@lovrabet/rabetbase-cli 2.0.11 → 2.0.12
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
|
-
|
|
1
|
+
function a80_0x4e22(){const _0x33dd00=['pipe','skipped','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','write','log','\x20skill\x20installed','cwd','install','10mJZLpd','../../skills/npx-skills-add.js','288294JTEOhG','Check\x20network\x20connectivity\x20and\x20try\x20again.','nonInteractive','2795320fBPMoR','558bTcoZz','setLogPath','634130wrIQnW','info','27MNsCOT','npx\x20skills\x20add\x20failed:\x20','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','error','41010NLjARx','338074gBbfzZ','inherit','apiError','24bggqFl','skill-install','149680VlzevT','Install\x20developer\x20skill\x20package','8636dhLTMD','lovrabet/rabetbase'];a80_0x4e22=function(){return _0x33dd00;};return a80_0x4e22();}const a80_0x31104e=a80_0x1699;(function(_0x386bd4,_0x44fbfa){const _0x2a019c=a80_0x1699,_0x27296f=_0x386bd4();while(!![]){try{const _0x3d7118=parseInt(_0x2a019c(0x1e7))/0x1+parseInt(_0x2a019c(0x1e2))/0x2+-parseInt(_0x2a019c(0x1dd))/0x3*(parseInt(_0x2a019c(0x1e9))/0x4)+parseInt(_0x2a019c(0x1d3))/0x5*(parseInt(_0x2a019c(0x1d5))/0x6)+parseInt(_0x2a019c(0x1db))/0x7*(parseInt(_0x2a019c(0x1e5))/0x8)+parseInt(_0x2a019c(0x1d9))/0x9*(-parseInt(_0x2a019c(0x1e1))/0xa)+-parseInt(_0x2a019c(0x1d8))/0xb;if(_0x3d7118===_0x44fbfa)break;else _0x27296f['push'](_0x27296f['shift']());}catch(_0x170013){_0x27296f['push'](_0x27296f['shift']());}}}(a80_0x4e22,0x26c34));import{CliErrors}from'../../errors.js';function a80_0x1699(_0x216eb5,_0x5db106){_0x216eb5=_0x216eb5-0x1cd;const _0x4e22ec=a80_0x4e22();let _0x169902=_0x4e22ec[_0x216eb5];return _0x169902;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':'skill','command':a80_0x31104e(0x1d2),'description':a80_0x31104e(0x1e8),'risk':a80_0x31104e(0x1ce),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5ba5e4){const _0xdbaca7=a80_0x31104e;logger[_0xdbaca7(0x1da)](process[_0xdbaca7(0x1d1)]()),logger[_0xdbaca7(0x1dc)](_0xdbaca7(0x1e6),_0xdbaca7(0x1cd));const {runNpxSkillsAddGlobal:_0x10ac2e}=await import(_0xdbaca7(0x1d4)),_0x4bf4dd=_0x5ba5e4[_0xdbaca7(0x1d7)]?_0xdbaca7(0x1eb):_0xdbaca7(0x1e3);console[_0xdbaca7(0x1cf)]('Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...');const _0x2d3376=_0x10ac2e(process['cwd'](),_0xdbaca7(0x1ea),{'stdio':_0x4bf4dd});if(_0x2d3376[_0xdbaca7(0x1ec)])console[_0xdbaca7(0x1cf)](_0xdbaca7(0x1df));else{if(_0x2d3376['ok'])console[_0xdbaca7(0x1cf)](CLI_BIN_NAME+_0xdbaca7(0x1d0));else throw CliErrors[_0xdbaca7(0x1e4)](_0xdbaca7(0x1de)+(_0x2d3376[_0xdbaca7(0x1e0)]||'unknown'),_0xdbaca7(0x1d6));}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a81_0x1a940a=a81_0x1f12;(function(_0x4102b6,_0x471c7f){const _0x16debb=a81_0x1f12,_0x34f8c0=_0x4102b6();while(!![]){try{const _0x516537=-parseInt(_0x16debb(0x7c))/0x1*(parseInt(_0x16debb(0x65))/0x2)+-parseInt(_0x16debb(0x6d))/0x3+-parseInt(_0x16debb(0x7a))/0x4+-parseInt(_0x16debb(0x6b))/0x5*(parseInt(_0x16debb(0x71))/0x6)+-parseInt(_0x16debb(0x72))/0x7*(parseInt(_0x16debb(0x66))/0x8)+-parseInt(_0x16debb(0x68))/0x9*(-parseInt(_0x16debb(0x77))/0xa)+-parseInt(_0x16debb(0x73))/0xb*(-parseInt(_0x16debb(0x76))/0xc);if(_0x516537===_0x471c7f)break;else _0x34f8c0['push'](_0x34f8c0['shift']());}catch(_0x3c7c27){_0x34f8c0['push'](_0x34f8c0['shift']());}}}(a81_0x362d,0xb9557));function a81_0x362d(){const _0x1f606d=['1896kOZNMF','130hqzOMR','appCode','sqlName','2240072LxkKTp','str','610424dLLMxu','2naxghd','785904UQOjQE','dbId','790461sBWzqS','read','sqlCode','930QYBCWH','Return\x20full\x20raw\x20SQL\x20query\x20object','3085362Xwvfit','verbose','sql','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','40422acsAnX','91eoaxyu','302599VgvDNV','bool','detail'];a81_0x362d=function(){return _0x1f606d;};return a81_0x362d();}import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a81_0x1f12(_0x122dff,_0x318015){_0x122dff=_0x122dff-0x65;const _0x362d66=a81_0x362d();let _0x1f12c3=_0x362d66[_0x122dff];return _0x1f12c3;}export const sqlDetail={'service':a81_0x1a940a(0x6f),'command':a81_0x1a940a(0x75),'description':a81_0x1a940a(0x70),'risk':a81_0x1a940a(0x69),'flags':[SQLCODE_FLAG,{'name':a81_0x1a940a(0x6e),'type':'boolean','description':a81_0x1a940a(0x6c)}],async 'execute'(_0x52eb2d){const _0x1873fd=a81_0x1a940a,_0x58a117=await getSqlQueryInfo(_0x52eb2d[_0x1873fd(0x78)],_0x52eb2d[_0x1873fd(0x7b)]('sqlcode')),_0x54f203=_0x52eb2d[_0x1873fd(0x74)](_0x1873fd(0x6e));if(_0x54f203)return{'ok':!![],'data':_0x58a117};const _0xe2587=_0x58a117[_0x1873fd(0x67)]?await getDbName(_0x52eb2d[_0x1873fd(0x78)],_0x58a117['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x58a117[_0x1873fd(0x6a)],'sqlName':_0x58a117[_0x1873fd(0x79)],'db':_0xe2587?_0xe2587+'\x20('+_0x58a117[_0x1873fd(0x67)]+')':_0x58a117['dbId']??'','description':_0x58a117['description']??'','sqlContent':_0x58a117['sqlContent']??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a82_0x1f848a=a82_0x3b3b;(function(_0xabb2d5,_0x7af4a5){const _0x5a7fdf=a82_0x3b3b,_0x368927=_0xabb2d5();while(!![]){try{const _0x1d65bb=parseInt(_0x5a7fdf(0x138))/0x1*(-parseInt(_0x5a7fdf(0x13b))/0x2)+-parseInt(_0x5a7fdf(0x134))/0x3+parseInt(_0x5a7fdf(0x139))/0x4+parseInt(_0x5a7fdf(0x137))/0x5*(-parseInt(_0x5a7fdf(0x130))/0x6)+-parseInt(_0x5a7fdf(0x133))/0x7*(parseInt(_0x5a7fdf(0x136))/0x8)+parseInt(_0x5a7fdf(0x131))/0x9+parseInt(_0x5a7fdf(0x12d))/0xa;if(_0x1d65bb===_0x7af4a5)break;else _0x368927['push'](_0x368927['shift']());}catch(_0x33510b){_0x368927['push'](_0x368927['shift']());}}}(a82_0x4ddc,0xc644a));function a82_0x3b3b(_0x4e6ca4,_0x1a6f30){_0x4e6ca4=_0x4e6ca4-0x126;const _0x4ddcb8=a82_0x4ddc();let _0x3b3bd0=_0x4ddcb8[_0x4e6ca4];return _0x3b3bd0;}function a82_0x4ddc(){const _0x383d30=['100270euCdHx','41AwUpik','3898760AWRJTr','\x20row(s)\x20in\x20','40410zstYZo','sqlcode','execError','parse','execResult','Invalid\x20JSON\x20for\x20--params:\x20','sql','length','execSuccess','str','string','now','validation','read','params','23277340qwKWoT','exec','SQL\x20execution\x20failed','138ZSbFey','7240176HGGmTH','isArray','1883YZCQkb','4660452xpyWcY','appCode','13432AhqiPo'];a82_0x4ddc=function(){return _0x383d30;};return a82_0x4ddc();}import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':a82_0x1f848a(0x141),'command':a82_0x1f848a(0x12e),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a82_0x1f848a(0x12b),'flags':[SQLCODE_FLAG,{'name':a82_0x1f848a(0x12c),'type':a82_0x1f848a(0x128),'description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x346370){const _0x217af1=a82_0x1f848a;let _0x573f66;const _0xf07960=_0x346370[_0x217af1(0x127)](_0x217af1(0x12c));if(_0xf07960)try{_0x573f66=JSON[_0x217af1(0x13e)](_0xf07960);}catch{throw CliErrors[_0x217af1(0x12a)](_0x217af1(0x140)+_0xf07960);}const _0x185e11=Date[_0x217af1(0x129)](),_0x26e283=await executeSql(_0x346370[_0x217af1(0x135)],_0x346370[_0x217af1(0x127)](_0x217af1(0x13c)),_0x573f66),_0xc1ae4b=Date[_0x217af1(0x129)]()-_0x185e11,_0x38f99b=_0x26e283?.[_0x217af1(0x13f)]??_0x26e283,_0xe2d4b7=_0x26e283?.[_0x217af1(0x126)]??!![];if(!_0xe2d4b7)return{'ok':![],'data':{'error':_0x26e283?.[_0x217af1(0x13d)]||_0x217af1(0x12f),'elapsed':_0xc1ae4b},'message':_0x217af1(0x12f)};const _0x3ec59f=Array[_0x217af1(0x132)](_0x38f99b)?_0x38f99b:[];return{'ok':!![],'data':{'rows':_0x3ec59f,'rowCount':_0x3ec59f[_0x217af1(0x142)],'elapsed':_0xc1ae4b},'message':'Returned\x20'+_0x3ec59f[_0x217af1(0x142)]+_0x217af1(0x13a)+_0xc1ae4b+'ms'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x595028,_0x394fbf){const _0x1ffe94=a83_0x2c70,_0x2310e9=_0x595028();while(!![]){try{const _0x357430=-parseInt(_0x1ffe94(0x99))/0x1*(-parseInt(_0x1ffe94(0x9c))/0x2)+parseInt(_0x1ffe94(0x97))/0x3+-parseInt(_0x1ffe94(0x9d))/0x4+parseInt(_0x1ffe94(0x9f))/0x5*(-parseInt(_0x1ffe94(0x9b))/0x6)+-parseInt(_0x1ffe94(0x9e))/0x7+-parseInt(_0x1ffe94(0x98))/0x8*(parseInt(_0x1ffe94(0x96))/0x9)+-parseInt(_0x1ffe94(0x9a))/0xa*(-parseInt(_0x1ffe94(0xa0))/0xb);if(_0x357430===_0x394fbf)break;else _0x2310e9['push'](_0x2310e9['shift']());}catch(_0x399e24){_0x2310e9['push'](_0x2310e9['shift']());}}}(a83_0x259b,0xa053f));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a83_0x259b(){const _0x14e30c=['44axegRZ','2310516OaSjiH','1394499LuHcni','32SlrpUG','40088KMfFmU','4945850YDnNCL','732DHnsxR','58yoxzIE','3247676cPEBXY','1176007WTFpyx','38615ytrphW'];a83_0x259b=function(){return _0x14e30c;};return a83_0x259b();}import{sqlValidate}from'../../commands/sql/validate.js';function a83_0x2c70(_0x1a47c0,_0x1c9192){_0x1a47c0=_0x1a47c0-0x96;const _0x259b54=a83_0x259b();let _0x2c70c1=_0x259b54[_0x1a47c0];return _0x2c70c1;}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
|
-
const
|
|
1
|
+
const a84_0x5a281a=a84_0x1226;(function(_0x188f75,_0x5e814f){const _0x494d9b=a84_0x1226,_0x55676c=_0x188f75();while(!![]){try{const _0x4e4328=parseInt(_0x494d9b(0xdb))/0x1+parseInt(_0x494d9b(0xd3))/0x2*(parseInt(_0x494d9b(0xcc))/0x3)+parseInt(_0x494d9b(0xdd))/0x4+parseInt(_0x494d9b(0xe3))/0x5+-parseInt(_0x494d9b(0xd4))/0x6+parseInt(_0x494d9b(0xe0))/0x7+-parseInt(_0x494d9b(0xcf))/0x8;if(_0x4e4328===_0x5e814f)break;else _0x55676c['push'](_0x55676c['shift']());}catch(_0x3e27c8){_0x55676c['push'](_0x55676c['shift']());}}}(a84_0x4b73,0xc100e));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a84_0x1226(_0x1be0d3,_0x1b1a04){_0x1be0d3=_0x1be0d3-0xcb;const _0x4b73d8=a84_0x4b73();let _0x1226c6=_0x4b73d8[_0x1be0d3];return _0x1226c6;}function a84_0x4b73(){const _0x2213b6=['totalCount','verbose','577560rkVtuI','boolean','all','12268160zJcyeN','appCode','name','str','6mJMxpt','5683866ONyvGl','read','length','Page\x20size','list','sqlcode','sqlCode','191293WWzrZG','page','379220BbRoOm','pagesize','List\x20custom\x20SQL\x20queries','8917832ylmjyM','number','num','5668695WDCEes','sql','Filter\x20by\x20SQL\x20name','paging','description','map','bool','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','\x20SQL\x20queries\x20(total:\x20','tableData','dbId'];a84_0x4b73=function(){return _0x2213b6;};return a84_0x4b73();}export const sqlList={'service':a84_0x5a281a(0xe4),'command':a84_0x5a281a(0xd8),'description':a84_0x5a281a(0xdf),'risk':a84_0x5a281a(0xd5),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a84_0x5a281a(0xd1),'type':'string','description':a84_0x5a281a(0xe5)},{'name':a84_0x5a281a(0xdc),'type':a84_0x5a281a(0xe1),'description':'Page\x20number','default':0x1},{'name':a84_0x5a281a(0xde),'type':'number','description':a84_0x5a281a(0xd7)},{'name':'verbose','type':a84_0x5a281a(0xcd),'description':a84_0x5a281a(0xea)}],async 'execute'(_0x4adbdf){const _0x2cf8ad=a84_0x5a281a,_0x385bf5=await listSqlQueries(_0x4adbdf[_0x2cf8ad(0xd0)],{'sqlCode':_0x4adbdf[_0x2cf8ad(0xd2)](_0x2cf8ad(0xd9))||undefined,'sqlName':_0x4adbdf[_0x2cf8ad(0xd2)]('name')||undefined,'currentPage':_0x4adbdf[_0x2cf8ad(0xe2)](_0x2cf8ad(0xdc)),'pageSize':_0x4adbdf['num'](_0x2cf8ad(0xde),0x32)}),_0x589be1=_0x4adbdf[_0x2cf8ad(0xe9)](_0x2cf8ad(0xcb)),_0x2c694d=_0x385bf5[_0x2cf8ad(0xec)]??[],_0x4269eb=_0x385bf5[_0x2cf8ad(0xe6)]?.[_0x2cf8ad(0xee)]??_0x2c694d[_0x2cf8ad(0xd6)];let _0x2263dd;return _0x589be1?_0x2263dd=_0x2c694d:_0x2263dd=await Promise[_0x2cf8ad(0xce)](_0x2c694d[_0x2cf8ad(0xe8)](async _0x592d4d=>{const _0x335370=_0x2cf8ad,_0x39c31f=_0x592d4d[_0x335370(0xed)]?await getDbName(_0x4adbdf[_0x335370(0xd0)],_0x592d4d[_0x335370(0xed)]):undefined;return{'sqlCode':_0x592d4d[_0x335370(0xda)],'sqlName':_0x592d4d['sqlName'],'description':_0x592d4d[_0x335370(0xe7)]??'','db':_0x39c31f?_0x39c31f+'\x20('+_0x592d4d[_0x335370(0xed)]+')':_0x592d4d[_0x335370(0xed)]??''};})),{'ok':!![],'data':_0x2263dd,'message':_0x2c694d[_0x2cf8ad(0xd6)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':'Found\x20'+_0x2c694d[_0x2cf8ad(0xd6)]+_0x2cf8ad(0xeb)+_0x4269eb+').'};}};
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a85_0x48c8be=a85_0xbba2;(function(_0x10009e,_0x516a3e){const _0x5829c2=a85_0xbba2,_0x28e64f=_0x10009e();while(!![]){try{const _0x452c22=-parseInt(_0x5829c2(0x198))/0x1*(parseInt(_0x5829c2(0x1a4))/0x2)+parseInt(_0x5829c2(0x18a))/0x3+-parseInt(_0x5829c2(0x1b2))/0x4+parseInt(_0x5829c2(0x1b0))/0x5+-parseInt(_0x5829c2(0x1a5))/0x6*(parseInt(_0x5829c2(0x1a2))/0x7)+-parseInt(_0x5829c2(0x18f))/0x8+-parseInt(_0x5829c2(0x189))/0x9*(-parseInt(_0x5829c2(0x1a9))/0xa);if(_0x452c22===_0x516a3e)break;else _0x28e64f['push'](_0x28e64f['shift']());}catch(_0x7bd7cf){_0x28e64f['push'](_0x28e64f['shift']());}}}(a85_0x4811,0x2ec5d));function a85_0x4811(){const _0x533d81=['sqlcode','Path\x20to\x20the\x20SQL\x20file','95855kGcsff','dbId','821040axcgjS','type','action','\x20|\x20Params:\x20','string','SQL\x20query\x20description','sqlType','join','SQL\x20query\x20display\x20name','valid','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','1305aHFnig','158037YJpWsk','none','\x20chars)','str','\x20|\x20Tables:\x20','338728sOPdYT','dbName','Conflict\x20detected','Created','sqlCode','POST','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','/api/node-toolbox/sql/save','appCode','92275mplcxj','file','N/A','save','tables','validation','utf-8','message','Updated','SQL\x20validation\x20failed:\x20','91taOQdM','sqlname','6hmCXGc','172296swkTGP','\x20successfully','sql','parameters','70170ZdxoAO','cwd','blocked','Type:\x20','write'];a85_0x4811=function(){return _0x533d81;};return a85_0x4811();}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';function a85_0xbba2(_0x1f105e,_0xe29520){_0x1f105e=_0x1f105e-0x185;const _0x481116=a85_0x4811();let _0xbba24b=_0x481116[_0x1f105e];return _0xbba24b;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a85_0x48c8be(0x1a7),'command':a85_0x48c8be(0x19b),'description':a85_0x48c8be(0x188),'risk':a85_0x48c8be(0x1ad),'flags':[{'name':a85_0x48c8be(0x199),'type':a85_0x48c8be(0x1b6),'required':!![],'description':a85_0x48c8be(0x1af)},SQLCODE_FLAG_OPTIONAL,{'name':a85_0x48c8be(0x1a3),'type':'string','description':a85_0x48c8be(0x186)},{'name':'db','type':a85_0x48c8be(0x1b6),'description':a85_0x48c8be(0x195)},{'name':'description','type':a85_0x48c8be(0x1b6),'description':a85_0x48c8be(0x1b7)}],async 'validate'(_0x13cb19){const _0x1c433b=a85_0x48c8be,_0x4e01d3=resolve(process[_0x1c433b(0x1aa)](),_0x13cb19[_0x1c433b(0x18d)](_0x1c433b(0x199)));if(!existsSync(_0x4e01d3))throw CliErrors[_0x1c433b(0x19d)]('File\x20not\x20found:\x20'+_0x4e01d3);const _0xc307e8=readFileSync(_0x4e01d3,'utf-8'),_0x3c79cc=validateSql(_0xc307e8);if(!_0x3c79cc[_0x1c433b(0x187)])throw CliErrors[_0x1c433b(0x19d)](_0x1c433b(0x1a1)+_0x3c79cc['message']);},async 'dryRun'(_0x44c2ce){const _0x4dfd93=a85_0x48c8be,_0x5bda32=resolve(process[_0x4dfd93(0x1aa)](),_0x44c2ce[_0x4dfd93(0x18d)]('file')),_0x596735=readFileSync(_0x5bda32,_0x4dfd93(0x19e)),_0x42550e=validateSql(_0x596735),_0x2ef34b=_0x44c2ce[_0x4dfd93(0x18d)]('db')||undefined,{db:_0x16197f,error:_0x546e4a}=await resolveOneDb(_0x44c2ce['appCode'],_0x2ef34b);return{'method':_0x4dfd93(0x194),'url':_0x4dfd93(0x196),'body':{'appCode':_0x44c2ce['appCode'],'sqlContent':'('+_0x596735['length']+_0x4dfd93(0x18c),'sqlCode':_0x44c2ce[_0x4dfd93(0x18d)](_0x4dfd93(0x1ae))||undefined,'sqlName':_0x44c2ce[_0x4dfd93(0x18d)](_0x4dfd93(0x1a3))||undefined,'db':_0x16197f?_0x16197f[_0x4dfd93(0x190)]+'\x20('+_0x16197f[_0x4dfd93(0x1b1)]+')':_0x546e4a},'description':['Save\x20SQL\x20query\x20from\x20'+_0x44c2ce[_0x4dfd93(0x18d)](_0x4dfd93(0x199)),'Validation:\x20'+_0x42550e[_0x4dfd93(0x19f)],_0x4dfd93(0x1ac)+_0x42550e[_0x4dfd93(0x1b8)][_0x4dfd93(0x1b3)]+_0x4dfd93(0x18e)+(_0x42550e[_0x4dfd93(0x19c)][_0x4dfd93(0x185)](',\x20')||_0x4dfd93(0x19a))+_0x4dfd93(0x1b5)+(_0x42550e[_0x4dfd93(0x1a8)]['join'](',\x20')||_0x4dfd93(0x18b))][_0x4dfd93(0x185)]('\x0a')};},async 'execute'(_0x5152c7){const _0x3c4cb6=a85_0x48c8be,_0x58dfad=resolve(process['cwd'](),_0x5152c7[_0x3c4cb6(0x18d)](_0x3c4cb6(0x199))),_0x118460=readFileSync(_0x58dfad,'utf-8'),_0x1902f5=_0x5152c7[_0x3c4cb6(0x18d)]('db')||undefined,{db:_0x4c7016,error:_0x369009}=await resolveOneDb(_0x5152c7[_0x3c4cb6(0x197)],_0x1902f5);if(_0x369009)throw CliErrors[_0x3c4cb6(0x19d)](_0x369009);const _0x101b6a=await saveSqlQuery({'appCode':_0x5152c7['appCode'],'sqlContent':_0x118460,'sqlCode':_0x5152c7[_0x3c4cb6(0x18d)]('sqlcode')||undefined,'sqlName':_0x5152c7[_0x3c4cb6(0x18d)]('sqlname')||undefined,'dbId':_0x4c7016[_0x3c4cb6(0x1b1)],'description':_0x5152c7[_0x3c4cb6(0x18d)]('description')||undefined});if(_0x101b6a[_0x3c4cb6(0x1ab)])return{'ok':![],'data':_0x101b6a,'message':_0x101b6a['message']||_0x3c4cb6(0x191)};return{'ok':!![],'data':{'sqlCode':_0x101b6a[_0x3c4cb6(0x193)],'sqlName':_0x101b6a['sqlName'],'action':_0x101b6a[_0x3c4cb6(0x1b4)]},'message':(_0x101b6a[_0x3c4cb6(0x1b4)]==='created'?_0x3c4cb6(0x192):_0x3c4cb6(0x1a0))+_0x3c4cb6(0x1a6)+(_0x101b6a[_0x3c4cb6(0x193)]?'\x20('+_0x101b6a['sqlCode']+')':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a86_0x343c38=a86_0x3ff9;function a86_0x4629(){const _0xc686b4=['filter','split','854676OKSILc','validate','push','valid','string','type','str','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','toLowerCase','File\x20not\x20found:\x20','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','3224OYRiry','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','isDangerous','10215NbHaMt','appCode','isArray','22flDfjF','flagMissing','map','9032652XsmJGw','\x22\x20not\x20found\x20in\x20any\x20dataset','sql','dbtableConfig','637076fwQmuE','36GvYMAD','isSelectOnly','validation','Provide\x20--file\x20or\x20--sql','tableName','message','sqlType','read','schemas','tables','name','70ziFIZB','reason','1799718QQjiEj','file','\x22\x20not\x20found\x20or\x20not\x20accessible','29555PeBUmZ','10mabPqu','schema:','utf-8','63846eydfly','fields'];a86_0x4629=function(){return _0xc686b4;};return a86_0x4629();}(function(_0x449447,_0x28e18c){const _0x237d28=a86_0x3ff9,_0xd1319e=_0x449447();while(!![]){try{const _0x51dedf=parseInt(_0x237d28(0x133))/0x1+-parseInt(_0x237d28(0x14f))/0x2*(-parseInt(_0x237d28(0x13a))/0x3)+parseInt(_0x237d28(0x126))/0x4*(-parseInt(_0x237d28(0x136))/0x5)+-parseInt(_0x237d28(0x13e))/0x6*(parseInt(_0x237d28(0x131))/0x7)+-parseInt(_0x237d28(0x149))/0x8*(parseInt(_0x237d28(0x14c))/0x9)+parseInt(_0x237d28(0x137))/0xa*(parseInt(_0x237d28(0x125))/0xb)+parseInt(_0x237d28(0x152))/0xc;if(_0x51dedf===_0x28e18c)break;else _0xd1319e['push'](_0xd1319e['shift']());}catch(_0x5f3d5f){_0xd1319e['push'](_0xd1319e['shift']());}}}(a86_0x4629,0xde051));import{readFileSync,existsSync}from'node:fs';function a86_0x3ff9(_0x1e51fd,_0xf0e7c4){_0x1e51fd=_0x1e51fd-0x122;const _0x462943=a86_0x4629();let _0x3ff9e5=_0x462943[_0x1e51fd];return _0x3ff9e5;}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':a86_0x343c38(0x123),'command':a86_0x343c38(0x13f),'description':a86_0x343c38(0x148),'risk':a86_0x343c38(0x12d),'flags':[{'name':a86_0x343c38(0x134),'type':a86_0x343c38(0x142),'description':a86_0x343c38(0x145)},{'name':a86_0x343c38(0x123),'type':a86_0x343c38(0x142),'description':a86_0x343c38(0x14a)},{'name':a86_0x343c38(0x12e),'type':a86_0x343c38(0x142),'description':'Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against'}],async 'execute'(_0x172f92){const _0x3c337c=a86_0x343c38,_0x34d596=_0x172f92[_0x3c337c(0x144)](_0x3c337c(0x134)),_0x2ed46d=_0x172f92['str'](_0x3c337c(0x123));if(!_0x34d596&&!_0x2ed46d)throw CliErrors[_0x3c337c(0x150)](_0x3c337c(0x134),_0x3c337c(0x129));let _0x164760;if(_0x34d596){const _0xea32eb=resolve(process['cwd'](),_0x34d596);if(!existsSync(_0xea32eb))throw CliErrors[_0x3c337c(0x128)](_0x3c337c(0x147)+_0xea32eb);_0x164760=readFileSync(_0xea32eb,_0x3c337c(0x139));}else _0x164760=_0x2ed46d;const _0x2bf1e2=validateSql(_0x164760),_0x31c1e0={'valid':_0x2bf1e2[_0x3c337c(0x141)],'sqlType':_0x2bf1e2['sqlType'][_0x3c337c(0x143)],'isSelectOnly':_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x127)],'isDangerous':_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x14b)],'tables':_0x2bf1e2[_0x3c337c(0x12f)],'parameters':_0x2bf1e2['parameters'],'message':_0x2bf1e2['message']};_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x132)]&&(_0x31c1e0['reason']=_0x2bf1e2[_0x3c337c(0x12c)][_0x3c337c(0x132)]);const _0x5b2d06=_0x172f92['str']('schemas');if(_0x5b2d06&&_0x2bf1e2[_0x3c337c(0x141)]){const _0x1d4f76=_0x5b2d06[_0x3c337c(0x13d)](',')['map'](_0x31ca23=>_0x31ca23['trim']())[_0x3c337c(0x13c)](Boolean),_0x346b8a=[],_0x2d363e=await listDatasets(_0x172f92[_0x3c337c(0x14d)]),_0xd619d1=new Map(_0x2d363e[_0x3c337c(0x151)](_0x3a310c=>[_0x3a310c[_0x3c337c(0x124)]?.[_0x3c337c(0x12a)]?.[_0x3c337c(0x146)](),_0x3a310c]));for(const _0xab74ec of _0x2bf1e2[_0x3c337c(0x12f)]){const _0x33511c=_0xd619d1['get'](_0xab74ec[_0x3c337c(0x146)]());!_0x33511c&&_0x346b8a[_0x3c337c(0x140)]('Table\x20\x22'+_0xab74ec+_0x3c337c(0x122));}for(const _0x2468f8 of _0x1d4f76){try{const _0x32fd45=await getDatasetDetail(_0x2468f8),_0x1b31b3=Array[_0x3c337c(0x14e)](_0x32fd45[_0x3c337c(0x13b)])?_0x32fd45[_0x3c337c(0x13b)]:[],_0x4c56fc=new Set(_0x1b31b3[_0x3c337c(0x151)](_0x8b03fd=>_0x8b03fd[_0x3c337c(0x130)]?.[_0x3c337c(0x146)]())),_0x1a3b8d=_0x32fd45[_0x3c337c(0x124)]?.[_0x3c337c(0x12a)]||_0x32fd45[_0x3c337c(0x12a)]||_0x2468f8;_0x31c1e0[_0x3c337c(0x138)+_0x1a3b8d]={'code':_0x2468f8,'tableName':_0x1a3b8d,'fieldCount':_0x4c56fc['size'],'fields':Array['from'](_0x4c56fc)};}catch{_0x346b8a[_0x3c337c(0x140)]('Dataset\x20\x22'+_0x2468f8+_0x3c337c(0x135));}}_0x346b8a['length']>0x0&&(_0x31c1e0['schemaWarnings']=_0x346b8a);}return{'ok':_0x2bf1e2[_0x3c337c(0x141)],'data':_0x31c1e0,'message':_0x2bf1e2[_0x3c337c(0x12b)]};}};
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a87_0x3b5edb=a87_0x49eb;function a87_0x49eb(_0x3b3039,_0x2b9d0e){_0x3b3039=_0x3b3039-0xf9;const _0x5a9f2d=a87_0x5a9f();let _0x49eb88=_0x5a9f2d[_0x3b3039];return _0x49eb88;}function a87_0x5a9f(){const _0x8d43f=['env','SQL\x20string','appcode','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','description','File\x20path','yes','86hMTaHT','Show\x20help','format','Force\x20overwrite','dbid','function-node','Override\x20appcode','Environment','skipImports','app','dryRun','operation','pagesize','sqlname','enable-bff-save','10qxAzxB','clear','Config\x20value','Apply\x20to\x20all','Page\x20size','Clear','8DBkIEZ','remote','skip-imports','sqlcode','key','Keyword\x20filter','170TKUFVt','Name','map','value','page','rabetbase','project','Rabetbase\x20CLI','output','target','code','Page\x20number','dry-run','help','Record\x20ID','Preview\x20operation\x20without\x20executing','Enable\x20BFF\x20save','Config\x20key','Output\x20path','meowKey','Alias\x20for\x20--non-interactive','params','verbose','SQL\x20code','Use\x20project\x20config\x20scope','string','functionNode','17961VeYUFw','all','JSON\x20params','Type\x20filter','2594067gcUZCb','sql','3186372uYJpew','<expr>','Schemas','datasetcode','719140mjWIWm','watch','467253JEjqDE','boolean','schemas','<name>','Watch\x20mode','Operation\x20type','non-interactive','Verbose\x20output','file','name','17061363yMvjIW','Function\x20node','2313lnpGzz','Skip\x20import\x20generation','force','Output\x20format','SQL\x20name','keyword'];a87_0x5a9f=function(){return _0x8d43f;};return a87_0x5a9f();}(function(_0x3e317e,_0x54af10){const _0xcf6ba3=a87_0x49eb,_0x9d9205=_0x3e317e();while(!![]){try{const _0x95cec9=parseInt(_0xcf6ba3(0x144))/0x1+parseInt(_0xcf6ba3(0x102))/0x2*(-parseInt(_0xcf6ba3(0x138))/0x3)+-parseInt(_0xcf6ba3(0x142))/0x4*(parseInt(_0xcf6ba3(0x111))/0x5)+-parseInt(_0xcf6ba3(0x13e))/0x6+parseInt(_0xcf6ba3(0x13c))/0x7*(-parseInt(_0xcf6ba3(0x117))/0x8)+-parseInt(_0xcf6ba3(0x150))/0x9*(-parseInt(_0xcf6ba3(0x11d))/0xa)+parseInt(_0xcf6ba3(0x14e))/0xb;if(_0x95cec9===_0x54af10)break;else _0x9d9205['push'](_0x9d9205['shift']());}catch(_0x23cc6e){_0x9d9205['push'](_0x9d9205['shift']());}}}(a87_0x5a9f,0x7b0c1));export const CLI_BIN_NAME=a87_0x3b5edb(0x122);export const CLI_DISPLAY_NAME=a87_0x3b5edb(0x124);export const NPM_PACKAGE_NAME='@lovrabet/rabetbase-cli';export const GLOBAL_FLAGS=[{'name':'appcode','meowKey':a87_0x3b5edb(0xfd),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x108),'hint':'<code>'},{'name':a87_0x3b5edb(0x10b),'meowKey':a87_0x3b5edb(0x10b),'type':'string','description':'Select\x20app\x20profile\x20by\x20name','hint':a87_0x3b5edb(0x147)},{'name':a87_0x3b5edb(0xfb),'meowKey':a87_0x3b5edb(0xfb),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x109),'hint':'production\x20|\x20daily'},{'name':a87_0x3b5edb(0x104),'meowKey':'format','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x153),'hint':'json\x20|\x20pretty\x20|\x20compress'},{'name':'jq','meowKey':'jq','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0xfe),'hint':a87_0x3b5edb(0x13f)},{'name':a87_0x3b5edb(0x129),'meowKey':a87_0x3b5edb(0x10c),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x12c)},{'name':'yes','meowKey':a87_0x3b5edb(0x101),'type':a87_0x3b5edb(0x145),'description':'Skip\x20confirmation\x20for\x20high-risk\x20writes'},{'name':a87_0x3b5edb(0x14a),'meowKey':'nonInteractive','type':a87_0x3b5edb(0x145),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':'global','meowKey':'global','type':a87_0x3b5edb(0x145),'description':'Use\x20global\x20config\x20scope'},{'name':a87_0x3b5edb(0x123),'meowKey':a87_0x3b5edb(0x123),'type':'boolean','description':a87_0x3b5edb(0x135)},{'name':'ci','meowKey':'ci','type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x131),'hidden':!![]},{'name':a87_0x3b5edb(0x12a),'meowKey':'help','type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x103)},{'name':a87_0x3b5edb(0x14d),'meowKey':a87_0x3b5edb(0x14d),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x11e),'hidden':!![]},{'name':a87_0x3b5edb(0x112),'meowKey':a87_0x3b5edb(0x112),'type':'boolean','description':a87_0x3b5edb(0x116),'hidden':!![]},{'name':a87_0x3b5edb(0x143),'meowKey':a87_0x3b5edb(0x143),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x148),'hidden':!![]},{'name':'output','meowKey':a87_0x3b5edb(0x125),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x12f),'hidden':!![]},{'name':'params','meowKey':a87_0x3b5edb(0x132),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x13a),'hidden':!![]},{'name':a87_0x3b5edb(0x141),'meowKey':a87_0x3b5edb(0x141),'type':a87_0x3b5edb(0x136),'description':'Dataset\x20code','hidden':!![]},{'name':a87_0x3b5edb(0x139),'meowKey':a87_0x3b5edb(0x139),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x114),'hidden':!![]},{'name':a87_0x3b5edb(0x110),'meowKey':'enableBffSave','type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x12d),'hidden':!![]},{'name':'id','meowKey':'id','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x12b),'hidden':!![]},{'name':'type','meowKey':'type','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x13b),'hidden':!![]},{'name':a87_0x3b5edb(0x14c),'meowKey':a87_0x3b5edb(0x14c),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x100),'hidden':!![]},{'name':'sqlcode','meowKey':a87_0x3b5edb(0x11a),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x134),'hidden':!![]},{'name':a87_0x3b5edb(0x10f),'meowKey':'sqlname','type':'string','description':a87_0x3b5edb(0xf9),'hidden':!![]},{'name':a87_0x3b5edb(0x106),'meowKey':a87_0x3b5edb(0x106),'type':'string','description':'DB\x20ID','hidden':!![]},{'name':a87_0x3b5edb(0xff),'meowKey':a87_0x3b5edb(0xff),'type':a87_0x3b5edb(0x136),'description':'Description','hidden':!![]},{'name':a87_0x3b5edb(0x121),'meowKey':a87_0x3b5edb(0x121),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x128),'hidden':!![]},{'name':a87_0x3b5edb(0x10e),'meowKey':a87_0x3b5edb(0x10e),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x115),'hidden':!![]},{'name':a87_0x3b5edb(0xfa),'meowKey':a87_0x3b5edb(0xfa),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x11c),'hidden':!![]},{'name':a87_0x3b5edb(0x127),'meowKey':a87_0x3b5edb(0x127),'type':'string','description':'Code\x20filter','hidden':!![]},{'name':'sql','meowKey':a87_0x3b5edb(0x13d),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0xfc),'hidden':!![]},{'name':a87_0x3b5edb(0x146),'meowKey':a87_0x3b5edb(0x146),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x140),'hidden':!![]},{'name':a87_0x3b5edb(0x10d),'meowKey':a87_0x3b5edb(0x10d),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x149),'hidden':!![]},{'name':a87_0x3b5edb(0x126),'meowKey':'target','type':a87_0x3b5edb(0x136),'description':'Target\x20path','hidden':!![]},{'name':a87_0x3b5edb(0x119),'meowKey':a87_0x3b5edb(0x10a),'type':'boolean','description':a87_0x3b5edb(0x151),'hidden':!![]},{'name':a87_0x3b5edb(0x11b),'meowKey':a87_0x3b5edb(0x11b),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x12e),'hidden':!![]},{'name':a87_0x3b5edb(0x120),'meowKey':'value','type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x113),'hidden':!![]},{'name':a87_0x3b5edb(0x152),'meowKey':a87_0x3b5edb(0x152),'type':a87_0x3b5edb(0x145),'description':a87_0x3b5edb(0x105),'hidden':!![]},{'name':'remote','meowKey':a87_0x3b5edb(0x118),'type':a87_0x3b5edb(0x145),'description':'Use\x20remote','hidden':!![]},{'name':a87_0x3b5edb(0x133),'meowKey':'verbose','type':'boolean','description':a87_0x3b5edb(0x14b),'hidden':!![]},{'name':'operation-type','meowKey':'operationType','type':'string','description':a87_0x3b5edb(0x149),'hidden':!![]},{'name':a87_0x3b5edb(0x107),'meowKey':a87_0x3b5edb(0x137),'type':a87_0x3b5edb(0x136),'description':a87_0x3b5edb(0x14f),'hidden':!![]}];export function buildMeowFlags(){const _0x395a0e=a87_0x3b5edb;return Object['fromEntries'](GLOBAL_FLAGS[_0x395a0e(0x11f)](_0x343161=>[_0x343161[_0x395a0e(0x130)],{'type':_0x343161['type']}]));}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a88_0x67da57=a88_0x17b7;(function(_0x4f97a6,_0x156868){const _0x3fd175=a88_0x17b7,_0x4beb41=_0x4f97a6();while(!![]){try{const _0x3958bc=-parseInt(_0x3fd175(0x1ef))/0x1*(-parseInt(_0x3fd175(0x1e2))/0x2)+parseInt(_0x3fd175(0x1e8))/0x3*(parseInt(_0x3fd175(0x1ea))/0x4)+-parseInt(_0x3fd175(0x1ee))/0x5+-parseInt(_0x3fd175(0x1e7))/0x6+parseInt(_0x3fd175(0x1f0))/0x7*(-parseInt(_0x3fd175(0x1e1))/0x8)+parseInt(_0x3fd175(0x1f3))/0x9+parseInt(_0x3fd175(0x1e6))/0xa*(parseInt(_0x3fd175(0x1e4))/0xb);if(_0x3958bc===_0x156868)break;else _0x4beb41['push'](_0x4beb41['shift']());}catch(_0x503a49){_0x4beb41['push'](_0x4beb41['shift']());}}}(a88_0x31b4,0x46eb5));function a88_0x31b4(){const _0x259192=['https://daily-api.lovrabet.com','18330XDDezS','3272802hlFzpv','3QCDzRm','https://api.lovrabet.com','288712BbSkxQ','apiDomain','https://runtime.lovrabet.com','https://daily-runtime.lovrabet.com','96595Wbhpql','13mPIout','434RSlINJ','production','runtimeDomain','2205576sLzwiB','11192PToQyy','44794nfffyo','https://user-daily.lovrabet.com','2002kGjCjs'];a88_0x31b4=function(){return _0x259192;};return a88_0x31b4();}import{getEnv}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x157198){const _0x251c2a=a88_0x17b7;customApiDomain=_0x157198?.[_0x251c2a(0x1eb)],customUserDomain=_0x157198?.['userDomain'],customRuntimeDomain=_0x157198?.[_0x251c2a(0x1f2)];}function a88_0x17b7(_0x310261,_0x50d926){_0x310261=_0x310261-0x1e1;const _0x31b492=a88_0x31b4();let _0x17b7bd=_0x31b492[_0x310261];return _0x17b7bd;}export const getUserDomain=()=>customUserDomain||(getEnv()===a88_0x67da57(0x1f1)?'https://user.lovrabet.com':a88_0x67da57(0x1e3));export const getApiDomain=()=>customApiDomain||(getEnv()===a88_0x67da57(0x1f1)?a88_0x67da57(0x1e9):a88_0x67da57(0x1e5));export const getRuntimeDomain=()=>customRuntimeDomain||(getEnv()===a88_0x67da57(0x1f1)?a88_0x67da57(0x1ec):a88_0x67da57(0x1ed));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a89_0x4e6af8=a89_0x12fe;(function(_0xc8e41f,_0x3d56d7){const _0x446730=a89_0x12fe,_0x127c95=_0xc8e41f();while(!![]){try{const _0x11a027=-parseInt(_0x446730(0x1f4))/0x1+parseInt(_0x446730(0x1f1))/0x2*(-parseInt(_0x446730(0x1f8))/0x3)+parseInt(_0x446730(0x1f9))/0x4+parseInt(_0x446730(0x1f0))/0x5+parseInt(_0x446730(0x1fa))/0x6+parseInt(_0x446730(0x1f3))/0x7*(parseInt(_0x446730(0x1f2))/0x8)+-parseInt(_0x446730(0x1ef))/0x9*(parseInt(_0x446730(0x1f5))/0xa);if(_0x11a027===_0x3d56d7)break;else _0x127c95['push'](_0x127c95['shift']());}catch(_0x176133){_0x127c95['push'](_0x127c95['shift']());}}}(a89_0x4b28,0x3fa41));export function normalizeEnv(_0x3d1836){const _0xbf5d27=a89_0x12fe;return _0x3d1836===_0xbf5d27(0x1f6)?_0xbf5d27(0x1f7):_0x3d1836;}function a89_0x4b28(){const _0x4043f7=['1430664fyWxla','14IuiYxB','25124zZbVZA','1149460yMfrdu','online','production','48ZTJeJR','658812DqvyeT','2423010SZyBIL','63UsCMRA','1587635zrKXyb','19164xZkwFS'];a89_0x4b28=function(){return _0x4043f7;};return a89_0x4b28();}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a89_0x4e6af8(0x1f7));function a89_0x12fe(_0x5e163c,_0x494688){_0x5e163c=_0x5e163c-0x1ef;const _0x4b2848=a89_0x4b28();let _0x12fec4=_0x4b2848[_0x5e163c];return _0x12fec4;}export function getEnv(){return env;}export function initEnv(_0x5e9c71){env=normalizeEnv(_0x5e9c71);}
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a90_0x558a7d=a90_0x3a40;(function(_0x25a378,_0x15cc68){const _0x2584e0=a90_0x3a40,_0x1fa9f7=_0x25a378();while(!![]){try{const _0x4afb4e=-parseInt(_0x2584e0(0x110))/0x1*(parseInt(_0x2584e0(0x10d))/0x2)+-parseInt(_0x2584e0(0x10e))/0x3+-parseInt(_0x2584e0(0x10f))/0x4*(parseInt(_0x2584e0(0x113))/0x5)+parseInt(_0x2584e0(0x112))/0x6+-parseInt(_0x2584e0(0x10a))/0x7+parseInt(_0x2584e0(0x10c))/0x8+parseInt(_0x2584e0(0x111))/0x9;if(_0x4afb4e===_0x15cc68)break;else _0x1fa9f7['push'](_0x1fa9f7['shift']());}catch(_0x164b04){_0x1fa9f7['push'](_0x1fa9f7['shift']());}}}(a90_0x54e4,0x618aa));function a90_0x3a40(_0x2e009e,_0x4e0a63){_0x2e009e=_0x2e009e-0x10a;const _0x54e424=a90_0x54e4();let _0x3a40c1=_0x54e424[_0x2e009e];return _0x3a40c1;}function a90_0x54e4(){const _0x2f55e8=['2165889eJaJYA','16BTZhSh','28yporNm','13374477cBQEjc','2172066idXEUj','328835mtIxKT','3864560GIGBfO','./src/api','4901672cgIYCs','37438jyvaYp'];a90_0x54e4=function(){return _0x2f55e8;};return a90_0x54e4();}export const DEFAULT_API_DIR=a90_0x558a7d(0x10b);
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
const a91_0x29b968=a91_0x4b98;(function(_0x2c8317,_0x23af63){const _0x54c875=a91_0x4b98,_0x362be2=_0x2c8317();while(!![]){try{const _0x301e41=parseInt(_0x54c875(0x1b6))/0x1+-parseInt(_0x54c875(0x1de))/0x2+-parseInt(_0x54c875(0x1bf))/0x3+-parseInt(_0x54c875(0x1df))/0x4+-parseInt(_0x54c875(0x1d6))/0x5+parseInt(_0x54c875(0x1cc))/0x6*(parseInt(_0x54c875(0x1db))/0x7)+parseInt(_0x54c875(0x19b))/0x8;if(_0x301e41===_0x23af63)break;else _0x362be2['push'](_0x362be2['shift']());}catch(_0x308a76){_0x362be2['push'](_0x362be2['shift']());}}}(a91_0x4c80,0x9375a));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';function a91_0x4c80(){const _0x1196b6=['.lovrabet.json','defaultApp','userDomain','\x0a\x20\x20','APPCODE','find','argv','api.ts','filter','inherit','true','high-risk-write','./constant/env.js','334169cIhGOl','read','COOKIE','APP','error','online','apiDir','empty','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','1485648cHKjIz','./constant/domain.js','missing','ENV','.rabetbase.json','locale','entries','keys','slice','apps','./utils/is-non-interactive.js','silent','message','1776rCkEeU','object','runtimeDomain','pageSize','utf8','join','cookie','daily','format','production','1983915dHKLPn','maxRisk','authRequired','write','stringify','6475DYjzUj','Global','riskLevel','1570200LJodDe','3323712oRXRJk','./auth/get-cookie.js','.lovrabetrc','-api.ts','setRawCommand','RISK_LEVEL','cwd','length','project','20032416RRWrPd','trim','ACCESS_KEY','MAX_RISK','parse','env','VERBOSE','accessKey','string','en-US','warn','PAGE_SIZE','status','appcode'];a91_0x4c80=function(){return _0x1196b6;};return a91_0x4c80();}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';import{DEFAULT_API_DIR}from'./constant/paths.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0xb51c68){return process.env[`RABETBASE_${_0xb51c68}`]||process.env[`LOVRABET_${_0xb51c68}`]||undefined;}export const NEW_CONFIG_NAME=a91_0x29b968(0x1c3);export const CONFIG_NAMES=[a91_0x29b968(0x1c3),a91_0x29b968(0x1a9),a91_0x29b968(0x1e1)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a91_0x29b968(0x1b1)](_0x595d11=>_0x595d11!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x548707){for(const _0x1e0707 of CONFIG_NAMES){const _0xffc86d=resolve(_0x548707,_0x1e0707);if(existsSync(_0xffc86d))return _0xffc86d;}return undefined;}export async function createContext(_0x165fc5){const _0x3c9976=a91_0x29b968,_0x5cbcc8=readRawConfig(),_0x39a319=buildConfig(_0x5cbcc8,_0x165fc5),{initEnv:_0x2e671c}=await import(_0x3c9976(0x1b5));if(_0x39a319['env'])_0x2e671c(_0x39a319[_0x3c9976(0x1a0)]);else _0x165fc5[_0x3c9976(0x1a0)]&&typeof _0x165fc5[_0x3c9976(0x1a0)]===_0x3c9976(0x1a3)&&_0x2e671c(_0x165fc5[_0x3c9976(0x1a0)]);const {initDomains:_0x5bddf2,getUserDomain:_0x16b163,getApiDomain:_0x4336ef}=await import(_0x3c9976(0x1c0));_0x5bddf2({'apiDomain':_0x5cbcc8['apiDomain']||undefined,'userDomain':_0x5cbcc8[_0x3c9976(0x1ab)]||undefined,'runtimeDomain':_0x5cbcc8[_0x3c9976(0x1ce)]||undefined});const _0x5a1a37={'apiDomain':_0x4336ef(),'userDomain':_0x16b163()},_0x434056=await buildAuth(_0x39a319);logger['setLogPath'](process[_0x3c9976(0x198)]());const _0x7f0754=(CLI_BIN_NAME+'\x20'+process[_0x3c9976(0x1af)][_0x3c9976(0x1c7)](0x2)[_0x3c9976(0x1d1)]('\x20'))[_0x3c9976(0x19c)]();logger[_0x3c9976(0x196)](_0x7f0754);const {isNonInteractive:_0x31d56b}=await import(_0x3c9976(0x1c9)),_0x182904=_0x31d56b(_0x165fc5);return{'config':_0x39a319,'auth':_0x434056,'logger':logger,'env':_0x5a1a37,'nonInteractive':_0x182904};}export function buildConfigFromFlags(_0x29a6b7){return buildConfig(readRawConfig(),_0x29a6b7);}export function getProjectConfigPath(){const _0x3e430b=a91_0x29b968;return resolveConfigPath(process[_0x3e430b(0x198)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x4fb63d){const _0xfb5bce=a91_0x29b968;if(!existsSync(_0x4fb63d))return{'status':'missing'};try{const _0xbd76a8=readFileSync(_0x4fb63d,{'encoding':'utf8'});if(!_0xbd76a8?.[_0xfb5bce(0x19c)]())return{'status':_0xfb5bce(0x1bd)};const _0x54a63a=JSON[_0xfb5bce(0x19f)](_0xbd76a8);return{'status':'ok','data':_0x54a63a};}catch(_0x1be69e){return{'status':_0xfb5bce(0x1ba),'message':_0x1be69e instanceof Error?_0x1be69e[_0xfb5bce(0x1cb)]:String(_0x1be69e)};}}function parseCliConfigJsonFile(_0x5c5b06,_0x1207a2,_0x4b50d6){const _0x28a6ad=a91_0x29b968,_0x128d9b=inspectCliConfigJsonFile(_0x5c5b06);if(_0x128d9b['status']===_0x28a6ad(0x1c1)||_0x128d9b[_0x28a6ad(0x1a7)]===_0x28a6ad(0x1bd))return{};if(_0x128d9b[_0x28a6ad(0x1a7)]==='ok')return _0x128d9b['data'];return _0x1207a2===_0x28a6ad(0x1a5)&&_0x4b50d6&&console[_0x28a6ad(0x1ba)](CLI_BIN_NAME+':\x20'+_0x4b50d6+_0x28a6ad(0x1be)+_0x5c5b06+_0x28a6ad(0x1ac)+_0x128d9b['message']),{};}function a91_0x4b98(_0xdeb1c2,_0x5595f0){_0xdeb1c2=_0xdeb1c2-0x196;const _0x4c80be=a91_0x4c80();let _0x4b989b=_0x4c80be[_0xdeb1c2];return _0x4b989b;}export function loadRawConfigLayers(_0x23a424){const _0x19e673=a91_0x29b968;let _0xe7de52={},_0x45e965={};const _0x3f9457=resolveConfigPath(homedir());_0x3f9457&&(_0xe7de52=parseCliConfigJsonFile(_0x3f9457,_0x19e673(0x1a5),_0x19e673(0x1dc)));const _0x474dfd=_0x23a424||process[_0x19e673(0x198)](),_0x370df4=resolveConfigPath(_0x474dfd);return _0x370df4&&(_0x45e965=parseCliConfigJsonFile(_0x370df4,'warn','Project')),{'globalPath':_0x3f9457,'projectPath':_0x370df4,'globalConfig':_0xe7de52,'projectConfig':_0x45e965};}function mergeRawConfigLayers(_0x212792){const _0x39e50f=a91_0x29b968,{globalConfig:_0x5eff93,projectConfig:_0x2e0f6c}=_0x212792;if(_0x2e0f6c[_0x39e50f(0x1b2)]===![]){const _0x579bc6={..._0x2e0f6c};delete _0x579bc6[_0x39e50f(0x1b2)];const _0x205ad8=_0x2e0f6c[_0x39e50f(0x1c8)]&&typeof _0x2e0f6c[_0x39e50f(0x1c8)]===_0x39e50f(0x1cd)?_0x2e0f6c[_0x39e50f(0x1c8)]:{};Object['keys'](_0x205ad8)[_0x39e50f(0x199)]>0x0?_0x579bc6[_0x39e50f(0x1c8)]=_0x205ad8:delete _0x579bc6[_0x39e50f(0x1c8)];if(_0x39e50f(0x1aa)in _0x2e0f6c)_0x579bc6['defaultApp']=_0x2e0f6c[_0x39e50f(0x1aa)];else Object['keys'](_0x205ad8)[_0x39e50f(0x199)]>0x0&&(_0x579bc6['defaultApp']=Object[_0x39e50f(0x1c6)](_0x205ad8)[0x0]);return _0x579bc6;}const _0x1950ea=_0x5eff93[_0x39e50f(0x1c8)]&&typeof _0x5eff93[_0x39e50f(0x1c8)]===_0x39e50f(0x1cd)?_0x5eff93['apps']:{},_0x386958=_0x2e0f6c[_0x39e50f(0x1c8)]&&typeof _0x2e0f6c[_0x39e50f(0x1c8)]==='object'?_0x2e0f6c[_0x39e50f(0x1c8)]:{},_0x124b1a={..._0x1950ea,..._0x386958},_0x38892d={..._0x5eff93,..._0x2e0f6c};Object[_0x39e50f(0x1c6)](_0x124b1a)[_0x39e50f(0x199)]>0x0&&(_0x38892d['apps']=_0x124b1a);if('defaultApp'in _0x2e0f6c)_0x38892d[_0x39e50f(0x1aa)]=_0x2e0f6c[_0x39e50f(0x1aa)];else{if(_0x386958&&Object[_0x39e50f(0x1c6)](_0x386958)[_0x39e50f(0x199)]>0x0)_0x38892d[_0x39e50f(0x1aa)]=Object['keys'](_0x386958)[0x0];else _0x5eff93[_0x39e50f(0x1aa)]&&(_0x38892d['defaultApp']=_0x5eff93[_0x39e50f(0x1aa)]);}return _0x38892d;}export function readRawConfigWithLayers(_0x1c2aff){const _0x374045=loadRawConfigLayers(_0x1c2aff);return{'config':mergeRawConfigLayers(_0x374045),'layers':_0x374045};}export function readRawConfig(_0x429f8f){return mergeRawConfigLayers(loadRawConfigLayers(_0x429f8f));}export function readConfigFile(_0x14367d){const _0x4f1a2f=a91_0x29b968;return parseCliConfigJsonFile(_0x14367d,_0x4f1a2f(0x1ca));}export function writeConfigFile(_0x2c950f,_0x1b35cd){const _0x58a5dd=a91_0x29b968,_0xdd53d0=dirname(_0x2c950f);!existsSync(_0xdd53d0)&&mkdirSync(_0xdd53d0,{'recursive':!![]});const _0x258798=_0x2c950f+'.tmp';try{writeFileSync(_0x258798,JSON[_0x58a5dd(0x1da)](_0x1b35cd,null,0x2)+'\x0a',{'encoding':_0x58a5dd(0x1d0),'mode':0x180}),renameSync(_0x258798,_0x2c950f);}catch(_0x1f84a9){try{unlinkSync(_0x258798);}catch{}throw _0x1f84a9;}}export function resolveWriteConfigPath(_0x36de27){const _0x1e1431=a91_0x29b968,_0x46061c=_0x36de27===_0x1e1431(0x19a)?process[_0x1e1431(0x198)]():homedir(),_0x2800e6=resolveConfigPath(_0x46061c);return _0x2800e6??resolve(_0x46061c,NEW_CONFIG_NAME);}function buildConfig(_0x30d9ae,_0x13d33b){const _0x3de017=a91_0x29b968,_0x341d1d={};if(_0x30d9ae[_0x3de017(0x1c8)]&&typeof _0x30d9ae[_0x3de017(0x1c8)]===_0x3de017(0x1cd))for(const [_0x177621,_0x1eb848]of Object[_0x3de017(0x1c5)](_0x30d9ae['apps'])){_0x1eb848&&typeof _0x1eb848===_0x3de017(0x1cd)&&_0x1eb848[_0x3de017(0x1a8)]&&(_0x341d1d[_0x177621]=_0x1eb848);}const _0x4cf551=_0x30d9ae[_0x3de017(0x1aa)]||undefined,_0xf2f00f=Object[_0x3de017(0x1c6)](_0x341d1d)['length']>0x0,_0x34cd38=_0x13d33b['app']||env(_0x3de017(0x1b9))||undefined,_0x5410d1=_0x34cd38||_0x4cf551||undefined,_0x22ada7=_0x13d33b[_0x3de017(0x1a8)]||env(_0x3de017(0x1ad))||undefined,_0x25949f=_0x22ada7?Object[_0x3de017(0x1c5)](_0x341d1d)[_0x3de017(0x1ae)](([,_0x3d73a7])=>_0x3d73a7?.[_0x3de017(0x1a8)]===_0x22ada7):undefined,_0xa3b7ee=_0x25949f?.[0x0],_0x56b939=_0x25949f?.[0x1];let _0x3ab938=_0x22ada7?_0xa3b7ee:_0x5410d1,_0x300e97=_0x3ab938&&_0x341d1d[_0x3ab938]?_0x341d1d[_0x3ab938]:undefined;_0x22ada7&&_0x56b939&&(_0x300e97=_0x56b939);const _0x7e4933=_0x22ada7?_0x56b939??_0x300e97:_0x300e97,_0x1ddec5=_0x34cd38||(_0x22ada7?_0xa3b7ee:undefined),_0x51cd4d=_0x22ada7||_0x7e4933?.[_0x3de017(0x1a8)]||_0x30d9ae[_0x3de017(0x1a8)]||_0x30d9ae['app']||undefined,_0x27bdd3=_0x13d33b[_0x3de017(0x1a0)]||env(_0x3de017(0x1c2))||_0x7e4933?.['env']||_0x30d9ae['env']||_0x3de017(0x1d5),_0x50c2ab=_0x7e4933?.[_0x3de017(0x1c4)]||_0x30d9ae[_0x3de017(0x1c4)]||_0x3de017(0x1a4),_0x591fa6=env(_0x3de017(0x1b8))||_0x7e4933?.[_0x3de017(0x1d2)]||_0x30d9ae[_0x3de017(0x1d2)]||undefined,_0x2aa2db=env(_0x3de017(0x19d))||_0x7e4933?.[_0x3de017(0x1a2)]||_0x30d9ae[_0x3de017(0x1a2)]||undefined,_0x3c6912=_0x13d33b[_0x3de017(0x1d4)]||env('FORMAT')||_0x7e4933?.[_0x3de017(0x1d4)]||_0x30d9ae[_0x3de017(0x1d4)],_0x450d20=normalizeLegacyOutputFormat(_0x3c6912),_0x4f8102=env(_0x3de017(0x1a6))||_0x7e4933?.[_0x3de017(0x1cf)]||_0x30d9ae[_0x3de017(0x1cf)],_0x883a97=_0x4f8102?Number(_0x4f8102)||undefined:undefined,_0x10d033=env(_0x3de017(0x197))||env(_0x3de017(0x19e))||_0x7e4933?.[_0x3de017(0x1dd)]||_0x30d9ae['riskLevel']||_0x30d9ae[_0x3de017(0x1d7)],_0x41a517=_0x10d033===_0x3de017(0x1b7)||_0x10d033===_0x3de017(0x1d9)?_0x10d033:_0x3de017(0x1b4),_0x2d6460=env(_0x3de017(0x1a1)),_0x9fd9a4=_0x2d6460==='1'||_0x2d6460===_0x3de017(0x1b3),_0x111f6c=_0x7e4933?.[_0x3de017(0x1bc)]||_0x30d9ae[_0x3de017(0x1bc)]||DEFAULT_API_DIR;return{'appCode':typeof _0x51cd4d==='string'&&_0x51cd4d['trim']()?_0x51cd4d['trim']():undefined,'env':_0x27bdd3===_0x3de017(0x1bb)?_0x3de017(0x1d5):_0x27bdd3===_0x3de017(0x1d3)?_0x3de017(0x1d3):_0x3de017(0x1d5),'locale':_0x50c2ab,'cookie':_0x591fa6,'accessKey':_0x2aa2db,'format':_0x450d20,'pageSize':_0x883a97,'riskLevel':_0x41a517,'verbose':_0x9fd9a4,'apiDir':_0x111f6c,'apps':_0x341d1d,'defaultApp':_0x4cf551,'currentApp':_0xf2f00f?_0x3ab938:undefined,'explicitAppName':_0x1ddec5,'raw':_0x30d9ae};}async function buildAuth(_0x52be32){const _0x2f24b7=a91_0x29b968,{getCookie:_0x391060}=await import(_0x2f24b7(0x1e0)),_0x4de79a=_0x52be32[_0x2f24b7(0x1d2)]||_0x391060(),_0x27c160=_0x4de79a?await getIsSessionValid():![];return{'cookie':_0x4de79a,'isLoggedIn':_0x27c160,async 'getOrLogin'(){const _0x549243=_0x2f24b7;if(_0x4de79a&&_0x27c160)return _0x4de79a;throw CliErrors[_0x549243(0x1d8)]();}};}export function resolveApiFilePath(_0x3217c4,_0x140732){const _0x259730=a91_0x29b968,_0x518a08=resolve(process[_0x259730(0x198)](),_0x3217c4),_0x5b11ea=resolve(_0x518a08,_0x259730(0x1b0));if(!_0x140732)return _0x5b11ea;const _0x3ca485=readRawConfig(),_0x85010=_0x3ca485[_0x259730(0x1c8)]&&typeof _0x3ca485[_0x259730(0x1c8)]===_0x259730(0x1cd)?_0x3ca485[_0x259730(0x1c8)]:{},_0xe4cc0d=Object[_0x259730(0x1c5)](_0x85010)[_0x259730(0x1ae)](([,_0xee57c])=>_0xee57c?.[_0x259730(0x1a8)]===_0x140732);if(!_0xe4cc0d)return _0x5b11ea;const [_0x1c0e51,_0x3922a4]=_0xe4cc0d,_0x467218=typeof _0x3ca485['defaultApp']===_0x259730(0x1a3)?_0x3ca485[_0x259730(0x1aa)]:undefined;if(_0x3922a4?.[_0x259730(0x1bc)])return _0x5b11ea;if(_0x467218&&_0x1c0e51!==_0x467218)return resolve(_0x518a08,_0x1c0e51+_0x259730(0x1e2));return _0x5b11ea;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a92_0x4933(){const _0xda4c37=['cwd','2711380wxlfsj','alias','set','5705bKWkVj','utf-8','744eGgOIU','4144504MnqoYK','128lIFcew','9906530vzjxxb','2915MuoZLN','42926829SfvBal','6366kFvFEm','push','datasetCode','has','3hpexCB','api.ts','exec','558CcRbEF'];a92_0x4933=function(){return _0xda4c37;};return a92_0x4933();}(function(_0x588652,_0x30313a){const _0x1290ce=a92_0xdd0e,_0x1095ce=_0x588652();while(!![]){try{const _0x4d7b0a=-parseInt(_0x1290ce(0xfe))/0x1*(-parseInt(_0x1290ce(0xfc))/0x2)+-parseInt(_0x1290ce(0x104))/0x3*(parseInt(_0x1290ce(0xf5))/0x4)+parseInt(_0x1290ce(0xf8))/0x5*(-parseInt(_0x1290ce(0x100))/0x6)+-parseInt(_0x1290ce(0xfb))/0x7+-parseInt(_0x1290ce(0xfa))/0x8*(-parseInt(_0x1290ce(0x107))/0x9)+-parseInt(_0x1290ce(0xfd))/0xa+parseInt(_0x1290ce(0xff))/0xb;if(_0x4d7b0a===_0x30313a)break;else _0x1095ce['push'](_0x1095ce['shift']());}catch(_0x48dff8){_0x1095ce['push'](_0x1095ce['shift']());}}}(a92_0x4933,0x983ea));import{readFileSync,existsSync}from'node:fs';function a92_0xdd0e(_0x6d8ed6,_0x4a5229){_0x6d8ed6=_0x6d8ed6-0xf4;const _0x493397=a92_0x4933();let _0xdd0e6=_0x493397[_0x6d8ed6];return _0xdd0e6;}import{resolve}from'node:path';const cache=new Map();function parseApiFile(_0x2c06e3){const _0x13534a=a92_0xdd0e,_0x5c98eb=[],_0x2a88f7=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0xb39b54;while((_0xb39b54=_0x2a88f7[_0x13534a(0x106)](_0x2c06e3))!==null){_0x5c98eb[_0x13534a(0x101)]({'datasetCode':_0xb39b54[0x1],'tableName':_0xb39b54[0x2],'name':_0xb39b54[0x3],'alias':_0xb39b54[0x4]});}return _0x5c98eb;}export function loadAliasMap(_0x2e2e7d,_0x279076,_0x4511eb){const _0x42ec99=a92_0xdd0e,_0x521903=_0x4511eb??resolve(process[_0x42ec99(0xf4)](),_0x2e2e7d,_0x42ec99(0x105));if(cache[_0x42ec99(0x103)](_0x521903))return cache['get'](_0x521903);if(!existsSync(_0x521903))return cache['set'](_0x521903,[]),[];try{const _0xe1994e=readFileSync(_0x521903,_0x42ec99(0xf9)),_0x3a4b64=parseApiFile(_0xe1994e);return cache[_0x42ec99(0xf7)](_0x521903,_0x3a4b64),_0x3a4b64;}catch{return cache[_0x42ec99(0xf7)](_0x521903,[]),[];}}export function resolveAlias(_0x1d667a,_0x1642f6,_0x38dcf1,_0x584fef){const _0x3d0f6a=a92_0xdd0e;if(!_0x1642f6)return undefined;const _0x218efd=loadAliasMap(_0x1d667a,_0x38dcf1,_0x584fef),_0x24ee55=_0x218efd['find'](_0x4af3fd=>_0x4af3fd[_0x3d0f6a(0xf6)]===_0x1642f6);return _0x24ee55?.[_0x3d0f6a(0x102)];}export function listAliases(_0x48af48,_0x1f617f,_0x3584c4){return loadAliasMap(_0x48af48,_0x1f617f,_0x3584c4);}
|
package/lib/core/api-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2b1768,_0xb0152e){const _0xe48500=a93_0x39be,_0x2f1610=_0x2b1768();while(!![]){try{const _0x554d0a=-parseInt(_0xe48500(0x1fa))/0x1+-parseInt(_0xe48500(0x236))/0x2+-parseInt(_0xe48500(0x201))/0x3*(parseInt(_0xe48500(0x229))/0x4)+-parseInt(_0xe48500(0x1fb))/0x5+parseInt(_0xe48500(0x20c))/0x6*(-parseInt(_0xe48500(0x221))/0x7)+-parseInt(_0xe48500(0x22c))/0x8+parseInt(_0xe48500(0x20a))/0x9*(parseInt(_0xe48500(0x24b))/0xa);if(_0x554d0a===_0xb0152e)break;else _0x2f1610['push'](_0x2f1610['shift']());}catch(_0x5f3d74){_0x2f1610['push'](_0x2f1610['shift']());}}}(a93_0x1567,0x8c6dd));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x3f8ec8){_activeCookie=_0x3f8ec8||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x509775,_0x2c9a71={}){const _0x1ee4d8=a93_0x39be,{method:method=_0x1ee4d8(0x1f8),body:_0xd5ffee,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x2c9a71,_0x4734c2=useRuntime?getRuntimeDomain():getApiDomain(),_0x1ff702=_activeCookie||getCookie(),_0x1e6225=''+_0x4734c2+_0x509775,_0x393627=new AbortController(),_0x2ddefc=setTimeout(()=>_0x393627['abort'](),timeout);try{const _0x28871e=await fetch(_0x1e6225,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x1ff702,'X-Invoke-Source':'cli:rabetbase',...headers},'body':_0xd5ffee?JSON[_0x1ee4d8(0x1f4)](_0xd5ffee):undefined,'signal':_0x393627[_0x1ee4d8(0x250)]});let _0x17fbda;try{_0x17fbda=await _0x28871e[_0x1ee4d8(0x213)]();}catch{throw CliErrors[_0x1ee4d8(0x22b)](_0x1ee4d8(0x248)+_0x28871e[_0x1ee4d8(0x1f1)]+')',_0x28871e[_0x1ee4d8(0x1f1)]>=0x190?_0x1ee4d8(0x253):undefined);}if(!_0x28871e['ok']||_0x17fbda[_0x1ee4d8(0x225)]===![])throw CliErrors['apiError'](_0x17fbda[_0x1ee4d8(0x208)]||_0x17fbda[_0x1ee4d8(0x20b)]||'API\x20error:\x20'+_0x28871e['status'],_0x17fbda['errorCode']?_0x1ee4d8(0x267)+_0x17fbda[_0x1ee4d8(0x200)]:undefined);return _0x17fbda;}catch(_0x12b321){if(_0x12b321 instanceof Error&&_0x12b321['name']==='AbortError')throw CliErrors['apiError'](_0x1ee4d8(0x21f)+_0x1e6225);throw _0x12b321;}finally{clearTimeout(_0x2ddefc);}}function isAuthFailure(_0x394a65){const _0x36b03f=a93_0x39be,_0x593322=_0x394a65[_0x36b03f(0x208)]||_0x394a65['message']||_0x394a65[_0x36b03f(0x209)]?.['message']||_0x394a65[_0x36b03f(0x216)]||_0x394a65[_0x36b03f(0x245)]||'';return _0x394a65[_0x36b03f(0x200)]===_0x36b03f(0x23b)||_0x394a65['code']===0x191||_0x394a65[_0x36b03f(0x24a)]==='401'||_0x593322['includes'](_0x36b03f(0x257))||_0x593322['includes'](_0x36b03f(0x240))||_0x593322[_0x36b03f(0x228)]('登录')||_0x593322[_0x36b03f(0x228)]('认证');}export async function platformFetch(_0x2a579d,_0x4b7bd3){const _0x96a422=a93_0x39be,_0x590aae=await fetch(_0x2a579d,{'method':_0x4b7bd3['method']??_0x96a422(0x1f8),'headers':{'Content-Type':'application/json','Cookie':_0x4b7bd3[_0x96a422(0x1ef)]},..._0x4b7bd3['body']&&{'body':JSON[_0x96a422(0x1f4)](_0x4b7bd3[_0x96a422(0x210)])}});if(!_0x590aae['ok']){if(_0x590aae[_0x96a422(0x1f1)]===0x191)throw CliErrors['authRequired']();throw CliErrors[_0x96a422(0x22b)](_0x4b7bd3['label']+_0x96a422(0x1f9)+_0x590aae[_0x96a422(0x1f1)]);}const _0x4b2168=await _0x590aae[_0x96a422(0x213)]();if(_0x4b2168[_0x96a422(0x225)]===![]){if(isAuthFailure(_0x4b2168))throw CliErrors[_0x96a422(0x252)]();throw CliErrors[_0x96a422(0x22b)](_0x4b2168['errorMsg']||_0x4b2168['message']||_0x4b7bd3[_0x96a422(0x215)]+_0x96a422(0x244));}return _0x4b2168[_0x96a422(0x209)];}export async function listBffScripts(_0x1de149,_0x237dc6,_0x2dbb56){const _0xfb28bc=a93_0x39be;let _0x354ce8=_0xfb28bc(0x21c)+_0x1de149;if(_0x237dc6)_0x354ce8+=_0xfb28bc(0x246)+_0x237dc6;const _0x579b45=await apiRequest(_0x354ce8);let _0x268369=extractList(_0x579b45['data']);if(_0x2dbb56?.['scriptName']){const _0x579082=_0x2dbb56[_0xfb28bc(0x247)][_0xfb28bc(0x1f0)]();_0x268369=_0x268369[_0xfb28bc(0x262)](_0xd9c02e=>_0xd9c02e[_0xfb28bc(0x22e)]?.[_0xfb28bc(0x1f0)]()['includes'](_0x579082)||_0xd9c02e[_0xfb28bc(0x259)]?.[_0xfb28bc(0x1f0)]()[_0xfb28bc(0x228)](_0x579082));}return _0x268369;}export async function getBffScriptInfo(_0x23faf4){const _0x31f434=a93_0x39be,_0x10cf0e=await apiRequest(_0x31f434(0x260)+_0x23faf4);if(!_0x10cf0e[_0x31f434(0x209)])throw CliErrors['validation'](_0x31f434(0x1fd)+_0x23faf4);return _0x10cf0e[_0x31f434(0x209)];}export async function saveBffScript(_0x12568d){const _0x2ad54a=a93_0x39be,_0x2ea0db=await apiRequest(_0x2ad54a(0x21b),{'method':'POST','body':_0x12568d});return _0x2ea0db[_0x2ad54a(0x209)];}export async function deleteBffScript(_0x30ef57){const _0x236926=a93_0x39be;await apiRequest(_0x236926(0x24d),{'method':_0x236926(0x212),'body':{'id':_0x30ef57}});}export async function getBffScriptStatistics(_0x498280){const _0x29d2c7=a93_0x39be,_0x278dba=await apiRequest(_0x29d2c7(0x249)+_0x498280);return extractList(_0x278dba[_0x29d2c7(0x209)]);}export async function listBffDatasetOperations(_0x75a8eb,_0x56cc08){const _0x3aeac7=a93_0x39be,_0x306a7b=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x3aeac7(0x212),'body':{'appCode':_0x75a8eb,'datasetId':_0x56cc08}});return _0x306a7b['data'];}export async function listSqlQueries(_0x285be2,_0x58b5f0){const _0x224939=a93_0x39be,_0x46de56=await apiRequest(_0x224939(0x25f),{'method':_0x224939(0x212),'body':{'appCode':_0x285be2,'currentPage':_0x58b5f0?.[_0x224939(0x21d)]??0x1,'pageSize':_0x58b5f0?.[_0x224939(0x20f)]??0x32,'sqlCode':_0x58b5f0?.[_0x224939(0x1f2)],'sqlName':_0x58b5f0?.[_0x224939(0x230)]}});return _0x46de56[_0x224939(0x209)];}export async function getSqlQueryInfo(_0x1fcfd6,_0x2fdbf4){const _0x588520=a93_0x39be,_0x53a7f8=await listSqlQueries(_0x1fcfd6,{'sqlCode':_0x2fdbf4}),_0x429234=_0x53a7f8[_0x588520(0x232)]?.[0x0];if(!_0x429234)throw CliErrors[_0x588520(0x231)](_0x588520(0x258)+_0x2fdbf4);return _0x429234;}export async function saveSqlQuery(_0x3d967e){const _0x58a642=a93_0x39be,_0x2bffee=await apiRequest(_0x58a642(0x20e),{'method':_0x58a642(0x212),'body':_0x3d967e});return _0x2bffee[_0x58a642(0x209)];}export async function executeSql(_0xd295fa,_0x16a8d6,_0x2c7b25){const _0x3fbf6e=a93_0x39be,_0x4f17ca=await apiRequest(_0x3fbf6e(0x25c),{'method':_0x3fbf6e(0x212),'body':{'appCode':_0xd295fa,'sqlCode':_0x16a8d6,..._0x2c7b25&&{'params':_0x2c7b25}},'useRuntime':!![]});return _0x4f17ca[_0x3fbf6e(0x209)];}export async function listDatasets(_0x3cc323,_0x56632b){const _0x41ecf7=a93_0x39be,_0x48c7eb={'appCode':_0x3cc323,'deleted':![]};if(_0x56632b?.['code'])_0x48c7eb['code']=_0x56632b[_0x41ecf7(0x24a)];if(_0x56632b?.[_0x41ecf7(0x1f6)])_0x48c7eb[_0x41ecf7(0x1f6)]=_0x56632b[_0x41ecf7(0x1f6)];const _0xdbd8ef=await apiRequest(_0x41ecf7(0x223),{'method':'POST','body':_0x48c7eb});return extractList(_0xdbd8ef[_0x41ecf7(0x209)]);}export async function searchDatasets(_0x96b487,_0x2240a0){const _0xae3a23=a93_0x39be,_0x5d0346=await listDatasets(_0x96b487,{'name':_0x2240a0}),_0x23167e=_0x2240a0['toLowerCase'](),_0x5d58f1=new Set(_0x5d0346['map'](_0x21ca40=>_0x21ca40['id'])),_0x5ed7ab=_0x5d0346[_0xae3a23(0x262)](_0x4c13fd=>_0x4c13fd[_0xae3a23(0x24e)]?.[_0xae3a23(0x22f)]?.['toLowerCase']()[_0xae3a23(0x228)](_0x23167e)||_0x4c13fd[_0xae3a23(0x259)]?.[_0xae3a23(0x1f0)]()[_0xae3a23(0x228)](_0x23167e)),_0x2e95a2=await listDatasets(_0x96b487,{'code':_0x2240a0});for(const _0xc80d83 of _0x2e95a2){!_0x5d58f1['has'](_0xc80d83['id'])&&(_0x5d0346['push'](_0xc80d83),_0x5d58f1[_0xae3a23(0x20d)](_0xc80d83['id']));}return _0x5d0346;}export function normalizeDatasetOperations(_0x26b26d){const _0x112e4d=a93_0x39be;if(Array[_0x112e4d(0x235)](_0x26b26d))return _0x26b26d[_0x112e4d(0x262)](_0x32b0b8=>_0x32b0b8!=null&&typeof _0x32b0b8===_0x112e4d(0x218));if(_0x26b26d&&typeof _0x26b26d==='object')return Object['entries'](_0x26b26d)[_0x112e4d(0x262)](([,_0x1a23e1])=>_0x1a23e1!=null&&typeof _0x1a23e1===_0x112e4d(0x218))[_0x112e4d(0x224)](([_0x50c097,_0xeca100])=>({..._0xeca100,'name':_0xeca100[_0x112e4d(0x1f6)]??_0xeca100['operationName']??_0x50c097}));return[];}export async function getDatasetDetail(_0x421c35){const _0x2fc690=a93_0x39be,_0x142930=/^\d+$/[_0x2fc690(0x243)](_0x421c35)?'id':'code',_0x28f5bf=await apiRequest(_0x2fc690(0x220)+_0x142930+'='+_0x421c35);return _0x28f5bf[_0x2fc690(0x209)];}export async function getDatasetOperations(_0x1f438e){const _0x5847ad=a93_0x39be,_0x3b01e4=await getDatasetDetail(_0x1f438e),_0x34dc3d=normalizeDatasetOperations(_0x3b01e4[_0x5847ad(0x219)])[_0x5847ad(0x224)](_0x2fa515=>({'name':_0x2fa515[_0x5847ad(0x1f6)]||_0x2fa515[_0x5847ad(0x1ff)],'displayName':_0x2fa515[_0x5847ad(0x23d)]||_0x2fa515[_0x5847ad(0x1f6)],'type':_0x2fa515['type'],'method':_0x2fa515[_0x5847ad(0x25e)],'path':_0x2fa515[_0x5847ad(0x25b)],'enabled':_0x2fa515['enabled']??!![],'requestFields':_0x2fa515[_0x5847ad(0x234)],'responseFields':_0x2fa515[_0x5847ad(0x1fc)]}));return{'dataset':{'id':_0x3b01e4['id']??_0x3b01e4[_0x5847ad(0x268)],'name':_0x3b01e4[_0x5847ad(0x1f6)],'code':_0x3b01e4[_0x5847ad(0x24a)]||_0x3b01e4[_0x5847ad(0x239)],'tableName':_0x3b01e4[_0x5847ad(0x22f)]||_0x3b01e4[_0x5847ad(0x24e)]?.['tableName']},'operations':_0x34dc3d};}export async function getOperationDetail(_0x4cd7b2,_0x54364e,_0x4ee2e9){const _0x165afe=a93_0x39be;let _0x2751ca=_0x54364e;if(!/^\d+$/[_0x165afe(0x243)](_0x54364e)){const _0x5506c0=await listDatasets(_0x4cd7b2,{'code':_0x54364e}),_0x1caa7c=_0x5506c0[_0x165afe(0x214)](_0x1d2f31=>_0x1d2f31[_0x165afe(0x24a)]===_0x54364e||String(_0x1d2f31['id'])===_0x54364e);if(!_0x1caa7c)throw CliErrors[_0x165afe(0x231)](_0x165afe(0x264)+_0x54364e);_0x2751ca=String(_0x1caa7c['id']);}const _0x543085=await getDatasetDetail(_0x2751ca),_0x227dcf=normalizeDatasetOperations(_0x543085['operations'])[_0x165afe(0x214)](_0x19d21e=>(_0x19d21e[_0x165afe(0x1f6)]||_0x19d21e[_0x165afe(0x1ff)])===_0x4ee2e9);if(!_0x227dcf)throw CliErrors['validation'](_0x165afe(0x22a)+_0x4ee2e9+_0x165afe(0x21a)+_0x54364e);return{'dataset':{'id':_0x543085['id']??_0x543085[_0x165afe(0x268)],'name':_0x543085[_0x165afe(0x1f6)],'code':_0x543085[_0x165afe(0x24a)]||_0x543085[_0x165afe(0x239)],'tableName':_0x543085[_0x165afe(0x22f)]||_0x543085['dbtableConfig']?.[_0x165afe(0x22f)]},'operation':_0x227dcf};}export function generateSdkCode(_0x122dde,_0x28a205,_0x1c4401){const _0x56cf23=a93_0x39be,_0x3e85bb=_0x1c4401?.[_0x56cf23(0x23f)]??!![],_0x350e7c=_0x56cf23(0x24c)+_0x122dde[_0x56cf23(0x24a)]?.[_0x56cf23(0x227)](/-/g,'_'),_0x20bbba=_0x28a205['name']||_0x28a205[_0x56cf23(0x1ff)]||_0x56cf23(0x262),_0x1583e8=[];_0x3e85bb&&_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x24f),'',_0x56cf23(0x241),'');_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x1f7)+_0x122dde['name']+'\x20('+(_0x122dde[_0x56cf23(0x22f)]||_0x56cf23(0x237))+')');if(_0x20bbba==='filter')_0x1583e8[_0x56cf23(0x242)]('const\x20result\x20=\x20await\x20client.models.'+_0x350e7c+_0x56cf23(0x222),'\x20\x20where:\x20{},',_0x56cf23(0x23a),_0x56cf23(0x1f3),_0x56cf23(0x266));else{if(_0x20bbba==='getOne')_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x25a));else{if(_0x20bbba===_0x56cf23(0x21e))_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x254));else{if(_0x20bbba===_0x56cf23(0x23e))_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x203));else _0x20bbba===_0x56cf23(0x204)||_0x20bbba===_0x56cf23(0x25d)?_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+_0x56cf23(0x22d)):_0x1583e8[_0x56cf23(0x242)](_0x56cf23(0x255)+_0x350e7c+'.'+_0x20bbba+'(/*\x20params\x20*/);');}}}return _0x1583e8['join']('\x0a');}export function generateSqlCodeTemplate(_0x26b236,_0x70db25){const _0x311041=a93_0x39be,_0x44cfe6=_0x70db25?.[_0x311041(0x1fe)]??_0x311041(0x251),_0x504892=_0x70db25?.[_0x311041(0x23f)]??!![],_0x2a195c=[];return _0x2a195c[_0x311041(0x242)]('//\x20SQL:\x20'+_0x26b236[_0x311041(0x230)]+'\x20('+_0x26b236[_0x311041(0x1f2)]+')'),_0x44cfe6==='sdk'?(_0x504892&&_0x2a195c[_0x311041(0x242)](_0x311041(0x24f),'',_0x311041(0x241),''),_0x2a195c[_0x311041(0x242)]('const\x20data\x20=\x20await\x20client.sql.execute({',_0x311041(0x217)+_0x26b236['sqlCode']+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','});','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);',_0x311041(0x211))):_0x2a195c[_0x311041(0x242)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x311041(0x261),_0x311041(0x238)+_0x26b236[_0x311041(0x1f2)]+'\x27,',_0x311041(0x205),_0x311041(0x207),_0x311041(0x1f5),'}'),_0x2a195c[_0x311041(0x202)]('\x0a');}function a93_0x39be(_0x5a2128,_0x971bdf){_0x5a2128=_0x5a2128-0x1ef;const _0x156709=a93_0x1567();let _0x39be11=_0x156709[_0x5a2128];return _0x39be11;}function a93_0x1567(){const _0x4ef85a=['\x20failed,\x20HTTP\x20','916935WBdWjt','713570KlfMPW','responseFields','BFF\x20script\x20not\x20found:\x20id=','target','operationName','errorCode','345669HyPzZw','join','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','delete','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/smartapi/app/getList','\x20\x20});','errorMsg','data','9GCvJUF','message','2166mXlFWX','add','/api/node-toolbox/sql/save','pageSize','body','const\x20results\x20=\x20data.execResult\x20||\x20[];','POST','json','find','label','errorMessage','\x20\x20sqlCode:\x20\x27','object','operations','\x22\x20not\x20found\x20in\x20dataset\x20','/api/management/library/scripts/save','/api/management/library/scripts/list?appCode=','currentPage','create','Request\x20timeout:\x20','/smartapi/dataset/get-driven-data?','3199OvRMiW','.filter({','/smartapi/dataset/get-dataset-list','map','success','Warning:\x20showing\x20first\x20','replace','includes','16wFLTKh','Operation\x20\x22','apiError','3506760oiJBFS','.remove(id);','functionName','tableName','sqlName','validation','tableData','warn','requestFields','isArray','92398EpoAxw','table','\x20\x20\x20\x20sqlCode:\x20\x27','modelCode','\x20\x20pageSize:\x2020,','UNAUTHORIZED','/smartapi/question/er-config','displayName','update','includeImports','Unauthorized','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','push','test','\x20failed','error','&type=','scriptName','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','/api/management/library/scripts/statistics?appCode=','code','27452590TcucRg','dataset_','/api/management/library/scripts/delete','dbtableConfig','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','signal','sdk','authRequired','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','.create({\x20/*\x20fields\x20*/\x20});','const\x20result\x20=\x20await\x20client.models.','totalCount','401','SQL\x20query\x20not\x20found:\x20','description','.getOne(id);','path','/api/custom/executeSql','remove','method','/smartapi/custom/queryUserCustomSqlList','/api/management/library/scripts/info?id=','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','filter','\x20apps.\x20','Dataset\x20not\x20found:\x20','Use\x20the\x20platform\x20console\x20to\x20see\x20all.','});','API\x20error\x20code:\x20','modelId','cookie','toLowerCase','status','sqlCode','\x20\x20currentPage:\x201,','stringify','\x20\x20return\x20rows;','name','//\x20','GET'];a93_0x1567=function(){return _0x4ef85a;};return a93_0x1567();}export async function getErConfig(_0x5a2c0a,_0x15766e){const _0x569e4b=a93_0x39be,_0x39c562=await apiRequest(_0x569e4b(0x23c),{'method':'POST','body':{'appCode':_0x5a2c0a,'dblinkId':_0x15766e}});return _0x39c562['data'];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x39602a=a93_0x39be,_0x118668=await apiRequest(_0x39602a(0x206),{'method':_0x39602a(0x212),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x4fc17b=extractList(_0x118668[_0x39602a(0x209)]),_0x138997=extractPaging(_0x118668[_0x39602a(0x209)]);return _0x138997&&_0x138997['totalCount']>REMOTE_APP_PAGE_SIZE&&console[_0x39602a(0x233)](_0x39602a(0x226)+REMOTE_APP_PAGE_SIZE+'\x20of\x20'+_0x138997[_0x39602a(0x256)]+_0x39602a(0x263)+_0x39602a(0x265)),_0x4fc17b;}
|
|
1
|
+
(function(_0x261e09,_0x25ad7d){const _0x4f23ae=a93_0x41b7,_0x488058=_0x261e09();while(!![]){try{const _0x408ff9=parseInt(_0x4f23ae(0x18b))/0x1*(parseInt(_0x4f23ae(0x186))/0x2)+parseInt(_0x4f23ae(0x17c))/0x3+-parseInt(_0x4f23ae(0x177))/0x4*(-parseInt(_0x4f23ae(0x192))/0x5)+-parseInt(_0x4f23ae(0x16c))/0x6+-parseInt(_0x4f23ae(0x168))/0x7*(-parseInt(_0x4f23ae(0x1c4))/0x8)+parseInt(_0x4f23ae(0x199))/0x9*(parseInt(_0x4f23ae(0x160))/0xa)+-parseInt(_0x4f23ae(0x15e))/0xb;if(_0x408ff9===_0x25ad7d)break;else _0x488058['push'](_0x488058['shift']());}catch(_0xbf9ba7){_0x488058['push'](_0x488058['shift']());}}}(a93_0x1d59,0x2758c));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList,extractPaging}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x607bc7){_activeCookie=_0x607bc7||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x48f58f,_0x23f5ff={}){const _0x39a5e3=a93_0x41b7,{method:method=_0x39a5e3(0x1ad),body:_0x36a44e,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x23f5ff,_0x5a76b3=useRuntime?getRuntimeDomain():getApiDomain(),_0x3d276d=_activeCookie||getCookie(),_0x469979=''+_0x5a76b3+_0x48f58f,_0x5d0e25=new AbortController(),_0x3a013d=setTimeout(()=>_0x5d0e25[_0x39a5e3(0x1b1)](),timeout);try{const _0x375ecf=await fetch(_0x469979,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x3d276d,'X-Invoke-Source':_0x39a5e3(0x15d),...headers},'body':_0x36a44e?JSON[_0x39a5e3(0x15c)](_0x36a44e):undefined,'signal':_0x5d0e25[_0x39a5e3(0x1c9)]});let _0x41f442;try{_0x41f442=await _0x375ecf[_0x39a5e3(0x1bb)]();}catch{throw CliErrors[_0x39a5e3(0x1a2)](_0x39a5e3(0x173)+_0x375ecf[_0x39a5e3(0x1ab)]+')',_0x375ecf[_0x39a5e3(0x1ab)]>=0x190?_0x39a5e3(0x162):undefined);}if(!_0x375ecf['ok']||_0x41f442[_0x39a5e3(0x197)]===![])throw CliErrors[_0x39a5e3(0x1a2)](_0x41f442['errorMsg']||_0x41f442[_0x39a5e3(0x170)]||_0x39a5e3(0x179)+_0x375ecf[_0x39a5e3(0x1ab)],_0x41f442['errorCode']?_0x39a5e3(0x1ba)+_0x41f442['errorCode']:undefined);return _0x41f442;}catch(_0x56b429){if(_0x56b429 instanceof Error&&_0x56b429[_0x39a5e3(0x1b4)]===_0x39a5e3(0x19d))throw CliErrors[_0x39a5e3(0x1a2)]('Request\x20timeout:\x20'+_0x469979);throw _0x56b429;}finally{clearTimeout(_0x3a013d);}}function isAuthFailure(_0x568727){const _0x5c7219=a93_0x41b7,_0x1bcdc4=_0x568727[_0x5c7219(0x17d)]||_0x568727['message']||_0x568727[_0x5c7219(0x156)]?.[_0x5c7219(0x170)]||_0x568727[_0x5c7219(0x158)]||_0x568727[_0x5c7219(0x1a8)]||'';return _0x568727[_0x5c7219(0x1c7)]==='UNAUTHORIZED'||_0x568727[_0x5c7219(0x174)]===0x191||_0x568727[_0x5c7219(0x174)]==='401'||_0x1bcdc4[_0x5c7219(0x18a)](_0x5c7219(0x188))||_0x1bcdc4[_0x5c7219(0x18a)](_0x5c7219(0x18c))||_0x1bcdc4[_0x5c7219(0x18a)]('登录')||_0x1bcdc4[_0x5c7219(0x18a)]('认证');}export async function platformFetch(_0xcc0bd9,_0x4ee53b){const _0x596f00=a93_0x41b7,_0x2d82ba=await fetch(_0xcc0bd9,{'method':_0x4ee53b[_0x596f00(0x1bf)]??_0x596f00(0x1ad),'headers':{'Content-Type':_0x596f00(0x18f),'Cookie':_0x4ee53b[_0x596f00(0x1ca)]},..._0x4ee53b[_0x596f00(0x176)]&&{'body':JSON[_0x596f00(0x15c)](_0x4ee53b[_0x596f00(0x176)])}});if(!_0x2d82ba['ok']){if(_0x2d82ba[_0x596f00(0x1ab)]===0x191)throw CliErrors[_0x596f00(0x164)]();throw CliErrors[_0x596f00(0x1a2)](_0x4ee53b[_0x596f00(0x195)]+_0x596f00(0x1cd)+_0x2d82ba[_0x596f00(0x1ab)]);}const _0x505d4f=await _0x2d82ba['json']();if(_0x505d4f[_0x596f00(0x197)]===![]){if(isAuthFailure(_0x505d4f))throw CliErrors[_0x596f00(0x164)]();throw CliErrors[_0x596f00(0x1a2)](_0x505d4f[_0x596f00(0x17d)]||_0x505d4f['message']||_0x4ee53b[_0x596f00(0x195)]+'\x20failed');}return _0x505d4f['data'];}export async function listBffScripts(_0x26b058,_0x1aca02,_0x537ab9){const _0x350a51=a93_0x41b7;let _0x200b06=_0x350a51(0x1c3)+_0x26b058;if(_0x1aca02)_0x200b06+=_0x350a51(0x18d)+_0x1aca02;const _0x29e4a7=await apiRequest(_0x200b06);let _0x7610ad=extractList(_0x29e4a7[_0x350a51(0x156)]);if(_0x537ab9?.[_0x350a51(0x17b)]){const _0x349610=_0x537ab9[_0x350a51(0x17b)][_0x350a51(0x1a1)]();_0x7610ad=_0x7610ad[_0x350a51(0x169)](_0x4fb82f=>_0x4fb82f[_0x350a51(0x1cc)]?.[_0x350a51(0x1a1)]()['includes'](_0x349610)||_0x4fb82f[_0x350a51(0x193)]?.['toLowerCase']()[_0x350a51(0x18a)](_0x349610));}return _0x7610ad;}export async function getBffScriptInfo(_0xd42847){const _0x2b31c7=a93_0x41b7,_0x2db7a7=await apiRequest(_0x2b31c7(0x19f)+_0xd42847);if(!_0x2db7a7['data'])throw CliErrors['validation']('BFF\x20script\x20not\x20found:\x20id='+_0xd42847);return _0x2db7a7[_0x2b31c7(0x156)];}export async function saveBffScript(_0x1bf575){const _0x5088ef=a93_0x41b7,_0x38d009=await apiRequest('/api/management/library/scripts/save',{'method':'POST','body':_0x1bf575});return _0x38d009[_0x5088ef(0x156)];}function a93_0x1d59(){const _0x271b9d=['});','data','tableData','errorMessage','\x20\x20currentPage:\x201,','path','dbtableConfig','stringify','cli:rabetbase','7015602CtDcLq','.getOne(id);','10kREasj','operationName','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','pageSize','authRequired','warn','\x20\x20\x20\x20sqlCode:\x20\x27','table','77evgWcV','filter','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','target','1450446EkcKAt','validation','update','.create({\x20/*\x20fields\x20*/\x20});','message','sqlCode','/smartapi/question/er-config','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','code','\x20apps.\x20','body','66072zjuEgN','remove','API\x20error:\x20','Warning:\x20showing\x20first\x20','scriptName','628929IqkTOk','errorMsg','add','join','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','\x22\x20not\x20found\x20in\x20dataset\x20','SQL\x20query\x20not\x20found:\x20','find','\x20\x20pageSize:\x2020,','Dataset\x20not\x20found:\x20','524430DiwhfJ','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','401','sqlName','includes','1JnkWLa','Unauthorized','&type=','modelId','application/json','replace','displayName','75EftRjK','description','/api/node-toolbox/sql/save','label','(/*\x20params\x20*/);','success','/api/management/library/scripts/delete','2297313QtaETW','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','includeImports','totalCount','AbortError','//\x20SQL:\x20','/api/management/library/scripts/info?id=','const\x20data\x20=\x20await\x20client.sql.execute({','toLowerCase','apiError','modelCode','operations','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','/smartapi/app/getList','POST','error','isArray','\x20of\x20','status','currentPage','GET','const\x20results\x20=\x20data.execResult\x20||\x20[];','/api/management/library/scripts/statistics?appCode=','test','abort','.filter({','enabled','name','has','dataset_','Operation\x20\x22','sdk','object','API\x20error\x20code:\x20','json','.remove(id);','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','//\x20','method','map','push','tableName','/api/management/library/scripts/list?appCode=','47856sxTBII','requestFields','create','errorCode','\x20\x20return\x20rows;','signal','cookie','const\x20result\x20=\x20await\x20client.models.','functionName','\x20failed,\x20HTTP\x20'];a93_0x1d59=function(){return _0x271b9d;};return a93_0x1d59();}export async function deleteBffScript(_0x3bece9){const _0x50980f=a93_0x41b7;await apiRequest(_0x50980f(0x198),{'method':'POST','body':{'id':_0x3bece9}});}export async function getBffScriptStatistics(_0xe82af5){const _0x2f5049=a93_0x41b7,_0x4dc155=await apiRequest(_0x2f5049(0x1af)+_0xe82af5);return extractList(_0x4dc155[_0x2f5049(0x156)]);}export async function listBffDatasetOperations(_0x19c70b,_0x2374f2){const _0x45c8e2=a93_0x41b7,_0x289de3=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x45c8e2(0x1a7),'body':{'appCode':_0x19c70b,'datasetId':_0x2374f2}});return _0x289de3['data'];}export async function listSqlQueries(_0x1ad1b2,_0x51f6be){const _0x448ff1=a93_0x41b7,_0x2981ae=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':'POST','body':{'appCode':_0x1ad1b2,'currentPage':_0x51f6be?.[_0x448ff1(0x1ac)]??0x1,'pageSize':_0x51f6be?.[_0x448ff1(0x163)]??0x32,'sqlCode':_0x51f6be?.[_0x448ff1(0x171)],'sqlName':_0x51f6be?.[_0x448ff1(0x189)]}});return _0x2981ae[_0x448ff1(0x156)];}function a93_0x41b7(_0xe51fb8,_0x118081){_0xe51fb8=_0xe51fb8-0x156;const _0x1d5924=a93_0x1d59();let _0x41b779=_0x1d5924[_0xe51fb8];return _0x41b779;}export async function getSqlQueryInfo(_0x335cff,_0xde317){const _0x27444f=a93_0x41b7,_0x22d3b5=await listSqlQueries(_0x335cff,{'sqlCode':_0xde317}),_0x245a16=_0x22d3b5[_0x27444f(0x157)]?.[0x0];if(!_0x245a16)throw CliErrors['validation'](_0x27444f(0x182)+_0xde317);return _0x245a16;}export async function saveSqlQuery(_0x44cca7){const _0x5e360c=a93_0x41b7,_0x1c1df1=await apiRequest(_0x5e360c(0x194),{'method':'POST','body':_0x44cca7});return _0x1c1df1[_0x5e360c(0x156)];}export async function executeSql(_0x45fec0,_0x3da69b,_0x3500a8){const _0x1add13=a93_0x41b7,_0x12ab8c=await apiRequest('/api/custom/executeSql',{'method':_0x1add13(0x1a7),'body':{'appCode':_0x45fec0,'sqlCode':_0x3da69b,..._0x3500a8&&{'params':_0x3500a8}},'useRuntime':!![]});return _0x12ab8c[_0x1add13(0x156)];}export async function listDatasets(_0x19f893,_0x15e94e){const _0x36bbcd=a93_0x41b7,_0x366079={'appCode':_0x19f893,'deleted':![]};if(_0x15e94e?.['code'])_0x366079[_0x36bbcd(0x174)]=_0x15e94e[_0x36bbcd(0x174)];if(_0x15e94e?.[_0x36bbcd(0x1b4)])_0x366079['name']=_0x15e94e[_0x36bbcd(0x1b4)];const _0x3be1bb=await apiRequest('/smartapi/dataset/get-dataset-list',{'method':_0x36bbcd(0x1a7),'body':_0x366079});return extractList(_0x3be1bb['data']);}export async function searchDatasets(_0x28dd82,_0xb162cf){const _0x573a08=a93_0x41b7,_0x30eb08=await listDatasets(_0x28dd82,{'name':_0xb162cf}),_0x4a07f7=_0xb162cf['toLowerCase'](),_0x35ce99=new Set(_0x30eb08[_0x573a08(0x1c0)](_0x16d8ae=>_0x16d8ae['id'])),_0x5ccaba=_0x30eb08[_0x573a08(0x169)](_0x1cc134=>_0x1cc134[_0x573a08(0x15b)]?.[_0x573a08(0x1c2)]?.['toLowerCase']()['includes'](_0x4a07f7)||_0x1cc134[_0x573a08(0x193)]?.[_0x573a08(0x1a1)]()[_0x573a08(0x18a)](_0x4a07f7)),_0x1e1d62=await listDatasets(_0x28dd82,{'code':_0xb162cf});for(const _0x28c90b of _0x1e1d62){!_0x35ce99[_0x573a08(0x1b5)](_0x28c90b['id'])&&(_0x30eb08[_0x573a08(0x1c1)](_0x28c90b),_0x35ce99[_0x573a08(0x17e)](_0x28c90b['id']));}return _0x30eb08;}export function normalizeDatasetOperations(_0x7499ca){const _0x4940b8=a93_0x41b7;if(Array[_0x4940b8(0x1a9)](_0x7499ca))return _0x7499ca[_0x4940b8(0x169)](_0xe6e70=>_0xe6e70!=null&&typeof _0xe6e70==='object');if(_0x7499ca&&typeof _0x7499ca===_0x4940b8(0x1b9))return Object['entries'](_0x7499ca)[_0x4940b8(0x169)](([,_0x5461ac])=>_0x5461ac!=null&&typeof _0x5461ac==='object')[_0x4940b8(0x1c0)](([_0x34bca6,_0x3ef539])=>({..._0x3ef539,'name':_0x3ef539['name']??_0x3ef539[_0x4940b8(0x161)]??_0x34bca6}));return[];}export async function getDatasetDetail(_0x7efe7a){const _0x39f93a=a93_0x41b7,_0x275dfb=/^\d+$/[_0x39f93a(0x1b0)](_0x7efe7a)?'id':_0x39f93a(0x174),_0x34f86f=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x275dfb+'='+_0x7efe7a);return _0x34f86f[_0x39f93a(0x156)];}export async function getDatasetOperations(_0x343e3c){const _0x521965=a93_0x41b7,_0x866b1f=await getDatasetDetail(_0x343e3c),_0x3f4248=normalizeDatasetOperations(_0x866b1f[_0x521965(0x1a4)])['map'](_0x3494d2=>({'name':_0x3494d2[_0x521965(0x1b4)]||_0x3494d2[_0x521965(0x161)],'displayName':_0x3494d2[_0x521965(0x191)]||_0x3494d2['name'],'type':_0x3494d2['type'],'method':_0x3494d2[_0x521965(0x1bf)],'path':_0x3494d2[_0x521965(0x15a)],'enabled':_0x3494d2[_0x521965(0x1b3)]??!![],'requestFields':_0x3494d2[_0x521965(0x1c5)],'responseFields':_0x3494d2['responseFields']}));return{'dataset':{'id':_0x866b1f['id']??_0x866b1f[_0x521965(0x18e)],'name':_0x866b1f[_0x521965(0x1b4)],'code':_0x866b1f[_0x521965(0x174)]||_0x866b1f[_0x521965(0x1a3)],'tableName':_0x866b1f[_0x521965(0x1c2)]||_0x866b1f[_0x521965(0x15b)]?.[_0x521965(0x1c2)]},'operations':_0x3f4248};}export async function getOperationDetail(_0x4e8f2b,_0x4d42b1,_0x5165cd){const _0x1bf5cc=a93_0x41b7;let _0x147111=_0x4d42b1;if(!/^\d+$/['test'](_0x4d42b1)){const _0xc7a5aa=await listDatasets(_0x4e8f2b,{'code':_0x4d42b1}),_0x33f994=_0xc7a5aa[_0x1bf5cc(0x183)](_0x36b709=>_0x36b709[_0x1bf5cc(0x174)]===_0x4d42b1||String(_0x36b709['id'])===_0x4d42b1);if(!_0x33f994)throw CliErrors[_0x1bf5cc(0x16d)](_0x1bf5cc(0x185)+_0x4d42b1);_0x147111=String(_0x33f994['id']);}const _0x4dd589=await getDatasetDetail(_0x147111),_0x44e4=normalizeDatasetOperations(_0x4dd589[_0x1bf5cc(0x1a4)])['find'](_0x479797=>(_0x479797[_0x1bf5cc(0x1b4)]||_0x479797[_0x1bf5cc(0x161)])===_0x5165cd);if(!_0x44e4)throw CliErrors[_0x1bf5cc(0x16d)](_0x1bf5cc(0x1b7)+_0x5165cd+_0x1bf5cc(0x181)+_0x4d42b1);return{'dataset':{'id':_0x4dd589['id']??_0x4dd589[_0x1bf5cc(0x18e)],'name':_0x4dd589[_0x1bf5cc(0x1b4)],'code':_0x4dd589[_0x1bf5cc(0x174)]||_0x4dd589[_0x1bf5cc(0x1a3)],'tableName':_0x4dd589[_0x1bf5cc(0x1c2)]||_0x4dd589[_0x1bf5cc(0x15b)]?.[_0x1bf5cc(0x1c2)]},'operation':_0x44e4};}export function generateSdkCode(_0x46cef5,_0x37d355,_0x4a0a8b){const _0x38cceb=a93_0x41b7,_0x581a08=_0x4a0a8b?.['includeImports']??!![],_0x74b7e2=_0x38cceb(0x1b6)+_0x46cef5[_0x38cceb(0x174)]?.[_0x38cceb(0x190)](/-/g,'_'),_0x616fd3=_0x37d355[_0x38cceb(0x1b4)]||_0x37d355[_0x38cceb(0x161)]||_0x38cceb(0x169),_0x352ca8=[];_0x581a08&&_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x187),'',_0x38cceb(0x16a),'');_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1be)+_0x46cef5[_0x38cceb(0x1b4)]+'\x20('+(_0x46cef5[_0x38cceb(0x1c2)]||_0x38cceb(0x167))+')');if(_0x616fd3===_0x38cceb(0x169))_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x1b2),'\x20\x20where:\x20{},',_0x38cceb(0x184),_0x38cceb(0x159),_0x38cceb(0x1ce));else{if(_0x616fd3==='getOne')_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x15f));else{if(_0x616fd3===_0x38cceb(0x1c6))_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+_0x38cceb(0x16f));else{if(_0x616fd3===_0x38cceb(0x16e))_0x352ca8[_0x38cceb(0x1c1)](_0x38cceb(0x1cb)+_0x74b7e2+_0x38cceb(0x180));else _0x616fd3==='delete'||_0x616fd3===_0x38cceb(0x178)?_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+_0x38cceb(0x1bc)):_0x352ca8[_0x38cceb(0x1c1)]('const\x20result\x20=\x20await\x20client.models.'+_0x74b7e2+'.'+_0x616fd3+_0x38cceb(0x196));}}}return _0x352ca8[_0x38cceb(0x17f)]('\x0a');}export function generateSqlCodeTemplate(_0x139c17,_0x1aedbc){const _0x35331d=a93_0x41b7,_0x162abc=_0x1aedbc?.[_0x35331d(0x16b)]??_0x35331d(0x1b8),_0x3d9b7d=_0x1aedbc?.[_0x35331d(0x19b)]??!![],_0x1cebe8=[];return _0x1cebe8['push'](_0x35331d(0x19e)+_0x139c17['sqlName']+'\x20('+_0x139c17[_0x35331d(0x171)]+')'),_0x162abc===_0x35331d(0x1b8)?(_0x3d9b7d&&_0x1cebe8['push'](_0x35331d(0x187),'',_0x35331d(0x16a),''),_0x1cebe8[_0x35331d(0x1c1)](_0x35331d(0x1a0),'\x20\x20sqlCode:\x20\x27'+_0x139c17[_0x35331d(0x171)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x35331d(0x1ce),_0x35331d(0x19a),_0x35331d(0x1ae))):_0x1cebe8['push'](_0x35331d(0x1a5),_0x35331d(0x1bd),'\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({',_0x35331d(0x166)+_0x139c17['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20});',_0x35331d(0x1c8),'}'),_0x1cebe8[_0x35331d(0x17f)]('\x0a');}export async function getErConfig(_0x415b6f,_0x1a30bf){const _0x2043f6=a93_0x41b7,_0x3d8750=await apiRequest(_0x2043f6(0x172),{'method':'POST','body':{'appCode':_0x415b6f,'dblinkId':_0x1a30bf}});return _0x3d8750[_0x2043f6(0x156)];}const REMOTE_APP_PAGE_SIZE=0xc8;export async function listRemoteApps(){const _0x307362=a93_0x41b7,_0x3bd339=await apiRequest(_0x307362(0x1a6),{'method':_0x307362(0x1a7),'body':{'currentPage':0x1,'pageSize':REMOTE_APP_PAGE_SIZE}}),_0x8cae10=extractList(_0x3bd339[_0x307362(0x156)]),_0x25347e=extractPaging(_0x3bd339[_0x307362(0x156)]);return _0x25347e&&_0x25347e[_0x307362(0x19c)]>REMOTE_APP_PAGE_SIZE&&console[_0x307362(0x165)](_0x307362(0x17a)+REMOTE_APP_PAGE_SIZE+_0x307362(0x1aa)+_0x25347e[_0x307362(0x19c)]+_0x307362(0x175)+'Use\x20the\x20platform\x20console\x20to\x20see\x20all.'),_0x8cae10;}
|
package/lib/core/bff/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a94_0xb064(_0x2012b0,_0x26c50b){_0x2012b0=_0x2012b0-0x1d1;const _0x3943af=a94_0x3943();let _0xb06466=_0x3943af[_0x2012b0];return _0xb06466;}function a94_0x3943(){const _0x1a738c=['1819350SIkQAi','1366320lYVHgQ','4670PmbuhC','18uXkEBq','bff-trash','.rabetbase','bff.lock.json','7KdazOr','cwd','/bff','7lrSivK','3428424XPBlFQ','7371630KHoSji','bff','25586OGryIw','3515168uVotqK','6782jCgALK'];a94_0x3943=function(){return _0x1a738c;};return a94_0x3943();}const a94_0x3cee22=a94_0xb064;(function(_0x5e0b25,_0x10752f){const _0x4bd037=a94_0xb064,_0x5daa9e=_0x5e0b25();while(!![]){try{const _0x1744b3=-parseInt(_0x4bd037(0x1e0))/0x1*(parseInt(_0x4bd037(0x1d8))/0x2)+parseInt(_0x4bd037(0x1d9))/0x3+parseInt(_0x4bd037(0x1d7))/0x4+parseInt(_0x4bd037(0x1da))/0x5*(-parseInt(_0x4bd037(0x1dc))/0x6)+-parseInt(_0x4bd037(0x1d2))/0x7*(parseInt(_0x4bd037(0x1d3))/0x8)+-parseInt(_0x4bd037(0x1d4))/0x9+-parseInt(_0x4bd037(0x1db))/0xa*(-parseInt(_0x4bd037(0x1d6))/0xb);if(_0x1744b3===_0x10752f)break;else _0x5daa9e['push'](_0x5daa9e['shift']());}catch(_0x284f26){_0x5daa9e['push'](_0x5daa9e['shift']());}}}(a94_0x3943,0x7544c));import{resolve}from'node:path';const DOT_DIR=a94_0x3cee22(0x1de),LOCK_FILE_NAME=a94_0x3cee22(0x1df),TRASH_DIR_NAME=a94_0x3cee22(0x1dd);export function loadBffProjectConfig(_0x3e5639,_0x486920){const _0x4f2f54=a94_0x3cee22,_0x461f59=resolve(_0x486920??process[_0x4f2f54(0x1e1)]()),_0x3b85b1=DOT_DIR+_0x4f2f54(0x1d1),_0x11e57e=_0x3b85b1+'/'+_0x3e5639;return{'projectRoot':_0x461f59,'appCode':_0x3e5639,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x3b85b1,'scriptsRoot':_0x11e57e,'scriptsRootDir':resolve(_0x461f59,DOT_DIR,_0x4f2f54(0x1d5),_0x3e5639),'lockFilePath':resolve(_0x461f59,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x461f59,DOT_DIR,TRASH_DIR_NAME)};}
|