@lovrabet/cli 1.1.14 → 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 (57) 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 +2 -2
  55. package/templates/pages/blank/index.tsx.tpl +2 -1
  56. package/templates/pages/sdk-fetch/index.tsx.tpl +1 -0
  57. package/templates/projects/sub-app-react-demo/vite.config.ts +33 -15
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 a0_0x5695(){const _0x591247=['backspace','635975xsyWzy','路径不能以\x20/\x20开头或结尾','return','1464SJhKFK','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','330vReAPh','3208653AmIHNo','green','771021pGSzhM','页面路由地址:\x20','1560232hCTXAW','6033SOpJkI','length','red','页面路径不合法','\x20直接回车确认,或输入自定义路由地址','includes','endsWith','existsSync','355950hzYKAi','页面路径\x20','\x20已存在,请使用其他路径','\x20Step2:\x20','my-page','6POphSo','gray','test','2598592OULQvS','column','delete','slice','trim','\x20←\x20'];a0_0x5695=function(){return _0x591247;};return a0_0x5695();}(function(_0xc3f490,_0xa954b4){const _0x3fa995=a0_0x2dcc,_0x93c729=_0xc3f490();while(!![]){try{const _0x1475ed=-parseInt(_0x3fa995(0x19c))/0x1+-parseInt(_0x3fa995(0x1a6))/0x2+-parseInt(_0x3fa995(0x1a7))/0x3*(parseInt(_0x3fa995(0x19f))/0x4)+parseInt(_0x3fa995(0x1af))/0x5*(-parseInt(_0x3fa995(0x1b4))/0x6)+parseInt(_0x3fa995(0x1a2))/0x7+-parseInt(_0x3fa995(0x1b7))/0x8+parseInt(_0x3fa995(0x1a4))/0x9*(parseInt(_0x3fa995(0x1a1))/0xa);if(_0x1475ed===_0xa954b4)break;else _0x93c729['push'](_0x93c729['shift']());}catch(_0x28f716){_0x93c729['push'](_0x93c729['shift']());}}}(a0_0x5695,0xb402d));function a0_0x2dcc(_0x3e0b2f,_0x1ee762){const _0x569585=a0_0x5695();return a0_0x2dcc=function(_0x2dcc6f,_0x2eab02){_0x2dcc6f=_0x2dcc6f-0x196;let _0x2c7008=_0x569585[_0x2dcc6f];return _0x2c7008;},a0_0x2dcc(_0x3e0b2f,_0x1ee762);}import{jsx as a0_0x34cc70,jsxs as a0_0x1b2739}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x3f00aa from'node:fs';export function InputProjectCode(_0x505009){const _0x417d6b=a0_0x2dcc,{onSubmit:_0x112f80,pagePath:_0x1032cb}=_0x505009,[_0x4b6fe5,_0x57a03e]=useState(''),[_0x2a5695,_0x3291a2]=useState(''),_0x56e8f2=_0x417d6b(0x1b3);function _0x32a1dd(_0x1f2af5){const _0x5555e5=_0x417d6b;if(_0x1f2af5[_0x5555e5(0x1a8)]>0x64)return{'valid':![],'message':'页面路径长度不能超过\x20100\x20个字符'};if(_0x1f2af5['startsWith']('/')||_0x1f2af5[_0x5555e5(0x1ad)]('/'))return{'valid':![],'message':_0x5555e5(0x19d)};if(_0x1f2af5[_0x5555e5(0x1ac)]('//'))return{'valid':![],'message':'路径不能包含连续的\x20/'};const _0x14206f=_0x1f2af5['split']('/');for(const _0x200127 of _0x14206f){if(!_0x200127)continue;const _0xdd366f=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xdd366f[_0x5555e5(0x1b6)](_0x200127))return{'valid':![],'message':_0x5555e5(0x1a0)};}return{'valid':!![]};}return useInput((_0x69ea20,_0x1039ab)=>{const _0xec28d1=_0x417d6b;if(_0x1039ab[_0xec28d1(0x19e)]){const _0x5f1ab5=_0x4b6fe5[_0xec28d1(0x199)]()||_0x56e8f2;if(_0x2a5695)return;const _0x69daf5=_0x1032cb+'/'+_0x5f1ab5;if(a0_0x3f00aa[_0xec28d1(0x1ae)](_0x69daf5)){_0x3291a2(_0xec28d1(0x1b0)+_0x5f1ab5+_0xec28d1(0x1b1));return;}_0x112f80(_0x5f1ab5),_0x57a03e(''),_0x3291a2('');}else _0x1039ab[_0xec28d1(0x19b)]||_0x1039ab[_0xec28d1(0x197)]?_0x57a03e(_0x4044c7=>{const _0x84f935=_0xec28d1,_0x251f45=_0x4044c7[_0x84f935(0x198)](0x0,-0x1),{valid:_0x31a8b6,message:_0x99936d}=_0x32a1dd(_0x251f45);return _0x3291a2(_0x31a8b6?'':_0x99936d||_0x84f935(0x1aa)),_0x251f45;}):_0x57a03e(_0x49cfa2=>{const _0x27b628=_0xec28d1,_0x907cd4=_0x49cfa2+_0x69ea20,{valid:_0x54b4b1,message:_0x413deb}=_0x32a1dd(_0x907cd4);return _0x3291a2(_0x54b4b1?'':_0x413deb||_0x27b628(0x1aa)),_0x907cd4;});}),a0_0x1b2739(Box,{'flexDirection':_0x417d6b(0x196),'children':[a0_0x1b2739(Box,{'children':[a0_0x34cc70(Text,{'color':'gray','children':_0x417d6b(0x1b2)}),a0_0x34cc70(Text,{'children':_0x417d6b(0x1a5)}),_0x4b6fe5?a0_0x34cc70(Text,{'color':_0x417d6b(0x1a3),'children':_0x4b6fe5}):a0_0x34cc70(Text,{'color':'gray','children':_0x56e8f2}),_0x2a5695&&a0_0x1b2739(Text,{'color':_0x417d6b(0x1a9),'children':[_0x417d6b(0x19a),_0x2a5695]})]}),!_0x2a5695&&!_0x4b6fe5&&a0_0x34cc70(Box,{'children':a0_0x34cc70(Text,{'color':_0x417d6b(0x1b5),'children':_0x417d6b(0x1ab)})})]});}
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_0x3b8f00=a1_0x5c88;(function(_0x217fa6,_0x231486){const _0x3ccb2e=a1_0x5c88,_0x5c2b10=_0x217fa6();while(!![]){try{const _0x3318d3=-parseInt(_0x3ccb2e(0x115))/0x1+-parseInt(_0x3ccb2e(0x10b))/0x2*(parseInt(_0x3ccb2e(0xfa))/0x3)+parseInt(_0x3ccb2e(0x116))/0x4+-parseInt(_0x3ccb2e(0xff))/0x5*(-parseInt(_0x3ccb2e(0x100))/0x6)+parseInt(_0x3ccb2e(0x112))/0x7+-parseInt(_0x3ccb2e(0x11c))/0x8+parseInt(_0x3ccb2e(0xfe))/0x9*(-parseInt(_0x3ccb2e(0xf9))/0xa);if(_0x3318d3===_0x231486)break;else _0x5c2b10['push'](_0x5c2b10['shift']());}catch(_0x3a752b){_0x5c2b10['push'](_0x5c2b10['shift']());}}}(a1_0x59a5,0xa70b7));import{jsx as a1_0x531bb6,jsxs as a1_0x47b014,Fragment as a1_0x1f2d95}from'react/jsx-runtime';function a1_0x5c88(_0x3f8cdb,_0x494288){const _0x59a5ef=a1_0x59a5();return a1_0x5c88=function(_0x5c8854,_0x37769a){_0x5c8854=_0x5c8854-0xf8;let _0x3d2c09=_0x59a5ef[_0x5c8854];return _0x3d2c09;},a1_0x5c88(_0x3f8cdb,_0x494288);}import{fileURLToPath}from'node:url';import a1_0x5a4952 from'node:path';function a1_0x59a5(){const _0x485f3d=['\x20*\x20页面路径:\x20','2rsUHTR','dirname','error','resolve','info','\x20Step2:\x20','../../templates/pages','5013540atNnFV','green','gray','702736pEERiN','1624980wXDzwM','then','页面添加成功:\x20','finally','message','cyan','5094096GSBTji','\x20Step1:\x20','setLogPath','10kzMehE','73761hvDmMG','cwd','正在创建页面,请稍候…','join','949086zLNVKr','105ArwTWk','294654zLROsW','now','url','processTemplate','页面添加失败:\x20','\x20*\x20页面创建成功!','success','\x20*\x20页面文件已创建,可直接通过路由访问','add-page','src'];a1_0x59a5=function(){return _0x485f3d;};return a1_0x59a5();}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';const __dirname=a1_0x5a4952[a1_0x3b8f00(0x10c)](fileURLToPath(import.meta[a1_0x3b8f00(0x102)])),pageTemplateDir=a1_0x5a4952['resolve'](__dirname,a1_0x3b8f00(0x111)),projectDir=process[a1_0x3b8f00(0xfb)]();export const AddPage=()=>{const _0x1c98c3=a1_0x3b8f00,{exit:_0x4a883c}=useApp(),[_0x58b5f6,_0x4dd094]=useState(''),[_0x14ae14,_0x4527d7]=useState(''),[_0x32bd49,_0x39784b]=useState(![]),[_0x3308dd,_0x5518fe]=useState(![]),_0x251f59=a1_0x5a4952[_0x1c98c3(0xfd)](projectDir,_0x1c98c3(0x109),'pages'),_0x319176=a1_0x5a4952[_0x1c98c3(0xfd)](_0x251f59,_0x14ae14),_0x343b74=a1_0x5a4952[_0x1c98c3(0xfd)](_0x1c98c3(0x109),'pages',_0x14ae14);useEffect(()=>{const _0x5bd63c=_0x1c98c3,_0x53947f=a1_0x5a4952[_0x5bd63c(0x10e)](pageTemplateDir,_0x58b5f6);if(_0x58b5f6&&_0x14ae14){_0x39784b(!![]),logger[_0x5bd63c(0xf8)](process[_0x5bd63c(0xfb)]());const _0x12f1ce=Date['now']();logger[_0x5bd63c(0x10f)](_0x5bd63c(0x108),'开始添加页面:\x20'+_0x14ae14,{'template':_0x58b5f6,'targetPath':_0x343b74}),TemplateReplacer[_0x5bd63c(0x103)](_0x53947f,a1_0x5a4952['join'](_0x251f59,_0x14ae14),_0x14ae14,_0x58b5f6)[_0x5bd63c(0x117)](()=>{const _0x469966=_0x5bd63c,_0x5d5e48=Date[_0x469966(0x101)]()-_0x12f1ce;logger[_0x469966(0x106)]('add-page',_0x469966(0x118)+_0x14ae14,_0x5d5e48,{'template':_0x58b5f6,'targetPath':_0x343b74,'routePath':_0x14ae14}),_0x5518fe(!![]);})['catch'](_0x2635b6=>{const _0x72751e=_0x5bd63c,_0x4aa481=Date[_0x72751e(0x101)]()-_0x12f1ce;logger[_0x72751e(0x10d)](_0x72751e(0x108),_0x72751e(0x104)+_0x14ae14,{'template':_0x58b5f6,'targetPath':_0x343b74,'error':_0x2635b6 instanceof Error?_0x2635b6[_0x72751e(0x11a)]:String(_0x2635b6),'duration':_0x4aa481});})[_0x5bd63c(0x119)](()=>{_0x39784b(![]);});}},[_0x58b5f6,_0x14ae14]),useEffect(()=>{_0x3308dd&&setTimeout(()=>{_0x4a883c();});},[_0x3308dd]);if(_0x58b5f6)return a1_0x47b014(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x47b014(Box,{'children':[a1_0x531bb6(Text,{'color':'gray','children':_0x1c98c3(0x11d)}),a1_0x531bb6(Text,{'children':'已选择页面模板\x20'}),a1_0x531bb6(Text,{'color':'green','children':_0x58b5f6})]}),_0x14ae14?a1_0x47b014(Box,{'children':[a1_0x531bb6(Text,{'color':_0x1c98c3(0x114),'children':_0x1c98c3(0x110)}),a1_0x531bb6(Text,{'children':'已输入的页面路由\x20'}),a1_0x531bb6(Text,{'color':_0x1c98c3(0x113),'children':_0x14ae14})]}):a1_0x531bb6(InputProjectCode,{'pagePath':_0x319176,'onSubmit':_0x4527d7}),_0x14ae14&&_0x32bd49?a1_0x47b014(Box,{'marginTop':0x1,'children':[a1_0x531bb6(Box,{'width':'4'}),a1_0x531bb6(Text,{'children':_0x1c98c3(0xfc)})]}):null,_0x3308dd?a1_0x47b014(a1_0x1f2d95,{'children':[a1_0x531bb6(Box,{'marginTop':0x1,'children':a1_0x531bb6(Text,{'color':_0x1c98c3(0x114),'children':_0x1c98c3(0x105)})}),a1_0x47b014(Box,{'children':[a1_0x531bb6(Text,{'color':'gray','children':_0x1c98c3(0x10a)}),a1_0x531bb6(Text,{'color':_0x1c98c3(0x113),'children':_0x343b74})]}),a1_0x47b014(Box,{'children':[a1_0x531bb6(Text,{'color':_0x1c98c3(0x114),'children':'\x20*\x20路由地址:\x20'}),a1_0x47b014(Text,{'color':_0x1c98c3(0x113),'children':['/',_0x14ae14]})]}),a1_0x531bb6(Box,{'marginTop':0x1,'children':a1_0x531bb6(Text,{'color':_0x1c98c3(0x11b),'children':_0x1c98c3(0x107)})})]}):null]});return a1_0x531bb6(SelectPageTemplate,{'onSelect':_0x4dd094});};
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(_0x3527b9,_0x26e711){const _0x2b45d4=a2_0x3045,_0x50dc29=_0x3527b9();while(!![]){try{const _0x327cf9=-parseInt(_0x2b45d4(0x11b))/0x1*(parseInt(_0x2b45d4(0x126))/0x2)+-parseInt(_0x2b45d4(0x121))/0x3*(parseInt(_0x2b45d4(0x115))/0x4)+parseInt(_0x2b45d4(0x139))/0x5*(parseInt(_0x2b45d4(0x116))/0x6)+parseInt(_0x2b45d4(0x12a))/0x7+parseInt(_0x2b45d4(0x11a))/0x8*(-parseInt(_0x2b45d4(0x138))/0x9)+-parseInt(_0x2b45d4(0x12b))/0xa*(-parseInt(_0x2b45d4(0x127))/0xb)+-parseInt(_0x2b45d4(0x11f))/0xc*(-parseInt(_0x2b45d4(0x122))/0xd);if(_0x327cf9===_0x26e711)break;else _0x50dc29['push'](_0x50dc29['shift']());}catch(_0x1627ff){_0x50dc29['push'](_0x50dc29['shift']());}}}(a2_0x3d80,0x25c5a));import{jsx as a2_0x489ae6,jsxs as a2_0x22352c}from'react/jsx-runtime';function a2_0x3d80(){const _0x18072e=['57ZUtpTv','13CDvtuF','downArrow','green','\x20Step1:\x20','1858vQThqZ','1419Vnyjss','templates/pages','../..','1955954SjdWmo','12170JoNpTl','resolve','map','\x20\x20\x20\x20\x20\x20>\x20','filter','dirname','sort','error','url','gray','获取模板列表失败:','localeCompare','sdk-fetch','45MgSExl','418065EAwTYk','length','34616Oymxfn','18qQEZzN','label','join','blank','357904lYxlQa','197aFFsds','upArrow','column','return','463068mBCXOF','onSelect'];a2_0x3d80=function(){return _0x18072e;};return a2_0x3d80();}function a2_0x3045(_0x480da2,_0x134d77){const _0x3d8062=a2_0x3d80();return a2_0x3045=function(_0x30456e,_0x3c30f3){_0x30456e=_0x30456e-0x115;let _0xcf929b=_0x3d8062[_0x30456e];return _0xcf929b;},a2_0x3045(_0x480da2,_0x134d77);}import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x4e153b from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x42f4e0=a2_0x3045;try{const _0x1cbce8=fileURLToPath(import.meta[_0x42f4e0(0x133)]),_0x4f8816=a2_0x4e153b[_0x42f4e0(0x12c)](a2_0x4e153b[_0x42f4e0(0x130)](_0x1cbce8),_0x42f4e0(0x129)),_0x575e36=a2_0x4e153b[_0x42f4e0(0x118)](_0x4f8816,_0x42f4e0(0x128)),_0x58da25=await readdir(_0x575e36,{'withFileTypes':!![]}),_0x531d14=_0x58da25[_0x42f4e0(0x12f)](_0x1f00c1=>_0x1f00c1['isDirectory']())[_0x42f4e0(0x12d)](_0x20de21=>({'label':_0x20de21['name']}))[_0x42f4e0(0x131)]((_0x4dcccf,_0x596e09)=>_0x4dcccf['label'][_0x42f4e0(0x136)](_0x596e09['label']));return _0x531d14;}catch(_0x5a35a5){return console[_0x42f4e0(0x132)](_0x42f4e0(0x135),_0x5a35a5),[{'label':_0x42f4e0(0x119)},{'label':_0x42f4e0(0x137)}];}}export function SelectPageTemplate(_0x208267){const _0x53b3cb=a2_0x3045,[_0xd64134,_0x5d2ec3]=useState(0x0),[_0x5a289a,_0xe02476]=useState([]),[_0xa3b806,_0x203ad8]=useState(!![]);useEffect(()=>{async function _0x4c3469(){const _0x49fe98=await getTemplateList();_0xe02476(_0x49fe98),_0x203ad8(![]);}_0x4c3469();},[]),useInput((_0x5db1cb,_0x14b183)=>{const _0x54001c=a2_0x3045;if(_0xa3b806)return;if(_0x14b183[_0x54001c(0x11e)]){const _0x332b8b=_0x5a289a[_0xd64134];_0x332b8b&&_0x208267[_0x54001c(0x120)](_0x332b8b[_0x54001c(0x117)]);}_0x14b183[_0x54001c(0x11c)]&&_0x5d2ec3(_0xcd3061=>_0xcd3061===0x0?_0x5a289a[_0x54001c(0x13a)]-0x1:_0xcd3061-0x1),_0x14b183[_0x54001c(0x123)]&&_0x5d2ec3(_0x138261=>_0x138261===_0x5a289a[_0x54001c(0x13a)]-0x1?0x0:_0x138261+0x1);});if(_0xa3b806)return a2_0x489ae6(Box,{'flexDirection':_0x53b3cb(0x11d),'paddingY':0x1,'children':a2_0x22352c(Box,{'children':[a2_0x489ae6(Text,{'color':_0x53b3cb(0x134),'children':_0x53b3cb(0x125)}),a2_0x489ae6(Text,{'children':'正在加载页面模板...'})]})});return a2_0x22352c(Box,{'flexDirection':_0x53b3cb(0x11d),'paddingY':0x1,'children':[a2_0x22352c(Box,{'children':[a2_0x489ae6(Text,{'color':'gray','children':'\x20Step1:\x20'}),a2_0x489ae6(Text,{'children':'请选择您要创建的页面模板'})]}),_0x5a289a['map']((_0x56285b,_0x2fe786)=>{const _0x2a5aad=_0x53b3cb,_0xc64404=_0x2fe786===_0xd64134,_0x470d2e=_0xc64404?_0x2a5aad(0x12e)+_0x56285b[_0x2a5aad(0x117)]:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0x56285b[_0x2a5aad(0x117)];return a2_0x489ae6(Box,{'children':a2_0x489ae6(Text,{'color':_0xc64404?_0x2a5aad(0x124):undefined,'children':_0x470d2e})},_0x470d2e);})]});}
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(_0x5e78c9,_0x53ea93){const _0xefc56b=a3_0xad4c,_0x41b000=_0x5e78c9();while(!![]){try{const _0x2117c8=parseInt(_0xefc56b(0x1bb))/0x1+-parseInt(_0xefc56b(0x1ea))/0x2+-parseInt(_0xefc56b(0x1d8))/0x3*(-parseInt(_0xefc56b(0x1df))/0x4)+parseInt(_0xefc56b(0x1c0))/0x5+-parseInt(_0xefc56b(0x1bf))/0x6+-parseInt(_0xefc56b(0x1d1))/0x7+parseInt(_0xefc56b(0x1bc))/0x8*(parseInt(_0xefc56b(0x1d3))/0x9);if(_0x2117c8===_0x53ea93)break;else _0x41b000['push'](_0x41b000['shift']());}catch(_0x2dec41){_0x41b000['push'](_0x41b000['shift']());}}}(a3_0x33e6,0xcf254));import{jsx as a3_0x3657e9,jsxs as a3_0x3baa2e,Fragment as a3_0x45b571}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_0xad4c(_0x93e094,_0x10050d){const _0x33e61e=a3_0x33e6();return a3_0xad4c=function(_0xad4cb,_0x532d06){_0xad4cb=_0xad4cb-0x1b5;let _0x5640ca=_0x33e61e[_0xad4cb];return _0x5640ca;},a3_0xad4c(_0x93e094,_0x10050d);}function a3_0x33e6(){const _0x6360b2=['文档生成完成','⚠️\x20以下数据集生成失败:','duplicateCount','success','column','env','online','!\x20原始数据集\x20','log','2127066pKKTcG','message','join','正在获取数据集列表...','cwd','cyan','💡\x20请使用\x20','115828ZZRgWJ','14942920NHuKTA','api-doc','setLogPath','768540NINwAs','1274015PTBkLA','\x1b[33m!\x20以下数据集代码不存在:\x20','map','originalCount','\x20个数据集中筛选出\x20',',\x20失败\x20','\x20个,过滤重复','未找到任何数据集','yellow','.md\x20(','🚀\x20','datasetName','string','length','\x1b[0m','使用指定的应用AppCode:\x20','指定的数据集代码都不存在:\x20','7336007UUaQKA','\x20(环境:\x20','9hsrOMT','文档生成失败:\x20','includes','error','gray','33osLHnM','使用配置的应用AppCode:\x20','*\x20输出目录:\x20','datasetCode','filter','dim','未提供应用AppCode,且配置中也没有默认值','308944JDxGgC','\x20重新登录后再试'];a3_0x33e6=function(){return _0x6360b2;};return a3_0x33e6();}import{generateDatasetDocs}from'./api-doc.js';import{logger}from'../utils/logger.js';export const ApiDocUI=({appCode:_0x38f956,env:_0x31c1c0,output:_0x3570f,extraParams:_0x5b590a,datasetCodes:_0x5d41f5})=>{const _0x8738a1=a3_0xad4c,{exit:_0x287bbd}=useApp(),[_0x500a6f,_0x4f1df9]=useState(![]),[_0x2a2d68,_0x10240b]=useState(''),[_0x2603b9,_0x1e386a]=useState(![]),[_0x465936,_0x37e225]=useState(null),[_0x32ccc4,_0x226c77]=useState(null),[_0x3cb1b9,_0x4b0d69]=useState(null),_0x316704=readConfig(),_0x360d55=getConfigAppCode(),_0x5aa680=_0x38f956||_0x360d55,_0x33447c=typeof _0x316704?.[_0x8738a1(0x1e6)]===_0x8738a1(0x1cc)?_0x316704[_0x8738a1(0x1e6)]:undefined,_0x49cb35=_0x31c1c0||_0x33447c||_0x8738a1(0x1e7);initEnv(_0x49cb35);const _0x2b8e3c=_0x3570f||'./docs',_0x535a43=_0x38f956?_0x8738a1(0x1cf)+_0x5aa680:_0x8738a1(0x1d9)+_0x5aa680;useEffect(()=>{_0x4f1df9(!![]),_0x1b1ac8();},[]),useEffect(()=>{(_0x2603b9||_0x465936)&&_0x287bbd();},[_0x2603b9,_0x465936,_0x287bbd]);async function _0x1b1ac8(){const _0x128535=_0x8738a1;if(!_0x5aa680){_0x37e225(_0x128535(0x1de));return;}try{logger[_0x128535(0x1be)](process[_0x128535(0x1b8)]()),_0x10240b(_0x128535(0x1b7));const {rawData:_0xae51f8,originalCount:_0x5b9955,filteredCount:_0x1d5851,duplicateCount:_0x5923a9}=await fetchDatasets(_0x5aa680);_0x4b0d69({'originalCount':_0x5b9955,'filteredCount':_0x1d5851,'duplicateCount':_0x5923a9});if(_0xae51f8[_0x128535(0x1cd)]===0x0){_0x37e225(_0x128535(0x1c7));return;}let _0xce28a2=_0xae51f8;if(_0x5d41f5&&_0x5d41f5[_0x128535(0x1cd)]>0x0){_0xce28a2=_0xae51f8[_0x128535(0x1dc)](_0xb5fd7a=>_0x5d41f5[_0x128535(0x1d5)](_0xb5fd7a['code']));const _0x45d423=_0xce28a2['map'](_0x1e8b58=>_0x1e8b58['code']),_0x1833c9=_0x5d41f5[_0x128535(0x1dc)](_0x4a0762=>!_0x45d423['includes'](_0x4a0762));_0x1833c9['length']>0x0&&console[_0x128535(0x1e9)](_0x128535(0x1c1)+_0x1833c9[_0x128535(0x1b6)](',\x20')+_0x128535(0x1ce));if(_0xce28a2[_0x128535(0x1cd)]===0x0){_0x37e225(_0x128535(0x1d0)+_0x5d41f5[_0x128535(0x1b6)](',\x20'));return;}console['log']('\x1b[90m*\x20从\x20'+_0xae51f8[_0x128535(0x1cd)]+_0x128535(0x1c4)+_0xce28a2[_0x128535(0x1cd)]+'\x20个匹配的数据集\x1b[0m');}_0x10240b('正在生成\x20'+_0xce28a2[_0x128535(0x1cd)]+'\x20个数据集的文档...');const _0x2650ab=await generateDatasetDocs(_0xce28a2,_0x5aa680,_0x2b8e3c,(_0x31fecd,_0x2ba47b,_0x2c65dd)=>{const _0x443c47=_0x128535;_0x10240b('正在生成\x20'+_0x2c65dd+_0x443c47(0x1c9)+_0x31fecd+'/'+_0x2ba47b+')');},_0x5b590a);_0x226c77(_0x2650ab),_0x1e386a(!![]);const _0x45b2ba=_0x2650ab[_0x128535(0x1dc)](_0x426d5c=>_0x426d5c[_0x128535(0x1e4)])[_0x128535(0x1cd)],_0x34d663=_0x2650ab['filter'](_0x2b65b7=>!_0x2b65b7['success'])['length'];logger['success'](_0x128535(0x1bd),_0x128535(0x1e1),undefined,{'totalCount':_0x2650ab[_0x128535(0x1cd)],'successCount':_0x45b2ba,'failCount':_0x34d663,'outputDir':_0x2b8e3c});}catch(_0x4c10f2){const _0x33882a=_0x4c10f2 instanceof Error?_0x4c10f2[_0x128535(0x1b5)]:String(_0x4c10f2);logger[_0x128535(0x1d6)](_0x128535(0x1bd),_0x128535(0x1d4)+_0x33882a,{'appCode':_0x5aa680,'outputDir':_0x2b8e3c}),_0x37e225('文档生成失败:\x20'+_0x33882a);}finally{_0x4f1df9(![]);}}const _0x173739=_0x32ccc4?.[_0x8738a1(0x1dc)](_0x3b7e74=>_0x3b7e74[_0x8738a1(0x1e4)])[_0x8738a1(0x1cd)]||0x0,_0x57055f=_0x32ccc4?.['filter'](_0x243c5c=>!_0x243c5c[_0x8738a1(0x1e4)])[_0x8738a1(0x1cd)]||0x0;return a3_0x3baa2e(Box,{'flexDirection':_0x8738a1(0x1e5),'children':[(_0x500a6f||_0x2603b9)&&a3_0x3baa2e(Box,{'children':[a3_0x3657e9(Text,{'color':'gray','children':'*\x20'}),a3_0x3657e9(Text,{'color':_0x38f956?'white':_0x8738a1(0x1dd),'children':_0x535a43})]}),_0x500a6f&&a3_0x3657e9(Box,{'children':a3_0x3baa2e(Text,{'children':[_0x8738a1(0x1ca),_0x2a2d68,_0x8738a1(0x1d2),_0x49cb35,')']})}),_0x2603b9&&_0x32ccc4&&_0x3cb1b9&&a3_0x3baa2e(Box,{'flexDirection':'column','children':[a3_0x3657e9(Box,{'children':a3_0x3baa2e(Text,{'color':'green','children':['√\x20文档生成完成!成功\x20',_0x173739,'\x20个',_0x57055f>0x0&&_0x8738a1(0x1c5)+_0x57055f+'\x20个']})}),_0x3cb1b9['duplicateCount']>0x0&&a3_0x3657e9(Box,{'marginTop':0x1,'children':a3_0x3baa2e(Text,{'color':_0x8738a1(0x1c8),'children':[_0x8738a1(0x1e8),_0x3cb1b9[_0x8738a1(0x1c3)],_0x8738a1(0x1c6),'\x20',_0x3cb1b9[_0x8738a1(0x1e3)],'\x20个']})}),a3_0x3baa2e(Box,{'marginTop':0x1,'children':[a3_0x3657e9(Text,{'color':_0x8738a1(0x1d7),'children':_0x8738a1(0x1da)}),a3_0x3657e9(Text,{'color':'cyan','children':_0x2b8e3c})]}),_0x173739>0x0&&a3_0x3baa2e(a3_0x45b571,{'children':[a3_0x3657e9(Box,{'marginTop':0x1,'children':a3_0x3657e9(Text,{'color':_0x8738a1(0x1d7),'children':'*\x20生成的文档文件:'})}),_0x32ccc4[_0x8738a1(0x1dc)](_0x443b2c=>_0x443b2c[_0x8738a1(0x1e4)])[_0x8738a1(0x1c2)]((_0x25cc60,_0x225812)=>a3_0x3baa2e(Box,{'marginLeft':0x2,'children':[a3_0x3baa2e(Text,{'color':'cyan','children':['•\x20',_0x25cc60['filePath']]}),a3_0x3baa2e(Text,{'color':_0x8738a1(0x1dd),'children':['\x20-\x20',_0x25cc60[_0x8738a1(0x1cb)]]})]},_0x225812))]}),_0x57055f>0x0&&a3_0x3baa2e(a3_0x45b571,{'children':[a3_0x3657e9(Box,{'marginTop':0x1,'children':a3_0x3657e9(Text,{'color':'yellow','children':_0x8738a1(0x1e2)})}),_0x32ccc4['filter'](_0x46e53d=>!_0x46e53d[_0x8738a1(0x1e4)])[_0x8738a1(0x1c2)]((_0x4c7fbf,_0x48c468)=>a3_0x3baa2e(Box,{'marginLeft':0x2,'flexDirection':_0x8738a1(0x1e5),'children':[a3_0x3baa2e(Text,{'color':'red','children':['•\x20',_0x4c7fbf[_0x8738a1(0x1cb)],'\x20(',_0x4c7fbf[_0x8738a1(0x1db)],')']}),_0x4c7fbf['error']&&a3_0x3657e9(Box,{'marginLeft':0x2,'children':a3_0x3657e9(Text,{'color':_0x8738a1(0x1dd),'children':_0x4c7fbf[_0x8738a1(0x1d6)]})})]},_0x48c468))]})]}),_0x465936&&a3_0x3baa2e(Box,{'flexDirection':_0x8738a1(0x1e5),'children':[a3_0x3657e9(Box,{'children':a3_0x3baa2e(Text,{'color':'red','children':['❌\x20',_0x465936]})}),_0x465936['includes']('登录')&&a3_0x3baa2e(Box,{'marginTop':0x1,'children':[a3_0x3657e9(Text,{'color':_0x8738a1(0x1c8),'children':_0x8738a1(0x1ba)}),a3_0x3657e9(Text,{'color':_0x8738a1(0x1b9),'children':'lovrabet\x20auth'}),a3_0x3657e9(Text,{'color':'yellow','children':_0x8738a1(0x1e0)})]})]})]});};
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(_0x14f871,_0x3790d6){const _0x3c4bb8=a4_0x53fb,_0x28971b=_0x14f871();while(!![]){try{const _0x8a5042=-parseInt(_0x3c4bb8(0x1fa))/0x1+-parseInt(_0x3c4bb8(0x205))/0x2*(parseInt(_0x3c4bb8(0x1f8))/0x3)+parseInt(_0x3c4bb8(0x1e9))/0x4+-parseInt(_0x3c4bb8(0x20a))/0x5+parseInt(_0x3c4bb8(0x1f3))/0x6*(parseInt(_0x3c4bb8(0x1f0))/0x7)+-parseInt(_0x3c4bb8(0x206))/0x8*(-parseInt(_0x3c4bb8(0x1f4))/0x9)+parseInt(_0x3c4bb8(0x1ed))/0xa*(parseInt(_0x3c4bb8(0x1f2))/0xb);if(_0x8a5042===_0x3790d6)break;else _0x28971b['push'](_0x28971b['shift']());}catch(_0x6e1a5){_0x28971b['push'](_0x28971b['shift']());}}}(a4_0x4378,0xbc195));function a4_0x53fb(_0x2d912c,_0x5749f0){const _0x43782e=a4_0x4378();return a4_0x53fb=function(_0x53fb77,_0x2c1efe){_0x53fb77=_0x53fb77-0x1e4;let _0x2f4a48=_0x43782e[_0x53fb77];return _0x2f4a48;},a4_0x53fb(_0x2d912c,_0x5749f0);}import{mkdirSync,writeFileSync}from'node:fs';import a4_0x1ecdaa from'node:path';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{logger}from'../utils/logger.js';function a4_0x4378(){const _0x13da62=['length','获取文档失败\x20(','padStart','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','.md\x20(','code','),HTTP状态码:\x20','等待\x203\x20秒...\x0a','55780BuPGhY','104472DupWUL','\x20个数据集需要生成文档\x0a','✓\x20成功生成:\x20','log','3746010AVirnD','push','生成文档失败:\x20','markdown','生成文档成功:\x20','dataset_','):缺少\x20data.markdown\x20字段',']\x20正在生成:\x20','name','text','data','api-doc','662600ogixgq','tableName','string','\x0a共有\x20','4672430FdmnZn','.md','message','210EbCMxg','POST','44wupmmU','154056gHjSVM','333YeOMEN','.md\x20-\x20','slice','dbtableConfig','165HwKurr','stringify','234480hoejyO','error','utf8'];a4_0x4378=function(){return _0x13da62;};return a4_0x4378();}export async function fetchDatasetDoc(_0x3f1498){const _0x192940=a4_0x53fb,{appCode:_0x55ec0f,datasetCode:_0x31284f,datasetId:_0xe13e94,extraParams:_0x144510}=_0x3f1498,_0x1729a6=getApiDomain(),_0x17a8c2=_0x1729a6+'/api/node-toolbox/api-doc-generator',_0x199c08={'appCode':_0x55ec0f,'datasetCode':_0x31284f,'datasetId':_0xe13e94,..._0x144510||{}},_0x26b45e=await fetch(_0x17a8c2,{'method':_0x192940(0x1f1),'headers':{'Content-Type':'application/json','Cookie':getCookie()},'body':JSON[_0x192940(0x1f9)](_0x199c08)});if(!_0x26b45e['ok']){if(_0x26b45e['status']===0x191)throw new Error(_0x192940(0x200));let _0x426a34='';try{_0x426a34=await _0x26b45e[_0x192940(0x1e6)]();}catch(_0x48d4d2){}throw new Error(_0x192940(0x1fe)+_0x31284f+_0x192940(0x203)+_0x26b45e['status']+(_0x426a34?'\x0a'+_0x426a34:''));}const _0x59a82e=await _0x26b45e['json']();if(!_0x59a82e[_0x192940(0x1e7)]||typeof _0x59a82e[_0x192940(0x1e7)][_0x192940(0x20d)]!==_0x192940(0x1eb))throw new Error('响应数据格式错误\x20('+_0x31284f+_0x192940(0x210));return _0x59a82e[_0x192940(0x1e7)]['markdown'];}function delay(_0x3cf732){return new Promise(_0x48c08f=>setTimeout(_0x48c08f,_0x3cf732));}export async function generateDatasetDocs(_0x453d38,_0x2ab6a6,_0x33a00c='./docs',_0x1fd126,_0x15b425){const _0x1165cc=a4_0x53fb;mkdirSync(_0x33a00c,{'recursive':!![]});const _0x3fd17e=[],_0x1447cf=_0x453d38['length'];console[_0x1165cc(0x209)](_0x1165cc(0x1ec)+_0x1447cf+_0x1165cc(0x207));for(let _0x3c7800=0x0;_0x3c7800<_0x453d38[_0x1165cc(0x1fd)];_0x3c7800++){const _0x5e033b=_0x453d38[_0x3c7800],_0x5ba0ad=_0x3c7800+0x1;let _0x469776;if(_0x5e033b[_0x1165cc(0x1f7)]?.[_0x1165cc(0x1ea)])_0x469776=_0x5e033b[_0x1165cc(0x1f7)]['tableName'];else{const _0x119c69=_0x5e033b[_0x1165cc(0x202)][_0x1165cc(0x1f6)](-0x6)[_0x1165cc(0x1ff)](0x6,'0');_0x469776=_0x1165cc(0x20f)+_0x119c69;}try{console[_0x1165cc(0x209)]('['+_0x5ba0ad+'/'+_0x1447cf+_0x1165cc(0x1e4)+_0x469776+_0x1165cc(0x201)+_0x5e033b[_0x1165cc(0x1e5)]+')');_0x1fd126&&_0x1fd126(_0x5ba0ad,_0x1447cf,_0x469776);const _0x2f3c58=await fetchDatasetDoc({'appCode':_0x2ab6a6,'datasetCode':_0x5e033b[_0x1165cc(0x202)],'datasetId':_0x5e033b['id'],'enableAI':![],'extraParams':_0x15b425}),_0x221977=a4_0x1ecdaa['join'](_0x33a00c,_0x469776+_0x1165cc(0x1ee));writeFileSync(_0x221977,_0x2f3c58,{'encoding':_0x1165cc(0x1fc)}),console[_0x1165cc(0x209)](_0x1165cc(0x208)+_0x469776+_0x1165cc(0x1ee)),logger['success'](_0x1165cc(0x1e8),_0x1165cc(0x20e)+_0x469776,undefined,{'datasetCode':_0x5e033b[_0x1165cc(0x202)],'datasetName':_0x5e033b[_0x1165cc(0x1e5)],'filePath':_0x221977,'progress':_0x5ba0ad+'/'+_0x1447cf}),_0x3fd17e[_0x1165cc(0x20b)]({'datasetCode':_0x5e033b[_0x1165cc(0x202)],'datasetName':_0x5e033b[_0x1165cc(0x1e5)],'filePath':_0x221977,'success':!![]});}catch(_0x398364){const _0x530397=_0x398364 instanceof Error?_0x398364[_0x1165cc(0x1ef)]:String(_0x398364);console[_0x1165cc(0x209)]('✗\x20失败:\x20'+_0x469776+_0x1165cc(0x1f5)+_0x530397+'\x0a'),logger[_0x1165cc(0x1fb)](_0x1165cc(0x1e8),_0x1165cc(0x20c)+_0x5e033b['code'],{'datasetCode':_0x5e033b[_0x1165cc(0x202)],'datasetName':_0x5e033b[_0x1165cc(0x1e5)],'error':_0x530397,'progress':_0x5ba0ad+'/'+_0x1447cf}),_0x3fd17e[_0x1165cc(0x20b)]({'datasetCode':_0x5e033b[_0x1165cc(0x202)],'datasetName':_0x5e033b[_0x1165cc(0x1e5)],'filePath':'','success':![],'error':_0x530397}),_0x5ba0ad<_0x1447cf&&(console[_0x1165cc(0x209)](_0x1165cc(0x204)),await delay(0xbb8));}}return _0x3fd17e;}
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(_0x514dac,_0x521586){const _0x57fcdb=a5_0x53b9,_0x4bfa54=_0x514dac();while(!![]){try{const _0x846842=parseInt(_0x57fcdb(0x183))/0x1+parseInt(_0x57fcdb(0x18f))/0x2*(parseInt(_0x57fcdb(0x188))/0x3)+parseInt(_0x57fcdb(0x18b))/0x4*(-parseInt(_0x57fcdb(0x1a3))/0x5)+parseInt(_0x57fcdb(0x181))/0x6+parseInt(_0x57fcdb(0x173))/0x7+parseInt(_0x57fcdb(0x19a))/0x8*(-parseInt(_0x57fcdb(0x180))/0x9)+-parseInt(_0x57fcdb(0x1a6))/0xa*(parseInt(_0x57fcdb(0x174))/0xb);if(_0x846842===_0x521586)break;else _0x4bfa54['push'](_0x4bfa54['shift']());}catch(_0x1f8385){_0x4bfa54['push'](_0x4bfa54['shift']());}}}(a5_0x431b,0x56e62));import{jsx as a5_0x39129e,jsxs as a5_0x2dfaca}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';function a5_0x431b(){const _0x5b8dbe=['cwd','modelCount','\x20个模型)','datasetCount','*\x20已生成文件:','endsWith','-\x20模型配置文件\x20(','column','env','slice','9FuLYeG','1726914VxJWYk','split','129496DJSnNn','gray','dim','client','!\x20原始数据集\x20','3hcgTtD','duplicateCount','\x20个模型','26364qPLSHr','.ts','api-pull','*\x20导入方式:','517870okFroF','green','online','未提供应用AppCode,且配置中也没有默认值','\x20个数据集,生成','-client','{\x20lovrabetClient\x20}','setLogPath','red','\x20from\x20\x27@/','originalCount','110168dFjjow','\x20个,过滤重复','yellow','\x20重新登录后再试','replace','includes','message','import\x20','拉取\x20API\x20配置失败:\x20','155YmjUMh','\x20-\x20客户端实例文件','api','10zIgRtz','328825BBPsDd','1641145iUWLtC','cyan'];a5_0x431b=function(){return _0x5b8dbe;};return a5_0x431b();}function a5_0x53b9(_0x1342a5,_0x468aee){const _0x431b54=a5_0x431b();return a5_0x53b9=function(_0x53b90a,_0xeffad8){_0x53b90a=_0x53b90a-0x173;let _0x568f35=_0x431b54[_0x53b90a];return _0x568f35;},a5_0x53b9(_0x1342a5,_0x468aee);}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';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x5454f4,env:_0x5e904c,output:_0x51d65f})=>{const _0x2de385=a5_0x53b9,{exit:_0x31823a}=useApp(),[_0x1f03d1,_0x3e3c94]=useState(![]),[_0x2ec704,_0x552c9b]=useState(![]),[_0x5eff79,_0x39f118]=useState(null),[_0xd9e36f,_0x436982]=useState(null),_0x396e2b=readConfig(),_0x2ef5f5=getConfigAppCode(),_0x5a1412=_0x5454f4||_0x2ef5f5,_0x3e7946=typeof _0x396e2b?.['env']==='string'?_0x396e2b[_0x2de385(0x17e)]:undefined,_0x3109f1=_0x5e904c||_0x3e7946||_0x2de385(0x191);initEnv(_0x3109f1);const _0x5044c8=_0x51d65f||'./src/api/',_0x445438=_0x5454f4&&_0x5454f4[_0x2de385(0x19f)]('-')?_0x5454f4[_0x2de385(0x182)]('-')[_0x2de385(0x17f)](0x1)['join']('-'):'',_0x1275c4=_0x5454f4?'使用指定的应用AppCode:\x20'+_0x5a1412:'使用配置的应用AppCode:\x20'+_0x5a1412,_0x3061fe=_0x445438?_0x445438+'-api':_0x2de385(0x1a5),_0x5b880d=_0x445438?_0x445438+_0x2de385(0x194):'client';useEffect(()=>{_0x3e3c94(!![]),_0x403b82();},[]),useEffect(()=>{(_0x2ec704||_0x5eff79)&&_0x31823a();},[_0x2ec704,_0x5eff79,_0x31823a]);async function _0x403b82(){const _0x4121ec=_0x2de385;if(!_0x5a1412){_0x39f118(_0x4121ec(0x192));return;}try{logger[_0x4121ec(0x196)](process[_0x4121ec(0x176)]());const {rawData:_0x1c8764,originalCount:_0x191923,filteredCount:_0x42f3d9,duplicateCount:_0x456eeb}=await fetchDatasets(_0x5a1412),_0x1ec39f=_0x42f3d9,_0x35c9ab=!_0x5454f4,_0x2cd92d=await generateApiFile(_0x1c8764,_0x445438,_0x5a1412,_0x35c9ab,_0x3109f1,_0x5044c8),_0x229ae5=_0x5044c8[_0x4121ec(0x17b)]('/')?_0x5044c8:_0x5044c8+'/';_0x436982({'api':''+_0x229ae5+_0x3061fe+_0x4121ec(0x18c),'client':''+_0x229ae5+_0x5b880d+_0x4121ec(0x18c),'modelCount':_0x2cd92d[_0x4121ec(0x177)],'datasetCount':_0x1ec39f,'originalCount':_0x191923,'duplicateCount':_0x456eeb}),_0x552c9b(!![]);}catch(_0x488901){const _0x4d5724=_0x488901 instanceof Error?_0x488901[_0x4121ec(0x1a0)]:String(_0x488901);logger['error'](_0x4121ec(0x18d),'拉取\x20API\x20配置失败:\x20'+_0x4d5724,{'appCode':_0x5a1412,'error':_0x4d5724}),_0x39f118(_0x4121ec(0x1a2)+_0x4d5724);}finally{_0x3e3c94(![]);}}return a5_0x2dfaca(Box,{'flexDirection':_0x2de385(0x17d),'children':[(_0x1f03d1||_0x2ec704)&&a5_0x2dfaca(Box,{'children':[a5_0x39129e(Text,{'color':_0x2de385(0x184),'children':'*\x20'}),a5_0x39129e(Text,{'color':_0x5454f4?'white':_0x2de385(0x185),'children':_0x1275c4})]}),_0x1f03d1&&a5_0x39129e(Box,{'children':a5_0x2dfaca(Text,{'children':['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20',_0x3109f1,')']})}),_0x2ec704&&_0xd9e36f&&a5_0x2dfaca(Box,{'flexDirection':_0x2de385(0x17d),'children':[a5_0x39129e(Box,{'children':a5_0x2dfaca(Text,{'color':_0x2de385(0x190),'children':['√\x20成功拉取\x20',_0xd9e36f[_0x2de385(0x179)],_0x2de385(0x193),'\x20',_0xd9e36f[_0x2de385(0x177)],_0x2de385(0x18a)]})}),_0xd9e36f[_0x2de385(0x189)]>0x0&&a5_0x39129e(Box,{'marginTop':0x1,'children':a5_0x2dfaca(Text,{'color':_0x2de385(0x19c),'children':[_0x2de385(0x187),_0xd9e36f[_0x2de385(0x199)],_0x2de385(0x19b),'\x20',_0xd9e36f[_0x2de385(0x189)],'\x20个']})}),a5_0x39129e(Box,{'marginTop':0x1,'children':a5_0x39129e(Text,{'color':_0x2de385(0x184),'children':_0x2de385(0x17a)})}),a5_0x2dfaca(Box,{'marginLeft':0x2,'children':[a5_0x2dfaca(Text,{'color':_0x2de385(0x175),'children':['•\x20',_0xd9e36f[_0x2de385(0x1a5)]]}),a5_0x2dfaca(Text,{'color':_0x2de385(0x185),'children':['\x20',_0x2de385(0x17c),_0xd9e36f[_0x2de385(0x177)],_0x2de385(0x178)]})]}),a5_0x2dfaca(Box,{'marginLeft':0x2,'children':[a5_0x2dfaca(Text,{'color':_0x2de385(0x175),'children':['•\x20',_0xd9e36f[_0x2de385(0x186)]]}),a5_0x39129e(Text,{'color':_0x2de385(0x185),'children':_0x2de385(0x1a4)})]}),a5_0x39129e(Box,{'marginTop':0x1,'children':a5_0x39129e(Text,{'color':'gray','children':_0x2de385(0x18e)})}),a5_0x39129e(Box,{'marginLeft':0x2,'children':a5_0x2dfaca(Text,{'color':_0x2de385(0x19c),'children':[_0x2de385(0x1a1),_0x2de385(0x195),_0x2de385(0x198),_0xd9e36f['client'][_0x2de385(0x19e)](/^\.\//,'')[_0x2de385(0x19e)](_0x2de385(0x18c),''),'\x27']})})]}),_0x5eff79&&a5_0x2dfaca(Box,{'flexDirection':_0x2de385(0x17d),'children':[a5_0x39129e(Box,{'children':a5_0x2dfaca(Text,{'color':_0x2de385(0x197),'children':['❌\x20',_0x5eff79]})}),_0x5eff79['includes']('登录')&&a5_0x2dfaca(Box,{'marginTop':0x1,'children':[a5_0x39129e(Text,{'color':_0x2de385(0x19c),'children':'💡\x20请使用\x20'}),a5_0x39129e(Text,{'color':_0x2de385(0x175),'children':'lovrabet\x20auth'}),a5_0x39129e(Text,{'color':_0x2de385(0x19c),'children':_0x2de385(0x19d)})]})]})]});};
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(_0x56e708,_0x4e956f){const _0x4deaaf=a6_0x3a8f,_0x54bcd2=_0x56e708();while(!![]){try{const _0x46f409=parseInt(_0x4deaaf(0x1ff))/0x1*(parseInt(_0x4deaaf(0x20c))/0x2)+-parseInt(_0x4deaaf(0x1f6))/0x3*(parseInt(_0x4deaaf(0x200))/0x4)+-parseInt(_0x4deaaf(0x207))/0x5*(parseInt(_0x4deaaf(0x203))/0x6)+-parseInt(_0x4deaaf(0x20f))/0x7*(parseInt(_0x4deaaf(0x1f8))/0x8)+parseInt(_0x4deaaf(0x201))/0x9*(parseInt(_0x4deaaf(0x20a))/0xa)+parseInt(_0x4deaaf(0x20d))/0xb*(-parseInt(_0x4deaaf(0x1f9))/0xc)+parseInt(_0x4deaaf(0x1f3))/0xd*(parseInt(_0x4deaaf(0x1f5))/0xe);if(_0x46f409===_0x4e956f)break;else _0x54bcd2['push'](_0x54bcd2['shift']());}catch(_0x390a7a){_0x54bcd2['push'](_0x54bcd2['shift']());}}}(a6_0x2ed0,0x3f4e3));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a6_0x3a8f(_0x415635,_0x17957d){const _0x2ed05e=a6_0x2ed0();return a6_0x3a8f=function(_0x3a8faa,_0x5170c7){_0x3a8faa=_0x3a8faa-0x1f2;let _0x52b391=_0x2ed05e[_0x3a8faa];return _0x52b391;},a6_0x3a8f(_0x415635,_0x17957d);}import{formatDataset}from'./format-dataset.js';export function filterDuplicateDatasets(_0x167c90){const _0x2f2d50=a6_0x3a8f,_0x47e444=_0x167c90[_0x2f2d50(0x208)](_0x5b8ad4=>_0x5b8ad4['dbtableConfig']),_0x3767a0=_0x167c90[_0x2f2d50(0x208)](_0x6a5d7b=>!_0x6a5d7b[_0x2f2d50(0x1fa)]),_0x1f2320=new Map();return _0x47e444[_0x2f2d50(0x1f2)](_0x47a994=>{const _0x4d054d=_0x2f2d50,_0x5eae17=_0x47a994[_0x4d054d(0x1fa)][_0x4d054d(0x1fc)],_0x1d86d7=_0x1f2320['get'](_0x5eae17);(!_0x1d86d7||_0x47a994['id']>_0x1d86d7['id'])&&_0x1f2320[_0x4d054d(0x20e)](_0x5eae17,_0x47a994);}),[...Array['from'](_0x1f2320['values']()),..._0x3767a0];}function a6_0x2ed0(){const _0x549748=['9vaooGT','json','395778lVSdkl','&pageSize=999&currentPage=1','获取数据集失败:\x20','status','5IGoBya','filter','data','1703590BfAyjD','success','103084WlIhNr','472329QPtYnR','set','1421eGcGkU','forEach','2425553LSAQBY','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','70BXbtHa','3mseGbe','message','2816INFtbX','132nmObpE','dbtableConfig','tableData','tableName','length','未知错误','2oOaGfQ','1349204jNmKyV'];a6_0x2ed0=function(){return _0x549748;};return a6_0x2ed0();}export async function fetchDatasets(_0x44d547){const _0x27fdd6=a6_0x3a8f,_0xabbad3=await fetch(getApiDomain()+'/smartapi/dataset/getList?appCode='+_0x44d547+_0x27fdd6(0x204),{'headers':{'Cookie':getCookie()}});if(!_0xabbad3['ok']){if(_0xabbad3[_0x27fdd6(0x206)]===0x191)throw new Error(_0x27fdd6(0x1f4));let _0x59244f='';try{_0x59244f=await _0xabbad3['text']();}catch(_0x44b963){}throw new Error('获取数据集失败,HTTP状态码:\x20'+_0xabbad3[_0x27fdd6(0x206)]+(_0x59244f?'\x0a'+_0x59244f:''));}const _0xfb2f05=await _0xabbad3[_0x27fdd6(0x202)]();if(!_0xfb2f05[_0x27fdd6(0x20b)])throw new Error(_0x27fdd6(0x205)+(_0xfb2f05[_0x27fdd6(0x1f7)]||_0x27fdd6(0x1fe)));const _0x364c9b=_0xfb2f05[_0x27fdd6(0x209)][_0x27fdd6(0x1fb)],_0x39cfd6=_0x364c9b[_0x27fdd6(0x1fd)],_0x12af26=filterDuplicateDatasets(_0x364c9b),_0x434074=_0x12af26[_0x27fdd6(0x1fd)],_0x47bee2=_0x39cfd6-_0x434074,_0x1ce286=formatDataset(_0x12af26);return{'datasets':_0x1ce286,'rawData':_0x12af26,'originalCount':_0x39cfd6,'filteredCount':_0x434074,'duplicateCount':_0x47bee2};}
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(_0x340a0b,_0x3e3446){const _0x2ef2b9=a7_0x1470,_0x129fbd=_0x340a0b();while(!![]){try{const _0x24ac58=parseInt(_0x2ef2b9(0x100))/0x1+parseInt(_0x2ef2b9(0xfe))/0x2+parseInt(_0x2ef2b9(0x103))/0x3*(parseInt(_0x2ef2b9(0x105))/0x4)+parseInt(_0x2ef2b9(0x104))/0x5+-parseInt(_0x2ef2b9(0xff))/0x6+-parseInt(_0x2ef2b9(0x101))/0x7+-parseInt(_0x2ef2b9(0xfb))/0x8;if(_0x24ac58===_0x3e3446)break;else _0x129fbd['push'](_0x129fbd['shift']());}catch(_0x5d81a4){_0x129fbd['push'](_0x129fbd['shift']());}}}(a7_0x54a2,0x87752));function a7_0x54a2(){const _0x31c675=['dataset','1329xrBCmU','3611255FzpxMn','5284puISBp','code','pkField','map','trim','split','Api','set','filter','allFields','dbtableConfig','4952576kybsBJ','name','tableName','723360GhTOrk','3045198QoZQmZ','615827DISixO','4224654UUfzLD'];a7_0x54a2=function(){return _0x31c675;};return a7_0x54a2();}function a7_0x1470(_0x43f306,_0x1185d6){const _0x54a24f=a7_0x54a2();return a7_0x1470=function(_0x14704b,_0x4089ec){_0x14704b=_0x14704b-0xfb;let _0x4af577=_0x54a24f[_0x14704b];return _0x4af577;},a7_0x1470(_0x43f306,_0x1185d6);}export function formatDataset(_0x23da3a){const _0x3a6cff=a7_0x1470,_0x266f0f=_0x23da3a[_0x3a6cff(0x10d)](_0x9d351e=>_0x9d351e[_0x3a6cff(0x10f)]),_0x2e5231=_0x23da3a['filter'](_0x2493c4=>!_0x2493c4['dbtableConfig']),_0x2a15bf=new Map();_0x266f0f['forEach'](_0xfd0f12=>{const _0x4f83b8=_0x3a6cff,_0x51dbc1=_0xfd0f12[_0x4f83b8(0x10f)][_0x4f83b8(0xfd)],_0x9ee2fe=_0x2a15bf['get'](_0x51dbc1);(!_0x9ee2fe||_0xfd0f12['id']>_0x9ee2fe['id'])&&_0x2a15bf[_0x4f83b8(0x10c)](_0x51dbc1,_0xfd0f12);});const _0x21a700=Array['from'](_0x2a15bf['values']())[_0x3a6cff(0x108)](_0x52def7=>{const _0x2cde91=_0x3a6cff,_0x4e0b25=snakeToCamel(_0x52def7[_0x2cde91(0x10f)][_0x2cde91(0xfd)]);return{'id':_0x52def7['id'],'name':_0x52def7[_0x2cde91(0xfc)],'code':_0x52def7[_0x2cde91(0x106)],'tableName':_0x52def7[_0x2cde91(0x10f)][_0x2cde91(0xfd)],'apiFucName':_0x4e0b25?_0x4e0b25+_0x2cde91(0x10b):_0x2cde91(0x102)+_0x52def7[_0x2cde91(0x106)]+_0x2cde91(0x10b),'modelName':_0x4e0b25||'dataset'+_0x52def7[_0x2cde91(0x106)],'pkField':_0x52def7[_0x2cde91(0x10f)][_0x2cde91(0x107)],'allFields':_0x52def7[_0x2cde91(0x10f)][_0x2cde91(0x10e)]?_0x52def7[_0x2cde91(0x10f)][_0x2cde91(0x10e)][_0x2cde91(0x10a)](','):[]};}),_0x31085b=_0x2e5231[_0x3a6cff(0x108)](_0x37b20b=>{const _0x3e02f4=_0x3a6cff,_0x352227=_0x37b20b[_0x3e02f4(0x106)]['slice'](-0x6),_0x48e018='dataset_'+_0x352227,_0x361b15=snakeToCamel(_0x48e018);return{'id':_0x37b20b['id'],'name':_0x37b20b['name'],'code':_0x37b20b[_0x3e02f4(0x106)],'tableName':_0x48e018,'apiFucName':_0x361b15?_0x361b15+'Api':_0x3e02f4(0x102)+_0x352227+_0x3e02f4(0x10b),'modelName':_0x361b15||_0x3e02f4(0x102)+_0x352227,'pkField':undefined,'allFields':[]};});return[..._0x21a700,..._0x31085b];}function snakeToCamel(_0x53d775){const _0x3ee320=a7_0x1470;if(!_0x53d775)return _0x53d775;const _0x305c1d=_0x53d775[_0x3ee320(0x109)]();return _0x305c1d['replace'](/_([a-zA-Z0-9])/g,(_0x1ce73d,_0x1c92a7)=>_0x1c92a7['toUpperCase']());}
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_0x5c9965=a8_0x27fc;(function(_0x2229b9,_0x3dca3a){const _0x392146=a8_0x27fc,_0x4d9aee=_0x2229b9();while(!![]){try{const _0xb9a6c7=parseInt(_0x392146(0x1b6))/0x1*(-parseInt(_0x392146(0x1a7))/0x2)+parseInt(_0x392146(0x19e))/0x3+parseInt(_0x392146(0x19d))/0x4*(-parseInt(_0x392146(0x1af))/0x5)+parseInt(_0x392146(0x1b4))/0x6*(parseInt(_0x392146(0x1a5))/0x7)+-parseInt(_0x392146(0x1ac))/0x8+parseInt(_0x392146(0x199))/0x9+parseInt(_0x392146(0x1b7))/0xa*(-parseInt(_0x392146(0x1aa))/0xb);if(_0xb9a6c7===_0x3dca3a)break;else _0x4d9aee['push'](_0x4d9aee['shift']());}catch(_0x18d14a){_0x4d9aee['push'](_0x4d9aee['shift']());}}}(a8_0x5486,0x74dec));import a8_0x151580 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a8_0x3a1b8a from'node:path';function a8_0x27fc(_0x528734,_0x556825){const _0x548688=a8_0x5486();return a8_0x27fc=function(_0x27fc8b,_0x316bbc){_0x27fc8b=_0x27fc8b-0x195;let _0x47e2c9=_0x548688[_0x27fc8b];return _0x47e2c9;},a8_0x27fc(_0x528734,_0x556825);}import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a8_0x5486(){const _0x449a9d=['env','../..','code','success','typescript','slice','CONFIG_NAMES.DEFAULT','endsWith','-api','7124418LJIjNk','keys','init-api','forEach','48SfqdjN','1303101huHcFM','online','client.ts.tpl','utf8','-client',',\x20env:\x20\x22','client','74837wbAetl','format','2DjYwDF','.ts','./src/api/','11xMOgBp','replaceApiContent','70360FWMvKv','tableName','url','29345XYIKTF','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','templates/generate-api','name','string','174KiCpqA','{\x20apiConfigName:\x20\x22','90819JGDvcj','8872660OsJoTp','join','dirname','app'];a8_0x5486=function(){return _0x449a9d;};return a8_0x5486();}import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x236d74,_0x320eed='',_0x3b65d4,_0x40e680=![],_0x331a05,_0x5b5f85=a8_0x5c9965(0x1a9)){const _0x495087=a8_0x5c9965,_0x5a62cf=readConfig(),_0x2d708b=_0x3b65d4||_0x5a62cf?.[_0x495087(0x1ba)];if(typeof _0x2d708b!=='string'||!_0x2d708b)throw new Error(_0x495087(0x1b0));const _0x25320c=_0x40e680?_0x495087(0x196):'\x22'+_0x2d708b+'\x22',_0x96b4f7=typeof _0x5a62cf[_0x495087(0x1bb)]===_0x495087(0x1b3)?_0x5a62cf[_0x495087(0x1bb)]:undefined,_0x3654fc=_0x331a05||_0x96b4f7||_0x495087(0x19f),_0x1563a0=_0x3654fc!==_0x495087(0x19f);let _0xcb9fc7;if(_0x40e680)_0x1563a0?_0xcb9fc7='{\x20apiConfigName:\x20'+_0x25320c+',\x20env:\x20\x22'+_0x3654fc+'\x22\x20}':_0xcb9fc7='';else{const _0xb709c=_0x1563a0?_0x495087(0x1a3)+_0x3654fc+'\x22':'';_0xcb9fc7=_0x495087(0x1b5)+_0x2d708b+'\x22'+_0xb709c+'\x20}';}const _0x21cdde=_0x320eed?_0x320eed+_0x495087(0x198):'api',_0x32846b=_0x320eed?_0x320eed+_0x495087(0x1a2):_0x495087(0x1a4),_0x1906c1=formatDataset(_0x236d74),_0x520b92={};_0x1906c1[_0x495087(0x19c)](_0x58d18f=>{const _0x4d19f7=_0x495087;_0x520b92[_0x58d18f['modelName']]={'tableName':_0x58d18f[_0x4d19f7(0x1ad)],'datasetCode':_0x58d18f[_0x4d19f7(0x1bd)],'name':_0x58d18f[_0x4d19f7(0x1b2)]||''};});const _0x464f62=fileURLToPath(import.meta[_0x495087(0x1ae)]),_0x17d7df=a8_0x3a1b8a['resolve'](a8_0x3a1b8a[_0x495087(0x1b9)](_0x464f62),_0x495087(0x1bc)),_0x3efd98=a8_0x3a1b8a[_0x495087(0x1b8)](_0x17d7df,_0x495087(0x1b1)),_0x306624=a8_0x3a1b8a[_0x495087(0x1b8)](_0x3efd98,'api.ts.tpl'),_0x4ffbfb=a8_0x3a1b8a[_0x495087(0x1b8)](_0x3efd98,_0x495087(0x1a0)),_0x4cbffc=_0x5b5f85[_0x495087(0x197)]('/')?_0x5b5f85[_0x495087(0x195)](0x0,-0x1):_0x5b5f85;mkdirSync(_0x4cbffc,{'recursive':!![]});const _0x26e64d=readFileSync(_0x306624,_0x495087(0x1a1)),_0x5d85cf=TemplateReplacer[_0x495087(0x1ab)](_0x26e64d,_0x2d708b,_0x520b92,Object['keys'](_0x520b92)[0x0],_0x21cdde,_0x25320c),_0x44692d=await a8_0x151580[_0x495087(0x1a6)](_0x5d85cf,{'parser':'typescript'}),_0x24b7d6=_0x4cbffc+'/'+_0x21cdde+_0x495087(0x1a8);writeFileSync(_0x24b7d6,_0x44692d,{'encoding':_0x495087(0x1a1)});const _0x51465c=readFileSync(_0x4ffbfb,'utf8'),_0x4082eb=TemplateReplacer['replaceApiContent'](_0x51465c,_0x2d708b,_0x520b92,Object[_0x495087(0x19a)](_0x520b92)[0x0],_0x21cdde,_0x25320c,_0xcb9fc7),_0x243bad=await a8_0x151580[_0x495087(0x1a6)](_0x4082eb,{'parser':_0x495087(0x1bf)}),_0x43511a=_0x4cbffc+'/'+_0x32846b+_0x495087(0x1a8);writeFileSync(_0x43511a,_0x243bad,{'encoding':_0x495087(0x1a1)});const _0x3aa65b=Object['keys'](_0x520b92)['length'];return logger[_0x495087(0x1be)](_0x495087(0x19b),'API\x20文件生成成功!',undefined,{'apiFile':_0x24b7d6,'clientFile':_0x43511a,'modelCount':_0x3aa65b,'configName':_0x25320c}),{'modelCount':_0x3aa65b,'apiFilePath':_0x24b7d6,'clientFilePath':_0x43511a,'configName':_0x25320c};}
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(_0x62a7a7,_0x583046){const _0x487cc6=a9_0xf9ed,_0x356013=_0x62a7a7();while(!![]){try{const _0x132a19=-parseInt(_0x487cc6(0x69))/0x1*(-parseInt(_0x487cc6(0x7c))/0x2)+parseInt(_0x487cc6(0x7d))/0x3+-parseInt(_0x487cc6(0x9c))/0x4*(parseInt(_0x487cc6(0x89))/0x5)+parseInt(_0x487cc6(0x9f))/0x6*(-parseInt(_0x487cc6(0x85))/0x7)+parseInt(_0x487cc6(0x74))/0x8*(-parseInt(_0x487cc6(0x67))/0x9)+-parseInt(_0x487cc6(0x8f))/0xa+parseInt(_0x487cc6(0x96))/0xb;if(_0x132a19===_0x583046)break;else _0x356013['push'](_0x356013['shift']());}catch(_0x235117){_0x356013['push'](_0x356013['shift']());}}}(a9_0x5afa,0x69940));import{jsx as a9_0x55e4c4}from'react/jsx-runtime';import{render}from'ink';function a9_0xf9ed(_0x17daf8,_0x357a1){const _0x5afac9=a9_0x5afa();return a9_0xf9ed=function(_0xf9eda1,_0x3ae919){_0xf9eda1=_0xf9eda1-0x67;let _0x218d9b=_0x5afac9[_0xf9eda1];return _0x218d9b;},a9_0xf9ed(_0x17daf8,_0x357a1);}import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x35093f){const _0x40334a=a9_0xf9ed,_0x1f5d08=_0x35093f[_0x40334a(0x86)][0x1];if(_0x35093f['flags'][_0x40334a(0x84)]){console[_0x40334a(0x9e)](_0x40334a(0x8b));return;}if(_0x1f5d08===_0x40334a(0x72)){_0x35093f[_0x40334a(0x86)][0x2]&&(console[_0x40334a(0x82)](_0x40334a(0x6d)),console['log'](_0x40334a(0x97)),console[_0x40334a(0x9e)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x35093f[_0x40334a(0x86)][0x2]),process[_0x40334a(0x8e)](0x1));const _0x23ec51=getConfigAppCode();let _0x14e657=_0x35093f[_0x40334a(0x75)][_0x40334a(0x70)];const _0x94e218=typeof _0x35093f[_0x40334a(0x75)][_0x40334a(0x7b)]==='string'?_0x35093f['flags'][_0x40334a(0x7b)]:undefined,_0x5ca264=_0x35093f['flags'][_0x40334a(0x81)];!_0x14e657&&!_0x23ec51&&(console[_0x40334a(0x82)](_0x40334a(0x92)),console['log'](_0x40334a(0x91)),console[_0x40334a(0x9e)](_0x40334a(0x78)),console['log'](_0x40334a(0x8d)),process[_0x40334a(0x8e)](0x1)),_0x14e657&&_0x23ec51&&_0x14e657===_0x23ec51&&(console[_0x40334a(0x9e)](_0x40334a(0x88)+_0x14e657+'\x1b[0m'),console['log'](_0x40334a(0x77)),_0x14e657=undefined),render(a9_0x55e4c4(ApiPullUI,{'appCode':_0x14e657,'env':_0x94e218,'output':_0x5ca264}));}else{if(_0x1f5d08===_0x40334a(0x68)){_0x35093f[_0x40334a(0x86)][0x2]&&(console[_0x40334a(0x82)](_0x40334a(0x6d)),console[_0x40334a(0x9e)](_0x40334a(0x97)),console[_0x40334a(0x9e)](_0x40334a(0x6a)+_0x35093f[_0x40334a(0x86)][0x2]),process['exit'](0x1));const _0x5504cd=getConfigAppCode();let _0x33c635=_0x35093f[_0x40334a(0x75)][_0x40334a(0x70)];const _0x1bac51=typeof _0x35093f[_0x40334a(0x75)][_0x40334a(0x7b)]===_0x40334a(0x93)?_0x35093f[_0x40334a(0x75)]['env']:undefined,_0x366321=_0x35093f['flags']['output'],_0x36741d=_0x35093f['flags'][_0x40334a(0x7f)],_0x5d2c0d=_0x35093f[_0x40334a(0x75)][_0x40334a(0x95)];!_0x33c635&&!_0x5504cd&&(console[_0x40334a(0x82)](_0x40334a(0x92)),console[_0x40334a(0x9e)](_0x40334a(0x91)),console[_0x40334a(0x9e)](_0x40334a(0x78)),console[_0x40334a(0x9e)](_0x40334a(0x7a)),process[_0x40334a(0x8e)](0x1));_0x33c635&&_0x5504cd&&_0x33c635===_0x5504cd&&(console[_0x40334a(0x9e)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x33c635+'\x1b[0m'),_0x33c635=undefined);let _0x184c7e;if(_0x36741d)try{_0x184c7e=JSON[_0x40334a(0x98)](_0x36741d),(typeof _0x184c7e!=='object'||_0x184c7e===null||Array[_0x40334a(0x94)](_0x184c7e))&&(console[_0x40334a(0x82)](_0x40334a(0x9d)),process[_0x40334a(0x8e)](0x1));}catch(_0x35a60a){console[_0x40334a(0x82)](_0x40334a(0x80)),console['error'](_0x40334a(0x76)+(_0x35a60a instanceof Error?_0x35a60a[_0x40334a(0x8c)]:String(_0x35a60a))),process[_0x40334a(0x8e)](0x1);}let _0x4ed358;_0x5d2c0d&&(_0x4ed358=_0x5d2c0d[_0x40334a(0x6b)](',')[_0x40334a(0x83)](_0xaa23f7=>_0xaa23f7['trim']())[_0x40334a(0x7e)](_0x64ab88=>_0x64ab88[_0x40334a(0x99)]>0x0),_0x4ed358[_0x40334a(0x99)]===0x0&&(console[_0x40334a(0x82)](_0x40334a(0x87)),process[_0x40334a(0x8e)](0x1)),console['log'](_0x40334a(0x79)+_0x4ed358[_0x40334a(0x73)](',\x20')+_0x40334a(0x8a))),render(a9_0x55e4c4(ApiDocUI,{'appCode':_0x33c635,'env':_0x1bac51,'output':_0x366321,'extraParams':_0x184c7e,'datasetCodes':_0x4ed358}));}else console[_0x40334a(0x82)](_0x40334a(0x71)+_0x1f5d08),console[_0x40334a(0x9e)](_0x40334a(0x6c)),console[_0x40334a(0x9e)]('\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[_0x40334a(0x9e)](_0x40334a(0x90)),console[_0x40334a(0x9e)](_0x40334a(0x6e)),console[_0x40334a(0x9e)]('\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['log'](_0x40334a(0x6f)),console[_0x40334a(0x9e)](_0x40334a(0x9a)),console['log'](_0x40334a(0x9b)),console[_0x40334a(0x9e)]('\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)'),process[_0x40334a(0x8e)](0x1);}}function a9_0x5afa(){const _0x51054a=['!\x20请使用以下方式之一:','×\x20未配置\x20AppCode','string','isArray','datasetcode','12182764XenfVy','请使用\x20--appcode\x20参数,例如:','parse','length','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定文档输出目录(默认:\x20./docs)','56UuMibg','×\x20--params\x20参数必须是一个有效的\x20JSON\x20对象','log','628890ZDnTrj','18cIMlyU','doc','1LUBlIB','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','split','Available\x20commands:','❌\x20错误:不再支持位置参数方式','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','\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文档','appcode','Unknown\x20api\x20command:\x20','pull','join','139592XZsHkt','flags','\x20\x20错误:\x20','\x1b[90m\x20\x20(注:\x20--appcode\x20参数与配置一致,将使用默认配置)\x1b[0m','\x20\x20\x201.\x20配置默认值:\x20lovrabet\x20config\x20set\x20appcode\x20<app-code>','\x1b[90m*\x20仅生成指定数据集的文档:\x20','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20doc\x20--appcode\x20<app-code>','env','974990wobUzp','1972224NHPatX','filter','params','×\x20--params\x20参数不是有效的\x20JSON\x20格式','output','error','map','help','49FvFFuG','input','×\x20--datasetcode\x20参数不能为空','\x1b[90m*\x20使用配置的应用AppCode:\x20','78245mCJowW','\x1b[0m','\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','message','\x20\x20\x202.\x20使用参数:\x20lovrabet\x20api\x20pull\x20--appcode\x20<app-code>','exit','8322900GvHsJE','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode'];a9_0x5afa=function(){return _0x51054a;};return a9_0x5afa();}
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);}}
@@ -1 +1 @@
1
- (function(_0x923adb,_0x590a30){const _0x453bb6=a10_0x1a0b,_0xa074be=_0x923adb();while(!![]){try{const _0x2db59d=parseInt(_0x453bb6(0x185))/0x1*(parseInt(_0x453bb6(0x174))/0x2)+-parseInt(_0x453bb6(0x189))/0x3*(parseInt(_0x453bb6(0x182))/0x4)+parseInt(_0x453bb6(0x187))/0x5*(parseInt(_0x453bb6(0x160))/0x6)+parseInt(_0x453bb6(0x16b))/0x7*(parseInt(_0x453bb6(0x181))/0x8)+-parseInt(_0x453bb6(0x162))/0x9+-parseInt(_0x453bb6(0x177))/0xa*(parseInt(_0x453bb6(0x16f))/0xb)+parseInt(_0x453bb6(0x171))/0xc*(-parseInt(_0x453bb6(0x186))/0xd);if(_0x2db59d===_0x590a30)break;else _0xa074be['push'](_0xa074be['shift']());}catch(_0x53ae16){_0xa074be['push'](_0xa074be['shift']());}}}(a10_0x5ee0,0x51d44));import{readConfig}from'../utils/config.js';function a10_0x1a0b(_0x3c33ba,_0x4b3041){const _0x5ee0f7=a10_0x5ee0();return a10_0x1a0b=function(_0x1a0bc1,_0x10afca){_0x1a0bc1=_0x1a0bc1-0x160;let _0x2f61a0=_0x5ee0f7[_0x1a0bc1];return _0x2f61a0;},a10_0x1a0b(_0x3c33ba,_0x4b3041);}function a10_0x5ee0(){const _0x531496=['499WRKNjs','71591wkknBu','5SVLaEH','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','12wauUcI',',且无法读取错误响应内容','api','text','\x20个数据集...','string','.ts\x20-\x20模型配置文件','&pageSize=999&currentPage=1','×\x20服务器返回错误:','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','\x20个模型','1588746BitzvN','env','1045782HRdQnW','获取数据集失败,HTTP状态码:\x20','data','modelCount','url','length','API\x20配置拉取成功:\x20','\x20\x20\x20•\x20','-api','7hQClWf','×\x20API\x20配置拉取异常:','log','message','244673jyojiT','-client','12BkoxfT','error','chdir','2218QmcTdd','create-api-pull','获取数据集失败,原因:登录鉴权失败,登录已过期','300UKKMeo','*\x20正在处理\x20','/smartapi/dataset/getList?appCode=','status','×\x20无法读取错误响应内容','client','*\x20开始生成\x20API\x20配置文件:','info','online','未知错误','5166056AqrQbw','339772JFivXd','tableData','\x20个数据集,生成\x20'];a10_0x5ee0=function(){return _0x531496;};return a10_0x5ee0();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{httpRequest}from'../utils/http-client.js';export async function pullApiSilent(_0x4868ea,_0x514a29,_0x3b3915,_0x569dce){const _0x294b0b=a10_0x1a0b;let _0x1c05fd;try{const _0x41abd6=_0x514a29?.['trim']()||'';if(_0x41abd6){const _0xe2c18b=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0xe2c18b['test'](_0x41abd6))return console[_0x294b0b(0x172)](_0x294b0b(0x188)),![];}_0x3b3915&&(_0x1c05fd=process['cwd'](),process['chdir'](_0x3b3915));const _0x2d44c5=readConfig(),_0xc0f7cb=typeof _0x2d44c5[_0x294b0b(0x161)]===_0x294b0b(0x18e)?_0x2d44c5['env']:undefined,_0x25cbf4=_0x569dce||_0xc0f7cb||_0x294b0b(0x17f);initEnv(_0x25cbf4),console[_0x294b0b(0x16d)](_0x294b0b(0x192)+_0x25cbf4+')');const _0x2b2345=getApiDomain()+_0x294b0b(0x179)+_0x4868ea+_0x294b0b(0x190),_0xe037af=await httpRequest(_0x2b2345,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0xe037af['ok']){const _0x2e5c1d=_0xe037af['data'];if(_0x2e5c1d['success']){const _0x10b24b=_0x41abd6?_0x41abd6+_0x294b0b(0x16a):_0x294b0b(0x18b),_0x19e78e=_0x41abd6?_0x41abd6+_0x294b0b(0x170):_0x294b0b(0x17c);console[_0x294b0b(0x16d)](_0x294b0b(0x17d)),console[_0x294b0b(0x16d)](_0x294b0b(0x169)+_0x10b24b+_0x294b0b(0x18f)),console[_0x294b0b(0x16d)](_0x294b0b(0x169)+_0x19e78e+'.ts\x20-\x20客户端实例文件'),console[_0x294b0b(0x16d)](_0x294b0b(0x178)+_0x2e5c1d[_0x294b0b(0x164)][_0x294b0b(0x183)][_0x294b0b(0x167)]+_0x294b0b(0x18d));const _0x5e174a=await generateApiFile(_0x2e5c1d[_0x294b0b(0x164)]['tableData'],_0x41abd6,_0x4868ea,!![],_0x25cbf4);return console[_0x294b0b(0x16d)]('√\x20成功拉取\x20'+_0x2e5c1d['data'][_0x294b0b(0x183)][_0x294b0b(0x167)]+_0x294b0b(0x184)+_0x5e174a[_0x294b0b(0x165)]+_0x294b0b(0x193)),_0x3b3915&&logger[_0x294b0b(0x17e)](_0x294b0b(0x175),_0x294b0b(0x168)+_0x4868ea,{'projectPath':_0x3b3915,'appCode':_0x4868ea,'datasetCount':_0x2e5c1d['data'][_0x294b0b(0x183)]['length'],'filePrefix':_0x41abd6}),!![];}else return console['error'](_0x294b0b(0x191),_0x2e5c1d[_0x294b0b(0x16e)]||'未知错误'),_0x3b3915&&logger[_0x294b0b(0x172)](_0x294b0b(0x175),'API\x20配置拉取失败:\x20'+(_0x2e5c1d[_0x294b0b(0x16e)]||_0x294b0b(0x180)),{'projectPath':_0x3b3915,'appCode':_0x4868ea}),![];}else{if(_0xe037af['status']===0x191){const _0x745e19=_0x294b0b(0x176);console[_0x294b0b(0x172)]('×\x20'+_0x745e19),_0x3b3915&&logger[_0x294b0b(0x172)]('create-api-pull',_0x745e19,{'status':_0xe037af[_0x294b0b(0x17a)],'appCode':_0x4868ea,'url':_0xe037af['url'],'projectPath':_0x3b3915});}else{const _0x5a779b=_0x294b0b(0x163)+_0xe037af['status'];console[_0x294b0b(0x172)]('×\x20'+_0x5a779b);try{const _0x5c327d=await _0xe037af[_0x294b0b(0x18c)]();_0x5c327d&&console['error']('×\x20错误详情:',_0x5c327d),_0x3b3915&&logger[_0x294b0b(0x172)](_0x294b0b(0x175),_0x5a779b,{'status':_0xe037af['status'],'appCode':_0x4868ea,'url':_0xe037af['url'],'errorBody':_0x5c327d,'projectPath':_0x3b3915});}catch(_0x3f4997){console[_0x294b0b(0x172)](_0x294b0b(0x17b)),_0x3b3915&&logger[_0x294b0b(0x172)](_0x294b0b(0x175),_0x5a779b+_0x294b0b(0x18a),{'status':_0xe037af[_0x294b0b(0x17a)],'appCode':_0x4868ea,'url':_0xe037af[_0x294b0b(0x166)],'readError':_0x3f4997 instanceof Error?_0x3f4997[_0x294b0b(0x16e)]:String(_0x3f4997),'projectPath':_0x3b3915});}}return![];}}catch(_0xe2e4bd){const _0x31891f=_0xe2e4bd instanceof Error?_0xe2e4bd[_0x294b0b(0x16e)]:String(_0xe2e4bd);return console['error'](_0x294b0b(0x16c),_0x31891f),_0x3b3915&&logger[_0x294b0b(0x172)](_0x294b0b(0x175),'API\x20配置拉取异常:\x20'+_0x31891f,{'appCode':_0x4868ea,'projectPath':_0x3b3915}),![];}finally{_0x1c05fd&&process[_0x294b0b(0x173)](_0x1c05fd);}}
1
+ function a10_0x1026(){const _0x3dccc8=['data','-client','4732HkqhoV','api','获取数据集失败,原因:登录鉴权失败,登录已过期','env','1132116jQpgCH','15556236LoltnF','string','-api','4956WLmBBh','\x20个数据集...','9694030ynmaqZ','API\x20配置拉取失败:\x20','×\x20无法读取错误响应内容','2790lIrYJO','modelCount','url','7sIKxzt','*\x20正在处理\x20','×\x20错误详情:','×\x20API\x20配置拉取异常:','cwd','API\x20配置拉取成功:\x20','success','error','message','*\x20开始生成\x20API\x20配置文件:','client','22eTmavp','√\x20成功拉取\x20','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','未知错误','.ts\x20-\x20模型配置文件','1260jOyKpb','create-api-pull','\x20个模型','8215408JsyAdg','获取数据集失败,HTTP状态码:\x20','status','&pageSize=999&currentPage=1','\x20\x20\x20•\x20','log','chdir','98936xnfAjx','tableData','/smartapi/dataset/getList?appCode=',',且无法读取错误响应内容','×\x20服务器返回错误:','9xoQKvL','length','API\x20配置拉取异常:\x20','\x20个数据集,生成\x20','.ts\x20-\x20客户端实例文件','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'];a10_0x1026=function(){return _0x3dccc8;};return a10_0x1026();}(function(_0x1c7308,_0x4d8abc){const _0xcb3f54=a10_0x3756,_0x50df22=_0x1c7308();while(!![]){try{const _0x4b0fdf=-parseInt(_0xcb3f54(0x14d))/0x1+parseInt(_0xcb3f54(0x15a))/0x2*(parseInt(_0xcb3f54(0x143))/0x3)+parseInt(_0xcb3f54(0x12b))/0x4*(parseInt(_0xcb3f54(0x130))/0x5)+-parseInt(_0xcb3f54(0x127))/0x6+parseInt(_0xcb3f54(0x133))/0x7*(parseInt(_0xcb3f54(0x146))/0x8)+-parseInt(_0xcb3f54(0x152))/0x9*(-parseInt(_0xcb3f54(0x12d))/0xa)+parseInt(_0xcb3f54(0x13e))/0xb*(-parseInt(_0xcb3f54(0x128))/0xc);if(_0x4b0fdf===_0x4d8abc)break;else _0x50df22['push'](_0x50df22['shift']());}catch(_0x42bb97){_0x50df22['push'](_0x50df22['shift']());}}}(a10_0x1026,0xc393b));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a10_0x3756(_0x4771d8,_0x15f22b){const _0x10267f=a10_0x1026();return a10_0x3756=function(_0x3756a5,_0x52b122){_0x3756a5=_0x3756a5-0x125;let _0x4d0681=_0x10267f[_0x3756a5];return _0x4d0681;},a10_0x3756(_0x4771d8,_0x15f22b);}import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{httpRequest}from'../utils/http-client.js';export async function pullApiSilent(_0x5baa74,_0x4ae244,_0x4314fc,_0x13e456){const _0x5bc18e=a10_0x3756;let _0x208d1c;try{const _0x1cc24f=_0x4ae244?.['trim']()||'';if(_0x1cc24f){const _0x5ee7da=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5ee7da['test'](_0x1cc24f))return console['error'](_0x5bc18e(0x157)),![];}_0x4314fc&&(_0x208d1c=process[_0x5bc18e(0x137)](),process[_0x5bc18e(0x14c)](_0x4314fc));const _0x26e2c1=readConfig(),_0x277dee=typeof _0x26e2c1[_0x5bc18e(0x126)]===_0x5bc18e(0x129)?_0x26e2c1['env']:undefined,_0x5ea106=_0x13e456||_0x277dee||'online';initEnv(_0x5ea106),console[_0x5bc18e(0x14b)](_0x5bc18e(0x140)+_0x5ea106+')');const _0x23e737=getApiDomain()+_0x5bc18e(0x14f)+_0x5baa74+_0x5bc18e(0x149),_0x446993=await httpRequest(_0x23e737,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x446993['ok']){const _0x4fb18b=_0x446993['data'];if(_0x4fb18b[_0x5bc18e(0x139)]){const _0x2ad5a2=_0x1cc24f?_0x1cc24f+_0x5bc18e(0x12a):_0x5bc18e(0x15b),_0x2fa464=_0x1cc24f?_0x1cc24f+_0x5bc18e(0x159):_0x5bc18e(0x13d);console[_0x5bc18e(0x14b)](_0x5bc18e(0x13c)),console[_0x5bc18e(0x14b)](_0x5bc18e(0x14a)+_0x2ad5a2+_0x5bc18e(0x142)),console['log'](_0x5bc18e(0x14a)+_0x2fa464+_0x5bc18e(0x156)),console[_0x5bc18e(0x14b)](_0x5bc18e(0x134)+_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)][_0x5bc18e(0x153)]+_0x5bc18e(0x12c));const _0x33440a=await generateApiFile(_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)],_0x1cc24f,_0x5baa74,!![],_0x5ea106);return console[_0x5bc18e(0x14b)](_0x5bc18e(0x13f)+_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)][_0x5bc18e(0x153)]+_0x5bc18e(0x155)+_0x33440a[_0x5bc18e(0x131)]+_0x5bc18e(0x145)),_0x4314fc&&logger['info'](_0x5bc18e(0x144),_0x5bc18e(0x138)+_0x5baa74,{'projectPath':_0x4314fc,'appCode':_0x5baa74,'datasetCount':_0x4fb18b[_0x5bc18e(0x158)][_0x5bc18e(0x14e)][_0x5bc18e(0x153)],'filePrefix':_0x1cc24f}),!![];}else return console['error'](_0x5bc18e(0x151),_0x4fb18b['message']||_0x5bc18e(0x141)),_0x4314fc&&logger[_0x5bc18e(0x13a)](_0x5bc18e(0x144),_0x5bc18e(0x12e)+(_0x4fb18b[_0x5bc18e(0x13b)]||_0x5bc18e(0x141)),{'projectPath':_0x4314fc,'appCode':_0x5baa74}),![];}else{if(_0x446993[_0x5bc18e(0x148)]===0x191){const _0x1d2b1c=_0x5bc18e(0x125);console['error']('×\x20'+_0x1d2b1c),_0x4314fc&&logger[_0x5bc18e(0x13a)](_0x5bc18e(0x144),_0x1d2b1c,{'status':_0x446993['status'],'appCode':_0x5baa74,'url':_0x446993[_0x5bc18e(0x132)],'projectPath':_0x4314fc});}else{const _0x3a4168=_0x5bc18e(0x147)+_0x446993[_0x5bc18e(0x148)];console[_0x5bc18e(0x13a)]('×\x20'+_0x3a4168);try{const _0x25c979=await _0x446993['text']();_0x25c979&&console[_0x5bc18e(0x13a)](_0x5bc18e(0x135),_0x25c979),_0x4314fc&&logger[_0x5bc18e(0x13a)](_0x5bc18e(0x144),_0x3a4168,{'status':_0x446993[_0x5bc18e(0x148)],'appCode':_0x5baa74,'url':_0x446993['url'],'errorBody':_0x25c979,'projectPath':_0x4314fc});}catch(_0x25e0e1){console[_0x5bc18e(0x13a)](_0x5bc18e(0x12f)),_0x4314fc&&logger['error'](_0x5bc18e(0x144),_0x3a4168+_0x5bc18e(0x150),{'status':_0x446993[_0x5bc18e(0x148)],'appCode':_0x5baa74,'url':_0x446993[_0x5bc18e(0x132)],'readError':_0x25e0e1 instanceof Error?_0x25e0e1[_0x5bc18e(0x13b)]:String(_0x25e0e1),'projectPath':_0x4314fc});}}return![];}}catch(_0x2f5b7c){const _0x5bc8eb=_0x2f5b7c instanceof Error?_0x2f5b7c['message']:String(_0x2f5b7c);return console[_0x5bc18e(0x13a)](_0x5bc18e(0x136),_0x5bc8eb),_0x4314fc&&logger['error']('create-api-pull',_0x5bc18e(0x154)+_0x5bc8eb,{'appCode':_0x5baa74,'projectPath':_0x4314fc}),![];}finally{_0x208d1c&&process[_0x5bc18e(0x14c)](_0x208d1c);}}