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

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 (125) hide show
  1. package/lib/ai-setup/config.js +1 -1
  2. package/lib/api/api-doc-ui.js +1 -1
  3. package/lib/api/api-doc.js +1 -1
  4. package/lib/api/api-pull-ui.js +1 -1
  5. package/lib/api/fetch-model-list.js +1 -1
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/api/main.js +1 -1
  8. package/lib/api/pull-silent.js +1 -1
  9. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  10. package/lib/app-menu/create-menu.js +1 -1
  11. package/lib/app-menu/get-local-pages.js +1 -1
  12. package/lib/app-menu/get-online-menu-list.js +1 -1
  13. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  14. package/lib/app-menu/utils.js +1 -1
  15. package/lib/app-menu/valid-url.js +1 -1
  16. package/lib/app-menu-update-cdn/current-content.js +1 -1
  17. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  18. package/lib/app-menu-update-cdn/main.js +1 -1
  19. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  20. package/lib/auth/auth-server-ui.js +1 -1
  21. package/lib/auth/auth-server.js +1 -1
  22. package/lib/auth/constant.js +1 -1
  23. package/lib/auth/get-cookie.js +1 -1
  24. package/lib/auth/is-session-valid.js +1 -1
  25. package/lib/auth/logout.js +1 -1
  26. package/lib/cli-flags.js +1 -1
  27. package/lib/cli.js +1 -1
  28. package/lib/commands/api.js +1 -1
  29. package/lib/commands/app.js +1 -1
  30. package/lib/commands/auth.js +1 -1
  31. package/lib/commands/bff/delete.js +1 -1
  32. package/lib/commands/bff/detail.js +1 -1
  33. package/lib/commands/bff/index.js +1 -1
  34. package/lib/commands/bff/list.js +1 -1
  35. package/lib/commands/bff/new.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/build.js +1 -1
  40. package/lib/commands/codegen/index.js +1 -1
  41. package/lib/commands/codegen/sdk.js +1 -1
  42. package/lib/commands/codegen/sql.js +1 -1
  43. package/lib/commands/config.js +1 -1
  44. package/lib/commands/create.js +1 -1
  45. package/lib/commands/dataset/detail.js +1 -1
  46. package/lib/commands/dataset/index.js +1 -1
  47. package/lib/commands/dataset/links.js +1 -1
  48. package/lib/commands/dataset/list.js +1 -1
  49. package/lib/commands/dataset/operations.js +1 -1
  50. package/lib/commands/init.js +1 -1
  51. package/lib/commands/logout.js +1 -1
  52. package/lib/commands/logs.js +1 -1
  53. package/lib/commands/mcp.js +1 -1
  54. package/lib/commands/menu.js +1 -1
  55. package/lib/commands/preview.js +1 -1
  56. package/lib/commands/registry.js +1 -1
  57. package/lib/commands/run.js +1 -1
  58. package/lib/commands/skill.js +1 -1
  59. package/lib/commands/sql/detail.js +1 -1
  60. package/lib/commands/sql/exec.js +1 -1
  61. package/lib/commands/sql/index.js +1 -1
  62. package/lib/commands/sql/list.js +1 -1
  63. package/lib/commands/sql/save.js +1 -1
  64. package/lib/commands/sql/validate.js +1 -1
  65. package/lib/commands/start.js +1 -1
  66. package/lib/config/config-help.js +1 -1
  67. package/lib/config/main.js +1 -1
  68. package/lib/constant/cli.js +1 -1
  69. package/lib/constant/domain.js +1 -1
  70. package/lib/constant/env.js +1 -1
  71. package/lib/context.js +1 -1
  72. package/lib/core/alias-resolver.js +1 -1
  73. package/lib/core/api-client.js +1 -1
  74. package/lib/core/bff/config.js +1 -1
  75. package/lib/core/bff/file-system.js +1 -1
  76. package/lib/core/bff/hash.js +1 -1
  77. package/lib/core/bff/lock.js +1 -1
  78. package/lib/core/bff/utils.js +1 -1
  79. package/lib/core/db-resolver.js +1 -1
  80. package/lib/core/sql-validator.js +1 -1
  81. package/lib/create-app/enhanced-guided-create.js +1 -1
  82. package/lib/create-app/format-elapsed.js +1 -1
  83. package/lib/create-app/main.js +1 -1
  84. package/lib/create-app/non-interactive.js +1 -1
  85. package/lib/create-app/task-finished.js +1 -1
  86. package/lib/create-app/task-loading.js +1 -1
  87. package/lib/create-app/task-running.js +1 -1
  88. package/lib/create-app/task-time.js +1 -1
  89. package/lib/create-app/use-copy-project-template.js +1 -1
  90. package/lib/create-app/use-format-code.js +1 -1
  91. package/lib/create-app/use-install-dependencies.js +1 -1
  92. package/lib/errors.js +1 -1
  93. package/lib/framework/flags.js +1 -1
  94. package/lib/framework/help.js +1 -1
  95. package/lib/framework/index.js +1 -1
  96. package/lib/framework/output.js +1 -1
  97. package/lib/framework/response.js +1 -1
  98. package/lib/framework/runner.js +1 -1
  99. package/lib/generated/build-info.js +1 -1
  100. package/lib/help.js +1 -1
  101. package/lib/init/main.js +1 -1
  102. package/lib/mcp/McpInstallUI.js +1 -1
  103. package/lib/mcp/claude.js +1 -1
  104. package/lib/mcp/cursor.js +1 -1
  105. package/lib/mcp/main.js +1 -1
  106. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  107. package/lib/mcp/mcp-installer.js +1 -1
  108. package/lib/skills/main.js +1 -1
  109. package/lib/skills/npx-skills-add.js +1 -1
  110. package/lib/ui/IDESelector.js +1 -1
  111. package/lib/ui/useIDESelection.js +1 -1
  112. package/lib/utils/ai_config.js +1 -1
  113. package/lib/utils/cdn-config.js +1 -1
  114. package/lib/utils/check-sdk-version.js +1 -1
  115. package/lib/utils/cli-version-check.js +1 -1
  116. package/lib/utils/config.js +1 -1
  117. package/lib/utils/copy-directory.js +1 -1
  118. package/lib/utils/file-utils.js +1 -1
  119. package/lib/utils/guides-cdn.js +1 -1
  120. package/lib/utils/http-client.js +1 -1
  121. package/lib/utils/logger.js +1 -1
  122. package/lib/utils/rules-cdn.js +1 -1
  123. package/lib/utils/sleep.js +1 -1
  124. package/lib/utils/template-replacer.js +1 -1
  125. package/package.json +2 -3
@@ -1 +1 @@
1
- function a63_0x4070(_0xbee7aa,_0x3cfff7){_0xbee7aa=_0xbee7aa-0x10f;const _0x307f78=a63_0x307f();let _0x4070a3=_0x307f78[_0xbee7aa];return _0x4070a3;}function a63_0x307f(){const _0x2b396f=['sqlcode','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','1499636aZjMfo','name','number','dbId','171632RKVsrw','string','\x20SQL\x20queries\x20(total:\x20','tableData','Found\x20','sqlCode','Page\x20number','List\x20custom\x20SQL\x20queries','length','read','3603336eSqpoj','No\x20custom\x20SQL\x20queries\x20found.','18280070kKkXhw','str','pagesize','1144800vpKxSP','map','5610339GwovyF','totalCount','5XFSekM','verbose','bool','182jSOqkk','num','page','1fhaurm','Filter\x20by\x20SQL\x20code','10462ZZHqfj','paging'];a63_0x307f=function(){return _0x2b396f;};return a63_0x307f();}const a63_0x5f595b=a63_0x4070;(function(_0xbbba89,_0x822c58){const _0x109c76=a63_0x4070,_0x3fdd70=_0xbbba89();while(!![]){try{const _0x26c2bc=-parseInt(_0x109c76(0x118))/0x1*(parseInt(_0x109c76(0x11a))/0x2)+-parseInt(_0x109c76(0x131))/0x3+parseInt(_0x109c76(0x11e))/0x4*(-parseInt(_0x109c76(0x112))/0x5)+-parseInt(_0x109c76(0x12c))/0x6+parseInt(_0x109c76(0x115))/0x7*(parseInt(_0x109c76(0x122))/0x8)+-parseInt(_0x109c76(0x110))/0x9+parseInt(_0x109c76(0x12e))/0xa;if(_0x26c2bc===_0x822c58)break;else _0x3fdd70['push'](_0x3fdd70['shift']());}catch(_0x216b9b){_0x3fdd70['push'](_0x3fdd70['shift']());}}}(a63_0x307f,0x61b10));import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';export const sqlList={'service':'sql','command':'list','description':a63_0x5f595b(0x129),'risk':a63_0x5f595b(0x12b),'flags':[{'name':'sqlcode','type':a63_0x5f595b(0x123),'description':a63_0x5f595b(0x119)},{'name':a63_0x5f595b(0x11f),'type':'string','description':'Filter\x20by\x20SQL\x20name'},{'name':a63_0x5f595b(0x117),'type':a63_0x5f595b(0x120),'description':a63_0x5f595b(0x128),'default':0x1},{'name':a63_0x5f595b(0x130),'type':a63_0x5f595b(0x120),'description':'Page\x20size'},{'name':a63_0x5f595b(0x113),'type':'boolean','description':a63_0x5f595b(0x11d)}],async 'execute'(_0x3b840d){const _0x43487e=a63_0x5f595b,_0x161492=await listSqlQueries(_0x3b840d['appCode'],{'sqlCode':_0x3b840d[_0x43487e(0x12f)](_0x43487e(0x11c))||undefined,'sqlName':_0x3b840d[_0x43487e(0x12f)](_0x43487e(0x11f))||undefined,'currentPage':_0x3b840d[_0x43487e(0x116)](_0x43487e(0x117)),'pageSize':_0x3b840d['num'](_0x43487e(0x130),0x32)}),_0x13311b=_0x3b840d[_0x43487e(0x114)](_0x43487e(0x113)),_0x3e6898=_0x161492[_0x43487e(0x125)]??[],_0x2fe46e=_0x161492[_0x43487e(0x11b)]?.[_0x43487e(0x111)]??_0x3e6898[_0x43487e(0x12a)];let _0x588b41;return _0x13311b?_0x588b41=_0x3e6898:_0x588b41=await Promise['all'](_0x3e6898[_0x43487e(0x10f)](async _0x3a8890=>{const _0xf2b48=_0x43487e,_0xa4e557=_0x3a8890[_0xf2b48(0x121)]?await getDbName(_0x3b840d['appCode'],_0x3a8890[_0xf2b48(0x121)]):undefined;return{'sqlCode':_0x3a8890[_0xf2b48(0x127)],'sqlName':_0x3a8890['sqlName'],'description':_0x3a8890['description']??'','db':_0xa4e557?_0xa4e557+'\x20('+_0x3a8890[_0xf2b48(0x121)]+')':_0x3a8890['dbId']??''};})),{'ok':!![],'data':_0x588b41,'message':_0x3e6898['length']===0x0?_0x43487e(0x12d):_0x43487e(0x126)+_0x3e6898[_0x43487e(0x12a)]+_0x43487e(0x124)+_0x2fe46e+').'};}};
1
+ const a63_0x52688e=a63_0x4e91;(function(_0xf46741,_0x18c03b){const _0x26d83b=a63_0x4e91,_0x5ca482=_0xf46741();while(!![]){try{const _0x2e9cd9=parseInt(_0x26d83b(0x1d2))/0x1*(-parseInt(_0x26d83b(0x1c9))/0x2)+parseInt(_0x26d83b(0x1c0))/0x3+-parseInt(_0x26d83b(0x1b3))/0x4*(parseInt(_0x26d83b(0x1d1))/0x5)+parseInt(_0x26d83b(0x1c8))/0x6*(parseInt(_0x26d83b(0x1c6))/0x7)+-parseInt(_0x26d83b(0x1b6))/0x8*(parseInt(_0x26d83b(0x1ce))/0x9)+parseInt(_0x26d83b(0x1bf))/0xa+parseInt(_0x26d83b(0x1c4))/0xb;if(_0x2e9cd9===_0x18c03b)break;else _0x5ca482['push'](_0x5ca482['shift']());}catch(_0x45def9){_0x5ca482['push'](_0x5ca482['shift']());}}}(a63_0x9ee9,0xa3532));function a63_0x4e91(_0x48628a,_0x3ba8f7){_0x48628a=_0x48628a-0x1ae;const _0x9ee963=a63_0x9ee9();let _0x4e91fc=_0x9ee963[_0x48628a];return _0x4e91fc;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';export const sqlList={'service':'sql','command':a63_0x52688e(0x1ae),'description':a63_0x52688e(0x1be),'risk':'read','flags':[{'name':a63_0x52688e(0x1b0),'type':'string','description':'Filter\x20by\x20SQL\x20code'},{'name':a63_0x52688e(0x1cc),'type':a63_0x52688e(0x1af),'description':a63_0x52688e(0x1c3)},{'name':a63_0x52688e(0x1b2),'type':'number','description':a63_0x52688e(0x1b9),'default':0x1},{'name':a63_0x52688e(0x1cd),'type':'number','description':'Page\x20size'},{'name':a63_0x52688e(0x1b8),'type':a63_0x52688e(0x1b7),'description':a63_0x52688e(0x1cf)}],async 'execute'(_0xeeabe1){const _0x2d44ba=a63_0x52688e,_0x53307d=await listSqlQueries(_0xeeabe1[_0x2d44ba(0x1b4)],{'sqlCode':_0xeeabe1[_0x2d44ba(0x1c1)]('sqlcode')||undefined,'sqlName':_0xeeabe1[_0x2d44ba(0x1c1)](_0x2d44ba(0x1cc))||undefined,'currentPage':_0xeeabe1[_0x2d44ba(0x1c2)](_0x2d44ba(0x1b2)),'pageSize':_0xeeabe1[_0x2d44ba(0x1c2)](_0x2d44ba(0x1cd),0x32)}),_0x36bc8e=_0xeeabe1[_0x2d44ba(0x1c5)]('verbose'),_0x173e66=_0x53307d[_0x2d44ba(0x1bb)]??[],_0x34b069=_0x53307d[_0x2d44ba(0x1d0)]?.[_0x2d44ba(0x1c7)]??_0x173e66['length'];let _0x25db19;return _0x36bc8e?_0x25db19=_0x173e66:_0x25db19=await Promise['all'](_0x173e66[_0x2d44ba(0x1b5)](async _0xf4889f=>{const _0x142900=_0x2d44ba,_0x29c0de=_0xf4889f[_0x142900(0x1bd)]?await getDbName(_0xeeabe1[_0x142900(0x1b4)],_0xf4889f[_0x142900(0x1bd)]):undefined;return{'sqlCode':_0xf4889f[_0x142900(0x1b1)],'sqlName':_0xf4889f['sqlName'],'description':_0xf4889f[_0x142900(0x1ba)]??'','db':_0x29c0de?_0x29c0de+'\x20('+_0xf4889f[_0x142900(0x1bd)]+')':_0xf4889f[_0x142900(0x1bd)]??''};})),{'ok':!![],'data':_0x25db19,'message':_0x173e66['length']===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x2d44ba(0x1cb)+_0x173e66[_0x2d44ba(0x1ca)]+_0x2d44ba(0x1bc)+_0x34b069+').'};}};function a63_0x9ee9(){const _0x2159c6=['2133204DaxIzQ','str','num','Filter\x20by\x20SQL\x20name','22023815yYeTld','bool','21476VKeNcK','totalCount','510gRSvVy','654380knqXVl','length','Found\x20','name','pagesize','2250YbsFqw','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','paging','5qdwcJe','2IvgaII','list','string','sqlcode','sqlCode','page','4559476ERRiOp','appCode','map','33720ipqRMe','boolean','verbose','Page\x20number','description','tableData','\x20SQL\x20queries\x20(total:\x20','dbId','List\x20custom\x20SQL\x20queries','5429640GwuYZt'];a63_0x9ee9=function(){return _0x2159c6;};return a63_0x9ee9();}
@@ -1 +1 @@
1
- const a64_0x5ac0fb=a64_0x4299;function a64_0x4426(){const _0x294889=['SQL\x20validation\x20failed:\x20','\x20|\x20Params:\x20','Type:\x20','sqlCode','sqlName','4POleYM','sqlType','3161930NuSEdL','14SguWmf','action','32VUHsey','message','validation','12TpXilN','utf-8','1212VQYHNW','blocked','sql','Created','description','dbName','/api/node-toolbox/sql/save','string','str','length','Conflict\x20detected','\x20|\x20Tables:\x20','appCode','12466289QxeiJu','599663IzLSFG','5456910FIqdGm','Validation:\x20','Save\x20SQL\x20query\x20from\x20','parameters','Path\x20to\x20the\x20SQL\x20file','\x20chars)','join','N/A','file','SQL\x20query\x20description','cwd','tables','dbId','648765nMnMQs','887118yHYpnJ','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','sqlcode','Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)','sqlname','type','1029dkGhsx','SQL\x20code\x20identifier\x20for\x20updating\x20existing\x20query\x20(format:\x20xxxxxxxx-xxxxxxxx)'];a64_0x4426=function(){return _0x294889;};return a64_0x4426();}(function(_0x28616f,_0x811356){const _0x1d91e1=a64_0x4299,_0x10b94b=_0x28616f();while(!![]){try{const _0x3e7108=parseInt(_0x1d91e1(0x92))/0x1+parseInt(_0x1d91e1(0x84))/0x2*(-parseInt(_0x1d91e1(0x73))/0x3)+parseInt(_0x1d91e1(0x7a))/0x4*(parseInt(_0x1d91e1(0x7c))/0x5)+parseInt(_0x1d91e1(0x6d))/0x6*(-parseInt(_0x1d91e1(0x7d))/0x7)+parseInt(_0x1d91e1(0x7f))/0x8*(parseInt(_0x1d91e1(0x6c))/0x9)+parseInt(_0x1d91e1(0x93))/0xa+parseInt(_0x1d91e1(0x91))/0xb*(-parseInt(_0x1d91e1(0x82))/0xc);if(_0x3e7108===_0x811356)break;else _0x10b94b['push'](_0x10b94b['shift']());}catch(_0x5e29b6){_0x10b94b['push'](_0x10b94b['shift']());}}}(a64_0x4426,0x68ca1));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';function a64_0x4299(_0x397877,_0x4a8bdf){_0x397877=_0x397877-0x69;const _0x442690=a64_0x4426();let _0x42999f=_0x442690[_0x397877];return _0x42999f;}import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';export const sqlSave={'service':a64_0x5ac0fb(0x86),'command':'save','description':a64_0x5ac0fb(0x6e),'risk':'write','flags':[{'name':a64_0x5ac0fb(0x9b),'type':a64_0x5ac0fb(0x8b),'required':!![],'description':a64_0x5ac0fb(0x97)},{'name':a64_0x5ac0fb(0x6f),'type':a64_0x5ac0fb(0x8b),'description':a64_0x5ac0fb(0x74)},{'name':a64_0x5ac0fb(0x71),'type':a64_0x5ac0fb(0x8b),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a64_0x5ac0fb(0x8b),'description':a64_0x5ac0fb(0x70)},{'name':a64_0x5ac0fb(0x88),'type':a64_0x5ac0fb(0x8b),'description':a64_0x5ac0fb(0x9c)}],async 'validate'(_0x52ef34){const _0x115803=a64_0x5ac0fb,_0x352eca=resolve(process[_0x115803(0x69)](),_0x52ef34[_0x115803(0x8c)](_0x115803(0x9b)));if(!existsSync(_0x352eca))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x352eca);const _0x1e4f8a=readFileSync(_0x352eca,_0x115803(0x83)),_0x351db3=validateSql(_0x1e4f8a);if(!_0x351db3['valid'])throw CliErrors[_0x115803(0x81)](_0x115803(0x75)+_0x351db3[_0x115803(0x80)]);},async 'dryRun'(_0x597ef1){const _0x1d4947=a64_0x5ac0fb,_0x58eb1f=resolve(process['cwd'](),_0x597ef1[_0x1d4947(0x8c)](_0x1d4947(0x9b))),_0x10245e=readFileSync(_0x58eb1f,'utf-8'),_0x124e04=validateSql(_0x10245e),_0x30ce3e=_0x597ef1[_0x1d4947(0x8c)]('db')||undefined,{db:_0x2f94c1,error:_0x5ad980}=await resolveOneDb(_0x597ef1[_0x1d4947(0x90)],_0x30ce3e);return{'method':'POST','url':_0x1d4947(0x8a),'body':{'appCode':_0x597ef1[_0x1d4947(0x90)],'sqlContent':'('+_0x10245e[_0x1d4947(0x8d)]+_0x1d4947(0x98),'sqlCode':_0x597ef1[_0x1d4947(0x8c)](_0x1d4947(0x6f))||undefined,'sqlName':_0x597ef1[_0x1d4947(0x8c)]('sqlname')||undefined,'db':_0x2f94c1?_0x2f94c1[_0x1d4947(0x89)]+'\x20('+_0x2f94c1['dbId']+')':_0x5ad980},'description':[_0x1d4947(0x95)+_0x597ef1[_0x1d4947(0x8c)](_0x1d4947(0x9b)),_0x1d4947(0x94)+_0x124e04['message'],_0x1d4947(0x77)+_0x124e04[_0x1d4947(0x7b)][_0x1d4947(0x72)]+_0x1d4947(0x8f)+(_0x124e04[_0x1d4947(0x6a)][_0x1d4947(0x99)](',\x20')||_0x1d4947(0x9a))+_0x1d4947(0x76)+(_0x124e04[_0x1d4947(0x96)]['join'](',\x20')||'none')][_0x1d4947(0x99)]('\x0a')};},async 'execute'(_0x152247){const _0x2b2a36=a64_0x5ac0fb,_0x5f092f=resolve(process['cwd'](),_0x152247[_0x2b2a36(0x8c)](_0x2b2a36(0x9b))),_0x17bf76=readFileSync(_0x5f092f,'utf-8'),_0x5e8239=_0x152247[_0x2b2a36(0x8c)]('db')||undefined,{db:_0x53e98f,error:_0x201d6a}=await resolveOneDb(_0x152247['appCode'],_0x5e8239);if(_0x201d6a)throw CliErrors[_0x2b2a36(0x81)](_0x201d6a);const _0x1e7c36=await saveSqlQuery({'appCode':_0x152247[_0x2b2a36(0x90)],'sqlContent':_0x17bf76,'sqlCode':_0x152247[_0x2b2a36(0x8c)]('sqlcode')||undefined,'sqlName':_0x152247[_0x2b2a36(0x8c)](_0x2b2a36(0x71))||undefined,'dbId':_0x53e98f[_0x2b2a36(0x6b)],'description':_0x152247['str'](_0x2b2a36(0x88))||undefined});if(_0x1e7c36[_0x2b2a36(0x85)])return{'ok':![],'data':_0x1e7c36,'message':_0x1e7c36[_0x2b2a36(0x80)]||_0x2b2a36(0x8e)};return{'ok':!![],'data':{'sqlCode':_0x1e7c36['sqlCode'],'sqlName':_0x1e7c36[_0x2b2a36(0x79)],'action':_0x1e7c36[_0x2b2a36(0x7e)]},'message':(_0x1e7c36['action']==='created'?_0x2b2a36(0x87):'Updated')+'\x20successfully'+(_0x1e7c36[_0x2b2a36(0x78)]?'\x20('+_0x1e7c36['sqlCode']+')':'')};}};
1
+ function a64_0x3ec8(){const _0x35cfe8=['SQL\x20code\x20identifier\x20for\x20updating\x20existing\x20query\x20(format:\x20xxxxxxxx-xxxxxxxx)','22986130hWrkVm','4827949bCPgty','sqlcode','Save\x20SQL\x20query\x20from\x20','\x20chars)','/api/node-toolbox/sql/save','sql','utf-8','dbId','cwd','join','type','save','Save\x20or\x20update\x20a\x20custom\x20SQL\x20query\x20(validates\x20before\x20saving)','appCode','file','none','sqlname','created','\x20|\x20Tables:\x20','tables','message','N/A','File\x20not\x20found:\x20','3078108ChokwP','POST','string','action','Updated','8876128idQgfd','23076aEVnww','description','Path\x20to\x20the\x20SQL\x20file','\x20successfully','write','1365DLliJV','validation','6CjNFBK','SQL\x20validation\x20failed:\x20','dbName','SQL\x20query\x20description','138132HQLQLp','9goOUGe','2927530GHZPcA','str','sqlCode'];a64_0x3ec8=function(){return _0x35cfe8;};return a64_0x3ec8();}const a64_0x5e8c27=a64_0x321a;(function(_0x586ba5,_0xabf8a4){const _0x55a7f6=a64_0x321a,_0x309fd5=_0x586ba5();while(!![]){try{const _0x58ae77=parseInt(_0x55a7f6(0x13b))/0x1+-parseInt(_0x55a7f6(0x13d))/0x2+parseInt(_0x55a7f6(0x159))/0x3+parseInt(_0x55a7f6(0x15f))/0x4*(-parseInt(_0x55a7f6(0x135))/0x5)+parseInt(_0x55a7f6(0x137))/0x6*(-parseInt(_0x55a7f6(0x142))/0x7)+parseInt(_0x55a7f6(0x15e))/0x8+parseInt(_0x55a7f6(0x13c))/0x9*(parseInt(_0x55a7f6(0x141))/0xa);if(_0x58ae77===_0xabf8a4)break;else _0x309fd5['push'](_0x309fd5['shift']());}catch(_0x3c26a1){_0x309fd5['push'](_0x309fd5['shift']());}}}(a64_0x3ec8,0xce070));import{readFileSync,existsSync}from'node:fs';function a64_0x321a(_0x178c7b,_0x1e291e){_0x178c7b=_0x178c7b-0x134;const _0x3ec898=a64_0x3ec8();let _0x321aec=_0x3ec898[_0x178c7b];return _0x321aec;}import{resolve}from'node:path';import{saveSqlQuery}from'../../core/api-client.js';import{resolveOneDb}from'../../core/db-resolver.js';import{validateSql}from'../../core/sql-validator.js';import{CliErrors}from'../../errors.js';export const sqlSave={'service':a64_0x5e8c27(0x147),'command':a64_0x5e8c27(0x14d),'description':a64_0x5e8c27(0x14e),'risk':a64_0x5e8c27(0x134),'flags':[{'name':a64_0x5e8c27(0x150),'type':'string','required':!![],'description':a64_0x5e8c27(0x161)},{'name':a64_0x5e8c27(0x143),'type':a64_0x5e8c27(0x15b),'description':a64_0x5e8c27(0x140)},{'name':'sqlname','type':a64_0x5e8c27(0x15b),'description':'SQL\x20query\x20display\x20name'},{'name':'db','type':a64_0x5e8c27(0x15b),'description':'Target\x20database\x20—\x20accepts\x20a\x20numeric\x20ID\x20or\x20database\x20name\x20(e.g.\x20ecommerce_db)'},{'name':a64_0x5e8c27(0x160),'type':'string','description':a64_0x5e8c27(0x13a)}],async 'validate'(_0x543e5f){const _0x3b80d8=a64_0x5e8c27,_0x121a77=resolve(process[_0x3b80d8(0x14a)](),_0x543e5f['str']('file'));if(!existsSync(_0x121a77))throw CliErrors['validation'](_0x3b80d8(0x158)+_0x121a77);const _0x23d055=readFileSync(_0x121a77,'utf-8'),_0x33bd5c=validateSql(_0x23d055);if(!_0x33bd5c['valid'])throw CliErrors[_0x3b80d8(0x136)](_0x3b80d8(0x138)+_0x33bd5c['message']);},async 'dryRun'(_0x353bf1){const _0x6ad1e2=a64_0x5e8c27,_0x25a42b=resolve(process[_0x6ad1e2(0x14a)](),_0x353bf1[_0x6ad1e2(0x13e)](_0x6ad1e2(0x150))),_0x4fc20c=readFileSync(_0x25a42b,_0x6ad1e2(0x148)),_0x1564f3=validateSql(_0x4fc20c),_0x3621cf=_0x353bf1[_0x6ad1e2(0x13e)]('db')||undefined,{db:_0x299f10,error:_0xccd9b2}=await resolveOneDb(_0x353bf1[_0x6ad1e2(0x14f)],_0x3621cf);return{'method':_0x6ad1e2(0x15a),'url':_0x6ad1e2(0x146),'body':{'appCode':_0x353bf1[_0x6ad1e2(0x14f)],'sqlContent':'('+_0x4fc20c['length']+_0x6ad1e2(0x145),'sqlCode':_0x353bf1[_0x6ad1e2(0x13e)](_0x6ad1e2(0x143))||undefined,'sqlName':_0x353bf1['str'](_0x6ad1e2(0x152))||undefined,'db':_0x299f10?_0x299f10[_0x6ad1e2(0x139)]+'\x20('+_0x299f10[_0x6ad1e2(0x149)]+')':_0xccd9b2},'description':[_0x6ad1e2(0x144)+_0x353bf1[_0x6ad1e2(0x13e)](_0x6ad1e2(0x150)),'Validation:\x20'+_0x1564f3[_0x6ad1e2(0x156)],'Type:\x20'+_0x1564f3['sqlType'][_0x6ad1e2(0x14c)]+_0x6ad1e2(0x154)+(_0x1564f3[_0x6ad1e2(0x155)][_0x6ad1e2(0x14b)](',\x20')||_0x6ad1e2(0x157))+'\x20|\x20Params:\x20'+(_0x1564f3['parameters']['join'](',\x20')||_0x6ad1e2(0x151))][_0x6ad1e2(0x14b)]('\x0a')};},async 'execute'(_0x2f8ee0){const _0x999f7a=a64_0x5e8c27,_0x1c70d0=resolve(process[_0x999f7a(0x14a)](),_0x2f8ee0[_0x999f7a(0x13e)](_0x999f7a(0x150))),_0x546853=readFileSync(_0x1c70d0,_0x999f7a(0x148)),_0x15d327=_0x2f8ee0['str']('db')||undefined,{db:_0x1ffc1e,error:_0x5538b3}=await resolveOneDb(_0x2f8ee0[_0x999f7a(0x14f)],_0x15d327);if(_0x5538b3)throw CliErrors['validation'](_0x5538b3);const _0xc7ccf5=await saveSqlQuery({'appCode':_0x2f8ee0[_0x999f7a(0x14f)],'sqlContent':_0x546853,'sqlCode':_0x2f8ee0[_0x999f7a(0x13e)](_0x999f7a(0x143))||undefined,'sqlName':_0x2f8ee0[_0x999f7a(0x13e)](_0x999f7a(0x152))||undefined,'dbId':_0x1ffc1e[_0x999f7a(0x149)],'description':_0x2f8ee0[_0x999f7a(0x13e)](_0x999f7a(0x160))||undefined});if(_0xc7ccf5['blocked'])return{'ok':![],'data':_0xc7ccf5,'message':_0xc7ccf5[_0x999f7a(0x156)]||'Conflict\x20detected'};return{'ok':!![],'data':{'sqlCode':_0xc7ccf5[_0x999f7a(0x13f)],'sqlName':_0xc7ccf5['sqlName'],'action':_0xc7ccf5[_0x999f7a(0x15c)]},'message':(_0xc7ccf5[_0x999f7a(0x15c)]===_0x999f7a(0x153)?'Created':_0x999f7a(0x15d))+_0x999f7a(0x162)+(_0xc7ccf5['sqlCode']?'\x20('+_0xc7ccf5[_0x999f7a(0x13f)]+')':'')};}};
@@ -1 +1 @@
1
- function a65_0x108b(){const _0x5bba4c=['schemas','452155wxoFKo','tableName','18EcbqJV','validate','19736brdEUy','69832WBjNci','push','utf-8','map','isArray','schema:','2679082LUMLds','message','length','valid','\x22\x20not\x20found\x20or\x20not\x20accessible','reason','tables','dbtableConfig','200QFTonp','Table\x20\x22','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','validation','isSelectOnly','file','Path\x20to\x20the\x20SQL\x20file\x20to\x20validate','678eqUFgq','str','Dataset\x20\x22','617138rniKav','from','size','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','toLowerCase','filter','sqlType','sql','string','Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)','19185eGLplU','\x22\x20not\x20found\x20in\x20any\x20dataset','flagMissing','name','fields','cwd','isDangerous','462064XSEsGx','Provide\x20--file\x20or\x20--sql','schemaWarnings','read','get','111XfsAfa'];a65_0x108b=function(){return _0x5bba4c;};return a65_0x108b();}const a65_0x99e571=a65_0x28c9;(function(_0x198dd5,_0x20f13e){const _0x37ee29=a65_0x28c9,_0x1982c4=_0x198dd5();while(!![]){try{const _0x3fb23c=-parseInt(_0x37ee29(0x19f))/0x1+-parseInt(_0x37ee29(0x1c3))/0x2+-parseInt(_0x37ee29(0x1a4))/0x3*(-parseInt(_0x37ee29(0x1aa))/0x4)+parseInt(_0x37ee29(0x198))/0x5*(parseInt(_0x37ee29(0x1c0))/0x6)+-parseInt(_0x37ee29(0x1b1))/0x7+-parseInt(_0x37ee29(0x1ab))/0x8*(-parseInt(_0x37ee29(0x1a8))/0x9)+-parseInt(_0x37ee29(0x1b9))/0xa*(-parseInt(_0x37ee29(0x1a6))/0xb);if(_0x3fb23c===_0x20f13e)break;else _0x1982c4['push'](_0x1982c4['shift']());}catch(_0x5baffe){_0x1982c4['push'](_0x1982c4['shift']());}}}(a65_0x108b,0x49d02));import{readFileSync,existsSync}from'node:fs';function a65_0x28c9(_0x530506,_0x2d6471){_0x530506=_0x530506-0x192;const _0x108ba1=a65_0x108b();let _0x28c936=_0x108ba1[_0x530506];return _0x28c936;}import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const sqlValidate={'service':a65_0x99e571(0x195),'command':a65_0x99e571(0x1a9),'description':a65_0x99e571(0x1c6),'risk':a65_0x99e571(0x1a2),'flags':[{'name':a65_0x99e571(0x1be),'type':a65_0x99e571(0x196),'description':a65_0x99e571(0x1bf)},{'name':a65_0x99e571(0x195),'type':'string','description':a65_0x99e571(0x197)},{'name':a65_0x99e571(0x1a5),'type':a65_0x99e571(0x196),'description':a65_0x99e571(0x1bb)}],async 'execute'(_0x6a8d3a){const _0xf0afa3=a65_0x99e571,_0x5522d5=_0x6a8d3a[_0xf0afa3(0x1c1)](_0xf0afa3(0x1be)),_0x188c78=_0x6a8d3a[_0xf0afa3(0x1c1)](_0xf0afa3(0x195));if(!_0x5522d5&&!_0x188c78)throw CliErrors[_0xf0afa3(0x19a)]('file',_0xf0afa3(0x1a0));let _0x282dc1;if(_0x5522d5){const _0x47b314=resolve(process[_0xf0afa3(0x19d)](),_0x5522d5);if(!existsSync(_0x47b314))throw CliErrors[_0xf0afa3(0x1bc)]('File\x20not\x20found:\x20'+_0x47b314);_0x282dc1=readFileSync(_0x47b314,_0xf0afa3(0x1ad));}else _0x282dc1=_0x188c78;const _0x781866=validateSql(_0x282dc1),_0x2b96d5={'valid':_0x781866[_0xf0afa3(0x1b4)],'sqlType':_0x781866[_0xf0afa3(0x194)]['type'],'isSelectOnly':_0x781866[_0xf0afa3(0x194)][_0xf0afa3(0x1bd)],'isDangerous':_0x781866[_0xf0afa3(0x194)][_0xf0afa3(0x19e)],'tables':_0x781866[_0xf0afa3(0x1b7)],'parameters':_0x781866['parameters'],'message':_0x781866[_0xf0afa3(0x1b2)]};_0x781866['sqlType'][_0xf0afa3(0x1b6)]&&(_0x2b96d5[_0xf0afa3(0x1b6)]=_0x781866[_0xf0afa3(0x194)][_0xf0afa3(0x1b6)]);const _0x3578ca=_0x6a8d3a[_0xf0afa3(0x1c1)](_0xf0afa3(0x1a5));if(_0x3578ca&&_0x781866[_0xf0afa3(0x1b4)]){const _0x1f9c05=_0x3578ca['split'](',')[_0xf0afa3(0x1ae)](_0x1dc46e=>_0x1dc46e['trim']())[_0xf0afa3(0x193)](Boolean),_0xc88bd5=[],_0x1fa113=await listDatasets(_0x6a8d3a['appCode']),_0x51e3dc=new Map(_0x1fa113[_0xf0afa3(0x1ae)](_0x1f2c48=>[_0x1f2c48[_0xf0afa3(0x1b8)]?.['tableName']?.['toLowerCase'](),_0x1f2c48]));for(const _0x13ea89 of _0x781866[_0xf0afa3(0x1b7)]){const _0xbefc2=_0x51e3dc[_0xf0afa3(0x1a3)](_0x13ea89[_0xf0afa3(0x192)]());!_0xbefc2&&_0xc88bd5['push'](_0xf0afa3(0x1ba)+_0x13ea89+_0xf0afa3(0x199));}for(const _0x544a7a of _0x1f9c05){try{const _0x112936=await getDatasetDetail(_0x544a7a),_0x3a66b0=Array[_0xf0afa3(0x1af)](_0x112936[_0xf0afa3(0x19c)])?_0x112936[_0xf0afa3(0x19c)]:[],_0x576ae9=new Set(_0x3a66b0[_0xf0afa3(0x1ae)](_0x410dff=>_0x410dff[_0xf0afa3(0x19b)]?.[_0xf0afa3(0x192)]())),_0x1edef3=_0x112936[_0xf0afa3(0x1b8)]?.[_0xf0afa3(0x1a7)]||_0x112936[_0xf0afa3(0x1a7)]||_0x544a7a;_0x2b96d5[_0xf0afa3(0x1b0)+_0x1edef3]={'code':_0x544a7a,'tableName':_0x1edef3,'fieldCount':_0x576ae9[_0xf0afa3(0x1c5)],'fields':Array[_0xf0afa3(0x1c4)](_0x576ae9)};}catch{_0xc88bd5[_0xf0afa3(0x1ac)](_0xf0afa3(0x1c2)+_0x544a7a+_0xf0afa3(0x1b5));}}_0xc88bd5[_0xf0afa3(0x1b3)]>0x0&&(_0x2b96d5[_0xf0afa3(0x1a1)]=_0xc88bd5);}return{'ok':_0x781866[_0xf0afa3(0x1b4)],'data':_0x2b96d5,'message':_0x781866['message']};}};
1
+ const a65_0x3733e3=a65_0xf286;(function(_0x2667ff,_0x206580){const _0x207018=a65_0xf286,_0x32f7b9=_0x2667ff();while(!![]){try{const _0x769a03=parseInt(_0x207018(0xb1))/0x1*(-parseInt(_0x207018(0xa4))/0x2)+-parseInt(_0x207018(0xac))/0x3+-parseInt(_0x207018(0xa2))/0x4+-parseInt(_0x207018(0x95))/0x5+parseInt(_0x207018(0x90))/0x6*(parseInt(_0x207018(0x9a))/0x7)+parseInt(_0x207018(0xbb))/0x8+parseInt(_0x207018(0xb6))/0x9;if(_0x769a03===_0x206580)break;else _0x32f7b9['push'](_0x32f7b9['shift']());}catch(_0x1f77ee){_0x32f7b9['push'](_0x32f7b9['shift']());}}}(a65_0x2b7d,0x622e5));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';import{validateSql}from'../../core/sql-validator.js';function a65_0xf286(_0x186542,_0x329da0){_0x186542=_0x186542-0x90;const _0x2b7da9=a65_0x2b7d();let _0xf28604=_0x2b7da9[_0x186542];return _0xf28604;}import{getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a65_0x2b7d(){const _0x1fdf55=['Provide\x20--file\x20or\x20--sql','filter','\x22\x20not\x20found\x20in\x20any\x20dataset','5648800NjRszc','map','from','17856NmAjGE','valid','Comma-separated\x20dataset\x20codes\x20to\x20cross-check\x20table/column\x20names\x20against','name','utf-8','1706445oEusEC','tables','validate','tableName','schemas','42SXLUOS','type','read','toLowerCase','Validate\x20SQL\x20content\x20without\x20saving\x20(type\x20detection,\x20parameter\x20extraction,\x20optional\x20schema\x20check)','fields','isDangerous','split','68316oCjqXk','message','563364lSEJub','validation','dbtableConfig','file','sqlType','get','File\x20not\x20found:\x20','isArray','1193112JgjDVE','str','push','Table\x20\x22','string','1HZkLKl','reason','length','sql','Dataset\x20\x22','6443523TXdLar','schema:'];a65_0x2b7d=function(){return _0x1fdf55;};return a65_0x2b7d();}export const sqlValidate={'service':a65_0x3733e3(0xb4),'command':a65_0x3733e3(0x97),'description':a65_0x3733e3(0x9e),'risk':a65_0x3733e3(0x9c),'flags':[{'name':a65_0x3733e3(0xa7),'type':a65_0x3733e3(0xb0),'description':'Path\x20to\x20the\x20SQL\x20file\x20to\x20validate'},{'name':a65_0x3733e3(0xb4),'type':a65_0x3733e3(0xb0),'description':'Inline\x20SQL\x20content\x20to\x20validate\x20(alternative\x20to\x20--file)'},{'name':a65_0x3733e3(0x99),'type':a65_0x3733e3(0xb0),'description':a65_0x3733e3(0x92)}],async 'execute'(_0x1d03f6){const _0x5c04e8=a65_0x3733e3,_0x37326d=_0x1d03f6[_0x5c04e8(0xad)](_0x5c04e8(0xa7)),_0x1e8d0d=_0x1d03f6['str'](_0x5c04e8(0xb4));if(!_0x37326d&&!_0x1e8d0d)throw CliErrors['flagMissing'](_0x5c04e8(0xa7),_0x5c04e8(0xb8));let _0x1fcbc0;if(_0x37326d){const _0x5f1db9=resolve(process['cwd'](),_0x37326d);if(!existsSync(_0x5f1db9))throw CliErrors[_0x5c04e8(0xa5)](_0x5c04e8(0xaa)+_0x5f1db9);_0x1fcbc0=readFileSync(_0x5f1db9,_0x5c04e8(0x94));}else _0x1fcbc0=_0x1e8d0d;const _0x336aca=validateSql(_0x1fcbc0),_0x2e27b9={'valid':_0x336aca[_0x5c04e8(0x91)],'sqlType':_0x336aca[_0x5c04e8(0xa8)][_0x5c04e8(0x9b)],'isSelectOnly':_0x336aca[_0x5c04e8(0xa8)]['isSelectOnly'],'isDangerous':_0x336aca[_0x5c04e8(0xa8)][_0x5c04e8(0xa0)],'tables':_0x336aca['tables'],'parameters':_0x336aca['parameters'],'message':_0x336aca[_0x5c04e8(0xa3)]};_0x336aca[_0x5c04e8(0xa8)][_0x5c04e8(0xb2)]&&(_0x2e27b9['reason']=_0x336aca[_0x5c04e8(0xa8)][_0x5c04e8(0xb2)]);const _0x518f04=_0x1d03f6[_0x5c04e8(0xad)](_0x5c04e8(0x99));if(_0x518f04&&_0x336aca['valid']){const _0x1209ac=_0x518f04[_0x5c04e8(0xa1)](',')[_0x5c04e8(0xbc)](_0x3c69dc=>_0x3c69dc['trim']())[_0x5c04e8(0xb9)](Boolean),_0x2e3777=[],_0x8cea1b=await listDatasets(_0x1d03f6['appCode']),_0x1ab01e=new Map(_0x8cea1b[_0x5c04e8(0xbc)](_0x3f41a7=>[_0x3f41a7[_0x5c04e8(0xa6)]?.[_0x5c04e8(0x98)]?.[_0x5c04e8(0x9d)](),_0x3f41a7]));for(const _0x3ed05d of _0x336aca[_0x5c04e8(0x96)]){const _0x595253=_0x1ab01e[_0x5c04e8(0xa9)](_0x3ed05d['toLowerCase']());!_0x595253&&_0x2e3777[_0x5c04e8(0xae)](_0x5c04e8(0xaf)+_0x3ed05d+_0x5c04e8(0xba));}for(const _0x1b613d of _0x1209ac){try{const _0x1275b4=await getDatasetDetail(_0x1b613d),_0x1fc1ac=Array[_0x5c04e8(0xab)](_0x1275b4[_0x5c04e8(0x9f)])?_0x1275b4[_0x5c04e8(0x9f)]:[],_0x5a7f5a=new Set(_0x1fc1ac[_0x5c04e8(0xbc)](_0x459777=>_0x459777[_0x5c04e8(0x93)]?.[_0x5c04e8(0x9d)]())),_0x18b7dc=_0x1275b4[_0x5c04e8(0xa6)]?.[_0x5c04e8(0x98)]||_0x1275b4[_0x5c04e8(0x98)]||_0x1b613d;_0x2e27b9[_0x5c04e8(0xb7)+_0x18b7dc]={'code':_0x1b613d,'tableName':_0x18b7dc,'fieldCount':_0x5a7f5a['size'],'fields':Array[_0x5c04e8(0xbd)](_0x5a7f5a)};}catch{_0x2e3777['push'](_0x5c04e8(0xb5)+_0x1b613d+'\x22\x20not\x20found\x20or\x20not\x20accessible');}}_0x2e3777[_0x5c04e8(0xb3)]>0x0&&(_0x2e27b9['schemaWarnings']=_0x2e3777);}return{'ok':_0x336aca[_0x5c04e8(0x91)],'data':_0x2e27b9,'message':_0x336aca[_0x5c04e8(0xa3)]};}};
@@ -1 +1 @@
1
- const a66_0x30b990=a66_0x5f4c;function a66_0x52aa(){const _0x2cd2cc=['cwd','126310GwpNiL','6039304uNGmri','21geNfoy','60zXLZge','3073587fIZhVX','4LGFuBD','4069780NZelBH','176850vjhpik','logger','242253WbMwFa','inherit','160FOBRqH','10vNKPLM','481830YBUPqv','now','info','needsUpgrade','vite','start','env','启动开发服务器'];a66_0x52aa=function(){return _0x2cd2cc;};return a66_0x52aa();}(function(_0x103f05,_0x3c0977){const _0x469e93=a66_0x5f4c,_0x37b5e2=_0x103f05();while(!![]){try{const _0x41c737=parseInt(_0x469e93(0x19d))/0x1*(parseInt(_0x469e93(0x193))/0x2)+-parseInt(_0x469e93(0x1a1))/0x3*(-parseInt(_0x469e93(0x1a2))/0x4)+-parseInt(_0x469e93(0x1a3))/0x5+parseInt(_0x469e93(0x194))/0x6*(parseInt(_0x469e93(0x19f))/0x7)+-parseInt(_0x469e93(0x19e))/0x8+parseInt(_0x469e93(0x1a4))/0x9*(parseInt(_0x469e93(0x192))/0xa)+parseInt(_0x469e93(0x190))/0xb*(-parseInt(_0x469e93(0x1a0))/0xc);if(_0x41c737===_0x3c0977)break;else _0x37b5e2['push'](_0x37b5e2['shift']());}catch(_0x21c20f){_0x37b5e2['push'](_0x37b5e2['shift']());}}}(a66_0x52aa,0x81fba));import{execa}from'execa';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';function a66_0x5f4c(_0xe5c60f,_0xaa77c5){_0xe5c60f=_0xe5c60f-0x190;const _0x52aa90=a66_0x52aa();let _0x5f4ccd=_0x52aa90[_0xe5c60f];return _0x5f4ccd;}import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export async function runStart(_0x42e06b){const _0x1b34b0=a66_0x5f4c,_0x3ca168=Date[_0x1b34b0(0x195)](),_0x2ff91d=_0x42e06b||process[_0x1b34b0(0x19c)](),_0x4a4529=await checkCliVersion();_0x4a4529['needsUpgrade']&&printCliUpgradeWarning(_0x4a4529);const _0x2644c9=await checkSdkVersion(_0x2ff91d);_0x2644c9[_0x1b34b0(0x197)]&&printSdkUpgradeWarning(_0x2644c9);try{await execa(_0x1b34b0(0x198),[],{'cwd':_0x2ff91d,'stdio':_0x1b34b0(0x191),'preferLocal':!![],'localDir':_0x2ff91d,'env':{...process[_0x1b34b0(0x19a)]}});const _0x44616d=Date[_0x1b34b0(0x195)]()-_0x3ca168;void _0x44616d;}catch(_0x153e79){throw _0x153e79;}}export const startCommand={'name':a66_0x30b990(0x199),'description':'Start\x20development\x20server',async 'run'(_0x481f4f,_0x4fafd2,_0x12d71f){const _0x26ffa6=a66_0x30b990;_0x481f4f[_0x26ffa6(0x1a5)][_0x26ffa6(0x196)](_0x26ffa6(0x199),_0x26ffa6(0x19b)),await runStart();}};
1
+ function a66_0xa5b5(_0x8a8eff,_0x4f20d3){_0x8a8eff=_0x8a8eff-0x1cf;const _0x6682a5=a66_0x6682();let _0xa5b5b0=_0x6682a5[_0x8a8eff];return _0xa5b5b0;}const a66_0x3e48e5=a66_0xa5b5;(function(_0x23aab2,_0x13f743){const _0x415b82=a66_0xa5b5,_0x35491a=_0x23aab2();while(!![]){try{const _0x2ad320=parseInt(_0x415b82(0x1e2))/0x1*(-parseInt(_0x415b82(0x1d1))/0x2)+-parseInt(_0x415b82(0x1cf))/0x3*(parseInt(_0x415b82(0x1da))/0x4)+parseInt(_0x415b82(0x1dc))/0x5*(parseInt(_0x415b82(0x1e0))/0x6)+parseInt(_0x415b82(0x1e3))/0x7*(parseInt(_0x415b82(0x1d4))/0x8)+-parseInt(_0x415b82(0x1d5))/0x9*(-parseInt(_0x415b82(0x1db))/0xa)+parseInt(_0x415b82(0x1e1))/0xb*(parseInt(_0x415b82(0x1e6))/0xc)+parseInt(_0x415b82(0x1d8))/0xd*(parseInt(_0x415b82(0x1d2))/0xe);if(_0x2ad320===_0x13f743)break;else _0x35491a['push'](_0x35491a['shift']());}catch(_0x4e40a5){_0x35491a['push'](_0x35491a['shift']());}}}(a66_0x6682,0x22c3b));import{execa}from'execa';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export async function runStart(_0x38620b){const _0x2398cc=a66_0xa5b5,_0x3e7dc1=Date[_0x2398cc(0x1e5)](),_0x30312d=_0x38620b||process[_0x2398cc(0x1e4)](),_0x2eec64=await checkCliVersion();_0x2eec64[_0x2398cc(0x1d0)]&&printCliUpgradeWarning(_0x2eec64);const _0x33a60d=await checkSdkVersion(_0x30312d);_0x33a60d[_0x2398cc(0x1d0)]&&printSdkUpgradeWarning(_0x33a60d);try{await execa(_0x2398cc(0x1df),[],{'cwd':_0x30312d,'stdio':_0x2398cc(0x1d7),'preferLocal':!![],'localDir':_0x30312d,'env':{...process[_0x2398cc(0x1d3)]}});const _0x3e0b80=Date[_0x2398cc(0x1e5)]()-_0x3e7dc1;void _0x3e0b80;}catch(_0xc340a2){throw _0xc340a2;}}function a66_0x6682(){const _0x15b922=['1171219CyXQrQ','cwd','now','3396dgOoIC','info','723YjiFoL','needsUpgrade','1226DadWKh','84UylWBd','env','8BUbPJp','35568NadseV','Start\x20development\x20server','inherit','539721tYkhCK','启动开发服务器','2968ibxfTA','160ZFLSlj','53175ucQiAR','start','logger','vite','6Emrpxi','3531KRVBBQ','424SJRPNS'];a66_0x6682=function(){return _0x15b922;};return a66_0x6682();}export const startCommand={'name':a66_0x3e48e5(0x1dd),'description':a66_0x3e48e5(0x1d6),async 'run'(_0x18b483,_0x57baf2,_0x368821){const _0x4a4e76=a66_0x3e48e5;_0x18b483[_0x4a4e76(0x1de)][_0x4a4e76(0x1e7)](_0x4a4e76(0x1dd),_0x4a4e76(0x1d9)),await runStart();}};
@@ -1 +1 @@
1
- (function(_0x52bd3e,_0x49ec2d){const _0xf6a389=a67_0x2f82,_0x5cff6f=_0x52bd3e();while(!![]){try{const _0x2e07bb=-parseInt(_0xf6a389(0x141))/0x1*(parseInt(_0xf6a389(0x136))/0x2)+-parseInt(_0xf6a389(0x13e))/0x3+-parseInt(_0xf6a389(0x148))/0x4*(-parseInt(_0xf6a389(0x147))/0x5)+-parseInt(_0xf6a389(0x137))/0x6*(-parseInt(_0xf6a389(0x140))/0x7)+-parseInt(_0xf6a389(0x142))/0x8+parseInt(_0xf6a389(0x13c))/0x9+parseInt(_0xf6a389(0x144))/0xa;if(_0x2e07bb===_0x49ec2d)break;else _0x5cff6f['push'](_0x5cff6f['shift']());}catch(_0x26085e){_0x5cff6f['push'](_0x5cff6f['shift']());}}}(a67_0x49e3,0xdee02));import{jsxs as a67_0x13035c,jsx as a67_0x4cdbc1}from'react/jsx-runtime';function a67_0x2f82(_0x4631c5,_0x3cea46){_0x4631c5=_0x4631c5-0x135;const _0x49e329=a67_0x49e3();let _0x2f8259=_0x49e329[_0x4631c5];return _0x2f8259;}import{Box,Text}from'ink';import{CLI_BIN_NAME}from'../constant/cli.js';function a67_0x49e3(){const _0x40e987=['19832bWbwQS','map','Set\x20a\x20config\x20value','\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','List\x20all\x20config\x20values','109982FPehVa','831876LzUKEh','gray','\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','description','\x20config\x20set\x20locale\x20en\x20\x20\x20\x20\x20\x20\x20','3762225xemqMl','\x20\x20\x20\x20','1020003YLfHol','Examples:','7weCKhx','14ZumkPC','7799608TmKnCd','command','24162630fhryyu','\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Invalid\x20command.\x20Available\x20commands:','25gYNrrj'];a67_0x49e3=function(){return _0x40e987;};return a67_0x49e3();}export function ConfigHelp(){const _0x546052=a67_0x2f82,_0x27b329=[{'command':CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','description':_0x546052(0x14a)},{'command':CLI_BIN_NAME+'\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description':'Get\x20a\x20config\x20value'},{'command':CLI_BIN_NAME+_0x546052(0x145),'description':_0x546052(0x135)}],_0x2cd9c6=[{'command':CLI_BIN_NAME+_0x546052(0x139),'description':'Set\x20App\x20Code\x20for\x20current\x20project'},{'command':CLI_BIN_NAME+_0x546052(0x14b),'description':'Set\x20environment\x20(production/daily)'},{'command':CLI_BIN_NAME+_0x546052(0x13b),'description':'Set\x20display\x20language\x20(zh/en)'}];return a67_0x13035c(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a67_0x4cdbc1(Box,{'marginBottom':0x1,'children':a67_0x13035c(Text,{'color':'gray','children':['\x20','!','\x20\x20',_0x546052(0x146)]})}),_0x27b329['map'](_0x15f4e7=>a67_0x13035c(Box,{'children':[a67_0x13035c(Text,{'children':[_0x546052(0x13d),_0x15f4e7[_0x546052(0x143)]]}),a67_0x4cdbc1(Text,{'color':_0x546052(0x138),'children':_0x15f4e7[_0x546052(0x13a)]})]},_0x15f4e7[_0x546052(0x143)])),a67_0x4cdbc1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a67_0x13035c(Text,{'color':_0x546052(0x138),'children':['\x20*\x20',_0x546052(0x13f)]})}),_0x2cd9c6[_0x546052(0x149)](_0x5865ca=>a67_0x13035c(Box,{'children':[a67_0x13035c(Text,{'children':['\x20\x20\x20\x20',_0x5865ca[_0x546052(0x143)]]}),a67_0x4cdbc1(Text,{'color':_0x546052(0x138),'children':_0x5865ca[_0x546052(0x13a)]})]},_0x5865ca[_0x546052(0x143)]))]});}
1
+ (function(_0x1d4f02,_0x2d3e06){const _0x4cff9a=a67_0x174b,_0x563999=_0x1d4f02();while(!![]){try{const _0x25a6d2=-parseInt(_0x4cff9a(0x197))/0x1+-parseInt(_0x4cff9a(0x19e))/0x2+parseInt(_0x4cff9a(0x19c))/0x3+parseInt(_0x4cff9a(0x19d))/0x4*(-parseInt(_0x4cff9a(0x1a7))/0x5)+parseInt(_0x4cff9a(0x1a8))/0x6*(parseInt(_0x4cff9a(0x192))/0x7)+-parseInt(_0x4cff9a(0x1a9))/0x8*(parseInt(_0x4cff9a(0x1ac))/0x9)+parseInt(_0x4cff9a(0x19a))/0xa;if(_0x25a6d2===_0x2d3e06)break;else _0x563999['push'](_0x563999['shift']());}catch(_0x486d29){_0x563999['push'](_0x563999['shift']());}}}(a67_0x2a86,0x34d20));function a67_0x174b(_0x485299,_0x4e8783){_0x485299=_0x485299-0x192;const _0x2a8604=a67_0x2a86();let _0x174b8a=_0x2a8604[_0x485299];return _0x174b8a;}import{jsxs as a67_0xd7a625,jsx as a67_0x568441}from'react/jsx-runtime';function a67_0x2a86(){const _0x45ca47=['11850DaFuKK','1663734xzxxmx','19528kaPZKh','description','\x20\x20\x20\x20','531DRcNWf','Set\x20environment\x20(production/daily)','7iCxUOv','\x20config\x20set\x20locale\x20en\x20\x20\x20\x20\x20\x20\x20','gray','Set\x20App\x20Code\x20for\x20current\x20project','\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','268761IVjGpt','Invalid\x20command.\x20Available\x20commands:','map','3878310EvDZJT','Set\x20display\x20language\x20(zh/en)','1038546iZlLfz','172EpXxgd','560520hOcvaE','List\x20all\x20config\x20values','command','Set\x20a\x20config\x20value','Get\x20a\x20config\x20value','\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','\x20*\x20'];a67_0x2a86=function(){return _0x45ca47;};return a67_0x2a86();}import{Box,Text}from'ink';import{CLI_BIN_NAME}from'../constant/cli.js';export function ConfigHelp(){const _0x489890=a67_0x174b,_0x15d286=[{'command':CLI_BIN_NAME+'\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','description':_0x489890(0x1a1)},{'command':CLI_BIN_NAME+_0x489890(0x1a4),'description':_0x489890(0x1a2)},{'command':CLI_BIN_NAME+_0x489890(0x1a3),'description':_0x489890(0x19f)}],_0x6f70da=[{'command':CLI_BIN_NAME+_0x489890(0x1a5),'description':_0x489890(0x195)},{'command':CLI_BIN_NAME+_0x489890(0x196),'description':_0x489890(0x1ad)},{'command':CLI_BIN_NAME+_0x489890(0x193),'description':_0x489890(0x19b)}];return a67_0xd7a625(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a67_0x568441(Box,{'marginBottom':0x1,'children':a67_0xd7a625(Text,{'color':_0x489890(0x194),'children':['\x20','!','\x20\x20',_0x489890(0x198)]})}),_0x15d286[_0x489890(0x199)](_0x5f36a3=>a67_0xd7a625(Box,{'children':[a67_0xd7a625(Text,{'children':['\x20\x20\x20\x20',_0x5f36a3[_0x489890(0x1a0)]]}),a67_0x568441(Text,{'color':_0x489890(0x194),'children':_0x5f36a3[_0x489890(0x1aa)]})]},_0x5f36a3['command'])),a67_0x568441(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a67_0xd7a625(Text,{'color':_0x489890(0x194),'children':[_0x489890(0x1a6),'Examples:']})}),_0x6f70da[_0x489890(0x199)](_0x39e9d7=>a67_0xd7a625(Box,{'children':[a67_0xd7a625(Text,{'children':[_0x489890(0x1ab),_0x39e9d7[_0x489890(0x1a0)]]}),a67_0x568441(Text,{'color':_0x489890(0x194),'children':_0x39e9d7[_0x489890(0x1aa)]})]},_0x39e9d7[_0x489890(0x1a0)]))]});}
@@ -1 +1 @@
1
- const a68_0x2c5f12=a68_0x43d6;(function(_0x413cf6,_0x4a78fb){const _0x2e14cc=a68_0x43d6,_0x1d6551=_0x413cf6();while(!![]){try{const _0x25bfb2=-parseInt(_0x2e14cc(0x121))/0x1+-parseInt(_0x2e14cc(0x132))/0x2*(-parseInt(_0x2e14cc(0x11b))/0x3)+parseInt(_0x2e14cc(0x11a))/0x4+parseInt(_0x2e14cc(0x12c))/0x5+-parseInt(_0x2e14cc(0x10c))/0x6*(-parseInt(_0x2e14cc(0x12d))/0x7)+parseInt(_0x2e14cc(0x111))/0x8*(-parseInt(_0x2e14cc(0x11f))/0x9)+-parseInt(_0x2e14cc(0x11c))/0xa*(parseInt(_0x2e14cc(0x116))/0xb);if(_0x25bfb2===_0x4a78fb)break;else _0x1d6551['push'](_0x1d6551['shift']());}catch(_0x1150f0){_0x1d6551['push'](_0x1d6551['shift']());}}}(a68_0x2d75,0x83dd5));import{jsx as a68_0x282d12,jsxs as a68_0x143c35}from'react/jsx-runtime';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig}from'../utils/config.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{logger}from'../utils/logger.js';function a68_0x43d6(_0x34098f,_0x45941c){_0x34098f=_0x34098f-0x10b;const _0x2d75af=a68_0x2d75();let _0x43d6f3=_0x2d75af[_0x34098f];return _0x43d6f3;}function a68_0x2d75(){const _0x27d43d=['\x20locale\x20set\x20to:\x20','zh-CN','message','includes','2455584gRQLnb','production','app','log','input','11hbwAJQ','help','env','appcode','311332EcLjZK','3hZErFy','14249480cnZubv','column','red','9bwKpCD','length','183858gRpoZL','string','Project','en-US','\x20env\x20set\x20to:\x20','error','Config\x20value\x20is\x20invalid\x20or\x20too\x20long','stringify','Invalid\x20locale\x20value.\x20Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','get','list','4687095Evujvf','173999ZBVZBG','online','Global','config','undefined','1638388JXJjzx','locale','150gFCUYN'];a68_0x2d75=function(){return _0x27d43d;};return a68_0x2d75();}const LOCALE_MAP={'zh':a68_0x2c5f12(0x10e),'zh-cn':a68_0x2c5f12(0x10e),'zh_cn':a68_0x2c5f12(0x10e),'en':a68_0x2c5f12(0x124),'en-us':'en-US','en_us':'en-US'};function normalizeLocale(_0x4e3a05){if(!_0x4e3a05)return null;return LOCALE_MAP[_0x4e3a05['toLowerCase']()]??null;}export function Config(_0x19c675){const _0x53f2de=a68_0x2c5f12,{cli:_0x2effcd}=_0x19c675,_0x1374c5=_0x2effcd[_0x53f2de(0x115)][0x1],_0x542c1b=_0x2effcd[_0x53f2de(0x115)][0x2],_0xa0f1e1=['set',_0x53f2de(0x12a)][_0x53f2de(0x110)](_0x1374c5||''),_0x11b030=_0x2effcd[_0x53f2de(0x115)][_0x53f2de(0x120)]>=0x3;if(_0x542c1b==='--help'||_0x2effcd['flags'][_0x53f2de(0x117)])return a68_0x282d12(ConfigHelp,{});const _0x48a34f=readConfig();if(_0x1374c5==='set'){if(_0x542c1b){const _0x244bd3=_0x2effcd[_0x53f2de(0x115)][0x3];if(typeof _0x244bd3!==_0x53f2de(0x131)){if(_0x542c1b===_0x53f2de(0x118)&&![_0x53f2de(0x12e),_0x53f2de(0x112),'daily'][_0x53f2de(0x110)](_0x244bd3))return a68_0x282d12(Box,{'children':a68_0x282d12(Text,{'color':_0x53f2de(0x11e),'children':'env\x20value\x20must\x20be\x20\x22production\x22\x20or\x20\x22daily\x22'})});if(_0x542c1b===_0x53f2de(0x10b)&&!normalizeLocale(_0x244bd3))return a68_0x282d12(Box,{'flexDirection':_0x53f2de(0x11d),'children':a68_0x282d12(Text,{'color':_0x53f2de(0x11e),'children':_0x53f2de(0x129)})});const _0x40cb02=isInProject(),_0x510f5f=resolveWriteConfigPath(_0x40cb02?'project':'global');let _0x461ca7=readConfigFile(_0x510f5f);if(typeof _0x244bd3!==_0x53f2de(0x122)||_0x244bd3[_0x53f2de(0x120)]>0x1f4)return a68_0x282d12(Box,{'children':a68_0x282d12(Text,{'color':'red','children':_0x53f2de(0x127)})});let _0x6336ab=_0x542c1b,_0x3e9f24=_0x244bd3;_0x542c1b===_0x53f2de(0x113)&&(_0x6336ab=_0x53f2de(0x119),delete _0x461ca7[_0x53f2de(0x113)]);_0x542c1b==='appcode'&&delete _0x461ca7['app'];_0x542c1b===_0x53f2de(0x10b)&&(_0x3e9f24=normalizeLocale(_0x244bd3));_0x461ca7[_0x6336ab]=_0x3e9f24;try{writeConfigFile(_0x510f5f,_0x461ca7);const _0x82346c=_0x40cb02?_0x53f2de(0x123):_0x53f2de(0x12f);_0x542c1b==='env'&&console[_0x53f2de(0x114)]('✓\x20'+_0x82346c+_0x53f2de(0x125)+_0x244bd3);if(_0x542c1b==='locale'){const _0xb7d699=normalizeLocale(_0x244bd3);console[_0x53f2de(0x114)]('✓\x20'+_0x82346c+_0x53f2de(0x10d)+_0xb7d699);}}catch(_0x14f772){return logger[_0x53f2de(0x126)](_0x53f2de(0x130),'保存配置失败',{'error':_0x14f772 instanceof Error?_0x14f772[_0x53f2de(0x10f)]:String(_0x14f772),'configKey':_0x542c1b,'configValue':_0x244bd3,'targetConfigPath':_0x510f5f}),a68_0x282d12(Box,{'children':a68_0x143c35(Text,{'color':'red','children':['Failed\x20to\x20save\x20config',':','\x20',_0x14f772 instanceof Error?_0x14f772[_0x53f2de(0x10f)]:String(_0x14f772)]})});}return null;}return a68_0x282d12(Box,{'children':a68_0x282d12(Text,{'color':_0x53f2de(0x11e),'children':'No\x20config\x20value\x20provided'})});}}if(_0x1374c5===_0x53f2de(0x12a)){if(_0x542c1b){let _0x1bbae4=_0x542c1b;return _0x542c1b==='app'&&(_0x1bbae4=_0x53f2de(0x119)),console[_0x53f2de(0x114)](_0x48a34f[_0x1bbae4]||'undefined'),null;}return null;}if(_0x1374c5===_0x53f2de(0x12b))return console[_0x53f2de(0x114)](JSON[_0x53f2de(0x128)](_0x48a34f,null,0x2)),null;if(!_0xa0f1e1||!_0x11b030)return a68_0x282d12(ConfigHelp,{});return null;}
1
+ const a68_0x51142e=a68_0x11ae;(function(_0x46bc42,_0x39e5dd){const _0x22e1f3=a68_0x11ae,_0x5b51a2=_0x46bc42();while(!![]){try{const _0x419e63=-parseInt(_0x22e1f3(0x16a))/0x1+-parseInt(_0x22e1f3(0x16c))/0x2+-parseInt(_0x22e1f3(0x16e))/0x3+parseInt(_0x22e1f3(0x149))/0x4+-parseInt(_0x22e1f3(0x151))/0x5+-parseInt(_0x22e1f3(0x15b))/0x6+parseInt(_0x22e1f3(0x167))/0x7;if(_0x419e63===_0x39e5dd)break;else _0x5b51a2['push'](_0x5b51a2['shift']());}catch(_0x1ec31f){_0x5b51a2['push'](_0x5b51a2['shift']());}}}(a68_0x2031,0xc0adc));import{jsx as a68_0x546f8e,jsxs as a68_0x1f8285}from'react/jsx-runtime';import{ConfigHelp}from'./config-help.js';function a68_0x2031(){const _0x9f62f6=['undefined','3903633NacvTt','project','appcode','Project','181096ukDPzL','toLowerCase','env','config','log','production','Failed\x20to\x20save\x20config','Invalid\x20locale\x20value.\x20Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','7577025tHZbvv','help','red','online','\x20locale\x20set\x20to:\x20','get','locale','No\x20config\x20value\x20provided','list','input','3207078oxMaYf','flags','保存配置失败','global','error','zh-CN','app','stringify','string','set','Config\x20value\x20is\x20invalid\x20or\x20too\x20long','env\x20value\x20must\x20be\x20\x22production\x22\x20or\x20\x22daily\x22','33876745zhQYjb','message','includes','254890JEnort','en-US','979156poXDzG'];a68_0x2031=function(){return _0x9f62f6;};return a68_0x2031();}import{Box,Text}from'ink';import{readConfig}from'../utils/config.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';import{logger}from'../utils/logger.js';const LOCALE_MAP={'zh':a68_0x51142e(0x160),'zh-cn':'zh-CN','zh_cn':a68_0x51142e(0x160),'en':a68_0x51142e(0x16b),'en-us':a68_0x51142e(0x16b),'en_us':a68_0x51142e(0x16b)};function normalizeLocale(_0x219bdd){const _0x44b41a=a68_0x51142e;if(!_0x219bdd)return null;return LOCALE_MAP[_0x219bdd[_0x44b41a(0x14a)]()]??null;}function a68_0x11ae(_0x3c9ed5,_0x1fd042){_0x3c9ed5=_0x3c9ed5-0x148;const _0x20318c=a68_0x2031();let _0x11aea4=_0x20318c[_0x3c9ed5];return _0x11aea4;}export function Config(_0xe37f91){const _0x11a4d2=a68_0x51142e,{cli:_0x9a49fc}=_0xe37f91,_0x2edf3e=_0x9a49fc['input'][0x1],_0x89702e=_0x9a49fc[_0x11a4d2(0x15a)][0x2],_0x2dca3c=[_0x11a4d2(0x164),_0x11a4d2(0x156)][_0x11a4d2(0x169)](_0x2edf3e||''),_0x50cc70=_0x9a49fc[_0x11a4d2(0x15a)]['length']>=0x3;if(_0x89702e==='--help'||_0x9a49fc[_0x11a4d2(0x15c)][_0x11a4d2(0x152)])return a68_0x546f8e(ConfigHelp,{});const _0x40adf0=readConfig();if(_0x2edf3e==='set'){if(_0x89702e){const _0x5e219d=_0x9a49fc[_0x11a4d2(0x15a)][0x3];if(typeof _0x5e219d!==_0x11a4d2(0x16d)){if(_0x89702e===_0x11a4d2(0x14b)&&![_0x11a4d2(0x154),_0x11a4d2(0x14e),'daily'][_0x11a4d2(0x169)](_0x5e219d))return a68_0x546f8e(Box,{'children':a68_0x546f8e(Text,{'color':'red','children':_0x11a4d2(0x166)})});if(_0x89702e===_0x11a4d2(0x157)&&!normalizeLocale(_0x5e219d))return a68_0x546f8e(Box,{'flexDirection':'column','children':a68_0x546f8e(Text,{'color':_0x11a4d2(0x153),'children':_0x11a4d2(0x150)})});const _0x22ef68=isInProject(),_0x91a527=resolveWriteConfigPath(_0x22ef68?_0x11a4d2(0x16f):_0x11a4d2(0x15e));let _0x5e5d48=readConfigFile(_0x91a527);if(typeof _0x5e219d!==_0x11a4d2(0x163)||_0x5e219d['length']>0x1f4)return a68_0x546f8e(Box,{'children':a68_0x546f8e(Text,{'color':_0x11a4d2(0x153),'children':_0x11a4d2(0x165)})});let _0x7d9efa=_0x89702e,_0x318610=_0x5e219d;_0x89702e===_0x11a4d2(0x161)&&(_0x7d9efa=_0x11a4d2(0x170),delete _0x5e5d48[_0x11a4d2(0x161)]);_0x89702e==='appcode'&&delete _0x5e5d48[_0x11a4d2(0x161)];_0x89702e===_0x11a4d2(0x157)&&(_0x318610=normalizeLocale(_0x5e219d));_0x5e5d48[_0x7d9efa]=_0x318610;try{writeConfigFile(_0x91a527,_0x5e5d48);const _0x1483ba=_0x22ef68?_0x11a4d2(0x148):'Global';_0x89702e===_0x11a4d2(0x14b)&&console['log']('✓\x20'+_0x1483ba+'\x20env\x20set\x20to:\x20'+_0x5e219d);if(_0x89702e===_0x11a4d2(0x157)){const _0x15c31f=normalizeLocale(_0x5e219d);console[_0x11a4d2(0x14d)]('✓\x20'+_0x1483ba+_0x11a4d2(0x155)+_0x15c31f);}}catch(_0x377beb){return logger[_0x11a4d2(0x15f)](_0x11a4d2(0x14c),_0x11a4d2(0x15d),{'error':_0x377beb instanceof Error?_0x377beb[_0x11a4d2(0x168)]:String(_0x377beb),'configKey':_0x89702e,'configValue':_0x5e219d,'targetConfigPath':_0x91a527}),a68_0x546f8e(Box,{'children':a68_0x1f8285(Text,{'color':_0x11a4d2(0x153),'children':[_0x11a4d2(0x14f),':','\x20',_0x377beb instanceof Error?_0x377beb['message']:String(_0x377beb)]})});}return null;}return a68_0x546f8e(Box,{'children':a68_0x546f8e(Text,{'color':_0x11a4d2(0x153),'children':_0x11a4d2(0x158)})});}}if(_0x2edf3e===_0x11a4d2(0x156)){if(_0x89702e){let _0x474bc7=_0x89702e;return _0x89702e===_0x11a4d2(0x161)&&(_0x474bc7=_0x11a4d2(0x170)),console['log'](_0x40adf0[_0x474bc7]||_0x11a4d2(0x16d)),null;}return null;}if(_0x2edf3e===_0x11a4d2(0x159))return console['log'](JSON[_0x11a4d2(0x162)](_0x40adf0,null,0x2)),null;if(!_0x2dca3c||!_0x50cc70)return a68_0x546f8e(ConfigHelp,{});return null;}
@@ -1 +1 @@
1
- function a69_0x55b2(_0x2aec4a,_0x519414){_0x2aec4a=_0x2aec4a-0xc3;const _0x2b8173=a69_0x2b81();let _0x55b2f1=_0x2b8173[_0x2aec4a];return _0x55b2f1;}const a69_0x18782d=a69_0x55b2;(function(_0x58a493,_0x53e193){const _0x2b3ce5=a69_0x55b2,_0x2fa690=_0x58a493();while(!![]){try{const _0x19244e=parseInt(_0x2b3ce5(0xc3))/0x1+parseInt(_0x2b3ce5(0xc5))/0x2+parseInt(_0x2b3ce5(0xc7))/0x3*(-parseInt(_0x2b3ce5(0xc6))/0x4)+parseInt(_0x2b3ce5(0xc9))/0x5*(-parseInt(_0x2b3ce5(0xcb))/0x6)+-parseInt(_0x2b3ce5(0xcd))/0x7+parseInt(_0x2b3ce5(0xc4))/0x8+parseInt(_0x2b3ce5(0xca))/0x9;if(_0x19244e===_0x53e193)break;else _0x2fa690['push'](_0x2fa690['shift']());}catch(_0x6f5552){_0x2fa690['push'](_0x2fa690['shift']());}}}(a69_0x2b81,0x7ce27));export const CLI_BIN_NAME=a69_0x18782d(0xc8);export const NPM_PACKAGE_NAME=a69_0x18782d(0xcc);function a69_0x2b81(){const _0x296b92=['452205yUAKqt','7932PtdyPI','@lovrabet/rabetbase-cli','264348yTgAuY','982976HRmFuh','4122888MBSrfY','1329842ihYxxx','3447032YmNNJZ','3vDSbJc','rabetbase','3035TTmlwC'];a69_0x2b81=function(){return _0x296b92;};return a69_0x2b81();}
1
+ const a69_0x247372=a69_0x2ef5;(function(_0x1fbf4c,_0x3ec311){const _0x3f3c16=a69_0x2ef5,_0x5f392a=_0x1fbf4c();while(!![]){try{const _0x5245c6=parseInt(_0x3f3c16(0x1a8))/0x1+parseInt(_0x3f3c16(0x1a0))/0x2+parseInt(_0x3f3c16(0x19f))/0x3*(parseInt(_0x3f3c16(0x1aa))/0x4)+-parseInt(_0x3f3c16(0x19e))/0x5*(parseInt(_0x3f3c16(0x1a3))/0x6)+parseInt(_0x3f3c16(0x1a7))/0x7*(-parseInt(_0x3f3c16(0x1a5))/0x8)+parseInt(_0x3f3c16(0x1a9))/0x9*(parseInt(_0x3f3c16(0x1a2))/0xa)+-parseInt(_0x3f3c16(0x1a6))/0xb*(parseInt(_0x3f3c16(0x1a1))/0xc);if(_0x5245c6===_0x3ec311)break;else _0x5f392a['push'](_0x5f392a['shift']());}catch(_0x364b82){_0x5f392a['push'](_0x5f392a['shift']());}}}(a69_0x38a9,0x9c14e));function a69_0x38a9(){const _0x4a6b3b=['4UJbsVi','@lovrabet/rabetbase-cli','5xmSyBu','2608467ZIrKRO','669554psvJnH','29604hiCeRz','130WJZJIt','4471926YQvqOY','rabetbase','1416KTlMZa','253NYrbgd','46214lVtpPg','616079pMXuYa','546633ahkZGp'];a69_0x38a9=function(){return _0x4a6b3b;};return a69_0x38a9();}function a69_0x2ef5(_0x419390,_0x469c50){_0x419390=_0x419390-0x19e;const _0x38a91e=a69_0x38a9();let _0x2ef5d1=_0x38a91e[_0x419390];return _0x2ef5d1;}export const CLI_BIN_NAME=a69_0x247372(0x1a4);export const NPM_PACKAGE_NAME=a69_0x247372(0x1ab);
@@ -1 +1 @@
1
- const a70_0x54d8a1=a70_0x15df;(function(_0x2f5ac8,_0x9a97df){const _0x218e16=a70_0x15df,_0x2a1572=_0x2f5ac8();while(!![]){try{const _0x342819=parseInt(_0x218e16(0x1e9))/0x1*(parseInt(_0x218e16(0x1ef))/0x2)+-parseInt(_0x218e16(0x1eb))/0x3+parseInt(_0x218e16(0x1e5))/0x4*(-parseInt(_0x218e16(0x1ed))/0x5)+-parseInt(_0x218e16(0x1ea))/0x6+parseInt(_0x218e16(0x1e7))/0x7*(-parseInt(_0x218e16(0x1f2))/0x8)+-parseInt(_0x218e16(0x1ec))/0x9*(parseInt(_0x218e16(0x1e6))/0xa)+parseInt(_0x218e16(0x1e8))/0xb*(parseInt(_0x218e16(0x1f3))/0xc);if(_0x342819===_0x9a97df)break;else _0x2a1572['push'](_0x2a1572['shift']());}catch(_0xb11f89){_0x2a1572['push'](_0x2a1572['shift']());}}}(a70_0x933f,0x2dead));import{getEnv}from'./env.js';function a70_0x933f(){const _0x5d9c49=['599432xtEVXy','40GYFpAv','119ctJzsa','42394veHWtr','321889xEoGaM','1755108xScGgR','821889UmweIM','463572fIrpSS','5QINAHG','https://api.lovrabet.com','2jmhEwQ','https://user-daily.lovrabet.com','https://user.lovrabet.com','160312GYCJPt','3516bhRDtH','production','https://daily-runtime.lovrabet.com'];a70_0x933f=function(){return _0x5d9c49;};return a70_0x933f();}function a70_0x15df(_0x3b071f,_0x35998c){_0x3b071f=_0x3b071f-0x1e5;const _0x933f7b=a70_0x933f();let _0x15df70=_0x933f7b[_0x3b071f];return _0x15df70;}export const getUserDomain=()=>getEnv()===a70_0x54d8a1(0x1f4)?a70_0x54d8a1(0x1f1):a70_0x54d8a1(0x1f0);export const getApiDomain=()=>getEnv()===a70_0x54d8a1(0x1f4)?a70_0x54d8a1(0x1ee):'https://daily-api.lovrabet.com';export const getRuntimeDomain=()=>getEnv()==='production'?'https://runtime.lovrabet.com':a70_0x54d8a1(0x1f5);
1
+ const a70_0x144ff3=a70_0x11f3;function a70_0x3304(){const _0x193b22=['7YrGgvK','4921806DyqOAO','3990604qRlskh','42NfHkTW','6547760jZmNpM','https://user.lovrabet.com','1716UXbGUV','90tVmIKf','65671cpFcUm','541864gkwHhO','production','https://daily-api.lovrabet.com','https://api.lovrabet.com','6503676EjuBTC','181160IYXbqt'];a70_0x3304=function(){return _0x193b22;};return a70_0x3304();}function a70_0x11f3(_0x1836d7,_0x5d2359){_0x1836d7=_0x1836d7-0x15a;const _0x33045e=a70_0x3304();let _0x11f3cf=_0x33045e[_0x1836d7];return _0x11f3cf;}(function(_0x5c9d99,_0x5f2192){const _0x59d452=a70_0x11f3,_0x55045b=_0x5c9d99();while(!![]){try{const _0x14cf3=-parseInt(_0x59d452(0x15f))/0x1*(-parseInt(_0x59d452(0x15a))/0x2)+-parseInt(_0x59d452(0x167))/0x3+parseInt(_0x59d452(0x168))/0x4+parseInt(_0x59d452(0x15b))/0x5+-parseInt(_0x59d452(0x164))/0x6*(-parseInt(_0x59d452(0x166))/0x7)+-parseInt(_0x59d452(0x160))/0x8*(-parseInt(_0x59d452(0x15e))/0x9)+parseInt(_0x59d452(0x165))/0xa*(-parseInt(_0x59d452(0x15d))/0xb);if(_0x14cf3===_0x5f2192)break;else _0x55045b['push'](_0x55045b['shift']());}catch(_0x3b72d3){_0x55045b['push'](_0x55045b['shift']());}}}(a70_0x3304,0xef788));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a70_0x144ff3(0x161)?a70_0x144ff3(0x15c):'https://user-daily.lovrabet.com';export const getApiDomain=()=>getEnv()===a70_0x144ff3(0x161)?a70_0x144ff3(0x163):a70_0x144ff3(0x162);export const getRuntimeDomain=()=>getEnv()===a70_0x144ff3(0x161)?'https://runtime.lovrabet.com':'https://daily-runtime.lovrabet.com';
@@ -1 +1 @@
1
- const a71_0x508db7=a71_0x2f2a;function a71_0x2f2a(_0x28eb64,_0x50f315){_0x28eb64=_0x28eb64-0x180;const _0x3cca2b=a71_0x3cca();let _0x2f2a2a=_0x3cca2b[_0x28eb64];return _0x2f2a2a;}(function(_0xc93212,_0x4b5734){const _0x37ab40=a71_0x2f2a,_0x11105c=_0xc93212();while(!![]){try{const _0x5795a6=parseInt(_0x37ab40(0x180))/0x1*(parseInt(_0x37ab40(0x189))/0x2)+-parseInt(_0x37ab40(0x186))/0x3*(parseInt(_0x37ab40(0x183))/0x4)+parseInt(_0x37ab40(0x18b))/0x5*(-parseInt(_0x37ab40(0x18d))/0x6)+-parseInt(_0x37ab40(0x18c))/0x7+parseInt(_0x37ab40(0x185))/0x8+parseInt(_0x37ab40(0x188))/0x9+parseInt(_0x37ab40(0x18a))/0xa*(-parseInt(_0x37ab40(0x182))/0xb);if(_0x5795a6===_0x4b5734)break;else _0x11105c['push'](_0x11105c['shift']());}catch(_0x2ef855){_0x11105c['push'](_0x11105c['shift']());}}}(a71_0x3cca,0x24208));export function normalizeEnv(_0x361a8e){const _0x4fd6a6=a71_0x2f2a;return _0x361a8e===_0x4fd6a6(0x187)?'production':_0x361a8e;}function a71_0x3cca(){const _0x5ba98e=['340790XOUXyF','5ninkjj','392749fAyraw','1172982rkaGtH','37mNlBJO','env','33iWuORF','332wsrXir','LOVRABET_ENV','1054752uUbuXq','2073WwrPBJ','online','1431351dfvveb','14502vnaKTq'];a71_0x3cca=function(){return _0x5ba98e;};return a71_0x3cca();}let env=normalizeEnv(process[a71_0x508db7(0x181)]['RABETBASE_ENV']||process[a71_0x508db7(0x181)][a71_0x508db7(0x184)]||'production');export function getEnv(){return env;}export function initEnv(_0x46e1a2){env=normalizeEnv(_0x46e1a2);}
1
+ const a71_0x31aefd=a71_0x2424;(function(_0x74bb10,_0x52d3de){const _0x632f1f=a71_0x2424,_0x3f28b5=_0x74bb10();while(!![]){try{const _0x18eb59=-parseInt(_0x632f1f(0x1e7))/0x1+-parseInt(_0x632f1f(0x1e1))/0x2+-parseInt(_0x632f1f(0x1e6))/0x3*(parseInt(_0x632f1f(0x1e2))/0x4)+-parseInt(_0x632f1f(0x1ea))/0x5+parseInt(_0x632f1f(0x1e5))/0x6*(-parseInt(_0x632f1f(0x1df))/0x7)+parseInt(_0x632f1f(0x1e8))/0x8+parseInt(_0x632f1f(0x1ec))/0x9*(parseInt(_0x632f1f(0x1eb))/0xa);if(_0x18eb59===_0x52d3de)break;else _0x3f28b5['push'](_0x3f28b5['shift']());}catch(_0x4dc3dc){_0x3f28b5['push'](_0x3f28b5['shift']());}}}(a71_0x203d,0x25f28));export function normalizeEnv(_0x6255ef){const _0x10a5f0=a71_0x2424;return _0x6255ef===_0x10a5f0(0x1e0)?_0x10a5f0(0x1e3):_0x6255ef;}let env=normalizeEnv(process['env'][a71_0x31aefd(0x1e9)]||process['env'][a71_0x31aefd(0x1e4)]||a71_0x31aefd(0x1e3));function a71_0x203d(){const _0x1e673a=['RABETBASE_ENV','1127075aBYTpl','6510CFPJse','8793FTyNrP','742kfrRvA','online','113714hqZJoU','388eHxMne','production','LOVRABET_ENV','2454xSnQmd','1737xdLuWE','234512QBQMdZ','1085648LVjOVm'];a71_0x203d=function(){return _0x1e673a;};return a71_0x203d();}function a71_0x2424(_0x5eb7c8,_0x48adf9){_0x5eb7c8=_0x5eb7c8-0x1df;const _0x203dd0=a71_0x203d();let _0x2424ac=_0x203dd0[_0x5eb7c8];return _0x2424ac;}export function getEnv(){return env;}export function initEnv(_0x20feba){env=normalizeEnv(_0x20feba);}
package/lib/context.js CHANGED
@@ -1 +1 @@
1
- const a72_0x37cd5f=a72_0x27df;(function(_0x3bfa5b,_0x2cd195){const _0x2a5456=a72_0x27df,_0x3a2ab1=_0x3bfa5b();while(!![]){try{const _0x4e2d03=-parseInt(_0x2a5456(0x1b1))/0x1*(parseInt(_0x2a5456(0x1ac))/0x2)+parseInt(_0x2a5456(0x1ca))/0x3+parseInt(_0x2a5456(0x1cf))/0x4*(-parseInt(_0x2a5456(0x19b))/0x5)+parseInt(_0x2a5456(0x1ae))/0x6+parseInt(_0x2a5456(0x1bb))/0x7*(parseInt(_0x2a5456(0x1c3))/0x8)+parseInt(_0x2a5456(0x1a3))/0x9*(parseInt(_0x2a5456(0x1c4))/0xa)+-parseInt(_0x2a5456(0x1a7))/0xb;if(_0x4e2d03===_0x2cd195)break;else _0x3a2ab1['push'](_0x3a2ab1['shift']());}catch(_0x331b51){_0x3a2ab1['push'](_0x3a2ab1['shift']());}}}(a72_0x4110,0x7ca0a));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';function env(_0x394a24){const _0x2bb59f=a72_0x27df;return process[_0x2bb59f(0x1af)][_0x2bb59f(0x1c0)+_0x394a24]||process['env'][_0x2bb59f(0x1d7)+_0x394a24]||undefined;}export const NEW_CONFIG_NAME=a72_0x37cd5f(0x1d0);function a72_0x27df(_0x40201e,_0x30c629){_0x40201e=_0x40201e-0x194;const _0x411056=a72_0x4110();let _0x27dfae=_0x411056[_0x40201e];return _0x27dfae;}export const CONFIG_NAMES=[a72_0x37cd5f(0x1d0),a72_0x37cd5f(0x1c8),a72_0x37cd5f(0x1d2)];export function resolveConfigPath(_0x405ce0){for(const _0x2fd54b of CONFIG_NAMES){const _0x2c1ea1=resolve(_0x405ce0,_0x2fd54b);if(existsSync(_0x2c1ea1))return _0x2c1ea1;}return undefined;}export async function createContext(_0x4e9f56){const _0x4624de=a72_0x37cd5f,_0x241bf=readRawConfig(),_0x4ca239=buildConfig(_0x241bf,_0x4e9f56),{initEnv:_0x29f2d6}=await import(_0x4624de(0x1d1));if(_0x4ca239[_0x4624de(0x1af)])_0x29f2d6(_0x4ca239[_0x4624de(0x1af)]);else _0x4e9f56[_0x4624de(0x1af)]&&typeof _0x4e9f56[_0x4624de(0x1af)]===_0x4624de(0x1a2)&&_0x29f2d6(_0x4e9f56[_0x4624de(0x1af)]);const {getUserDomain:_0x36d0d7,getApiDomain:_0x3a4fbd}=await import('./constant/domain.js'),_0x14bf60={'apiDomain':_0x3a4fbd(),'userDomain':_0x36d0d7()},_0x31ceb9=await buildAuth(_0x4ca239);logger[_0x4624de(0x1a0)](process[_0x4624de(0x1b0)]());const _0x43ae3c=(CLI_BIN_NAME+'\x20'+process[_0x4624de(0x1cd)][_0x4624de(0x1d9)](0x2)[_0x4624de(0x1a5)]('\x20'))['trim']();logger[_0x4624de(0x19f)](_0x43ae3c);const _0x31c07f=isNonInteractiveMode(_0x4e9f56);return{'config':_0x4ca239,'auth':_0x31ceb9,'logger':logger,'env':_0x14bf60,'nonInteractive':_0x31c07f};}function a72_0x4110(){const _0x20c948=['app','15oPyZgj','ACCESS_KEY','length','.tmp','setRawCommand','setLogPath','daily','string','52641GgUnEW','table','join','setRawMode','9127569gHupBs','object','RISK_LEVEL','entries','stdout','549002UKmdHu','riskLevel','2529984HTjdtE','env','cwd','3aLCtHN','high-risk-write','true','maxRisk','read','APP','locale','json','apiDir','isRaw','2308222cGQGEn','stdin','utf8','production','COOKIE','RABETBASE_','VERBOSE','parse','24VfZKil','1660UenvcB','APPCODE','isTTY','keys','.lovrabet.json','accessKey','1822011HGAOOd','write','cookie','argv','pageSize','1100556AohKoK','.rabetbase.json','./constant/env.js','.lovrabetrc','FORMAT','./src/api','defaultApp','format','LOVRABET_','pretty','slice','trim','authRequired','project','PAGE_SIZE','apps','appcode'];a72_0x4110=function(){return _0x20c948;};return a72_0x4110();}export function buildConfigFromFlags(_0x54d331){return buildConfig(readRawConfig(),_0x54d331);}export function getProjectConfigPath(){const _0x646c9=a72_0x37cd5f;return resolveConfigPath(process[_0x646c9(0x1b0)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x28e2ac){const _0x520000=a72_0x37cd5f;let _0xe016a2={},_0x2ef18c={};try{const _0x3d023e=resolveConfigPath(homedir());if(_0x3d023e){const _0xa9e421=readFileSync(_0x3d023e,{'encoding':'utf8'});if(_0xa9e421)_0xe016a2=JSON[_0x520000(0x1c2)](_0xa9e421);}}catch{}try{const _0x5b54d0=_0x28e2ac||process[_0x520000(0x1b0)](),_0x426870=resolveConfigPath(_0x5b54d0);if(_0x426870){const _0x28567e=readFileSync(_0x426870,{'encoding':_0x520000(0x1bd)});if(_0x28567e)_0x2ef18c=JSON['parse'](_0x28567e);}}catch{}const _0x4228e3=_0xe016a2[_0x520000(0x198)]&&typeof _0xe016a2[_0x520000(0x198)]===_0x520000(0x1a8)?_0xe016a2[_0x520000(0x198)]:{},_0x2d3f27=_0x2ef18c[_0x520000(0x198)]&&typeof _0x2ef18c[_0x520000(0x198)]==='object'?_0x2ef18c[_0x520000(0x198)]:{},_0x246ff7={..._0x4228e3,..._0x2d3f27},_0x3b147b={..._0xe016a2,..._0x2ef18c};Object['keys'](_0x246ff7)[_0x520000(0x19d)]>0x0&&(_0x3b147b['apps']=_0x246ff7);if(_0x520000(0x1d5)in _0x2ef18c)_0x3b147b[_0x520000(0x1d5)]=_0x2ef18c[_0x520000(0x1d5)];else{if(_0x2d3f27&&Object[_0x520000(0x1c7)](_0x2d3f27)[_0x520000(0x19d)]>0x0)_0x3b147b['defaultApp']=Object[_0x520000(0x1c7)](_0x2d3f27)[0x0];else _0xe016a2[_0x520000(0x1d5)]&&(_0x3b147b[_0x520000(0x1d5)]=_0xe016a2['defaultApp']);}return _0x3b147b;}export function readConfigFile(_0x3082a5){const _0x4d4bbf=a72_0x37cd5f;try{if(existsSync(_0x3082a5)){const _0x5cfcfa=readFileSync(_0x3082a5,{'encoding':_0x4d4bbf(0x1bd)});if(_0x5cfcfa)return JSON[_0x4d4bbf(0x1c2)](_0x5cfcfa);}}catch{}return{};}export function writeConfigFile(_0x11c0b5,_0x5e45cc){const _0x1618e0=a72_0x37cd5f,_0x1716cd=dirname(_0x11c0b5);!existsSync(_0x1716cd)&&mkdirSync(_0x1716cd,{'recursive':!![]});const _0x203eec=_0x11c0b5+_0x1618e0(0x19e);try{writeFileSync(_0x203eec,JSON['stringify'](_0x5e45cc,null,0x2)+'\x0a',{'encoding':_0x1618e0(0x1bd),'mode':0x180}),renameSync(_0x203eec,_0x11c0b5);}catch(_0x48f89e){try{unlinkSync(_0x203eec);}catch{}throw _0x48f89e;}}export function resolveWriteConfigPath(_0xfa0f76){const _0x4eb026=a72_0x37cd5f,_0x746c0f=_0xfa0f76===_0x4eb026(0x196)?process[_0x4eb026(0x1b0)]():homedir(),_0x2ff9e1=resolveConfigPath(_0x746c0f);return _0x2ff9e1??resolve(_0x746c0f,NEW_CONFIG_NAME);}function buildConfig(_0x2af990,_0x3ff55d){const _0x23108f=a72_0x37cd5f,_0x18708b={};if(_0x2af990['apps']&&typeof _0x2af990[_0x23108f(0x198)]===_0x23108f(0x1a8))for(const [_0x2a3e77,_0x10bdb0]of Object[_0x23108f(0x1aa)](_0x2af990['apps'])){_0x10bdb0&&typeof _0x10bdb0===_0x23108f(0x1a8)&&_0x10bdb0[_0x23108f(0x199)]&&(_0x18708b[_0x2a3e77]=_0x10bdb0);}const _0x44ee55=_0x2af990[_0x23108f(0x1d5)]||undefined,_0x42ec79=Object[_0x23108f(0x1c7)](_0x18708b)[_0x23108f(0x19d)]>0x0,_0x42cb69=_0x3ff55d[_0x23108f(0x19a)]||env(_0x23108f(0x1b6))||undefined,_0x33caa3=_0x42cb69||_0x44ee55||undefined,_0x311008=_0x33caa3&&_0x18708b[_0x33caa3]?_0x18708b[_0x33caa3]:undefined,_0x486a0f=_0x3ff55d[_0x23108f(0x199)]||env(_0x23108f(0x1c5))||_0x311008?.[_0x23108f(0x199)]||_0x2af990['appcode']||_0x2af990[_0x23108f(0x19a)]||undefined,_0x58c45c=_0x3ff55d['env']||env('ENV')||_0x311008?.[_0x23108f(0x1af)]||_0x2af990[_0x23108f(0x1af)]||'production',_0x381510=_0x311008?.[_0x23108f(0x1b7)]||_0x2af990[_0x23108f(0x1b7)]||'en-US',_0x16ae1e=env(_0x23108f(0x1bf))||_0x311008?.[_0x23108f(0x1cc)]||_0x2af990['cookie']||undefined,_0x442423=env(_0x23108f(0x19c))||_0x311008?.[_0x23108f(0x1c9)]||_0x2af990[_0x23108f(0x1c9)]||undefined,_0x4119fd=_0x3ff55d['format']||env(_0x23108f(0x1d3))||_0x311008?.[_0x23108f(0x1d6)]||_0x2af990[_0x23108f(0x1d6)],_0x4fcc5b=_0x4119fd===_0x23108f(0x1b8)||_0x4119fd===_0x23108f(0x1d8)||_0x4119fd===_0x23108f(0x1a4)?_0x4119fd:undefined,_0x3fea71=env(_0x23108f(0x197))||_0x311008?.[_0x23108f(0x1ce)]||_0x2af990['pageSize'],_0x37e88c=_0x3fea71?Number(_0x3fea71)||undefined:undefined,_0x3a7be4=env(_0x23108f(0x1a9))||env('MAX_RISK')||_0x311008?.[_0x23108f(0x1ad)]||_0x2af990['riskLevel']||_0x2af990[_0x23108f(0x1b4)],_0x2d7d15=_0x3a7be4===_0x23108f(0x1b5)||_0x3a7be4===_0x23108f(0x1cb)?_0x3a7be4:_0x23108f(0x1b2),_0x5343c7=env(_0x23108f(0x1c1)),_0x45299f=_0x5343c7==='1'||_0x5343c7==='true',_0x3d77de=_0x311008?.[_0x23108f(0x1b9)]||_0x2af990[_0x23108f(0x1b9)]||_0x23108f(0x1d4);return{'appCode':typeof _0x486a0f===_0x23108f(0x1a2)&&_0x486a0f['trim']()?_0x486a0f[_0x23108f(0x194)]():undefined,'env':_0x58c45c==='online'?_0x23108f(0x1be):_0x58c45c==='daily'?_0x23108f(0x1a1):_0x23108f(0x1be),'locale':_0x381510,'cookie':_0x16ae1e,'accessKey':_0x442423,'format':_0x4fcc5b,'pageSize':_0x37e88c,'riskLevel':_0x2d7d15,'verbose':_0x45299f,'apiDir':_0x3d77de,'apps':_0x18708b,'defaultApp':_0x44ee55,'currentApp':_0x42ec79?_0x33caa3:undefined,'raw':_0x2af990};}async function buildAuth(_0x5894c3){const _0x1b9620=a72_0x37cd5f,{getCookie:_0xc43707}=await import('./auth/get-cookie.js'),_0x1d67fe=_0x5894c3[_0x1b9620(0x1cc)]||_0xc43707(),_0x46ed6f=_0x1d67fe?await getIsSessionValid():![];return{'cookie':_0x1d67fe,'isLoggedIn':_0x46ed6f,async 'getOrLogin'(){const _0xb3ba15=_0x1b9620;if(_0x1d67fe&&_0x46ed6f)return _0x1d67fe;throw CliErrors[_0xb3ba15(0x195)]();}};}function isNonInteractiveMode(_0xe38f32){const _0x537373=a72_0x37cd5f;return!!(_0xe38f32['nonInteractive']||_0xe38f32['ci']||env('CI')===_0x537373(0x1b3)||process[_0x537373(0x1af)]['CI']==='true'||!process[_0x537373(0x1ab)][_0x537373(0x1c6)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x205314=a72_0x37cd5f;if(!process['stdin'][_0x205314(0x1c6)])return![];try{const _0x1a7c0e=process['stdin'][_0x205314(0x1ba)];return process[_0x205314(0x1bc)]['setRawMode'](!![]),process['stdin'][_0x205314(0x1a6)](_0x1a7c0e??![]),!![];}catch{return![];}}
1
+ const a72_0x4144a1=a72_0x322c;(function(_0x1cff5f,_0x21597a){const _0xd70c98=a72_0x322c,_0x52ee6e=_0x1cff5f();while(!![]){try{const _0x1c2d05=parseInt(_0xd70c98(0xd9))/0x1*(parseInt(_0xd70c98(0xbf))/0x2)+parseInt(_0xd70c98(0xcd))/0x3*(parseInt(_0xd70c98(0xd1))/0x4)+-parseInt(_0xd70c98(0xc5))/0x5*(-parseInt(_0xd70c98(0xb8))/0x6)+-parseInt(_0xd70c98(0xbb))/0x7+-parseInt(_0xd70c98(0xbe))/0x8*(parseInt(_0xd70c98(0xd6))/0x9)+parseInt(_0xd70c98(0xd2))/0xa+-parseInt(_0xd70c98(0xd8))/0xb*(parseInt(_0xd70c98(0xcc))/0xc);if(_0x1c2d05===_0x21597a)break;else _0x52ee6e['push'](_0x52ee6e['shift']());}catch(_0xc72c94){_0x52ee6e['push'](_0x52ee6e['shift']());}}}(a72_0x3f58,0x66dc8));import{readFileSync,writeFileSync,existsSync,mkdirSync,renameSync,unlinkSync}from'node:fs';import{resolve,dirname}from'node:path';import{homedir}from'node:os';function a72_0x3f58(){const _0x195872=['67104Ckvyaz','3EykBPW','utf8','argv','online','1572492LtQQjz','5940020gLnQPd','format','daily','object','8469bchjzC','ENV','1738BxvJXs','302329gsmGgH','read','cwd','true','isTTY','appcode','setRawCommand','isRaw','PAGE_SIZE','apiDir','parse','string','.lovrabetrc','app','defaultApp','./constant/domain.js','riskLevel','VERBOSE','env','slice','FORMAT','maxRisk','stdout','json','APPCODE','setRawMode','ACCESS_KEY','cookie','accessKey','write','production','project','./constant/env.js','MAX_RISK','LOVRABET_','./src/api','1097142Yjgqsa','join','authRequired','5644289fbIlkQ','table','locale','248ZqeXYy','4HnYVTo','stdin','stringify','pageSize','en-US','length','15VnxCEW','high-risk-write','.lovrabet.json','apps','keys','.rabetbase.json','trim'];a72_0x3f58=function(){return _0x195872;};return a72_0x3f58();}import{logger}from'./utils/logger.js';import{getIsSessionValid}from'./auth/is-session-valid.js';import{CliErrors}from'./errors.js';import{CLI_BIN_NAME}from'./constant/cli.js';function env(_0x13df76){const _0xe324d8=a72_0x322c;return process[_0xe324d8(0xeb)]['RABETBASE_'+_0x13df76]||process[_0xe324d8(0xeb)][_0xe324d8(0xb6)+_0x13df76]||undefined;}export const NEW_CONFIG_NAME=a72_0x4144a1(0xca);export const CONFIG_NAMES=['.rabetbase.json',a72_0x4144a1(0xc7),a72_0x4144a1(0xe5)];export function resolveConfigPath(_0x31774a){for(const _0xae50e4 of CONFIG_NAMES){const _0x2e752e=resolve(_0x31774a,_0xae50e4);if(existsSync(_0x2e752e))return _0x2e752e;}return undefined;}export async function createContext(_0x1c00b9){const _0x259eba=a72_0x4144a1,_0x4c7205=readRawConfig(),_0x4f2781=buildConfig(_0x4c7205,_0x1c00b9),{initEnv:_0x1d2126}=await import(_0x259eba(0xb4));if(_0x4f2781[_0x259eba(0xeb)])_0x1d2126(_0x4f2781[_0x259eba(0xeb)]);else _0x1c00b9[_0x259eba(0xeb)]&&typeof _0x1c00b9['env']==='string'&&_0x1d2126(_0x1c00b9[_0x259eba(0xeb)]);const {getUserDomain:_0x2280e8,getApiDomain:_0x58da9a}=await import(_0x259eba(0xe8)),_0x284ae4={'apiDomain':_0x58da9a(),'userDomain':_0x2280e8()},_0x170fac=await buildAuth(_0x4f2781);logger['setLogPath'](process['cwd']());const _0x1389e8=(CLI_BIN_NAME+'\x20'+process[_0x259eba(0xcf)][_0x259eba(0xec)](0x2)[_0x259eba(0xb9)]('\x20'))[_0x259eba(0xcb)]();logger[_0x259eba(0xdf)](_0x1389e8);const _0x516605=isNonInteractiveMode(_0x1c00b9);return{'config':_0x4f2781,'auth':_0x170fac,'logger':logger,'env':_0x284ae4,'nonInteractive':_0x516605};}export function buildConfigFromFlags(_0x16b690){return buildConfig(readRawConfig(),_0x16b690);}export function getProjectConfigPath(){const _0x33c048=a72_0x4144a1;return resolveConfigPath(process[_0x33c048(0xdb)]());}export function getGlobalConfigPath(){return resolveConfigPath(homedir());}export function isInProject(){return!!getProjectConfigPath();}export function readRawConfig(_0x147d07){const _0x462887=a72_0x4144a1;let _0x263b00={},_0x4eaf12={};try{const _0x3789ce=resolveConfigPath(homedir());if(_0x3789ce){const _0x44784c=readFileSync(_0x3789ce,{'encoding':_0x462887(0xce)});if(_0x44784c)_0x263b00=JSON[_0x462887(0xe3)](_0x44784c);}}catch{}try{const _0x5a651d=_0x147d07||process[_0x462887(0xdb)](),_0x330139=resolveConfigPath(_0x5a651d);if(_0x330139){const _0x4f408d=readFileSync(_0x330139,{'encoding':_0x462887(0xce)});if(_0x4f408d)_0x4eaf12=JSON['parse'](_0x4f408d);}}catch{}const _0xe2bf7a=_0x263b00['apps']&&typeof _0x263b00['apps']==='object'?_0x263b00[_0x462887(0xc8)]:{},_0x51a713=_0x4eaf12['apps']&&typeof _0x4eaf12['apps']===_0x462887(0xd5)?_0x4eaf12[_0x462887(0xc8)]:{},_0x3118ef={..._0xe2bf7a,..._0x51a713},_0x3dd34a={..._0x263b00,..._0x4eaf12};Object[_0x462887(0xc9)](_0x3118ef)[_0x462887(0xc4)]>0x0&&(_0x3dd34a[_0x462887(0xc8)]=_0x3118ef);if(_0x462887(0xe7)in _0x4eaf12)_0x3dd34a[_0x462887(0xe7)]=_0x4eaf12[_0x462887(0xe7)];else{if(_0x51a713&&Object[_0x462887(0xc9)](_0x51a713)[_0x462887(0xc4)]>0x0)_0x3dd34a[_0x462887(0xe7)]=Object[_0x462887(0xc9)](_0x51a713)[0x0];else _0x263b00['defaultApp']&&(_0x3dd34a[_0x462887(0xe7)]=_0x263b00[_0x462887(0xe7)]);}return _0x3dd34a;}function a72_0x322c(_0x232bb1,_0x22c436){_0x232bb1=_0x232bb1-0xb2;const _0x3f58ef=a72_0x3f58();let _0x322ccb=_0x3f58ef[_0x232bb1];return _0x322ccb;}export function readConfigFile(_0x4168cb){const _0x9643ca=a72_0x4144a1;try{if(existsSync(_0x4168cb)){const _0x27daa3=readFileSync(_0x4168cb,{'encoding':_0x9643ca(0xce)});if(_0x27daa3)return JSON[_0x9643ca(0xe3)](_0x27daa3);}}catch{}return{};}export function writeConfigFile(_0x17b82a,_0x53add1){const _0x43431d=a72_0x4144a1,_0x2769ce=dirname(_0x17b82a);!existsSync(_0x2769ce)&&mkdirSync(_0x2769ce,{'recursive':!![]});const _0x12122b=_0x17b82a+'.tmp';try{writeFileSync(_0x12122b,JSON[_0x43431d(0xc1)](_0x53add1,null,0x2)+'\x0a',{'encoding':_0x43431d(0xce),'mode':0x180}),renameSync(_0x12122b,_0x17b82a);}catch(_0x291d6c){try{unlinkSync(_0x12122b);}catch{}throw _0x291d6c;}}export function resolveWriteConfigPath(_0x52fa33){const _0xe31ae4=a72_0x4144a1,_0x329315=_0x52fa33===_0xe31ae4(0xb3)?process[_0xe31ae4(0xdb)]():homedir(),_0x5ea440=resolveConfigPath(_0x329315);return _0x5ea440??resolve(_0x329315,NEW_CONFIG_NAME);}function buildConfig(_0x2e94c5,_0x2feb94){const _0x5704ca=a72_0x4144a1,_0x194666={};if(_0x2e94c5[_0x5704ca(0xc8)]&&typeof _0x2e94c5[_0x5704ca(0xc8)]===_0x5704ca(0xd5))for(const [_0x478d14,_0x40c49c]of Object['entries'](_0x2e94c5[_0x5704ca(0xc8)])){_0x40c49c&&typeof _0x40c49c===_0x5704ca(0xd5)&&_0x40c49c[_0x5704ca(0xde)]&&(_0x194666[_0x478d14]=_0x40c49c);}const _0x2eaf3e=_0x2e94c5[_0x5704ca(0xe7)]||undefined,_0x557725=Object[_0x5704ca(0xc9)](_0x194666)[_0x5704ca(0xc4)]>0x0,_0x273156=_0x2feb94[_0x5704ca(0xe6)]||env('APP')||undefined,_0x265a5f=_0x273156||_0x2eaf3e||undefined,_0x397954=_0x265a5f&&_0x194666[_0x265a5f]?_0x194666[_0x265a5f]:undefined,_0xa87e35=_0x2feb94[_0x5704ca(0xde)]||env(_0x5704ca(0xf1))||_0x397954?.['appcode']||_0x2e94c5['appcode']||_0x2e94c5[_0x5704ca(0xe6)]||undefined,_0xa9cfbb=_0x2feb94[_0x5704ca(0xeb)]||env(_0x5704ca(0xd7))||_0x397954?.[_0x5704ca(0xeb)]||_0x2e94c5[_0x5704ca(0xeb)]||_0x5704ca(0xb2),_0xfbb6fb=_0x397954?.[_0x5704ca(0xbd)]||_0x2e94c5[_0x5704ca(0xbd)]||_0x5704ca(0xc3),_0x21a13e=env('COOKIE')||_0x397954?.[_0x5704ca(0xf4)]||_0x2e94c5['cookie']||undefined,_0x5487ef=env(_0x5704ca(0xf3))||_0x397954?.['accessKey']||_0x2e94c5[_0x5704ca(0xf5)]||undefined,_0x14c023=_0x2feb94[_0x5704ca(0xd3)]||env(_0x5704ca(0xed))||_0x397954?.[_0x5704ca(0xd3)]||_0x2e94c5[_0x5704ca(0xd3)],_0x4eb9ad=_0x14c023===_0x5704ca(0xf0)||_0x14c023==='pretty'||_0x14c023===_0x5704ca(0xbc)?_0x14c023:undefined,_0x29b765=env(_0x5704ca(0xe1))||_0x397954?.[_0x5704ca(0xc2)]||_0x2e94c5[_0x5704ca(0xc2)],_0x518574=_0x29b765?Number(_0x29b765)||undefined:undefined,_0xffde98=env('RISK_LEVEL')||env(_0x5704ca(0xb5))||_0x397954?.[_0x5704ca(0xe9)]||_0x2e94c5[_0x5704ca(0xe9)]||_0x2e94c5[_0x5704ca(0xee)],_0x490581=_0xffde98===_0x5704ca(0xda)||_0xffde98===_0x5704ca(0xf6)?_0xffde98:_0x5704ca(0xc6),_0x1973c0=env(_0x5704ca(0xea)),_0x3126f2=_0x1973c0==='1'||_0x1973c0===_0x5704ca(0xdc),_0x1d78a1=_0x397954?.[_0x5704ca(0xe2)]||_0x2e94c5[_0x5704ca(0xe2)]||_0x5704ca(0xb7);return{'appCode':typeof _0xa87e35===_0x5704ca(0xe4)&&_0xa87e35[_0x5704ca(0xcb)]()?_0xa87e35[_0x5704ca(0xcb)]():undefined,'env':_0xa9cfbb===_0x5704ca(0xd0)?_0x5704ca(0xb2):_0xa9cfbb===_0x5704ca(0xd4)?_0x5704ca(0xd4):_0x5704ca(0xb2),'locale':_0xfbb6fb,'cookie':_0x21a13e,'accessKey':_0x5487ef,'format':_0x4eb9ad,'pageSize':_0x518574,'riskLevel':_0x490581,'verbose':_0x3126f2,'apiDir':_0x1d78a1,'apps':_0x194666,'defaultApp':_0x2eaf3e,'currentApp':_0x557725?_0x265a5f:undefined,'raw':_0x2e94c5};}async function buildAuth(_0xeeb411){const _0x2c6b3a=a72_0x4144a1,{getCookie:_0x5c5cca}=await import('./auth/get-cookie.js'),_0x10c3b9=_0xeeb411[_0x2c6b3a(0xf4)]||_0x5c5cca(),_0x49b2d3=_0x10c3b9?await getIsSessionValid():![];return{'cookie':_0x10c3b9,'isLoggedIn':_0x49b2d3,async 'getOrLogin'(){const _0x351dc2=_0x2c6b3a;if(_0x10c3b9&&_0x49b2d3)return _0x10c3b9;throw CliErrors[_0x351dc2(0xba)]();}};}function isNonInteractiveMode(_0x2e5051){const _0x1eb736=a72_0x4144a1;return!!(_0x2e5051['nonInteractive']||_0x2e5051['ci']||env('CI')===_0x1eb736(0xdc)||process[_0x1eb736(0xeb)]['CI']===_0x1eb736(0xdc)||!process[_0x1eb736(0xef)][_0x1eb736(0xdd)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x267592=a72_0x4144a1;if(!process[_0x267592(0xc0)][_0x267592(0xdd)])return![];try{const _0x424ef2=process[_0x267592(0xc0)][_0x267592(0xe0)];return process[_0x267592(0xc0)][_0x267592(0xf2)](!![]),process['stdin']['setRawMode'](_0x424ef2??![]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x3dab8c,_0x1f4102){const _0x2c40a5=a73_0x516d,_0x126eb1=_0x3dab8c();while(!![]){try{const _0x50fff6=parseInt(_0x2c40a5(0x113))/0x1+-parseInt(_0x2c40a5(0x114))/0x2*(-parseInt(_0x2c40a5(0x10e))/0x3)+parseInt(_0x2c40a5(0x112))/0x4+-parseInt(_0x2c40a5(0x10a))/0x5+parseInt(_0x2c40a5(0x110))/0x6*(-parseInt(_0x2c40a5(0x10f))/0x7)+parseInt(_0x2c40a5(0x109))/0x8*(parseInt(_0x2c40a5(0x10c))/0x9)+-parseInt(_0x2c40a5(0x116))/0xa;if(_0x50fff6===_0x1f4102)break;else _0x126eb1['push'](_0x126eb1['shift']());}catch(_0x1155de){_0x126eb1['push'](_0x126eb1['shift']());}}}(a73_0x48e5,0x8e259));function a73_0x516d(_0x2cd9e1,_0x203897){_0x2cd9e1=_0x2cd9e1-0x108;const _0x48e5d5=a73_0x48e5();let _0x516d3d=_0x48e5d5[_0x2cd9e1];return _0x516d3d;}import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';function a73_0x48e5(){const _0x26ab03=['826496jheSgz','80626jXboRU','get','9606720miwGeu','find','utf-8','2057680xgGSiF','1936245YfrNYu','datasetCode','9ojIjLL','set','21fHgaHT','105mJInXN','60618nmGOFw','push','2863208aLTuQm'];a73_0x48e5=function(){return _0x26ab03;};return a73_0x48e5();}const cache=new Map();function parseApiFile(_0xc38592){const _0x464a9b=a73_0x516d,_0x14586f=[],_0x22c0f3=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x5780ec;while((_0x5780ec=_0x22c0f3['exec'](_0xc38592))!==null){_0x14586f[_0x464a9b(0x111)]({'datasetCode':_0x5780ec[0x1],'tableName':_0x5780ec[0x2],'name':_0x5780ec[0x3],'alias':_0x5780ec[0x4]});}return _0x14586f;}export function loadAliasMap(_0x5978a6){const _0x258851=a73_0x516d,_0x2e911d=resolve(process['cwd'](),_0x5978a6);if(cache['has'](_0x2e911d))return cache[_0x258851(0x115)](_0x2e911d);const _0x4113c6=resolve(_0x2e911d,'api.ts');if(!existsSync(_0x4113c6))return cache[_0x258851(0x10d)](_0x2e911d,[]),[];try{const _0x197ffa=readFileSync(_0x4113c6,_0x258851(0x108)),_0x4387a8=parseApiFile(_0x197ffa);return cache['set'](_0x2e911d,_0x4387a8),_0x4387a8;}catch{return cache['set'](_0x2e911d,[]),[];}}export function resolveAlias(_0x5cc0bd,_0x13692e){const _0x313de9=a73_0x516d;if(!_0x13692e)return undefined;const _0x421e42=loadAliasMap(_0x5cc0bd),_0x2f7e1e=_0x421e42[_0x313de9(0x117)](_0x4f988e=>_0x4f988e['alias']===_0x13692e);return _0x2f7e1e?.[_0x313de9(0x10b)];}export function listAliases(_0x154893){return loadAliasMap(_0x154893);}
1
+ (function(_0x3a004f,_0x56aac2){const _0x29b135=a73_0x2c93,_0x592adf=_0x3a004f();while(!![]){try{const _0x4ca02d=parseInt(_0x29b135(0x17e))/0x1*(parseInt(_0x29b135(0x183))/0x2)+-parseInt(_0x29b135(0x17d))/0x3+parseInt(_0x29b135(0x184))/0x4*(parseInt(_0x29b135(0x180))/0x5)+parseInt(_0x29b135(0x177))/0x6*(parseInt(_0x29b135(0x18b))/0x7)+-parseInt(_0x29b135(0x178))/0x8+parseInt(_0x29b135(0x17a))/0x9+parseInt(_0x29b135(0x17f))/0xa*(parseInt(_0x29b135(0x188))/0xb);if(_0x4ca02d===_0x56aac2)break;else _0x592adf['push'](_0x592adf['shift']());}catch(_0x25c44e){_0x592adf['push'](_0x592adf['shift']());}}}(a73_0x32b4,0xe38e7));import{readFileSync,existsSync}from'node:fs';import{resolve}from'node:path';const cache=new Map();function a73_0x32b4(){const _0x56df36=['exec','api.ts','121XVFLAY','has','push','72793imAbXE','240TihQck','12560040MzpVoo','find','8628030utBSJx','datasetCode','get','3668334ewtQUO','8452JAWGGL','898010xbLjGt','25BAmiGU','set','cwd','308TUZxsw','48644nZrXFM','utf-8'];a73_0x32b4=function(){return _0x56df36;};return a73_0x32b4();}function parseApiFile(_0x45fe5d){const _0x1a6d9=a73_0x2c93,_0x245194=[],_0x163b43=/\{\s*datasetCode:\s*"([^"]+)"\s*,\s*tableName:\s*"([^"]+)"\s*,\s*name:\s*"([^"]*?)"\s*,\s*alias:\s*"([^"]+)"\s*,?\s*\}/g;let _0x4ac046;while((_0x4ac046=_0x163b43[_0x1a6d9(0x186)](_0x45fe5d))!==null){_0x245194[_0x1a6d9(0x18a)]({'datasetCode':_0x4ac046[0x1],'tableName':_0x4ac046[0x2],'name':_0x4ac046[0x3],'alias':_0x4ac046[0x4]});}return _0x245194;}export function loadAliasMap(_0x390c33){const _0x5e294b=a73_0x2c93,_0x104307=resolve(process[_0x5e294b(0x182)](),_0x390c33);if(cache[_0x5e294b(0x189)](_0x104307))return cache[_0x5e294b(0x17c)](_0x104307);const _0x17dd70=resolve(_0x104307,_0x5e294b(0x187));if(!existsSync(_0x17dd70))return cache[_0x5e294b(0x181)](_0x104307,[]),[];try{const _0x8eff94=readFileSync(_0x17dd70,_0x5e294b(0x185)),_0x344ee7=parseApiFile(_0x8eff94);return cache[_0x5e294b(0x181)](_0x104307,_0x344ee7),_0x344ee7;}catch{return cache[_0x5e294b(0x181)](_0x104307,[]),[];}}function a73_0x2c93(_0x3ef383,_0x1d2ecc){_0x3ef383=_0x3ef383-0x177;const _0x32b464=a73_0x32b4();let _0x2c93b6=_0x32b464[_0x3ef383];return _0x2c93b6;}export function resolveAlias(_0x3177ff,_0x1ec59a){const _0x3fc8e1=a73_0x2c93;if(!_0x1ec59a)return undefined;const _0x7eb9d2=loadAliasMap(_0x3177ff),_0x1f6d03=_0x7eb9d2[_0x3fc8e1(0x179)](_0x5d56f1=>_0x5d56f1['alias']===_0x1ec59a);return _0x1f6d03?.[_0x3fc8e1(0x17b)];}export function listAliases(_0x4d5427){return loadAliasMap(_0x4d5427);}
@@ -1 +1 @@
1
- (function(_0x40723e,_0x584bd3){const _0x42fe63=a74_0x45a6,_0x2ded44=_0x40723e();while(!![]){try{const _0x2f2d4f=-parseInt(_0x42fe63(0x1a6))/0x1*(-parseInt(_0x42fe63(0x19f))/0x2)+-parseInt(_0x42fe63(0x177))/0x3*(parseInt(_0x42fe63(0x1ab))/0x4)+-parseInt(_0x42fe63(0x1a1))/0x5+parseInt(_0x42fe63(0x163))/0x6+-parseInt(_0x42fe63(0x1af))/0x7+parseInt(_0x42fe63(0x1aa))/0x8+-parseInt(_0x42fe63(0x1b6))/0x9;if(_0x2f2d4f===_0x584bd3)break;else _0x2ded44['push'](_0x2ded44['shift']());}catch(_0x5e989d){_0x2ded44['push'](_0x2ded44['shift']());}}}(a74_0x55c1,0x40443));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';function a74_0x55c1(){const _0x4f687f=['\x20\x20currentPage:\x201,','code','responseFields','method','object','.remove(id);','message','description','/smartapi/custom/queryUserCustomSqlList','/api/management/library/scripts/statistics?appCode=','/api/node-toolbox/sql/save','operationName','489994qhyYSZ','table','1131410ywNpXQ','SQL\x20query\x20not\x20found:\x20','//\x20','filter','replace','2tAlVHW','join','tableData','apiError','2765824IxYzLs','737388PKUWKI','dbtableConfig','POST','cli:rabetbase','1490972DJvPrZ','sqlName','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});','\x20\x20\x20\x20sqlCode:\x20\x27','currentPage','//\x20SQL:\x20','name','3646899BNvJBW','json','BFF\x20script\x20not\x20found:\x20id=','find','\x20\x20pageSize:\x2020,','remove','errorCode','});','\x20\x20sqlCode:\x20\x27','target','\x20\x20where:\x20{},','sqlCode','const\x20data\x20=\x20await\x20client.sql.execute({','Operation\x20\x22','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','/smartapi/question/er-config','/smartapi/dataset/get-dataset-list','type','includes','includeImports','data','2738094ywvxpj','\x20\x20});','push','requestFields','scriptName','Dataset\x20not\x20found:\x20','API\x20error\x20code:\x20','signal','functionName','/smartapi/dataset/get-dataset-operation','modelId','test','&type=','status','GET','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','add','(/*\x20params\x20*/);','const\x20results\x20=\x20data.execResult\x20||\x20[];','isArray','3kjxuSZ','const\x20result\x20=\x20await\x20client.models.','/api/management/library/scripts/save','validation','API\x20error:\x20','.create({\x20/*\x20fields\x20*/\x20});','success','path','map','tableName','pageSize','Request\x20timeout:\x20','enabled','\x22\x20not\x20found\x20in\x20dataset\x20','errorMsg','\x20\x20return\x20rows;','displayName','operations','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','sdk','toLowerCase','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','/api/management/library/scripts/list?appCode=','modelCode','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','AbortError','create','/api/management/library/scripts/delete'];a74_0x55c1=function(){return _0x4f687f;};return a74_0x55c1();}import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';function a74_0x45a6(_0x232327,_0x2527b8){_0x232327=_0x232327-0x156;const _0x55c1a3=a74_0x55c1();let _0x45a6fc=_0x55c1a3[_0x232327];return _0x45a6fc;}let _activeCookie;export function setActiveCookie(_0x126c39){_activeCookie=_0x126c39||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x14d7ca,_0x58751d={}){const _0x50ce12=a74_0x45a6,{method:method=_0x50ce12(0x171),body:_0x142060,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x58751d,_0x3fa71b=useRuntime?getRuntimeDomain():getApiDomain(),_0x17e2cb=_activeCookie||getCookie(),_0x577a1f=''+_0x3fa71b+_0x14d7ca,_0x36b99f=new AbortController(),_0x1787a7=setTimeout(()=>_0x36b99f['abort'](),timeout);try{const _0x4baf0b=await fetch(_0x577a1f,{'method':method,'headers':{'Content-Type':'application/json','Cookie':_0x17e2cb,'X-Invoke-Source':_0x50ce12(0x1ae),...headers},'body':_0x142060?JSON['stringify'](_0x142060):undefined,'signal':_0x36b99f[_0x50ce12(0x16a)]});let _0x2bd8b0;try{_0x2bd8b0=await _0x4baf0b[_0x50ce12(0x1b7)]();}catch{throw CliErrors[_0x50ce12(0x1a9)]('API\x20returned\x20non-JSON\x20response\x20(HTTP\x20'+_0x4baf0b[_0x50ce12(0x170)]+')',_0x4baf0b[_0x50ce12(0x170)]>=0x190?'Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.':undefined);}if(!_0x4baf0b['ok']||_0x2bd8b0[_0x50ce12(0x17d)]===![])throw CliErrors['apiError'](_0x2bd8b0[_0x50ce12(0x185)]||_0x2bd8b0[_0x50ce12(0x199)]||_0x50ce12(0x17b)+_0x4baf0b[_0x50ce12(0x170)],_0x2bd8b0[_0x50ce12(0x1bc)]?_0x50ce12(0x169)+_0x2bd8b0['errorCode']:undefined);return _0x2bd8b0;}catch(_0x3eb9cd){if(_0x3eb9cd instanceof Error&&_0x3eb9cd[_0x50ce12(0x1b5)]===_0x50ce12(0x190))throw CliErrors['apiError'](_0x50ce12(0x182)+_0x577a1f);throw _0x3eb9cd;}finally{clearTimeout(_0x1787a7);}}export async function listBffScripts(_0x243621,_0x38e157,_0x369c6d){const _0x35b294=a74_0x45a6;let _0x335d31=_0x35b294(0x18d)+_0x243621;if(_0x38e157)_0x335d31+=_0x35b294(0x16f)+_0x38e157;const _0x3b2f81=await apiRequest(_0x335d31);let _0xad141d=extractList(_0x3b2f81[_0x35b294(0x162)]);if(_0x369c6d?.[_0x35b294(0x167)]){const _0xa16bc7=_0x369c6d[_0x35b294(0x167)]['toLowerCase']();_0xad141d=_0xad141d[_0x35b294(0x1a4)](_0x2febe1=>_0x2febe1[_0x35b294(0x16b)]?.[_0x35b294(0x18b)]()[_0x35b294(0x160)](_0xa16bc7)||_0x2febe1['description']?.[_0x35b294(0x18b)]()[_0x35b294(0x160)](_0xa16bc7));}return _0xad141d;}export async function getBffScriptInfo(_0x13d8a3){const _0x38f789=a74_0x45a6,_0xeedff9=await apiRequest('/api/management/library/scripts/info?id='+_0x13d8a3);if(!_0xeedff9['data'])throw CliErrors[_0x38f789(0x17a)](_0x38f789(0x1b8)+_0x13d8a3);return _0xeedff9[_0x38f789(0x162)];}export async function saveBffScript(_0x788da6){const _0x37fb83=a74_0x45a6,_0x5164b0=await apiRequest(_0x37fb83(0x179),{'method':_0x37fb83(0x1ad),'body':_0x788da6});return _0x5164b0['data'];}export async function deleteBffScript(_0x278a3c){const _0x528270=a74_0x45a6;await apiRequest(_0x528270(0x192),{'method':_0x528270(0x1ad),'body':{'id':_0x278a3c}});}export async function getBffScriptStatistics(_0xee7648){const _0x2daaba=a74_0x45a6,_0x1e4f42=await apiRequest(_0x2daaba(0x19c)+_0xee7648);return extractList(_0x1e4f42[_0x2daaba(0x162)]);}export async function listBffDatasetOperations(_0x1c4174,_0x488ee9){const _0x331c1b=a74_0x45a6,_0x3acc41=await apiRequest(_0x331c1b(0x16c),{'method':'POST','body':{'appCode':_0x1c4174,'datasetId':_0x488ee9}});return _0x3acc41[_0x331c1b(0x162)];}export async function listSqlQueries(_0x182b67,_0x4cca0d){const _0x38401c=a74_0x45a6,_0x20e81f=await apiRequest(_0x38401c(0x19b),{'method':_0x38401c(0x1ad),'body':{'appCode':_0x182b67,'currentPage':_0x4cca0d?.[_0x38401c(0x1b3)]??0x1,'pageSize':_0x4cca0d?.[_0x38401c(0x181)]??0x32,'sqlCode':_0x4cca0d?.['sqlCode'],'sqlName':_0x4cca0d?.[_0x38401c(0x1b0)]}});return _0x20e81f['data'];}export async function getSqlQueryInfo(_0x171ef4,_0x230742){const _0x5c38ec=a74_0x45a6,_0x3e734b=await listSqlQueries(_0x171ef4,{'sqlCode':_0x230742}),_0x4cc16b=_0x3e734b[_0x5c38ec(0x1a8)]?.[0x0];if(!_0x4cc16b)throw CliErrors[_0x5c38ec(0x17a)](_0x5c38ec(0x1a2)+_0x230742);return _0x4cc16b;}export async function saveSqlQuery(_0x591ee9){const _0xcd25f1=a74_0x45a6,_0x57f5af=await apiRequest(_0xcd25f1(0x19d),{'method':_0xcd25f1(0x1ad),'body':_0x591ee9});return _0x57f5af[_0xcd25f1(0x162)];}export async function executeSql(_0xe1732c,_0x4bfe47,_0x111a02){const _0x385044=a74_0x45a6,_0xc6ba86=await apiRequest('/api/custom/executeSql',{'method':_0x385044(0x1ad),'body':{'appCode':_0xe1732c,'sqlCode':_0x4bfe47,..._0x111a02&&{'params':_0x111a02}},'useRuntime':!![]});return _0xc6ba86[_0x385044(0x162)];}export async function listDatasets(_0x558a45,_0x4b5494){const _0x307711=a74_0x45a6,_0x388a30={'appCode':_0x558a45,'deleted':![]};if(_0x4b5494?.[_0x307711(0x194)])_0x388a30[_0x307711(0x194)]=_0x4b5494['code'];if(_0x4b5494?.[_0x307711(0x1b5)])_0x388a30[_0x307711(0x1b5)]=_0x4b5494['name'];const _0x3386e0=await apiRequest(_0x307711(0x15e),{'method':_0x307711(0x1ad),'body':_0x388a30});return extractList(_0x3386e0[_0x307711(0x162)]);}export async function searchDatasets(_0x9ffed6,_0x27574b){const _0x55d76f=a74_0x45a6,_0x4d2087=await listDatasets(_0x9ffed6,{'name':_0x27574b}),_0x8b1577=_0x27574b[_0x55d76f(0x18b)](),_0x1e198d=new Set(_0x4d2087['map'](_0x5c9408=>_0x5c9408['id'])),_0x2db348=_0x4d2087[_0x55d76f(0x1a4)](_0x209e06=>_0x209e06[_0x55d76f(0x1ac)]?.['tableName']?.[_0x55d76f(0x18b)]()['includes'](_0x8b1577)||_0x209e06[_0x55d76f(0x19a)]?.['toLowerCase']()[_0x55d76f(0x160)](_0x8b1577)),_0x1986ec=await listDatasets(_0x9ffed6,{'code':_0x27574b});for(const _0x54c156 of _0x1986ec){!_0x1e198d['has'](_0x54c156['id'])&&(_0x4d2087[_0x55d76f(0x165)](_0x54c156),_0x1e198d[_0x55d76f(0x173)](_0x54c156['id']));}return _0x4d2087;}export function normalizeDatasetOperations(_0x26b065){const _0x27c71e=a74_0x45a6;if(Array[_0x27c71e(0x176)](_0x26b065))return _0x26b065[_0x27c71e(0x1a4)](_0xe133a6=>_0xe133a6!=null&&typeof _0xe133a6==='object');if(_0x26b065&&typeof _0x26b065===_0x27c71e(0x197))return Object['entries'](_0x26b065)[_0x27c71e(0x1a4)](([,_0x42cf0a])=>_0x42cf0a!=null&&typeof _0x42cf0a===_0x27c71e(0x197))[_0x27c71e(0x17f)](([_0x366cdf,_0x3500c0])=>({..._0x3500c0,'name':_0x3500c0[_0x27c71e(0x1b5)]??_0x3500c0['operationName']??_0x366cdf}));return[];}export async function getDatasetDetail(_0x1cf33f){const _0xa61a96=a74_0x45a6,_0x5549ab=/^\d+$/[_0xa61a96(0x16e)](_0x1cf33f)?'id':_0xa61a96(0x194),_0x5cff57=await apiRequest('/smartapi/dataset/get-driven-data?'+_0x5549ab+'='+_0x1cf33f);return _0x5cff57[_0xa61a96(0x162)];}export async function getDatasetOperations(_0x5d1f1b){const _0xd5dbc1=a74_0x45a6,_0x5e64c6=await getDatasetDetail(_0x5d1f1b),_0xa0958c=normalizeDatasetOperations(_0x5e64c6[_0xd5dbc1(0x188)])[_0xd5dbc1(0x17f)](_0x4ac0d0=>({'name':_0x4ac0d0['name']||_0x4ac0d0['operationName'],'displayName':_0x4ac0d0[_0xd5dbc1(0x187)]||_0x4ac0d0['name'],'type':_0x4ac0d0[_0xd5dbc1(0x15f)],'method':_0x4ac0d0[_0xd5dbc1(0x196)],'path':_0x4ac0d0[_0xd5dbc1(0x17e)],'enabled':_0x4ac0d0[_0xd5dbc1(0x183)]??!![],'requestFields':_0x4ac0d0[_0xd5dbc1(0x166)],'responseFields':_0x4ac0d0[_0xd5dbc1(0x195)]}));return{'dataset':{'id':_0x5e64c6['id']??_0x5e64c6[_0xd5dbc1(0x16d)],'name':_0x5e64c6[_0xd5dbc1(0x1b5)],'code':_0x5e64c6[_0xd5dbc1(0x194)]||_0x5e64c6['modelCode'],'tableName':_0x5e64c6[_0xd5dbc1(0x180)]||_0x5e64c6[_0xd5dbc1(0x1ac)]?.[_0xd5dbc1(0x180)]},'operations':_0xa0958c};}export async function getOperationDetail(_0x5f4ae0,_0x15fd2b,_0x1459ce){const _0x46d9e3=a74_0x45a6;let _0x38bd4a=_0x15fd2b;if(!/^\d+$/[_0x46d9e3(0x16e)](_0x15fd2b)){const _0x282e83=await listDatasets(_0x5f4ae0,{'code':_0x15fd2b}),_0x1c07b0=_0x282e83[_0x46d9e3(0x1b9)](_0x266964=>_0x266964[_0x46d9e3(0x194)]===_0x15fd2b||String(_0x266964['id'])===_0x15fd2b);if(!_0x1c07b0)throw CliErrors[_0x46d9e3(0x17a)](_0x46d9e3(0x168)+_0x15fd2b);_0x38bd4a=String(_0x1c07b0['id']);}const _0x5560db=await getDatasetDetail(_0x38bd4a),_0x29d779=normalizeDatasetOperations(_0x5560db[_0x46d9e3(0x188)])[_0x46d9e3(0x1b9)](_0x38cc38=>(_0x38cc38['name']||_0x38cc38[_0x46d9e3(0x19e)])===_0x1459ce);if(!_0x29d779)throw CliErrors[_0x46d9e3(0x17a)](_0x46d9e3(0x15b)+_0x1459ce+_0x46d9e3(0x184)+_0x15fd2b);return{'dataset':{'id':_0x5560db['id']??_0x5560db[_0x46d9e3(0x16d)],'name':_0x5560db[_0x46d9e3(0x1b5)],'code':_0x5560db['code']||_0x5560db[_0x46d9e3(0x18e)],'tableName':_0x5560db[_0x46d9e3(0x180)]||_0x5560db['dbtableConfig']?.[_0x46d9e3(0x180)]},'operation':_0x29d779};}export function generateSdkCode(_0x37cead,_0x546f03,_0x32a72a){const _0x2fc6ab=a74_0x45a6,_0x559fc1=_0x32a72a?.[_0x2fc6ab(0x161)]??!![],_0x30b4a0='dataset_'+_0x37cead['code']?.[_0x2fc6ab(0x1a5)](/-/g,'_'),_0x4af7ec=_0x546f03[_0x2fc6ab(0x1b5)]||_0x546f03['operationName']||_0x2fc6ab(0x1a4),_0x361f22=[];_0x559fc1&&_0x361f22['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x2fc6ab(0x1b1),'');_0x361f22[_0x2fc6ab(0x165)](_0x2fc6ab(0x1a3)+_0x37cead[_0x2fc6ab(0x1b5)]+'\x20('+(_0x37cead[_0x2fc6ab(0x180)]||_0x2fc6ab(0x1a0))+')');if(_0x4af7ec==='filter')_0x361f22[_0x2fc6ab(0x165)](_0x2fc6ab(0x178)+_0x30b4a0+'.filter({',_0x2fc6ab(0x158),_0x2fc6ab(0x1ba),_0x2fc6ab(0x193),'});');else{if(_0x4af7ec==='getOne')_0x361f22[_0x2fc6ab(0x165)](_0x2fc6ab(0x178)+_0x30b4a0+'.getOne(id);');else{if(_0x4af7ec===_0x2fc6ab(0x191))_0x361f22['push']('const\x20result\x20=\x20await\x20client.models.'+_0x30b4a0+_0x2fc6ab(0x17c));else{if(_0x4af7ec==='update')_0x361f22[_0x2fc6ab(0x165)](_0x2fc6ab(0x178)+_0x30b4a0+_0x2fc6ab(0x18f));else _0x4af7ec==='delete'||_0x4af7ec===_0x2fc6ab(0x1bb)?_0x361f22[_0x2fc6ab(0x165)](_0x2fc6ab(0x178)+_0x30b4a0+_0x2fc6ab(0x198)):_0x361f22['push']('const\x20result\x20=\x20await\x20client.models.'+_0x30b4a0+'.'+_0x4af7ec+_0x2fc6ab(0x174));}}}return _0x361f22[_0x2fc6ab(0x1a7)]('\x0a');}export function generateSqlCodeTemplate(_0x124d7f,_0x363e88){const _0x3b7679=a74_0x45a6,_0x4e3037=_0x363e88?.[_0x3b7679(0x157)]??_0x3b7679(0x18a),_0x53447d=_0x363e88?.[_0x3b7679(0x161)]??!![],_0xca16e4=[];return _0xca16e4['push'](_0x3b7679(0x1b4)+_0x124d7f[_0x3b7679(0x1b0)]+'\x20('+_0x124d7f[_0x3b7679(0x159)]+')'),_0x4e3037===_0x3b7679(0x18a)?(_0x53447d&&_0xca16e4['push'](_0x3b7679(0x189),'',_0x3b7679(0x1b1),''),_0xca16e4['push'](_0x3b7679(0x15a),_0x3b7679(0x156)+_0x124d7f[_0x3b7679(0x159)]+'\x27,','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},',_0x3b7679(0x1bd),_0x3b7679(0x172),_0x3b7679(0x175))):_0xca16e4[_0x3b7679(0x165)]('//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{',_0x3b7679(0x15c),_0x3b7679(0x1b2)+_0x124d7f[_0x3b7679(0x159)]+'\x27,',_0x3b7679(0x18c),_0x3b7679(0x164),_0x3b7679(0x186),'}'),_0xca16e4[_0x3b7679(0x1a7)]('\x0a');}export async function getErConfig(_0x46c6d7,_0xe03b00){const _0x54abba=a74_0x45a6,_0x501b6b=await apiRequest(_0x54abba(0x15d),{'method':_0x54abba(0x1ad),'body':{'appCode':_0x46c6d7,'dblinkId':_0xe03b00}});return _0x501b6b[_0x54abba(0x162)];}
1
+ (function(_0x2d4245,_0x52127a){const _0x4c9cc5=a74_0x2e0d,_0x519f6a=_0x2d4245();while(!![]){try{const _0x1d403a=-parseInt(_0x4c9cc5(0x176))/0x1*(parseInt(_0x4c9cc5(0x139))/0x2)+parseInt(_0x4c9cc5(0x18c))/0x3*(-parseInt(_0x4c9cc5(0x153))/0x4)+parseInt(_0x4c9cc5(0x13c))/0x5*(parseInt(_0x4c9cc5(0x199))/0x6)+-parseInt(_0x4c9cc5(0x177))/0x7*(parseInt(_0x4c9cc5(0x183))/0x8)+parseInt(_0x4c9cc5(0x194))/0x9*(-parseInt(_0x4c9cc5(0x193))/0xa)+parseInt(_0x4c9cc5(0x197))/0xb*(parseInt(_0x4c9cc5(0x173))/0xc)+parseInt(_0x4c9cc5(0x147))/0xd*(parseInt(_0x4c9cc5(0x195))/0xe);if(_0x1d403a===_0x52127a)break;else _0x519f6a['push'](_0x519f6a['shift']());}catch(_0x4998e2){_0x519f6a['push'](_0x519f6a['shift']());}}}(a74_0x50a0,0xe169d));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain,getRuntimeDomain}from'../constant/domain.js';import{CliErrors}from'../errors.js';import{extractList}from'../framework/response.js';let _activeCookie;export function setActiveCookie(_0x4cc756){_activeCookie=_0x4cc756||undefined;}export function clearActiveCookie(){_activeCookie=undefined;}async function apiRequest(_0x294c80,_0x2df5d0={}){const _0x2113e7=a74_0x2e0d,{method:method=_0x2113e7(0x159),body:_0x6fac56,headers:headers={},timeout:timeout=0x7530,useRuntime:useRuntime=![]}=_0x2df5d0,_0x1e2056=useRuntime?getRuntimeDomain():getApiDomain(),_0x3dfc66=_activeCookie||getCookie(),_0x5695f3=''+_0x1e2056+_0x294c80,_0x4dc89e=new AbortController(),_0x37fb58=setTimeout(()=>_0x4dc89e[_0x2113e7(0x15b)](),timeout);try{const _0x1cce88=await fetch(_0x5695f3,{'method':method,'headers':{'Content-Type':_0x2113e7(0x13e),'Cookie':_0x3dfc66,'X-Invoke-Source':_0x2113e7(0x17b),...headers},'body':_0x6fac56?JSON[_0x2113e7(0x16c)](_0x6fac56):undefined,'signal':_0x4dc89e[_0x2113e7(0x19b)]});let _0x148b64;try{_0x148b64=await _0x1cce88[_0x2113e7(0x174)]();}catch{throw CliErrors[_0x2113e7(0x148)](_0x2113e7(0x18f)+_0x1cce88[_0x2113e7(0x156)]+')',_0x1cce88[_0x2113e7(0x156)]>=0x190?_0x2113e7(0x15a):undefined);}if(!_0x1cce88['ok']||_0x148b64[_0x2113e7(0x136)]===![])throw CliErrors[_0x2113e7(0x148)](_0x148b64[_0x2113e7(0x16a)]||_0x148b64['message']||_0x2113e7(0x185)+_0x1cce88[_0x2113e7(0x156)],_0x148b64['errorCode']?_0x2113e7(0x140)+_0x148b64[_0x2113e7(0x17c)]:undefined);return _0x148b64;}catch(_0x2db261){if(_0x2db261 instanceof Error&&_0x2db261[_0x2113e7(0x15c)]===_0x2113e7(0x162))throw CliErrors['apiError'](_0x2113e7(0x14d)+_0x5695f3);throw _0x2db261;}finally{clearTimeout(_0x37fb58);}}export async function listBffScripts(_0x52c273,_0x57a4fe,_0x1a0f84){const _0x25808f=a74_0x2e0d;let _0xd0895b=_0x25808f(0x16e)+_0x52c273;if(_0x57a4fe)_0xd0895b+='&type='+_0x57a4fe;const _0x4b944e=await apiRequest(_0xd0895b);let _0x2d3f36=extractList(_0x4b944e[_0x25808f(0x141)]);if(_0x1a0f84?.[_0x25808f(0x14f)]){const _0xf7ea7a=_0x1a0f84[_0x25808f(0x14f)][_0x25808f(0x17a)]();_0x2d3f36=_0x2d3f36[_0x25808f(0x166)](_0x191b03=>_0x191b03[_0x25808f(0x134)]?.[_0x25808f(0x17a)]()[_0x25808f(0x160)](_0xf7ea7a)||_0x191b03[_0x25808f(0x186)]?.['toLowerCase']()[_0x25808f(0x160)](_0xf7ea7a));}return _0x2d3f36;}function a74_0x2e0d(_0x54a405,_0x28b63d){_0x54a405=_0x54a405-0x132;const _0x50a0e0=a74_0x50a0();let _0x2e0d6e=_0x50a0e0[_0x54a405];return _0x2e0d6e;}export async function getBffScriptInfo(_0x5643ea){const _0x5aa96c=a74_0x2e0d,_0x17e4f6=await apiRequest('/api/management/library/scripts/info?id='+_0x5643ea);if(!_0x17e4f6['data'])throw CliErrors[_0x5aa96c(0x18e)](_0x5aa96c(0x150)+_0x5643ea);return _0x17e4f6['data'];}export async function saveBffScript(_0x44899d){const _0x2ff2bd=a74_0x2e0d,_0x28d6b9=await apiRequest('/api/management/library/scripts/save',{'method':_0x2ff2bd(0x198),'body':_0x44899d});return _0x28d6b9[_0x2ff2bd(0x141)];}export async function deleteBffScript(_0x4c5431){const _0x17c568=a74_0x2e0d;await apiRequest(_0x17c568(0x155),{'method':_0x17c568(0x198),'body':{'id':_0x4c5431}});}export async function getBffScriptStatistics(_0x377845){const _0x5774fb=a74_0x2e0d,_0x400d85=await apiRequest('/api/management/library/scripts/statistics?appCode='+_0x377845);return extractList(_0x400d85[_0x5774fb(0x141)]);}export async function listBffDatasetOperations(_0x96fb81,_0x2a99da){const _0x59ca2d=a74_0x2e0d,_0x56f3ee=await apiRequest('/smartapi/dataset/get-dataset-operation',{'method':_0x59ca2d(0x198),'body':{'appCode':_0x96fb81,'datasetId':_0x2a99da}});return _0x56f3ee[_0x59ca2d(0x141)];}export async function listSqlQueries(_0x594278,_0x585e20){const _0xe08a2b=a74_0x2e0d,_0x9479e4=await apiRequest('/smartapi/custom/queryUserCustomSqlList',{'method':_0xe08a2b(0x198),'body':{'appCode':_0x594278,'currentPage':_0x585e20?.[_0xe08a2b(0x16b)]??0x1,'pageSize':_0x585e20?.[_0xe08a2b(0x17f)]??0x32,'sqlCode':_0x585e20?.[_0xe08a2b(0x18d)],'sqlName':_0x585e20?.[_0xe08a2b(0x18a)]}});return _0x9479e4[_0xe08a2b(0x141)];}export async function getSqlQueryInfo(_0x294149,_0x52eb44){const _0x3bb6c2=await listSqlQueries(_0x294149,{'sqlCode':_0x52eb44}),_0x4c146f=_0x3bb6c2['tableData']?.[0x0];if(!_0x4c146f)throw CliErrors['validation']('SQL\x20query\x20not\x20found:\x20'+_0x52eb44);return _0x4c146f;}export async function saveSqlQuery(_0x1b7c19){const _0x1fc982=a74_0x2e0d,_0x3c521a=await apiRequest(_0x1fc982(0x187),{'method':_0x1fc982(0x198),'body':_0x1b7c19});return _0x3c521a[_0x1fc982(0x141)];}export async function executeSql(_0x5df433,_0x1c6cfc,_0x4b7fdc){const _0x37e324=a74_0x2e0d,_0x11fdd6=await apiRequest(_0x37e324(0x152),{'method':_0x37e324(0x198),'body':{'appCode':_0x5df433,'sqlCode':_0x1c6cfc,..._0x4b7fdc&&{'params':_0x4b7fdc}},'useRuntime':!![]});return _0x11fdd6[_0x37e324(0x141)];}export async function listDatasets(_0x39f469,_0x191782){const _0x25b533=a74_0x2e0d,_0x73ebbe={'appCode':_0x39f469,'deleted':![]};if(_0x191782?.[_0x25b533(0x182)])_0x73ebbe[_0x25b533(0x182)]=_0x191782[_0x25b533(0x182)];if(_0x191782?.[_0x25b533(0x15c)])_0x73ebbe[_0x25b533(0x15c)]=_0x191782[_0x25b533(0x15c)];const _0x2fcb7a=await apiRequest(_0x25b533(0x149),{'method':_0x25b533(0x198),'body':_0x73ebbe});return extractList(_0x2fcb7a['data']);}export async function searchDatasets(_0x525556,_0x474892){const _0x1cef74=a74_0x2e0d,_0xf25e63=await listDatasets(_0x525556,{'name':_0x474892}),_0x46c729=_0x474892[_0x1cef74(0x17a)](),_0x5b639a=new Set(_0xf25e63['map'](_0x1c6e0b=>_0x1c6e0b['id'])),_0x2eafb1=_0xf25e63[_0x1cef74(0x166)](_0x4d15bb=>_0x4d15bb[_0x1cef74(0x13b)]?.[_0x1cef74(0x169)]?.[_0x1cef74(0x17a)]()['includes'](_0x46c729)||_0x4d15bb[_0x1cef74(0x186)]?.[_0x1cef74(0x17a)]()['includes'](_0x46c729)),_0x1a7f1d=await listDatasets(_0x525556,{'code':_0x474892});for(const _0x3c1d94 of _0x1a7f1d){!_0x5b639a[_0x1cef74(0x14a)](_0x3c1d94['id'])&&(_0xf25e63[_0x1cef74(0x181)](_0x3c1d94),_0x5b639a[_0x1cef74(0x171)](_0x3c1d94['id']));}return _0xf25e63;}export function normalizeDatasetOperations(_0x2557c1){const _0x2b6d84=a74_0x2e0d;if(Array[_0x2b6d84(0x17e)](_0x2557c1))return _0x2557c1[_0x2b6d84(0x166)](_0x491576=>_0x491576!=null&&typeof _0x491576==='object');if(_0x2557c1&&typeof _0x2557c1===_0x2b6d84(0x143))return Object[_0x2b6d84(0x133)](_0x2557c1)[_0x2b6d84(0x166)](([,_0x5d6e69])=>_0x5d6e69!=null&&typeof _0x5d6e69==='object')[_0x2b6d84(0x170)](([_0x5d6863,_0x1b6d25])=>({..._0x1b6d25,'name':_0x1b6d25[_0x2b6d84(0x15c)]??_0x1b6d25[_0x2b6d84(0x157)]??_0x5d6863}));return[];}export async function getDatasetDetail(_0x167933){const _0x1a5de8=a74_0x2e0d,_0x4d9ea3=/^\d+$/['test'](_0x167933)?'id':_0x1a5de8(0x182),_0x2f3835=await apiRequest(_0x1a5de8(0x14c)+_0x4d9ea3+'='+_0x167933);return _0x2f3835[_0x1a5de8(0x141)];}export async function getDatasetOperations(_0x411200){const _0x7bb73e=a74_0x2e0d,_0x1aced9=await getDatasetDetail(_0x411200),_0xa74a7=normalizeDatasetOperations(_0x1aced9[_0x7bb73e(0x178)])[_0x7bb73e(0x170)](_0x4ff767=>({'name':_0x4ff767['name']||_0x4ff767['operationName'],'displayName':_0x4ff767[_0x7bb73e(0x14e)]||_0x4ff767[_0x7bb73e(0x15c)],'type':_0x4ff767['type'],'method':_0x4ff767[_0x7bb73e(0x13f)],'path':_0x4ff767[_0x7bb73e(0x15d)],'enabled':_0x4ff767[_0x7bb73e(0x18b)]??!![],'requestFields':_0x4ff767[_0x7bb73e(0x158)],'responseFields':_0x4ff767[_0x7bb73e(0x13d)]}));return{'dataset':{'id':_0x1aced9['id']??_0x1aced9[_0x7bb73e(0x163)],'name':_0x1aced9[_0x7bb73e(0x15c)],'code':_0x1aced9[_0x7bb73e(0x182)]||_0x1aced9['modelCode'],'tableName':_0x1aced9[_0x7bb73e(0x169)]||_0x1aced9[_0x7bb73e(0x13b)]?.['tableName']},'operations':_0xa74a7};}export async function getOperationDetail(_0x34cfce,_0x53b582,_0x12c806){const _0xbba63b=a74_0x2e0d;let _0x4bc2e5=_0x53b582;if(!/^\d+$/[_0xbba63b(0x17d)](_0x53b582)){const _0x4bfadd=await listDatasets(_0x34cfce,{'code':_0x53b582}),_0x470572=_0x4bfadd[_0xbba63b(0x196)](_0x2d91dd=>_0x2d91dd[_0xbba63b(0x182)]===_0x53b582||String(_0x2d91dd['id'])===_0x53b582);if(!_0x470572)throw CliErrors[_0xbba63b(0x18e)]('Dataset\x20not\x20found:\x20'+_0x53b582);_0x4bc2e5=String(_0x470572['id']);}const _0x5c1a8d=await getDatasetDetail(_0x4bc2e5),_0x47ac37=normalizeDatasetOperations(_0x5c1a8d[_0xbba63b(0x178)])['find'](_0x3ec57d=>(_0x3ec57d[_0xbba63b(0x15c)]||_0x3ec57d['operationName'])===_0x12c806);if(!_0x47ac37)throw CliErrors[_0xbba63b(0x18e)]('Operation\x20\x22'+_0x12c806+'\x22\x20not\x20found\x20in\x20dataset\x20'+_0x53b582);return{'dataset':{'id':_0x5c1a8d['id']??_0x5c1a8d[_0xbba63b(0x163)],'name':_0x5c1a8d['name'],'code':_0x5c1a8d[_0xbba63b(0x182)]||_0x5c1a8d[_0xbba63b(0x15f)],'tableName':_0x5c1a8d[_0xbba63b(0x169)]||_0x5c1a8d[_0xbba63b(0x13b)]?.[_0xbba63b(0x169)]},'operation':_0x47ac37};}function a74_0x50a0(){const _0x3c5321=['delete','tableName','errorMsg','currentPage','stringify','join','/api/management/library/scripts/list?appCode=','create','map','add','.update(id,\x20{\x20/*\x20fields\x20*/\x20});','1502124gRrTbS','json','export\x20default\x20async\x20function\x20handler(params,\x20context)\x20{','579UGWqwi','3997XpCtCy','operations','\x20\x20pageSize:\x2020,','toLowerCase','cli:rabetbase','errorCode','test','isArray','pageSize','\x20\x20const\x20rows\x20=\x20await\x20context.client.sql.execute({','push','code','17112IWNwpX','});','API\x20error:\x20','description','/api/node-toolbox/sql/save','//\x20','\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','sqlName','enabled','1764669ZxHZas','sqlCode','validation','API\x20returned\x20non-JSON\x20response\x20(HTTP\x20','\x20\x20return\x20rows;','replace','if\x20(!data.execSuccess)\x20throw\x20new\x20Error(\x27SQL\x20execution\x20failed\x27);','1693220GKGTQJ','63zPRpXs','14pYyozj','find','88prUPjW','POST','10932GgqrQs','update','signal','const\x20data\x20=\x20await\x20client.sql.execute({','entries','functionName','target','success','const\x20result\x20=\x20await\x20client.models.','\x20\x20\x20\x20sqlCode:\x20\x27','1348fqrUBN','remove','dbtableConfig','4390DmCDLL','responseFields','application/json','method','API\x20error\x20code:\x20','data','import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','object','.remove(id);','.filter({','.create({\x20/*\x20fields\x20*/\x20});','22194289xDIiBi','apiError','/smartapi/dataset/get-dataset-list','has','//\x20SQL:\x20','/smartapi/dataset/get-driven-data?','Request\x20timeout:\x20','displayName','scriptName','BFF\x20script\x20not\x20found:\x20id=','includeImports','/api/custom/executeSql','4hZtnvS','(/*\x20params\x20*/);','/api/management/library/scripts/delete','status','operationName','requestFields','GET','Check\x20your\x20auth\x20cookie\x20and\x20try\x20again.','abort','name','path','const\x20results\x20=\x20data.execResult\x20||\x20[];','modelCode','includes','//\x20BFF\x20context:\x20context.client.sql.execute\x20returns\x20rows\x20directly','AbortError','modelId','.getOne(id);','\x20\x20currentPage:\x201,','filter','const\x20client\x20=\x20new\x20LovrabetClient({\x20appCode:\x20\x27<YOUR_APP_CODE>\x27\x20});'];a74_0x50a0=function(){return _0x3c5321;};return a74_0x50a0();}export function generateSdkCode(_0xf76317,_0x3e7c41,_0x14ba98){const _0x21caff=a74_0x2e0d,_0x403395=_0x14ba98?.[_0x21caff(0x151)]??!![],_0x2cfe14='dataset_'+_0xf76317['code']?.[_0x21caff(0x191)](/-/g,'_'),_0x4c25c4=_0x3e7c41['name']||_0x3e7c41['operationName']||_0x21caff(0x166),_0x2eeaf7=[];_0x403395&&_0x2eeaf7[_0x21caff(0x181)](_0x21caff(0x142),'',_0x21caff(0x167),'');_0x2eeaf7['push'](_0x21caff(0x188)+_0xf76317[_0x21caff(0x15c)]+'\x20('+(_0xf76317[_0x21caff(0x169)]||'table')+')');if(_0x4c25c4==='filter')_0x2eeaf7[_0x21caff(0x181)]('const\x20result\x20=\x20await\x20client.models.'+_0x2cfe14+_0x21caff(0x145),'\x20\x20where:\x20{},',_0x21caff(0x179),_0x21caff(0x165),_0x21caff(0x184));else{if(_0x4c25c4==='getOne')_0x2eeaf7[_0x21caff(0x181)](_0x21caff(0x137)+_0x2cfe14+_0x21caff(0x164));else{if(_0x4c25c4===_0x21caff(0x16f))_0x2eeaf7[_0x21caff(0x181)]('const\x20result\x20=\x20await\x20client.models.'+_0x2cfe14+_0x21caff(0x146));else{if(_0x4c25c4===_0x21caff(0x19a))_0x2eeaf7[_0x21caff(0x181)]('const\x20result\x20=\x20await\x20client.models.'+_0x2cfe14+_0x21caff(0x172));else _0x4c25c4===_0x21caff(0x168)||_0x4c25c4===_0x21caff(0x13a)?_0x2eeaf7['push'](_0x21caff(0x137)+_0x2cfe14+_0x21caff(0x144)):_0x2eeaf7[_0x21caff(0x181)]('const\x20result\x20=\x20await\x20client.models.'+_0x2cfe14+'.'+_0x4c25c4+_0x21caff(0x154));}}}return _0x2eeaf7[_0x21caff(0x16d)]('\x0a');}export function generateSqlCodeTemplate(_0x3e3178,_0xa8d798){const _0x4f21ca=a74_0x2e0d,_0x2fea8e=_0xa8d798?.[_0x4f21ca(0x135)]??'sdk',_0x40c56d=_0xa8d798?.[_0x4f21ca(0x151)]??!![],_0x16e14a=[];return _0x16e14a[_0x4f21ca(0x181)](_0x4f21ca(0x14b)+_0x3e3178[_0x4f21ca(0x18a)]+'\x20('+_0x3e3178['sqlCode']+')'),_0x2fea8e==='sdk'?(_0x40c56d&&_0x16e14a['push']('import\x20{\x20LovrabetClient\x20}\x20from\x20\x27@lovrabet/sdk\x27;','',_0x4f21ca(0x167),''),_0x16e14a[_0x4f21ca(0x181)](_0x4f21ca(0x132),'\x20\x20sqlCode:\x20\x27'+_0x3e3178[_0x4f21ca(0x18d)]+'\x27,',_0x4f21ca(0x189),_0x4f21ca(0x184),_0x4f21ca(0x192),_0x4f21ca(0x15e))):_0x16e14a[_0x4f21ca(0x181)](_0x4f21ca(0x161),_0x4f21ca(0x175),_0x4f21ca(0x180),_0x4f21ca(0x138)+_0x3e3178['sqlCode']+'\x27,','\x20\x20\x20\x20params:\x20{\x20/*\x20parameter\x20values\x20*/\x20},','\x20\x20});',_0x4f21ca(0x190),'}'),_0x16e14a['join']('\x0a');}export async function getErConfig(_0x4a4d44,_0x3bf3e1){const _0x140419=a74_0x2e0d,_0x394546=await apiRequest('/smartapi/question/er-config',{'method':'POST','body':{'appCode':_0x4a4d44,'dblinkId':_0x3bf3e1}});return _0x394546[_0x140419(0x141)];}
@@ -1 +1 @@
1
- const a75_0x5c105c=a75_0x57fd;(function(_0x3cdda6,_0xf43f07){const _0x773fa2=a75_0x57fd,_0x174c26=_0x3cdda6();while(!![]){try{const _0xa54731=parseInt(_0x773fa2(0xa6))/0x1+-parseInt(_0x773fa2(0xa2))/0x2+-parseInt(_0x773fa2(0xa1))/0x3+-parseInt(_0x773fa2(0x9f))/0x4*(-parseInt(_0x773fa2(0xa5))/0x5)+-parseInt(_0x773fa2(0x9c))/0x6+parseInt(_0x773fa2(0x9d))/0x7+parseInt(_0x773fa2(0xa0))/0x8*(-parseInt(_0x773fa2(0xa8))/0x9);if(_0xa54731===_0xf43f07)break;else _0x174c26['push'](_0x174c26['shift']());}catch(_0x2e39a9){_0x174c26['push'](_0x174c26['shift']());}}}(a75_0x3230,0x2069c));import{resolve}from'node:path';const DOT_DIR=a75_0x5c105c(0xaa),LOCK_FILE_NAME=a75_0x5c105c(0xa3),TRASH_DIR_NAME=a75_0x5c105c(0x9e);function a75_0x57fd(_0x17b12f,_0x23d77c){_0x17b12f=_0x17b12f-0x9c;const _0x3230e7=a75_0x3230();let _0x57fdf3=_0x3230e7[_0x17b12f];return _0x57fdf3;}export function loadBffProjectConfig(_0x4b0837,_0x2a4f43){const _0x551703=a75_0x5c105c,_0x545837=resolve(_0x2a4f43??process[_0x551703(0xa9)]()),_0x19674b=DOT_DIR+_0x551703(0xa7),_0x5bd644=_0x19674b+'/'+_0x4b0837;return{'projectRoot':_0x545837,'appCode':_0x4b0837,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x19674b,'scriptsRoot':_0x5bd644,'scriptsRootDir':resolve(_0x545837,DOT_DIR,_0x551703(0xa4),_0x4b0837),'lockFilePath':resolve(_0x545837,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x545837,DOT_DIR,TRASH_DIR_NAME)};}function a75_0x3230(){const _0x2644e9=['100176rrQmDQ','339798aRUQSx','bff.lock.json','bff','10doaINL','191928IeESer','/bff','9NpvLhp','cwd','.rabetbase','1037916mQBLST','1462384AkUQzR','bff-trash','472844nFysBS','1025768umfYMl'];a75_0x3230=function(){return _0x2644e9;};return a75_0x3230();}
1
+ const a75_0xa631f2=a75_0x22be;function a75_0x22be(_0x81d755,_0x1ed591){_0x81d755=_0x81d755-0xbe;const _0xd30ac=a75_0xd30a();let _0x22beb4=_0xd30ac[_0x81d755];return _0x22beb4;}(function(_0xe0aac5,_0x2fcff6){const _0x5a821a=a75_0x22be,_0x30bda1=_0xe0aac5();while(!![]){try{const _0x5cc187=parseInt(_0x5a821a(0xcc))/0x1+parseInt(_0x5a821a(0xc1))/0x2*(parseInt(_0x5a821a(0xbf))/0x3)+-parseInt(_0x5a821a(0xc3))/0x4+-parseInt(_0x5a821a(0xc5))/0x5+-parseInt(_0x5a821a(0xca))/0x6*(-parseInt(_0x5a821a(0xc9))/0x7)+parseInt(_0x5a821a(0xc8))/0x8*(-parseInt(_0x5a821a(0xc6))/0x9)+-parseInt(_0x5a821a(0xbe))/0xa;if(_0x5cc187===_0x2fcff6)break;else _0x30bda1['push'](_0x30bda1['shift']());}catch(_0x98e9f7){_0x30bda1['push'](_0x30bda1['shift']());}}}(a75_0xd30a,0xe117e));import{resolve}from'node:path';function a75_0xd30a(){const _0x2ee106=['6gmEbkT','cwd','1834764nlmoMz','2882860LVVXlp','507462AJoPie','.rabetbase','8CBBKMN','bff','3141416MwpKil','bff.lock.json','7530210lwHEVc','1136709QklYUg','bff-trash','16HdqUgw','8700202SYXQGU'];a75_0xd30a=function(){return _0x2ee106;};return a75_0xd30a();}const DOT_DIR=a75_0xa631f2(0xc0),LOCK_FILE_NAME=a75_0xa631f2(0xc4),TRASH_DIR_NAME=a75_0xa631f2(0xc7);export function loadBffProjectConfig(_0xfc414f,_0xce0509){const _0xd0184d=a75_0xa631f2,_0x3516c7=resolve(_0xce0509??process[_0xd0184d(0xcb)]()),_0x36d334=DOT_DIR+'/bff',_0x27cdb5=_0x36d334+'/'+_0xfc414f;return{'projectRoot':_0x3516c7,'appCode':_0xfc414f,'scriptsBaseDir':DOT_DIR,'scriptsWorkspaceRoot':_0x36d334,'scriptsRoot':_0x27cdb5,'scriptsRootDir':resolve(_0x3516c7,DOT_DIR,_0xd0184d(0xc2),_0xfc414f),'lockFilePath':resolve(_0x3516c7,DOT_DIR,LOCK_FILE_NAME),'trashDir':resolve(_0x3516c7,DOT_DIR,TRASH_DIR_NAME)};}
@@ -1 +1 @@
1
- const a76_0x3f5813=a76_0x5163;(function(_0x59dc54,_0x964c08){const _0x232db7=a76_0x5163,_0x49bae8=_0x59dc54();while(!![]){try{const _0x1f009e=parseInt(_0x232db7(0xe3))/0x1+parseInt(_0x232db7(0xf4))/0x2*(-parseInt(_0x232db7(0xd9))/0x3)+parseInt(_0x232db7(0xe8))/0x4+-parseInt(_0x232db7(0xf9))/0x5*(-parseInt(_0x232db7(0xfa))/0x6)+-parseInt(_0x232db7(0xdf))/0x7+-parseInt(_0x232db7(0xf2))/0x8+parseInt(_0x232db7(0xea))/0x9*(parseInt(_0x232db7(0xfb))/0xa);if(_0x1f009e===_0x964c08)break;else _0x49bae8['push'](_0x49bae8['shift']());}catch(_0x56e6f5){_0x49bae8['push'](_0x49bae8['shift']());}}}(a76_0x1af6,0xd351b));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'./utils.js';export const SUPPORTED_BFF_TYPES=[a76_0x3f5813(0xff),a76_0x3f5813(0xdc),'HOOK'];export function normalizeBffType(_0x8a5c93){const _0x5f326f=a76_0x3f5813;if(!_0x8a5c93)return undefined;const _0x484375=_0x8a5c93[_0x5f326f(0xf5)]()[_0x5f326f(0xe7)]();return SUPPORTED_BFF_TYPES[_0x5f326f(0xdb)](_0x484375)?_0x484375:undefined;}async function scanJsFilesRecursively(_0x243202,_0x7b1c87){const _0x2d2b5c=a76_0x3f5813,_0x5340b8=[];try{const _0x5dac29=await readdir(_0x243202,{'withFileTypes':!![]});for(const _0x332d47 of _0x5dac29){const _0x3d0544=join(_0x243202,_0x332d47['name']);if(_0x332d47[_0x2d2b5c(0xe2)]())_0x5340b8[_0x2d2b5c(0xdd)](...await scanJsFilesRecursively(_0x3d0544,_0x7b1c87+'/'+_0x332d47['name']));else _0x332d47[_0x2d2b5c(0xe6)]()&&_0x332d47[_0x2d2b5c(0xf8)][_0x2d2b5c(0xef)]('.js')&&_0x5340b8['push']({'lockKey':_0x7b1c87+'/'+_0x332d47[_0x2d2b5c(0xf8)][_0x2d2b5c(0xed)](/\.js$/,''),'filePath':_0x3d0544});}}catch(_0x4af161){if(_0x4af161[_0x2d2b5c(0xf1)]!==_0x2d2b5c(0xf3))throw _0x4af161;}return _0x5340b8;}async function scanFlatFunctions(_0x580b72,_0x5c7473){const _0x348b70=a76_0x3f5813,_0x17b13d=join(_0x580b72[_0x348b70(0xde)],_0x5c7473),_0xed514b=await scanJsFilesRecursively(_0x17b13d,_0x5c7473);return _0xed514b[_0x348b70(0x100)](({lockKey:_0x58bbc0,filePath:_0x5d284a})=>({'type':_0x5c7473,'name':_0x58bbc0[_0x348b70(0xf7)]('/')['at'](-0x1)??'','filePath':_0x5d284a,'lockKey':_0x58bbc0}));}async function scanHookFunctions(_0x10b98b){const _0x320d2e=a76_0x3f5813,_0x46b3f4=join(_0x10b98b[_0x320d2e(0xde)],_0x320d2e(0xe4)),_0x51dd53=[];try{const _0x19f176=await readdir(_0x46b3f4,{'withFileTypes':!![]});for(const _0x59756b of _0x19f176){if(!_0x59756b['isDirectory']())continue;const _0x295c05=_0x59756b['name'],_0x1e4c43=join(_0x46b3f4,_0x295c05),_0x221a5a=await readdir(_0x1e4c43,{'withFileTypes':!![]});for(const _0x4622dc of _0x221a5a){if(!_0x4622dc[_0x320d2e(0xe2)]())continue;const _0x25943f=_0x4622dc[_0x320d2e(0xf8)],_0x50497c=join(_0x1e4c43,_0x25943f),_0x23fc0a=await readdir(_0x50497c,{'withFileTypes':!![]});for(const _0x5e0daa of _0x23fc0a){if(!_0x5e0daa[_0x320d2e(0xe2)]())continue;const _0x1a82b2=_0x5e0daa[_0x320d2e(0xf8)],_0x33b481=join(_0x50497c,_0x1a82b2),_0xf6e40=await readdir(_0x33b481,{'withFileTypes':!![]});for(const _0x1e386e of _0xf6e40){if(!_0x1e386e[_0x320d2e(0xe6)]()||!_0x1e386e['name'][_0x320d2e(0xef)](_0x320d2e(0xda)))continue;const _0x16b01a=_0x1e386e[_0x320d2e(0xf8)]['replace'](/\.js$/,'');_0x51dd53[_0x320d2e(0xdd)]({'type':_0x320d2e(0xe4),'name':_0x16b01a,'filePath':join(_0x33b481,_0x1e386e['name']),'lockKey':_0x320d2e(0xf0)+_0x295c05+'/'+_0x25943f+'/'+_0x1a82b2+'/'+_0x16b01a,'alias':_0x295c05,'operationType':_0x25943f,'functionNode':_0x1a82b2});}}}}}catch(_0x2bfd5d){if(_0x2bfd5d[_0x320d2e(0xf1)]!==_0x320d2e(0xf3))throw _0x2bfd5d;}return _0x51dd53;}function a76_0x1af6(){const _0x3887b9=['beforeScriptId','split','name','95JJEXkM','262470RSDfLW','2421310jHJLNx','set','datasetCode','scriptType','COMMON','map','36gPQsok','.js','includes','ENDPOINT','push','scriptsRootDir','4201477xmbhYM','alias','functionName','isDirectory','211609LXQwwq','HOOK','afterScriptId','isFile','toUpperCase','3704732kcrtno','before','9TkRJJn','get','all','replace','operationType','endsWith','HOOK/','code','4655584YKBoEh','ENOENT','27226oOPqjQ','trim'];a76_0x1af6=function(){return _0x3887b9;};return a76_0x1af6();}export async function scanLocalBffFunctions(_0x950eb1,_0x29c817){const _0x4b7660=a76_0x3f5813;if(_0x29c817===_0x4b7660(0xff)||_0x29c817===_0x4b7660(0xdc))return scanFlatFunctions(_0x950eb1,_0x29c817);if(_0x29c817==='HOOK')return scanHookFunctions(_0x950eb1);const [_0x53aeeb,_0x473b31,_0x26b6d9]=await Promise[_0x4b7660(0xec)]([scanFlatFunctions(_0x950eb1,'COMMON'),scanFlatFunctions(_0x950eb1,_0x4b7660(0xdc)),scanHookFunctions(_0x950eb1)]);return[..._0x53aeeb,..._0x473b31,..._0x26b6d9];}export function resolveLocalFilePathFromLockKey(_0x5693bd,_0xb8da7){const _0x3af731=a76_0x3f5813;return join(_0x5693bd[_0x3af731(0xde)],..._0xb8da7[_0x3af731(0xf7)]('/'))+_0x3af731(0xda);}export function createHookLocationMap(_0x409ee4){const _0x5e3b32=a76_0x3f5813,_0x40e9e4=new Map();for(const _0x2ac325 of _0x409ee4){_0x2ac325[_0x5e3b32(0xf6)]&&_0x40e9e4[_0x5e3b32(0xfc)](_0x2ac325[_0x5e3b32(0xf6)],{'datasetCode':_0x2ac325[_0x5e3b32(0xfd)],'operationType':snakeToCamel(_0x2ac325[_0x5e3b32(0xee)]),'functionNode':_0x5e3b32(0xe9)}),_0x2ac325[_0x5e3b32(0xe5)]&&_0x40e9e4['set'](_0x2ac325[_0x5e3b32(0xe5)],{'datasetCode':_0x2ac325['datasetCode'],'operationType':snakeToCamel(_0x2ac325[_0x5e3b32(0xee)]),'functionNode':'after'});}return _0x40e9e4;}function a76_0x5163(_0x28b4f3,_0x4aa3f4){_0x28b4f3=_0x28b4f3-0xd9;const _0x1af6ba=a76_0x1af6();let _0x5163dc=_0x1af6ba[_0x28b4f3];return _0x5163dc;}export function resolveRemoteScriptTarget(_0x1a1f23,_0x1a5d29,_0x1893ff,_0x2a475d,_0x390bf4){const _0x275579=a76_0x3f5813,_0x18727a=normalizeBffType(_0x1a5d29[_0x275579(0xfe)]);if(!_0x18727a||!_0x1a5d29[_0x275579(0xe1)])return null;if(_0x18727a==='HOOK'){const _0x172ff6=(_0x1a5d29['id']?_0x1893ff[_0x275579(0xeb)](_0x1a5d29['id']):undefined)??findHookLocationByRemoteId(_0x2a475d,_0x1a5d29['id']);if(!_0x172ff6)return null;const _0x21c2fa=_0x172ff6[_0x275579(0xe0)]||_0x390bf4[_0x275579(0xeb)](_0x172ff6[_0x275579(0xfd)]),_0xac292c=_0x21c2fa??_0x172ff6[_0x275579(0xfd)],_0x4f13ba={..._0x172ff6,'alias':_0x21c2fa},_0x11b7ae='HOOK/'+_0xac292c+'/'+_0x4f13ba[_0x275579(0xee)]+'/'+_0x4f13ba['functionNode']+'/'+_0x1a5d29['functionName'];return{'lockKey':_0x11b7ae,'filePath':resolveLocalFilePathFromLockKey(_0x1a1f23,_0x11b7ae),'type':'HOOK','hookLocation':_0x4f13ba};}const _0x2eeb4e=_0x18727a+'/'+_0x1a5d29[_0x275579(0xe1)];return{'lockKey':_0x2eeb4e,'filePath':resolveLocalFilePathFromLockKey(_0x1a1f23,_0x2eeb4e),'type':_0x18727a};}export async function ensureParentDirectory(_0x4151c3){await mkdir(dirname(_0x4151c3),{'recursive':!![]});}export async function fileExists(_0x1119d4){try{return await access(_0x1119d4,constants['F_OK']),!![];}catch{return![];}}export async function directoryExists(_0x5e8850){const _0x3776ef=a76_0x3f5813;try{const _0x51bbf7=await stat(_0x5e8850);return _0x51bbf7[_0x3776ef(0xe2)]();}catch{return![];}}
1
+ const a76_0x6b92e6=a76_0x4126;(function(_0x29c172,_0x584d2d){const _0x34a097=a76_0x4126,_0x9b669d=_0x29c172();while(!![]){try{const _0x18800b=parseInt(_0x34a097(0x1b4))/0x1*(-parseInt(_0x34a097(0x1a1))/0x2)+-parseInt(_0x34a097(0x19b))/0x3*(parseInt(_0x34a097(0x19f))/0x4)+-parseInt(_0x34a097(0x199))/0x5+-parseInt(_0x34a097(0x1b2))/0x6+-parseInt(_0x34a097(0x1a7))/0x7+parseInt(_0x34a097(0x195))/0x8+-parseInt(_0x34a097(0x1b5))/0x9*(-parseInt(_0x34a097(0x193))/0xa);if(_0x18800b===_0x584d2d)break;else _0x9b669d['push'](_0x9b669d['shift']());}catch(_0x18ddcf){_0x9b669d['push'](_0x9b669d['shift']());}}}(a76_0x3c4c,0xdf3a3));function a76_0x3c4c(){const _0x12ca14=['4641581THBarl','after','HOOK/','code','before','split','beforeScriptId','datasetCode','endsWith','functionName','trim','6973260gbdvPn','COMMON','246211JFpsvs','9zFOuvY','isDirectory','afterScriptId','functionNode','56871490XyEqQJ','scriptsRootDir','13424976qQZrnd','set','push','operationType','8200160VhSyDj','HOOK','657957FxbILk','toUpperCase','replace','F_OK','32imTtAi','name','10CKYamR','ENOENT','.js','get','all','ENDPOINT'];a76_0x3c4c=function(){return _0x12ca14;};return a76_0x3c4c();}import{access,mkdir,readdir,stat}from'node:fs/promises';function a76_0x4126(_0x52eead,_0x2cb044){_0x52eead=_0x52eead-0x192;const _0x3c4c0f=a76_0x3c4c();let _0x41266d=_0x3c4c0f[_0x52eead];return _0x41266d;}import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'./utils.js';export const SUPPORTED_BFF_TYPES=[a76_0x6b92e6(0x1b3),a76_0x6b92e6(0x1a6),'HOOK'];export function normalizeBffType(_0x1ad606){const _0x14debd=a76_0x6b92e6;if(!_0x1ad606)return undefined;const _0x22fee1=_0x1ad606[_0x14debd(0x1b1)]()[_0x14debd(0x19c)]();return SUPPORTED_BFF_TYPES['includes'](_0x22fee1)?_0x22fee1:undefined;}async function scanJsFilesRecursively(_0x527f4a,_0x26bcd0){const _0x120d5b=a76_0x6b92e6,_0x3bc445=[];try{const _0x34c539=await readdir(_0x527f4a,{'withFileTypes':!![]});for(const _0x461bb2 of _0x34c539){const _0x3e059d=join(_0x527f4a,_0x461bb2['name']);if(_0x461bb2[_0x120d5b(0x1b6)]())_0x3bc445['push'](...await scanJsFilesRecursively(_0x3e059d,_0x26bcd0+'/'+_0x461bb2[_0x120d5b(0x1a0)]));else _0x461bb2['isFile']()&&_0x461bb2[_0x120d5b(0x1a0)][_0x120d5b(0x1af)](_0x120d5b(0x1a3))&&_0x3bc445[_0x120d5b(0x197)]({'lockKey':_0x26bcd0+'/'+_0x461bb2[_0x120d5b(0x1a0)][_0x120d5b(0x19d)](/\.js$/,''),'filePath':_0x3e059d});}}catch(_0x5682b1){if(_0x5682b1[_0x120d5b(0x1aa)]!=='ENOENT')throw _0x5682b1;}return _0x3bc445;}async function scanFlatFunctions(_0x2d7734,_0x3fe095){const _0x1e5986=a76_0x6b92e6,_0x4793e5=join(_0x2d7734[_0x1e5986(0x194)],_0x3fe095),_0x2ccd51=await scanJsFilesRecursively(_0x4793e5,_0x3fe095);return _0x2ccd51['map'](({lockKey:_0x37e52b,filePath:_0x3bc58c})=>({'type':_0x3fe095,'name':_0x37e52b[_0x1e5986(0x1ac)]('/')['at'](-0x1)??'','filePath':_0x3bc58c,'lockKey':_0x37e52b}));}async function scanHookFunctions(_0x483961){const _0x1c887e=a76_0x6b92e6,_0x57b9e6=join(_0x483961[_0x1c887e(0x194)],_0x1c887e(0x19a)),_0x5c1456=[];try{const _0x51d1a4=await readdir(_0x57b9e6,{'withFileTypes':!![]});for(const _0x52d5e9 of _0x51d1a4){if(!_0x52d5e9[_0x1c887e(0x1b6)]())continue;const _0xe045a3=_0x52d5e9[_0x1c887e(0x1a0)],_0x5bc3f4=join(_0x57b9e6,_0xe045a3),_0x511e92=await readdir(_0x5bc3f4,{'withFileTypes':!![]});for(const _0x2d1e3f of _0x511e92){if(!_0x2d1e3f[_0x1c887e(0x1b6)]())continue;const _0x4150cf=_0x2d1e3f[_0x1c887e(0x1a0)],_0x5bc24d=join(_0x5bc3f4,_0x4150cf),_0x2679a4=await readdir(_0x5bc24d,{'withFileTypes':!![]});for(const _0xff309d of _0x2679a4){if(!_0xff309d[_0x1c887e(0x1b6)]())continue;const _0x3db5a5=_0xff309d[_0x1c887e(0x1a0)],_0x4bd661=join(_0x5bc24d,_0x3db5a5),_0x58a8cd=await readdir(_0x4bd661,{'withFileTypes':!![]});for(const _0x5c114d of _0x58a8cd){if(!_0x5c114d['isFile']()||!_0x5c114d[_0x1c887e(0x1a0)][_0x1c887e(0x1af)](_0x1c887e(0x1a3)))continue;const _0x1759a8=_0x5c114d[_0x1c887e(0x1a0)][_0x1c887e(0x19d)](/\.js$/,'');_0x5c1456[_0x1c887e(0x197)]({'type':'HOOK','name':_0x1759a8,'filePath':join(_0x4bd661,_0x5c114d['name']),'lockKey':_0x1c887e(0x1a9)+_0xe045a3+'/'+_0x4150cf+'/'+_0x3db5a5+'/'+_0x1759a8,'alias':_0xe045a3,'operationType':_0x4150cf,'functionNode':_0x3db5a5});}}}}}catch(_0x33e711){if(_0x33e711[_0x1c887e(0x1aa)]!==_0x1c887e(0x1a2))throw _0x33e711;}return _0x5c1456;}export async function scanLocalBffFunctions(_0x5a9a39,_0x351c67){const _0x478f84=a76_0x6b92e6;if(_0x351c67===_0x478f84(0x1b3)||_0x351c67==='ENDPOINT')return scanFlatFunctions(_0x5a9a39,_0x351c67);if(_0x351c67==='HOOK')return scanHookFunctions(_0x5a9a39);const [_0x345efe,_0x3fff71,_0x1f1a2a]=await Promise[_0x478f84(0x1a5)]([scanFlatFunctions(_0x5a9a39,_0x478f84(0x1b3)),scanFlatFunctions(_0x5a9a39,_0x478f84(0x1a6)),scanHookFunctions(_0x5a9a39)]);return[..._0x345efe,..._0x3fff71,..._0x1f1a2a];}export function resolveLocalFilePathFromLockKey(_0x51e46e,_0x49e0af){const _0x164a49=a76_0x6b92e6;return join(_0x51e46e[_0x164a49(0x194)],..._0x49e0af[_0x164a49(0x1ac)]('/'))+_0x164a49(0x1a3);}export function createHookLocationMap(_0x40afbd){const _0xf37389=a76_0x6b92e6,_0x3bb8df=new Map();for(const _0x163b17 of _0x40afbd){_0x163b17[_0xf37389(0x1ad)]&&_0x3bb8df[_0xf37389(0x196)](_0x163b17['beforeScriptId'],{'datasetCode':_0x163b17[_0xf37389(0x1ae)],'operationType':snakeToCamel(_0x163b17[_0xf37389(0x198)]),'functionNode':_0xf37389(0x1ab)}),_0x163b17[_0xf37389(0x1b7)]&&_0x3bb8df[_0xf37389(0x196)](_0x163b17[_0xf37389(0x1b7)],{'datasetCode':_0x163b17['datasetCode'],'operationType':snakeToCamel(_0x163b17[_0xf37389(0x198)]),'functionNode':_0xf37389(0x1a8)});}return _0x3bb8df;}export function resolveRemoteScriptTarget(_0x6c13e8,_0x7269ab,_0x6d6fe,_0x564362,_0x24b2bf){const _0x1fb31d=a76_0x6b92e6,_0x3a70e6=normalizeBffType(_0x7269ab['scriptType']);if(!_0x3a70e6||!_0x7269ab[_0x1fb31d(0x1b0)])return null;if(_0x3a70e6===_0x1fb31d(0x19a)){const _0x5e2992=(_0x7269ab['id']?_0x6d6fe['get'](_0x7269ab['id']):undefined)??findHookLocationByRemoteId(_0x564362,_0x7269ab['id']);if(!_0x5e2992)return null;const _0x2ae58a=_0x5e2992['alias']||_0x24b2bf[_0x1fb31d(0x1a4)](_0x5e2992['datasetCode']),_0x5d1e1a=_0x2ae58a??_0x5e2992[_0x1fb31d(0x1ae)],_0x51e280={..._0x5e2992,'alias':_0x2ae58a},_0xfb6f9f='HOOK/'+_0x5d1e1a+'/'+_0x51e280[_0x1fb31d(0x198)]+'/'+_0x51e280[_0x1fb31d(0x192)]+'/'+_0x7269ab[_0x1fb31d(0x1b0)];return{'lockKey':_0xfb6f9f,'filePath':resolveLocalFilePathFromLockKey(_0x6c13e8,_0xfb6f9f),'type':_0x1fb31d(0x19a),'hookLocation':_0x51e280};}const _0x4b4b2a=_0x3a70e6+'/'+_0x7269ab[_0x1fb31d(0x1b0)];return{'lockKey':_0x4b4b2a,'filePath':resolveLocalFilePathFromLockKey(_0x6c13e8,_0x4b4b2a),'type':_0x3a70e6};}export async function ensureParentDirectory(_0x4afd6c){await mkdir(dirname(_0x4afd6c),{'recursive':!![]});}export async function fileExists(_0x5d0e1b){const _0x584115=a76_0x6b92e6;try{return await access(_0x5d0e1b,constants[_0x584115(0x19e)]),!![];}catch{return![];}}export async function directoryExists(_0x99e3c5){try{const _0xaf51c2=await stat(_0x99e3c5);return _0xaf51c2['isDirectory']();}catch{return![];}}
@@ -1 +1 @@
1
- (function(_0x269f53,_0x58695c){const _0x159e35=a77_0x2726,_0x4d334c=_0x269f53();while(!![]){try{const _0x1baff0=parseInt(_0x159e35(0x1b5))/0x1*(parseInt(_0x159e35(0x1b6))/0x2)+-parseInt(_0x159e35(0x1bb))/0x3+-parseInt(_0x159e35(0x1b2))/0x4*(-parseInt(_0x159e35(0x1be))/0x5)+-parseInt(_0x159e35(0x1b9))/0x6*(parseInt(_0x159e35(0x1b8))/0x7)+parseInt(_0x159e35(0x1b1))/0x8+-parseInt(_0x159e35(0x1b3))/0x9+parseInt(_0x159e35(0x1b4))/0xa*(parseInt(_0x159e35(0x1b7))/0xb);if(_0x1baff0===_0x58695c)break;else _0x4d334c['push'](_0x4d334c['shift']());}catch(_0x3cf233){_0x4d334c['push'](_0x4d334c['shift']());}}}(a77_0x4f2b,0x481d3));import{readFile}from'node:fs/promises';import a77_0x11f5d5 from'node:crypto';export function computeContentHash(_0xa1c2f1){const _0x34e730=a77_0x2726;return a77_0x11f5d5[_0x34e730(0x1bc)](_0x34e730(0x1ba))[_0x34e730(0x1c0)](_0xa1c2f1)[_0x34e730(0x1bd)]('hex');}function a77_0x4f2b(){const _0x4c789e=['digest','10saZhTP','utf8','update','4669888RKWjzj','555956bqRYuI','2568456cEAHZs','170HJWzVn','1564JZKRLL','188OErgZn','269819LMcBHL','4101307sjZqLY','6ggSuEK','md5','777177CmuqxB','createHash'];a77_0x4f2b=function(){return _0x4c789e;};return a77_0x4f2b();}function a77_0x2726(_0x4a9a6d,_0x2079a4){_0x4a9a6d=_0x4a9a6d-0x1b1;const _0x4f2b50=a77_0x4f2b();let _0x2726b5=_0x4f2b50[_0x4a9a6d];return _0x2726b5;}export async function computeFileHash(_0x4f7e4b){const _0x48f7d5=a77_0x2726,_0x2fc193=await readFile(_0x4f7e4b,_0x48f7d5(0x1bf));return computeContentHash(_0x2fc193);}
1
+ (function(_0x4a6a8e,_0x33d196){const _0x5d38a2=a77_0x361d,_0x16c277=_0x4a6a8e();while(!![]){try{const _0x15cbc0=parseInt(_0x5d38a2(0x17f))/0x1*(-parseInt(_0x5d38a2(0x188))/0x2)+parseInt(_0x5d38a2(0x182))/0x3*(parseInt(_0x5d38a2(0x179))/0x4)+-parseInt(_0x5d38a2(0x17b))/0x5*(parseInt(_0x5d38a2(0x17e))/0x6)+parseInt(_0x5d38a2(0x17d))/0x7*(-parseInt(_0x5d38a2(0x17c))/0x8)+parseInt(_0x5d38a2(0x184))/0x9*(parseInt(_0x5d38a2(0x187))/0xa)+parseInt(_0x5d38a2(0x185))/0xb+-parseInt(_0x5d38a2(0x17a))/0xc*(-parseInt(_0x5d38a2(0x18b))/0xd);if(_0x15cbc0===_0x33d196)break;else _0x16c277['push'](_0x16c277['shift']());}catch(_0x2293d6){_0x16c277['push'](_0x16c277['shift']());}}}(a77_0x3c54,0xab92f));import{readFile}from'node:fs/promises';import a77_0x11e706 from'node:crypto';function a77_0x3c54(){const _0x5149ef=['hex','update','1155468GdwCVH','createHash','9itrLqg','9667768LHTtcM','utf8','3728170xcShrD','26kaIXgF','digest','md5','25883XWgqum','4mlRFcP','5916jRSeLc','1341095HgcBAK','2442128pQuuGE','28CBmoTq','6aBVBdF','32798kEfwuL'];a77_0x3c54=function(){return _0x5149ef;};return a77_0x3c54();}export function computeContentHash(_0xfd7323){const _0x2aa4ff=a77_0x361d;return a77_0x11e706[_0x2aa4ff(0x183)](_0x2aa4ff(0x18a))[_0x2aa4ff(0x181)](_0xfd7323)[_0x2aa4ff(0x189)](_0x2aa4ff(0x180));}function a77_0x361d(_0x5732e3,_0x45c79a){_0x5732e3=_0x5732e3-0x179;const _0x3c548f=a77_0x3c54();let _0x361d76=_0x3c548f[_0x5732e3];return _0x361d76;}export async function computeFileHash(_0x15633b){const _0x134086=a77_0x361d,_0x183245=await readFile(_0x15633b,_0x134086(0x186));return computeContentHash(_0x183245);}
@@ -1 +1 @@
1
- (function(_0x551a43,_0x2a1668){const _0x5d05c2=a78_0x5f34,_0x5b6448=_0x551a43();while(!![]){try{const _0x2c1af3=-parseInt(_0x5d05c2(0x10c))/0x1*(parseInt(_0x5d05c2(0x102))/0x2)+-parseInt(_0x5d05c2(0x119))/0x3+parseInt(_0x5d05c2(0x115))/0x4+-parseInt(_0x5d05c2(0x118))/0x5+parseInt(_0x5d05c2(0x107))/0x6*(-parseInt(_0x5d05c2(0x10a))/0x7)+parseInt(_0x5d05c2(0x10b))/0x8+parseInt(_0x5d05c2(0x104))/0x9;if(_0x2c1af3===_0x2a1668)break;else _0x5b6448['push'](_0x5b6448['shift']());}catch(_0x311456){_0x5b6448['push'](_0x5b6448['shift']());}}}(a78_0x3984,0xf1ade));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(_0x17077d){return{'aliases':_0x17077d?{'default':_0x17077d}:{},'apps':{}};}function normalizeLockFile(_0x539c3f,_0x414205,_0x6170e5){const _0x51ca85=a78_0x5f34;if(_0x51ca85(0x109)in _0x539c3f&&_0x539c3f['apps']&&typeof _0x539c3f['apps']===_0x51ca85(0x105))return(!_0x539c3f[_0x51ca85(0x117)]||typeof _0x539c3f[_0x51ca85(0x117)]!==_0x51ca85(0x105))&&(_0x539c3f[_0x51ca85(0x117)]={}),!_0x539c3f[_0x51ca85(0x117)][_0x51ca85(0x11b)]&&(_0x539c3f[_0x51ca85(0x117)]['default']=_0x414205),_0x539c3f;const _0x1026ec=_0x539c3f,_0x459e89=_0x1026ec[_0x51ca85(0x103)]?.[_0x51ca85(0x114)]?.[_0x51ca85(0x110)]()||_0x414205,_0x5a529b=_0x1026ec[_0x51ca85(0x103)]?.[_0x51ca85(0x11c)]?.[_0x51ca85(0x110)]()||_0x6170e5;return{'aliases':{'default':_0x459e89},'apps':{[_0x459e89]:{'scriptsRoot':_0x5a529b,'lastSync':_0x1026ec['lastSync']||'','functions':_0x1026ec[_0x51ca85(0x106)]||{}}}};}export function ensureLockScope(_0xae6850,_0x97a4fe,_0x4ecee4,_0x117574,_0x4fff06,_0xb8f2a9){const _0x12248b=a78_0x5f34,_0x58ecda=normalizeLockFile(_0xae6850,_0x4fff06,_0xb8f2a9);!_0x58ecda[_0x12248b(0x117)]['default']&&(_0x58ecda[_0x12248b(0x117)][_0x12248b(0x11b)]=_0x4fff06);let _0x2f4232=_0x58ecda['apps'][_0x97a4fe];if(!_0x2f4232)return _0x2f4232={'scriptsRoot':_0x4ecee4,'lastSync':'','functions':{}},_0x58ecda[_0x12248b(0x109)][_0x97a4fe]=_0x2f4232,{'lockData':_0x58ecda,'appLock':_0x2f4232};if(!_0x2f4232[_0x12248b(0x11c)])_0x2f4232[_0x12248b(0x11c)]=_0x4ecee4;else{if(_0x2f4232[_0x12248b(0x11c)]!==_0x4ecee4)throw new Error(_0x117574+':\x20scriptsRoot\x20mismatch\x20—\x20'+(_0x12248b(0x10e)+_0x4ecee4+_0x12248b(0x111)+_0x2f4232[_0x12248b(0x11c)]+_0x12248b(0x113))+'Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.');}return!_0x2f4232[_0x12248b(0x106)]&&(_0x2f4232[_0x12248b(0x106)]={}),!_0x2f4232['lastSync']&&(_0x2f4232[_0x12248b(0x11a)]=''),{'lockData':_0x58ecda,'appLock':_0x2f4232};}export async function readBffLockFile(_0x46af55){const _0x783ccc=a78_0x5f34;try{const _0x30391e=await readFile(_0x46af55,_0x783ccc(0x116));return JSON[_0x783ccc(0x112)](_0x30391e);}catch(_0x553cd0){if(_0x553cd0[_0x783ccc(0x10f)]===_0x783ccc(0x10d))return null;throw new Error('Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20'+String(_0x553cd0));}}function a78_0x3984(){const _0xca3889=['default','scriptsRoot','4RuGPBx','meta','46258110McjoTu','object','functions','9219384RDlzrd','stringify','apps','7wKAZUH','2246632KCREyl','931678NDCAlE','ENOENT','current\x20\x22','code','trim','\x22\x20vs\x20lock\x20\x22','parse','\x22.\x20','appCode','3339320UAGqeR','utf8','aliases','365045WYignp','5377806mqLTjB','lastSync'];a78_0x3984=function(){return _0xca3889;};return a78_0x3984();}function a78_0x5f34(_0x3f850c,_0x11c647){_0x3f850c=_0x3f850c-0x102;const _0x3984ea=a78_0x3984();let _0x5f34b9=_0x3984ea[_0x3f850c];return _0x5f34b9;}export async function writeBffLockFile(_0x30de37,_0x54dc57){const _0x534642=a78_0x5f34;await mkdir(dirname(_0x30de37),{'recursive':!![]}),await writeFile(_0x30de37,JSON[_0x534642(0x108)](_0x54dc57,null,0x2),_0x534642(0x116));}
1
+ (function(_0x4edcd5,_0x57b030){const _0x5c344c=a78_0x2a12,_0x8213c2=_0x4edcd5();while(!![]){try{const _0x2bf9e2=parseInt(_0x5c344c(0x80))/0x1*(-parseInt(_0x5c344c(0x8b))/0x2)+-parseInt(_0x5c344c(0x7b))/0x3*(parseInt(_0x5c344c(0x81))/0x4)+parseInt(_0x5c344c(0x8a))/0x5+-parseInt(_0x5c344c(0x74))/0x6+-parseInt(_0x5c344c(0x84))/0x7+-parseInt(_0x5c344c(0x72))/0x8*(-parseInt(_0x5c344c(0x7d))/0x9)+parseInt(_0x5c344c(0x78))/0xa;if(_0x2bf9e2===_0x57b030)break;else _0x8213c2['push'](_0x8213c2['shift']());}catch(_0x53fd75){_0x8213c2['push'](_0x8213c2['shift']());}}}(a78_0x3084,0xc114e));import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(_0x28e8f3){return{'aliases':_0x28e8f3?{'default':_0x28e8f3}:{},'apps':{}};}function normalizeLockFile(_0x309a73,_0x25414e,_0x555981){const _0x443330=a78_0x2a12;if(_0x443330(0x82)in _0x309a73&&_0x309a73[_0x443330(0x82)]&&typeof _0x309a73[_0x443330(0x82)]===_0x443330(0x86))return(!_0x309a73['aliases']||typeof _0x309a73[_0x443330(0x87)]!==_0x443330(0x86))&&(_0x309a73[_0x443330(0x87)]={}),!_0x309a73[_0x443330(0x87)][_0x443330(0x7c)]&&(_0x309a73['aliases']['default']=_0x25414e),_0x309a73;const _0x7e97dd=_0x309a73,_0x510e8=_0x7e97dd['meta']?.['appCode']?.[_0x443330(0x75)]()||_0x25414e,_0x57eef7=_0x7e97dd[_0x443330(0x7a)]?.[_0x443330(0x76)]?.[_0x443330(0x75)]()||_0x555981;return{'aliases':{'default':_0x510e8},'apps':{[_0x510e8]:{'scriptsRoot':_0x57eef7,'lastSync':_0x7e97dd[_0x443330(0x8d)]||'','functions':_0x7e97dd[_0x443330(0x77)]||{}}}};}export function ensureLockScope(_0x1a84ad,_0x477eb2,_0x4f0224,_0x861e4e,_0x3b6496,_0x29a70b){const _0xa28fc3=a78_0x2a12,_0x23e182=normalizeLockFile(_0x1a84ad,_0x3b6496,_0x29a70b);!_0x23e182[_0xa28fc3(0x87)][_0xa28fc3(0x7c)]&&(_0x23e182['aliases']['default']=_0x3b6496);let _0x431ed9=_0x23e182['apps'][_0x477eb2];if(!_0x431ed9)return _0x431ed9={'scriptsRoot':_0x4f0224,'lastSync':'','functions':{}},_0x23e182[_0xa28fc3(0x82)][_0x477eb2]=_0x431ed9,{'lockData':_0x23e182,'appLock':_0x431ed9};if(!_0x431ed9['scriptsRoot'])_0x431ed9[_0xa28fc3(0x76)]=_0x4f0224;else{if(_0x431ed9[_0xa28fc3(0x76)]!==_0x4f0224)throw new Error(_0x861e4e+_0xa28fc3(0x79)+('current\x20\x22'+_0x4f0224+'\x22\x20vs\x20lock\x20\x22'+_0x431ed9['scriptsRoot']+_0xa28fc3(0x8c))+_0xa28fc3(0x89));}return!_0x431ed9['functions']&&(_0x431ed9[_0xa28fc3(0x77)]={}),!_0x431ed9[_0xa28fc3(0x8d)]&&(_0x431ed9[_0xa28fc3(0x8d)]=''),{'lockData':_0x23e182,'appLock':_0x431ed9};}export async function readBffLockFile(_0x569f95){const _0x34cf2a=a78_0x2a12;try{const _0x673e28=await readFile(_0x569f95,_0x34cf2a(0x73));return JSON[_0x34cf2a(0x7e)](_0x673e28);}catch(_0x55a105){if(_0x55a105[_0x34cf2a(0x85)]===_0x34cf2a(0x88))return null;throw new Error(_0x34cf2a(0x7f)+String(_0x55a105));}}function a78_0x2a12(_0x1b71ce,_0x19dc19){_0x1b71ce=_0x1b71ce-0x72;const _0x30846b=a78_0x3084();let _0x2a1299=_0x30846b[_0x1b71ce];return _0x2a1299;}function a78_0x3084(){const _0x39006f=['meta','15bAEits','default','153gEoSHp','parse','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','167ELtSFH','1208056qlnbfo','apps','stringify','2691577GtmHQG','code','object','aliases','ENOENT','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','6490785QltMDQ','146ThiCql','\x22.\x20','lastSync','53368ctnEvD','utf8','7594578oXfKLn','trim','scriptsRoot','functions','25518330nGeOGA',':\x20scriptsRoot\x20mismatch\x20—\x20'];a78_0x3084=function(){return _0x39006f;};return a78_0x3084();}export async function writeBffLockFile(_0x1c067a,_0x23434b){const _0x41699c=a78_0x2a12;await mkdir(dirname(_0x1c067a),{'recursive':!![]}),await writeFile(_0x1c067a,JSON[_0x41699c(0x83)](_0x23434b,null,0x2),_0x41699c(0x73));}