@lovrabet/rabetbase-cli 2.0.2-beta.6 → 2.0.2-beta.8

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 (132) 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/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -0
  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 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  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/cli-update.js +1 -1
  30. package/lib/commands/codegen/index.js +1 -1
  31. package/lib/commands/codegen/sdk.js +1 -1
  32. package/lib/commands/codegen/sql.js +1 -1
  33. package/lib/commands/common/flags.js +1 -1
  34. package/lib/commands/config.js +1 -1
  35. package/lib/commands/create.js +1 -1
  36. package/lib/commands/dataset/detail.js +1 -1
  37. package/lib/commands/dataset/index.js +1 -1
  38. package/lib/commands/dataset/links.js +1 -1
  39. package/lib/commands/dataset/list.js +1 -1
  40. package/lib/commands/dataset/operations.js +1 -1
  41. package/lib/commands/doctor.js +1 -1
  42. package/lib/commands/init.js +1 -1
  43. package/lib/commands/logout.js +1 -1
  44. package/lib/commands/logs.js +1 -1
  45. package/lib/commands/mcp.js +1 -1
  46. package/lib/commands/menu/index.js +1 -1
  47. package/lib/commands/menu/shared/compare-table.js +1 -1
  48. package/lib/commands/menu/shared/index.js +1 -1
  49. package/lib/commands/menu/shared/inquirer.js +1 -1
  50. package/lib/commands/menu/shared/local-pages.js +1 -1
  51. package/lib/commands/menu/shared/logic.js +1 -1
  52. package/lib/commands/menu/shared/service.js +1 -1
  53. package/lib/commands/menu/shared/sync-core.js +1 -1
  54. package/lib/commands/menu/shared/update-core.js +1 -1
  55. package/lib/commands/menu/shared/valid-url.js +1 -1
  56. package/lib/commands/menu/sync.js +1 -1
  57. package/lib/commands/menu/update.js +1 -1
  58. package/lib/commands/preview.js +1 -1
  59. package/lib/commands/project-upgrade.js +1 -1
  60. package/lib/commands/registry.js +1 -1
  61. package/lib/commands/run.js +1 -1
  62. package/lib/commands/skill.js +1 -1
  63. package/lib/commands/sql/detail.js +1 -1
  64. package/lib/commands/sql/exec.js +1 -1
  65. package/lib/commands/sql/index.js +1 -1
  66. package/lib/commands/sql/list.js +1 -1
  67. package/lib/commands/sql/save.js +1 -1
  68. package/lib/commands/sql/validate.js +1 -1
  69. package/lib/commands/start.js +1 -1
  70. package/lib/config/config-help.js +1 -1
  71. package/lib/config/main.js +1 -1
  72. package/lib/constant/cli.js +1 -1
  73. package/lib/constant/domain.js +1 -1
  74. package/lib/constant/env.js +1 -1
  75. package/lib/context.js +1 -1
  76. package/lib/core/alias-resolver.js +1 -1
  77. package/lib/core/api-client.js +1 -1
  78. package/lib/core/bff/config.js +1 -1
  79. package/lib/core/bff/file-system.js +1 -1
  80. package/lib/core/bff/hash.js +1 -1
  81. package/lib/core/bff/lock.js +1 -1
  82. package/lib/core/bff/utils.js +1 -1
  83. package/lib/core/db-resolver.js +1 -1
  84. package/lib/core/sql-validator.js +1 -1
  85. package/lib/create-app/enhanced-guided-create.js +1 -1
  86. package/lib/create-app/format-elapsed.js +1 -1
  87. package/lib/create-app/main.js +1 -1
  88. package/lib/create-app/non-interactive.js +1 -1
  89. package/lib/create-app/task-finished.js +1 -1
  90. package/lib/create-app/task-loading.js +1 -1
  91. package/lib/create-app/task-running.js +1 -1
  92. package/lib/create-app/task-time.js +1 -1
  93. package/lib/create-app/use-copy-project-template.js +1 -1
  94. package/lib/create-app/use-format-code.js +1 -1
  95. package/lib/create-app/use-install-dependencies.js +1 -1
  96. package/lib/errors.js +1 -1
  97. package/lib/framework/flags.js +1 -1
  98. package/lib/framework/help.js +1 -1
  99. package/lib/framework/index.js +1 -1
  100. package/lib/framework/output.js +1 -1
  101. package/lib/framework/response.js +1 -1
  102. package/lib/framework/runner.js +1 -1
  103. package/lib/generated/build-info.js +1 -1
  104. package/lib/help.js +1 -1
  105. package/lib/init/main.js +1 -1
  106. package/lib/mcp/McpInstallUI.js +1 -1
  107. package/lib/mcp/claude.js +1 -1
  108. package/lib/mcp/cursor.js +1 -1
  109. package/lib/mcp/main.js +1 -1
  110. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  111. package/lib/mcp/mcp-installer.js +1 -1
  112. package/lib/skills/main.js +1 -1
  113. package/lib/skills/npx-skills-add.js +1 -1
  114. package/lib/telemetry/cli-help-trace.js +1 -0
  115. package/lib/telemetry/otel-logger-version.js +1 -0
  116. package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
  117. package/lib/ui/IDESelector.js +1 -1
  118. package/lib/ui/useIDESelection.js +1 -1
  119. package/lib/utils/ai_config.js +1 -1
  120. package/lib/utils/cdn-config.js +1 -1
  121. package/lib/utils/check-sdk-version.js +1 -1
  122. package/lib/utils/cli-version-check.js +1 -1
  123. package/lib/utils/config.js +1 -1
  124. package/lib/utils/copy-directory.js +1 -1
  125. package/lib/utils/file-utils.js +1 -1
  126. package/lib/utils/guides-cdn.js +1 -1
  127. package/lib/utils/http-client.js +1 -1
  128. package/lib/utils/logger.js +1 -1
  129. package/lib/utils/rules-cdn.js +1 -1
  130. package/lib/utils/sleep.js +1 -1
  131. package/lib/utils/template-replacer.js +1 -1
  132. package/package.json +2 -1
@@ -1 +1 @@
1
- function a128_0x5dcd(){const _0x4382b4=['../../templates/rules/lovrabet_rules.mdc.tpl','statusText','content','lastUpdated','utf-8','444qQZvwW','1286VLrYjD','120Lcnthw','236410wOwgUi','1430883IKnaZj','7qVWwMt','19313OCltJA','11289216cSSryO','3777DpuWeP','80IwTMEW','json','.cursor/rules','CDN\x20请求失败:\x20','223597RAKeGu','application/json','string','/rules/rules.json','lovrabet_rules.mdc','4661970VxdYoz'];a128_0x5dcd=function(){return _0x4382b4;};return a128_0x5dcd();}const a128_0x28c1c4=a128_0x409b;(function(_0x2b5dcd,_0x2b17e5){const _0x355dff=a128_0x409b,_0x3ef68a=_0x2b5dcd();while(!![]){try{const _0x2eb275=-parseInt(_0x355dff(0x6d))/0x1+parseInt(_0x355dff(0x68))/0x2*(parseInt(_0x355dff(0x6f))/0x3)+-parseInt(_0x355dff(0x69))/0x4*(-parseInt(_0x355dff(0x6a))/0x5)+-parseInt(_0x355dff(0x79))/0x6*(parseInt(_0x355dff(0x6c))/0x7)+parseInt(_0x355dff(0x6e))/0x8+-parseInt(_0x355dff(0x6b))/0x9*(parseInt(_0x355dff(0x70))/0xa)+parseInt(_0x355dff(0x74))/0xb*(-parseInt(_0x355dff(0x67))/0xc);if(_0x2eb275===_0x2b17e5)break;else _0x3ef68a['push'](_0x3ef68a['shift']());}catch(_0x3dd63a){_0x3ef68a['push'](_0x3ef68a['shift']());}}}(a128_0x5dcd,0xc7e9e));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0xdbba81=a128_0x409b,_0x2c0eee=getTemplateBaseUrl();return _0x2c0eee+_0xdbba81(0x77);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a128_0x28c1c4(0x7a));export async function fetchRulesFromCDN(){const _0x27b313=a128_0x28c1c4,_0x5395a4=getRulesCdnUrl(),_0x604401=await fetch(_0x5395a4,{'headers':{'Accept':_0x27b313(0x75)}});if(!_0x604401['ok'])throw new Error(_0x27b313(0x73)+_0x604401['status']+'\x20'+_0x604401[_0x27b313(0x7b)]);const _0x4e15e7=await _0x604401[_0x27b313(0x71)]();if(!_0x4e15e7[_0x27b313(0x64)]||typeof _0x4e15e7[_0x27b313(0x64)]!==_0x27b313(0x76))throw new Error('CDN\x20返回数据格式错误');return _0x4e15e7;}export async function getRulesContent(){const _0x50bf5e=a128_0x28c1c4;try{const _0x57ed20=await fetchRulesFromCDN();return _0x57ed20[_0x50bf5e(0x64)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,'utf-8');throw new Error('本地模板文件不存在:\x20'+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x29991e){const _0x2623d8=a128_0x28c1c4,_0x47f7f7=await fetchRulesFromCDN()['catch'](()=>null);let _0x407734;_0x47f7f7?(_0x407734=_0x47f7f7['content'],_0x47f7f7[_0x2623d8(0x65)]&&(_0x407734=appendUpdateTime(_0x407734,_0x47f7f7[_0x2623d8(0x65)]))):_0x407734=readLocalTemplate();const _0x1633a9=dirname(_0x29991e);!existsSync(_0x1633a9)&&mkdirSync(_0x1633a9,{'recursive':!![]}),writeFileSync(_0x29991e,_0x407734,_0x2623d8(0x66));}function a128_0x409b(_0x1520c2,_0x32a53f){_0x1520c2=_0x1520c2-0x64;const _0x5dcdfe=a128_0x5dcd();let _0x409b93=_0x5dcdfe[_0x1520c2];return _0x409b93;}export async function copyRulesToCursor(_0x1389de){const _0x13f36c=a128_0x28c1c4,_0x22876=join(_0x1389de,_0x13f36c(0x72)),_0x1dbe91=join(_0x22876,_0x13f36c(0x78));if(existsSync(_0x1dbe91))return![];return await writeRulesFile(_0x1dbe91),!![];}export async function copyRulesToAgentsMd(_0x26bdf1){const _0x44916a=join(_0x26bdf1,'agents.md');if(existsSync(_0x44916a))return![];return await writeRulesFile(_0x44916a),!![];}
1
+ const a132_0x85b328=a132_0x4e0c;(function(_0xca8eba,_0x1442e3){const _0x10b847=a132_0x4e0c,_0x3f53c6=_0xca8eba();while(!![]){try{const _0xc88189=-parseInt(_0x10b847(0xe1))/0x1+-parseInt(_0x10b847(0xeb))/0x2*(parseInt(_0x10b847(0xe5))/0x3)+-parseInt(_0x10b847(0xdf))/0x4*(parseInt(_0x10b847(0xec))/0x5)+parseInt(_0x10b847(0xe4))/0x6*(-parseInt(_0x10b847(0xd8))/0x7)+parseInt(_0x10b847(0xdd))/0x8+-parseInt(_0x10b847(0xda))/0x9+parseInt(_0x10b847(0xed))/0xa;if(_0xc88189===_0x1442e3)break;else _0x3f53c6['push'](_0x3f53c6['shift']());}catch(_0x374a8a){_0x3f53c6['push'](_0x3f53c6['shift']());}}}(a132_0x1ec6,0x381bd));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';function a132_0x1ec6(){const _0x2091f2=['status','5082UcTcjP','12TRyNBP','lovrabet_rules.mdc','CDN\x20请求失败:\x20','content','catch','本地模板文件不存在:\x20','179674RUwApQ','49960rfxuWa','12039200iiUxyA','CDN\x20返回数据格式错误','../../templates/rules/lovrabet_rules.mdc.tpl','651xwoQLn','json','1473291ISWgSU','statusText','application/json','939960fcIwXw','lastUpdated','76XkCKAV','utf-8','299928tZTZXz','agents.md'];a132_0x1ec6=function(){return _0x2091f2;};return a132_0x1ec6();}import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x34a4cb=getTemplateBaseUrl();return _0x34a4cb+'/rules/rules.json';}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a132_0x85b328(0xd7));function a132_0x4e0c(_0x36ce53,_0x5b6cc1){_0x36ce53=_0x36ce53-0xd7;const _0x1ec62d=a132_0x1ec6();let _0x4e0c53=_0x1ec62d[_0x36ce53];return _0x4e0c53;}export async function fetchRulesFromCDN(){const _0x4c37bc=a132_0x85b328,_0x41dc2a=getRulesCdnUrl(),_0x24f0be=await fetch(_0x41dc2a,{'headers':{'Accept':_0x4c37bc(0xdc)}});if(!_0x24f0be['ok'])throw new Error(_0x4c37bc(0xe7)+_0x24f0be[_0x4c37bc(0xe3)]+'\x20'+_0x24f0be[_0x4c37bc(0xdb)]);const _0x5d73fd=await _0x24f0be[_0x4c37bc(0xd9)]();if(!_0x5d73fd[_0x4c37bc(0xe8)]||typeof _0x5d73fd[_0x4c37bc(0xe8)]!=='string')throw new Error(_0x4c37bc(0xee));return _0x5d73fd;}export async function getRulesContent(){const _0x47887d=a132_0x85b328;try{const _0x43a0d0=await fetchRulesFromCDN();return _0x43a0d0[_0x47887d(0xe8)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x3970ee=a132_0x85b328;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,'utf-8');throw new Error(_0x3970ee(0xea)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0xd84cea){const _0x4991cb=a132_0x85b328,_0x14bbbf=await fetchRulesFromCDN()[_0x4991cb(0xe9)](()=>null);let _0x2f9d00;_0x14bbbf?(_0x2f9d00=_0x14bbbf[_0x4991cb(0xe8)],_0x14bbbf['lastUpdated']&&(_0x2f9d00=appendUpdateTime(_0x2f9d00,_0x14bbbf[_0x4991cb(0xde)]))):_0x2f9d00=readLocalTemplate();const _0x3b2dc4=dirname(_0xd84cea);!existsSync(_0x3b2dc4)&&mkdirSync(_0x3b2dc4,{'recursive':!![]}),writeFileSync(_0xd84cea,_0x2f9d00,_0x4991cb(0xe0));}export async function copyRulesToCursor(_0x3c616f){const _0x587a87=a132_0x85b328,_0x292b2f=join(_0x3c616f,'.cursor/rules'),_0x1e7a7f=join(_0x292b2f,_0x587a87(0xe6));if(existsSync(_0x1e7a7f))return![];return await writeRulesFile(_0x1e7a7f),!![];}export async function copyRulesToAgentsMd(_0x135898){const _0x546e7d=a132_0x85b328,_0x1240d3=join(_0x135898,_0x546e7d(0xe2));if(existsSync(_0x1240d3))return![];return await writeRulesFile(_0x1240d3),!![];}
@@ -1 +1 @@
1
- export function sleep(_0x58b24b){return new Promise(_0x4df566=>setTimeout(_0x4df566,_0x58b24b));}
1
+ export function sleep(_0x564db3){return new Promise(_0x4118ce=>setTimeout(_0x4118ce,_0x564db3));}
@@ -1 +1 @@
1
- function a130_0x3dd8(_0x377f1b,_0x397cbe){_0x377f1b=_0x377f1b-0x1ed;const _0x173192=a130_0x1731();let _0x3dd855=_0x173192[_0x377f1b];return _0x3dd855;}const a130_0x4fb013=a130_0x3dd8;function a130_0x1731(){const _0x44013f=['.jsx','promises','push','charAt','.js','datasetCode:\x20\x22','7390586JzIJiy','.tpl','utf8','toLocaleDateString','message','api','\x20},','toUpperCase','slice','success','1841354ShzQlv','alias','开始处理模板内容替换','.ts','22743210KhgxvQ','split','readdir','isDirectory','name:\x20\x22','97413BypHop','endsWith','902556ZmuBsy','8qtyBqm','LOVRABET','datasetCode','template','.json','35TKZoMP','processDirectory','map','../../package.json','copyFile','name','replace','processFile','.tsx','toComponentName','version','alias:\x20\x22','mkdir','pop','replaceContent','error','join','toLocaleString','7233939jJgaYO','toLowerCase','tableName:\x20\x22','info','116ySuDhu','2-digit','\x0a\x20\x20\x20\x20{\x20','346077kIqfmM','processTemplate','now','numeric','toDisplayTitle','writeFile'];a130_0x1731=function(){return _0x44013f;};return a130_0x1731();}(function(_0x1dc293,_0x1ce529){const _0x5edabd=a130_0x3dd8,_0x2fa007=_0x1dc293();while(!![]){try{const _0x15660d=-parseInt(_0x5edabd(0x1f3))/0x1+parseInt(_0x5edabd(0x209))/0x2+-parseInt(_0x5edabd(0x212))/0x3*(-parseInt(_0x5edabd(0x1f0))/0x4)+parseInt(_0x5edabd(0x21a))/0x5*(parseInt(_0x5edabd(0x214))/0x6)+parseInt(_0x5edabd(0x1ff))/0x7*(parseInt(_0x5edabd(0x215))/0x8)+-parseInt(_0x5edabd(0x22c))/0x9+-parseInt(_0x5edabd(0x20d))/0xa;if(_0x15660d===_0x1ce529)break;else _0x2fa007['push'](_0x2fa007['shift']());}catch(_0x44f69c){_0x2fa007['push'](_0x2fa007['shift']());}}}(a130_0x1731,0x85883));import a130_0x289c56 from'node:fs';import a130_0x383d38 from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a130_0x4fb013(0x21d))[a130_0x4fb013(0x224)];export class TemplateReplacer{static[a130_0x4fb013(0x223)](_0x529505){const _0xfd1033=a130_0x4fb013,_0x63f1ff=_0x529505[_0xfd1033(0x20e)]('/')[_0xfd1033(0x227)]()||_0x529505;return _0x63f1ff[_0xfd1033(0x20e)]('-')[_0xfd1033(0x21c)](_0x559bdf=>_0x559bdf[_0xfd1033(0x1fc)](0x0)[_0xfd1033(0x206)]()+_0x559bdf[_0xfd1033(0x207)](0x1)[_0xfd1033(0x1ed)]())[_0xfd1033(0x22a)]('');}static[a130_0x4fb013(0x1f7)](_0x8c1e59){const _0x3280ec=a130_0x4fb013,_0x2ddfea=_0x8c1e59[_0x3280ec(0x20e)]('/')[_0x3280ec(0x227)]()||_0x8c1e59;return _0x2ddfea[_0x3280ec(0x20e)]('-')[_0x3280ec(0x21c)](_0x3e77dd=>_0x3e77dd[_0x3280ec(0x1fc)](0x0)[_0x3280ec(0x206)]()+_0x3e77dd[_0x3280ec(0x207)](0x1)[_0x3280ec(0x1ed)]())[_0x3280ec(0x22a)]('\x20');}static['replaceContent'](_0x2f2ce0,_0x4b9a14,_0x16ff71){const _0x4bcdb7=a130_0x4fb013,_0x53440c=this[_0x4bcdb7(0x223)](_0x4b9a14),_0x3b6307=this[_0x4bcdb7(0x1f7)](_0x4b9a14),_0xe3dac4=new Date(),_0x547e14=_0xe3dac4[_0x4bcdb7(0x22b)](undefined,{'year':_0x4bcdb7(0x1f6),'month':_0x4bcdb7(0x1f1),'day':'2-digit','hour':_0x4bcdb7(0x1f1),'minute':_0x4bcdb7(0x1f1),'second':_0x4bcdb7(0x1f1),'hour12':![]})[_0x4bcdb7(0x220)](/\//g,'-'),_0x2a776b=_0xe3dac4[_0x4bcdb7(0x202)](undefined,{'year':_0x4bcdb7(0x1f6),'month':_0x4bcdb7(0x1f1),'day':_0x4bcdb7(0x1f1)})['replace'](/\//g,'-'),_0x44816e=_0xe3dac4['toLocaleTimeString'](undefined,{'hour12':![]});let _0x358a39=_0x2f2ce0['replace'](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0x53440c)['replace'](/\{DisplayTitle\}/g,_0x3b6307)['replace'](/\{PageName\}/g,_0x4b9a14)['replace'](/\{TemplateName\}/g,_0x16ff71)[_0x4bcdb7(0x220)](/\{CreatedAt\}/g,_0x547e14)['replace'](/\{CreatedDate\}/g,_0x2a776b)[_0x4bcdb7(0x220)](/\{CreatedTime\}/g,_0x44816e);return _0x358a39;}static['replaceApiContent'](_0x49a0e0,_0x968c79,_0x4c59c7,_0x9f88ef,_0x43b926,_0x451588,_0x1d866b,_0x2b871c){const _0xe31c90=a130_0x4fb013,_0x4c27a3=new Date(),_0x5a5f43=_0x4c27a3['toISOString'](),_0x574c32=_0x4c59c7['map'](_0x4ae707=>{const _0x37a926=a130_0x3dd8,_0x5e8cbc=[_0x37a926(0x1fe)+_0x4ae707[_0x37a926(0x217)]+'\x22',_0x37a926(0x1ee)+_0x4ae707['tableName']+'\x22',_0x37a926(0x211)+_0x4ae707[_0x37a926(0x21f)]+'\x22'];return _0x4ae707[_0x37a926(0x20a)]&&_0x5e8cbc[_0x37a926(0x1fb)](_0x37a926(0x225)+_0x4ae707[_0x37a926(0x20a)]+'\x22'),_0x37a926(0x1f2)+_0x5e8cbc[_0x37a926(0x22a)](',\x20')+_0x37a926(0x205);})[_0xe31c90(0x22a)](''),_0x3ad794=_0x9f88ef||_0x4c59c7[0x0]?.[_0xe31c90(0x20a)]||'YourModel';let _0x73f8ee=_0x49a0e0[_0xe31c90(0x220)](/\{AppCode\}/g,_0x968c79)[_0xe31c90(0x220)](/\{ModelConfigs\}/g,_0x574c32)[_0xe31c90(0x220)](/\{ExampleModelName\}/g,_0x3ad794)[_0xe31c90(0x220)](/\{ApiFileName\}/g,_0x43b926||_0xe31c90(0x204))[_0xe31c90(0x220)](/\{ConfigName\}/g,_0x451588||'default')[_0xe31c90(0x220)](/\{ClientConfigParam\}/g,_0x1d866b||'')[_0xe31c90(0x220)](/\{VarPrefix\}/g,_0x2b871c||_0xe31c90(0x216))[_0xe31c90(0x220)](/\{CreatedAt\}/g,_0x5a5f43);return _0x73f8ee;}static async[a130_0x4fb013(0x1f4)](_0x4b61dd,_0x5bf735,_0x15b5bf,_0x656b82,_0x22487f=!![]){const _0x443e97=a130_0x4fb013,_0x2471ae=Date[_0x443e97(0x1f5)]();try{_0x22487f&&logger[_0x443e97(0x1ef)]('template',_0x443e97(0x20b),{'templatePath':_0x4b61dd,'targetPath':_0x5bf735,'pageName':_0x15b5bf,'templateName':_0x656b82});await a130_0x289c56[_0x443e97(0x1fa)][_0x443e97(0x226)](_0x5bf735,{'recursive':!![]}),await this[_0x443e97(0x21b)](_0x4b61dd,_0x5bf735,_0x15b5bf,_0x656b82);if(_0x22487f){const _0x52145c=Date['now']()-_0x2471ae;logger[_0x443e97(0x208)](_0x443e97(0x218),'模板内容替换完成',_0x52145c,{'pageName':_0x15b5bf,'templateName':_0x656b82});}}catch(_0x2125c2){if(_0x22487f){const _0x36ab7f=Date[_0x443e97(0x1f5)]()-_0x2471ae;logger[_0x443e97(0x229)](_0x443e97(0x218),'模板内容替换失败',{'templatePath':_0x4b61dd,'targetPath':_0x5bf735,'pageName':_0x15b5bf,'templateName':_0x656b82,'error':_0x2125c2 instanceof Error?_0x2125c2[_0x443e97(0x203)]:String(_0x2125c2),'duration':_0x36ab7f});}throw _0x2125c2;}}static async[a130_0x4fb013(0x21b)](_0x3afbe7,_0x26a8cb,_0x2a8869,_0x2c042c){const _0x3b60c3=a130_0x4fb013,_0x2ea808=await a130_0x289c56[_0x3b60c3(0x1fa)][_0x3b60c3(0x20f)](_0x3afbe7,{'withFileTypes':!![]});for(const _0x184d7b of _0x2ea808){const _0x40208f=a130_0x383d38[_0x3b60c3(0x22a)](_0x3afbe7,_0x184d7b[_0x3b60c3(0x21f)]);let _0xa4b064=a130_0x383d38['join'](_0x26a8cb,_0x184d7b[_0x3b60c3(0x21f)]);_0x184d7b['name']['endsWith']('.tpl')&&(_0xa4b064=a130_0x383d38[_0x3b60c3(0x22a)](_0x26a8cb,_0x184d7b['name'][_0x3b60c3(0x220)](/\.tpl$/,'')));if(_0x184d7b[_0x3b60c3(0x210)]())await a130_0x289c56['promises'][_0x3b60c3(0x226)](_0xa4b064,{'recursive':!![]}),await this['processDirectory'](_0x40208f,_0xa4b064,_0x2a8869,_0x2c042c);else _0x184d7b['isFile']()&&await this['processFile'](_0x40208f,_0xa4b064,_0x2a8869,_0x2c042c);}}static async[a130_0x4fb013(0x221)](_0x515953,_0x39a54c,_0x30371c,_0x1153ed){const _0x230558=a130_0x4fb013,_0x4093dd=a130_0x383d38['extname'](_0x515953)[_0x230558(0x1ed)]();_0x515953['endsWith'](_0x230558(0x200))&&(_0x39a54c=_0x39a54c['replace'](/\.tpl$/,''));const _0x53040d=[_0x230558(0x222),_0x230558(0x20c),_0x230558(0x1f9),_0x230558(0x1fd),_0x230558(0x219),'.md','.css','.scss','.tpl'];if(_0x53040d['includes'](_0x4093dd)||_0x515953[_0x230558(0x213)](_0x230558(0x200))){const _0x4e1603=await a130_0x289c56[_0x230558(0x1fa)]['readFile'](_0x515953,_0x230558(0x201)),_0x5320f4=this[_0x230558(0x228)](_0x4e1603,_0x30371c,_0x1153ed);await a130_0x289c56[_0x230558(0x1fa)][_0x230558(0x1f8)](_0x39a54c,_0x5320f4,_0x230558(0x201));}else await a130_0x289c56[_0x230558(0x1fa)][_0x230558(0x21e)](_0x515953,_0x39a54c);}}
1
+ const a134_0x2af0ef=a134_0x3942;(function(_0xc80f8e,_0x279e5e){const _0x566c38=a134_0x3942,_0x231ac6=_0xc80f8e();while(!![]){try{const _0x4588da=parseInt(_0x566c38(0x1c1))/0x1*(-parseInt(_0x566c38(0x1a5))/0x2)+parseInt(_0x566c38(0x1ba))/0x3+parseInt(_0x566c38(0x1b5))/0x4*(-parseInt(_0x566c38(0x1c8))/0x5)+parseInt(_0x566c38(0x1aa))/0x6+-parseInt(_0x566c38(0x1b6))/0x7+parseInt(_0x566c38(0x1b0))/0x8+-parseInt(_0x566c38(0x1b1))/0x9;if(_0x4588da===_0x279e5e)break;else _0x231ac6['push'](_0x231ac6['shift']());}catch(_0x5b7c5f){_0x231ac6['push'](_0x231ac6['shift']());}}}(a134_0x45db,0xa0a3c));import a134_0x341def from'node:fs';import a134_0x143284 from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';function a134_0x3942(_0x16f13b,_0x1d8af7){_0x16f13b=_0x16f13b-0x18d;const _0x45dbb8=a134_0x45db();let _0x394289=_0x45dbb8[_0x16f13b];return _0x394289;}function a134_0x45db(){const _0x49801c=['.json','extname','mkdir','datasetCode','map','.css','241nqRUhf','toLowerCase','\x20},','alias:\x20\x22','slice','toLocaleDateString','.md','5BZTvLL','join','name','2-digit','now','tableName:\x20\x22','message','push','processDirectory','toDisplayTitle','template','.tpl','toComponentName','.jsx','processFile','.tsx','includes','replace','split','toLocaleTimeString','toISOString','toUpperCase','replaceContent','pop','LOVRABET','charAt','.scss','模板内容替换失败','utf8','version','3384vkiGvz','name:\x20\x22','isDirectory','api','success','6880800lfJISX','alias','../../package.json','开始处理模板内容替换','writeFile','numeric','4228216LEYoDe','667827hrKOfw','replaceApiContent','.ts','promises','2831476vTwRZE','6271216AavXKc','readdir','tableName','endsWith','3205155CZRFuF'];a134_0x45db=function(){return _0x49801c;};return a134_0x45db();}const require=createRequire(import.meta.url),CLI_VERSION=require(a134_0x2af0ef(0x1ac))[a134_0x2af0ef(0x1a4)];export class TemplateReplacer{static[a134_0x2af0ef(0x193)](_0x45e8cb){const _0x328b87=a134_0x2af0ef,_0x5c1776=_0x45e8cb[_0x328b87(0x199)]('/')['pop']()||_0x45e8cb;return _0x5c1776[_0x328b87(0x199)]('-')[_0x328b87(0x1bf)](_0x255ac5=>_0x255ac5['charAt'](0x0)[_0x328b87(0x19c)]()+_0x255ac5[_0x328b87(0x1c5)](0x1)[_0x328b87(0x1c2)]())[_0x328b87(0x1c9)]('');}static[a134_0x2af0ef(0x190)](_0x122919){const _0x5d1d48=a134_0x2af0ef,_0x155b7d=_0x122919['split']('/')[_0x5d1d48(0x19e)]()||_0x122919;return _0x155b7d[_0x5d1d48(0x199)]('-')[_0x5d1d48(0x1bf)](_0x345061=>_0x345061[_0x5d1d48(0x1a0)](0x0)[_0x5d1d48(0x19c)]()+_0x345061['slice'](0x1)[_0x5d1d48(0x1c2)]())['join']('\x20');}static['replaceContent'](_0x403f8f,_0x18a32e,_0x24c667){const _0xcfda30=a134_0x2af0ef,_0x48dded=this['toComponentName'](_0x18a32e),_0x190d52=this[_0xcfda30(0x190)](_0x18a32e),_0x7e2152=new Date(),_0x43c6f3=_0x7e2152['toLocaleString'](undefined,{'year':'numeric','month':'2-digit','day':_0xcfda30(0x1cb),'hour':_0xcfda30(0x1cb),'minute':_0xcfda30(0x1cb),'second':'2-digit','hour12':![]})['replace'](/\//g,'-'),_0x4e6859=_0x7e2152[_0xcfda30(0x1c6)](undefined,{'year':_0xcfda30(0x1af),'month':_0xcfda30(0x1cb),'day':'2-digit'})[_0xcfda30(0x198)](/\//g,'-'),_0x1c53c0=_0x7e2152[_0xcfda30(0x19a)](undefined,{'hour12':![]});let _0x321f9d=_0x403f8f[_0xcfda30(0x198)](/\{CliVersion\}/g,CLI_VERSION)[_0xcfda30(0x198)](/\{ComponentName\}/g,_0x48dded)[_0xcfda30(0x198)](/\{DisplayTitle\}/g,_0x190d52)['replace'](/\{PageName\}/g,_0x18a32e)[_0xcfda30(0x198)](/\{TemplateName\}/g,_0x24c667)[_0xcfda30(0x198)](/\{CreatedAt\}/g,_0x43c6f3)['replace'](/\{CreatedDate\}/g,_0x4e6859)[_0xcfda30(0x198)](/\{CreatedTime\}/g,_0x1c53c0);return _0x321f9d;}static[a134_0x2af0ef(0x1b2)](_0x417d91,_0x3a8ef3,_0x1eb457,_0x336cf2,_0x5ebca3,_0x18d7c1,_0x49740b,_0x9a1d7e){const _0x57ea58=a134_0x2af0ef,_0x3fe830=new Date(),_0x53e888=_0x3fe830[_0x57ea58(0x19b)](),_0x5f4328=_0x1eb457[_0x57ea58(0x1bf)](_0x51757b=>{const _0x473a3c=_0x57ea58,_0x3b9a46=['datasetCode:\x20\x22'+_0x51757b[_0x473a3c(0x1be)]+'\x22',_0x473a3c(0x1cd)+_0x51757b[_0x473a3c(0x1b8)]+'\x22',_0x473a3c(0x1a6)+_0x51757b[_0x473a3c(0x1ca)]+'\x22'];return _0x51757b[_0x473a3c(0x1ab)]&&_0x3b9a46[_0x473a3c(0x18e)](_0x473a3c(0x1c4)+_0x51757b['alias']+'\x22'),'\x0a\x20\x20\x20\x20{\x20'+_0x3b9a46[_0x473a3c(0x1c9)](',\x20')+_0x473a3c(0x1c3);})[_0x57ea58(0x1c9)](''),_0x16163=_0x336cf2||_0x1eb457[0x0]?.['alias']||'YourModel';let _0x19bb23=_0x417d91[_0x57ea58(0x198)](/\{AppCode\}/g,_0x3a8ef3)['replace'](/\{ModelConfigs\}/g,_0x5f4328)[_0x57ea58(0x198)](/\{ExampleModelName\}/g,_0x16163)[_0x57ea58(0x198)](/\{ApiFileName\}/g,_0x5ebca3||_0x57ea58(0x1a8))[_0x57ea58(0x198)](/\{ConfigName\}/g,_0x18d7c1||'default')[_0x57ea58(0x198)](/\{ClientConfigParam\}/g,_0x49740b||'')['replace'](/\{VarPrefix\}/g,_0x9a1d7e||_0x57ea58(0x19f))[_0x57ea58(0x198)](/\{CreatedAt\}/g,_0x53e888);return _0x19bb23;}static async['processTemplate'](_0x8161db,_0x156f3b,_0x35000f,_0x136a72,_0x2eb02c=!![]){const _0x28f224=a134_0x2af0ef,_0x5baa67=Date['now']();try{_0x2eb02c&&logger['info'](_0x28f224(0x191),_0x28f224(0x1ad),{'templatePath':_0x8161db,'targetPath':_0x156f3b,'pageName':_0x35000f,'templateName':_0x136a72});await a134_0x341def[_0x28f224(0x1b4)][_0x28f224(0x1bd)](_0x156f3b,{'recursive':!![]}),await this[_0x28f224(0x18f)](_0x8161db,_0x156f3b,_0x35000f,_0x136a72);if(_0x2eb02c){const _0x1a0484=Date[_0x28f224(0x1cc)]()-_0x5baa67;logger[_0x28f224(0x1a9)](_0x28f224(0x191),'模板内容替换完成',_0x1a0484,{'pageName':_0x35000f,'templateName':_0x136a72});}}catch(_0x2c4003){if(_0x2eb02c){const _0x1c514c=Date[_0x28f224(0x1cc)]()-_0x5baa67;logger['error'](_0x28f224(0x191),_0x28f224(0x1a2),{'templatePath':_0x8161db,'targetPath':_0x156f3b,'pageName':_0x35000f,'templateName':_0x136a72,'error':_0x2c4003 instanceof Error?_0x2c4003[_0x28f224(0x18d)]:String(_0x2c4003),'duration':_0x1c514c});}throw _0x2c4003;}}static async[a134_0x2af0ef(0x18f)](_0x428de2,_0x527234,_0x1a9c99,_0x1e410e){const _0x14af64=a134_0x2af0ef,_0x1f44b7=await a134_0x341def[_0x14af64(0x1b4)][_0x14af64(0x1b7)](_0x428de2,{'withFileTypes':!![]});for(const _0x490c9c of _0x1f44b7){const _0x53bf35=a134_0x143284[_0x14af64(0x1c9)](_0x428de2,_0x490c9c['name']);let _0x1c3868=a134_0x143284[_0x14af64(0x1c9)](_0x527234,_0x490c9c[_0x14af64(0x1ca)]);_0x490c9c['name'][_0x14af64(0x1b9)](_0x14af64(0x192))&&(_0x1c3868=a134_0x143284[_0x14af64(0x1c9)](_0x527234,_0x490c9c[_0x14af64(0x1ca)][_0x14af64(0x198)](/\.tpl$/,'')));if(_0x490c9c[_0x14af64(0x1a7)]())await a134_0x341def['promises']['mkdir'](_0x1c3868,{'recursive':!![]}),await this[_0x14af64(0x18f)](_0x53bf35,_0x1c3868,_0x1a9c99,_0x1e410e);else _0x490c9c['isFile']()&&await this[_0x14af64(0x195)](_0x53bf35,_0x1c3868,_0x1a9c99,_0x1e410e);}}static async['processFile'](_0xd9f4aa,_0x5738b4,_0x20d56f,_0x44ae99){const _0xa1a0a7=a134_0x2af0ef,_0x4e574c=a134_0x143284[_0xa1a0a7(0x1bc)](_0xd9f4aa)['toLowerCase']();_0xd9f4aa['endsWith'](_0xa1a0a7(0x192))&&(_0x5738b4=_0x5738b4[_0xa1a0a7(0x198)](/\.tpl$/,''));const _0x5e15cb=[_0xa1a0a7(0x196),_0xa1a0a7(0x1b3),_0xa1a0a7(0x194),'.js',_0xa1a0a7(0x1bb),_0xa1a0a7(0x1c7),_0xa1a0a7(0x1c0),_0xa1a0a7(0x1a1),_0xa1a0a7(0x192)];if(_0x5e15cb[_0xa1a0a7(0x197)](_0x4e574c)||_0xd9f4aa[_0xa1a0a7(0x1b9)](_0xa1a0a7(0x192))){const _0x3d688b=await a134_0x341def[_0xa1a0a7(0x1b4)]['readFile'](_0xd9f4aa,_0xa1a0a7(0x1a3)),_0x530322=this[_0xa1a0a7(0x19d)](_0x3d688b,_0x20d56f,_0x44ae99);await a134_0x341def[_0xa1a0a7(0x1b4)][_0xa1a0a7(0x1ae)](_0x5738b4,_0x530322,_0xa1a0a7(0x1a3));}else await a134_0x341def[_0xa1a0a7(0x1b4)]['copyFile'](_0xd9f4aa,_0x5738b4);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/rabetbase-cli",
3
- "version": "2.0.2-beta.6",
3
+ "version": "2.0.2-beta.8",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,6 +52,7 @@
52
52
  "dependencies": {
53
53
  "@inquirer/prompts": "^8.3.2",
54
54
  "@types/winston": "^2.4.4",
55
+ "@yuntoo/otel-logger": "1.0.27",
55
56
  "chalk": "^5.6.2",
56
57
  "execa": "^9.6.0",
57
58
  "ink": "^6.2.3",