@lovrabet/rabetbase-cli 2.1.2-beta.3 → 2.1.2
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/login-success-html.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/generate.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/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.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/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.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/pull.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.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-alias.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/entity-with-id.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/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a79_0x36ff5c=a79_0x5406;(function(_0x5ce282,_0x3db250){const _0x3e1ac5=a79_0x5406,_0x356542=_0x5ce282();while(!![]){try{const _0x23dbde=-parseInt(_0x3e1ac5(0x201))/0x1+parseInt(_0x3e1ac5(0x1f5))/0x2*(parseInt(_0x3e1ac5(0x206))/0x3)+-parseInt(_0x3e1ac5(0x218))/0x4+-parseInt(_0x3e1ac5(0x1f9))/0x5+parseInt(_0x3e1ac5(0x20d))/0x6*(parseInt(_0x3e1ac5(0x212))/0x7)+-parseInt(_0x3e1ac5(0x1f8))/0x8+parseInt(_0x3e1ac5(0x1ed))/0x9*(parseInt(_0x3e1ac5(0x1eb))/0xa);if(_0x23dbde===_0x3db250)break;else _0x356542['push'](_0x356542['shift']());}catch(_0x2c53d1){_0x356542['push'](_0x356542['shift']());}}}(a79_0x492f,0xde946));import{createInterface}from'node:readline';function a79_0x492f(){const _0x4f40b4=['name','push','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','local\x20differs\x20from\x20remote','No\x20remote\x20SQL\x20queries\x20matched.','8dwCBFi','paging','unchanged','7383336YsWmem','7789205cICelg','message','Overwrite\x20local\x20files\x20that\x20differ\x20from\x20remote','Pull\x20remote\x20custom\x20SQL\x20queries\x20into\x20.rabetbase/sql/','\x20skipped,\x20','pull','\x20error(s)).','conflict','754359uLdauE','question','str','skipped','would_pull','1038927scIPmI','trim','yes','bool','utf8','Pull\x20failed:\x20could\x20not\x20load\x20SQL\x20content\x20(','Filter\x20by\x20SQL\x20display\x20name\x20(API\x20filter)','9732gehraH','Force\x20pull\x20cancelled.','totalCount','includes','stderr','1491bvrshC','POST','close','sqlcode','toLowerCase','nonInteractive','2079640IjhioF','Would\x20pull\x20','\x20failed','sqlCode','force','appCode','stdin','write','cancelled','610aqFLMn','length','433179smGgqq','sqlName','sql'];a79_0x492f=function(){return _0x4f40b4;};return a79_0x492f();}import{readFile,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryInfo,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{findProjectRootDirectory}from'../../context.js';function a79_0x5406(_0x492039,_0x5e2806){_0x492039=_0x492039-0x1e5;const _0x492f4d=a79_0x492f();let _0x540688=_0x492f4d[_0x492039];return _0x540688;}import{assignSqlFileNames,buildPulledSqlFileContent,resolveSqlLocalDir}from'../../commands/sql/shared.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x3955e4,_0x96bcf){const _0x455f6d=a79_0x5406,_0x5835c2=[];let _0x1f6e42=0x1;while(!![]){const _0x350895=await listSqlQueries(_0x3955e4,{'currentPage':_0x1f6e42,'pageSize':PAGE_SIZE,'sqlCode':_0x96bcf[_0x455f6d(0x1e5)],'sqlName':_0x96bcf['sqlName']}),_0x1a4b8a=_0x350895['tableData']??[];_0x5835c2[_0x455f6d(0x1f1)](..._0x1a4b8a);if(_0x1a4b8a[_0x455f6d(0x1ec)]===0x0)break;const _0x57d66a=_0x350895[_0x455f6d(0x1f6)]?.[_0x455f6d(0x20f)];if(_0x57d66a!=null?_0x5835c2[_0x455f6d(0x1ec)]>=_0x57d66a:_0x1a4b8a['length']<PAGE_SIZE)break;_0x1f6e42++;}return _0x5835c2;}async function ensureSqlContent(_0x1f8563,_0x396023){const _0xe34b1a=a79_0x5406;if(_0x396023['sqlContent']!=null&&String(_0x396023['sqlContent'])[_0xe34b1a(0x1ec)]>0x0)return _0x396023;return getSqlQueryInfo(_0x1f8563,_0x396023['sqlCode']);}export const sqlPull={'service':a79_0x36ff5c(0x1ef),'command':a79_0x36ff5c(0x1fe),'description':a79_0x36ff5c(0x1fc),'risk':a79_0x36ff5c(0x1e9),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a79_0x36ff5c(0x1f0),'type':'string','description':a79_0x36ff5c(0x20c)},{'name':a79_0x36ff5c(0x1e6),'type':'boolean','description':a79_0x36ff5c(0x1fb)}],async 'dryRun'(_0x521170){const _0x4058eb=a79_0x36ff5c,_0x1f1d5f=findProjectRootDirectory(),_0x251450=resolveSqlLocalDir(_0x1f1d5f),_0x1efdf1=_0x521170['str'](_0x4058eb(0x215))||undefined,_0x2539ac=_0x521170[_0x4058eb(0x203)](_0x4058eb(0x1f0))||undefined,_0x3fb1a1=await fetchAllSqlQueries(_0x521170['appCode'],{'sqlCode':_0x1efdf1,'sqlName':_0x2539ac}),_0x53f60a=[],_0x211b71=[];for(const _0x36b9f8 of _0x3fb1a1){try{_0x53f60a['push'](await ensureSqlContent(_0x521170[_0x4058eb(0x1e7)],_0x36b9f8));}catch(_0x3ba79b){_0x211b71[_0x4058eb(0x1f1)]({'sqlCode':_0x36b9f8[_0x4058eb(0x1e5)],'error':_0x3ba79b instanceof Error?_0x3ba79b[_0x4058eb(0x1fa)]:String(_0x3ba79b)});}}const _0x507a76=assignSqlFileNames(_0x53f60a),_0xefd88f=[];for(const [_0x408371,_0x1a57d2]of _0x507a76){const _0x720aa4=join(_0x251450,_0x408371),_0x24f5c1=buildPulledSqlFileContent(_0x1a57d2);let _0x3bd590=_0x4058eb(0x205),_0x557a14;if(await fileExists(_0x720aa4)){const _0x14b8ed=await readFile(_0x720aa4,_0x4058eb(0x20a));_0x14b8ed===_0x24f5c1?(_0x3bd590=_0x4058eb(0x204),_0x557a14=_0x4058eb(0x1f7)):(_0x3bd590=_0x4058eb(0x200),_0x557a14=_0x4058eb(0x1f2));}_0xefd88f[_0x4058eb(0x1f1)]({'sqlCode':_0x1a57d2[_0x4058eb(0x1e5)],'sqlName':_0x1a57d2[_0x4058eb(0x1ee)],'filePath':_0x720aa4,'status':_0x3bd590,'reason':_0x557a14});}return{'method':_0x4058eb(0x213),'url':'/smartapi/custom/queryUserCustomSqlList','body':{'appCode':_0x521170[_0x4058eb(0x1e7)],'sqlCode':_0x1efdf1??null,'sqlName':_0x2539ac??null,'loadErrors':_0x211b71,'files':_0xefd88f},'description':_0x4058eb(0x219)+_0xefd88f['length']+'\x20SQL\x20file(s)\x20under\x20'+_0x251450};},async 'execute'(_0x2a9d66){const _0x297a4d=a79_0x36ff5c,_0x22c808=findProjectRootDirectory(),_0x58f2f5=resolveSqlLocalDir(_0x22c808),_0x4f15e7=_0x2a9d66['str'](_0x297a4d(0x215))||undefined,_0x29d6e0=_0x2a9d66['str'](_0x297a4d(0x1f0))||undefined,_0x37bfa3=_0x2a9d66[_0x297a4d(0x209)](_0x297a4d(0x1e6)),_0x502e13=await fetchAllSqlQueries(_0x2a9d66[_0x297a4d(0x1e7)],{'sqlCode':_0x4f15e7,'sqlName':_0x29d6e0});if(_0x502e13[_0x297a4d(0x1ec)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x297a4d(0x1f4)};const _0x427600=[],_0x5b6c6d=[];for(const _0x206b6b of _0x502e13){try{_0x427600[_0x297a4d(0x1f1)](await ensureSqlContent(_0x2a9d66[_0x297a4d(0x1e7)],_0x206b6b));}catch(_0x4458d8){_0x5b6c6d['push']({'sqlCode':_0x206b6b[_0x297a4d(0x1e5)],'error':_0x4458d8 instanceof Error?_0x4458d8[_0x297a4d(0x1fa)]:String(_0x4458d8)});}}if(_0x427600[_0x297a4d(0x1ec)]===0x0)return{'ok':![],'data':{'pulled':[],'skipped':[],'failed':_0x5b6c6d},'message':_0x297a4d(0x20b)+_0x5b6c6d[_0x297a4d(0x1ec)]+_0x297a4d(0x1ff)};const _0x324a57=assignSqlFileNames(_0x427600);if(_0x37bfa3&&!_0x2a9d66[_0x297a4d(0x217)]){let _0x8b0c25=![];for(const [_0x17b579,_0xcca2ce]of _0x324a57){const _0x26191d=join(_0x58f2f5,_0x17b579),_0x360ec8=buildPulledSqlFileContent(_0xcca2ce);if(await fileExists(_0x26191d)){const _0x1f4040=await readFile(_0x26191d,_0x297a4d(0x20a));if(_0x1f4040!==_0x360ec8){_0x8b0c25=!![];break;}}}if(_0x8b0c25){const _0x44a50d=await confirmForce();if(!_0x44a50d)throw CliErrors[_0x297a4d(0x1ea)](_0x297a4d(0x20e));}}const _0x165e48=[],_0x16241c=[];for(const [_0x44afc6,_0x21c8af]of _0x324a57){const _0x90ae26=join(_0x58f2f5,_0x44afc6),_0x5e9e53=buildPulledSqlFileContent(_0x21c8af);try{if(await fileExists(_0x90ae26)){const _0x45837e=await readFile(_0x90ae26,'utf8');if(_0x45837e===_0x5e9e53){_0x16241c[_0x297a4d(0x1f1)]({'sqlCode':_0x21c8af['sqlCode'],'reason':_0x297a4d(0x1f7)});continue;}if(!_0x37bfa3){_0x16241c[_0x297a4d(0x1f1)]({'sqlCode':_0x21c8af[_0x297a4d(0x1e5)],'reason':_0x297a4d(0x1f3)});continue;}}await ensureParentDirectory(_0x90ae26),await writeFile(_0x90ae26,_0x5e9e53,_0x297a4d(0x20a)),_0x165e48['push']({'sqlCode':_0x21c8af['sqlCode'],'filePath':_0x90ae26});}catch(_0x485c52){_0x5b6c6d[_0x297a4d(0x1f1)]({'sqlCode':_0x21c8af[_0x297a4d(0x1e5)],'error':_0x485c52 instanceof Error?_0x485c52[_0x297a4d(0x1fa)]:String(_0x485c52)});}}const _0x5365e1=_0x5b6c6d['length']===0x0;return{'ok':_0x5365e1,'data':{'pulled':_0x165e48,'skipped':_0x16241c,'failed':_0x5b6c6d},'message':'Pull\x20complete:\x20'+_0x165e48[_0x297a4d(0x1ec)]+'\x20written,\x20'+_0x16241c[_0x297a4d(0x1ec)]+_0x297a4d(0x1fd)+_0x5b6c6d[_0x297a4d(0x1ec)]+_0x297a4d(0x21a)};}};async function confirmForce(){const _0x233677=a79_0x36ff5c,_0xe6fe69=createInterface({'input':process[_0x233677(0x1e8)],'output':process[_0x233677(0x211)]}),_0x55cfbc=await new Promise(_0x4aae18=>{const _0x4bdb15=_0x233677;_0xe6fe69[_0x4bdb15(0x202)]('Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.\x20Continue?\x20[y/N]\x20',_0x4aae18);});return _0xe6fe69[_0x233677(0x214)](),['y',_0x233677(0x208)][_0x233677(0x210)](_0x55cfbc[_0x233677(0x207)]()[_0x233677(0x216)]());}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a83_0x24f3(){const _0x3d81e0=['Updated','Path\x20to\x20the\x20SQL\x20file','blocked','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','658072ZERatA','appCode','write','validation','message','none','dbName','SQL\x20query\x20description','sqlType','Validation:\x20','sqlcode','parameters','\x20chars)','sql','Save\x20SQL\x20query\x20from\x20','string','cwd','dbId','\x20successfully','tables','Type:\x20','POST','1499882cRrgTA','join','Conflict\x20detected','utf-8','3152SPblyE','str','Created','3282430oEzRxk','110430cIGees','SQL\x20query\x20display\x20name','sqlCode','sqlname','created','valid','4llBjCi','action','save','SQL\x20validation\x20failed:\x20','\x20|\x20Tables:\x20','1858251ewgsxj','file','4463870zsozZt','11823UaWLMp','/api/node-toolbox/sql/save','sqlName','9aduTYB'];a83_0x24f3=function(){return _0x3d81e0;};return a83_0x24f3();}const a83_0x465f0c=a83_0x3a87;(function(_0x1424ac,_0x1b903c){const _0x36da20=a83_0x3a87,_0x37c7b5=_0x1424ac();while(!![]){try{const _0x7ddc6f=parseInt(_0x36da20(0x19b))/0x1+-parseInt(_0x36da20(0x17d))/0x2+-parseInt(_0x36da20(0x190))/0x3+-parseInt(_0x36da20(0x18b))/0x4*(-parseInt(_0x36da20(0x192))/0x5)+-parseInt(_0x36da20(0x185))/0x6+-parseInt(_0x36da20(0x193))/0x7*(-parseInt(_0x36da20(0x181))/0x8)+-parseInt(_0x36da20(0x196))/0x9*(parseInt(_0x36da20(0x184))/0xa);if(_0x7ddc6f===_0x1b903c)break;else _0x37c7b5['push'](_0x37c7b5['shift']());}catch(_0x15b60f){_0x37c7b5['push'](_0x37c7b5['shift']());}}}(a83_0x24f3,0x7a252));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 a83_0x3a87(_0x255082,_0x910b52){_0x255082=_0x255082-0x168;const _0x24f385=a83_0x24f3();let _0x3a878d=_0x24f385[_0x255082];return _0x3a878d;}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a83_0x465f0c(0x174),'command':a83_0x465f0c(0x18d),'description':a83_0x465f0c(0x19a),'risk':a83_0x465f0c(0x169),'flags':[{'name':a83_0x465f0c(0x191),'type':'string','required':!![],'description':a83_0x465f0c(0x198)},SQLCODE_FLAG_OPTIONAL,{'name':a83_0x465f0c(0x188),'type':a83_0x465f0c(0x176),'description':a83_0x465f0c(0x186)},{'name':'db','type':'string','description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':'description','type':'string','description':a83_0x465f0c(0x16e)}],async 'validate'(_0x57aa1f){const _0x5548ab=a83_0x465f0c,_0x517732=resolve(process[_0x5548ab(0x177)](),_0x57aa1f['str'](_0x5548ab(0x191)));if(!existsSync(_0x517732))throw CliErrors[_0x5548ab(0x16a)]('File\x20not\x20found:\x20'+_0x517732);const _0x428540=readFileSync(_0x517732,_0x5548ab(0x180)),_0x18405a=validateSql(_0x428540);if(!_0x18405a[_0x5548ab(0x18a)])throw CliErrors[_0x5548ab(0x16a)](_0x5548ab(0x18e)+_0x18405a['message']);},async 'dryRun'(_0x4000fd){const _0x310762=a83_0x465f0c,_0x3aab22=resolve(process[_0x310762(0x177)](),_0x4000fd[_0x310762(0x182)](_0x310762(0x191))),_0x222a6f=readFileSync(_0x3aab22,_0x310762(0x180)),_0x451371=validateSql(_0x222a6f),_0x182d99=_0x4000fd[_0x310762(0x182)]('db')||undefined,{db:_0x293dd8,error:_0x2ad110}=await resolveOneDb(_0x4000fd[_0x310762(0x168)],_0x182d99);return{'method':_0x310762(0x17c),'url':_0x310762(0x194),'body':{'appCode':_0x4000fd[_0x310762(0x168)],'sqlContent':'('+_0x222a6f['length']+_0x310762(0x173),'sqlCode':_0x4000fd[_0x310762(0x182)](_0x310762(0x171))||undefined,'sqlName':_0x4000fd[_0x310762(0x182)]('sqlname')||undefined,'db':_0x293dd8?_0x293dd8[_0x310762(0x16d)]+'\x20('+_0x293dd8['dbId']+')':_0x2ad110},'description':[_0x310762(0x175)+_0x4000fd[_0x310762(0x182)](_0x310762(0x191)),_0x310762(0x170)+_0x451371[_0x310762(0x16b)],_0x310762(0x17b)+_0x451371[_0x310762(0x16f)]['type']+_0x310762(0x18f)+(_0x451371[_0x310762(0x17a)][_0x310762(0x17e)](',\x20')||'N/A')+'\x20|\x20Params:\x20'+(_0x451371[_0x310762(0x172)][_0x310762(0x17e)](',\x20')||_0x310762(0x16c))]['join']('\x0a')};},async 'execute'(_0x5cf53e){const _0x3f7d1f=a83_0x465f0c,_0x50c487=resolve(process[_0x3f7d1f(0x177)](),_0x5cf53e[_0x3f7d1f(0x182)](_0x3f7d1f(0x191))),_0x3382ed=readFileSync(_0x50c487,_0x3f7d1f(0x180)),_0x117597=_0x5cf53e[_0x3f7d1f(0x182)]('db')||undefined,{db:_0x21c345,error:_0x31b895}=await resolveOneDb(_0x5cf53e['appCode'],_0x117597);if(_0x31b895)throw CliErrors[_0x3f7d1f(0x16a)](_0x31b895);const _0x19e84b=await saveSqlQuery({'appCode':_0x5cf53e[_0x3f7d1f(0x168)],'sqlContent':_0x3382ed,'sqlCode':_0x5cf53e[_0x3f7d1f(0x182)](_0x3f7d1f(0x171))||undefined,'sqlName':_0x5cf53e[_0x3f7d1f(0x182)](_0x3f7d1f(0x188))||undefined,'dbId':_0x21c345[_0x3f7d1f(0x178)],'description':_0x5cf53e[_0x3f7d1f(0x182)]('description')||undefined});if(_0x19e84b[_0x3f7d1f(0x199)])return{'ok':![],'data':_0x19e84b,'message':_0x19e84b[_0x3f7d1f(0x16b)]||_0x3f7d1f(0x17f)};return{'ok':!![],'data':{'sqlCode':_0x19e84b[_0x3f7d1f(0x187)],'sqlName':_0x19e84b[_0x3f7d1f(0x195)],'action':_0x19e84b[_0x3f7d1f(0x18c)]},'message':(_0x19e84b['action']===_0x3f7d1f(0x189)?_0x3f7d1f(0x183):_0x3f7d1f(0x197))+_0x3f7d1f(0x179)+(_0x19e84b[_0x3f7d1f(0x187)]?'\x20('+_0x19e84b['sqlCode']+')':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a84_0x3d6e90=a84_0x5d62;(function(_0x345f32,_0x2f538e){const _0x52b2b9=a84_0x5d62,_0x4b1a56=_0x345f32();while(!![]){try{const _0x4533d5=-parseInt(_0x52b2b9(0x180))/0x1*(-parseInt(_0x52b2b9(0x178))/0x2)+-parseInt(_0x52b2b9(0x171))/0x3*(parseInt(_0x52b2b9(0x17e))/0x4)+parseInt(_0x52b2b9(0x185))/0x5+-parseInt(_0x52b2b9(0x16e))/0x6*(-parseInt(_0x52b2b9(0x186))/0x7)+-parseInt(_0x52b2b9(0x17b))/0x8*(parseInt(_0x52b2b9(0x17d))/0x9)+-parseInt(_0x52b2b9(0x184))/0xa+-parseInt(_0x52b2b9(0x177))/0xb;if(_0x4533d5===_0x2f538e)break;else _0x4b1a56['push'](_0x4b1a56['shift']());}catch(_0x5826a9){_0x4b1a56['push'](_0x4b1a56['shift']());}}}(a84_0x342b,0x38bb6));function a84_0x5d62(_0x5256c5,_0x50eb42){_0x5256c5=_0x5256c5-0x16e;const _0x342bc2=a84_0x342b();let _0x5d6223=_0x342bc2[_0x5256c5];return _0x5d6223;}function a84_0x342b(){const _0x31f0db=['2657208BNbqFs','sqlName','9seXzYT','163412TTGwIp','endsWith','46azcBTA','set','.rabetbase/sql','.sql','2587550olnwxt','1702930CGcMvb','698138aeHksC','trimEnd','join','24EWZqSw','trim','unknown','3yUpBLf','description','replace','sqlContent','unnamed','--\x20@lovrabet.sqlName:\x20','3356837SICVWg','18686lBSujG','has','sqlCode'];a84_0x342b=function(){return _0x31f0db;};return a84_0x342b();}import{join}from'node:path';export const SQL_LOCAL_REL_DIR=a84_0x3d6e90(0x182);export function resolveSqlLocalDir(_0x47eae4){return join(_0x47eae4,SQL_LOCAL_REL_DIR);}export function safeSqlFileBaseName(_0x574beb){const _0x199c0b=a84_0x3d6e90,_0x9b2275=_0x574beb['trim']()||'unnamed',_0x57fedf=_0x9b2275[_0x199c0b(0x173)](/[/\\?%*:|"<>]/g,'_')[_0x199c0b(0x173)](/\s+/g,'_')[_0x199c0b(0x173)](/_+/g,'_');return _0x57fedf||_0x199c0b(0x175);}export function assignSqlFileNames(_0xbbb343){const _0x2ad361=a84_0x3d6e90,_0x18827c=new Map();for(const _0x5f43d7 of _0xbbb343){const _0xe79e71=safeSqlFileBaseName(_0x5f43d7[_0x2ad361(0x17c)]??'unnamed');let _0x1edc0b=_0xe79e71+_0x2ad361(0x183);if(_0x18827c[_0x2ad361(0x179)](_0x1edc0b)){const _0x551ce0=(_0x5f43d7['sqlCode']??_0x2ad361(0x170))['replace'](/-/g,'');_0x1edc0b=_0xe79e71+'__'+_0x551ce0+_0x2ad361(0x183);}let _0x25e879=0x0,_0x4c42d0=_0x1edc0b;while(_0x18827c[_0x2ad361(0x179)](_0x4c42d0)){_0x25e879++,_0x4c42d0=_0xe79e71+'__'+_0x25e879+_0x2ad361(0x183);}_0x18827c[_0x2ad361(0x181)](_0x4c42d0,_0x5f43d7);}return _0x18827c;}export function buildPulledSqlFileContent(_0x3395c2){const _0x3caba9=a84_0x3d6e90,_0x599ef7=_0x3395c2['sqlName']??_0x3caba9(0x175),_0x3bf102=_0x3395c2[_0x3caba9(0x17a)]??'',_0x386f00=(_0x3395c2[_0x3caba9(0x172)]??'')[_0x3caba9(0x173)](/\r?\n/g,'\x20')[_0x3caba9(0x16f)](),_0x5619aa=_0x3395c2[_0x3caba9(0x174)]??'',_0x25bf0a=[_0x3caba9(0x176)+_0x599ef7,'--\x20@lovrabet.sqlCode:\x20'+_0x3bf102,'--\x20@lovrabet.description:'+(_0x386f00?'\x20'+_0x386f00:''),'',_0x5619aa[_0x3caba9(0x187)]()],_0x4c8d66=_0x25bf0a[_0x3caba9(0x188)]('\x0a');return _0x4c8d66[_0x3caba9(0x17f)]('\x0a')?_0x4c8d66:_0x4c8d66+'\x0a';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a78_0x241cb0=a78_0x59b0;function a78_0x409c(){const _0xd18dde=['utf-8','file','6335660CrgBjc','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','\x22\x20not\x20found\x20in\x20any\x20dataset','isSelectOnly','3001275DdDfDh','appCode','6466020RVtrqf','map','validate','string','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','fields','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','validation','3509942aCBSvm','67995050ZiMtmj','message','from','str','dbtableConfig','schemas','push','tableName','filter','trim','type','size','reason','length','flagMissing','Provide\x20--file\x20or\x20--sql','sql','3294375IZHsMh','parameters','toLowerCase','tables','File\x20not\x20found:\x20','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','valid','1vxvIMe','4323855zUryFJ','schema:','sqlType','40GIGPjH','cwd','5WcjbKU'];a78_0x409c=function(){return _0xd18dde;};return a78_0x409c();}(function(_0x2fd963,_0x162ed4){const _0x20660f=a78_0x59b0,_0x42c05f=_0x2fd963();while(!![]){try{const _0x449416=parseInt(_0x20660f(0x134))/0x1*(-parseInt(_0x20660f(0x14b))/0x2)+-parseInt(_0x20660f(0x135))/0x3+parseInt(_0x20660f(0x13d))/0x4*(-parseInt(_0x20660f(0x13a))/0x5)+parseInt(_0x20660f(0x143))/0x6+-parseInt(_0x20660f(0x12d))/0x7+parseInt(_0x20660f(0x138))/0x8*(-parseInt(_0x20660f(0x141))/0x9)+parseInt(_0x20660f(0x14c))/0xa;if(_0x449416===_0x162ed4)break;else _0x42c05f['push'](_0x42c05f['shift']());}catch(_0x54edeb){_0x42c05f['push'](_0x42c05f['shift']());}}}(a78_0x409c,0xea21c));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a78_0x59b0(_0x37753a,_0x543f95){_0x37753a=_0x37753a-0x123;const _0x409c9c=a78_0x409c();let _0x59b0ec=_0x409c9c[_0x37753a];return _0x59b0ec;}import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a78_0x241cb0(0x12c),'command':a78_0x241cb0(0x145),'description':a78_0x241cb0(0x13e),'risk':'read','flags':[{'name':a78_0x241cb0(0x13c),'type':a78_0x241cb0(0x146),'description':a78_0x241cb0(0x149)},{'name':a78_0x241cb0(0x12c),'type':'string','description':a78_0x241cb0(0x147)},{'name':'schemas','type':a78_0x241cb0(0x146),'description':a78_0x241cb0(0x132)}],async 'execute'(_0x3e0011){const _0x4f9f60=a78_0x241cb0,_0x25fa51=_0x3e0011[_0x4f9f60(0x14f)](_0x4f9f60(0x13c)),_0x22484e=_0x3e0011[_0x4f9f60(0x14f)](_0x4f9f60(0x12c));if(!_0x25fa51&&!_0x22484e)throw CliErrors[_0x4f9f60(0x12a)]('file',_0x4f9f60(0x12b));let _0x44b150;if(_0x25fa51){const _0x3befed=resolve(process[_0x4f9f60(0x139)](),_0x25fa51);if(!existsSync(_0x3befed))throw CliErrors[_0x4f9f60(0x14a)](_0x4f9f60(0x131)+_0x3befed);_0x44b150=readFileSync(_0x3befed,_0x4f9f60(0x13b));}else _0x44b150=_0x22484e;const _0x22e4bb=validateSql(_0x44b150),_0x4609e8={'valid':_0x22e4bb[_0x4f9f60(0x133)],'sqlType':_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x126)],'isSelectOnly':_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x140)],'isDangerous':_0x22e4bb['sqlType']['isDangerous'],'tables':_0x22e4bb[_0x4f9f60(0x130)],'parameters':_0x22e4bb[_0x4f9f60(0x12e)],'message':_0x22e4bb[_0x4f9f60(0x14d)]};_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x128)]&&(_0x4609e8[_0x4f9f60(0x128)]=_0x22e4bb[_0x4f9f60(0x137)][_0x4f9f60(0x128)]);const _0x444183=_0x3e0011[_0x4f9f60(0x14f)](_0x4f9f60(0x151));if(_0x444183&&_0x22e4bb[_0x4f9f60(0x133)]){const _0x2cb7e1=_0x444183['split'](',')[_0x4f9f60(0x144)](_0x2c1aa1=>_0x2c1aa1[_0x4f9f60(0x125)]())[_0x4f9f60(0x124)](Boolean),_0x5d88ce=[],_0xbb1e8=await listDatasets(_0x3e0011[_0x4f9f60(0x142)]),_0x14efed=new Map(_0xbb1e8[_0x4f9f60(0x144)](_0x1ebbcb=>[_0x1ebbcb['dbtableConfig']?.[_0x4f9f60(0x123)]?.[_0x4f9f60(0x12f)](),_0x1ebbcb]));for(const _0x4fe4ca of _0x22e4bb[_0x4f9f60(0x130)]){const _0x6cb67b=_0x14efed['get'](_0x4fe4ca[_0x4f9f60(0x12f)]());!_0x6cb67b&&_0x5d88ce[_0x4f9f60(0x152)]('Table\x20\x22'+_0x4fe4ca+_0x4f9f60(0x13f));}for(const _0x102fbf of _0x2cb7e1){try{const _0x2fc377=await getDatasetDetail(_0x102fbf),_0x363dc2=Array['isArray'](_0x2fc377[_0x4f9f60(0x148)])?_0x2fc377[_0x4f9f60(0x148)]:[],_0x196514=new Set(_0x363dc2[_0x4f9f60(0x144)](_0x4029ec=>_0x4029ec['name']?.[_0x4f9f60(0x12f)]())),_0x372133=_0x2fc377[_0x4f9f60(0x150)]?.['tableName']||_0x2fc377[_0x4f9f60(0x123)]||_0x102fbf;_0x4609e8[_0x4f9f60(0x136)+_0x372133]={'code':_0x102fbf,'tableName':_0x372133,'fieldCount':_0x196514[_0x4f9f60(0x127)],'fields':Array[_0x4f9f60(0x14e)](_0x196514)};}catch{_0x5d88ce[_0x4f9f60(0x152)]('Dataset\x20\x22'+_0x102fbf+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x5d88ce[_0x4f9f60(0x129)]>0x0&&(_0x4609e8['schemaWarnings']=_0x5d88ce);}return{'ok':_0x22e4bb[_0x4f9f60(0x133)],'data':_0x4609e8,'message':_0x22e4bb['message']};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a34_0x2c37ab=a34_0x2e11;(function(_0x225082,_0x4137f5){const _0xe27be=a34_0x2e11,_0x27104a=_0x225082();while(!![]){try{const _0x3df40c=-parseInt(_0xe27be(0x115))/0x1+parseInt(_0xe27be(0x10f))/0x2+-parseInt(_0xe27be(0xf7))/0x3*(parseInt(_0xe27be(0x101))/0x4)+-parseInt(_0xe27be(0xf4))/0x5+-parseInt(_0xe27be(0xff))/0x6+-parseInt(_0xe27be(0xfc))/0x7+parseInt(_0xe27be(0x109))/0x8;if(_0x3df40c===_0x4137f5)break;else _0x27104a['push'](_0x27104a['shift']());}catch(_0x3e10c6){_0x27104a['push'](_0x27104a['shift']());}}}(a34_0x68e4,0xdb19a));import{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';import{RABETBASE_ENV_VALUES}from'../constant/env.js';import{RABETBASE_OUTPUT_FORMAT_VALUES}from'../constant/output.js';import{RISK_LEVEL_VALUES}from'../constant/risk.js';export{DEFAULT_CONFIG_VALUES}from'../constant/defaults.js';export const PROJECT_CREATE_INHERITABLE_KEYS=[a34_0x2c37ab(0x11b),a34_0x2c37ab(0x102),a34_0x2c37ab(0x114),a34_0x2c37ab(0xfe),a34_0x2c37ab(0x105)];export const TOP_LEVEL_CONFIG_KEYS=new Set([a34_0x2c37ab(0x119),a34_0x2c37ab(0x111),a34_0x2c37ab(0x114),a34_0x2c37ab(0xfe),a34_0x2c37ab(0x11b),a34_0x2c37ab(0x102),a34_0x2c37ab(0x11a)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x898c8c){const _0x5aaed7=a34_0x2c37ab;return[..._0x898c8c][_0x5aaed7(0x100)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x433c62){const _0x3973ec=a34_0x2c37ab;return TOP_LEVEL_CONFIG_KEYS[_0x3973ec(0x104)](_0x433c62);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x398a56=a34_0x2c37ab;return _0x398a56(0xf9)+getTopLevelConfigKeySummary()+')';}function a34_0x2e11(_0x2f5068,_0x292177){_0x2f5068=_0x2f5068-0xf4;const _0x68e465=a34_0x68e4();let _0x2e1109=_0x68e465[_0x2f5068];return _0x2e1109;}export const APP_PROFILE_FLAG_KEY_MAP={'env':a34_0x2c37ab(0x111),'apiDir':a34_0x2c37ab(0x11a),'cookie':a34_0x2c37ab(0x11b),'accessKey':'accessKey','defaultFormat':'format','pageSize':a34_0x2c37ab(0xf5),'riskLevel':'riskLevel','locale':a34_0x2c37ab(0x114)};export function getAppProfileFlagDefs(){const _0x2fb58b=a34_0x2c37ab;return[{'name':_0x2fb58b(0x111),'type':'string','description':'Target\x20environment','enum':[...RABETBASE_ENV_VALUES]},{'name':_0x2fb58b(0x11a),'type':'string','description':_0x2fb58b(0xf6)},{'name':_0x2fb58b(0x11b),'type':_0x2fb58b(0x113),'description':_0x2fb58b(0x117),'hidden':!![]},{'name':_0x2fb58b(0x102),'type':_0x2fb58b(0x113),'description':'Access\x20key','hidden':!![]},{'name':_0x2fb58b(0x110),'type':'string','description':_0x2fb58b(0x106),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':'pageSize','type':_0x2fb58b(0x116),'description':_0x2fb58b(0x112)},{'name':_0x2fb58b(0x105),'type':_0x2fb58b(0x113),'description':_0x2fb58b(0x10a),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x2fb58b(0x114),'type':'string','description':_0x2fb58b(0x10c)}];}export function collectAppProfileOverrides(_0x21214e){const _0x3ee753=a34_0x2c37ab,_0x5d988b={};for(const [_0x2d9b1a,_0x3bdbe8]of Object['entries'](APP_PROFILE_FLAG_KEY_MAP)){const _0x410012=_0x21214e(_0x2d9b1a);if(!_0x410012)continue;_0x5d988b[_0x3bdbe8]=_0x3bdbe8===_0x3ee753(0xf5)?Number(_0x410012):_0x410012;}return _0x5d988b;}export function buildAppProfileListFields(_0x1eb13c){const _0x5da990=a34_0x2c37ab;return{'env':_0x1eb13c[_0x5da990(0x111)]??null,'apiDir':_0x1eb13c['apiDir']??null,'hasCookie':!!_0x1eb13c[_0x5da990(0x11b)],'hasAccessKey':!!_0x1eb13c[_0x5da990(0x102)],'format':_0x1eb13c[_0x5da990(0xfe)]??null,'pageSize':_0x1eb13c[_0x5da990(0xf5)]??null,'riskLevel':_0x1eb13c['riskLevel']??null,'locale':_0x1eb13c[_0x5da990(0x114)]??null};}export function buildAppDoctorFields(_0x4fb030,_0x4cdf38){const _0x567a09=a34_0x2c37ab;return{'env':{'value':_0x4fb030['env']||_0x4cdf38['env'],'source':_0x4fb030['env']?'app':_0x567a09(0xfd)},'apiDir':{'value':_0x4fb030[_0x567a09(0x11a)]||_0x4cdf38[_0x567a09(0x11a)],'source':_0x4fb030[_0x567a09(0x11a)]?'app':_0x567a09(0xfd)},'cookie':{'value':_0x4fb030['cookie']||_0x4cdf38[_0x567a09(0x11b)],'source':_0x4fb030['cookie']?_0x567a09(0x103):_0x567a09(0xfd)},'accessKey':{'value':_0x4fb030['accessKey']||_0x4cdf38['accessKey'],'source':_0x4fb030['accessKey']?'app':_0x567a09(0xfd)}};}export function buildCanonicalAppConfig(_0x1f74cc,_0x29d613){const _0x114645=a34_0x2c37ab,_0x3274f2=_0x1f74cc[_0x114645(0x118)](_0x46d64a=>String(_0x46d64a||'')[_0x114645(0xf8)]())[_0x114645(0x10d)](Boolean);if(_0x3274f2[_0x114645(0xfb)]===0x0)return{};const _0x4021fe={};for(const _0x3fe6f7 of _0x3274f2){_0x4021fe[_0x3fe6f7]=_0x29d613?{'appcode':_0x3fe6f7,'env':_0x29d613}:{'appcode':_0x3fe6f7};}return{'apps':_0x4021fe,'defaultApp':_0x3274f2[0x0]};}function a34_0x68e4(){const _0x38a007=['trim','Config\x20key\x20(','en-US','length','12371611ilkUau','inherit','format','4570974DLizds','join','8332rgOVFu','accessKey','app','has','riskLevel','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','keys','defaultApp','45210584nEONLQ','Risk\x20level','zh-CN','Locale','filter','apps','2880506QIiIdk','defaultFormat','env','Default\x20page\x20size','string','locale','1478408kKpbkR','number','Auth\x20cookie','map','appcode','apiDir','cookie','7704010JZbyMS','pageSize','API\x20directory\x20path','930OFpupa'];a34_0x68e4=function(){return _0x38a007;};return a34_0x68e4();}export function buildCanonicalProjectConfig(_0x42feeb,_0x4a9c56){const _0x1a74f0=a34_0x2c37ab,{appCodes:appCodes=[],env:_0x3be6b5,metadata:_0x55bf27}=_0x4a9c56,_0x26f876={..._0x42feeb,..._0x55bf27||{}};delete _0x26f876[_0x1a74f0(0x119)],delete _0x26f876['app'];if(_0x3be6b5)_0x26f876['env']=_0x3be6b5;else!_0x26f876[_0x1a74f0(0x111)]&&(_0x26f876['env']=DEFAULT_CONFIG_VALUES[_0x1a74f0(0x111)]);const _0x3bd986=buildCanonicalAppConfig(appCodes,_0x26f876[_0x1a74f0(0x111)]);return Object[_0x1a74f0(0x107)](_0x3bd986)[_0x1a74f0(0xfb)]>0x0&&(_0x26f876[_0x1a74f0(0x10e)]=_0x3bd986[_0x1a74f0(0x10e)],_0x26f876[_0x1a74f0(0x108)]=_0x3bd986['defaultApp']),_0x26f876;}const LOCALE_MAP={'zh':a34_0x2c37ab(0x10b),'zh-cn':a34_0x2c37ab(0x10b),'zh_cn':a34_0x2c37ab(0x10b),'en':a34_0x2c37ab(0xfa),'en-us':a34_0x2c37ab(0xfa),'en_us':a34_0x2c37ab(0xfa)};export function normalizeLocale(_0x86620){if(!_0x86620)return null;return LOCALE_MAP[_0x86620['toLowerCase']()]??null;}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a56_0x50508a=a56_0x36fc;function a56_0xa18f(){const _0xd3963a=['schemas','Code\x20filter','code','appcode','all','Clear','62736wVRpSv','value','Schemas','Verbose\x20output','DB\x20ID','env','functionNode','4083MQQgld','Override\x20appcode','operation','Alias\x20for\x20--non-interactive','dbid','key','3300gPoiIm','production\x20|\x20daily','Use\x20project\x20config\x20scope','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','target','function-node','description','Enable\x20BFF\x20save','keyword','Output\x20format','verbose','project','@lovrabet/rabetbase-cli','Operation\x20type','Record\x20ID','Show\x20help','Page\x20size','clear','meowKey','Apply\x20to\x20all','Description','40wmXcTs','Page\x20number','22391310XOhHkt','File\x20path','JSON\x20params','force','655173vlDnkE','Config\x20key','Select\x20app\x20profile\x20by\x20name','format','dryRun','yes','page','type','734peAYSu','json\x20|\x20pretty\x20|\x20compress','5575cRYPfV','string','global','datasetcode','output','nonInteractive','6587420XLAUmt','Dataset\x20code','remote','params','4547574ZGphWX','pagesize','rabetbase','Target\x20path','SQL\x20name','<expr>','sql','file','app','non-interactive','name','Config\x20value','Skip\x20confirmation\x20for\x20high-risk\x20writes','SQL\x20code','Use\x20remote','Type\x20filter','Keyword\x20filter','watch','dry-run','Force\x20overwrite','sqlcode','skipImports','help','operation-type','boolean','operationType','Output\x20path'];a56_0xa18f=function(){return _0xd3963a;};return a56_0xa18f();}(function(_0x48b6cc,_0x333e18){const _0x61a610=a56_0x36fc,_0x3ee171=_0x48b6cc();while(!![]){try{const _0x3bd90d=parseInt(_0x61a610(0x248))/0x1+parseInt(_0x61a610(0x21b))/0x2*(parseInt(_0x61a610(0x24f))/0x3)+-parseInt(_0x61a610(0x1f8))/0x4*(parseInt(_0x61a610(0x21d))/0x5)+-parseInt(_0x61a610(0x227))/0x6+-parseInt(_0x61a610(0x223))/0x7+-parseInt(_0x61a610(0x20d))/0x8*(-parseInt(_0x61a610(0x213))/0x9)+parseInt(_0x61a610(0x20f))/0xa;if(_0x3bd90d===_0x333e18)break;else _0x3ee171['push'](_0x3ee171['shift']());}catch(_0x51f2b8){_0x3ee171['push'](_0x3ee171['shift']());}}}(a56_0xa18f,0x856ab));export const CLI_BIN_NAME=a56_0x50508a(0x229);function a56_0x36fc(_0x28fcf6,_0x3800b2){_0x28fcf6=_0x28fcf6-0x1f3;const _0xa18f27=a56_0xa18f();let _0x36fc1c=_0xa18f27[_0x28fcf6];return _0x36fc1c;}export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';export const NPM_PACKAGE_NAME=a56_0x50508a(0x204);export const GLOBAL_FLAGS=[{'name':a56_0x50508a(0x245),'meowKey':a56_0x50508a(0x245),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x1f3),'hint':'<code>'},{'name':a56_0x50508a(0x22f),'meowKey':a56_0x50508a(0x22f),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x215),'hint':'<name>'},{'name':'env','meowKey':a56_0x50508a(0x24d),'type':a56_0x50508a(0x21e),'description':'Environment','hint':a56_0x50508a(0x1f9)},{'name':a56_0x50508a(0x216),'meowKey':a56_0x50508a(0x216),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x201),'hint':a56_0x50508a(0x21c)},{'name':'jq','meowKey':'jq','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x1fb),'hint':a56_0x50508a(0x22c)},{'name':a56_0x50508a(0x239),'meowKey':a56_0x50508a(0x217),'type':a56_0x50508a(0x23f),'description':'Preview\x20operation\x20without\x20executing'},{'name':a56_0x50508a(0x218),'meowKey':a56_0x50508a(0x218),'type':'boolean','description':a56_0x50508a(0x233)},{'name':a56_0x50508a(0x230),'meowKey':a56_0x50508a(0x222),'type':a56_0x50508a(0x23f),'description':'Force\x20non-interactive\x20mode\x20(CI)'},{'name':a56_0x50508a(0x21f),'meowKey':a56_0x50508a(0x21f),'type':'boolean','description':'Use\x20global\x20config\x20scope'},{'name':'project','meowKey':a56_0x50508a(0x203),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x1fa)},{'name':'ci','meowKey':'ci','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x1f5),'hidden':!![]},{'name':a56_0x50508a(0x23d),'meowKey':a56_0x50508a(0x23d),'type':'boolean','description':a56_0x50508a(0x207)},{'name':'name','meowKey':a56_0x50508a(0x231),'type':a56_0x50508a(0x21e),'description':'Name','hidden':!![]},{'name':a56_0x50508a(0x209),'meowKey':a56_0x50508a(0x209),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x247),'hidden':!![]},{'name':a56_0x50508a(0x238),'meowKey':'watch','type':a56_0x50508a(0x23f),'description':'Watch\x20mode','hidden':!![]},{'name':a56_0x50508a(0x221),'meowKey':a56_0x50508a(0x221),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x241),'hidden':!![]},{'name':a56_0x50508a(0x226),'meowKey':a56_0x50508a(0x226),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x211),'hidden':!![]},{'name':a56_0x50508a(0x220),'meowKey':a56_0x50508a(0x220),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x224),'hidden':!![]},{'name':a56_0x50508a(0x246),'meowKey':a56_0x50508a(0x246),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x20b),'hidden':!![]},{'name':'enable-bff-save','meowKey':'enableBffSave','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x1ff),'hidden':!![]},{'name':'id','meowKey':'id','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x206),'hidden':!![]},{'name':'type','meowKey':a56_0x50508a(0x21a),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x236),'hidden':!![]},{'name':a56_0x50508a(0x22e),'meowKey':a56_0x50508a(0x22e),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x210),'hidden':!![]},{'name':a56_0x50508a(0x23b),'meowKey':a56_0x50508a(0x23b),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x234),'hidden':!![]},{'name':'sqlname','meowKey':'sqlname','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x22b),'hidden':!![]},{'name':a56_0x50508a(0x1f6),'meowKey':'dbid','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x24c),'hidden':!![]},{'name':'description','meowKey':a56_0x50508a(0x1fe),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x20c),'hidden':!![]},{'name':a56_0x50508a(0x219),'meowKey':a56_0x50508a(0x219),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x20e),'hidden':!![]},{'name':a56_0x50508a(0x228),'meowKey':a56_0x50508a(0x228),'type':'string','description':a56_0x50508a(0x208),'hidden':!![]},{'name':a56_0x50508a(0x200),'meowKey':'keyword','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x237),'hidden':!![]},{'name':a56_0x50508a(0x244),'meowKey':'code','type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x243),'hidden':!![]},{'name':a56_0x50508a(0x22d),'meowKey':'sql','type':a56_0x50508a(0x21e),'description':'SQL\x20string','hidden':!![]},{'name':a56_0x50508a(0x242),'meowKey':a56_0x50508a(0x242),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x24a),'hidden':!![]},{'name':a56_0x50508a(0x1f4),'meowKey':a56_0x50508a(0x1f4),'type':'string','description':a56_0x50508a(0x205),'hidden':!![]},{'name':a56_0x50508a(0x1fc),'meowKey':a56_0x50508a(0x1fc),'type':'string','description':a56_0x50508a(0x22a),'hidden':!![]},{'name':'skip-imports','meowKey':a56_0x50508a(0x23c),'type':a56_0x50508a(0x23f),'description':'Skip\x20import\x20generation','hidden':!![]},{'name':a56_0x50508a(0x1f7),'meowKey':a56_0x50508a(0x1f7),'type':'string','description':a56_0x50508a(0x214),'hidden':!![]},{'name':a56_0x50508a(0x249),'meowKey':a56_0x50508a(0x249),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x232),'hidden':!![]},{'name':a56_0x50508a(0x212),'meowKey':a56_0x50508a(0x212),'type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x23a),'hidden':!![]},{'name':a56_0x50508a(0x225),'meowKey':'remote','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x235),'hidden':!![]},{'name':a56_0x50508a(0x202),'meowKey':'verbose','type':a56_0x50508a(0x23f),'description':a56_0x50508a(0x24b),'hidden':!![]},{'name':a56_0x50508a(0x23e),'meowKey':a56_0x50508a(0x240),'type':a56_0x50508a(0x21e),'description':a56_0x50508a(0x205),'hidden':!![]},{'name':a56_0x50508a(0x1fd),'meowKey':a56_0x50508a(0x24e),'type':a56_0x50508a(0x21e),'description':'Function\x20node','hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a56_0x50508a(0x245),'app','env',a56_0x50508a(0x216),'jq',a56_0x50508a(0x239),a56_0x50508a(0x218),a56_0x50508a(0x230),'ci']);export function buildMeowFlags(){const _0x350186=a56_0x50508a;return Object['fromEntries'](GLOBAL_FLAGS['map'](_0x3e1bc3=>[_0x3e1bc3[_0x350186(0x20a)],{'type':_0x3e1bc3[_0x350186(0x21a)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x3b5075=a51_0x1de9;(function(_0xb6d619,_0x3d5111){const _0xcc4804=a51_0x1de9,_0x3a3f58=_0xb6d619();while(!![]){try{const _0x5788cc=parseInt(_0xcc4804(0x125))/0x1+-parseInt(_0xcc4804(0x128))/0x2*(-parseInt(_0xcc4804(0x126))/0x3)+-parseInt(_0xcc4804(0x127))/0x4+parseInt(_0xcc4804(0x12c))/0x5*(-parseInt(_0xcc4804(0x12b))/0x6)+parseInt(_0xcc4804(0x124))/0x7+-parseInt(_0xcc4804(0x12e))/0x8*(parseInt(_0xcc4804(0x123))/0x9)+parseInt(_0xcc4804(0x122))/0xa;if(_0x5788cc===_0x3d5111)break;else _0x3a3f58['push'](_0x3a3f58['shift']());}catch(_0x536b28){_0x3a3f58['push'](_0x3a3f58['shift']());}}}(a51_0x37e1,0xe93b3));import{DEFAULT_API_DIR}from'../constant/paths.js';function a51_0x1de9(_0x408527,_0x3cce35){_0x408527=_0x408527-0x122;const _0x37e16b=a51_0x37e1();let _0x1de993=_0x37e16b[_0x408527];return _0x1de993;}export const DEFAULT_CONFIG_VALUES={'env':'production','format':a51_0x3b5075(0x129),'locale':a51_0x3b5075(0x12d),'riskLevel':a51_0x3b5075(0x12a),'apiDir':DEFAULT_API_DIR};function a51_0x37e1(){const _0x16c136=['en-US','34248VcvXcN','9727540VRrWvQ','2169kuAAsO','6793192xbLuup','1369504qWfypT','2292QzThkW','4815348lprAAw','4486KClOgL','compress','high-risk-write','11012958TmSQCp','5VnpIiL'];a51_0x37e1=function(){return _0x16c136;};return a51_0x37e1();}export const DEFAULT_COMMAND_OUTPUT_FORMAT=a51_0x3b5075(0x129);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a50_0x8dd587=a50_0x1774;function a50_0x1774(_0x59005d,_0xe5482b){_0x59005d=_0x59005d-0xf4;const _0x1e5428=a50_0x1e54();let _0x177473=_0x1e5428[_0x59005d];return _0x177473;}(function(_0x48342f,_0x50c058){const _0x394235=a50_0x1774,_0x4935eb=_0x48342f();while(!![]){try{const _0x34d4b4=parseInt(_0x394235(0x102))/0x1*(parseInt(_0x394235(0xf7))/0x2)+parseInt(_0x394235(0xf9))/0x3+-parseInt(_0x394235(0xfb))/0x4*(-parseInt(_0x394235(0xfa))/0x5)+-parseInt(_0x394235(0xff))/0x6+parseInt(_0x394235(0xf4))/0x7+parseInt(_0x394235(0xfd))/0x8*(-parseInt(_0x394235(0x101))/0x9)+-parseInt(_0x394235(0x100))/0xa;if(_0x34d4b4===_0x50c058)break;else _0x4935eb['push'](_0x4935eb['shift']());}catch(_0x53c206){_0x4935eb['push'](_0x4935eb['shift']());}}}(a50_0x1e54,0xc20cc));function a50_0x1e54(){const _0x506f30=['12813840DnPMoc','50832NyhjPx','93063LWyfcR','1902075wQXpAe','https://user.lovrabet.com','https://api.lovrabet.com','16ZgZgfF','https://runtime.lovrabet.com','4386129xBUcDd','675625jpercQ','44oMPztq','https://daily-runtime.lovrabet.com','1256qBMzVM','https://user-daily.lovrabet.com','6010194IMEovy'];a50_0x1e54=function(){return _0x506f30;};return a50_0x1e54();}import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x2a2f79){customApiDomain=_0x2a2f79?.['apiDomain'],customUserDomain=_0x2a2f79?.['userDomain'],customRuntimeDomain=_0x2a2f79?.['runtimeDomain'];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?a50_0x8dd587(0xf5):a50_0x8dd587(0xfe));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?a50_0x8dd587(0xf6):'https://daily-api.lovrabet.com');export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a50_0x8dd587(0xf8):a50_0x8dd587(0xfc));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x42538b=a54_0x3651;function a54_0x21eb(){const _0x491769=['2768495oYRQdM','332139VkhhBn','93GWjRZs','19526660ivFdqE','68038lurZRi','dev','8tLfwQU','6yHcUOg','online','development','daily','8996776qjknVK','production','303177YSexMA','10513845kSLWTM'];a54_0x21eb=function(){return _0x491769;};return a54_0x21eb();}(function(_0x40e3ed,_0x142637){const _0x4afa63=a54_0x3651,_0x57739c=_0x40e3ed();while(!![]){try{const _0x58886e=parseInt(_0x4afa63(0x8c))/0x1+parseInt(_0x4afa63(0x8f))/0x2*(parseInt(_0x4afa63(0x8d))/0x3)+parseInt(_0x4afa63(0x91))/0x4*(parseInt(_0x4afa63(0x8b))/0x5)+-parseInt(_0x4afa63(0x92))/0x6*(-parseInt(_0x4afa63(0x89))/0x7)+-parseInt(_0x4afa63(0x87))/0x8+parseInt(_0x4afa63(0x8a))/0x9+-parseInt(_0x4afa63(0x8e))/0xa;if(_0x58886e===_0x142637)break;else _0x57739c['push'](_0x57739c['shift']());}catch(_0x390cfc){_0x57739c['push'](_0x57739c['shift']());}}}(a54_0x21eb,0x9969b));export const RABETBASE_ENV_VALUES=[a54_0x42538b(0x88),a54_0x42538b(0x86)];function a54_0x3651(_0x1e4ccb,_0x3b6582){_0x1e4ccb=_0x1e4ccb-0x85;const _0x21ebca=a54_0x21eb();let _0x36518e=_0x21ebca[_0x1e4ccb];return _0x36518e;}export function normalizeEnv(_0x2c2add){const _0xf64849=a54_0x42538b;return _0x2c2add===_0xf64849(0x93)?_0xf64849(0x88):_0x2c2add;}export function isProduction(_0x22386c){const _0x4a96a7=a54_0x42538b;return normalizeEnv(_0x22386c)===_0x4a96a7(0x88);}export function isDaily(_0x15260e){const _0x4b2558=a54_0x42538b;return normalizeEnv(_0x15260e)===_0x4b2558(0x86);}export function isDev(_0xc07444){const _0xe3e31=a54_0x42538b,_0x4914b1=normalizeEnv(_0xc07444);return _0x4914b1===_0xe3e31(0x85)||_0x4914b1===_0xe3e31(0x90);}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a54_0x42538b(0x88));export function getEnv(){return env;}export function initEnv(_0x3b6a23){env=normalizeEnv(_0x3b6a23);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a55_0x50ff(){const _0x21e10e=['21762RpTITs','33651xZatbe','2pHsCYH','153964KhchPo','1327839vylgzv','3130agIoMb','compress','4491040djBGUy','497kEkhFl','2728260smZcrT','142303sMERuD'];a55_0x50ff=function(){return _0x21e10e;};return a55_0x50ff();}const a55_0x7ad2f7=a55_0x53bb;(function(_0x16216b,_0x3bbbc7){const _0x314635=a55_0x53bb,_0x5c09bb=_0x16216b();while(!![]){try{const _0x37fc8d=-parseInt(_0x314635(0xf7))/0x1*(parseInt(_0x314635(0xfa))/0x2)+-parseInt(_0x314635(0xfc))/0x3+parseInt(_0x314635(0xfb))/0x4+-parseInt(_0x314635(0x101))/0x5+-parseInt(_0x314635(0xf8))/0x6*(parseInt(_0x314635(0x100))/0x7)+parseInt(_0x314635(0xff))/0x8+-parseInt(_0x314635(0xf9))/0x9*(-parseInt(_0x314635(0xfd))/0xa);if(_0x37fc8d===_0x3bbbc7)break;else _0x5c09bb['push'](_0x5c09bb['shift']());}catch(_0x212157){_0x5c09bb['push'](_0x5c09bb['shift']());}}}(a55_0x50ff,0x5d48d));function a55_0x53bb(_0x3e8a0a,_0x4a3229){_0x3e8a0a=_0x3e8a0a-0xf7;const _0x50ff51=a55_0x50ff();let _0x53bbd8=_0x50ff51[_0x3e8a0a];return _0x53bbd8;}export const RABETBASE_OUTPUT_FORMAT_VALUES=['json','pretty',a55_0x7ad2f7(0xfe)];
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a53_0x28f7(){const _0x390371=['313331rICXQO','7916656auQNRp','3290176pllhII','1678200rOicmU','858249JDIPxt','489579SJWPHO','12DHldJp','460010vnkxMu'];a53_0x28f7=function(){return _0x390371;};return a53_0x28f7();}function a53_0x4e97(_0x48dfad,_0x46c107){_0x48dfad=_0x48dfad-0x126;const _0x28f774=a53_0x28f7();let _0x4e9701=_0x28f774[_0x48dfad];return _0x4e9701;}(function(_0x52f1f2,_0x5bd24b){const _0x2e176e=a53_0x4e97,_0x3b659c=_0x52f1f2();while(!![]){try{const _0x16253e=-parseInt(_0x2e176e(0x126))/0x1+parseInt(_0x2e176e(0x12c))/0x2*(-parseInt(_0x2e176e(0x12b))/0x3)+parseInt(_0x2e176e(0x128))/0x4+-parseInt(_0x2e176e(0x12d))/0x5+parseInt(_0x2e176e(0x129))/0x6+-parseInt(_0x2e176e(0x12a))/0x7+parseInt(_0x2e176e(0x127))/0x8;if(_0x16253e===_0x5bd24b)break;else _0x3b659c['push'](_0x3b659c['shift']());}catch(_0x3357f4){_0x3b659c['push'](_0x3b659c['shift']());}}}(a53_0x28f7,0x8ec18));export const DEFAULT_API_DIR='./src/api';
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a52_0x1d2c(){const _0x25e8e1=['5290080iYsjDg','13329kSrCQf','478340YPRnYR','high-risk-write','114585IqdVmS','1240EBRASk','135702IMtgMT','72PyJhCU','53620qEOTXE','604336KbtEsS','read','3yqKBbn'];a52_0x1d2c=function(){return _0x25e8e1;};return a52_0x1d2c();}const a52_0x17749=a52_0x3bff;(function(_0x1c1d61,_0x2d1092){const _0x1d4e4a=a52_0x3bff,_0x579929=_0x1c1d61();while(!![]){try{const _0x228e79=-parseInt(_0x1d4e4a(0xc1))/0x1+parseInt(_0x1d4e4a(0xba))/0x2+-parseInt(_0x1d4e4a(0xbc))/0x3*(-parseInt(_0x1d4e4a(0xbf))/0x4)+parseInt(_0x1d4e4a(0xb9))/0x5*(parseInt(_0x1d4e4a(0xb8))/0x6)+parseInt(_0x1d4e4a(0xb7))/0x7+-parseInt(_0x1d4e4a(0xc2))/0x8*(-parseInt(_0x1d4e4a(0xbe))/0x9)+-parseInt(_0x1d4e4a(0xbd))/0xa;if(_0x228e79===_0x2d1092)break;else _0x579929['push'](_0x579929['shift']());}catch(_0x3c5409){_0x579929['push'](_0x579929['shift']());}}}(a52_0x1d2c,0x2608d));function a52_0x3bff(_0x31bc45,_0x701bee){_0x31bc45=_0x31bc45-0xb7;const _0x1d2c82=a52_0x1d2c();let _0x3bff16=_0x1d2c82[_0x31bc45];return _0x3bff16;}export const RISK_LEVEL_VALUES=[a52_0x17749(0xbb),'write',a52_0x17749(0xc0)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a33_0x3bfedc=a33_0x2c09;(function(_0x410772,_0x3dc0e3){const _0x5d23a3=a33_0x2c09,_0x312d04=_0x410772();while(!![]){try{const _0x5e8622=-parseInt(_0x5d23a3(0x188))/0x1*(parseInt(_0x5d23a3(0x166))/0x2)+-parseInt(_0x5d23a3(0x175))/0x3+-parseInt(_0x5d23a3(0x171))/0x4*(parseInt(_0x5d23a3(0x18d))/0x5)+-parseInt(_0x5d23a3(0x168))/0x6*(-parseInt(_0x5d23a3(0x190))/0x7)+parseInt(_0x5d23a3(0x15c))/0x8*(parseInt(_0x5d23a3(0x160))/0x9)+parseInt(_0x5d23a3(0x17e))/0xa+parseInt(_0x5d23a3(0x170))/0xb;if(_0x5e8622===_0x3dc0e3)break;else _0x312d04['push'](_0x312d04['shift']());}catch(_0x393a64){_0x312d04['push'](_0x312d04['shift']());}}}(a33_0x57ef,0xa6d2e));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}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';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x2cc03a){return process.env[`RABETBASE_${_0x2cc03a}`]||process.env[`LOVRABET_${_0x2cc03a}`]||undefined;}export const NEW_CONFIG_NAME='.rabetbase.json';export const CONFIG_NAMES=['.rabetbase.json',a33_0x3bfedc(0x17b),'.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a33_0x3bfedc(0x173)](_0x1dd09e=>_0x1dd09e!==NEW_CONFIG_NAME);function a33_0x2c09(_0x19b870,_0x259bbc){_0x19b870=_0x19b870-0x143;const _0x57effa=a33_0x57ef();let _0x2c0948=_0x57effa[_0x19b870];return _0x2c0948;}export function resolveConfigPath(_0x171589){for(const _0x4af4a8 of CONFIG_NAMES){const _0x5e2fd9=resolve(_0x171589,_0x4af4a8);if(existsSync(_0x5e2fd9))return _0x5e2fd9;}return undefined;}export function findProjectRootDirectory(_0x4a07e4=process[a33_0x3bfedc(0x17a)]()){let _0x19dac2=resolve(_0x4a07e4);const {root:_0x23c3c6}=parse(_0x19dac2),_0x578eaa=homedir();while(!![]){if(resolveConfigPath(_0x19dac2)){if(_0x19dac2===_0x578eaa)break;return _0x19dac2;}if(_0x19dac2===_0x23c3c6||_0x19dac2===_0x578eaa)break;const _0x18d93a=dirname(_0x19dac2);if(_0x18d93a===_0x19dac2)break;_0x19dac2=_0x18d93a;}return resolve(_0x4a07e4);}export async function createContext(_0x43337b){const _0xa5e571=a33_0x3bfedc,_0x3b2800=readRawConfig(),_0x54b809=buildConfig(_0x3b2800,_0x43337b),{initEnv:_0x41ee53}=await import(_0xa5e571(0x14f));if(_0x54b809[_0xa5e571(0x187)])_0x41ee53(_0x54b809[_0xa5e571(0x187)]);else _0x43337b['env']&&typeof _0x43337b[_0xa5e571(0x187)]==='string'&&_0x41ee53(_0x43337b[_0xa5e571(0x187)]);const {initDomains:_0x17eb94,getUserDomain:_0x3ca1a4,getApiDomain:_0x49ff92}=await import(_0xa5e571(0x177));_0x17eb94({'apiDomain':_0x3b2800['apiDomain']||undefined,'userDomain':_0x3b2800['userDomain']||undefined,'runtimeDomain':_0x3b2800[_0xa5e571(0x143)]||undefined});const _0x58b3cf={'apiDomain':_0x49ff92(),'userDomain':_0x3ca1a4()},_0xe1ff86=await buildAuth(_0x54b809);logger[_0xa5e571(0x17f)](process[_0xa5e571(0x17a)]());const _0x513a2f=(CLI_BIN_NAME+'\x20'+process[_0xa5e571(0x16a)][_0xa5e571(0x154)](0x2)[_0xa5e571(0x159)]('\x20'))[_0xa5e571(0x16e)]();logger[_0xa5e571(0x14d)](_0x513a2f);const {isNonInteractive:_0x3fe946}=await import(_0xa5e571(0x18b)),_0x36ae19=_0x3fe946(_0x43337b);return{'config':_0x54b809,'auth':_0xe1ff86,'logger':logger,'env':_0x58b3cf,'nonInteractive':_0x36ae19};}export function buildConfigFromFlags(_0x59e794){return buildConfig(readRawConfig(),_0x59e794);}export function getProjectConfigPath(){return resolveConfigPath(process['cwd']());}function a33_0x57ef(){const _0x3ae36e=['project','map','136MUwoDk','merged','PAGE_SIZE','stringify','257373lmhnVP','cookie','message','appcode','FORMAT','projectConfig','2hWtFef','length','3997482SUUeGN','missing','argv','./auth/get-cookie.js','format','empty','trim','api.ts','1766248gJCJSD','892UXrlqV','object','filter','ACCESS_KEY','2645604JPwHOH','apiDir','./constant/domain.js','https://g.lovrabet.com/dist/lovrabet-skill','warn','cwd','.lovrabet.json','read','ENV','5149390mAuhaq','setLogPath','APP','riskLevel','app','-api.ts','migrated','true','keys','env','39502DzjjRU','utf8','defaultApp','./utils/is-non-interactive.js','config','5005PUzLLH','set','entries','7uoljxr','write','runtimeDomain','inherit','error','apps','MAX_RISK','template_base_url','values','authRequired','find','pageSize','setRawCommand','locale','./constant/env.js','string','COOKIE','daily','status','slice','production','APPCODE','Global','accessKey','join'];a33_0x57ef=function(){return _0x3ae36e;};return a33_0x57ef();}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x5c4851){const _0x409850=a33_0x3bfedc;if(!existsSync(_0x5c4851))return{'status':_0x409850(0x169)};try{const _0x1e7028=readFileSync(_0x5c4851,{'encoding':'utf8'});if(!_0x1e7028?.[_0x409850(0x16e)]())return{'status':_0x409850(0x16d)};const _0x159b20=JSON['parse'](_0x1e7028);return{'status':'ok','data':_0x159b20};}catch(_0x2a4021){return{'status':_0x409850(0x145),'message':_0x2a4021 instanceof Error?_0x2a4021[_0x409850(0x162)]:String(_0x2a4021)};}}function parseCliConfigJsonFile(_0xf05905,_0x2fb0e8,_0x3525b6){const _0x415044=a33_0x3bfedc,_0x222ee=inspectCliConfigJsonFile(_0xf05905);if(_0x222ee['status']===_0x415044(0x169)||_0x222ee['status']===_0x415044(0x16d))return{};if(_0x222ee[_0x415044(0x153)]==='ok')return _0x222ee['data'];return _0x2fb0e8===_0x415044(0x179)&&_0x3525b6&&console[_0x415044(0x145)](CLI_BIN_NAME+':\x20'+_0x3525b6+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0xf05905+'\x0a\x20\x20'+_0x222ee['message']),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x4f95e6){const _0x4624cc=a33_0x3bfedc;if(!_0x4f95e6||typeof _0x4f95e6!==_0x4624cc(0x172))return{'config':{},'migrated':![]};const _0x6b7fd7={..._0x4f95e6},_0x194522=_0x6b7fd7[_0x4624cc(0x146)]&&typeof _0x6b7fd7['apps']===_0x4624cc(0x172)?{..._0x6b7fd7[_0x4624cc(0x146)]}:{},_0x3432bd=Object['keys'](_0x194522)[_0x4624cc(0x167)],_0x215863=_0x6b7fd7[_0x4624cc(0x163)]||_0x6b7fd7['app'];let _0x55d737=![];if(_0x215863&&_0x3432bd===0x0){const _0x24544d=typeof _0x6b7fd7[_0x4624cc(0x18a)]===_0x4624cc(0x150)&&_0x6b7fd7[_0x4624cc(0x18a)]['trim']()?_0x6b7fd7[_0x4624cc(0x18a)]:String(_0x215863)[_0x4624cc(0x16e)]();_0x194522[_0x24544d]={'appcode':String(_0x215863)[_0x4624cc(0x16e)](),..._0x6b7fd7['env']!=null?{'env':_0x6b7fd7[_0x4624cc(0x187)]}:{},..._0x6b7fd7[_0x4624cc(0x176)]!=null?{'apiDir':_0x6b7fd7['apiDir']}:{},..._0x6b7fd7[_0x4624cc(0x161)]!=null?{'cookie':_0x6b7fd7['cookie']}:{},..._0x6b7fd7[_0x4624cc(0x158)]!=null?{'accessKey':_0x6b7fd7[_0x4624cc(0x158)]}:{},..._0x6b7fd7[_0x4624cc(0x16c)]!=null?{'format':_0x6b7fd7[_0x4624cc(0x16c)]}:{},..._0x6b7fd7[_0x4624cc(0x14c)]!=null?{'pageSize':_0x6b7fd7[_0x4624cc(0x14c)]}:{},..._0x6b7fd7[_0x4624cc(0x181)]!=null?{'riskLevel':_0x6b7fd7[_0x4624cc(0x181)]}:{},..._0x6b7fd7['locale']!=null?{'locale':_0x6b7fd7[_0x4624cc(0x14e)]}:{}},_0x6b7fd7['apps']=_0x194522;if(!_0x6b7fd7[_0x4624cc(0x18a)])_0x6b7fd7['defaultApp']=_0x24544d;_0x55d737=!![];}return(_0x4624cc(0x163)in _0x6b7fd7||_0x4624cc(0x182)in _0x6b7fd7)&&(delete _0x6b7fd7['appcode'],delete _0x6b7fd7[_0x4624cc(0x182)],_0x55d737=!![]),{'config':_0x6b7fd7,'migrated':_0x55d737};}function writeNormalizedConfigIfNeeded(_0x5045b2,_0x1ab5d4){const _0x257e6f=a33_0x3bfedc,_0x9b16e7=JSON['stringify'](_0x1ab5d4,null,0x2)+'\x0a';if(normalizedWriteCache['get'](_0x5045b2)===_0x9b16e7)return;writeConfigFile(_0x5045b2,_0x1ab5d4),normalizedWriteCache[_0x257e6f(0x18e)](_0x5045b2,_0x9b16e7);}function parseAndNormalizeConfig(_0x111ba3,_0x14094f,_0x5a1a91){const _0x366a09=a33_0x3bfedc,_0x871cb1=parseCliConfigJsonFile(_0x111ba3,_0x14094f,_0x5a1a91),_0x51dc7c=normalizeLegacyConfigShape(_0x871cb1);if(_0x51dc7c[_0x366a09(0x184)])try{writeNormalizedConfigIfNeeded(_0x111ba3,_0x51dc7c[_0x366a09(0x18c)]);}catch{}return _0x51dc7c[_0x366a09(0x18c)];}export function loadRawConfigLayers(_0x33fdfc){const _0x4735cf=a33_0x3bfedc;let _0x3b5ebc={},_0xf527ab={};const _0x304798=resolveConfigPath(homedir());_0x304798&&(_0x3b5ebc=parseAndNormalizeConfig(_0x304798,_0x4735cf(0x179),_0x4735cf(0x157)));const _0x2a9538=_0x33fdfc??findProjectRootDirectory(),_0x4c35f0=resolveConfigPath(_0x2a9538);return _0x4c35f0&&(_0xf527ab=parseAndNormalizeConfig(_0x4c35f0,'warn','Project')),{'globalPath':_0x304798,'projectPath':_0x4c35f0,'globalConfig':_0x3b5ebc,'projectConfig':_0xf527ab};}function mergeRawConfigLayers(_0x5c2318){const _0x23df3f=a33_0x3bfedc,{globalConfig:_0x1511eb,projectConfig:_0x38508a}=_0x5c2318;if(_0x38508a[_0x23df3f(0x144)]===![]){const _0x481665={..._0x38508a};delete _0x481665['inherit'];const _0x3152d3=_0x38508a[_0x23df3f(0x146)]&&typeof _0x38508a['apps']==='object'?_0x38508a[_0x23df3f(0x146)]:{};Object[_0x23df3f(0x186)](_0x3152d3)[_0x23df3f(0x167)]>0x0?_0x481665[_0x23df3f(0x146)]=_0x3152d3:delete _0x481665['apps'];if(_0x23df3f(0x18a)in _0x38508a)_0x481665[_0x23df3f(0x18a)]=_0x38508a[_0x23df3f(0x18a)];else Object[_0x23df3f(0x186)](_0x3152d3)[_0x23df3f(0x167)]>0x0&&(_0x481665[_0x23df3f(0x18a)]=Object['keys'](_0x3152d3)[0x0]);return _0x481665;}const _0x11f6c8=_0x1511eb[_0x23df3f(0x146)]&&typeof _0x1511eb[_0x23df3f(0x146)]==='object'?_0x1511eb[_0x23df3f(0x146)]:{},_0x33823c=_0x38508a[_0x23df3f(0x146)]&&typeof _0x38508a['apps']===_0x23df3f(0x172)?_0x38508a[_0x23df3f(0x146)]:{},_0x158854={..._0x11f6c8,..._0x33823c},_0x6df72b={..._0x1511eb,..._0x38508a};Object[_0x23df3f(0x186)](_0x158854)['length']>0x0&&(_0x6df72b['apps']=_0x158854);if(_0x23df3f(0x18a)in _0x38508a)_0x6df72b['defaultApp']=_0x38508a[_0x23df3f(0x18a)];else{if(_0x33823c&&Object[_0x23df3f(0x186)](_0x33823c)['length']>0x0)_0x6df72b[_0x23df3f(0x18a)]=Object['keys'](_0x33823c)[0x0];else{if(_0x1511eb[_0x23df3f(0x18a)])_0x6df72b[_0x23df3f(0x18a)]=_0x1511eb['defaultApp'];else{const _0x58d48c=Object[_0x23df3f(0x186)](_0x11f6c8);_0x58d48c[_0x23df3f(0x167)]>0x0&&(_0x6df72b['defaultApp']=_0x58d48c[0x0]);}}}return _0x6df72b;}export function readRawConfigWithLayers(_0x36c78b){const _0x106527=loadRawConfigLayers(_0x36c78b);return{'config':mergeRawConfigLayers(_0x106527),'layers':_0x106527};}export function readRawConfig(_0x3af9d7){return mergeRawConfigLayers(loadRawConfigLayers(_0x3af9d7));}export function getConfigAppCode(_0x2b9a61){const _0x2e85ba=a33_0x3bfedc,_0xa93a9a=readRawConfig(_0x2b9a61);if(_0xa93a9a[_0x2e85ba(0x146)]&&typeof _0xa93a9a[_0x2e85ba(0x146)]===_0x2e85ba(0x172)){const _0x4938fe=_0xa93a9a['defaultApp'];if(_0x4938fe&&_0xa93a9a[_0x2e85ba(0x146)][_0x4938fe]?.['appcode'])return String(_0xa93a9a[_0x2e85ba(0x146)][_0x4938fe][_0x2e85ba(0x163)])[_0x2e85ba(0x16e)]();const _0x51e477=Object[_0x2e85ba(0x149)](_0xa93a9a['apps'])[0x0];if(_0x51e477?.[_0x2e85ba(0x163)])return String(_0x51e477['appcode'])[_0x2e85ba(0x16e)]();}const _0x3af87c=_0xa93a9a['appcode']||_0xa93a9a[_0x2e85ba(0x182)];if(typeof _0x3af87c!=='string'||_0x3af87c['trim']()==='')return undefined;return _0x3af87c[_0x2e85ba(0x16e)]();}export function getMultiAppConfigs(_0x58ca0e='project',_0x429a0a){const _0x3549b2=a33_0x3bfedc,_0x52b234=_0x58ca0e===_0x3549b2(0x15d)?readRawConfig(_0x429a0a):loadRawConfigLayers(_0x429a0a)[_0x3549b2(0x165)],_0x27f004=_0x52b234[_0x3549b2(0x146)];if(!_0x27f004||typeof _0x27f004!==_0x3549b2(0x172)||Object[_0x3549b2(0x186)](_0x27f004)[_0x3549b2(0x167)]===0x0)return null;const _0x4e6cee=_0x52b234['defaultApp'];return Object[_0x3549b2(0x18f)](_0x27f004)[_0x3549b2(0x15b)](([_0xf3d259,_0x4dc9f0])=>({'name':_0xf3d259,'appcode':_0x4dc9f0?.[_0x3549b2(0x163)]||'','isDefault':_0xf3d259===_0x4e6cee,'env':_0x4dc9f0?.[_0x3549b2(0x187)],'apiDir':_0x4dc9f0?.[_0x3549b2(0x176)],'cookie':_0x4dc9f0?.[_0x3549b2(0x161)]||undefined}))[_0x3549b2(0x173)](_0x483346=>_0x483346['appcode']);}export function getTemplateBaseUrl(_0x5d6fc5){const _0x3c3c=a33_0x3bfedc,_0x10d6fe=readRawConfig(_0x5d6fc5);if(_0x10d6fe['template_base_url']&&typeof _0x10d6fe['template_base_url']===_0x3c3c(0x150))return _0x10d6fe[_0x3c3c(0x148)]['replace'](/\/$/,'');return _0x3c3c(0x178);}export function readConfigFile(_0x13255b){return parseAndNormalizeConfig(_0x13255b,'silent');}export function writeConfigFile(_0x2aeb84,_0x3fd95b){const _0x3818c2=a33_0x3bfedc,_0x495fdd=dirname(_0x2aeb84);!existsSync(_0x495fdd)&&mkdirSync(_0x495fdd,{'recursive':!![]});const _0xe15ec8=_0x2aeb84+'.tmp';try{writeFileSync(_0xe15ec8,JSON[_0x3818c2(0x15f)](_0x3fd95b,null,0x2)+'\x0a',{'encoding':_0x3818c2(0x189),'mode':0x180}),renameSync(_0xe15ec8,_0x2aeb84);}catch(_0x5e23dd){try{unlinkSync(_0xe15ec8);}catch{}throw _0x5e23dd;}}export function resolveWriteConfigPath(_0x25fa93){const _0x178bee=a33_0x3bfedc,_0x5ddb19=_0x25fa93===_0x178bee(0x15a)?process[_0x178bee(0x17a)]():homedir(),_0x3b0c88=resolveConfigPath(_0x5ddb19);return _0x3b0c88??resolve(_0x5ddb19,NEW_CONFIG_NAME);}function buildConfig(_0x268524,_0x2ae8b4){const _0x37509a=a33_0x3bfedc,_0x59bc43={};if(_0x268524[_0x37509a(0x146)]&&typeof _0x268524[_0x37509a(0x146)]===_0x37509a(0x172))for(const [_0x2e56e4,_0x28540b]of Object['entries'](_0x268524['apps'])){_0x28540b&&typeof _0x28540b===_0x37509a(0x172)&&_0x28540b['appcode']&&(_0x59bc43[_0x2e56e4]=_0x28540b);}const _0x45b969=_0x268524[_0x37509a(0x18a)]||undefined,_0x17f68f=Object['keys'](_0x59bc43)[_0x37509a(0x167)]>0x0,_0x599071=_0x2ae8b4[_0x37509a(0x182)]||env(_0x37509a(0x180))||undefined,_0x353cc1=_0x599071||_0x45b969||undefined,_0x37c963=_0x2ae8b4[_0x37509a(0x163)]||env(_0x37509a(0x156))||undefined,_0x1b2ea4=_0x37c963?Object[_0x37509a(0x18f)](_0x59bc43)[_0x37509a(0x14b)](([,_0x2bfb1e])=>_0x2bfb1e?.['appcode']===_0x37c963):undefined,_0x2066ff=_0x1b2ea4?.[0x0],_0x1e2bed=_0x1b2ea4?.[0x1];let _0x3b5d96=_0x37c963?_0x2066ff:_0x353cc1,_0x2dd0cf=_0x3b5d96&&_0x59bc43[_0x3b5d96]?_0x59bc43[_0x3b5d96]:undefined;_0x37c963&&_0x1e2bed&&(_0x2dd0cf=_0x1e2bed);const _0x23dc5f=_0x37c963?_0x1e2bed??_0x2dd0cf:_0x2dd0cf,_0x12e1ea=_0x599071||(_0x37c963?_0x2066ff:undefined),_0xd39819=_0x37c963||_0x23dc5f?.[_0x37509a(0x163)]||undefined,_0x404194=_0x2ae8b4[_0x37509a(0x187)]||env(_0x37509a(0x17d))||_0x23dc5f?.[_0x37509a(0x187)]||_0x268524[_0x37509a(0x187)]||DEFAULT_CONFIG_VALUES[_0x37509a(0x187)],_0x5aef5a=_0x23dc5f?.[_0x37509a(0x14e)]||_0x268524['locale']||DEFAULT_CONFIG_VALUES[_0x37509a(0x14e)],_0x20dc04=env(_0x37509a(0x151))||_0x23dc5f?.[_0x37509a(0x161)]||_0x268524[_0x37509a(0x161)]||undefined,_0x5baffe=env(_0x37509a(0x174))||_0x23dc5f?.[_0x37509a(0x158)]||_0x268524['accessKey']||undefined,_0x453a77=_0x2ae8b4[_0x37509a(0x16c)]||env(_0x37509a(0x164))||_0x23dc5f?.[_0x37509a(0x16c)]||_0x268524[_0x37509a(0x16c)],_0x43ee4f=normalizeLegacyOutputFormat(_0x453a77),_0x18ff9c=env(_0x37509a(0x15e))||_0x23dc5f?.['pageSize']||_0x268524[_0x37509a(0x14c)],_0x51fc95=_0x18ff9c?Number(_0x18ff9c)||undefined:undefined,_0x55aaf8=env('RISK_LEVEL')||env(_0x37509a(0x147))||_0x23dc5f?.[_0x37509a(0x181)]||_0x268524[_0x37509a(0x181)]||_0x268524['maxRisk'],_0x19a027=_0x55aaf8===_0x37509a(0x17c)||_0x55aaf8===_0x37509a(0x191)?_0x55aaf8:DEFAULT_CONFIG_VALUES[_0x37509a(0x181)],_0x31c9ea=env('VERBOSE'),_0x31de5c=_0x31c9ea==='1'||_0x31c9ea===_0x37509a(0x185),_0x57ff80=_0x23dc5f?.[_0x37509a(0x176)]||_0x268524['apiDir']||DEFAULT_CONFIG_VALUES['apiDir'],_0x2281d5=isDaily(normalizeEnv(String(_0x404194)))?_0x37509a(0x152):_0x37509a(0x155);return{'appCode':typeof _0xd39819==='string'&&_0xd39819[_0x37509a(0x16e)]()?_0xd39819[_0x37509a(0x16e)]():undefined,'env':_0x2281d5,'locale':_0x5aef5a,'cookie':_0x20dc04,'accessKey':_0x5baffe,'format':_0x43ee4f,'pageSize':_0x51fc95,'riskLevel':_0x19a027,'verbose':_0x31de5c,'apiDir':_0x57ff80,'apps':_0x59bc43,'defaultApp':_0x45b969,'currentApp':_0x17f68f?_0x3b5d96:undefined,'explicitAppName':_0x12e1ea,'raw':_0x268524};}async function buildAuth(_0x4f6897){const _0xcfe01f=a33_0x3bfedc,{getCookie:_0x1f865f}=await import(_0xcfe01f(0x16b)),_0x412d3b=_0x4f6897['cookie']||_0x1f865f(),_0x39235a=_0x412d3b?await getIsSessionValid():![];return{'cookie':_0x412d3b,'isLoggedIn':_0x39235a,async 'getOrLogin'(){const _0x548b6d=_0xcfe01f;if(_0x412d3b&&_0x39235a)return _0x412d3b;throw CliErrors[_0x548b6d(0x14a)]();}};}export function resolveApiFilePath(_0x18b5bc,_0x5cfa44){const _0x3a4f19=a33_0x3bfedc,_0x1e8b66=resolve(process['cwd'](),_0x18b5bc),_0xf0ce7b=resolve(_0x1e8b66,_0x3a4f19(0x16f));if(!_0x5cfa44)return _0xf0ce7b;const _0xd738a4=readRawConfig(),_0x5c9479=_0xd738a4['apps']&&typeof _0xd738a4[_0x3a4f19(0x146)]===_0x3a4f19(0x172)?_0xd738a4['apps']:{},_0x5d5a2f=Object[_0x3a4f19(0x18f)](_0x5c9479)[_0x3a4f19(0x14b)](([,_0x187190])=>_0x187190?.['appcode']===_0x5cfa44);if(!_0x5d5a2f)return _0xf0ce7b;const [_0x453649,_0x207ebc]=_0x5d5a2f,_0x29405d=typeof _0xd738a4[_0x3a4f19(0x18a)]===_0x3a4f19(0x150)?_0xd738a4[_0x3a4f19(0x18a)]:undefined;if(_0x207ebc?.[_0x3a4f19(0x176)])return _0xf0ce7b;if(_0x29405d&&_0x453649!==_0x29405d)return resolve(_0x1e8b66,_0x453649+_0x3a4f19(0x183));return _0xf0ce7b;}
|
|
1
|
+
const a33_0x2638b9=a33_0x6b50;(function(_0x2bb85e,_0x1424e7){const _0xe288e4=a33_0x6b50,_0x4bff72=_0x2bb85e();while(!![]){try{const _0x289d0a=-parseInt(_0xe288e4(0xed))/0x1*(-parseInt(_0xe288e4(0xe6))/0x2)+parseInt(_0xe288e4(0xf6))/0x3*(-parseInt(_0xe288e4(0xfc))/0x4)+parseInt(_0xe288e4(0xf4))/0x5*(-parseInt(_0xe288e4(0x118))/0x6)+parseInt(_0xe288e4(0x121))/0x7*(-parseInt(_0xe288e4(0xf8))/0x8)+parseInt(_0xe288e4(0x10b))/0x9+parseInt(_0xe288e4(0x106))/0xa+-parseInt(_0xe288e4(0xf9))/0xb;if(_0x289d0a===_0x1424e7)break;else _0x4bff72['push'](_0x4bff72['shift']());}catch(_0x5432f2){_0x4bff72['push'](_0x4bff72['shift']());}}}(a33_0x1551,0xa6aba));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname,parse}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';import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x1dcbc9){return process.env[`RABETBASE_${_0x1dcbc9}`]||process.env[`LOVRABET_${_0x1dcbc9}`]||undefined;}export const NEW_CONFIG_NAME=a33_0x2638b9(0xdf);export const CONFIG_NAMES=['.rabetbase.json',a33_0x2638b9(0x10c),a33_0x2638b9(0xdc)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a33_0x2638b9(0x10e)](_0x448f8a=>_0x448f8a!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x5c9a57){for(const _0x1a7b8e of CONFIG_NAMES){const _0x330348=resolve(_0x5c9a57,_0x1a7b8e);if(existsSync(_0x330348))return _0x330348;}return undefined;}export function findProjectRootDirectory(_0x446f7f=process['cwd']()){let _0x39b4de=resolve(_0x446f7f);const {root:_0x26f46a}=parse(_0x39b4de),_0x4a57dd=homedir();while(!![]){if(resolveConfigPath(_0x39b4de)){if(_0x39b4de===_0x4a57dd)break;return _0x39b4de;}if(_0x39b4de===_0x26f46a||_0x39b4de===_0x4a57dd)break;const _0x739a80=dirname(_0x39b4de);if(_0x739a80===_0x39b4de)break;_0x39b4de=_0x739a80;}return resolve(_0x446f7f);}export async function createContext(_0x107f58){const _0x30dc75=a33_0x2638b9,_0x3b6a61=readRawConfig(),_0x115477=buildConfig(_0x3b6a61,_0x107f58),{initEnv:_0x2b7648}=await import(_0x30dc75(0x101));if(_0x115477['env'])_0x2b7648(_0x115477[_0x30dc75(0xd2)]);else _0x107f58[_0x30dc75(0xd2)]&&typeof _0x107f58['env']==='string'&&_0x2b7648(_0x107f58['env']);const {initDomains:_0x567370,getUserDomain:_0x4d9b1c,getApiDomain:_0x5449d7}=await import('./constant/domain.js');_0x567370({'apiDomain':_0x3b6a61['apiDomain']||undefined,'userDomain':_0x3b6a61[_0x30dc75(0xd6)]||undefined,'runtimeDomain':_0x3b6a61[_0x30dc75(0xee)]||undefined});const _0x481232={'apiDomain':_0x5449d7(),'userDomain':_0x4d9b1c()},_0xb099a2=await buildAuth(_0x115477);logger[_0x30dc75(0xfb)](process[_0x30dc75(0x11b)]());const _0x296415=(CLI_BIN_NAME+'\x20'+process['argv']['slice'](0x2)[_0x30dc75(0xf1)]('\x20'))[_0x30dc75(0x117)]();logger['setRawCommand'](_0x296415);const {isNonInteractive:_0x5a8c25}=await import(_0x30dc75(0xfa)),_0x12274f=_0x5a8c25(_0x107f58);return{'config':_0x115477,'auth':_0xb099a2,'logger':logger,'env':_0x481232,'nonInteractive':_0x12274f};}export function buildConfigFromFlags(_0x1c8306){return buildConfig(readRawConfig(),_0x1c8306);}export function getProjectConfigPath(){const _0x33c9b9=a33_0x2638b9;return resolveConfigPath(process[_0x33c9b9(0x11b)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x3d86d2){const _0x4439b3=a33_0x2638b9;if(!existsSync(_0x3d86d2))return{'status':_0x4439b3(0xd8)};try{const _0x201de4=readFileSync(_0x3d86d2,{'encoding':_0x4439b3(0xe8)});if(!_0x201de4?.[_0x4439b3(0x117)]())return{'status':_0x4439b3(0xf3)};const _0x5d7357=JSON[_0x4439b3(0xe4)](_0x201de4);return{'status':'ok','data':_0x5d7357};}catch(_0x5be55c){return{'status':_0x4439b3(0xf7),'message':_0x5be55c instanceof Error?_0x5be55c[_0x4439b3(0x120)]:String(_0x5be55c)};}}function parseCliConfigJsonFile(_0x3985ff,_0x51589b,_0x4a4647){const _0x5130af=a33_0x2638b9,_0x4d36e3=inspectCliConfigJsonFile(_0x3985ff);if(_0x4d36e3[_0x5130af(0x103)]===_0x5130af(0xd8)||_0x4d36e3[_0x5130af(0x103)]===_0x5130af(0xf3))return{};if(_0x4d36e3['status']==='ok')return _0x4d36e3['data'];return _0x51589b===_0x5130af(0x10d)&&_0x4a4647&&console[_0x5130af(0xf7)](CLI_BIN_NAME+':\x20'+_0x4a4647+_0x5130af(0xd4)+_0x3985ff+'\x0a\x20\x20'+_0x4d36e3[_0x5130af(0x120)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0xaf3fec){const _0x54c477=a33_0x2638b9;if(!_0xaf3fec||typeof _0xaf3fec!==_0x54c477(0xd9))return{'config':{},'migrated':![]};const _0x230344={..._0xaf3fec},_0x10d151=_0x230344[_0x54c477(0xda)]&&typeof _0x230344[_0x54c477(0xda)]===_0x54c477(0xd9)?{..._0x230344[_0x54c477(0xda)]}:{},_0x58b494=Object[_0x54c477(0x105)](_0x10d151)['length'],_0x232929=_0x230344[_0x54c477(0xe5)]||_0x230344[_0x54c477(0xeb)];let _0x3fa681=![];if(_0x232929&&_0x58b494===0x0){const _0x2d866c=typeof _0x230344[_0x54c477(0xd7)]==='string'&&_0x230344[_0x54c477(0xd7)][_0x54c477(0x117)]()?_0x230344[_0x54c477(0xd7)]:String(_0x232929)[_0x54c477(0x117)]();_0x10d151[_0x2d866c]={'appcode':String(_0x232929)[_0x54c477(0x117)](),..._0x230344[_0x54c477(0xd2)]!=null?{'env':_0x230344[_0x54c477(0xd2)]}:{},..._0x230344['apiDir']!=null?{'apiDir':_0x230344[_0x54c477(0xd5)]}:{},..._0x230344[_0x54c477(0xea)]!=null?{'cookie':_0x230344[_0x54c477(0xea)]}:{},..._0x230344['accessKey']!=null?{'accessKey':_0x230344[_0x54c477(0xe7)]}:{},..._0x230344[_0x54c477(0xff)]!=null?{'format':_0x230344[_0x54c477(0xff)]}:{},..._0x230344[_0x54c477(0x104)]!=null?{'pageSize':_0x230344[_0x54c477(0x104)]}:{},..._0x230344[_0x54c477(0x108)]!=null?{'riskLevel':_0x230344[_0x54c477(0x108)]}:{},..._0x230344[_0x54c477(0x11f)]!=null?{'locale':_0x230344['locale']}:{}},_0x230344['apps']=_0x10d151;if(!_0x230344[_0x54c477(0xd7)])_0x230344[_0x54c477(0xd7)]=_0x2d866c;_0x3fa681=!![];}return(_0x54c477(0xe5)in _0x230344||_0x54c477(0xeb)in _0x230344)&&(delete _0x230344['appcode'],delete _0x230344[_0x54c477(0xeb)],_0x3fa681=!![]),{'config':_0x230344,'migrated':_0x3fa681};}function writeNormalizedConfigIfNeeded(_0x5e91da,_0xa79c5){const _0x52f64d=a33_0x2638b9,_0x5f5415=JSON[_0x52f64d(0x11a)](_0xa79c5,null,0x2)+'\x0a';if(normalizedWriteCache[_0x52f64d(0x11e)](_0x5e91da)===_0x5f5415)return;writeConfigFile(_0x5e91da,_0xa79c5),normalizedWriteCache[_0x52f64d(0x115)](_0x5e91da,_0x5f5415);}function parseAndNormalizeConfig(_0x2b2bfa,_0x336c9b,_0x47e1c1){const _0x22ee7c=a33_0x2638b9,_0x51284c=parseCliConfigJsonFile(_0x2b2bfa,_0x336c9b,_0x47e1c1),_0x5ef677=normalizeLegacyConfigShape(_0x51284c);if(_0x5ef677[_0x22ee7c(0x113)])try{writeNormalizedConfigIfNeeded(_0x2b2bfa,_0x5ef677[_0x22ee7c(0xd1)]);}catch{}return _0x5ef677[_0x22ee7c(0xd1)];}export function loadRawConfigLayers(_0x5d03f1){const _0x340a85=a33_0x2638b9;let _0x4208a6={},_0x20fea3={};const _0x5a0bce=resolveConfigPath(homedir());_0x5a0bce&&(_0x4208a6=parseAndNormalizeConfig(_0x5a0bce,_0x340a85(0x10d),_0x340a85(0xe0)));const _0x707c8c=_0x5d03f1??findProjectRootDirectory(),_0x443b12=resolveConfigPath(_0x707c8c);return _0x443b12&&(_0x20fea3=parseAndNormalizeConfig(_0x443b12,_0x340a85(0x10d),_0x340a85(0x119))),{'globalPath':_0x5a0bce,'projectPath':_0x443b12,'globalConfig':_0x4208a6,'projectConfig':_0x20fea3};}function mergeRawConfigLayers(_0x18e9f2){const _0x22fc79=a33_0x2638b9,{globalConfig:_0x2c0d57,projectConfig:_0x599be5}=_0x18e9f2;if(_0x599be5[_0x22fc79(0x114)]===![]){const _0x4e91d3={..._0x599be5};delete _0x4e91d3['inherit'];const _0x34433b=_0x599be5[_0x22fc79(0xda)]&&typeof _0x599be5[_0x22fc79(0xda)]===_0x22fc79(0xd9)?_0x599be5[_0x22fc79(0xda)]:{};Object[_0x22fc79(0x105)](_0x34433b)['length']>0x0?_0x4e91d3[_0x22fc79(0xda)]=_0x34433b:delete _0x4e91d3[_0x22fc79(0xda)];if(_0x22fc79(0xd7)in _0x599be5)_0x4e91d3[_0x22fc79(0xd7)]=_0x599be5['defaultApp'];else Object[_0x22fc79(0x105)](_0x34433b)[_0x22fc79(0xd3)]>0x0&&(_0x4e91d3[_0x22fc79(0xd7)]=Object['keys'](_0x34433b)[0x0]);return _0x4e91d3;}const _0x32bd35=_0x2c0d57[_0x22fc79(0xda)]&&typeof _0x2c0d57[_0x22fc79(0xda)]===_0x22fc79(0xd9)?_0x2c0d57[_0x22fc79(0xda)]:{},_0x23bce6=_0x599be5['apps']&&typeof _0x599be5['apps']==='object'?_0x599be5['apps']:{},_0x48fbe3={..._0x32bd35,..._0x23bce6},_0x14b279={..._0x2c0d57,..._0x599be5};Object[_0x22fc79(0x105)](_0x48fbe3)['length']>0x0&&(_0x14b279['apps']=_0x48fbe3);if(_0x22fc79(0xd7)in _0x599be5)_0x14b279['defaultApp']=_0x599be5[_0x22fc79(0xd7)];else{if(_0x23bce6&&Object[_0x22fc79(0x105)](_0x23bce6)[_0x22fc79(0xd3)]>0x0)_0x14b279[_0x22fc79(0xd7)]=Object['keys'](_0x23bce6)[0x0];else{if(_0x2c0d57['defaultApp'])_0x14b279[_0x22fc79(0xd7)]=_0x2c0d57[_0x22fc79(0xd7)];else{const _0xb3a69=Object[_0x22fc79(0x105)](_0x32bd35);_0xb3a69[_0x22fc79(0xd3)]>0x0&&(_0x14b279['defaultApp']=_0xb3a69[0x0]);}}}return _0x14b279;}export function readRawConfigWithLayers(_0x2b2c1f){const _0x6b99cc=loadRawConfigLayers(_0x2b2c1f);return{'config':mergeRawConfigLayers(_0x6b99cc),'layers':_0x6b99cc};}export function readRawConfig(_0x13ea1c){return mergeRawConfigLayers(loadRawConfigLayers(_0x13ea1c));}export function getConfigAppCode(_0x30a633){const _0x326b42=a33_0x2638b9,_0x144720=readRawConfig(_0x30a633);if(_0x144720[_0x326b42(0xda)]&&typeof _0x144720[_0x326b42(0xda)]===_0x326b42(0xd9)){const _0x2a8426=_0x144720['defaultApp'];if(_0x2a8426&&_0x144720[_0x326b42(0xda)][_0x2a8426]?.[_0x326b42(0xe5)])return String(_0x144720[_0x326b42(0xda)][_0x2a8426][_0x326b42(0xe5)])[_0x326b42(0x117)]();const _0x489343=Object['values'](_0x144720[_0x326b42(0xda)])[0x0];if(_0x489343?.[_0x326b42(0xe5)])return String(_0x489343[_0x326b42(0xe5)])['trim']();}const _0x5ef020=_0x144720[_0x326b42(0xe5)]||_0x144720[_0x326b42(0xeb)];if(typeof _0x5ef020!==_0x326b42(0xdb)||_0x5ef020[_0x326b42(0x117)]()==='')return undefined;return _0x5ef020[_0x326b42(0x117)]();}export function getMultiAppConfigs(_0x1f9627=a33_0x2638b9(0xef),_0x2717a6){const _0x3858e2=a33_0x2638b9,_0x228219=_0x1f9627===_0x3858e2(0x10a)?readRawConfig(_0x2717a6):loadRawConfigLayers(_0x2717a6)['projectConfig'],_0x4d590d=_0x228219[_0x3858e2(0xda)];if(!_0x4d590d||typeof _0x4d590d!==_0x3858e2(0xd9)||Object['keys'](_0x4d590d)[_0x3858e2(0xd3)]===0x0)return null;const _0x8466ee=_0x228219[_0x3858e2(0xd7)];return Object[_0x3858e2(0x107)](_0x4d590d)['map'](([_0x2af29f,_0xa785ad])=>({'name':_0x2af29f,'appcode':_0xa785ad?.[_0x3858e2(0xe5)]||'','isDefault':_0x2af29f===_0x8466ee,'env':_0xa785ad?.['env'],'apiDir':_0xa785ad?.[_0x3858e2(0xd5)],'cookie':_0xa785ad?.[_0x3858e2(0xea)]||undefined}))['filter'](_0x49eb80=>_0x49eb80[_0x3858e2(0xe5)]);}export function getTemplateBaseUrl(_0x510ce1){const _0x2584cb=a33_0x2638b9,_0x32f727=readRawConfig(_0x510ce1);if(_0x32f727[_0x2584cb(0xe2)]&&typeof _0x32f727[_0x2584cb(0xe2)]===_0x2584cb(0xdb))return _0x32f727['template_base_url'][_0x2584cb(0x11c)](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}export function readConfigFile(_0x13aee9){const _0x184273=a33_0x2638b9;return parseAndNormalizeConfig(_0x13aee9,_0x184273(0x111));}export function writeConfigFile(_0x461b0e,_0x93df04){const _0x5a5568=a33_0x2638b9,_0x1fa4b1=dirname(_0x461b0e);!existsSync(_0x1fa4b1)&&mkdirSync(_0x1fa4b1,{'recursive':!![]});const _0x4343d7=_0x461b0e+_0x5a5568(0x102);try{writeFileSync(_0x4343d7,JSON[_0x5a5568(0x11a)](_0x93df04,null,0x2)+'\x0a',{'encoding':_0x5a5568(0xe8),'mode':0x180}),renameSync(_0x4343d7,_0x461b0e);}catch(_0x122775){try{unlinkSync(_0x4343d7);}catch{}throw _0x122775;}}export function resolveWriteConfigPath(_0xad3d92){const _0x367554=a33_0x2638b9,_0x16533c=_0xad3d92===_0x367554(0xef)?process[_0x367554(0x11b)]():homedir(),_0x202cff=resolveConfigPath(_0x16533c);return _0x202cff??resolve(_0x16533c,NEW_CONFIG_NAME);}function buildConfig(_0x553ce7,_0x1ee2b2){const _0x40dd5d=a33_0x2638b9,_0x219572={};if(_0x553ce7[_0x40dd5d(0xda)]&&typeof _0x553ce7[_0x40dd5d(0xda)]===_0x40dd5d(0xd9))for(const [_0x152848,_0x3e48b8]of Object[_0x40dd5d(0x107)](_0x553ce7[_0x40dd5d(0xda)])){_0x3e48b8&&typeof _0x3e48b8===_0x40dd5d(0xd9)&&_0x3e48b8[_0x40dd5d(0xe5)]&&(_0x219572[_0x152848]=_0x3e48b8);}const _0x5d9023=_0x553ce7[_0x40dd5d(0xd7)]||undefined,_0x190c62=Object[_0x40dd5d(0x105)](_0x219572)[_0x40dd5d(0xd3)]>0x0,_0x3a5a7c=_0x1ee2b2[_0x40dd5d(0xeb)]||env('APP')||undefined,_0x45f6fe=_0x3a5a7c||_0x5d9023||undefined,_0x513f8a=_0x1ee2b2['appcode']||env(_0x40dd5d(0xe9))||undefined,_0xf80780=_0x513f8a?Object[_0x40dd5d(0x107)](_0x219572)[_0x40dd5d(0xde)](([,_0x2b04bc])=>_0x2b04bc?.[_0x40dd5d(0xe5)]===_0x513f8a):undefined,_0xc8f3e9=_0xf80780?.[0x0],_0x29d0e1=_0xf80780?.[0x1];let _0x104507=_0x513f8a?_0xc8f3e9:_0x45f6fe,_0x3ffc45=_0x104507&&_0x219572[_0x104507]?_0x219572[_0x104507]:undefined;_0x513f8a&&_0x29d0e1&&(_0x3ffc45=_0x29d0e1);const _0x368fd2=_0x513f8a?_0x29d0e1??_0x3ffc45:_0x3ffc45,_0x12d538=_0x3a5a7c||(_0x513f8a?_0xc8f3e9:undefined),_0x2afd0f=_0x513f8a||_0x368fd2?.[_0x40dd5d(0xe5)]||undefined,_0x46c26b=_0x1ee2b2[_0x40dd5d(0xd2)]||env(_0x40dd5d(0xf5))||_0x368fd2?.['env']||_0x553ce7['env']||DEFAULT_CONFIG_VALUES['env'],_0x2d604f=_0x368fd2?.[_0x40dd5d(0x11f)]||_0x553ce7[_0x40dd5d(0x11f)]||DEFAULT_CONFIG_VALUES[_0x40dd5d(0x11f)],_0x426363=env(_0x40dd5d(0xe1))||_0x368fd2?.[_0x40dd5d(0xea)]||_0x553ce7[_0x40dd5d(0xea)]||undefined,_0x12bb9d=env('ACCESS_KEY')||_0x368fd2?.[_0x40dd5d(0xe7)]||_0x553ce7[_0x40dd5d(0xe7)]||undefined,_0x3a56c4=_0x1ee2b2[_0x40dd5d(0xff)]||env(_0x40dd5d(0xfd))||_0x368fd2?.[_0x40dd5d(0xff)]||_0x553ce7['format'],_0x42f2a2=normalizeLegacyOutputFormat(_0x3a56c4),_0x5ce715=env('PAGE_SIZE')||_0x368fd2?.[_0x40dd5d(0x104)]||_0x553ce7[_0x40dd5d(0x104)],_0x3b5772=_0x5ce715?Number(_0x5ce715)||undefined:undefined,_0x4267d4=env(_0x40dd5d(0xec))||env(_0x40dd5d(0x116))||_0x368fd2?.[_0x40dd5d(0x108)]||_0x553ce7['riskLevel']||_0x553ce7[_0x40dd5d(0x112)],_0x4590bc=_0x4267d4===_0x40dd5d(0xfe)||_0x4267d4===_0x40dd5d(0x100)?_0x4267d4:DEFAULT_CONFIG_VALUES[_0x40dd5d(0x108)],_0x3c3111=env(_0x40dd5d(0x10f)),_0x48c0ee=_0x3c3111==='1'||_0x3c3111===_0x40dd5d(0x11d),_0x88c997=_0x368fd2?.[_0x40dd5d(0xd5)]||_0x553ce7['apiDir']||DEFAULT_CONFIG_VALUES['apiDir'],_0x43e962=isDaily(normalizeEnv(String(_0x46c26b)))?_0x40dd5d(0xdd):_0x40dd5d(0xf0);return{'appCode':typeof _0x2afd0f===_0x40dd5d(0xdb)&&_0x2afd0f[_0x40dd5d(0x117)]()?_0x2afd0f[_0x40dd5d(0x117)]():undefined,'env':_0x43e962,'locale':_0x2d604f,'cookie':_0x426363,'accessKey':_0x12bb9d,'format':_0x42f2a2,'pageSize':_0x3b5772,'riskLevel':_0x4590bc,'verbose':_0x48c0ee,'apiDir':_0x88c997,'apps':_0x219572,'defaultApp':_0x5d9023,'currentApp':_0x190c62?_0x104507:undefined,'explicitAppName':_0x12d538,'raw':_0x553ce7};}function a33_0x1551(){const _0x2f7e9b=['5753448QmHvzG','.lovrabet.json','warn','filter','VERBOSE','./auth/get-cookie.js','silent','maxRisk','migrated','inherit','set','MAX_RISK','trim','6ozBRpo','Project','stringify','cwd','replace','true','get','locale','message','7TGOYZC','config','env','length','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','apiDir','userDomain','defaultApp','missing','object','apps','string','.lovrabetrc','daily','find','.rabetbase.json','Global','COOKIE','template_base_url','api.ts','parse','appcode','10Bfdrag','accessKey','utf8','APPCODE','cookie','app','RISK_LEVEL','189061bqfBGG','runtimeDomain','project','production','join','authRequired','empty','2650775lMSVuU','ENV','499227Vlpaex','error','1485144pzwwqV','3301991LNDhkU','./utils/is-non-interactive.js','setLogPath','12KXCeTL','FORMAT','read','format','write','./constant/env.js','.tmp','status','pageSize','keys','6133110FyUUdX','entries','riskLevel','-api.ts','merged'];a33_0x1551=function(){return _0x2f7e9b;};return a33_0x1551();}async function buildAuth(_0x4b5987){const _0x5a971f=a33_0x2638b9,{getCookie:_0x3b1711}=await import(_0x5a971f(0x110)),_0x3a780d=_0x4b5987[_0x5a971f(0xea)]||_0x3b1711(),_0x4033f8=_0x3a780d?await getIsSessionValid():![];return{'cookie':_0x3a780d,'isLoggedIn':_0x4033f8,async 'getOrLogin'(){const _0x451ba3=_0x5a971f;if(_0x3a780d&&_0x4033f8)return _0x3a780d;throw CliErrors[_0x451ba3(0xf2)]();}};}function a33_0x6b50(_0x21ffdc,_0x56697c){_0x21ffdc=_0x21ffdc-0xd1;const _0x15517a=a33_0x1551();let _0x6b5031=_0x15517a[_0x21ffdc];return _0x6b5031;}export function resolveApiFilePath(_0x325ace,_0x52706f){const _0x231856=a33_0x2638b9,_0x4f99ce=resolve(process[_0x231856(0x11b)](),_0x325ace),_0x49144e=resolve(_0x4f99ce,_0x231856(0xe3));if(!_0x52706f)return _0x49144e;const _0x197788=readRawConfig(),_0x3eae27=_0x197788[_0x231856(0xda)]&&typeof _0x197788[_0x231856(0xda)]==='object'?_0x197788[_0x231856(0xda)]:{},_0xd3b7a3=Object[_0x231856(0x107)](_0x3eae27)['find'](([,_0x38e6c6])=>_0x38e6c6?.['appcode']===_0x52706f);if(!_0xd3b7a3)return _0x49144e;const [_0x48744e,_0x1af975]=_0xd3b7a3,_0x3f6c53=typeof _0x197788['defaultApp']===_0x231856(0xdb)?_0x197788[_0x231856(0xd7)]:undefined;if(_0x1af975?.[_0x231856(0xd5)])return _0x49144e;if(_0x3f6c53&&_0x48744e!==_0x3f6c53)return resolve(_0x4f99ce,_0x48744e+_0x231856(0x109));return _0x49144e;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48aeaa,_0x27b812){const _0x509184=a157_0x511f,_0x38c15d=_0x48aeaa();while(!![]){try{const _0x18e7fe=-parseInt(_0x509184(0x10e))/0x1*(parseInt(_0x509184(0x109))/0x2)+-parseInt(_0x509184(0x112))/0x3+parseInt(_0x509184(0x119))/0x4+-parseInt(_0x509184(0x10d))/0x5*(-parseInt(_0x509184(0x117))/0x6)+-parseInt(_0x509184(0x111))/0x7+-parseInt(_0x509184(0x113))/0x8+-parseInt(_0x509184(0x118))/0x9*(-parseInt(_0x509184(0x10a))/0xa);if(_0x18e7fe===_0x27b812)break;else _0x38c15d['push'](_0x38c15d['shift']());}catch(_0x450da4){_0x38c15d['push'](_0x38c15d['shift']());}}}(a157_0x28d3,0x2d4e5));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a157_0x511f(_0x7ad92d,_0x25acc4){_0x7ad92d=_0x7ad92d-0x108;const _0x28d39e=a157_0x28d3();let _0x511fa0=_0x28d39e[_0x7ad92d];return _0x511fa0;}const cache=new Map();function parseApiFile(_0xf2ee20){const _0x2473bb=a157_0x511f,_0x325b13=[],_0x4d5e40=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x303660;while((_0x303660=_0x4d5e40['exec'](_0xf2ee20))!==null){_0x325b13[_0x2473bb(0x116)]({'datasetCode':_0x303660[0x1],'tableName':_0x303660[0x2],'name':_0x303660[0x3],'alias':_0x303660[0x4]});}return _0x325b13;}export function loadAliasMap(_0x77aa7,_0x33d38c,_0x215ec1){const _0x28ac60=a157_0x511f,_0x22ed92=_0x215ec1??resolve(process[_0x28ac60(0x10f)](),_0x77aa7,_0x28ac60(0x10c));if(cache['has'](_0x22ed92))return cache[_0x28ac60(0x108)](_0x22ed92);if(!existsSync(_0x22ed92))return cache['set'](_0x22ed92,[]),[];try{const _0x4806d0=readFileSync(_0x22ed92,_0x28ac60(0x10b)),_0x5505a5=parseApiFile(_0x4806d0);return cache[_0x28ac60(0x114)](_0x22ed92,_0x5505a5),_0x5505a5;}catch{return cache['set'](_0x22ed92,[]),[];}}function a157_0x28d3(){const _0x4c738d=['find','1069481nxcYhU','1031529bKXKxH','345136pizDMt','set','alias','push','54nSEmwZ','9gRSfsh','864972TvytUw','get','10xQLXoa','8075090GfsBrG','utf-8','api.ts','37405AwIxIz','73148VZtjTY','cwd'];a157_0x28d3=function(){return _0x4c738d;};return a157_0x28d3();}export function resolveAlias(_0x59126d,_0x23baec,_0x334204,_0x255e34){const _0x2d5469=a157_0x511f;if(!_0x23baec)return undefined;const _0x1dc659=loadAliasMap(_0x59126d,_0x334204,_0x255e34),_0x5c5aea=_0x1dc659[_0x2d5469(0x110)](_0x43f0eb=>_0x43f0eb[_0x2d5469(0x115)]===_0x23baec);return _0x5c5aea?.['datasetCode'];}export function listAliases(_0x583930,_0x5d128d,_0x9b3e99){return loadAliasMap(_0x583930,_0x5d128d,_0x9b3e99);}
|