@lovrabet/rabetbase-cli 2.0.2-beta.6 → 2.0.2-beta.7
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 -0
- 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 -0
- package/lib/telemetry/otel-logger-version.js +1 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
- 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 +2 -1
package/lib/commands/skill.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x57874f=a62_0x34ee;function a62_0x15d5(){const _0xb70642=['1494687NjyckM','10185570LhFLVW','818837dxqIwR','Install\x20skill\x20packages','skill-install','cwd','pipe','install','935976TXLAfU','2630vAoaGb','inherit','logger','2uKQjGG','nonInteractive','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','15dOXSbQ','8383599GNAVcW','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','info','log','rabetbase\x20skill\x20installed','154814LTbKiz','1196328rQOxGF','unknown','Check\x20network\x20connectivity\x20and\x20try\x20again.','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','setLogPath','skill','8ciMcsd','error'];a62_0x15d5=function(){return _0xb70642;};return a62_0x15d5();}(function(_0x5c089d,_0x31d58f){const _0x5f3196=a62_0x34ee,_0x1f845d=_0x5c089d();while(!![]){try{const _0x13a437=parseInt(_0x5f3196(0x14a))/0x1*(parseInt(_0x5f3196(0x154))/0x2)+parseInt(_0x5f3196(0x148))/0x3+parseInt(_0x5f3196(0x140))/0x4+-parseInt(_0x5f3196(0x157))/0x5*(-parseInt(_0x5f3196(0x150))/0x6)+parseInt(_0x5f3196(0x158))/0x7*(parseInt(_0x5f3196(0x146))/0x8)+parseInt(_0x5f3196(0x149))/0x9+-parseInt(_0x5f3196(0x151))/0xa*(parseInt(_0x5f3196(0x13f))/0xb);if(_0x13a437===_0x31d58f)break;else _0x1f845d['push'](_0x1f845d['shift']());}catch(_0x2cce93){_0x1f845d['push'](_0x1f845d['shift']());}}}(a62_0x15d5,0xadd7d));import{skillsCommand as a62_0x1e5063}from'../skills/main.js';import{CliErrors}from'../errors.js';function a62_0x34ee(_0x51fd75,_0x3ff588){_0x51fd75=_0x51fd75-0x13c;const _0x15d51f=a62_0x15d5();let _0x34eed3=_0x15d51f[_0x51fd75];return _0x34eed3;}export const skillCommand={'name':a62_0x57874f(0x145),'description':a62_0x57874f(0x14b),async 'run'(_0xf574c,_0xebb743,_0x5f5830){const _0x438796=a62_0x57874f,_0x3d4b9a=_0xebb743[0x0];if(_0x3d4b9a===_0x438796(0x14f)){_0xf574c['logger'][_0x438796(0x144)](process[_0x438796(0x14d)]()),_0xf574c[_0x438796(0x153)][_0x438796(0x13c)](_0x438796(0x14c),_0x438796(0x156));const {runNpxSkillsAddGlobal:_0x4f28c3}=await import('../skills/npx-skills-add.js'),_0x22eda1=_0xf574c[_0x438796(0x155)]?_0x438796(0x14e):_0x438796(0x152);console[_0x438796(0x13d)](_0x438796(0x143));const _0x430276=_0x4f28c3(process[_0x438796(0x14d)](),'lovrabet/rabetbase',{'stdio':_0x22eda1});if(_0x430276['skipped'])console[_0x438796(0x13d)](_0x438796(0x159));else{if(_0x430276['ok'])console[_0x438796(0x13d)](_0x438796(0x13e));else throw CliErrors['apiError']('npx\x20skills\x20add\x20failed:\x20'+(_0x430276[_0x438796(0x147)]||_0x438796(0x141)),_0x438796(0x142));}}else await a62_0x1e5063(_0x3d4b9a,[],_0x5f5830);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a63_0x73e1(_0x4fd590,_0x2bca29){_0x4fd590=_0x4fd590-0x7e;const _0x4d1117=a63_0x4d11();let _0x73e1f=_0x4d1117[_0x4fd590];return _0x73e1f;}const a63_0xa87fae=a63_0x73e1;(function(_0x52f582,_0x59b318){const _0x40e487=a63_0x73e1,_0x44e2ae=_0x52f582();while(!![]){try{const _0x139b7e=-parseInt(_0x40e487(0x87))/0x1+parseInt(_0x40e487(0x86))/0x2+parseInt(_0x40e487(0x8e))/0x3+parseInt(_0x40e487(0x81))/0x4+-parseInt(_0x40e487(0x85))/0x5*(parseInt(_0x40e487(0x84))/0x6)+-parseInt(_0x40e487(0x80))/0x7+-parseInt(_0x40e487(0x8b))/0x8*(-parseInt(_0x40e487(0x83))/0x9);if(_0x139b7e===_0x59b318)break;else _0x44e2ae['push'](_0x44e2ae['shift']());}catch(_0x42540e){_0x44e2ae['push'](_0x44e2ae['shift']());}}}(a63_0x4d11,0x93608));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_0xa87fae(0x82),'command':a63_0xa87fae(0x8c),'description':a63_0xa87fae(0x90),'risk':'read','flags':[SQLCODE_FLAG,{'name':a63_0xa87fae(0x93),'type':a63_0xa87fae(0x88),'description':a63_0xa87fae(0x8a)}],async 'execute'(_0x54bc27){const _0x28a3ab=a63_0xa87fae,_0x130cce=await getSqlQueryInfo(_0x54bc27[_0x28a3ab(0x92)],_0x54bc27[_0x28a3ab(0x8d)]('sqlcode')),_0x3ccf03=_0x54bc27['bool']('verbose');if(_0x3ccf03)return{'ok':!![],'data':_0x130cce};const _0xea14ee=_0x130cce[_0x28a3ab(0x7f)]?await getDbName(_0x54bc27[_0x28a3ab(0x92)],_0x130cce[_0x28a3ab(0x7f)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x130cce[_0x28a3ab(0x89)],'sqlName':_0x130cce[_0x28a3ab(0x7e)],'db':_0xea14ee?_0xea14ee+'\x20('+_0x130cce['dbId']+')':_0x130cce['dbId']??'','description':_0x130cce[_0x28a3ab(0x91)]??'','sqlContent':_0x130cce[_0x28a3ab(0x8f)]??''}};}};function a63_0x4d11(){const _0x450f0f=['detail','str','1640139jxqdGy','sqlContent','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','description','appCode','verbose','sqlName','dbId','3864588QOBJpG','935596rMFsAw','sql','54OCfgbg','7197774dAbosh','5onENDa','407932QzWlsq','516755ScigtO','boolean','sqlCode','Return\x20full\x20raw\x20SQL\x20query\x20object','2516728AsiCjW'];a63_0x4d11=function(){return _0x450f0f;};return a63_0x4d11();}
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a64_0xcefe0a=a64_0x104f;(function(_0x22cb99,_0x2d63a8){const _0x42baef=a64_0x104f,_0x27d67e=_0x22cb99();while(!![]){try{const _0x21b2d0=-parseInt(_0x42baef(0x193))/0x1+-parseInt(_0x42baef(0x18f))/0x2*(parseInt(_0x42baef(0x1a5))/0x3)+-parseInt(_0x42baef(0x1a9))/0x4*(-parseInt(_0x42baef(0x1a2))/0x5)+parseInt(_0x42baef(0x192))/0x6+-parseInt(_0x42baef(0x194))/0x7+parseInt(_0x42baef(0x19d))/0x8+-parseInt(_0x42baef(0x1a6))/0x9*(-parseInt(_0x42baef(0x19f))/0xa);if(_0x21b2d0===_0x2d63a8)break;else _0x27d67e['push'](_0x27d67e['shift']());}catch(_0x5d31d0){_0x27d67e['push'](_0x27d67e['shift']());}}}(a64_0x3a56,0x7b4cd));import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a64_0x104f(_0x36ca1f,_0x252030){_0x36ca1f=_0x36ca1f-0x18e;const _0x3a564a=a64_0x3a56();let _0x104f91=_0x3a564a[_0x36ca1f];return _0x104f91;}import{SQLCODE_FLAG}from'../common/flags.js';function a64_0x3a56(){const _0x13eae0=['validation','5IgtrjU','sql','\x20row(s)\x20in\x20','57HJygAu','131148HYQPlY','exec','parse','3060044yUJFoU','string','50708ajfycR','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','execSuccess','3174744KeHQzB','635358JLzAWF','5275816hWJMHj','str','length','now','appCode','Returned\x20','params','Invalid\x20JSON\x20for\x20--params:\x20','sqlcode','5972144HVjGOW','execResult','230zPUEzT','SQL\x20execution\x20failed'];a64_0x3a56=function(){return _0x13eae0;};return a64_0x3a56();}export const sqlExec={'service':a64_0xcefe0a(0x1a3),'command':a64_0xcefe0a(0x1a7),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a64_0xcefe0a(0x19a),'type':a64_0xcefe0a(0x18e),'description':a64_0xcefe0a(0x190)}],async 'execute'(_0x598ea9){const _0x542437=a64_0xcefe0a;let _0x6d8950;const _0x113eb5=_0x598ea9[_0x542437(0x195)](_0x542437(0x19a));if(_0x113eb5)try{_0x6d8950=JSON[_0x542437(0x1a8)](_0x113eb5);}catch{throw CliErrors[_0x542437(0x1a1)](_0x542437(0x19b)+_0x113eb5);}const _0x46fb9c=Date[_0x542437(0x197)](),_0x45e431=await executeSql(_0x598ea9[_0x542437(0x198)],_0x598ea9[_0x542437(0x195)](_0x542437(0x19c)),_0x6d8950),_0x4d11d1=Date[_0x542437(0x197)]()-_0x46fb9c,_0x2a47a3=_0x45e431?.[_0x542437(0x19e)]??_0x45e431,_0x5028c6=_0x45e431?.[_0x542437(0x191)]??!![];if(!_0x5028c6)return{'ok':![],'data':{'error':_0x45e431?.['execError']||'SQL\x20execution\x20failed','elapsed':_0x4d11d1},'message':_0x542437(0x1a0)};const _0x1bf1bd=Array['isArray'](_0x2a47a3)?_0x2a47a3:[];return{'ok':!![],'data':{'rows':_0x1bf1bd,'rowCount':_0x1bf1bd[_0x542437(0x196)],'elapsed':_0x4d11d1},'message':_0x542437(0x199)+_0x1bf1bd['length']+_0x542437(0x1a4)+_0x4d11d1+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a96eb,_0x5c787d){const _0x323bc1=a65_0x11bd,_0x17d0ca=_0x1a96eb();while(!![]){try{const _0x34c85f=parseInt(_0x323bc1(0x189))/0x1+-parseInt(_0x323bc1(0x185))/0x2*(parseInt(_0x323bc1(0x18a))/0x3)+parseInt(_0x323bc1(0x182))/0x4*(parseInt(_0x323bc1(0x186))/0x5)+-parseInt(_0x323bc1(0x183))/0x6+parseInt(_0x323bc1(0x184))/0x7+parseInt(_0x323bc1(0x188))/0x8+-parseInt(_0x323bc1(0x187))/0x9;if(_0x34c85f===_0x5c787d)break;else _0x17d0ca['push'](_0x17d0ca['shift']());}catch(_0xff9e98){_0x17d0ca['push'](_0x17d0ca['shift']());}}}(a65_0x5d56,0x770e6));import{sqlList}from'./list.js';import{sqlDetail}from'./detail.js';import{sqlValidate}from'./validate.js';import{sqlSave}from'./save.js';function a65_0x5d56(){const _0x19e09e=['6596SvSUPt','2051850lYsDuN','3868396lSncYh','13434iuYbHL','2190zBBiOy','14962194DSHSiI','6898088jsHCKt','428831TDABts','33sYZDDB'];a65_0x5d56=function(){return _0x19e09e;};return a65_0x5d56();}function a65_0x11bd(_0x1310d7,_0x55ff69){_0x1310d7=_0x1310d7-0x182;const _0x5d562d=a65_0x5d56();let _0x11bd0a=_0x5d562d[_0x1310d7];return _0x11bd0a;}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_0x1b16d4=a66_0x2e42;function a66_0x2e42(_0x2ad6ac,_0x42b8df){_0x2ad6ac=_0x2ad6ac-0x6a;const _0x1a669a=a66_0x1a66();let _0x2e4265=_0x1a669a[_0x2ad6ac];return _0x2e4265;}(function(_0x249c34,_0x23c445){const _0x3e9e77=a66_0x2e42,_0x18995a=_0x249c34();while(!![]){try{const _0x4ab0ff=parseInt(_0x3e9e77(0x86))/0x1+parseInt(_0x3e9e77(0x73))/0x2+-parseInt(_0x3e9e77(0x7d))/0x3+-parseInt(_0x3e9e77(0x6e))/0x4*(parseInt(_0x3e9e77(0x81))/0x5)+-parseInt(_0x3e9e77(0x85))/0x6*(parseInt(_0x3e9e77(0x74))/0x7)+-parseInt(_0x3e9e77(0x76))/0x8+parseInt(_0x3e9e77(0x77))/0x9;if(_0x4ab0ff===_0x23c445)break;else _0x18995a['push'](_0x18995a['shift']());}catch(_0x2c43e0){_0x18995a['push'](_0x18995a['shift']());}}}(a66_0x1a66,0x69de3));function a66_0x1a66(){const _0x289766=['dbId','tableData','2220813qrCmvX','sqlCode','paging','num','538075rUKcsw','boolean','Page\x20number','description','478722EkzZXB','249913VAPZte','appCode','page','verbose','Page\x20size','sql','str','\x20SQL\x20queries\x20(total:\x20','length','sqlName','totalCount','28UKBxtr','list','Filter\x20by\x20SQL\x20name','number','bool','205930hssRew','42QIfugR','string','1691216ehzFmH','20380113JvkXPo','pagesize','name','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'];a66_0x1a66=function(){return _0x289766;};return a66_0x1a66();}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_0x1b16d4(0x8b),'command':a66_0x1b16d4(0x6f),'description':'List\x20custom\x20SQL\x20queries','risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a66_0x1b16d4(0x79),'type':a66_0x1b16d4(0x75),'description':a66_0x1b16d4(0x70)},{'name':a66_0x1b16d4(0x88),'type':a66_0x1b16d4(0x71),'description':a66_0x1b16d4(0x83),'default':0x1},{'name':a66_0x1b16d4(0x78),'type':a66_0x1b16d4(0x71),'description':a66_0x1b16d4(0x8a)},{'name':'verbose','type':a66_0x1b16d4(0x82),'description':a66_0x1b16d4(0x7a)}],async 'execute'(_0x2b11bc){const _0x1bfedf=a66_0x1b16d4,_0x48019a=await listSqlQueries(_0x2b11bc[_0x1bfedf(0x87)],{'sqlCode':_0x2b11bc[_0x1bfedf(0x8c)]('sqlcode')||undefined,'sqlName':_0x2b11bc['str'](_0x1bfedf(0x79))||undefined,'currentPage':_0x2b11bc['num']('page'),'pageSize':_0x2b11bc[_0x1bfedf(0x80)](_0x1bfedf(0x78),0x32)}),_0x147c43=_0x2b11bc[_0x1bfedf(0x72)](_0x1bfedf(0x89)),_0x12b31a=_0x48019a[_0x1bfedf(0x7c)]??[],_0x4bc6cb=_0x48019a[_0x1bfedf(0x7f)]?.[_0x1bfedf(0x6d)]??_0x12b31a[_0x1bfedf(0x6b)];let _0x5033a5;return _0x147c43?_0x5033a5=_0x12b31a:_0x5033a5=await Promise['all'](_0x12b31a['map'](async _0x42d31d=>{const _0x116867=_0x1bfedf,_0x5ae445=_0x42d31d[_0x116867(0x7b)]?await getDbName(_0x2b11bc[_0x116867(0x87)],_0x42d31d['dbId']):undefined;return{'sqlCode':_0x42d31d[_0x116867(0x7e)],'sqlName':_0x42d31d[_0x116867(0x6c)],'description':_0x42d31d[_0x116867(0x84)]??'','db':_0x5ae445?_0x5ae445+'\x20('+_0x42d31d['dbId']+')':_0x42d31d[_0x116867(0x7b)]??''};})),{'ok':!![],'data':_0x5033a5,'message':_0x12b31a[_0x1bfedf(0x6b)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x12b31a['length']+_0x1bfedf(0x6a)+_0x4bc6cb+').'};}};
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a67_0x41ef21=a67_0x3292;function a67_0x489a(){const _0x459a9f=['dbId','cwd','3691348DVnfrb','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','sqlname','POST','string','\x20successfully','write','SQL\x20validation\x20failed:\x20','join','dbName','str','351776KUmHUC','parameters','sqlCode','Validation:\x20','action','7188356VQQBcn','utf-8','validation','sqlType','sqlName','message','821052FmJHVK','length','none','valid','sqlcode','SQL\x20query\x20display\x20name','Conflict\x20detected','/api/node-toolbox/sql/save','\x20|\x20Tables:\x20','\x20chars)','Path\x20to\x20the\x20SQL\x20file','file','created','Save\x20SQL\x20query\x20from\x20','SQL\x20query\x20description','Created','6brCOxd','appCode','2phmynn','sql','4114045kGZQEn','N/A','1137998ypeCLw','description','2150106TQnYpx','tables','type','80eovTsQ'];a67_0x489a=function(){return _0x459a9f;};return a67_0x489a();}(function(_0x4be4d9,_0x28fffd){const _0x4d7502=a67_0x3292,_0x233a2a=_0x4be4d9();while(!![]){try{const _0x20a12b=parseInt(_0x4d7502(0xe5))/0x1+-parseInt(_0x4d7502(0xe1))/0x2*(parseInt(_0x4d7502(0xe7))/0x3)+-parseInt(_0x4d7502(0xed))/0x4+-parseInt(_0x4d7502(0xe3))/0x5*(-parseInt(_0x4d7502(0xdf))/0x6)+parseInt(_0x4d7502(0xc9))/0x7+parseInt(_0x4d7502(0xc4))/0x8+parseInt(_0x4d7502(0xcf))/0x9*(-parseInt(_0x4d7502(0xea))/0xa);if(_0x20a12b===_0x28fffd)break;else _0x233a2a['push'](_0x233a2a['shift']());}catch(_0x1da02e){_0x233a2a['push'](_0x233a2a['shift']());}}}(a67_0x489a,0xa1b34));function a67_0x3292(_0x3a076a,_0x3c1ce7){_0x3a076a=_0x3a076a-0xbd;const _0x489adc=a67_0x489a();let _0x32928f=_0x489adc[_0x3a076a];return _0x32928f;}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';import{SQLCODE_FLAG_OPTIONAL}from'../common/flags.js';export const sqlSave={'service':a67_0x41ef21(0xe2),'command':'save','description':a67_0x41ef21(0xee),'risk':a67_0x41ef21(0xbf),'flags':[{'name':a67_0x41ef21(0xda),'type':a67_0x41ef21(0xbd),'required':!![],'description':a67_0x41ef21(0xd9)},SQLCODE_FLAG_OPTIONAL,{'name':a67_0x41ef21(0xef),'type':'string','description':a67_0x41ef21(0xd4)},{'name':'db','type':a67_0x41ef21(0xbd),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a67_0x41ef21(0xe6),'type':'string','description':a67_0x41ef21(0xdd)}],async 'validate'(_0x31768){const _0x5da8cc=a67_0x41ef21,_0x33f6b3=resolve(process[_0x5da8cc(0xec)](),_0x31768[_0x5da8cc(0xc3)](_0x5da8cc(0xda)));if(!existsSync(_0x33f6b3))throw CliErrors[_0x5da8cc(0xcb)]('File\x20not\x20found:\x20'+_0x33f6b3);const _0x497c4a=readFileSync(_0x33f6b3,_0x5da8cc(0xca)),_0x369fc0=validateSql(_0x497c4a);if(!_0x369fc0[_0x5da8cc(0xd2)])throw CliErrors[_0x5da8cc(0xcb)](_0x5da8cc(0xc0)+_0x369fc0[_0x5da8cc(0xce)]);},async 'dryRun'(_0x1c7030){const _0x16435b=a67_0x41ef21,_0x25a9f0=resolve(process[_0x16435b(0xec)](),_0x1c7030[_0x16435b(0xc3)](_0x16435b(0xda))),_0x167097=readFileSync(_0x25a9f0,_0x16435b(0xca)),_0x16aa57=validateSql(_0x167097),_0x590bd4=_0x1c7030[_0x16435b(0xc3)]('db')||undefined,{db:_0x245d10,error:_0x1de98f}=await resolveOneDb(_0x1c7030[_0x16435b(0xe0)],_0x590bd4);return{'method':_0x16435b(0xf0),'url':_0x16435b(0xd6),'body':{'appCode':_0x1c7030['appCode'],'sqlContent':'('+_0x167097[_0x16435b(0xd0)]+_0x16435b(0xd8),'sqlCode':_0x1c7030[_0x16435b(0xc3)]('sqlcode')||undefined,'sqlName':_0x1c7030[_0x16435b(0xc3)](_0x16435b(0xef))||undefined,'db':_0x245d10?_0x245d10[_0x16435b(0xc2)]+'\x20('+_0x245d10[_0x16435b(0xeb)]+')':_0x1de98f},'description':[_0x16435b(0xdc)+_0x1c7030[_0x16435b(0xc3)](_0x16435b(0xda)),_0x16435b(0xc7)+_0x16aa57[_0x16435b(0xce)],'Type:\x20'+_0x16aa57[_0x16435b(0xcc)][_0x16435b(0xe9)]+_0x16435b(0xd7)+(_0x16aa57[_0x16435b(0xe8)]['join'](',\x20')||_0x16435b(0xe4))+'\x20|\x20Params:\x20'+(_0x16aa57[_0x16435b(0xc5)][_0x16435b(0xc1)](',\x20')||_0x16435b(0xd1))]['join']('\x0a')};},async 'execute'(_0x3b2f61){const _0x1bc706=a67_0x41ef21,_0x303486=resolve(process[_0x1bc706(0xec)](),_0x3b2f61['str'](_0x1bc706(0xda))),_0x20cede=readFileSync(_0x303486,_0x1bc706(0xca)),_0x6e04bc=_0x3b2f61[_0x1bc706(0xc3)]('db')||undefined,{db:_0x3ae68c,error:_0x542d32}=await resolveOneDb(_0x3b2f61[_0x1bc706(0xe0)],_0x6e04bc);if(_0x542d32)throw CliErrors[_0x1bc706(0xcb)](_0x542d32);const _0x2d2591=await saveSqlQuery({'appCode':_0x3b2f61['appCode'],'sqlContent':_0x20cede,'sqlCode':_0x3b2f61[_0x1bc706(0xc3)](_0x1bc706(0xd3))||undefined,'sqlName':_0x3b2f61['str'](_0x1bc706(0xef))||undefined,'dbId':_0x3ae68c[_0x1bc706(0xeb)],'description':_0x3b2f61['str'](_0x1bc706(0xe6))||undefined});if(_0x2d2591['blocked'])return{'ok':![],'data':_0x2d2591,'message':_0x2d2591[_0x1bc706(0xce)]||_0x1bc706(0xd5)};return{'ok':!![],'data':{'sqlCode':_0x2d2591[_0x1bc706(0xc6)],'sqlName':_0x2d2591[_0x1bc706(0xcd)],'action':_0x2d2591[_0x1bc706(0xc8)]},'message':(_0x2d2591[_0x1bc706(0xc8)]===_0x1bc706(0xdb)?_0x1bc706(0xde):'Updated')+_0x1bc706(0xbe)+(_0x2d2591[_0x1bc706(0xc6)]?'\x20('+_0x2d2591[_0x1bc706(0xc6)]+')':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a68_0x52f5b4=a68_0x3df9;function a68_0xdce8(){const _0x1d5f97=['36WFgnvt','validate','map','reason','toLowerCase','length','get','35827froVsD','4612626cgkXkY','128063TDgRey','103557RQnpPK','schema:','696rxLekc','file','2362myKYuD','utf-8','string','sql','validation','schemaWarnings','type','4PZPKuH','tableName','valid','56lbjetU','push','isArray','isDangerous','113057itLjmL','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','\x22\x20not\x20found\x20or\x20not\x20accessible','size','fields','17645RcHaKy','str','split','name','271UwGSLU','message','Dataset\x20\x22','sqlType','Provide\x20--file\x20or\x20--sql','1190KNrEcc','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','dbtableConfig','File\x20not\x20found:\x20','isSelectOnly','Table\x20\x22','trim'];a68_0xdce8=function(){return _0x1d5f97;};return a68_0xdce8();}(function(_0x4da3ff,_0x22f541){const _0x13bc63=a68_0x3df9,_0x45ed4c=_0x4da3ff();while(!![]){try{const _0x2508cd=-parseInt(_0x13bc63(0xe0))/0x1*(parseInt(_0x13bc63(0xc9))/0x2)+parseInt(_0x13bc63(0xf6))/0x3*(parseInt(_0x13bc63(0xd0))/0x4)+parseInt(_0x13bc63(0xdc))/0x5*(parseInt(_0x13bc63(0xec))/0x6)+parseInt(_0x13bc63(0xd7))/0x7*(parseInt(_0x13bc63(0xd3))/0x8)+-parseInt(_0x13bc63(0xf4))/0x9+-parseInt(_0x13bc63(0xe5))/0xa*(-parseInt(_0x13bc63(0xf3))/0xb)+parseInt(_0x13bc63(0xf8))/0xc*(parseInt(_0x13bc63(0xf5))/0xd);if(_0x2508cd===_0x22f541)break;else _0x45ed4c['push'](_0x45ed4c['shift']());}catch(_0x4e8a65){_0x45ed4c['push'](_0x45ed4c['shift']());}}}(a68_0xdce8,0x480d6));function a68_0x3df9(_0x66577d,_0x593f31){_0x66577d=_0x66577d-0xc9;const _0xdce83e=a68_0xdce8();let _0x3df95e=_0xdce83e[_0x66577d];return _0x3df95e;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a68_0x52f5b4(0xcc),'command':a68_0x52f5b4(0xed),'description':'Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','risk':'read','flags':[{'name':a68_0x52f5b4(0xf9),'type':a68_0x52f5b4(0xcb),'description':a68_0x52f5b4(0xe6)},{'name':'sql','type':a68_0x52f5b4(0xcb),'description':a68_0x52f5b4(0xd8)},{'name':'schemas','type':a68_0x52f5b4(0xcb),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x3d073d){const _0x43b69b=a68_0x52f5b4,_0x4df354=_0x3d073d[_0x43b69b(0xdd)](_0x43b69b(0xf9)),_0x24bd74=_0x3d073d[_0x43b69b(0xdd)]('sql');if(!_0x4df354&&!_0x24bd74)throw CliErrors['flagMissing'](_0x43b69b(0xf9),_0x43b69b(0xe4));let _0x3ff694;if(_0x4df354){const _0x191d1d=resolve(process['cwd'](),_0x4df354);if(!existsSync(_0x191d1d))throw CliErrors[_0x43b69b(0xcd)](_0x43b69b(0xe8)+_0x191d1d);_0x3ff694=readFileSync(_0x191d1d,_0x43b69b(0xca));}else _0x3ff694=_0x24bd74;const _0x20a538=validateSql(_0x3ff694),_0x10258d={'valid':_0x20a538[_0x43b69b(0xd2)],'sqlType':_0x20a538[_0x43b69b(0xe3)][_0x43b69b(0xcf)],'isSelectOnly':_0x20a538[_0x43b69b(0xe3)][_0x43b69b(0xe9)],'isDangerous':_0x20a538[_0x43b69b(0xe3)][_0x43b69b(0xd6)],'tables':_0x20a538['tables'],'parameters':_0x20a538['parameters'],'message':_0x20a538['message']};_0x20a538['sqlType'][_0x43b69b(0xef)]&&(_0x10258d[_0x43b69b(0xef)]=_0x20a538[_0x43b69b(0xe3)]['reason']);const _0x280e92=_0x3d073d[_0x43b69b(0xdd)]('schemas');if(_0x280e92&&_0x20a538[_0x43b69b(0xd2)]){const _0x15eeb4=_0x280e92[_0x43b69b(0xde)](',')[_0x43b69b(0xee)](_0x232947=>_0x232947[_0x43b69b(0xeb)]())['filter'](Boolean),_0x27f767=[],_0x4ee73e=await listDatasets(_0x3d073d['appCode']),_0x1314ef=new Map(_0x4ee73e[_0x43b69b(0xee)](_0x18183a=>[_0x18183a[_0x43b69b(0xe7)]?.['tableName']?.[_0x43b69b(0xf0)](),_0x18183a]));for(const _0x5308f3 of _0x20a538['tables']){const _0x5b8690=_0x1314ef[_0x43b69b(0xf2)](_0x5308f3[_0x43b69b(0xf0)]());!_0x5b8690&&_0x27f767[_0x43b69b(0xd4)](_0x43b69b(0xea)+_0x5308f3+'\x22\x20not\x20found\x20in\x20any\x20dataset');}for(const _0x37dca1 of _0x15eeb4){try{const _0x41a9a3=await getDatasetDetail(_0x37dca1),_0x27ac3e=Array[_0x43b69b(0xd5)](_0x41a9a3[_0x43b69b(0xdb)])?_0x41a9a3[_0x43b69b(0xdb)]:[],_0x5d203d=new Set(_0x27ac3e['map'](_0x500dbc=>_0x500dbc[_0x43b69b(0xdf)]?.[_0x43b69b(0xf0)]())),_0x4a6625=_0x41a9a3[_0x43b69b(0xe7)]?.[_0x43b69b(0xd1)]||_0x41a9a3[_0x43b69b(0xd1)]||_0x37dca1;_0x10258d[_0x43b69b(0xf7)+_0x4a6625]={'code':_0x37dca1,'tableName':_0x4a6625,'fieldCount':_0x5d203d[_0x43b69b(0xda)],'fields':Array['from'](_0x5d203d)};}catch{_0x27f767[_0x43b69b(0xd4)](_0x43b69b(0xe2)+_0x37dca1+_0x43b69b(0xd9));}}_0x27f767[_0x43b69b(0xf1)]>0x0&&(_0x10258d[_0x43b69b(0xce)]=_0x27f767);}return{'ok':_0x20a538[_0x43b69b(0xd2)],'data':_0x10258d,'message':_0x20a538[_0x43b69b(0xe1)]};}};
|
package/lib/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a69_0x260576=a69_0x4499;(function(_0x312434,_0x4e077c){const _0x5cb1c2=a69_0x4499,_0x1c7bb8=_0x312434();while(!![]){try{const _0x3a04c9=-parseInt(_0x5cb1c2(0xdb))/0x1*(parseInt(_0x5cb1c2(0xea))/0x2)+-parseInt(_0x5cb1c2(0xdf))/0x3+-parseInt(_0x5cb1c2(0xdd))/0x4+-parseInt(_0x5cb1c2(0xe3))/0x5+-parseInt(_0x5cb1c2(0xec))/0x6*(-parseInt(_0x5cb1c2(0xe9))/0x7)+-parseInt(_0x5cb1c2(0xe4))/0x8+parseInt(_0x5cb1c2(0xe6))/0x9*(parseInt(_0x5cb1c2(0xdc))/0xa);if(_0x3a04c9===_0x4e077c)break;else _0x1c7bb8['push'](_0x1c7bb8['shift']());}catch(_0x4c70e6){_0x1c7bb8['push'](_0x1c7bb8['shift']());}}}(a69_0x1610,0xd9a99));import{execa}from'execa';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export async function runStart(_0x4dd18f){const _0x2d9aea=a69_0x4499,_0x352674=Date[_0x2d9aea(0xeb)](),_0x437b22=_0x4dd18f||process[_0x2d9aea(0xde)](),_0xc8d102=await checkCliVersion();_0xc8d102[_0x2d9aea(0xe8)]&&printCliUpgradeWarning(_0xc8d102);const _0x44a638=await checkSdkVersion(_0x437b22);_0x44a638[_0x2d9aea(0xe8)]&&printSdkUpgradeWarning(_0x44a638);try{await execa(_0x2d9aea(0xe0),[],{'cwd':_0x437b22,'stdio':_0x2d9aea(0xe1),'preferLocal':!![],'localDir':_0x437b22,'env':{...process['env']}});const _0x54ef09=Date[_0x2d9aea(0xeb)]()-_0x352674;void _0x54ef09;}catch(_0x273047){throw _0x273047;}}function a69_0x4499(_0x48b94a,_0x2128f3){_0x48b94a=_0x48b94a-0xda;const _0x1610a1=a69_0x1610();let _0x4499e0=_0x1610a1[_0x48b94a];return _0x4499e0;}function a69_0x1610(){const _0x44390a=['3288TykIVF','start','29Qiqgqq','97640VbRZbp','383472HdTlFl','cwd','5021331owRSff','vite','inherit','Start\x20development\x20server','594565lAYLWW','14005512ZsQASJ','启动开发服务器','3933UoaBmx','info','needsUpgrade','14560AsIEud','60408KwPRll','now'];a69_0x1610=function(){return _0x44390a;};return a69_0x1610();}export const startCommand={'name':a69_0x260576(0xda),'description':a69_0x260576(0xe2),async 'run'(_0x24d1fd,_0x416541,_0x214afe){const _0x5ef627=a69_0x260576;_0x24d1fd['logger'][_0x5ef627(0xe7)](_0x5ef627(0xda),_0x5ef627(0xe5)),await runStart();}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x49fd75,_0x5e5f3c){const _0x46648c=a70_0x3ddb,_0x66812f=_0x49fd75();while(!![]){try{const _0x587cff=-parseInt(_0x46648c(0xe3))/0x1+-parseInt(_0x46648c(0xe8))/0x2*(-parseInt(_0x46648c(0xda))/0x3)+parseInt(_0x46648c(0xd9))/0x4*(-parseInt(_0x46648c(0xe6))/0x5)+parseInt(_0x46648c(0xd4))/0x6*(parseInt(_0x46648c(0xdf))/0x7)+parseInt(_0x46648c(0xe0))/0x8+-parseInt(_0x46648c(0xd3))/0x9*(-parseInt(_0x46648c(0xdb))/0xa)+parseInt(_0x46648c(0xd6))/0xb*(-parseInt(_0x46648c(0xdd))/0xc);if(_0x587cff===_0x5e5f3c)break;else _0x66812f['push'](_0x66812f['shift']());}catch(_0x2344a5){_0x66812f['push'](_0x66812f['shift']());}}}(a70_0x44d8,0x703cf));import{jsxs as a70_0x224f39,jsx as a70_0x2604d1}from'react/jsx-runtime';function a70_0x3ddb(_0x4f243b,_0x4669a0){_0x4f243b=_0x4f243b-0xd2;const _0x44d8c9=a70_0x44d8();let _0x3ddbc8=_0x44d8c9[_0x4f243b];return _0x3ddbc8;}import{Box,Text}from'ink';import{CLI_BIN_NAME}from'../constant/cli.js';export function ConfigHelp(){const _0x32286a=a70_0x3ddb,_0x105ecc=[{'command':CLI_BIN_NAME+_0x32286a(0xd5),'description':'Set\x20a\x20config\x20value'},{'command':CLI_BIN_NAME+_0x32286a(0xe9),'description':_0x32286a(0xde)},{'command':CLI_BIN_NAME+_0x32286a(0xdc),'description':_0x32286a(0xe5)}],_0x3502f5=[{'command':CLI_BIN_NAME+'\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','description':'Set\x20App\x20Code\x20for\x20current\x20project'},{'command':CLI_BIN_NAME+_0x32286a(0xea),'description':'Set\x20environment\x20(production/daily)'},{'command':CLI_BIN_NAME+_0x32286a(0xe7),'description':'Set\x20display\x20language\x20(zh/en)'}];return a70_0x224f39(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a70_0x2604d1(Box,{'marginBottom':0x1,'children':a70_0x224f39(Text,{'color':'gray','children':['\x20','!','\x20\x20','Invalid\x20command.\x20Available\x20commands:']})}),_0x105ecc[_0x32286a(0xe2)](_0x213edc=>a70_0x224f39(Box,{'children':[a70_0x224f39(Text,{'children':[_0x32286a(0xe1),_0x213edc['command']]}),a70_0x2604d1(Text,{'color':_0x32286a(0xd2),'children':_0x213edc[_0x32286a(0xd8)]})]},_0x213edc[_0x32286a(0xd7)])),a70_0x2604d1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a70_0x224f39(Text,{'color':_0x32286a(0xd2),'children':['\x20*\x20',_0x32286a(0xe4)]})}),_0x3502f5['map'](_0x325aea=>a70_0x224f39(Box,{'children':[a70_0x224f39(Text,{'children':[_0x32286a(0xe1),_0x325aea[_0x32286a(0xd7)]]}),a70_0x2604d1(Text,{'color':_0x32286a(0xd2),'children':_0x325aea[_0x32286a(0xd8)]})]},_0x325aea[_0x32286a(0xd7)]))]});}function a70_0x44d8(){const _0x512f8e=['14PVNheO','3512336GQcdqx','\x20\x20\x20\x20','map','420629kknxBm','Examples:','List\x20all\x20config\x20values','60iARnQi','\x20config\x20set\x20locale\x20en\x20\x20\x20\x20\x20\x20\x20','2ZKVKhc','\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','gray','565119ypdeoA','2367810YXWNTn','\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','2739jbWCRQ','command','description','223688xtpUPi','1628409hcZclP','40skaPUJ','\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','22692PSRzBt','Get\x20a\x20config\x20value'];a70_0x44d8=function(){return _0x512f8e;};return a70_0x44d8();}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a71_0x401587=a71_0x4321;(function(_0x1b5e42,_0x544b7d){const _0x81255=a71_0x4321,_0x171a42=_0x1b5e42();while(!![]){try{const _0x3c9546=parseInt(_0x81255(0x14f))/0x1*(parseInt(_0x81255(0x156))/0x2)+parseInt(_0x81255(0x172))/0x3+-parseInt(_0x81255(0x16d))/0x4*(parseInt(_0x81255(0x159))/0x5)+-parseInt(_0x81255(0x173))/0x6*(-parseInt(_0x81255(0x168))/0x7)+-parseInt(_0x81255(0x15b))/0x8*(parseInt(_0x81255(0x161))/0x9)+parseInt(_0x81255(0x14b))/0xa+-parseInt(_0x81255(0x153))/0xb*(parseInt(_0x81255(0x14a))/0xc);if(_0x3c9546===_0x544b7d)break;else _0x171a42['push'](_0x171a42['shift']());}catch(_0x39c7f5){_0x171a42['push'](_0x171a42['shift']());}}}(a71_0x1439,0xf41be));import{jsx as a71_0x5c354b,jsxs as a71_0x59689c}from'react/jsx-runtime';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig}from'../utils/config.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function a71_0x4321(_0x5e0634,_0x2b17b7){_0x5e0634=_0x5e0634-0x14a;const _0x14393=a71_0x1439();let _0x432188=_0x14393[_0x5e0634];return _0x432188;}function a71_0x1439(){const _0x25fb46=['get','Global','Invalid\x20locale\x20value.\x20Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','input','4618896qmZaje','4169166TZQIIb','toLowerCase','flags','15036rFJxkG','4322360czzfht','env\x20value\x20must\x20be\x20\x22production\x22\x20or\x20\x22daily\x22','log','list','59823qdKPCW','stringify','message','--help','22473cswFPs','column','appcode','18uQDpuV','\x20locale\x20set\x20to:\x20','global','15JHBtgD','Config\x20value\x20is\x20invalid\x20or\x20too\x20long','1201896MBBchs','length','保存配置失败','undefined','error','app','9SIfaBs','help','red','locale','en-US','includes','Failed\x20to\x20save\x20config','14dGRvLa','env','string','online','zh-CN','253348zPnMpd'];a71_0x1439=function(){return _0x25fb46;};return a71_0x1439();}import{logger}from'../utils/logger.js';const LOCALE_MAP={'zh':'zh-CN','zh-cn':'zh-CN','zh_cn':a71_0x401587(0x16c),'en':'en-US','en-us':a71_0x401587(0x165),'en_us':'en-US'};function normalizeLocale(_0x5b1456){const _0x37e036=a71_0x401587;if(!_0x5b1456)return null;return LOCALE_MAP[_0x5b1456[_0x37e036(0x174)]()]??null;}export function Config(_0x7b8f4e){const _0x2db8ed=a71_0x401587,{cli:_0x345722}=_0x7b8f4e,_0x9e8067=_0x345722[_0x2db8ed(0x171)][0x1],_0x39f4e3=_0x345722[_0x2db8ed(0x171)][0x2],_0x43cd9e=['set',_0x2db8ed(0x16e)][_0x2db8ed(0x166)](_0x9e8067||''),_0xe86dc9=_0x345722[_0x2db8ed(0x171)][_0x2db8ed(0x15c)]>=0x3;if(_0x39f4e3===_0x2db8ed(0x152)||_0x345722[_0x2db8ed(0x175)][_0x2db8ed(0x162)])return a71_0x5c354b(ConfigHelp,{});const _0x58aa7b=readConfig();if(_0x9e8067==='set'){if(_0x39f4e3){const _0x17860c=_0x345722[_0x2db8ed(0x171)][0x3];if(typeof _0x17860c!==_0x2db8ed(0x15e)){if(_0x39f4e3===_0x2db8ed(0x169)&&![_0x2db8ed(0x16b),'production','daily'][_0x2db8ed(0x166)](_0x17860c))return a71_0x5c354b(Box,{'children':a71_0x5c354b(Text,{'color':_0x2db8ed(0x163),'children':_0x2db8ed(0x14c)})});if(_0x39f4e3===_0x2db8ed(0x164)&&!normalizeLocale(_0x17860c))return a71_0x5c354b(Box,{'flexDirection':_0x2db8ed(0x154),'children':a71_0x5c354b(Text,{'color':'red','children':_0x2db8ed(0x170)})});const _0x153900=_0x345722[_0x2db8ed(0x175)][_0x2db8ed(0x158)]?_0x2db8ed(0x158):isInProject()?'project':_0x2db8ed(0x158),_0x3da2f8=resolveWriteConfigPath(_0x153900);let _0x3ae3f9=readConfigFile(_0x3da2f8);if(typeof _0x17860c!==_0x2db8ed(0x16a)||_0x17860c[_0x2db8ed(0x15c)]>0x1f4)return a71_0x5c354b(Box,{'children':a71_0x5c354b(Text,{'color':_0x2db8ed(0x163),'children':_0x2db8ed(0x15a)})});let _0x5809eb=_0x39f4e3,_0x3f8be5=_0x17860c;_0x39f4e3===_0x2db8ed(0x160)&&(_0x5809eb=_0x2db8ed(0x155),delete _0x3ae3f9[_0x2db8ed(0x160)]);_0x39f4e3===_0x2db8ed(0x155)&&delete _0x3ae3f9[_0x2db8ed(0x160)];_0x39f4e3==='locale'&&(_0x3f8be5=normalizeLocale(_0x17860c));_0x3ae3f9[_0x5809eb]=_0x3f8be5;try{writeConfigFile(_0x3da2f8,_0x3ae3f9);const _0x1c267e=_0x153900==='global'?_0x2db8ed(0x16f):'Project';_0x39f4e3===_0x2db8ed(0x169)&&console[_0x2db8ed(0x14d)]('✓\x20'+_0x1c267e+'\x20env\x20set\x20to:\x20'+_0x17860c);if(_0x39f4e3==='locale'){const _0x2efce6=normalizeLocale(_0x17860c);console[_0x2db8ed(0x14d)]('✓\x20'+_0x1c267e+_0x2db8ed(0x157)+_0x2efce6);}}catch(_0x3cb08c){return logger[_0x2db8ed(0x15f)]('config',_0x2db8ed(0x15d),{'error':_0x3cb08c instanceof Error?_0x3cb08c[_0x2db8ed(0x151)]:String(_0x3cb08c),'configKey':_0x39f4e3,'configValue':_0x17860c,'targetConfigPath':_0x3da2f8}),a71_0x5c354b(Box,{'children':a71_0x59689c(Text,{'color':_0x2db8ed(0x163),'children':[_0x2db8ed(0x167),':','\x20',_0x3cb08c instanceof Error?_0x3cb08c[_0x2db8ed(0x151)]:String(_0x3cb08c)]})});}return null;}return a71_0x5c354b(Box,{'children':a71_0x5c354b(Text,{'color':_0x2db8ed(0x163),'children':'No\x20config\x20value\x20provided'})});}}if(_0x9e8067==='get'){if(_0x39f4e3){let _0xd8eec6=_0x39f4e3;return _0x39f4e3===_0x2db8ed(0x160)&&(_0xd8eec6=_0x2db8ed(0x155)),console['log'](_0x58aa7b[_0xd8eec6]||_0x2db8ed(0x15e)),null;}return null;}if(_0x9e8067===_0x2db8ed(0x14e))return console[_0x2db8ed(0x14d)](JSON[_0x2db8ed(0x150)](_0x58aa7b,null,0x2)),null;if(!_0x43cd9e||!_0xe86dc9)return a71_0x5c354b(ConfigHelp,{});return null;}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a72_0x399656=a72_0x38cd;(function(_0x40ee33,_0x4eea3a){const _0x9c275=a72_0x38cd,_0x2f3c56=_0x40ee33();while(!![]){try{const _0x1af526=parseInt(_0x9c275(0x1d1))/0x1*(-parseInt(_0x9c275(0x1cf))/0x2)+parseInt(_0x9c275(0x1d7))/0x3+parseInt(_0x9c275(0x1d8))/0x4+-parseInt(_0x9c275(0x1d6))/0x5+parseInt(_0x9c275(0x1d5))/0x6+-parseInt(_0x9c275(0x1d4))/0x7*(parseInt(_0x9c275(0x1d2))/0x8)+parseInt(_0x9c275(0x1d0))/0x9;if(_0x1af526===_0x4eea3a)break;else _0x2f3c56['push'](_0x2f3c56['shift']());}catch(_0x376479){_0x2f3c56['push'](_0x2f3c56['shift']());}}}(a72_0x2995,0xcdb8e));function a72_0x2995(){const _0x1e47fa=['19139859DuYEnV','2bMLrUk','272zOxutK','@lovrabet/rabetbase-cli','335076JqWjSp','4425612allxnV','3718510tdCfAz','467097dawhHB','2726352LTdIgT','487688zHvXed'];a72_0x2995=function(){return _0x1e47fa;};return a72_0x2995();}export const CLI_BIN_NAME='rabetbase';function a72_0x38cd(_0x4f859f,_0x4d678d){_0x4f859f=_0x4f859f-0x1cf;const _0x299588=a72_0x2995();let _0x38cd90=_0x299588[_0x4f859f];return _0x38cd90;}export const NPM_PACKAGE_NAME=a72_0x399656(0x1d3);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a73_0x5bb4a3=a73_0x2cf0;(function(_0x458903,_0x3660e1){const _0x17090c=a73_0x2cf0,_0x282d5d=_0x458903();while(!![]){try{const _0x4c5109=-parseInt(_0x17090c(0x199))/0x1*(-parseInt(_0x17090c(0x19a))/0x2)+-parseInt(_0x17090c(0x19b))/0x3*(parseInt(_0x17090c(0x197))/0x4)+-parseInt(_0x17090c(0x19c))/0x5*(-parseInt(_0x17090c(0x19d))/0x6)+parseInt(_0x17090c(0x196))/0x7+-parseInt(_0x17090c(0x19f))/0x8*(-parseInt(_0x17090c(0x19e))/0x9)+-parseInt(_0x17090c(0x1a0))/0xa+-parseInt(_0x17090c(0x194))/0xb;if(_0x4c5109===_0x3660e1)break;else _0x282d5d['push'](_0x282d5d['shift']());}catch(_0x17aade){_0x282d5d['push'](_0x282d5d['shift']());}}}(a73_0x2af5,0xbfdbc));import{getEnv}from'./env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0xbc760d){const _0x4cad07=a73_0x2cf0;customApiDomain=_0xbc760d?.[_0x4cad07(0x193)],customUserDomain=_0xbc760d?.[_0x4cad07(0x1a2)],customRuntimeDomain=_0xbc760d?.[_0x4cad07(0x195)];}export const getUserDomain=()=>customUserDomain||(getEnv()==='production'?a73_0x5bb4a3(0x1a1):a73_0x5bb4a3(0x1a3));function a73_0x2cf0(_0x52ee6c,_0x4a5cc){_0x52ee6c=_0x52ee6c-0x191;const _0x2af5d3=a73_0x2af5();let _0x2cf0b6=_0x2af5d3[_0x52ee6c];return _0x2cf0b6;}export const getApiDomain=()=>customApiDomain||(getEnv()===a73_0x5bb4a3(0x191)?a73_0x5bb4a3(0x192):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()==='production'?'https://runtime.lovrabet.com':a73_0x5bb4a3(0x198));function a73_0x2af5(){const _0x1ccdad=['7098098JrUHet','396OiVCoM','https://daily-runtime.lovrabet.com','1ibAicg','2121594HgUjqd','2247wgBohM','532775ilNxyo','72ksjyvy','5602023yTopmJ','8uuIhMG','1835780tqJUsG','https://user.lovrabet.com','userDomain','https://user-daily.lovrabet.com','production','https://api.lovrabet.com','apiDomain','32255707CggUVS','runtimeDomain'];a73_0x2af5=function(){return _0x1ccdad;};return a73_0x2af5();}
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a74_0x4169f6=a74_0x27c3;(function(_0x5f18bd,_0xaa3fec){const _0x4f34aa=a74_0x27c3,_0x456352=_0x5f18bd();while(!![]){try{const _0x2c6c43=parseInt(_0x4f34aa(0x6b))/0x1*(-parseInt(_0x4f34aa(0x6f))/0x2)+-parseInt(_0x4f34aa(0x73))/0x3*(-parseInt(_0x4f34aa(0x6a))/0x4)+parseInt(_0x4f34aa(0x69))/0x5+parseInt(_0x4f34aa(0x72))/0x6*(-parseInt(_0x4f34aa(0x71))/0x7)+-parseInt(_0x4f34aa(0x75))/0x8+parseInt(_0x4f34aa(0x68))/0x9*(parseInt(_0x4f34aa(0x6c))/0xa)+parseInt(_0x4f34aa(0x67))/0xb;if(_0x2c6c43===_0xaa3fec)break;else _0x456352['push'](_0x456352['shift']());}catch(_0x1267ef){_0x456352['push'](_0x456352['shift']());}}}(a74_0x47c3,0xb8a4f));export function normalizeEnv(_0x736750){const _0x186576=a74_0x27c3;return _0x736750===_0x186576(0x6e)?_0x186576(0x70):_0x736750;}function a74_0x27c3(_0x140deb,_0x43a0ee){_0x140deb=_0x140deb-0x67;const _0x47c317=a74_0x47c3();let _0x27c3e8=_0x47c317[_0x140deb];return _0x27c3e8;}function a74_0x47c3(){const _0xf7b72=['online','2900HnCSde','production','77hpMJVy','146364QPRTFA','39471ZLLJVF','env','3630984OrrcEM','11668800MYPZaA','4121217YMpzbQ','1715420cbSsty','36sOfXzq','346GcXHjk','10rkNIhX','RABETBASE_ENV'];a74_0x47c3=function(){return _0xf7b72;};return a74_0x47c3();}let env=normalizeEnv(process[a74_0x4169f6(0x74)][a74_0x4169f6(0x6d)]||process['env']['LOVRABET_ENV']||a74_0x4169f6(0x70));export function getEnv(){return env;}export function initEnv(_0x22cdf0){env=normalizeEnv(_0x22cdf0);}
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a75_0x35b9(){const _0x243b80=['./constant/domain.js','12219823lKhaeS','.lovrabetrc','792BwOZxI','apiDir','appcode','apiDomain','2pyOXcF','entries','setLogPath','userDomain','locale','env','app','object','nonInteractive','.tmp','write','1068QlCHeU','621457pLuOUP','trim','apps','slice','2350020ksVuFh','pageSize','online','isTTY','utf8','setRawCommand','defaultApp','VERBOSE','riskLevel','.lovrabet.json','RABETBASE_','17612vKAEBS','stringify','read','COOKIE','authRequired','ACCESS_KEY','join','8104320LvPdfq','setRawMode','json','FORMAT','cookie','./src/api','94730qVdtWR','RISK_LEVEL','ENV','string','stdin','length','keys','format','641065ndBmRj','parse','24YUfhnF','cwd','en-US','LOVRABET_','project','MAX_RISK','maxRisk','isRaw','true','table','argv','APPCODE','daily','find','28CSUHQo','accessKey','production'];a75_0x35b9=function(){return _0x243b80;};return a75_0x35b9();}const a75_0x5376db=a75_0x48b2;(function(_0x3e7b13,_0x4a3820){const _0xd0c1a3=a75_0x48b2,_0x1036f9=_0x3e7b13();while(!![]){try{const _0x4d878e=parseInt(_0xd0c1a3(0xc8))/0x1*(parseInt(_0xd0c1a3(0xbc))/0x2)+-parseInt(_0xd0c1a3(0xcc))/0x3+parseInt(_0xd0c1a3(0xb2))/0x4*(-parseInt(_0xd0c1a3(0xec))/0x5)+-parseInt(_0xd0c1a3(0xc7))/0x6*(parseInt(_0xd0c1a3(0xd7))/0x7)+-parseInt(_0xd0c1a3(0xde))/0x8+-parseInt(_0xd0c1a3(0xb8))/0x9*(-parseInt(_0xd0c1a3(0xe4))/0xa)+parseInt(_0xd0c1a3(0xb6))/0xb*(parseInt(_0xd0c1a3(0xee))/0xc);if(_0x4d878e===_0x4a3820)break;else _0x1036f9['push'](_0x1036f9['shift']());}catch(_0x106d4f){_0x1036f9['push'](_0x1036f9['shift']());}}}(a75_0x35b9,0x82a6c));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';function env(_0x465162){const _0x3c368b=a75_0x48b2;return process[_0x3c368b(0xc1)][_0x3c368b(0xd6)+_0x465162]||process[_0x3c368b(0xc1)][_0x3c368b(0xa7)+_0x465162]||undefined;}export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=['.rabetbase.json',a75_0x5376db(0xd5),a75_0x5376db(0xb7)];export function resolveConfigPath(_0x521e68){for(const _0x3bc6d8 of CONFIG_NAMES){const _0x4693b3=resolve(_0x521e68,_0x3bc6d8);if(existsSync(_0x4693b3))return _0x4693b3;}return undefined;}export async function createContext(_0x3fb213){const _0x475fa5=a75_0x5376db,_0x25c1b3=readRawConfig(),_0x5cb6cf=buildConfig(_0x25c1b3,_0x3fb213),{initEnv:_0x1c55d8}=await import('./constant/env.js');if(_0x5cb6cf[_0x475fa5(0xc1)])_0x1c55d8(_0x5cb6cf[_0x475fa5(0xc1)]);else _0x3fb213['env']&&typeof _0x3fb213['env']==='string'&&_0x1c55d8(_0x3fb213[_0x475fa5(0xc1)]);const {initDomains:_0x159848,getUserDomain:_0xe4b334,getApiDomain:_0x2d80c9}=await import(_0x475fa5(0xb5));_0x159848({'apiDomain':_0x25c1b3[_0x475fa5(0xbb)]||undefined,'userDomain':_0x25c1b3[_0x475fa5(0xbf)]||undefined,'runtimeDomain':_0x25c1b3['runtimeDomain']||undefined});const _0x585c56={'apiDomain':_0x2d80c9(),'userDomain':_0xe4b334()},_0x2311b3=await buildAuth(_0x5cb6cf);logger[_0x475fa5(0xbe)](process[_0x475fa5(0xa5)]());const _0x200cc1=(CLI_BIN_NAME+'\x20'+process[_0x475fa5(0xae)][_0x475fa5(0xcb)](0x2)[_0x475fa5(0xdd)]('\x20'))[_0x475fa5(0xc9)]();logger[_0x475fa5(0xd1)](_0x200cc1);const _0x3c3eab=isNonInteractiveMode(_0x3fb213);return{'config':_0x5cb6cf,'auth':_0x2311b3,'logger':logger,'env':_0x585c56,'nonInteractive':_0x3c3eab};}export function buildConfigFromFlags(_0x5de37a){return buildConfig(readRawConfig(),_0x5de37a);}export function getProjectConfigPath(){const _0x37bc02=a75_0x5376db;return resolveConfigPath(process[_0x37bc02(0xa5)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x5c4e02){const _0x12455a=a75_0x5376db;let _0x193725={},_0x49b976={};try{const _0x47157a=resolveConfigPath(homedir());if(_0x47157a){const _0x4520fb=readFileSync(_0x47157a,{'encoding':_0x12455a(0xd0)});if(_0x4520fb)_0x193725=JSON['parse'](_0x4520fb);}}catch{}try{const _0x3614a4=_0x5c4e02||process[_0x12455a(0xa5)](),_0x3c0faa=resolveConfigPath(_0x3614a4);if(_0x3c0faa){const _0x18cbc2=readFileSync(_0x3c0faa,{'encoding':_0x12455a(0xd0)});if(_0x18cbc2)_0x49b976=JSON[_0x12455a(0xed)](_0x18cbc2);}}catch{}const _0x54cd50=_0x193725[_0x12455a(0xca)]&&typeof _0x193725[_0x12455a(0xca)]===_0x12455a(0xc3)?_0x193725['apps']:{},_0x5d6f7f=_0x49b976['apps']&&typeof _0x49b976[_0x12455a(0xca)]===_0x12455a(0xc3)?_0x49b976[_0x12455a(0xca)]:{},_0x223efe={..._0x54cd50,..._0x5d6f7f},_0x6b613f={..._0x193725,..._0x49b976};Object[_0x12455a(0xea)](_0x223efe)[_0x12455a(0xe9)]>0x0&&(_0x6b613f[_0x12455a(0xca)]=_0x223efe);if('defaultApp'in _0x49b976)_0x6b613f['defaultApp']=_0x49b976[_0x12455a(0xd2)];else{if(_0x5d6f7f&&Object[_0x12455a(0xea)](_0x5d6f7f)[_0x12455a(0xe9)]>0x0)_0x6b613f['defaultApp']=Object['keys'](_0x5d6f7f)[0x0];else _0x193725[_0x12455a(0xd2)]&&(_0x6b613f[_0x12455a(0xd2)]=_0x193725[_0x12455a(0xd2)]);}return _0x6b613f;}export function readConfigFile(_0x18218d){const _0x4ea36e=a75_0x5376db;try{if(existsSync(_0x18218d)){const _0x4e4aa0=readFileSync(_0x18218d,{'encoding':_0x4ea36e(0xd0)});if(_0x4e4aa0)return JSON[_0x4ea36e(0xed)](_0x4e4aa0);}}catch{}return{};}export function writeConfigFile(_0x24f1a9,_0x25306f){const _0x4b1564=a75_0x5376db,_0x40f0f9=dirname(_0x24f1a9);!existsSync(_0x40f0f9)&&mkdirSync(_0x40f0f9,{'recursive':!![]});const _0x99420d=_0x24f1a9+_0x4b1564(0xc5);try{writeFileSync(_0x99420d,JSON[_0x4b1564(0xd8)](_0x25306f,null,0x2)+'\x0a',{'encoding':_0x4b1564(0xd0),'mode':0x180}),renameSync(_0x99420d,_0x24f1a9);}catch(_0x3e05f7){try{unlinkSync(_0x99420d);}catch{}throw _0x3e05f7;}}export function resolveWriteConfigPath(_0x104471){const _0xb96eba=a75_0x5376db,_0x33ef0c=_0x104471===_0xb96eba(0xa8)?process[_0xb96eba(0xa5)]():homedir(),_0x548a9b=resolveConfigPath(_0x33ef0c);return _0x548a9b??resolve(_0x33ef0c,NEW_CONFIG_NAME);}function a75_0x48b2(_0x1012ac,_0x49d424){_0x1012ac=_0x1012ac-0xa5;const _0x35b96b=a75_0x35b9();let _0x48b268=_0x35b96b[_0x1012ac];return _0x48b268;}function buildConfig(_0x4c5f9d,_0x74c6e8){const _0x1d6de6=a75_0x5376db,_0x54e1bd={};if(_0x4c5f9d['apps']&&typeof _0x4c5f9d[_0x1d6de6(0xca)]===_0x1d6de6(0xc3))for(const [_0x5dae35,_0x571655]of Object[_0x1d6de6(0xbd)](_0x4c5f9d[_0x1d6de6(0xca)])){_0x571655&&typeof _0x571655===_0x1d6de6(0xc3)&&_0x571655[_0x1d6de6(0xba)]&&(_0x54e1bd[_0x5dae35]=_0x571655);}const _0x1bc517=_0x4c5f9d[_0x1d6de6(0xd2)]||undefined,_0x1b0ba5=Object[_0x1d6de6(0xea)](_0x54e1bd)[_0x1d6de6(0xe9)]>0x0,_0x37af04=_0x74c6e8[_0x1d6de6(0xc2)]||env('APP')||undefined;let _0x5d0232=_0x37af04||_0x1bc517||undefined,_0x5cc60f=_0x5d0232&&_0x54e1bd[_0x5d0232]?_0x54e1bd[_0x5d0232]:undefined;if(_0x74c6e8[_0x1d6de6(0xba)]&&!_0x37af04){const _0x438f27=Object['entries'](_0x54e1bd)[_0x1d6de6(0xb1)](([_0x224042,_0x152f9d])=>_0x152f9d[_0x1d6de6(0xba)]===_0x74c6e8[_0x1d6de6(0xba)]);_0x438f27&&(_0x5d0232=_0x438f27[0x0],_0x5cc60f=_0x438f27[0x1]);}const _0x54e737=_0x37af04||(_0x74c6e8[_0x1d6de6(0xba)]&&_0x5d0232&&!_0x1bc517?_0x5d0232:undefined),_0x5c68ae=_0x74c6e8[_0x1d6de6(0xba)]||env(_0x1d6de6(0xaf))||_0x5cc60f?.[_0x1d6de6(0xba)]||_0x4c5f9d[_0x1d6de6(0xba)]||_0x4c5f9d[_0x1d6de6(0xc2)]||undefined,_0x3e41f0=_0x74c6e8[_0x1d6de6(0xc1)]||env(_0x1d6de6(0xe6))||_0x5cc60f?.[_0x1d6de6(0xc1)]||_0x4c5f9d[_0x1d6de6(0xc1)]||_0x1d6de6(0xb4),_0x52610e=_0x5cc60f?.[_0x1d6de6(0xc0)]||_0x4c5f9d[_0x1d6de6(0xc0)]||_0x1d6de6(0xa6),_0x1faa2d=env(_0x1d6de6(0xda))||_0x5cc60f?.[_0x1d6de6(0xe2)]||_0x4c5f9d[_0x1d6de6(0xe2)]||undefined,_0x284b84=env(_0x1d6de6(0xdc))||_0x5cc60f?.[_0x1d6de6(0xb3)]||_0x4c5f9d[_0x1d6de6(0xb3)]||undefined,_0xfca090=_0x74c6e8[_0x1d6de6(0xeb)]||env(_0x1d6de6(0xe1))||_0x5cc60f?.[_0x1d6de6(0xeb)]||_0x4c5f9d['format'],_0x31bd95=_0xfca090===_0x1d6de6(0xe0)||_0xfca090==='pretty'||_0xfca090===_0x1d6de6(0xad)?_0xfca090:undefined,_0x1446c8=env('PAGE_SIZE')||_0x5cc60f?.[_0x1d6de6(0xcd)]||_0x4c5f9d[_0x1d6de6(0xcd)],_0x871c4=_0x1446c8?Number(_0x1446c8)||undefined:undefined,_0x417cea=env(_0x1d6de6(0xe5))||env(_0x1d6de6(0xa9))||_0x5cc60f?.[_0x1d6de6(0xd4)]||_0x4c5f9d[_0x1d6de6(0xd4)]||_0x4c5f9d[_0x1d6de6(0xaa)],_0x2ac7ba=_0x417cea===_0x1d6de6(0xd9)||_0x417cea===_0x1d6de6(0xc6)?_0x417cea:'high-risk-write',_0x3f0572=env(_0x1d6de6(0xd3)),_0x5a92dc=_0x3f0572==='1'||_0x3f0572==='true',_0xf2b40c=_0x5cc60f?.['apiDir']||_0x4c5f9d[_0x1d6de6(0xb9)]||_0x1d6de6(0xe3);return{'appCode':typeof _0x5c68ae===_0x1d6de6(0xe7)&&_0x5c68ae[_0x1d6de6(0xc9)]()?_0x5c68ae['trim']():undefined,'env':_0x3e41f0===_0x1d6de6(0xce)?_0x1d6de6(0xb4):_0x3e41f0==='daily'?_0x1d6de6(0xb0):_0x1d6de6(0xb4),'locale':_0x52610e,'cookie':_0x1faa2d,'accessKey':_0x284b84,'format':_0x31bd95,'pageSize':_0x871c4,'riskLevel':_0x2ac7ba,'verbose':_0x5a92dc,'apiDir':_0xf2b40c,'apps':_0x54e1bd,'defaultApp':_0x1bc517,'currentApp':_0x1b0ba5?_0x5d0232:undefined,'explicitAppName':_0x54e737,'raw':_0x4c5f9d};}async function buildAuth(_0x1d5928){const _0x368f4c=a75_0x5376db,{getCookie:_0x409b4f}=await import('./auth/get-cookie.js'),_0x2f6557=_0x1d5928[_0x368f4c(0xe2)]||_0x409b4f(),_0x33b6fd=_0x2f6557?await getIsSessionValid():![];return{'cookie':_0x2f6557,'isLoggedIn':_0x33b6fd,async 'getOrLogin'(){const _0x296b6e=_0x368f4c;if(_0x2f6557&&_0x33b6fd)return _0x2f6557;throw CliErrors[_0x296b6e(0xdb)]();}};}function isNonInteractiveMode(_0x371b37){const _0x68f597=a75_0x5376db;return!!(_0x371b37[_0x68f597(0xc4)]||_0x371b37['ci']||env('CI')===_0x68f597(0xac)||process[_0x68f597(0xc1)]['CI']==='true'||!process['stdout'][_0x68f597(0xcf)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x564a3e=a75_0x5376db;if(!process[_0x564a3e(0xe8)][_0x564a3e(0xcf)])return![];try{const _0x46d6e4=process[_0x564a3e(0xe8)][_0x564a3e(0xab)];return process['stdin']['setRawMode'](!![]),process[_0x564a3e(0xe8)][_0x564a3e(0xdf)](_0x46d6e4??![]),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x414e30,_0x10b849){const _0x1b3f80=a76_0x3075,_0x3077a8=_0x414e30();while(!![]){try{const _0x16ddf8=-parseInt(_0x1b3f80(0x196))/0x1+parseInt(_0x1b3f80(0x1a0))/0x2*(-parseInt(_0x1b3f80(0x19d))/0x3)+parseInt(_0x1b3f80(0x198))/0x4+parseInt(_0x1b3f80(0x19e))/0x5+-parseInt(_0x1b3f80(0x19f))/0x6*(-parseInt(_0x1b3f80(0x199))/0x7)+parseInt(_0x1b3f80(0x194))/0x8+parseInt(_0x1b3f80(0x19a))/0x9;if(_0x16ddf8===_0x10b849)break;else _0x3077a8['push'](_0x3077a8['shift']());}catch(_0x1a0114){_0x3077a8['push'](_0x3077a8['shift']());}}}(a76_0x53ca,0xba5f9));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x2d7f0b){const _0x50a99f=a76_0x3075,_0x312f8a=[],_0xa8510c=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x4e36f1;while((_0x4e36f1=_0xa8510c[_0x50a99f(0x19c)](_0x2d7f0b))!==null){_0x312f8a[_0x50a99f(0x195)]({'datasetCode':_0x4e36f1[0x1],'tableName':_0x4e36f1[0x2],'name':_0x4e36f1[0x3],'alias':_0x4e36f1[0x4]});}return _0x312f8a;}function a76_0x3075(_0x3cdeb3,_0x4f9e3c){_0x3cdeb3=_0x3cdeb3-0x194;const _0x53ca67=a76_0x53ca();let _0x307527=_0x53ca67[_0x3cdeb3];return _0x307527;}export function loadAliasMap(_0x5ec09f){const _0x2caf34=a76_0x3075,_0xb0f134=resolve(process[_0x2caf34(0x1a2)](),_0x5ec09f);if(cache[_0x2caf34(0x19b)](_0xb0f134))return cache['get'](_0xb0f134);const _0x49d949=resolve(_0xb0f134,'api.ts');if(!existsSync(_0x49d949))return cache[_0x2caf34(0x1a1)](_0xb0f134,[]),[];try{const _0xebe51f=readFileSync(_0x49d949,'utf-8'),_0x942149=parseApiFile(_0xebe51f);return cache['set'](_0xb0f134,_0x942149),_0x942149;}catch{return cache[_0x2caf34(0x1a1)](_0xb0f134,[]),[];}}export function resolveAlias(_0x92e33b,_0x3659da){const _0x3fcf3e=a76_0x3075;if(!_0x3659da)return undefined;const _0x22c4c7=loadAliasMap(_0x92e33b),_0x3b5e93=_0x22c4c7[_0x3fcf3e(0x197)](_0x389f2f=>_0x389f2f['alias']===_0x3659da);return _0x3b5e93?.['datasetCode'];}function a76_0x53ca(){const _0x1e7bf9=['find','2122592qwYDck','301tzntEr','2871234WATpFY','has','exec','3120777cDjXct','5688615oIlCFY','30042LkSGoI','2hanAkv','set','cwd','1442376zhIZgc','push','579351wQMIAR'];a76_0x53ca=function(){return _0x1e7bf9;};return a76_0x53ca();}export function listAliases(_0x1415cb){return loadAliasMap(_0x1415cb);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x48bdb2,_0x36a698){const _0x3d93fb=a76_0x5f3c,_0x5a17eb=_0x48bdb2();while(!![]){try{const _0xef7c10=-parseInt(_0x3d93fb(0x249))/0x1+-parseInt(_0x3d93fb(0x1ff))/0x2*(parseInt(_0x3d93fb(0x200))/0x3)+parseInt(_0x3d93fb(0x1ea))/0x4*(parseInt(_0x3d93fb(0x20e))/0x5)+parseInt(_0x3d93fb(0x1ed))/0x6*(-parseInt(_0x3d93fb(0x240))/0x7)+-parseInt(_0x3d93fb(0x223))/0x8+parseInt(_0x3d93fb(0x237))/0x9*(-parseInt(_0x3d93fb(0x207))/0xa)+parseInt(_0x3d93fb(0x241))/0xb*(parseInt(_0x3d93fb(0x1f8))/0xc);if(_0xef7c10===_0x36a698)break;else _0x5a17eb['push'](_0x5a17eb['shift']());}catch(_0x354bc8){_0x5a17eb['push'](_0x5a17eb['shift']());}}}(a76_0x4135,0x533d6));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x48df17){_activeCookie=_0x48df17||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x566867,_0x15c924={}){const _0x3020cf=a76_0x5f3c,{method:method='GET',body:_0x4a125b,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x15c924,_0x5edb83=useRuntime?getRuntimeDomain():getApiDomain(),_0x4a8956=_activeCookie||getCookie(),_0x498b84=''+_0x5edb83+_0x566867,_0x31c5d8=new AbortController(),_0x13f4a9=setTimeout(()=>_0x31c5d8[_0x3020cf(0x1ee)](),timeout);try{const _0x3cfcd7=await fetch(_0x498b84,{'method':method,'headers':{'Content-Type':_0x3020cf(0x21b),'Cookie':_0x4a8956,'X-Invoke-Source':_0x3020cf(0x229),...headers},'body':_0x4a125b?JSON[_0x3020cf(0x245)](_0x4a125b):undefined,'signal':_0x31c5d8[_0x3020cf(0x208)]});let _0x1c76a3;try{_0x1c76a3=await _0x3cfcd7['json']();}catch{throw CliErrors[_0x3020cf(0x230)](_0x3020cf(0x1e2)+_0x3cfcd7[_0x3020cf(0x22a)]+')',_0x3cfcd7['status']>=0x190?_0x3020cf(0x1f1):undefined);}if(!_0x3cfcd7['ok']||_0x1c76a3[_0x3020cf(0x216)]===![])throw CliErrors[_0x3020cf(0x230)](_0x1c76a3[_0x3020cf(0x238)]||_0x1c76a3['message']||_0x3020cf(0x247)+_0x3cfcd7[_0x3020cf(0x22a)],_0x1c76a3[_0x3020cf(0x242)]?_0x3020cf(0x20d)+_0x1c76a3['errorCode']:undefined);return _0x1c76a3;}catch(_0x104c09){if(_0x104c09 instanceof Error&&_0x104c09[_0x3020cf(0x20b)]===_0x3020cf(0x251))throw CliErrors[_0x3020cf(0x230)](_0x3020cf(0x226)+_0x498b84);throw _0x104c09;}finally{clearTimeout(_0x13f4a9);}}function a76_0x4135(){const _0x26b2c6=['replace','});','(/*\x20params\x20*/);','//\x20','apiError','toLowerCase','modelCode','sdk','\x20\x20currentPage:\x201,','/smartapi/dataset/get-dataset-operation','const\x20result\x20=\x20await\x20client.models.','18YQsJzz','errorMsg','validation','pageSize','.create({\x20/*\x20fields\x20*/\x20});','Operation\x20\x22','const\x20results\x20=\x20data.execResult\x20||\x20[];','includes','description','266XceauM','14258783VLSmxY','errorCode','create','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','stringify','test','API\x20error:\x20','tableData','537150QQJFrV','tableName','/api/management/library/scripts/statistics?appCode=','getOne','.remove(id);','/api/node-toolbox/sql/save','/api/management/library/scripts/delete','object','AbortError','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','\x20\x20where:\x20{},','/smartapi/custom/queryUserCustomSqlList','scriptName','\x20\x20sqlCode:\x20\x27','target','sqlCode','data','11944TrLeqL','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','sqlName','1884Iridgi','abort','modelId','operationName','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','enabled','push','//\x20SQL:\x20','includeImports','12kNhyfw','responseFields','\x20\x20\x20\x20sqlCode:\x20\x27','path','has','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','/api/management/library/scripts/list?appCode=','1056492dJQloJ','3bqyWvC','entries','filter','type','POST','code','delete','125780kQtKtr','signal','.filter({','BFF\x20script\x20not\x20found:\x20id=','name','\x20\x20return\x20rows;','API\x20error\x20code:\x20','595mRpGiz','join','/api/custom/executeSql','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','/smartapi/dataset/get-dataset-list','map','/api/management/library/scripts/save','update','success','/smartapi/question/er-config','find','requestFields','/smartapi/dataset/get-driven-data?','application/json','const\x20data\x20=\x20await\x20client.sql.execute({','/api/management/library/scripts/info?id=','SQL\x20query\x20not\x20found:\x20','method','dataset_','add','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','1665224lUQUjy','functionName','\x22\x20not\x20found\x20in\x20dataset\x20','Request\x20timeout:\x20','isArray','displayName','cli:rabetbase','status','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;'];a76_0x4135=function(){return _0x26b2c6;};return a76_0x4135();}export async function listBffScripts(_0x190b67,_0x295147,_0x14c2f7){const _0x419860=a76_0x5f3c;let _0x14b3b2=_0x419860(0x1fe)+_0x190b67;if(_0x295147)_0x14b3b2+='&type='+_0x295147;const _0x40eda1=await apiRequest(_0x14b3b2);let _0xdddd9e=extractList(_0x40eda1[_0x419860(0x1e9)]);if(_0x14c2f7?.['scriptName']){const _0x53d398=_0x14c2f7[_0x419860(0x1e5)][_0x419860(0x231)]();_0xdddd9e=_0xdddd9e[_0x419860(0x202)](_0x57320f=>_0x57320f[_0x419860(0x224)]?.[_0x419860(0x231)]()['includes'](_0x53d398)||_0x57320f[_0x419860(0x23f)]?.[_0x419860(0x231)]()[_0x419860(0x23e)](_0x53d398));}return _0xdddd9e;}export async function getBffScriptInfo(_0x4e60cb){const _0x149107=a76_0x5f3c,_0x5d55aa=await apiRequest(_0x149107(0x21d)+_0x4e60cb);if(!_0x5d55aa[_0x149107(0x1e9)])throw CliErrors[_0x149107(0x239)](_0x149107(0x20a)+_0x4e60cb);return _0x5d55aa[_0x149107(0x1e9)];}export async function saveBffScript(_0x2e7d86){const _0x2ab4b2=a76_0x5f3c,_0x48bf42=await apiRequest(_0x2ab4b2(0x214),{'method':_0x2ab4b2(0x204),'body':_0x2e7d86});return _0x48bf42['data'];}export async function deleteBffScript(_0x47da57){const _0x4b7e07=a76_0x5f3c;await apiRequest(_0x4b7e07(0x24f),{'method':_0x4b7e07(0x204),'body':{'id':_0x47da57}});}export async function getBffScriptStatistics(_0x553f10){const _0x37f5eb=a76_0x5f3c,_0x362dd7=await apiRequest(_0x37f5eb(0x24b)+_0x553f10);return extractList(_0x362dd7['data']);}export async function listBffDatasetOperations(_0x15c39b,_0x32625e){const _0x13886e=a76_0x5f3c,_0x5033cd=await apiRequest(_0x13886e(0x235),{'method':_0x13886e(0x204),'body':{'appCode':_0x15c39b,'datasetId':_0x32625e}});return _0x5033cd[_0x13886e(0x1e9)];}export async function listSqlQueries(_0x3ab629,_0x176d76){const _0x29fc41=a76_0x5f3c,_0x38eaab=await apiRequest(_0x29fc41(0x1e4),{'method':_0x29fc41(0x204),'body':{'appCode':_0x3ab629,'currentPage':_0x176d76?.['currentPage']??0x1,'pageSize':_0x176d76?.[_0x29fc41(0x23a)]??0x32,'sqlCode':_0x176d76?.[_0x29fc41(0x1e8)],'sqlName':_0x176d76?.['sqlName']}});return _0x38eaab[_0x29fc41(0x1e9)];}export async function getSqlQueryInfo(_0x163c7d,_0xda3e98){const _0x49b7ed=a76_0x5f3c,_0x3581f4=await listSqlQueries(_0x163c7d,{'sqlCode':_0xda3e98}),_0x42d817=_0x3581f4[_0x49b7ed(0x248)]?.[0x0];if(!_0x42d817)throw CliErrors[_0x49b7ed(0x239)](_0x49b7ed(0x21e)+_0xda3e98);return _0x42d817;}export async function saveSqlQuery(_0x48c68f){const _0x295a93=a76_0x5f3c,_0x1bf2e9=await apiRequest(_0x295a93(0x24e),{'method':_0x295a93(0x204),'body':_0x48c68f});return _0x1bf2e9[_0x295a93(0x1e9)];}export async function executeSql(_0x371970,_0x8ad576,_0x15cfdc){const _0x2b8e02=a76_0x5f3c,_0x28648c=await apiRequest(_0x2b8e02(0x210),{'method':_0x2b8e02(0x204),'body':{'appCode':_0x371970,'sqlCode':_0x8ad576,..._0x15cfdc&&{'params':_0x15cfdc}},'useRuntime':!![]});return _0x28648c[_0x2b8e02(0x1e9)];}export async function listDatasets(_0x2f3d7b,_0x2db51f){const _0x954d7e=a76_0x5f3c,_0x22e9d7={'appCode':_0x2f3d7b,'deleted':![]};if(_0x2db51f?.[_0x954d7e(0x205)])_0x22e9d7[_0x954d7e(0x205)]=_0x2db51f['code'];if(_0x2db51f?.[_0x954d7e(0x20b)])_0x22e9d7[_0x954d7e(0x20b)]=_0x2db51f['name'];const _0x56d202=await apiRequest(_0x954d7e(0x212),{'method':'POST','body':_0x22e9d7});return extractList(_0x56d202[_0x954d7e(0x1e9)]);}export async function searchDatasets(_0xac3ab8,_0x1602ca){const _0x23d0da=a76_0x5f3c,_0x36d5b1=await listDatasets(_0xac3ab8,{'name':_0x1602ca}),_0x5749b6=_0x1602ca[_0x23d0da(0x231)](),_0x13b562=new Set(_0x36d5b1['map'](_0x446f10=>_0x446f10['id'])),_0x3d86f7=_0x36d5b1[_0x23d0da(0x202)](_0x1e8828=>_0x1e8828['dbtableConfig']?.[_0x23d0da(0x24a)]?.[_0x23d0da(0x231)]()[_0x23d0da(0x23e)](_0x5749b6)||_0x1e8828[_0x23d0da(0x23f)]?.['toLowerCase']()[_0x23d0da(0x23e)](_0x5749b6)),_0x421ebb=await listDatasets(_0xac3ab8,{'code':_0x1602ca});for(const _0x19b88d of _0x421ebb){!_0x13b562[_0x23d0da(0x1fc)](_0x19b88d['id'])&&(_0x36d5b1[_0x23d0da(0x1f5)](_0x19b88d),_0x13b562[_0x23d0da(0x221)](_0x19b88d['id']));}return _0x36d5b1;}export function normalizeDatasetOperations(_0x2c1119){const _0x5e5043=a76_0x5f3c;if(Array[_0x5e5043(0x227)](_0x2c1119))return _0x2c1119[_0x5e5043(0x202)](_0x39f339=>_0x39f339!=null&&typeof _0x39f339==='object');if(_0x2c1119&&typeof _0x2c1119===_0x5e5043(0x250))return Object[_0x5e5043(0x201)](_0x2c1119)[_0x5e5043(0x202)](([,_0x37a5ec])=>_0x37a5ec!=null&&typeof _0x37a5ec===_0x5e5043(0x250))[_0x5e5043(0x213)](([_0x2218dc,_0x50fcb4])=>({..._0x50fcb4,'name':_0x50fcb4[_0x5e5043(0x20b)]??_0x50fcb4[_0x5e5043(0x1f0)]??_0x2218dc}));return[];}export async function getDatasetDetail(_0x183161){const _0x1849fb=a76_0x5f3c,_0x41ab98=/^\d+$/[_0x1849fb(0x246)](_0x183161)?'id':_0x1849fb(0x205),_0x3df61f=await apiRequest(_0x1849fb(0x21a)+_0x41ab98+'='+_0x183161);return _0x3df61f[_0x1849fb(0x1e9)];}function a76_0x5f3c(_0x2d12b7,_0x2341e3){_0x2d12b7=_0x2d12b7-0x1e2;const _0x413538=a76_0x4135();let _0x5f3cab=_0x413538[_0x2d12b7];return _0x5f3cab;}export async function getDatasetOperations(_0x585574){const _0x5f2bd4=a76_0x5f3c,_0x4fed33=await getDatasetDetail(_0x585574),_0x1914df=normalizeDatasetOperations(_0x4fed33['operations'])[_0x5f2bd4(0x213)](_0x52b2bd=>({'name':_0x52b2bd[_0x5f2bd4(0x20b)]||_0x52b2bd['operationName'],'displayName':_0x52b2bd[_0x5f2bd4(0x228)]||_0x52b2bd['name'],'type':_0x52b2bd[_0x5f2bd4(0x203)],'method':_0x52b2bd[_0x5f2bd4(0x21f)],'path':_0x52b2bd[_0x5f2bd4(0x1fb)],'enabled':_0x52b2bd[_0x5f2bd4(0x1f4)]??!![],'requestFields':_0x52b2bd[_0x5f2bd4(0x219)],'responseFields':_0x52b2bd[_0x5f2bd4(0x1f9)]}));return{'dataset':{'id':_0x4fed33['id']??_0x4fed33[_0x5f2bd4(0x1ef)],'name':_0x4fed33[_0x5f2bd4(0x20b)],'code':_0x4fed33[_0x5f2bd4(0x205)]||_0x4fed33[_0x5f2bd4(0x232)],'tableName':_0x4fed33['tableName']||_0x4fed33['dbtableConfig']?.[_0x5f2bd4(0x24a)]},'operations':_0x1914df};}export async function getOperationDetail(_0x1f8da3,_0x476a20,_0x316b80){const _0x4ec502=a76_0x5f3c;let _0x492f9e=_0x476a20;if(!/^\d+$/[_0x4ec502(0x246)](_0x476a20)){const _0x169039=await listDatasets(_0x1f8da3,{'code':_0x476a20}),_0x1cb500=_0x169039[_0x4ec502(0x218)](_0x52ab9e=>_0x52ab9e['code']===_0x476a20||String(_0x52ab9e['id'])===_0x476a20);if(!_0x1cb500)throw CliErrors[_0x4ec502(0x239)]('Dataset\x20not\x20found:\x20'+_0x476a20);_0x492f9e=String(_0x1cb500['id']);}const _0x554bce=await getDatasetDetail(_0x492f9e),_0x1e535b=normalizeDatasetOperations(_0x554bce['operations'])[_0x4ec502(0x218)](_0x2119b9=>(_0x2119b9[_0x4ec502(0x20b)]||_0x2119b9[_0x4ec502(0x1f0)])===_0x316b80);if(!_0x1e535b)throw CliErrors[_0x4ec502(0x239)](_0x4ec502(0x23c)+_0x316b80+_0x4ec502(0x225)+_0x476a20);return{'dataset':{'id':_0x554bce['id']??_0x554bce['modelId'],'name':_0x554bce[_0x4ec502(0x20b)],'code':_0x554bce['code']||_0x554bce['modelCode'],'tableName':_0x554bce[_0x4ec502(0x24a)]||_0x554bce['dbtableConfig']?.[_0x4ec502(0x24a)]},'operation':_0x1e535b};}export function generateSdkCode(_0x484703,_0x597dbb,_0x469649){const _0x359f4c=a76_0x5f3c,_0x2d8501=_0x469649?.[_0x359f4c(0x1f7)]??!![],_0x563c34=_0x359f4c(0x220)+_0x484703[_0x359f4c(0x205)]?.[_0x359f4c(0x22c)](/-/g,'_'),_0x5803db=_0x597dbb[_0x359f4c(0x20b)]||_0x597dbb[_0x359f4c(0x1f0)]||_0x359f4c(0x202),_0x144095=[];_0x2d8501&&_0x144095[_0x359f4c(0x1f5)](_0x359f4c(0x22b),'',_0x359f4c(0x1fd),'');_0x144095[_0x359f4c(0x1f5)](_0x359f4c(0x22f)+_0x484703['name']+'\x20('+(_0x484703[_0x359f4c(0x24a)]||'table')+')');if(_0x5803db===_0x359f4c(0x202))_0x144095[_0x359f4c(0x1f5)](_0x359f4c(0x236)+_0x563c34+_0x359f4c(0x209),_0x359f4c(0x1e3),'\x20\x20pageSize:\x2020,',_0x359f4c(0x234),_0x359f4c(0x22d));else{if(_0x5803db===_0x359f4c(0x24c))_0x144095[_0x359f4c(0x1f5)]('const\x20result\x20=\x20await\x20client.models.'+_0x563c34+'.getOne(id);');else{if(_0x5803db===_0x359f4c(0x243))_0x144095[_0x359f4c(0x1f5)](_0x359f4c(0x236)+_0x563c34+_0x359f4c(0x23b));else{if(_0x5803db===_0x359f4c(0x215))_0x144095['push'](_0x359f4c(0x236)+_0x563c34+_0x359f4c(0x211));else _0x5803db===_0x359f4c(0x206)||_0x5803db==='remove'?_0x144095['push'](_0x359f4c(0x236)+_0x563c34+_0x359f4c(0x24d)):_0x144095[_0x359f4c(0x1f5)]('const\x20result\x20=\x20await\x20client.models.'+_0x563c34+'.'+_0x5803db+_0x359f4c(0x22e));}}}return _0x144095['join']('\x0a');}export function generateSqlCodeTemplate(_0x2c86a7,_0x769dc7){const _0x2e713a=a76_0x5f3c,_0x46b6e2=_0x769dc7?.[_0x2e713a(0x1e7)]??'sdk',_0x1c1d89=_0x769dc7?.['includeImports']??!![],_0x8d0281=[];return _0x8d0281[_0x2e713a(0x1f5)](_0x2e713a(0x1f6)+_0x2c86a7[_0x2e713a(0x1ec)]+'\x20('+_0x2c86a7['sqlCode']+')'),_0x46b6e2===_0x2e713a(0x233)?(_0x1c1d89&&_0x8d0281['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x2e713a(0x1fd),''),_0x8d0281['push'](_0x2e713a(0x21c),_0x2e713a(0x1e6)+_0x2c86a7[_0x2e713a(0x1e8)]+'\x27,',_0x2e713a(0x1eb),_0x2e713a(0x22d),'if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x2e713a(0x23d))):_0x8d0281['push'](_0x2e713a(0x1f3),_0x2e713a(0x1f2),_0x2e713a(0x244),_0x2e713a(0x1fa)+_0x2c86a7['sqlCode']+'\x27,',_0x2e713a(0x222),'\x20\x20});',_0x2e713a(0x20c),'}'),_0x8d0281[_0x2e713a(0x20f)]('\x0a');}export async function getErConfig(_0x39572b,_0x1a58cf){const _0x591ee4=a76_0x5f3c,_0x1c64de=await apiRequest(_0x591ee4(0x217),{'method':'POST','body':{'appCode':_0x39572b,'dblinkId':_0x1a58cf}});return _0x1c64de[_0x591ee4(0x1e9)];}
|
|
1
|
+
(function(_0x34a293,_0xf615f){const _0xf687ea=a77_0x494c,_0x1bfbcf=_0x34a293();while(!![]){try{const _0x2f06b1=-parseInt(_0xf687ea(0x107))/0x1*(-parseInt(_0xf687ea(0x102))/0x2)+-parseInt(_0xf687ea(0xf7))/0x3*(parseInt(_0xf687ea(0x10d))/0x4)+parseInt(_0xf687ea(0xfa))/0x5*(parseInt(_0xf687ea(0x101))/0x6)+parseInt(_0xf687ea(0xec))/0x7+parseInt(_0xf687ea(0xe7))/0x8*(parseInt(_0xf687ea(0x11a))/0x9)+-parseInt(_0xf687ea(0x105))/0xa+-parseInt(_0xf687ea(0x13e))/0xb*(parseInt(_0xf687ea(0x106))/0xc);if(_0x2f06b1===_0xf615f)break;else _0x1bfbcf['push'](_0x1bfbcf['shift']());}catch(_0x172534){_0x1bfbcf['push'](_0x1bfbcf['shift']());}}}(a77_0x58d4,0xe5f87));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';function a77_0x494c(_0x334051,_0x25a9df){_0x334051=_0x334051-0xd9;const _0x58d4dd=a77_0x58d4();let _0x494c38=_0x58d4dd[_0x334051];return _0x494c38;}import{extractList}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x30ec55){_activeCookie=_0x30ec55||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x161b82,_0x30d85d={}){const _0x210e32=a77_0x494c,{method:method='GET',body:_0x4f53d8,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x30d85d,_0x4b9f9f=useRuntime?getRuntimeDomain():getApiDomain(),_0x4b4761=_activeCookie||getCookie(),_0x31b3e0=''+_0x4b9f9f+_0x161b82,_0x4e1686=new AbortController(),_0xa69a50=setTimeout(()=>_0x4e1686['abort'](),timeout);try{const _0x237235=await fetch(_0x31b3e0,{'method':method,'headers':{'Content-Type':_0x210e32(0x124),'Cookie':_0x4b4761,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0x4f53d8?JSON['stringify'](_0x4f53d8):undefined,'signal':_0x4e1686[_0x210e32(0x12a)]});let _0xb9863d;try{_0xb9863d=await _0x237235[_0x210e32(0xea)]();}catch{throw CliErrors[_0x210e32(0xda)](_0x210e32(0x136)+_0x237235['status']+')',_0x237235['status']>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x237235['ok']||_0xb9863d[_0x210e32(0x10f)]===![])throw CliErrors['apiError'](_0xb9863d[_0x210e32(0xf8)]||_0xb9863d[_0x210e32(0x10b)]||_0x210e32(0x133)+_0x237235['status'],_0xb9863d[_0x210e32(0xe3)]?_0x210e32(0xfb)+_0xb9863d[_0x210e32(0xe3)]:undefined);return _0xb9863d;}catch(_0x2dd14e){if(_0x2dd14e instanceof Error&&_0x2dd14e[_0x210e32(0x128)]==='AbortError')throw CliErrors['apiError'](_0x210e32(0x113)+_0x31b3e0);throw _0x2dd14e;}finally{clearTimeout(_0xa69a50);}}export async function listBffScripts(_0x56392b,_0x50e616,_0x295ee2){const _0x3c85ae=a77_0x494c;let _0xfd367e=_0x3c85ae(0xfe)+_0x56392b;if(_0x50e616)_0xfd367e+='&type='+_0x50e616;const _0x302dd0=await apiRequest(_0xfd367e);let _0xabce40=extractList(_0x302dd0[_0x3c85ae(0x12c)]);if(_0x295ee2?.['scriptName']){const _0x4e8f21=_0x295ee2['scriptName']['toLowerCase']();_0xabce40=_0xabce40[_0x3c85ae(0xef)](_0x5206b1=>_0x5206b1['functionName']?.[_0x3c85ae(0x12d)]()['includes'](_0x4e8f21)||_0x5206b1[_0x3c85ae(0xf9)]?.[_0x3c85ae(0x12d)]()[_0x3c85ae(0x109)](_0x4e8f21));}return _0xabce40;}export async function getBffScriptInfo(_0xd1ca75){const _0x3d0fce=a77_0x494c,_0x7e8c0=await apiRequest(_0x3d0fce(0x130)+_0xd1ca75);if(!_0x7e8c0[_0x3d0fce(0x12c)])throw CliErrors[_0x3d0fce(0x13c)](_0x3d0fce(0x11d)+_0xd1ca75);return _0x7e8c0[_0x3d0fce(0x12c)];}export async function saveBffScript(_0x400b5f){const _0x3abc59=a77_0x494c,_0x3a5a44=await apiRequest(_0x3abc59(0xf2),{'method':_0x3abc59(0x122),'body':_0x400b5f});return _0x3a5a44[_0x3abc59(0x12c)];}export async function deleteBffScript(_0x4f6161){const _0x3e4d69=a77_0x494c;await apiRequest(_0x3e4d69(0xdc),{'method':_0x3e4d69(0x122),'body':{'id':_0x4f6161}});}export async function getBffScriptStatistics(_0x4d454f){const _0x29e829=a77_0x494c,_0xcf154f=await apiRequest(_0x29e829(0x10c)+_0x4d454f);return extractList(_0xcf154f[_0x29e829(0x12c)]);}export async function listBffDatasetOperations(_0x290bb4,_0x3701d4){const _0xb6ab0b=a77_0x494c,_0x3634c6=await apiRequest(_0xb6ab0b(0xe1),{'method':_0xb6ab0b(0x122),'body':{'appCode':_0x290bb4,'datasetId':_0x3701d4}});return _0x3634c6[_0xb6ab0b(0x12c)];}export async function listSqlQueries(_0xec6c4c,_0x1fc9c7){const _0x1049f4=a77_0x494c,_0x4438eb=await apiRequest(_0x1049f4(0x103),{'method':'POST','body':{'appCode':_0xec6c4c,'currentPage':_0x1fc9c7?.[_0x1049f4(0xf1)]??0x1,'pageSize':_0x1fc9c7?.[_0x1049f4(0x114)]??0x32,'sqlCode':_0x1fc9c7?.[_0x1049f4(0x119)],'sqlName':_0x1fc9c7?.['sqlName']}});return _0x4438eb['data'];}export async function getSqlQueryInfo(_0x477463,_0x56afa5){const _0x5c9338=a77_0x494c,_0x12467c=await listSqlQueries(_0x477463,{'sqlCode':_0x56afa5}),_0x294193=_0x12467c[_0x5c9338(0x139)]?.[0x0];if(!_0x294193)throw CliErrors[_0x5c9338(0x13c)](_0x5c9338(0x100)+_0x56afa5);return _0x294193;}export async function saveSqlQuery(_0x4da3aa){const _0x3bd751=a77_0x494c,_0x5f3744=await apiRequest(_0x3bd751(0xde),{'method':_0x3bd751(0x122),'body':_0x4da3aa});return _0x5f3744[_0x3bd751(0x12c)];}function a77_0x58d4(){const _0x428d32=['\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','getOne','sqlCode','306qTHJOn','const\x20result\x20=\x20await\x20client.models.','/api/custom/executeSql','BFF\x20script\x20not\x20found:\x20id=','.getOne(id);','sdk','tableName','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','POST','/smartapi/dataset/get-dataset-list','application/json','code','map','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','name','target','signal','requestFields','data','toLowerCase','add','create','/api/management/library/scripts/info?id=','push','entries','API\x20error:\x20','});','\x20\x20pageSize:\x2020,','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','\x20\x20where:\x20{},','enabled','tableData','\x20\x20currentPage:\x201,','Operation\x20\x22','validation','dbtableConfig','143aqFlWL','dataset_','apiError','//\x20SQL:\x20','/api/management/library/scripts/delete','.create({\x20/*\x20fields\x20*/\x20});','/api/node-toolbox/sql/save','Dataset\x20not\x20found:\x20','isArray','/smartapi/dataset/get-dataset-operation','object','errorCode','operations','\x20\x20\x20\x20sqlCode:\x20\x27','/smartapi/dataset/get-driven-data?','435336RYQqqB','find','update','json','//\x20','11410413lzPkMj','join','.remove(id);','filter','method','currentPage','/api/management/library/scripts/save','path','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','operationName','responseFields','267906DGHHIe','errorMsg','description','4330230AvHtcQ','API\x20error\x20code:\x20','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','/api/management/library/scripts/list?appCode=','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','SQL\x20query\x20not\x20found:\x20','6xiZoDf','28206wXYoGz','/smartapi/custom/queryUserCustomSqlList','includeImports','17049220DGaDMY','2185044BAoono','117EWhNmj','remove','includes','has','message','/api/management/library/scripts/statistics?appCode=','44XiKNnO','\x22\x20not\x20found\x20in\x20dataset\x20','success','/smartapi/question/er-config','.filter({','modelId','Request\x20timeout:\x20','pageSize','const\x20data\x20=\x20await\x20client.sql.execute({','modelCode'];a77_0x58d4=function(){return _0x428d32;};return a77_0x58d4();}export async function executeSql(_0x4adcc0,_0x18a315,_0x3bdbfe){const _0x390d3d=a77_0x494c,_0x40c3fd=await apiRequest(_0x390d3d(0x11c),{'method':'POST','body':{'appCode':_0x4adcc0,'sqlCode':_0x18a315,..._0x3bdbfe&&{'params':_0x3bdbfe}},'useRuntime':!![]});return _0x40c3fd['data'];}export async function listDatasets(_0x2abbfd,_0x2f6ff7){const _0x20b18d=a77_0x494c,_0x2bbbc7={'appCode':_0x2abbfd,'deleted':![]};if(_0x2f6ff7?.[_0x20b18d(0x125)])_0x2bbbc7[_0x20b18d(0x125)]=_0x2f6ff7['code'];if(_0x2f6ff7?.[_0x20b18d(0x128)])_0x2bbbc7[_0x20b18d(0x128)]=_0x2f6ff7['name'];const _0x57f174=await apiRequest(_0x20b18d(0x123),{'method':_0x20b18d(0x122),'body':_0x2bbbc7});return extractList(_0x57f174['data']);}export async function searchDatasets(_0x1b7e95,_0x2c86b1){const _0xc67735=a77_0x494c,_0x42dc7f=await listDatasets(_0x1b7e95,{'name':_0x2c86b1}),_0x514611=_0x2c86b1[_0xc67735(0x12d)](),_0x20b459=new Set(_0x42dc7f[_0xc67735(0x126)](_0xb6217f=>_0xb6217f['id'])),_0x5ec099=_0x42dc7f['filter'](_0x17f051=>_0x17f051[_0xc67735(0x13d)]?.['tableName']?.[_0xc67735(0x12d)]()['includes'](_0x514611)||_0x17f051[_0xc67735(0xf9)]?.[_0xc67735(0x12d)]()[_0xc67735(0x109)](_0x514611)),_0x167208=await listDatasets(_0x1b7e95,{'code':_0x2c86b1});for(const _0x247ae3 of _0x167208){!_0x20b459[_0xc67735(0x10a)](_0x247ae3['id'])&&(_0x42dc7f[_0xc67735(0x131)](_0x247ae3),_0x20b459[_0xc67735(0x12e)](_0x247ae3['id']));}return _0x42dc7f;}export function normalizeDatasetOperations(_0x546ea6){const _0x412ec2=a77_0x494c;if(Array[_0x412ec2(0xe0)](_0x546ea6))return _0x546ea6[_0x412ec2(0xef)](_0x39a7ba=>_0x39a7ba!=null&&typeof _0x39a7ba===_0x412ec2(0xe2));if(_0x546ea6&&typeof _0x546ea6===_0x412ec2(0xe2))return Object[_0x412ec2(0x132)](_0x546ea6)[_0x412ec2(0xef)](([,_0xf6a4a2])=>_0xf6a4a2!=null&&typeof _0xf6a4a2===_0x412ec2(0xe2))[_0x412ec2(0x126)](([_0x507462,_0x13eb41])=>({..._0x13eb41,'name':_0x13eb41[_0x412ec2(0x128)]??_0x13eb41[_0x412ec2(0xf5)]??_0x507462}));return[];}export async function getDatasetDetail(_0x1a4a6d){const _0x5b1b3d=a77_0x494c,_0x4a6ce3=/^\d+$/['test'](_0x1a4a6d)?'id':_0x5b1b3d(0x125),_0x1a2ce2=await apiRequest(_0x5b1b3d(0xe6)+_0x4a6ce3+'='+_0x1a4a6d);return _0x1a2ce2[_0x5b1b3d(0x12c)];}export async function getDatasetOperations(_0x46d132){const _0x4bc33a=a77_0x494c,_0x45c546=await getDatasetDetail(_0x46d132),_0xd19f14=normalizeDatasetOperations(_0x45c546[_0x4bc33a(0xe4)])[_0x4bc33a(0x126)](_0x502087=>({'name':_0x502087[_0x4bc33a(0x128)]||_0x502087[_0x4bc33a(0xf5)],'displayName':_0x502087['displayName']||_0x502087['name'],'type':_0x502087['type'],'method':_0x502087[_0x4bc33a(0xf0)],'path':_0x502087[_0x4bc33a(0xf3)],'enabled':_0x502087[_0x4bc33a(0x138)]??!![],'requestFields':_0x502087[_0x4bc33a(0x12b)],'responseFields':_0x502087[_0x4bc33a(0xf6)]}));return{'dataset':{'id':_0x45c546['id']??_0x45c546[_0x4bc33a(0x112)],'name':_0x45c546['name'],'code':_0x45c546[_0x4bc33a(0x125)]||_0x45c546[_0x4bc33a(0x116)],'tableName':_0x45c546['tableName']||_0x45c546[_0x4bc33a(0x13d)]?.[_0x4bc33a(0x120)]},'operations':_0xd19f14};}export async function getOperationDetail(_0x496a6b,_0x27384b,_0x3bb143){const _0x452353=a77_0x494c;let _0x211209=_0x27384b;if(!/^\d+$/['test'](_0x27384b)){const _0x4a076a=await listDatasets(_0x496a6b,{'code':_0x27384b}),_0x1cdf66=_0x4a076a[_0x452353(0xe8)](_0x1d4401=>_0x1d4401['code']===_0x27384b||String(_0x1d4401['id'])===_0x27384b);if(!_0x1cdf66)throw CliErrors[_0x452353(0x13c)](_0x452353(0xdf)+_0x27384b);_0x211209=String(_0x1cdf66['id']);}const _0x1f821f=await getDatasetDetail(_0x211209),_0x3e4352=normalizeDatasetOperations(_0x1f821f['operations'])['find'](_0x39acc0=>(_0x39acc0[_0x452353(0x128)]||_0x39acc0[_0x452353(0xf5)])===_0x3bb143);if(!_0x3e4352)throw CliErrors[_0x452353(0x13c)](_0x452353(0x13b)+_0x3bb143+_0x452353(0x10e)+_0x27384b);return{'dataset':{'id':_0x1f821f['id']??_0x1f821f['modelId'],'name':_0x1f821f[_0x452353(0x128)],'code':_0x1f821f['code']||_0x1f821f[_0x452353(0x116)],'tableName':_0x1f821f['tableName']||_0x1f821f[_0x452353(0x13d)]?.[_0x452353(0x120)]},'operation':_0x3e4352};}export function generateSdkCode(_0x3647ee,_0xd4e77d,_0x177c71){const _0x5920a8=a77_0x494c,_0x420515=_0x177c71?.[_0x5920a8(0x104)]??!![],_0x1a92e7=_0x5920a8(0xd9)+_0x3647ee[_0x5920a8(0x125)]?.['replace'](/-/g,'_'),_0x1d0959=_0xd4e77d['name']||_0xd4e77d[_0x5920a8(0xf5)]||_0x5920a8(0xef),_0x261056=[];_0x420515&&_0x261056[_0x5920a8(0x131)](_0x5920a8(0x127),'',_0x5920a8(0xf4),'');_0x261056[_0x5920a8(0x131)](_0x5920a8(0xeb)+_0x3647ee[_0x5920a8(0x128)]+'\x20('+(_0x3647ee[_0x5920a8(0x120)]||'table')+')');if(_0x1d0959===_0x5920a8(0xef))_0x261056[_0x5920a8(0x131)]('const\x20result\x20=\x20await\x20client.models.'+_0x1a92e7+_0x5920a8(0x111),_0x5920a8(0x137),_0x5920a8(0x135),_0x5920a8(0x13a),_0x5920a8(0x134));else{if(_0x1d0959===_0x5920a8(0x118))_0x261056[_0x5920a8(0x131)](_0x5920a8(0x11b)+_0x1a92e7+_0x5920a8(0x11e));else{if(_0x1d0959===_0x5920a8(0x12f))_0x261056[_0x5920a8(0x131)](_0x5920a8(0x11b)+_0x1a92e7+_0x5920a8(0xdd));else{if(_0x1d0959===_0x5920a8(0xe9))_0x261056[_0x5920a8(0x131)](_0x5920a8(0x11b)+_0x1a92e7+_0x5920a8(0x121));else _0x1d0959==='delete'||_0x1d0959===_0x5920a8(0x108)?_0x261056[_0x5920a8(0x131)](_0x5920a8(0x11b)+_0x1a92e7+_0x5920a8(0xee)):_0x261056['push'](_0x5920a8(0x11b)+_0x1a92e7+'.'+_0x1d0959+'(/*\x20params\x20*/);');}}}return _0x261056[_0x5920a8(0xed)]('\x0a');}export function generateSqlCodeTemplate(_0x26a93f,_0x3b3551){const _0x4c3995=a77_0x494c,_0x8bcee7=_0x3b3551?.[_0x4c3995(0x129)]??_0x4c3995(0x11f),_0x31d2f0=_0x3b3551?.['includeImports']??!![],_0x53bf28=[];return _0x53bf28['push'](_0x4c3995(0xdb)+_0x26a93f['sqlName']+'\x20('+_0x26a93f[_0x4c3995(0x119)]+')'),_0x8bcee7==='sdk'?(_0x31d2f0&&_0x53bf28[_0x4c3995(0x131)](_0x4c3995(0x127),'',_0x4c3995(0xf4),''),_0x53bf28['push'](_0x4c3995(0x115),'\x20\x20sqlCode:\x20\x27'+_0x26a93f[_0x4c3995(0x119)]+'\x27,',_0x4c3995(0xff),_0x4c3995(0x134),_0x4c3995(0xfd),'const\x20results\x20=\x20data.execResult\x20||\x20[];')):_0x53bf28['push'](_0x4c3995(0xfc),'export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x4c3995(0xe5)+_0x26a93f[_0x4c3995(0x119)]+'\x27,',_0x4c3995(0x117),'\x20\x20});','\x20\x20return\x20rows;','}'),_0x53bf28[_0x4c3995(0xed)]('\x0a');}export async function getErConfig(_0x48d585,_0xc1440f){const _0x5d0c72=a77_0x494c,_0xa5203b=await apiRequest(_0x5d0c72(0x110),{'method':_0x5d0c72(0x122),'body':{'appCode':_0x48d585,'dblinkId':_0xc1440f}});return _0xa5203b[_0x5d0c72(0x12c)];}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a78_0x1ea9(){const _0x4d28a0=['494809IJuMdi','/bff','8ZXyYwK','42oNwmvA','165KrzaMW','227676bCxdys','1914940NsgCDQ','20WKBqMz','bff','3319443AlwlFR','540012jYAqmB','bff.lock.json','1209068BUJAKL','bff-trash','1463740yoBxUd','cwd'];a78_0x1ea9=function(){return _0x4d28a0;};return a78_0x1ea9();}const a78_0x30b7f3=a78_0x12e8;function a78_0x12e8(_0x3f1003,_0x2f8d82){_0x3f1003=_0x3f1003-0x186;const _0x1ea9ff=a78_0x1ea9();let _0x12e805=_0x1ea9ff[_0x3f1003];return _0x12e805;}(function(_0x3be62e,_0x4263f6){const _0x7f2d13=a78_0x12e8,_0x330fee=_0x3be62e();while(!![]){try{const _0x590383=parseInt(_0x7f2d13(0x193))/0x1+parseInt(_0x7f2d13(0x18a))/0x2*(parseInt(_0x7f2d13(0x18c))/0x3)+-parseInt(_0x7f2d13(0x18e))/0x4*(-parseInt(_0x7f2d13(0x195))/0x5)+-parseInt(_0x7f2d13(0x191))/0x6+-parseInt(_0x7f2d13(0x187))/0x7+parseInt(_0x7f2d13(0x189))/0x8*(-parseInt(_0x7f2d13(0x190))/0x9)+parseInt(_0x7f2d13(0x18d))/0xa*(-parseInt(_0x7f2d13(0x18b))/0xb);if(_0x590383===_0x4263f6)break;else _0x330fee['push'](_0x330fee['shift']());}catch(_0x191f37){_0x330fee['push'](_0x330fee['shift']());}}}(a78_0x1ea9,0xd3166));import{resolve}from'node:path';const DOT_DIR='.rabetbase',LOCK_FILE_NAME=a78_0x30b7f3(0x192),TRASH_DIR_NAME=a78_0x30b7f3(0x194);export function loadBffProjectConfig(_0x2b42d5,_0x1529eb){const _0x2e192c=a78_0x30b7f3,_0x203ae7=resolve(_0x1529eb??process[_0x2e192c(0x186)]()),_0xaaddf8=DOT_DIR+_0x2e192c(0x188),_0x3fb21c=_0xaaddf8+'/'+_0x2b42d5;return{'projectRoot':_0x203ae7,'appCode':_0x2b42d5,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0xaaddf8,'scriptsRoot':_0x3fb21c,'scriptsRootDir':resolve(_0x203ae7,DOT_DIR,_0x2e192c(0x18f),_0x2b42d5),'lockFilePath':resolve(_0x203ae7,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x203ae7,DOT_DIR,TRASH_DIR_NAME)};}
|