@lovrabet/cli 1.1.15 → 1.1.16

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.
Files changed (56) hide show
  1. package/README.md +41 -0
  2. package/lib/add-page/input-page-router.js +1 -1
  3. package/lib/add-page/main.js +1 -1
  4. package/lib/add-page/select-page-template.js +1 -1
  5. package/lib/api/api-doc-ui.js +1 -1
  6. package/lib/api/api-doc.js +1 -1
  7. package/lib/api/api-pull-ui.js +1 -1
  8. package/lib/api/fetch-datasets.js +1 -1
  9. package/lib/api/format-dataset.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/api/pull.js +1 -1
  14. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  15. package/lib/app-menu/create-menu.js +1 -1
  16. package/lib/app-menu/get-local-pages.js +1 -1
  17. package/lib/app-menu/get-online-menu-list.js +1 -1
  18. package/lib/app-menu/valid-url.js +1 -1
  19. package/lib/auth/auth-server-ui.js +1 -1
  20. package/lib/auth/auth-server.js +1 -1
  21. package/lib/auth/constant.js +1 -1
  22. package/lib/auth/get-cookie.js +1 -1
  23. package/lib/auth/is-session-valid.js +1 -1
  24. package/lib/auth/logout.js +1 -1
  25. package/lib/cli.js +1 -1
  26. package/lib/cmd/build-watch.js +1 -1
  27. package/lib/cmd/build.js +1 -1
  28. package/lib/cmd/logs.js +1 -1
  29. package/lib/cmd/preview.js +1 -1
  30. package/lib/cmd/start.js +1 -1
  31. package/lib/config/config-help.js +1 -1
  32. package/lib/config/main.js +1 -1
  33. package/lib/constant/domain.js +1 -1
  34. package/lib/constant/env.js +1 -1
  35. package/lib/create-app/enhanced-guided-create.js +1 -1
  36. package/lib/create-app/format-elapsed.js +1 -1
  37. package/lib/create-app/main.js +1 -1
  38. package/lib/create-app/task-finished.js +1 -1
  39. package/lib/create-app/task-loading.js +1 -1
  40. package/lib/create-app/task-running.js +1 -1
  41. package/lib/create-app/task-time.js +1 -1
  42. package/lib/create-app/use-copy-project-template.js +1 -1
  43. package/lib/create-app/use-format-code.js +1 -1
  44. package/lib/create-app/use-install-dependencies.js +1 -1
  45. package/lib/help.js +1 -1
  46. package/lib/init/main.js +1 -1
  47. package/lib/utils/config.js +1 -1
  48. package/lib/utils/copy-directory.js +1 -1
  49. package/lib/utils/http-client.js +1 -1
  50. package/lib/utils/logger.js +1 -1
  51. package/lib/utils/router-updater.js +1 -1
  52. package/lib/utils/sleep.js +1 -1
  53. package/lib/utils/template-replacer.js +1 -1
  54. package/package.json +1 -1
  55. package/templates/pages/blank/index.tsx.tpl +2 -1
  56. package/templates/pages/sdk-fetch/index.tsx.tpl +1 -0
package/README.md CHANGED
@@ -8,6 +8,7 @@
8
8
  - 📄 **智能页面生成** - 自动生成页面组件和路由配置
9
9
  - 🔐 **统一身份认证** - 集成 Lovrabet 平台登录和权限管理
10
10
  - 🌐 **API 自动生成** - 根据数据集自动生成 API 配置文件
11
+ - 📋 **菜单智能同步** - 自动扫描本地页面并同步菜单到平台,支持多种命名策略
11
12
  - ⚡ **开发服务器** - 内置热更新开发服务器
12
13
  - 🏗️ **智能构建** - 优化的生产环境构建配置
13
14
  - 📦 **模板管理** - 丰富的项目模板和组件模板
@@ -152,6 +153,30 @@ lovrabet add page
152
153
  - **清理令牌**: 清除本地保存的认证信息
153
154
  - **安全退出**: 通知服务器撤销令牌
154
155
 
156
+ ### 菜单管理
157
+
158
+ #### `lovrabet menu sync`
159
+
160
+ 同步本地页面到 Lovrabet 平台菜单
161
+
162
+ ```bash
163
+ lovrabet menu sync
164
+ ```
165
+
166
+ - **自动扫描**: 扫描 `src/pages` 目录下的所有页面
167
+ - **智能对比**: 对比本地和平台菜单,找出缺失项
168
+ - **智能命名**: 支持多种菜单名称提取策略(详见文档)
169
+ - **批量创建**: 一键创建所有缺失的菜单项
170
+
171
+ **菜单名称提取优先级**:
172
+
173
+ 1. **Title 注释**(最高优先级)- 在文件顶部注释中添加 `Title: 菜单名称`
174
+ 2. **displayName 属性** - 组件的 `displayName` 属性
175
+ 3. **组件名** - `export default` 的组件名(PascalCase)
176
+ 4. **文件路径**(兜底)- 使用相对路径作为菜单名
177
+
178
+ > 💡 **推荐做法**:使用 `Title:` 注释,可以设置中文菜单名,更加清晰易懂。
179
+
155
180
  ### 配置管理
156
181
 
157
182
  #### `lovrabet init`
@@ -330,6 +355,22 @@ lovrabet logs --clear
330
355
 
331
356
  ## 📝 What's New
332
357
 
358
+ ### v1.1.15 (2025-01-05)
359
+
360
+ **新增功能 (New Features):**
361
+
362
+ - ✨ **菜单同步智能标题提取** - `lovrabet menu sync` 命令一键将二开应用工程自动同步到Lovrabet生成的业务系统,瞬间完成主子应用合并,无需执行繁琐的手动配置。
363
+ **核心特性:**
364
+ - 🎯 **支持中文菜单名** - 使用 Title 注释可以直接写中文,用户体验更友好
365
+ - 📋 **优先级清晰** - Title > displayName > 组件名 > 文件路径
366
+ - 🔧 **灵活配置** - 支持多种命名策略,满足不同团队习惯
367
+ - ✅ **自动回退** - 即使没有设置,也能自动使用文件路径作为兜底
368
+ - 🛡️ **格式容错** - Title 支持大小写、单双星号注释等多种格式
369
+
370
+ 详情点击此处 [lovrabet menu sync](https://open.lovrabet.com/docs/lovrabet-cli/menu-sync)
371
+
372
+ ---
373
+
333
374
  ### v1.1.12 (2025-10-17)
334
375
 
335
376
  **新增功能 (New Features):**
@@ -1 +1 @@
1
- (function(_0x4cf1a2,_0xfdac){const _0x1ccb1f=a0_0xc24e,_0x55ba7b=_0x4cf1a2();while(!![]){try{const _0x327870=parseInt(_0x1ccb1f(0x1ba))/0x1+parseInt(_0x1ccb1f(0x1cc))/0x2+parseInt(_0x1ccb1f(0x1be))/0x3*(-parseInt(_0x1ccb1f(0x1c7))/0x4)+parseInt(_0x1ccb1f(0x1c0))/0x5+parseInt(_0x1ccb1f(0x1bf))/0x6*(-parseInt(_0x1ccb1f(0x1c6))/0x7)+-parseInt(_0x1ccb1f(0x1c9))/0x8+-parseInt(_0x1ccb1f(0x1c5))/0x9*(-parseInt(_0x1ccb1f(0x1cb))/0xa);if(_0x327870===_0xfdac)break;else _0x55ba7b['push'](_0x55ba7b['shift']());}catch(_0x1c7be){_0x55ba7b['push'](_0x55ba7b['shift']());}}}(a0_0x1f7f,0x595dc));import{jsx as a0_0x278c5b,jsxs as a0_0xae2c6}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a0_0xc24e(_0x5e2107,_0x2d802a){const _0x1f7f42=a0_0x1f7f();return a0_0xc24e=function(_0xc24edf,_0x28ab2c){_0xc24edf=_0xc24edf-0x1b5;let _0x1e1885=_0x1f7f42[_0xc24edf];return _0x1e1885;},a0_0xc24e(_0x5e2107,_0x2d802a);}import a0_0x22fe73 from'node:fs';export function InputProjectCode(_0x5d24ea){const _0x69867=a0_0xc24e,{onSubmit:_0x5eccc,pagePath:_0x55ee95}=_0x5d24ea,[_0x530398,_0x4a0af9]=useState(''),[_0x27418f,_0x57eb96]=useState(''),_0x2693f6=_0x69867(0x1bc);function _0x4c691d(_0x4cc8b1){const _0x2ca465=_0x69867;if(_0x4cc8b1[_0x2ca465(0x1ce)]>0x64)return{'valid':![],'message':_0x2ca465(0x1c3)};if(_0x4cc8b1[_0x2ca465(0x1cd)]('/')||_0x4cc8b1[_0x2ca465(0x1c2)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x4cc8b1[_0x2ca465(0x1b5)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0x1d8072=_0x4cc8b1[_0x2ca465(0x1b9)]('/');for(const _0x5a8d10 of _0x1d8072){if(!_0x5a8d10)continue;const _0x22c03d=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x22c03d[_0x2ca465(0x1c1)](_0x5a8d10))return{'valid':![],'message':'路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};}return{'valid':!![]};}return useInput((_0x3c16c0,_0x383e6a)=>{const _0x4033f8=_0x69867;if(_0x383e6a[_0x4033f8(0x1b6)]){const _0x30bb4a=_0x530398['trim']()||_0x2693f6;if(_0x27418f)return;const _0x4ee882=_0x55ee95+'/'+_0x30bb4a;if(a0_0x22fe73[_0x4033f8(0x1c4)](_0x4ee882)){_0x57eb96('页面路径\x20'+_0x30bb4a+_0x4033f8(0x1c8));return;}_0x5eccc(_0x30bb4a),_0x4a0af9(''),_0x57eb96('');}else _0x383e6a['backspace']||_0x383e6a[_0x4033f8(0x1d0)]?_0x4a0af9(_0x3db675=>{const _0x1f2db0=_0x4033f8,_0x132776=_0x3db675[_0x1f2db0(0x1bd)](0x0,-0x1),{valid:_0xb03411,message:_0xaeded}=_0x4c691d(_0x132776);return _0x57eb96(_0xb03411?'':_0xaeded||_0x1f2db0(0x1b7)),_0x132776;}):_0x4a0af9(_0x4d6f60=>{const _0x11c295=_0x4033f8,_0x115da0=_0x4d6f60+_0x3c16c0,{valid:_0x48ca26,message:_0x59f18e}=_0x4c691d(_0x115da0);return _0x57eb96(_0x48ca26?'':_0x59f18e||_0x11c295(0x1b7)),_0x115da0;});}),a0_0xae2c6(Box,{'flexDirection':'column','children':[a0_0xae2c6(Box,{'children':[a0_0x278c5b(Text,{'color':_0x69867(0x1ca),'children':'\x20Step2:\x20'}),a0_0x278c5b(Text,{'children':'页面路由地址:\x20'}),_0x530398?a0_0x278c5b(Text,{'color':_0x69867(0x1cf),'children':_0x530398}):a0_0x278c5b(Text,{'color':_0x69867(0x1ca),'children':_0x2693f6}),_0x27418f&&a0_0xae2c6(Text,{'color':_0x69867(0x1bb),'children':[_0x69867(0x1b8),_0x27418f]})]}),!_0x27418f&&!_0x530398&&a0_0x278c5b(Box,{'children':a0_0x278c5b(Text,{'color':_0x69867(0x1ca),'children':_0x69867(0x1d1)})})]});}function a0_0x1f7f(){const _0x2dfe4e=['页面路径长度不能超过\x20100\x20个字符','existsSync','507168SdcSFT','44674nDJhhL','4HayPWS','\x20已存在,请使用其他路径','3832728QiaWyi','gray','80usTUez','193144BYjNTF','startsWith','length','green','delete','\x20直接回车确认,或输入自定义路由地址','includes','return','页面路径不合法','\x20←\x20','split','99172cDMRHv','red','my-page','slice','326229qGDLGP','318KYnJaI','3227820LmovVb','test','endsWith'];a0_0x1f7f=function(){return _0x2dfe4e;};return a0_0x1f7f();}
1
+ (function(_0x40ec6a,_0x21660d){const _0x304e2d=a0_0x59c8,_0x562a31=_0x40ec6a();while(!![]){try{const _0x16e6b8=-parseInt(_0x304e2d(0x12e))/0x1+parseInt(_0x304e2d(0x136))/0x2*(-parseInt(_0x304e2d(0x122))/0x3)+parseInt(_0x304e2d(0x12c))/0x4+parseInt(_0x304e2d(0x127))/0x5*(parseInt(_0x304e2d(0x13a))/0x6)+parseInt(_0x304e2d(0x139))/0x7+-parseInt(_0x304e2d(0x131))/0x8*(parseInt(_0x304e2d(0x12a))/0x9)+parseInt(_0x304e2d(0x137))/0xa;if(_0x16e6b8===_0x21660d)break;else _0x562a31['push'](_0x562a31['shift']());}catch(_0x1270ea){_0x562a31['push'](_0x562a31['shift']());}}}(a0_0x3204,0xc9dee));import{jsx as a0_0x5d7857,jsxs as a0_0x3a6988}from'react/jsx-runtime';function a0_0x3204(){const _0x148432=['my-page','existsSync','green','路径不能以\x20/\x20开头或结尾','5ZcgTIn','includes','页面路径长度不能超过\x20100\x20个字符','9EJPIDR','trim','461096tFWrAY','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','640825PDGXjF','test','return','4834344xfojGs','length','gray','split','slice','129468UdWoSK','15056320bjYXfU','\x20←\x20','3959179OupoCt','6304134FVCnEy','delete','\x20已存在,请使用其他路径','页面路径不合法','\x20Step2:\x20','路径不能包含连续的\x20/','页面路由地址:\x20','startsWith','endsWith','backspace','54aldvbm'];a0_0x3204=function(){return _0x148432;};return a0_0x3204();}function a0_0x59c8(_0x6ef2da,_0xfce13){const _0x32049e=a0_0x3204();return a0_0x59c8=function(_0x59c82a,_0x2537b2){_0x59c82a=_0x59c82a-0x11a;let _0x2f7a07=_0x32049e[_0x59c82a];return _0x2f7a07;},a0_0x59c8(_0x6ef2da,_0xfce13);}import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x5574c9 from'node:fs';export function InputProjectCode(_0x2632ec){const _0x27fe48=a0_0x59c8,{onSubmit:_0x39a85e,pagePath:_0x2ee15e}=_0x2632ec,[_0x4c9a1c,_0x2380c8]=useState(''),[_0x18c6cf,_0x1f2a39]=useState(''),_0xd81c48=_0x27fe48(0x123);function _0x1e6d47(_0x9ac2cf){const _0x527206=_0x27fe48;if(_0x9ac2cf[_0x527206(0x132)]>0x64)return{'valid':![],'message':_0x527206(0x129)};if(_0x9ac2cf[_0x527206(0x11f)]('/')||_0x9ac2cf[_0x527206(0x120)]('/'))return{'valid':![],'message':_0x527206(0x126)};if(_0x9ac2cf[_0x527206(0x128)]('//'))return{'valid':![],'message':_0x527206(0x11d)};const _0x409b8d=_0x9ac2cf[_0x527206(0x134)]('/');for(const _0x121fc6 of _0x409b8d){if(!_0x121fc6)continue;const _0x1dbfbf=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x1dbfbf[_0x527206(0x12f)](_0x121fc6))return{'valid':![],'message':_0x527206(0x12d)};}return{'valid':!![]};}return useInput((_0x122922,_0x1ad5c2)=>{const _0x3ebc1e=_0x27fe48;if(_0x1ad5c2[_0x3ebc1e(0x130)]){const _0x30ff66=_0x4c9a1c[_0x3ebc1e(0x12b)]()||_0xd81c48;if(_0x18c6cf)return;const _0x144bee=_0x2ee15e+'/'+_0x30ff66;if(a0_0x5574c9[_0x3ebc1e(0x124)](_0x144bee)){_0x1f2a39('页面路径\x20'+_0x30ff66+_0x3ebc1e(0x11a));return;}_0x39a85e(_0x30ff66),_0x2380c8(''),_0x1f2a39('');}else _0x1ad5c2[_0x3ebc1e(0x121)]||_0x1ad5c2[_0x3ebc1e(0x13b)]?_0x2380c8(_0x5984e2=>{const _0x4e6cd3=_0x3ebc1e,_0x179a8c=_0x5984e2[_0x4e6cd3(0x135)](0x0,-0x1),{valid:_0x196233,message:_0x137ba2}=_0x1e6d47(_0x179a8c);return _0x1f2a39(_0x196233?'':_0x137ba2||_0x4e6cd3(0x11b)),_0x179a8c;}):_0x2380c8(_0xf72d22=>{const _0x4894eb=_0x3ebc1e,_0x14aecb=_0xf72d22+_0x122922,{valid:_0x118688,message:_0x3a210d}=_0x1e6d47(_0x14aecb);return _0x1f2a39(_0x118688?'':_0x3a210d||_0x4894eb(0x11b)),_0x14aecb;});}),a0_0x3a6988(Box,{'flexDirection':'column','children':[a0_0x3a6988(Box,{'children':[a0_0x5d7857(Text,{'color':_0x27fe48(0x133),'children':_0x27fe48(0x11c)}),a0_0x5d7857(Text,{'children':_0x27fe48(0x11e)}),_0x4c9a1c?a0_0x5d7857(Text,{'color':_0x27fe48(0x125),'children':_0x4c9a1c}):a0_0x5d7857(Text,{'color':'gray','children':_0xd81c48}),_0x18c6cf&&a0_0x3a6988(Text,{'color':'red','children':[_0x27fe48(0x138),_0x18c6cf]})]}),!_0x18c6cf&&!_0x4c9a1c&&a0_0x5d7857(Box,{'children':a0_0x5d7857(Text,{'color':_0x27fe48(0x133),'children':'\x20直接回车确认,或输入自定义路由地址'})})]});}
@@ -1 +1 @@
1
- const a1_0x2f1410=a1_0x58ae;(function(_0x5c11b2,_0x3d5854){const _0x13c2e2=a1_0x58ae,_0x189ab1=_0x5c11b2();while(!![]){try{const _0x4300ca=parseInt(_0x13c2e2(0x19a))/0x1*(-parseInt(_0x13c2e2(0x17c))/0x2)+parseInt(_0x13c2e2(0x181))/0x3+-parseInt(_0x13c2e2(0x187))/0x4+-parseInt(_0x13c2e2(0x192))/0x5*(parseInt(_0x13c2e2(0x178))/0x6)+parseInt(_0x13c2e2(0x19e))/0x7+-parseInt(_0x13c2e2(0x185))/0x8+parseInt(_0x13c2e2(0x18d))/0x9;if(_0x4300ca===_0x3d5854)break;else _0x189ab1['push'](_0x189ab1['shift']());}catch(_0x17a346){_0x189ab1['push'](_0x189ab1['shift']());}}}(a1_0x227b,0xcaee6));import{jsx as a1_0x409617,jsxs as a1_0x3200b1,Fragment as a1_0xc3305e}from'react/jsx-runtime';function a1_0x227b(){const _0x3f7d17=['catch','cyan','info','now','21582441GEOHmi','green','gray','pages','column','15kCvFtZ','join','dirname','已选择页面模板\x20','url','\x20Step1:\x20','开始添加页面:\x20','processTemplate','659473yVJiSx','页面添加失败:\x20','\x20*\x20页面路径:\x20','\x20*\x20页面文件已创建,可直接通过路由访问','7912135BrxAmF','1999374OTliGM','setLogPath','message','页面添加成功:\x20','4srOynV','src','cwd','../../templates/pages','resolve','4491195ZcVScl','\x20Step2:\x20','success','error','10074432cmlGgE','add-page','2465104wvUbFT','正在创建页面,请稍候…'];a1_0x227b=function(){return _0x3f7d17;};return a1_0x227b();}import{fileURLToPath}from'node:url';import a1_0x34e22f from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a1_0x58ae(_0x55cb4d,_0x178042){const _0x227b53=a1_0x227b();return a1_0x58ae=function(_0x58ae53,_0x5351a5){_0x58ae53=_0x58ae53-0x178;let _0x54380e=_0x227b53[_0x58ae53];return _0x54380e;},a1_0x58ae(_0x55cb4d,_0x178042);}import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x34e22f[a1_0x2f1410(0x194)](fileURLToPath(import.meta[a1_0x2f1410(0x196)])),pageTemplateDir=a1_0x34e22f[a1_0x2f1410(0x180)](__dirname,a1_0x2f1410(0x17f)),projectDir=process['cwd']();export const AddPage=()=>{const _0xcad06b=a1_0x2f1410,{exit:_0x3b0a61}=useApp(),[_0x203f44,_0x3b4514]=useState(''),[_0x435d94,_0x16bc2a]=useState(''),[_0x2b4ceb,_0x2e5e09]=useState(![]),[_0x43bcb4,_0x2eeb32]=useState(![]),_0x22d2de=a1_0x34e22f[_0xcad06b(0x193)](projectDir,_0xcad06b(0x17d),'pages'),_0x236e67=a1_0x34e22f[_0xcad06b(0x193)](_0x22d2de,_0x435d94),_0x4243b1=a1_0x34e22f[_0xcad06b(0x193)]('src',_0xcad06b(0x190),_0x435d94);useEffect(()=>{const _0x36e6ee=_0xcad06b,_0x2609ee=a1_0x34e22f['resolve'](pageTemplateDir,_0x203f44);if(_0x203f44&&_0x435d94){_0x2e5e09(!![]),logger[_0x36e6ee(0x179)](process[_0x36e6ee(0x17e)]());const _0x224099=Date[_0x36e6ee(0x18c)]();logger[_0x36e6ee(0x18b)]('add-page',_0x36e6ee(0x198)+_0x435d94,{'template':_0x203f44,'targetPath':_0x4243b1}),TemplateReplacer[_0x36e6ee(0x199)](_0x2609ee,a1_0x34e22f[_0x36e6ee(0x193)](_0x22d2de,_0x435d94),_0x435d94,_0x203f44)['then'](()=>{const _0x8c781d=_0x36e6ee,_0x5e3709=Date[_0x8c781d(0x18c)]()-_0x224099;logger[_0x8c781d(0x183)](_0x8c781d(0x186),_0x8c781d(0x17b)+_0x435d94,_0x5e3709,{'template':_0x203f44,'targetPath':_0x4243b1,'routePath':_0x435d94}),_0x2eeb32(!![]);})[_0x36e6ee(0x189)](_0xf3f1d3=>{const _0x4b738e=_0x36e6ee,_0x457202=Date[_0x4b738e(0x18c)]()-_0x224099;logger[_0x4b738e(0x184)](_0x4b738e(0x186),_0x4b738e(0x19b)+_0x435d94,{'template':_0x203f44,'targetPath':_0x4243b1,'error':_0xf3f1d3 instanceof Error?_0xf3f1d3[_0x4b738e(0x17a)]:String(_0xf3f1d3),'duration':_0x457202});})['finally'](()=>{_0x2e5e09(![]);});}},[_0x203f44,_0x435d94]),useEffect(()=>{_0x43bcb4&&setTimeout(()=>{_0x3b0a61();});},[_0x43bcb4]);if(_0x203f44)return a1_0x3200b1(Box,{'flexDirection':_0xcad06b(0x191),'paddingY':0x1,'children':[a1_0x3200b1(Box,{'children':[a1_0x409617(Text,{'color':_0xcad06b(0x18f),'children':_0xcad06b(0x197)}),a1_0x409617(Text,{'children':_0xcad06b(0x195)}),a1_0x409617(Text,{'color':'green','children':_0x203f44})]}),_0x435d94?a1_0x3200b1(Box,{'children':[a1_0x409617(Text,{'color':_0xcad06b(0x18f),'children':_0xcad06b(0x182)}),a1_0x409617(Text,{'children':'已输入的页面路由\x20'}),a1_0x409617(Text,{'color':_0xcad06b(0x18e),'children':_0x435d94})]}):a1_0x409617(InputProjectCode,{'pagePath':_0x236e67,'onSubmit':_0x16bc2a}),_0x435d94&&_0x2b4ceb?a1_0x3200b1(Box,{'marginTop':0x1,'children':[a1_0x409617(Box,{'width':'4'}),a1_0x409617(Text,{'children':_0xcad06b(0x188)})]}):null,_0x43bcb4?a1_0x3200b1(a1_0xc3305e,{'children':[a1_0x409617(Box,{'marginTop':0x1,'children':a1_0x409617(Text,{'color':_0xcad06b(0x18f),'children':'\x20*\x20页面创建成功!'})}),a1_0x3200b1(Box,{'children':[a1_0x409617(Text,{'color':_0xcad06b(0x18f),'children':_0xcad06b(0x19c)}),a1_0x409617(Text,{'color':_0xcad06b(0x18e),'children':_0x4243b1})]}),a1_0x3200b1(Box,{'children':[a1_0x409617(Text,{'color':_0xcad06b(0x18f),'children':'\x20*\x20路由地址:\x20'}),a1_0x3200b1(Text,{'color':_0xcad06b(0x18e),'children':['/',_0x435d94]})]}),a1_0x409617(Box,{'marginTop':0x1,'children':a1_0x409617(Text,{'color':_0xcad06b(0x18a),'children':_0xcad06b(0x19d)})})]}):null]});return a1_0x409617(SelectPageTemplate,{'onSelect':_0x3b4514});};
1
+ const a1_0x4b5cdb=a1_0x10db;(function(_0x530d79,_0xd356a7){const _0x1c86b9=a1_0x10db,_0x291f6a=_0x530d79();while(!![]){try{const _0x31c8f0=parseInt(_0x1c86b9(0x20e))/0x1+-parseInt(_0x1c86b9(0x1ea))/0x2*(-parseInt(_0x1c86b9(0x207))/0x3)+-parseInt(_0x1c86b9(0x20c))/0x4*(parseInt(_0x1c86b9(0x20b))/0x5)+parseInt(_0x1c86b9(0x1f6))/0x6+-parseInt(_0x1c86b9(0x1fb))/0x7+-parseInt(_0x1c86b9(0x209))/0x8*(-parseInt(_0x1c86b9(0x1f8))/0x9)+-parseInt(_0x1c86b9(0x1ee))/0xa*(parseInt(_0x1c86b9(0x1f0))/0xb);if(_0x31c8f0===_0xd356a7)break;else _0x291f6a['push'](_0x291f6a['shift']());}catch(_0x41872f){_0x291f6a['push'](_0x291f6a['shift']());}}}(a1_0x4909,0x3df85));import{jsx as a1_0x35604c,jsxs as a1_0x4d4df3,Fragment as a1_0x5565d2}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x24f5b6 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a1_0x10db(_0x459902,_0x2e13aa){const _0x490982=a1_0x4909();return a1_0x10db=function(_0x10dbd8,_0x3ec95e){_0x10dbd8=_0x10dbd8-0x1e7;let _0x2611fe=_0x490982[_0x10dbd8];return _0x2611fe;},a1_0x10db(_0x459902,_0x2e13aa);}function a1_0x4909(){const _0x418b47=['now','add-page','column','resolve','\x20*\x20页面创建成功!','success','dirname','已选择页面模板\x20','cyan','green','83151jdOgtn','cwd','140824kshhpi','\x20*\x20页面文件已创建,可直接通过路由访问','5jbEcKy','184432WlqSUl','error','121321tddInW','catch','message','gray','2hdZnuk','finally','pages','info','2380830aZUtfK','processTemplate','11xoBgtn','已输入的页面路由\x20','页面添加成功:\x20','\x20*\x20路由地址:\x20','\x20*\x20页面路径:\x20','join','1246782HizILL','开始添加页面:\x20','171eMkaPa','url','then','1072904GDYiFO','src'];a1_0x4909=function(){return _0x418b47;};return a1_0x4909();}const __dirname=a1_0x24f5b6[a1_0x4b5cdb(0x203)](fileURLToPath(import.meta[a1_0x4b5cdb(0x1f9)])),pageTemplateDir=a1_0x24f5b6['resolve'](__dirname,'../../templates/pages'),projectDir=process[a1_0x4b5cdb(0x208)]();export const AddPage=()=>{const _0x412040=a1_0x4b5cdb,{exit:_0x476bdf}=useApp(),[_0x54fc71,_0x36f33b]=useState(''),[_0x510529,_0x45ce6f]=useState(''),[_0x4d10e5,_0x19d478]=useState(![]),[_0x5027d2,_0x5d2512]=useState(![]),_0x47a5b6=a1_0x24f5b6[_0x412040(0x1f5)](projectDir,_0x412040(0x1fc),_0x412040(0x1ec)),_0x2591e7=a1_0x24f5b6[_0x412040(0x1f5)](_0x47a5b6,_0x510529),_0x6f2adf=a1_0x24f5b6[_0x412040(0x1f5)]('src',_0x412040(0x1ec),_0x510529);useEffect(()=>{const _0x55781a=_0x412040,_0x4c76d0=a1_0x24f5b6[_0x55781a(0x200)](pageTemplateDir,_0x54fc71);if(_0x54fc71&&_0x510529){_0x19d478(!![]),logger['setLogPath'](process[_0x55781a(0x208)]());const _0x14b046=Date['now']();logger[_0x55781a(0x1ed)](_0x55781a(0x1fe),_0x55781a(0x1f7)+_0x510529,{'template':_0x54fc71,'targetPath':_0x6f2adf}),TemplateReplacer[_0x55781a(0x1ef)](_0x4c76d0,a1_0x24f5b6[_0x55781a(0x1f5)](_0x47a5b6,_0x510529),_0x510529,_0x54fc71)[_0x55781a(0x1fa)](()=>{const _0x3ae264=_0x55781a,_0x5c49d6=Date[_0x3ae264(0x1fd)]()-_0x14b046;logger[_0x3ae264(0x202)]('add-page',_0x3ae264(0x1f2)+_0x510529,_0x5c49d6,{'template':_0x54fc71,'targetPath':_0x6f2adf,'routePath':_0x510529}),_0x5d2512(!![]);})[_0x55781a(0x1e7)](_0x4aab7d=>{const _0x4a537e=_0x55781a,_0x370816=Date['now']()-_0x14b046;logger[_0x4a537e(0x20d)](_0x4a537e(0x1fe),'页面添加失败:\x20'+_0x510529,{'template':_0x54fc71,'targetPath':_0x6f2adf,'error':_0x4aab7d instanceof Error?_0x4aab7d[_0x4a537e(0x1e8)]:String(_0x4aab7d),'duration':_0x370816});})[_0x55781a(0x1eb)](()=>{_0x19d478(![]);});}},[_0x54fc71,_0x510529]),useEffect(()=>{_0x5027d2&&setTimeout(()=>{_0x476bdf();});},[_0x5027d2]);if(_0x54fc71)return a1_0x4d4df3(Box,{'flexDirection':_0x412040(0x1ff),'paddingY':0x1,'children':[a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':'\x20Step1:\x20'}),a1_0x35604c(Text,{'children':_0x412040(0x204)}),a1_0x35604c(Text,{'color':_0x412040(0x206),'children':_0x54fc71})]}),_0x510529?a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':'\x20Step2:\x20'}),a1_0x35604c(Text,{'children':_0x412040(0x1f1)}),a1_0x35604c(Text,{'color':'green','children':_0x510529})]}):a1_0x35604c(InputProjectCode,{'pagePath':_0x2591e7,'onSubmit':_0x45ce6f}),_0x510529&&_0x4d10e5?a1_0x4d4df3(Box,{'marginTop':0x1,'children':[a1_0x35604c(Box,{'width':'4'}),a1_0x35604c(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x5027d2?a1_0x4d4df3(a1_0x5565d2,{'children':[a1_0x35604c(Box,{'marginTop':0x1,'children':a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':_0x412040(0x201)})}),a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':'gray','children':_0x412040(0x1f4)}),a1_0x35604c(Text,{'color':'green','children':_0x6f2adf})]}),a1_0x4d4df3(Box,{'children':[a1_0x35604c(Text,{'color':_0x412040(0x1e9),'children':_0x412040(0x1f3)}),a1_0x4d4df3(Text,{'color':'green','children':['/',_0x510529]})]}),a1_0x35604c(Box,{'marginTop':0x1,'children':a1_0x35604c(Text,{'color':_0x412040(0x205),'children':_0x412040(0x20a)})})]}):null]});return a1_0x35604c(SelectPageTemplate,{'onSelect':_0x36f33b});};
@@ -1 +1 @@
1
- (function(_0x375315,_0x4a3bf7){const _0x55ccd3=a2_0x53e6,_0x1b25bf=_0x375315();while(!![]){try{const _0xd00ed9=parseInt(_0x55ccd3(0x15c))/0x1+-parseInt(_0x55ccd3(0x173))/0x2*(parseInt(_0x55ccd3(0x15b))/0x3)+parseInt(_0x55ccd3(0x163))/0x4+parseInt(_0x55ccd3(0x164))/0x5+parseInt(_0x55ccd3(0x15d))/0x6+-parseInt(_0x55ccd3(0x177))/0x7*(parseInt(_0x55ccd3(0x16f))/0x8)+parseInt(_0x55ccd3(0x172))/0x9*(-parseInt(_0x55ccd3(0x176))/0xa);if(_0xd00ed9===_0x4a3bf7)break;else _0x1b25bf['push'](_0x1b25bf['shift']());}catch(_0x5d359e){_0x1b25bf['push'](_0x1b25bf['shift']());}}}(a2_0x34e7,0x4b755));import{jsx as a2_0x4c13f6,jsxs as a2_0x412c9e}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';function a2_0x53e6(_0x1b61be,_0x4c1f43){const _0x34e799=a2_0x34e7();return a2_0x53e6=function(_0x53e678,_0x14d8e8){_0x53e678=_0x53e678-0x158;let _0x3d10fe=_0x34e799[_0x53e678];return _0x3d10fe;},a2_0x53e6(_0x1b61be,_0x4c1f43);}import{readdir}from'node:fs/promises';import a2_0x48aafd from'node:path';import{fileURLToPath}from'node:url';function a2_0x34e7(){const _0xa3733f=['../..','name','899632LUplNA','2509225nRFvlZ','sdk-fetch','请选择您要创建的页面模板','downArrow','dirname','sort','templates/pages','localeCompare','return','onSelect','resolve','112XebnqR','gray','length','198uTUGah','30802cBMmFa','map','正在加载页面模板...','236390MFSaNF','157346teKgsu','upArrow','blank','label','\x20Step1:\x20','column','9sOprMJ','9211VsrgKw','2724396hxxZJV','获取模板列表失败:','url','\x20\x20\x20\x20\x20\x20>\x20'];a2_0x34e7=function(){return _0xa3733f;};return a2_0x34e7();}async function getTemplateList(){const _0x5bf23d=a2_0x53e6;try{const _0xa7eac7=fileURLToPath(import.meta[_0x5bf23d(0x15f)]),_0x114719=a2_0x48aafd[_0x5bf23d(0x16e)](a2_0x48aafd[_0x5bf23d(0x168)](_0xa7eac7),_0x5bf23d(0x161)),_0x5a0341=a2_0x48aafd['join'](_0x114719,_0x5bf23d(0x16a)),_0xde3ef7=await readdir(_0x5a0341,{'withFileTypes':!![]}),_0x2904aa=_0xde3ef7['filter'](_0x66623a=>_0x66623a['isDirectory']())[_0x5bf23d(0x174)](_0x124ed1=>({'label':_0x124ed1[_0x5bf23d(0x162)]}))[_0x5bf23d(0x169)]((_0x571553,_0x4f63e8)=>_0x571553[_0x5bf23d(0x158)][_0x5bf23d(0x16b)](_0x4f63e8['label']));return _0x2904aa;}catch(_0x44ade){return console['error'](_0x5bf23d(0x15e),_0x44ade),[{'label':_0x5bf23d(0x179)},{'label':_0x5bf23d(0x165)}];}}export function SelectPageTemplate(_0x2fcdfa){const _0x5f417a=a2_0x53e6,[_0x2f8818,_0x1c53b7]=useState(0x0),[_0x67f502,_0xf404e4]=useState([]),[_0x5c0cc6,_0x4787a6]=useState(!![]);useEffect(()=>{async function _0xec5640(){const _0x1ec9f9=await getTemplateList();_0xf404e4(_0x1ec9f9),_0x4787a6(![]);}_0xec5640();},[]),useInput((_0x12dee6,_0x219b10)=>{const _0x46c2d2=a2_0x53e6;if(_0x5c0cc6)return;if(_0x219b10[_0x46c2d2(0x16c)]){const _0x30f68d=_0x67f502[_0x2f8818];_0x30f68d&&_0x2fcdfa[_0x46c2d2(0x16d)](_0x30f68d['label']);}_0x219b10[_0x46c2d2(0x178)]&&_0x1c53b7(_0x19a36b=>_0x19a36b===0x0?_0x67f502[_0x46c2d2(0x171)]-0x1:_0x19a36b-0x1),_0x219b10[_0x46c2d2(0x167)]&&_0x1c53b7(_0x49963c=>_0x49963c===_0x67f502[_0x46c2d2(0x171)]-0x1?0x0:_0x49963c+0x1);});if(_0x5c0cc6)return a2_0x4c13f6(Box,{'flexDirection':_0x5f417a(0x15a),'paddingY':0x1,'children':a2_0x412c9e(Box,{'children':[a2_0x4c13f6(Text,{'color':_0x5f417a(0x170),'children':_0x5f417a(0x159)}),a2_0x4c13f6(Text,{'children':_0x5f417a(0x175)})]})});return a2_0x412c9e(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x412c9e(Box,{'children':[a2_0x4c13f6(Text,{'color':_0x5f417a(0x170),'children':'\x20Step1:\x20'}),a2_0x4c13f6(Text,{'children':_0x5f417a(0x166)})]}),_0x67f502['map']((_0x5c9874,_0x172fac)=>{const _0x4630c9=_0x5f417a,_0x373484=_0x172fac===_0x2f8818,_0x4e8483=_0x373484?_0x4630c9(0x160)+_0x5c9874['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x5c9874[_0x4630c9(0x158)];return a2_0x4c13f6(Box,{'children':a2_0x4c13f6(Text,{'color':_0x373484?'green':undefined,'children':_0x4e8483})},_0x4e8483);})]});}
1
+ (function(_0x1ca7d3,_0x20ec2c){const _0x18ac74=a2_0x5478,_0x293963=_0x1ca7d3();while(!![]){try{const _0xe351f1=parseInt(_0x18ac74(0x169))/0x1*(-parseInt(_0x18ac74(0x159))/0x2)+-parseInt(_0x18ac74(0x15e))/0x3*(-parseInt(_0x18ac74(0x175))/0x4)+parseInt(_0x18ac74(0x15c))/0x5*(-parseInt(_0x18ac74(0x166))/0x6)+parseInt(_0x18ac74(0x17b))/0x7+parseInt(_0x18ac74(0x176))/0x8*(parseInt(_0x18ac74(0x168))/0x9)+-parseInt(_0x18ac74(0x164))/0xa*(-parseInt(_0x18ac74(0x163))/0xb)+-parseInt(_0x18ac74(0x16e))/0xc;if(_0xe351f1===_0x20ec2c)break;else _0x293963['push'](_0x293963['shift']());}catch(_0xad8e28){_0x293963['push'](_0x293963['shift']());}}}(a2_0x72b1,0xc590d));import{jsx as a2_0x757fe5,jsxs as a2_0x3bec06}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';function a2_0x72b1(){const _0x165d05=['return','6HmxYMO','length','map','正在加载页面模板...','../..','6539489SssbkY','10omMpdC','\x20\x20\x20\x20\x20\x20>\x20','725262mFHCnR','name','11272077TIduNt','11488JwsNgE','url','请选择您要创建的页面模板','column','templates/pages','4973568TJKRVo','blank','filter','localeCompare','获取模板列表失败:','sdk-fetch','green','920428vBuFuU','8eCVoMK','downArrow','sort','upArrow','isDirectory','8107435YnwPOg','resolve','error','264xiqhlf','\x20Step1:\x20','dirname','30qPWIjR'];a2_0x72b1=function(){return _0x165d05;};return a2_0x72b1();}import{readdir}from'node:fs/promises';import a2_0x40375d from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x4c7317=a2_0x5478;try{const _0x3b582d=fileURLToPath(import.meta[_0x4c7317(0x16a)]),_0x17c986=a2_0x40375d[_0x4c7317(0x157)](a2_0x40375d[_0x4c7317(0x15b)](_0x3b582d),_0x4c7317(0x162)),_0x1d5ee3=a2_0x40375d['join'](_0x17c986,_0x4c7317(0x16d)),_0x2f7a27=await readdir(_0x1d5ee3,{'withFileTypes':!![]}),_0x1838eb=_0x2f7a27[_0x4c7317(0x170)](_0x398241=>_0x398241[_0x4c7317(0x17a)]())[_0x4c7317(0x160)](_0x40fa73=>({'label':_0x40fa73[_0x4c7317(0x167)]}))[_0x4c7317(0x178)]((_0xaca169,_0x1fb462)=>_0xaca169['label'][_0x4c7317(0x171)](_0x1fb462['label']));return _0x1838eb;}catch(_0x545bdf){return console[_0x4c7317(0x158)](_0x4c7317(0x172),_0x545bdf),[{'label':_0x4c7317(0x16f)},{'label':_0x4c7317(0x173)}];}}function a2_0x5478(_0x557db1,_0x42b30c){const _0x72b150=a2_0x72b1();return a2_0x5478=function(_0x54787e,_0x8697da){_0x54787e=_0x54787e-0x157;let _0xd13e80=_0x72b150[_0x54787e];return _0xd13e80;},a2_0x5478(_0x557db1,_0x42b30c);}export function SelectPageTemplate(_0x487b73){const _0x1a4a36=a2_0x5478,[_0x4d4b10,_0x2e0786]=useState(0x0),[_0xe7b32f,_0xe6a8e6]=useState([]),[_0x5b32bb,_0x11f7dc]=useState(!![]);useEffect(()=>{async function _0x58a0bc(){const _0x204235=await getTemplateList();_0xe6a8e6(_0x204235),_0x11f7dc(![]);}_0x58a0bc();},[]),useInput((_0x26d9ca,_0x3cf4ef)=>{const _0x3a27db=a2_0x5478;if(_0x5b32bb)return;if(_0x3cf4ef[_0x3a27db(0x15d)]){const _0x4d33df=_0xe7b32f[_0x4d4b10];_0x4d33df&&_0x487b73['onSelect'](_0x4d33df['label']);}_0x3cf4ef[_0x3a27db(0x179)]&&_0x2e0786(_0x478029=>_0x478029===0x0?_0xe7b32f['length']-0x1:_0x478029-0x1),_0x3cf4ef[_0x3a27db(0x177)]&&_0x2e0786(_0x464e8d=>_0x464e8d===_0xe7b32f[_0x3a27db(0x15f)]-0x1?0x0:_0x464e8d+0x1);});if(_0x5b32bb)return a2_0x757fe5(Box,{'flexDirection':_0x1a4a36(0x16c),'paddingY':0x1,'children':a2_0x3bec06(Box,{'children':[a2_0x757fe5(Text,{'color':'gray','children':_0x1a4a36(0x15a)}),a2_0x757fe5(Text,{'children':_0x1a4a36(0x161)})]})});return a2_0x3bec06(Box,{'flexDirection':'column','paddingY':0x1,'children':[a2_0x3bec06(Box,{'children':[a2_0x757fe5(Text,{'color':'gray','children':_0x1a4a36(0x15a)}),a2_0x757fe5(Text,{'children':_0x1a4a36(0x16b)})]}),_0xe7b32f[_0x1a4a36(0x160)]((_0x41b228,_0x470063)=>{const _0xe7268=_0x1a4a36,_0x1a9bd2=_0x470063===_0x4d4b10,_0x5d67a5=_0x1a9bd2?_0xe7268(0x165)+_0x41b228['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x41b228['label'];return a2_0x757fe5(Box,{'children':a2_0x757fe5(Text,{'color':_0x1a9bd2?_0xe7268(0x174):undefined,'children':_0x5d67a5})},_0x5d67a5);})]});}
@@ -1 +1 @@
1
- function a3_0x1699(){const _0x2391cb=['1562BatPwC','.md\x20(','duplicateCount','map','*\x20生成的文档文件:','lovrabet\x20auth','正在生成\x20','⚠️\x20以下数据集生成失败:','cwd','online','cyan','使用指定的应用AppCode:\x20','9VyuDIU','397585gPmpWF','√\x20文档生成完成!成功\x20','log','50220kZopck','env','datasetName','filter','🚀\x20','178711XSXrJF','success','4767TvVqvH','white','\x20(环境:\x20','string','length','未提供应用AppCode,且配置中也没有默认值','green','文档生成失败:\x20','api-doc','dim','2bPPWiB','red','\x1b[90m*\x20从\x20','datasetCode','💡\x20请使用\x20','gray','指定的数据集代码都不存在:\x20','column','2459176YKmosD','filePath','includes','\x20个数据集中筛选出\x20','error','\x1b[33m!\x20以下数据集代码不存在:\x20','517874ShqbAW','yellow','使用配置的应用AppCode:\x20','4QPHZtp','!\x20原始数据集\x20','文档生成完成',',\x20失败\x20','正在获取数据集列表...','./docs','\x1b[0m','\x20-\x20','message','1037298dkgUzY','originalCount','join'];a3_0x1699=function(){return _0x2391cb;};return a3_0x1699();}(function(_0x5157e4,_0x417d7d){const _0x2db44a=a3_0xc0b8,_0x424207=_0x5157e4();while(!![]){try{const _0x3e0576=parseInt(_0x2db44a(0x1eb))/0x1*(parseInt(_0x2db44a(0x1f7))/0x2)+-parseInt(_0x2db44a(0x1ed))/0x3+parseInt(_0x2db44a(0x208))/0x4*(-parseInt(_0x2db44a(0x221))/0x5)+-parseInt(_0x2db44a(0x211))/0x6+-parseInt(_0x2db44a(0x205))/0x7+-parseInt(_0x2db44a(0x1ff))/0x8*(parseInt(_0x2db44a(0x220))/0x9)+parseInt(_0x2db44a(0x1e6))/0xa*(parseInt(_0x2db44a(0x214))/0xb);if(_0x3e0576===_0x417d7d)break;else _0x424207['push'](_0x424207['shift']());}catch(_0x5ace6b){_0x424207['push'](_0x424207['shift']());}}}(a3_0x1699,0x3e9d3));import{jsx as a3_0x4c9460,jsxs as a3_0x53929f,Fragment as a3_0x347479}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchDatasets}from'./fetch-datasets.js';function a3_0xc0b8(_0x53213b,_0x354d9e){const _0x169919=a3_0x1699();return a3_0xc0b8=function(_0xc0b80d,_0x2a0b39){_0xc0b80d=_0xc0b80d-0x1e4;let _0x31a79c=_0x169919[_0xc0b80d];return _0x31a79c;},a3_0xc0b8(_0x53213b,_0x354d9e);}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x1413cd,env:_0x397057,output:_0x5a92e7,extraParams:_0x1c96c1,datasetCodes:_0xb936b8})=>{const _0x5c8a4b=a3_0xc0b8,{exit:_0x52532c}=useApp(),[_0x4033d7,_0x4f247d]=useState(![]),[_0x27fd2e,_0x4548f4]=useState(''),[_0x9a6961,_0x3b50ff]=useState(![]),[_0x4a689f,_0x1bf355]=useState(null),[_0x12912d,_0xce1bc]=useState(null),[_0x32cac8,_0x1c22f5]=useState(null),_0x2212a8=readConfig(),_0x5293d6=getConfigAppCode(),_0x181ad1=_0x1413cd||_0x5293d6,_0x35d136=typeof _0x2212a8?.[_0x5c8a4b(0x1e7)]===_0x5c8a4b(0x1f0)?_0x2212a8[_0x5c8a4b(0x1e7)]:undefined,_0x3605b3=_0x397057||_0x35d136||_0x5c8a4b(0x21d);initEnv(_0x3605b3);const _0x55f7a5=_0x5a92e7||_0x5c8a4b(0x20d),_0x36b464=_0x1413cd?_0x5c8a4b(0x21f)+_0x181ad1:_0x5c8a4b(0x207)+_0x181ad1;useEffect(()=>{_0x4f247d(!![]),_0x2a3386();},[]),useEffect(()=>{(_0x9a6961||_0x4a689f)&&_0x52532c();},[_0x9a6961,_0x4a689f,_0x52532c]);async function _0x2a3386(){const _0x5e8d37=_0x5c8a4b;if(!_0x181ad1){_0x1bf355(_0x5e8d37(0x1f2));return;}try{logger['setLogPath'](process[_0x5e8d37(0x21c)]()),_0x4548f4(_0x5e8d37(0x20c));const {rawData:_0x192c30,originalCount:_0x2b33aa,filteredCount:_0x367bec,duplicateCount:_0xc3cae4}=await fetchDatasets(_0x181ad1);_0x1c22f5({'originalCount':_0x2b33aa,'filteredCount':_0x367bec,'duplicateCount':_0xc3cae4});if(_0x192c30[_0x5e8d37(0x1f1)]===0x0){_0x1bf355('未找到任何数据集');return;}let _0x4b0d4f=_0x192c30;if(_0xb936b8&&_0xb936b8[_0x5e8d37(0x1f1)]>0x0){_0x4b0d4f=_0x192c30[_0x5e8d37(0x1e9)](_0x1d717d=>_0xb936b8['includes'](_0x1d717d['code']));const _0x24e3b6=_0x4b0d4f['map'](_0x56b6d2=>_0x56b6d2['code']),_0x1b1def=_0xb936b8[_0x5e8d37(0x1e9)](_0xbf8dd1=>!_0x24e3b6['includes'](_0xbf8dd1));_0x1b1def['length']>0x0&&console[_0x5e8d37(0x1e5)](_0x5e8d37(0x204)+_0x1b1def[_0x5e8d37(0x213)](',\x20')+_0x5e8d37(0x20e));if(_0x4b0d4f['length']===0x0){_0x1bf355(_0x5e8d37(0x1fd)+_0xb936b8[_0x5e8d37(0x213)](',\x20'));return;}console[_0x5e8d37(0x1e5)](_0x5e8d37(0x1f9)+_0x192c30[_0x5e8d37(0x1f1)]+_0x5e8d37(0x202)+_0x4b0d4f['length']+'\x20个匹配的数据集\x1b[0m');}_0x4548f4(_0x5e8d37(0x21a)+_0x4b0d4f[_0x5e8d37(0x1f1)]+'\x20个数据集的文档...');const _0x1766c7=await generateDatasetDocs(_0x4b0d4f,_0x181ad1,_0x55f7a5,(_0x909945,_0x18acd3,_0x27adcf)=>{const _0x527e7c=_0x5e8d37;_0x4548f4('正在生成\x20'+_0x27adcf+_0x527e7c(0x215)+_0x909945+'/'+_0x18acd3+')');},_0x1c96c1);_0xce1bc(_0x1766c7),_0x3b50ff(!![]);const _0x39c591=_0x1766c7[_0x5e8d37(0x1e9)](_0x15ef2b=>_0x15ef2b[_0x5e8d37(0x1ec)])[_0x5e8d37(0x1f1)],_0x3b53d0=_0x1766c7[_0x5e8d37(0x1e9)](_0x4f7405=>!_0x4f7405[_0x5e8d37(0x1ec)])['length'];logger[_0x5e8d37(0x1ec)](_0x5e8d37(0x1f5),_0x5e8d37(0x20a),undefined,{'totalCount':_0x1766c7['length'],'successCount':_0x39c591,'failCount':_0x3b53d0,'outputDir':_0x55f7a5});}catch(_0x2e40c6){const _0x34a0bc=_0x2e40c6 instanceof Error?_0x2e40c6[_0x5e8d37(0x210)]:String(_0x2e40c6);logger['error'](_0x5e8d37(0x1f5),_0x5e8d37(0x1f4)+_0x34a0bc,{'appCode':_0x181ad1,'outputDir':_0x55f7a5}),_0x1bf355(_0x5e8d37(0x1f4)+_0x34a0bc);}finally{_0x4f247d(![]);}}const _0x5cc37c=_0x12912d?.[_0x5c8a4b(0x1e9)](_0x511700=>_0x511700['success'])[_0x5c8a4b(0x1f1)]||0x0,_0x29d544=_0x12912d?.['filter'](_0x429d5c=>!_0x429d5c['success'])[_0x5c8a4b(0x1f1)]||0x0;return a3_0x53929f(Box,{'flexDirection':_0x5c8a4b(0x1fe),'children':[(_0x4033d7||_0x9a6961)&&a3_0x53929f(Box,{'children':[a3_0x4c9460(Text,{'color':_0x5c8a4b(0x1fc),'children':'*\x20'}),a3_0x4c9460(Text,{'color':_0x1413cd?_0x5c8a4b(0x1ee):_0x5c8a4b(0x1f6),'children':_0x36b464})]}),_0x4033d7&&a3_0x4c9460(Box,{'children':a3_0x53929f(Text,{'children':[_0x5c8a4b(0x1ea),_0x27fd2e,_0x5c8a4b(0x1ef),_0x3605b3,')']})}),_0x9a6961&&_0x12912d&&_0x32cac8&&a3_0x53929f(Box,{'flexDirection':_0x5c8a4b(0x1fe),'children':[a3_0x4c9460(Box,{'children':a3_0x53929f(Text,{'color':_0x5c8a4b(0x1f3),'children':[_0x5c8a4b(0x1e4),_0x5cc37c,'\x20个',_0x29d544>0x0&&_0x5c8a4b(0x20b)+_0x29d544+'\x20个']})}),_0x32cac8['duplicateCount']>0x0&&a3_0x4c9460(Box,{'marginTop':0x1,'children':a3_0x53929f(Text,{'color':'yellow','children':[_0x5c8a4b(0x209),_0x32cac8[_0x5c8a4b(0x212)],'\x20个,过滤重复','\x20',_0x32cac8[_0x5c8a4b(0x216)],'\x20个']})}),a3_0x53929f(Box,{'marginTop':0x1,'children':[a3_0x4c9460(Text,{'color':_0x5c8a4b(0x1fc),'children':'*\x20输出目录:\x20'}),a3_0x4c9460(Text,{'color':_0x5c8a4b(0x21e),'children':_0x55f7a5})]}),_0x5cc37c>0x0&&a3_0x53929f(a3_0x347479,{'children':[a3_0x4c9460(Box,{'marginTop':0x1,'children':a3_0x4c9460(Text,{'color':_0x5c8a4b(0x1fc),'children':_0x5c8a4b(0x218)})}),_0x12912d[_0x5c8a4b(0x1e9)](_0x46b8a7=>_0x46b8a7[_0x5c8a4b(0x1ec)])[_0x5c8a4b(0x217)]((_0x28aa38,_0x3622b7)=>a3_0x53929f(Box,{'marginLeft':0x2,'children':[a3_0x53929f(Text,{'color':'cyan','children':['•\x20',_0x28aa38[_0x5c8a4b(0x200)]]}),a3_0x53929f(Text,{'color':_0x5c8a4b(0x1f6),'children':[_0x5c8a4b(0x20f),_0x28aa38['datasetName']]})]},_0x3622b7))]}),_0x29d544>0x0&&a3_0x53929f(a3_0x347479,{'children':[a3_0x4c9460(Box,{'marginTop':0x1,'children':a3_0x4c9460(Text,{'color':_0x5c8a4b(0x206),'children':_0x5c8a4b(0x21b)})}),_0x12912d[_0x5c8a4b(0x1e9)](_0x173d01=>!_0x173d01[_0x5c8a4b(0x1ec)])[_0x5c8a4b(0x217)]((_0x24bc1e,_0x1a4f56)=>a3_0x53929f(Box,{'marginLeft':0x2,'flexDirection':_0x5c8a4b(0x1fe),'children':[a3_0x53929f(Text,{'color':_0x5c8a4b(0x1f8),'children':['•\x20',_0x24bc1e[_0x5c8a4b(0x1e8)],'\x20(',_0x24bc1e[_0x5c8a4b(0x1fa)],')']}),_0x24bc1e[_0x5c8a4b(0x203)]&&a3_0x4c9460(Box,{'marginLeft':0x2,'children':a3_0x4c9460(Text,{'color':'dim','children':_0x24bc1e[_0x5c8a4b(0x203)]})})]},_0x1a4f56))]})]}),_0x4a689f&&a3_0x53929f(Box,{'flexDirection':_0x5c8a4b(0x1fe),'children':[a3_0x4c9460(Box,{'children':a3_0x53929f(Text,{'color':'red','children':['❌\x20',_0x4a689f]})}),_0x4a689f[_0x5c8a4b(0x201)]('登录')&&a3_0x53929f(Box,{'marginTop':0x1,'children':[a3_0x4c9460(Text,{'color':_0x5c8a4b(0x206),'children':_0x5c8a4b(0x1fb)}),a3_0x4c9460(Text,{'color':_0x5c8a4b(0x21e),'children':_0x5c8a4b(0x219)}),a3_0x4c9460(Text,{'color':'yellow','children':'\x20重新登录后再试'})]})]})]});};
1
+ function a3_0x2bbc(){const _0x239029=['message','\x1b[33m!\x20以下数据集代码不存在:\x20','2572772fikmlr','90NIPfFU','指定的数据集代码都不存在:\x20','gray','文档生成失败:\x20','*\x20输出目录:\x20','7xQxnRl',',\x20失败\x20','api-doc','√\x20文档生成完成!成功\x20','未提供应用AppCode,且配置中也没有默认值','yellow','\x1b[0m','22209LichIm','\x20-\x20','!\x20原始数据集\x20','error','*\x20生成的文档文件:','dim','716IhdxNt','column','success','log','code','white','3944133KPaKYv','length','\x20(环境:\x20','\x20个数据集的文档...','.md\x20(','💡\x20请使用\x20','filter','duplicateCount','使用配置的应用AppCode:\x20','4550248yWegNN','./docs','\x20重新登录后再试','正在生成\x20','green','文档生成完成','\x20个数据集中筛选出\x20','12010eyUkMJ','join','env','cwd','\x20个,过滤重复','red','string','1nmHZzn','3862122xNFHTV','includes','1954794NZnJUU','online','\x20个匹配的数据集\x1b[0m','cyan','datasetName'];a3_0x2bbc=function(){return _0x239029;};return a3_0x2bbc();}(function(_0x31f780,_0x1d956f){const _0x4201f8=a3_0x35dd,_0x2dd3a0=_0x31f780();while(!![]){try{const _0x211904=-parseInt(_0x4201f8(0x172))/0x1*(-parseInt(_0x4201f8(0x17c))/0x2)+parseInt(_0x4201f8(0x175))/0x3+parseInt(_0x4201f8(0x18f))/0x4*(parseInt(_0x4201f8(0x16b))/0x5)+-parseInt(_0x4201f8(0x173))/0x6+parseInt(_0x4201f8(0x182))/0x7*(-parseInt(_0x4201f8(0x19e))/0x8)+-parseInt(_0x4201f8(0x195))/0x9+parseInt(_0x4201f8(0x17d))/0xa*(parseInt(_0x4201f8(0x189))/0xb);if(_0x211904===_0x1d956f)break;else _0x2dd3a0['push'](_0x2dd3a0['shift']());}catch(_0x1adf26){_0x2dd3a0['push'](_0x2dd3a0['shift']());}}}(a3_0x2bbc,0xb38b0));import{jsx as a3_0x1dcada,jsxs as a3_0x1bd80b,Fragment as a3_0x3e2fef}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x35dd(_0x5d8dd1,_0x575ff5){const _0x2bbc08=a3_0x2bbc();return a3_0x35dd=function(_0x35dde6,_0x1ea3f1){_0x35dde6=_0x35dde6-0x16a;let _0x107347=_0x2bbc08[_0x35dde6];return _0x107347;},a3_0x35dd(_0x5d8dd1,_0x575ff5);}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchDatasets}from'./fetch-datasets.js';import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x21d45e,env:_0x55aee9,output:_0x5b5a48,extraParams:_0x10e500,datasetCodes:_0x45d2a5})=>{const _0x3f6381=a3_0x35dd,{exit:_0x497967}=useApp(),[_0x2c9e91,_0x9ab273]=useState(![]),[_0x4c5e36,_0x2e5282]=useState(''),[_0x3adc4a,_0x12561c]=useState(![]),[_0x3349c3,_0x3f0d28]=useState(null),[_0x5935f0,_0x53b182]=useState(null),[_0x5f5dc6,_0x1ec420]=useState(null),_0x295c08=readConfig(),_0x3b65f0=getConfigAppCode(),_0x2ea937=_0x21d45e||_0x3b65f0,_0x1c54d8=typeof _0x295c08?.[_0x3f6381(0x16d)]===_0x3f6381(0x171)?_0x295c08[_0x3f6381(0x16d)]:undefined,_0x303e01=_0x55aee9||_0x1c54d8||_0x3f6381(0x176);initEnv(_0x303e01);const _0x468a9b=_0x5b5a48||_0x3f6381(0x19f),_0x2bd3a6=_0x21d45e?'使用指定的应用AppCode:\x20'+_0x2ea937:_0x3f6381(0x19d)+_0x2ea937;useEffect(()=>{_0x9ab273(!![]),_0x596893();},[]),useEffect(()=>{(_0x3adc4a||_0x3349c3)&&_0x497967();},[_0x3adc4a,_0x3349c3,_0x497967]);async function _0x596893(){const _0x22431c=_0x3f6381;if(!_0x2ea937){_0x3f0d28(_0x22431c(0x186));return;}try{logger['setLogPath'](process[_0x22431c(0x16e)]()),_0x2e5282('正在获取数据集列表...');const {rawData:_0xfb567,originalCount:_0x2dbb2c,filteredCount:_0x2cd7cf,duplicateCount:_0x1c1c6b}=await fetchDatasets(_0x2ea937);_0x1ec420({'originalCount':_0x2dbb2c,'filteredCount':_0x2cd7cf,'duplicateCount':_0x1c1c6b});if(_0xfb567[_0x22431c(0x196)]===0x0){_0x3f0d28('未找到任何数据集');return;}let _0x42fab8=_0xfb567;if(_0x45d2a5&&_0x45d2a5['length']>0x0){_0x42fab8=_0xfb567['filter'](_0x3c77ba=>_0x45d2a5[_0x22431c(0x174)](_0x3c77ba[_0x22431c(0x193)]));const _0x3f1e09=_0x42fab8['map'](_0x3ca557=>_0x3ca557[_0x22431c(0x193)]),_0x2a1622=_0x45d2a5[_0x22431c(0x19b)](_0x47a65d=>!_0x3f1e09[_0x22431c(0x174)](_0x47a65d));_0x2a1622[_0x22431c(0x196)]>0x0&&console[_0x22431c(0x192)](_0x22431c(0x17b)+_0x2a1622[_0x22431c(0x16c)](',\x20')+_0x22431c(0x188));if(_0x42fab8[_0x22431c(0x196)]===0x0){_0x3f0d28(_0x22431c(0x17e)+_0x45d2a5[_0x22431c(0x16c)](',\x20'));return;}console[_0x22431c(0x192)]('\x1b[90m*\x20从\x20'+_0xfb567[_0x22431c(0x196)]+_0x22431c(0x16a)+_0x42fab8[_0x22431c(0x196)]+_0x22431c(0x177));}_0x2e5282(_0x22431c(0x1a1)+_0x42fab8['length']+_0x22431c(0x198));const _0x548256=await generateDatasetDocs(_0x42fab8,_0x2ea937,_0x468a9b,(_0x36b6cf,_0x2425f6,_0x579fec)=>{const _0x5a5cd6=_0x22431c;_0x2e5282(_0x5a5cd6(0x1a1)+_0x579fec+_0x5a5cd6(0x199)+_0x36b6cf+'/'+_0x2425f6+')');},_0x10e500);_0x53b182(_0x548256),_0x12561c(!![]);const _0x18d35e=_0x548256[_0x22431c(0x19b)](_0x284eaf=>_0x284eaf[_0x22431c(0x191)])['length'],_0x8c2c95=_0x548256[_0x22431c(0x19b)](_0xc02df2=>!_0xc02df2[_0x22431c(0x191)])[_0x22431c(0x196)];logger['success']('api-doc',_0x22431c(0x1a3),undefined,{'totalCount':_0x548256[_0x22431c(0x196)],'successCount':_0x18d35e,'failCount':_0x8c2c95,'outputDir':_0x468a9b});}catch(_0x583e50){const _0x12a5fc=_0x583e50 instanceof Error?_0x583e50[_0x22431c(0x17a)]:String(_0x583e50);logger[_0x22431c(0x18c)](_0x22431c(0x184),_0x22431c(0x180)+_0x12a5fc,{'appCode':_0x2ea937,'outputDir':_0x468a9b}),_0x3f0d28(_0x22431c(0x180)+_0x12a5fc);}finally{_0x9ab273(![]);}}const _0x37ccc7=_0x5935f0?.['filter'](_0x35c887=>_0x35c887[_0x3f6381(0x191)])[_0x3f6381(0x196)]||0x0,_0x3f6884=_0x5935f0?.[_0x3f6381(0x19b)](_0x36291e=>!_0x36291e[_0x3f6381(0x191)])[_0x3f6381(0x196)]||0x0;return a3_0x1bd80b(Box,{'flexDirection':_0x3f6381(0x190),'children':[(_0x2c9e91||_0x3adc4a)&&a3_0x1bd80b(Box,{'children':[a3_0x1dcada(Text,{'color':_0x3f6381(0x17f),'children':'*\x20'}),a3_0x1dcada(Text,{'color':_0x21d45e?_0x3f6381(0x194):_0x3f6381(0x18e),'children':_0x2bd3a6})]}),_0x2c9e91&&a3_0x1dcada(Box,{'children':a3_0x1bd80b(Text,{'children':['🚀\x20',_0x4c5e36,_0x3f6381(0x197),_0x303e01,')']})}),_0x3adc4a&&_0x5935f0&&_0x5f5dc6&&a3_0x1bd80b(Box,{'flexDirection':_0x3f6381(0x190),'children':[a3_0x1dcada(Box,{'children':a3_0x1bd80b(Text,{'color':_0x3f6381(0x1a2),'children':[_0x3f6381(0x185),_0x37ccc7,'\x20个',_0x3f6884>0x0&&_0x3f6381(0x183)+_0x3f6884+'\x20个']})}),_0x5f5dc6[_0x3f6381(0x19c)]>0x0&&a3_0x1dcada(Box,{'marginTop':0x1,'children':a3_0x1bd80b(Text,{'color':_0x3f6381(0x187),'children':[_0x3f6381(0x18b),_0x5f5dc6['originalCount'],_0x3f6381(0x16f),'\x20',_0x5f5dc6[_0x3f6381(0x19c)],'\x20个']})}),a3_0x1bd80b(Box,{'marginTop':0x1,'children':[a3_0x1dcada(Text,{'color':'gray','children':_0x3f6381(0x181)}),a3_0x1dcada(Text,{'color':_0x3f6381(0x178),'children':_0x468a9b})]}),_0x37ccc7>0x0&&a3_0x1bd80b(a3_0x3e2fef,{'children':[a3_0x1dcada(Box,{'marginTop':0x1,'children':a3_0x1dcada(Text,{'color':'gray','children':_0x3f6381(0x18d)})}),_0x5935f0[_0x3f6381(0x19b)](_0x570f9e=>_0x570f9e[_0x3f6381(0x191)])['map']((_0x1b7e42,_0xda74e1)=>a3_0x1bd80b(Box,{'marginLeft':0x2,'children':[a3_0x1bd80b(Text,{'color':_0x3f6381(0x178),'children':['•\x20',_0x1b7e42['filePath']]}),a3_0x1bd80b(Text,{'color':'dim','children':[_0x3f6381(0x18a),_0x1b7e42[_0x3f6381(0x179)]]})]},_0xda74e1))]}),_0x3f6884>0x0&&a3_0x1bd80b(a3_0x3e2fef,{'children':[a3_0x1dcada(Box,{'marginTop':0x1,'children':a3_0x1dcada(Text,{'color':_0x3f6381(0x187),'children':'⚠️\x20以下数据集生成失败:'})}),_0x5935f0[_0x3f6381(0x19b)](_0x5b1aa0=>!_0x5b1aa0[_0x3f6381(0x191)])['map']((_0x232b18,_0x41eac9)=>a3_0x1bd80b(Box,{'marginLeft':0x2,'flexDirection':_0x3f6381(0x190),'children':[a3_0x1bd80b(Text,{'color':_0x3f6381(0x170),'children':['•\x20',_0x232b18[_0x3f6381(0x179)],'\x20(',_0x232b18['datasetCode'],')']}),_0x232b18[_0x3f6381(0x18c)]&&a3_0x1dcada(Box,{'marginLeft':0x2,'children':a3_0x1dcada(Text,{'color':_0x3f6381(0x18e),'children':_0x232b18[_0x3f6381(0x18c)]})})]},_0x41eac9))]})]}),_0x3349c3&&a3_0x1bd80b(Box,{'flexDirection':'column','children':[a3_0x1dcada(Box,{'children':a3_0x1bd80b(Text,{'color':'red','children':['❌\x20',_0x3349c3]})}),_0x3349c3[_0x3f6381(0x174)]('登录')&&a3_0x1bd80b(Box,{'marginTop':0x1,'children':[a3_0x1dcada(Text,{'color':_0x3f6381(0x187),'children':_0x3f6381(0x19a)}),a3_0x1dcada(Text,{'color':_0x3f6381(0x178),'children':'lovrabet\x20auth'}),a3_0x1dcada(Text,{'color':'yellow','children':_0x3f6381(0x1a0)})]})]})]});};
@@ -1 +1 @@
1
- function a4_0x4f6a(){const _0x12e073=['code','26836rShyoa','application/json','string','data','message',']\x20正在生成:\x20','slice','api-doc','生成文档成功:\x20','):缺少\x20data.markdown\x20字段','stringify','utf8','2771755WWBmjD','✗\x20失败:\x20','log','name','生成文档失败:\x20','32oEFkwX','3152804uPDUyV','获取文档失败\x20(','3496872rvpomj','等待\x203\x20秒...\x0a','.md\x20(','\x0a共有\x20','77193YPLcMv','POST','1711323ivCxPG','✓\x20成功生成:\x20','padStart','.md','length','error','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','33VKaMMF','status','join','markdown','.md\x20-\x20','text','3881845EWynyq','dataset_','success','),HTTP状态码:\x20','tableName','dbtableConfig'];a4_0x4f6a=function(){return _0x12e073;};return a4_0x4f6a();}(function(_0x30ea01,_0x46c6db){const _0x276226=a4_0x4d19,_0x31e5c0=_0x30ea01();while(!![]){try{const _0x1ad0dd=parseInt(_0x276226(0xe8))/0x1+-parseInt(_0x276226(0xfe))/0x2*(parseInt(_0x276226(0xf1))/0x3)+-parseInt(_0x276226(0xe2))/0x4+parseInt(_0x276226(0xf7))/0x5+-parseInt(_0x276226(0xe4))/0x6+parseInt(_0x276226(0x10a))/0x7+-parseInt(_0x276226(0xe1))/0x8*(-parseInt(_0x276226(0xea))/0x9);if(_0x1ad0dd===_0x46c6db)break;else _0x31e5c0['push'](_0x31e5c0['shift']());}catch(_0x2e7ce4){_0x31e5c0['push'](_0x31e5c0['shift']());}}}(a4_0x4f6a,0x77ff0));import{mkdirSync,writeFileSync}from'node:fs';import a4_0x413ad6 from'node:path';import{getCookie}from'../auth/get-cookie.js';function a4_0x4d19(_0x1cecd5,_0x5b17b8){const _0x4f6ace=a4_0x4f6a();return a4_0x4d19=function(_0x4d197d,_0x2b4a75){_0x4d197d=_0x4d197d-0xdf;let _0x32d9d1=_0x4f6ace[_0x4d197d];return _0x32d9d1;},a4_0x4d19(_0x1cecd5,_0x5b17b8);}import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0x17ef31){const _0x24e7bc=a4_0x4d19,{appCode:_0x199044,datasetCode:_0x41038a,datasetId:_0x3382d3,extraParams:_0x5ba72c}=_0x17ef31,_0x5b20ac=getApiDomain(),_0x60d7e5=_0x5b20ac+'/api/node-toolbox/api-doc-generator',_0x25dacd={'appCode':_0x199044,'datasetCode':_0x41038a,'datasetId':_0x3382d3,..._0x5ba72c||{}},_0x1c8f78=await fetch(_0x60d7e5,{'method':_0x24e7bc(0xe9),'headers':{'Content-Type':_0x24e7bc(0xff),'Cookie':getCookie()},'body':JSON[_0x24e7bc(0x108)](_0x25dacd)});if(!_0x1c8f78['ok']){if(_0x1c8f78[_0x24e7bc(0xf2)]===0x191)throw new Error(_0x24e7bc(0xf0));let _0x4337d2='';try{_0x4337d2=await _0x1c8f78[_0x24e7bc(0xf6)]();}catch(_0x5f3283){}throw new Error(_0x24e7bc(0xe3)+_0x41038a+_0x24e7bc(0xfa)+_0x1c8f78['status']+(_0x4337d2?'\x0a'+_0x4337d2:''));}const _0x8fae45=await _0x1c8f78['json']();if(!_0x8fae45[_0x24e7bc(0x101)]||typeof _0x8fae45[_0x24e7bc(0x101)]['markdown']!==_0x24e7bc(0x100))throw new Error('响应数据格式错误\x20('+_0x41038a+_0x24e7bc(0x107));return _0x8fae45[_0x24e7bc(0x101)][_0x24e7bc(0xf4)];}function delay(_0x29b404){return new Promise(_0x3bb7d9=>setTimeout(_0x3bb7d9,_0x29b404));}export async function generateDatasetDocs(_0x53214b,_0x1e562f,_0x5cba17='./docs',_0x40a019,_0x3e984d){const _0x2a022d=a4_0x4d19;mkdirSync(_0x5cba17,{'recursive':!![]});const _0x55fd61=[],_0x5a0065=_0x53214b[_0x2a022d(0xee)];console[_0x2a022d(0x10c)](_0x2a022d(0xe7)+_0x5a0065+'\x20个数据集需要生成文档\x0a');for(let _0x252241=0x0;_0x252241<_0x53214b['length'];_0x252241++){const _0x4380f9=_0x53214b[_0x252241],_0x4a0a2e=_0x252241+0x1;let _0x384703;if(_0x4380f9[_0x2a022d(0xfc)]?.[_0x2a022d(0xfb)])_0x384703=_0x4380f9[_0x2a022d(0xfc)][_0x2a022d(0xfb)];else{const _0x15b2e6=_0x4380f9[_0x2a022d(0xfd)][_0x2a022d(0x104)](-0x6)[_0x2a022d(0xec)](0x6,'0');_0x384703=_0x2a022d(0xf8)+_0x15b2e6;}try{console['log']('['+_0x4a0a2e+'/'+_0x5a0065+_0x2a022d(0x103)+_0x384703+_0x2a022d(0xe6)+_0x4380f9[_0x2a022d(0xdf)]+')');_0x40a019&&_0x40a019(_0x4a0a2e,_0x5a0065,_0x384703);const _0x411305=await fetchDatasetDoc({'appCode':_0x1e562f,'datasetCode':_0x4380f9[_0x2a022d(0xfd)],'datasetId':_0x4380f9['id'],'enableAI':![],'extraParams':_0x3e984d}),_0x4c5fce=a4_0x413ad6[_0x2a022d(0xf3)](_0x5cba17,_0x384703+_0x2a022d(0xed));writeFileSync(_0x4c5fce,_0x411305,{'encoding':_0x2a022d(0x109)}),console[_0x2a022d(0x10c)](_0x2a022d(0xeb)+_0x384703+_0x2a022d(0xed)),logger[_0x2a022d(0xf9)](_0x2a022d(0x105),_0x2a022d(0x106)+_0x384703,undefined,{'datasetCode':_0x4380f9[_0x2a022d(0xfd)],'datasetName':_0x4380f9[_0x2a022d(0xdf)],'filePath':_0x4c5fce,'progress':_0x4a0a2e+'/'+_0x5a0065}),_0x55fd61['push']({'datasetCode':_0x4380f9[_0x2a022d(0xfd)],'datasetName':_0x4380f9[_0x2a022d(0xdf)],'filePath':_0x4c5fce,'success':!![]});}catch(_0x442bb9){const _0x15cf2e=_0x442bb9 instanceof Error?_0x442bb9[_0x2a022d(0x102)]:String(_0x442bb9);console[_0x2a022d(0x10c)](_0x2a022d(0x10b)+_0x384703+_0x2a022d(0xf5)+_0x15cf2e+'\x0a'),logger[_0x2a022d(0xef)](_0x2a022d(0x105),_0x2a022d(0xe0)+_0x4380f9[_0x2a022d(0xfd)],{'datasetCode':_0x4380f9[_0x2a022d(0xfd)],'datasetName':_0x4380f9[_0x2a022d(0xdf)],'error':_0x15cf2e,'progress':_0x4a0a2e+'/'+_0x5a0065}),_0x55fd61['push']({'datasetCode':_0x4380f9[_0x2a022d(0xfd)],'datasetName':_0x4380f9[_0x2a022d(0xdf)],'filePath':'','success':![],'error':_0x15cf2e}),_0x4a0a2e<_0x5a0065&&(console[_0x2a022d(0x10c)](_0x2a022d(0xe5)),await delay(0xbb8));}}return _0x55fd61;}
1
+ const a4_0x49c084=a4_0x5efa;(function(_0x26d5b0,_0xeffee0){const _0x22e1b0=a4_0x5efa,_0x4edd2a=_0x26d5b0();while(!![]){try{const _0xac5c5f=-parseInt(_0x22e1b0(0x122))/0x1*(-parseInt(_0x22e1b0(0x111))/0x2)+-parseInt(_0x22e1b0(0x11f))/0x3+parseInt(_0x22e1b0(0x114))/0x4*(-parseInt(_0x22e1b0(0x12f))/0x5)+parseInt(_0x22e1b0(0x116))/0x6+parseInt(_0x22e1b0(0x119))/0x7*(parseInt(_0x22e1b0(0x135))/0x8)+parseInt(_0x22e1b0(0x11e))/0x9*(-parseInt(_0x22e1b0(0x11b))/0xa)+-parseInt(_0x22e1b0(0x125))/0xb;if(_0xac5c5f===_0xeffee0)break;else _0x4edd2a['push'](_0x4edd2a['shift']());}catch(_0x4d6fe2){_0x4edd2a['push'](_0x4edd2a['shift']());}}}(a4_0x495e,0x8694c));function a4_0x5efa(_0x5d10e5,_0x4441b2){const _0x495eb5=a4_0x495e();return a4_0x5efa=function(_0x5efa79,_0x480739){_0x5efa79=_0x5efa79-0x10f;let _0x1beef0=_0x495eb5[_0x5efa79];return _0x1beef0;},a4_0x5efa(_0x5d10e5,_0x4441b2);}import{mkdirSync,writeFileSync}from'node:fs';import a4_0x38782e from'node:path';function a4_0x495e(){const _0x5f179d=['.md','text','205081gFVZul','生成文档失败:\x20','等待\x203\x20秒...\x0a','639870camtSo','生成文档成功:\x20','获取文档失败\x20(','log','✓\x20成功生成:\x20','dbtableConfig',']\x20正在生成:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','/api/node-toolbox/api-doc-generator','stringify','1865LaJgbK','slice','api-doc','data','error','.md\x20-\x20','8UnIvwM','length','),HTTP状态码:\x20','padStart','dataset_','success','POST','push','./docs','\x20个数据集需要生成文档\x0a','message','\x0a共有\x20','.md\x20(','utf8','status','2JAPhCz','code','markdown','3400uSkSsu','name','859812MZROfC','join','✗\x20失败:\x20','6976053hbPBYI','tableName','8480jzLzAm','响应数据格式错误\x20(','application/json','4194sqUmsA','69990kpYfAu'];a4_0x495e=function(){return _0x5f179d;};return a4_0x495e();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';export async function fetchDatasetDoc(_0xcc58fe){const _0x4dcc28=a4_0x5efa,{appCode:_0xb15f25,datasetCode:_0x5e2092,datasetId:_0x528e08,extraParams:_0x2f627f}=_0xcc58fe,_0x156572=getApiDomain(),_0x159a55=_0x156572+_0x4dcc28(0x12d),_0x3b65b8={'appCode':_0xb15f25,'datasetCode':_0x5e2092,'datasetId':_0x528e08,..._0x2f627f||{}},_0x11d47a=await fetch(_0x159a55,{'method':_0x4dcc28(0x13b),'headers':{'Content-Type':_0x4dcc28(0x11d),'Cookie':getCookie()},'body':JSON[_0x4dcc28(0x12e)](_0x3b65b8)});if(!_0x11d47a['ok']){if(_0x11d47a[_0x4dcc28(0x110)]===0x191)throw new Error(_0x4dcc28(0x12c));let _0x1fa4d8='';try{_0x1fa4d8=await _0x11d47a[_0x4dcc28(0x121)]();}catch(_0x250bb6){}throw new Error(_0x4dcc28(0x127)+_0x5e2092+_0x4dcc28(0x137)+_0x11d47a[_0x4dcc28(0x110)]+(_0x1fa4d8?'\x0a'+_0x1fa4d8:''));}const _0x179f42=await _0x11d47a['json']();if(!_0x179f42[_0x4dcc28(0x132)]||typeof _0x179f42[_0x4dcc28(0x132)][_0x4dcc28(0x113)]!=='string')throw new Error(_0x4dcc28(0x11c)+_0x5e2092+'):缺少\x20data.markdown\x20字段');return _0x179f42[_0x4dcc28(0x132)][_0x4dcc28(0x113)];}function delay(_0x3c5ae0){return new Promise(_0x142964=>setTimeout(_0x142964,_0x3c5ae0));}export async function generateDatasetDocs(_0x3e910d,_0x2592d8,_0x520623=a4_0x49c084(0x13d),_0x4ce8a4,_0x5a12b9){const _0x506654=a4_0x49c084;mkdirSync(_0x520623,{'recursive':!![]});const _0x51a307=[],_0x33c66a=_0x3e910d[_0x506654(0x136)];console[_0x506654(0x128)](_0x506654(0x140)+_0x33c66a+_0x506654(0x13e));for(let _0x58a2ad=0x0;_0x58a2ad<_0x3e910d[_0x506654(0x136)];_0x58a2ad++){const _0xd3c78d=_0x3e910d[_0x58a2ad],_0xa8c64a=_0x58a2ad+0x1;let _0x1875b9;if(_0xd3c78d[_0x506654(0x12a)]?.[_0x506654(0x11a)])_0x1875b9=_0xd3c78d['dbtableConfig'][_0x506654(0x11a)];else{const _0x821593=_0xd3c78d['code'][_0x506654(0x130)](-0x6)[_0x506654(0x138)](0x6,'0');_0x1875b9=_0x506654(0x139)+_0x821593;}try{console['log']('['+_0xa8c64a+'/'+_0x33c66a+_0x506654(0x12b)+_0x1875b9+_0x506654(0x141)+_0xd3c78d['name']+')');_0x4ce8a4&&_0x4ce8a4(_0xa8c64a,_0x33c66a,_0x1875b9);const _0x3812e8=await fetchDatasetDoc({'appCode':_0x2592d8,'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetId':_0xd3c78d['id'],'enableAI':![],'extraParams':_0x5a12b9}),_0x3a721=a4_0x38782e[_0x506654(0x117)](_0x520623,_0x1875b9+'.md');writeFileSync(_0x3a721,_0x3812e8,{'encoding':_0x506654(0x10f)}),console[_0x506654(0x128)](_0x506654(0x129)+_0x1875b9+_0x506654(0x120)),logger[_0x506654(0x13a)](_0x506654(0x131),_0x506654(0x126)+_0x1875b9,undefined,{'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d[_0x506654(0x115)],'filePath':_0x3a721,'progress':_0xa8c64a+'/'+_0x33c66a}),_0x51a307[_0x506654(0x13c)]({'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d[_0x506654(0x115)],'filePath':_0x3a721,'success':!![]});}catch(_0x1d8080){const _0x298e97=_0x1d8080 instanceof Error?_0x1d8080[_0x506654(0x13f)]:String(_0x1d8080);console['log'](_0x506654(0x118)+_0x1875b9+_0x506654(0x134)+_0x298e97+'\x0a'),logger[_0x506654(0x133)](_0x506654(0x131),_0x506654(0x123)+_0xd3c78d[_0x506654(0x112)],{'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d[_0x506654(0x115)],'error':_0x298e97,'progress':_0xa8c64a+'/'+_0x33c66a}),_0x51a307[_0x506654(0x13c)]({'datasetCode':_0xd3c78d[_0x506654(0x112)],'datasetName':_0xd3c78d['name'],'filePath':'','success':![],'error':_0x298e97}),_0xa8c64a<_0x33c66a&&(console[_0x506654(0x128)](_0x506654(0x124)),await delay(0xbb8));}}return _0x51a307;}
@@ -1 +1 @@
1
- (function(_0x18cad2,_0x48145c){const _0x5b8713=a5_0x9215,_0x455dfc=_0x18cad2();while(!![]){try{const _0x5c5873=-parseInt(_0x5b8713(0xc2))/0x1+-parseInt(_0x5b8713(0xa7))/0x2+parseInt(_0x5b8713(0xd2))/0x3+parseInt(_0x5b8713(0xae))/0x4+-parseInt(_0x5b8713(0xb2))/0x5+-parseInt(_0x5b8713(0xd3))/0x6*(-parseInt(_0x5b8713(0xba))/0x7)+parseInt(_0x5b8713(0xc6))/0x8*(parseInt(_0x5b8713(0xc4))/0x9);if(_0x5c5873===_0x48145c)break;else _0x455dfc['push'](_0x455dfc['shift']());}catch(_0x463339){_0x455dfc['push'](_0x455dfc['shift']());}}}(a5_0xc821,0xcf7f3));import{jsx as a5_0x3a8d86,jsxs as a5_0x2b0263}from'react/jsx-runtime';import{useEffect,useState}from'react';function a5_0xc821(){const _0x17f2c9=['√\x20成功拉取\x20','.ts','未提供应用AppCode,且配置中也没有默认值','8400745RpvXbk','env','💡\x20请使用\x20','!\x20原始数据集\x20','column','./src/api/','join','\x20from\x20\x27@/','35LftSoG','dim','includes','使用配置的应用AppCode:\x20','online','api','modelCount','拉取\x20API\x20配置失败:\x20','1314756DdwuTI','error','261SVAXkX','cyan','515208rBYfAy','replace','import\x20','duplicateCount','setLogPath','-client','{\x20lovrabetClient\x20}','使用指定的应用AppCode:\x20','client','*\x20已生成文件:','api-pull','datasetCount','2331633mNHfRn','1925166xdOPeO','yellow','lovrabet\x20auth','*\x20导入方式:','3218966kAsPad','\x20-\x20客户端实例文件','\x20重新登录后再试','-\x20模型配置文件\x20(','message','green','\x20个数据集,生成','4820600rkPvov'];a5_0xc821=function(){return _0x17f2c9;};return a5_0xc821();}import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a5_0x9215(_0xa3da06,_0x28b154){const _0xc8216c=a5_0xc821();return a5_0x9215=function(_0x9215ed,_0x4b0301){_0x9215ed=_0x9215ed-0xa4;let _0x16c93c=_0xc8216c[_0x9215ed];return _0x16c93c;},a5_0x9215(_0xa3da06,_0x28b154);}import{fetchDatasets}from'./fetch-datasets.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x592a7a,env:_0x4d5d79,output:_0x7d2080})=>{const _0x49726e=a5_0x9215,{exit:_0x1946f7}=useApp(),[_0xebda8d,_0x1c8571]=useState(![]),[_0x2c321a,_0x1966e0]=useState(![]),[_0xe8ca93,_0x3506e3]=useState(null),[_0x119e5b,_0x413bf8]=useState(null),_0x450e8b=readConfig(),_0x2866ba=getConfigAppCode(),_0xa9efea=_0x592a7a||_0x2866ba,_0x45d47c=typeof _0x450e8b?.[_0x49726e(0xb3)]==='string'?_0x450e8b[_0x49726e(0xb3)]:undefined,_0x949fd7=_0x4d5d79||_0x45d47c||_0x49726e(0xbe);initEnv(_0x949fd7);const _0x23f7e5=_0x7d2080||_0x49726e(0xb7),_0x35120d=_0x592a7a&&_0x592a7a[_0x49726e(0xbc)]('-')?_0x592a7a['split']('-')['slice'](0x1)[_0x49726e(0xb8)]('-'):'',_0x10e1d9=_0x592a7a?_0x49726e(0xcd)+_0xa9efea:_0x49726e(0xbd)+_0xa9efea,_0x542ba2=_0x35120d?_0x35120d+'-api':'api',_0x5dbd8c=_0x35120d?_0x35120d+_0x49726e(0xcb):_0x49726e(0xce);useEffect(()=>{_0x1c8571(!![]),_0x3ed19f();},[]),useEffect(()=>{(_0x2c321a||_0xe8ca93)&&_0x1946f7();},[_0x2c321a,_0xe8ca93,_0x1946f7]);async function _0x3ed19f(){const _0x55bd6e=_0x49726e;if(!_0xa9efea){_0x3506e3(_0x55bd6e(0xb1));return;}try{logger[_0x55bd6e(0xca)](process['cwd']());const {rawData:_0x581b25,originalCount:_0x59e6e9,filteredCount:_0x32a14f,duplicateCount:_0x76671e}=await fetchDatasets(_0xa9efea),_0x2ea29f=_0x32a14f,_0x21c18d=!_0x592a7a,_0x23fb90=await generateApiFile(_0x581b25,_0x35120d,_0xa9efea,_0x21c18d,_0x949fd7,_0x23f7e5),_0x4148e4=_0x23f7e5['endsWith']('/')?_0x23f7e5:_0x23f7e5+'/';_0x413bf8({'api':''+_0x4148e4+_0x542ba2+_0x55bd6e(0xb0),'client':''+_0x4148e4+_0x5dbd8c+_0x55bd6e(0xb0),'modelCount':_0x23fb90[_0x55bd6e(0xc0)],'datasetCount':_0x2ea29f,'originalCount':_0x59e6e9,'duplicateCount':_0x76671e}),_0x1966e0(!![]);}catch(_0x2af532){const _0x2b2a45=_0x2af532 instanceof Error?_0x2af532[_0x55bd6e(0xab)]:String(_0x2af532);logger[_0x55bd6e(0xc3)](_0x55bd6e(0xd0),_0x55bd6e(0xc1)+_0x2b2a45,{'appCode':_0xa9efea,'error':_0x2b2a45}),_0x3506e3('拉取\x20API\x20配置失败:\x20'+_0x2b2a45);}finally{_0x1c8571(![]);}}return a5_0x2b0263(Box,{'flexDirection':_0x49726e(0xb6),'children':[(_0xebda8d||_0x2c321a)&&a5_0x2b0263(Box,{'children':[a5_0x3a8d86(Text,{'color':'gray','children':'*\x20'}),a5_0x3a8d86(Text,{'color':_0x592a7a?'white':_0x49726e(0xbb),'children':_0x10e1d9})]}),_0xebda8d&&a5_0x3a8d86(Box,{'children':a5_0x2b0263(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x949fd7,')']})}),_0x2c321a&&_0x119e5b&&a5_0x2b0263(Box,{'flexDirection':_0x49726e(0xb6),'children':[a5_0x3a8d86(Box,{'children':a5_0x2b0263(Text,{'color':_0x49726e(0xac),'children':[_0x49726e(0xaf),_0x119e5b[_0x49726e(0xd1)],_0x49726e(0xad),'\x20',_0x119e5b['modelCount'],'\x20个模型']})}),_0x119e5b[_0x49726e(0xc9)]>0x0&&a5_0x3a8d86(Box,{'marginTop':0x1,'children':a5_0x2b0263(Text,{'color':'yellow','children':[_0x49726e(0xb5),_0x119e5b['originalCount'],'\x20个,过滤重复','\x20',_0x119e5b[_0x49726e(0xc9)],'\x20个']})}),a5_0x3a8d86(Box,{'marginTop':0x1,'children':a5_0x3a8d86(Text,{'color':'gray','children':_0x49726e(0xcf)})}),a5_0x2b0263(Box,{'marginLeft':0x2,'children':[a5_0x2b0263(Text,{'color':'cyan','children':['•\x20',_0x119e5b[_0x49726e(0xbf)]]}),a5_0x2b0263(Text,{'color':_0x49726e(0xbb),'children':['\x20',_0x49726e(0xaa),_0x119e5b[_0x49726e(0xc0)],'\x20个模型)']})]}),a5_0x2b0263(Box,{'marginLeft':0x2,'children':[a5_0x2b0263(Text,{'color':'cyan','children':['•\x20',_0x119e5b[_0x49726e(0xce)]]}),a5_0x3a8d86(Text,{'color':_0x49726e(0xbb),'children':_0x49726e(0xa8)})]}),a5_0x3a8d86(Box,{'marginTop':0x1,'children':a5_0x3a8d86(Text,{'color':'gray','children':_0x49726e(0xa6)})}),a5_0x3a8d86(Box,{'marginLeft':0x2,'children':a5_0x2b0263(Text,{'color':_0x49726e(0xa4),'children':[_0x49726e(0xc8),_0x49726e(0xcc),_0x49726e(0xb9),_0x119e5b[_0x49726e(0xce)][_0x49726e(0xc7)](/^\.\//,'')['replace'](_0x49726e(0xb0),''),'\x27']})})]}),_0xe8ca93&&a5_0x2b0263(Box,{'flexDirection':'column','children':[a5_0x3a8d86(Box,{'children':a5_0x2b0263(Text,{'color':'red','children':['❌\x20',_0xe8ca93]})}),_0xe8ca93[_0x49726e(0xbc)]('登录')&&a5_0x2b0263(Box,{'marginTop':0x1,'children':[a5_0x3a8d86(Text,{'color':_0x49726e(0xa4),'children':_0x49726e(0xb4)}),a5_0x3a8d86(Text,{'color':_0x49726e(0xc5),'children':_0x49726e(0xa5)}),a5_0x3a8d86(Text,{'color':_0x49726e(0xa4),'children':_0x49726e(0xa9)})]})]})]});};
1
+ (function(_0x48bf46,_0x2d0ca7){const _0x238900=a5_0x142c,_0x31bc75=_0x48bf46();while(!![]){try{const _0x474472=-parseInt(_0x238900(0x158))/0x1*(parseInt(_0x238900(0x155))/0x2)+parseInt(_0x238900(0x140))/0x3+parseInt(_0x238900(0x146))/0x4*(-parseInt(_0x238900(0x14e))/0x5)+-parseInt(_0x238900(0x15a))/0x6+parseInt(_0x238900(0x14d))/0x7+-parseInt(_0x238900(0x154))/0x8+parseInt(_0x238900(0x14f))/0x9;if(_0x474472===_0x2d0ca7)break;else _0x31bc75['push'](_0x31bc75['shift']());}catch(_0x47a0f3){_0x31bc75['push'](_0x31bc75['shift']());}}}(a5_0xee2e,0xb7cfc));import{jsx as a5_0x45f2ac,jsxs as a5_0x18761d}from'react/jsx-runtime';function a5_0x142c(_0x571426,_0x5bd7ad){const _0xee2e0a=a5_0xee2e();return a5_0x142c=function(_0x142c68,_0x22b505){_0x142c68=_0x142c68-0x137;let _0xd1a7cc=_0xee2e0a[_0x142c68];return _0xd1a7cc;},a5_0x142c(_0x571426,_0x5bd7ad);}import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchDatasets}from'./fetch-datasets.js';import{generateApiFile}from'./generate-api-file.js';function a5_0xee2e(){const _0x4bac69=['\x20个,过滤重复','\x20from\x20\x27@/','\x20个数据集,生成','datasetCount','{\x20lovrabetClient\x20}','-\x20模型配置文件\x20(','拉取\x20API\x20配置失败:\x20','*\x20已生成文件:','red','env','cyan','online','duplicateCount','split','originalCount','\x20个模型','client','√\x20成功拉取\x20','-client','yellow','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','3133680WiorgG','-api','column','green','string','api-pull','8756cIFMas','.ts','endsWith','modelCount','setLogPath','gray','slice','7269941PaWDSg','535STBhDX','10541799xhufdz','!\x20原始数据集\x20','\x20-\x20客户端实例文件','api','replace','4853312QdKHYr','398FiQjLB','import\x20','join','4663oZwYNa','未提供应用AppCode,且配置中也没有默认值','4396308FLOKsf','./src/api/','使用指定的应用AppCode:\x20','使用配置的应用AppCode:\x20','dim','includes','*\x20导入方式:','white'];a5_0xee2e=function(){return _0x4bac69;};return a5_0xee2e();}import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x36032f,env:_0x961f75,output:_0xd0f132})=>{const _0x5d442=a5_0x142c,{exit:_0x1b4913}=useApp(),[_0x1d07a2,_0x17c5c2]=useState(![]),[_0x1514b4,_0x190357]=useState(![]),[_0x3eafdd,_0x3c249e]=useState(null),[_0x59f210,_0x4d890e]=useState(null),_0x2904dc=readConfig(),_0x3d2856=getConfigAppCode(),_0x53b432=_0x36032f||_0x3d2856,_0x224a79=typeof _0x2904dc?.['env']===_0x5d442(0x144)?_0x2904dc[_0x5d442(0x16b)]:undefined,_0x4d15d8=_0x961f75||_0x224a79||_0x5d442(0x16d);initEnv(_0x4d15d8);const _0x462df1=_0xd0f132||_0x5d442(0x15b),_0x1bf854=_0x36032f&&_0x36032f['includes']('-')?_0x36032f[_0x5d442(0x138)]('-')[_0x5d442(0x14c)](0x1)[_0x5d442(0x157)]('-'):'',_0x2e9612=_0x36032f?_0x5d442(0x15c)+_0x53b432:_0x5d442(0x15d)+_0x53b432,_0x4171f2=_0x1bf854?_0x1bf854+_0x5d442(0x141):_0x5d442(0x152),_0x4653cb=_0x1bf854?_0x1bf854+_0x5d442(0x13d):_0x5d442(0x13b);useEffect(()=>{_0x17c5c2(!![]),_0x1d4f88();},[]),useEffect(()=>{(_0x1514b4||_0x3eafdd)&&_0x1b4913();},[_0x1514b4,_0x3eafdd,_0x1b4913]);async function _0x1d4f88(){const _0x41d7a1=_0x5d442;if(!_0x53b432){_0x3c249e(_0x41d7a1(0x159));return;}try{logger[_0x41d7a1(0x14a)](process['cwd']());const {rawData:_0x14d60e,originalCount:_0x422cba,filteredCount:_0xd80088,duplicateCount:_0xeaefc}=await fetchDatasets(_0x53b432),_0x25d69b=_0xd80088,_0x11419a=!_0x36032f,_0x54cc1b=await generateApiFile(_0x14d60e,_0x1bf854,_0x53b432,_0x11419a,_0x4d15d8,_0x462df1),_0x665d33=_0x462df1[_0x41d7a1(0x148)]('/')?_0x462df1:_0x462df1+'/';_0x4d890e({'api':''+_0x665d33+_0x4171f2+_0x41d7a1(0x147),'client':''+_0x665d33+_0x4653cb+_0x41d7a1(0x147),'modelCount':_0x54cc1b[_0x41d7a1(0x149)],'datasetCount':_0x25d69b,'originalCount':_0x422cba,'duplicateCount':_0xeaefc}),_0x190357(!![]);}catch(_0x28abe6){const _0x224f95=_0x28abe6 instanceof Error?_0x28abe6['message']:String(_0x28abe6);logger['error'](_0x41d7a1(0x145),_0x41d7a1(0x168)+_0x224f95,{'appCode':_0x53b432,'error':_0x224f95}),_0x3c249e(_0x41d7a1(0x168)+_0x224f95);}finally{_0x17c5c2(![]);}}return a5_0x18761d(Box,{'flexDirection':_0x5d442(0x142),'children':[(_0x1d07a2||_0x1514b4)&&a5_0x18761d(Box,{'children':[a5_0x45f2ac(Text,{'color':_0x5d442(0x14b),'children':'*\x20'}),a5_0x45f2ac(Text,{'color':_0x36032f?_0x5d442(0x161):'dim','children':_0x2e9612})]}),_0x1d07a2&&a5_0x45f2ac(Box,{'children':a5_0x18761d(Text,{'children':[_0x5d442(0x13f),_0x4d15d8,')']})}),_0x1514b4&&_0x59f210&&a5_0x18761d(Box,{'flexDirection':_0x5d442(0x142),'children':[a5_0x45f2ac(Box,{'children':a5_0x18761d(Text,{'color':_0x5d442(0x143),'children':[_0x5d442(0x13c),_0x59f210[_0x5d442(0x165)],_0x5d442(0x164),'\x20',_0x59f210[_0x5d442(0x149)],_0x5d442(0x13a)]})}),_0x59f210[_0x5d442(0x137)]>0x0&&a5_0x45f2ac(Box,{'marginTop':0x1,'children':a5_0x18761d(Text,{'color':_0x5d442(0x13e),'children':[_0x5d442(0x150),_0x59f210[_0x5d442(0x139)],_0x5d442(0x162),'\x20',_0x59f210['duplicateCount'],'\x20个']})}),a5_0x45f2ac(Box,{'marginTop':0x1,'children':a5_0x45f2ac(Text,{'color':'gray','children':_0x5d442(0x169)})}),a5_0x18761d(Box,{'marginLeft':0x2,'children':[a5_0x18761d(Text,{'color':'cyan','children':['•\x20',_0x59f210['api']]}),a5_0x18761d(Text,{'color':'dim','children':['\x20',_0x5d442(0x167),_0x59f210[_0x5d442(0x149)],'\x20个模型)']})]}),a5_0x18761d(Box,{'marginLeft':0x2,'children':[a5_0x18761d(Text,{'color':'cyan','children':['•\x20',_0x59f210[_0x5d442(0x13b)]]}),a5_0x45f2ac(Text,{'color':_0x5d442(0x15e),'children':_0x5d442(0x151)})]}),a5_0x45f2ac(Box,{'marginTop':0x1,'children':a5_0x45f2ac(Text,{'color':_0x5d442(0x14b),'children':_0x5d442(0x160)})}),a5_0x45f2ac(Box,{'marginLeft':0x2,'children':a5_0x18761d(Text,{'color':'yellow','children':[_0x5d442(0x156),_0x5d442(0x166),_0x5d442(0x163),_0x59f210[_0x5d442(0x13b)][_0x5d442(0x153)](/^\.\//,'')[_0x5d442(0x153)](_0x5d442(0x147),''),'\x27']})})]}),_0x3eafdd&&a5_0x18761d(Box,{'flexDirection':'column','children':[a5_0x45f2ac(Box,{'children':a5_0x18761d(Text,{'color':_0x5d442(0x16a),'children':['❌\x20',_0x3eafdd]})}),_0x3eafdd[_0x5d442(0x15f)]('登录')&&a5_0x18761d(Box,{'marginTop':0x1,'children':[a5_0x45f2ac(Text,{'color':'yellow','children':'💡\x20请使用\x20'}),a5_0x45f2ac(Text,{'color':_0x5d442(0x16c),'children':'lovrabet\x20auth'}),a5_0x45f2ac(Text,{'color':_0x5d442(0x13e),'children':'\x20重新登录后再试'})]})]})]});};
@@ -1 +1 @@
1
- (function(_0x391bf6,_0xedccc1){const _0xf827fe=a6_0x5167,_0x57a234=_0x391bf6();while(!![]){try{const _0x27d417=parseInt(_0xf827fe(0x19d))/0x1+-parseInt(_0xf827fe(0x1b4))/0x2*(parseInt(_0xf827fe(0x1b1))/0x3)+-parseInt(_0xf827fe(0x19c))/0x4+-parseInt(_0xf827fe(0x1b0))/0x5+parseInt(_0xf827fe(0x1b8))/0x6*(parseInt(_0xf827fe(0x1a8))/0x7)+parseInt(_0xf827fe(0x1b2))/0x8*(parseInt(_0xf827fe(0x1a5))/0x9)+parseInt(_0xf827fe(0x1b5))/0xa;if(_0x27d417===_0xedccc1)break;else _0x57a234['push'](_0x57a234['shift']());}catch(_0x1efcb5){_0x57a234['push'](_0x57a234['shift']());}}}(a6_0x356e,0xe9eff));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{formatDataset}from'./format-dataset.js';function a6_0x356e(){const _0x2f62b4=['forEach','2632100AkdPhy','1414269dCogtw','32jmQsby','filter','4UojZeN','14576000AnOsIL','获取数据集失败,HTTP状态码:\x20','status','6uNMkRI','from','3990604BeZUHG','1481833UcdQbl','json','length','values','dbtableConfig','data','tableName','/smartapi/dataset/getList?appCode=','55206IFQaVV','&pageSize=999&currentPage=1','获取数据集失败:\x20','3228085okirSV','success','text','tableData','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','未知错误','get'];a6_0x356e=function(){return _0x2f62b4;};return a6_0x356e();}export function filterDuplicateDatasets(_0x4a8e77){const _0xdaf999=a6_0x5167,_0x34205c=_0x4a8e77['filter'](_0x2de7fc=>_0x2de7fc[_0xdaf999(0x1a1)]),_0x7961e3=_0x4a8e77[_0xdaf999(0x1b3)](_0x21ba94=>!_0x21ba94['dbtableConfig']),_0x225c64=new Map();return _0x34205c[_0xdaf999(0x1af)](_0x5558b8=>{const _0x151427=_0xdaf999,_0x5d2cda=_0x5558b8[_0x151427(0x1a1)][_0x151427(0x1a3)],_0x1985c3=_0x225c64[_0x151427(0x1ae)](_0x5d2cda);(!_0x1985c3||_0x5558b8['id']>_0x1985c3['id'])&&_0x225c64['set'](_0x5d2cda,_0x5558b8);}),[...Array[_0xdaf999(0x1b9)](_0x225c64[_0xdaf999(0x1a0)]()),..._0x7961e3];}function a6_0x5167(_0x21cfc4,_0x178f97){const _0x356ef2=a6_0x356e();return a6_0x5167=function(_0x516716,_0x43fea8){_0x516716=_0x516716-0x19c;let _0x14eaba=_0x356ef2[_0x516716];return _0x14eaba;},a6_0x5167(_0x21cfc4,_0x178f97);}export async function fetchDatasets(_0x33537e){const _0x16a60d=a6_0x5167,_0x157b54=await fetch(getApiDomain()+_0x16a60d(0x1a4)+_0x33537e+_0x16a60d(0x1a6),{'headers':{'Cookie':getCookie()}});if(!_0x157b54['ok']){if(_0x157b54[_0x16a60d(0x1b7)]===0x191)throw new Error(_0x16a60d(0x1ac));let _0x1bb36e='';try{_0x1bb36e=await _0x157b54[_0x16a60d(0x1aa)]();}catch(_0x2cf4bc){}throw new Error(_0x16a60d(0x1b6)+_0x157b54[_0x16a60d(0x1b7)]+(_0x1bb36e?'\x0a'+_0x1bb36e:''));}const _0x425654=await _0x157b54[_0x16a60d(0x19e)]();if(!_0x425654[_0x16a60d(0x1a9)])throw new Error(_0x16a60d(0x1a7)+(_0x425654['message']||_0x16a60d(0x1ad)));const _0x47ac2c=_0x425654[_0x16a60d(0x1a2)][_0x16a60d(0x1ab)],_0x2a8265=_0x47ac2c[_0x16a60d(0x19f)],_0xa4968a=filterDuplicateDatasets(_0x47ac2c),_0x5ac657=_0xa4968a['length'],_0x3f4770=_0x2a8265-_0x5ac657,_0x4a5eba=formatDataset(_0xa4968a);return{'datasets':_0x4a5eba,'rawData':_0xa4968a,'originalCount':_0x2a8265,'filteredCount':_0x5ac657,'duplicateCount':_0x3f4770};}
1
+ function a6_0x5e90(_0x113d31,_0x4a64e0){const _0x2a79b1=a6_0x2a79();return a6_0x5e90=function(_0x5e9058,_0x402145){_0x5e9058=_0x5e9058-0x9f;let _0xc89721=_0x2a79b1[_0x5e9058];return _0xc89721;},a6_0x5e90(_0x113d31,_0x4a64e0);}(function(_0x4274b2,_0x48d1af){const _0xbebf26=a6_0x5e90,_0x550132=_0x4274b2();while(!![]){try{const _0x2dfb5b=parseInt(_0xbebf26(0xa0))/0x1+-parseInt(_0xbebf26(0xa7))/0x2+parseInt(_0xbebf26(0xae))/0x3+parseInt(_0xbebf26(0xb4))/0x4+-parseInt(_0xbebf26(0xb5))/0x5*(-parseInt(_0xbebf26(0xa8))/0x6)+-parseInt(_0xbebf26(0x9f))/0x7*(-parseInt(_0xbebf26(0xaf))/0x8)+-parseInt(_0xbebf26(0xab))/0x9*(parseInt(_0xbebf26(0xb8))/0xa);if(_0x2dfb5b===_0x48d1af)break;else _0x550132['push'](_0x550132['shift']());}catch(_0x24bc6a){_0x550132['push'](_0x550132['shift']());}}}(a6_0x2a79,0xcae5e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{formatDataset}from'./format-dataset.js';function a6_0x2a79(){const _0x2bbd5a=['tableData','/smartapi/dataset/getList?appCode=','filter','dbtableConfig','&pageSize=999&currentPage=1','1797920HqGyCD','6VcZMXP','forEach','length','90IslBgy','from','获取数据集失败:\x20','2762052TdgCxx','6840BMjRcD','获取数据集失败,HTTP状态码:\x20','未知错误','status','text','3903428WwoisI','3435695IqCBLB','values','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2372860BKfyOh','7070kwFHBU','655660IeCRHZ','get'];a6_0x2a79=function(){return _0x2bbd5a;};return a6_0x2a79();}export function filterDuplicateDatasets(_0x3cf512){const _0x1fae41=a6_0x5e90,_0x4ac32d=_0x3cf512[_0x1fae41(0xa4)](_0x3bb728=>_0x3bb728['dbtableConfig']),_0x2f777f=_0x3cf512[_0x1fae41(0xa4)](_0x160c7f=>!_0x160c7f['dbtableConfig']),_0x2afbd0=new Map();return _0x4ac32d[_0x1fae41(0xa9)](_0x496831=>{const _0x32b05f=_0x1fae41,_0x3f9fae=_0x496831[_0x32b05f(0xa5)]['tableName'],_0x5f308a=_0x2afbd0[_0x32b05f(0xa1)](_0x3f9fae);(!_0x5f308a||_0x496831['id']>_0x5f308a['id'])&&_0x2afbd0['set'](_0x3f9fae,_0x496831);}),[...Array[_0x1fae41(0xac)](_0x2afbd0[_0x1fae41(0xb6)]()),..._0x2f777f];}export async function fetchDatasets(_0x4a8a0d){const _0x1bf12c=a6_0x5e90,_0xbcb556=await fetch(getApiDomain()+_0x1bf12c(0xa3)+_0x4a8a0d+_0x1bf12c(0xa6),{'headers':{'Cookie':getCookie()}});if(!_0xbcb556['ok']){if(_0xbcb556['status']===0x191)throw new Error(_0x1bf12c(0xb7));let _0x41437c='';try{_0x41437c=await _0xbcb556[_0x1bf12c(0xb3)]();}catch(_0x372d69){}throw new Error(_0x1bf12c(0xb0)+_0xbcb556[_0x1bf12c(0xb2)]+(_0x41437c?'\x0a'+_0x41437c:''));}const _0x5e159f=await _0xbcb556['json']();if(!_0x5e159f['success'])throw new Error(_0x1bf12c(0xad)+(_0x5e159f['message']||_0x1bf12c(0xb1)));const _0xb9e485=_0x5e159f['data'][_0x1bf12c(0xa2)],_0x193476=_0xb9e485[_0x1bf12c(0xaa)],_0x4098de=filterDuplicateDatasets(_0xb9e485),_0x512b23=_0x4098de[_0x1bf12c(0xaa)],_0x7ec8a=_0x193476-_0x512b23,_0x5afe2c=formatDataset(_0x4098de);return{'datasets':_0x5afe2c,'rawData':_0x4098de,'originalCount':_0x193476,'filteredCount':_0x512b23,'duplicateCount':_0x7ec8a};}
@@ -1 +1 @@
1
- function a7_0x4928(){const _0x9730df=['25pxDpjB','6sTOHka','slice','766492AHoGkp','replace','dataset','map','140394PWWzwR','4tCNLFk','toUpperCase','trim','values','5063140EOLIQO','pkField','tableName','9054480ypcDuA','1524912EvCTgg','Api','from','name','55615989mWkiYt','18uYhlhw','dbtableConfig','8525209vFluav','filter','code','split','set','forEach'];a7_0x4928=function(){return _0x9730df;};return a7_0x4928();}(function(_0x4d5952,_0xc46ac0){const _0x278105=a7_0x4daa,_0x4ef319=_0x4d5952();while(!![]){try{const _0xb96bd3=parseInt(_0x278105(0x9a))/0x1+parseInt(_0x278105(0x92))/0x2*(parseInt(_0x278105(0x91))/0x3)+parseInt(_0x278105(0xaa))/0x4*(parseInt(_0x278105(0xa7))/0x5)+parseInt(_0x278105(0xa8))/0x6*(parseInt(_0x278105(0xa1))/0x7)+parseInt(_0x278105(0x99))/0x8+-parseInt(_0x278105(0x9f))/0x9*(-parseInt(_0x278105(0x96))/0xa)+-parseInt(_0x278105(0x9e))/0xb;if(_0xb96bd3===_0xc46ac0)break;else _0x4ef319['push'](_0x4ef319['shift']());}catch(_0x509655){_0x4ef319['push'](_0x4ef319['shift']());}}}(a7_0x4928,0xd7905));export function formatDataset(_0x41a878){const _0x3718df=a7_0x4daa,_0x232970=_0x41a878['filter'](_0x2030e6=>_0x2030e6[_0x3718df(0xa0)]),_0x5247ea=_0x41a878[_0x3718df(0xa2)](_0x4aaaeb=>!_0x4aaaeb[_0x3718df(0xa0)]),_0x5baae5=new Map();_0x232970[_0x3718df(0xa6)](_0x4e09ab=>{const _0x3f576c=_0x3718df,_0x5046c0=_0x4e09ab[_0x3f576c(0xa0)][_0x3f576c(0x98)],_0x4fa7f4=_0x5baae5['get'](_0x5046c0);(!_0x4fa7f4||_0x4e09ab['id']>_0x4fa7f4['id'])&&_0x5baae5[_0x3f576c(0xa5)](_0x5046c0,_0x4e09ab);});const _0x138299=Array[_0x3718df(0x9c)](_0x5baae5[_0x3718df(0x95)]())[_0x3718df(0x90)](_0x4c2af8=>{const _0x3fbb46=_0x3718df,_0x22d63f=snakeToCamel(_0x4c2af8[_0x3fbb46(0xa0)]['tableName']);return{'id':_0x4c2af8['id'],'name':_0x4c2af8['name'],'code':_0x4c2af8[_0x3fbb46(0xa3)],'tableName':_0x4c2af8[_0x3fbb46(0xa0)]['tableName'],'apiFucName':_0x22d63f?_0x22d63f+_0x3fbb46(0x9b):_0x3fbb46(0x8f)+_0x4c2af8[_0x3fbb46(0xa3)]+_0x3fbb46(0x9b),'modelName':_0x22d63f||_0x3fbb46(0x8f)+_0x4c2af8[_0x3fbb46(0xa3)],'pkField':_0x4c2af8[_0x3fbb46(0xa0)][_0x3fbb46(0x97)],'allFields':_0x4c2af8[_0x3fbb46(0xa0)]['allFields']?_0x4c2af8[_0x3fbb46(0xa0)]['allFields'][_0x3fbb46(0xa4)](','):[]};}),_0xa96a54=_0x5247ea[_0x3718df(0x90)](_0x4830c1=>{const _0x2a8f0c=_0x3718df,_0x42268f=_0x4830c1[_0x2a8f0c(0xa3)][_0x2a8f0c(0xa9)](-0x6),_0x178a61='dataset_'+_0x42268f,_0x5110d5=snakeToCamel(_0x178a61);return{'id':_0x4830c1['id'],'name':_0x4830c1[_0x2a8f0c(0x9d)],'code':_0x4830c1[_0x2a8f0c(0xa3)],'tableName':_0x178a61,'apiFucName':_0x5110d5?_0x5110d5+_0x2a8f0c(0x9b):_0x2a8f0c(0x8f)+_0x42268f+_0x2a8f0c(0x9b),'modelName':_0x5110d5||'dataset'+_0x42268f,'pkField':undefined,'allFields':[]};});return[..._0x138299,..._0xa96a54];}function a7_0x4daa(_0x44cbce,_0x207444){const _0x4928f8=a7_0x4928();return a7_0x4daa=function(_0x4daa6b,_0x4ca540){_0x4daa6b=_0x4daa6b-0x8f;let _0x5e4233=_0x4928f8[_0x4daa6b];return _0x5e4233;},a7_0x4daa(_0x44cbce,_0x207444);}function snakeToCamel(_0x44ade8){const _0x412e82=a7_0x4daa;if(!_0x44ade8)return _0x44ade8;const _0x53e616=_0x44ade8[_0x412e82(0x94)]();return _0x53e616[_0x412e82(0xab)](/_([a-zA-Z0-9])/g,(_0x5a18b3,_0x4e7b8f)=>_0x4e7b8f[_0x412e82(0x93)]());}
1
+ (function(_0x5ce28c,_0x2a0d47){const _0x56e448=a7_0x26c1,_0x3e34ec=_0x5ce28c();while(!![]){try{const _0x44f56a=-parseInt(_0x56e448(0x1cb))/0x1*(-parseInt(_0x56e448(0x1da))/0x2)+-parseInt(_0x56e448(0x1e2))/0x3+parseInt(_0x56e448(0x1d9))/0x4+parseInt(_0x56e448(0x1cd))/0x5+parseInt(_0x56e448(0x1dd))/0x6*(parseInt(_0x56e448(0x1e3))/0x7)+-parseInt(_0x56e448(0x1e0))/0x8+parseInt(_0x56e448(0x1e4))/0x9*(-parseInt(_0x56e448(0x1df))/0xa);if(_0x44f56a===_0x2a0d47)break;else _0x3e34ec['push'](_0x3e34ec['shift']());}catch(_0x4b7369){_0x3e34ec['push'](_0x3e34ec['shift']());}}}(a7_0x3457,0x92749));export function formatDataset(_0x263458){const _0x4939f9=a7_0x26c1,_0x12ac63=_0x263458[_0x4939f9(0x1d4)](_0x432e3b=>_0x432e3b[_0x4939f9(0x1d6)]),_0x118c4f=_0x263458[_0x4939f9(0x1d4)](_0x2020fc=>!_0x2020fc[_0x4939f9(0x1d6)]),_0x538f3f=new Map();_0x12ac63[_0x4939f9(0x1d7)](_0x4342e0=>{const _0x49e640=_0x4939f9,_0x540f04=_0x4342e0[_0x49e640(0x1d6)][_0x49e640(0x1cc)],_0x5480d2=_0x538f3f[_0x49e640(0x1cf)](_0x540f04);(!_0x5480d2||_0x4342e0['id']>_0x5480d2['id'])&&_0x538f3f['set'](_0x540f04,_0x4342e0);});const _0x556122=Array[_0x4939f9(0x1dc)](_0x538f3f['values']())[_0x4939f9(0x1d3)](_0x1420c9=>{const _0x268f4e=_0x4939f9,_0x25782c=snakeToCamel(_0x1420c9['dbtableConfig'][_0x268f4e(0x1cc)]);return{'id':_0x1420c9['id'],'name':_0x1420c9[_0x268f4e(0x1d1)],'code':_0x1420c9[_0x268f4e(0x1e1)],'tableName':_0x1420c9['dbtableConfig'][_0x268f4e(0x1cc)],'apiFucName':_0x25782c?_0x25782c+_0x268f4e(0x1ce):'dataset'+_0x1420c9[_0x268f4e(0x1e1)]+_0x268f4e(0x1ce),'modelName':_0x25782c||_0x268f4e(0x1d2)+_0x1420c9[_0x268f4e(0x1e1)],'pkField':_0x1420c9[_0x268f4e(0x1d6)]['pkField'],'allFields':_0x1420c9[_0x268f4e(0x1d6)]['allFields']?_0x1420c9[_0x268f4e(0x1d6)][_0x268f4e(0x1db)]['split'](','):[]};}),_0x54a05e=_0x118c4f[_0x4939f9(0x1d3)](_0x983af0=>{const _0x362547=_0x4939f9,_0x4dbe68=_0x983af0[_0x362547(0x1e1)][_0x362547(0x1de)](-0x6),_0x11d4bb=_0x362547(0x1d8)+_0x4dbe68,_0x26700e=snakeToCamel(_0x11d4bb);return{'id':_0x983af0['id'],'name':_0x983af0[_0x362547(0x1d1)],'code':_0x983af0['code'],'tableName':_0x11d4bb,'apiFucName':_0x26700e?_0x26700e+_0x362547(0x1ce):_0x362547(0x1d2)+_0x4dbe68+_0x362547(0x1ce),'modelName':_0x26700e||_0x362547(0x1d2)+_0x4dbe68,'pkField':undefined,'allFields':[]};});return[..._0x556122,..._0x54a05e];}function snakeToCamel(_0x3dcdcb){const _0x42a277=a7_0x26c1;if(!_0x3dcdcb)return _0x3dcdcb;const _0x43a71d=_0x3dcdcb[_0x42a277(0x1d5)]();return _0x43a71d['replace'](/_([a-zA-Z0-9])/g,(_0x968aa6,_0xf86d40)=>_0xf86d40[_0x42a277(0x1d0)]());}function a7_0x26c1(_0x106eca,_0x1218a1){const _0x345766=a7_0x3457();return a7_0x26c1=function(_0x26c1e7,_0x590842){_0x26c1e7=_0x26c1e7-0x1cb;let _0x3343cb=_0x345766[_0x26c1e7];return _0x3343cb;},a7_0x26c1(_0x106eca,_0x1218a1);}function a7_0x3457(){const _0x22d33b=['trim','dbtableConfig','forEach','dataset_','2616132NcKbns','18aikUox','allFields','from','1230bSHcbS','slice','1090qTZCdh','1550168pduTnu','code','2404791mRIpwN','19432NuVybV','103644ONStPI','62606joOswa','tableName','5319630IRAvnn','Api','get','toUpperCase','name','dataset','map','filter'];a7_0x3457=function(){return _0x22d33b;};return a7_0x3457();}
@@ -1 +1 @@
1
- const a8_0x5b5269=a8_0x2711;(function(_0x5b1a3b,_0x49306c){const _0x296b2c=a8_0x2711,_0x260345=_0x5b1a3b();while(!![]){try{const _0x392e5f=-parseInt(_0x296b2c(0x13d))/0x1+parseInt(_0x296b2c(0x162))/0x2*(parseInt(_0x296b2c(0x14a))/0x3)+-parseInt(_0x296b2c(0x166))/0x4*(-parseInt(_0x296b2c(0x14b))/0x5)+parseInt(_0x296b2c(0x13c))/0x6+-parseInt(_0x296b2c(0x157))/0x7+parseInt(_0x296b2c(0x15b))/0x8*(parseInt(_0x296b2c(0x156))/0x9)+-parseInt(_0x296b2c(0x15e))/0xa;if(_0x392e5f===_0x49306c)break;else _0x260345['push'](_0x260345['shift']());}catch(_0x26a82a){_0x260345['push'](_0x260345['shift']());}}}(a8_0x1cca,0xabd9b));import a8_0x5623b1 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a8_0x255625 from'node:path';function a8_0x1cca(){const _0x2cd323=['-client','9IOjMiO','5MNckHl','success',',\x20env:\x20\x22','api.ts.tpl','forEach','resolve','client.ts.tpl','templates/generate-api','join','online','{\x20apiConfigName:\x20\x22','27Mivwyo','1865703YiCghU','init-api','API\x20文件生成成功!','{\x20apiConfigName:\x20','538696VFFaJS','env','-api','10084990mOEiIx','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','keys','format','427658UcXtAn','.ts','tableName','\x22\x20}','2879504NmkSXp','app','dirname','api','5287806PPhAMj','465748GBMFUX','replaceApiContent','typescript','./src/api/','utf8','endsWith','string','code','slice','modelName','client','length'];a8_0x1cca=function(){return _0x2cd323;};return a8_0x1cca();}function a8_0x2711(_0xe27568,_0x4dea8b){const _0x1ccab9=a8_0x1cca();return a8_0x2711=function(_0x27116d,_0x3abd04){_0x27116d=_0x27116d-0x13c;let _0x69efcf=_0x1ccab9[_0x27116d];return _0x69efcf;},a8_0x2711(_0xe27568,_0x4dea8b);}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x7e8aa1,_0x43f9d9='',_0x285c73,_0x4a75cc=![],_0x4444dc,_0x9616f6=a8_0x5b5269(0x140)){const _0x4b7485=a8_0x5b5269,_0x586d51=readConfig(),_0x366b34=_0x285c73||_0x586d51?.[_0x4b7485(0x167)];if(typeof _0x366b34!==_0x4b7485(0x143)||!_0x366b34)throw new Error(_0x4b7485(0x15f));const _0x40f04e=_0x4a75cc?'CONFIG_NAMES.DEFAULT':'\x22'+_0x366b34+'\x22',_0x2d7e5c=typeof _0x586d51[_0x4b7485(0x15c)]==='string'?_0x586d51['env']:undefined,_0x5615e7=_0x4444dc||_0x2d7e5c||_0x4b7485(0x154),_0x30fe58=_0x5615e7!=='online';let _0x4f20a2;if(_0x4a75cc)_0x30fe58?_0x4f20a2=_0x4b7485(0x15a)+_0x40f04e+_0x4b7485(0x14d)+_0x5615e7+_0x4b7485(0x165):_0x4f20a2='';else{const _0x2221f8=_0x30fe58?_0x4b7485(0x14d)+_0x5615e7+'\x22':'';_0x4f20a2=_0x4b7485(0x155)+_0x366b34+'\x22'+_0x2221f8+'\x20}';}const _0x20258b=_0x43f9d9?_0x43f9d9+_0x4b7485(0x15d):_0x4b7485(0x169),_0x2d4944=_0x43f9d9?_0x43f9d9+_0x4b7485(0x149):_0x4b7485(0x147),_0x4c056f=formatDataset(_0x7e8aa1),_0x37f832={};_0x4c056f[_0x4b7485(0x14f)](_0x2b6477=>{const _0xfab5f3=_0x4b7485;_0x37f832[_0x2b6477[_0xfab5f3(0x146)]]={'tableName':_0x2b6477[_0xfab5f3(0x164)],'datasetCode':_0x2b6477[_0xfab5f3(0x144)],'name':_0x2b6477['name']||''};});const _0x3bba56=fileURLToPath(import.meta['url']),_0x313fef=a8_0x255625[_0x4b7485(0x150)](a8_0x255625[_0x4b7485(0x168)](_0x3bba56),'../..'),_0x38c289=a8_0x255625[_0x4b7485(0x153)](_0x313fef,_0x4b7485(0x152)),_0x119461=a8_0x255625[_0x4b7485(0x153)](_0x38c289,_0x4b7485(0x14e)),_0x36e8f3=a8_0x255625['join'](_0x38c289,_0x4b7485(0x151)),_0x457ed6=_0x9616f6[_0x4b7485(0x142)]('/')?_0x9616f6[_0x4b7485(0x145)](0x0,-0x1):_0x9616f6;mkdirSync(_0x457ed6,{'recursive':!![]});const _0x506c99=readFileSync(_0x119461,_0x4b7485(0x141)),_0x573b1a=TemplateReplacer[_0x4b7485(0x13e)](_0x506c99,_0x366b34,_0x37f832,Object['keys'](_0x37f832)[0x0],_0x20258b,_0x40f04e),_0x41777b=await a8_0x5623b1[_0x4b7485(0x161)](_0x573b1a,{'parser':_0x4b7485(0x13f)}),_0x242159=_0x457ed6+'/'+_0x20258b+_0x4b7485(0x163);writeFileSync(_0x242159,_0x41777b,{'encoding':_0x4b7485(0x141)});const _0x2a0281=readFileSync(_0x36e8f3,_0x4b7485(0x141)),_0x42391c=TemplateReplacer[_0x4b7485(0x13e)](_0x2a0281,_0x366b34,_0x37f832,Object[_0x4b7485(0x160)](_0x37f832)[0x0],_0x20258b,_0x40f04e,_0x4f20a2),_0xfca64c=await a8_0x5623b1['format'](_0x42391c,{'parser':'typescript'}),_0x1fb600=_0x457ed6+'/'+_0x2d4944+_0x4b7485(0x163);writeFileSync(_0x1fb600,_0xfca64c,{'encoding':'utf8'});const _0x491f15=Object['keys'](_0x37f832)[_0x4b7485(0x148)];return logger[_0x4b7485(0x14c)](_0x4b7485(0x158),_0x4b7485(0x159),undefined,{'apiFile':_0x242159,'clientFile':_0x1fb600,'modelCount':_0x491f15,'configName':_0x40f04e}),{'modelCount':_0x491f15,'apiFilePath':_0x242159,'clientFilePath':_0x1fb600,'configName':_0x40f04e};}
1
+ const a8_0x344d00=a8_0x2543;(function(_0x557c56,_0xdd33c7){const _0x17cad9=a8_0x2543,_0x523231=_0x557c56();while(!![]){try{const _0x34b9e9=-parseInt(_0x17cad9(0xb4))/0x1*(-parseInt(_0x17cad9(0xd7))/0x2)+-parseInt(_0x17cad9(0xd3))/0x3*(parseInt(_0x17cad9(0xb5))/0x4)+-parseInt(_0x17cad9(0xb3))/0x5*(parseInt(_0x17cad9(0xb2))/0x6)+parseInt(_0x17cad9(0xd5))/0x7*(-parseInt(_0x17cad9(0xc8))/0x8)+-parseInt(_0x17cad9(0xc4))/0x9*(parseInt(_0x17cad9(0xc3))/0xa)+parseInt(_0x17cad9(0xdd))/0xb*(parseInt(_0x17cad9(0xc5))/0xc)+parseInt(_0x17cad9(0xd8))/0xd;if(_0x34b9e9===_0xdd33c7)break;else _0x523231['push'](_0x523231['shift']());}catch(_0x14c6e7){_0x523231['push'](_0x523231['shift']());}}}(a8_0x3f9c,0xaa311));import a8_0x5aff0c from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a8_0x2068f0 from'node:path';function a8_0x3f9c(){const _0x236136=['请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','{\x20apiConfigName:\x20','keys','name','endsWith','client.ts.tpl','tableName','10xByPRw','10631403blLILF','115452VtobXJ','join','slice','24mjbEGd','online',',\x20env:\x20\x22','string','format','-client','resolve','API\x20文件生成成功!','CONFIG_NAMES.DEFAULT','dirname','.ts','4012653ZWSFVk','env','2861201UEmaLS','templates/generate-api','2gCzRgG','59811037RlnBfU','api.ts.tpl','code','./src/api/','length','341fCiLzv','\x22\x20}','-api','6473022VtVdQO','5uCacyX','621889ynrLCq','4iZqyLL','utf8','modelName','success','forEach','replaceApiContent','typescript'];a8_0x3f9c=function(){return _0x236136;};return a8_0x3f9c();}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a8_0x2543(_0x60a345,_0x164683){const _0x3f9c26=a8_0x3f9c();return a8_0x2543=function(_0x25438a,_0x2169bb){_0x25438a=_0x25438a-0xb2;let _0x5335c6=_0x3f9c26[_0x25438a];return _0x5335c6;},a8_0x2543(_0x60a345,_0x164683);}export async function generateApiFile(_0x3f52ea,_0x31ac3d='',_0x41374f,_0x4b31ec=![],_0x53f264,_0x2cc35e=a8_0x344d00(0xdb)){const _0x549eed=a8_0x344d00,_0x5de0ef=readConfig(),_0x50ea97=_0x41374f||_0x5de0ef?.['app'];if(typeof _0x50ea97!=='string'||!_0x50ea97)throw new Error(_0x549eed(0xbc));const _0x45e96b=_0x4b31ec?_0x549eed(0xd0):'\x22'+_0x50ea97+'\x22',_0x5622ea=typeof _0x5de0ef[_0x549eed(0xd4)]===_0x549eed(0xcb)?_0x5de0ef['env']:undefined,_0x2630fe=_0x53f264||_0x5622ea||_0x549eed(0xc9),_0x5b8a43=_0x2630fe!==_0x549eed(0xc9);let _0x37d8c7;if(_0x4b31ec)_0x5b8a43?_0x37d8c7=_0x549eed(0xbd)+_0x45e96b+_0x549eed(0xca)+_0x2630fe+_0x549eed(0xde):_0x37d8c7='';else{const _0x2a8275=_0x5b8a43?',\x20env:\x20\x22'+_0x2630fe+'\x22':'';_0x37d8c7='{\x20apiConfigName:\x20\x22'+_0x50ea97+'\x22'+_0x2a8275+'\x20}';}const _0x52edca=_0x31ac3d?_0x31ac3d+_0x549eed(0xdf):'api',_0xdde871=_0x31ac3d?_0x31ac3d+_0x549eed(0xcd):'client',_0x2149be=formatDataset(_0x3f52ea),_0x39e154={};_0x2149be[_0x549eed(0xb9)](_0x27f0ff=>{const _0x2e65f0=_0x549eed;_0x39e154[_0x27f0ff[_0x2e65f0(0xb7)]]={'tableName':_0x27f0ff[_0x2e65f0(0xc2)],'datasetCode':_0x27f0ff[_0x2e65f0(0xda)],'name':_0x27f0ff[_0x2e65f0(0xbf)]||''};});const _0x258513=fileURLToPath(import.meta['url']),_0x679bb7=a8_0x2068f0[_0x549eed(0xce)](a8_0x2068f0[_0x549eed(0xd1)](_0x258513),'../..'),_0x162f23=a8_0x2068f0[_0x549eed(0xc6)](_0x679bb7,_0x549eed(0xd6)),_0xb17a97=a8_0x2068f0['join'](_0x162f23,_0x549eed(0xd9)),_0x3bc5d0=a8_0x2068f0[_0x549eed(0xc6)](_0x162f23,_0x549eed(0xc1)),_0x1404a7=_0x2cc35e[_0x549eed(0xc0)]('/')?_0x2cc35e[_0x549eed(0xc7)](0x0,-0x1):_0x2cc35e;mkdirSync(_0x1404a7,{'recursive':!![]});const _0x401219=readFileSync(_0xb17a97,_0x549eed(0xb6)),_0x244f48=TemplateReplacer[_0x549eed(0xba)](_0x401219,_0x50ea97,_0x39e154,Object[_0x549eed(0xbe)](_0x39e154)[0x0],_0x52edca,_0x45e96b),_0x210177=await a8_0x5aff0c[_0x549eed(0xcc)](_0x244f48,{'parser':_0x549eed(0xbb)}),_0x34a2c0=_0x1404a7+'/'+_0x52edca+_0x549eed(0xd2);writeFileSync(_0x34a2c0,_0x210177,{'encoding':_0x549eed(0xb6)});const _0x10a720=readFileSync(_0x3bc5d0,_0x549eed(0xb6)),_0x3be8d3=TemplateReplacer[_0x549eed(0xba)](_0x10a720,_0x50ea97,_0x39e154,Object[_0x549eed(0xbe)](_0x39e154)[0x0],_0x52edca,_0x45e96b,_0x37d8c7),_0x2a6ef5=await a8_0x5aff0c[_0x549eed(0xcc)](_0x3be8d3,{'parser':'typescript'}),_0x4f22b8=_0x1404a7+'/'+_0xdde871+_0x549eed(0xd2);writeFileSync(_0x4f22b8,_0x2a6ef5,{'encoding':_0x549eed(0xb6)});const _0x112cc4=Object[_0x549eed(0xbe)](_0x39e154)[_0x549eed(0xdc)];return logger[_0x549eed(0xb8)]('init-api',_0x549eed(0xcf),undefined,{'apiFile':_0x34a2c0,'clientFile':_0x4f22b8,'modelCount':_0x112cc4,'configName':_0x45e96b}),{'modelCount':_0x112cc4,'apiFilePath':_0x34a2c0,'clientFilePath':_0x4f22b8,'configName':_0x45e96b};}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x304279,_0x35a462){const _0xbf611a=a9_0x2144,_0x2e245b=_0x304279();while(!![]){try{const _0x92ca41=parseInt(_0xbf611a(0x1c0))/0x1+-parseInt(_0xbf611a(0x1ba))/0x2*(-parseInt(_0xbf611a(0x1c3))/0x3)+-parseInt(_0xbf611a(0x1bc))/0x4+parseInt(_0xbf611a(0x1e2))/0x5+-parseInt(_0xbf611a(0x1b0))/0x6+parseInt(_0xbf611a(0x1e3))/0x7*(parseInt(_0xbf611a(0x1d1))/0x8)+-parseInt(_0xbf611a(0x1e0))/0x9*(parseInt(_0xbf611a(0x1be))/0xa);if(_0x92ca41===_0x35a462)break;else _0x2e245b['push'](_0x2e245b['shift']());}catch(_0x2a0169){_0x2e245b['push'](_0x2e245b['shift']());}}}(a9_0x156f,0x4a671));import{jsx as a9_0x4d4d67}from'react/jsx-runtime';import{render}from'ink';function a9_0x2144(_0x2ad653,_0x2dda5e){const _0x156fe7=a9_0x156f();return a9_0x2144=function(_0x2144f8,_0x1eb705){_0x2144f8=_0x2144f8-0x1ae;let _0x11829c=_0x156fe7[_0x2144f8];return _0x11829c;},a9_0x2144(_0x2ad653,_0x2dda5e);}import{ApiPullUI}from'./api-pull-ui.js';function a9_0x156f(){const _0x333c69=['datasetcode','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','map','message','object','Available\x20commands:','filter','\x20\x20错误:\x20','help','isArray','8ijARDL','×\x20--datasetcode\x20参数不能为空','exit','pull','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','log','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','trim','\x1b[0m','❌\x20错误:不再支持位置参数方式','input','9ovSaho','env','282025cMCWUR','2468109nFoGSv','doc','×\x20--params\x20参数不是有效的\x20JSON\x20格式','×\x20未配置\x20AppCode','split','2036052YAFuxa','params','parse','\x1b[90m*\x20仅生成指定数据集的文档:\x20','output','Unknown\x20api\x20command:\x20','error','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','appcode','flags','2LMDuFI','!\x20请使用以下方式之一:','934592ivrUxl','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','4527030WJWlvl','\x1b[90m*\x20使用配置的应用AppCode:\x20','503432lJBxxH','string','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','1254066isJDRT','join','请使用\x20--appcode\x20参数,例如:'];a9_0x156f=function(){return _0x333c69;};return a9_0x156f();}import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0xcbd45){const _0x37bf2c=a9_0x2144,_0x9ff9b4=_0xcbd45[_0x37bf2c(0x1df)][0x1];if(_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1cf)]){console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1c2));return;}if(_0x9ff9b4===_0x37bf2c(0x1d4)){_0xcbd45['input'][0x2]&&(console[_0x37bf2c(0x1b6)](_0x37bf2c(0x1de)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1c5)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1c7)+_0xcbd45['input'][0x2]),process[_0x37bf2c(0x1d3)](0x1));const _0xdf1ee2=getConfigAppCode();let _0x3d28d5=_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1b8)];const _0x4160da=typeof _0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1e1)]===_0x37bf2c(0x1c1)?_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1e1)]:undefined,_0x34c6ae=_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1b4)];!_0x3d28d5&&!_0xdf1ee2&&(console[_0x37bf2c(0x1b6)](_0x37bf2c(0x1ae)),console['log'](_0x37bf2c(0x1bb)),console['log']('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console[_0x37bf2c(0x1d7)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process[_0x37bf2c(0x1d3)](0x1)),_0x3d28d5&&_0xdf1ee2&&_0x3d28d5===_0xdf1ee2&&(console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1bf)+_0x3d28d5+_0x37bf2c(0x1dd)),console['log'](_0x37bf2c(0x1b7)),_0x3d28d5=undefined),render(a9_0x4d4d67(ApiPullUI,{'appCode':_0x3d28d5,'env':_0x4160da,'output':_0x34c6ae}));}else{if(_0x9ff9b4===_0x37bf2c(0x1e4)){_0xcbd45[_0x37bf2c(0x1df)][0x2]&&(console[_0x37bf2c(0x1b6)](_0x37bf2c(0x1de)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1c5)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1d8)+_0xcbd45[_0x37bf2c(0x1df)][0x2]),process[_0x37bf2c(0x1d3)](0x1));const _0x5dfd1c=getConfigAppCode();let _0x3b95ca=_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1b8)];const _0x4a494f=typeof _0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1e1)]===_0x37bf2c(0x1c1)?_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1e1)]:undefined,_0x42258d=_0xcbd45['flags'][_0x37bf2c(0x1b4)],_0x49ca4c=_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1b1)],_0x528da9=_0xcbd45[_0x37bf2c(0x1b9)][_0x37bf2c(0x1c6)];!_0x3b95ca&&!_0x5dfd1c&&(console['error'](_0x37bf2c(0x1ae)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1bb)),console['log']('\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>'),console['log'](_0x37bf2c(0x1db)),process[_0x37bf2c(0x1d3)](0x1));_0x3b95ca&&_0x5dfd1c&&_0x3b95ca===_0x5dfd1c&&(console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1bf)+_0x3b95ca+_0x37bf2c(0x1dd)),_0x3b95ca=undefined);let _0x51db46;if(_0x49ca4c)try{_0x51db46=JSON[_0x37bf2c(0x1b2)](_0x49ca4c),(typeof _0x51db46!==_0x37bf2c(0x1cb)||_0x51db46===null||Array[_0x37bf2c(0x1d0)](_0x51db46))&&(console[_0x37bf2c(0x1b6)]('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process['exit'](0x1));}catch(_0x5282a4){console['error'](_0x37bf2c(0x1e5)),console['error'](_0x37bf2c(0x1ce)+(_0x5282a4 instanceof Error?_0x5282a4[_0x37bf2c(0x1ca)]:String(_0x5282a4))),process[_0x37bf2c(0x1d3)](0x1);}let _0x4d9efa;_0x528da9&&(_0x4d9efa=_0x528da9[_0x37bf2c(0x1af)](',')[_0x37bf2c(0x1c9)](_0x1c4a73=>_0x1c4a73[_0x37bf2c(0x1dc)]())[_0x37bf2c(0x1cd)](_0x111e4d=>_0x111e4d['length']>0x0),_0x4d9efa['length']===0x0&&(console['error'](_0x37bf2c(0x1d2)),process['exit'](0x1)),console['log'](_0x37bf2c(0x1b3)+_0x4d9efa[_0x37bf2c(0x1c4)](',\x20')+_0x37bf2c(0x1dd))),render(a9_0x4d4d67(ApiDocUI,{'appCode':_0x3b95ca,'env':_0x4a494f,'output':_0x42258d,'extraParams':_0x51db46,'datasetCodes':_0x4d9efa}));}else console['error'](_0x37bf2c(0x1b5)+_0x9ff9b4),console['log'](_0x37bf2c(0x1cc)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1d6)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1d5)),console[_0x37bf2c(0x1d7)]('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)'),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1bd)),console[_0x37bf2c(0x1d7)](''),console[_0x37bf2c(0x1d7)]('\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档'),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1da)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1d9)),console[_0x37bf2c(0x1d7)](_0x37bf2c(0x1c8)),process['exit'](0x1);}}
1
+ (function(_0x2cddf9,_0x42fd3e){const _0x2b99a6=a9_0x1d5b,_0x55b5eb=_0x2cddf9();while(!![]){try{const _0x441152=parseInt(_0x2b99a6(0x16e))/0x1*(-parseInt(_0x2b99a6(0x16b))/0x2)+-parseInt(_0x2b99a6(0x15f))/0x3+parseInt(_0x2b99a6(0x17f))/0x4+-parseInt(_0x2b99a6(0x180))/0x5+-parseInt(_0x2b99a6(0x167))/0x6+-parseInt(_0x2b99a6(0x17b))/0x7+parseInt(_0x2b99a6(0x178))/0x8;if(_0x441152===_0x42fd3e)break;else _0x55b5eb['push'](_0x55b5eb['shift']());}catch(_0x19f5f1){_0x55b5eb['push'](_0x55b5eb['shift']());}}}(a9_0x5e85,0x45798));function a9_0x5e85(){const _0x5793d5=['Unknown\x20api\x20command:\x20','doc','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','parse','help','flags','pull','object','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','❌\x20错误:不再支持位置参数方式','\x1b[90m*\x20使用配置的应用AppCode:\x20','params','469008SpFvhj','env','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','exit','×\x20--datasetcode\x20参数不能为空','message','appcode','!\x20请使用以下方式之一:','1730802aJMowe','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','×\x20--params\x20参数不是有效的\x20JSON\x20格式','请使用\x20--appcode\x20参数,例如:','2JSNxvB','string','\x1b[0m','130297YDOaKC','Available\x20commands:','join','log','input','output','\x20\x20错误:\x20','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20指定输出目录(pull:\x20./src/api/,doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--datasetcode\x20<codes>\x20指定要生成文档的数据集代码(多个用逗号分隔,仅\x20doc\x20命令)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示此帮助信息\x0a\x0a示例:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境拉取\x20API\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成所有数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境生成文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20只生成指定数据集的文档\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20生成多个数据集的文档\x0a','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','error','13018400cZkDcs','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','map','1828540QmfqUI','filter','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','153940PXioWi','2724485yoVvbm','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'];a9_0x5e85=function(){return _0x5793d5;};return a9_0x5e85();}import{jsx as a9_0x2fc234}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';function a9_0x1d5b(_0x1bbf00,_0x14e8a3){const _0x5e8589=a9_0x5e85();return a9_0x1d5b=function(_0x1d5ba7,_0x5971ef){_0x1d5ba7=_0x1d5ba7-0x157;let _0x40fe1a=_0x5e8589[_0x1d5ba7];return _0x40fe1a;},a9_0x1d5b(_0x1bbf00,_0x14e8a3);}import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x1d6fe9){const _0x283257=a9_0x1d5b,_0x101508=_0x1d6fe9[_0x283257(0x172)][0x1];if(_0x1d6fe9[_0x283257(0x158)][_0x283257(0x157)]){console[_0x283257(0x171)](_0x283257(0x175));return;}if(_0x101508===_0x283257(0x159)){_0x1d6fe9[_0x283257(0x172)][0x2]&&(console['error'](_0x283257(0x15c)),console[_0x283257(0x171)]('请使用\x20--appcode\x20参数,例如:'),console[_0x283257(0x171)](_0x283257(0x17e)+_0x1d6fe9[_0x283257(0x172)][0x2]),process['exit'](0x1));const _0xe85672=getConfigAppCode();let _0x1acea4=_0x1d6fe9[_0x283257(0x158)][_0x283257(0x165)];const _0x3b246a=typeof _0x1d6fe9[_0x283257(0x158)][_0x283257(0x160)]===_0x283257(0x16c)?_0x1d6fe9[_0x283257(0x158)]['env']:undefined,_0x3b8253=_0x1d6fe9['flags'][_0x283257(0x173)];!_0x1acea4&&!_0xe85672&&(console[_0x283257(0x177)]('×\x20未配置\x20AppCode'),console[_0x283257(0x171)](_0x283257(0x166)),console[_0x283257(0x171)](_0x283257(0x176)),console[_0x283257(0x171)]('\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>'),process[_0x283257(0x162)](0x1)),_0x1acea4&&_0xe85672&&_0x1acea4===_0xe85672&&(console[_0x283257(0x171)](_0x283257(0x15d)+_0x1acea4+'\x1b[0m'),console[_0x283257(0x171)](_0x283257(0x185)),_0x1acea4=undefined),render(a9_0x2fc234(ApiPullUI,{'appCode':_0x1acea4,'env':_0x3b246a,'output':_0x3b8253}));}else{if(_0x101508===_0x283257(0x184)){_0x1d6fe9['input'][0x2]&&(console[_0x283257(0x177)]('❌\x20错误:不再支持位置参数方式'),console['log'](_0x283257(0x16a)),console[_0x283257(0x171)](_0x283257(0x179)+_0x1d6fe9[_0x283257(0x172)][0x2]),process[_0x283257(0x162)](0x1));const _0x217179=getConfigAppCode();let _0x4e76ec=_0x1d6fe9[_0x283257(0x158)][_0x283257(0x165)];const _0x33ca52=typeof _0x1d6fe9[_0x283257(0x158)]['env']===_0x283257(0x16c)?_0x1d6fe9[_0x283257(0x158)][_0x283257(0x160)]:undefined,_0x37b509=_0x1d6fe9[_0x283257(0x158)]['output'],_0x39b754=_0x1d6fe9[_0x283257(0x158)][_0x283257(0x15e)],_0x57307e=_0x1d6fe9[_0x283257(0x158)]['datasetcode'];!_0x4e76ec&&!_0x217179&&(console['error']('×\x20未配置\x20AppCode'),console[_0x283257(0x171)](_0x283257(0x166)),console['log'](_0x283257(0x176)),console[_0x283257(0x171)](_0x283257(0x168)),process['exit'](0x1));_0x4e76ec&&_0x217179&&_0x4e76ec===_0x217179&&(console[_0x283257(0x171)](_0x283257(0x15d)+_0x4e76ec+_0x283257(0x16d)),_0x4e76ec=undefined);let _0x58f0d6;if(_0x39b754)try{_0x58f0d6=JSON[_0x283257(0x186)](_0x39b754),(typeof _0x58f0d6!==_0x283257(0x15a)||_0x58f0d6===null||Array['isArray'](_0x58f0d6))&&(console['error']('×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象'),process[_0x283257(0x162)](0x1));}catch(_0x5e1f80){console[_0x283257(0x177)](_0x283257(0x169)),console[_0x283257(0x177)](_0x283257(0x174)+(_0x5e1f80 instanceof Error?_0x5e1f80[_0x283257(0x164)]:String(_0x5e1f80))),process['exit'](0x1);}let _0x1bcd30;_0x57307e&&(_0x1bcd30=_0x57307e['split'](',')[_0x283257(0x17a)](_0x5ca36b=>_0x5ca36b['trim']())[_0x283257(0x17c)](_0x3444ec=>_0x3444ec['length']>0x0),_0x1bcd30['length']===0x0&&(console[_0x283257(0x177)](_0x283257(0x163)),process[_0x283257(0x162)](0x1)),console[_0x283257(0x171)]('\x1b[90m*\x20仅生成指定数据集的文档:\x20'+_0x1bcd30[_0x283257(0x170)](',\x20')+'\x1b[0m')),render(a9_0x2fc234(ApiDocUI,{'appCode':_0x4e76ec,'env':_0x33ca52,'output':_0x37b509,'extraParams':_0x58f0d6,'datasetCodes':_0x1bcd30}));}else console[_0x283257(0x177)](_0x283257(0x183)+_0x101508),console[_0x283257(0x171)](_0x283257(0x16f)),console[_0x283257(0x171)]('\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件'),console[_0x283257(0x171)](_0x283257(0x182)),console['log'](_0x283257(0x15b)),console[_0x283257(0x171)]('\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),console['log'](''),console[_0x283257(0x171)]('\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档'),console[_0x283257(0x171)](_0x283257(0x161)),console['log'](_0x283257(0x17d)),console['log'](_0x283257(0x181)),process[_0x283257(0x162)](0x1);}}