@lovrabet/rabetbase-cli 2.0.7 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -0
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/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 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -0
- 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 -0
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/package.json +7 -4
package/lib/api/api-doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a0_0x455106=a0_0x5685;(function(_0x4b5744,_0x2b5411){const _0x3d33f4=a0_0x5685,_0x2e8910=_0x4b5744();while(!![]){try{const _0x1b93df=parseInt(_0x3d33f4(0xb6))/0x1*(parseInt(_0x3d33f4(0xb7))/0x2)+parseInt(_0x3d33f4(0xb8))/0x3*(-parseInt(_0x3d33f4(0xc2))/0x4)+parseInt(_0x3d33f4(0xd3))/0x5*(parseInt(_0x3d33f4(0xcd))/0x6)+parseInt(_0x3d33f4(0xbd))/0x7*(parseInt(_0x3d33f4(0xbf))/0x8)+parseInt(_0x3d33f4(0xcb))/0x9*(-parseInt(_0x3d33f4(0xba))/0xa)+parseInt(_0x3d33f4(0xc9))/0xb*(parseInt(_0x3d33f4(0xbe))/0xc)+parseInt(_0x3d33f4(0xc5))/0xd;if(_0x1b93df===_0x2b5411)break;else _0x2e8910['push'](_0x2e8910['shift']());}catch(_0x1bd084){_0x2e8910['push'](_0x2e8910['shift']());}}}(a0_0x55bb,0x9e39a));function a0_0x55bb(){const _0x6736a5=['push','datasetCode','生成文档成功:\x20','error','.md','2333aoddTN','42xphSGz','47532pjkthj','\x20datasets\x20to\x20generate\x20docs\x20for\x0a','10372400EHSjbR','):\x20missing\x20data.markdown\x20field','./docs','4235MgHNvJ','2940eutmUG','1552reNrbu','tableName','string','20EpeAOO','log','api-doc','10026679OSZbeb','markdown','success','Waiting\x203\x20seconds...\x0a','21769FPUUOm','name','9skrRvv','✓\x20Generated:\x20','2052294TORueq','POST','length','✗\x20Failed:\x20','.md\x20(','生成文档失败:\x20','5JiPcuo'];a0_0x55bb=function(){return _0x6736a5;};return a0_0x55bb();}import{mkdirSync,writeFileSync}from'node:fs';import a0_0x3bd074 from'node:path';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{platformFetch}from'../core/api-client.js';function a0_0x5685(_0x335718,_0x2a7638){_0x335718=_0x335718-0xb5;const _0x55bb83=a0_0x55bb();let _0x568549=_0x55bb83[_0x335718];return _0x568549;}export async function fetchDatasetDoc(_0x154c54){const _0x174f70=a0_0x5685,{appCode:_0x238585,cookie:_0x1477e0,datasetCode:_0x3d1e4d,datasetId:_0x14169a,extraParams:_0x97496d}=_0x154c54,_0x41fc97=getApiDomain()+'/api/node-toolbox/api-doc-generator',_0x134d26=await platformFetch(_0x41fc97,{'method':_0x174f70(0xce),'body':{'appCode':_0x238585,'datasetCode':_0x3d1e4d,'datasetId':_0x14169a,..._0x97496d||{}},'cookie':_0x1477e0,'label':'Fetch\x20doc\x20('+_0x3d1e4d+')'});if(!_0x134d26||typeof _0x134d26[_0x174f70(0xc6)]!==_0x174f70(0xc1))throw new Error('Invalid\x20response\x20format\x20('+_0x3d1e4d+_0x174f70(0xbb));return _0x134d26[_0x174f70(0xc6)];}function delay(_0x2c2b8e){return new Promise(_0x6f337b=>setTimeout(_0x6f337b,_0x2c2b8e));}export async function generateDatasetDocs(_0x305839,_0xf5c593,_0x22a286,_0x268d73=a0_0x455106(0xbc),_0x2f48e3,_0x3f5e03){const _0x1d4c32=a0_0x455106;mkdirSync(_0x268d73,{'recursive':!![]});const _0xe651b6=[],_0x5474a4=_0x305839[_0x1d4c32(0xcf)];console[_0x1d4c32(0xc3)]('\x0a'+_0x5474a4+_0x1d4c32(0xb9));for(let _0x402079=0x0;_0x402079<_0x305839[_0x1d4c32(0xcf)];_0x402079++){const _0x28b2a0=_0x305839[_0x402079],_0x5d4171=_0x402079+0x1,_0x49bcb6=_0x28b2a0[_0x1d4c32(0xc0)];try{console[_0x1d4c32(0xc3)]('['+_0x5d4171+'/'+_0x5474a4+']\x20Generating:\x20'+_0x49bcb6+_0x1d4c32(0xd1)+_0x28b2a0[_0x1d4c32(0xca)]+')');if(_0x2f48e3)_0x2f48e3(_0x5d4171,_0x5474a4,_0x49bcb6);const _0x2cbd69=await fetchDatasetDoc({'appCode':_0xf5c593,'cookie':_0x22a286,'datasetCode':_0x28b2a0['datasetCode'],'datasetId':_0x28b2a0['id'],'enableAI':![],'extraParams':_0x3f5e03}),_0x35ff31=a0_0x3bd074['join'](_0x268d73,_0x49bcb6+_0x1d4c32(0xb5));writeFileSync(_0x35ff31,_0x2cbd69,{'encoding':'utf8'}),console[_0x1d4c32(0xc3)](_0x1d4c32(0xcc)+_0x49bcb6+'.md'),logger[_0x1d4c32(0xc7)](_0x1d4c32(0xc4),_0x1d4c32(0xd6)+_0x49bcb6,undefined,{'datasetCode':_0x28b2a0['datasetCode'],'datasetName':_0x28b2a0[_0x1d4c32(0xca)],'filePath':_0x35ff31,'progress':_0x5d4171+'/'+_0x5474a4}),_0xe651b6[_0x1d4c32(0xd4)]({'datasetCode':_0x28b2a0[_0x1d4c32(0xd5)],'datasetName':_0x28b2a0[_0x1d4c32(0xca)],'filePath':_0x35ff31,'success':!![]});if(_0x5d4171<_0x5474a4)await delay(0x1388);}catch(_0x15a6de){const _0x31c779=_0x15a6de instanceof Error?_0x15a6de['message']:String(_0x15a6de);console['log'](_0x1d4c32(0xd0)+_0x49bcb6+'.md\x20-\x20'+_0x31c779),logger[_0x1d4c32(0xd7)](_0x1d4c32(0xc4),_0x1d4c32(0xd2)+_0x28b2a0[_0x1d4c32(0xd5)],{'datasetCode':_0x28b2a0[_0x1d4c32(0xd5)],'datasetName':_0x28b2a0[_0x1d4c32(0xca)],'error':_0x31c779,'progress':_0x5d4171+'/'+_0x5474a4}),_0xe651b6[_0x1d4c32(0xd4)]({'datasetCode':_0x28b2a0[_0x1d4c32(0xd5)],'datasetName':_0x28b2a0[_0x1d4c32(0xca)],'filePath':'','success':![],'error':_0x31c779}),_0x5d4171<_0x5474a4&&(console[_0x1d4c32(0xc3)](_0x1d4c32(0xc8)),await delay(0xbb8));}}return _0xe651b6;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12aa0a,_0x4b4fbf){const _0x1c3783=a1_0x1160,_0x64c308=_0x12aa0a();while(!![]){try{const _0x2b258e=parseInt(_0x1c3783(0x153))/0x1*(parseInt(_0x1c3783(0x159))/0x2)+parseInt(_0x1c3783(0x157))/0x3*(parseInt(_0x1c3783(0x14f))/0x4)+-parseInt(_0x1c3783(0x154))/0x5+parseInt(_0x1c3783(0x155))/0x6+-parseInt(_0x1c3783(0x156))/0x7+-parseInt(_0x1c3783(0x150))/0x8*(parseInt(_0x1c3783(0x14d))/0x9)+-parseInt(_0x1c3783(0x14a))/0xa*(-parseInt(_0x1c3783(0x152))/0xb);if(_0x2b258e===_0x4b4fbf)break;else _0x64c308['push'](_0x64c308['shift']());}catch(_0x1ab738){_0x64c308['push'](_0x64c308['shift']());}}}(a1_0x4db8,0xb595e));function a1_0x4db8(){const _0x5b2ba8=['1034539UkgCyx','3Yrpidu','7032880CtYQyu','7229412fEoExn','9625238ODYBOu','3lXbati','configArray','673468icNrsx','length','map','fetch-model-list','120XfvHRL','replace','Fetch\x20datasets','2757717BjlKsx','name','3178072qyEVBx','16kVsYJk','trim'];a1_0x4db8=function(){return _0x5b2ba8;};return a1_0x4db8();}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';import{platformFetch}from'../core/api-client.js';function cleanNewlines(_0x1208c5){const _0x1fe1e5=a1_0x1160;return _0x1208c5[_0x1fe1e5(0x14b)](/[\r\n]+/g,'\x20')[_0x1fe1e5(0x151)]();}function a1_0x1160(_0x1d3c5a,_0x3c4e5a){_0x1d3c5a=_0x1d3c5a-0x14a;const _0x4db8b8=a1_0x4db8();let _0x1160ec=_0x4db8b8[_0x1d3c5a];return _0x1160ec;}function cleanDatasetName(_0x1b8a41){const _0x28eec4=a1_0x1160;if(!_0x1b8a41['name'])return _0x1b8a41;return{..._0x1b8a41,'name':cleanNewlines(_0x1b8a41[_0x28eec4(0x14e)])};}export async function fetchModelList(_0x2ae8b1,_0x3e3494){const _0x1c354f=a1_0x1160,_0x1b50dd=getEnv(),_0x2fba2f=getApiDomain()+'/api/node-toolbox/dataset/model-list?appcode='+_0x2ae8b1+'&otype=array';logger['info'](_0x1c354f(0x15c),'正在从服务器拉取模型列表...\x20(环境:\x20'+_0x1b50dd+')',{'apiUrl':_0x2fba2f});const _0x636ffd=await platformFetch(_0x2fba2f,{'cookie':_0x3e3494,'label':_0x1c354f(0x14c)}),_0x55ae37=(_0x636ffd[_0x1c354f(0x158)]??[])[_0x1c354f(0x15b)](cleanDatasetName);return{'configArray':_0x55ae37,'count':_0x55ae37[_0x1c354f(0x15a)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a3dea,_0x39c64c){const _0x2b9784=a2_0x4e75,_0x2df3d7=_0x2a3dea();while(!![]){try{const _0x3e3030=parseInt(_0x2b9784(0x137))/0x1*(-parseInt(_0x2b9784(0x13c))/0x2)+parseInt(_0x2b9784(0x12b))/0x3*(parseInt(_0x2b9784(0x131))/0x4)+-parseInt(_0x2b9784(0x145))/0x5*(-parseInt(_0x2b9784(0x130))/0x6)+-parseInt(_0x2b9784(0x14b))/0x7+-parseInt(_0x2b9784(0x140))/0x8*(-parseInt(_0x2b9784(0x148))/0x9)+parseInt(_0x2b9784(0x143))/0xa*(parseInt(_0x2b9784(0x153))/0xb)+parseInt(_0x2b9784(0x147))/0xc*(-parseInt(_0x2b9784(0x12e))/0xd);if(_0x3e3030===_0x39c64c)break;else _0x2df3d7['push'](_0x2df3d7['shift']());}catch(_0x49e3a4){_0x2df3d7['push'](_0x2df3d7['shift']());}}}(a2_0x50b9,0x664ff));import a2_0x2cd157 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a2_0x432796 from'node:path';import{fileURLToPath}from'node:url';import{TemplateReplacer}from'../utils/template-replacer.js';function a2_0x4e75(_0x4f18b8,_0xd8223c){_0x4f18b8=_0x4f18b8-0x126;const _0x50b976=a2_0x50b9();let _0x4e756b=_0x50b976[_0x4f18b8];return _0x4e756b;}import{CLI_BIN_NAME}from'../constant/cli.js';function a2_0x50b9(){const _0x79ab39=['-client','6IspCNO','Please\x20configure\x20app\x20code\x20first\x20via\x20`','utf8','replace','18896alyYvQ','client','name','10tuirKE','join','53505IFNdkN','client.ts.tpl','996300sXjPOl','1557YOcMDF','datasetCode','test','1061697WdcCdu','{\x20apiConfigName:\x20\x22','api','{\x20apiConfigName:\x20','CONFIG_NAMES.DEFAULT','typescript','init-api','format','6713300FUAyWv','\x20config\x20set\x20app\x20<value>`','push',',\x20env:\x20\x22','.ts','production','49137txjERB','../..','forEach','65pcvquL','-api','198dugUXj','68JhcgyA','resolve','api.ts.tpl','toUpperCase','LOVRABET','length','221545HjgnIh','replaceApiContent','tableName','success'];a2_0x50b9=function(){return _0x79ab39;};return a2_0x50b9();}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x2edfc5,_0x274a7a,_0x1cd49b,_0xa9e99c,_0x2b158,_0x34b230,_0x595042){const _0x5d3818=a2_0x4e75;if(!_0x1cd49b)throw new Error(_0x5d3818(0x13d)+CLI_BIN_NAME+_0x5d3818(0x126));const _0x4b6cf4=_0xa9e99c&&!_0x595042,_0x84abb3=_0x595042||_0x1cd49b,_0x24bdef=_0x4b6cf4?_0x5d3818(0x14f):'\x22'+_0x84abb3+'\x22',_0x3ffc34=_0x2b158!==_0x5d3818(0x12a);let _0x897cc3;if(_0x4b6cf4)_0x3ffc34?_0x897cc3=_0x5d3818(0x14e)+_0x24bdef+_0x5d3818(0x128)+_0x2b158+'\x22\x20}':_0x897cc3='';else{const _0x34edc3=_0x3ffc34?_0x5d3818(0x128)+_0x2b158+'\x22':'';_0x897cc3=_0x5d3818(0x14c)+_0x84abb3+'\x22'+_0x34edc3+'\x20}';}const _0x2b54fb=_0x274a7a?_0x274a7a+_0x5d3818(0x12f):_0x5d3818(0x14d),_0x18c6ad=_0x274a7a?_0x274a7a+_0x5d3818(0x13b):_0x5d3818(0x141),_0x4c5ee3=_0x274a7a&&!/^app-[a-f0-9]+$/i[_0x5d3818(0x14a)](_0x274a7a)?_0x274a7a[_0x5d3818(0x13f)](/-/g,'_')[_0x5d3818(0x134)]():_0x5d3818(0x135),_0x2a07d6=[];_0x2edfc5[_0x5d3818(0x12d)](_0xc2a0fd=>{const _0x375451=_0x5d3818;_0x2a07d6[_0x375451(0x127)]({'datasetCode':_0xc2a0fd[_0x375451(0x149)],'tableName':_0xc2a0fd[_0x375451(0x139)],'name':_0xc2a0fd[_0x375451(0x142)]||'','alias':_0xc2a0fd['alias']||_0xc2a0fd['key']});});const _0x6d9a6=fileURLToPath(import.meta.url),_0x53cef7=a2_0x432796[_0x5d3818(0x132)](a2_0x432796['dirname'](_0x6d9a6),_0x5d3818(0x12c)),_0x5c2193=a2_0x432796[_0x5d3818(0x144)](_0x53cef7,'templates/generate-api'),_0x295f86=a2_0x432796[_0x5d3818(0x144)](_0x5c2193,_0x5d3818(0x133)),_0x44dd3b=a2_0x432796[_0x5d3818(0x144)](_0x5c2193,_0x5d3818(0x146)),_0x55888a=_0x34b230;mkdirSync(_0x55888a,{'recursive':!![]});const _0x608de0=_0x2a07d6[0x0]?.['alias'],_0x3043d8=readFileSync(_0x295f86,_0x5d3818(0x13e)),_0x5164b9=TemplateReplacer[_0x5d3818(0x138)](_0x3043d8,_0x1cd49b,_0x2a07d6,_0x608de0,_0x2b54fb,_0x24bdef,undefined,_0x4c5ee3),_0x21711c=await a2_0x2cd157[_0x5d3818(0x152)](_0x5164b9,{'parser':'typescript'}),_0x370aa6=a2_0x432796[_0x5d3818(0x144)](_0x55888a,_0x2b54fb+_0x5d3818(0x129));writeFileSync(_0x370aa6,_0x21711c,{'encoding':_0x5d3818(0x13e)});const _0x31eba4=readFileSync(_0x44dd3b,_0x5d3818(0x13e)),_0x48051b=TemplateReplacer['replaceApiContent'](_0x31eba4,_0x1cd49b,_0x2a07d6,_0x608de0,_0x2b54fb,_0x24bdef,_0x897cc3,_0x4c5ee3),_0x1380d0=await a2_0x2cd157[_0x5d3818(0x152)](_0x48051b,{'parser':_0x5d3818(0x150)}),_0x12d617=a2_0x432796[_0x5d3818(0x144)](_0x55888a,_0x18c6ad+_0x5d3818(0x129));writeFileSync(_0x12d617,_0x1380d0,{'encoding':_0x5d3818(0x13e)});const _0x153f49=_0x2a07d6[_0x5d3818(0x136)];return logger[_0x5d3818(0x13a)](_0x5d3818(0x151),'API\x20文件生成成功!',undefined,{'apiFile':_0x370aa6,'clientFile':_0x12d617,'modelCount':_0x153f49,'configName':_0x24bdef}),{'modelCount':_0x153f49,'apiFilePath':_0x370aa6,'clientFilePath':_0x12d617,'configName':_0x24bdef};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a3_0x1294(_0x5a68e3,_0x13a80a){_0x5a68e3=_0x5a68e3-0x164;const _0x6d5102=a3_0x6d51();let _0x129406=_0x6d5102[_0x5a68e3];return _0x129406;}(function(_0x17c955,_0x5be615){const _0x40b30c=a3_0x1294,_0x38eff2=_0x17c955();while(!![]){try{const _0x7ac843=-parseInt(_0x40b30c(0x171))/0x1+-parseInt(_0x40b30c(0x16f))/0x2*(parseInt(_0x40b30c(0x16e))/0x3)+parseInt(_0x40b30c(0x167))/0x4*(-parseInt(_0x40b30c(0x166))/0x5)+parseInt(_0x40b30c(0x16a))/0x6*(parseInt(_0x40b30c(0x164))/0x7)+parseInt(_0x40b30c(0x172))/0x8*(parseInt(_0x40b30c(0x16c))/0x9)+-parseInt(_0x40b30c(0x16b))/0xa+parseInt(_0x40b30c(0x170))/0xb*(parseInt(_0x40b30c(0x175))/0xc);if(_0x7ac843===_0x5be615)break;else _0x38eff2['push'](_0x38eff2['shift']());}catch(_0x1be2ea){_0x38eff2['push'](_0x38eff2['shift']());}}}(a3_0x6d51,0xbd61b));import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{confirm}from'@inquirer/prompts';import a3_0xc6949 from'ora';function a3_0x6d51(){const _0x30ff34=['Logging\x20in...\x20Please\x20complete\x20login\x20in\x20your\x20browser.','489276mfDqUL','391797xFfmfo','stop','53205bqRZMC','156KfJAhU','start','log','138XjFwjR','5700420wxBACh','9oSASrH','√\x20Valid\x20session\x20detected,\x20no\x20login\x20required.','165XIUJkN','55594MCslaz','429wBmnwO','986560dTNGLd','11189304DXzqWR','*\x20Login\x20successful!'];a3_0x6d51=function(){return _0x30ff34;};return a3_0x6d51();}export async function runAuthServer(){const _0x300580=a3_0x1294,_0x5533c8=await getIsSessionValid();if(_0x5533c8){console[_0x300580(0x169)](_0x300580(0x16d));return;}const _0x150fc9=await confirm({'message':'No\x20valid\x20session.\x20Login\x20now?','default':!![]});if(!_0x150fc9)return;const _0x383654=a3_0xc6949(_0x300580(0x174))[_0x300580(0x168)](),_0x2285e4=await authServer({'silent':!![]});_0x383654[_0x300580(0x165)](),_0x2285e4?console['log'](_0x300580(0x173)):console[_0x300580(0x169)]('!\x20Login\x20failed.');}
|
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a4_0x360ff8=a4_0x3b06;(function(_0x512d8c,_0x33d43e){const _0x38d27d=a4_0x3b06,_0x57d182=_0x512d8c();while(!![]){try{const _0x5efb49=-parseInt(_0x38d27d(0x193))/0x1+parseInt(_0x38d27d(0x195))/0x2+-parseInt(_0x38d27d(0x181))/0x3+-parseInt(_0x38d27d(0x1a7))/0x4*(parseInt(_0x38d27d(0x1a4))/0x5)+-parseInt(_0x38d27d(0x1aa))/0x6+parseInt(_0x38d27d(0x191))/0x7*(parseInt(_0x38d27d(0x1a5))/0x8)+-parseInt(_0x38d27d(0x183))/0x9*(-parseInt(_0x38d27d(0x180))/0xa);if(_0x5efb49===_0x33d43e)break;else _0x57d182['push'](_0x57d182['shift']());}catch(_0x49c468){_0x57d182['push'](_0x57d182['shift']());}}}(a4_0x5f26,0xb37c9));import{writeFileSync}from'node:fs';import a4_0x5e243a from'node:https';function a4_0x3b06(_0x580d15,_0x3e58be){_0x580d15=_0x580d15-0x180;const _0x5f2643=a4_0x5f26();let _0x3b06af=_0x5f2643[_0x580d15];return _0x3b06af;}import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'../auth/is-session-valid.js';import{cookieFile}from'../auth/constant.js';export async function authServer(_0x5c78af){const _0x3d23cb=a4_0x3b06,_0x4aca4e=_0x5c78af?.[_0x3d23cb(0x1ab)]||![];if(await getIsSessionValid())return!![];const _0x2615ca=await(await fetch(_0x3d23cb(0x189)))[_0x3d23cb(0x19d)]();return new Promise(async(_0x348d85,_0x2b32db)=>{const _0x4e5be8=_0x3d23cb;let _0x528fc4=0x0;const _0x17d5de=a4_0x5e243a[_0x4e5be8(0x199)](_0x2615ca,async(_0x128b54,_0x5fc861)=>{const _0x2fd209=_0x4e5be8,_0x37a8fd=getUserDomain(),_0x5300d5=_0x128b54[_0x2fd209(0x188)][_0x2fd209(0x1b0)]||'',_0x5889ee=await fetch(_0x37a8fd+_0x2fd209(0x196),{'headers':{'cookie':_0x5300d5}})[_0x2fd209(0x194)](_0x16d546=>_0x16d546['json']()),_0x545e4b=_0x5889ee&&_0x5889ee[_0x2fd209(0x18c)]&&_0x5889ee['user'];if(_0x545e4b){writeFileSync(cookieFile,_0x5300d5,'utf-8'),_0x348d85(!![]);const _0xb72172=_0x2fd209(0x19a),_0x13d86e=_0x2fd209(0x19b)+_0x2fd209(0x18d)+_0x2fd209(0x190),_0x1ec4b4=_0x2fd209(0x1a8),_0x29c744=_0x2fd209(0x1a9)+_0xb72172+_0x2fd209(0x1ac)+_0x13d86e+_0x2fd209(0x186)+_0x1ec4b4+'</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>';_0x5fc861[_0x2fd209(0x187)](0xc8,{'Content-Type':_0x2fd209(0x185)}),_0x5fc861[_0x2fd209(0x1ad)](_0x29c744),_0x17d5de[_0x2fd209(0x1af)]();}else{const _0x4e7fd5=''+encodeURIComponent('https://dev.lovrabet.com:'+_0x528fc4);_0x5fc861[_0x2fd209(0x187)](0x12e,{'location':_0x37a8fd+_0x2fd209(0x18b)+_0x4e7fd5}),_0x5fc861['end']();return;}});_0x17d5de['listen'](0x0,'127.0.0.1',()=>{const _0x2d12fb=_0x4e5be8,_0x30b440=_0x17d5de[_0x2d12fb(0x1a3)]();_0x528fc4=typeof _0x30b440===_0x2d12fb(0x19f)&&_0x30b440?_0x30b440[_0x2d12fb(0x1a0)]:Number(_0x30b440);const _0x5389af=_0x2d12fb(0x198)+_0x528fc4;!_0x4aca4e&&(console['log']('🔐\x20Starting\x20login\x20service...'),console[_0x2d12fb(0x18e)]('📍\x20Login\x20URL:',_0x5389af),console['log'](_0x2d12fb(0x197)),console[_0x2d12fb(0x18e)](''),console[_0x2d12fb(0x18e)](_0x2d12fb(0x1ae)),console[_0x2d12fb(0x18e)]('')),openInBrowser(_0x5389af)[_0x2d12fb(0x194)](_0x922514=>{const _0xc2b2d2=_0x2d12fb;!_0x4aca4e&&(_0x922514?console[_0xc2b2d2(0x18e)](_0xc2b2d2(0x184)):(console[_0xc2b2d2(0x18e)](_0xc2b2d2(0x19c)),console['log'](_0xc2b2d2(0x19e),_0x5389af)),console['log'](''));})[_0x2d12fb(0x1a1)](()=>{const _0x21e919=_0x2d12fb;!_0x4aca4e&&(console[_0x21e919(0x18e)](_0x21e919(0x19c)),console[_0x21e919(0x18e)](_0x21e919(0x19e),_0x5389af),console[_0x21e919(0x18e)](''));});}),_0x17d5de['on'](_0x4e5be8(0x182),_0x3c6a8a=>{const _0x67d92a=_0x4e5be8;!_0x4aca4e&&console[_0x67d92a(0x182)]('Auth\x20server\x20error:',_0x3c6a8a),_0x2b32db(_0x3c6a8a);});});}function a4_0x5f26(){const _0x3db58f=['4FVILiT','Unable\x20to\x20close\x20automatically.\x20Please\x20close\x20this\x20tab\x20or\x20window\x20manually.','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>','7232820VqenRj','silent','</title></head>\x0a<body>\x0a\x20\x20<div>','end','💡\x20If\x20the\x20browser\x20does\x20not\x20open\x20automatically,\x20copy\x20the\x20login\x20URL\x20above\x20into\x20your\x20browser.','close','cookie','526810eYXNtx','3478740BXSowo','error','369tLWvqL','✅\x20Browser\x20opened.\x20Please\x20complete\x20login\x20in\x20the\x20browser.','text/html;\x20charset=utf-8','</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>','writeHead','headers','https://g.yuntooai.com/cert/lovrabet-dev.json','xdg-open\x20\x22','/sign-in?redirect=','session','<span\x20id=\x22t\x22>5</span>','log','isAuth','\x20seconds.','2865891wWbmqV','darwin','18537ykmdmq','then','1354034VUYXtW','/api/auth/get-session','🌐\x20Attempting\x20to\x20open\x20browser\x20automatically...','https://dev.lovrabet.com:','createServer','Login\x20Successful','Login\x20successful.\x20Please\x20return\x20to\x20the\x20CLI\x20to\x20continue.\x20This\x20window\x20will\x20close\x20in\x20','⚠️\x20\x20Failed\x20to\x20open\x20browser\x20automatically','json','🔗\x20Please\x20copy\x20the\x20login\x20URL\x20into\x20your\x20browser:','object','port','catch','cmd\x20/c\x20start\x20\x22\x22\x20\x22','address','637935uNVrJk','8sUQcms','open\x20\x22'];a4_0x5f26=function(){return _0x3db58f;};return a4_0x5f26();}function openInBrowser(_0x4c1feb){return new Promise(_0x15a59e=>{const _0x3b3718=a4_0x3b06,_0x5ce8dd=process['platform'];let _0x465ef7;if(_0x5ce8dd==='win32')_0x465ef7=_0x3b3718(0x1a2)+_0x4c1feb+'\x22';else _0x5ce8dd===_0x3b3718(0x192)?_0x465ef7=_0x3b3718(0x1a6)+_0x4c1feb+'\x22':_0x465ef7=_0x3b3718(0x18a)+_0x4c1feb+'\x22';exec(_0x465ef7,_0x20a90f=>{_0x20a90f?_0x15a59e(![]):_0x15a59e(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log'](a4_0x360ff8(0x18f),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a5_0x57d4(_0x1b7927,_0x553fee){_0x1b7927=_0x1b7927-0x9d;const _0x47e555=a5_0x47e5();let _0x57d420=_0x47e555[_0x1b7927];return _0x57d420;}function a5_0x47e5(){const _0x25b3f2=['1109560DOpaZQ','14fIPmbf','400284ICrhVC','4954670fKaidX','145HXsNiC','1663416Lluyya','1194xahFXU','25196bVwLoJ','116qdRVRn','100475BGGBcN','.lovrabet'];a5_0x47e5=function(){return _0x25b3f2;};return a5_0x47e5();}const a5_0x567c31=a5_0x57d4;(function(_0xbe1829,_0x513b5f){const _0x36397b=a5_0x57d4,_0x1f52d2=_0xbe1829();while(!![]){try{const _0x4fb84d=-parseInt(_0x36397b(0xa3))/0x1+-parseInt(_0x36397b(0xa2))/0x2*(-parseInt(_0x36397b(0xa0))/0x3)+-parseInt(_0x36397b(0xa1))/0x4*(parseInt(_0x36397b(0x9e))/0x5)+parseInt(_0x36397b(0x9f))/0x6+-parseInt(_0x36397b(0xa6))/0x7*(parseInt(_0x36397b(0xa5))/0x8)+parseInt(_0x36397b(0xa7))/0x9+parseInt(_0x36397b(0x9d))/0xa;if(_0x4fb84d===_0x513b5f)break;else _0x1f52d2['push'](_0x1f52d2['shift']());}catch(_0xc75e67){_0x1f52d2['push'](_0x1f52d2['shift']());}}}(a5_0x47e5,0x444af));import{mkdirSync}from'node:fs';import{homedir}from'node:os';import{join}from'node:path';export const configDir=join(homedir(),a5_0x567c31(0xa4));export const cookieFile=join(configDir,'cookie');mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4c1227,_0x118770){var _0x8fba4e=a6_0x5017,_0x4c01a3=_0x4c1227();while(!![]){try{var _0x3b3843=-parseInt(_0x8fba4e(0xbe))/0x1+parseInt(_0x8fba4e(0xb4))/0x2*(-parseInt(_0x8fba4e(0xbf))/0x3)+-parseInt(_0x8fba4e(0xb7))/0x4*(-parseInt(_0x8fba4e(0xbc))/0x5)+parseInt(_0x8fba4e(0xb8))/0x6*(parseInt(_0x8fba4e(0xb6))/0x7)+parseInt(_0x8fba4e(0xb5))/0x8*(parseInt(_0x8fba4e(0xbd))/0x9)+-parseInt(_0x8fba4e(0xc1))/0xa*(parseInt(_0x8fba4e(0xc0))/0xb)+-parseInt(_0x8fba4e(0xbb))/0xc*(-parseInt(_0x8fba4e(0xb9))/0xd);if(_0x3b3843===_0x118770)break;else _0x4c01a3['push'](_0x4c01a3['shift']());}catch(_0x127496){_0x4c01a3['push'](_0x4c01a3['shift']());}}}(a6_0x5de4,0x93748));import{readFileSync}from'node:fs';import{cookieFile}from'../auth/constant.js';function a6_0x5de4(){var _0x504f9c=['utf-8','204dxqAqB','10UidnDn','63567yjdDZB','736880BOuriv','7491LBTshV','2131481hgvkuf','30MRlhWZ','842eGOvXH','736zvnIUA','7rWsSvr','206136trXTHm','3335514VooUIq','1272947hZdCqD'];a6_0x5de4=function(){return _0x504f9c;};return a6_0x5de4();}function a6_0x5017(_0x54c0fb,_0x1b358d){_0x54c0fb=_0x54c0fb-0xb4;var _0x5de486=a6_0x5de4();var _0x50170b=_0x5de486[_0x54c0fb];return _0x50170b;}export function getCookie(){var _0x5966c4=a6_0x5017;try{return readFileSync(cookieFile,_0x5966c4(0xba));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2115d0,_0x5d497a){const _0x6b11d=a7_0x1b6b,_0x180f28=_0x2115d0();while(!![]){try{const _0x2f6833=-parseInt(_0x6b11d(0x11d))/0x1*(parseInt(_0x6b11d(0x117))/0x2)+parseInt(_0x6b11d(0x114))/0x3+parseInt(_0x6b11d(0x118))/0x4*(-parseInt(_0x6b11d(0x120))/0x5)+-parseInt(_0x6b11d(0x119))/0x6+parseInt(_0x6b11d(0x11a))/0x7*(-parseInt(_0x6b11d(0x115))/0x8)+-parseInt(_0x6b11d(0x113))/0x9*(parseInt(_0x6b11d(0x116))/0xa)+parseInt(_0x6b11d(0x11c))/0xb;if(_0x2f6833===_0x5d497a)break;else _0x180f28['push'](_0x180f28['shift']());}catch(_0x25e835){_0x180f28['push'](_0x180f28['shift']());}}}(a7_0x16eb,0x1dc6d));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';function a7_0x1b6b(_0x11bf6d,_0x357610){_0x11bf6d=_0x11bf6d-0x113;const _0x16eb2d=a7_0x16eb();let _0x1b6b71=_0x16eb2d[_0x11bf6d];return _0x1b6b71;}import{cookieFile}from'../auth/constant.js';export async function getSessionUserInfo(){const _0x533253=a7_0x1b6b;try{if(!existsSync(cookieFile))return null;const _0x2bf5a7=readFileSync(cookieFile,_0x533253(0x11b)),_0x482aee=await fetch(getUserDomain()+'/api/auth/get-session',{'headers':{'cookie':_0x2bf5a7}});if(!_0x482aee['ok'])return null;const _0x263c53=await _0x482aee[_0x533253(0x11e)]();if(!_0x263c53['session']||!_0x263c53[_0x533253(0x11f)])return null;return _0x263c53;}catch{return null;}}function a7_0x16eb(){const _0x3200db=['422877aoCEGc','utf-8','7725938VyKTIp','76jiZNSn','json','user','158305TnZLYT','198LHYVRY','721023PixqKv','32PFOWGV','106330bcvmTO','4486CvPpPa','16KEdACF','288312DxdZBC'];a7_0x16eb=function(){return _0x3200db;};return a7_0x16eb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x117e31,_0x458339){const _0x580b37=a8_0x1bc3,_0x306d06=_0x117e31();while(!![]){try{const _0x14e86f=parseInt(_0x580b37(0x1c3))/0x1+parseInt(_0x580b37(0x1c7))/0x2*(-parseInt(_0x580b37(0x1c9))/0x3)+parseInt(_0x580b37(0x1c4))/0x4+parseInt(_0x580b37(0x1c1))/0x5+parseInt(_0x580b37(0x1cc))/0x6+parseInt(_0x580b37(0x1c6))/0x7*(parseInt(_0x580b37(0x1c8))/0x8)+-parseInt(_0x580b37(0x1ca))/0x9*(parseInt(_0x580b37(0x1cb))/0xa);if(_0x14e86f===_0x458339)break;else _0x306d06['push'](_0x306d06['shift']());}catch(_0xc05029){_0x306d06['push'](_0x306d06['shift']());}}}(a8_0x45f9,0x5b752));function a8_0x1bc3(_0x58236d,_0x14d88e){_0x58236d=_0x58236d-0x1c1;const _0x45f905=a8_0x45f9();let _0x1bc3dc=_0x45f905[_0x58236d];return _0x1bc3dc;}function a8_0x45f9(){const _0x28dc73=['2195052NideOI','user','7FfJEwI','16394mdoeLh','2855896YjQLEs','24eMEaBN','15661071RGkiOi','10uVEQeO','100554bAnZhb','utf-8','session','3112455kcQdhe','json','635305PhJmAA'];a8_0x45f9=function(){return _0x28dc73;};return a8_0x45f9();}import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'../auth/constant.js';export async function getIsSessionValid(){const _0x4b82ea=a8_0x1bc3;try{if(!existsSync(cookieFile))return![];const _0x1c1610=readFileSync(cookieFile,_0x4b82ea(0x1cd)),_0x44dd6b=await fetch(getUserDomain()+'/api/auth/get-session',{'headers':{'cookie':_0x1c1610}})['then'](_0x159a6d=>_0x159a6d[_0x4b82ea(0x1c2)]());return _0x44dd6b&&_0x44dd6b[_0x4b82ea(0x1ce)]&&_0x44dd6b[_0x4b82ea(0x1c5)];}catch{}return![];}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a9_0x10b6(){var _0x129a7f=['log','3101043sqgmRE','7379199ycdIds','8VzSzeK','24BIsIYH','1461532qOzLBl','3198455QhfRHG','1746088jVicrf','1231188pxZcwg','1027768GtglQX'];a9_0x10b6=function(){return _0x129a7f;};return a9_0x10b6();}(function(_0x3900ca,_0x418592){var _0x2335c0=a9_0xe11e,_0x3bdd85=_0x3900ca();while(!![]){try{var _0x6d05b1=parseInt(_0x2335c0(0x159))/0x1+-parseInt(_0x2335c0(0x156))/0x2+parseInt(_0x2335c0(0x15c))/0x3+-parseInt(_0x2335c0(0x158))/0x4+-parseInt(_0x2335c0(0x157))/0x5+parseInt(_0x2335c0(0x155))/0x6*(-parseInt(_0x2335c0(0x15a))/0x7)+-parseInt(_0x2335c0(0x154))/0x8*(-parseInt(_0x2335c0(0x15d))/0x9);if(_0x6d05b1===_0x418592)break;else _0x3bdd85['push'](_0x3bdd85['shift']());}catch(_0x13c4a5){_0x3bdd85['push'](_0x3bdd85['shift']());}}}(a9_0x10b6,0xa8949));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../auth/constant.js';function a9_0xe11e(_0x5c07be,_0x53751b){_0x5c07be=_0x5c07be-0x154;var _0x10b6c3=a9_0x10b6();var _0xe11e0f=_0x10b6c3[_0x5c07be];return _0xe11e0f;}export function logout(){var _0x2d109a=a9_0xe11e;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x2d109a(0x15b)]('✓\x20Logged\x20out')):console['log']('!\x20Not\x20logged\x20in');}
|
package/lib/cli-flags.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3672c5,_0x4f2edb){const _0x40b586=a10_0x4c9b,_0x55f6f0=_0x3672c5();while(!![]){try{const _0x5508a8=-parseInt(_0x40b586(0x90))/0x1+-parseInt(_0x40b586(0x8d))/0x2*(-parseInt(_0x40b586(0x8b))/0x3)+parseInt(_0x40b586(0x8e))/0x4+parseInt(_0x40b586(0x8a))/0x5+parseInt(_0x40b586(0x8c))/0x6+parseInt(_0x40b586(0x8f))/0x7+-parseInt(_0x40b586(0x89))/0x8;if(_0x5508a8===_0x4f2edb)break;else _0x55f6f0['push'](_0x55f6f0['shift']());}catch(_0x21c888){_0x55f6f0['push'](_0x55f6f0['shift']());}}}(a10_0x39ae,0x85383));function a10_0x4c9b(_0x1e8367,_0x5e3334){_0x1e8367=_0x1e8367-0x89;const _0x39aeef=a10_0x39ae();let _0x4c9b60=_0x39aeef[_0x1e8367];return _0x4c9b60;}function a10_0x39ae(){const _0x271c73=['11995432GiMxCT','188885baMVzG','61437COKlNi','3227292zviFeD','92cibsTK','3488060qizJNE','2721866SvqoeG','733450ysYbXm'];a10_0x39ae=function(){return _0x271c73;};return a10_0x39ae();}export const dynamicCliFlags={'enableBffSave':{'type':'boolean'}};
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a11_0x3109e0=a11_0x4f94;(function(_0x560025,_0x3ad106){const _0x472a57=a11_0x4f94,_0x5c6f65=_0x560025();while(!![]){try{const _0x267d14=parseInt(_0x472a57(0x100))/0x1*(-parseInt(_0x472a57(0x114))/0x2)+-parseInt(_0x472a57(0x106))/0x3*(-parseInt(_0x472a57(0x111))/0x4)+-parseInt(_0x472a57(0x137))/0x5*(parseInt(_0x472a57(0x126))/0x6)+-parseInt(_0x472a57(0x128))/0x7*(parseInt(_0x472a57(0x11d))/0x8)+parseInt(_0x472a57(0x109))/0x9*(parseInt(_0x472a57(0x133))/0xa)+-parseInt(_0x472a57(0x131))/0xb+parseInt(_0x472a57(0x12a))/0xc;if(_0x267d14===_0x3ad106)break;else _0x5c6f65['push'](_0x5c6f65['shift']());}catch(_0x4e8b30){_0x5c6f65['push'](_0x5c6f65['shift']());}}}(a11_0x3827,0x6edbd));import a11_0x22968c from'meow';import{showHelp}from'./help.js';import{CliError,CliErrors}from'./errors.js';import{isKnownService,getServiceEntry,findDefinition,deprecatedAliases}from'./commands/registry.js';import{runCommand}from'./framework/runner.js';import{generateCommandHelp,generateServiceHelp,generateFullHelp}from'./framework/help.js';import{getCookie}from'./auth/get-cookie.js';import{getApiDomain}from'./constant/domain.js';import{CLI_BIN_NAME,buildMeowFlags}from'./constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'./generated/build-info.js';import{reportCliHelpTrace}from'./telemetry/cli-help-trace.js';import{reportCommandTrace}from'./telemetry/cli-command-trace.js';import{isNonInteractive as a11_0x4fc96c}from'./utils/is-non-interactive.js';import{registerOtelShutdownOnExit,exitWithOtelShutdown}from'./telemetry/register-otel-exit-shutdown.js';let dynamicCliFlags=null;try{dynamicCliFlags=(await import(a11_0x3109e0(0x12e)))[a11_0x3109e0(0x110)];}catch{}const helpText=generateFullHelp(),cliVersion=GIT_COMMIT!==a11_0x3109e0(0x134)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[a11_0x3109e0(0x123)](0x0,0xa)+')':VERSION,cli=a11_0x22968c(helpText,{'importMeta':import.meta,'version':cliVersion,'flags':{...buildMeowFlags(),...dynamicCliFlags||{}}});registerOtelShutdownOnExit(),await run();function a11_0x3827(){const _0x40dd8a=['wildcardDef','Error:\x20','2021553JwJZWD','unknownCommand','message','help','code','userDomain','riskLevel','dynamicCliFlags','669996rvCwsb','exitCode','now','30904LMvvbh','./constant/env.js','stderr','cancelled','appCode','command','input','appcode','explicitAppName','19496CIJUro','Unexpected\x20error:','apiDir','runtimeDomain','pageSize','apiDomain','slice','log','\x20\x20Please\x20update\x20your\x20command\x20and\x20try\x20again.\x0a','6uGnpUQ','env','259mjgtwP','⚠\x20`','17331684QhtkWg','flags','./constant/domain.js','cookie','./cli-flags.js','\x0aCancelled.\x0a','./context.js','536976vaIrME','`\x20has\x20been\x20moved\x20to\x20`','10geTLnl','unknown','unknown_service','error','4362565qjkpwi','24uPTLfq','defaultCommand','write','raw','service','format','3Orpjaf'];a11_0x3827=function(){return _0x40dd8a;};return a11_0x3827();}async function run(){const _0x79e359=a11_0x3109e0;let _0x391090=cli['input'][0x0],_0x27d4ba=cli[_0x79e359(0x11a)][0x1];const _0x2cfec8=cli[_0x79e359(0x12b)];if(!_0x391090){await reportCliHelpTrace('global'),showHelp();return;}const _0x1ef5da=deprecatedAliases[_0x391090];if(_0x1ef5da&&!isKnownService(_0x391090)){const _0xbeacc=_0x27d4ba?CLI_BIN_NAME+'\x20'+_0x391090+'\x20'+_0x27d4ba:CLI_BIN_NAME+'\x20'+_0x391090,_0x556893=CLI_BIN_NAME+'\x20'+_0x1ef5da[_0x79e359(0x104)]+'\x20'+_0x1ef5da[_0x79e359(0x119)];console[_0x79e359(0x136)](_0x79e359(0x129)+_0xbeacc+_0x79e359(0x132)+_0x556893+'`\x20in\x20v2.0.\x0a'+_0x79e359(0x125)),await exitWithOtelShutdown(0x1);}if(!isKnownService(_0x391090)){await reportCliHelpTrace(_0x79e359(0x135),{'service':_0x391090}),showHelp();return;}const _0x5e40d8=getServiceEntry(_0x391090);if(_0x2cfec8[_0x79e359(0x127)]&&typeof _0x2cfec8[_0x79e359(0x127)]==='string'){const {initEnv:_0x3dcb4c}=await import(_0x79e359(0x115));_0x3dcb4c(_0x2cfec8[_0x79e359(0x127)]);}const {buildConfigFromFlags:_0x332d8c}=await import(_0x79e359(0x130)),_0x4434d4=_0x332d8c(_0x2cfec8);if(!_0x2cfec8['env']&&_0x4434d4[_0x79e359(0x127)]){const {initEnv:_0x588aca}=await import(_0x79e359(0x115));_0x588aca(_0x4434d4[_0x79e359(0x127)]);}if(_0x4434d4['raw']?.[_0x79e359(0x122)]||_0x4434d4[_0x79e359(0x103)]?.[_0x79e359(0x10e)]||_0x4434d4[_0x79e359(0x103)]?.['runtimeDomain']){const {initDomains:_0xf3a538}=await import(_0x79e359(0x12c));_0xf3a538({'apiDomain':_0x4434d4['raw'][_0x79e359(0x122)]||undefined,'userDomain':_0x4434d4[_0x79e359(0x103)][_0x79e359(0x10e)]||undefined,'runtimeDomain':_0x4434d4[_0x79e359(0x103)][_0x79e359(0x120)]||undefined});}if(!_0x27d4ba){if(_0x5e40d8[_0x79e359(0x101)])_0x27d4ba=_0x5e40d8[_0x79e359(0x101)];else{if(_0x5e40d8[_0x79e359(0x107)]){if(_0x2cfec8['help']){console[_0x79e359(0x124)](generateCommandHelp(_0x5e40d8['wildcardDef']));return;}await dispatchDeclarative(_0x5e40d8['wildcardDef'],_0x391090,'',[],_0x2cfec8,_0x4434d4);return;}else{printServiceHelp(_0x391090);return;}}}if(_0x2cfec8[_0x79e359(0x10c)]&&!findDefinition(_0x391090,_0x27d4ba)){printServiceHelp(_0x391090);return;}{let _0x48feef=findDefinition(_0x391090,_0x27d4ba),_0x440433=cli['input'][_0x79e359(0x123)](0x2);if(!_0x48feef){if(_0x5e40d8[_0x79e359(0x107)]){if(_0x2cfec8['help']){console[_0x79e359(0x124)](generateCommandHelp(_0x5e40d8['wildcardDef']));return;}_0x48feef=_0x5e40d8[_0x79e359(0x107)],_0x440433=[_0x27d4ba,...cli['input'][_0x79e359(0x123)](0x2)];}else{printServiceHelp(_0x391090),await handleErrorAsync(CliErrors[_0x79e359(0x10a)](_0x391090+'\x20'+_0x27d4ba));return;}}if(_0x2cfec8[_0x79e359(0x10c)]){console[_0x79e359(0x124)](generateCommandHelp(_0x48feef));return;}await dispatchDeclarative(_0x48feef,_0x391090,_0x27d4ba,_0x440433,_0x2cfec8,_0x4434d4);}}async function dispatchDeclarative(_0x3b8342,_0x3ed08f,_0x4599f1,_0x26b9fd,_0x1bd4e2,_0x4d6637){const _0x5935ce=a11_0x3109e0,_0xed604d=Date[_0x5935ce(0x113)]();let _0x48072e;try{await runCommand(_0x3b8342,{'rawFlags':_0x1bd4e2,'args':_0x26b9fd,'resolveAppCode':()=>_0x4d6637[_0x5935ce(0x118)]||_0x1bd4e2[_0x5935ce(0x11b)]||process.env.RABETBASE_APPCODE||process.env.LOVRABET_APPCODE||undefined,'resolveCookie':()=>_0x4d6637[_0x5935ce(0x12d)]||getCookie(),'resolveApiDomain':()=>getApiDomain(),'isNonInteractive':a11_0x4fc96c(_0x1bd4e2),'defaultFormat':_0x4d6637[_0x5935ce(0x105)],'defaultPageSize':_0x4d6637[_0x5935ce(0x121)],'defaultVerbose':_0x4d6637['verbose'],'apiDir':_0x4d6637[_0x5935ce(0x11f)],'riskLevel':_0x4d6637[_0x5935ce(0x10f)],'selectedAppName':_0x4d6637[_0x5935ce(0x11c)]});}catch(_0x1afdb8){_0x48072e=_0x1afdb8;}await reportCommandTrace({'service':_0x3ed08f,'command':_0x4599f1,'flags':_0x1bd4e2,'durationMs':Date[_0x5935ce(0x113)]()-_0xed604d,'error':_0x48072e});if(_0x48072e)await handleErrorAsync(_0x48072e);}function printServiceHelp(_0x597172){const _0x5f0ae8=a11_0x3109e0;console[_0x5f0ae8(0x124)](generateServiceHelp(_0x597172));}function a11_0x4f94(_0x5c8f45,_0x4b2757){_0x5c8f45=_0x5c8f45-0x100;const _0x382700=a11_0x3827();let _0x4f9401=_0x382700[_0x5c8f45];return _0x4f9401;}async function handleErrorAsync(_0x51ca5b){const _0x345111=a11_0x3109e0;if(_0x51ca5b instanceof Error&&_0x51ca5b['name']==='ExitPromptError')return process[_0x345111(0x116)][_0x345111(0x102)](_0x345111(0x12f)),await exitWithOtelShutdown(0x0);if(_0x51ca5b instanceof CliError){if(_0x51ca5b[_0x345111(0x10d)]===_0x345111(0x117))return process['stderr'][_0x345111(0x102)]('\x0a'+_0x51ca5b[_0x345111(0x10b)]+'\x0a'),await exitWithOtelShutdown(0x0);console[_0x345111(0x136)](_0x345111(0x108)+_0x51ca5b['message']);if(_0x51ca5b['hint'])console[_0x345111(0x136)]('Hint:\x20'+_0x51ca5b['hint']);return await exitWithOtelShutdown(_0x51ca5b[_0x345111(0x112)]);}return console[_0x345111(0x136)](_0x345111(0x11e),_0x51ca5b),await exitWithOtelShutdown(0x1);}
|
package/lib/commands/api/doc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x1e4500=a12_0xb001;(function(_0x37b0a2,_0x5c1a50){const _0xe07edf=a12_0xb001,_0xa9faea=_0x37b0a2();while(!![]){try{const _0x39f6ee=parseInt(_0xe07edf(0x229))/0x1+parseInt(_0xe07edf(0x230))/0x2*(parseInt(_0xe07edf(0x210))/0x3)+-parseInt(_0xe07edf(0x1f9))/0x4+-parseInt(_0xe07edf(0x1f6))/0x5*(parseInt(_0xe07edf(0x208))/0x6)+-parseInt(_0xe07edf(0x231))/0x7*(parseInt(_0xe07edf(0x219))/0x8)+parseInt(_0xe07edf(0x202))/0x9*(-parseInt(_0xe07edf(0x1ee))/0xa)+parseInt(_0xe07edf(0x227))/0xb*(parseInt(_0xe07edf(0x1fc))/0xc);if(_0x39f6ee===_0x5c1a50)break;else _0xa9faea['push'](_0xa9faea['shift']());}catch(_0x113cbf){_0xa9faea['push'](_0xa9faea['shift']());}}}(a12_0x49c8,0x1db50));function a12_0x49c8(){const _0x491e79=['padStart','Doc\x20generation\x20complete:\x20','1001NKwvQJ','cookie','56298CuCkEK','length','str','.md','success','./docs','api','2WrLHrj','133LWmGRq','doc','\x20\x20•\x20','appCode','477060AVwHEB','Filter:\x20comma-separated\x20dataset\x20codes\x20to\x20generate\x20docs\x20for','):\x20','\x20of\x20','Fetched\x20','...','has','Generate\x20markdown\x20documentation\x20for\x20all\x20datasets','55zcgJOk','Invalid\x20--params:\x20','Extra\x20params\x20passed\x20to\x20the\x20doc\x20generator\x20(JSON\x20object)','144208hJhXQC','\x0d\x20\x20[','params','46572hAAkrp','object','\x20doc(s)\x20failed','\x20dataset(s)','log','Provide\x20a\x20valid\x20JSON\x20object,\x20e.g.\x20--params\x20\x27{\x22key\x22:\x22value\x22}\x27','27mgIbPq','validation','parse','succeed','map','\x20failed','42918akJKzY','fail','datasetCode','must\x20be\x20a\x20JSON\x20object','\x1b[90m*\x20Filtered\x20','write','stdout','!\x20No\x20datasets\x20found.','390246pyOHBL','Doc\x20generation:\x20','filter','\x20file(s)','output','\x20dataset(s)\x1b[0m','\x1b[0m','string','error','67376jRFIeB','trim','Fetching\x20dataset\x20list\x20for\x20','✓\x20Generated\x20','Output\x20directory\x20(default:\x20./docs)','message','\x1b[90m*\x20Generating\x20docs\x20for:\x20','split','\x20succeeded,\x20','isArray','join','datasetcode'];a12_0x49c8=function(){return _0x491e79;};return a12_0x49c8();}import a12_0x68bd9b from'ora';import{fetchModelList}from'../../api/fetch-model-list.js';import{generateDatasetDocs}from'../../api/api-doc.js';function a12_0xb001(_0x401790,_0x12f976){_0x401790=_0x401790-0x1ec;const _0x49c8cb=a12_0x49c8();let _0xb001cc=_0x49c8cb[_0x401790];return _0xb001cc;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const apiDoc={'service':a12_0x1e4500(0x22f),'command':a12_0x1e4500(0x232),'description':a12_0x1e4500(0x1f5),'risk':'write','requiresAppCode':!![],'hasFormat':![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':a12_0x1e4500(0x214),'type':'string','description':a12_0x1e4500(0x21d)},{'name':'datasetcode','type':a12_0x1e4500(0x217),'description':a12_0x1e4500(0x1ef)},{'name':a12_0x1e4500(0x1fb),'type':a12_0x1e4500(0x217),'description':a12_0x1e4500(0x1f8)}],async 'execute'(_0x11715b){const _0x3b81ec=a12_0x1e4500,_0x34c2b1=_0x11715b['str'](_0x3b81ec(0x214))||_0x3b81ec(0x22e),_0x5919bf=_0x11715b[_0x3b81ec(0x22b)](_0x3b81ec(0x224)),_0x23b2b2=_0x11715b[_0x3b81ec(0x22b)](_0x3b81ec(0x1fb));let _0x4156e1;if(_0x23b2b2)try{_0x4156e1=JSON[_0x3b81ec(0x204)](_0x23b2b2);if(typeof _0x4156e1!==_0x3b81ec(0x1fd)||_0x4156e1===null||Array[_0x3b81ec(0x222)](_0x4156e1))throw new Error(_0x3b81ec(0x20b));}catch(_0x313b59){throw CliErrors[_0x3b81ec(0x203)](_0x3b81ec(0x1f7)+(_0x313b59 instanceof Error?_0x313b59[_0x3b81ec(0x21e)]:String(_0x313b59)),_0x3b81ec(0x201));}let _0x599159;if(_0x5919bf){const _0x5d3ebe=_0x5919bf[_0x3b81ec(0x220)](',')[_0x3b81ec(0x206)](_0x4c66eb=>_0x4c66eb[_0x3b81ec(0x21a)]())[_0x3b81ec(0x212)](_0x2db609=>_0x2db609[_0x3b81ec(0x22a)]>0x0);if(_0x5d3ebe['length']===0x0)throw CliErrors[_0x3b81ec(0x203)]('--datasetcode\x20cannot\x20be\x20empty.');_0x599159=new Set(_0x5d3ebe),console[_0x3b81ec(0x200)](_0x3b81ec(0x21f)+_0x5d3ebe[_0x3b81ec(0x223)](',\x20')+_0x3b81ec(0x216));}const _0x3dbbd5=a12_0x68bd9b(_0x3b81ec(0x21b)+_0x11715b[_0x3b81ec(0x1ed)]+_0x3b81ec(0x1f3))['start']();let _0x2c21ef;try{({configArray:_0x2c21ef}=await fetchModelList(_0x11715b[_0x3b81ec(0x1ed)],_0x11715b[_0x3b81ec(0x228)]),_0x3dbbd5[_0x3b81ec(0x205)](_0x3b81ec(0x1f2)+_0x2c21ef[_0x3b81ec(0x22a)]+_0x3b81ec(0x1ff)));}catch(_0x231127){_0x3dbbd5[_0x3b81ec(0x209)]('Failed\x20to\x20fetch\x20datasets');throw _0x231127;}if(_0x2c21ef['length']===0x0)return console[_0x3b81ec(0x200)](_0x3b81ec(0x20f)),{'ok':!![]};let _0x5f255e=_0x2c21ef;if(_0x599159){_0x5f255e=_0x2c21ef[_0x3b81ec(0x212)](_0x490266=>_0x599159[_0x3b81ec(0x1f4)](_0x490266['datasetCode']));const _0xd9559f=[..._0x599159][_0x3b81ec(0x212)](_0x56cc24=>!_0x2c21ef['some'](_0x40dde0=>_0x40dde0[_0x3b81ec(0x20a)]===_0x56cc24));_0xd9559f[_0x3b81ec(0x22a)]>0x0&&console[_0x3b81ec(0x200)]('\x1b[33m!\x20The\x20following\x20dataset\x20codes\x20do\x20not\x20exist:\x20'+_0xd9559f['join'](',\x20')+'\x1b[0m');if(_0x5f255e[_0x3b81ec(0x22a)]===0x0)throw CliErrors[_0x3b81ec(0x203)]('None\x20of\x20the\x20specified\x20dataset\x20codes\x20exist:\x20'+[..._0x599159]['join'](',\x20'));console['log'](_0x3b81ec(0x20c)+_0x5f255e[_0x3b81ec(0x22a)]+_0x3b81ec(0x1f1)+_0x2c21ef[_0x3b81ec(0x22a)]+_0x3b81ec(0x215));}let _0x571c81=0x0;const _0x17d584=await generateDatasetDocs(_0x5f255e,_0x11715b[_0x3b81ec(0x1ed)],_0x11715b['cookie'],_0x34c2b1,(_0x262473,_0x5068d5,_0x1445a8)=>{const _0x5699fb=_0x3b81ec;_0x571c81=_0x262473,process[_0x5699fb(0x20e)]['write'](_0x5699fb(0x1fa)+String(_0x262473)[_0x5699fb(0x225)](String(_0x5068d5)[_0x5699fb(0x22a)])+'/'+_0x5068d5+']\x20'+_0x1445a8+_0x5699fb(0x22c));},_0x4156e1);if(_0x571c81>0x0)process['stdout'][_0x3b81ec(0x20d)]('\x0a');const _0x78097e=_0x17d584[_0x3b81ec(0x212)](_0x4a0bd0=>_0x4a0bd0[_0x3b81ec(0x22d)])[_0x3b81ec(0x22a)],_0x29f0c5=_0x17d584[_0x3b81ec(0x212)](_0x33d06e=>!_0x33d06e[_0x3b81ec(0x22d)])[_0x3b81ec(0x22a)];console[_0x3b81ec(0x200)](),console['log'](_0x3b81ec(0x21c)+_0x78097e+'\x20doc(s)\x20in\x20'+_0x34c2b1);if(_0x29f0c5>0x0){console[_0x3b81ec(0x218)]('!\x20'+_0x29f0c5+_0x3b81ec(0x1fe));for(const _0x485d4f of _0x17d584['filter'](_0x14f2c7=>!_0x14f2c7[_0x3b81ec(0x22d)])){console[_0x3b81ec(0x218)](_0x3b81ec(0x1ec)+_0x485d4f['datasetName']+'\x20('+_0x485d4f[_0x3b81ec(0x20a)]+_0x3b81ec(0x1f0)+_0x485d4f['error']);}}return{'ok':_0x29f0c5===0x0,'message':_0x29f0c5>0x0?_0x3b81ec(0x211)+_0x78097e+_0x3b81ec(0x221)+_0x29f0c5+_0x3b81ec(0x207):_0x3b81ec(0x226)+_0x78097e+_0x3b81ec(0x213)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ca773,_0x2e61a9){const _0x555dba=a13_0x2bf6,_0x32bfdb=_0x3ca773();while(!![]){try{const _0x39d319=parseInt(_0x555dba(0x192))/0x1*(-parseInt(_0x555dba(0x18a))/0x2)+-parseInt(_0x555dba(0x190))/0x3*(-parseInt(_0x555dba(0x18b))/0x4)+parseInt(_0x555dba(0x191))/0x5*(parseInt(_0x555dba(0x193))/0x6)+-parseInt(_0x555dba(0x18e))/0x7+parseInt(_0x555dba(0x194))/0x8+parseInt(_0x555dba(0x18f))/0x9*(parseInt(_0x555dba(0x18c))/0xa)+-parseInt(_0x555dba(0x18d))/0xb;if(_0x39d319===_0x2e61a9)break;else _0x32bfdb['push'](_0x32bfdb['shift']());}catch(_0x3213c9){_0x32bfdb['push'](_0x32bfdb['shift']());}}}(a13_0x3d58,0x446a2));function a13_0x2bf6(_0xf3fb59,_0x4b79d1){_0xf3fb59=_0xf3fb59-0x18a;const _0x3d5854=a13_0x3d58();let _0x2bf66b=_0x3d5854[_0xf3fb59];return _0x2bf66b;}import{apiList}from'../../commands/api/list.js';import{apiPull}from'../../commands/api/pull.js';import{apiDoc}from'../../commands/api/doc.js';function a13_0x3d58(){const _0x27c99f=['7bUUJyG','27126DWyCcn','3145472yybBsx','17866bXSHUX','155912HYHFUl','5400NikJET','6128848EWCJHx','2425878zGSayM','6876tYekkz','12UrVCNw','315hvkCWU'];a13_0x3d58=function(){return _0x27c99f;};return a13_0x3d58();}export const apiDefinitions=[apiList,apiPull,apiDoc];
|
package/lib/commands/api/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x22bfff=a14_0x5d10;function a14_0x5d10(_0x2a4e9e,_0x249e32){_0x2a4e9e=_0x2a4e9e-0x178;const _0x18efeb=a14_0x18ef();let _0x5d1046=_0x18efeb[_0x2a4e9e];return _0x5d1046;}(function(_0x31fad3,_0x5a1073){const _0x7bb0ab=a14_0x5d10,_0x522220=_0x31fad3();while(!![]){try{const _0x3a2915=parseInt(_0x7bb0ab(0x17a))/0x1*(-parseInt(_0x7bb0ab(0x181))/0x2)+parseInt(_0x7bb0ab(0x185))/0x3+-parseInt(_0x7bb0ab(0x186))/0x4+-parseInt(_0x7bb0ab(0x184))/0x5*(parseInt(_0x7bb0ab(0x188))/0x6)+-parseInt(_0x7bb0ab(0x189))/0x7*(parseInt(_0x7bb0ab(0x17b))/0x8)+-parseInt(_0x7bb0ab(0x18c))/0x9*(parseInt(_0x7bb0ab(0x182))/0xa)+parseInt(_0x7bb0ab(0x183))/0xb;if(_0x3a2915===_0x5a1073)break;else _0x522220['push'](_0x522220['shift']());}catch(_0x52c1a1){_0x522220['push'](_0x522220['shift']());}}}(a14_0x18ef,0xeecb8));import{initEnv}from'../../constant/env.js';import{fetchModelList}from'../../api/fetch-model-list.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a14_0x18ef(){const _0x5e42c0=['9QIhbhj','list','List\x20all\x20datasets/models\x20for\x20the\x20configured\x20app(s)','29EtIZDM','748576YmwJzC','name','cookie','push','api','appcode','107370PuVUeB','18801350YEdlQW','47195214suWhrK','3035OcxQxS','3809388ALOMkA','1015984vamNqp','read','7884cVmOHy','7HgYsbb','production','env'];a14_0x18ef=function(){return _0x5e42c0;};return a14_0x18ef();}import{resolveTargetApps}from'../../commands/api/shared.js';export const apiList={'service':a14_0x22bfff(0x17f),'command':a14_0x22bfff(0x178),'description':a14_0x22bfff(0x179),'risk':a14_0x22bfff(0x187),'requiresAppCode':!![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]}],async 'execute'(_0x25c4b0){const _0x581783=a14_0x22bfff,_0x432122=_0x25c4b0['str'](_0x581783(0x180)),_0xf7eb0f=resolveTargetApps(_0x25c4b0,_0x432122);if(_0xf7eb0f){const _0xa49414=[];for(const _0x18d587 of _0xf7eb0f){const _0x17f71d=_0x18d587[_0x581783(0x17d)]||_0x25c4b0[_0x581783(0x17d)],_0x125ca8=_0x18d587[_0x581783(0x18b)]||_0x581783(0x18a);initEnv(_0x125ca8);const {configArray:_0xa84186}=await fetchModelList(_0x18d587['appcode'],_0x17f71d);_0xa49414[_0x581783(0x17e)](..._0xa84186['map'](_0x339612=>({..._0x339612,'_appName':_0x18d587[_0x581783(0x17c)],'_appCode':_0x18d587[_0x581783(0x180)],'_env':_0x125ca8,'_isDefault':_0x18d587['isDefault']})));}return{'ok':!![],'data':_0xa49414};}const {configArray:_0x221a47}=await fetchModelList(_0x25c4b0['appCode'],_0x25c4b0[_0x581783(0x17d)]);return{'ok':!![],'data':_0x221a47};}};
|
package/lib/commands/api/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x55b5d5=a15_0x47fd;(function(_0x24c8a4,_0x280e15){const _0x317c88=a15_0x47fd,_0x176335=_0x24c8a4();while(!![]){try{const _0x1fae06=parseInt(_0x317c88(0x221))/0x1+-parseInt(_0x317c88(0x1f2))/0x2+parseInt(_0x317c88(0x1f3))/0x3*(parseInt(_0x317c88(0x214))/0x4)+parseInt(_0x317c88(0x223))/0x5+-parseInt(_0x317c88(0x1f5))/0x6+-parseInt(_0x317c88(0x205))/0x7+parseInt(_0x317c88(0x1fa))/0x8;if(_0x1fae06===_0x280e15)break;else _0x176335['push'](_0x176335['shift']());}catch(_0x385fee){_0x176335['push'](_0x176335['shift']());}}}(a15_0x4201,0x727e3));import a15_0x44775d from'ora';import a15_0x26fd39 from'node:path';function a15_0x4201(){const _0x1d19e2=['Done:\x20','16uYriJi','error','\x20\x20•\x20','start','log','\x20app(s)\x20failed','pull','split','apiFilePath','\x20dataset(s),\x20generated\x20','name','apiDir','fail','604409fBslPQ','client','3253855gSpJly','message','Pulling\x20API\x20config\x20for\x20','1649676KhvZWy','43518dBDiBu','isDefault','821742Mymbih','-client','appCode','str','join','2729800KsjAIh','appcode','succeed','\x20model(s)','includes','slice','clientFilePath','string','cookie','modelCount','env','1565697wIBCwx','write','output','\x20dataset(s)\x20→\x20','length','production','.ts','./src/api/','Pulled\x20','\x20failed','api','\x20succeeded,\x20','Pulling\x20','Output\x20directory\x20(default:\x20./src/api/)'];a15_0x4201=function(){return _0x1d19e2;};return a15_0x4201();}function a15_0x47fd(_0x5cea1d,_0x42ece6){_0x5cea1d=_0x5cea1d-0x1f0;const _0x42014e=a15_0x4201();let _0x47fda9=_0x42014e[_0x5cea1d];return _0x47fda9;}import{initEnv,getEnv}from'../../constant/env.js';import{fetchModelList}from'../../api/fetch-model-list.js';import{generateApiFile}from'../../api/generate-api-file.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{resolveTargetApps}from'../../commands/api/shared.js';export const apiPull={'service':a15_0x55b5d5(0x20f),'command':a15_0x55b5d5(0x21a),'description':'Pull\x20datasets\x20and\x20generate\x20API\x20config\x20files\x20(./src/api/)','risk':a15_0x55b5d5(0x206),'requiresAppCode':!![],'hasFormat':![],'flags':[{...APPCODE_FLAG_OPTIONAL,'hidden':!![]},{'name':'output','type':a15_0x55b5d5(0x201),'description':a15_0x55b5d5(0x212)}],async 'execute'(_0x49df8e){const _0x4270cd=a15_0x55b5d5,_0x5b42b8=_0x49df8e[_0x4270cd(0x1f8)]('appcode'),_0x1e1051=_0x49df8e[_0x4270cd(0x1f8)](_0x4270cd(0x207))||undefined,_0x2e83a3=resolveTargetApps(_0x49df8e,_0x5b42b8);if(_0x2e83a3){let _0x4c252b=0x0,_0x3621f0=0x0;for(const _0x12cff0 of _0x2e83a3){const _0xe37d96=_0x12cff0[_0x4270cd(0x202)]||_0x49df8e['cookie'],_0x5839d1=_0x12cff0[_0x4270cd(0x204)]||_0x4270cd(0x20a);initEnv(_0x5839d1);const _0x17ffc1=_0x12cff0[_0x4270cd(0x21f)]||_0x1e1051||_0x4270cd(0x20c),_0x40531f=_0x12cff0[_0x4270cd(0x1f4)]?'':_0x12cff0[_0x4270cd(0x21e)]||_0x12cff0[_0x4270cd(0x1fb)],_0x21b7cb=a15_0x44775d(_0x4270cd(0x211)+_0x12cff0[_0x4270cd(0x21e)]+'\x20('+_0x12cff0['appcode']+')...')[_0x4270cd(0x217)]();try{const {configArray:_0x2998c7}=await fetchModelList(_0x12cff0[_0x4270cd(0x1fb)],_0xe37d96),_0x31549d=await generateApiFile(_0x2998c7,_0x40531f,_0x12cff0[_0x4270cd(0x1fb)],_0x12cff0[_0x4270cd(0x1f4)],_0x5839d1,_0x17ffc1,_0x12cff0[_0x4270cd(0x21e)]);_0x21b7cb[_0x4270cd(0x1fc)](_0x12cff0[_0x4270cd(0x21e)]+':\x20'+_0x2998c7[_0x4270cd(0x209)]+_0x4270cd(0x208)+_0x31549d[_0x4270cd(0x203)]+_0x4270cd(0x1fd)),console['log'](_0x4270cd(0x216)+_0x31549d[_0x4270cd(0x21c)]),console[_0x4270cd(0x218)](_0x4270cd(0x216)+_0x31549d[_0x4270cd(0x200)]),_0x4c252b++;}catch(_0xeaf4d1){_0x21b7cb[_0x4270cd(0x220)](_0x12cff0['name']+':\x20'+(_0xeaf4d1 instanceof Error?_0xeaf4d1['message']:String(_0xeaf4d1))),_0x3621f0++;}}console['log']();if(_0x3621f0>0x0)console[_0x4270cd(0x215)]('!\x20'+_0x3621f0+_0x4270cd(0x219));return{'ok':_0x3621f0===0x0,'message':_0x4270cd(0x213)+_0x4c252b+_0x4270cd(0x210)+_0x3621f0+_0x4270cd(0x20e)};}const _0x5a607a=_0x5b42b8&&_0x5b42b8[_0x4270cd(0x1fe)]('-')?_0x5b42b8[_0x4270cd(0x21b)]('-')[_0x4270cd(0x1ff)](0x1)[_0x4270cd(0x1f9)]('-'):'',_0x3d5aec=_0x1e1051||_0x49df8e[_0x4270cd(0x21f)]||'./src/api/',_0x588a08=!_0x5b42b8,_0x13e96b=a15_0x44775d(_0x4270cd(0x1f1)+_0x49df8e[_0x4270cd(0x1f7)]+'...')[_0x4270cd(0x217)]();try{const {configArray:_0x350532}=await fetchModelList(_0x49df8e[_0x4270cd(0x1f7)],_0x49df8e[_0x4270cd(0x202)]),_0x4c75d0=await generateApiFile(_0x350532,_0x5a607a,_0x49df8e[_0x4270cd(0x1f7)],_0x588a08,getEnv(),_0x3d5aec);_0x13e96b['succeed'](_0x4270cd(0x20d)+_0x350532['length']+_0x4270cd(0x21d)+_0x4c75d0['modelCount']+_0x4270cd(0x1fd));const _0x2c7cd4=_0x5a607a?_0x5a607a+'-api':_0x4270cd(0x20f),_0x2abd05=_0x5a607a?_0x5a607a+_0x4270cd(0x1f6):_0x4270cd(0x222);return console[_0x4270cd(0x218)](_0x4270cd(0x216)+a15_0x26fd39['join'](_0x3d5aec,_0x2c7cd4+_0x4270cd(0x20b))),console[_0x4270cd(0x218)](_0x4270cd(0x216)+a15_0x26fd39['join'](_0x3d5aec,_0x2abd05+'.ts')),{'ok':!![],'data':{'datasetCount':_0x350532['length'],'modelCount':_0x4c75d0[_0x4270cd(0x203)]}};}catch(_0x54cd75){_0x13e96b[_0x4270cd(0x220)]('Failed:\x20'+(_0x54cd75 instanceof Error?_0x54cd75[_0x4270cd(0x1f0)]:String(_0x54cd75)));throw _0x54cd75;}}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a16_0x24ec(_0x271218,_0x364f62){_0x271218=_0x271218-0x1d7;const _0x5ca47b=a16_0x5ca4();let _0x24ecab=_0x5ca47b[_0x271218];return _0x24ecab;}(function(_0x6669d0,_0x24bb25){const _0x161cc5=a16_0x24ec,_0xf66daf=_0x6669d0();while(!![]){try{const _0x182ff2=parseInt(_0x161cc5(0x1e0))/0x1*(-parseInt(_0x161cc5(0x1e5))/0x2)+-parseInt(_0x161cc5(0x1da))/0x3*(parseInt(_0x161cc5(0x1e3))/0x4)+-parseInt(_0x161cc5(0x1d8))/0x5+parseInt(_0x161cc5(0x1dd))/0x6*(parseInt(_0x161cc5(0x1df))/0x7)+-parseInt(_0x161cc5(0x1dc))/0x8+parseInt(_0x161cc5(0x1e4))/0x9+-parseInt(_0x161cc5(0x1e2))/0xa*(-parseInt(_0x161cc5(0x1d9))/0xb);if(_0x182ff2===_0x24bb25)break;else _0xf66daf['push'](_0xf66daf['shift']());}catch(_0x380ba8){_0xf66daf['push'](_0xf66daf['shift']());}}}(a16_0x5ca4,0x6d200));function a16_0x5ca4(){const _0x1063d1=['14560lXAlyg','4efgNHP','2942145APWZeg','165526PRycxU','App\x20\x22','3498515esGnHC','8360owhTvu','1679112KMZXed','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','4058800HyEDHj','1726062AQQBVg','selectedAppName','21Gupkkx','1uEMapD','filter'];a16_0x5ca4=function(){return _0x1063d1;};return a16_0x5ca4();}import{getMultiAppConfigs}from'../../utils/config.js';import{CliErrors}from'../../errors.js';export function resolveTargetApps(_0x4839e6,_0xa65399){const _0x1155d7=a16_0x24ec;if(_0xa65399)return null;let _0x38c47e=getMultiAppConfigs();if(!_0x38c47e||_0x38c47e['length']===0x0)return null;if(_0x4839e6[_0x1155d7(0x1de)]){const _0x3e40b3=_0x38c47e[_0x1155d7(0x1e1)](_0x3a6a66=>_0x3a6a66['name']===_0x4839e6['selectedAppName']);if(_0x3e40b3['length']===0x0){const _0x97a583=_0x38c47e['map'](_0x1e3677=>_0x1e3677['name'])['join'](',\x20');throw CliErrors['validation'](_0x1155d7(0x1d7)+_0x4839e6[_0x1155d7(0x1de)]+_0x1155d7(0x1db)+_0x97a583);}_0x38c47e=_0x3e40b3;}return _0x38c47e;}
|
package/lib/commands/app/add.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a17_0x58290f=a17_0x4e38;function a17_0x159b(){const _0x127dbc=['1207768HsHSsw','Default\x20output\x20format\x20for\x20this\x20app\x20(profile)','env','Target\x20environment','validation','Access\x20key','add','pageSize','198668vJZJia','defaultApp','App\x20code','global','cookie','Auth\x20cookie','apiDir','boolean','apps','284Qidynt','riskLevel','name','flagMissing','locale','Add\x20or\x20update\x20an\x20app\x20in\x20config','write','141565MWVUXC','trim','Usage:\x20','Risk\x20level','entries','string','app','1290591qGuUjS','\x22\x20(appcode:\x20','10lurzKZ','Added','\x20app\x20add\x20<name>\x20--appcode\x20<code>','App\x20profile\x20name','appcode','accessKey','6wCAHHV','str','302652HysGrg','keys','length','16854TXJSmT','Default\x20page\x20size','1288655hPBGus','Missing\x20app\x20name.'];a17_0x159b=function(){return _0x127dbc;};return a17_0x159b();}(function(_0x130346,_0x48dba9){const _0x1607b8=a17_0x4e38,_0x122887=_0x130346();while(!![]){try{const _0x158519=-parseInt(_0x1607b8(0xd2))/0x1+-parseInt(_0x1607b8(0xf2))/0x2+parseInt(_0x1607b8(0xe6))/0x3*(parseInt(_0x1607b8(0xcb))/0x4)+-parseInt(_0x1607b8(0xe8))/0x5*(parseInt(_0x1607b8(0xe1))/0x6)+parseInt(_0x1607b8(0xe3))/0x7+parseInt(_0x1607b8(0xea))/0x8+parseInt(_0x1607b8(0xd9))/0x9*(parseInt(_0x1607b8(0xdb))/0xa);if(_0x158519===_0x48dba9)break;else _0x122887['push'](_0x122887['shift']());}catch(_0x40eb49){_0x122887['push'](_0x122887['shift']());}}}(a17_0x159b,0x3a11e));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readConfig,writeConfig,scopeLabel,migrateLegacySingleApp}from'../../commands/app/shared.js';const PROFILE_FLAG_KEYS={'env':a17_0x58290f(0xec),'apiDir':'apiDir','cookie':a17_0x58290f(0xf6),'accessKey':'accessKey','defaultFormat':'format','pageSize':a17_0x58290f(0xf1),'riskLevel':a17_0x58290f(0xcc),'locale':a17_0x58290f(0xcf)};async function validateArgs(_0x32b155){const _0x367b30=a17_0x58290f,_0x3fe61e=_0x32b155['args'][0x0]?.[_0x367b30(0xd3)]();if(!_0x3fe61e)throw CliErrors[_0x367b30(0xee)](_0x367b30(0xe9),_0x367b30(0xd4)+CLI_BIN_NAME+_0x367b30(0xdd));}async function execute(_0x167149){const _0xdd180c=a17_0x58290f,_0x3417ff=_0x167149['args'][0x0]?.[_0xdd180c(0xd3)]();if(!_0x3417ff)throw CliErrors['validation'](_0xdd180c(0xe9),_0xdd180c(0xd4)+CLI_BIN_NAME+_0xdd180c(0xdd));const _0x5f6b3b=_0x167149[_0xdd180c(0xe2)](_0xdd180c(0xdf));if(!_0x5f6b3b)throw CliErrors[_0xdd180c(0xce)](_0xdd180c(0xdf),_0xdd180c(0xd4)+CLI_BIN_NAME+_0xdd180c(0xdd));const _0x3f8445={'global':_0x167149['bool'](_0xdd180c(0xf5))},_0x346418=readConfig(_0x3f8445);if(!_0x346418['apps'])_0x346418[_0xdd180c(0xca)]={};Object[_0xdd180c(0xe4)](_0x346418[_0xdd180c(0xca)])[_0xdd180c(0xe5)]===0x0&&migrateLegacySingleApp(_0x346418,_0x3417ff);const _0x4815fc={'appcode':_0x5f6b3b};for(const [_0x37f023,_0x14a5fd]of Object[_0xdd180c(0xd6)](PROFILE_FLAG_KEYS)){const _0x6a22b4=_0x167149['str'](_0x37f023);_0x6a22b4&&(_0x4815fc[_0x14a5fd]=_0x14a5fd===_0xdd180c(0xf1)?Number(_0x6a22b4):_0x6a22b4);}const _0x178c5d=_0x346418['apps'],_0x4f39de=!!_0x178c5d[_0x3417ff];_0x178c5d[_0x3417ff]=_0x4815fc;if(!_0x346418[_0xdd180c(0xf3)])_0x346418['defaultApp']=_0x3417ff;writeConfig(_0x346418,_0x3f8445);const _0x43f9b6=!_0x4f39de&&_0x346418[_0xdd180c(0xf3)]===_0x3417ff?'\x20Set\x20as\x20default\x20app.':'';return{'ok':!![],'message':(_0x4f39de?'Updated':_0xdd180c(0xdc))+'\x20app\x20\x22'+_0x3417ff+_0xdd180c(0xda)+_0x5f6b3b+')'+scopeLabel(_0x3f8445)+'.'+_0x43f9b6};}function a17_0x4e38(_0x18819b,_0x20833e){_0x18819b=_0x18819b-0xc8;const _0x159b62=a17_0x159b();let _0x4e3862=_0x159b62[_0x18819b];return _0x4e3862;}export const appAddDefinition={'service':a17_0x58290f(0xd8),'command':a17_0x58290f(0xf0),'description':a17_0x58290f(0xd0),'risk':a17_0x58290f(0xd1),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a17_0x58290f(0xcd),'description':a17_0x58290f(0xde),'required':!![]}],'flags':[{'name':a17_0x58290f(0xdf),'type':'string','description':a17_0x58290f(0xf4),'required':!![]},{'name':a17_0x58290f(0xf5),'type':a17_0x58290f(0xc9),'description':'Use\x20global\x20config\x20scope','default':![]},{'name':'env','type':'string','description':a17_0x58290f(0xed)},{'name':a17_0x58290f(0xc8),'type':a17_0x58290f(0xd7),'description':'API\x20directory\x20path'},{'name':'cookie','type':a17_0x58290f(0xd7),'description':a17_0x58290f(0xf7),'hidden':!![]},{'name':a17_0x58290f(0xe0),'type':'string','description':a17_0x58290f(0xef),'hidden':!![]},{'name':'defaultFormat','type':a17_0x58290f(0xd7),'description':a17_0x58290f(0xeb)},{'name':a17_0x58290f(0xf1),'type':'number','description':a17_0x58290f(0xe7)},{'name':a17_0x58290f(0xcc),'type':'string','description':a17_0x58290f(0xd5)},{'name':a17_0x58290f(0xcf),'type':a17_0x58290f(0xd7),'description':'Locale'}],'validate':validateArgs,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x87a9fc,_0x124a2c){const _0x1de175=a18_0x5977,_0x4913e9=_0x87a9fc();while(!![]){try{const _0x6759fa=parseInt(_0x1de175(0x18d))/0x1*(parseInt(_0x1de175(0x18e))/0x2)+parseInt(_0x1de175(0x18f))/0x3+parseInt(_0x1de175(0x190))/0x4+-parseInt(_0x1de175(0x191))/0x5+-parseInt(_0x1de175(0x18c))/0x6+-parseInt(_0x1de175(0x193))/0x7*(parseInt(_0x1de175(0x192))/0x8)+-parseInt(_0x1de175(0x194))/0x9;if(_0x6759fa===_0x124a2c)break;else _0x4913e9['push'](_0x4913e9['shift']());}catch(_0x5bdb31){_0x4913e9['push'](_0x4913e9['shift']());}}}(a18_0x5691,0x5cd28));import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/remote.js';import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';function a18_0x5977(_0x172398,_0x5cb6f0){_0x172398=_0x172398-0x18c;const _0x5691f2=a18_0x5691();let _0x597709=_0x5691f2[_0x172398];return _0x597709;}function a18_0x5691(){const _0x121ea6=['2obzSxg','2198046sfSuoJ','2870992YXAWPx','1245000rOwtTh','370072FdyZWI','77ZhpYiz','809541TqtlXm','2007930ChrxOl','112223ERDqyX'];a18_0x5691=function(){return _0x121ea6;};return a18_0x5691();}export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];
|