@lovrabet/cli 1.1.7 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/LICENSE +45 -0
  2. package/README.md +85 -4
  3. package/lib/add-page/input-page-router.js +1 -1
  4. package/lib/add-page/main.js +1 -1
  5. package/lib/add-page/select-page-template.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/format-dataset.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/api/pull.js +1 -1
  12. package/lib/auth/auth-server-ui.js +1 -1
  13. package/lib/auth/auth-server.js +1 -1
  14. package/lib/auth/constant.js +1 -1
  15. package/lib/auth/get-cookie.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli.js +1 -1
  19. package/lib/cmd/build-watch.js +1 -1
  20. package/lib/cmd/build.js +1 -1
  21. package/lib/cmd/logs.js +1 -1
  22. package/lib/cmd/preview.js +1 -1
  23. package/lib/cmd/start.js +1 -1
  24. package/lib/config/config-help.js +1 -1
  25. package/lib/config/main.js +1 -1
  26. package/lib/constant/domain.js +1 -1
  27. package/lib/constant/env.js +1 -1
  28. package/lib/create-app/enhanced-guided-create.js +1 -1
  29. package/lib/create-app/format-elapsed.js +1 -1
  30. package/lib/create-app/main.js +1 -1
  31. package/lib/create-app/task-finished.js +1 -1
  32. package/lib/create-app/task-loading.js +1 -1
  33. package/lib/create-app/task-running.js +1 -1
  34. package/lib/create-app/task-time.js +1 -1
  35. package/lib/create-app/use-copy-project-template.js +1 -1
  36. package/lib/create-app/use-format-code.js +1 -1
  37. package/lib/create-app/use-install-dependencies.js +1 -1
  38. package/lib/help.js +1 -1
  39. package/lib/utils/config.js +1 -1
  40. package/lib/utils/copy-directory.js +1 -1
  41. package/lib/utils/http-client.js +1 -1
  42. package/lib/utils/logger.js +1 -1
  43. package/lib/utils/router-updater.js +1 -1
  44. package/lib/utils/template-replacer.js +1 -1
  45. package/package.json +2 -2
  46. package/templates/projects/sub-app-react-demo/package-lock.json +4 -4
  47. package/templates/projects/sub-app-react-demo/package.json +1 -1
package/LICENSE ADDED
@@ -0,0 +1,45 @@
1
+ # Lovrabet CLI 软件许可协议
2
+
3
+ 版权所有 (c) 2024-2025 Lovrabet
4
+
5
+ ## 许可范围
6
+
7
+ 本软件("Lovrabet CLI")是专有软件,由 Lovrabet 开发和维护。
8
+
9
+ ### 允许的使用
10
+
11
+ 您被授予有限的、非独占的、不可转让的许可,可以:
12
+
13
+ 1. **安装和使用** - 通过 npm 安装并在您的开发环境中使用本软件
14
+ 2. **个人和商业用途** - 在个人项目或商业项目中使用本软件
15
+ 3. **生成内容** - 使用本软件生成的代码和项目文件归您所有
16
+
17
+ ### 限制条款
18
+
19
+ 您**不得**:
20
+
21
+ 1. ❌ **修改源代码** - 不得修改、反编译、逆向工程或反汇编本软件
22
+ 2. ❌ **再分发** - 不得复制、分发、出售或转让本软件
23
+ 3. ❌ **创建衍生作品** - 不得基于本软件创建衍生产品或竞争产品
24
+ 4. ❌ **移除版权声明** - 不得移除或修改任何版权声明或商标
25
+ 5. ❌ **公开源代码** - 本软件为闭源软件,源代码不公开
26
+
27
+ ## 免责声明
28
+
29
+ 本软件按"原样"提供,不提供任何明示或暗示的保证,包括但不限于对适销性、特定用途适用性和非侵权性的保证。
30
+
31
+ 在任何情况下,作者或版权持有人均不对任何索赔、损害或其他责任负责,无论是在合同诉讼、侵权行为还是其他方面。
32
+
33
+ ## 终止
34
+
35
+ 如果您违反本许可协议的任何条款,您使用本软件的权利将自动终止。
36
+
37
+ ## 联系方式
38
+
39
+ 如有疑问或需要商业授权,请联系:
40
+ - 网站:https://www.lovrabet.com
41
+ - 邮箱:support@lovrabet.com
42
+
43
+ ---
44
+
45
+ **本软件受著作权法和国际条约保护。未经授权的复制或分发可能导致严重的民事和刑事处罚。**
package/README.md CHANGED
@@ -65,7 +65,7 @@ lovrabet start
65
65
  如果在create的时候未选择自动更新API列表,或者API已经发生变化,可以手动根据应用的appcode自动生成 API 配置:
66
66
 
67
67
  ```bash
68
- lovrabet api pull [app-code]
68
+ lovrabet api pull --appcode <app-code>
69
69
  ```
70
70
 
71
71
  ### 5. 添加页面
@@ -126,13 +126,14 @@ lovrabet add page
126
126
 
127
127
  ### API 集成
128
128
 
129
- #### `lovrabet api pull [app-code]`
129
+ #### `lovrabet api pull`
130
130
 
131
131
  拉取并生成 API 配置文件
132
132
 
133
133
  - **自动发现**: 扫描应用数据集和接口
134
134
  - **类型生成**: 自动生成 TypeScript 类型定义
135
135
  - **配置生成**: 生成 SDK 配置文件
136
+ - **可用参数**: `--appcode`、`--output`、`--env`(v1.1.7+)
136
137
 
137
138
  ### 身份认证
138
139
 
@@ -227,7 +228,7 @@ module.exports = {
227
228
  ```bash
228
229
  lovrabet create prototype-app
229
230
  cd prototype-app
230
- lovrabet api pull your-app-code
231
+ lovrabet api pull --appcode your-app-code
231
232
  lovrabet start
232
233
  ```
233
234
 
@@ -266,7 +267,7 @@ lovrabet auth
266
267
  A: 检查应用代码是否正确,确认您有该应用的访问权限:
267
268
 
268
269
  ```bash
269
- lovrabet api pull correct-app-code
270
+ lovrabet api pull --appcode correct-app-code
270
271
  ```
271
272
 
272
273
  **Q: 构建错误?**
@@ -293,10 +294,90 @@ lovrabet logs
293
294
  lovrabet logs --clear
294
295
  ```
295
296
 
297
+ ## 📝 What's New
298
+
299
+ ### v1.1.7 (2025-10-10)
300
+
301
+ **重大变更 (Breaking Changes):**
302
+
303
+ - 🔴 **`lovrabet api pull` 命令参数调整**
304
+ - ❌ **不再支持**位置参数方式(如 `lovrabet api pull my-app-code`)
305
+ - ✅ **改用** `--appcode` 参数(如 `lovrabet api pull --appcode my-app-code`)
306
+ - 迁移指南:将 `lovrabet api pull <app-code>` 改为 `lovrabet api pull --appcode <app-code>`
307
+
308
+ **新增功能 (New Features):**
309
+
310
+ - ✨ **新增 `--output` 参数** - 支持自定义 API 文件输出目录
311
+ ```bash
312
+ lovrabet api pull --output ./lib/api
313
+ ```
314
+ - ✨ **新增 `--env` 参数** - 支持指定环境拉取 API(内部使用)
315
+ ```bash
316
+ lovrabet api pull --env <env>
317
+ ```
318
+
319
+ **改进 (Improvements):**
320
+
321
+ - 📚 优化命令行帮助信息,参数说明更加清晰
322
+ - 🔧 统一命令行参数风格,所有参数均使用 `--` 前缀
323
+ - 📖 更新文档,添加版本标识和迁移说明
324
+
325
+ **使用示例:**
326
+
327
+ ```bash
328
+ # ✅ 推荐用法
329
+ lovrabet api pull # 使用配置的 appcode
330
+ lovrabet api pull --appcode my-app # 指定 appcode
331
+ lovrabet api pull --output ./lib/api # 自定义输出目录
332
+ lovrabet api pull --appcode my-app --output ./api # 组合使用
333
+
334
+ # ❌ 不再支持
335
+ lovrabet api pull my-app # 位置参数方式已废弃
336
+ ```
337
+
338
+ ---
339
+
340
+ ### v1.1.6 (2025-09-30)
341
+
342
+ **改进 (Improvements):**
343
+
344
+ - 📦 **升级模板 SDK** - 项目模板中的 SDK 升级到最新版本,支持更多特性
345
+
346
+ ---
347
+
348
+ ### v1.1.4 (2025-09-27)
349
+
350
+ **重大变更 (Breaking Changes):**
351
+
352
+ - 🔴 **统一模型配置字段命名** - 重构模型配置字段命名规范(可能影响现有配置)
353
+ - 请查阅文档更新配置文件中的字段名称
354
+
355
+ ---
356
+
296
357
  ## 📖 更多资源
297
358
 
298
359
  - [Lovrabet SDK 使用指南](https://www.npmjs.com/package/@lovrabet/sdk)
299
360
  - [示例项目](https://github.com/lovrabet-ai/sub-app-react-demo)
361
+ - [完整文档](https://docs.lovrabet.com)
362
+
363
+ ---
364
+
365
+ ## 🤝 反馈
366
+
367
+ 如遇到问题或有功能建议,欢迎提交 Issue!
368
+
369
+ ## 📄 许可证
370
+
371
+ **专有软件(Proprietary)** - 详见 [LICENSE](./LICENSE) 文件
372
+
373
+ 本软件为 Lovrabet 开放平台的专有工具:
374
+ - ✅ **允许使用** - 可以安装和使用本工具开发 Lovrabet 应用
375
+ - ✅ **生成内容归您** - 使用本工具生成的代码和项目归您所有
376
+ - ❌ **不得修改** - 不得修改、反编译或逆向工程
377
+ - ❌ **不得再分发** - 不得复制或分发本软件
378
+ - ❌ **源代码不公开** - 本软件为闭源软件
379
+
380
+ 如需商业授权或有疑问,请访问 [lovrabet.com](https://www.lovrabet.com)
300
381
 
301
382
  ---
302
383
 
@@ -1 +1 @@
1
- function a0_0x5b4f(_0x59a3bc,_0x5630b0){const _0x389584=a0_0x3895();return a0_0x5b4f=function(_0x5b4fa8,_0x34b1aa){_0x5b4fa8=_0x5b4fa8-0x196;let _0x1f57fc=_0x389584[_0x5b4fa8];return _0x1f57fc;},a0_0x5b4f(_0x59a3bc,_0x5630b0);}(function(_0x2ef32b,_0x59feaa){const _0x2e66bd=a0_0x5b4f,_0x154d48=_0x2ef32b();while(!![]){try{const _0x13a684=parseInt(_0x2e66bd(0x1b4))/0x1*(-parseInt(_0x2e66bd(0x1aa))/0x2)+-parseInt(_0x2e66bd(0x1a9))/0x3+parseInt(_0x2e66bd(0x1b3))/0x4*(parseInt(_0x2e66bd(0x1a0))/0x5)+parseInt(_0x2e66bd(0x19b))/0x6*(parseInt(_0x2e66bd(0x1a6))/0x7)+-parseInt(_0x2e66bd(0x197))/0x8+-parseInt(_0x2e66bd(0x1b6))/0x9*(-parseInt(_0x2e66bd(0x199))/0xa)+parseInt(_0x2e66bd(0x19d))/0xb*(parseInt(_0x2e66bd(0x1af))/0xc);if(_0x13a684===_0x59feaa)break;else _0x154d48['push'](_0x154d48['shift']());}catch(_0x3d1ef4){_0x154d48['push'](_0x154d48['shift']());}}}(a0_0x3895,0xda540));import{jsx as a0_0xc39c85,jsxs as a0_0xa8d649}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0xf4b223 from'node:fs';function a0_0x3895(){const _0x4a92d4=['3506cyHRYB','endsWith','slice','startsWith','column','2057520jykCSJ','页面路由地址:\x20','backspace','\x20直接回车确认,或输入自定义路由地址','40tywmtN','593owOSjC','return','6419862DtkzrL','路径不能包含连续的\x20/','gray','5009248GsQxlZ','\x20←\x20','20ZWVLJn','\x20Step2:\x20','782658fznaVU','test','121IiJoOx','\x20已存在,请使用其他路径','includes','37775xVuoIY','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','delete','页面路径长度不能超过\x20100\x20个字符','red','my-page','28azXCmH','页面路径\x20','existsSync','4050183eNBTmx'];a0_0x3895=function(){return _0x4a92d4;};return a0_0x3895();}export function InputProjectCode(_0x28d9d7){const _0x33e5dc=a0_0x5b4f,{onSubmit:_0x3e1b57,pagePath:_0x3421ba}=_0x28d9d7,[_0x1ea7f5,_0x4d3f31]=useState(''),[_0x7747c4,_0x145ed7]=useState(''),_0x4564c3=_0x33e5dc(0x1a5);function _0x9de74a(_0x1371f0){const _0x22f92f=_0x33e5dc;if(_0x1371f0['length']>0x64)return{'valid':![],'message':_0x22f92f(0x1a3)};if(_0x1371f0[_0x22f92f(0x1ad)]('/')||_0x1371f0[_0x22f92f(0x1ab)]('/'))return{'valid':![],'message':'路径不能以\x20/\x20开头或结尾'};if(_0x1371f0[_0x22f92f(0x19f)]('//'))return{'valid':![],'message':_0x22f92f(0x1b7)};const _0x586999=_0x1371f0['split']('/');for(const _0x356fa6 of _0x586999){if(!_0x356fa6)continue;const _0xeea8d7=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xeea8d7[_0x22f92f(0x19c)](_0x356fa6))return{'valid':![],'message':_0x22f92f(0x1a1)};}return{'valid':!![]};}return useInput((_0x58dce1,_0x36ca1d)=>{const _0xc156a2=_0x33e5dc;if(_0x36ca1d[_0xc156a2(0x1b5)]){const _0x551934=_0x1ea7f5['trim']()||_0x4564c3;if(_0x7747c4)return;const _0x1b44c2=_0x3421ba+'/'+_0x551934;if(a0_0xf4b223[_0xc156a2(0x1a8)](_0x1b44c2)){_0x145ed7(_0xc156a2(0x1a7)+_0x551934+_0xc156a2(0x19e));return;}_0x3e1b57(_0x551934),_0x4d3f31(''),_0x145ed7('');}else _0x36ca1d[_0xc156a2(0x1b1)]||_0x36ca1d[_0xc156a2(0x1a2)]?_0x4d3f31(_0x443728=>{const _0x18fc77=_0xc156a2,_0x4671ce=_0x443728[_0x18fc77(0x1ac)](0x0,-0x1),{valid:_0x1b65d3,message:_0x4dc77c}=_0x9de74a(_0x4671ce);return _0x145ed7(_0x1b65d3?'':_0x4dc77c||'页面路径不合法'),_0x4671ce;}):_0x4d3f31(_0x31525f=>{const _0x4e2977=_0x31525f+_0x58dce1,{valid:_0x33fe14,message:_0x534871}=_0x9de74a(_0x4e2977);return _0x145ed7(_0x33fe14?'':_0x534871||'页面路径不合法'),_0x4e2977;});}),a0_0xa8d649(Box,{'flexDirection':_0x33e5dc(0x1ae),'children':[a0_0xa8d649(Box,{'children':[a0_0xc39c85(Text,{'color':_0x33e5dc(0x196),'children':_0x33e5dc(0x19a)}),a0_0xc39c85(Text,{'children':_0x33e5dc(0x1b0)}),_0x1ea7f5?a0_0xc39c85(Text,{'color':'green','children':_0x1ea7f5}):a0_0xc39c85(Text,{'color':_0x33e5dc(0x196),'children':_0x4564c3}),_0x7747c4&&a0_0xa8d649(Text,{'color':_0x33e5dc(0x1a4),'children':[_0x33e5dc(0x198),_0x7747c4]})]}),!_0x7747c4&&!_0x1ea7f5&&a0_0xc39c85(Box,{'children':a0_0xc39c85(Text,{'color':_0x33e5dc(0x196),'children':_0x33e5dc(0x1b2)})})]});}
1
+ function a0_0x4e8c(_0xd50599,_0x566223){const _0x531f20=a0_0x531f();return a0_0x4e8c=function(_0x4e8cd0,_0x3d8f38){_0x4e8cd0=_0x4e8cd0-0xd9;let _0xdc4305=_0x531f20[_0x4e8cd0];return _0xdc4305;},a0_0x4e8c(_0xd50599,_0x566223);}function a0_0x531f(){const _0x23cad4=['delete','71821UMtUPx','length','7mKZsYW','split','页面路径\x20','gray','1725714DMauFX','my-page','10LtttIl','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','\x20Step2:\x20','4153448hHnhSU','2uJysHa','页面路径不合法','column','路径不能以\x20/\x20开头或结尾','endsWith','页面路径长度不能超过\x20100\x20个字符','980832EFltkn','existsSync','2002670KzHZAn','458128kETycN','页面路由地址:\x20','\x20直接回车确认,或输入自定义路由地址','464583RUELTX','test','\x20←\x20','路径不能包含连续的\x20/','red'];a0_0x531f=function(){return _0x23cad4;};return a0_0x531f();}(function(_0x5b1d47,_0x3c3c8){const _0x2a75ae=a0_0x4e8c,_0x495dce=_0x5b1d47();while(!![]){try{const _0xb48e59=parseInt(_0x2a75ae(0xde))/0x1*(-parseInt(_0x2a75ae(0xea))/0x2)+parseInt(_0x2a75ae(0xf6))/0x3+parseInt(_0x2a75ae(0xf3))/0x4+-parseInt(_0x2a75ae(0xf2))/0x5+parseInt(_0x2a75ae(0xf0))/0x6+-parseInt(_0x2a75ae(0xe0))/0x7*(-parseInt(_0x2a75ae(0xe9))/0x8)+-parseInt(_0x2a75ae(0xe4))/0x9*(parseInt(_0x2a75ae(0xe6))/0xa);if(_0xb48e59===_0x3c3c8)break;else _0x495dce['push'](_0x495dce['shift']());}catch(_0x26ca47){_0x495dce['push'](_0x495dce['shift']());}}}(a0_0x531f,0x464c9));import{jsx as a0_0x26ea40,jsxs as a0_0x185837}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0x20a90e from'node:fs';export function InputProjectCode(_0x4fb1f8){const _0x2c5c55=a0_0x4e8c,{onSubmit:_0x104cb3,pagePath:_0x3a1c46}=_0x4fb1f8,[_0xa82e58,_0x41de3f]=useState(''),[_0x406031,_0x29ac9f]=useState(''),_0x164cb2=_0x2c5c55(0xe5);function _0x47fbbf(_0x772e10){const _0x2b96b1=_0x2c5c55;if(_0x772e10[_0x2b96b1(0xdf)]>0x64)return{'valid':![],'message':_0x2b96b1(0xef)};if(_0x772e10['startsWith']('/')||_0x772e10[_0x2b96b1(0xee)]('/'))return{'valid':![],'message':_0x2b96b1(0xed)};if(_0x772e10['includes']('//'))return{'valid':![],'message':_0x2b96b1(0xdb)};const _0x16c930=_0x772e10[_0x2b96b1(0xe1)]('/');for(const _0x1955f0 of _0x16c930){if(!_0x1955f0)continue;const _0x57660d=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0x57660d[_0x2b96b1(0xd9)](_0x1955f0))return{'valid':![],'message':_0x2b96b1(0xe7)};}return{'valid':!![]};}return useInput((_0x57ac71,_0x28f544)=>{const _0x569e17=_0x2c5c55;if(_0x28f544['return']){const _0x4b3a2e=_0xa82e58['trim']()||_0x164cb2;if(_0x406031)return;const _0x454678=_0x3a1c46+'/'+_0x4b3a2e;if(a0_0x20a90e[_0x569e17(0xf1)](_0x454678)){_0x29ac9f(_0x569e17(0xe2)+_0x4b3a2e+'\x20已存在,请使用其他路径');return;}_0x104cb3(_0x4b3a2e),_0x41de3f(''),_0x29ac9f('');}else _0x28f544['backspace']||_0x28f544[_0x569e17(0xdd)]?_0x41de3f(_0x3b9c2e=>{const _0x7f00ab=_0x569e17,_0x20bd01=_0x3b9c2e['slice'](0x0,-0x1),{valid:_0x5b4cd3,message:_0x1cfbce}=_0x47fbbf(_0x20bd01);return _0x29ac9f(_0x5b4cd3?'':_0x1cfbce||_0x7f00ab(0xeb)),_0x20bd01;}):_0x41de3f(_0x55d665=>{const _0x267fdc=_0x569e17,_0x5354b5=_0x55d665+_0x57ac71,{valid:_0x37c6b1,message:_0x1444ad}=_0x47fbbf(_0x5354b5);return _0x29ac9f(_0x37c6b1?'':_0x1444ad||_0x267fdc(0xeb)),_0x5354b5;});}),a0_0x185837(Box,{'flexDirection':_0x2c5c55(0xec),'children':[a0_0x185837(Box,{'children':[a0_0x26ea40(Text,{'color':_0x2c5c55(0xe3),'children':_0x2c5c55(0xe8)}),a0_0x26ea40(Text,{'children':_0x2c5c55(0xf4)}),_0xa82e58?a0_0x26ea40(Text,{'color':'green','children':_0xa82e58}):a0_0x26ea40(Text,{'color':_0x2c5c55(0xe3),'children':_0x164cb2}),_0x406031&&a0_0x185837(Text,{'color':_0x2c5c55(0xdc),'children':[_0x2c5c55(0xda),_0x406031]})]}),!_0x406031&&!_0xa82e58&&a0_0x26ea40(Box,{'children':a0_0x26ea40(Text,{'color':_0x2c5c55(0xe3),'children':_0x2c5c55(0xf5)})})]});}
@@ -1 +1 @@
1
- const a1_0x40d0ae=a1_0x4253;(function(_0x39dbac,_0x601f20){const _0x431cfc=a1_0x4253,_0x1effb2=_0x39dbac();while(!![]){try{const _0x5e304f=-parseInt(_0x431cfc(0x192))/0x1+parseInt(_0x431cfc(0x1b4))/0x2+-parseInt(_0x431cfc(0x1ab))/0x3*(-parseInt(_0x431cfc(0x18d))/0x4)+parseInt(_0x431cfc(0x1b1))/0x5*(parseInt(_0x431cfc(0x1ad))/0x6)+-parseInt(_0x431cfc(0x1a6))/0x7*(-parseInt(_0x431cfc(0x19a))/0x8)+parseInt(_0x431cfc(0x1aa))/0x9*(parseInt(_0x431cfc(0x197))/0xa)+parseInt(_0x431cfc(0x19e))/0xb*(-parseInt(_0x431cfc(0x19f))/0xc);if(_0x5e304f===_0x601f20)break;else _0x1effb2['push'](_0x1effb2['shift']());}catch(_0x523677){_0x1effb2['push'](_0x1effb2['shift']());}}}(a1_0x2de5,0xa31f9));function a1_0x2de5(){const _0x2cdf94=['catch','2365TgKHkB','108312jgeTkH','\x20*\x20页面文件已创建,可直接通过路由访问','join','\x20*\x20页面路径:\x20','\x20Step2:\x20','\x20*\x20路由地址:\x20','column','16079StKVUW','setLogPath','finally','green','9phLdCZ','12whhZRX','then','6DHyyXQ','开始添加页面:\x20','src','message','4703335AmQPCW','add-page','resolve','2330658ZtBdsm','273548PImXye','url','页面添加失败:\x20','processTemplate','已输入的页面路由\x20','664497cAhhOx','now','success','页面添加成功:\x20','gray','5927890KJVBfU','已选择页面模板\x20','cwd','1048mNahtW','../../templates/pages','cyan'];a1_0x2de5=function(){return _0x2cdf94;};return a1_0x2de5();}import{jsx as a1_0x13c719,jsxs as a1_0xca579b,Fragment as a1_0x2f3c67}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x3df011 from'node:path';import{useEffect,useState}from'react';function a1_0x4253(_0x3badc8,_0x5f4771){const _0x2de5a2=a1_0x2de5();return a1_0x4253=function(_0x4253b8,_0x2fd677){_0x4253b8=_0x4253b8-0x18d;let _0x44116e=_0x2de5a2[_0x4253b8];return _0x44116e;},a1_0x4253(_0x3badc8,_0x5f4771);}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_0x3df011['dirname'](fileURLToPath(import.meta[a1_0x40d0ae(0x18e)])),pageTemplateDir=a1_0x3df011['resolve'](__dirname,a1_0x40d0ae(0x19b)),projectDir=process[a1_0x40d0ae(0x199)]();export const AddPage=()=>{const _0x2cef51=a1_0x40d0ae,{exit:_0xebd0e7}=useApp(),[_0x130905,_0x3da1bf]=useState(''),[_0x33b37f,_0x12c083]=useState(''),[_0x26c93c,_0x87565c]=useState(![]),[_0x53090f,_0x55268a]=useState(![]),_0x449925=a1_0x3df011[_0x2cef51(0x1a1)](projectDir,'src','pages'),_0x265a36=a1_0x3df011['join'](_0x449925,_0x33b37f),_0x2ec926=a1_0x3df011[_0x2cef51(0x1a1)](_0x2cef51(0x1af),'pages',_0x33b37f);useEffect(()=>{const _0x597b14=_0x2cef51,_0x5d564d=a1_0x3df011[_0x597b14(0x1b3)](pageTemplateDir,_0x130905);if(_0x130905&&_0x33b37f){_0x87565c(!![]),logger[_0x597b14(0x1a7)](process[_0x597b14(0x199)]());const _0x15eb66=Date['now']();logger['info'](_0x597b14(0x1b2),_0x597b14(0x1ae)+_0x33b37f,{'template':_0x130905,'targetPath':_0x2ec926}),TemplateReplacer[_0x597b14(0x190)](_0x5d564d,a1_0x3df011[_0x597b14(0x1a1)](_0x449925,_0x33b37f),_0x33b37f,_0x130905)[_0x597b14(0x1ac)](()=>{const _0xf3f713=_0x597b14,_0x3e8cf5=Date[_0xf3f713(0x193)]()-_0x15eb66;logger[_0xf3f713(0x194)](_0xf3f713(0x1b2),_0xf3f713(0x195)+_0x33b37f,_0x3e8cf5,{'template':_0x130905,'targetPath':_0x2ec926,'routePath':_0x33b37f}),_0x55268a(!![]);})[_0x597b14(0x19d)](_0x2cddda=>{const _0x1e5180=_0x597b14,_0x2dee29=Date[_0x1e5180(0x193)]()-_0x15eb66;logger['error'](_0x1e5180(0x1b2),_0x1e5180(0x18f)+_0x33b37f,{'template':_0x130905,'targetPath':_0x2ec926,'error':_0x2cddda instanceof Error?_0x2cddda[_0x1e5180(0x1b0)]:String(_0x2cddda),'duration':_0x2dee29});})[_0x597b14(0x1a8)](()=>{_0x87565c(![]);});}},[_0x130905,_0x33b37f]),useEffect(()=>{_0x53090f&&setTimeout(()=>{_0xebd0e7();});},[_0x53090f]);if(_0x130905)return a1_0xca579b(Box,{'flexDirection':_0x2cef51(0x1a5),'paddingY':0x1,'children':[a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':'\x20Step1:\x20'}),a1_0x13c719(Text,{'children':_0x2cef51(0x198)}),a1_0x13c719(Text,{'color':_0x2cef51(0x1a9),'children':_0x130905})]}),_0x33b37f?a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':_0x2cef51(0x1a3)}),a1_0x13c719(Text,{'children':_0x2cef51(0x191)}),a1_0x13c719(Text,{'color':_0x2cef51(0x1a9),'children':_0x33b37f})]}):a1_0x13c719(InputProjectCode,{'pagePath':_0x265a36,'onSubmit':_0x12c083}),_0x33b37f&&_0x26c93c?a1_0xca579b(Box,{'marginTop':0x1,'children':[a1_0x13c719(Box,{'width':'4'}),a1_0x13c719(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0x53090f?a1_0xca579b(a1_0x2f3c67,{'children':[a1_0x13c719(Box,{'marginTop':0x1,'children':a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':'\x20*\x20页面创建成功!'})}),a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':_0x2cef51(0x1a2)}),a1_0x13c719(Text,{'color':'green','children':_0x2ec926})]}),a1_0xca579b(Box,{'children':[a1_0x13c719(Text,{'color':_0x2cef51(0x196),'children':_0x2cef51(0x1a4)}),a1_0xca579b(Text,{'color':_0x2cef51(0x1a9),'children':['/',_0x33b37f]})]}),a1_0x13c719(Box,{'marginTop':0x1,'children':a1_0x13c719(Text,{'color':_0x2cef51(0x19c),'children':_0x2cef51(0x1a0)})})]}):null]});return a1_0x13c719(SelectPageTemplate,{'onSelect':_0x3da1bf});};
1
+ const a1_0x14a6c6=a1_0xcff5;(function(_0x3413a8,_0xc853c2){const _0x41f596=a1_0xcff5,_0x6d6e67=_0x3413a8();while(!![]){try{const _0x9b55e1=parseInt(_0x41f596(0x1bb))/0x1*(parseInt(_0x41f596(0x1af))/0x2)+-parseInt(_0x41f596(0x1b5))/0x3*(-parseInt(_0x41f596(0x1b9))/0x4)+-parseInt(_0x41f596(0x1a3))/0x5+-parseInt(_0x41f596(0x1b7))/0x6*(-parseInt(_0x41f596(0x1b2))/0x7)+parseInt(_0x41f596(0x1bf))/0x8*(parseInt(_0x41f596(0x1bd))/0x9)+-parseInt(_0x41f596(0x1a7))/0xa+-parseInt(_0x41f596(0x1b6))/0xb;if(_0x9b55e1===_0xc853c2)break;else _0x6d6e67['push'](_0x6d6e67['shift']());}catch(_0x5c6722){_0x6d6e67['push'](_0x6d6e67['shift']());}}}(a1_0x3e9c,0xed852));import{jsx as a1_0x5e70c2,jsxs as a1_0x347187,Fragment as a1_0x47a434}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x4897bf 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';function a1_0xcff5(_0x48e8c9,_0x3bc752){const _0x3e9c22=a1_0x3e9c();return a1_0xcff5=function(_0xcff527,_0x1108e6){_0xcff527=_0xcff527-0x1a2;let _0x22aeed=_0x3e9c22[_0xcff527];return _0x22aeed;},a1_0xcff5(_0x48e8c9,_0x3bc752);}import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x4897bf['dirname'](fileURLToPath(import.meta[a1_0x14a6c6(0x1a5)])),pageTemplateDir=a1_0x4897bf[a1_0x14a6c6(0x1b1)](__dirname,a1_0x14a6c6(0x1b8)),projectDir=process[a1_0x14a6c6(0x1be)]();function a1_0x3e9c(){const _0x84ed40=['error','6094170CGmMKp','\x20Step2:\x20','url','src','2519410nLhxbo','\x20*\x20路由地址:\x20','正在创建页面,请稍候…','页面添加成功:\x20','catch','\x20*\x20页面文件已创建,可直接通过路由访问','success','then','2GZtkgm','gray','resolve','2359XaexBi','join','now','6izbamg','16716172VGoiWj','7926PiAaPx','../../templates/pages','510604tryuXb','column','1639679shjaqR','info','14608359oIjbXR','cwd','8nZIqdY','green','\x20*\x20页面创建成功!','processTemplate','开始添加页面:\x20','setLogPath','add-page','pages'];a1_0x3e9c=function(){return _0x84ed40;};return a1_0x3e9c();}export const AddPage=()=>{const _0x1ba9a4=a1_0x14a6c6,{exit:_0x476ff6}=useApp(),[_0x39de59,_0x4b20a5]=useState(''),[_0x5a33ae,_0x47bfad]=useState(''),[_0x3a869e,_0x1ae624]=useState(![]),[_0x353286,_0x20808c]=useState(![]),_0x111c01=a1_0x4897bf[_0x1ba9a4(0x1b3)](projectDir,_0x1ba9a4(0x1a6),_0x1ba9a4(0x1c6)),_0x1dee9c=a1_0x4897bf[_0x1ba9a4(0x1b3)](_0x111c01,_0x5a33ae),_0x174a1f=a1_0x4897bf[_0x1ba9a4(0x1b3)](_0x1ba9a4(0x1a6),'pages',_0x5a33ae);useEffect(()=>{const _0x14d266=_0x1ba9a4,_0x5e9bef=a1_0x4897bf['resolve'](pageTemplateDir,_0x39de59);if(_0x39de59&&_0x5a33ae){_0x1ae624(!![]),logger[_0x14d266(0x1c4)](process[_0x14d266(0x1be)]());const _0x1cfc40=Date['now']();logger[_0x14d266(0x1bc)](_0x14d266(0x1c5),_0x14d266(0x1c3)+_0x5a33ae,{'template':_0x39de59,'targetPath':_0x174a1f}),TemplateReplacer[_0x14d266(0x1c2)](_0x5e9bef,a1_0x4897bf[_0x14d266(0x1b3)](_0x111c01,_0x5a33ae),_0x5a33ae,_0x39de59)[_0x14d266(0x1ae)](()=>{const _0x521bc6=_0x14d266,_0x5e43d3=Date[_0x521bc6(0x1b4)]()-_0x1cfc40;logger[_0x521bc6(0x1ad)]('add-page',_0x521bc6(0x1aa)+_0x5a33ae,_0x5e43d3,{'template':_0x39de59,'targetPath':_0x174a1f,'routePath':_0x5a33ae}),_0x20808c(!![]);})[_0x14d266(0x1ab)](_0x11cc2f=>{const _0x311084=_0x14d266,_0x121c9d=Date[_0x311084(0x1b4)]()-_0x1cfc40;logger[_0x311084(0x1a2)](_0x311084(0x1c5),'页面添加失败:\x20'+_0x5a33ae,{'template':_0x39de59,'targetPath':_0x174a1f,'error':_0x11cc2f instanceof Error?_0x11cc2f['message']:String(_0x11cc2f),'duration':_0x121c9d});})['finally'](()=>{_0x1ae624(![]);});}},[_0x39de59,_0x5a33ae]),useEffect(()=>{_0x353286&&setTimeout(()=>{_0x476ff6();});},[_0x353286]);if(_0x39de59)return a1_0x347187(Box,{'flexDirection':_0x1ba9a4(0x1ba),'paddingY':0x1,'children':[a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':'\x20Step1:\x20'}),a1_0x5e70c2(Text,{'children':'已选择页面模板\x20'}),a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1c0),'children':_0x39de59})]}),_0x5a33ae?a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':_0x1ba9a4(0x1a4)}),a1_0x5e70c2(Text,{'children':'已输入的页面路由\x20'}),a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1c0),'children':_0x5a33ae})]}):a1_0x5e70c2(InputProjectCode,{'pagePath':_0x1dee9c,'onSubmit':_0x47bfad}),_0x5a33ae&&_0x3a869e?a1_0x347187(Box,{'marginTop':0x1,'children':[a1_0x5e70c2(Box,{'width':'4'}),a1_0x5e70c2(Text,{'children':_0x1ba9a4(0x1a9)})]}):null,_0x353286?a1_0x347187(a1_0x47a434,{'children':[a1_0x5e70c2(Box,{'marginTop':0x1,'children':a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':_0x1ba9a4(0x1c1)})}),a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':'gray','children':'\x20*\x20页面路径:\x20'}),a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1c0),'children':_0x174a1f})]}),a1_0x347187(Box,{'children':[a1_0x5e70c2(Text,{'color':_0x1ba9a4(0x1b0),'children':_0x1ba9a4(0x1a8)}),a1_0x347187(Text,{'color':_0x1ba9a4(0x1c0),'children':['/',_0x5a33ae]})]}),a1_0x5e70c2(Box,{'marginTop':0x1,'children':a1_0x5e70c2(Text,{'color':'cyan','children':_0x1ba9a4(0x1ac)})})]}):null]});return a1_0x5e70c2(SelectPageTemplate,{'onSelect':_0x4b20a5});};
@@ -1 +1 @@
1
- (function(_0x46c0d7,_0x3d6517){const _0xbdb7e8=a2_0x5a89,_0x2dd957=_0x46c0d7();while(!![]){try{const _0x3b4e5d=-parseInt(_0xbdb7e8(0x169))/0x1*(parseInt(_0xbdb7e8(0x17b))/0x2)+parseInt(_0xbdb7e8(0x157))/0x3+-parseInt(_0xbdb7e8(0x15a))/0x4*(-parseInt(_0xbdb7e8(0x17c))/0x5)+parseInt(_0xbdb7e8(0x15e))/0x6*(parseInt(_0xbdb7e8(0x176))/0x7)+-parseInt(_0xbdb7e8(0x160))/0x8*(parseInt(_0xbdb7e8(0x170))/0x9)+-parseInt(_0xbdb7e8(0x162))/0xa+-parseInt(_0xbdb7e8(0x15d))/0xb*(parseInt(_0xbdb7e8(0x175))/0xc);if(_0x3b4e5d===_0x3d6517)break;else _0x2dd957['push'](_0x2dd957['shift']());}catch(_0x1b10d5){_0x2dd957['push'](_0x2dd957['shift']());}}}(a2_0x5c55,0x36b21));function a2_0x5c55(){const _0x24cba9=['onSelect','264zntQBX','35qFoUUR','error','sdk-fetch','dirname','resolve','56HERywX','5kUeBNw','gray','872991wRRLlj','isDirectory','sort','1015796TdAcHs','\x20\x20\x20\x20\x20\x20>\x20','map','26653jZuQxU','377304pVlCmg','请选择您要创建的页面模板','181736TRqPQq','\x20\x20\x20\x20\x20\x20\x20\x20','3172320SEIPiV','upArrow','green','column','获取模板列表失败:','../..','url','7023JcyUZm','\x20Step1:\x20','join','localeCompare','templates/pages','label','downArrow','27QGFyeW','blank','filter','length'];a2_0x5c55=function(){return _0x24cba9;};return a2_0x5c55();}import{jsx as a2_0x541009,jsxs as a2_0x1c86e7}from'react/jsx-runtime';import{useState,useEffect}from'react';function a2_0x5a89(_0x727287,_0x4cc103){const _0x5c5513=a2_0x5c55();return a2_0x5a89=function(_0x5a8948,_0xbb787b){_0x5a8948=_0x5a8948-0x157;let _0x989a59=_0x5c5513[_0x5a8948];return _0x989a59;},a2_0x5a89(_0x727287,_0x4cc103);}import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x54b893 from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x33348d=a2_0x5a89;try{const _0x56f642=fileURLToPath(import.meta[_0x33348d(0x168)]),_0x33a249=a2_0x54b893[_0x33348d(0x17a)](a2_0x54b893[_0x33348d(0x179)](_0x56f642),_0x33348d(0x167)),_0x10ac72=a2_0x54b893[_0x33348d(0x16b)](_0x33a249,_0x33348d(0x16d)),_0x36d857=await readdir(_0x10ac72,{'withFileTypes':!![]}),_0x1628f1=_0x36d857[_0x33348d(0x172)](_0x46a029=>_0x46a029[_0x33348d(0x158)]())[_0x33348d(0x15c)](_0x4a7013=>({'label':_0x4a7013['name']}))[_0x33348d(0x159)]((_0xd4e6f,_0x9acff6)=>_0xd4e6f[_0x33348d(0x16e)][_0x33348d(0x16c)](_0x9acff6[_0x33348d(0x16e)]));return _0x1628f1;}catch(_0x401d1f){return console[_0x33348d(0x177)](_0x33348d(0x166),_0x401d1f),[{'label':_0x33348d(0x171)},{'label':_0x33348d(0x178)}];}}export function SelectPageTemplate(_0x4b78bf){const _0x465dd8=a2_0x5a89,[_0x31dbf8,_0x4e1f40]=useState(0x0),[_0x14b43f,_0x442bfb]=useState([]),[_0x258690,_0x53a02d]=useState(!![]);useEffect(()=>{async function _0x373c18(){const _0x2fc343=await getTemplateList();_0x442bfb(_0x2fc343),_0x53a02d(![]);}_0x373c18();},[]),useInput((_0x4cbceb,_0x463df7)=>{const _0x4fe965=a2_0x5a89;if(_0x258690)return;if(_0x463df7['return']){const _0xd11c23=_0x14b43f[_0x31dbf8];_0xd11c23&&_0x4b78bf[_0x4fe965(0x174)](_0xd11c23[_0x4fe965(0x16e)]);}_0x463df7[_0x4fe965(0x163)]&&_0x4e1f40(_0xd3cc19=>_0xd3cc19===0x0?_0x14b43f['length']-0x1:_0xd3cc19-0x1),_0x463df7[_0x4fe965(0x16f)]&&_0x4e1f40(_0x12327b=>_0x12327b===_0x14b43f[_0x4fe965(0x173)]-0x1?0x0:_0x12327b+0x1);});if(_0x258690)return a2_0x541009(Box,{'flexDirection':_0x465dd8(0x165),'paddingY':0x1,'children':a2_0x1c86e7(Box,{'children':[a2_0x541009(Text,{'color':_0x465dd8(0x17d),'children':_0x465dd8(0x16a)}),a2_0x541009(Text,{'children':'正在加载页面模板...'})]})});return a2_0x1c86e7(Box,{'flexDirection':_0x465dd8(0x165),'paddingY':0x1,'children':[a2_0x1c86e7(Box,{'children':[a2_0x541009(Text,{'color':_0x465dd8(0x17d),'children':'\x20Step1:\x20'}),a2_0x541009(Text,{'children':_0x465dd8(0x15f)})]}),_0x14b43f['map']((_0x555d3c,_0x54c7ee)=>{const _0x1f72a3=_0x465dd8,_0x4f6d68=_0x54c7ee===_0x31dbf8,_0x25e97e=_0x4f6d68?_0x1f72a3(0x15b)+_0x555d3c[_0x1f72a3(0x16e)]:_0x1f72a3(0x161)+_0x555d3c[_0x1f72a3(0x16e)];return a2_0x541009(Box,{'children':a2_0x541009(Text,{'color':_0x4f6d68?_0x1f72a3(0x164):undefined,'children':_0x25e97e})},_0x25e97e);})]});}
1
+ function a2_0x5a18(_0x44248e,_0x6c2d05){const _0x40a0a5=a2_0x40a0();return a2_0x5a18=function(_0x5a1830,_0x2d4511){_0x5a1830=_0x5a1830-0x17a;let _0x3793a5=_0x40a0a5[_0x5a1830];return _0x3793a5;},a2_0x5a18(_0x44248e,_0x6c2d05);}(function(_0x1816aa,_0x3b16b0){const _0x1b5bc6=a2_0x5a18,_0x2c049c=_0x1816aa();while(!![]){try{const _0x438bad=parseInt(_0x1b5bc6(0x187))/0x1*(parseInt(_0x1b5bc6(0x19c))/0x2)+-parseInt(_0x1b5bc6(0x191))/0x3+parseInt(_0x1b5bc6(0x186))/0x4*(-parseInt(_0x1b5bc6(0x18c))/0x5)+parseInt(_0x1b5bc6(0x17f))/0x6+parseInt(_0x1b5bc6(0x194))/0x7*(parseInt(_0x1b5bc6(0x197))/0x8)+-parseInt(_0x1b5bc6(0x192))/0x9+parseInt(_0x1b5bc6(0x193))/0xa;if(_0x438bad===_0x3b16b0)break;else _0x2c049c['push'](_0x2c049c['shift']());}catch(_0x58ca8b){_0x2c049c['push'](_0x2c049c['shift']());}}}(a2_0x40a0,0x3fc65));import{jsx as a2_0x280047,jsxs as a2_0x2bc691}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x306911 from'node:path';import{fileURLToPath}from'node:url';function a2_0x40a0(){const _0x100526=['label','gray','length','585882kekacg','2212605klsJTQ','3905800QloZnM','410893mxKrqJ','resolve','正在加载页面模板...','56gggMOE','isDirectory','url','sdk-fetch','获取模板列表失败:','99406ciYznk','../..','filter','column','templates/pages','sort','1834500tPtWHx','map','dirname','name','请选择您要创建的页面模板','onSelect','green','2017076ipEmDE','2wWTqkD','\x20\x20\x20\x20\x20\x20>\x20','\x20Step1:\x20','downArrow','return','5fTxnMM','blank'];a2_0x40a0=function(){return _0x100526;};return a2_0x40a0();}async function getTemplateList(){const _0x204bb2=a2_0x5a18;try{const _0x294a31=fileURLToPath(import.meta[_0x204bb2(0x199)]),_0x4ba8ac=a2_0x306911[_0x204bb2(0x195)](a2_0x306911[_0x204bb2(0x181)](_0x294a31),_0x204bb2(0x17a)),_0x2a7354=a2_0x306911['join'](_0x4ba8ac,_0x204bb2(0x17d)),_0x2ec324=await readdir(_0x2a7354,{'withFileTypes':!![]}),_0x4d4feb=_0x2ec324[_0x204bb2(0x17b)](_0x1bea8d=>_0x1bea8d[_0x204bb2(0x198)]())[_0x204bb2(0x180)](_0x2083ef=>({'label':_0x2083ef[_0x204bb2(0x182)]}))[_0x204bb2(0x17e)]((_0x16a754,_0x4d3c52)=>_0x16a754[_0x204bb2(0x18e)]['localeCompare'](_0x4d3c52[_0x204bb2(0x18e)]));return _0x4d4feb;}catch(_0x17e73a){return console['error'](_0x204bb2(0x19b),_0x17e73a),[{'label':_0x204bb2(0x18d)},{'label':_0x204bb2(0x19a)}];}}export function SelectPageTemplate(_0x34fcd3){const _0x4130d4=a2_0x5a18,[_0x457a76,_0x487cc5]=useState(0x0),[_0x54b3a3,_0x435237]=useState([]),[_0x597e4b,_0x3579fc]=useState(!![]);useEffect(()=>{async function _0x5cb910(){const _0xccf7d2=await getTemplateList();_0x435237(_0xccf7d2),_0x3579fc(![]);}_0x5cb910();},[]),useInput((_0x2dd2f9,_0x1ffa6d)=>{const _0x150057=a2_0x5a18;if(_0x597e4b)return;if(_0x1ffa6d[_0x150057(0x18b)]){const _0x9b32c6=_0x54b3a3[_0x457a76];_0x9b32c6&&_0x34fcd3[_0x150057(0x184)](_0x9b32c6['label']);}_0x1ffa6d['upArrow']&&_0x487cc5(_0x4be6ac=>_0x4be6ac===0x0?_0x54b3a3[_0x150057(0x190)]-0x1:_0x4be6ac-0x1),_0x1ffa6d[_0x150057(0x18a)]&&_0x487cc5(_0x40b07e=>_0x40b07e===_0x54b3a3['length']-0x1?0x0:_0x40b07e+0x1);});if(_0x597e4b)return a2_0x280047(Box,{'flexDirection':_0x4130d4(0x17c),'paddingY':0x1,'children':a2_0x2bc691(Box,{'children':[a2_0x280047(Text,{'color':_0x4130d4(0x18f),'children':_0x4130d4(0x189)}),a2_0x280047(Text,{'children':_0x4130d4(0x196)})]})});return a2_0x2bc691(Box,{'flexDirection':_0x4130d4(0x17c),'paddingY':0x1,'children':[a2_0x2bc691(Box,{'children':[a2_0x280047(Text,{'color':_0x4130d4(0x18f),'children':_0x4130d4(0x189)}),a2_0x280047(Text,{'children':_0x4130d4(0x183)})]}),_0x54b3a3[_0x4130d4(0x180)]((_0xc3df1a,_0x42c643)=>{const _0x3e09ee=_0x4130d4,_0x1cf9af=_0x42c643===_0x457a76,_0x2738a3=_0x1cf9af?_0x3e09ee(0x188)+_0xc3df1a['label']:'\x20\x20\x20\x20\x20\x20\x20\x20'+_0xc3df1a[_0x3e09ee(0x18e)];return a2_0x280047(Box,{'children':a2_0x280047(Text,{'color':_0x1cf9af?_0x3e09ee(0x185):undefined,'children':_0x2738a3})},_0x2738a3);})]});}
@@ -1 +1 @@
1
- (function(_0xc3d26a,_0x538884){const _0x4daae5=a3_0x5a60,_0x51dbda=_0xc3d26a();while(!![]){try{const _0x3f26f8=parseInt(_0x4daae5(0x122))/0x1*(-parseInt(_0x4daae5(0x129))/0x2)+parseInt(_0x4daae5(0x108))/0x3+parseInt(_0x4daae5(0x120))/0x4+parseInt(_0x4daae5(0x111))/0x5+-parseInt(_0x4daae5(0x12b))/0x6+-parseInt(_0x4daae5(0x10f))/0x7+-parseInt(_0x4daae5(0x123))/0x8*(-parseInt(_0x4daae5(0x135))/0x9);if(_0x3f26f8===_0x538884)break;else _0x51dbda['push'](_0x51dbda['shift']());}catch(_0x304877){_0x51dbda['push'](_0x51dbda['shift']());}}}(a3_0x21a5,0x55778));import{jsx as a3_0x323b6c,jsxs as a3_0x3743db}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x21a5(){const _0x48bc94=['🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','status','\x20from\x20\x27@/','使用配置的应用AppCode:\x20','app','148OzJbXp','./src/api/','1222368dmJqWB','lovrabet\x20auth','success','message','-client','import\x20','\x20-\x20模型配置文件','green','tableData','url','9sFmzaN','json','env','replace','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','error','cwd','online','💡\x20请使用\x20','获取数据集失败,HTTP状态码:\x20','text','data','white','*\x20已生成文件:','1179102TvHwzN','yellow','dim','*\x20将生成文件:\x20','/smartapi/dataset/getList?appCode=','\x20和\x20','includes','3306632lwOrJy','split','3000985lsyfGj','join','未提供应用AppCode,且配置中也没有默认值','cyan','api-pull','api','column','slice','gray','使用指定的应用AppCode:\x20','string',',且无法读取错误响应内容','endsWith','拉取\x20API\x20配置失败:\x20','.ts','272100WQevpy','client','5627IsRObn','3050544AvhvKg'];a3_0x21a5=function(){return _0x48bc94;};return a3_0x21a5();}function a3_0x5a60(_0x4c8777,_0x30f12f){const _0x21a5cb=a3_0x21a5();return a3_0x5a60=function(_0x5a6088,_0x3d63e3){_0x5a6088=_0x5a6088-0xfd;let _0x2963d6=_0x21a5cb[_0x5a6088];return _0x2963d6;},a3_0x5a60(_0x4c8777,_0x30f12f);}import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';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';export const ApiPullUI=({appCode:_0x3402b1,env:_0x3a20be,output:_0x2f062a})=>{const _0x1a7345=a3_0x5a60,{exit:_0x59d912}=useApp(),[_0x3f02d6,_0x3cd5c2]=useState(![]),[_0x4478dc,_0x32e447]=useState(![]),[_0x39f641,_0x3f2915]=useState(null),[_0x17d4c4,_0x22d88d]=useState(null),_0xe7f14b=readConfig(),_0x24b7a8=_0x3402b1||_0xe7f14b?.[_0x1a7345(0x128)],_0x1eeff3=typeof _0xe7f14b?.['env']===_0x1a7345(0x11b)?_0xe7f14b[_0x1a7345(0x137)]:undefined,_0x208e26=_0x3a20be||_0x1eeff3||_0x1a7345(0x101);initEnv(_0x208e26);const _0x2801af=_0x2f062a||_0x1a7345(0x12a),_0x2e07a3=_0x3402b1&&_0x3402b1[_0x1a7345(0x10e)]('-')?_0x3402b1[_0x1a7345(0x110)]('-')[_0x1a7345(0x118)](0x1)[_0x1a7345(0x112)]('-'):'',_0x4b50c6=_0x3402b1?_0x1a7345(0x11a)+_0x24b7a8:_0x1a7345(0x127)+_0x24b7a8,_0x429dec=_0x2e07a3?_0x2e07a3+'-api':'api',_0x5936b2=_0x2e07a3?_0x2e07a3+_0x1a7345(0x12f):_0x1a7345(0x121);useEffect(()=>{_0x3cd5c2(!![]),_0x24286b();},[]),useEffect(()=>{(_0x4478dc||_0x39f641)&&_0x59d912();},[_0x4478dc,_0x39f641,_0x59d912]);async function _0x24286b(){const _0x1976ca=_0x1a7345;if(!_0x24b7a8){_0x3f2915(_0x1976ca(0x113));return;}try{logger['setLogPath'](process[_0x1976ca(0x100)]());const _0x365c65=await fetch(getApiDomain()+_0x1976ca(0x10c)+_0x24b7a8+'&pageSize=999&currentPage=1',{'headers':{'Cookie':getCookie()}});if(_0x365c65['ok']){const _0x927180=await _0x365c65[_0x1976ca(0x136)]();if(_0x927180[_0x1976ca(0x12d)]){const _0x5c5979=!_0x3402b1;await generateApiFile(_0x927180[_0x1976ca(0x105)][_0x1976ca(0x133)],_0x2e07a3,_0x24b7a8,_0x5c5979,_0x208e26,_0x2801af);const _0x4e2603=_0x2801af[_0x1976ca(0x11d)]('/')?_0x2801af:_0x2801af+'/';_0x22d88d({'api':''+_0x4e2603+_0x429dec+_0x1976ca(0x11f),'client':''+_0x4e2603+_0x5936b2+_0x1976ca(0x11f)}),_0x32e447(!![]);}}else{if(_0x365c65[_0x1976ca(0x125)]===0x191){const _0x41d677=_0x1976ca(0xfe);logger[_0x1976ca(0xff)](_0x1976ca(0x115),_0x41d677,{'status':_0x365c65[_0x1976ca(0x125)],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)]}),_0x3f2915(_0x41d677);}else{const _0x710f1=_0x1976ca(0x103)+_0x365c65[_0x1976ca(0x125)];try{const _0x129233=await _0x365c65[_0x1976ca(0x104)]();_0x129233?logger[_0x1976ca(0xff)](_0x1976ca(0x115),_0x710f1,{'status':_0x365c65[_0x1976ca(0x125)],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)],'errorBody':_0x129233}):logger[_0x1976ca(0xff)]('api-pull',_0x710f1,{'status':_0x365c65[_0x1976ca(0x125)],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)]});}catch(_0x57a806){logger[_0x1976ca(0xff)](_0x1976ca(0x115),_0x710f1+_0x1976ca(0x11c),{'status':_0x365c65['status'],'appCode':_0x24b7a8,'url':_0x365c65[_0x1976ca(0x134)],'readError':_0x57a806 instanceof Error?_0x57a806[_0x1976ca(0x12e)]:String(_0x57a806)});}_0x3f2915(_0x710f1);}}}catch(_0x3c1930){const _0x392511=_0x3c1930 instanceof Error?_0x3c1930[_0x1976ca(0x12e)]:String(_0x3c1930);_0x3f2915(_0x1976ca(0x11e)+_0x392511);}finally{_0x3cd5c2(![]);}}return a3_0x3743db(Box,{'flexDirection':'column','children':[a3_0x3743db(Box,{'children':[a3_0x323b6c(Text,{'color':_0x1a7345(0x119),'children':'*\x20'}),a3_0x323b6c(Text,{'color':_0x3402b1?_0x1a7345(0x106):'dim','children':_0x4b50c6})]}),a3_0x3743db(Box,{'children':[a3_0x323b6c(Text,{'color':_0x1a7345(0x119),'children':_0x1a7345(0x10b)}),a3_0x3743db(Text,{'color':_0x1a7345(0x114),'children':[_0x429dec,_0x1a7345(0x11f)]}),a3_0x323b6c(Text,{'color':'dim','children':_0x1a7345(0x10d)}),a3_0x3743db(Text,{'color':_0x1a7345(0x114),'children':[_0x5936b2,_0x1a7345(0x11f)]})]}),_0x3f02d6&&a3_0x323b6c(Box,{'children':a3_0x3743db(Text,{'children':[_0x1a7345(0x124),_0x208e26,')']})}),_0x4478dc&&_0x17d4c4&&a3_0x3743db(Box,{'flexDirection':_0x1a7345(0x117),'children':[a3_0x323b6c(Box,{'children':a3_0x323b6c(Text,{'color':_0x1a7345(0x132),'children':'√\x20API\x20文件生成成功!'})}),a3_0x323b6c(Box,{'marginTop':0x1,'children':a3_0x323b6c(Text,{'color':'gray','children':_0x1a7345(0x107)})}),a3_0x3743db(Box,{'marginLeft':0x2,'children':[a3_0x3743db(Text,{'color':_0x1a7345(0x114),'children':['•\x20',_0x17d4c4[_0x1a7345(0x116)]]}),a3_0x323b6c(Text,{'color':_0x1a7345(0x10a),'children':_0x1a7345(0x131)})]}),a3_0x3743db(Box,{'marginLeft':0x2,'children':[a3_0x3743db(Text,{'color':'cyan','children':['•\x20',_0x17d4c4[_0x1a7345(0x121)]]}),a3_0x323b6c(Text,{'color':_0x1a7345(0x10a),'children':'\x20-\x20客户端实例文件'})]}),a3_0x323b6c(Box,{'marginTop':0x1,'children':a3_0x323b6c(Text,{'color':_0x1a7345(0x119),'children':'*\x20导入方式:'})}),a3_0x323b6c(Box,{'marginLeft':0x2,'children':a3_0x3743db(Text,{'color':_0x1a7345(0x109),'children':[_0x1a7345(0x130),'{\x20lovrabetClient\x20}',_0x1a7345(0x126),_0x17d4c4['client'][_0x1a7345(0xfd)](/^\.\//,'')['replace'](/^src\//,'')[_0x1a7345(0xfd)]('.ts',''),'\x27']})})]}),_0x39f641&&a3_0x3743db(Box,{'flexDirection':_0x1a7345(0x117),'children':[a3_0x323b6c(Box,{'children':a3_0x3743db(Text,{'color':'red','children':['❌\x20',_0x39f641]})}),_0x39f641['includes']('登录')&&a3_0x3743db(Box,{'marginTop':0x1,'children':[a3_0x323b6c(Text,{'color':_0x1a7345(0x109),'children':_0x1a7345(0x102)}),a3_0x323b6c(Text,{'color':_0x1a7345(0x114),'children':_0x1a7345(0x12c)}),a3_0x323b6c(Text,{'color':_0x1a7345(0x109),'children':'\x20重新登录后再试'})]})]})]});};
1
+ (function(_0x3de300,_0x5b7d20){const _0x1f06af=a3_0xf095,_0x6a04e5=_0x3de300();while(!![]){try{const _0x258521=parseInt(_0x1f06af(0x14d))/0x1+parseInt(_0x1f06af(0x169))/0x2+parseInt(_0x1f06af(0x177))/0x3+-parseInt(_0x1f06af(0x15f))/0x4*(-parseInt(_0x1f06af(0x14b))/0x5)+-parseInt(_0x1f06af(0x147))/0x6*(parseInt(_0x1f06af(0x168))/0x7)+parseInt(_0x1f06af(0x164))/0x8+-parseInt(_0x1f06af(0x157))/0x9*(parseInt(_0x1f06af(0x15d))/0xa);if(_0x258521===_0x5b7d20)break;else _0x6a04e5['push'](_0x6a04e5['shift']());}catch(_0x31fb58){_0x6a04e5['push'](_0x6a04e5['shift']());}}}(a3_0x4302,0xf0968));import{jsx as a3_0x239839,jsxs as a3_0x2c8b61}from'react/jsx-runtime';import{useEffect,useState}from'react';function a3_0x4302(){const _0x560483=['29784663uMMxqu','api-pull','success','green','拉取\x20API\x20配置失败:\x20','cyan','10OFgXzA','使用指定的应用AppCode:\x20','1535188YwGowy','status',',且无法读取错误响应内容','string','replace','1057160IdmdWQ','slice','.ts','message','5572021SaZAAK','3761592Drwszk','💡\x20请使用\x20','data','white','split','env','\x20-\x20客户端实例文件','tableData','未提供应用AppCode,且配置中也没有默认值','url','dim','api','yellow','🚀\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','3133935uptdzw','-client','setLogPath','\x20和\x20','\x20-\x20模型配置文件','-api','includes','import\x20','12sJeDOE','red','\x20重新登录后再试','client','25hkywhz','√\x20API\x20文件生成成功!','910290szWblG','&pageSize=999&currentPage=1','gray','error','lovrabet\x20auth','online','获取数据集失败,HTTP状态码:\x20','/smartapi/dataset/getList?appCode=','app','column'];a3_0x4302=function(){return _0x560483;};return a3_0x4302();}import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{initEnv}from'../constant/env.js';function a3_0xf095(_0x59a2a4,_0x3a331f){const _0x430237=a3_0x4302();return a3_0xf095=function(_0xf09505,_0x4402ab){_0xf09505=_0xf09505-0x147;let _0x262626=_0x430237[_0xf09505];return _0x262626;},a3_0xf095(_0x59a2a4,_0x3a331f);}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x4c33c6,env:_0x2e9dcb,output:_0x5f03f1})=>{const _0x31547c=a3_0xf095,{exit:_0x22e97c}=useApp(),[_0xdcf659,_0x52c032]=useState(![]),[_0x51fa5d,_0x495b07]=useState(![]),[_0xe13024,_0x22819b]=useState(null),[_0x26bcca,_0x32a584]=useState(null),_0x22e576=readConfig(),_0x458797=_0x4c33c6||_0x22e576?.[_0x31547c(0x155)],_0x48aa9b=typeof _0x22e576?.[_0x31547c(0x16e)]===_0x31547c(0x162)?_0x22e576[_0x31547c(0x16e)]:undefined,_0x755727=_0x2e9dcb||_0x48aa9b||_0x31547c(0x152);initEnv(_0x755727);const _0x411917=_0x5f03f1||'./src/api/',_0x3c10e5=_0x4c33c6&&_0x4c33c6[_0x31547c(0x17d)]('-')?_0x4c33c6[_0x31547c(0x16d)]('-')[_0x31547c(0x165)](0x1)['join']('-'):'',_0x3dc67f=_0x4c33c6?_0x31547c(0x15e)+_0x458797:'使用配置的应用AppCode:\x20'+_0x458797,_0x14484=_0x3c10e5?_0x3c10e5+_0x31547c(0x17c):_0x31547c(0x174),_0x4b3550=_0x3c10e5?_0x3c10e5+_0x31547c(0x178):'client';useEffect(()=>{_0x52c032(!![]),_0x2af923();},[]),useEffect(()=>{(_0x51fa5d||_0xe13024)&&_0x22e97c();},[_0x51fa5d,_0xe13024,_0x22e97c]);async function _0x2af923(){const _0x2e71d1=_0x31547c;if(!_0x458797){_0x22819b(_0x2e71d1(0x171));return;}try{logger[_0x2e71d1(0x179)](process['cwd']());const _0x25258f=await fetch(getApiDomain()+_0x2e71d1(0x154)+_0x458797+_0x2e71d1(0x14e),{'headers':{'Cookie':getCookie()}});if(_0x25258f['ok']){const _0x473a56=await _0x25258f['json']();if(_0x473a56[_0x2e71d1(0x159)]){const _0x2d1c6c=!_0x4c33c6;await generateApiFile(_0x473a56[_0x2e71d1(0x16b)][_0x2e71d1(0x170)],_0x3c10e5,_0x458797,_0x2d1c6c,_0x755727,_0x411917);const _0x3e9c33=_0x411917['endsWith']('/')?_0x411917:_0x411917+'/';_0x32a584({'api':''+_0x3e9c33+_0x14484+'.ts','client':''+_0x3e9c33+_0x4b3550+_0x2e71d1(0x166)}),_0x495b07(!![]);}}else{if(_0x25258f[_0x2e71d1(0x160)]===0x191){const _0x424b9b='登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录';logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x424b9b,{'status':_0x25258f[_0x2e71d1(0x160)],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)]}),_0x22819b(_0x424b9b);}else{const _0x2e1e1=_0x2e71d1(0x153)+_0x25258f[_0x2e71d1(0x160)];try{const _0x57c04f=await _0x25258f['text']();_0x57c04f?logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x2e1e1,{'status':_0x25258f['status'],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)],'errorBody':_0x57c04f}):logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x2e1e1,{'status':_0x25258f[_0x2e71d1(0x160)],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)]});}catch(_0x35b19f){logger[_0x2e71d1(0x150)](_0x2e71d1(0x158),_0x2e1e1+_0x2e71d1(0x161),{'status':_0x25258f[_0x2e71d1(0x160)],'appCode':_0x458797,'url':_0x25258f[_0x2e71d1(0x172)],'readError':_0x35b19f instanceof Error?_0x35b19f[_0x2e71d1(0x167)]:String(_0x35b19f)});}_0x22819b(_0x2e1e1);}}}catch(_0x37fac8){const _0x1ceb65=_0x37fac8 instanceof Error?_0x37fac8[_0x2e71d1(0x167)]:String(_0x37fac8);_0x22819b(_0x2e71d1(0x15b)+_0x1ceb65);}finally{_0x52c032(![]);}}return a3_0x2c8b61(Box,{'flexDirection':_0x31547c(0x156),'children':[a3_0x2c8b61(Box,{'children':[a3_0x239839(Text,{'color':_0x31547c(0x14f),'children':'*\x20'}),a3_0x239839(Text,{'color':_0x4c33c6?_0x31547c(0x16c):_0x31547c(0x173),'children':_0x3dc67f})]}),a3_0x2c8b61(Box,{'children':[a3_0x239839(Text,{'color':_0x31547c(0x14f),'children':'*\x20将生成文件:\x20'}),a3_0x2c8b61(Text,{'color':'cyan','children':[_0x14484,_0x31547c(0x166)]}),a3_0x239839(Text,{'color':'dim','children':_0x31547c(0x17a)}),a3_0x2c8b61(Text,{'color':_0x31547c(0x15c),'children':[_0x4b3550,_0x31547c(0x166)]})]}),_0xdcf659&&a3_0x239839(Box,{'children':a3_0x2c8b61(Text,{'children':[_0x31547c(0x176),_0x755727,')']})}),_0x51fa5d&&_0x26bcca&&a3_0x2c8b61(Box,{'flexDirection':'column','children':[a3_0x239839(Box,{'children':a3_0x239839(Text,{'color':_0x31547c(0x15a),'children':_0x31547c(0x14c)})}),a3_0x239839(Box,{'marginTop':0x1,'children':a3_0x239839(Text,{'color':'gray','children':'*\x20已生成文件:'})}),a3_0x2c8b61(Box,{'marginLeft':0x2,'children':[a3_0x2c8b61(Text,{'color':_0x31547c(0x15c),'children':['•\x20',_0x26bcca['api']]}),a3_0x239839(Text,{'color':_0x31547c(0x173),'children':_0x31547c(0x17b)})]}),a3_0x2c8b61(Box,{'marginLeft':0x2,'children':[a3_0x2c8b61(Text,{'color':_0x31547c(0x15c),'children':['•\x20',_0x26bcca[_0x31547c(0x14a)]]}),a3_0x239839(Text,{'color':_0x31547c(0x173),'children':_0x31547c(0x16f)})]}),a3_0x239839(Box,{'marginTop':0x1,'children':a3_0x239839(Text,{'color':_0x31547c(0x14f),'children':'*\x20导入方式:'})}),a3_0x239839(Box,{'marginLeft':0x2,'children':a3_0x2c8b61(Text,{'color':_0x31547c(0x175),'children':[_0x31547c(0x17e),'{\x20lovrabetClient\x20}','\x20from\x20\x27@/',_0x26bcca[_0x31547c(0x14a)][_0x31547c(0x163)](/^\.\//,'')[_0x31547c(0x163)](/^src\//,'')['replace'](_0x31547c(0x166),''),'\x27']})})]}),_0xe13024&&a3_0x2c8b61(Box,{'flexDirection':_0x31547c(0x156),'children':[a3_0x239839(Box,{'children':a3_0x2c8b61(Text,{'color':_0x31547c(0x148),'children':['❌\x20',_0xe13024]})}),_0xe13024['includes']('登录')&&a3_0x2c8b61(Box,{'marginTop':0x1,'children':[a3_0x239839(Text,{'color':_0x31547c(0x175),'children':_0x31547c(0x16a)}),a3_0x239839(Text,{'color':_0x31547c(0x15c),'children':_0x31547c(0x151)}),a3_0x239839(Text,{'color':_0x31547c(0x175),'children':_0x31547c(0x149)})]})]})]});};
@@ -1 +1 @@
1
- function a4_0x2dba(_0x3e00c6,_0x449fc4){const _0x3589e0=a4_0x3589();return a4_0x2dba=function(_0x2dba6f,_0x4a50cd){_0x2dba6f=_0x2dba6f-0x9b;let _0x177b08=_0x3589e0[_0x2dba6f];return _0x177b08;},a4_0x2dba(_0x3e00c6,_0x449fc4);}function a4_0x3589(){const _0x2da101=['dbtableConfig','2032430qRVVCN','dataset','code','set','allFields','get','156MvtIGd','toUpperCase','map','trim','filter','forEach','88320FxhijU','2jmmXmA','118966YLfcPc','split','name','values','750332ieFxmN','tableName','dataset_','Api','946845JPLkVT','1179626gZIinx','16UNEdkI','replace','755HtbFCa'];a4_0x3589=function(){return _0x2da101;};return a4_0x3589();}(function(_0x4b1ca2,_0x28fb6e){const _0x518609=a4_0x2dba,_0x2471a2=_0x4b1ca2();while(!![]){try{const _0x241486=parseInt(_0x518609(0xad))/0x1*(parseInt(_0x518609(0xae))/0x2)+-parseInt(_0x518609(0xac))/0x3+parseInt(_0x518609(0xb2))/0x4+parseInt(_0x518609(0x9e))/0x5*(parseInt(_0x518609(0xa6))/0x6)+-parseInt(_0x518609(0x9b))/0x7+parseInt(_0x518609(0x9c))/0x8*(-parseInt(_0x518609(0xb6))/0x9)+parseInt(_0x518609(0xa0))/0xa;if(_0x241486===_0x28fb6e)break;else _0x2471a2['push'](_0x2471a2['shift']());}catch(_0x40b674){_0x2471a2['push'](_0x2471a2['shift']());}}}(a4_0x3589,0x19b86));export function formatDataset(_0x4ebf31){const _0x39b06e=a4_0x2dba,_0x68dae7=_0x4ebf31[_0x39b06e(0xaa)](_0x56c72=>_0x56c72[_0x39b06e(0x9f)]),_0x45fdd5=_0x4ebf31[_0x39b06e(0xaa)](_0x8dbed5=>!_0x8dbed5['dbtableConfig']),_0x14d256=new Map();_0x68dae7[_0x39b06e(0xab)](_0x5dec25=>{const _0x390fee=_0x39b06e,_0x35ccb0=_0x5dec25['dbtableConfig'][_0x390fee(0xb3)],_0x6f258c=_0x14d256[_0x390fee(0xa5)](_0x35ccb0);(!_0x6f258c||_0x5dec25['id']>_0x6f258c['id'])&&_0x14d256[_0x390fee(0xa3)](_0x35ccb0,_0x5dec25);});const _0x108c3f=Array['from'](_0x14d256[_0x39b06e(0xb1)]())[_0x39b06e(0xa8)](_0xe307f8=>{const _0x4f0372=_0x39b06e,_0x27e1d6=snakeToCamel(_0xe307f8[_0x4f0372(0x9f)][_0x4f0372(0xb3)]);return{'id':_0xe307f8['id'],'name':_0xe307f8['name'],'code':_0xe307f8[_0x4f0372(0xa2)],'tableName':_0xe307f8[_0x4f0372(0x9f)][_0x4f0372(0xb3)],'apiFucName':_0x27e1d6?_0x27e1d6+_0x4f0372(0xb5):'dataset'+_0xe307f8['code']+_0x4f0372(0xb5),'pkField':_0xe307f8[_0x4f0372(0x9f)]['pkField'],'allFields':_0xe307f8[_0x4f0372(0x9f)][_0x4f0372(0xa4)][_0x4f0372(0xaf)](',')};}),_0x22e53e=_0x45fdd5[_0x39b06e(0xa8)](_0x445340=>{const _0x3bf04e=_0x39b06e,_0x13240b=_0x3bf04e(0xb4)+_0x445340[_0x3bf04e(0xa2)],_0x4e686b=snakeToCamel(_0x13240b);return{'id':_0x445340['id'],'name':_0x445340[_0x3bf04e(0xb0)],'code':_0x445340[_0x3bf04e(0xa2)],'tableName':_0x13240b,'apiFucName':_0x4e686b?_0x4e686b+_0x3bf04e(0xb5):_0x3bf04e(0xa1)+_0x445340[_0x3bf04e(0xa2)]+_0x3bf04e(0xb5),'pkField':undefined,'allFields':[]};});return[..._0x108c3f,..._0x22e53e];}function snakeToCamel(_0x55fbec){const _0x2ed199=a4_0x2dba;if(!_0x55fbec)return _0x55fbec;const _0x6640ef=_0x55fbec[_0x2ed199(0xa9)]();return _0x6640ef[_0x2ed199(0x9d)](/_([a-zA-Z0-9])/g,(_0x487e36,_0xf179c9)=>_0xf179c9[_0x2ed199(0xa7)]());}
1
+ (function(_0x4f8d33,_0x3e20c4){const _0x15b885=a4_0x3651,_0x2d3c76=_0x4f8d33();while(!![]){try{const _0x343edb=-parseInt(_0x15b885(0x1b8))/0x1+-parseInt(_0x15b885(0x1a8))/0x2*(-parseInt(_0x15b885(0x1b9))/0x3)+parseInt(_0x15b885(0x1b1))/0x4*(-parseInt(_0x15b885(0x1b5))/0x5)+parseInt(_0x15b885(0x1ae))/0x6+parseInt(_0x15b885(0x1c2))/0x7*(-parseInt(_0x15b885(0x1ac))/0x8)+parseInt(_0x15b885(0x1a9))/0x9+parseInt(_0x15b885(0x1b6))/0xa;if(_0x343edb===_0x3e20c4)break;else _0x2d3c76['push'](_0x2d3c76['shift']());}catch(_0xb69836){_0x2d3c76['push'](_0x2d3c76['shift']());}}}(a4_0x54cd,0xa8985));function a4_0x3651(_0x2a6a2b,_0x47cd1d){const _0x54cdf9=a4_0x54cd();return a4_0x3651=function(_0x36511b,_0x33fcae){_0x36511b=_0x36511b-0x1a6;let _0x5231f6=_0x54cdf9[_0x36511b];return _0x5231f6;},a4_0x3651(_0x2a6a2b,_0x47cd1d);}export function formatDataset(_0xdc08e7){const _0x198e0c=a4_0x3651,_0x383404=_0xdc08e7[_0x198e0c(0x1ad)](_0x2d12a5=>_0x2d12a5[_0x198e0c(0x1bc)]),_0x155f69=_0xdc08e7[_0x198e0c(0x1ad)](_0x440c7c=>!_0x440c7c['dbtableConfig']),_0x92fbd1=new Map();_0x383404[_0x198e0c(0x1b7)](_0x44879e=>{const _0x378b92=_0x198e0c,_0x1c019c=_0x44879e[_0x378b92(0x1bc)][_0x378b92(0x1c1)],_0x36fb8c=_0x92fbd1[_0x378b92(0x1b2)](_0x1c019c);(!_0x36fb8c||_0x44879e['id']>_0x36fb8c['id'])&&_0x92fbd1[_0x378b92(0x1bd)](_0x1c019c,_0x44879e);});const _0x3b225d=Array['from'](_0x92fbd1[_0x198e0c(0x1a6)]())[_0x198e0c(0x1b0)](_0x236564=>{const _0x5e35de=_0x198e0c,_0x2091d3=snakeToCamel(_0x236564[_0x5e35de(0x1bc)][_0x5e35de(0x1c1)]);return{'id':_0x236564['id'],'name':_0x236564[_0x5e35de(0x1aa)],'code':_0x236564[_0x5e35de(0x1af)],'tableName':_0x236564['dbtableConfig'][_0x5e35de(0x1c1)],'apiFucName':_0x2091d3?_0x2091d3+_0x5e35de(0x1bf):'dataset'+_0x236564[_0x5e35de(0x1af)]+_0x5e35de(0x1bf),'pkField':_0x236564[_0x5e35de(0x1bc)][_0x5e35de(0x1b4)],'allFields':_0x236564['dbtableConfig'][_0x5e35de(0x1b3)][_0x5e35de(0x1a7)](',')};}),_0x192f62=_0x155f69['map'](_0x242778=>{const _0x67e39c=_0x198e0c,_0x5bbcd5=_0x67e39c(0x1ba)+_0x242778[_0x67e39c(0x1af)],_0x2efd2e=snakeToCamel(_0x5bbcd5);return{'id':_0x242778['id'],'name':_0x242778[_0x67e39c(0x1aa)],'code':_0x242778[_0x67e39c(0x1af)],'tableName':_0x5bbcd5,'apiFucName':_0x2efd2e?_0x2efd2e+_0x67e39c(0x1bf):_0x67e39c(0x1bb)+_0x242778['code']+_0x67e39c(0x1bf),'pkField':undefined,'allFields':[]};});return[..._0x3b225d,..._0x192f62];}function a4_0x54cd(){const _0x232221=['toUpperCase','tableName','648683MFDREC','values','split','4kpokRv','2225484NRPkry','name','trim','24ZXNKKx','filter','549426UoKhnn','code','map','2620172dpnCWN','get','allFields','pkField','5DUdiCF','18812460TRZVBm','forEach','851224VYMhwb','382119sTQOvF','dataset_','dataset','dbtableConfig','set','replace','Api'];a4_0x54cd=function(){return _0x232221;};return a4_0x54cd();}function snakeToCamel(_0x3ce49f){const _0xc7fa22=a4_0x3651;if(!_0x3ce49f)return _0x3ce49f;const _0x574fd5=_0x3ce49f[_0xc7fa22(0x1ab)]();return _0x574fd5[_0xc7fa22(0x1be)](/_([a-zA-Z0-9])/g,(_0x4fa6cd,_0x1b96cf)=>_0x1b96cf[_0xc7fa22(0x1c0)]());}
@@ -1 +1 @@
1
- const a5_0x497cd3=a5_0x3bac;(function(_0x1df8c6,_0x1428f0){const _0x4aad75=a5_0x3bac,_0x9302f6=_0x1df8c6();while(!![]){try{const _0x2d40b9=-parseInt(_0x4aad75(0x119))/0x1*(-parseInt(_0x4aad75(0x122))/0x2)+parseInt(_0x4aad75(0x107))/0x3*(-parseInt(_0x4aad75(0x106))/0x4)+-parseInt(_0x4aad75(0x12c))/0x5+parseInt(_0x4aad75(0x102))/0x6*(parseInt(_0x4aad75(0x11f))/0x7)+-parseInt(_0x4aad75(0x115))/0x8*(parseInt(_0x4aad75(0x10a))/0x9)+-parseInt(_0x4aad75(0x125))/0xa*(-parseInt(_0x4aad75(0x120))/0xb)+parseInt(_0x4aad75(0x128))/0xc*(-parseInt(_0x4aad75(0x127))/0xd);if(_0x2d40b9===_0x1428f0)break;else _0x9302f6['push'](_0x9302f6['shift']());}catch(_0x1435ab){_0x9302f6['push'](_0x9302f6['shift']());}}}(a5_0x1f11,0xcd942));import a5_0x174ee0 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x17faf3 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';function a5_0x3bac(_0x2f0a79,_0x2d1ced){const _0x1f1109=a5_0x1f11();return a5_0x3bac=function(_0x3bac2d,_0x15b063){_0x3bac2d=_0x3bac2d-0xff;let _0x4aad8a=_0x1f1109[_0x3bac2d];return _0x4aad8a;},a5_0x3bac(_0x2f0a79,_0x2d1ced);}import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';function a5_0x1f11(){const _0x2430e6=['url','\x20个模型)','client','4446070LerLVx','API\x20文件生成成功!','resolve','format','api','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','dirname','apiFucName','9549984HTxqMx','online','./src/api/','\x22\x20}','244Awfjbr','27051ABLIzx','.ts','length','9PsRzce','CONFIG_NAMES.DEFAULT','-client','replace','code','slice','utf8','string','keys','{\x20apiConfigName:\x20','templates/generate-api','7720408pyjdma','tableName','api.ts.tpl','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/','1uIogaw','typescript','../..','endsWith','app','join','7iqitgh','10038523DlKptA','\x20\x20\x20•\x20','1840502InElPp','env','log','10oIjsFE',',\x20env:\x20\x22','105274UwRwlJ','264fBMxkx'];a5_0x1f11=function(){return _0x2430e6;};return a5_0x1f11();}import{logger}from'../utils/logger.js';export async function generateApiFile(_0x432935,_0x241e99='',_0x1cecbe,_0x542e9e=![],_0x3ab604,_0x4a6586=a5_0x497cd3(0x104)){const _0x5b482d=a5_0x497cd3,_0x5ea918=readConfig(),_0x19676b=_0x1cecbe||_0x5ea918?.[_0x5b482d(0x11d)];if(typeof _0x19676b!==_0x5b482d(0x111)||!_0x19676b)throw new Error(_0x5b482d(0xff));const _0x53e6c6=_0x542e9e?_0x5b482d(0x10b):'\x22'+_0x19676b+'\x22',_0x2cc0c4=typeof _0x5ea918[_0x5b482d(0x123)]===_0x5b482d(0x111)?_0x5ea918['env']:undefined,_0x36d66d=_0x3ab604||_0x2cc0c4||'online',_0xcdacf0=_0x36d66d!==_0x5b482d(0x103);let _0x146b4b;if(_0x542e9e)_0xcdacf0?_0x146b4b=_0x5b482d(0x113)+_0x53e6c6+_0x5b482d(0x126)+_0x36d66d+_0x5b482d(0x105):_0x146b4b='';else{const _0x69b8d3=_0xcdacf0?_0x5b482d(0x126)+_0x36d66d+'\x22':'';_0x146b4b='{\x20apiConfigName:\x20\x22'+_0x19676b+'\x22'+_0x69b8d3+'\x20}';}const _0x5b4782=_0x241e99?_0x241e99+'-api':_0x5b482d(0x130),_0x3611c2=_0x241e99?_0x241e99+_0x5b482d(0x10c):_0x5b482d(0x12b),_0x2c2231=formatDataset(_0x432935),_0x1dcc50={};_0x2c2231['forEach'](_0x9e01c1=>{const _0x4df0f9=_0x5b482d,_0x1adc21=_0x9e01c1[_0x4df0f9(0x101)][_0x4df0f9(0x10d)](/Api$/,''),_0x14eb6c=_0x1adc21['charAt'](0x0)['toUpperCase']()+_0x1adc21[_0x4df0f9(0x10f)](0x1);_0x1dcc50[_0x14eb6c]={'tableName':_0x9e01c1[_0x4df0f9(0x116)],'datasetCode':_0x9e01c1[_0x4df0f9(0x10e)]};});const _0x4ff11c=fileURLToPath(import.meta[_0x5b482d(0x129)]),_0x50afeb=a5_0x17faf3[_0x5b482d(0x12e)](a5_0x17faf3[_0x5b482d(0x100)](_0x4ff11c),_0x5b482d(0x11b)),_0x53e496=a5_0x17faf3[_0x5b482d(0x11e)](_0x50afeb,_0x5b482d(0x114)),_0x330a79=a5_0x17faf3['join'](_0x53e496,_0x5b482d(0x117)),_0x47bdec=a5_0x17faf3[_0x5b482d(0x11e)](_0x53e496,'client.ts.tpl'),_0x5a3feb=_0x4a6586[_0x5b482d(0x11c)]('/')?_0x4a6586[_0x5b482d(0x10f)](0x0,-0x1):_0x4a6586;mkdirSync(_0x5a3feb,{'recursive':!![]});const _0x877e1e=readFileSync(_0x330a79,'utf8'),_0x1ffd50=TemplateReplacer['replaceApiContent'](_0x877e1e,_0x19676b,_0x1dcc50,Object[_0x5b482d(0x112)](_0x1dcc50)[0x0],_0x5b4782,_0x53e6c6),_0x1c7055=await a5_0x174ee0[_0x5b482d(0x12f)](_0x1ffd50,{'parser':_0x5b482d(0x11a)}),_0x29e2f8=_0x5a3feb+'/'+_0x5b4782+_0x5b482d(0x108);writeFileSync(_0x29e2f8,_0x1c7055,{'encoding':_0x5b482d(0x110)});const _0x44f452=readFileSync(_0x47bdec,'utf8'),_0x4ef9c4=TemplateReplacer['replaceApiContent'](_0x44f452,_0x19676b,_0x1dcc50,Object[_0x5b482d(0x112)](_0x1dcc50)[0x0],_0x5b4782,_0x53e6c6,_0x146b4b),_0x98547b=await a5_0x174ee0['format'](_0x4ef9c4,{'parser':_0x5b482d(0x11a)}),_0x453dc5=_0x5a3feb+'/'+_0x3611c2+_0x5b482d(0x108);writeFileSync(_0x453dc5,_0x98547b,{'encoding':_0x5b482d(0x110)}),logger['success']('init-api',_0x5b482d(0x12d)),console['log']('*\x20已生成文件:'),console[_0x5b482d(0x124)](_0x5b482d(0x121)+_0x29e2f8+'\x20-\x20模型配置文件\x20('+Object[_0x5b482d(0x112)](_0x1dcc50)[_0x5b482d(0x109)]+_0x5b482d(0x12a)),console[_0x5b482d(0x124)]('\x20\x20\x20•\x20'+_0x453dc5+'\x20-\x20客户端实例文件'),console[_0x5b482d(0x124)]('*\x20API配置\x20apiConfigName\x20:\x20'+_0x53e6c6);const _0x341fc7=_0x5a3feb[_0x5b482d(0x10d)](/^\.\//,'')[_0x5b482d(0x10d)](/\/$/,'');console['log'](_0x5b482d(0x118)+_0x341fc7+'/'+_0x3611c2+'\x27');}
1
+ const a5_0x1e34e2=a5_0x41f5;(function(_0x1438d0,_0x3aef82){const _0x2d8239=a5_0x41f5,_0x25a755=_0x1438d0();while(!![]){try{const _0x3d3712=parseInt(_0x2d8239(0x15b))/0x1+parseInt(_0x2d8239(0x15c))/0x2+-parseInt(_0x2d8239(0x14b))/0x3+-parseInt(_0x2d8239(0x141))/0x4*(-parseInt(_0x2d8239(0x140))/0x5)+parseInt(_0x2d8239(0x164))/0x6*(-parseInt(_0x2d8239(0x168))/0x7)+-parseInt(_0x2d8239(0x165))/0x8+-parseInt(_0x2d8239(0x166))/0x9;if(_0x3d3712===_0x3aef82)break;else _0x25a755['push'](_0x25a755['shift']());}catch(_0x1a466b){_0x25a755['push'](_0x25a755['shift']());}}}(a5_0x19d6,0xf3fdd));import a5_0x163c1e from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';import a5_0x4e0317 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';function a5_0x41f5(_0x2afff8,_0x40e673){const _0x19d69d=a5_0x19d6();return a5_0x41f5=function(_0x41f534,_0x30d88d){_0x41f534=_0x41f534-0x140;let _0x5c4d82=_0x19d69d[_0x41f534];return _0x5c4d82;},a5_0x41f5(_0x2afff8,_0x40e673);}import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';function a5_0x19d6(){const _0xe6eb2f=['.ts','{\x20apiConfigName:\x20','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','env','templates/generate-api','client.ts.tpl','-client','667270efFUJA','1778610ZQuMxP','string','client','replace','code','slice','\x20-\x20模型配置文件\x20(','\x20个模型)','208668IpemYX','6782848XdPvXW','9101511bdhNpG','\x20\x20\x20•\x20','7aSPjDb','tableName','6809555fJUzGV','4zyIRqJ','success','init-api','\x20-\x20客户端实例文件','CONFIG_NAMES.DEFAULT','log','API\x20文件生成成功!','./src/api/','online','typescript','75552iBRbMu','join',',\x20env:\x20\x22','../..','forEach','keys','utf8','replaceApiContent','charAt'];a5_0x19d6=function(){return _0xe6eb2f;};return a5_0x19d6();}export async function generateApiFile(_0x258630,_0x40014e='',_0x485c25,_0x5be7f8=![],_0x422e2e,_0x62c4d4=a5_0x1e34e2(0x148)){const _0x206e4a=a5_0x1e34e2,_0x4a91d4=readConfig(),_0x55ca08=_0x485c25||_0x4a91d4?.['app'];if(typeof _0x55ca08!==_0x206e4a(0x15d)||!_0x55ca08)throw new Error(_0x206e4a(0x156));const _0x47e587=_0x5be7f8?_0x206e4a(0x145):'\x22'+_0x55ca08+'\x22',_0x36f80a=typeof _0x4a91d4[_0x206e4a(0x157)]==='string'?_0x4a91d4[_0x206e4a(0x157)]:undefined,_0x367274=_0x422e2e||_0x36f80a||_0x206e4a(0x149),_0x1517f0=_0x367274!=='online';let _0x269b18;if(_0x5be7f8)_0x1517f0?_0x269b18=_0x206e4a(0x155)+_0x47e587+',\x20env:\x20\x22'+_0x367274+'\x22\x20}':_0x269b18='';else{const _0x376228=_0x1517f0?_0x206e4a(0x14d)+_0x367274+'\x22':'';_0x269b18='{\x20apiConfigName:\x20\x22'+_0x55ca08+'\x22'+_0x376228+'\x20}';}const _0x460eb1=_0x40014e?_0x40014e+'-api':'api',_0x4ecb98=_0x40014e?_0x40014e+_0x206e4a(0x15a):_0x206e4a(0x15e),_0xa06d69=formatDataset(_0x258630),_0x4822a9={};_0xa06d69[_0x206e4a(0x14f)](_0x35ece7=>{const _0x4552d5=_0x206e4a,_0x5b4c3c=_0x35ece7['apiFucName'][_0x4552d5(0x15f)](/Api$/,''),_0x5248cd=_0x5b4c3c[_0x4552d5(0x153)](0x0)['toUpperCase']()+_0x5b4c3c[_0x4552d5(0x161)](0x1);_0x4822a9[_0x5248cd]={'tableName':_0x35ece7[_0x4552d5(0x169)],'datasetCode':_0x35ece7[_0x4552d5(0x160)]};});const _0x48188f=fileURLToPath(import.meta['url']),_0x3ffd0a=a5_0x4e0317['resolve'](a5_0x4e0317['dirname'](_0x48188f),_0x206e4a(0x14e)),_0x440b57=a5_0x4e0317[_0x206e4a(0x14c)](_0x3ffd0a,_0x206e4a(0x158)),_0x1141da=a5_0x4e0317[_0x206e4a(0x14c)](_0x440b57,'api.ts.tpl'),_0x225898=a5_0x4e0317[_0x206e4a(0x14c)](_0x440b57,_0x206e4a(0x159)),_0xc3eb9b=_0x62c4d4['endsWith']('/')?_0x62c4d4[_0x206e4a(0x161)](0x0,-0x1):_0x62c4d4;mkdirSync(_0xc3eb9b,{'recursive':!![]});const _0x1830e1=readFileSync(_0x1141da,_0x206e4a(0x151)),_0x1e1e3a=TemplateReplacer[_0x206e4a(0x152)](_0x1830e1,_0x55ca08,_0x4822a9,Object[_0x206e4a(0x150)](_0x4822a9)[0x0],_0x460eb1,_0x47e587),_0x1f7801=await a5_0x163c1e['format'](_0x1e1e3a,{'parser':_0x206e4a(0x14a)}),_0x5709a1=_0xc3eb9b+'/'+_0x460eb1+_0x206e4a(0x154);writeFileSync(_0x5709a1,_0x1f7801,{'encoding':_0x206e4a(0x151)});const _0x3222e0=readFileSync(_0x225898,_0x206e4a(0x151)),_0x4fcb14=TemplateReplacer[_0x206e4a(0x152)](_0x3222e0,_0x55ca08,_0x4822a9,Object[_0x206e4a(0x150)](_0x4822a9)[0x0],_0x460eb1,_0x47e587,_0x269b18),_0x1765d4=await a5_0x163c1e['format'](_0x4fcb14,{'parser':'typescript'}),_0x1389bf=_0xc3eb9b+'/'+_0x4ecb98+'.ts';writeFileSync(_0x1389bf,_0x1765d4,{'encoding':_0x206e4a(0x151)}),logger[_0x206e4a(0x142)](_0x206e4a(0x143),_0x206e4a(0x147)),console[_0x206e4a(0x146)]('*\x20已生成文件:'),console[_0x206e4a(0x146)](_0x206e4a(0x167)+_0x5709a1+_0x206e4a(0x162)+Object[_0x206e4a(0x150)](_0x4822a9)['length']+_0x206e4a(0x163)),console[_0x206e4a(0x146)](_0x206e4a(0x167)+_0x1389bf+_0x206e4a(0x144)),console[_0x206e4a(0x146)]('*\x20API配置\x20apiConfigName\x20:\x20'+_0x47e587);const _0x581969=_0xc3eb9b[_0x206e4a(0x15f)](/^\.\//,'')[_0x206e4a(0x15f)](/\/$/,'');console['log']('*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/'+_0x581969+'/'+_0x4ecb98+'\x27');}
package/lib/api/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x8998b6,_0x44aa6c){const _0x201587=a6_0x3ae3,_0x4fcb9d=_0x8998b6();while(!![]){try{const _0x36607d=parseInt(_0x201587(0x14f))/0x1+parseInt(_0x201587(0x14a))/0x2*(parseInt(_0x201587(0x14e))/0x3)+parseInt(_0x201587(0x152))/0x4+-parseInt(_0x201587(0x153))/0x5+parseInt(_0x201587(0x154))/0x6+parseInt(_0x201587(0x14b))/0x7+parseInt(_0x201587(0x159))/0x8*(-parseInt(_0x201587(0x151))/0x9);if(_0x36607d===_0x44aa6c)break;else _0x4fcb9d['push'](_0x4fcb9d['shift']());}catch(_0x3d4382){_0x4fcb9d['push'](_0x4fcb9d['shift']());}}}(a6_0x353f,0xb295a));import{jsx as a6_0xc600d5}from'react/jsx-runtime';function a6_0x3ae3(_0x14faf0,_0x5bf349){const _0x353f46=a6_0x353f();return a6_0x3ae3=function(_0x3ae34d,_0x1d28bb){_0x3ae34d=_0x3ae34d-0x145;let _0x1a338b=_0x353f46[_0x3ae34d];return _0x1a338b;},a6_0x3ae3(_0x14faf0,_0x5bf349);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a6_0x353f(){const _0x5a8db4=['3pTVeoT','1036458oNezsn','\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配置文件','2452941kPKxjz','5466408tVyhzB','3004185nGeFnx','109506rpIYuP','string','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20指定输出目录(默认:./src/api/)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--help\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\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20--env\x20daily\x20--output\x20./api\x0a','env','56kvmReI','flags','output','error','input','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','❌\x20错误:不再支持位置参数方式','请使用\x20--appcode\x20参数,例如:','appcode','pull','log','exit','1143764nLbBlc','1728783NGvlyH','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','help'];a6_0x353f=function(){return _0x5a8db4;};return a6_0x353f();}export async function apiCli(_0x2b71ad){const _0x9d8cda=a6_0x3ae3,_0x554b5f=_0x2b71ad[_0x9d8cda(0x15d)][0x1];if(_0x2b71ad['flags'][_0x9d8cda(0x14d)]){console[_0x9d8cda(0x148)](_0x9d8cda(0x157));return;}if(_0x554b5f===_0x9d8cda(0x147)){_0x2b71ad['input'][0x2]&&(console[_0x9d8cda(0x15c)](_0x9d8cda(0x15f)),console[_0x9d8cda(0x148)](_0x9d8cda(0x145)),console[_0x9d8cda(0x148)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x2b71ad[_0x9d8cda(0x15d)][0x2]),process[_0x9d8cda(0x149)](0x1));const _0xf3d9c2=_0x2b71ad[_0x9d8cda(0x15a)][_0x9d8cda(0x146)],_0x11847d=typeof _0x2b71ad[_0x9d8cda(0x15a)]['env']===_0x9d8cda(0x155)?_0x2b71ad['flags'][_0x9d8cda(0x158)]:undefined,_0x33d538=_0x2b71ad['flags'][_0x9d8cda(0x15b)];render(a6_0xc600d5(ApiPullUI,{'appCode':_0xf3d9c2,'env':_0x11847d,'output':_0x33d538}));}else console[_0x9d8cda(0x15c)]('Unknown\x20api\x20command:\x20'+_0x554b5f),console['log']('Available\x20commands:'),console[_0x9d8cda(0x148)](_0x9d8cda(0x150)),console[_0x9d8cda(0x148)](_0x9d8cda(0x14c)),console[_0x9d8cda(0x148)](_0x9d8cda(0x15e)),console[_0x9d8cda(0x148)](_0x9d8cda(0x156)),process['exit'](0x1);}
1
+ (function(_0x5ecaa3,_0x4e238d){const _0x3cd966=a6_0x4d0c,_0x2e6479=_0x5ecaa3();while(!![]){try{const _0x1fca95=-parseInt(_0x3cd966(0x65))/0x1*(-parseInt(_0x3cd966(0x7c))/0x2)+parseInt(_0x3cd966(0x80))/0x3+-parseInt(_0x3cd966(0x69))/0x4+-parseInt(_0x3cd966(0x78))/0x5+parseInt(_0x3cd966(0x81))/0x6*(-parseInt(_0x3cd966(0x72))/0x7)+-parseInt(_0x3cd966(0x77))/0x8+parseInt(_0x3cd966(0x75))/0x9*(parseInt(_0x3cd966(0x73))/0xa);if(_0x1fca95===_0x4e238d)break;else _0x2e6479['push'](_0x2e6479['shift']());}catch(_0x2cb869){_0x2e6479['push'](_0x2e6479['shift']());}}}(a6_0x1978,0x7d86a));import{jsx as a6_0x3819f8}from'react/jsx-runtime';function a6_0x4d0c(_0x423fdc,_0x45df98){const _0x1978e3=a6_0x1978();return a6_0x4d0c=function(_0x4d0c56,_0x4d20da){_0x4d0c56=_0x4d0c56-0x64;let _0x295d26=_0x1978e3[_0x4d0c56];return _0x295d26;},a6_0x4d0c(_0x423fdc,_0x45df98);}function a6_0x1978(){const _0x565157=['\x0alovrabet\x20api\x20-\x20API\x20相关操作\x0a\x0a用法:\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x0a选项:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20指定应用代码\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20指定输出目录(默认:./src/api/)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20指定环境(如:daily、online)\x0a\x20\x20--help\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\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20--env\x20daily\x20--output\x20./api\x0a','\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配置文件','appcode','2140240sevEUl','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定环境(如:\x20daily,\x20online)','Available\x20commands:','\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20指定输出目录(默认:\x20./src/api/)','env','help','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode','Unknown\x20api\x20command:\x20','input','7zzaSvq','8675690VenDbU','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20','18CkDPCf','❌\x20错误:不再支持位置参数方式','4209344iqPBph','1726490UnZOzE','请使用\x20--appcode\x20参数,例如:','string','pull','514pCaNGj','flags','log','error','553338nCuxjP','3701934QsfZPL','exit','2405JDmHrn'];a6_0x1978=function(){return _0x565157;};return a6_0x1978();}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';export async function apiCli(_0x1d16d6){const _0xcca91c=a6_0x4d0c,_0x300bcf=_0x1d16d6[_0xcca91c(0x71)][0x1];if(_0x1d16d6['flags'][_0xcca91c(0x6e)]){console[_0xcca91c(0x7e)](_0xcca91c(0x66));return;}if(_0x300bcf===_0xcca91c(0x7b)){_0x1d16d6[_0xcca91c(0x71)][0x2]&&(console[_0xcca91c(0x7f)](_0xcca91c(0x76)),console[_0xcca91c(0x7e)](_0xcca91c(0x79)),console[_0xcca91c(0x7e)](_0xcca91c(0x74)+_0x1d16d6['input'][0x2]),process[_0xcca91c(0x64)](0x1));const _0x50f4be=_0x1d16d6[_0xcca91c(0x7d)][_0xcca91c(0x68)],_0x59099d=typeof _0x1d16d6[_0xcca91c(0x7d)]['env']===_0xcca91c(0x7a)?_0x1d16d6[_0xcca91c(0x7d)][_0xcca91c(0x6d)]:undefined,_0x22994c=_0x1d16d6[_0xcca91c(0x7d)]['output'];render(a6_0x3819f8(ApiPullUI,{'appCode':_0x50f4be,'env':_0x59099d,'output':_0x22994c}));}else console[_0xcca91c(0x7f)](_0xcca91c(0x70)+_0x300bcf),console[_0xcca91c(0x7e)](_0xcca91c(0x6b)),console[_0xcca91c(0x7e)](_0xcca91c(0x67)),console[_0xcca91c(0x7e)](_0xcca91c(0x6f)),console['log'](_0xcca91c(0x6c)),console[_0xcca91c(0x7e)](_0xcca91c(0x6a)),process[_0xcca91c(0x64)](0x1);}
@@ -1 +1 @@
1
- (function(_0x1437ca,_0x2482ff){const _0x25a84f=a7_0x2a24,_0x159dee=_0x1437ca();while(!![]){try{const _0x2ef2c4=parseInt(_0x25a84f(0xb5))/0x1+parseInt(_0x25a84f(0x9e))/0x2+parseInt(_0x25a84f(0xa2))/0x3*(-parseInt(_0x25a84f(0xaf))/0x4)+-parseInt(_0x25a84f(0xa3))/0x5*(-parseInt(_0x25a84f(0x97))/0x6)+parseInt(_0x25a84f(0xb4))/0x7*(parseInt(_0x25a84f(0x99))/0x8)+parseInt(_0x25a84f(0x95))/0x9+-parseInt(_0x25a84f(0xbe))/0xa;if(_0x2ef2c4===_0x2482ff)break;else _0x159dee['push'](_0x159dee['shift']());}catch(_0x133fe3){_0x159dee['push'](_0x159dee['shift']());}}}(a7_0x1953,0xcf2d6));function a7_0x2a24(_0x39d6b6,_0x5be0a4){const _0x195389=a7_0x1953();return a7_0x2a24=function(_0x2a2443,_0x330a39){_0x2a2443=_0x2a2443-0x93;let _0x2518ad=_0x195389[_0x2a2443];return _0x2518ad;},a7_0x2a24(_0x39d6b6,_0x5be0a4);}import{readConfig}from'../utils/config.js';function a7_0x1953(){const _0x224f3e=['data','3vFhctm','20cvkAtX','-client','error','env','×\x20服务器返回错误:','API\x20配置拉取成功:\x20','API\x20配置拉取异常:\x20','length','cwd','.ts\x20-\x20模型配置文件','\x20个数据集...','API\x20配置拉取失败:\x20','1793116CaQokS','未知错误','online','&pageSize=999&currentPage=1','message','273FkAVBn','1454535acKRea','-api',',且无法读取错误响应内容','获取数据集失败,原因:登录鉴权失败,登录已过期','log','test','×\x20API\x20配置拉取异常:','*\x20正在处理\x20','\x20\x20\x20•\x20','42656010odezAi','.ts\x20-\x20客户端实例文件','status','√\x20API\x20配置文件生成完成','/smartapi/dataset/getList?appCode=','string','api','success','1599912FPJzPt','text','1596966oLazqQ','url','326504TizhIT','获取数据集失败,HTTP状态码:\x20','tableData','client','×\x20错误详情:','2547648fcbxXk','create-api-pull','chdir'];a7_0x1953=function(){return _0x224f3e;};return a7_0x1953();}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(_0x2bf723,_0x28a047,_0xd0d7e7,_0x3d4572){const _0x528db2=a7_0x2a24;let _0x47e646;try{const _0x5b23d3=_0x28a047?.['trim']()||'';if(_0x5b23d3){const _0x4553eb=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x4553eb[_0x528db2(0xba)](_0x5b23d3))return console[_0x528db2(0xa5)]('×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。'),![];}_0xd0d7e7&&(_0x47e646=process[_0x528db2(0xab)](),process[_0x528db2(0xa0)](_0xd0d7e7));const _0x34f6f4=readConfig(),_0x15b6fd=typeof _0x34f6f4[_0x528db2(0xa6)]===_0x528db2(0xc3)?_0x34f6f4[_0x528db2(0xa6)]:undefined,_0x40610c=_0x3d4572||_0x15b6fd||_0x528db2(0xb1);initEnv(_0x40610c),console[_0x528db2(0xb9)]('*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20'+_0x40610c+')');const _0x33fdfb=getApiDomain()+_0x528db2(0xc2)+_0x2bf723+_0x528db2(0xb2),_0x4ec561=await httpRequest(_0x33fdfb,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x4ec561['ok']){const _0x3b523c=_0x4ec561['data'];if(_0x3b523c[_0x528db2(0x94)]){const _0x2d61e2=_0x5b23d3?_0x5b23d3+_0x528db2(0xb6):_0x528db2(0x93),_0x3137d7=_0x5b23d3?_0x5b23d3+_0x528db2(0xa4):_0x528db2(0x9c);return console['log']('*\x20开始生成\x20API\x20配置文件:'),console['log'](_0x528db2(0xbd)+_0x2d61e2+_0x528db2(0xac)),console[_0x528db2(0xb9)](_0x528db2(0xbd)+_0x3137d7+_0x528db2(0xbf)),console[_0x528db2(0xb9)](_0x528db2(0xbc)+_0x3b523c[_0x528db2(0xa1)][_0x528db2(0x9b)]['length']+_0x528db2(0xad)),await generateApiFile(_0x3b523c[_0x528db2(0xa1)][_0x528db2(0x9b)],_0x5b23d3,_0x2bf723,!![],_0x40610c),console['log'](_0x528db2(0xc1)),_0xd0d7e7&&logger['info'](_0x528db2(0x9f),_0x528db2(0xa8)+_0x2bf723,{'projectPath':_0xd0d7e7,'appCode':_0x2bf723,'datasetCount':_0x3b523c[_0x528db2(0xa1)]['tableData'][_0x528db2(0xaa)],'filePrefix':_0x5b23d3}),!![];}else return console[_0x528db2(0xa5)](_0x528db2(0xa7),_0x3b523c['message']||'未知错误'),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x528db2(0xae)+(_0x3b523c[_0x528db2(0xb3)]||_0x528db2(0xb0)),{'projectPath':_0xd0d7e7,'appCode':_0x2bf723}),![];}else{if(_0x4ec561[_0x528db2(0xc0)]===0x191){const _0x2ef8d0=_0x528db2(0xb8);console['error']('×\x20'+_0x2ef8d0),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x2ef8d0,{'status':_0x4ec561[_0x528db2(0xc0)],'appCode':_0x2bf723,'url':_0x4ec561[_0x528db2(0x98)],'projectPath':_0xd0d7e7});}else{const _0x1299df=_0x528db2(0x9a)+_0x4ec561[_0x528db2(0xc0)];console['error']('×\x20'+_0x1299df);try{const _0x19a540=await _0x4ec561[_0x528db2(0x96)]();_0x19a540&&console['error'](_0x528db2(0x9d),_0x19a540),_0xd0d7e7&&logger[_0x528db2(0xa5)](_0x528db2(0x9f),_0x1299df,{'status':_0x4ec561['status'],'appCode':_0x2bf723,'url':_0x4ec561[_0x528db2(0x98)],'errorBody':_0x19a540,'projectPath':_0xd0d7e7});}catch(_0x29bfa4){console[_0x528db2(0xa5)]('×\x20无法读取错误响应内容'),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x1299df+_0x528db2(0xb7),{'status':_0x4ec561[_0x528db2(0xc0)],'appCode':_0x2bf723,'url':_0x4ec561[_0x528db2(0x98)],'readError':_0x29bfa4 instanceof Error?_0x29bfa4[_0x528db2(0xb3)]:String(_0x29bfa4),'projectPath':_0xd0d7e7});}}return![];}}catch(_0xc3ef25){const _0x51b212=_0xc3ef25 instanceof Error?_0xc3ef25[_0x528db2(0xb3)]:String(_0xc3ef25);return console[_0x528db2(0xa5)](_0x528db2(0xbb),_0x51b212),_0xd0d7e7&&logger['error'](_0x528db2(0x9f),_0x528db2(0xa9)+_0x51b212,{'appCode':_0x2bf723,'projectPath':_0xd0d7e7}),![];}finally{_0x47e646&&process[_0x528db2(0xa0)](_0x47e646);}}
1
+ (function(_0x11c922,_0x52c266){const _0x210493=a7_0x4769,_0x1dbc99=_0x11c922();while(!![]){try{const _0x20ad43=-parseInt(_0x210493(0x205))/0x1+parseInt(_0x210493(0x1ed))/0x2+-parseInt(_0x210493(0x21b))/0x3+-parseInt(_0x210493(0x1f9))/0x4+-parseInt(_0x210493(0x1f0))/0x5+parseInt(_0x210493(0x1fd))/0x6*(-parseInt(_0x210493(0x206))/0x7)+parseInt(_0x210493(0x1fc))/0x8;if(_0x20ad43===_0x52c266)break;else _0x1dbc99['push'](_0x1dbc99['shift']());}catch(_0x1126dd){_0x1dbc99['push'](_0x1dbc99['shift']());}}}(a7_0x8fe1,0x21c32));import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a7_0x4769(_0x1aa63d,_0x2ddc93){const _0x8fe16a=a7_0x8fe1();return a7_0x4769=function(_0x476965,_0x56dee6){_0x476965=_0x476965-0x1ed;let _0x5ce299=_0x8fe16a[_0x476965];return _0x5ce299;},a7_0x4769(_0x1aa63d,_0x2ddc93);}import{getApiDomain}from'../constant/domain.js';function a7_0x8fe1(){const _0x1cd028=['*\x20开始生成\x20API\x20配置文件:','-client','未知错误','.ts\x20-\x20模型配置文件','&pageSize=999&currentPage=1','status','api','460348GrHOWC','API\x20配置拉取失败:\x20','获取数据集失败,HTTP状态码:\x20','5934072qGzKCt','4146lDkEqP','client','tableData','/smartapi/dataset/getList?appCode=','url','*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','API\x20配置拉取成功:\x20',',且无法读取错误响应内容','118303mCXTWV','2611bZLbYq','create-api-pull','data','-api','×\x20错误详情:','log','string','text','chdir','length','*\x20正在处理\x20','info','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','message','cwd','\x20\x20\x20•\x20','×\x20服务器返回错误:','×\x20API\x20配置拉取异常:','error','获取数据集失败,原因:登录鉴权失败,登录已过期','online','701037wrQikp','env','365434KjVWKr','×\x20无法读取错误响应内容','trim','306870GBtiYa','API\x20配置拉取异常:\x20'];a7_0x8fe1=function(){return _0x1cd028;};return a7_0x8fe1();}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(_0x57f9f8,_0x5ae705,_0x22b0e5,_0x414f6b){const _0x36ff85=a7_0x4769;let _0x584872;try{const _0x58d892=_0x5ae705?.[_0x36ff85(0x1ef)]()||'';if(_0x58d892){const _0x5d37e8=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x5d37e8['test'](_0x58d892))return console['error'](_0x36ff85(0x212)),![];}_0x22b0e5&&(_0x584872=process[_0x36ff85(0x214)](),process[_0x36ff85(0x20e)](_0x22b0e5));const _0xf28bb8=readConfig(),_0x27ad53=typeof _0xf28bb8[_0x36ff85(0x21c)]===_0x36ff85(0x20c)?_0xf28bb8[_0x36ff85(0x21c)]:undefined,_0x5575c2=_0x414f6b||_0x27ad53||_0x36ff85(0x21a);initEnv(_0x5575c2),console[_0x36ff85(0x20b)](_0x36ff85(0x202)+_0x5575c2+')');const _0x560ffb=getApiDomain()+_0x36ff85(0x200)+_0x57f9f8+_0x36ff85(0x1f6),_0x1460b8=await httpRequest(_0x560ffb,{'headers':{'Cookie':getCookie()},'timeout':0xea60,'retries':0x2});if(_0x1460b8['ok']){const _0x580321=_0x1460b8['data'];if(_0x580321['success']){const _0xbed659=_0x58d892?_0x58d892+_0x36ff85(0x209):_0x36ff85(0x1f8),_0x470711=_0x58d892?_0x58d892+_0x36ff85(0x1f3):_0x36ff85(0x1fe);return console[_0x36ff85(0x20b)](_0x36ff85(0x1f2)),console['log'](_0x36ff85(0x215)+_0xbed659+_0x36ff85(0x1f5)),console[_0x36ff85(0x20b)](_0x36ff85(0x215)+_0x470711+'.ts\x20-\x20客户端实例文件'),console[_0x36ff85(0x20b)](_0x36ff85(0x210)+_0x580321['data'][_0x36ff85(0x1ff)][_0x36ff85(0x20f)]+'\x20个数据集...'),await generateApiFile(_0x580321[_0x36ff85(0x208)][_0x36ff85(0x1ff)],_0x58d892,_0x57f9f8,!![],_0x5575c2),console[_0x36ff85(0x20b)]('√\x20API\x20配置文件生成完成'),_0x22b0e5&&logger[_0x36ff85(0x211)](_0x36ff85(0x207),_0x36ff85(0x203)+_0x57f9f8,{'projectPath':_0x22b0e5,'appCode':_0x57f9f8,'datasetCount':_0x580321['data'][_0x36ff85(0x1ff)][_0x36ff85(0x20f)],'filePrefix':_0x58d892}),!![];}else return console['error'](_0x36ff85(0x216),_0x580321[_0x36ff85(0x213)]||_0x36ff85(0x1f4)),_0x22b0e5&&logger[_0x36ff85(0x218)](_0x36ff85(0x207),_0x36ff85(0x1fa)+(_0x580321[_0x36ff85(0x213)]||_0x36ff85(0x1f4)),{'projectPath':_0x22b0e5,'appCode':_0x57f9f8}),![];}else{if(_0x1460b8['status']===0x191){const _0x3d1a48=_0x36ff85(0x219);console[_0x36ff85(0x218)]('×\x20'+_0x3d1a48),_0x22b0e5&&logger['error'](_0x36ff85(0x207),_0x3d1a48,{'status':_0x1460b8[_0x36ff85(0x1f7)],'appCode':_0x57f9f8,'url':_0x1460b8[_0x36ff85(0x201)],'projectPath':_0x22b0e5});}else{const _0x4842cf=_0x36ff85(0x1fb)+_0x1460b8[_0x36ff85(0x1f7)];console[_0x36ff85(0x218)]('×\x20'+_0x4842cf);try{const _0x4ac4ea=await _0x1460b8[_0x36ff85(0x20d)]();_0x4ac4ea&&console[_0x36ff85(0x218)](_0x36ff85(0x20a),_0x4ac4ea),_0x22b0e5&&logger['error']('create-api-pull',_0x4842cf,{'status':_0x1460b8[_0x36ff85(0x1f7)],'appCode':_0x57f9f8,'url':_0x1460b8[_0x36ff85(0x201)],'errorBody':_0x4ac4ea,'projectPath':_0x22b0e5});}catch(_0x341c9d){console[_0x36ff85(0x218)](_0x36ff85(0x1ee)),_0x22b0e5&&logger[_0x36ff85(0x218)](_0x36ff85(0x207),_0x4842cf+_0x36ff85(0x204),{'status':_0x1460b8['status'],'appCode':_0x57f9f8,'url':_0x1460b8[_0x36ff85(0x201)],'readError':_0x341c9d instanceof Error?_0x341c9d[_0x36ff85(0x213)]:String(_0x341c9d),'projectPath':_0x22b0e5});}}return![];}}catch(_0x1af6af){const _0x28c372=_0x1af6af instanceof Error?_0x1af6af[_0x36ff85(0x213)]:String(_0x1af6af);return console[_0x36ff85(0x218)](_0x36ff85(0x217),_0x28c372),_0x22b0e5&&logger[_0x36ff85(0x218)](_0x36ff85(0x207),_0x36ff85(0x1f1)+_0x28c372,{'appCode':_0x57f9f8,'projectPath':_0x22b0e5}),![];}finally{_0x584872&&process[_0x36ff85(0x20e)](_0x584872);}}
package/lib/api/pull.js CHANGED
@@ -1 +1 @@
1
- function a8_0x4b67(){const _0x1d0a2c=['data','\x0a*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','api','api-pull','*\x20使用指定的应用AppCode:\x20','*\x20开始生成\x20API\x20配置文件:','8586530DOTCJN','×\x20提供的应用AppCode\x20\x22','12BgGkHE','error','stdout','status','!\x20请使用以下方式之一:','\x20个数据集...','/smartapi/dataset/getList?appCode=','env','668622NzIZOT','742736NZFDfo','×\x20未提供应用AppCode,且配置中也没有默认值','test','.ts\x20-\x20模型配置文件','5201238TeHvhv','-client','9ILAwva','url','trim','&pageSize=999&currentPage=1','×\x20错误详情:','tableData','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','log','stdin','app',',且无法读取错误响应内容','\x1b[90m*\x20使用配置的应用AppCode:\x20','exit','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','3adQVpO','8515472nZZrwE','\x1b[0m','7868072GmiSsu','question','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','\x22\x20无效','online','\x20\x20\x20•\x20','string','*\x20正在处理\x20','text','167795KQcnjV','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','json'];a8_0x4b67=function(){return _0x1d0a2c;};return a8_0x4b67();}(function(_0x1dcc70,_0x3860e7){const _0x3a4712=a8_0x5192,_0x4dd676=_0x1dcc70();while(!![]){try{const _0x1740e3=-parseInt(_0x3a4712(0x11e))/0x1*(-parseInt(_0x3a4712(0x10a))/0x2)+-parseInt(_0x3a4712(0x109))/0x3+parseInt(_0x3a4712(0x135))/0x4*(parseInt(_0x3a4712(0x12a))/0x5)+-parseInt(_0x3a4712(0x10e))/0x6+-parseInt(_0x3a4712(0x11f))/0x7+-parseInt(_0x3a4712(0x121))/0x8*(-parseInt(_0x3a4712(0x110))/0x9)+parseInt(_0x3a4712(0x133))/0xa;if(_0x1740e3===_0x3860e7)break;else _0x4dd676['push'](_0x4dd676['shift']());}catch(_0x3d3dd8){_0x4dd676['push'](_0x4dd676['shift']());}}}(a8_0x4b67,0xb746c));import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a8_0x5192(_0x2dafdb,_0x4cb25a){const _0x4b6720=a8_0x4b67();return a8_0x5192=function(_0x519213,_0x37a41b){_0x519213=_0x519213-0x105;let _0x292d3c=_0x4b6720[_0x519213];return _0x292d3c;},a8_0x5192(_0x2dafdb,_0x4cb25a);}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';export async function initApi(_0x11edcb,_0x44cd88){const _0x32d156=a8_0x5192,_0x5c5d3e=readConfig(),_0x37a5e5=_0x11edcb||_0x5c5d3e?.[_0x32d156(0x119)],_0x1892d1=typeof _0x5c5d3e['env']===_0x32d156(0x127)?_0x5c5d3e[_0x32d156(0x108)]:undefined,_0x318396=_0x44cd88||_0x1892d1||_0x32d156(0x125);initEnv(_0x318396);(typeof _0x37a5e5!==_0x32d156(0x127)||!_0x37a5e5)&&(_0x11edcb?console[_0x32d156(0x136)](_0x32d156(0x134)+_0x11edcb+_0x32d156(0x124)):(console['error'](_0x32d156(0x10b)),console[_0x32d156(0x117)](_0x32d156(0x105)),console['log'](_0x32d156(0x12b)),console[_0x32d156(0x117)](_0x32d156(0x116))),process[_0x32d156(0x11c)](0x1));_0x11edcb?console['log'](_0x32d156(0x131)+_0x37a5e5):console[_0x32d156(0x117)](_0x32d156(0x11b)+_0x37a5e5+_0x32d156(0x120));const _0x537b98=createInterface({'input':process[_0x32d156(0x118)],'output':process[_0x32d156(0x137)]});let _0x15f9b5;try{const _0x564a81=await _0x537b98[_0x32d156(0x122)]('!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20');_0x15f9b5=_0x564a81[_0x32d156(0x112)]();if(_0x15f9b5){const _0x65036f=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x65036f[_0x32d156(0x10c)](_0x15f9b5)&&(console[_0x32d156(0x136)](_0x32d156(0x123)),process[_0x32d156(0x11c)](0x1));}}finally{_0x537b98['close']();}console['log'](_0x32d156(0x12e)+_0x318396+')');const _0x1e6f88=await fetch(getApiDomain()+_0x32d156(0x107)+_0x37a5e5+_0x32d156(0x113),{'headers':{'Cookie':getCookie()}});if(_0x1e6f88['ok']){const _0x37e731=await _0x1e6f88[_0x32d156(0x12c)]();if(_0x37e731['success']){const _0x7279f3=_0x15f9b5?_0x15f9b5+'-api':_0x32d156(0x12f),_0x2b177c=_0x15f9b5?_0x15f9b5+_0x32d156(0x10f):'client';console[_0x32d156(0x117)](_0x32d156(0x132)),console[_0x32d156(0x117)](_0x32d156(0x126)+_0x7279f3+_0x32d156(0x10d)),console[_0x32d156(0x117)](_0x32d156(0x126)+_0x2b177c+'.ts\x20-\x20客户端实例文件'),console[_0x32d156(0x117)](_0x32d156(0x128)+_0x37e731[_0x32d156(0x12d)][_0x32d156(0x115)]['length']+_0x32d156(0x106));const _0x55fd6c=!_0x11edcb;await generateApiFile(_0x37e731[_0x32d156(0x12d)][_0x32d156(0x115)],_0x15f9b5,_0x37a5e5,_0x55fd6c,_0x318396);}}else{if(_0x1e6f88[_0x32d156(0x138)]===0x191){const _0x4f1cfc=_0x32d156(0x11d);console[_0x32d156(0x136)]('×\x20'+_0x4f1cfc),logger[_0x32d156(0x136)](_0x32d156(0x130),_0x4f1cfc,{'status':_0x1e6f88[_0x32d156(0x138)],'appCode':_0x37a5e5,'url':_0x1e6f88[_0x32d156(0x111)]});}else{const _0x30d139='获取数据集失败,HTTP状态码:\x20'+_0x1e6f88[_0x32d156(0x138)];console['error']('×\x20'+_0x30d139);try{const _0x54e6ab=await _0x1e6f88[_0x32d156(0x129)]();_0x54e6ab?(console[_0x32d156(0x136)](_0x32d156(0x114),_0x54e6ab),logger[_0x32d156(0x136)](_0x32d156(0x130),_0x30d139,{'status':_0x1e6f88['status'],'appCode':_0x37a5e5,'url':_0x1e6f88['url'],'errorBody':_0x54e6ab})):logger['error']('api-pull',_0x30d139,{'status':_0x1e6f88[_0x32d156(0x138)],'appCode':_0x37a5e5,'url':_0x1e6f88[_0x32d156(0x111)]});}catch(_0x406f75){console['error']('×\x20无法读取错误响应内容'),logger[_0x32d156(0x136)](_0x32d156(0x130),_0x30d139+_0x32d156(0x11a),{'status':_0x1e6f88[_0x32d156(0x138)],'appCode':_0x37a5e5,'url':_0x1e6f88[_0x32d156(0x111)],'readError':_0x406f75 instanceof Error?_0x406f75['message']:String(_0x406f75)});}}process[_0x32d156(0x11c)](0x1);}}
1
+ (function(_0x250f72,_0x5609c4){const _0x35b850=a8_0x4142,_0x52161a=_0x250f72();while(!![]){try{const _0x56acb6=-parseInt(_0x35b850(0x127))/0x1*(parseInt(_0x35b850(0x137))/0x2)+-parseInt(_0x35b850(0x10f))/0x3+parseInt(_0x35b850(0x13d))/0x4+-parseInt(_0x35b850(0x10d))/0x5*(parseInt(_0x35b850(0x122))/0x6)+parseInt(_0x35b850(0x124))/0x7*(parseInt(_0x35b850(0x120))/0x8)+parseInt(_0x35b850(0x10a))/0x9+parseInt(_0x35b850(0x128))/0xa;if(_0x56acb6===_0x5609c4)break;else _0x52161a['push'](_0x52161a['shift']());}catch(_0x35d1b2){_0x52161a['push'](_0x52161a['shift']());}}}(a8_0x364a,0x562a3));import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';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';function a8_0x364a(){const _0x34856e=['获取数据集失败,HTTP状态码:\x20','-api','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','*\x20开始生成\x20API\x20配置文件:','\x1b[0m','message','error','api-pull','data','env','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','url','\x20个数据集...','\x0a*\x20正在从服务器拉取\x20API\x20配置...\x20(环境:\x20','2bBIBiP','×\x20无法读取错误响应内容','stdout','test','text','\x20\x20\x20•\x20','2039424WuDHpd','json','×\x20未提供应用AppCode,且配置中也没有默认值','2404134lWmAwP','.ts\x20-\x20模型配置文件','success','649795BUHznR','question','1972395DMCxNA','×\x20提供的应用AppCode\x20\x22','exit','trim','*\x20使用指定的应用AppCode:\x20','.ts\x20-\x20客户端实例文件','stdin','×\x20错误详情:','api','tableData','-client','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','!\x20请使用以下方式之一:','string','log','&pageSize=999&currentPage=1',',且无法读取错误响应内容','66304pKWdFM','/smartapi/dataset/getList?appCode=','6eKBtuo','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','7LbqHsC','*\x20正在处理\x20','status','665748qnVQEX','10208330qNHbZm'];a8_0x364a=function(){return _0x34856e;};return a8_0x364a();}import{logger}from'../utils/logger.js';function a8_0x4142(_0x3af225,_0x582773){const _0x364a8e=a8_0x364a();return a8_0x4142=function(_0x414281,_0x51f8ea){_0x414281=_0x414281-0x108;let _0x3186cd=_0x364a8e[_0x414281];return _0x3186cd;},a8_0x4142(_0x3af225,_0x582773);}export async function initApi(_0x91e62e,_0x31a2bb){const _0x164a3d=a8_0x4142,_0x1884df=readConfig(),_0x4f4bd0=_0x91e62e||_0x1884df?.['app'],_0x5b779e=typeof _0x1884df['env']===_0x164a3d(0x11c)?_0x1884df[_0x164a3d(0x132)]:undefined,_0x262d34=_0x31a2bb||_0x5b779e||'online';initEnv(_0x262d34);(typeof _0x4f4bd0!==_0x164a3d(0x11c)||!_0x4f4bd0)&&(_0x91e62e?console['error'](_0x164a3d(0x110)+_0x91e62e+'\x22\x20无效'):(console[_0x164a3d(0x12f)](_0x164a3d(0x109)),console[_0x164a3d(0x11d)](_0x164a3d(0x11b)),console['log'](_0x164a3d(0x11a)),console[_0x164a3d(0x11d)](_0x164a3d(0x123))),process['exit'](0x1));_0x91e62e?console[_0x164a3d(0x11d)](_0x164a3d(0x113)+_0x4f4bd0):console[_0x164a3d(0x11d)]('\x1b[90m*\x20使用配置的应用AppCode:\x20'+_0x4f4bd0+_0x164a3d(0x12d));const _0x59063c=createInterface({'input':process[_0x164a3d(0x115)],'output':process[_0x164a3d(0x139)]});let _0x1f2f28;try{const _0x2d11da=await _0x59063c[_0x164a3d(0x10e)]('!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20');_0x1f2f28=_0x2d11da[_0x164a3d(0x112)]();if(_0x1f2f28){const _0x550fc3=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x550fc3[_0x164a3d(0x13a)](_0x1f2f28)&&(console[_0x164a3d(0x12f)](_0x164a3d(0x133)),process['exit'](0x1));}}finally{_0x59063c['close']();}console[_0x164a3d(0x11d)](_0x164a3d(0x136)+_0x262d34+')');const _0x31c2f2=await fetch(getApiDomain()+_0x164a3d(0x121)+_0x4f4bd0+_0x164a3d(0x11e),{'headers':{'Cookie':getCookie()}});if(_0x31c2f2['ok']){const _0x3ef205=await _0x31c2f2[_0x164a3d(0x108)]();if(_0x3ef205[_0x164a3d(0x10c)]){const _0x1e2288=_0x1f2f28?_0x1f2f28+_0x164a3d(0x12a):_0x164a3d(0x117),_0x4d8e8d=_0x1f2f28?_0x1f2f28+_0x164a3d(0x119):'client';console['log'](_0x164a3d(0x12c)),console[_0x164a3d(0x11d)]('\x20\x20\x20•\x20'+_0x1e2288+_0x164a3d(0x10b)),console[_0x164a3d(0x11d)](_0x164a3d(0x13c)+_0x4d8e8d+_0x164a3d(0x114)),console[_0x164a3d(0x11d)](_0x164a3d(0x125)+_0x3ef205['data']['tableData']['length']+_0x164a3d(0x135));const _0x172f96=!_0x91e62e;await generateApiFile(_0x3ef205[_0x164a3d(0x131)][_0x164a3d(0x118)],_0x1f2f28,_0x4f4bd0,_0x172f96,_0x262d34);}}else{if(_0x31c2f2[_0x164a3d(0x126)]===0x191){const _0x2ac4a8=_0x164a3d(0x12b);console['error']('×\x20'+_0x2ac4a8),logger['error'](_0x164a3d(0x130),_0x2ac4a8,{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2[_0x164a3d(0x134)]});}else{const _0x35b74a=_0x164a3d(0x129)+_0x31c2f2[_0x164a3d(0x126)];console[_0x164a3d(0x12f)]('×\x20'+_0x35b74a);try{const _0x583fbb=await _0x31c2f2[_0x164a3d(0x13b)]();_0x583fbb?(console['error'](_0x164a3d(0x116),_0x583fbb),logger[_0x164a3d(0x12f)](_0x164a3d(0x130),_0x35b74a,{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2[_0x164a3d(0x134)],'errorBody':_0x583fbb})):logger['error'](_0x164a3d(0x130),_0x35b74a,{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2[_0x164a3d(0x134)]});}catch(_0x175e25){console[_0x164a3d(0x12f)](_0x164a3d(0x138)),logger[_0x164a3d(0x12f)](_0x164a3d(0x130),_0x35b74a+_0x164a3d(0x11f),{'status':_0x31c2f2[_0x164a3d(0x126)],'appCode':_0x4f4bd0,'url':_0x31c2f2['url'],'readError':_0x175e25 instanceof Error?_0x175e25[_0x164a3d(0x12e)]:String(_0x175e25)});}}process[_0x164a3d(0x111)](0x1);}}
@@ -1 +1 @@
1
- (function(_0x5b87fe,_0x490d99){const _0x718fca=a10_0x515a,_0x14176c=_0x5b87fe();while(!![]){try{const _0x109d3a=parseInt(_0x718fca(0xd1))/0x1+parseInt(_0x718fca(0xc5))/0x2+-parseInt(_0x718fca(0xd3))/0x3*(parseInt(_0x718fca(0xc4))/0x4)+parseInt(_0x718fca(0xd5))/0x5*(parseInt(_0x718fca(0xce))/0x6)+parseInt(_0x718fca(0xcc))/0x7*(parseInt(_0x718fca(0xc1))/0x8)+-parseInt(_0x718fca(0xc2))/0x9+-parseInt(_0x718fca(0xc7))/0xa;if(_0x109d3a===_0x490d99)break;else _0x14176c['push'](_0x14176c['shift']());}catch(_0x24010f){_0x14176c['push'](_0x14176c['shift']());}}}(a10_0xaeaf,0x54884));import{jsx as a10_0x48d0b7,jsxs as a10_0x26756e}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0x34e7e5 from'ink-spinner';function a10_0x515a(_0xf2749e,_0x54241f){const _0xaeaf1e=a10_0xaeaf();return a10_0x515a=function(_0x515ac9,_0x513ca8){_0x515ac9=_0x515ac9-0xc1;let _0xdeca23=_0xaeaf1e[_0x515ac9];return _0xdeca23;},a10_0x515a(_0xf2749e,_0x54241f);}export function AuthServer(){const _0x8b19a1=a10_0x515a,{exit:_0x25d757}=useApp(),[_0x94c985,_0xa14d82]=useState(![]),[_0x210102,_0x54a4c9]=useState(!![]),[_0x3414eb,_0x274c77]=useState(![]),[_0x263c42,_0x1787c6]=useState(![]);useEffect(()=>{getIsSessionValid()['then'](_0xa14d82)['finally'](()=>_0x54a4c9(![]));},[]),useEffect(()=>{!_0x210102&&_0x94c985&&(console['log']('√\x20当前为有效会话,无需重新登录。'),_0x25d757());},[_0x210102,_0x94c985,_0x25d757]),useEffect(()=>{const _0x100937=a10_0x515a;_0x263c42&&(console[_0x100937(0xcb)](_0x100937(0xc3)),_0x25d757());},[_0x263c42,_0x25d757]),useInput((_0x3cbfaa,_0x306248)=>{const _0x4b402b=a10_0x515a;_0x306248[_0x4b402b(0xcd)]&&(_0x274c77(!![]),authServer({'silent':!![]})[_0x4b402b(0xd2)](_0x187bff=>{_0x1787c6(_0x187bff);})),_0x3cbfaa==='q'&&_0x25d757();});if(_0x210102)return null;if(_0x94c985||_0x263c42)return null;return a10_0x48d0b7(Box,{'flexDirection':_0x8b19a1(0xc8),'marginTop':0x1,'marginBottom':0x1,'children':_0x3414eb?a10_0x26756e(Box,{'children':[a10_0x48d0b7(Box,{'width':'1'}),a10_0x26756e(Text,{'color':_0x8b19a1(0xcf),'children':[a10_0x48d0b7(a10_0x34e7e5,{'type':_0x8b19a1(0xc6)}),'\x20\x20']}),a10_0x48d0b7(Text,{'children':'正在登录...\x20'}),a10_0x48d0b7(Text,{'color':_0x8b19a1(0xd4),'children':_0x8b19a1(0xd0)})]}):a10_0x26756e(Box,{'children':[a10_0x48d0b7(Box,{'width':'1'}),a10_0x48d0b7(Text,{'children':_0x8b19a1(0xca)}),a10_0x48d0b7(Text,{'color':'gray','children':_0x8b19a1(0xc9)})]})});}function a10_0xaeaf(){const _0x2cf4d9=['column','按\x20“q”\x20退出。','*\x20按回车开始登录。','log','63VXrSEJ','return','1430418rSctWB','green','请前往浏览器完成登录。','538723SwkInw','then','512217DjIdoZ','gray','5zOMuKe','23192tsAxSG','3570894vzjwZU','*\x20登录成功!','4dtDZdJ','1197340kaHWXh','dots','4881380VMqeeT'];a10_0xaeaf=function(){return _0x2cf4d9;};return a10_0xaeaf();}
1
+ function a10_0x22e3(){const _0x2d482b=['127105hvPmGi','111923nBSoNr','184vTuWQW','按\x20“q”\x20退出。','请前往浏览器完成登录。','*\x20按回车开始登录。','15785890ZBPImj','gray','return','finally','then','√\x20当前为有效会话,无需重新登录。','831123sGrCVJ','*\x20登录成功!','dots','5943906QZJcyR','116487XuyFrg','log','column','78gReczU','40GENzak','1109824oVzCFI'];a10_0x22e3=function(){return _0x2d482b;};return a10_0x22e3();}(function(_0xdcdd0,_0x28e78d){const _0x411cea=a10_0x5d90,_0x23983c=_0xdcdd0();while(!![]){try{const _0x422ebc=parseInt(_0x411cea(0x1c6))/0x1+-parseInt(_0x411cea(0x1ce))/0x2*(parseInt(_0x411cea(0x1ca))/0x3)+parseInt(_0x411cea(0x1cf))/0x4+-parseInt(_0x411cea(0x1ba))/0x5*(parseInt(_0x411cea(0x1cd))/0x6)+parseInt(_0x411cea(0x1bb))/0x7*(-parseInt(_0x411cea(0x1bc))/0x8)+-parseInt(_0x411cea(0x1c9))/0x9+parseInt(_0x411cea(0x1c0))/0xa;if(_0x422ebc===_0x28e78d)break;else _0x23983c['push'](_0x23983c['shift']());}catch(_0x21f68c){_0x23983c['push'](_0x23983c['shift']());}}}(a10_0x22e3,0x86bfe));function a10_0x5d90(_0x2ab4d8,_0x1258d0){const _0x22e35b=a10_0x22e3();return a10_0x5d90=function(_0x5d90e,_0x4a4490){_0x5d90e=_0x5d90e-0x1ba;let _0x248ec3=_0x22e35b[_0x5d90e];return _0x248ec3;},a10_0x5d90(_0x2ab4d8,_0x1258d0);}import{jsx as a10_0x415a53,jsxs as a10_0x4c45d0}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0xd183f2 from'ink-spinner';export function AuthServer(){const _0x237e7d=a10_0x5d90,{exit:_0x544bde}=useApp(),[_0x321d57,_0x1f91b6]=useState(![]),[_0x2125f0,_0x3044d0]=useState(!![]),[_0x19876a,_0x1a3d34]=useState(![]),[_0x202b95,_0x530ed7]=useState(![]);useEffect(()=>{const _0x3c6971=a10_0x5d90;getIsSessionValid()['then'](_0x1f91b6)[_0x3c6971(0x1c3)](()=>_0x3044d0(![]));},[]),useEffect(()=>{const _0x150033=a10_0x5d90;!_0x2125f0&&_0x321d57&&(console[_0x150033(0x1cb)](_0x150033(0x1c5)),_0x544bde());},[_0x2125f0,_0x321d57,_0x544bde]),useEffect(()=>{const _0x14b14c=a10_0x5d90;_0x202b95&&(console[_0x14b14c(0x1cb)](_0x14b14c(0x1c7)),_0x544bde());},[_0x202b95,_0x544bde]),useInput((_0xb971aa,_0x140f3f)=>{const _0x40a323=a10_0x5d90;_0x140f3f[_0x40a323(0x1c2)]&&(_0x1a3d34(!![]),authServer({'silent':!![]})[_0x40a323(0x1c4)](_0x3c00f2=>{_0x530ed7(_0x3c00f2);})),_0xb971aa==='q'&&_0x544bde();});if(_0x2125f0)return null;if(_0x321d57||_0x202b95)return null;return a10_0x415a53(Box,{'flexDirection':_0x237e7d(0x1cc),'marginTop':0x1,'marginBottom':0x1,'children':_0x19876a?a10_0x4c45d0(Box,{'children':[a10_0x415a53(Box,{'width':'1'}),a10_0x4c45d0(Text,{'color':'green','children':[a10_0x415a53(a10_0xd183f2,{'type':_0x237e7d(0x1c8)}),'\x20\x20']}),a10_0x415a53(Text,{'children':'正在登录...\x20'}),a10_0x415a53(Text,{'color':'gray','children':_0x237e7d(0x1be)})]}):a10_0x4c45d0(Box,{'children':[a10_0x415a53(Box,{'width':'1'}),a10_0x415a53(Text,{'children':_0x237e7d(0x1bf)}),a10_0x415a53(Text,{'color':_0x237e7d(0x1c1),'children':_0x237e7d(0x1bd)})]})});}