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

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_0x50214a=a132_0x410b;(function(_0x50642b,_0x156d73){const _0x268894=a132_0x410b,_0x1e207e=_0x50642b();while(!![]){try{const _0x40ee2a=parseInt(_0x268894(0x141))/0x1*(parseInt(_0x268894(0x139))/0x2)+-parseInt(_0x268894(0x13b))/0x3*(-parseInt(_0x268894(0x13f))/0x4)+-parseInt(_0x268894(0x13e))/0x5+-parseInt(_0x268894(0x143))/0x6+-parseInt(_0x268894(0x132))/0x7+-parseInt(_0x268894(0x144))/0x8+-parseInt(_0x268894(0x13a))/0x9*(-parseInt(_0x268894(0x14b))/0xa);if(_0x40ee2a===_0x156d73)break;else _0x1e207e['push'](_0x1e207e['shift']());}catch(_0x40c2e2){_0x1e207e['push'](_0x1e207e['shift']());}}}(a132_0x61ae,0xe82d0));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 a132_0x61ae(){const _0x57e87c=['string','catch','status','utf-8','content','CDN\x20请求失败:\x20','2iFcHyl','954hyHAYh','79923pLHhdR','../../templates/rules/lovrabet_rules.mdc.tpl','lastUpdated','26370poZAys','248WDKMBl','statusText','699806rEwIpY','agents.md','10612590Ubdhvg','12573176pJGsrU','application/json','CDN\x20返回数据格式错误','json','/rules/rules.json','本地模板文件不存在:\x20','lovrabet_rules.mdc','348020mUSMXs','12207174ifrxFS'];a132_0x61ae=function(){return _0x57e87c;};return a132_0x61ae();}function getRulesCdnUrl(){const _0x203970=a132_0x410b,_0x414229=getTemplateBaseUrl();return _0x414229+_0x203970(0x148);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a132_0x50214a(0x13c));export async function fetchRulesFromCDN(){const _0x577fa2=a132_0x50214a,_0x58d0dd=getRulesCdnUrl(),_0x3e548a=await fetch(_0x58d0dd,{'headers':{'Accept':_0x577fa2(0x145)}});if(!_0x3e548a['ok'])throw new Error(_0x577fa2(0x138)+_0x3e548a[_0x577fa2(0x135)]+'\x20'+_0x3e548a[_0x577fa2(0x140)]);const _0x487adf=await _0x3e548a[_0x577fa2(0x147)]();if(!_0x487adf[_0x577fa2(0x137)]||typeof _0x487adf[_0x577fa2(0x137)]!==_0x577fa2(0x133))throw new Error(_0x577fa2(0x146));return _0x487adf;}export async function getRulesContent(){try{const _0x1c14a4=await fetchRulesFromCDN();return _0x1c14a4['content'];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x55bdf6=a132_0x50214a;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,'utf-8');throw new Error(_0x55bdf6(0x149)+LOCAL_TEMPLATE_PATH);}function a132_0x410b(_0xfe6787,_0x29b021){_0xfe6787=_0xfe6787-0x132;const _0x61ae10=a132_0x61ae();let _0x410b5f=_0x61ae10[_0xfe6787];return _0x410b5f;}export async function writeRulesFile(_0x403b06){const _0x49d2ca=a132_0x50214a,_0x141a9c=await fetchRulesFromCDN()[_0x49d2ca(0x134)](()=>null);let _0x189490;_0x141a9c?(_0x189490=_0x141a9c['content'],_0x141a9c[_0x49d2ca(0x13d)]&&(_0x189490=appendUpdateTime(_0x189490,_0x141a9c[_0x49d2ca(0x13d)]))):_0x189490=readLocalTemplate();const _0x3230d6=dirname(_0x403b06);!existsSync(_0x3230d6)&&mkdirSync(_0x3230d6,{'recursive':!![]}),writeFileSync(_0x403b06,_0x189490,_0x49d2ca(0x136));}export async function copyRulesToCursor(_0x3fab83){const _0x25fb54=a132_0x50214a,_0x194a59=join(_0x3fab83,'.cursor/rules'),_0x13c82b=join(_0x194a59,_0x25fb54(0x14a));if(existsSync(_0x13c82b))return![];return await writeRulesFile(_0x13c82b),!![];}export async function copyRulesToAgentsMd(_0x309350){const _0x1815db=a132_0x50214a,_0x524ed9=join(_0x309350,_0x1815db(0x142));if(existsSync(_0x524ed9))return![];return await writeRulesFile(_0x524ed9),!![];}
@@ -1 +1 @@
1
- export function sleep(_0x58b24b){return new Promise(_0x4df566=>setTimeout(_0x4df566,_0x58b24b));}
1
+ export function sleep(_0x228efd){return new Promise(_0x10e607=>setTimeout(_0x10e607,_0x228efd));}
@@ -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_0x5159b9=a134_0x1605;(function(_0xc181f6,_0x5aef94){const _0x1f038b=a134_0x1605,_0x4551f2=_0xc181f6();while(!![]){try{const _0x1bac3e=-parseInt(_0x1f038b(0x130))/0x1+parseInt(_0x1f038b(0x121))/0x2+-parseInt(_0x1f038b(0x117))/0x3*(-parseInt(_0x1f038b(0x110))/0x4)+parseInt(_0x1f038b(0x11a))/0x5*(-parseInt(_0x1f038b(0x136))/0x6)+parseInt(_0x1f038b(0x137))/0x7+-parseInt(_0x1f038b(0x123))/0x8+parseInt(_0x1f038b(0x11b))/0x9*(parseInt(_0x1f038b(0x116))/0xa);if(_0x1bac3e===_0x5aef94)break;else _0x4551f2['push'](_0x4551f2['shift']());}catch(_0x314ed5){_0x4551f2['push'](_0x4551f2['shift']());}}}(a134_0x1ad3,0x95688));import a134_0x29a694 from'node:fs';function a134_0x1605(_0x2d4cd1,_0x59a290){_0x2d4cd1=_0x2d4cd1-0xfa;const _0x1ad3de=a134_0x1ad3();let _0x160588=_0x1ad3de[_0x2d4cd1];return _0x160588;}import a134_0x165c7c from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require('../../package.json')[a134_0x5159b9(0x124)];function a134_0x1ad3(){const _0x57eade=['alias:\x20\x22','replaceContent','success','message','692274axDFTy','6315687PBluXL','LOVRABET','toUpperCase','toLowerCase','isDirectory','processTemplate','copyFile','toComponentName','.css','.md','2-digit','slice','numeric','processFile','开始处理模板内容替换','processDirectory','map','datasetCode:\x20\x22','replaceApiContent','mkdir','template','isFile','join','.tpl','replace','1979964SCcTdV','alias','api','.tsx','toLocaleTimeString','toDisplayTitle','20JGkomp','3WelGQi','error','.js','25nqbhhP','3584943TBrUlY','push','charAt','split','\x20},','promises','1247138RNhwHI','name','8226952HHEUuY','version','endsWith','readdir','writeFile','pop','toLocaleString','.ts','toISOString','tableName:\x20\x22','now','utf8','.scss','600215prtLpt','toLocaleDateString'];a134_0x1ad3=function(){return _0x57eade;};return a134_0x1ad3();}export class TemplateReplacer{static[a134_0x5159b9(0xfe)](_0x270bdd){const _0x146281=a134_0x5159b9,_0x1ac269=_0x270bdd[_0x146281(0x11e)]('/')[_0x146281(0x128)]()||_0x270bdd;return _0x1ac269['split']('-')['map'](_0x2d67d7=>_0x2d67d7[_0x146281(0x11d)](0x0)[_0x146281(0x139)]()+_0x2d67d7[_0x146281(0x102)](0x1)[_0x146281(0xfa)]())['join']('');}static[a134_0x5159b9(0x115)](_0x2b6b60){const _0x2d1335=a134_0x5159b9,_0x4c0f51=_0x2b6b60[_0x2d1335(0x11e)]('/')[_0x2d1335(0x128)]()||_0x2b6b60;return _0x4c0f51[_0x2d1335(0x11e)]('-')[_0x2d1335(0x107)](_0xa10ce5=>_0xa10ce5[_0x2d1335(0x11d)](0x0)[_0x2d1335(0x139)]()+_0xa10ce5[_0x2d1335(0x102)](0x1)['toLowerCase']())[_0x2d1335(0x10d)]('\x20');}static[a134_0x5159b9(0x133)](_0x55bb1d,_0x5e5e06,_0x485d2b){const _0x12312d=a134_0x5159b9,_0x70cdc3=this[_0x12312d(0xfe)](_0x5e5e06),_0x5ab62a=this[_0x12312d(0x115)](_0x5e5e06),_0x11f782=new Date(),_0x22213c=_0x11f782[_0x12312d(0x129)](undefined,{'year':_0x12312d(0x103),'month':_0x12312d(0x101),'day':'2-digit','hour':_0x12312d(0x101),'minute':_0x12312d(0x101),'second':_0x12312d(0x101),'hour12':![]})[_0x12312d(0x10f)](/\//g,'-'),_0x30493d=_0x11f782[_0x12312d(0x131)](undefined,{'year':_0x12312d(0x103),'month':_0x12312d(0x101),'day':_0x12312d(0x101)})[_0x12312d(0x10f)](/\//g,'-'),_0xd0c053=_0x11f782[_0x12312d(0x114)](undefined,{'hour12':![]});let _0x528761=_0x55bb1d[_0x12312d(0x10f)](/\{CliVersion\}/g,CLI_VERSION)[_0x12312d(0x10f)](/\{ComponentName\}/g,_0x70cdc3)[_0x12312d(0x10f)](/\{DisplayTitle\}/g,_0x5ab62a)['replace'](/\{PageName\}/g,_0x5e5e06)['replace'](/\{TemplateName\}/g,_0x485d2b)['replace'](/\{CreatedAt\}/g,_0x22213c)[_0x12312d(0x10f)](/\{CreatedDate\}/g,_0x30493d)['replace'](/\{CreatedTime\}/g,_0xd0c053);return _0x528761;}static[a134_0x5159b9(0x109)](_0x471472,_0x552d91,_0x41da33,_0x477d54,_0x549c3f,_0x266f92,_0x35bdf5,_0x103190){const _0x42c922=a134_0x5159b9,_0x36774b=new Date(),_0x1d5db6=_0x36774b[_0x42c922(0x12b)](),_0x463dc2=_0x41da33['map'](_0x4d2c87=>{const _0x4fa338=_0x42c922,_0xba3bc3=[_0x4fa338(0x108)+_0x4d2c87['datasetCode']+'\x22',_0x4fa338(0x12c)+_0x4d2c87['tableName']+'\x22','name:\x20\x22'+_0x4d2c87[_0x4fa338(0x122)]+'\x22'];return _0x4d2c87[_0x4fa338(0x111)]&&_0xba3bc3[_0x4fa338(0x11c)](_0x4fa338(0x132)+_0x4d2c87[_0x4fa338(0x111)]+'\x22'),'\x0a\x20\x20\x20\x20{\x20'+_0xba3bc3[_0x4fa338(0x10d)](',\x20')+_0x4fa338(0x11f);})['join'](''),_0x466e28=_0x477d54||_0x41da33[0x0]?.['alias']||'YourModel';let _0x4cd342=_0x471472['replace'](/\{AppCode\}/g,_0x552d91)[_0x42c922(0x10f)](/\{ModelConfigs\}/g,_0x463dc2)['replace'](/\{ExampleModelName\}/g,_0x466e28)['replace'](/\{ApiFileName\}/g,_0x549c3f||_0x42c922(0x112))['replace'](/\{ConfigName\}/g,_0x266f92||'default')[_0x42c922(0x10f)](/\{ClientConfigParam\}/g,_0x35bdf5||'')[_0x42c922(0x10f)](/\{VarPrefix\}/g,_0x103190||_0x42c922(0x138))[_0x42c922(0x10f)](/\{CreatedAt\}/g,_0x1d5db6);return _0x4cd342;}static async[a134_0x5159b9(0xfc)](_0x475a94,_0x619e37,_0x60d7e3,_0x557583,_0x535bcf=!![]){const _0x2f787d=a134_0x5159b9,_0x148d2c=Date[_0x2f787d(0x12d)]();try{_0x535bcf&&logger['info'](_0x2f787d(0x10b),_0x2f787d(0x105),{'templatePath':_0x475a94,'targetPath':_0x619e37,'pageName':_0x60d7e3,'templateName':_0x557583});await a134_0x29a694[_0x2f787d(0x120)][_0x2f787d(0x10a)](_0x619e37,{'recursive':!![]}),await this[_0x2f787d(0x106)](_0x475a94,_0x619e37,_0x60d7e3,_0x557583);if(_0x535bcf){const _0x46f727=Date[_0x2f787d(0x12d)]()-_0x148d2c;logger[_0x2f787d(0x134)](_0x2f787d(0x10b),'模板内容替换完成',_0x46f727,{'pageName':_0x60d7e3,'templateName':_0x557583});}}catch(_0x405727){if(_0x535bcf){const _0x1f22ec=Date[_0x2f787d(0x12d)]()-_0x148d2c;logger[_0x2f787d(0x118)](_0x2f787d(0x10b),'模板内容替换失败',{'templatePath':_0x475a94,'targetPath':_0x619e37,'pageName':_0x60d7e3,'templateName':_0x557583,'error':_0x405727 instanceof Error?_0x405727[_0x2f787d(0x135)]:String(_0x405727),'duration':_0x1f22ec});}throw _0x405727;}}static async[a134_0x5159b9(0x106)](_0x37827b,_0x19d150,_0xfdf24,_0x9a4140){const _0x3d56dd=a134_0x5159b9,_0x5ba0de=await a134_0x29a694['promises'][_0x3d56dd(0x126)](_0x37827b,{'withFileTypes':!![]});for(const _0x338430 of _0x5ba0de){const _0x5a26ec=a134_0x165c7c[_0x3d56dd(0x10d)](_0x37827b,_0x338430['name']);let _0x384090=a134_0x165c7c[_0x3d56dd(0x10d)](_0x19d150,_0x338430[_0x3d56dd(0x122)]);_0x338430[_0x3d56dd(0x122)][_0x3d56dd(0x125)](_0x3d56dd(0x10e))&&(_0x384090=a134_0x165c7c['join'](_0x19d150,_0x338430[_0x3d56dd(0x122)][_0x3d56dd(0x10f)](/\.tpl$/,'')));if(_0x338430[_0x3d56dd(0xfb)]())await a134_0x29a694[_0x3d56dd(0x120)][_0x3d56dd(0x10a)](_0x384090,{'recursive':!![]}),await this[_0x3d56dd(0x106)](_0x5a26ec,_0x384090,_0xfdf24,_0x9a4140);else _0x338430[_0x3d56dd(0x10c)]()&&await this[_0x3d56dd(0x104)](_0x5a26ec,_0x384090,_0xfdf24,_0x9a4140);}}static async[a134_0x5159b9(0x104)](_0x2f0f49,_0x49d22d,_0x3120e9,_0x4190e6){const _0x4956b8=a134_0x5159b9,_0x63935a=a134_0x165c7c['extname'](_0x2f0f49)[_0x4956b8(0xfa)]();_0x2f0f49[_0x4956b8(0x125)]('.tpl')&&(_0x49d22d=_0x49d22d[_0x4956b8(0x10f)](/\.tpl$/,''));const _0x417e48=[_0x4956b8(0x113),_0x4956b8(0x12a),'.jsx',_0x4956b8(0x119),'.json',_0x4956b8(0x100),_0x4956b8(0xff),_0x4956b8(0x12f),'.tpl'];if(_0x417e48['includes'](_0x63935a)||_0x2f0f49[_0x4956b8(0x125)]('.tpl')){const _0x3a7389=await a134_0x29a694[_0x4956b8(0x120)]['readFile'](_0x2f0f49,_0x4956b8(0x12e)),_0x4775f8=this[_0x4956b8(0x133)](_0x3a7389,_0x3120e9,_0x4190e6);await a134_0x29a694['promises'][_0x4956b8(0x127)](_0x49d22d,_0x4775f8,'utf8');}else await a134_0x29a694[_0x4956b8(0x120)][_0x4956b8(0xfd)](_0x2f0f49,_0x49d22d);}}
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.7",
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",