@lovrabet/rabetbase-cli 2.0.2-beta.2 → 2.0.2-beta.3

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 (146) hide show
  1. package/lib/ai-setup/config.js +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/pull-silent.js +1 -1
  6. package/lib/auth/auth-server-ui.js +1 -1
  7. package/lib/auth/auth-server.js +1 -1
  8. package/lib/auth/constant.js +1 -1
  9. package/lib/auth/get-cookie.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/doc.js +1 -0
  15. package/lib/commands/api/index.js +1 -0
  16. package/lib/commands/api/list.js +1 -0
  17. package/lib/commands/api/pull.js +1 -0
  18. package/lib/commands/app.js +1 -1
  19. package/lib/commands/auth.js +1 -1
  20. package/lib/commands/bff/delete.js +1 -1
  21. package/lib/commands/bff/detail.js +1 -1
  22. package/lib/commands/bff/index.js +1 -1
  23. package/lib/commands/bff/list.js +1 -1
  24. package/lib/commands/bff/new.js +1 -1
  25. package/lib/commands/bff/pull.js +1 -1
  26. package/lib/commands/bff/push.js +1 -1
  27. package/lib/commands/bff/status.js +1 -1
  28. package/lib/commands/build.js +1 -1
  29. package/lib/commands/codegen/index.js +1 -1
  30. package/lib/commands/codegen/sdk.js +1 -1
  31. package/lib/commands/codegen/sql.js +1 -1
  32. package/lib/commands/common/flags.js +1 -0
  33. package/lib/commands/config.js +1 -1
  34. package/lib/commands/create.js +1 -1
  35. package/lib/commands/dataset/detail.js +1 -1
  36. package/lib/commands/dataset/index.js +1 -1
  37. package/lib/commands/dataset/links.js +1 -1
  38. package/lib/commands/dataset/list.js +1 -1
  39. package/lib/commands/dataset/operations.js +1 -1
  40. package/lib/commands/init.js +1 -1
  41. package/lib/commands/logout.js +1 -1
  42. package/lib/commands/logs.js +1 -1
  43. package/lib/commands/mcp.js +1 -1
  44. package/lib/commands/menu/index.js +1 -0
  45. package/lib/commands/menu/shared/compare-table.js +1 -0
  46. package/lib/commands/menu/shared/index.js +1 -0
  47. package/lib/commands/menu/shared/inquirer.js +1 -0
  48. package/lib/commands/menu/shared/local-pages.js +1 -0
  49. package/lib/commands/menu/shared/logic.js +1 -0
  50. package/lib/commands/menu/shared/service.js +1 -0
  51. package/lib/commands/menu/shared/sync-core.js +1 -0
  52. package/lib/commands/menu/shared/update-core.js +1 -0
  53. package/lib/commands/menu/shared/valid-url.js +1 -0
  54. package/lib/commands/menu/sync.js +1 -0
  55. package/lib/commands/menu/update.js +1 -0
  56. package/lib/commands/preview.js +1 -1
  57. package/lib/commands/registry.js +1 -1
  58. package/lib/commands/run.js +1 -1
  59. package/lib/commands/skill.js +1 -1
  60. package/lib/commands/sql/detail.js +1 -1
  61. package/lib/commands/sql/exec.js +1 -1
  62. package/lib/commands/sql/index.js +1 -1
  63. package/lib/commands/sql/list.js +1 -1
  64. package/lib/commands/sql/save.js +1 -1
  65. package/lib/commands/sql/validate.js +1 -1
  66. package/lib/commands/start.js +1 -1
  67. package/lib/config/config-help.js +1 -1
  68. package/lib/config/main.js +1 -1
  69. package/lib/constant/cli.js +1 -1
  70. package/lib/constant/domain.js +1 -1
  71. package/lib/constant/env.js +1 -1
  72. package/lib/context.js +1 -1
  73. package/lib/core/alias-resolver.js +1 -1
  74. package/lib/core/api-client.js +1 -1
  75. package/lib/core/bff/config.js +1 -1
  76. package/lib/core/bff/file-system.js +1 -1
  77. package/lib/core/bff/hash.js +1 -1
  78. package/lib/core/bff/lock.js +1 -1
  79. package/lib/core/bff/utils.js +1 -1
  80. package/lib/core/db-resolver.js +1 -1
  81. package/lib/core/sql-validator.js +1 -1
  82. package/lib/create-app/enhanced-guided-create.js +1 -1
  83. package/lib/create-app/format-elapsed.js +1 -1
  84. package/lib/create-app/main.js +1 -1
  85. package/lib/create-app/non-interactive.js +1 -1
  86. package/lib/create-app/task-finished.js +1 -1
  87. package/lib/create-app/task-loading.js +1 -1
  88. package/lib/create-app/task-running.js +1 -1
  89. package/lib/create-app/task-time.js +1 -1
  90. package/lib/create-app/use-copy-project-template.js +1 -1
  91. package/lib/create-app/use-format-code.js +1 -1
  92. package/lib/create-app/use-install-dependencies.js +1 -1
  93. package/lib/errors.js +1 -1
  94. package/lib/framework/flags.js +1 -1
  95. package/lib/framework/help.js +1 -1
  96. package/lib/framework/index.js +1 -1
  97. package/lib/framework/output.js +1 -1
  98. package/lib/framework/response.js +1 -1
  99. package/lib/framework/runner.js +1 -1
  100. package/lib/generated/build-info.js +1 -1
  101. package/lib/help.js +1 -1
  102. package/lib/init/main.js +1 -1
  103. package/lib/mcp/McpInstallUI.js +1 -1
  104. package/lib/mcp/claude.js +1 -1
  105. package/lib/mcp/cursor.js +1 -1
  106. package/lib/mcp/main.js +1 -1
  107. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  108. package/lib/mcp/mcp-installer.js +1 -1
  109. package/lib/skills/main.js +1 -1
  110. package/lib/skills/npx-skills-add.js +1 -1
  111. package/lib/ui/IDESelector.js +1 -1
  112. package/lib/ui/useIDESelection.js +1 -1
  113. package/lib/utils/ai_config.js +1 -1
  114. package/lib/utils/cdn-config.js +1 -1
  115. package/lib/utils/check-sdk-version.js +1 -1
  116. package/lib/utils/cli-version-check.js +1 -1
  117. package/lib/utils/config.js +1 -1
  118. package/lib/utils/copy-directory.js +1 -1
  119. package/lib/utils/file-utils.js +1 -1
  120. package/lib/utils/guides-cdn.js +1 -1
  121. package/lib/utils/http-client.js +1 -1
  122. package/lib/utils/logger.js +1 -1
  123. package/lib/utils/rules-cdn.js +1 -1
  124. package/lib/utils/sleep.js +1 -1
  125. package/lib/utils/template-replacer.js +1 -1
  126. package/package.json +5 -2
  127. package/templates/generate-api/api.ts.tpl +4 -4
  128. package/templates/generate-api/client.ts.tpl +2 -2
  129. package/lib/api/api-doc-ui.js +0 -1
  130. package/lib/api/api-pull-ui.js +0 -1
  131. package/lib/api/main.js +0 -1
  132. package/lib/app-menu/app-menu-sync-ui.js +0 -1
  133. package/lib/app-menu/create-menu.js +0 -1
  134. package/lib/app-menu/get-local-pages.js +0 -1
  135. package/lib/app-menu/get-online-menu-list.js +0 -1
  136. package/lib/app-menu/types.js +0 -1
  137. package/lib/app-menu/use-get-online-menu-list.js +0 -1
  138. package/lib/app-menu/utils.js +0 -1
  139. package/lib/app-menu/valid-url.js +0 -1
  140. package/lib/app-menu-update-cdn/current-content.js +0 -1
  141. package/lib/app-menu-update-cdn/input-cdn-asset.js +0 -1
  142. package/lib/app-menu-update-cdn/main.js +0 -1
  143. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +0 -1
  144. package/lib/commands/api.js +0 -1
  145. package/lib/commands/menu.js +0 -1
  146. /package/lib/{app-menu-update-cdn → commands/menu/shared}/types.js +0 -0
@@ -1 +1 @@
1
- function a128_0x3487(_0x4a2eb8,_0x358015){_0x4a2eb8=_0x4a2eb8-0x1df;const _0x16a024=a128_0x16a0();let _0x34879d=_0x16a024[_0x4a2eb8];return _0x34879d;}const a128_0x1d387e=a128_0x3487;(function(_0x268dac,_0x2859ae){const _0x5bdc1c=a128_0x3487,_0x3d5048=_0x268dac();while(!![]){try{const _0x396424=parseInt(_0x5bdc1c(0x212))/0x1*(parseInt(_0x5bdc1c(0x1f4))/0x2)+parseInt(_0x5bdc1c(0x206))/0x3+parseInt(_0x5bdc1c(0x1e7))/0x4+parseInt(_0x5bdc1c(0x21a))/0x5*(parseInt(_0x5bdc1c(0x221))/0x6)+parseInt(_0x5bdc1c(0x215))/0x7*(-parseInt(_0x5bdc1c(0x1f9))/0x8)+-parseInt(_0x5bdc1c(0x211))/0x9*(parseInt(_0x5bdc1c(0x21e))/0xa)+-parseInt(_0x5bdc1c(0x1ed))/0xb;if(_0x396424===_0x2859ae)break;else _0x3d5048['push'](_0x3d5048['shift']());}catch(_0x726824){_0x3d5048['push'](_0x3d5048['shift']());}}}(a128_0x16a0,0xef355));function a128_0x16a0(){const _0x20b18c=['info','toLocaleDateString','10378pSkwhK','2-digit','.tpl','promises','template','3227888STpfbw','split','readFile','map','name','toUpperCase','name:\x20\x22','now','utf8','error','.js','replaceContent','numeric','3894459SXRpUM','.json','datasetCode:\x20\x22','toComponentName','success','.jsx','YourModel','processFile','replaceApiContent','replace','../../package.json','1173006GRyRYQ','66YYeMwe','push','extname','7NPYRGk','模板内容替换完成','readdir','api','toLocaleString','225HyOlYW','mkdir','.css','tableName','80UFSnnf','endsWith','version','4950UCcxjC','datasetCode','message','toDisplayTitle','.ts','\x20},','slice','模板内容替换失败','toLowerCase','writeFile','pop','4748552YnZqhd','\x0a\x20\x20\x20\x20{\x20','charAt','alias','tableName:\x20\x22','isDirectory','4828285gUiXoY','processDirectory','join','alias:\x20\x22','toLocaleTimeString'];a128_0x16a0=function(){return _0x20b18c;};return a128_0x16a0();}import a128_0x3425f7 from'node:fs';import a128_0x2a222f from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a128_0x1d387e(0x210))[a128_0x1d387e(0x220)];export class TemplateReplacer{static[a128_0x1d387e(0x209)](_0x3871cd){const _0x5189d7=a128_0x1d387e,_0x3f0a1f=_0x3871cd[_0x5189d7(0x1fa)]('/')['pop']()||_0x3871cd;return _0x3f0a1f[_0x5189d7(0x1fa)]('-')[_0x5189d7(0x1fc)](_0x2d3b36=>_0x2d3b36[_0x5189d7(0x1e9)](0x0)[_0x5189d7(0x1fe)]()+_0x2d3b36[_0x5189d7(0x1e2)](0x1)[_0x5189d7(0x1e4)]())['join']('');}static[a128_0x1d387e(0x1df)](_0x20bc55){const _0x5677fd=a128_0x1d387e,_0xabd5c6=_0x20bc55['split']('/')[_0x5677fd(0x1e6)]()||_0x20bc55;return _0xabd5c6[_0x5677fd(0x1fa)]('-')[_0x5677fd(0x1fc)](_0x5abe8a=>_0x5abe8a[_0x5677fd(0x1e9)](0x0)['toUpperCase']()+_0x5abe8a['slice'](0x1)[_0x5677fd(0x1e4)]())['join']('\x20');}static[a128_0x1d387e(0x204)](_0x4f8e2b,_0x490068,_0xfcf143){const _0x192aa3=a128_0x1d387e,_0x39bacc=this[_0x192aa3(0x209)](_0x490068),_0x27321f=this[_0x192aa3(0x1df)](_0x490068),_0x11e5c1=new Date(),_0x57222a=_0x11e5c1[_0x192aa3(0x219)](undefined,{'year':_0x192aa3(0x205),'month':_0x192aa3(0x1f5),'day':_0x192aa3(0x1f5),'hour':_0x192aa3(0x1f5),'minute':_0x192aa3(0x1f5),'second':_0x192aa3(0x1f5),'hour12':![]})[_0x192aa3(0x20f)](/\//g,'-'),_0x55d0e4=_0x11e5c1[_0x192aa3(0x1f3)](undefined,{'year':_0x192aa3(0x205),'month':_0x192aa3(0x1f5),'day':_0x192aa3(0x1f5)})[_0x192aa3(0x20f)](/\//g,'-'),_0x5da1d4=_0x11e5c1[_0x192aa3(0x1f1)](undefined,{'hour12':![]});let _0x36015f=_0x4f8e2b[_0x192aa3(0x20f)](/\{CliVersion\}/g,CLI_VERSION)[_0x192aa3(0x20f)](/\{ComponentName\}/g,_0x39bacc)[_0x192aa3(0x20f)](/\{DisplayTitle\}/g,_0x27321f)[_0x192aa3(0x20f)](/\{PageName\}/g,_0x490068)['replace'](/\{TemplateName\}/g,_0xfcf143)[_0x192aa3(0x20f)](/\{CreatedAt\}/g,_0x57222a)[_0x192aa3(0x20f)](/\{CreatedDate\}/g,_0x55d0e4)[_0x192aa3(0x20f)](/\{CreatedTime\}/g,_0x5da1d4);return _0x36015f;}static[a128_0x1d387e(0x20e)](_0x6dde3b,_0x348ad6,_0x4f977d,_0x3bc5f7,_0x365f83,_0x30038e,_0x4f7f3c){const _0x5574f1=a128_0x1d387e,_0x3b09f1=new Date(),_0x421fc1=_0x3b09f1['toISOString'](),_0x5a5125=_0x4f977d[_0x5574f1(0x1fc)](_0x1ec6f7=>{const _0x5ea7f6=_0x5574f1,_0x4171a9=[_0x5ea7f6(0x208)+_0x1ec6f7[_0x5ea7f6(0x222)]+'\x22',_0x5ea7f6(0x1eb)+_0x1ec6f7[_0x5ea7f6(0x21d)]+'\x22',_0x5ea7f6(0x1ff)+_0x1ec6f7[_0x5ea7f6(0x1fd)]+'\x22'];return _0x1ec6f7[_0x5ea7f6(0x1ea)]&&_0x4171a9[_0x5ea7f6(0x213)](_0x5ea7f6(0x1f0)+_0x1ec6f7['alias']+'\x22'),_0x5ea7f6(0x1e8)+_0x4171a9[_0x5ea7f6(0x1ef)](',\x20')+_0x5ea7f6(0x1e1);})[_0x5574f1(0x1ef)](''),_0x23798f=_0x3bc5f7||_0x4f977d[0x0]?.['alias']||_0x5574f1(0x20c);let _0x317841=_0x6dde3b[_0x5574f1(0x20f)](/\{AppCode\}/g,_0x348ad6)[_0x5574f1(0x20f)](/\{ModelConfigs\}/g,_0x5a5125)[_0x5574f1(0x20f)](/\{ExampleModelName\}/g,_0x23798f)[_0x5574f1(0x20f)](/\{ApiFileName\}/g,_0x365f83||_0x5574f1(0x218))[_0x5574f1(0x20f)](/\{ConfigName\}/g,_0x30038e||'default')['replace'](/\{ClientConfigParam\}/g,_0x4f7f3c||'')[_0x5574f1(0x20f)](/\{CreatedAt\}/g,_0x421fc1);return _0x317841;}static async['processTemplate'](_0x3d59f3,_0x344636,_0x4b13a7,_0x6821ce,_0x1f40f4=!![]){const _0x7b6d7b=a128_0x1d387e,_0x4b75bf=Date[_0x7b6d7b(0x200)]();try{_0x1f40f4&&logger[_0x7b6d7b(0x1f2)]('template','开始处理模板内容替换',{'templatePath':_0x3d59f3,'targetPath':_0x344636,'pageName':_0x4b13a7,'templateName':_0x6821ce});await a128_0x3425f7['promises'][_0x7b6d7b(0x21b)](_0x344636,{'recursive':!![]}),await this[_0x7b6d7b(0x1ee)](_0x3d59f3,_0x344636,_0x4b13a7,_0x6821ce);if(_0x1f40f4){const _0x591912=Date[_0x7b6d7b(0x200)]()-_0x4b75bf;logger[_0x7b6d7b(0x20a)](_0x7b6d7b(0x1f8),_0x7b6d7b(0x216),_0x591912,{'pageName':_0x4b13a7,'templateName':_0x6821ce});}}catch(_0x88e357){if(_0x1f40f4){const _0x3157c3=Date[_0x7b6d7b(0x200)]()-_0x4b75bf;logger[_0x7b6d7b(0x202)]('template',_0x7b6d7b(0x1e3),{'templatePath':_0x3d59f3,'targetPath':_0x344636,'pageName':_0x4b13a7,'templateName':_0x6821ce,'error':_0x88e357 instanceof Error?_0x88e357[_0x7b6d7b(0x223)]:String(_0x88e357),'duration':_0x3157c3});}throw _0x88e357;}}static async['processDirectory'](_0x4210e5,_0x5396e1,_0x32f090,_0x3c4c46){const _0x69917e=a128_0x1d387e,_0x1659c2=await a128_0x3425f7[_0x69917e(0x1f7)][_0x69917e(0x217)](_0x4210e5,{'withFileTypes':!![]});for(const _0x4a7b94 of _0x1659c2){const _0x26cf17=a128_0x2a222f[_0x69917e(0x1ef)](_0x4210e5,_0x4a7b94[_0x69917e(0x1fd)]);let _0x3f468a=a128_0x2a222f[_0x69917e(0x1ef)](_0x5396e1,_0x4a7b94[_0x69917e(0x1fd)]);_0x4a7b94[_0x69917e(0x1fd)][_0x69917e(0x21f)](_0x69917e(0x1f6))&&(_0x3f468a=a128_0x2a222f[_0x69917e(0x1ef)](_0x5396e1,_0x4a7b94[_0x69917e(0x1fd)]['replace'](/\.tpl$/,'')));if(_0x4a7b94[_0x69917e(0x1ec)]())await a128_0x3425f7['promises'][_0x69917e(0x21b)](_0x3f468a,{'recursive':!![]}),await this['processDirectory'](_0x26cf17,_0x3f468a,_0x32f090,_0x3c4c46);else _0x4a7b94['isFile']()&&await this['processFile'](_0x26cf17,_0x3f468a,_0x32f090,_0x3c4c46);}}static async[a128_0x1d387e(0x20d)](_0x3ec5f6,_0x186e2a,_0x5f4dee,_0xc5ccd9){const _0x21e3f1=a128_0x1d387e,_0x483e49=a128_0x2a222f[_0x21e3f1(0x214)](_0x3ec5f6)['toLowerCase']();_0x3ec5f6[_0x21e3f1(0x21f)](_0x21e3f1(0x1f6))&&(_0x186e2a=_0x186e2a[_0x21e3f1(0x20f)](/\.tpl$/,''));const _0x51209f=['.tsx',_0x21e3f1(0x1e0),_0x21e3f1(0x20b),_0x21e3f1(0x203),_0x21e3f1(0x207),'.md',_0x21e3f1(0x21c),'.scss',_0x21e3f1(0x1f6)];if(_0x51209f['includes'](_0x483e49)||_0x3ec5f6[_0x21e3f1(0x21f)]('.tpl')){const _0x3b9589=await a128_0x3425f7[_0x21e3f1(0x1f7)][_0x21e3f1(0x1fb)](_0x3ec5f6,'utf8'),_0x5a4b73=this[_0x21e3f1(0x204)](_0x3b9589,_0x5f4dee,_0xc5ccd9);await a128_0x3425f7[_0x21e3f1(0x1f7)][_0x21e3f1(0x1e5)](_0x186e2a,_0x5a4b73,_0x21e3f1(0x201));}else await a128_0x3425f7[_0x21e3f1(0x1f7)]['copyFile'](_0x3ec5f6,_0x186e2a);}}
1
+ const a128_0x412465=a128_0x9289;(function(_0x47b5f4,_0x42c574){const _0x458ed4=a128_0x9289,_0x14c6f6=_0x47b5f4();while(!![]){try{const _0x37b41a=-parseInt(_0x458ed4(0xbb))/0x1*(-parseInt(_0x458ed4(0xbd))/0x2)+-parseInt(_0x458ed4(0xce))/0x3+parseInt(_0x458ed4(0xb3))/0x4+-parseInt(_0x458ed4(0x9e))/0x5+parseInt(_0x458ed4(0xdd))/0x6+parseInt(_0x458ed4(0xc4))/0x7*(parseInt(_0x458ed4(0xae))/0x8)+-parseInt(_0x458ed4(0xad))/0x9*(-parseInt(_0x458ed4(0xa9))/0xa);if(_0x37b41a===_0x42c574)break;else _0x14c6f6['push'](_0x14c6f6['shift']());}catch(_0x2ae12d){_0x14c6f6['push'](_0x14c6f6['shift']());}}}(a128_0x2ccc,0xe7f60));import a128_0x9407df from'node:fs';import a128_0x56a701 from'node:path';function a128_0x2ccc(){const _0x503b46=['slice','utf8','processTemplate','push','replaceContent','default','toISOString','.css','readdir','alias','模板内容替换完成','.scss','9472248lNuHun','toLocaleString','开始处理模板内容替换','message','toComponentName','5766165tvvXdB','isDirectory','name:\x20\x22','join','.ts','split','numeric','map','copyFile','mkdir','模板内容替换失败','10xCCFek','success','charAt','replace','1543356kusUoZ','8hEEAkd','pop','promises','processDirectory','.md','1449500oPfyQS','isFile','toUpperCase','info','toLocaleDateString','template','processFile','../../package.json','1672RMfcWk','\x0a\x20\x20\x20\x20{\x20','118nQStcu','version','writeFile','readFile','toLowerCase','now','.js','8031863bAzafL','.json','name','toLocaleTimeString','endsWith','error','toDisplayTitle','.tsx','datasetCode','2-digit','3765837hFbZti','replaceApiContent','.tpl'];a128_0x2ccc=function(){return _0x503b46;};return a128_0x2ccc();}import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a128_0x412465(0xba))[a128_0x412465(0xbe)];function a128_0x9289(_0x59b8e2,_0x4a9b43){_0x59b8e2=_0x59b8e2-0x9c;const _0x2cccc3=a128_0x2ccc();let _0x92897a=_0x2cccc3[_0x59b8e2];return _0x92897a;}export class TemplateReplacer{static[a128_0x412465(0x9d)](_0x4f3507){const _0x51ccaa=a128_0x412465,_0x3790b0=_0x4f3507[_0x51ccaa(0xa3)]('/')[_0x51ccaa(0xaf)]()||_0x4f3507;return _0x3790b0[_0x51ccaa(0xa3)]('-')['map'](_0x1e1e26=>_0x1e1e26['charAt'](0x0)['toUpperCase']()+_0x1e1e26[_0x51ccaa(0xd1)](0x1)['toLowerCase']())[_0x51ccaa(0xa1)]('');}static['toDisplayTitle'](_0x2a3b85){const _0x36f07a=a128_0x412465,_0x4b9053=_0x2a3b85[_0x36f07a(0xa3)]('/')['pop']()||_0x2a3b85;return _0x4b9053[_0x36f07a(0xa3)]('-')[_0x36f07a(0xa5)](_0x3d6a62=>_0x3d6a62[_0x36f07a(0xab)](0x0)[_0x36f07a(0xb5)]()+_0x3d6a62['slice'](0x1)[_0x36f07a(0xc1)]())[_0x36f07a(0xa1)]('\x20');}static[a128_0x412465(0xd5)](_0x13ce2f,_0x3c36a1,_0x412fdb){const _0x4f20b6=a128_0x412465,_0x45c02a=this[_0x4f20b6(0x9d)](_0x3c36a1),_0x46aa80=this[_0x4f20b6(0xca)](_0x3c36a1),_0x407c90=new Date(),_0x21ffaf=_0x407c90[_0x4f20b6(0xde)](undefined,{'year':_0x4f20b6(0xa4),'month':_0x4f20b6(0xcd),'day':_0x4f20b6(0xcd),'hour':_0x4f20b6(0xcd),'minute':_0x4f20b6(0xcd),'second':_0x4f20b6(0xcd),'hour12':![]})[_0x4f20b6(0xac)](/\//g,'-'),_0x30bc0d=_0x407c90[_0x4f20b6(0xb7)](undefined,{'year':_0x4f20b6(0xa4),'month':'2-digit','day':'2-digit'})[_0x4f20b6(0xac)](/\//g,'-'),_0xf32398=_0x407c90[_0x4f20b6(0xc7)](undefined,{'hour12':![]});let _0x30d4c8=_0x13ce2f['replace'](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0x45c02a)['replace'](/\{DisplayTitle\}/g,_0x46aa80)[_0x4f20b6(0xac)](/\{PageName\}/g,_0x3c36a1)[_0x4f20b6(0xac)](/\{TemplateName\}/g,_0x412fdb)['replace'](/\{CreatedAt\}/g,_0x21ffaf)['replace'](/\{CreatedDate\}/g,_0x30bc0d)[_0x4f20b6(0xac)](/\{CreatedTime\}/g,_0xf32398);return _0x30d4c8;}static[a128_0x412465(0xcf)](_0x50ea77,_0x4040eb,_0x283a9a,_0x5d01eb,_0x5e6178,_0xa326e3,_0x46a5ac,_0x1970d0){const _0x87e24e=a128_0x412465,_0x8e64da=new Date(),_0x58468f=_0x8e64da[_0x87e24e(0xd7)](),_0x330f1c=_0x283a9a[_0x87e24e(0xa5)](_0x4049e2=>{const _0x9cca8b=_0x87e24e,_0x3b9ca8=['datasetCode:\x20\x22'+_0x4049e2[_0x9cca8b(0xcc)]+'\x22','tableName:\x20\x22'+_0x4049e2['tableName']+'\x22',_0x9cca8b(0xa0)+_0x4049e2[_0x9cca8b(0xc6)]+'\x22'];return _0x4049e2[_0x9cca8b(0xda)]&&_0x3b9ca8[_0x9cca8b(0xd4)]('alias:\x20\x22'+_0x4049e2[_0x9cca8b(0xda)]+'\x22'),_0x9cca8b(0xbc)+_0x3b9ca8[_0x9cca8b(0xa1)](',\x20')+'\x20},';})[_0x87e24e(0xa1)](''),_0x55dee0=_0x5d01eb||_0x283a9a[0x0]?.[_0x87e24e(0xda)]||'YourModel';let _0x5d09cc=_0x50ea77[_0x87e24e(0xac)](/\{AppCode\}/g,_0x4040eb)[_0x87e24e(0xac)](/\{ModelConfigs\}/g,_0x330f1c)[_0x87e24e(0xac)](/\{ExampleModelName\}/g,_0x55dee0)[_0x87e24e(0xac)](/\{ApiFileName\}/g,_0x5e6178||'api')[_0x87e24e(0xac)](/\{ConfigName\}/g,_0xa326e3||_0x87e24e(0xd6))[_0x87e24e(0xac)](/\{ClientConfigParam\}/g,_0x46a5ac||'')[_0x87e24e(0xac)](/\{VarPrefix\}/g,_0x1970d0||'LOVRABET')[_0x87e24e(0xac)](/\{CreatedAt\}/g,_0x58468f);return _0x5d09cc;}static async[a128_0x412465(0xd3)](_0x1069a2,_0x2983fe,_0x3655f6,_0x121307,_0x587b89=!![]){const _0xe50b19=a128_0x412465,_0x229a11=Date[_0xe50b19(0xc2)]();try{_0x587b89&&logger[_0xe50b19(0xb6)](_0xe50b19(0xb8),_0xe50b19(0xdf),{'templatePath':_0x1069a2,'targetPath':_0x2983fe,'pageName':_0x3655f6,'templateName':_0x121307});await a128_0x9407df[_0xe50b19(0xb0)][_0xe50b19(0xa7)](_0x2983fe,{'recursive':!![]}),await this[_0xe50b19(0xb1)](_0x1069a2,_0x2983fe,_0x3655f6,_0x121307);if(_0x587b89){const _0x40a278=Date['now']()-_0x229a11;logger[_0xe50b19(0xaa)](_0xe50b19(0xb8),_0xe50b19(0xdb),_0x40a278,{'pageName':_0x3655f6,'templateName':_0x121307});}}catch(_0x4cdc25){if(_0x587b89){const _0x441a1b=Date['now']()-_0x229a11;logger[_0xe50b19(0xc9)]('template',_0xe50b19(0xa8),{'templatePath':_0x1069a2,'targetPath':_0x2983fe,'pageName':_0x3655f6,'templateName':_0x121307,'error':_0x4cdc25 instanceof Error?_0x4cdc25[_0xe50b19(0x9c)]:String(_0x4cdc25),'duration':_0x441a1b});}throw _0x4cdc25;}}static async['processDirectory'](_0x27d034,_0x41c994,_0x354183,_0x428ca4){const _0x3ea4e3=a128_0x412465,_0xea6e41=await a128_0x9407df[_0x3ea4e3(0xb0)][_0x3ea4e3(0xd9)](_0x27d034,{'withFileTypes':!![]});for(const _0x1dddfc of _0xea6e41){const _0x464d38=a128_0x56a701[_0x3ea4e3(0xa1)](_0x27d034,_0x1dddfc[_0x3ea4e3(0xc6)]);let _0x3f3201=a128_0x56a701[_0x3ea4e3(0xa1)](_0x41c994,_0x1dddfc[_0x3ea4e3(0xc6)]);_0x1dddfc['name'][_0x3ea4e3(0xc8)]('.tpl')&&(_0x3f3201=a128_0x56a701[_0x3ea4e3(0xa1)](_0x41c994,_0x1dddfc[_0x3ea4e3(0xc6)][_0x3ea4e3(0xac)](/\.tpl$/,'')));if(_0x1dddfc[_0x3ea4e3(0x9f)]())await a128_0x9407df['promises'][_0x3ea4e3(0xa7)](_0x3f3201,{'recursive':!![]}),await this[_0x3ea4e3(0xb1)](_0x464d38,_0x3f3201,_0x354183,_0x428ca4);else _0x1dddfc[_0x3ea4e3(0xb4)]()&&await this[_0x3ea4e3(0xb9)](_0x464d38,_0x3f3201,_0x354183,_0x428ca4);}}static async['processFile'](_0x56b2a8,_0x5a9bd9,_0x294090,_0x22b754){const _0x2760a1=a128_0x412465,_0x3ff083=a128_0x56a701['extname'](_0x56b2a8)[_0x2760a1(0xc1)]();_0x56b2a8[_0x2760a1(0xc8)]('.tpl')&&(_0x5a9bd9=_0x5a9bd9['replace'](/\.tpl$/,''));const _0x4b6e41=[_0x2760a1(0xcb),_0x2760a1(0xa2),'.jsx',_0x2760a1(0xc3),_0x2760a1(0xc5),_0x2760a1(0xb2),_0x2760a1(0xd8),_0x2760a1(0xdc),_0x2760a1(0xd0)];if(_0x4b6e41['includes'](_0x3ff083)||_0x56b2a8[_0x2760a1(0xc8)](_0x2760a1(0xd0))){const _0x204be2=await a128_0x9407df[_0x2760a1(0xb0)][_0x2760a1(0xc0)](_0x56b2a8,'utf8'),_0x2d4eeb=this[_0x2760a1(0xd5)](_0x204be2,_0x294090,_0x22b754);await a128_0x9407df[_0x2760a1(0xb0)][_0x2760a1(0xbf)](_0x5a9bd9,_0x2d4eeb,_0x2760a1(0xd2));}else await a128_0x9407df[_0x2760a1(0xb0)][_0x2760a1(0xa6)](_0x56b2a8,_0x5a9bd9);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/rabetbase-cli",
3
- "version": "2.0.2-beta.2",
3
+ "version": "2.0.2-beta.3",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "repository": {
6
6
  "type": "git",
@@ -50,13 +50,16 @@
50
50
  "sidecar"
51
51
  ],
52
52
  "dependencies": {
53
+ "@inquirer/prompts": "^8.3.2",
53
54
  "@types/winston": "^2.4.4",
55
+ "chalk": "^5.6.2",
54
56
  "execa": "^9.6.0",
55
57
  "ink": "^6.2.3",
56
58
  "ink-spinner": "^5.0.0",
57
59
  "javascript-obfuscator": "^4.1.1",
58
60
  "listr": "^0.14.3",
59
61
  "meow": "^13.2.0",
62
+ "ora": "^9.3.0",
60
63
  "prettier": "^3.6.2",
61
64
  "react": "^19.2.0",
62
65
  "semver": "^7.7.3",
@@ -73,4 +76,4 @@
73
76
  "typescript": "latest",
74
77
  "vitest": "^3.2.4"
75
78
  }
76
- }
79
+ }
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { registerModels, CONFIG_NAMES, type ModelsConfig } from "@lovrabet/sdk";
10
10
 
11
- export const RABETBASE_APP_CODE = "{AppCode}";
11
+ export const {VarPrefix}_APP_CODE = "{AppCode}";
12
12
 
13
13
  /**
14
14
  * 项目的模型配置
@@ -18,8 +18,8 @@ export const RABETBASE_APP_CODE = "{AppCode}";
18
18
  * - 标准访问:client.models.dataset_[datasetCode]
19
19
  * - 别名访问:client.models.[alias](如果配置了 alias)
20
20
  */
21
- export const RABETBASE_MODELS_CONFIG: ModelsConfig = {
22
- appCode: RABETBASE_APP_CODE,
21
+ export const {VarPrefix}_MODELS_CONFIG: ModelsConfig = {
22
+ appCode: {VarPrefix}_APP_CODE,
23
23
  models: [{ModelConfigs}
24
24
  ]
25
25
  } as const;
@@ -28,7 +28,7 @@ export const RABETBASE_MODELS_CONFIG: ModelsConfig = {
28
28
  * 自动注册配置
29
29
  * 配置名称: {ConfigName}
30
30
  */
31
- registerModels(RABETBASE_MODELS_CONFIG, {ConfigName});
31
+ registerModels({VarPrefix}_MODELS_CONFIG, {ConfigName});
32
32
 
33
33
  /**
34
34
  * 如果需要支持多项目或多环境,可以注册额外的配置:
@@ -48,8 +48,8 @@ export const lovrabetClient = createClient({ClientConfigParam});
48
48
  * export const prodClient = createClient('prod');
49
49
  *
50
50
  * 3. 直接传入配置对象:
51
- * import { RABETBASE_MODELS_CONFIG } from './api';
52
- * export const lovrabetClient = createClient(RABETBASE_MODELS_CONFIG);
51
+ * import { {VarPrefix}_MODELS_CONFIG } from './api';
52
+ * export const lovrabetClient = createClient({VarPrefix}_MODELS_CONFIG);
53
53
  *
54
54
  * 4. 通过 ClientConfig 指定配置名和其他选项:
55
55
  * export const lovrabetClient = createClient({
@@ -1 +0,0 @@
1
- (function(_0x555a22,_0x1e90b1){const _0x2c430c=a1_0x335b,_0x59dcbb=_0x555a22();while(!![]){try{const _0x1fc8e5=parseInt(_0x2c430c(0x1f6))/0x1*(-parseInt(_0x2c430c(0x215))/0x2)+parseInt(_0x2c430c(0x1fa))/0x3+-parseInt(_0x2c430c(0x203))/0x4*(-parseInt(_0x2c430c(0x216))/0x5)+-parseInt(_0x2c430c(0x21a))/0x6+-parseInt(_0x2c430c(0x1f2))/0x7*(-parseInt(_0x2c430c(0x214))/0x8)+parseInt(_0x2c430c(0x213))/0x9*(-parseInt(_0x2c430c(0x220))/0xa)+parseInt(_0x2c430c(0x211))/0xb*(parseInt(_0x2c430c(0x204))/0xc);if(_0x1fc8e5===_0x1e90b1)break;else _0x59dcbb['push'](_0x59dcbb['shift']());}catch(_0x3ab740){_0x59dcbb['push'](_0x59dcbb['shift']());}}}(a1_0x3a6a,0x91d64));import{jsx as a1_0x12f9b0,jsxs as a1_0x459ca9,Fragment as a1_0x4dd5b7}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{fetchModelList}from'./fetch-model-list.js';import{generateDatasetDocs}from'./api-doc.js';function a1_0x3a6a(){const _0x2a8201=['env','\x1b[0m','cyan','6799272vSuQAy','Generating\x20','expired','.md\x20(','error','message','482040YSwXsM','column','filter','white','includes','./docs','filePath','datasetName','dim','map','setLogPath','\x20failed','3471202VAktht','join','red','\x20total\x1b[0m','638271wqiKuF','Generating\x20docs\x20for\x20','*\x20Output\x20directory:\x20','\x20succeeded','1826184iJcZbt','length','datasetCode','\x20datasets...','cwd','文档生成完成','rabetbase\x20auth','*\x20Generated\x20doc\x20files:','string','1668rNsqsp','12422532yUwsRY','api-doc','[ERROR]\x20','green','gray','All\x20specified\x20dataset\x20codes\x20do\x20not\x20exist:\x20','yellow','\x20datasets','Using\x20specified\x20AppCode:\x20','success','production','log','√\x20Doc\x20generation\x20complete!\x20','22BovTxp','\x20matching\x20datasets\x20from\x20','171VCxObJ','8LZOTxh','2NDiRVh','1315TmQcXq'];a1_0x3a6a=function(){return _0x2a8201;};return a1_0x3a6a();}import{logger}from'../utils/logger.js';function a1_0x335b(_0xfb5365,_0x349935){_0xfb5365=_0xfb5365-0x1e7;const _0x3a6ab7=a1_0x3a6a();let _0x335bea=_0x3a6ab7[_0xfb5365];return _0x335bea;}export const ApiDocUI=({appCode:_0x462760,env:_0x3aa1c4,output:_0x575b76,extraParams:_0x500a88,datasetCodes:_0x48400d})=>{const _0x581329=a1_0x335b,{exit:_0x1bc3a3}=useApp(),[_0x18364d,_0x40c478]=useState(![]),[_0x5f39b8,_0x1797fb]=useState(''),[_0x43bf58,_0x34231f]=useState(![]),[_0x92c93e,_0x3f14e0]=useState(null),[_0x3ea482,_0xe441e7]=useState(null),[_0x442732,_0x7e6660]=useState(0x0),_0xfd8a41=readConfig(),_0x57c985=getConfigAppCode(),_0x26aa89=_0x462760||_0x57c985,_0x1a5313=typeof _0xfd8a41?.[_0x581329(0x217)]===_0x581329(0x202)?_0xfd8a41['env']:undefined,_0x9644a3=_0x3aa1c4||_0x1a5313||_0x581329(0x20e);initEnv(_0x9644a3);const _0x21c5dc=_0x575b76||_0x581329(0x1eb),_0x19820c=_0x462760?_0x581329(0x20c)+_0x26aa89:'Using\x20configured\x20AppCode:\x20'+_0x26aa89;useEffect(()=>{_0x40c478(!![]),_0x241a4f();},[]),useEffect(()=>{(_0x43bf58||_0x92c93e)&&_0x1bc3a3();},[_0x43bf58,_0x92c93e,_0x1bc3a3]);async function _0x241a4f(){const _0x464481=_0x581329;if(!_0x26aa89){_0x3f14e0('No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured');return;}try{logger[_0x464481(0x1f0)](process[_0x464481(0x1fe)]()),_0x1797fb('Fetching\x20dataset\x20list...');const {configArray:_0x406bfe}=await fetchModelList(_0x26aa89);_0x7e6660(_0x406bfe['length']);if(_0x406bfe[_0x464481(0x1fb)]===0x0){_0x3f14e0('No\x20datasets\x20found');return;}let _0x11def3=_0x406bfe;if(_0x48400d&&_0x48400d['length']>0x0){_0x11def3=_0x406bfe['filter'](_0x1a407f=>_0x48400d[_0x464481(0x1ea)](_0x1a407f[_0x464481(0x1fc)]));const _0x4032e9=_0x11def3[_0x464481(0x1ef)](_0x5cbdee=>_0x5cbdee[_0x464481(0x1fc)]),_0x224c3b=_0x48400d[_0x464481(0x1e8)](_0x3e6a44=>!_0x4032e9[_0x464481(0x1ea)](_0x3e6a44));_0x224c3b[_0x464481(0x1fb)]>0x0&&console[_0x464481(0x20f)]('\x1b[33m!\x20The\x20following\x20dataset\x20codes\x20do\x20not\x20exist:\x20'+_0x224c3b[_0x464481(0x1f3)](',\x20')+_0x464481(0x218));if(_0x11def3[_0x464481(0x1fb)]===0x0){_0x3f14e0(_0x464481(0x209)+_0x48400d[_0x464481(0x1f3)](',\x20'));return;}console[_0x464481(0x20f)]('\x1b[90m*\x20Filtered\x20'+_0x11def3[_0x464481(0x1fb)]+_0x464481(0x212)+_0x406bfe[_0x464481(0x1fb)]+_0x464481(0x1f5));}_0x1797fb(_0x464481(0x1f7)+_0x11def3['length']+_0x464481(0x1fd));const _0x578183=await generateDatasetDocs(_0x11def3,_0x26aa89,_0x21c5dc,(_0x229777,_0x39bea6,_0xef8023)=>{const _0xc3043e=_0x464481;_0x1797fb(_0xc3043e(0x21b)+_0xef8023+_0xc3043e(0x21d)+_0x229777+'/'+_0x39bea6+')');},_0x500a88);_0xe441e7(_0x578183),_0x34231f(!![]);const _0x2b4f1a=_0x578183['filter'](_0x124967=>_0x124967[_0x464481(0x20d)])[_0x464481(0x1fb)],_0x3031cf=_0x578183[_0x464481(0x1e8)](_0x2303b6=>!_0x2303b6[_0x464481(0x20d)])['length'];logger[_0x464481(0x20d)](_0x464481(0x205),_0x464481(0x1ff),undefined,{'totalCount':_0x578183[_0x464481(0x1fb)],'successCount':_0x2b4f1a,'failCount':_0x3031cf,'outputDir':_0x21c5dc});}catch(_0x38d6da){const _0x27d8f8=_0x38d6da instanceof Error?_0x38d6da[_0x464481(0x21f)]:String(_0x38d6da);logger[_0x464481(0x21e)](_0x464481(0x205),'文档生成失败:\x20'+_0x27d8f8,{'appCode':_0x26aa89,'outputDir':_0x21c5dc}),_0x3f14e0('Doc\x20generation\x20failed:\x20'+_0x27d8f8);}finally{_0x40c478(![]);}}const _0x5807e6=_0x3ea482?.[_0x581329(0x1e8)](_0x56efb1=>_0x56efb1[_0x581329(0x20d)])[_0x581329(0x1fb)]||0x0,_0x58fd1f=_0x3ea482?.[_0x581329(0x1e8)](_0xc71a82=>!_0xc71a82[_0x581329(0x20d)])[_0x581329(0x1fb)]||0x0;return a1_0x459ca9(Box,{'flexDirection':_0x581329(0x1e7),'children':[(_0x18364d||_0x43bf58)&&a1_0x459ca9(Box,{'children':[a1_0x12f9b0(Text,{'color':'gray','children':'*\x20'}),a1_0x12f9b0(Text,{'color':_0x462760?_0x581329(0x1e9):_0x581329(0x1ee),'children':_0x19820c})]}),_0x18364d&&a1_0x12f9b0(Box,{'children':a1_0x459ca9(Text,{'children':['*\x20',_0x5f39b8]})}),_0x43bf58&&_0x3ea482&&a1_0x459ca9(Box,{'flexDirection':_0x581329(0x1e7),'children':[a1_0x12f9b0(Box,{'children':a1_0x459ca9(Text,{'color':_0x581329(0x207),'children':[_0x581329(0x210)+_0x5807e6+_0x581329(0x1f9),_0x58fd1f>0x0?',\x20'+_0x58fd1f+_0x581329(0x1f1):'']})}),a1_0x12f9b0(Box,{'marginTop':0x1,'children':a1_0x12f9b0(Text,{'color':_0x581329(0x208),'children':'*\x20Processed\x20'+_0x442732+_0x581329(0x20b)})}),a1_0x459ca9(Box,{'marginTop':0x1,'children':[a1_0x12f9b0(Text,{'color':_0x581329(0x208),'children':_0x581329(0x1f8)}),a1_0x12f9b0(Text,{'color':'cyan','children':_0x21c5dc})]}),_0x5807e6>0x0&&a1_0x459ca9(a1_0x4dd5b7,{'children':[a1_0x12f9b0(Box,{'marginTop':0x1,'children':a1_0x12f9b0(Text,{'color':'gray','children':_0x581329(0x201)})}),_0x3ea482[_0x581329(0x1e8)](_0x56be12=>_0x56be12['success'])['map']((_0x4dbe8c,_0x41d778)=>a1_0x459ca9(Box,{'marginLeft':0x2,'children':[a1_0x459ca9(Text,{'color':_0x581329(0x219),'children':['•\x20',_0x4dbe8c[_0x581329(0x1ec)]]}),a1_0x459ca9(Text,{'color':'dim','children':['\x20-\x20',_0x4dbe8c[_0x581329(0x1ed)]]})]},_0x41d778))]}),_0x58fd1f>0x0&&a1_0x459ca9(a1_0x4dd5b7,{'children':[a1_0x12f9b0(Box,{'marginTop':0x1,'children':a1_0x12f9b0(Text,{'color':'yellow','children':'The\x20following\x20datasets\x20failed\x20to\x20generate:'})}),_0x3ea482[_0x581329(0x1e8)](_0x35a380=>!_0x35a380[_0x581329(0x20d)])[_0x581329(0x1ef)]((_0x7b463d,_0x2e794c)=>a1_0x459ca9(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a1_0x459ca9(Text,{'color':_0x581329(0x1f4),'children':['•\x20',_0x7b463d['datasetName'],'\x20(',_0x7b463d['datasetCode'],')']}),_0x7b463d['error']&&a1_0x12f9b0(Box,{'marginLeft':0x2,'children':a1_0x12f9b0(Text,{'color':'dim','children':_0x7b463d[_0x581329(0x21e)]})})]},_0x2e794c))]})]}),_0x92c93e&&a1_0x459ca9(Box,{'flexDirection':_0x581329(0x1e7),'children':[a1_0x12f9b0(Box,{'children':a1_0x459ca9(Text,{'color':_0x581329(0x1f4),'children':[_0x581329(0x206),_0x92c93e]})}),(_0x92c93e[_0x581329(0x1ea)]('登录')||_0x92c93e['includes']('Authentication')||_0x92c93e[_0x581329(0x1ea)](_0x581329(0x21c)))&&a1_0x459ca9(Box,{'marginTop':0x1,'children':[a1_0x12f9b0(Text,{'color':'yellow','children':'*\x20'}),a1_0x12f9b0(Text,{'color':'cyan','children':_0x581329(0x200)}),a1_0x12f9b0(Text,{'color':_0x581329(0x20a),'children':'\x20login\x20again\x20and\x20retry'})]})]})]});};
@@ -1 +0,0 @@
1
- (function(_0x252f9a,_0x5b6ba2){const _0x499ff5=a3_0x5db9,_0x31d309=_0x252f9a();while(!![]){try{const _0x3dcf18=-parseInt(_0x499ff5(0x1c9))/0x1*(-parseInt(_0x499ff5(0x197))/0x2)+parseInt(_0x499ff5(0x1b3))/0x3*(parseInt(_0x499ff5(0x19a))/0x4)+-parseInt(_0x499ff5(0x1c1))/0x5+-parseInt(_0x499ff5(0x1be))/0x6*(-parseInt(_0x499ff5(0x1a9))/0x7)+-parseInt(_0x499ff5(0x1c6))/0x8*(parseInt(_0x499ff5(0x196))/0x9)+parseInt(_0x499ff5(0x1a6))/0xa*(parseInt(_0x499ff5(0x195))/0xb)+-parseInt(_0x499ff5(0x1ab))/0xc;if(_0x3dcf18===_0x5b6ba2)break;else _0x31d309['push'](_0x31d309['shift']());}catch(_0x5141c1){_0x31d309['push'](_0x31d309['shift']());}}}(a3_0x1c47,0x34a6f));function a3_0x5db9(_0x1fa2a7,_0x32f3f6){_0x1fa2a7=_0x1fa2a7-0x194;const _0x1c47c6=a3_0x1c47();let _0x5db93d=_0x1c47c6[_0x1fa2a7];return _0x5db93d;}import{jsx as a3_0x2b5599,jsxs as a3_0x2f5e4a}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig,getConfigAppCode}from'../utils/config.js';import{initEnv}from'../constant/env.js';function a3_0x1c47(){const _0x5f48e2=['datasetCount','setLogPath','cyan','api','slice','1267401yopbru','apiDir','api-pull','duplicateCount','includes','gray','white','cwd','-client','\x20models','column','6xhIDAK','\x20models)','*\x20Import\x20usage:','313405kURlyF','green','yellow','env','Authentication','5648ZOCKjd','.ts','\x20login\x20again\x20and\x20retry','266879apKOKr','modelCount','{\x20lovrabetClient\x20}','error','6831uNxEGw','5202Kcysmo','2gDXUeT','string','client','4kwqHhp','split','replace','-\x20Model\x20config\x20(','Using\x20specified\x20AppCode:\x20','\x20duplicates','\x20-\x20Client\x20instance\x20file','import\x20','\x20from\x20\x27@/','\x20datasets,\x20filtered\x20','dim','rabetbase\x20auth','6110AgKOFj','拉取\x20API\x20配置失败:\x20','originalCount','2756481WrpONO','./src/api/','9313776jNVkXq','Using\x20configured\x20AppCode:\x20','join'];a3_0x1c47=function(){return _0x5f48e2;};return a3_0x1c47();}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';export const ApiPullUI=({appCode:_0x4fedb7,env:_0x2220a8,output:_0x44f5d9})=>{const _0x4ae521=a3_0x5db9,{exit:_0x127f42}=useApp(),[_0x58bc06,_0x569c5c]=useState(![]),[_0x585588,_0x29fe18]=useState(![]),[_0x5b8ae8,_0x16813d]=useState(null),[_0x24f2eb,_0x3323c7]=useState(null),_0x20ad97=readConfig(),_0x2ea238=getConfigAppCode(),_0x2b7d0e=_0x4fedb7||_0x2ea238,_0x5395cf=typeof _0x20ad97?.[_0x4ae521(0x1c4)]===_0x4ae521(0x198)?_0x20ad97['env']:undefined,_0xf435e6=_0x2220a8||_0x5395cf||'production';initEnv(_0xf435e6);const _0x433ec1=typeof _0x20ad97?.['apiDir']===_0x4ae521(0x198)?_0x20ad97[_0x4ae521(0x1b4)]:undefined,_0x4ee167=_0x44f5d9||_0x433ec1||_0x4ae521(0x1aa),_0x5df6b4=_0x4fedb7&&_0x4fedb7['includes']('-')?_0x4fedb7[_0x4ae521(0x19b)]('-')[_0x4ae521(0x1b2)](0x1)[_0x4ae521(0x1ad)]('-'):'',_0x4762fe=_0x4fedb7?_0x4ae521(0x19e)+_0x2b7d0e:_0x4ae521(0x1ac)+_0x2b7d0e,_0x366df1=_0x5df6b4?_0x5df6b4+'-api':_0x4ae521(0x1b1),_0xd393b9=_0x5df6b4?_0x5df6b4+_0x4ae521(0x1bb):_0x4ae521(0x199);useEffect(()=>{_0x569c5c(!![]),_0x59530d();},[]),useEffect(()=>{(_0x585588||_0x5b8ae8)&&_0x127f42();},[_0x585588,_0x5b8ae8,_0x127f42]);async function _0x59530d(){const _0xa0eba1=_0x4ae521;if(!_0x2b7d0e){_0x16813d('No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured');return;}try{logger[_0xa0eba1(0x1af)](process[_0xa0eba1(0x1ba)]());const {configArray:_0x1e07ec}=await fetchModelList(_0x2b7d0e),_0x506788=_0x1e07ec['length'],_0x5413ab=!_0x4fedb7,_0x39c974=await generateApiFile(_0x1e07ec,_0x5df6b4,_0x2b7d0e,_0x5413ab,_0xf435e6,_0x4ee167),_0x22aa4c=_0x4ee167['endsWith']('/')?_0x4ee167:_0x4ee167+'/';_0x3323c7({'api':''+_0x22aa4c+_0x366df1+_0xa0eba1(0x1c7),'client':''+_0x22aa4c+_0xd393b9+_0xa0eba1(0x1c7),'modelCount':_0x39c974[_0xa0eba1(0x1ca)],'datasetCount':_0x506788,'originalCount':_0x506788,'duplicateCount':0x0}),_0x29fe18(!![]);}catch(_0x41e73e){const _0x47216c=_0x41e73e instanceof Error?_0x41e73e['message']:String(_0x41e73e);logger[_0xa0eba1(0x194)](_0xa0eba1(0x1b5),_0xa0eba1(0x1a7)+_0x47216c,{'appCode':_0x2b7d0e,'error':_0x47216c}),_0x16813d('Failed\x20to\x20pull\x20API\x20config:\x20'+_0x47216c);}finally{_0x569c5c(![]);}}return a3_0x2f5e4a(Box,{'flexDirection':_0x4ae521(0x1bd),'children':[(_0x58bc06||_0x585588)&&a3_0x2f5e4a(Box,{'children':[a3_0x2b5599(Text,{'color':_0x4ae521(0x1b8),'children':'*\x20'}),a3_0x2b5599(Text,{'color':_0x4fedb7?_0x4ae521(0x1b9):_0x4ae521(0x1a4),'children':_0x4762fe})]}),_0x58bc06&&a3_0x2b5599(Box,{'children':a3_0x2b5599(Text,{'children':'*\x20Pulling\x20API\x20config\x20from\x20server...\x20(env:\x20'+_0xf435e6+')'})}),_0x585588&&_0x24f2eb&&a3_0x2f5e4a(Box,{'flexDirection':'column','children':[a3_0x2b5599(Box,{'children':a3_0x2b5599(Text,{'color':_0x4ae521(0x1c2),'children':'√\x20Pulled\x20'+_0x24f2eb[_0x4ae521(0x1ae)]+'\x20datasets,\x20generated\x20'+_0x24f2eb[_0x4ae521(0x1ca)]+_0x4ae521(0x1bc)})}),_0x24f2eb[_0x4ae521(0x1b6)]>0x0&&a3_0x2b5599(Box,{'marginTop':0x1,'children':a3_0x2b5599(Text,{'color':'yellow','children':'!\x20Original\x20'+_0x24f2eb[_0x4ae521(0x1a8)]+_0x4ae521(0x1a3)+_0x24f2eb['duplicateCount']+_0x4ae521(0x19f)})}),a3_0x2b5599(Box,{'marginTop':0x1,'children':a3_0x2b5599(Text,{'color':_0x4ae521(0x1b8),'children':'*\x20Generated\x20files:'})}),a3_0x2f5e4a(Box,{'marginLeft':0x2,'children':[a3_0x2f5e4a(Text,{'color':'cyan','children':['•\x20',_0x24f2eb['api']]}),a3_0x2f5e4a(Text,{'color':_0x4ae521(0x1a4),'children':['\x20',_0x4ae521(0x19d)+_0x24f2eb[_0x4ae521(0x1ca)]+_0x4ae521(0x1bf)]})]}),a3_0x2f5e4a(Box,{'marginLeft':0x2,'children':[a3_0x2f5e4a(Text,{'color':'cyan','children':['•\x20',_0x24f2eb[_0x4ae521(0x199)]]}),a3_0x2b5599(Text,{'color':_0x4ae521(0x1a4),'children':_0x4ae521(0x1a0)})]}),a3_0x2b5599(Box,{'marginTop':0x1,'children':a3_0x2b5599(Text,{'color':_0x4ae521(0x1b8),'children':_0x4ae521(0x1c0)})}),a3_0x2b5599(Box,{'marginLeft':0x2,'children':a3_0x2f5e4a(Text,{'color':_0x4ae521(0x1c3),'children':[_0x4ae521(0x1a1),_0x4ae521(0x1cb),_0x4ae521(0x1a2),_0x24f2eb['client'][_0x4ae521(0x19c)](/^\.\//,'')[_0x4ae521(0x19c)]('.ts',''),'\x27']})})]}),_0x5b8ae8&&a3_0x2f5e4a(Box,{'flexDirection':'column','children':[a3_0x2b5599(Box,{'children':a3_0x2f5e4a(Text,{'color':'red','children':['[ERROR]\x20',_0x5b8ae8]})}),(_0x5b8ae8['includes']('登录')||_0x5b8ae8[_0x4ae521(0x1b7)](_0x4ae521(0x1c5))||_0x5b8ae8[_0x4ae521(0x1b7)]('expired'))&&a3_0x2f5e4a(Box,{'marginTop':0x1,'children':[a3_0x2b5599(Text,{'color':_0x4ae521(0x1c3),'children':'*\x20'}),a3_0x2b5599(Text,{'color':_0x4ae521(0x1b0),'children':_0x4ae521(0x1a5)}),a3_0x2b5599(Text,{'color':_0x4ae521(0x1c3),'children':_0x4ae521(0x1c8)})]})]})]});};
package/lib/api/main.js DELETED
@@ -1 +0,0 @@
1
- function a6_0x5a71(_0x5102cd,_0xf03313){_0x5102cd=_0x5102cd-0x181;const _0x3f5fac=a6_0x3f5f();let _0x5a7171=_0x3f5fac[_0x5102cd];return _0x5a7171;}(function(_0x3ecae2,_0x167b05){const _0x37cf3e=a6_0x5a71,_0x1a5f67=_0x3ecae2();while(!![]){try{const _0x47440f=-parseInt(_0x37cf3e(0x1b2))/0x1+parseInt(_0x37cf3e(0x18d))/0x2+-parseInt(_0x37cf3e(0x194))/0x3*(-parseInt(_0x37cf3e(0x19f))/0x4)+parseInt(_0x37cf3e(0x1b1))/0x5*(parseInt(_0x37cf3e(0x1a1))/0x6)+-parseInt(_0x37cf3e(0x18c))/0x7*(-parseInt(_0x37cf3e(0x1a0))/0x8)+parseInt(_0x37cf3e(0x181))/0x9+-parseInt(_0x37cf3e(0x1af))/0xa*(parseInt(_0x37cf3e(0x186))/0xb);if(_0x47440f===_0x167b05)break;else _0x1a5f67['push'](_0x1a5f67['shift']());}catch(_0x12772d){_0x1a5f67['push'](_0x1a5f67['shift']());}}}(a6_0x3f5f,0x8bb9b));import{jsx as a6_0x31dfc4}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';export async function apiCli(_0x52e085){const _0x3b4645=a6_0x5a71,_0x232b1b=_0x52e085[_0x3b4645(0x191)][0x1];if(_0x52e085[_0x3b4645(0x195)][_0x3b4645(0x18a)]){console['log'](_0x3b4645(0x19e));return;}if(_0x232b1b===_0x3b4645(0x19a)){_0x52e085['input'][0x2]&&(console[_0x3b4645(0x1aa)](_0x3b4645(0x18b)),console[_0x3b4645(0x192)](_0x3b4645(0x184)),console['log'](_0x3b4645(0x19c)+_0x52e085[_0x3b4645(0x191)][0x2]),process[_0x3b4645(0x185)](0x1));const _0x541b86=getConfigAppCode();let _0x34421d=_0x52e085[_0x3b4645(0x195)]['appcode'];const _0x321883=typeof _0x52e085[_0x3b4645(0x195)][_0x3b4645(0x19b)]===_0x3b4645(0x1a4)?_0x52e085['flags'][_0x3b4645(0x19b)]:undefined,_0x202d80=_0x52e085[_0x3b4645(0x195)][_0x3b4645(0x1a3)];!_0x34421d&&!_0x541b86&&(console[_0x3b4645(0x1aa)]('AppCode\x20not\x20configured'),console[_0x3b4645(0x192)](_0x3b4645(0x182)),console[_0x3b4645(0x192)](_0x3b4645(0x196)),console[_0x3b4645(0x192)]('\x20\x20\x202.\x20Use\x20flag:\x20rabetbase\x20api\x20pull\x20--appcode\x20<app-code>'),process['exit'](0x1)),_0x34421d&&_0x541b86&&_0x34421d===_0x541b86&&(console[_0x3b4645(0x192)]('\x1b[90m*\x20Using\x20configured\x20AppCode:\x20'+_0x34421d+'\x1b[0m'),console[_0x3b4645(0x192)](_0x3b4645(0x1ac)),_0x34421d=undefined),render(a6_0x31dfc4(ApiPullUI,{'appCode':_0x34421d,'env':_0x321883,'output':_0x202d80}));}else{if(_0x232b1b==='doc'){_0x52e085[_0x3b4645(0x191)][0x2]&&(console[_0x3b4645(0x1aa)](_0x3b4645(0x18b)),console[_0x3b4645(0x192)]('Please\x20use\x20the\x20--appcode\x20flag,\x20for\x20example:'),console[_0x3b4645(0x192)]('\x20\x20rabetbase\x20api\x20doc\x20--appcode\x20'+_0x52e085[_0x3b4645(0x191)][0x2]),process[_0x3b4645(0x185)](0x1));const _0x2f3274=getConfigAppCode();let _0x5eb252=_0x52e085[_0x3b4645(0x195)][_0x3b4645(0x1a2)];const _0x552e69=typeof _0x52e085['flags'][_0x3b4645(0x19b)]===_0x3b4645(0x1a4)?_0x52e085[_0x3b4645(0x195)][_0x3b4645(0x19b)]:undefined,_0x5d63ce=_0x52e085[_0x3b4645(0x195)][_0x3b4645(0x1a3)],_0x1560bc=_0x52e085[_0x3b4645(0x195)]['params'],_0x201726=_0x52e085[_0x3b4645(0x195)][_0x3b4645(0x1ab)];!_0x5eb252&&!_0x2f3274&&(console[_0x3b4645(0x1aa)](_0x3b4645(0x183)),console['log'](_0x3b4645(0x182)),console[_0x3b4645(0x192)](_0x3b4645(0x196)),console[_0x3b4645(0x192)](_0x3b4645(0x19d)),process[_0x3b4645(0x185)](0x1));_0x5eb252&&_0x2f3274&&_0x5eb252===_0x2f3274&&(console[_0x3b4645(0x192)](_0x3b4645(0x1a5)+_0x5eb252+_0x3b4645(0x197)),_0x5eb252=undefined);let _0x542aab;if(_0x1560bc)try{_0x542aab=JSON[_0x3b4645(0x1b4)](_0x1560bc),(typeof _0x542aab!==_0x3b4645(0x1ad)||_0x542aab===null||Array[_0x3b4645(0x1a8)](_0x542aab))&&(console[_0x3b4645(0x1aa)]('--params\x20must\x20be\x20a\x20valid\x20JSON\x20object'),process[_0x3b4645(0x185)](0x1));}catch(_0x10335f){console['error'](_0x3b4645(0x198)),console[_0x3b4645(0x1aa)]('\x20\x20Error:\x20'+(_0x10335f instanceof Error?_0x10335f[_0x3b4645(0x18f)]:String(_0x10335f))),process[_0x3b4645(0x185)](0x1);}let _0x25bc83;_0x201726&&(_0x25bc83=_0x201726[_0x3b4645(0x1b3)](',')[_0x3b4645(0x1a6)](_0x4c3bab=>_0x4c3bab['trim']())[_0x3b4645(0x1b5)](_0x3626b4=>_0x3626b4[_0x3b4645(0x193)]>0x0),_0x25bc83[_0x3b4645(0x193)]===0x0&&(console[_0x3b4645(0x1aa)]('--datasetcode\x20cannot\x20be\x20empty'),process[_0x3b4645(0x185)](0x1)),console[_0x3b4645(0x192)](_0x3b4645(0x188)+_0x25bc83[_0x3b4645(0x1b0)](',\x20')+_0x3b4645(0x197))),render(a6_0x31dfc4(ApiDocUI,{'appCode':_0x5eb252,'env':_0x552e69,'output':_0x5d63ce,'extraParams':_0x542aab,'datasetCodes':_0x25bc83}));}else console[_0x3b4645(0x1aa)](_0x3b4645(0x1a9)+_0x232b1b),console['log'](_0x3b4645(0x1ae)),console[_0x3b4645(0x192)]('\x20\x20rabetbase\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//\x20Pull\x20and\x20generate\x20API\x20config\x20files'),console['log'](_0x3b4645(0x190)),console[_0x3b4645(0x192)](_0x3b4645(0x199)),console[_0x3b4645(0x192)](_0x3b4645(0x189)),console[_0x3b4645(0x192)](''),console[_0x3b4645(0x192)]('\x20\x20rabetbase\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20all\x20datasets'),console['log'](_0x3b4645(0x1a7)),console[_0x3b4645(0x192)](_0x3b4645(0x18e)),console[_0x3b4645(0x192)](_0x3b4645(0x187)),process[_0x3b4645(0x185)](0x1);}}function a6_0x3f5f(){const _0x155d0e=['--params\x20is\x20not\x20valid\x20JSON\x20format','\x20\x20rabetbase\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20output\x20directory','pull','env','\x20\x20rabetbase\x20api\x20pull\x20--appcode\x20','\x20\x20\x202.\x20Use\x20flag:\x20rabetbase\x20api\x20doc\x20--appcode\x20<app-code>','\x0arabetbase\x20api\x20-\x20API\x20Operations\x0a\x0aUsage:\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20[options]\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20[options]\x0a\x0aOptions:\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20Specify\x20app\x20code\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20Specify\x20output\x20directory\x20(pull:\x20./src/api/,\x20doc:\x20./docs)\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Specify\x20environment\x20(e.g.\x20daily,\x20production)\x0a\x20\x20--datasetcode\x20<codes>\x20Specify\x20dataset\x20codes\x20for\x20doc\x20generation\x20(comma-separated,\x20doc\x20command\x20only)\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Show\x20this\x20help\x20message\x0a\x0aExamples:\x0a\x20\x20$\x20rabetbase\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//\x20Pull\x20and\x20generate\x20API\x20config\x20files\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20output\x20directory\x0a\x20\x20$\x20rabetbase\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20API\x20for\x20specified\x20environment\x0a\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20all\x20datasets\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20doc\x20output\x20directory\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20specified\x20environment\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20doc\x20for\x20specific\x20dataset\x20only\x0a\x20\x20$\x20rabetbase\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20multiple\x20datasets\x0a','298612vvSxWA','414160uyDeYF','939480XwMTnj','appcode','output','string','\x1b[90m*\x20Using\x20configured\x20AppCode:\x20','map','\x20\x20rabetbase\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode','isArray','Unknown\x20api\x20command:\x20','error','datasetcode','\x1b[90m\x20\x20(Note:\x20--appcode\x20flag\x20matches\x20config,\x20using\x20default\x20config)\x1b[0m','object','Available\x20commands:','4390MUNicA','join','10obtCqx','1024819sdSToE','split','parse','filter','2454021SaAYBM','Please\x20use\x20one\x20of\x20the\x20following:','AppCode\x20not\x20configured','Please\x20use\x20the\x20--appcode\x20flag,\x20for\x20example:','exit','4983VxZRLK','\x20\x20rabetbase\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Generate\x20docs\x20for\x20specified\x20environment','\x1b[90m*\x20Generating\x20docs\x20only\x20for\x20specified\x20datasets:\x20','\x20\x20rabetbase\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Pull\x20API\x20for\x20specified\x20environment','help','Error:\x20Positional\x20arguments\x20are\x20no\x20longer\x20supported','7bzmosv','77214LQNvZz','\x20\x20rabetbase\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Specify\x20doc\x20output\x20directory','message','\x20\x20rabetbase\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20Use\x20specified\x20appcode','input','log','length','45XktThY','flags','\x20\x20\x201.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20appcode\x20<app-code>','\x1b[0m'];a6_0x3f5f=function(){return _0x155d0e;};return a6_0x3f5f();}
@@ -1 +0,0 @@
1
- function a8_0xda03(_0x24a924,_0x308afd){_0x24a924=_0x24a924-0xa7;const _0x129540=a8_0x1295();let _0xda0380=_0x129540[_0x24a924];return _0xda0380;}(function(_0x194c30,_0x264fcb){const _0xa7ab67=a8_0xda03,_0xe71dee=_0x194c30();while(!![]){try{const _0x1060fc=parseInt(_0xa7ab67(0xea))/0x1*(-parseInt(_0xa7ab67(0xec))/0x2)+-parseInt(_0xa7ab67(0xb0))/0x3+parseInt(_0xa7ab67(0xde))/0x4+-parseInt(_0xa7ab67(0xc7))/0x5*(-parseInt(_0xa7ab67(0xe8))/0x6)+parseInt(_0xa7ab67(0xdf))/0x7+-parseInt(_0xa7ab67(0xbd))/0x8*(-parseInt(_0xa7ab67(0xc8))/0x9)+parseInt(_0xa7ab67(0xaa))/0xa*(-parseInt(_0xa7ab67(0xb1))/0xb);if(_0x1060fc===_0x264fcb)break;else _0xe71dee['push'](_0xe71dee['shift']());}catch(_0x51ec1a){_0xe71dee['push'](_0xe71dee['shift']());}}}(a8_0x1295,0x73235));import{jsx as a8_0x20a180,jsxs as a8_0x1cf8ea,Fragment as a8_0x12deb7}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a8_0x50f54b from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a8_0x20a180(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x2b627a=a8_0xda03,{exit:_0x5b7149}=useApp(),{loading:_0x3b8d94,menuList:_0x31acae,error:_0x1e507b}=useGetOnlineMenuList(),_0x3b632b=getLocalPages(),_0x49e1b1=_0x31acae['map'](_0x1afbcd=>_0x1afbcd['path']),_0x50d079=_0x2b627a(0xd5),_0x5ec0d8=[_0x50d079,..._0x3b632b[_0x2b627a(0xba)](_0x3d6c4b=>_0x3d6c4b[_0x2b627a(0xc3)])],_0x42e75f=getStringWidth(getMaxWidth(_0x5ec0d8,0x4)),_0xccbde9=getStringWidth(getMaxWidth([_0x50d079])),[_0x21c611,_0x3b2992]=useState(_0x2b627a(0xa8)),[_0x1e419e,_0x432675]=useState(new Set()),[_0x4305c9,_0x27910f]=useState(0x0),[_0x4dc4b5,_0x2805d4]=useState(''),[_0x3f1bbf,_0x1501ec]=useState(''),[_0x5cf347,_0xaeb572]=useState(''),[_0x17cf53,_0x2bc092]=useState(''),[_0x333e9d,_0x14a7b2]=useState([]),_0x5641e1=_0x3b632b[_0x2b627a(0xba)](_0x275555=>({'label':_0x275555[_0x2b627a(0xc3)],'path':_0x275555[_0x2b627a(0xc4)],'local':!![],'online':_0x49e1b1['includes'](_0x275555[_0x2b627a(0xc4)])})),_0x234e81=_0x3b632b[_0x2b627a(0xd1)](_0x372618=>{const _0x4ac10a=_0x2b627a;return!_0x49e1b1[_0x4ac10a(0xb2)](_0x372618[_0x4ac10a(0xc4)]);});useEffect(()=>{const _0x1d5927=_0x2b627a;if(!_0x3b8d94&&_0x3b632b['length']>0x0&&_0x1e419e['size']===0x0){const _0x13fbfd=new Set(_0x3b632b[_0x1d5927(0xba)]((_0x5ca53c,_0x15a58e)=>({'page':_0x5ca53c,'index':_0x15a58e}))[_0x1d5927(0xd1)](({page:_0x220313})=>!_0x49e1b1[_0x1d5927(0xb2)](_0x220313[_0x1d5927(0xc4)]))[_0x1d5927(0xba)](({index:_0xf9b04f})=>_0xf9b04f));_0x432675(_0x13fbfd);}},[_0x3b8d94,_0x3b632b['length'],_0x49e1b1[_0x2b627a(0xeb)]]),useInput(async(_0xe698ea,_0x1f1a1d)=>{const _0x23e94f=_0x2b627a;if(_0x21c611===_0x23e94f(0xa8)){if(_0x1f1a1d[_0x23e94f(0xcb)]){_0x27910f(_0x243219=>_0x243219>0x0?_0x243219-0x1:_0x3b632b[_0x23e94f(0xeb)]-0x1);return;}if(_0x1f1a1d[_0x23e94f(0xdc)]){_0x27910f(_0x2ae5bb=>_0x2ae5bb<_0x3b632b[_0x23e94f(0xeb)]-0x1?_0x2ae5bb+0x1:0x0);return;}if(_0xe698ea==='\x20'){_0x432675(_0x1bfd23=>{const _0xdb4671=_0x23e94f,_0x50c013=new Set(_0x1bfd23);return _0x50c013[_0xdb4671(0xdd)](_0x4305c9)?_0x50c013['delete'](_0x4305c9):_0x50c013['add'](_0x4305c9),_0x50c013;});return;}if(_0xe698ea==='a'||_0xe698ea==='A'){const _0x3528d0=new Set(_0x3b632b['map']((_0x2f4d10,_0x59680d)=>_0x59680d));_0x432675(_0x3528d0);return;}if(_0xe698ea==='i'||_0xe698ea==='I'||_0xe698ea==='r'||_0xe698ea==='R'){_0x432675(_0x433c26=>{const _0x4eb87d=_0x23e94f,_0x186e5f=new Set();for(let _0x57ee67=0x0;_0x57ee67<_0x3b632b[_0x4eb87d(0xeb)];_0x57ee67++){!_0x433c26['has'](_0x57ee67)&&_0x186e5f['add'](_0x57ee67);}return _0x186e5f;});return;}if(_0xe698ea==='q'||_0xe698ea==='Q'){_0x5b7149();return;}if(_0x1f1a1d[_0x23e94f(0xb8)]){if(_0x1e419e['size']===0x0){_0x2bc092('Please\x20select\x20at\x20least\x20one\x20menu');return;}const _0x2e5f58=_0x3b632b['filter']((_0x41ad49,_0x510580)=>_0x1e419e[_0x23e94f(0xdd)](_0x510580)),_0x55bf3e=_0x2e5f58[_0x23e94f(0xba)](_0x2ee414=>_0x2ee414['label'])[_0x23e94f(0xa9)](',\x20');_0x14a7b2([{'label':_0x23e94f(0xb6),'value':_0x1e419e['size']+_0x23e94f(0xac)}]),_0x2bc092(''),_0x3b2992('input-js');return;}return;}if(_0x21c611===_0x23e94f(0xc2)){if(_0x1f1a1d['return']){const _0x14ce80=_0x5cf347[_0x23e94f(0xbb)]();if(_0x14ce80==='')return;if(!isValidJsHttpsUrl(_0x14ce80)){_0x2bc092(_0x23e94f(0xe5));return;}if(!await isUrlReachable(_0x14ce80)){_0x2bc092(_0x23e94f(0xe6));return;}_0x2805d4(_0x14ce80),_0x14a7b2(_0xd6798f=>[..._0xd6798f,{'label':_0x23e94f(0xda),'value':_0x14ce80}]),_0xaeb572(''),_0x2bc092(''),_0x3b2992('input-css');return;}if(_0x1f1a1d[_0x23e94f(0xce)]||_0x1f1a1d['delete']){_0xaeb572(_0x53ce3a=>_0x53ce3a[_0x23e94f(0xc1)](0x0,-0x1)),_0x2bc092('');return;}_0xaeb572(_0x32e0a4=>_0x32e0a4+_0xe698ea);return;}if(_0x21c611===_0x23e94f(0xad)){if(_0x1f1a1d[_0x23e94f(0xb8)]){const _0x5cb758=_0x5cf347[_0x23e94f(0xbb)]();if(_0x5cb758==='')return;if(!isValidCssHttpsUrl(_0x5cb758)){_0x2bc092(_0x23e94f(0xe2));return;}if(!await isUrlReachable(_0x5cb758)){_0x2bc092(_0x23e94f(0xe3));return;}_0x1501ec(_0x5cb758),_0x14a7b2(_0x165ccf=>[..._0x165ccf,{'label':_0x23e94f(0xe7),'value':_0x5cb758}]),_0xaeb572(''),_0x2bc092(''),_0x3b2992('creating');const _0x6f871f=_0x3b632b[_0x23e94f(0xd1)]((_0x49bcce,_0x329b9a)=>_0x1e419e[_0x23e94f(0xdd)](_0x329b9a));createMenus(_0x6f871f,[_0x4dc4b5,_0x5cb758])[_0x23e94f(0xcc)](()=>{const _0x5aa495=_0x23e94f;_0x3b2992(_0x5aa495(0xcd)),setTimeout(()=>{_0x5b7149();},0x3e8);})[_0x23e94f(0xd8)](_0x1fcbbe=>{const _0x4d9988=_0x23e94f;_0x2bc092(_0x1fcbbe['message']||_0x4d9988(0xb5)),_0x3b2992('selecting');});return;}if(_0x1f1a1d['backspace']||_0x1f1a1d['delete']){_0xaeb572(_0x13e7d6=>_0x13e7d6[_0x23e94f(0xc1)](0x0,-0x1)),_0x2bc092('');return;}_0xaeb572(_0x408e2a=>_0x408e2a+_0xe698ea);return;}});if(_0x3b8d94)return a8_0x1cf8ea(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a8_0x20a180(Text,{'children':'\x20\x20'}),a8_0x20a180(a8_0x50f54b,{'type':_0x2b627a(0xd6)}),a8_0x20a180(Text,{'children':'\x20Fetching\x20online\x20menu\x20list...'})]});if(_0x1e507b)return a8_0x1cf8ea(Box,{'flexDirection':_0x2b627a(0xab),'marginTop':0x1,'marginBottom':0x1,'children':[a8_0x1cf8ea(Text,{'color':_0x2b627a(0xc9),'children':['✗\x20',_0x1e507b]}),a8_0x1cf8ea(Box,{'marginTop':0x1,'children':[a8_0x20a180(Text,{'color':'gray','children':_0x2b627a(0xb9)}),a8_0x20a180(Text,{'color':_0x2b627a(0xef),'children':_0x2b627a(0xbf)}),a8_0x20a180(Text,{'color':_0x2b627a(0xd4),'children':_0x2b627a(0xe9)})]})]});if(_0x3b632b['length']===0x0)return a8_0x20a180(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a8_0x20a180(Text,{'color':_0x2b627a(0xd9),'children':_0x2b627a(0xe1)})});return a8_0x1cf8ea(Box,{'flexDirection':_0x2b627a(0xab),'marginTop':0x1,'marginBottom':0x1,'children':[_0x21c611===_0x2b627a(0xa8)&&a8_0x1cf8ea(a8_0x12deb7,{'children':[a8_0x1cf8ea(Box,{'children':[a8_0x1cf8ea(Text,{'bold':!![],'children':['\x20\x20',_0x50d079,getRemainingSpaces(_0x42e75f,_0x50d079)]}),a8_0x1cf8ea(Text,{'bold':!![],'children':[_0x2b627a(0xc0),getRemainingSpaces(_0xccbde9,_0x50d079)]}),a8_0x1cf8ea(Text,{'bold':!![],'children':['Lovrabet\x20Platform',getRemainingSpaces(_0xccbde9,_0x50d079)]})]}),_0x5641e1['map'](_0x3a3bc6=>a8_0x1cf8ea(Box,{'children':[a8_0x1cf8ea(Text,{'children':['\x20\x20',_0x3a3bc6[_0x2b627a(0xc3)],getRemainingSpaces(_0x42e75f,_0x3a3bc6['label'])]}),a8_0x1cf8ea(Text,{'color':'green','children':[_0x3a3bc6[_0x2b627a(0xc6)]?'✓':'✗',getRemainingSpaces(_0xccbde9,'✓')]}),a8_0x1cf8ea(Text,{'color':_0x3a3bc6['online']?_0x2b627a(0xe4):'red','children':[_0x3a3bc6[_0x2b627a(0xb7)]?'✓':'✗',getRemainingSpaces(_0xccbde9,'✓')]})]},_0x3a3bc6['path']))]}),_0x21c611==='selecting'&&_0x333e9d['length']===0x0&&a8_0x20a180(Box,{'marginTop':0x1,'children':a8_0x20a180(Text,{'color':_0x2b627a(0xef),'children':'*\x20Sync\x20menus\x20to\x20Lovrabet\x20platform'})}),_0x333e9d[_0x2b627a(0xba)]((_0xed7dc9,_0x50ea9e)=>a8_0x1cf8ea(Box,{'children':[a8_0x1cf8ea(Text,{'color':_0x2b627a(0xe4),'children':['√\x20',_0xed7dc9[_0x2b627a(0xc3)],':\x20']}),a8_0x20a180(Text,{'color':_0x2b627a(0xef),'children':_0xed7dc9[_0x2b627a(0xae)]})]},_0x50ea9e)),_0x17cf53&&_0x21c611==='selecting'&&a8_0x20a180(Box,{'marginTop':0x1,'children':a8_0x1cf8ea(Text,{'color':'red','children':['✗\x20',_0x17cf53]})}),_0x21c611===_0x2b627a(0xa8)&&a8_0x20a180(a8_0x12deb7,{'children':a8_0x1cf8ea(Box,{'marginTop':_0x333e9d[_0x2b627a(0xeb)]>0x0||_0x17cf53?0x1:0x0,'flexDirection':_0x2b627a(0xab),'children':[a8_0x20a180(Text,{'bold':!![],'children':'*\x20Select\x20menus\x20to\x20sync:'}),_0x3b632b['map']((_0x1666a8,_0x1cd77f)=>{const _0x41ae49=_0x2b627a,_0x18b7d8=_0x4305c9===_0x1cd77f,_0x28a24d=_0x1e419e[_0x41ae49(0xdd)](_0x1cd77f),_0x3d571c=_0x49e1b1['includes'](_0x1666a8['path']),_0x2284b8=_0x3d571c?_0x41ae49(0xe0):_0x41ae49(0xcf);return a8_0x20a180(Box,{'children':a8_0x1cf8ea(Text,{'backgroundColor':_0x18b7d8?_0x41ae49(0xbe):undefined,'color':_0x18b7d8?_0x41ae49(0xb4):undefined,'children':['\x20\x20',_0x28a24d?_0x41ae49(0xd3):_0x41ae49(0xaf),'\x20',_0x1666a8['label']]})},_0x1666a8['path']);}),a8_0x20a180(Box,{'marginTop':0x1,'children':a8_0x20a180(Text,{'color':'gray','children':_0x2b627a(0xbc)})})]})}),_0x21c611===_0x2b627a(0xc2)&&a8_0x1cf8ea(a8_0x12deb7,{'children':[a8_0x1cf8ea(Box,{'children':[a8_0x20a180(Text,{'children':_0x2b627a(0xb3)}),a8_0x20a180(Text,{'color':'green','children':_0x5cf347}),_0x17cf53&&a8_0x1cf8ea(Text,{'color':_0x2b627a(0xc9),'children':['\x20←\x20',_0x17cf53]})]}),!_0x17cf53&&a8_0x20a180(Box,{'children':a8_0x20a180(Text,{'color':'gray','children':'\x20Enter\x20project\x20JS\x20asset\x20URL\x20(https://...)'})})]}),_0x21c611===_0x2b627a(0xad)&&a8_0x1cf8ea(a8_0x12deb7,{'children':[a8_0x1cf8ea(Box,{'children':[a8_0x20a180(Text,{'children':_0x2b627a(0xca)}),a8_0x20a180(Text,{'color':_0x2b627a(0xe4),'children':_0x5cf347}),_0x17cf53&&a8_0x1cf8ea(Text,{'color':'red','children':[_0x2b627a(0xd2),_0x17cf53]})]}),!_0x17cf53&&a8_0x20a180(Box,{'children':a8_0x20a180(Text,{'color':_0x2b627a(0xd4),'children':_0x2b627a(0xed)})})]}),_0x21c611===_0x2b627a(0xc5)&&a8_0x20a180(Box,{'children':a8_0x20a180(Text,{'children':_0x2b627a(0xd7)})}),_0x21c611==='done'&&a8_0x20a180(Box,{'children':a8_0x20a180(Text,{'color':_0x2b627a(0xe4),'children':_0x2b627a(0xa7)})})]});}function getStringWidth(_0xe0b0a2){let _0x327253=0x0;for(const _0x38d949 of _0xe0b0a2){/[\u4e00-\u9fa5]/['test'](_0x38d949)?_0x327253+=0x2:_0x327253+=0x1;}return _0x327253;}function getRemainingSpaces(_0x5b5551,_0x40ae6e){const _0x579af8=a8_0xda03,_0x28225f=getStringWidth(_0x40ae6e);return Array(Math[_0x579af8(0xee)](0x0,_0x5b5551-_0x28225f))[_0x579af8(0xdb)]('\x20')['join']('');}function getMaxWidth(_0x26de91,_0x53d5ee=0x2){const _0x5a855e=a8_0xda03;let _0x1514f4='',_0x51c629=0x0;for(const _0x37d9a of _0x26de91){const _0x47c422=getStringWidth(_0x37d9a);_0x47c422>_0x51c629&&(_0x51c629=_0x47c422,_0x1514f4=_0x37d9a);}return _0x1514f4+'\x20'[_0x5a855e(0xd0)](_0x53d5ee);}function a8_0x1295(){const _0x5bd560=['done','backspace','Create','repeat','filter','\x20←\x20','[✓]','gray','Menu\x20Name','dots','*\x20Creating\x20menus...','catch','yellow','JS\x20URL','fill','downArrow','has','3458080DteBFZ','817075fEmCUb','Update','!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','Please\x20enter\x20a\x20valid\x20CSS\x20https\x20URL','CSS\x20URL\x20is\x20unreachable','green','Please\x20enter\x20a\x20valid\x20JS\x20https\x20URL','JS\x20URL\x20is\x20unreachable','CSS\x20URL','238968vblhJB','\x20command\x20to\x20re-login','1aFPepH','length','1377034TBDzdb','\x20Enter\x20project\x20CSS\x20asset\x20URL\x20(https://...)','max','cyan','√\x20Menu\x20creation\x20completed','selecting','join','18230ictqDQ','column','\x20items','input-css','value','[\x20]','2044044BOSvdF','2222VlpqxY','includes','*\x20JS\x20URL:\x20','white','Failed\x20to\x20create\x20menu','Selected\x20menus','online','return','Hint:\x20use\x20','map','trim','\x20↑/↓:\x20Move\x20\x20Space:\x20Toggle\x20\x20a:\x20All\x20\x20i/r:\x20Invert\x20\x20Enter:\x20Confirm','5048408kewPHi','blue','rabetbase\x20auth','Local','slice','input-js','label','path','creating','local','75qfbavT','9htolxT','red','*\x20CSS\x20URL:\x20','upArrow','then'];a8_0x1295=function(){return _0x5bd560;};return a8_0x1295();}
@@ -1 +0,0 @@
1
- (function(_0x35cdf8,_0x23a783){const _0x5829d2=a9_0x3e7d,_0x3c0b38=_0x35cdf8();while(!![]){try{const _0x35f4f1=parseInt(_0x5829d2(0xd8))/0x1*(-parseInt(_0x5829d2(0xdf))/0x2)+parseInt(_0x5829d2(0xc6))/0x3+-parseInt(_0x5829d2(0xd1))/0x4*(parseInt(_0x5829d2(0xc7))/0x5)+parseInt(_0x5829d2(0xcc))/0x6*(parseInt(_0x5829d2(0xca))/0x7)+-parseInt(_0x5829d2(0xd2))/0x8*(-parseInt(_0x5829d2(0xe5))/0x9)+parseInt(_0x5829d2(0xe8))/0xa+parseInt(_0x5829d2(0xdb))/0xb*(-parseInt(_0x5829d2(0xec))/0xc);if(_0x35f4f1===_0x23a783)break;else _0x3c0b38['push'](_0x3c0b38['shift']());}catch(_0x82bf7a){_0x3c0b38['push'](_0x3c0b38['shift']());}}}(a9_0x28d8,0x51a56));function a9_0x3e7d(_0x52a8e6,_0x5907b4){_0x52a8e6=_0x52a8e6-0xc1;const _0x28d893=a9_0x28d8();let _0x3e7d5e=_0x28d893[_0x52a8e6];return _0x3e7d5e;}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a9_0x28d8(){const _0x5b9256=['success','length','8nPBKjD','5060680xwrJpJ','Error','label','Failed\x20to\x20create\x20menu:\x20','Auth\x20validation\x20failed.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','resources','9359GXTQfO','stringify','Creating\x20menu:\x20','176DslFow','appcode','errorCode','Menu\x20created\x20successfully:','138jwRFmC','import','includes','0011','create-menu','status','9hoIiJu','\x20\x20\x201.\x20Specify\x20directly:\x20rabetbase\x20api\x20pull\x20<app-code>','error','5242660OlYfwL','json','Failed\x20to\x20create\x20menu,\x20HTTP\x20status:\x20','\x20\x20\x202.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20app\x20<app-code>','262044yPxqHb','Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again','log','procode','application/json','POST','/smartapi/menu/create','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','1369407sutWts','764185TbkwOi','path','data','497RrYVeJ','all','1854ctlnWa','info','errorMsg'];a9_0x28d8=function(){return _0x5b9256;};return a9_0x28d8();}const config=readConfig();export async function createMenu(_0x5fd65c){const _0xbcb75a=a9_0x3e7d,_0x58ec93=config?.[_0xbcb75a(0xdc)];if(!_0x58ec93){const _0x4e1c90=_0xbcb75a(0xc5);logger[_0xbcb75a(0xe7)](_0xbcb75a(0xe3),_0x4e1c90),console[_0xbcb75a(0xe7)]('×\x20'+_0x4e1c90),console['log']('!\x20Please\x20use\x20one\x20of\x20the\x20following:'),console['log'](_0xbcb75a(0xe6)),console['log']('\x20\x20\x202.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20app\x20<app-code>');return;}logger['info'](_0xbcb75a(0xe3),_0xbcb75a(0xda)+_0x5fd65c[_0xbcb75a(0xd4)]+'\x20('+_0x5fd65c[_0xbcb75a(0xc8)]+')');const _0x390c28={'appCode':_0x58ec93,'type':_0xbcb75a(0xc1),'sort':0x0,'extend':{'loadScriptMode':_0xbcb75a(0xe0),'resources':_0x5fd65c[_0xbcb75a(0xd7)]?JSON[_0xbcb75a(0xd9)](_0x5fd65c[_0xbcb75a(0xd7)]):undefined},..._0x5fd65c},_0xd92f1a=await fetch(getApiDomain()+_0xbcb75a(0xc4),{'method':'POST','body':JSON[_0xbcb75a(0xd9)](_0x390c28),'headers':{'Content-Type':_0xbcb75a(0xc2),'Cookie':getCookie()}});if(!_0xd92f1a['ok']){if(_0xd92f1a[_0xbcb75a(0xe4)]===0x191){const _0x50f817=_0xbcb75a(0xed);logger[_0xbcb75a(0xe7)](_0xbcb75a(0xe3),_0x50f817,{'status':_0xd92f1a['status'],'menu':_0x5fd65c['label']});throw new Error(_0x50f817);}const _0x106c0e=_0xbcb75a(0xea)+_0xd92f1a[_0xbcb75a(0xe4)];logger[_0xbcb75a(0xe7)](_0xbcb75a(0xe3),_0x106c0e,{'menu':_0x5fd65c[_0xbcb75a(0xd4)]});throw new Error(_0x106c0e);}const _0x2c95fd=await _0xd92f1a['json']();if(!_0x2c95fd[_0xbcb75a(0xcf)]){const _0x392043=_0xbcb75a(0xd5)+(_0x2c95fd['errorMsg']||_0xbcb75a(0xd3));logger[_0xbcb75a(0xe7)](_0xbcb75a(0xe3),_0x392043,{'errorCode':_0x2c95fd[_0xbcb75a(0xdd)],'errorMsg':_0x2c95fd[_0xbcb75a(0xce)],'menu':_0x5fd65c[_0xbcb75a(0xd4)]});throw new Error(_0x392043);}logger[_0xbcb75a(0xcd)](_0xbcb75a(0xe3),'Menu\x20created\x20successfully:'+_0x5fd65c['label'],_0x2c95fd[_0xbcb75a(0xc9)]),console[_0xbcb75a(0xee)](_0xbcb75a(0xde),_0x2c95fd[_0xbcb75a(0xc9)]);}async function _createMenu(_0x2f542a,_0x5dbe3d){const _0x53f94d=a9_0x3e7d,_0x11f9ba=config?.['appcode'];if(!_0x11f9ba){const _0x5e986c='No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured';logger[_0x53f94d(0xe7)](_0x53f94d(0xe3),_0x5e986c),console[_0x53f94d(0xe7)]('×\x20'+_0x5e986c),console[_0x53f94d(0xee)]('!\x20Please\x20use\x20one\x20of\x20the\x20following:'),console[_0x53f94d(0xee)](_0x53f94d(0xe6)),console[_0x53f94d(0xee)](_0x53f94d(0xeb));return;}const _0x505c30={'appCode':_0x11f9ba,'type':_0x53f94d(0xc1),'sort':0x0,'extend':{'loadScriptMode':_0x53f94d(0xe0),'resources':_0x5dbe3d?JSON[_0x53f94d(0xd9)](_0x5dbe3d):undefined},'label':_0x2f542a[_0x53f94d(0xd4)],'path':_0x2f542a[_0x53f94d(0xc8)]},_0x2580dc=await fetch(getApiDomain()+_0x53f94d(0xc4),{'method':_0x53f94d(0xc3),'body':JSON['stringify'](_0x505c30),'headers':{'Content-Type':_0x53f94d(0xc2),'Cookie':getCookie()}});if(!_0x2580dc['ok']){if(_0x2580dc[_0x53f94d(0xe4)]===0x191){const _0x335723=_0x53f94d(0xed);logger[_0x53f94d(0xe7)]('create-menu',_0x335723,{'status':_0x2580dc[_0x53f94d(0xe4)],'menu':_0x2f542a[_0x53f94d(0xd4)]});throw new Error(_0x335723);}const _0x4dad2f=_0x53f94d(0xea)+_0x2580dc['status'];logger[_0x53f94d(0xe7)](_0x53f94d(0xe3),_0x4dad2f,{'menu':_0x2f542a[_0x53f94d(0xd4)]});throw new Error(_0x4dad2f);}const _0x1c011f=await _0x2580dc[_0x53f94d(0xe9)]();if(!_0x1c011f[_0x53f94d(0xcf)]){if(_0x1c011f[_0x53f94d(0xdd)]===_0x53f94d(0xe2)||_0x1c011f[_0x53f94d(0xce)]?.[_0x53f94d(0xe1)]('登录')){const _0x13f9ac=_0x53f94d(0xd6);logger['error'](_0x53f94d(0xe3),_0x13f9ac,{'errorCode':_0x1c011f['errorCode'],'errorMsg':_0x1c011f[_0x53f94d(0xce)],'menu':_0x2f542a[_0x53f94d(0xd4)]});throw new Error(_0x13f9ac);}const _0x3e509c=_0x53f94d(0xd5)+(_0x1c011f[_0x53f94d(0xce)]||_0x53f94d(0xd3));logger[_0x53f94d(0xe7)]('create-menu',_0x3e509c,{'errorCode':_0x1c011f[_0x53f94d(0xdd)],'errorMsg':_0x1c011f[_0x53f94d(0xce)],'menu':_0x2f542a[_0x53f94d(0xd4)]});throw new Error(_0x3e509c);}logger[_0x53f94d(0xcd)](_0x53f94d(0xe3),_0x53f94d(0xde)+_0x2f542a[_0x53f94d(0xd4)]);}export async function createMenus(_0x54a9d4,_0x30ff3c){const _0x14841f=a9_0x3e7d;logger[_0x14841f(0xcd)]('create-menus','Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x54a9d4[_0x14841f(0xd0)]),await Promise[_0x14841f(0xcb)](_0x54a9d4['map'](async _0x4f4d85=>{await _createMenu(_0x4f4d85,_0x30ff3c);})),logger[_0x14841f(0xcd)]('create-menus','Batch\x20menu\x20creation\x20completed,\x20total\x20'+_0x54a9d4[_0x14841f(0xd0)]);}
@@ -1 +0,0 @@
1
- const a10_0x5da6ac=a10_0x2de6;(function(_0x37bea1,_0x5f4ebe){const _0xd4a7c6=a10_0x2de6,_0x15413c=_0x37bea1();while(!![]){try{const _0x183853=-parseInt(_0xd4a7c6(0xc0))/0x1*(parseInt(_0xd4a7c6(0xb9))/0x2)+parseInt(_0xd4a7c6(0xbf))/0x3+parseInt(_0xd4a7c6(0xc2))/0x4+parseInt(_0xd4a7c6(0xbc))/0x5+-parseInt(_0xd4a7c6(0xb1))/0x6*(-parseInt(_0xd4a7c6(0xae))/0x7)+parseInt(_0xd4a7c6(0xb5))/0x8+-parseInt(_0xd4a7c6(0xaf))/0x9;if(_0x183853===_0x5f4ebe)break;else _0x15413c['push'](_0x15413c['shift']());}catch(_0x5970cb){_0x15413c['push'](_0x15413c['shift']());}}}(a10_0x2afa,0x77363));function a10_0x2de6(_0x2ba3c4,_0xf95e1a){_0x2ba3c4=_0x2ba3c4-0xae;const _0x2afa75=a10_0x2afa();let _0x2de6b1=_0x2afa75[_0x2ba3c4];return _0x2de6b1;}function a10_0x2afa(){const _0x293507=['forEach','63007dQCzUS','20282265hHfutE','utf-8','114nsTWic','src/pages','isDirectory','replace','4589096dqPXZW','slice','filter','index.tsx','1063586oEPtzR','endsWith','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','3609840edoPjk','path','trim','2890155TlRJZd','1cPNuOf','match','3374640KLQwBY','.tsx'];a10_0x2afa=function(){return _0x293507;};return a10_0x2afa();}import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';const pagesDir=resolve(process['cwd'](),a10_0x5da6ac(0xb2));export function extractTitleFromComment(_0x5d94c1){const _0x50f99a=a10_0x5da6ac;try{const _0x55598d=readFileSync(_0x5d94c1,_0x50f99a(0xb0)),_0x9e61df=_0x55598d[_0x50f99a(0xc1)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x9e61df&&_0x9e61df[0x1]){const _0x31429d=_0x9e61df[0x1],_0x181499=_0x31429d[_0x50f99a(0xc1)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x181499&&_0x181499[0x1])return _0x181499[0x1][_0x50f99a(0xbe)]();}let _0x549186=null;const _0x35b43c=_0x55598d[_0x50f99a(0xc1)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x35b43c&&_0x35b43c[0x1]&&(_0x549186=_0x35b43c[0x1]);if(!_0x549186){const _0x13694c=_0x55598d['match'](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x13694c&&_0x13694c[0x1]&&(_0x549186=_0x13694c[0x1]);}if(_0x549186){const _0x3e51b9=new RegExp('\x5cb'+_0x549186+_0x50f99a(0xbb)),_0x524233=_0x55598d[_0x50f99a(0xc1)](_0x3e51b9);if(_0x524233&&_0x524233[0x1])return _0x524233[0x1];return _0x549186;}return null;}catch(_0x3ca79e){return null;}}export function getLocalPages(_0x2bcbd4=pagesDir,_0x95447c=pagesDir){const _0x5ceee6=a10_0x5da6ac;let _0x5ca8a5=[];const _0x39c4ae=readdirSync(_0x2bcbd4);return _0x39c4ae[_0x5ceee6(0xc4)](_0x3b094c=>{const _0x30e4b6=_0x5ceee6,_0x4b5cfd=join(_0x2bcbd4,_0x3b094c),_0x897702=statSync(_0x4b5cfd);if(_0x897702&&_0x897702[_0x30e4b6(0xb3)]())_0x5ca8a5=_0x5ca8a5['concat'](getLocalPages(_0x4b5cfd,_0x95447c));else{if(_0x3b094c[_0x30e4b6(0xba)](_0x30e4b6(0xc3))){let _0x5d6ef6=relative(_0x95447c,_0x4b5cfd);_0x5d6ef6[_0x30e4b6(0xba)](_0x30e4b6(0xb8))?_0x5d6ef6=_0x5d6ef6[_0x30e4b6(0xb4)](/index\.tsx$/,''):_0x5d6ef6=_0x5d6ef6[_0x30e4b6(0xb4)](/\.tsx$/,'');_0x5d6ef6[_0x30e4b6(0xba)]('/')&&(_0x5d6ef6=_0x5d6ef6[_0x30e4b6(0xb6)](0x0,-0x1));const _0x575b80=extractTitleFromComment(_0x4b5cfd),_0x8d681b=_0x575b80||_0x5d6ef6;_0x5ca8a5['push']({'path':_0x5d6ef6['replaceAll']('$',':'),'label':_0x8d681b});}}}),_0x5ca8a5[_0x5ceee6(0xb7)](_0x2353f5=>_0x2353f5[_0x5ceee6(0xbd)]!=='');}
@@ -1 +0,0 @@
1
- (function(_0x29c95c,_0x15e5af){const _0x5143b1=a11_0x51f4,_0x2fc18a=_0x29c95c();while(!![]){try{const _0x18ef13=-parseInt(_0x5143b1(0x14b))/0x1*(-parseInt(_0x5143b1(0x152))/0x2)+parseInt(_0x5143b1(0x13c))/0x3+parseInt(_0x5143b1(0x139))/0x4+-parseInt(_0x5143b1(0x140))/0x5*(parseInt(_0x5143b1(0x15c))/0x6)+-parseInt(_0x5143b1(0x154))/0x7+parseInt(_0x5143b1(0x15d))/0x8*(parseInt(_0x5143b1(0x158))/0x9)+-parseInt(_0x5143b1(0x14f))/0xa*(-parseInt(_0x5143b1(0x155))/0xb);if(_0x18ef13===_0x15e5af)break;else _0x2fc18a['push'](_0x2fc18a['shift']());}catch(_0x1afff0){_0x2fc18a['push'](_0x2fc18a['shift']());}}}(a11_0x57db,0x6b4b5));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a11_0x57db(){const _0x4a766c=['errorCode','Failed\x20to\x20fetch\x20menu\x20list,\x20HTTP\x20status:\x20','2438028GPkrYh','Error','isArray','673638tfpwEl','info','data','error','20OLUxoG','\x20\x20\x201.\x20Specify\x20directly:\x20rabetbase\x20api\x20pull\x20<app-code>','children','get-online-menu-list','log','length','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','status','Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20','/smartapi/menu/find?appCode=','json','533474jMGLdN','\x20online\x20menus\x20successfully','label','Server\x20returned\x20empty\x20menu\x20list','165190rUCini','resources','Failed\x20to\x20fetch\x20menu\x20list:\x20','2kGehCg','online','4042689mTbdAi','143QgqjLp','success','flat','2691xzaqTo','errorMsg','application/json','appcode','1037172TjXcYA','3376cCypjn'];a11_0x57db=function(){return _0x4a766c;};return a11_0x57db();}import{getEnv}from'../constant/env.js';const config=readConfig();function a11_0x51f4(_0x59192f,_0x202c1c){_0x59192f=_0x59192f-0x138;const _0x57dbc2=a11_0x57db();let _0x51f47b=_0x57dbc2[_0x59192f];return _0x51f47b;}export async function getOnlineMenuList(){const _0x9477f0=a11_0x51f4,_0x2f31bd=config?.[_0x9477f0(0x15b)];if(!_0x2f31bd){const _0x1847de=_0x9477f0(0x146);return logger[_0x9477f0(0x13f)](_0x9477f0(0x143),_0x1847de),console[_0x9477f0(0x13f)]('×\x20'+_0x1847de),console[_0x9477f0(0x144)]('!\x20Please\x20use\x20one\x20of\x20the\x20following:'),console[_0x9477f0(0x144)](_0x9477f0(0x141)),console['log']('\x20\x20\x202.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20app\x20<app-code>'),[];}const _0x19819e=getEnv();logger[_0x9477f0(0x13d)](_0x9477f0(0x143),_0x19819e===_0x9477f0(0x153)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x2f31bd+')':_0x9477f0(0x148)+_0x2f31bd+')');const _0x3ecf16=await fetch(getApiDomain()+_0x9477f0(0x149)+_0x2f31bd,{'method':'GET','headers':{'Content-Type':_0x9477f0(0x15a),'Cookie':getCookie()}});if(!_0x3ecf16['ok']){if(_0x3ecf16[_0x9477f0(0x147)]===0x191){const _0x4c3ca8='Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger[_0x9477f0(0x13f)](_0x9477f0(0x143),_0x4c3ca8,{'status':_0x3ecf16['status']});throw new Error(_0x4c3ca8);}const _0x2a3b15=_0x9477f0(0x138)+_0x3ecf16['status'];logger[_0x9477f0(0x13f)](_0x9477f0(0x143),_0x2a3b15);throw new Error(_0x2a3b15);}const _0x160055=await _0x3ecf16[_0x9477f0(0x14a)]();if(!_0x160055[_0x9477f0(0x156)]){const _0x25dc6a=_0x9477f0(0x151)+(_0x160055[_0x9477f0(0x159)]||_0x9477f0(0x13a));logger[_0x9477f0(0x13f)](_0x9477f0(0x143),_0x25dc6a,{'errorCode':_0x160055[_0x9477f0(0x15e)],'errorMsg':_0x160055[_0x9477f0(0x159)]});throw new Error(_0x25dc6a);}if(!_0x160055[_0x9477f0(0x13e)])return logger[_0x9477f0(0x13d)](_0x9477f0(0x143),_0x9477f0(0x14e)),[];return logger['info'](_0x9477f0(0x143),'Fetched\x20'+_0x160055[_0x9477f0(0x13e)][_0x9477f0(0x145)]+_0x9477f0(0x14c)),_0x160055['data']['map'](formatMenuList)[_0x9477f0(0x157)]();}function formatMenuList(_0x11399f){const _0x5d0262=a11_0x51f4;let _0x41d66b=[];try{if(_0x11399f['extend']?.[_0x5d0262(0x150)]){const _0x3431b1=JSON['parse'](_0x11399f['extend'][_0x5d0262(0x150)]);Array[_0x5d0262(0x13b)](_0x3431b1)&&(_0x41d66b=_0x3431b1);}}catch(_0x1e6542){}const _0x59106c=[{'id':_0x11399f['id'],'path':_0x11399f['path'],'label':_0x11399f[_0x5d0262(0x14d)],'resources':_0x41d66b}];if(_0x11399f[_0x5d0262(0x142)]&&_0x11399f[_0x5d0262(0x142)][_0x5d0262(0x145)]>0x0)for(const _0x133784 of _0x11399f[_0x5d0262(0x142)]){_0x59106c['push'](...formatMenuList(_0x133784));}return _0x59106c;}
@@ -1 +0,0 @@
1
- export{};
@@ -1 +0,0 @@
1
- (function(_0xa60d89,_0x141664){const _0x34d320=a13_0x5eeb,_0x1434ec=_0xa60d89();while(!![]){try{const _0x41fe64=parseInt(_0x34d320(0x13f))/0x1+parseInt(_0x34d320(0x13b))/0x2+parseInt(_0x34d320(0x132))/0x3*(parseInt(_0x34d320(0x13d))/0x4)+parseInt(_0x34d320(0x140))/0x5*(-parseInt(_0x34d320(0x138))/0x6)+-parseInt(_0x34d320(0x134))/0x7+parseInt(_0x34d320(0x137))/0x8+-parseInt(_0x34d320(0x13c))/0x9*(parseInt(_0x34d320(0x13e))/0xa);if(_0x41fe64===_0x141664)break;else _0x1434ec['push'](_0x1434ec['shift']());}catch(_0x375f14){_0x1434ec['push'](_0x1434ec['shift']());}}}(a13_0x2a0a,0x79279));import{useEffect,useState}from'react';import{getOnlineMenuList}from'./get-online-menu-list.js';function a13_0x5eeb(_0x40f77e,_0x1a3299){_0x40f77e=_0x40f77e-0x132;const _0x2a0ae7=a13_0x2a0a();let _0x5eebf9=_0x2a0ae7[_0x40f77e];return _0x5eebf9;}export function useGetOnlineMenuList(){const [_0x384ede,_0x49d5eb]=useState([]),[_0x46a84b,_0x16d79b]=useState(!![]),[_0x51ca5d,_0x52e96f]=useState('');return useEffect(()=>{const _0x14f1d3=a13_0x5eeb;_0x16d79b(!![]),_0x52e96f(''),getOnlineMenuList()[_0x14f1d3(0x133)](_0x49d5eb)[_0x14f1d3(0x13a)](_0x4c252a=>{const _0x4f3be9=_0x14f1d3;_0x52e96f(_0x4c252a[_0x4f3be9(0x139)]||_0x4f3be9(0x135));})[_0x14f1d3(0x136)](()=>_0x16d79b(![]));},[]),{'menuList':_0x384ede,'loading':_0x46a84b,'error':_0x51ca5d};}function a13_0x2a0a(){const _0x1f2014=['600HqvOky','10zrUJDA','672189eGcTJp','10CatmpU','1926EMFEgN','then','1240624cuYYGC','Failed\x20to\x20fetch\x20menu\x20list:\x20Error','finally','7063368usKdyv','382938fHIsVc','message','catch','182690xcYyui','8474652LXfgqD'];a13_0x2a0a=function(){return _0x1f2014;};return a13_0x2a0a();}
@@ -1 +0,0 @@
1
- (function(_0x237538,_0x994146){const _0x24a693=a14_0xf1c9,_0x493304=_0x237538();while(!![]){try{const _0x44fa0c=-parseInt(_0x24a693(0x79))/0x1+-parseInt(_0x24a693(0x85))/0x2*(parseInt(_0x24a693(0x87))/0x3)+-parseInt(_0x24a693(0x81))/0x4*(-parseInt(_0x24a693(0x84))/0x5)+-parseInt(_0x24a693(0x80))/0x6+parseInt(_0x24a693(0x7d))/0x7*(parseInt(_0x24a693(0x83))/0x8)+-parseInt(_0x24a693(0x7a))/0x9*(-parseInt(_0x24a693(0x7b))/0xa)+parseInt(_0x24a693(0x7f))/0xb;if(_0x44fa0c===_0x994146)break;else _0x493304['push'](_0x493304['shift']());}catch(_0x58be7f){_0x493304['push'](_0x493304['shift']());}}}(a14_0x1c29,0x4350c));function a14_0xf1c9(_0x300232,_0x42cbb9){_0x300232=_0x300232-0x79;const _0x1c2954=a14_0x1c29();let _0xf1c92a=_0x1c2954[_0x300232];return _0xf1c92a;}export function getRemainingSpaces(_0x46f80c,_0x3e3361){const _0x242194=a14_0xf1c9,_0xd2a601=getStringWidth(_0x3e3361);return Array(Math[_0x242194(0x88)](0x0,_0x46f80c-_0xd2a601))[_0x242194(0x86)]('\x20')[_0x242194(0x7c)]('');}export function getMaxWidth(_0x57642b,_0x3d2403=0x2){const _0x2c708f=a14_0xf1c9;let _0x39b793='',_0x50ec92=0x0;for(const _0x1b5692 of _0x57642b){const _0x3534bd=getStringWidth(_0x1b5692);_0x3534bd>_0x50ec92&&(_0x50ec92=_0x3534bd,_0x39b793=_0x1b5692);}return _0x39b793+'\x20'[_0x2c708f(0x82)](_0x3d2403);}export function getStringWidth(_0x155cb4){const _0x26ee38=a14_0xf1c9;let _0x55fb68=0x0;for(const _0x24fce1 of _0x155cb4){/[\u4e00-\u9fa5]/[_0x26ee38(0x7e)](_0x24fce1)?_0x55fb68+=0x2:_0x55fb68+=0x1;}return _0x55fb68;}function a14_0x1c29(){const _0x183a00=['max','470856NHNLNa','126549DRtMlv','190yGeayM','join','574pkiYeP','test','10408167oTxena','3079194kAvlrh','116CzHbpR','repeat','2440lEHywo','25015GAIwdA','4IwsDmq','fill','185511wQOvtO'];a14_0x1c29=function(){return _0x183a00;};return a14_0x1c29();}
@@ -1 +0,0 @@
1
- (function(_0x2cca02,_0x23f557){const _0x4d372b=a15_0x4365,_0x4a82a3=_0x2cca02();while(!![]){try{const _0x1e5bf4=parseInt(_0x4d372b(0x79))/0x1*(parseInt(_0x4d372b(0x7e))/0x2)+-parseInt(_0x4d372b(0x7a))/0x3*(parseInt(_0x4d372b(0x80))/0x4)+-parseInt(_0x4d372b(0x76))/0x5*(-parseInt(_0x4d372b(0x7c))/0x6)+-parseInt(_0x4d372b(0x75))/0x7*(-parseInt(_0x4d372b(0x7d))/0x8)+-parseInt(_0x4d372b(0x73))/0x9+parseInt(_0x4d372b(0x7f))/0xa*(parseInt(_0x4d372b(0x7b))/0xb)+-parseInt(_0x4d372b(0x81))/0xc;if(_0x1e5bf4===_0x23f557)break;else _0x4a82a3['push'](_0x4a82a3['shift']());}catch(_0x59671d){_0x4a82a3['push'](_0x4a82a3['shift']());}}}(a15_0x396d,0x5dd62));export function isValidJsHttpsUrl(_0x33ad4a){const _0x5a9451=a15_0x4365;return/^https:\/\/.+\.js(\?.*)?$/[_0x5a9451(0x74)](_0x33ad4a[_0x5a9451(0x77)]());}function a15_0x4365(_0x435f54,_0x2b6ac6){_0x435f54=_0x435f54-0x73;const _0x396dd6=a15_0x396d();let _0x436565=_0x396dd6[_0x435f54];return _0x436565;}function a15_0x396d(){const _0xfe33cf=['10wlHglk','28kGAzYC','1425936NxwTJa','2225340LKtAaN','test','1257011WdKKez','80605TIlAlU','trim','HEAD','584TUvwyB','207591CbHzhZ','8085748SpSoNW','72aYTzkP','8UDKkiz','434EZNiUz'];a15_0x396d=function(){return _0xfe33cf;};return a15_0x396d();}export function isValidCssHttpsUrl(_0x3c896e){const _0x3d5951=a15_0x4365;return/^https:\/\/.+\.css(\?.*)?$/['test'](_0x3c896e[_0x3d5951(0x77)]());}export async function isUrlReachable(_0x4beec5){const _0x4d835e=a15_0x4365;try{const _0x1b6b3f=await fetch(_0x4beec5,{'method':_0x4d835e(0x78)});return _0x1b6b3f['ok'];}catch{return![];}}
@@ -1 +0,0 @@
1
- (function(_0x1f8156,_0x286440){const _0x5d07c5=a16_0xd583,_0xc0ef2=_0x1f8156();while(!![]){try{const _0x48c52b=parseInt(_0x5d07c5(0x124))/0x1*(parseInt(_0x5d07c5(0x12a))/0x2)+-parseInt(_0x5d07c5(0x128))/0x3+-parseInt(_0x5d07c5(0x122))/0x4+parseInt(_0x5d07c5(0x11e))/0x5*(-parseInt(_0x5d07c5(0x11b))/0x6)+parseInt(_0x5d07c5(0x118))/0x7*(-parseInt(_0x5d07c5(0x129))/0x8)+-parseInt(_0x5d07c5(0x127))/0x9+parseInt(_0x5d07c5(0x11a))/0xa*(parseInt(_0x5d07c5(0x126))/0xb);if(_0x48c52b===_0x286440)break;else _0xc0ef2['push'](_0xc0ef2['shift']());}catch(_0x4af35f){_0xc0ef2['push'](_0xc0ef2['shift']());}}}(a16_0x72aa,0xdde10));import{jsx as a16_0x49d473,jsxs as a16_0x5bc78b}from'react/jsx-runtime';import{Text,Box}from'ink';function a16_0xd583(_0x7d1f91,_0x2d64a1){_0x7d1f91=_0x7d1f91-0x118;const _0x72aab2=a16_0x72aa();let _0xd58398=_0x72aab2[_0x7d1f91];return _0xd58398;}function a16_0x72aa(){const _0x19cbb0=['from','*\x20Menus\x20and\x20asset\x20links\x20to\x20update','map','9104319MrLvAA','resources','10XxrPht','18BRyShp','column','label','2581995xMvpZS','Asset\x20links\x20to\x20update:','cyan','length','2871964PJBOCv','filter','876fodcdQ','join','44426789EfPIEN','8500653SBcVJX','155019GtMjAh','8vtvrmt','3274qSCVmi','flat'];a16_0x72aa=function(){return _0x19cbb0;};return a16_0x72aa();}export function CurrentMenuCdnContent(_0x22f332){const _0x3aa77a=a16_0xd583,{menuList:_0xe18109}=_0x22f332,_0x26c985=_0xe18109[_0x3aa77a(0x123)](_0x84897e=>_0x84897e[_0x3aa77a(0x119)][_0x3aa77a(0x121)]),_0x44c167=Array[_0x3aa77a(0x12c)](new Set(_0xe18109['map'](_0x3c0baf=>_0x3c0baf[_0x3aa77a(0x119)])[_0x3aa77a(0x12b)]()));return a16_0x5bc78b(Box,{'flexDirection':_0x3aa77a(0x11c),'children':[a16_0x49d473(Text,{'color':_0x3aa77a(0x120),'children':_0x3aa77a(0x12d)}),a16_0x5bc78b(Box,{'marginTop':0x1,'flexDirection':_0x3aa77a(0x11c),'children':[a16_0x5bc78b(Text,{'bold':!![],'children':['\x20\x20','Menus\x20to\x20update:']}),a16_0x5bc78b(Text,{'children':['\x20\x20',_0x26c985[_0x3aa77a(0x12e)](_0x2a4b34=>_0x2a4b34[_0x3aa77a(0x11d)])[_0x3aa77a(0x125)](',\x20')]})]}),a16_0x49d473(Box,{'marginTop':0x1,'children':a16_0x5bc78b(Text,{'bold':!![],'children':['\x20\x20',_0x3aa77a(0x11f)]})}),_0x44c167[_0x3aa77a(0x12e)](_0x3c1a23=>a16_0x49d473(Box,{'children':a16_0x5bc78b(Text,{'children':['\x20\x20',_0x3c1a23]})},_0x3c1a23))]});}
@@ -1 +0,0 @@
1
- (function(_0x174144,_0x3ac78a){const _0x5c1d72=a17_0x8aaa,_0x56a15a=_0x174144();while(!![]){try{const _0x14fce5=parseInt(_0x5c1d72(0x1dd))/0x1+parseInt(_0x5c1d72(0x1d5))/0x2+parseInt(_0x5c1d72(0x1db))/0x3*(-parseInt(_0x5c1d72(0x1d8))/0x4)+-parseInt(_0x5c1d72(0x1d2))/0x5*(-parseInt(_0x5c1d72(0x1df))/0x6)+parseInt(_0x5c1d72(0x1e0))/0x7+parseInt(_0x5c1d72(0x1de))/0x8*(parseInt(_0x5c1d72(0x1d9))/0x9)+-parseInt(_0x5c1d72(0x1da))/0xa;if(_0x14fce5===_0x3ac78a)break;else _0x56a15a['push'](_0x56a15a['shift']());}catch(_0x5559f3){_0x56a15a['push'](_0x56a15a['shift']());}}}(a17_0x2349,0x1dc50));function a17_0x2349(){const _0x4ce77f=['208DYFpAs','18elvAoW','879249VOVLIk','CSS\x20URL:\x20','162385aCsrZI','JS\x20URL:\x20','column','63070cqKBAY','*\x20Entered\x20asset\x20URLs','green','28XztGyt','61218NdQBMH','1325530BottnV','103713qNhTJt','cyan','65061xeRpvB'];a17_0x2349=function(){return _0x4ce77f;};return a17_0x2349();}import{jsx as a17_0x3b275b,jsxs as a17_0x5ab2eb}from'react/jsx-runtime';function a17_0x8aaa(_0x41d566,_0x4498fb){_0x41d566=_0x41d566-0x1d2;const _0x234919=a17_0x2349();let _0x8aaa0a=_0x234919[_0x41d566];return _0x8aaa0a;}import{Text,Box}from'ink';export function InputCdnAsset(_0x51a2c4){const _0x397c9d=a17_0x8aaa,{jsCdnUrl:_0x19d3df,cssCdnUrl:_0x41c79c}=_0x51a2c4;return a17_0x5ab2eb(Box,{'flexDirection':_0x397c9d(0x1d4),'marginTop':0x1,'children':[a17_0x3b275b(Text,{'color':_0x397c9d(0x1dc),'children':_0x397c9d(0x1d6)}),a17_0x5ab2eb(Box,{'children':[a17_0x5ab2eb(Text,{'children':['\x20\x20',_0x397c9d(0x1d3)]}),a17_0x3b275b(Text,{'color':_0x397c9d(0x1d7),'children':_0x19d3df})]}),a17_0x5ab2eb(Box,{'children':[a17_0x5ab2eb(Text,{'children':['\x20\x20',_0x397c9d(0x1e1)]}),a17_0x3b275b(Text,{'color':_0x397c9d(0x1d7),'children':_0x41c79c})]})]});}
@@ -1 +0,0 @@
1
- (function(_0x28fc9d,_0xea4ff0){const _0x49c597=a18_0xb56a,_0x31cac=_0x28fc9d();while(!![]){try{const _0x245ce2=parseInt(_0x49c597(0x7b))/0x1*(parseInt(_0x49c597(0x98))/0x2)+-parseInt(_0x49c597(0x74))/0x3+parseInt(_0x49c597(0x80))/0x4*(-parseInt(_0x49c597(0x8a))/0x5)+parseInt(_0x49c597(0xa7))/0x6*(parseInt(_0x49c597(0x82))/0x7)+-parseInt(_0x49c597(0x81))/0x8+-parseInt(_0x49c597(0x76))/0x9+parseInt(_0x49c597(0x77))/0xa;if(_0x245ce2===_0xea4ff0)break;else _0x31cac['push'](_0x31cac['shift']());}catch(_0x7862cb){_0x31cac['push'](_0x31cac['shift']());}}}(a18_0x470a,0x7fa37));import{jsx as a18_0x4b056d,jsxs as a18_0x2b9851,Fragment as a18_0x22604f}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';function a18_0x470a(){const _0x51cbdf=['input-css','\x20Fetching\x20online\x20menu\x20asset\x20links...','green','Enter\x20project\x20JS\x20asset\x20URL\x20(https://...)','need-confirm','slice','Hint:\x20use\x20','Continue\x20update','value','Enter\x20project\x20CSS\x20asset\x20URL\x20(https://...)','174wUqoDa','path','flat','column','2421789NLkwzX','leftArrow','3852576OMbMFL','8992770oIewuF','Please\x20enter\x20a\x20valid\x20CSS\x20https\x20URL','resolve','yellow','43977thppPS','cancel','label','JS\x20URL:\x20','updated','740dpalAA','6820440UNrLtO','244195vFnlue','trim','cyan','CSS\x20URL:\x20','JS\x20URL\x20is\x20unreachable','length','\x20command\x20to\x20re-login','\x20←\x20','105ZIUiUX','!\x20No\x20menu\x20asset\x20links\x20found','return','delete','\x20Assets\x20are\x20syncing...','input-js','upArrow','backspace','resources','red','downArrow','creating','gray','dots','32NqKhwh','rightArrow','map','from','Please\x20enter\x20a\x20valid\x20JS\x20https\x20URL'];a18_0x470a=function(){return _0x51cbdf;};return a18_0x470a();}import a18_0x4e2ff1 from'ink-spinner';function a18_0xb56a(_0x20b044,_0x366588){_0x20b044=_0x20b044-0x74;const _0x470a26=a18_0x470a();let _0xb56a5b=_0x470a26[_0x20b044];return _0xb56a5b;}import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';import.meta.main&&render(a18_0x4b056d(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x7fa2dd=a18_0xb56a,{exit:_0x5598aa}=useApp(),{loading:_0x3b625c,menuList:_0x4e18fa,error:_0x5afb31}=useGetOnlineMenuList(),[_0x39bf30,_0x2e2c23]=useState('ok'),[_0x221af5,_0x45e14a]=useState(_0x7fa2dd(0x8f)),[_0x581b79,_0x1b36d8]=useState(''),[_0x584c0e,_0x5d1a7e]=useState(''),[_0x321267,_0x134e55]=useState(''),[_0x58c6d0,_0x802dd8]=useState(''),_0x498c10=Array[_0x7fa2dd(0x9b)](new Set(_0x4e18fa[_0x7fa2dd(0x9a)](_0x55b044=>_0x55b044[_0x7fa2dd(0x92)])[_0x7fa2dd(0xa9)]()));useEffect(()=>{const _0x642b49=_0x7fa2dd;_0x221af5===_0x642b49(0x7f)&&setTimeout(_0x5598aa,0x32);},[_0x221af5]),useInput(async(_0x2d1423,_0x56dcf9)=>{const _0x5b2700=_0x7fa2dd;if(_0x221af5===_0x5b2700(0x8f)){if(_0x56dcf9[_0x5b2700(0x8c)]){const _0xd3cd37=_0x321267['trim']();if(_0xd3cd37==='')return;if(!isValidJsHttpsUrl(_0xd3cd37)){_0x802dd8(_0x5b2700(0x9c));return;}if(!await isUrlReachable(_0xd3cd37)){_0x802dd8(_0x5b2700(0x86));return;}_0x1b36d8(_0xd3cd37),_0x134e55(''),_0x802dd8(''),_0x45e14a(_0x5b2700(0x9d));return;}if(_0x56dcf9[_0x5b2700(0x91)]||_0x56dcf9[_0x5b2700(0x8d)]){_0x134e55(_0x19f285=>_0x19f285[_0x5b2700(0xa2)](0x0,-0x1)),_0x802dd8('');return;}_0x134e55(_0x1ce04b=>_0x1ce04b+_0x2d1423);return;}if(_0x221af5===_0x5b2700(0x9d)){if(_0x56dcf9[_0x5b2700(0x8c)]){const _0x4ac459=_0x321267[_0x5b2700(0x83)]();if(_0x4ac459==='')return;if(!isValidCssHttpsUrl(_0x4ac459)){_0x802dd8(_0x5b2700(0x78));return;}if(!await isUrlReachable(_0x4ac459)){_0x802dd8('CSS\x20URL\x20is\x20unreachable');return;}_0x5d1a7e(_0x4ac459),_0x134e55(''),_0x802dd8(''),_0x45e14a(_0x5b2700(0xa1));return;}if(_0x56dcf9[_0x5b2700(0x91)]||_0x56dcf9[_0x5b2700(0x8d)]){_0x134e55(_0x57162c=>_0x57162c['slice'](0x0,-0x1)),_0x802dd8('');return;}_0x134e55(_0x30e493=>_0x30e493+_0x2d1423);return;}if(_0x221af5===_0x5b2700(0xa1)){(_0x56dcf9[_0x5b2700(0x90)]||_0x56dcf9[_0x5b2700(0x94)]||_0x56dcf9[_0x5b2700(0x75)]||_0x56dcf9[_0x5b2700(0x99)])&&_0x2e2c23(_0x3e3a2a=>_0x3e3a2a==='ok'?_0x5b2700(0x7c):'ok');if(_0x56dcf9[_0x5b2700(0x8c)]){_0x45e14a(_0x5b2700(0x95));if(_0x39bf30==='ok')await Promise['all'](_0x4e18fa['map'](_0x371de4=>{const _0x1ba037=_0x5b2700,_0x1bea19={'id':_0x371de4['id'],'label':_0x371de4[_0x1ba037(0x7d)],'path':_0x371de4[_0x1ba037(0xa8)],'resources':[_0x581b79,_0x584c0e]};if(_0x371de4[_0x1ba037(0x92)][_0x1ba037(0x87)]===0x0)return Promise[_0x1ba037(0x79)]();return updateMenuCdnUrl(_0x1bea19);})),await new Promise(_0x3f9982=>setTimeout(_0x3f9982,0x3e8)),_0x45e14a('updated');else _0x39bf30===_0x5b2700(0x7c)&&_0x5598aa();}}});if(_0x3b625c)return a18_0x2b9851(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x4b056d(Text,{}),a18_0x4b056d(a18_0x4e2ff1,{'type':'dots'}),a18_0x4b056d(Text,{'children':_0x7fa2dd(0x9e)})]});if(_0x5afb31)return a18_0x2b9851(Box,{'flexDirection':_0x7fa2dd(0xaa),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x2b9851(Text,{'color':_0x7fa2dd(0x93),'children':['✗\x20',_0x5afb31]}),a18_0x2b9851(Box,{'marginTop':0x1,'children':[a18_0x4b056d(Text,{'color':'gray','children':_0x7fa2dd(0xa3)}),a18_0x4b056d(Text,{'color':_0x7fa2dd(0x84),'children':'rabetbase\x20auth'}),a18_0x4b056d(Text,{'color':_0x7fa2dd(0x96),'children':_0x7fa2dd(0x88)})]})]});if(_0x498c10[_0x7fa2dd(0x87)]===0x0)return a18_0x4b056d(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a18_0x4b056d(Text,{'color':_0x7fa2dd(0x7a),'children':_0x7fa2dd(0x8b)})});if(_0x221af5===_0x7fa2dd(0xa1))return a18_0x2b9851(Box,{'flexDirection':_0x7fa2dd(0xaa),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x4b056d(CurrentMenuCdnContent,{'menuList':_0x4e18fa}),a18_0x4b056d(InputCdnAsset,{'jsCdnUrl':_0x581b79,'cssCdnUrl':_0x584c0e}),a18_0x4b056d(Box,{'marginTop':0x1,'flexDirection':_0x7fa2dd(0xaa),'children':[{'label':_0x7fa2dd(0xa4),'value':'ok'},{'label':'Cancel\x20update','value':_0x7fa2dd(0x7c)}][_0x7fa2dd(0x9a)](_0x1416e9=>a18_0x2b9851(Text,{'color':_0x39bf30===_0x1416e9[_0x7fa2dd(0xa5)]?'yellow':undefined,'children':[_0x39bf30===_0x1416e9[_0x7fa2dd(0xa5)]?'>\x20':'\x20\x20',_0x1416e9[_0x7fa2dd(0x7d)]]},_0x1416e9['value']))})]});if(_0x221af5===_0x7fa2dd(0x95))return a18_0x2b9851(Box,{'flexDirection':_0x7fa2dd(0xaa),'marginTop':0x1,'marginBottom':0x1,'children':[a18_0x4b056d(CurrentMenuCdnContent,{'menuList':_0x4e18fa}),a18_0x4b056d(InputCdnAsset,{'jsCdnUrl':_0x581b79,'cssCdnUrl':_0x584c0e}),a18_0x2b9851(Box,{'marginTop':0x1,'children':[a18_0x4b056d(a18_0x4e2ff1,{'type':_0x7fa2dd(0x97)}),a18_0x4b056d(Text,{'children':_0x7fa2dd(0x8e)})]})]});if(_0x221af5==='updated')return a18_0x2b9851(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a18_0x4b056d(CurrentMenuCdnContent,{'menuList':_0x4e18fa}),a18_0x4b056d(InputCdnAsset,{'jsCdnUrl':_0x581b79,'cssCdnUrl':_0x584c0e}),a18_0x4b056d(Box,{'marginTop':0x1,'children':a18_0x4b056d(Text,{'color':_0x7fa2dd(0x9f),'children':'√\x20Updated\x20successfully'})})]});return a18_0x2b9851(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a18_0x4b056d(CurrentMenuCdnContent,{'menuList':_0x4e18fa}),a18_0x2b9851(Box,{'marginTop':0x1,'flexDirection':'column','children':[a18_0x4b056d(Text,{'color':_0x7fa2dd(0x84),'children':'*\x20Enter\x20new\x20asset\x20URLs'}),_0x581b79?a18_0x2b9851(Box,{'children':[a18_0x2b9851(Text,{'color':_0x7fa2dd(0x96),'children':['\x20\x20',_0x7fa2dd(0x7e)]}),a18_0x4b056d(Text,{'color':_0x7fa2dd(0x9f),'children':_0x581b79})]}):_0x221af5===_0x7fa2dd(0x8f)&&a18_0x2b9851(a18_0x22604f,{'children':[a18_0x2b9851(Box,{'children':[a18_0x2b9851(Text,{'children':['\x20\x20',_0x7fa2dd(0x7e)]}),a18_0x4b056d(Text,{'color':_0x7fa2dd(0x9f),'children':_0x321267}),_0x58c6d0&&a18_0x2b9851(Text,{'color':_0x7fa2dd(0x93),'children':[_0x7fa2dd(0x89),_0x58c6d0]})]}),!_0x58c6d0&&a18_0x4b056d(Box,{'children':a18_0x2b9851(Text,{'color':_0x7fa2dd(0x96),'children':['\x20\x20',_0x7fa2dd(0xa0)]})})]}),_0x584c0e?a18_0x2b9851(Box,{'children':[a18_0x2b9851(Text,{'children':['\x20\x20',_0x7fa2dd(0x85)]}),a18_0x4b056d(Text,{'color':_0x7fa2dd(0x9f),'children':_0x584c0e})]}):_0x221af5===_0x7fa2dd(0x9d)&&a18_0x2b9851(a18_0x22604f,{'children':[a18_0x2b9851(Box,{'children':[a18_0x2b9851(Text,{'children':['\x20\x20',_0x7fa2dd(0x85)]}),a18_0x4b056d(Text,{'color':_0x7fa2dd(0x9f),'children':_0x321267}),_0x58c6d0&&a18_0x2b9851(Text,{'color':_0x7fa2dd(0x93),'children':[_0x7fa2dd(0x89),_0x58c6d0]})]}),!_0x58c6d0&&a18_0x4b056d(Box,{'children':a18_0x2b9851(Text,{'color':'gray','children':['\x20\x20',_0x7fa2dd(0xa6)]})})]})]})]});}
@@ -1 +0,0 @@
1
- const a20_0x7bf694=a20_0x23a3;(function(_0x429818,_0x337e4c){const _0x2c3df8=a20_0x23a3,_0x88aea5=_0x429818();while(!![]){try{const _0x108520=parseInt(_0x2c3df8(0xff))/0x1+-parseInt(_0x2c3df8(0x100))/0x2+-parseInt(_0x2c3df8(0x10c))/0x3*(parseInt(_0x2c3df8(0x104))/0x4)+parseInt(_0x2c3df8(0x117))/0x5+-parseInt(_0x2c3df8(0x10e))/0x6*(parseInt(_0x2c3df8(0x114))/0x7)+parseInt(_0x2c3df8(0x106))/0x8*(-parseInt(_0x2c3df8(0x112))/0x9)+-parseInt(_0x2c3df8(0xf9))/0xa*(-parseInt(_0x2c3df8(0x101))/0xb);if(_0x108520===_0x337e4c)break;else _0x88aea5['push'](_0x88aea5['shift']());}catch(_0x1a1803){_0x88aea5['push'](_0x88aea5['shift']());}}}(a20_0x4817,0x5d61c));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a20_0x23a3(_0x401d13,_0xacaa31){_0x401d13=_0x401d13-0xf7;const _0x48172c=a20_0x4817();let _0x23a308=_0x48172c[_0x401d13];return _0x23a308;}function a20_0x4817(){const _0x521a75=['\x20\x20\x202.\x20Set\x20default:\x20rabetbase\x20config\x20set\x20app\x20<app-code>','info','30924utGpaY','label','2828088YKYjCE','json','Menu\x20assets\x20synced:\x20','Failed\x20to\x20update\x20menu\x20assets:\x20','18OKiuVW','log','7aRSibc','POST','import','1450305oqzJuC','errorCode','\x20\x20\x201.\x20Specify\x20directly:\x20rabetbase\x20api\x20pull\x20<app-code>','appcode','sdk-demo','error','3895470JYmyDf','No\x20AppCode\x20provided\x20and\x20no\x20default\x20configured','stringify','Error','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','/smartapi/menu/update','573613PpMRfE','688796bprbfU','22JsOilA','data','status','168WzeNjJ','errorMsg','46376nRXCvF','update-menu-cdn-url','success','resources'];a20_0x4817=function(){return _0x521a75;};return a20_0x4817();}const config=readConfig(),logLabel=a20_0x7bf694(0x107);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':'SdkDemo1','path':a20_0x7bf694(0xf7),'resources':[a20_0x7bf694(0xfd),'https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css']});export async function updateMenuCdnUrl(_0x1397ec){const _0x16534a=a20_0x7bf694,_0x5850f6=config?.[_0x16534a(0x11a)];if(!_0x5850f6){const _0x2332d6=_0x16534a(0xfa);logger[_0x16534a(0xf8)](logLabel,_0x2332d6),console[_0x16534a(0xf8)]('×\x20'+_0x2332d6),console['log']('!\x20Please\x20use\x20one\x20of\x20the\x20following:'),console[_0x16534a(0x113)](_0x16534a(0x119)),console[_0x16534a(0x113)](_0x16534a(0x10a));return;}logger[_0x16534a(0x10b)](logLabel,'Updating\x20menu\x20asset\x20links:\x20'+_0x1397ec[_0x16534a(0x10d)]+'\x20('+_0x1397ec['path']+')');const _0xa89b7f={'id':_0x1397ec['id'],'appCode':_0x5850f6,'extend':{'loadScriptMode':_0x16534a(0x116),'resources':_0x1397ec[_0x16534a(0x109)]?JSON['stringify'](_0x1397ec[_0x16534a(0x109)]):undefined}},_0x1d2829=await fetch(getApiDomain()+_0x16534a(0xfe),{'method':_0x16534a(0x115),'body':JSON[_0x16534a(0xfb)](_0xa89b7f),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x1d2829['ok']){if(_0x1d2829[_0x16534a(0x103)]===0x191){const _0x53154d='Authentication\x20failed,\x20session\x20expired.\x20Please\x20use\x20rabetbase\x20auth\x20to\x20login\x20again';logger[_0x16534a(0xf8)](logLabel,_0x53154d,{'status':_0x1d2829['status'],'menu':_0x1397ec[_0x16534a(0x10d)]});throw new Error(_0x53154d);}const _0x3334cc=_0x16534a(0x111)+_0x1d2829['status'];logger[_0x16534a(0xf8)](logLabel,_0x3334cc,{'menu':_0x1397ec[_0x16534a(0x10d)]});throw new Error(_0x3334cc);}const _0x18fd18=await _0x1d2829[_0x16534a(0x10f)]();if(!_0x18fd18[_0x16534a(0x108)]){const _0xb95f9b=_0x16534a(0x111)+(_0x18fd18[_0x16534a(0x105)]||_0x16534a(0xfc));logger['error'](logLabel,_0xb95f9b,{'errorCode':_0x18fd18[_0x16534a(0x118)],'errorMsg':_0x18fd18[_0x16534a(0x105)],'menu':_0x1397ec[_0x16534a(0x10d)]});throw new Error(_0xb95f9b);}logger[_0x16534a(0x10b)](logLabel,_0x16534a(0x110)+_0x1397ec[_0x16534a(0x10d)],_0x18fd18[_0x16534a(0x102)]);}
@@ -1 +0,0 @@
1
- const a29_0x543f75=a29_0x30fe;(function(_0x545f93,_0x453ec8){const _0xe0a1ff=a29_0x30fe,_0x664294=_0x545f93();while(!![]){try{const _0x4582c2=parseInt(_0xe0a1ff(0xbc))/0x1+parseInt(_0xe0a1ff(0xdd))/0x2+-parseInt(_0xe0a1ff(0xc9))/0x3*(-parseInt(_0xe0a1ff(0xd1))/0x4)+parseInt(_0xe0a1ff(0xda))/0x5*(-parseInt(_0xe0a1ff(0xd2))/0x6)+-parseInt(_0xe0a1ff(0xcc))/0x7*(parseInt(_0xe0a1ff(0xf7))/0x8)+-parseInt(_0xe0a1ff(0xf3))/0x9*(-parseInt(_0xe0a1ff(0xf5))/0xa)+-parseInt(_0xe0a1ff(0xeb))/0xb;if(_0x4582c2===_0x453ec8)break;else _0x664294['push'](_0x664294['shift']());}catch(_0x3bc848){_0x664294['push'](_0x664294['shift']());}}}(a29_0x3864,0x5009f));import{jsx as a29_0x394cff}from'react/jsx-runtime';import{render}from'ink';function a29_0x30fe(_0x323ea2,_0x28e3e0){_0x323ea2=_0x323ea2-0xb9;const _0x386415=a29_0x3864();let _0x30fe4b=_0x386415[_0x323ea2];return _0x30fe4b;}function a29_0x3864(){const _0x4b4f58=['\x20model(s)\x0a','must\x20be\x20a\x20JSON\x20object','No\x20models\x20found.','pull','4ILnnJt','102hjXEmn','padStart','key','\x0a\x20\x20App:\x20','map','doc','datasetCode','message','179135anbFPa','\x0a\x20\x20rabetbase\x20api\x20—\x20API\x20Operations\x0a\x0a\x20\x20USAGE\x0a\x20\x20\x20\x20rabetbase\x20api\x20list\x20[options]\x0a\x20\x20\x20\x20rabetbase\x20api\x20pull\x20[options]\x0a\x20\x20\x20\x20rabetbase\x20api\x20doc\x20\x20[options]\x0a\x0a\x20\x20OPTIONS\x0a\x20\x20\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20Specify\x20app\x20code\x0a\x20\x20\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20Output\x20directory\x20(pull:\x20./src/api/,\x20doc:\x20./docs)\x0a\x20\x20\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Environment\x20(daily\x20/\x20production)\x0a\x20\x20\x20\x20--datasetcode\x20<codes>\x20Dataset\x20codes\x20for\x20doc\x20(comma-separated,\x20doc\x20only)\x0a\x20\x20\x20\x20--params\x20<json>\x20\x20\x20\x20\x20\x20\x20Extra\x20params\x20JSON\x20(doc\x20only)\x0a\x0a\x20\x20EXAMPLES\x0a\x20\x20\x20\x20rabetbase\x20api\x20list\x0a\x20\x20\x20\x20rabetbase\x20api\x20list\x20--appcode\x20myapp\x0a\x20\x20\x20\x20rabetbase\x20api\x20pull\x0a\x20\x20\x20\x20rabetbase\x20api\x20pull\x20--appcode\x20myapp\x20--output\x20./api\x0a\x20\x20\x20\x20rabetbase\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x0a','output','1031714lLBbmG','--datasetcode\x20cannot\x20be\x20empty.','\x1b[90m*\x20Generating\x20docs\x20for:\x20','unknownCommand','trim','padEnd','Positional\x20arguments\x20are\x20no\x20longer\x20supported\x20for\x20`api\x20doc`.','api\x20','Invalid\x20--params:\x20','api\x20(missing\x20subcommand:\x20list,\x20pull\x20or\x20doc)','Pull\x20API\x20config\x20and\x20generate\x20documentation','env','appcode','min','6451214ZDxFIK','parse','object','\x1b[0m','Use:\x20rabetbase\x20api\x20doc\x20--appcode\x20','\x20\x20|\x20\x20','name','repeat','9elFlsn','validation','3498030LMiiXE','isArray','78152jfIfro','datasetcode','string','list','log','613510ntTiQc','Key','max','DatasetCode','Name','help','\x1b[90m*\x20Using\x20configured\x20AppCode:\x20','params','Positional\x20arguments\x20are\x20no\x20longer\x20supported\x20for\x20`api\x20pull`.','slice','Provide\x20a\x20valid\x20JSON\x20object,\x20e.g.\x20--params\x20\x27{\x22key\x22:\x22value\x22}\x27','configMissing','Set\x20appcode:\x20`rabetbase\x20config\x20set\x20appcode\x20<code>`\x20or\x20pass\x20--appcode.','1216965rZGEMs','api','length','259cxwgwn'];a29_0x3864=function(){return _0x4b4f58;};return a29_0x3864();}import{ApiPullUI}from'../api/api-pull-ui.js';import{ApiDocUI}from'../api/api-doc-ui.js';import{fetchModelList}from'../api/fetch-model-list.js';import{getConfigAppCode}from'../utils/config.js';import{CliErrors}from'../errors.js';const API_HELP=a29_0x543f75(0xdb);export const apiCommand={'name':a29_0x543f75(0xca),'description':a29_0x543f75(0xe7),async 'run'(_0x27be65,_0x401b81,_0xdd3003){const _0x132ef8=a29_0x543f75,_0x34fc39=_0x401b81[0x0];if(_0xdd3003[_0x132ef8(0xc1)]||!_0x34fc39&&!_0xdd3003['help']){console[_0x132ef8(0xbb)](API_HELP);if(!_0x34fc39&&!_0xdd3003[_0x132ef8(0xc1)])throw CliErrors[_0x132ef8(0xe0)](_0x132ef8(0xe6));return;}if(_0x34fc39===_0x132ef8(0xba)){const _0x459f73=getConfigAppCode(),_0x21626e=_0xdd3003[_0x132ef8(0xe9)]??_0x459f73;if(!_0x21626e)throw CliErrors['configMissing']('Set\x20appcode:\x20`rabetbase\x20config\x20set\x20appcode\x20<code>`\x20or\x20pass\x20--appcode.');const {configArray:_0xe245fc,count:_0x1395e2}=await fetchModelList(_0x21626e);if(_0x1395e2===0x0){console['log'](_0x132ef8(0xcf));return;}const _0x272af3=Math[_0x132ef8(0xea)](0x28,Math[_0x132ef8(0xbe)](0x4,..._0xe245fc[_0x132ef8(0xd6)](_0x552379=>_0x552379[_0x132ef8(0xf1)]['length']))),_0x25a090=Math[_0x132ef8(0xea)](0x24,Math[_0x132ef8(0xbe)](0x3,..._0xe245fc[_0x132ef8(0xd6)](_0xd2b1c3=>_0xd2b1c3[_0x132ef8(0xd4)][_0x132ef8(0xcb)]))),_0x4eb9d7=Math[_0x132ef8(0xea)](0x28,Math['max'](0x4,..._0xe245fc['map'](_0x4aa358=>_0x4aa358[_0x132ef8(0xd8)][_0x132ef8(0xcb)]))),_0x207047=(_0x611f5c,_0x1fc04a)=>_0x611f5c[_0x132ef8(0xc5)](0x0,_0x1fc04a)[_0x132ef8(0xe2)](_0x1fc04a),_0x4744bc=(_0x4d4f84,_0x390d3a,_0x1cb84e,_0xffe980)=>'\x20\x20'+String(_0x4d4f84)[_0x132ef8(0xd3)](0x6)+'\x20\x20'+_0x207047(_0x390d3a,_0x272af3)+'\x20\x20'+_0x207047(_0x1cb84e,_0x25a090)+'\x20\x20'+_0x207047(_0xffe980,_0x4eb9d7);console[_0x132ef8(0xbb)](_0x132ef8(0xd5)+_0x21626e+_0x132ef8(0xf0)+_0x1395e2+_0x132ef8(0xcd)),console['log'](_0x4744bc('ID',_0x132ef8(0xc0),_0x132ef8(0xbd),_0x132ef8(0xbf))),console[_0x132ef8(0xbb)]('\x20\x20'+'─'[_0x132ef8(0xf2)](0x6)+'\x20\x20'+'─'['repeat'](_0x272af3)+'\x20\x20'+'─'[_0x132ef8(0xf2)](_0x25a090)+'\x20\x20'+'─'[_0x132ef8(0xf2)](_0x4eb9d7));for(const _0xcaabe4 of _0xe245fc){console[_0x132ef8(0xbb)](_0x4744bc(_0xcaabe4['id'],_0xcaabe4[_0x132ef8(0xf1)],_0xcaabe4[_0x132ef8(0xd4)],_0xcaabe4[_0x132ef8(0xd8)]));}console[_0x132ef8(0xbb)]();return;}if(_0x34fc39===_0x132ef8(0xd0)){if(_0x401b81[0x1])throw CliErrors['validation'](_0x132ef8(0xc4),'Use:\x20rabetbase\x20api\x20pull\x20--appcode\x20'+_0x401b81[0x1]);const _0x8d04a0=getConfigAppCode();let _0x3987b6=_0xdd3003['appcode'];const _0x1357a3=typeof _0xdd3003[_0x132ef8(0xe8)]===_0x132ef8(0xb9)?_0xdd3003['env']:undefined,_0x47fc67=_0xdd3003[_0x132ef8(0xdc)];if(!_0x3987b6&&!_0x8d04a0)throw CliErrors[_0x132ef8(0xc7)](_0x132ef8(0xc8));_0x3987b6&&_0x8d04a0&&_0x3987b6===_0x8d04a0&&(console[_0x132ef8(0xbb)](_0x132ef8(0xc2)+_0x3987b6+'\x1b[0m'),_0x3987b6=undefined),render(a29_0x394cff(ApiPullUI,{'appCode':_0x3987b6,'env':_0x1357a3,'output':_0x47fc67}));}else{if(_0x34fc39===_0x132ef8(0xd7)){if(_0x401b81[0x1])throw CliErrors[_0x132ef8(0xf4)](_0x132ef8(0xe3),_0x132ef8(0xef)+_0x401b81[0x1]);const _0x500104=getConfigAppCode();let _0xb66693=_0xdd3003[_0x132ef8(0xe9)];const _0x153e8c=typeof _0xdd3003[_0x132ef8(0xe8)]===_0x132ef8(0xb9)?_0xdd3003[_0x132ef8(0xe8)]:undefined,_0x4ba5ad=_0xdd3003[_0x132ef8(0xdc)],_0x2826c6=_0xdd3003[_0x132ef8(0xc3)],_0x47f647=_0xdd3003[_0x132ef8(0xf8)];if(!_0xb66693&&!_0x500104)throw CliErrors[_0x132ef8(0xc7)](_0x132ef8(0xc8));_0xb66693&&_0x500104&&_0xb66693===_0x500104&&(console[_0x132ef8(0xbb)]('\x1b[90m*\x20Using\x20configured\x20AppCode:\x20'+_0xb66693+_0x132ef8(0xee)),_0xb66693=undefined);let _0x205d51;if(_0x2826c6)try{_0x205d51=JSON[_0x132ef8(0xec)](_0x2826c6);if(typeof _0x205d51!==_0x132ef8(0xed)||_0x205d51===null||Array[_0x132ef8(0xf6)](_0x205d51))throw new Error(_0x132ef8(0xce));}catch(_0x13a332){throw CliErrors[_0x132ef8(0xf4)](_0x132ef8(0xe5)+(_0x13a332 instanceof Error?_0x13a332[_0x132ef8(0xd9)]:String(_0x13a332)),_0x132ef8(0xc6));}let _0x38ec79;if(_0x47f647){const _0x4aa650=_0x47f647['split'](',')[_0x132ef8(0xd6)](_0x2c2504=>_0x2c2504[_0x132ef8(0xe1)]())['filter'](_0x40ed10=>_0x40ed10[_0x132ef8(0xcb)]>0x0);if(_0x4aa650[_0x132ef8(0xcb)]===0x0)throw CliErrors[_0x132ef8(0xf4)](_0x132ef8(0xde));console['log'](_0x132ef8(0xdf)+_0x4aa650['join'](',\x20')+_0x132ef8(0xee)),_0x38ec79=_0x4aa650;}render(a29_0x394cff(ApiDocUI,{'appCode':_0xb66693,'env':_0x153e8c,'output':_0x4ba5ad,'extraParams':_0x205d51,'datasetCodes':_0x38ec79}));}else{console['log'](API_HELP);throw CliErrors['unknownCommand'](_0x132ef8(0xe4)+_0x34fc39);}}}};
@@ -1 +0,0 @@
1
- const a55_0x22b2c9=a55_0x252e;(function(_0x874736,_0x45c77d){const _0x3a47e2=a55_0x252e,_0x12f982=_0x874736();while(!![]){try{const _0x3b0ee2=-parseInt(_0x3a47e2(0x1a4))/0x1+-parseInt(_0x3a47e2(0x1a5))/0x2*(-parseInt(_0x3a47e2(0x1b2))/0x3)+-parseInt(_0x3a47e2(0x1a7))/0x4+parseInt(_0x3a47e2(0x1a2))/0x5+parseInt(_0x3a47e2(0x1b0))/0x6*(parseInt(_0x3a47e2(0x19f))/0x7)+parseInt(_0x3a47e2(0x1a8))/0x8*(parseInt(_0x3a47e2(0x1a1))/0x9)+parseInt(_0x3a47e2(0x1ab))/0xa*(-parseInt(_0x3a47e2(0x19e))/0xb);if(_0x3b0ee2===_0x45c77d)break;else _0x12f982['push'](_0x12f982['shift']());}catch(_0x1a2f2c){_0x12f982['push'](_0x12f982['shift']());}}}(a55_0x17da,0x980bf));import{jsx as a55_0x3aac33}from'react/jsx-runtime';import{render}from'ink';import{AppMenuSyncUI}from'../app-menu/app-menu-sync-ui.js';function a55_0x17da(){const _0x22a40e=['menu-sync','update','cwd','222990sEukzg','logger','277026jjzKAp','22mmgPdW','224STXkzB','执行更新菜单\x20CDN\x20资源命令','84897HmFDTb','435570lgVLUz','同步菜单命令','352946soUmrP','12dTKwut','info','4856700tNVrTE','928HxvlXf','menu','Sync\x20menu\x20and\x20update\x20CDN\x20resources','3673850twsJud','setLogPath'];a55_0x17da=function(){return _0x22a40e;};return a55_0x17da();}import{AppMenuUpdateCdn}from'../app-menu-update-cdn/main.js';function a55_0x252e(_0x436042,_0x265a16){_0x436042=_0x436042-0x19e;const _0x17da65=a55_0x17da();let _0x252e9d=_0x17da65[_0x436042];return _0x252e9d;}export const menuCommand={'name':a55_0x22b2c9(0x1a9),'description':a55_0x22b2c9(0x1aa),async 'run'(_0x263892,_0x5c0c44,_0x117605){const _0xf844a1=a55_0x22b2c9,_0x200831=_0x5c0c44[0x0];_0x200831===_0xf844a1(0x1ae)?(_0x263892[_0xf844a1(0x1b1)][_0xf844a1(0x1ac)](process['cwd']()),_0x263892[_0xf844a1(0x1b1)][_0xf844a1(0x1a6)]('menu-update-cdn',_0xf844a1(0x1a0)),render(a55_0x3aac33(AppMenuUpdateCdn,{}))):(_0x263892['logger'][_0xf844a1(0x1ac)](process[_0xf844a1(0x1af)]()),_0x263892[_0xf844a1(0x1b1)][_0xf844a1(0x1a6)](_0xf844a1(0x1ad),_0xf844a1(0x1a3)),render(a55_0x3aac33(AppMenuSyncUI,{})));}};