@lovrabet/rabetbase-cli 2.1.2-beta.1 → 2.1.2-beta.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 -0
- 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 +2 -2
package/lib/commands/sql/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a99_0x4f6b(_0x38e43d,_0x29b3f3){_0x38e43d=_0x38e43d-0xff;const _0x5f5524=a99_0x5f55();let _0x4f6bc9=_0x5f5524[_0x38e43d];return _0x4f6bc9;}const a99_0xc480ac=a99_0x4f6b;(function(_0x63d71b,_0x138592){const _0x45480d=a99_0x4f6b,_0x230c5a=_0x63d71b();while(!![]){try{const _0x3816c7=-parseInt(_0x45480d(0x117))/0x1*(parseInt(_0x45480d(0x11c))/0x2)+-parseInt(_0x45480d(0x10e))/0x3*(-parseInt(_0x45480d(0x11b))/0x4)+parseInt(_0x45480d(0x12b))/0x5+parseInt(_0x45480d(0x107))/0x6*(-parseInt(_0x45480d(0x11d))/0x7)+-parseInt(_0x45480d(0x109))/0x8*(-parseInt(_0x45480d(0x116))/0x9)+parseInt(_0x45480d(0x134))/0xa+-parseInt(_0x45480d(0x122))/0xb;if(_0x3816c7===_0x138592)break;else _0x230c5a['push'](_0x230c5a['shift']());}catch(_0x3840a1){_0x230c5a['push'](_0x230c5a['shift']());}}}(a99_0x5f55,0x9a2b0));import{createInterface}from'node:readline';import{readFile,writeFile}from'node:fs/promises';function a99_0x5f55(){const _0x439cbc=['stdin','unchanged','6705ZkEgIQ','25MyfeAm','\x20error(s)).','boolean','close','4rIutmc','12488VYEDJg','497rmqFzC','push','stderr','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','Pull\x20failed:\x20could\x20not\x20load\x20SQL\x20content\x20(','12009184NgKYim','paging','sql','write','message','string','Pull\x20remote\x20custom\x20SQL\x20queries\x20into\x20.rabetbase/sql/','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.\x20Continue?\x20[y/N]\x20','Pull\x20complete:\x20','3451895xHKLuS','\x20written,\x20','local\x20differs\x20from\x20remote','length','Filter\x20by\x20SQL\x20display\x20name\x20(API\x20filter)','bool','str','\x20SQL\x20file(s)\x20under\x20','includes','1288630MOZrEY','force','pull','sqlContent','conflict','trim','Overwrite\x20local\x20files\x20that\x20differ\x20from\x20remote','sqlName','cancelled','sqlcode','sqlCode','57960aIoayG','would_pull','7696KksYIM','\x20skipped,\x20','utf8','\x20failed','name','3087732dflgTp','tableData','Would\x20pull\x20','appCode','nonInteractive','No\x20remote\x20SQL\x20queries\x20matched.'];a99_0x5f55=function(){return _0x439cbc;};return a99_0x5f55();}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';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(_0x4a0ede,_0x63703e){const _0x4b463b=a99_0x4f6b,_0x4ec94a=[];let _0x5683ba=0x1;while(!![]){const _0x16151d=await listSqlQueries(_0x4a0ede,{'currentPage':_0x5683ba,'pageSize':PAGE_SIZE,'sqlCode':_0x63703e[_0x4b463b(0x106)],'sqlName':_0x63703e[_0x4b463b(0x103)]}),_0x1fc1b0=_0x16151d[_0x4b463b(0x10f)]??[];_0x4ec94a[_0x4b463b(0x11e)](..._0x1fc1b0);if(_0x1fc1b0[_0x4b463b(0x12e)]===0x0)break;const _0x12342e=_0x16151d[_0x4b463b(0x123)]?.['totalCount'];if(_0x12342e!=null?_0x4ec94a['length']>=_0x12342e:_0x1fc1b0[_0x4b463b(0x12e)]<PAGE_SIZE)break;_0x5683ba++;}return _0x4ec94a;}async function ensureSqlContent(_0x12c4e1,_0x3ac31e){const _0xfd5561=a99_0x4f6b;if(_0x3ac31e[_0xfd5561(0xff)]!=null&&String(_0x3ac31e[_0xfd5561(0xff)])[_0xfd5561(0x12e)]>0x0)return _0x3ac31e;return getSqlQueryInfo(_0x12c4e1,_0x3ac31e[_0xfd5561(0x106)]);}export const sqlPull={'service':a99_0xc480ac(0x124),'command':a99_0xc480ac(0x136),'description':a99_0xc480ac(0x128),'risk':a99_0xc480ac(0x125),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a99_0xc480ac(0x10d),'type':a99_0xc480ac(0x127),'description':a99_0xc480ac(0x12f)},{'name':a99_0xc480ac(0x135),'type':a99_0xc480ac(0x119),'description':a99_0xc480ac(0x102)}],async 'dryRun'(_0x4d804f){const _0xf8a698=a99_0xc480ac,_0x1230e3=findProjectRootDirectory(),_0x3444a8=resolveSqlLocalDir(_0x1230e3),_0x59a6ee=_0x4d804f[_0xf8a698(0x131)](_0xf8a698(0x105))||undefined,_0x3b3a19=_0x4d804f[_0xf8a698(0x131)](_0xf8a698(0x10d))||undefined,_0x25d597=await fetchAllSqlQueries(_0x4d804f[_0xf8a698(0x111)],{'sqlCode':_0x59a6ee,'sqlName':_0x3b3a19}),_0x3aa9fe=[],_0x35b95b=[];for(const _0x3797c4 of _0x25d597){try{_0x3aa9fe['push'](await ensureSqlContent(_0x4d804f[_0xf8a698(0x111)],_0x3797c4));}catch(_0x2c97b8){_0x35b95b[_0xf8a698(0x11e)]({'sqlCode':_0x3797c4[_0xf8a698(0x106)],'error':_0x2c97b8 instanceof Error?_0x2c97b8[_0xf8a698(0x126)]:String(_0x2c97b8)});}}const _0x437992=assignSqlFileNames(_0x3aa9fe),_0x329b34=[];for(const [_0x30ae9c,_0x285b3f]of _0x437992){const _0x5178d1=join(_0x3444a8,_0x30ae9c),_0x28dda7=buildPulledSqlFileContent(_0x285b3f);let _0x280268=_0xf8a698(0x108),_0x36a8db;if(await fileExists(_0x5178d1)){const _0xc9afb1=await readFile(_0x5178d1,'utf8');_0xc9afb1===_0x28dda7?(_0x280268='skipped',_0x36a8db='unchanged'):(_0x280268=_0xf8a698(0x100),_0x36a8db=_0xf8a698(0x120));}_0x329b34[_0xf8a698(0x11e)]({'sqlCode':_0x285b3f[_0xf8a698(0x106)],'sqlName':_0x285b3f[_0xf8a698(0x103)],'filePath':_0x5178d1,'status':_0x280268,'reason':_0x36a8db});}return{'method':'POST','url':'/smartapi/custom/queryUserCustomSqlList','body':{'appCode':_0x4d804f['appCode'],'sqlCode':_0x59a6ee??null,'sqlName':_0x3b3a19??null,'loadErrors':_0x35b95b,'files':_0x329b34},'description':_0xf8a698(0x110)+_0x329b34[_0xf8a698(0x12e)]+_0xf8a698(0x132)+_0x3444a8};},async 'execute'(_0x2de8b3){const _0x245129=a99_0xc480ac,_0x4e6c15=findProjectRootDirectory(),_0x330019=resolveSqlLocalDir(_0x4e6c15),_0x1d83c3=_0x2de8b3[_0x245129(0x131)](_0x245129(0x105))||undefined,_0x1be696=_0x2de8b3[_0x245129(0x131)](_0x245129(0x10d))||undefined,_0x33c199=_0x2de8b3[_0x245129(0x130)](_0x245129(0x135)),_0x31f64b=await fetchAllSqlQueries(_0x2de8b3[_0x245129(0x111)],{'sqlCode':_0x1d83c3,'sqlName':_0x1be696});if(_0x31f64b[_0x245129(0x12e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x245129(0x113)};const _0x18a122=[],_0x122ba7=[];for(const _0x3871dc of _0x31f64b){try{_0x18a122[_0x245129(0x11e)](await ensureSqlContent(_0x2de8b3['appCode'],_0x3871dc));}catch(_0x2e894e){_0x122ba7[_0x245129(0x11e)]({'sqlCode':_0x3871dc[_0x245129(0x106)],'error':_0x2e894e instanceof Error?_0x2e894e[_0x245129(0x126)]:String(_0x2e894e)});}}if(_0x18a122[_0x245129(0x12e)]===0x0)return{'ok':![],'data':{'pulled':[],'skipped':[],'failed':_0x122ba7},'message':_0x245129(0x121)+_0x122ba7[_0x245129(0x12e)]+_0x245129(0x118)};const _0x5c5b87=assignSqlFileNames(_0x18a122);if(_0x33c199&&!_0x2de8b3[_0x245129(0x112)]){let _0x3aa473=![];for(const [_0x5f2d20,_0x3459aa]of _0x5c5b87){const _0x467029=join(_0x330019,_0x5f2d20),_0x40cf2c=buildPulledSqlFileContent(_0x3459aa);if(await fileExists(_0x467029)){const _0x3b882d=await readFile(_0x467029,_0x245129(0x10b));if(_0x3b882d!==_0x40cf2c){_0x3aa473=!![];break;}}}if(_0x3aa473){const _0xa0f311=await confirmForce();if(!_0xa0f311)throw CliErrors[_0x245129(0x104)]('Force\x20pull\x20cancelled.');}}const _0x4dcd83=[],_0x1b038c=[];for(const [_0x27670e,_0x31b385]of _0x5c5b87){const _0x7a03d0=join(_0x330019,_0x27670e),_0x4d632f=buildPulledSqlFileContent(_0x31b385);try{if(await fileExists(_0x7a03d0)){const _0x525489=await readFile(_0x7a03d0,_0x245129(0x10b));if(_0x525489===_0x4d632f){_0x1b038c[_0x245129(0x11e)]({'sqlCode':_0x31b385['sqlCode'],'reason':_0x245129(0x115)});continue;}if(!_0x33c199){_0x1b038c[_0x245129(0x11e)]({'sqlCode':_0x31b385['sqlCode'],'reason':_0x245129(0x12d)});continue;}}await ensureParentDirectory(_0x7a03d0),await writeFile(_0x7a03d0,_0x4d632f,_0x245129(0x10b)),_0x4dcd83[_0x245129(0x11e)]({'sqlCode':_0x31b385[_0x245129(0x106)],'filePath':_0x7a03d0});}catch(_0x30c2a6){_0x122ba7[_0x245129(0x11e)]({'sqlCode':_0x31b385[_0x245129(0x106)],'error':_0x30c2a6 instanceof Error?_0x30c2a6[_0x245129(0x126)]:String(_0x30c2a6)});}}const _0x2bd35b=_0x122ba7['length']===0x0;return{'ok':_0x2bd35b,'data':{'pulled':_0x4dcd83,'skipped':_0x1b038c,'failed':_0x122ba7},'message':_0x245129(0x12a)+_0x4dcd83[_0x245129(0x12e)]+_0x245129(0x12c)+_0x1b038c['length']+_0x245129(0x10a)+_0x122ba7[_0x245129(0x12e)]+_0x245129(0x10c)};}};async function confirmForce(){const _0x42a575=a99_0xc480ac,_0x10a5ad=createInterface({'input':process[_0x42a575(0x114)],'output':process[_0x42a575(0x11f)]}),_0x307375=await new Promise(_0x10c3cd=>{const _0x39c1d8=_0x42a575;_0x10a5ad['question'](_0x39c1d8(0x129),_0x10c3cd);});return _0x10a5ad[_0x42a575(0x11a)](),['y','yes'][_0x42a575(0x133)](_0x307375[_0x42a575(0x101)]()['toLowerCase']());}
|
package/lib/commands/sql/save.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a100_0x229472=a100_0x4243;function a100_0x1e6d(){const _0x2a1c41=['sqlname','file','appCode','10216520amsFtR','action','sqlCode','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','dbId','write','none','Validation:\x20','description','5pJQZVD','join','cwd','SQL\x20validation\x20failed:\x20','length','parameters','sql','\x20chars)','7577830VQGzFy','Updated','864EofMrv','SQL\x20query\x20display\x20name','45148gzilvt','12cwchpR','string','created','dbName','9ewKodV','\x20|\x20Params:\x20','1194549RblJEr','message','2652894GBxUKh','utf-8','validation','type','20ROTDMc','9700416IWQiGm','\x20successfully','SQL\x20query\x20description','tables','sqlcode','POST','str','\x20|\x20Tables:\x20','/api/node-toolbox/sql/save','File\x20not\x20found:\x20','21mXiSpW'];a100_0x1e6d=function(){return _0x2a1c41;};return a100_0x1e6d();}(function(_0x342eb6,_0x385d28){const _0x3714c8=a100_0x4243,_0x166811=_0x342eb6();while(!![]){try{const _0x2525ec=-parseInt(_0x3714c8(0x199))/0x1*(-parseInt(_0x3714c8(0x1a5))/0x2)+-parseInt(_0x3714c8(0x1ac))/0x3+-parseInt(_0x3714c8(0x1a3))/0x4*(parseInt(_0x3714c8(0x1b2))/0x5)+parseInt(_0x3714c8(0x1ae))/0x6*(parseInt(_0x3714c8(0x18c))/0x7)+parseInt(_0x3714c8(0x190))/0x8+-parseInt(_0x3714c8(0x1aa))/0x9*(parseInt(_0x3714c8(0x1a1))/0xa)+parseInt(_0x3714c8(0x1b3))/0xb*(-parseInt(_0x3714c8(0x1a6))/0xc);if(_0x2525ec===_0x385d28)break;else _0x166811['push'](_0x166811['shift']());}catch(_0x424868){_0x166811['push'](_0x166811['shift']());}}}(a100_0x1e6d,0xa5740));function a100_0x4243(_0x2285b2,_0x1ccb3a){_0x2285b2=_0x2285b2-0x185;const _0x1e6da4=a100_0x1e6d();let _0x4243a8=_0x1e6da4[_0x2285b2];return _0x4243a8;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlSave={'service':a100_0x229472(0x19f),'command':'save','description':'Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','risk':a100_0x229472(0x195),'flags':[{'name':'file','type':a100_0x229472(0x1a7),'required':!![],'description':'Path\x20to\x20the\x20SQL\x20file'},SQLCODE_FLAG_OPTIONAL,{'name':a100_0x229472(0x18d),'type':'string','description':a100_0x229472(0x1a4)},{'name':'db','type':'string','description':a100_0x229472(0x193)},{'name':a100_0x229472(0x198),'type':'string','description':a100_0x229472(0x1b5)}],async 'validate'(_0x3d0977){const _0x4b4bbc=a100_0x229472,_0x3882fb=resolve(process['cwd'](),_0x3d0977['str'](_0x4b4bbc(0x18e)));if(!existsSync(_0x3882fb))throw CliErrors[_0x4b4bbc(0x1b0)](_0x4b4bbc(0x18b)+_0x3882fb);const _0x523f8f=readFileSync(_0x3882fb,_0x4b4bbc(0x1af)),_0x25fb9f=validateSql(_0x523f8f);if(!_0x25fb9f['valid'])throw CliErrors[_0x4b4bbc(0x1b0)](_0x4b4bbc(0x19c)+_0x25fb9f[_0x4b4bbc(0x1ad)]);},async 'dryRun'(_0x1b0dbf){const _0x527475=a100_0x229472,_0x3c16e7=resolve(process['cwd'](),_0x1b0dbf[_0x527475(0x188)](_0x527475(0x18e))),_0x3477cf=readFileSync(_0x3c16e7,_0x527475(0x1af)),_0x429b86=validateSql(_0x3477cf),_0x1e50d3=_0x1b0dbf[_0x527475(0x188)]('db')||undefined,{db:_0x42abe8,error:_0x3b0a7d}=await resolveOneDb(_0x1b0dbf[_0x527475(0x18f)],_0x1e50d3);return{'method':_0x527475(0x187),'url':_0x527475(0x18a),'body':{'appCode':_0x1b0dbf[_0x527475(0x18f)],'sqlContent':'('+_0x3477cf[_0x527475(0x19d)]+_0x527475(0x1a0),'sqlCode':_0x1b0dbf['str'](_0x527475(0x186))||undefined,'sqlName':_0x1b0dbf[_0x527475(0x188)](_0x527475(0x18d))||undefined,'db':_0x42abe8?_0x42abe8[_0x527475(0x1a9)]+'\x20('+_0x42abe8[_0x527475(0x194)]+')':_0x3b0a7d},'description':['Save\x20SQL\x20query\x20from\x20'+_0x1b0dbf[_0x527475(0x188)](_0x527475(0x18e)),_0x527475(0x197)+_0x429b86[_0x527475(0x1ad)],'Type:\x20'+_0x429b86['sqlType'][_0x527475(0x1b1)]+_0x527475(0x189)+(_0x429b86[_0x527475(0x185)][_0x527475(0x19a)](',\x20')||'N/A')+_0x527475(0x1ab)+(_0x429b86[_0x527475(0x19e)][_0x527475(0x19a)](',\x20')||_0x527475(0x196))]['join']('\x0a')};},async 'execute'(_0x5b5c58){const _0x46c177=a100_0x229472,_0x110131=resolve(process[_0x46c177(0x19b)](),_0x5b5c58[_0x46c177(0x188)](_0x46c177(0x18e))),_0x45716b=readFileSync(_0x110131,_0x46c177(0x1af)),_0xd60e01=_0x5b5c58[_0x46c177(0x188)]('db')||undefined,{db:_0x58ae20,error:_0x24d259}=await resolveOneDb(_0x5b5c58[_0x46c177(0x18f)],_0xd60e01);if(_0x24d259)throw CliErrors[_0x46c177(0x1b0)](_0x24d259);const _0x5050f6=await saveSqlQuery({'appCode':_0x5b5c58[_0x46c177(0x18f)],'sqlContent':_0x45716b,'sqlCode':_0x5b5c58[_0x46c177(0x188)](_0x46c177(0x186))||undefined,'sqlName':_0x5b5c58[_0x46c177(0x188)](_0x46c177(0x18d))||undefined,'dbId':_0x58ae20[_0x46c177(0x194)],'description':_0x5b5c58['str'](_0x46c177(0x198))||undefined});if(_0x5050f6['blocked'])return{'ok':![],'data':_0x5050f6,'message':_0x5050f6[_0x46c177(0x1ad)]||'Conflict\x20detected'};return{'ok':!![],'data':{'sqlCode':_0x5050f6['sqlCode'],'sqlName':_0x5050f6['sqlName'],'action':_0x5050f6['action']},'message':(_0x5050f6[_0x46c177(0x191)]===_0x46c177(0x1a8)?'Created':_0x46c177(0x1a2))+_0x46c177(0x1b4)+(_0x5050f6['sqlCode']?'\x20('+_0x5050f6[_0x46c177(0x192)]+')':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a101_0x36e0(){const _0x4e6ac1=['trim','unknown','17408567gGwpFh','518550vtYLha','136BjSKtz','replace','.rabetbase/sql','sqlContent','14phwydj','trimEnd','set','6429240tfefIY','has','unnamed','4xBKnYl','sqlCode','--\x20@lovrabet.description:','356868yuosvn','description','sqlName','65809HDAAFR','.sql','2504349ZxYszw','6yEBkSa','4698106SwlWIm'];a101_0x36e0=function(){return _0x4e6ac1;};return a101_0x36e0();}const a101_0x6b2e7f=a101_0x5739;(function(_0x527199,_0x1ebd4d){const _0x2e9a08=a101_0x5739,_0x187ad8=_0x527199();while(!![]){try{const _0x594859=parseInt(_0x2e9a08(0x146))/0x1*(parseInt(_0x2e9a08(0x13a))/0x2)+-parseInt(_0x2e9a08(0x148))/0x3*(-parseInt(_0x2e9a08(0x140))/0x4)+parseInt(_0x2e9a08(0x135))/0x5*(parseInt(_0x2e9a08(0x149))/0x6)+parseInt(_0x2e9a08(0x14a))/0x7+-parseInt(_0x2e9a08(0x136))/0x8*(parseInt(_0x2e9a08(0x143))/0x9)+parseInt(_0x2e9a08(0x13d))/0xa+-parseInt(_0x2e9a08(0x134))/0xb;if(_0x594859===_0x1ebd4d)break;else _0x187ad8['push'](_0x187ad8['shift']());}catch(_0xcd5ee1){_0x187ad8['push'](_0x187ad8['shift']());}}}(a101_0x36e0,0x6f76d));function a101_0x5739(_0x33f1f9,_0x1b0465){_0x33f1f9=_0x33f1f9-0x133;const _0x36e0f0=a101_0x36e0();let _0x57393b=_0x36e0f0[_0x33f1f9];return _0x57393b;}import{join}from'node:path';export const SQL_LOCAL_REL_DIR=a101_0x6b2e7f(0x138);export function resolveSqlLocalDir(_0x280b6c){return join(_0x280b6c,SQL_LOCAL_REL_DIR);}export function safeSqlFileBaseName(_0x33f353){const _0x2ef1bd=a101_0x6b2e7f,_0x978b29=_0x33f353[_0x2ef1bd(0x14b)]()||_0x2ef1bd(0x13f),_0x1dfbe0=_0x978b29[_0x2ef1bd(0x137)](/[/\\?%*:|"<>]/g,'_')[_0x2ef1bd(0x137)](/\s+/g,'_')[_0x2ef1bd(0x137)](/_+/g,'_');return _0x1dfbe0||'unnamed';}export function assignSqlFileNames(_0x3d9a92){const _0x5f363b=a101_0x6b2e7f,_0x5e3bdc=new Map();for(const _0x4ebce6 of _0x3d9a92){const _0x552722=safeSqlFileBaseName(_0x4ebce6[_0x5f363b(0x145)]??'unnamed');let _0x3b4e09=_0x552722+'.sql';if(_0x5e3bdc[_0x5f363b(0x13e)](_0x3b4e09)){const _0x5ed3a5=(_0x4ebce6[_0x5f363b(0x141)]??_0x5f363b(0x133))[_0x5f363b(0x137)](/-/g,'');_0x3b4e09=_0x552722+'__'+_0x5ed3a5+_0x5f363b(0x147);}let _0x1983c0=0x0,_0x48128e=_0x3b4e09;while(_0x5e3bdc[_0x5f363b(0x13e)](_0x48128e)){_0x1983c0++,_0x48128e=_0x552722+'__'+_0x1983c0+_0x5f363b(0x147);}_0x5e3bdc[_0x5f363b(0x13c)](_0x48128e,_0x4ebce6);}return _0x5e3bdc;}export function buildPulledSqlFileContent(_0x412205){const _0x342679=a101_0x6b2e7f,_0x2a9338=_0x412205[_0x342679(0x145)]??_0x342679(0x13f),_0xab9b47=_0x412205[_0x342679(0x141)]??'',_0x117d93=(_0x412205[_0x342679(0x144)]??'')['replace'](/\r?\n/g,'\x20')['trim'](),_0x17042b=_0x412205[_0x342679(0x139)]??'',_0x5c54fa=['--\x20@lovrabet.sqlName:\x20'+_0x2a9338,'--\x20@lovrabet.sqlCode:\x20'+_0xab9b47,_0x342679(0x142)+(_0x117d93?'\x20'+_0x117d93:''),'',_0x17042b[_0x342679(0x13b)]()],_0x113ea8=_0x5c54fa['join']('\x0a');return _0x113ea8['endsWith']('\x0a')?_0x113ea8:_0x113ea8+'\x0a';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a102_0x3183(_0x4b0629,_0x4c8f85){_0x4b0629=_0x4b0629-0x72;const _0x32b649=a102_0x32b6();let _0x3183a1=_0x32b649[_0x4b0629];return _0x3183a1;}const a102_0x1f8041=a102_0x3183;(function(_0x2b9e94,_0x176e4d){const _0x542d9e=a102_0x3183,_0x329302=_0x2b9e94();while(!![]){try{const _0xfdef96=-parseInt(_0x542d9e(0x73))/0x1+parseInt(_0x542d9e(0x8f))/0x2*(-parseInt(_0x542d9e(0x7c))/0x3)+-parseInt(_0x542d9e(0x96))/0x4*(-parseInt(_0x542d9e(0x72))/0x5)+-parseInt(_0x542d9e(0x84))/0x6*(-parseInt(_0x542d9e(0x9c))/0x7)+parseInt(_0x542d9e(0x74))/0x8*(parseInt(_0x542d9e(0x9d))/0x9)+-parseInt(_0x542d9e(0x7a))/0xa*(parseInt(_0x542d9e(0xa0))/0xb)+parseInt(_0x542d9e(0x82))/0xc;if(_0xfdef96===_0x176e4d)break;else _0x329302['push'](_0x329302['shift']());}catch(_0x199447){_0x329302['push'](_0x329302['shift']());}}}(a102_0x32b6,0x37976));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';function a102_0x32b6(){const _0x40d2bd=['schema:','appCode','get','25JDAKmT','339454LWQnyc','80jhKxpZ','sqlType','isArray','validation','isSelectOnly','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','1493260gzHjjK','push','39ebvLXP','valid','reason','dbtableConfig','schemaWarnings','flagMissing','7368384wpJwCA','file','637794WJzWKX','length','cwd','tableName','string','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','\x22\x20not\x20found\x20or\x20not\x20accessible','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','\x22\x20not\x20found\x20in\x20any\x20dataset','tables','File\x20not\x20found:\x20','36896SzDiuQ','isDangerous','str','Provide\x20--file\x20or\x20--sql','name','schemas','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','185956zdHwoB','from','filter','message','validate','map','7NMbFex','3177ehShov','fields','toLowerCase','11RGzlAu','sql'];a102_0x32b6=function(){return _0x40d2bd;};return a102_0x32b6();}import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a102_0x1f8041(0xa1),'command':a102_0x1f8041(0x9a),'description':a102_0x1f8041(0x8b),'risk':'read','flags':[{'name':a102_0x1f8041(0x83),'type':a102_0x1f8041(0x88),'description':a102_0x1f8041(0x79)},{'name':a102_0x1f8041(0xa1),'type':a102_0x1f8041(0x88),'description':a102_0x1f8041(0x95)},{'name':a102_0x1f8041(0x94),'type':a102_0x1f8041(0x88),'description':a102_0x1f8041(0x89)}],async 'execute'(_0x1e02a3){const _0x111196=a102_0x1f8041,_0x71d8cd=_0x1e02a3[_0x111196(0x91)](_0x111196(0x83)),_0x411f7f=_0x1e02a3[_0x111196(0x91)](_0x111196(0xa1));if(!_0x71d8cd&&!_0x411f7f)throw CliErrors[_0x111196(0x81)](_0x111196(0x83),_0x111196(0x92));let _0x1955e5;if(_0x71d8cd){const _0x19fc98=resolve(process[_0x111196(0x86)](),_0x71d8cd);if(!existsSync(_0x19fc98))throw CliErrors[_0x111196(0x77)](_0x111196(0x8e)+_0x19fc98);_0x1955e5=readFileSync(_0x19fc98,'utf-8');}else _0x1955e5=_0x411f7f;const _0x2d9205=validateSql(_0x1955e5),_0x230eeb={'valid':_0x2d9205['valid'],'sqlType':_0x2d9205['sqlType']['type'],'isSelectOnly':_0x2d9205['sqlType'][_0x111196(0x78)],'isDangerous':_0x2d9205[_0x111196(0x75)][_0x111196(0x90)],'tables':_0x2d9205[_0x111196(0x8d)],'parameters':_0x2d9205['parameters'],'message':_0x2d9205[_0x111196(0x99)]};_0x2d9205['sqlType'][_0x111196(0x7e)]&&(_0x230eeb[_0x111196(0x7e)]=_0x2d9205[_0x111196(0x75)][_0x111196(0x7e)]);const _0x864470=_0x1e02a3[_0x111196(0x91)](_0x111196(0x94));if(_0x864470&&_0x2d9205[_0x111196(0x7d)]){const _0x33a37b=_0x864470['split'](',')[_0x111196(0x9b)](_0x2922cb=>_0x2922cb['trim']())[_0x111196(0x98)](Boolean),_0x5d41ff=[],_0x2097f5=await listDatasets(_0x1e02a3[_0x111196(0xa3)]),_0x233597=new Map(_0x2097f5[_0x111196(0x9b)](_0x1374ba=>[_0x1374ba[_0x111196(0x7f)]?.[_0x111196(0x87)]?.[_0x111196(0x9f)](),_0x1374ba]));for(const _0x406334 of _0x2d9205[_0x111196(0x8d)]){const _0xd8c29a=_0x233597[_0x111196(0xa4)](_0x406334['toLowerCase']());!_0xd8c29a&&_0x5d41ff[_0x111196(0x7b)]('Table\x20\x22'+_0x406334+_0x111196(0x8c));}for(const _0x1f6c65 of _0x33a37b){try{const _0xecdda3=await getDatasetDetail(_0x1f6c65),_0x3fb14d=Array[_0x111196(0x76)](_0xecdda3[_0x111196(0x9e)])?_0xecdda3['fields']:[],_0x589a75=new Set(_0x3fb14d[_0x111196(0x9b)](_0x4a7a49=>_0x4a7a49[_0x111196(0x93)]?.[_0x111196(0x9f)]())),_0x582cbc=_0xecdda3['dbtableConfig']?.[_0x111196(0x87)]||_0xecdda3[_0x111196(0x87)]||_0x1f6c65;_0x230eeb[_0x111196(0xa2)+_0x582cbc]={'code':_0x1f6c65,'tableName':_0x582cbc,'fieldCount':_0x589a75['size'],'fields':Array[_0x111196(0x97)](_0x589a75)};}catch{_0x5d41ff[_0x111196(0x7b)]('Dataset\x20\x22'+_0x1f6c65+_0x111196(0x8a));}}_0x5d41ff[_0x111196(0x85)]>0x0&&(_0x230eeb[_0x111196(0x80)]=_0x5d41ff);}return{'ok':_0x2d9205[_0x111196(0x7d)],'data':_0x230eeb,'message':_0x2d9205['message']};}};
|
package/lib/config/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a103_0x37531d=a103_0x53e0;(function(_0x17e1f4,_0x15f3c6){const _0x509b46=a103_0x53e0,_0x5826ed=_0x17e1f4();while(!![]){try{const _0x94fd32=-parseInt(_0x509b46(0x1d9))/0x1*(parseInt(_0x509b46(0x1e8))/0x2)+parseInt(_0x509b46(0x1f6))/0x3*(-parseInt(_0x509b46(0x1d3))/0x4)+-parseInt(_0x509b46(0x1e9))/0x5*(parseInt(_0x509b46(0x1d6))/0x6)+-parseInt(_0x509b46(0x1f1))/0x7+-parseInt(_0x509b46(0x1db))/0x8+parseInt(_0x509b46(0x1d2))/0x9*(-parseInt(_0x509b46(0x1e3))/0xa)+parseInt(_0x509b46(0x1d5))/0xb;if(_0x94fd32===_0x15f3c6)break;else _0x5826ed['push'](_0x5826ed['shift']());}catch(_0x15b862){_0x5826ed['push'](_0x5826ed['shift']());}}}(a103_0x3ba4,0xec95f));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';function a103_0x3ba4(){const _0x378edb=['filter','number','riskLevel','Target\x20environment','env','locale','1908109TyUyAR','trim','Auth\x20cookie','en-US','Config\x20key\x20(','25206mGCRUC','toLowerCase','Risk\x20level','Locale','accessKey','pageSize','Default\x20page\x20size','inherit','358551zpYaSV','216ZjSwTK','keys','82818659vkWHxx','30yaiabj','Access\x20key','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','60DWyKgX','map','15359960aAwXEV','format','cookie','join','entries','string','apiDir','length','210idvcBe','zh-CN','defaultFormat','apps','defaultApp','44284Vmherx','1748485JdZdIs','app'];a103_0x3ba4=function(){return _0x378edb;};return a103_0x3ba4();}export const PROJECT_CREATE_INHERITABLE_KEYS=['cookie',a103_0x37531d(0x1fa),a103_0x37531d(0x1f0),a103_0x37531d(0x1dc),a103_0x37531d(0x1ed)];function a103_0x53e0(_0x5157be,_0x3cbd68){_0x5157be=_0x5157be-0x1cf;const _0x3ba43c=a103_0x3ba4();let _0x53e02f=_0x3ba43c[_0x5157be];return _0x53e02f;}export const TOP_LEVEL_CONFIG_KEYS=new Set(['appcode',a103_0x37531d(0x1ef),a103_0x37531d(0x1f0),'format','cookie',a103_0x37531d(0x1fa),a103_0x37531d(0x1e1)]);export const CONFIG_ENUM_VALUES={'env':[...RABETBASE_ENV_VALUES],'format':[...RABETBASE_OUTPUT_FORMAT_VALUES]};export function formatConfigKeyList(_0x4c9fd6){const _0x205432=a103_0x37531d;return[..._0x4c9fd6][_0x205432(0x1de)](',\x20');}export function getTopLevelConfigKeyList(){return[...TOP_LEVEL_CONFIG_KEYS];}export function isTopLevelConfigKey(_0x32550e){return TOP_LEVEL_CONFIG_KEYS['has'](_0x32550e);}export function getTopLevelConfigKeySummary(){return formatConfigKeyList(getTopLevelConfigKeyList());}export function getConfigCommandKeyDescription(){const _0x16906f=a103_0x37531d;return _0x16906f(0x1f5)+getTopLevelConfigKeySummary()+')';}export const APP_PROFILE_FLAG_KEY_MAP={'env':'env','apiDir':a103_0x37531d(0x1e1),'cookie':a103_0x37531d(0x1dd),'accessKey':a103_0x37531d(0x1fa),'defaultFormat':'format','pageSize':a103_0x37531d(0x1cf),'riskLevel':a103_0x37531d(0x1ed),'locale':'locale'};export function getAppProfileFlagDefs(){const _0x2819ef=a103_0x37531d;return[{'name':_0x2819ef(0x1ef),'type':'string','description':_0x2819ef(0x1ee),'enum':[...RABETBASE_ENV_VALUES]},{'name':_0x2819ef(0x1e1),'type':_0x2819ef(0x1e0),'description':'API\x20directory\x20path'},{'name':_0x2819ef(0x1dd),'type':'string','description':_0x2819ef(0x1f3),'hidden':!![]},{'name':_0x2819ef(0x1fa),'type':_0x2819ef(0x1e0),'description':_0x2819ef(0x1d7),'hidden':!![]},{'name':_0x2819ef(0x1e5),'type':'string','description':_0x2819ef(0x1d8),'enum':[...RABETBASE_OUTPUT_FORMAT_VALUES]},{'name':_0x2819ef(0x1cf),'type':_0x2819ef(0x1ec),'description':_0x2819ef(0x1d0)},{'name':_0x2819ef(0x1ed),'type':_0x2819ef(0x1e0),'description':_0x2819ef(0x1f8),'enum':[...RISK_LEVEL_VALUES]},{'name':_0x2819ef(0x1f0),'type':_0x2819ef(0x1e0),'description':_0x2819ef(0x1f9)}];}export function collectAppProfileOverrides(_0x45a25e){const _0x182519=a103_0x37531d,_0x502331={};for(const [_0x2f4492,_0x38d7e8]of Object[_0x182519(0x1df)](APP_PROFILE_FLAG_KEY_MAP)){const _0x2ce2f6=_0x45a25e(_0x2f4492);if(!_0x2ce2f6)continue;_0x502331[_0x38d7e8]=_0x38d7e8==='pageSize'?Number(_0x2ce2f6):_0x2ce2f6;}return _0x502331;}export function buildAppProfileListFields(_0x835121){const _0x312a7c=a103_0x37531d;return{'env':_0x835121[_0x312a7c(0x1ef)]??null,'apiDir':_0x835121['apiDir']??null,'hasCookie':!!_0x835121[_0x312a7c(0x1dd)],'hasAccessKey':!!_0x835121['accessKey'],'format':_0x835121['format']??null,'pageSize':_0x835121[_0x312a7c(0x1cf)]??null,'riskLevel':_0x835121[_0x312a7c(0x1ed)]??null,'locale':_0x835121[_0x312a7c(0x1f0)]??null};}export function buildAppDoctorFields(_0x50084e,_0x4eba56){const _0x10c035=a103_0x37531d;return{'env':{'value':_0x50084e[_0x10c035(0x1ef)]||_0x4eba56[_0x10c035(0x1ef)],'source':_0x50084e['env']?'app':'inherit'},'apiDir':{'value':_0x50084e[_0x10c035(0x1e1)]||_0x4eba56[_0x10c035(0x1e1)],'source':_0x50084e[_0x10c035(0x1e1)]?_0x10c035(0x1ea):_0x10c035(0x1d1)},'cookie':{'value':_0x50084e['cookie']||_0x4eba56[_0x10c035(0x1dd)],'source':_0x50084e['cookie']?_0x10c035(0x1ea):_0x10c035(0x1d1)},'accessKey':{'value':_0x50084e[_0x10c035(0x1fa)]||_0x4eba56[_0x10c035(0x1fa)],'source':_0x50084e[_0x10c035(0x1fa)]?_0x10c035(0x1ea):_0x10c035(0x1d1)}};}export function buildCanonicalAppConfig(_0x46dd93,_0x14e9ea){const _0x359fbc=a103_0x37531d,_0x3fd1e1=_0x46dd93[_0x359fbc(0x1da)](_0xf89ea6=>String(_0xf89ea6||'')[_0x359fbc(0x1f2)]())[_0x359fbc(0x1eb)](Boolean);if(_0x3fd1e1[_0x359fbc(0x1e2)]===0x0)return{};const _0x25ddb5={};for(const _0x2ba6c4 of _0x3fd1e1){_0x25ddb5[_0x2ba6c4]=_0x14e9ea?{'appcode':_0x2ba6c4,'env':_0x14e9ea}:{'appcode':_0x2ba6c4};}return{'apps':_0x25ddb5,'defaultApp':_0x3fd1e1[0x0]};}export function buildCanonicalProjectConfig(_0x5830af,_0x9e07f4){const _0x5385f2=a103_0x37531d,{appCodes:appCodes=[],env:_0x51747d,metadata:_0x4656f5}=_0x9e07f4,_0x1bd4c5={..._0x5830af,..._0x4656f5||{}};delete _0x1bd4c5['appcode'],delete _0x1bd4c5[_0x5385f2(0x1ea)];if(_0x51747d)_0x1bd4c5[_0x5385f2(0x1ef)]=_0x51747d;else!_0x1bd4c5['env']&&(_0x1bd4c5['env']=DEFAULT_CONFIG_VALUES[_0x5385f2(0x1ef)]);const _0x237fd2=buildCanonicalAppConfig(appCodes,_0x1bd4c5[_0x5385f2(0x1ef)]);return Object[_0x5385f2(0x1d4)](_0x237fd2)[_0x5385f2(0x1e2)]>0x0&&(_0x1bd4c5[_0x5385f2(0x1e6)]=_0x237fd2[_0x5385f2(0x1e6)],_0x1bd4c5[_0x5385f2(0x1e7)]=_0x237fd2[_0x5385f2(0x1e7)]),_0x1bd4c5;}const LOCALE_MAP={'zh':a103_0x37531d(0x1e4),'zh-cn':'zh-CN','zh_cn':a103_0x37531d(0x1e4),'en':a103_0x37531d(0x1f4),'en-us':a103_0x37531d(0x1f4),'en_us':a103_0x37531d(0x1f4)};export function normalizeLocale(_0x2b1817){const _0x409330=a103_0x37531d;if(!_0x2b1817)return null;return LOCALE_MAP[_0x2b1817[_0x409330(0x1f7)]()]??null;}
|
package/lib/constant/cli.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a104_0xcbd0c5=a104_0x441b;(function(_0x4dc892,_0xa71fb6){const _0x2820b9=a104_0x441b,_0x1d9f1b=_0x4dc892();while(!![]){try{const _0x5e643e=parseInt(_0x2820b9(0x173))/0x1*(-parseInt(_0x2820b9(0x176))/0x2)+parseInt(_0x2820b9(0x15f))/0x3+-parseInt(_0x2820b9(0x18f))/0x4+parseInt(_0x2820b9(0x17d))/0x5*(parseInt(_0x2820b9(0x16a))/0x6)+parseInt(_0x2820b9(0x18c))/0x7+parseInt(_0x2820b9(0x16d))/0x8+parseInt(_0x2820b9(0x175))/0x9;if(_0x5e643e===_0xa71fb6)break;else _0x1d9f1b['push'](_0x1d9f1b['shift']());}catch(_0x26fbc8){_0x1d9f1b['push'](_0x1d9f1b['shift']());}}}(a104_0x79a5,0x5fa66));export const CLI_BIN_NAME=a104_0xcbd0c5(0x169);export const CLI_DISPLAY_NAME='Rabetbase\x20CLI';function a104_0x441b(_0x34dfea,_0x419ebe){_0x34dfea=_0x34dfea-0x15b;const _0x79a5f0=a104_0x79a5();let _0x441b6f=_0x79a5f0[_0x34dfea];return _0x441b6f;}export const NPM_PACKAGE_NAME=a104_0xcbd0c5(0x1ab);export const GLOBAL_FLAGS=[{'name':a104_0xcbd0c5(0x17c),'meowKey':'appcode','type':a104_0xcbd0c5(0x1ac),'description':'Override\x20appcode','hint':'<code>'},{'name':a104_0xcbd0c5(0x18e),'meowKey':a104_0xcbd0c5(0x18e),'type':a104_0xcbd0c5(0x1ac),'description':'Select\x20app\x20profile\x20by\x20name','hint':'<name>'},{'name':a104_0xcbd0c5(0x189),'meowKey':a104_0xcbd0c5(0x189),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x191),'hint':a104_0xcbd0c5(0x188)},{'name':a104_0xcbd0c5(0x1a6),'meowKey':a104_0xcbd0c5(0x1a6),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x15b),'hint':a104_0xcbd0c5(0x16f)},{'name':'jq','meowKey':'jq','type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x15e),'hint':'<expr>'},{'name':a104_0xcbd0c5(0x1a4),'meowKey':a104_0xcbd0c5(0x183),'type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x160)},{'name':a104_0xcbd0c5(0x167),'meowKey':'yes','type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x168)},{'name':a104_0xcbd0c5(0x18a),'meowKey':'nonInteractive','type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x16b)},{'name':a104_0xcbd0c5(0x186),'meowKey':'global','type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x165)},{'name':a104_0xcbd0c5(0x15d),'meowKey':a104_0xcbd0c5(0x15d),'type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x1a2)},{'name':'ci','meowKey':'ci','type':a104_0xcbd0c5(0x193),'description':'Alias\x20for\x20--non-interactive','hidden':!![]},{'name':a104_0xcbd0c5(0x198),'meowKey':a104_0xcbd0c5(0x198),'type':a104_0xcbd0c5(0x193),'description':'Show\x20help'},{'name':a104_0xcbd0c5(0x184),'meowKey':a104_0xcbd0c5(0x184),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x18d),'hidden':!![]},{'name':a104_0xcbd0c5(0x1a8),'meowKey':a104_0xcbd0c5(0x1a8),'type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x194),'hidden':!![]},{'name':a104_0xcbd0c5(0x1a7),'meowKey':'watch','type':a104_0xcbd0c5(0x193),'description':'Watch\x20mode','hidden':!![]},{'name':a104_0xcbd0c5(0x1a5),'meowKey':'output','type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x17e),'hidden':!![]},{'name':a104_0xcbd0c5(0x17b),'meowKey':a104_0xcbd0c5(0x17b),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x178),'hidden':!![]},{'name':a104_0xcbd0c5(0x19b),'meowKey':'datasetcode','type':a104_0xcbd0c5(0x1ac),'description':'Dataset\x20code','hidden':!![]},{'name':a104_0xcbd0c5(0x172),'meowKey':a104_0xcbd0c5(0x172),'type':'boolean','description':'Apply\x20to\x20all','hidden':!![]},{'name':a104_0xcbd0c5(0x171),'meowKey':a104_0xcbd0c5(0x187),'type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x196),'hidden':!![]},{'name':'id','meowKey':'id','type':a104_0xcbd0c5(0x1ac),'description':'Record\x20ID','hidden':!![]},{'name':'type','meowKey':a104_0xcbd0c5(0x195),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x19e),'hidden':!![]},{'name':a104_0xcbd0c5(0x192),'meowKey':'file','type':a104_0xcbd0c5(0x1ac),'description':'File\x20path','hidden':!![]},{'name':a104_0xcbd0c5(0x1aa),'meowKey':a104_0xcbd0c5(0x1aa),'type':a104_0xcbd0c5(0x1ac),'description':'SQL\x20code','hidden':!![]},{'name':a104_0xcbd0c5(0x180),'meowKey':'sqlname','type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x1a0),'hidden':!![]},{'name':a104_0xcbd0c5(0x16e),'meowKey':'dbid','type':a104_0xcbd0c5(0x1ac),'description':'DB\x20ID','hidden':!![]},{'name':a104_0xcbd0c5(0x197),'meowKey':a104_0xcbd0c5(0x197),'type':'string','description':a104_0xcbd0c5(0x179),'hidden':!![]},{'name':a104_0xcbd0c5(0x163),'meowKey':a104_0xcbd0c5(0x163),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x15c),'hidden':!![]},{'name':a104_0xcbd0c5(0x1a3),'meowKey':a104_0xcbd0c5(0x1a3),'type':a104_0xcbd0c5(0x1ac),'description':'Page\x20size','hidden':!![]},{'name':'keyword','meowKey':a104_0xcbd0c5(0x182),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x19a),'hidden':!![]},{'name':a104_0xcbd0c5(0x170),'meowKey':a104_0xcbd0c5(0x170),'type':'string','description':'Code\x20filter','hidden':!![]},{'name':a104_0xcbd0c5(0x16c),'meowKey':a104_0xcbd0c5(0x16c),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x19d),'hidden':!![]},{'name':a104_0xcbd0c5(0x177),'meowKey':a104_0xcbd0c5(0x177),'type':'string','description':a104_0xcbd0c5(0x1ad),'hidden':!![]},{'name':a104_0xcbd0c5(0x162),'meowKey':'operation','type':'string','description':a104_0xcbd0c5(0x17f),'hidden':!![]},{'name':'target','meowKey':a104_0xcbd0c5(0x190),'type':a104_0xcbd0c5(0x1ac),'description':'Target\x20path','hidden':!![]},{'name':a104_0xcbd0c5(0x166),'meowKey':a104_0xcbd0c5(0x199),'type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x185),'hidden':!![]},{'name':a104_0xcbd0c5(0x174),'meowKey':'key','type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x18b),'hidden':!![]},{'name':a104_0xcbd0c5(0x181),'meowKey':a104_0xcbd0c5(0x181),'type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x19c),'hidden':!![]},{'name':a104_0xcbd0c5(0x19f),'meowKey':a104_0xcbd0c5(0x19f),'type':a104_0xcbd0c5(0x193),'description':a104_0xcbd0c5(0x1a1),'hidden':!![]},{'name':'remote','meowKey':a104_0xcbd0c5(0x1a9),'type':a104_0xcbd0c5(0x193),'description':'Use\x20remote','hidden':!![]},{'name':a104_0xcbd0c5(0x164),'meowKey':a104_0xcbd0c5(0x164),'type':a104_0xcbd0c5(0x193),'description':'Verbose\x20output','hidden':!![]},{'name':'operation-type','meowKey':'operationType','type':a104_0xcbd0c5(0x1ac),'description':'Operation\x20type','hidden':!![]},{'name':'function-node','meowKey':'functionNode','type':a104_0xcbd0c5(0x1ac),'description':a104_0xcbd0c5(0x17a),'hidden':!![]}];export const PIPELINE_FLAG_NAMES=new Set([a104_0xcbd0c5(0x17c),a104_0xcbd0c5(0x18e),a104_0xcbd0c5(0x189),a104_0xcbd0c5(0x1a6),'jq',a104_0xcbd0c5(0x1a4),'yes',a104_0xcbd0c5(0x18a),'ci']);function a104_0x79a5(){const _0x4a104f=['skipImports','Keyword\x20filter','datasetcode','Config\x20value','SQL\x20string','Type\x20filter','force','SQL\x20name','Force\x20overwrite','Use\x20project\x20config\x20scope','pagesize','dry-run','output','format','watch','clear','remote','sqlcode','@lovrabet/rabetbase-cli','string','Schemas','Output\x20format','Page\x20number','project','Filter\x20JSON\x20output\x20(bundled\x20jq\x20via\x20node-jq,\x20else\x20PATH;\x20use\x20with\x20--format\x20json\x20or\x20compress)','228630vZdGyN','Preview\x20operation\x20without\x20executing','fromEntries','operation','page','verbose','Use\x20global\x20config\x20scope','skip-imports','yes','Skip\x20confirmation\x20for\x20high-risk\x20writes','rabetbase','7914WtCYIw','Force\x20non-interactive\x20mode\x20(CI)','sql','3734232WKHndm','dbid','json\x20|\x20pretty\x20|\x20compress','code','enable-bff-save','all','41617jdXNFB','key','2790324NNVnZs','14yltcRw','schemas','JSON\x20params','Description','Function\x20node','params','appcode','285yJRaxl','Output\x20path','Operation\x20type','sqlname','value','keyword','dryRun','name','Skip\x20import\x20generation','global','enableBffSave','production\x20|\x20daily','env','non-interactive','Config\x20key','2572066RQtreN','Name','app','2450180qoaCmz','target','Environment','file','boolean','Clear','type','Enable\x20BFF\x20save','description','help'];a104_0x79a5=function(){return _0x4a104f;};return a104_0x79a5();}export function buildMeowFlags(){const _0x6fc80a=a104_0xcbd0c5;return Object[_0x6fc80a(0x161)](GLOBAL_FLAGS['map'](_0x4f7d3a=>[_0x4f7d3a['meowKey'],{'type':_0x4f7d3a[_0x6fc80a(0x195)]}]));}
|
package/lib/constant/defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a105_0x1c7378=a105_0x22be;(function(_0x3b93e0,_0x5b7265){const _0x36f49b=a105_0x22be,_0x547496=_0x3b93e0();while(!![]){try{const _0x25247e=-parseInt(_0x36f49b(0x125))/0x1*(-parseInt(_0x36f49b(0x124))/0x2)+parseInt(_0x36f49b(0x126))/0x3*(-parseInt(_0x36f49b(0x127))/0x4)+parseInt(_0x36f49b(0x123))/0x5+parseInt(_0x36f49b(0x11c))/0x6+-parseInt(_0x36f49b(0x120))/0x7*(parseInt(_0x36f49b(0x122))/0x8)+parseInt(_0x36f49b(0x129))/0x9+-parseInt(_0x36f49b(0x121))/0xa;if(_0x25247e===_0x5b7265)break;else _0x547496['push'](_0x547496['shift']());}catch(_0x46b8ff){_0x547496['push'](_0x547496['shift']());}}}(a105_0x41b0,0x5d121));function a105_0x41b0(){const _0x486598=['production','7182USLlRq','2019710sZWcQq','3264hPclaV','894635qTHrPh','1221130sxRTQw','1awGykj','8094UJVnSJ','156MfqeDD','en-US','2668545LbuvtD','126126JNCaci','high-risk-write','compress'];a105_0x41b0=function(){return _0x486598;};return a105_0x41b0();}import{DEFAULT_API_DIR}from'../constant/paths.js';function a105_0x22be(_0x4d2b11,_0x10eb62){_0x4d2b11=_0x4d2b11-0x11c;const _0x41b056=a105_0x41b0();let _0x22be0b=_0x41b056[_0x4d2b11];return _0x22be0b;}export const DEFAULT_CONFIG_VALUES={'env':a105_0x1c7378(0x11f),'format':'compress','locale':a105_0x1c7378(0x128),'riskLevel':a105_0x1c7378(0x11d),'apiDir':DEFAULT_API_DIR};export const DEFAULT_COMMAND_OUTPUT_FORMAT=a105_0x1c7378(0x11e);
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a106_0x471fa7=a106_0x3b14;function a106_0x3b14(_0x1db278,_0x2dcf00){_0x1db278=_0x1db278-0x19e;const _0x3bdf2d=a106_0x3bdf();let _0x3b14c1=_0x3bdf2d[_0x1db278];return _0x3b14c1;}(function(_0x33241f,_0x2ae3c7){const _0x3ab1cf=a106_0x3b14,_0x4a6ca2=_0x33241f();while(!![]){try{const _0x4b30c8=parseInt(_0x3ab1cf(0x1a4))/0x1*(parseInt(_0x3ab1cf(0x1a7))/0x2)+-parseInt(_0x3ab1cf(0x19f))/0x3*(parseInt(_0x3ab1cf(0x1a5))/0x4)+parseInt(_0x3ab1cf(0x1aa))/0x5+-parseInt(_0x3ab1cf(0x1ae))/0x6+-parseInt(_0x3ab1cf(0x1af))/0x7+-parseInt(_0x3ab1cf(0x1a0))/0x8*(parseInt(_0x3ab1cf(0x1ad))/0x9)+parseInt(_0x3ab1cf(0x1a8))/0xa*(parseInt(_0x3ab1cf(0x1a6))/0xb);if(_0x4b30c8===_0x2ae3c7)break;else _0x4a6ca2['push'](_0x4a6ca2['shift']());}catch(_0x351f80){_0x4a6ca2['push'](_0x4a6ca2['shift']());}}}(a106_0x3bdf,0x186a3));function a106_0x3bdf(){const _0x25888e=['https://user-daily.lovrabet.com','runtimeDomain','https://daily-api.lovrabet.com','1cApPqX','14908MUdGsc','2327776KCGwWP','285954JWnKwp','10YHRbne','https://daily-runtime.lovrabet.com','919560fSIuai','userDomain','apiDomain','22311jgwJYX','896868DcQlGt','684369qjFguR','https://runtime.lovrabet.com','132qSETMc','88eUUUlv'];a106_0x3bdf=function(){return _0x25888e;};return a106_0x3bdf();}import{getEnv,isProduction}from'../constant/env.js';let customApiDomain,customUserDomain,customRuntimeDomain;export function initDomains(_0x11fd53){const _0x580bc5=a106_0x3b14;customApiDomain=_0x11fd53?.[_0x580bc5(0x1ac)],customUserDomain=_0x11fd53?.[_0x580bc5(0x1ab)],customRuntimeDomain=_0x11fd53?.[_0x580bc5(0x1a2)];}export const getUserDomain=()=>customUserDomain||(isProduction(getEnv())?'https://user.lovrabet.com':a106_0x471fa7(0x1a1));export const getApiDomain=()=>customApiDomain||(isProduction(getEnv())?'https://api.lovrabet.com':a106_0x471fa7(0x1a3));export const getRuntimeDomain=()=>customRuntimeDomain||(isProduction(getEnv())?a106_0x471fa7(0x19e):a106_0x471fa7(0x1a9));
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a107_0x1fabac=a107_0x6d49;(function(_0x5bc59c,_0xc9006b){const _0x35e49c=a107_0x6d49,_0x5185da=_0x5bc59c();while(!![]){try{const _0x2a0563=parseInt(_0x35e49c(0x117))/0x1+parseInt(_0x35e49c(0x11c))/0x2+parseInt(_0x35e49c(0x11d))/0x3+-parseInt(_0x35e49c(0x116))/0x4+parseInt(_0x35e49c(0x114))/0x5*(-parseInt(_0x35e49c(0x112))/0x6)+parseInt(_0x35e49c(0x113))/0x7+-parseInt(_0x35e49c(0x119))/0x8*(parseInt(_0x35e49c(0x118))/0x9);if(_0x2a0563===_0xc9006b)break;else _0x5185da['push'](_0x5185da['shift']());}catch(_0x4167da){_0x5185da['push'](_0x5185da['shift']());}}}(a107_0x171d,0xc07b9));export const RABETBASE_ENV_VALUES=['production','daily'];export function normalizeEnv(_0x4f72f4){const _0x1f6dd3=a107_0x6d49;return _0x4f72f4===_0x1f6dd3(0x11a)?_0x1f6dd3(0x115):_0x4f72f4;}export function isProduction(_0x3506de){const _0x2d77b0=a107_0x6d49;return normalizeEnv(_0x3506de)===_0x2d77b0(0x115);}export function isDaily(_0x5acdd8){return normalizeEnv(_0x5acdd8)==='daily';}function a107_0x6d49(_0x28667a,_0x33444b){_0x28667a=_0x28667a-0x112;const _0x171de3=a107_0x171d();let _0x6d4939=_0x171de3[_0x28667a];return _0x6d4939;}export function isDev(_0x110448){const _0x523606=a107_0x6d49,_0x3260fa=normalizeEnv(_0x110448);return _0x3260fa===_0x523606(0x11b)||_0x3260fa==='dev';}let env=normalizeEnv(process.env.RABETBASE_ENV||process.env.LOVRABET_ENV||a107_0x1fabac(0x115));function a107_0x171d(){const _0x399cb3=['3260152HyRMRk','884636bkcndX','475920fcYpMp','208GpbRrl','online','development','186618JSXPia','1831530IaQvEW','123288rsdZbZ','10448284qwCTvm','25FqrIfr','production'];a107_0x171d=function(){return _0x399cb3;};return a107_0x171d();}export function getEnv(){return env;}export function initEnv(_0x589d52){env=normalizeEnv(_0x589d52);}
|
package/lib/constant/output.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a108_0x359618=a108_0x1c39;(function(_0x4f9204,_0x201559){const _0x37b2cf=a108_0x1c39,_0x42c252=_0x4f9204();while(!![]){try{const _0x547ca3=-parseInt(_0x37b2cf(0x198))/0x1*(-parseInt(_0x37b2cf(0x18e))/0x2)+-parseInt(_0x37b2cf(0x192))/0x3+-parseInt(_0x37b2cf(0x193))/0x4+-parseInt(_0x37b2cf(0x194))/0x5+parseInt(_0x37b2cf(0x197))/0x6+parseInt(_0x37b2cf(0x18f))/0x7*(-parseInt(_0x37b2cf(0x196))/0x8)+parseInt(_0x37b2cf(0x195))/0x9;if(_0x547ca3===_0x201559)break;else _0x42c252['push'](_0x42c252['shift']());}catch(_0x17ba03){_0x42c252['push'](_0x42c252['shift']());}}}(a108_0x6988,0xe5fc0));export const RABETBASE_OUTPUT_FORMAT_VALUES=[a108_0x359618(0x199),a108_0x359618(0x190),a108_0x359618(0x191)];function a108_0x1c39(_0x31109a,_0xc47428){_0x31109a=_0x31109a-0x18e;const _0x698807=a108_0x6988();let _0x1c39e7=_0x698807[_0x31109a];return _0x1c39e7;}function a108_0x6988(){const _0x428fe2=['json','57938ahxhJs','7054215ntJpdg','pretty','compress','2413251pAqmkm','6934400ehLRUV','4791680gcVeJg','40305411kBHZDN','8lsTXRl','3546828YBFqKT','13qVzXOY'];a108_0x6988=function(){return _0x428fe2;};return a108_0x6988();}
|
package/lib/constant/paths.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2e98d2,_0x2a830c){const _0x229c73=a109_0x4d22,_0x562f4a=_0x2e98d2();while(!![]){try{const _0x131d78=-parseInt(_0x229c73(0x6f))/0x1+-parseInt(_0x229c73(0x6d))/0x2+-parseInt(_0x229c73(0x6c))/0x3*(-parseInt(_0x229c73(0x71))/0x4)+-parseInt(_0x229c73(0x69))/0x5+parseInt(_0x229c73(0x6a))/0x6+-parseInt(_0x229c73(0x70))/0x7+parseInt(_0x229c73(0x6b))/0x8*(parseInt(_0x229c73(0x6e))/0x9);if(_0x131d78===_0x2a830c)break;else _0x562f4a['push'](_0x562f4a['shift']());}catch(_0x18185b){_0x562f4a['push'](_0x562f4a['shift']());}}}(a109_0x36d1,0x35881));export const DEFAULT_API_DIR='./src/api';function a109_0x4d22(_0x3e3e74,_0x258e82){_0x3e3e74=_0x3e3e74-0x69;const _0x36d1a0=a109_0x36d1();let _0x4d2281=_0x36d1a0[_0x3e3e74];return _0x4d2281;}function a109_0x36d1(){const _0x33030c=['925494RHuXpg','3261864tpJjcL','28668MwLldd','577692UPtdjx','27HIktOy','436525OVqfgO','1249948jGYQKG','60iRHnnG','1987940lOvcJU'];a109_0x36d1=function(){return _0x33030c;};return a109_0x36d1();}
|
package/lib/constant/risk.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a110_0x289e(_0xdbf0f8,_0x3fb109){_0xdbf0f8=_0xdbf0f8-0x1e3;const _0x510f83=a110_0x510f();let _0x289ef0=_0x510f83[_0xdbf0f8];return _0x289ef0;}const a110_0x32c28b=a110_0x289e;(function(_0x275f55,_0x48d3f4){const _0x3d02ab=a110_0x289e,_0x6e5909=_0x275f55();while(!![]){try{const _0x4b2d56=-parseInt(_0x3d02ab(0x1ea))/0x1+parseInt(_0x3d02ab(0x1e8))/0x2*(parseInt(_0x3d02ab(0x1ed))/0x3)+-parseInt(_0x3d02ab(0x1e9))/0x4*(-parseInt(_0x3d02ab(0x1e6))/0x5)+parseInt(_0x3d02ab(0x1eb))/0x6*(parseInt(_0x3d02ab(0x1ee))/0x7)+-parseInt(_0x3d02ab(0x1e3))/0x8*(parseInt(_0x3d02ab(0x1e7))/0x9)+parseInt(_0x3d02ab(0x1e4))/0xa+-parseInt(_0x3d02ab(0x1e5))/0xb;if(_0x4b2d56===_0x48d3f4)break;else _0x6e5909['push'](_0x6e5909['shift']());}catch(_0x2b9afc){_0x6e5909['push'](_0x6e5909['shift']());}}}(a110_0x510f,0x18cfe));function a110_0x510f(){const _0x194a82=['1896741PaLgrD','20RkSldf','929196xSLlsM','1700FRZnvv','199268rDXfLA','196693sRMekG','984678PBhQeV','high-risk-write','93YpyzvP','7JIbIUR','8XNyPlK','1842670XPkeAd'];a110_0x510f=function(){return _0x194a82;};return a110_0x510f();}export const RISK_LEVEL_VALUES=['read','write',a110_0x32c28b(0x1ec)];
|
package/lib/context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a111_0x235eeb=a111_0x4b16;(function(_0x563410,_0x6b7ed8){const _0x399115=a111_0x4b16,_0x252979=_0x563410();while(!![]){try{const _0x568aa4=parseInt(_0x399115(0x212))/0x1*(parseInt(_0x399115(0x206))/0x2)+-parseInt(_0x399115(0x207))/0x3+parseInt(_0x399115(0x22b))/0x4*(-parseInt(_0x399115(0x219))/0x5)+parseInt(_0x399115(0x1ec))/0x6+-parseInt(_0x399115(0x1dc))/0x7*(-parseInt(_0x399115(0x1dd))/0x8)+-parseInt(_0x399115(0x1e3))/0x9+parseInt(_0x399115(0x1e4))/0xa*(parseInt(_0x399115(0x20e))/0xb);if(_0x568aa4===_0x6b7ed8)break;else _0x252979['push'](_0x252979['shift']());}catch(_0x519376){_0x252979['push'](_0x252979['shift']());}}}(a111_0x1239,0x21822));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';function a111_0x4b16(_0x2a2164,_0x361aaa){_0x2a2164=_0x2a2164-0x1d8;const _0x1239fd=a111_0x1239();let _0x4b1646=_0x1239fd[_0x2a2164];return _0x4b1646;}import{DEFAULT_CONFIG_VALUES}from'./constant/defaults.js';import{normalizeEnv,isDaily}from'./constant/env.js';import{normalizeLegacyOutputFormat}from'./framework/types.js';function env(_0x238b4b){return process.env[`RABETBASE_${_0x238b4b}`]||process.env[`LOVRABET_${_0x238b4b}`]||undefined;}export const NEW_CONFIG_NAME=a111_0x235eeb(0x200);export const CONFIG_NAMES=[a111_0x235eeb(0x200),a111_0x235eeb(0x1f1),a111_0x235eeb(0x1ef)];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a111_0x235eeb(0x1f7)](_0x52507d=>_0x52507d!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x4c4809){for(const _0x241fb8 of CONFIG_NAMES){const _0x1fed26=resolve(_0x4c4809,_0x241fb8);if(existsSync(_0x1fed26))return _0x1fed26;}return undefined;}export function findProjectRootDirectory(_0x5a0423=process[a111_0x235eeb(0x22a)]()){let _0xddc69a=resolve(_0x5a0423);const {root:_0x44440f}=parse(_0xddc69a),_0x1499ae=homedir();while(!![]){if(resolveConfigPath(_0xddc69a)){if(_0xddc69a===_0x1499ae)break;return _0xddc69a;}if(_0xddc69a===_0x44440f||_0xddc69a===_0x1499ae)break;const _0x452796=dirname(_0xddc69a);if(_0x452796===_0xddc69a)break;_0xddc69a=_0x452796;}return resolve(_0x5a0423);}export async function createContext(_0x18579c){const _0x3cd71d=a111_0x235eeb,_0x5733ad=readRawConfig(),_0x2d12bf=buildConfig(_0x5733ad,_0x18579c),{initEnv:_0x1b1738}=await import(_0x3cd71d(0x1d9));if(_0x2d12bf['env'])_0x1b1738(_0x2d12bf['env']);else _0x18579c[_0x3cd71d(0x21c)]&&typeof _0x18579c['env']===_0x3cd71d(0x1fd)&&_0x1b1738(_0x18579c[_0x3cd71d(0x21c)]);const {initDomains:_0xdbc783,getUserDomain:_0x3e0ccf,getApiDomain:_0x327288}=await import(_0x3cd71d(0x1ea));_0xdbc783({'apiDomain':_0x5733ad[_0x3cd71d(0x21d)]||undefined,'userDomain':_0x5733ad[_0x3cd71d(0x205)]||undefined,'runtimeDomain':_0x5733ad[_0x3cd71d(0x222)]||undefined});const _0x5c3845={'apiDomain':_0x327288(),'userDomain':_0x3e0ccf()},_0x4cc9d8=await buildAuth(_0x2d12bf);logger[_0x3cd71d(0x202)](process['cwd']());const _0x43d287=(CLI_BIN_NAME+'\x20'+process[_0x3cd71d(0x1e5)][_0x3cd71d(0x1e1)](0x2)[_0x3cd71d(0x209)]('\x20'))[_0x3cd71d(0x1fb)]();logger[_0x3cd71d(0x211)](_0x43d287);const {isNonInteractive:_0x9fde9e}=await import(_0x3cd71d(0x1f2)),_0x57c7fc=_0x9fde9e(_0x18579c);return{'config':_0x2d12bf,'auth':_0x4cc9d8,'logger':logger,'env':_0x5c3845,'nonInteractive':_0x57c7fc};}export function buildConfigFromFlags(_0x5d6b43){return buildConfig(readRawConfig(),_0x5d6b43);}export function getProjectConfigPath(){const _0x401e9d=a111_0x235eeb;return resolveConfigPath(process[_0x401e9d(0x22a)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x78ab53){const _0xb9b772=a111_0x235eeb;if(!existsSync(_0x78ab53))return{'status':_0xb9b772(0x1ed)};try{const _0x2f41e6=readFileSync(_0x78ab53,{'encoding':_0xb9b772(0x1eb)});if(!_0x2f41e6?.[_0xb9b772(0x1fb)]())return{'status':_0xb9b772(0x20d)};const _0x3f342e=JSON[_0xb9b772(0x20a)](_0x2f41e6);return{'status':'ok','data':_0x3f342e};}catch(_0x24b4be){return{'status':'error','message':_0x24b4be instanceof Error?_0x24b4be['message']:String(_0x24b4be)};}}function parseCliConfigJsonFile(_0x8c75f4,_0x2347dd,_0x3fce0d){const _0x295bb3=a111_0x235eeb,_0x225d40=inspectCliConfigJsonFile(_0x8c75f4);if(_0x225d40[_0x295bb3(0x1e8)]==='missing'||_0x225d40[_0x295bb3(0x1e8)]==='empty')return{};if(_0x225d40[_0x295bb3(0x1e8)]==='ok')return _0x225d40[_0x295bb3(0x1e9)];return _0x2347dd===_0x295bb3(0x227)&&_0x3fce0d&&console[_0x295bb3(0x1e2)](CLI_BIN_NAME+':\x20'+_0x3fce0d+_0x295bb3(0x1e6)+_0x8c75f4+_0x295bb3(0x1e0)+_0x225d40[_0x295bb3(0x204)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x11cdd0){const _0x3f6920=a111_0x235eeb;if(!_0x11cdd0||typeof _0x11cdd0!==_0x3f6920(0x1db))return{'config':{},'migrated':![]};const _0x55deec={..._0x11cdd0},_0x1dd225=_0x55deec['apps']&&typeof _0x55deec[_0x3f6920(0x1f6)]===_0x3f6920(0x1db)?{..._0x55deec[_0x3f6920(0x1f6)]}:{},_0x5bb035=Object[_0x3f6920(0x21e)](_0x1dd225)[_0x3f6920(0x216)],_0x1f8f87=_0x55deec[_0x3f6920(0x21b)]||_0x55deec['app'];let _0x1d6f60=![];if(_0x1f8f87&&_0x5bb035===0x0){const _0x464680=typeof _0x55deec['defaultApp']===_0x3f6920(0x1fd)&&_0x55deec['defaultApp']['trim']()?_0x55deec[_0x3f6920(0x1ee)]:String(_0x1f8f87)[_0x3f6920(0x1fb)]();_0x1dd225[_0x464680]={'appcode':String(_0x1f8f87)['trim'](),..._0x55deec[_0x3f6920(0x21c)]!=null?{'env':_0x55deec[_0x3f6920(0x21c)]}:{},..._0x55deec[_0x3f6920(0x220)]!=null?{'apiDir':_0x55deec[_0x3f6920(0x220)]}:{},..._0x55deec[_0x3f6920(0x225)]!=null?{'cookie':_0x55deec[_0x3f6920(0x225)]}:{},..._0x55deec['accessKey']!=null?{'accessKey':_0x55deec['accessKey']}:{},..._0x55deec['format']!=null?{'format':_0x55deec[_0x3f6920(0x20b)]}:{},..._0x55deec[_0x3f6920(0x1f5)]!=null?{'pageSize':_0x55deec[_0x3f6920(0x1f5)]}:{},..._0x55deec[_0x3f6920(0x1f8)]!=null?{'riskLevel':_0x55deec[_0x3f6920(0x1f8)]}:{},..._0x55deec[_0x3f6920(0x1fa)]!=null?{'locale':_0x55deec[_0x3f6920(0x1fa)]}:{}},_0x55deec[_0x3f6920(0x1f6)]=_0x1dd225;if(!_0x55deec[_0x3f6920(0x1ee)])_0x55deec[_0x3f6920(0x1ee)]=_0x464680;_0x1d6f60=!![];}return(_0x3f6920(0x21b)in _0x55deec||_0x3f6920(0x1da)in _0x55deec)&&(delete _0x55deec[_0x3f6920(0x21b)],delete _0x55deec['app'],_0x1d6f60=!![]),{'config':_0x55deec,'migrated':_0x1d6f60};}function writeNormalizedConfigIfNeeded(_0x37db4b,_0x78434f){const _0x3e88b0=a111_0x235eeb,_0x47d11b=JSON[_0x3e88b0(0x22c)](_0x78434f,null,0x2)+'\x0a';if(normalizedWriteCache[_0x3e88b0(0x21f)](_0x37db4b)===_0x47d11b)return;writeConfigFile(_0x37db4b,_0x78434f),normalizedWriteCache[_0x3e88b0(0x223)](_0x37db4b,_0x47d11b);}function parseAndNormalizeConfig(_0x422700,_0x2bd8d0,_0x16739b){const _0x201ffb=a111_0x235eeb,_0x13530b=parseCliConfigJsonFile(_0x422700,_0x2bd8d0,_0x16739b),_0xfeed06=normalizeLegacyConfigShape(_0x13530b);if(_0xfeed06[_0x201ffb(0x217)])try{writeNormalizedConfigIfNeeded(_0x422700,_0xfeed06[_0x201ffb(0x218)]);}catch{}return _0xfeed06[_0x201ffb(0x218)];}export function loadRawConfigLayers(_0x101c2d){const _0x39b810=a111_0x235eeb;let _0x2fc7ba={},_0xb9e31c={};const _0x2b082e=resolveConfigPath(homedir());_0x2b082e&&(_0x2fc7ba=parseAndNormalizeConfig(_0x2b082e,'warn',_0x39b810(0x1de)));const _0x1e207f=_0x101c2d??findProjectRootDirectory(),_0x190137=resolveConfigPath(_0x1e207f);return _0x190137&&(_0xb9e31c=parseAndNormalizeConfig(_0x190137,_0x39b810(0x227),'Project')),{'globalPath':_0x2b082e,'projectPath':_0x190137,'globalConfig':_0x2fc7ba,'projectConfig':_0xb9e31c};}function mergeRawConfigLayers(_0x3611e0){const _0x577b8c=a111_0x235eeb,{globalConfig:_0x1df6a6,projectConfig:_0x30f7d6}=_0x3611e0;if(_0x30f7d6[_0x577b8c(0x20f)]===![]){const _0x55c16e={..._0x30f7d6};delete _0x55c16e[_0x577b8c(0x20f)];const _0x4364a5=_0x30f7d6['apps']&&typeof _0x30f7d6[_0x577b8c(0x1f6)]===_0x577b8c(0x1db)?_0x30f7d6['apps']:{};Object['keys'](_0x4364a5)[_0x577b8c(0x216)]>0x0?_0x55c16e[_0x577b8c(0x1f6)]=_0x4364a5:delete _0x55c16e[_0x577b8c(0x1f6)];if(_0x577b8c(0x1ee)in _0x30f7d6)_0x55c16e['defaultApp']=_0x30f7d6['defaultApp'];else Object[_0x577b8c(0x21e)](_0x4364a5)['length']>0x0&&(_0x55c16e[_0x577b8c(0x1ee)]=Object[_0x577b8c(0x21e)](_0x4364a5)[0x0]);return _0x55c16e;}const _0x43a48c=_0x1df6a6[_0x577b8c(0x1f6)]&&typeof _0x1df6a6[_0x577b8c(0x1f6)]===_0x577b8c(0x1db)?_0x1df6a6[_0x577b8c(0x1f6)]:{},_0x5cb7a7=_0x30f7d6['apps']&&typeof _0x30f7d6[_0x577b8c(0x1f6)]===_0x577b8c(0x1db)?_0x30f7d6['apps']:{},_0x1cc78a={..._0x43a48c,..._0x5cb7a7},_0x61eb58={..._0x1df6a6,..._0x30f7d6};Object[_0x577b8c(0x21e)](_0x1cc78a)[_0x577b8c(0x216)]>0x0&&(_0x61eb58[_0x577b8c(0x1f6)]=_0x1cc78a);if(_0x577b8c(0x1ee)in _0x30f7d6)_0x61eb58['defaultApp']=_0x30f7d6['defaultApp'];else{if(_0x5cb7a7&&Object[_0x577b8c(0x21e)](_0x5cb7a7)[_0x577b8c(0x216)]>0x0)_0x61eb58['defaultApp']=Object[_0x577b8c(0x21e)](_0x5cb7a7)[0x0];else{if(_0x1df6a6[_0x577b8c(0x1ee)])_0x61eb58[_0x577b8c(0x1ee)]=_0x1df6a6['defaultApp'];else{const _0x353811=Object[_0x577b8c(0x21e)](_0x43a48c);_0x353811[_0x577b8c(0x216)]>0x0&&(_0x61eb58[_0x577b8c(0x1ee)]=_0x353811[0x0]);}}}return _0x61eb58;}export function readRawConfigWithLayers(_0x1e2126){const _0x463e00=loadRawConfigLayers(_0x1e2126);return{'config':mergeRawConfigLayers(_0x463e00),'layers':_0x463e00};}export function readRawConfig(_0x860115){return mergeRawConfigLayers(loadRawConfigLayers(_0x860115));}function a111_0x1239(){const _0x9398cb=['message','userDomain','45412rVtMqA','426300QdNdgs','project','join','parse','format','find','empty','11huddVo','inherit','entries','setRawCommand','2gTQdiP','write','authRequired','MAX_RISK','length','migrated','config','5ytWvBD','projectConfig','appcode','env','apiDomain','keys','get','apiDir','silent','runtimeDomain','set','values','cookie','FORMAT','warn','replace','PAGE_SIZE','cwd','831304Ynucmf','stringify','daily','./constant/env.js','app','object','127393PnNpqW','40OsujSh','Global','COOKIE','\x0a\x20\x20','slice','error','261675oRcOvu','2285790yCuUJX','argv','\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20','./auth/get-cookie.js','status','data','./constant/domain.js','utf8','907590QelWnY','missing','defaultApp','.lovrabetrc','maxRisk','.lovrabet.json','./utils/is-non-interactive.js','ACCESS_KEY','https://g.lovrabet.com/dist/lovrabet-skill','pageSize','apps','filter','riskLevel','merged','locale','trim','template_base_url','string','accessKey','production','.rabetbase.json','.tmp','setLogPath','true'];a111_0x1239=function(){return _0x9398cb;};return a111_0x1239();}export function getConfigAppCode(_0x143645){const _0x324a60=a111_0x235eeb,_0xe0a590=readRawConfig(_0x143645);if(_0xe0a590[_0x324a60(0x1f6)]&&typeof _0xe0a590['apps']===_0x324a60(0x1db)){const _0x174a9f=_0xe0a590[_0x324a60(0x1ee)];if(_0x174a9f&&_0xe0a590[_0x324a60(0x1f6)][_0x174a9f]?.[_0x324a60(0x21b)])return String(_0xe0a590[_0x324a60(0x1f6)][_0x174a9f][_0x324a60(0x21b)])[_0x324a60(0x1fb)]();const _0x237a99=Object[_0x324a60(0x224)](_0xe0a590[_0x324a60(0x1f6)])[0x0];if(_0x237a99?.[_0x324a60(0x21b)])return String(_0x237a99['appcode'])['trim']();}const _0x1136b6=_0xe0a590[_0x324a60(0x21b)]||_0xe0a590[_0x324a60(0x1da)];if(typeof _0x1136b6!==_0x324a60(0x1fd)||_0x1136b6[_0x324a60(0x1fb)]()==='')return undefined;return _0x1136b6[_0x324a60(0x1fb)]();}export function getMultiAppConfigs(_0x11bdf9=a111_0x235eeb(0x208),_0x53a78a){const _0x2b4037=a111_0x235eeb,_0x5009f1=_0x11bdf9===_0x2b4037(0x1f9)?readRawConfig(_0x53a78a):loadRawConfigLayers(_0x53a78a)[_0x2b4037(0x21a)],_0x33f0ab=_0x5009f1[_0x2b4037(0x1f6)];if(!_0x33f0ab||typeof _0x33f0ab!==_0x2b4037(0x1db)||Object['keys'](_0x33f0ab)[_0x2b4037(0x216)]===0x0)return null;const _0x15b9ea=_0x5009f1[_0x2b4037(0x1ee)];return Object[_0x2b4037(0x210)](_0x33f0ab)['map'](([_0x5939be,_0x489643])=>({'name':_0x5939be,'appcode':_0x489643?.['appcode']||'','isDefault':_0x5939be===_0x15b9ea,'env':_0x489643?.[_0x2b4037(0x21c)],'apiDir':_0x489643?.[_0x2b4037(0x220)],'cookie':_0x489643?.[_0x2b4037(0x225)]||undefined}))[_0x2b4037(0x1f7)](_0x735559=>_0x735559[_0x2b4037(0x21b)]);}export function getTemplateBaseUrl(_0x38dea7){const _0x4481f6=a111_0x235eeb,_0x16797b=readRawConfig(_0x38dea7);if(_0x16797b[_0x4481f6(0x1fc)]&&typeof _0x16797b[_0x4481f6(0x1fc)]===_0x4481f6(0x1fd))return _0x16797b['template_base_url'][_0x4481f6(0x228)](/\/$/,'');return _0x4481f6(0x1f4);}export function readConfigFile(_0x24184c){const _0x86cc64=a111_0x235eeb;return parseAndNormalizeConfig(_0x24184c,_0x86cc64(0x221));}export function writeConfigFile(_0x5c3d73,_0x5b106f){const _0x1b6122=a111_0x235eeb,_0x3db38d=dirname(_0x5c3d73);!existsSync(_0x3db38d)&&mkdirSync(_0x3db38d,{'recursive':!![]});const _0x1af416=_0x5c3d73+_0x1b6122(0x201);try{writeFileSync(_0x1af416,JSON['stringify'](_0x5b106f,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x1af416,_0x5c3d73);}catch(_0x9c6f8e){try{unlinkSync(_0x1af416);}catch{}throw _0x9c6f8e;}}export function resolveWriteConfigPath(_0x486dd6){const _0x5f0c81=_0x486dd6==='project'?process['cwd']():homedir(),_0x3588de=resolveConfigPath(_0x5f0c81);return _0x3588de??resolve(_0x5f0c81,NEW_CONFIG_NAME);}function buildConfig(_0x5e2cdb,_0x4f2785){const _0x5ed790=a111_0x235eeb,_0x2f6783={};if(_0x5e2cdb[_0x5ed790(0x1f6)]&&typeof _0x5e2cdb[_0x5ed790(0x1f6)]===_0x5ed790(0x1db))for(const [_0x1790cc,_0x48460c]of Object['entries'](_0x5e2cdb[_0x5ed790(0x1f6)])){_0x48460c&&typeof _0x48460c===_0x5ed790(0x1db)&&_0x48460c[_0x5ed790(0x21b)]&&(_0x2f6783[_0x1790cc]=_0x48460c);}const _0xf8c933=_0x5e2cdb['defaultApp']||undefined,_0x4ae88b=Object[_0x5ed790(0x21e)](_0x2f6783)[_0x5ed790(0x216)]>0x0,_0x2042bd=_0x4f2785[_0x5ed790(0x1da)]||env('APP')||undefined,_0x1a475a=_0x2042bd||_0xf8c933||undefined,_0x238eb0=_0x4f2785['appcode']||env('APPCODE')||undefined,_0x3a505b=_0x238eb0?Object[_0x5ed790(0x210)](_0x2f6783)[_0x5ed790(0x20c)](([,_0x4a62a6])=>_0x4a62a6?.[_0x5ed790(0x21b)]===_0x238eb0):undefined,_0x15e469=_0x3a505b?.[0x0],_0x1fe107=_0x3a505b?.[0x1];let _0x5d7283=_0x238eb0?_0x15e469:_0x1a475a,_0x331ad6=_0x5d7283&&_0x2f6783[_0x5d7283]?_0x2f6783[_0x5d7283]:undefined;_0x238eb0&&_0x1fe107&&(_0x331ad6=_0x1fe107);const _0x3918bb=_0x238eb0?_0x1fe107??_0x331ad6:_0x331ad6,_0x5f3709=_0x2042bd||(_0x238eb0?_0x15e469:undefined),_0x32c4a8=_0x238eb0||_0x3918bb?.['appcode']||undefined,_0x817d86=_0x4f2785[_0x5ed790(0x21c)]||env('ENV')||_0x3918bb?.[_0x5ed790(0x21c)]||_0x5e2cdb[_0x5ed790(0x21c)]||DEFAULT_CONFIG_VALUES[_0x5ed790(0x21c)],_0x45bd6a=_0x3918bb?.[_0x5ed790(0x1fa)]||_0x5e2cdb[_0x5ed790(0x1fa)]||DEFAULT_CONFIG_VALUES[_0x5ed790(0x1fa)],_0x78c8c1=env(_0x5ed790(0x1df))||_0x3918bb?.['cookie']||_0x5e2cdb[_0x5ed790(0x225)]||undefined,_0x4e7599=env(_0x5ed790(0x1f3))||_0x3918bb?.[_0x5ed790(0x1fe)]||_0x5e2cdb[_0x5ed790(0x1fe)]||undefined,_0x28e3d8=_0x4f2785[_0x5ed790(0x20b)]||env(_0x5ed790(0x226))||_0x3918bb?.[_0x5ed790(0x20b)]||_0x5e2cdb[_0x5ed790(0x20b)],_0x358c5f=normalizeLegacyOutputFormat(_0x28e3d8),_0x4e45d7=env(_0x5ed790(0x229))||_0x3918bb?.[_0x5ed790(0x1f5)]||_0x5e2cdb[_0x5ed790(0x1f5)],_0x116511=_0x4e45d7?Number(_0x4e45d7)||undefined:undefined,_0x519885=env('RISK_LEVEL')||env(_0x5ed790(0x215))||_0x3918bb?.[_0x5ed790(0x1f8)]||_0x5e2cdb[_0x5ed790(0x1f8)]||_0x5e2cdb[_0x5ed790(0x1f0)],_0x2d74fd=_0x519885==='read'||_0x519885===_0x5ed790(0x213)?_0x519885:DEFAULT_CONFIG_VALUES['riskLevel'],_0x2cc6e5=env('VERBOSE'),_0x73f289=_0x2cc6e5==='1'||_0x2cc6e5===_0x5ed790(0x203),_0x5229fd=_0x3918bb?.['apiDir']||_0x5e2cdb[_0x5ed790(0x220)]||DEFAULT_CONFIG_VALUES[_0x5ed790(0x220)],_0x45e9bb=isDaily(normalizeEnv(String(_0x817d86)))?_0x5ed790(0x1d8):_0x5ed790(0x1ff);return{'appCode':typeof _0x32c4a8===_0x5ed790(0x1fd)&&_0x32c4a8['trim']()?_0x32c4a8['trim']():undefined,'env':_0x45e9bb,'locale':_0x45bd6a,'cookie':_0x78c8c1,'accessKey':_0x4e7599,'format':_0x358c5f,'pageSize':_0x116511,'riskLevel':_0x2d74fd,'verbose':_0x73f289,'apiDir':_0x5229fd,'apps':_0x2f6783,'defaultApp':_0xf8c933,'currentApp':_0x4ae88b?_0x5d7283:undefined,'explicitAppName':_0x5f3709,'raw':_0x5e2cdb};}async function buildAuth(_0x338bce){const _0x5d3d88=a111_0x235eeb,{getCookie:_0x5cc2a0}=await import(_0x5d3d88(0x1e7)),_0x5af948=_0x338bce[_0x5d3d88(0x225)]||_0x5cc2a0(),_0x4dfde8=_0x5af948?await getIsSessionValid():![];return{'cookie':_0x5af948,'isLoggedIn':_0x4dfde8,async 'getOrLogin'(){const _0x2f1e7b=_0x5d3d88;if(_0x5af948&&_0x4dfde8)return _0x5af948;throw CliErrors[_0x2f1e7b(0x214)]();}};}export function resolveApiFilePath(_0x58d6a2,_0x572f71){const _0x3ca373=a111_0x235eeb,_0x4d41ca=resolve(process[_0x3ca373(0x22a)](),_0x58d6a2),_0x3ed823=resolve(_0x4d41ca,'api.ts');if(!_0x572f71)return _0x3ed823;const _0x107ba2=readRawConfig(),_0x36555a=_0x107ba2[_0x3ca373(0x1f6)]&&typeof _0x107ba2[_0x3ca373(0x1f6)]==='object'?_0x107ba2[_0x3ca373(0x1f6)]:{},_0x59594d=Object['entries'](_0x36555a)[_0x3ca373(0x20c)](([,_0x132ef0])=>_0x132ef0?.['appcode']===_0x572f71);if(!_0x59594d)return _0x3ed823;const [_0x3c518e,_0x372b55]=_0x59594d,_0x37b983=typeof _0x107ba2[_0x3ca373(0x1ee)]===_0x3ca373(0x1fd)?_0x107ba2[_0x3ca373(0x1ee)]:undefined;if(_0x372b55?.[_0x3ca373(0x220)])return _0x3ed823;if(_0x37b983&&_0x3c518e!==_0x37b983)return resolve(_0x4d41ca,_0x3c518e+'-api.ts');return _0x3ed823;}
|
|
1
|
+
const a111_0x293f0b=a111_0x368c;(function(_0x1724e8,_0x58235f){const _0x25f0cd=a111_0x368c,_0x50764d=_0x1724e8();while(!![]){try{const _0x1d4710=parseInt(_0x25f0cd(0x1c2))/0x1+-parseInt(_0x25f0cd(0x1c0))/0x2*(parseInt(_0x25f0cd(0x1ed))/0x3)+parseInt(_0x25f0cd(0x1dd))/0x4+parseInt(_0x25f0cd(0x1eb))/0x5+-parseInt(_0x25f0cd(0x1e1))/0x6+parseInt(_0x25f0cd(0x1ee))/0x7+parseInt(_0x25f0cd(0x1c1))/0x8;if(_0x1d4710===_0x58235f)break;else _0x50764d['push'](_0x50764d['shift']());}catch(_0x1b2e85){_0x50764d['push'](_0x50764d['shift']());}}}(a111_0x5ba1,0x6c616));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(_0x5da181){return process.env[`RABETBASE_${_0x5da181}`]||process.env[`LOVRABET_${_0x5da181}`]||undefined;}export const NEW_CONFIG_NAME=a111_0x293f0b(0x1b5);function a111_0x368c(_0x1e7ceb,_0x363eec){_0x1e7ceb=_0x1e7ceb-0x1ae;const _0x5ba194=a111_0x5ba1();let _0x368cab=_0x5ba194[_0x1e7ceb];return _0x368cab;}function a111_0x5ba1(){const _0x1875eb=['env','status','apps','silent','replace','ACCESS_KEY','authRequired','FORMAT','./constant/domain.js','message','COOKIE','config','defaultApp','length','argv','error','.rabetbase.json','slice','find','daily','.tmp','join','riskLevel','stringify','./constant/env.js','empty','production','472aoXipy','5589576ziNDlA','20160sKaajH','PAGE_SIZE','locale','runtimeDomain','keys','cwd','format','\x0a\x20\x20','parse','string','utf8','./utils/is-non-interactive.js','template_base_url','appcode','setRawCommand','data','app','trim','userDomain','get','Global','APPCODE','apiDir','ENV','MAX_RISK','inherit','project','2596292hxPLNU','object','true','warn','1406118CWxxFQ','setLogPath','accessKey','https://g.lovrabet.com/dist/lovrabet-skill','filter','map','./auth/get-cookie.js','pageSize','apiDomain','cookie','582115DDpgsz','entries','11169EDgvXL','507878TSBZnz','missing'];a111_0x5ba1=function(){return _0x1875eb;};return a111_0x5ba1();}export const CONFIG_NAMES=[a111_0x293f0b(0x1b5),'.lovrabet.json','.lovrabetrc'];export const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a111_0x293f0b(0x1e5)](_0x56da74=>_0x56da74!==NEW_CONFIG_NAME);export function resolveConfigPath(_0x1c3434){for(const _0x43960b of CONFIG_NAMES){const _0x1f4c29=resolve(_0x1c3434,_0x43960b);if(existsSync(_0x1f4c29))return _0x1f4c29;}return undefined;}export function findProjectRootDirectory(_0x49ef6c=process[a111_0x293f0b(0x1c7)]()){let _0x11622f=resolve(_0x49ef6c);const {root:_0x450f43}=parse(_0x11622f),_0x5061f0=homedir();while(!![]){if(resolveConfigPath(_0x11622f)){if(_0x11622f===_0x5061f0)break;return _0x11622f;}if(_0x11622f===_0x450f43||_0x11622f===_0x5061f0)break;const _0x1b73a3=dirname(_0x11622f);if(_0x1b73a3===_0x11622f)break;_0x11622f=_0x1b73a3;}return resolve(_0x49ef6c);}export async function createContext(_0x674830){const _0x51968b=a111_0x293f0b,_0x132264=readRawConfig(),_0x40cef3=buildConfig(_0x132264,_0x674830),{initEnv:_0x5e2081}=await import(_0x51968b(0x1bd));if(_0x40cef3['env'])_0x5e2081(_0x40cef3[_0x51968b(0x1f0)]);else _0x674830[_0x51968b(0x1f0)]&&typeof _0x674830[_0x51968b(0x1f0)]===_0x51968b(0x1cb)&&_0x5e2081(_0x674830[_0x51968b(0x1f0)]);const {initDomains:_0x5eb01d,getUserDomain:_0x322333,getApiDomain:_0x5d48bf}=await import(_0x51968b(0x1f8));_0x5eb01d({'apiDomain':_0x132264[_0x51968b(0x1e9)]||undefined,'userDomain':_0x132264[_0x51968b(0x1d4)]||undefined,'runtimeDomain':_0x132264[_0x51968b(0x1c5)]||undefined});const _0x85d5f={'apiDomain':_0x5d48bf(),'userDomain':_0x322333()},_0x2e7b21=await buildAuth(_0x40cef3);logger[_0x51968b(0x1e2)](process[_0x51968b(0x1c7)]());const _0x43e7fd=(CLI_BIN_NAME+'\x20'+process[_0x51968b(0x1b3)][_0x51968b(0x1b6)](0x2)[_0x51968b(0x1ba)]('\x20'))['trim']();logger[_0x51968b(0x1d0)](_0x43e7fd);const {isNonInteractive:_0x443f85}=await import(_0x51968b(0x1cd)),_0x5c80d7=_0x443f85(_0x674830);return{'config':_0x40cef3,'auth':_0x2e7b21,'logger':logger,'env':_0x85d5f,'nonInteractive':_0x5c80d7};}export function buildConfigFromFlags(_0x4443dc){return buildConfig(readRawConfig(),_0x4443dc);}export function getProjectConfigPath(){const _0x269794=a111_0x293f0b;return resolveConfigPath(process[_0x269794(0x1c7)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function inspectCliConfigJsonFile(_0x114b5e){const _0x5f4c72=a111_0x293f0b;if(!existsSync(_0x114b5e))return{'status':'missing'};try{const _0x496b67=readFileSync(_0x114b5e,{'encoding':'utf8'});if(!_0x496b67?.[_0x5f4c72(0x1d3)]())return{'status':_0x5f4c72(0x1be)};const _0x2544b2=JSON[_0x5f4c72(0x1ca)](_0x496b67);return{'status':'ok','data':_0x2544b2};}catch(_0x1b0db3){return{'status':_0x5f4c72(0x1b4),'message':_0x1b0db3 instanceof Error?_0x1b0db3['message']:String(_0x1b0db3)};}}function parseCliConfigJsonFile(_0x1017ae,_0xbe19b7,_0x424fdb){const _0x17d944=a111_0x293f0b,_0x3f904d=inspectCliConfigJsonFile(_0x1017ae);if(_0x3f904d['status']===_0x17d944(0x1ef)||_0x3f904d[_0x17d944(0x1f1)]===_0x17d944(0x1be))return{};if(_0x3f904d[_0x17d944(0x1f1)]==='ok')return _0x3f904d[_0x17d944(0x1d1)];return _0xbe19b7==='warn'&&_0x424fdb&&console['error'](CLI_BIN_NAME+':\x20'+_0x424fdb+'\x20config\x20file\x20ignored\x20(invalid\x20JSON\x20or\x20unreadable):\x20'+_0x1017ae+_0x17d944(0x1c9)+_0x3f904d[_0x17d944(0x1ae)]),{};}const normalizedWriteCache=new Map();function normalizeLegacyConfigShape(_0x472875){const _0x290a9e=a111_0x293f0b;if(!_0x472875||typeof _0x472875!==_0x290a9e(0x1de))return{'config':{},'migrated':![]};const _0x2263ab={..._0x472875},_0x5283a7=_0x2263ab[_0x290a9e(0x1f2)]&&typeof _0x2263ab[_0x290a9e(0x1f2)]===_0x290a9e(0x1de)?{..._0x2263ab[_0x290a9e(0x1f2)]}:{},_0x5739d1=Object[_0x290a9e(0x1c6)](_0x5283a7)[_0x290a9e(0x1b2)],_0x3b5ef7=_0x2263ab[_0x290a9e(0x1cf)]||_0x2263ab[_0x290a9e(0x1d2)];let _0x1776de=![];if(_0x3b5ef7&&_0x5739d1===0x0){const _0x8a9df7=typeof _0x2263ab[_0x290a9e(0x1b1)]===_0x290a9e(0x1cb)&&_0x2263ab['defaultApp'][_0x290a9e(0x1d3)]()?_0x2263ab['defaultApp']:String(_0x3b5ef7)[_0x290a9e(0x1d3)]();_0x5283a7[_0x8a9df7]={'appcode':String(_0x3b5ef7)[_0x290a9e(0x1d3)](),..._0x2263ab['env']!=null?{'env':_0x2263ab['env']}:{},..._0x2263ab['apiDir']!=null?{'apiDir':_0x2263ab[_0x290a9e(0x1d8)]}:{},..._0x2263ab[_0x290a9e(0x1ea)]!=null?{'cookie':_0x2263ab[_0x290a9e(0x1ea)]}:{},..._0x2263ab['accessKey']!=null?{'accessKey':_0x2263ab[_0x290a9e(0x1e3)]}:{},..._0x2263ab['format']!=null?{'format':_0x2263ab[_0x290a9e(0x1c8)]}:{},..._0x2263ab[_0x290a9e(0x1e8)]!=null?{'pageSize':_0x2263ab[_0x290a9e(0x1e8)]}:{},..._0x2263ab[_0x290a9e(0x1bb)]!=null?{'riskLevel':_0x2263ab[_0x290a9e(0x1bb)]}:{},..._0x2263ab['locale']!=null?{'locale':_0x2263ab[_0x290a9e(0x1c4)]}:{}},_0x2263ab[_0x290a9e(0x1f2)]=_0x5283a7;if(!_0x2263ab[_0x290a9e(0x1b1)])_0x2263ab[_0x290a9e(0x1b1)]=_0x8a9df7;_0x1776de=!![];}return(_0x290a9e(0x1cf)in _0x2263ab||_0x290a9e(0x1d2)in _0x2263ab)&&(delete _0x2263ab[_0x290a9e(0x1cf)],delete _0x2263ab[_0x290a9e(0x1d2)],_0x1776de=!![]),{'config':_0x2263ab,'migrated':_0x1776de};}function writeNormalizedConfigIfNeeded(_0x591865,_0x1e1202){const _0x415441=a111_0x293f0b,_0x53feed=JSON['stringify'](_0x1e1202,null,0x2)+'\x0a';if(normalizedWriteCache[_0x415441(0x1d5)](_0x591865)===_0x53feed)return;writeConfigFile(_0x591865,_0x1e1202),normalizedWriteCache['set'](_0x591865,_0x53feed);}function parseAndNormalizeConfig(_0x263f4b,_0x4be987,_0x5b0baa){const _0x358030=a111_0x293f0b,_0x23624d=parseCliConfigJsonFile(_0x263f4b,_0x4be987,_0x5b0baa),_0x37af29=normalizeLegacyConfigShape(_0x23624d);if(_0x37af29['migrated'])try{writeNormalizedConfigIfNeeded(_0x263f4b,_0x37af29[_0x358030(0x1b0)]);}catch{}return _0x37af29[_0x358030(0x1b0)];}export function loadRawConfigLayers(_0x3d3ca4){const _0x5b206d=a111_0x293f0b;let _0x18bbb4={},_0x2a63e3={};const _0x53ed22=resolveConfigPath(homedir());_0x53ed22&&(_0x18bbb4=parseAndNormalizeConfig(_0x53ed22,_0x5b206d(0x1e0),_0x5b206d(0x1d6)));const _0x5c940=_0x3d3ca4??findProjectRootDirectory(),_0x297ee8=resolveConfigPath(_0x5c940);return _0x297ee8&&(_0x2a63e3=parseAndNormalizeConfig(_0x297ee8,_0x5b206d(0x1e0),'Project')),{'globalPath':_0x53ed22,'projectPath':_0x297ee8,'globalConfig':_0x18bbb4,'projectConfig':_0x2a63e3};}function mergeRawConfigLayers(_0x56a4e3){const _0x1f9e03=a111_0x293f0b,{globalConfig:_0x1ddc17,projectConfig:_0x34cba7}=_0x56a4e3;if(_0x34cba7[_0x1f9e03(0x1db)]===![]){const _0x4df2fc={..._0x34cba7};delete _0x4df2fc[_0x1f9e03(0x1db)];const _0x56a01e=_0x34cba7[_0x1f9e03(0x1f2)]&&typeof _0x34cba7['apps']===_0x1f9e03(0x1de)?_0x34cba7[_0x1f9e03(0x1f2)]:{};Object[_0x1f9e03(0x1c6)](_0x56a01e)[_0x1f9e03(0x1b2)]>0x0?_0x4df2fc[_0x1f9e03(0x1f2)]=_0x56a01e:delete _0x4df2fc['apps'];if('defaultApp'in _0x34cba7)_0x4df2fc[_0x1f9e03(0x1b1)]=_0x34cba7[_0x1f9e03(0x1b1)];else Object['keys'](_0x56a01e)[_0x1f9e03(0x1b2)]>0x0&&(_0x4df2fc[_0x1f9e03(0x1b1)]=Object[_0x1f9e03(0x1c6)](_0x56a01e)[0x0]);return _0x4df2fc;}const _0xe2ed90=_0x1ddc17[_0x1f9e03(0x1f2)]&&typeof _0x1ddc17[_0x1f9e03(0x1f2)]===_0x1f9e03(0x1de)?_0x1ddc17[_0x1f9e03(0x1f2)]:{},_0x5339d9=_0x34cba7[_0x1f9e03(0x1f2)]&&typeof _0x34cba7[_0x1f9e03(0x1f2)]===_0x1f9e03(0x1de)?_0x34cba7[_0x1f9e03(0x1f2)]:{},_0x31f770={..._0xe2ed90,..._0x5339d9},_0x10a21d={..._0x1ddc17,..._0x34cba7};Object[_0x1f9e03(0x1c6)](_0x31f770)[_0x1f9e03(0x1b2)]>0x0&&(_0x10a21d[_0x1f9e03(0x1f2)]=_0x31f770);if(_0x1f9e03(0x1b1)in _0x34cba7)_0x10a21d['defaultApp']=_0x34cba7['defaultApp'];else{if(_0x5339d9&&Object[_0x1f9e03(0x1c6)](_0x5339d9)[_0x1f9e03(0x1b2)]>0x0)_0x10a21d['defaultApp']=Object[_0x1f9e03(0x1c6)](_0x5339d9)[0x0];else{if(_0x1ddc17[_0x1f9e03(0x1b1)])_0x10a21d['defaultApp']=_0x1ddc17['defaultApp'];else{const _0x102e13=Object[_0x1f9e03(0x1c6)](_0xe2ed90);_0x102e13[_0x1f9e03(0x1b2)]>0x0&&(_0x10a21d[_0x1f9e03(0x1b1)]=_0x102e13[0x0]);}}}return _0x10a21d;}export function readRawConfigWithLayers(_0x461545){const _0x5a3989=loadRawConfigLayers(_0x461545);return{'config':mergeRawConfigLayers(_0x5a3989),'layers':_0x5a3989};}export function readRawConfig(_0x52b2a1){return mergeRawConfigLayers(loadRawConfigLayers(_0x52b2a1));}export function getConfigAppCode(_0x123fdc){const _0x519abc=a111_0x293f0b,_0x408e73=readRawConfig(_0x123fdc);if(_0x408e73['apps']&&typeof _0x408e73[_0x519abc(0x1f2)]===_0x519abc(0x1de)){const _0x4efc55=_0x408e73[_0x519abc(0x1b1)];if(_0x4efc55&&_0x408e73[_0x519abc(0x1f2)][_0x4efc55]?.[_0x519abc(0x1cf)])return String(_0x408e73['apps'][_0x4efc55][_0x519abc(0x1cf)])[_0x519abc(0x1d3)]();const _0x644efa=Object['values'](_0x408e73[_0x519abc(0x1f2)])[0x0];if(_0x644efa?.['appcode'])return String(_0x644efa[_0x519abc(0x1cf)])['trim']();}const _0x245a37=_0x408e73[_0x519abc(0x1cf)]||_0x408e73[_0x519abc(0x1d2)];if(typeof _0x245a37!==_0x519abc(0x1cb)||_0x245a37[_0x519abc(0x1d3)]()==='')return undefined;return _0x245a37['trim']();}export function getMultiAppConfigs(_0x43ba5b=a111_0x293f0b(0x1dc),_0x495305){const _0x287087=a111_0x293f0b,_0x3eb6c1=_0x43ba5b==='merged'?readRawConfig(_0x495305):loadRawConfigLayers(_0x495305)['projectConfig'],_0x6ddfd8=_0x3eb6c1[_0x287087(0x1f2)];if(!_0x6ddfd8||typeof _0x6ddfd8!==_0x287087(0x1de)||Object[_0x287087(0x1c6)](_0x6ddfd8)[_0x287087(0x1b2)]===0x0)return null;const _0xc5e47e=_0x3eb6c1[_0x287087(0x1b1)];return Object['entries'](_0x6ddfd8)[_0x287087(0x1e6)](([_0x53be5c,_0x3afc00])=>({'name':_0x53be5c,'appcode':_0x3afc00?.[_0x287087(0x1cf)]||'','isDefault':_0x53be5c===_0xc5e47e,'env':_0x3afc00?.[_0x287087(0x1f0)],'apiDir':_0x3afc00?.[_0x287087(0x1d8)],'cookie':_0x3afc00?.[_0x287087(0x1ea)]||undefined}))[_0x287087(0x1e5)](_0x56f14e=>_0x56f14e[_0x287087(0x1cf)]);}export function getTemplateBaseUrl(_0x2513fb){const _0x430a90=a111_0x293f0b,_0x31907d=readRawConfig(_0x2513fb);if(_0x31907d[_0x430a90(0x1ce)]&&typeof _0x31907d[_0x430a90(0x1ce)]===_0x430a90(0x1cb))return _0x31907d[_0x430a90(0x1ce)][_0x430a90(0x1f4)](/\/$/,'');return _0x430a90(0x1e4);}export function readConfigFile(_0x254865){const _0x7f0865=a111_0x293f0b;return parseAndNormalizeConfig(_0x254865,_0x7f0865(0x1f3));}export function writeConfigFile(_0x42c3c8,_0x398731){const _0xffea65=a111_0x293f0b,_0x547f2c=dirname(_0x42c3c8);!existsSync(_0x547f2c)&&mkdirSync(_0x547f2c,{'recursive':!![]});const _0xb6e8cf=_0x42c3c8+_0xffea65(0x1b9);try{writeFileSync(_0xb6e8cf,JSON[_0xffea65(0x1bc)](_0x398731,null,0x2)+'\x0a',{'encoding':_0xffea65(0x1cc),'mode':0x180}),renameSync(_0xb6e8cf,_0x42c3c8);}catch(_0x36cd81){try{unlinkSync(_0xb6e8cf);}catch{}throw _0x36cd81;}}export function resolveWriteConfigPath(_0x112d3d){const _0x599d66=a111_0x293f0b,_0x5a4aa8=_0x112d3d===_0x599d66(0x1dc)?process[_0x599d66(0x1c7)]():homedir(),_0xbac9c6=resolveConfigPath(_0x5a4aa8);return _0xbac9c6??resolve(_0x5a4aa8,NEW_CONFIG_NAME);}function buildConfig(_0x4f8d5e,_0x369ac2){const _0x160621=a111_0x293f0b,_0x59c13a={};if(_0x4f8d5e['apps']&&typeof _0x4f8d5e[_0x160621(0x1f2)]===_0x160621(0x1de))for(const [_0x36697f,_0xff6ed1]of Object[_0x160621(0x1ec)](_0x4f8d5e[_0x160621(0x1f2)])){_0xff6ed1&&typeof _0xff6ed1===_0x160621(0x1de)&&_0xff6ed1['appcode']&&(_0x59c13a[_0x36697f]=_0xff6ed1);}const _0x1d45ec=_0x4f8d5e[_0x160621(0x1b1)]||undefined,_0x9c4e26=Object[_0x160621(0x1c6)](_0x59c13a)[_0x160621(0x1b2)]>0x0,_0x5ae2d7=_0x369ac2[_0x160621(0x1d2)]||env('APP')||undefined,_0xe6e9b2=_0x5ae2d7||_0x1d45ec||undefined,_0x4b6654=_0x369ac2[_0x160621(0x1cf)]||env(_0x160621(0x1d7))||undefined,_0x284bcb=_0x4b6654?Object[_0x160621(0x1ec)](_0x59c13a)[_0x160621(0x1b7)](([,_0x4b4a5e])=>_0x4b4a5e?.[_0x160621(0x1cf)]===_0x4b6654):undefined,_0x413f93=_0x284bcb?.[0x0],_0x2db8ec=_0x284bcb?.[0x1];let _0x486649=_0x4b6654?_0x413f93:_0xe6e9b2,_0x1c31a7=_0x486649&&_0x59c13a[_0x486649]?_0x59c13a[_0x486649]:undefined;_0x4b6654&&_0x2db8ec&&(_0x1c31a7=_0x2db8ec);const _0x20435d=_0x4b6654?_0x2db8ec??_0x1c31a7:_0x1c31a7,_0xbf1748=_0x5ae2d7||(_0x4b6654?_0x413f93:undefined),_0x427ab7=_0x4b6654||_0x20435d?.[_0x160621(0x1cf)]||undefined,_0xe43280=_0x369ac2[_0x160621(0x1f0)]||env(_0x160621(0x1d9))||_0x20435d?.[_0x160621(0x1f0)]||_0x4f8d5e[_0x160621(0x1f0)]||DEFAULT_CONFIG_VALUES[_0x160621(0x1f0)],_0x535e6d=_0x20435d?.['locale']||_0x4f8d5e[_0x160621(0x1c4)]||DEFAULT_CONFIG_VALUES['locale'],_0x260e3b=env(_0x160621(0x1af))||_0x20435d?.[_0x160621(0x1ea)]||_0x4f8d5e[_0x160621(0x1ea)]||undefined,_0xa8fabe=env(_0x160621(0x1f5))||_0x20435d?.[_0x160621(0x1e3)]||_0x4f8d5e[_0x160621(0x1e3)]||undefined,_0x2869d6=_0x369ac2[_0x160621(0x1c8)]||env(_0x160621(0x1f7))||_0x20435d?.['format']||_0x4f8d5e[_0x160621(0x1c8)],_0xc76add=normalizeLegacyOutputFormat(_0x2869d6),_0x3eeba3=env(_0x160621(0x1c3))||_0x20435d?.[_0x160621(0x1e8)]||_0x4f8d5e[_0x160621(0x1e8)],_0x38b89f=_0x3eeba3?Number(_0x3eeba3)||undefined:undefined,_0x28c838=env('RISK_LEVEL')||env(_0x160621(0x1da))||_0x20435d?.[_0x160621(0x1bb)]||_0x4f8d5e[_0x160621(0x1bb)]||_0x4f8d5e['maxRisk'],_0x5e940e=_0x28c838==='read'||_0x28c838==='write'?_0x28c838:DEFAULT_CONFIG_VALUES['riskLevel'],_0x3bf6df=env('VERBOSE'),_0x21254e=_0x3bf6df==='1'||_0x3bf6df===_0x160621(0x1df),_0x29e14b=_0x20435d?.['apiDir']||_0x4f8d5e['apiDir']||DEFAULT_CONFIG_VALUES[_0x160621(0x1d8)],_0x26718c=isDaily(normalizeEnv(String(_0xe43280)))?_0x160621(0x1b8):_0x160621(0x1bf);return{'appCode':typeof _0x427ab7===_0x160621(0x1cb)&&_0x427ab7[_0x160621(0x1d3)]()?_0x427ab7[_0x160621(0x1d3)]():undefined,'env':_0x26718c,'locale':_0x535e6d,'cookie':_0x260e3b,'accessKey':_0xa8fabe,'format':_0xc76add,'pageSize':_0x38b89f,'riskLevel':_0x5e940e,'verbose':_0x21254e,'apiDir':_0x29e14b,'apps':_0x59c13a,'defaultApp':_0x1d45ec,'currentApp':_0x9c4e26?_0x486649:undefined,'explicitAppName':_0xbf1748,'raw':_0x4f8d5e};}async function buildAuth(_0x224849){const _0x21ca89=a111_0x293f0b,{getCookie:_0x11a2cd}=await import(_0x21ca89(0x1e7)),_0x1f8dfc=_0x224849[_0x21ca89(0x1ea)]||_0x11a2cd(),_0x132e82=_0x1f8dfc?await getIsSessionValid():![];return{'cookie':_0x1f8dfc,'isLoggedIn':_0x132e82,async 'getOrLogin'(){const _0x30a32f=_0x21ca89;if(_0x1f8dfc&&_0x132e82)return _0x1f8dfc;throw CliErrors[_0x30a32f(0x1f6)]();}};}export function resolveApiFilePath(_0x169431,_0xfdacb3){const _0x5b9b3c=a111_0x293f0b,_0x248376=resolve(process['cwd'](),_0x169431),_0x2f798a=resolve(_0x248376,'api.ts');if(!_0xfdacb3)return _0x2f798a;const _0x2637d5=readRawConfig(),_0x2c0031=_0x2637d5[_0x5b9b3c(0x1f2)]&&typeof _0x2637d5[_0x5b9b3c(0x1f2)]===_0x5b9b3c(0x1de)?_0x2637d5[_0x5b9b3c(0x1f2)]:{},_0x2915a3=Object['entries'](_0x2c0031)[_0x5b9b3c(0x1b7)](([,_0x2cd51f])=>_0x2cd51f?.['appcode']===_0xfdacb3);if(!_0x2915a3)return _0x2f798a;const [_0x346e2d,_0x5ca62f]=_0x2915a3,_0x581630=typeof _0x2637d5[_0x5b9b3c(0x1b1)]===_0x5b9b3c(0x1cb)?_0x2637d5[_0x5b9b3c(0x1b1)]:undefined;if(_0x5ca62f?.[_0x5b9b3c(0x1d8)])return _0x2f798a;if(_0x581630&&_0x346e2d!==_0x581630)return resolve(_0x248376,_0x346e2d+'-api.ts');return _0x2f798a;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x345e6f,_0x384c43){const _0x849639=a112_0x3c2e,_0x1a8c0c=_0x345e6f();while(!![]){try{const _0x28d815=-parseInt(_0x849639(0x122))/0x1*(-parseInt(_0x849639(0x12b))/0x2)+-parseInt(_0x849639(0x126))/0x3*(-parseInt(_0x849639(0x12a))/0x4)+-parseInt(_0x849639(0x124))/0x5+-parseInt(_0x849639(0x120))/0x6*(parseInt(_0x849639(0x123))/0x7)+-parseInt(_0x849639(0x125))/0x8+parseInt(_0x849639(0x128))/0x9*(-parseInt(_0x849639(0x12f))/0xa)+parseInt(_0x849639(0x12c))/0xb*(parseInt(_0x849639(0x127))/0xc);if(_0x28d815===_0x384c43)break;else _0x1a8c0c['push'](_0x1a8c0c['shift']());}catch(_0x49b5c5){_0x1a8c0c['push'](_0x1a8c0c['shift']());}}}(a112_0xdf9c,0xad157));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a112_0x3c2e(_0x212547,_0x12212e){_0x212547=_0x212547-0x11f;const _0xdf9c5=a112_0xdf9c();let _0x3c2e2c=_0xdf9c5[_0x212547];return _0x3c2e2c;}function parseApiFile(_0x54a083){const _0x49c51b=a112_0x3c2e,_0x35e465=[],_0x55aa56=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x14e11b;while((_0x14e11b=_0x55aa56[_0x49c51b(0x129)](_0x54a083))!==null){_0x35e465[_0x49c51b(0x130)]({'datasetCode':_0x14e11b[0x1],'tableName':_0x14e11b[0x2],'name':_0x14e11b[0x3],'alias':_0x14e11b[0x4]});}return _0x35e465;}function a112_0xdf9c(){const _0x21478c=['7olrytG','3987920anTKto','27576JftQHV','478041ypACmD','25857804Ejdsuh','221949AdOAfk','exec','12wgWiSP','815186tBbYej','11YjYunm','has','alias','360yQsADv','push','set','3856038yFOkIi','datasetCode','1UIetmp'];a112_0xdf9c=function(){return _0x21478c;};return a112_0xdf9c();}export function loadAliasMap(_0x535a02,_0x2f146e,_0xa336a5){const _0x57c9b1=a112_0x3c2e,_0x1bffe9=_0xa336a5??resolve(process['cwd'](),_0x535a02,'api.ts');if(cache[_0x57c9b1(0x12d)](_0x1bffe9))return cache['get'](_0x1bffe9);if(!existsSync(_0x1bffe9))return cache[_0x57c9b1(0x11f)](_0x1bffe9,[]),[];try{const _0x3b66a6=readFileSync(_0x1bffe9,'utf-8'),_0x3d0713=parseApiFile(_0x3b66a6);return cache['set'](_0x1bffe9,_0x3d0713),_0x3d0713;}catch{return cache[_0x57c9b1(0x11f)](_0x1bffe9,[]),[];}}export function resolveAlias(_0x333ff5,_0x421d46,_0xcc0a5f,_0x9fb085){const _0x64b2e3=a112_0x3c2e;if(!_0x421d46)return undefined;const _0x4816bc=loadAliasMap(_0x333ff5,_0xcc0a5f,_0x9fb085),_0x513af3=_0x4816bc['find'](_0x2f71ec=>_0x2f71ec[_0x64b2e3(0x12e)]===_0x421d46);return _0x513af3?.[_0x64b2e3(0x121)];}export function listAliases(_0x1ab8ca,_0x2d3a51,_0x5262bc){return loadAliasMap(_0x1ab8ca,_0x2d3a51,_0x5262bc);}
|