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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/lib/ai-setup/config.js +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/doc.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/app.js +1 -1
  19. package/lib/commands/auth.js +1 -1
  20. package/lib/commands/bff/delete.js +1 -1
  21. package/lib/commands/bff/detail.js +1 -1
  22. package/lib/commands/bff/index.js +1 -1
  23. package/lib/commands/bff/list.js +1 -1
  24. package/lib/commands/bff/new.js +1 -1
  25. package/lib/commands/bff/pull.js +1 -1
  26. package/lib/commands/bff/push.js +1 -1
  27. package/lib/commands/bff/status.js +1 -1
  28. package/lib/commands/build.js +1 -1
  29. package/lib/commands/cli-update.js +1 -1
  30. package/lib/commands/codegen/index.js +1 -1
  31. package/lib/commands/codegen/sdk.js +1 -1
  32. package/lib/commands/codegen/sql.js +1 -1
  33. package/lib/commands/common/flags.js +1 -1
  34. package/lib/commands/config.js +1 -1
  35. package/lib/commands/create.js +1 -1
  36. package/lib/commands/dataset/detail.js +1 -1
  37. package/lib/commands/dataset/index.js +1 -1
  38. package/lib/commands/dataset/links.js +1 -1
  39. package/lib/commands/dataset/list.js +1 -1
  40. package/lib/commands/dataset/operations.js +1 -1
  41. package/lib/commands/doctor.js +1 -1
  42. package/lib/commands/init.js +1 -1
  43. package/lib/commands/logout.js +1 -1
  44. package/lib/commands/logs.js +1 -1
  45. package/lib/commands/mcp.js +1 -1
  46. package/lib/commands/menu/index.js +1 -1
  47. package/lib/commands/menu/shared/compare-table.js +1 -1
  48. package/lib/commands/menu/shared/index.js +1 -1
  49. package/lib/commands/menu/shared/inquirer.js +1 -1
  50. package/lib/commands/menu/shared/local-pages.js +1 -1
  51. package/lib/commands/menu/shared/logic.js +1 -1
  52. package/lib/commands/menu/shared/service.js +1 -1
  53. package/lib/commands/menu/shared/sync-core.js +1 -1
  54. package/lib/commands/menu/shared/update-core.js +1 -1
  55. package/lib/commands/menu/shared/valid-url.js +1 -1
  56. package/lib/commands/menu/sync.js +1 -1
  57. package/lib/commands/menu/update.js +1 -1
  58. package/lib/commands/preview.js +1 -1
  59. package/lib/commands/project-upgrade.js +1 -1
  60. package/lib/commands/registry.js +1 -1
  61. package/lib/commands/run.js +1 -1
  62. package/lib/commands/skill.js +1 -1
  63. package/lib/commands/sql/detail.js +1 -1
  64. package/lib/commands/sql/exec.js +1 -1
  65. package/lib/commands/sql/index.js +1 -1
  66. package/lib/commands/sql/list.js +1 -1
  67. package/lib/commands/sql/save.js +1 -1
  68. package/lib/commands/sql/validate.js +1 -1
  69. package/lib/commands/start.js +1 -1
  70. package/lib/config/config-help.js +1 -1
  71. package/lib/config/main.js +1 -1
  72. package/lib/constant/cli.js +1 -1
  73. package/lib/constant/domain.js +1 -1
  74. package/lib/constant/env.js +1 -1
  75. package/lib/context.js +1 -1
  76. package/lib/core/alias-resolver.js +1 -1
  77. package/lib/core/api-client.js +1 -1
  78. package/lib/core/bff/config.js +1 -1
  79. package/lib/core/bff/file-system.js +1 -1
  80. package/lib/core/bff/hash.js +1 -1
  81. package/lib/core/bff/lock.js +1 -1
  82. package/lib/core/bff/utils.js +1 -1
  83. package/lib/core/db-resolver.js +1 -1
  84. package/lib/core/sql-validator.js +1 -1
  85. package/lib/create-app/enhanced-guided-create.js +1 -1
  86. package/lib/create-app/format-elapsed.js +1 -1
  87. package/lib/create-app/main.js +1 -1
  88. package/lib/create-app/non-interactive.js +1 -1
  89. package/lib/create-app/task-finished.js +1 -1
  90. package/lib/create-app/task-loading.js +1 -1
  91. package/lib/create-app/task-running.js +1 -1
  92. package/lib/create-app/task-time.js +1 -1
  93. package/lib/create-app/use-copy-project-template.js +1 -1
  94. package/lib/create-app/use-format-code.js +1 -1
  95. package/lib/create-app/use-install-dependencies.js +1 -1
  96. package/lib/errors.js +1 -1
  97. package/lib/framework/flags.js +1 -1
  98. package/lib/framework/help.js +1 -1
  99. package/lib/framework/index.js +1 -1
  100. package/lib/framework/output.js +1 -1
  101. package/lib/framework/response.js +1 -1
  102. package/lib/framework/runner.js +1 -1
  103. package/lib/generated/build-info.js +1 -1
  104. package/lib/help.js +1 -1
  105. package/lib/init/main.js +1 -1
  106. package/lib/mcp/McpInstallUI.js +1 -1
  107. package/lib/mcp/claude.js +1 -1
  108. package/lib/mcp/cursor.js +1 -1
  109. package/lib/mcp/main.js +1 -1
  110. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  111. package/lib/mcp/mcp-installer.js +1 -1
  112. package/lib/skills/main.js +1 -1
  113. package/lib/skills/npx-skills-add.js +1 -1
  114. package/lib/telemetry/cli-help-trace.js +1 -1
  115. package/lib/telemetry/otel-logger-version.js +1 -1
  116. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  117. package/lib/ui/IDESelector.js +1 -1
  118. package/lib/ui/useIDESelection.js +1 -1
  119. package/lib/utils/ai_config.js +1 -1
  120. package/lib/utils/cdn-config.js +1 -1
  121. package/lib/utils/check-sdk-version.js +1 -1
  122. package/lib/utils/cli-version-check.js +1 -1
  123. package/lib/utils/config.js +1 -1
  124. package/lib/utils/copy-directory.js +1 -1
  125. package/lib/utils/file-utils.js +1 -1
  126. package/lib/utils/guides-cdn.js +1 -1
  127. package/lib/utils/http-client.js +1 -1
  128. package/lib/utils/logger.js +1 -1
  129. package/lib/utils/rules-cdn.js +1 -1
  130. package/lib/utils/sleep.js +1 -1
  131. package/lib/utils/template-replacer.js +1 -1
  132. package/package.json +1 -1
@@ -1 +1 @@
1
- const a16_0x5215df=a16_0x2ac8;(function(_0x2accf3,_0x3d1ad2){const _0x2c3f06=a16_0x2ac8,_0x47c2e4=_0x2accf3();while(!![]){try{const _0x3ff01d=parseInt(_0x2c3f06(0x159))/0x1+parseInt(_0x2c3f06(0x155))/0x2*(-parseInt(_0x2c3f06(0x146))/0x3)+parseInt(_0x2c3f06(0x135))/0x4*(-parseInt(_0x2c3f06(0x142))/0x5)+-parseInt(_0x2c3f06(0x152))/0x6+parseInt(_0x2c3f06(0x140))/0x7+parseInt(_0x2c3f06(0x15e))/0x8*(parseInt(_0x2c3f06(0x15f))/0x9)+-parseInt(_0x2c3f06(0x15d))/0xa*(-parseInt(_0x2c3f06(0x12d))/0xb);if(_0x3ff01d===_0x3d1ad2)break;else _0x47c2e4['push'](_0x47c2e4['shift']());}catch(_0x5578af){_0x47c2e4['push'](_0x47c2e4['shift']());}}}(a16_0x14a1,0xdec78));import a16_0x5314fd from'ora';import{initEnv,getEnv}from'../../constant/env.js';import{fetchModelList}from'../../api/fetch-model-list.js';function a16_0x14a1(){const _0x3bb6c7=['api','includes','\x20app(s)\x20failed','fail','cookie','string','log','str','Pull\x20datasets\x20and\x20generate\x20API\x20config\x20files\x20(./src/api/)','slice','production','6765444ZwIpkK','Override\x20app\x20code','name','10HajLNb','appCode','clientFilePath','\x20\x20•\x20','1685672fuvFvY','apiFilePath','error','map','145190kUXpeU','8632gmWlXl','14607LpIoVw','./src/api/','split','Done:\x20','App\x20\x22','pull','Pulling\x20','759wEXuop','endsWith','Pulling\x20API\x20config\x20for\x20','\x20model(s)','Output\x20directory\x20(default:\x20./src/api/)','appcode','modelCount','length','4WeAcaG','apiDir','isDefault','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','filter','join','client','output','message','env','\x20succeeded,\x20','92582XQBoVu','-client','3249265aTtEGS','start','succeed','selectedAppName','1057197MwAfAh'];a16_0x14a1=function(){return _0x3bb6c7;};return a16_0x14a1();}import{generateApiFile}from'../../api/generate-api-file.js';function a16_0x2ac8(_0x45d136,_0x2dee2c){_0x45d136=_0x45d136-0x12b;const _0x14a151=a16_0x14a1();let _0x2ac8b9=_0x14a151[_0x45d136];return _0x2ac8b9;}import{getMultiAppConfigs}from'../../utils/config.js';export const apiPull={'service':a16_0x5215df(0x147),'command':a16_0x5215df(0x12b),'description':a16_0x5215df(0x14f),'risk':'write','requiresAppCode':!![],'hasFormat':![],'flags':[{'name':'appcode','type':a16_0x5215df(0x14c),'description':a16_0x5215df(0x153),'hidden':!![]},{'name':a16_0x5215df(0x13c),'type':a16_0x5215df(0x14c),'description':a16_0x5215df(0x131)}],async 'execute'(_0x45e9f0){const _0x40f57c=a16_0x5215df,_0x4cb3cf=_0x45e9f0['str'](_0x40f57c(0x132)),_0x12e1f1=_0x45e9f0[_0x40f57c(0x14e)](_0x40f57c(0x13c))||undefined;if(!_0x4cb3cf){let _0x4730d8=getMultiAppConfigs();if(_0x4730d8&&_0x4730d8[_0x40f57c(0x134)]>0x0){if(_0x45e9f0[_0x40f57c(0x145)]){const _0x1f6e85=_0x4730d8[_0x40f57c(0x139)](_0x4a4f68=>_0x4a4f68['name']===_0x45e9f0[_0x40f57c(0x145)]);if(_0x1f6e85[_0x40f57c(0x134)]===0x0){const _0x157b66=_0x4730d8[_0x40f57c(0x15c)](_0x507ca0=>_0x507ca0[_0x40f57c(0x154)])[_0x40f57c(0x13a)](',\x20');return{'ok':![],'message':_0x40f57c(0x163)+_0x45e9f0[_0x40f57c(0x145)]+_0x40f57c(0x138)+_0x157b66};}_0x4730d8=_0x1f6e85;}let _0x2aa23a=0x0,_0x1fe59=0x0;for(const _0x4648a2 of _0x4730d8){const _0x382edd=_0x4648a2[_0x40f57c(0x14b)]||_0x45e9f0['cookie'],_0x1bc7c6=_0x4648a2[_0x40f57c(0x13e)]||_0x40f57c(0x151);initEnv(_0x1bc7c6);const _0x308162=_0x4648a2[_0x40f57c(0x136)]||_0x12e1f1||_0x40f57c(0x160),_0x504288=_0x4648a2[_0x40f57c(0x137)]?'':_0x4648a2['name']||_0x4648a2[_0x40f57c(0x132)],_0x4b21e0=a16_0x5314fd(_0x40f57c(0x12c)+_0x4648a2['name']+'\x20('+_0x4648a2[_0x40f57c(0x132)]+')...')[_0x40f57c(0x143)]();try{const {configArray:_0x2896cf}=await fetchModelList(_0x4648a2[_0x40f57c(0x132)],_0x382edd),_0x37fd55=await generateApiFile(_0x2896cf,_0x504288,_0x4648a2['appcode'],_0x4648a2[_0x40f57c(0x137)],_0x1bc7c6,_0x308162,_0x4648a2['name']);_0x4b21e0[_0x40f57c(0x144)](_0x4648a2[_0x40f57c(0x154)]+':\x20'+_0x2896cf[_0x40f57c(0x134)]+'\x20dataset(s)\x20→\x20'+_0x37fd55[_0x40f57c(0x133)]+'\x20model(s)'),console[_0x40f57c(0x14d)](_0x40f57c(0x158)+_0x37fd55[_0x40f57c(0x15a)]),console[_0x40f57c(0x14d)]('\x20\x20•\x20'+_0x37fd55[_0x40f57c(0x157)]),_0x2aa23a++;}catch(_0x45e214){_0x4b21e0[_0x40f57c(0x14a)](_0x4648a2['name']+':\x20'+(_0x45e214 instanceof Error?_0x45e214[_0x40f57c(0x13d)]:String(_0x45e214))),_0x1fe59++;}}return console[_0x40f57c(0x14d)](),_0x1fe59>0x0&&console[_0x40f57c(0x15b)]('!\x20'+_0x1fe59+_0x40f57c(0x149)),{'ok':_0x1fe59===0x0,'message':_0x40f57c(0x162)+_0x2aa23a+_0x40f57c(0x13f)+_0x1fe59+'\x20failed'};}}const _0x4dce5d=_0x4cb3cf&&_0x4cb3cf[_0x40f57c(0x148)]('-')?_0x4cb3cf[_0x40f57c(0x161)]('-')[_0x40f57c(0x150)](0x1)[_0x40f57c(0x13a)]('-'):'',_0x2ce300=_0x12e1f1||_0x45e9f0[_0x40f57c(0x136)]||_0x40f57c(0x160),_0x2d2ed5=!_0x4cb3cf,_0x4cf595=a16_0x5314fd(_0x40f57c(0x12f)+_0x45e9f0[_0x40f57c(0x156)]+'...')[_0x40f57c(0x143)]();try{const {configArray:_0x23dcde}=await fetchModelList(_0x45e9f0[_0x40f57c(0x156)],_0x45e9f0[_0x40f57c(0x14b)]),_0x175b65=await generateApiFile(_0x23dcde,_0x4dce5d,_0x45e9f0[_0x40f57c(0x156)],_0x2d2ed5,getEnv(),_0x2ce300);_0x4cf595['succeed']('Pulled\x20'+_0x23dcde['length']+'\x20dataset(s),\x20generated\x20'+_0x175b65[_0x40f57c(0x133)]+_0x40f57c(0x130));const _0x59b440=_0x4dce5d?_0x4dce5d+'-api':'api',_0x148b8e=_0x4dce5d?_0x4dce5d+_0x40f57c(0x141):_0x40f57c(0x13b),_0x145ab1=_0x2ce300[_0x40f57c(0x12e)]('/')?_0x2ce300:_0x2ce300+'/';return console[_0x40f57c(0x14d)]('\x20\x20•\x20'+_0x145ab1+_0x59b440+'.ts'),console[_0x40f57c(0x14d)](_0x40f57c(0x158)+_0x145ab1+_0x148b8e+'.ts'),{'ok':!![],'data':{'datasetCount':_0x23dcde[_0x40f57c(0x134)],'modelCount':_0x175b65[_0x40f57c(0x133)]}};}catch(_0x117d52){_0x4cf595[_0x40f57c(0x14a)]('Failed:\x20'+(_0x117d52 instanceof Error?_0x117d52['message']:String(_0x117d52)));throw _0x117d52;}}};
1
+ const a16_0x14a646=a16_0x315b;(function(_0x2ac997,_0x538410){const _0x21fc49=a16_0x315b,_0x5acbac=_0x2ac997();while(!![]){try{const _0x3cc036=-parseInt(_0x21fc49(0x145))/0x1+-parseInt(_0x21fc49(0x15c))/0x2+parseInt(_0x21fc49(0x156))/0x3+parseInt(_0x21fc49(0x138))/0x4+-parseInt(_0x21fc49(0x150))/0x5*(-parseInt(_0x21fc49(0x15a))/0x6)+-parseInt(_0x21fc49(0x15d))/0x7*(parseInt(_0x21fc49(0x149))/0x8)+parseInt(_0x21fc49(0x14d))/0x9;if(_0x3cc036===_0x538410)break;else _0x5acbac['push'](_0x5acbac['shift']());}catch(_0x5194d2){_0x5acbac['push'](_0x5acbac['shift']());}}}(a16_0x1e1f,0xe184b));function a16_0x1e1f(){const _0x1f7af6=['api','\x20failed','\x20app(s)\x20failed','filter','19140FANLdP','modelCount','Pulled\x20','apiFilePath','26502piNsVr','\x20dataset(s)\x20→\x20','3138970EMrhoB','1743whSwrJ','length','\x20\x20•\x20','Output\x20directory\x20(default:\x20./src/api/)','Done:\x20','\x22\x20not\x20found\x20in\x20config.\x20Available:\x20','.ts','Failed:\x20','Pulling\x20','Override\x20app\x20code','fail','name','2184540TcxUcV','join','appCode','\x20model(s)',')...','Pull\x20datasets\x20and\x20generate\x20API\x20config\x20files\x20(./src/api/)','appcode','log','apiDir','isDefault','includes','selectedAppName','output','946078epfaSc','map','\x20succeeded,\x20','cookie','31384SLFmbk','clientFilePath','str','split','24794379xgbgmN','App\x20\x22','string','1255FevLUj','-api'];a16_0x1e1f=function(){return _0x1f7af6;};return a16_0x1e1f();}import a16_0x40754e from'ora';import{initEnv,getEnv}from'../../constant/env.js';import{fetchModelList}from'../../api/fetch-model-list.js';function a16_0x315b(_0x22f1f2,_0x59c277){_0x22f1f2=_0x22f1f2-0x132;const _0x1e1f80=a16_0x1e1f();let _0x315b10=_0x1e1f80[_0x22f1f2];return _0x315b10;}import{generateApiFile}from'../../api/generate-api-file.js';import{getMultiAppConfigs}from'../../utils/config.js';export const apiPull={'service':a16_0x14a646(0x152),'command':'pull','description':a16_0x14a646(0x13d),'risk':'write','requiresAppCode':!![],'hasFormat':![],'flags':[{'name':a16_0x14a646(0x13e),'type':a16_0x14a646(0x14f),'description':a16_0x14a646(0x135),'hidden':!![]},{'name':a16_0x14a646(0x144),'type':a16_0x14a646(0x14f),'description':a16_0x14a646(0x160)}],async 'execute'(_0xe265){const _0x3c6d6=a16_0x14a646,_0x1a0f33=_0xe265['str'](_0x3c6d6(0x13e)),_0x1ab2ba=_0xe265[_0x3c6d6(0x14b)](_0x3c6d6(0x144))||undefined;if(!_0x1a0f33){let _0x32cb41=getMultiAppConfigs();if(_0x32cb41&&_0x32cb41[_0x3c6d6(0x15e)]>0x0){if(_0xe265['selectedAppName']){const _0x2ad428=_0x32cb41[_0x3c6d6(0x155)](_0x562856=>_0x562856[_0x3c6d6(0x137)]===_0xe265[_0x3c6d6(0x143)]);if(_0x2ad428[_0x3c6d6(0x15e)]===0x0){const _0x57b830=_0x32cb41[_0x3c6d6(0x146)](_0x459cf2=>_0x459cf2['name'])[_0x3c6d6(0x139)](',\x20');return{'ok':![],'message':_0x3c6d6(0x14e)+_0xe265[_0x3c6d6(0x143)]+_0x3c6d6(0x162)+_0x57b830};}_0x32cb41=_0x2ad428;}let _0x278a5a=0x0,_0xabd5dc=0x0;for(const _0x5d1a9f of _0x32cb41){const _0x289822=_0x5d1a9f[_0x3c6d6(0x148)]||_0xe265[_0x3c6d6(0x148)],_0x3bd95a=_0x5d1a9f['env']||'production';initEnv(_0x3bd95a);const _0x4371bf=_0x5d1a9f[_0x3c6d6(0x140)]||_0x1ab2ba||'./src/api/',_0x4bd0fb=_0x5d1a9f[_0x3c6d6(0x141)]?'':_0x5d1a9f['name']||_0x5d1a9f[_0x3c6d6(0x13e)],_0x400afb=a16_0x40754e(_0x3c6d6(0x134)+_0x5d1a9f[_0x3c6d6(0x137)]+'\x20('+_0x5d1a9f[_0x3c6d6(0x13e)]+_0x3c6d6(0x13c))['start']();try{const {configArray:_0x4bdd95}=await fetchModelList(_0x5d1a9f[_0x3c6d6(0x13e)],_0x289822),_0x5275e5=await generateApiFile(_0x4bdd95,_0x4bd0fb,_0x5d1a9f[_0x3c6d6(0x13e)],_0x5d1a9f['isDefault'],_0x3bd95a,_0x4371bf,_0x5d1a9f[_0x3c6d6(0x137)]);_0x400afb['succeed'](_0x5d1a9f[_0x3c6d6(0x137)]+':\x20'+_0x4bdd95[_0x3c6d6(0x15e)]+_0x3c6d6(0x15b)+_0x5275e5['modelCount']+_0x3c6d6(0x13b)),console[_0x3c6d6(0x13f)](_0x3c6d6(0x15f)+_0x5275e5[_0x3c6d6(0x159)]),console[_0x3c6d6(0x13f)]('\x20\x20•\x20'+_0x5275e5[_0x3c6d6(0x14a)]),_0x278a5a++;}catch(_0x2e5a6a){_0x400afb['fail'](_0x5d1a9f['name']+':\x20'+(_0x2e5a6a instanceof Error?_0x2e5a6a['message']:String(_0x2e5a6a))),_0xabd5dc++;}}return console[_0x3c6d6(0x13f)](),_0xabd5dc>0x0&&console['error']('!\x20'+_0xabd5dc+_0x3c6d6(0x154)),{'ok':_0xabd5dc===0x0,'message':_0x3c6d6(0x161)+_0x278a5a+_0x3c6d6(0x147)+_0xabd5dc+_0x3c6d6(0x153)};}}const _0x3f8f84=_0x1a0f33&&_0x1a0f33[_0x3c6d6(0x142)]('-')?_0x1a0f33[_0x3c6d6(0x14c)]('-')['slice'](0x1)[_0x3c6d6(0x139)]('-'):'',_0x4ea3c5=_0x1ab2ba||_0xe265['apiDir']||'./src/api/',_0x325684=!_0x1a0f33,_0x4ddb8c=a16_0x40754e('Pulling\x20API\x20config\x20for\x20'+_0xe265[_0x3c6d6(0x13a)]+'...')['start']();try{const {configArray:_0x5c3a3c}=await fetchModelList(_0xe265['appCode'],_0xe265[_0x3c6d6(0x148)]),_0x4b14c8=await generateApiFile(_0x5c3a3c,_0x3f8f84,_0xe265['appCode'],_0x325684,getEnv(),_0x4ea3c5);_0x4ddb8c['succeed'](_0x3c6d6(0x158)+_0x5c3a3c['length']+'\x20dataset(s),\x20generated\x20'+_0x4b14c8[_0x3c6d6(0x157)]+_0x3c6d6(0x13b));const _0x510adb=_0x3f8f84?_0x3f8f84+_0x3c6d6(0x151):_0x3c6d6(0x152),_0x45b9cc=_0x3f8f84?_0x3f8f84+'-client':'client',_0x4b6e48=_0x4ea3c5['endsWith']('/')?_0x4ea3c5:_0x4ea3c5+'/';return console[_0x3c6d6(0x13f)](_0x3c6d6(0x15f)+_0x4b6e48+_0x510adb+_0x3c6d6(0x132)),console[_0x3c6d6(0x13f)](_0x3c6d6(0x15f)+_0x4b6e48+_0x45b9cc+_0x3c6d6(0x132)),{'ok':!![],'data':{'datasetCount':_0x5c3a3c[_0x3c6d6(0x15e)],'modelCount':_0x4b14c8['modelCount']}};}catch(_0x263c45){_0x4ddb8c[_0x3c6d6(0x136)](_0x3c6d6(0x133)+(_0x263c45 instanceof Error?_0x263c45['message']:String(_0x263c45)));throw _0x263c45;}}};
@@ -1 +1 @@
1
- const a17_0x31fb62=a17_0x2097;(function(_0x2668ac,_0x5162d7){const _0x10e831=a17_0x2097,_0x281225=_0x2668ac();while(!![]){try{const _0x58574a=parseInt(_0x10e831(0x190))/0x1*(parseInt(_0x10e831(0x1a4))/0x2)+parseInt(_0x10e831(0x180))/0x3*(parseInt(_0x10e831(0x1a3))/0x4)+-parseInt(_0x10e831(0x17b))/0x5+parseInt(_0x10e831(0x1bc))/0x6*(-parseInt(_0x10e831(0x188))/0x7)+parseInt(_0x10e831(0x183))/0x8*(parseInt(_0x10e831(0x18e))/0x9)+parseInt(_0x10e831(0x19d))/0xa*(-parseInt(_0x10e831(0x1ad))/0xb)+-parseInt(_0x10e831(0x175))/0xc*(-parseInt(_0x10e831(0x1ab))/0xd);if(_0x58574a===_0x5162d7)break;else _0x281225['push'](_0x281225['shift']());}catch(_0x499d33){_0x281225['push'](_0x281225['shift']());}}}(a17_0x5a32,0x99ad1));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function a17_0x2097(_0x2d8563,_0x393c87){_0x2d8563=_0x2d8563-0x173;const _0x5a322e=a17_0x5a32();let _0x209799=_0x5a322e[_0x2d8563];return _0x209799;}function getConfigPath(_0x135190={}){const _0x2f6161=a17_0x2097,_0x5034e7=_0x135190[_0x2f6161(0x189)]?'global':_0x2f6161(0x184);return resolveWriteConfigPath(_0x5034e7);}function readConfig(_0x1315fd={}){return readConfigFile(getConfigPath(_0x1315fd));}function writeConfig(_0x1fa89c,_0xfc7b1b={}){writeConfigFile(getConfigPath(_0xfc7b1b),_0x1fa89c);}function listApps(_0x168259){const _0x1ac6fb=a17_0x2097,{apps:_0x5d1fb8,defaultApp:_0x473402,currentApp:_0x4eedb2}=_0x168259[_0x1ac6fb(0x18c)],_0x2c3f48=Object[_0x1ac6fb(0x198)](_0x5d1fb8);if(_0x2c3f48[_0x1ac6fb(0x19f)]===0x0){const _0x3d05c6=_0x168259['config']['appCode'];_0x3d05c6?(console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x185)),console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x19a)+_0x3d05c6+_0x1ac6fb(0x176)+_0x168259[_0x1ac6fb(0x18c)][_0x1ac6fb(0x1ae)]),console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1b7))):console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x17d));return;}console[_0x1ac6fb(0x1bb)]('Configured\x20apps:\x0a');for(const [_0x3c3ef5,_0x5812fe]of _0x2c3f48){const _0x2d8560=_0x3c3ef5===_0x473402,_0x358b09=_0x3c3ef5===_0x4eedb2,_0xccffa7=_0x358b09?'\x20*':_0x2d8560?_0x1ac6fb(0x1aa):'';console[_0x1ac6fb(0x1bb)]('\x20\x20'+_0x3c3ef5+_0xccffa7),console[_0x1ac6fb(0x1bb)]('\x20\x20\x20\x20appcode:\x20'+_0x5812fe[_0x1ac6fb(0x187)]);if(_0x5812fe['env'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x194)+_0x5812fe['env']);if(_0x5812fe[_0x1ac6fb(0x1b9)])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1b4)+_0x5812fe[_0x1ac6fb(0x1b9)]);if(_0x5812fe['cookie'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x186));if(_0x5812fe[_0x1ac6fb(0x197)])console['log'](_0x1ac6fb(0x1a0));if(_0x5812fe['format'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x191)+_0x5812fe['format']);if(_0x5812fe[_0x1ac6fb(0x179)])console['log'](_0x1ac6fb(0x17c)+_0x5812fe['pageSize']);if(_0x5812fe['riskLevel'])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x196)+_0x5812fe[_0x1ac6fb(0x18b)]);if(_0x5812fe[_0x1ac6fb(0x1b6)])console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1b8)+_0x5812fe[_0x1ac6fb(0x1b6)]);console[_0x1ac6fb(0x1bb)]('');}_0x473402?console[_0x1ac6fb(0x1bb)](_0x1ac6fb(0x1a2)+_0x473402):console['log'](_0x1ac6fb(0x1ba));}function useApp(_0x101794,_0xb84618,_0x2c35a3){const _0x26619c=a17_0x2097,_0x4d56d4=_0xb84618[0x0];!_0x4d56d4&&(console[_0x26619c(0x19b)]('Usage:\x20rabetbase\x20app\x20use\x20<name>\x20[--global]'),process[_0x26619c(0x1b0)](0x1));const _0x1235e6=readConfig(_0x2c35a3),_0x523e55=_0x1235e6[_0x26619c(0x1a7)]||{};if(!_0x523e55[_0x4d56d4]){const _0x8e1a33=Object[_0x26619c(0x195)](_0x523e55);_0x8e1a33[_0x26619c(0x19f)]===0x0?console[_0x26619c(0x19b)](_0x26619c(0x199)+_0x4d56d4+_0x26619c(0x1a6)):console[_0x26619c(0x19b)]('App\x20\x22'+_0x4d56d4+_0x26619c(0x1a5)+_0x8e1a33[_0x26619c(0x1a1)](',\x20')),process['exit'](0x1);}_0x1235e6[_0x26619c(0x1ac)]=_0x4d56d4,writeConfig(_0x1235e6,_0x2c35a3);const _0x1318f0=_0x2c35a3[_0x26619c(0x189)]?_0x26619c(0x18f):'';console['log'](_0x26619c(0x192)+_0x4d56d4+_0x26619c(0x1b1)+_0x523e55[_0x4d56d4][_0x26619c(0x187)]+')'+_0x1318f0);}function migrateLegacySingleApp(_0x4ab5b6,_0x2e6e99){const _0x4f1bb5=a17_0x2097,_0x3c8ca0=_0x4ab5b6[_0x4f1bb5(0x187)]||_0x4ab5b6[_0x4f1bb5(0x177)];if(!_0x3c8ca0)return;const _0x5ef0cf=String(_0x3c8ca0);if(_0x5ef0cf===_0x2e6e99)return;const _0x1b69af={'appcode':_0x3c8ca0};if(_0x4ab5b6['env'])_0x1b69af[_0x4f1bb5(0x1ae)]=_0x4ab5b6[_0x4f1bb5(0x1ae)];if(_0x4ab5b6[_0x4f1bb5(0x1b9)])_0x1b69af[_0x4f1bb5(0x1b9)]=_0x4ab5b6['apiDir'];if(_0x4ab5b6[_0x4f1bb5(0x17a)])_0x1b69af[_0x4f1bb5(0x17a)]=_0x4ab5b6[_0x4f1bb5(0x17a)];if(_0x4ab5b6[_0x4f1bb5(0x197)])_0x1b69af[_0x4f1bb5(0x197)]=_0x4ab5b6[_0x4f1bb5(0x197)];if(_0x4ab5b6[_0x4f1bb5(0x181)])_0x1b69af[_0x4f1bb5(0x181)]=_0x4ab5b6[_0x4f1bb5(0x181)];if(_0x4ab5b6[_0x4f1bb5(0x179)])_0x1b69af[_0x4f1bb5(0x179)]=_0x4ab5b6[_0x4f1bb5(0x179)];if(_0x4ab5b6[_0x4f1bb5(0x18b)])_0x1b69af[_0x4f1bb5(0x18b)]=_0x4ab5b6['riskLevel'];if(_0x4ab5b6[_0x4f1bb5(0x1b6)])_0x1b69af['locale']=_0x4ab5b6[_0x4f1bb5(0x1b6)];_0x4ab5b6[_0x4f1bb5(0x1a7)][_0x5ef0cf]=_0x1b69af,_0x4ab5b6['defaultApp']=_0x5ef0cf,delete _0x4ab5b6['appcode'],delete _0x4ab5b6[_0x4f1bb5(0x177)],console[_0x4f1bb5(0x1bb)](_0x4f1bb5(0x1a8)+_0x5ef0cf+_0x4f1bb5(0x17f));}function addApp(_0x214c1e,_0x39528e,_0x18ca06){const _0x3eeda7=a17_0x2097,_0x5bc3a7=_0x39528e[0x0];!_0x5bc3a7&&(console['error']('Usage:\x20rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>\x20[--env\x20<env>]\x20[--apiDir\x20<dir>]\x20[--global]'),process['exit'](0x1));const _0x52db97=_0x18ca06['appcode'];!_0x52db97&&(console['error'](_0x3eeda7(0x1b5)),process[_0x3eeda7(0x1b0)](0x1));const _0x401508=readConfig(_0x18ca06);if(!_0x401508[_0x3eeda7(0x1a7)])_0x401508[_0x3eeda7(0x1a7)]={};Object[_0x3eeda7(0x195)](_0x401508[_0x3eeda7(0x1a7)])[_0x3eeda7(0x19f)]===0x0&&migrateLegacySingleApp(_0x401508,_0x5bc3a7);const _0x45d6e1={'appcode':_0x52db97};if(_0x18ca06[_0x3eeda7(0x1ae)])_0x45d6e1[_0x3eeda7(0x1ae)]=_0x18ca06[_0x3eeda7(0x1ae)];if(_0x18ca06[_0x3eeda7(0x1b9)]||_0x18ca06[_0x3eeda7(0x19c)])_0x45d6e1['apiDir']=_0x18ca06[_0x3eeda7(0x1b9)]||_0x18ca06[_0x3eeda7(0x19c)];if(_0x18ca06[_0x3eeda7(0x17a)])_0x45d6e1[_0x3eeda7(0x17a)]=_0x18ca06['cookie'];if(_0x18ca06[_0x3eeda7(0x197)]||_0x18ca06[_0x3eeda7(0x1b2)])_0x45d6e1['accessKey']=_0x18ca06[_0x3eeda7(0x197)]||_0x18ca06[_0x3eeda7(0x1b2)];if(_0x18ca06[_0x3eeda7(0x181)])_0x45d6e1[_0x3eeda7(0x181)]=_0x18ca06['format'];if(_0x18ca06['pageSize']||_0x18ca06['pagesize'])_0x45d6e1['pageSize']=Number(_0x18ca06[_0x3eeda7(0x179)]||_0x18ca06[_0x3eeda7(0x182)]);if(_0x18ca06[_0x3eeda7(0x18b)]||_0x18ca06[_0x3eeda7(0x193)])_0x45d6e1[_0x3eeda7(0x18b)]=_0x18ca06['riskLevel']||_0x18ca06[_0x3eeda7(0x193)];if(_0x18ca06['locale'])_0x45d6e1[_0x3eeda7(0x1b6)]=_0x18ca06[_0x3eeda7(0x1b6)];const _0x373c4b=!!_0x401508[_0x3eeda7(0x1a7)][_0x5bc3a7];_0x401508[_0x3eeda7(0x1a7)][_0x5bc3a7]=_0x45d6e1;!_0x401508['defaultApp']&&(_0x401508[_0x3eeda7(0x1ac)]=_0x5bc3a7);writeConfig(_0x401508,_0x18ca06);const _0x288ec7=_0x18ca06['global']?_0x3eeda7(0x18f):'';console['log']((_0x373c4b?_0x3eeda7(0x1af):_0x3eeda7(0x17e))+'\x20app\x20\x22'+_0x5bc3a7+'\x22\x20(appcode:\x20'+_0x52db97+')'+_0x288ec7),_0x401508[_0x3eeda7(0x1ac)]===_0x5bc3a7&&!_0x373c4b&&console[_0x3eeda7(0x1bb)](_0x3eeda7(0x173));}function removeApp(_0x461fee,_0x2e0ddf,_0x1aa415){const _0x5cc633=a17_0x2097,_0x554040=_0x2e0ddf[0x0];!_0x554040&&(console[_0x5cc633(0x19b)](_0x5cc633(0x18d)),process[_0x5cc633(0x1b0)](0x1));const _0x1220fe=readConfig(_0x1aa415);(!_0x1220fe[_0x5cc633(0x1a7)]||!_0x1220fe[_0x5cc633(0x1a7)][_0x554040])&&(console[_0x5cc633(0x19b)]('App\x20\x22'+_0x554040+_0x5cc633(0x19e)),process[_0x5cc633(0x1b0)](0x1));delete _0x1220fe[_0x5cc633(0x1a7)][_0x554040];if(_0x1220fe[_0x5cc633(0x1ac)]===_0x554040){const _0x51d12c=Object[_0x5cc633(0x195)](_0x1220fe['apps']);_0x1220fe['defaultApp']=_0x51d12c[_0x5cc633(0x19f)]>0x0?_0x51d12c[0x0]:undefined,_0x1220fe['defaultApp']?console[_0x5cc633(0x1bb)](_0x5cc633(0x178)+_0x1220fe[_0x5cc633(0x1ac)]+'\x22.'):delete _0x1220fe[_0x5cc633(0x1ac)];}Object['keys'](_0x1220fe[_0x5cc633(0x1a7)])[_0x5cc633(0x19f)]===0x0&&(delete _0x1220fe[_0x5cc633(0x1a7)],delete _0x1220fe[_0x5cc633(0x1ac)]),writeConfig(_0x1220fe,_0x1aa415),console[_0x5cc633(0x1bb)]('Removed\x20app\x20\x22'+_0x554040+'\x22.');}export const appCommand={'name':a17_0x31fb62(0x177),'description':a17_0x31fb62(0x1a9),async 'run'(_0x501e5d,_0x1225e3,_0x5c55b1){const _0x2827aa=a17_0x31fb62,_0x3cd218=_0x1225e3[0x0],_0x520879=_0x1225e3['slice'](0x1);switch(_0x3cd218){case _0x2827aa(0x1b3):listApps(_0x501e5d);break;case'use':useApp(_0x501e5d,_0x520879,_0x5c55b1);break;case _0x2827aa(0x174):addApp(_0x501e5d,_0x520879,_0x5c55b1);break;case _0x2827aa(0x18a):removeApp(_0x501e5d,_0x520879,_0x5c55b1);break;default:listApps(_0x501e5d);break;}}};function a17_0x5a32(){const _0x5d3ead=['\x20\x20\x20\x20apiDir:\x20\x20\x20\x20','--appcode\x20is\x20required\x20when\x20adding\x20an\x20app.','locale','\x0aUse\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.','\x20\x20\x20\x20locale:\x20\x20\x20\x20','apiDir','No\x20default\x20app\x20set.\x20Use\x20`rabetbase\x20app\x20use\x20<name>`\x20to\x20set\x20one.','log','2969022xshCwP','Set\x20as\x20default\x20app.','add','12KGuCge','\x20\x20env:\x20','app','Default\x20app\x20changed\x20to\x20\x22','pageSize','cookie','5190215eWNbyc','\x20\x20\x20\x20pageSize:\x20\x20','No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','Added','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','3pxJOfO','format','pagesize','356280nuGMgy','project','Single-app\x20mode:','\x20\x20\x20\x20cookie:\x20\x20\x20\x20(set)','appcode','14grkXvN','global','remove','riskLevel','config','Usage:\x20rabetbase\x20app\x20remove\x20<name>\x20[--global]','117WhjoIJ','\x20(global)','2HqBiqU','\x20\x20\x20\x20format:\x20\x20\x20\x20','Default\x20app\x20set\x20to\x20\x22','risklevel','\x20\x20\x20\x20env:\x20\x20\x20\x20\x20\x20\x20','keys','\x20\x20\x20\x20riskLevel:\x20','accessKey','entries','No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20','\x20\x20appcode:\x20','error','apidir','112030qPcAHJ','\x22\x20not\x20found.','length','\x20\x20\x20\x20accessKey:\x20(set)','join','Default:\x20','2653508KqNCDj','276658RGshVf','\x22\x20not\x20found.\x20Available:\x20','\x20--appcode\x20<code>`\x20first.','apps','Migrated\x20existing\x20app\x20\x22','Manage\x20multiple\x20apps\x20in\x20one\x20workspace','\x20(default)','18728645DmQRVg','defaultApp','297YgDsYj','env','Updated','exit','\x22\x20(appcode:\x20','accesskey','list'];a17_0x5a32=function(){return _0x5d3ead;};return a17_0x5a32();}
1
+ const a17_0x1811de=a17_0x35d5;(function(_0x19aa1f,_0x2d5ee6){const _0x3f5d64=a17_0x35d5,_0x1b6086=_0x19aa1f();while(!![]){try{const _0x219622=parseInt(_0x3f5d64(0x15e))/0x1+-parseInt(_0x3f5d64(0x130))/0x2+parseInt(_0x3f5d64(0x15c))/0x3+-parseInt(_0x3f5d64(0x15a))/0x4*(-parseInt(_0x3f5d64(0x13d))/0x5)+-parseInt(_0x3f5d64(0x148))/0x6+parseInt(_0x3f5d64(0x154))/0x7*(-parseInt(_0x3f5d64(0x163))/0x8)+parseInt(_0x3f5d64(0x15f))/0x9;if(_0x219622===_0x2d5ee6)break;else _0x1b6086['push'](_0x1b6086['shift']());}catch(_0x512e83){_0x1b6086['push'](_0x1b6086['shift']());}}}(a17_0x4e84,0x8a66e));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../context.js';function getConfigPath(_0x337d16={}){const _0x23c405=a17_0x35d5,_0x3fada3=_0x337d16[_0x23c405(0x156)]?_0x23c405(0x156):_0x23c405(0x127);return resolveWriteConfigPath(_0x3fada3);}function readConfig(_0xfbd855={}){return readConfigFile(getConfigPath(_0xfbd855));}function a17_0x35d5(_0x38a919,_0xd359df){_0x38a919=_0x38a919-0x124;const _0x4e845f=a17_0x4e84();let _0x35d561=_0x4e845f[_0x38a919];return _0x35d561;}function writeConfig(_0x3bc900,_0x11717f={}){writeConfigFile(getConfigPath(_0x11717f),_0x3bc900);}function listApps(_0x73dfe6){const _0x2eb09c=a17_0x35d5,{apps:_0x501c19,defaultApp:_0x25f315,currentApp:_0x178242}=_0x73dfe6['config'],_0x1284d0=Object[_0x2eb09c(0x147)](_0x501c19);if(_0x1284d0[_0x2eb09c(0x12f)]===0x0){const _0x13c087=_0x73dfe6[_0x2eb09c(0x135)]['appCode'];_0x13c087?(console[_0x2eb09c(0x13a)](_0x2eb09c(0x12a)),console[_0x2eb09c(0x13a)](_0x2eb09c(0x139)+_0x13c087+'\x20\x20env:\x20'+_0x73dfe6[_0x2eb09c(0x135)][_0x2eb09c(0x129)]),console[_0x2eb09c(0x13a)](_0x2eb09c(0x162))):console[_0x2eb09c(0x13a)]('No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.');return;}console[_0x2eb09c(0x13a)](_0x2eb09c(0x159));for(const [_0x30db2d,_0x21aab2]of _0x1284d0){const _0x5c8e05=_0x30db2d===_0x25f315,_0xe5621e=_0x30db2d===_0x178242,_0x4b7dd0=_0xe5621e?'\x20*':_0x5c8e05?'\x20(default)':'';console[_0x2eb09c(0x13a)]('\x20\x20'+_0x30db2d+_0x4b7dd0),console[_0x2eb09c(0x13a)](_0x2eb09c(0x133)+_0x21aab2['appcode']);if(_0x21aab2['env'])console['log'](_0x2eb09c(0x13e)+_0x21aab2[_0x2eb09c(0x129)]);if(_0x21aab2[_0x2eb09c(0x14e)])console[_0x2eb09c(0x13a)](_0x2eb09c(0x152)+_0x21aab2['apiDir']);if(_0x21aab2[_0x2eb09c(0x137)])console[_0x2eb09c(0x13a)](_0x2eb09c(0x146));if(_0x21aab2[_0x2eb09c(0x149)])console['log'](_0x2eb09c(0x14c));if(_0x21aab2[_0x2eb09c(0x158)])console[_0x2eb09c(0x13a)](_0x2eb09c(0x15b)+_0x21aab2[_0x2eb09c(0x158)]);if(_0x21aab2[_0x2eb09c(0x14b)])console[_0x2eb09c(0x13a)]('\x20\x20\x20\x20pageSize:\x20\x20'+_0x21aab2[_0x2eb09c(0x14b)]);if(_0x21aab2[_0x2eb09c(0x160)])console[_0x2eb09c(0x13a)](_0x2eb09c(0x164)+_0x21aab2[_0x2eb09c(0x160)]);if(_0x21aab2[_0x2eb09c(0x161)])console['log']('\x20\x20\x20\x20locale:\x20\x20\x20\x20'+_0x21aab2[_0x2eb09c(0x161)]);console['log']('');}_0x25f315?console[_0x2eb09c(0x13a)](_0x2eb09c(0x132)+_0x25f315):console['log']('No\x20default\x20app\x20set.\x20Use\x20`rabetbase\x20app\x20use\x20<name>`\x20to\x20set\x20one.');}function useApp(_0x2cadb7,_0x2afdcc,_0x1bc910){const _0x4f6636=a17_0x35d5,_0x50d7a0=_0x2afdcc[0x0];!_0x50d7a0&&(console['error'](_0x4f6636(0x140)),process[_0x4f6636(0x13c)](0x1));const _0x35dcda=readConfig(_0x1bc910),_0x4a840c=_0x35dcda[_0x4f6636(0x13f)]||{};if(!_0x4a840c[_0x50d7a0]){const _0xc17521=Object[_0x4f6636(0x155)](_0x4a840c);_0xc17521['length']===0x0?console['error']('No\x20apps\x20configured.\x20Use\x20`rabetbase\x20app\x20add\x20'+_0x50d7a0+_0x4f6636(0x131)):console['error'](_0x4f6636(0x14f)+_0x50d7a0+_0x4f6636(0x138)+_0xc17521['join'](',\x20')),process[_0x4f6636(0x13c)](0x1);}_0x35dcda['defaultApp']=_0x50d7a0,writeConfig(_0x35dcda,_0x1bc910);const _0x439d8c=_0x1bc910[_0x4f6636(0x156)]?_0x4f6636(0x12e):'';console['log'](_0x4f6636(0x12b)+_0x50d7a0+_0x4f6636(0x145)+_0x4a840c[_0x50d7a0][_0x4f6636(0x136)]+')'+_0x439d8c);}function migrateLegacySingleApp(_0x91965f,_0x157549){const _0x454460=a17_0x35d5,_0xbca0fb=_0x91965f[_0x454460(0x136)]||_0x91965f['app'];if(!_0xbca0fb)return;const _0x107745=String(_0xbca0fb);if(_0x107745===_0x157549)return;const _0x34b86d={'appcode':_0xbca0fb};if(_0x91965f[_0x454460(0x129)])_0x34b86d['env']=_0x91965f[_0x454460(0x129)];if(_0x91965f['apiDir'])_0x34b86d['apiDir']=_0x91965f[_0x454460(0x14e)];if(_0x91965f[_0x454460(0x137)])_0x34b86d[_0x454460(0x137)]=_0x91965f[_0x454460(0x137)];if(_0x91965f[_0x454460(0x149)])_0x34b86d[_0x454460(0x149)]=_0x91965f[_0x454460(0x149)];if(_0x91965f[_0x454460(0x158)])_0x34b86d['format']=_0x91965f['format'];if(_0x91965f[_0x454460(0x14b)])_0x34b86d[_0x454460(0x14b)]=_0x91965f[_0x454460(0x14b)];if(_0x91965f['riskLevel'])_0x34b86d[_0x454460(0x160)]=_0x91965f[_0x454460(0x160)];if(_0x91965f[_0x454460(0x161)])_0x34b86d[_0x454460(0x161)]=_0x91965f[_0x454460(0x161)];_0x91965f['apps'][_0x107745]=_0x34b86d,_0x91965f[_0x454460(0x144)]=_0x107745,delete _0x91965f[_0x454460(0x136)],delete _0x91965f[_0x454460(0x126)],console[_0x454460(0x13a)](_0x454460(0x153)+_0x107745+_0x454460(0x142));}function addApp(_0x511d34,_0x4450b3,_0x1c707d){const _0x519f47=a17_0x35d5,_0x9ade5d=_0x4450b3[0x0];!_0x9ade5d&&(console[_0x519f47(0x125)]('Usage:\x20rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>\x20[--env\x20<env>]\x20[--apiDir\x20<dir>]\x20[--global]'),process[_0x519f47(0x13c)](0x1));const _0xf55ede=_0x1c707d[_0x519f47(0x136)];!_0xf55ede&&(console[_0x519f47(0x125)](_0x519f47(0x143)),process[_0x519f47(0x13c)](0x1));const _0x5cb5cd=readConfig(_0x1c707d);if(!_0x5cb5cd[_0x519f47(0x13f)])_0x5cb5cd[_0x519f47(0x13f)]={};Object['keys'](_0x5cb5cd[_0x519f47(0x13f)])[_0x519f47(0x12f)]===0x0&&migrateLegacySingleApp(_0x5cb5cd,_0x9ade5d);const _0x5d560a={'appcode':_0xf55ede};if(_0x1c707d['env'])_0x5d560a[_0x519f47(0x129)]=_0x1c707d['env'];if(_0x1c707d[_0x519f47(0x14e)]||_0x1c707d[_0x519f47(0x14a)])_0x5d560a[_0x519f47(0x14e)]=_0x1c707d[_0x519f47(0x14e)]||_0x1c707d['apidir'];if(_0x1c707d[_0x519f47(0x137)])_0x5d560a[_0x519f47(0x137)]=_0x1c707d[_0x519f47(0x137)];if(_0x1c707d[_0x519f47(0x149)]||_0x1c707d[_0x519f47(0x165)])_0x5d560a[_0x519f47(0x149)]=_0x1c707d[_0x519f47(0x149)]||_0x1c707d['accesskey'];if(_0x1c707d['format'])_0x5d560a['format']=_0x1c707d[_0x519f47(0x158)];if(_0x1c707d[_0x519f47(0x14b)]||_0x1c707d[_0x519f47(0x150)])_0x5d560a['pageSize']=Number(_0x1c707d['pageSize']||_0x1c707d[_0x519f47(0x150)]);if(_0x1c707d[_0x519f47(0x160)]||_0x1c707d[_0x519f47(0x14d)])_0x5d560a['riskLevel']=_0x1c707d[_0x519f47(0x160)]||_0x1c707d['risklevel'];if(_0x1c707d[_0x519f47(0x161)])_0x5d560a[_0x519f47(0x161)]=_0x1c707d['locale'];const _0x444395=!!_0x5cb5cd['apps'][_0x9ade5d];_0x5cb5cd[_0x519f47(0x13f)][_0x9ade5d]=_0x5d560a;!_0x5cb5cd[_0x519f47(0x144)]&&(_0x5cb5cd['defaultApp']=_0x9ade5d);writeConfig(_0x5cb5cd,_0x1c707d);const _0xdf495e=_0x1c707d['global']?_0x519f47(0x12e):'';console['log']((_0x444395?_0x519f47(0x141):_0x519f47(0x12c))+_0x519f47(0x157)+_0x9ade5d+_0x519f47(0x145)+_0xf55ede+')'+_0xdf495e),_0x5cb5cd['defaultApp']===_0x9ade5d&&!_0x444395&&console[_0x519f47(0x13a)](_0x519f47(0x134));}function removeApp(_0x1851ec,_0x267849,_0x1542a5){const _0x3fbf0e=a17_0x35d5,_0x5ac3ed=_0x267849[0x0];!_0x5ac3ed&&(console[_0x3fbf0e(0x125)]('Usage:\x20rabetbase\x20app\x20remove\x20<name>\x20[--global]'),process[_0x3fbf0e(0x13c)](0x1));const _0x283692=readConfig(_0x1542a5);(!_0x283692['apps']||!_0x283692[_0x3fbf0e(0x13f)][_0x5ac3ed])&&(console['error']('App\x20\x22'+_0x5ac3ed+_0x3fbf0e(0x12d)),process['exit'](0x1));delete _0x283692['apps'][_0x5ac3ed];if(_0x283692['defaultApp']===_0x5ac3ed){const _0x1642bd=Object[_0x3fbf0e(0x155)](_0x283692[_0x3fbf0e(0x13f)]);_0x283692[_0x3fbf0e(0x144)]=_0x1642bd[_0x3fbf0e(0x12f)]>0x0?_0x1642bd[0x0]:undefined,_0x283692[_0x3fbf0e(0x144)]?console[_0x3fbf0e(0x13a)]('Default\x20app\x20changed\x20to\x20\x22'+_0x283692[_0x3fbf0e(0x144)]+'\x22.'):delete _0x283692['defaultApp'];}Object[_0x3fbf0e(0x155)](_0x283692[_0x3fbf0e(0x13f)])[_0x3fbf0e(0x12f)]===0x0&&(delete _0x283692[_0x3fbf0e(0x13f)],delete _0x283692[_0x3fbf0e(0x144)]),writeConfig(_0x283692,_0x1542a5),console['log'](_0x3fbf0e(0x128)+_0x5ac3ed+'\x22.');}export const appCommand={'name':a17_0x1811de(0x126),'description':'Manage\x20multiple\x20apps\x20in\x20one\x20workspace',async 'run'(_0x561fb4,_0xc71a1c,_0x350b49){const _0x3bfc09=a17_0x1811de,_0x34fe2e=_0xc71a1c[0x0],_0x4e8769=_0xc71a1c[_0x3bfc09(0x124)](0x1);switch(_0x34fe2e){case _0x3bfc09(0x151):listApps(_0x561fb4);break;case'use':useApp(_0x561fb4,_0x4e8769,_0x350b49);break;case _0x3bfc09(0x13b):addApp(_0x561fb4,_0x4e8769,_0x350b49);break;case _0x3bfc09(0x15d):removeApp(_0x561fb4,_0x4e8769,_0x350b49);break;default:listApps(_0x561fb4);break;}}};function a17_0x4e84(){const _0x3a07b8=['Added','\x22\x20not\x20found.','\x20(global)','length','1325848chSajG','\x20--appcode\x20<code>`\x20first.','Default:\x20','\x20\x20\x20\x20appcode:\x20','Set\x20as\x20default\x20app.','config','appcode','cookie','\x22\x20not\x20found.\x20Available:\x20','\x20\x20appcode:\x20','log','add','exit','15GdklbM','\x20\x20\x20\x20env:\x20\x20\x20\x20\x20\x20\x20','apps','Usage:\x20rabetbase\x20app\x20use\x20<name>\x20[--global]','Updated','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','--appcode\x20is\x20required\x20when\x20adding\x20an\x20app.','defaultApp','\x22\x20(appcode:\x20','\x20\x20\x20\x20cookie:\x20\x20\x20\x20(set)','entries','5830002CuFoca','accessKey','apidir','pageSize','\x20\x20\x20\x20accessKey:\x20(set)','risklevel','apiDir','App\x20\x22','pagesize','list','\x20\x20\x20\x20apiDir:\x20\x20\x20\x20','Migrated\x20existing\x20app\x20\x22','112vsSxwH','keys','global','\x20app\x20\x22','format','Configured\x20apps:\x0a','593716ifLkAD','\x20\x20\x20\x20format:\x20\x20\x20\x20','1905078pIzVWe','remove','334242CItiEc','14262498qmOHUR','riskLevel','locale','\x0aUse\x20`rabetbase\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.','398896FhCXtK','\x20\x20\x20\x20riskLevel:\x20','accesskey','slice','error','app','project','Removed\x20app\x20\x22','env','Single-app\x20mode:','Default\x20app\x20set\x20to\x20\x22'];a17_0x4e84=function(){return _0x3a07b8;};return a17_0x4e84();}
@@ -1 +1 @@
1
- const a18_0x2340e2=a18_0x53e1;(function(_0x4679cc,_0x4d116a){const _0x18e51c=a18_0x53e1,_0x401558=_0x4679cc();while(!![]){try{const _0x1817a6=-parseInt(_0x18e51c(0xf2))/0x1*(-parseInt(_0x18e51c(0xf5))/0x2)+-parseInt(_0x18e51c(0xf0))/0x3+-parseInt(_0x18e51c(0xf6))/0x4+parseInt(_0x18e51c(0xef))/0x5+-parseInt(_0x18e51c(0xf1))/0x6+parseInt(_0x18e51c(0xf3))/0x7*(-parseInt(_0x18e51c(0xf4))/0x8)+parseInt(_0x18e51c(0xf7))/0x9;if(_0x1817a6===_0x4d116a)break;else _0x401558['push'](_0x401558['shift']());}catch(_0x4cf612){_0x401558['push'](_0x401558['shift']());}}}(a18_0xf283,0x99208));function a18_0x53e1(_0x44976d,_0x5b053b){_0x44976d=_0x44976d-0xef;const _0xf2835c=a18_0xf283();let _0x53e1ac=_0xf2835c[_0x44976d];return _0x53e1ac;}import{jsx as a18_0x394b5d}from'react/jsx-runtime';function a18_0xf283(){const _0x2cee53=['auth','3355800KTNMse','2996511tAKkQX','4799400MPkdsW','2246fFYfoa','1631LAczOd','2136ZtLkJq','294mhSSCV','1655576LmYMKJ','17106552RqgNef'];a18_0xf283=function(){return _0x2cee53;};return a18_0xf283();}import{render}from'ink';import{AuthServer}from'../auth/auth-server-ui.js';export const authCommand={'name':a18_0x2340e2(0xf8),'description':'Authenticate\x20with\x20rabetbase',async 'run'(_0x3ea08a,_0x7f1b78,_0x558c3a){render(a18_0x394b5d(AuthServer,{}));}};
1
+ const a18_0x4a53d5=a18_0xc1dc;(function(_0x2b12aa,_0x6b588a){const _0x1f3391=a18_0xc1dc,_0x3cdbec=_0x2b12aa();while(!![]){try{const _0x35dfd2=-parseInt(_0x1f3391(0x1fc))/0x1*(parseInt(_0x1f3391(0x1fb))/0x2)+-parseInt(_0x1f3391(0x1f4))/0x3+parseInt(_0x1f3391(0x1f2))/0x4+parseInt(_0x1f3391(0x1fd))/0x5*(-parseInt(_0x1f3391(0x1f5))/0x6)+-parseInt(_0x1f3391(0x1f9))/0x7*(-parseInt(_0x1f3391(0x1fa))/0x8)+-parseInt(_0x1f3391(0x1f6))/0x9*(parseInt(_0x1f3391(0x1f8))/0xa)+parseInt(_0x1f3391(0x1f7))/0xb;if(_0x35dfd2===_0x6b588a)break;else _0x3cdbec['push'](_0x3cdbec['shift']());}catch(_0x40cc73){_0x3cdbec['push'](_0x3cdbec['shift']());}}}(a18_0x5e0c,0x6c746));import{jsx as a18_0x3b4127}from'react/jsx-runtime';import{render}from'ink';function a18_0xc1dc(_0x27c27a,_0x49b7ed){_0x27c27a=_0x27c27a-0x1f2;const _0x5e0c50=a18_0x5e0c();let _0xc1dc4a=_0x5e0c50[_0x27c27a];return _0xc1dc4a;}import{AuthServer}from'../auth/auth-server-ui.js';function a18_0x5e0c(){const _0x249aa8=['6812674ZoskLl','759070LYWOvc','2087197QExjnw','8bVMfqi','26pDbQRJ','15929dPCQhO','3830UQFxsx','2349236ZcaWKG','auth','1752LmCMJq','3708oiaaxm','45KEUFsY'];a18_0x5e0c=function(){return _0x249aa8;};return a18_0x5e0c();}export const authCommand={'name':a18_0x4a53d5(0x1f3),'description':'Authenticate\x20with\x20rabetbase',async 'run'(_0x48740e,_0x12e17f,_0x253e02){render(a18_0x3b4127(AuthServer,{}));}};
@@ -1 +1 @@
1
- const a19_0x5b102f=a19_0x1d1d;(function(_0x5893b8,_0x47e384){const _0xf0c292=a19_0x1d1d,_0x144508=_0x5893b8();while(!![]){try{const _0x40def8=-parseInt(_0xf0c292(0x8b))/0x1*(parseInt(_0xf0c292(0xa4))/0x2)+parseInt(_0xf0c292(0xa6))/0x3*(-parseInt(_0xf0c292(0x89))/0x4)+-parseInt(_0xf0c292(0x80))/0x5*(parseInt(_0xf0c292(0x83))/0x6)+parseInt(_0xf0c292(0x86))/0x7*(-parseInt(_0xf0c292(0x93))/0x8)+parseInt(_0xf0c292(0x8f))/0x9*(parseInt(_0xf0c292(0x96))/0xa)+-parseInt(_0xf0c292(0x8e))/0xb+-parseInt(_0xf0c292(0x87))/0xc*(-parseInt(_0xf0c292(0x82))/0xd);if(_0x40def8===_0x47e384)break;else _0x144508['push'](_0x144508['shift']());}catch(_0x1f7976){_0x144508['push'](_0x144508['shift']());}}}(a19_0x3c2f,0xdca09));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a19_0x1d1d(_0x4e922d,_0x11bc2e){_0x4e922d=_0x4e922d-0x7b;const _0x3c2f8f=a19_0x3c2f();let _0x1d1daa=_0x3c2f8f[_0x4e922d];return _0x1d1daa;}function a19_0x3c2f(){const _0x129485=['42YEILHw','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','delete','replace','scriptsRootDir','bff','Function\x20not\x20found:\x20','string','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','120485jqsBMu','\x20\x20-\x20','13ZSVRnq','156cYAcvp','map','\x20(local\x20file\x20moved\x20to\x20trash)','29393aUkkvP','51852588hJOWzr','remoteId','315224iAODHz','Deleted\x20','107TTTgiH','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','str','2411552bsBiUa','6724287tTRwCN','toISOString','validation','filter','3104CADySH','Multiple\x20functions\x20match\x20\x22','scriptsWorkspaceRoot','10LFpSVv','keys','scriptsRoot','startsWith','lastSync','length','find','includes','No\x20lock\x20entry\x20found\x20for\x20\x22','lockFilePath','join','high-risk-write','functions','appCode','10958plrrTG','target'];a19_0x3c2f=function(){return _0x129485;};return a19_0x3c2f();}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a19_0x5b102f(0x7c),'command':'delete','description':a19_0x5b102f(0x7f),'risk':a19_0x5b102f(0xa1),'flags':[{'name':a19_0x5b102f(0xa5),'type':a19_0x5b102f(0x7e),'required':!![],'description':a19_0x5b102f(0xa7)}],async 'validate'(_0x3abb55){const _0x9c7be7=a19_0x5b102f,_0x37a179=loadBffProjectConfig(_0x3abb55['appCode']),_0xe94a4e=await readBffLockFile(_0x37a179[_0x9c7be7(0x9f)]);if(!_0xe94a4e)throw CliErrors['validation'](_0x9c7be7(0x8c));},async 'execute'(_0x29d191){const _0x53cd8d=a19_0x5b102f,_0x13b0df=loadBffProjectConfig(_0x29d191[_0x53cd8d(0xa3)]),_0x3c6d2b=await readBffLockFile(_0x13b0df[_0x53cd8d(0x9f)]);if(!_0x3c6d2b)throw CliErrors[_0x53cd8d(0x91)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x298267,appLock:_0xfc5bf}=ensureLockScope(_0x3c6d2b,_0x13b0df[_0x53cd8d(0xa3)],_0x13b0df[_0x53cd8d(0x98)],_0x53cd8d(0xa8),_0x13b0df[_0x53cd8d(0xa3)],_0x13b0df[_0x53cd8d(0x95)]+'/'+_0x13b0df[_0x53cd8d(0xa3)]),_0x2bfc30=_0x29d191[_0x53cd8d(0x8d)](_0x53cd8d(0xa5)),_0x5f0892=Object[_0x53cd8d(0x97)](_0xfc5bf['functions']),_0x387444=resolveDeleteTarget(_0x2bfc30,_0x5f0892),_0x53092c=_0xfc5bf[_0x53cd8d(0xa2)][_0x387444];if(!_0x53092c)throw CliErrors[_0x53cd8d(0x91)](_0x53cd8d(0x9e)+_0x387444+'\x22.');await deleteBffScript(_0x53092c[_0x53cd8d(0x88)]),delete _0xfc5bf[_0x53cd8d(0xa2)][_0x387444],_0xfc5bf[_0x53cd8d(0x9a)]=new Date()['toISOString'](),await writeBffLockFile(_0x13b0df[_0x53cd8d(0x9f)],_0x298267);const _0x19ef5e=resolveLocalFilePathFromLockKey(_0x13b0df,_0x387444);let _0x3e20c0;await fileExists(_0x19ef5e)&&(_0x3e20c0=await moveToTrash(_0x13b0df['projectRoot'],_0x13b0df['trashDir'],_0x19ef5e),await cleanupEmptyDirectories(dirname(_0x19ef5e),_0x13b0df[_0x53cd8d(0x7b)]));const _0x394bdc={'deleted':_0x387444,'remoteId':_0x53092c['remoteId']};if(_0x3e20c0)_0x394bdc['trashedTo']=_0x3e20c0;return{'ok':!![],'data':_0x394bdc,'message':_0x53cd8d(0x8a)+_0x387444+(_0x3e20c0?_0x53cd8d(0x85):'')};}};function resolveDeleteTarget(_0xf855e2,_0x9a55d2){const _0x1a86f4=a19_0x5b102f;if(_0xf855e2[_0x1a86f4(0x9d)]('/')){const _0x44c954=_0x9a55d2[_0x1a86f4(0x9c)](_0x3f29c0=>_0x3f29c0===_0xf855e2);if(!_0x44c954)throw CliErrors['validation'](_0x1a86f4(0x7d)+_0xf855e2);return _0x44c954;}const _0x439044=_0x9a55d2[_0x1a86f4(0x92)](_0x3d4c73=>_0x3d4c73['split']('/')['at'](-0x1)===_0xf855e2);if(_0x439044['length']===0x0)throw CliErrors[_0x1a86f4(0x91)](_0x1a86f4(0x7d)+_0xf855e2);if(_0x439044[_0x1a86f4(0x9b)]>0x1)throw CliErrors[_0x1a86f4(0x91)](_0x1a86f4(0x94)+_0xf855e2+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x439044[_0x1a86f4(0x84)](_0x6dfa99=>_0x1a86f4(0x81)+_0x6dfa99)[_0x1a86f4(0xa0)]('\x0a'));return _0x439044[0x0];}async function moveToTrash(_0x25fcc4,_0x22b898,_0x480cfd){const _0x2cb477=a19_0x5b102f,_0x3bcd5b=new Date()[_0x2cb477(0x90)]()[_0x2cb477(0xa9)](/[:.]/g,'-'),_0x2ba3fc=relative(_0x25fcc4,_0x480cfd),_0x121112=join(_0x22b898,_0x3bcd5b,_0x2ba3fc);return await mkdir(dirname(_0x121112),{'recursive':!![]}),await rename(_0x480cfd,_0x121112),_0x121112;}async function cleanupEmptyDirectories(_0x16ff9f,_0x49b294){const _0x176c5b=a19_0x5b102f;let _0x5f1ae7=resolve(_0x16ff9f);const _0x40cb5b=resolve(_0x49b294);while(_0x5f1ae7[_0x176c5b(0x99)](''+_0x40cb5b+sep)||_0x5f1ae7===_0x40cb5b){if(_0x5f1ae7===_0x40cb5b)return;try{const _0x3811c5=await readdir(_0x5f1ae7);if(_0x3811c5[_0x176c5b(0x9b)]>0x0)return;await rmdir(_0x5f1ae7);}catch{return;}_0x5f1ae7=dirname(_0x5f1ae7);}}
1
+ const a19_0x410418=a19_0x52e2;(function(_0x545008,_0x391854){const _0x2617a7=a19_0x52e2,_0x16dd90=_0x545008();while(!![]){try{const _0x280320=parseInt(_0x2617a7(0xf0))/0x1+-parseInt(_0x2617a7(0xd7))/0x2*(parseInt(_0x2617a7(0xdc))/0x3)+parseInt(_0x2617a7(0xe0))/0x4+parseInt(_0x2617a7(0xf6))/0x5+parseInt(_0x2617a7(0xd8))/0x6+-parseInt(_0x2617a7(0xe7))/0x7*(-parseInt(_0x2617a7(0xe9))/0x8)+-parseInt(_0x2617a7(0xdf))/0x9*(parseInt(_0x2617a7(0xef))/0xa);if(_0x280320===_0x391854)break;else _0x16dd90['push'](_0x16dd90['shift']());}catch(_0x69a1d9){_0x16dd90['push'](_0x16dd90['shift']());}}}(a19_0x29be,0xb5433));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a19_0x29be(){const _0x36d2b5=['delete','1808048PdlnGV','toISOString','replace','string','Deleted\x20','find','20WaJTwN','992025THyldg','lockFilePath','scriptsWorkspaceRoot','trashDir','keys','remoteId','6768365LOQQMb','No\x20lock\x20entry\x20found\x20for\x20\x22','bff','trashedTo','Function\x20not\x20found:\x20','length','high-risk-write','validation','join','Multiple\x20functions\x20match\x20\x22','25078usNKou','2126694ShngZd','scriptsRootDir','lastSync','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','300rdWihv','functions','str','5748534HosbKr','486576vIDQaj','appCode','filter','BFF\x20lock\x20file\x20not\x20found.','projectRoot','target','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','14qoDHfE'];a19_0x29be=function(){return _0x36d2b5;};return a19_0x29be();}import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a19_0x410418(0xf8),'command':a19_0x410418(0xe8),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a19_0x410418(0xd3),'flags':[{'name':a19_0x410418(0xe5),'type':a19_0x410418(0xec),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x4739b1){const _0x3175eb=a19_0x410418,_0x248730=loadBffProjectConfig(_0x4739b1[_0x3175eb(0xe1)]),_0x21bc2c=await readBffLockFile(_0x248730[_0x3175eb(0xf1)]);if(!_0x21bc2c)throw CliErrors[_0x3175eb(0xd4)](_0x3175eb(0xe6));},async 'execute'(_0x2d99ca){const _0x4dadc3=a19_0x410418,_0x395d23=loadBffProjectConfig(_0x2d99ca[_0x4dadc3(0xe1)]),_0x84848=await readBffLockFile(_0x395d23[_0x4dadc3(0xf1)]);if(!_0x84848)throw CliErrors[_0x4dadc3(0xd4)](_0x4dadc3(0xe3));const {lockData:_0x395c69,appLock:_0xb6bf97}=ensureLockScope(_0x84848,_0x395d23[_0x4dadc3(0xe1)],_0x395d23['scriptsRoot'],'delete',_0x395d23['appCode'],_0x395d23[_0x4dadc3(0xf2)]+'/'+_0x395d23['appCode']),_0x295747=_0x2d99ca[_0x4dadc3(0xde)](_0x4dadc3(0xe5)),_0x37a78d=Object[_0x4dadc3(0xf4)](_0xb6bf97[_0x4dadc3(0xdd)]),_0x547c3e=resolveDeleteTarget(_0x295747,_0x37a78d),_0x713755=_0xb6bf97[_0x4dadc3(0xdd)][_0x547c3e];if(!_0x713755)throw CliErrors[_0x4dadc3(0xd4)](_0x4dadc3(0xf7)+_0x547c3e+'\x22.');await deleteBffScript(_0x713755[_0x4dadc3(0xf5)]),delete _0xb6bf97[_0x4dadc3(0xdd)][_0x547c3e],_0xb6bf97[_0x4dadc3(0xda)]=new Date()[_0x4dadc3(0xea)](),await writeBffLockFile(_0x395d23[_0x4dadc3(0xf1)],_0x395c69);const _0x588eaf=resolveLocalFilePathFromLockKey(_0x395d23,_0x547c3e);let _0x2412e2;await fileExists(_0x588eaf)&&(_0x2412e2=await moveToTrash(_0x395d23[_0x4dadc3(0xe4)],_0x395d23[_0x4dadc3(0xf3)],_0x588eaf),await cleanupEmptyDirectories(dirname(_0x588eaf),_0x395d23[_0x4dadc3(0xd9)]));const _0x50d53a={'deleted':_0x547c3e,'remoteId':_0x713755['remoteId']};if(_0x2412e2)_0x50d53a[_0x4dadc3(0xd0)]=_0x2412e2;return{'ok':!![],'data':_0x50d53a,'message':_0x4dadc3(0xed)+_0x547c3e+(_0x2412e2?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x5b42df,_0x509ef4){const _0x31cc11=a19_0x410418;if(_0x5b42df['includes']('/')){const _0x46a1ef=_0x509ef4[_0x31cc11(0xee)](_0x399f69=>_0x399f69===_0x5b42df);if(!_0x46a1ef)throw CliErrors[_0x31cc11(0xd4)](_0x31cc11(0xd1)+_0x5b42df);return _0x46a1ef;}const _0x590a55=_0x509ef4[_0x31cc11(0xe2)](_0x18a63b=>_0x18a63b['split']('/')['at'](-0x1)===_0x5b42df);if(_0x590a55[_0x31cc11(0xd2)]===0x0)throw CliErrors[_0x31cc11(0xd4)](_0x31cc11(0xd1)+_0x5b42df);if(_0x590a55[_0x31cc11(0xd2)]>0x1)throw CliErrors[_0x31cc11(0xd4)](_0x31cc11(0xd6)+_0x5b42df+_0x31cc11(0xdb)+_0x590a55['map'](_0x296628=>'\x20\x20-\x20'+_0x296628)[_0x31cc11(0xd5)]('\x0a'));return _0x590a55[0x0];}async function moveToTrash(_0x2e0105,_0x3f4a51,_0x3a5ec3){const _0x5efd6f=a19_0x410418,_0x5304b3=new Date()[_0x5efd6f(0xea)]()[_0x5efd6f(0xeb)](/[:.]/g,'-'),_0x3d6309=relative(_0x2e0105,_0x3a5ec3),_0x1a55ef=join(_0x3f4a51,_0x5304b3,_0x3d6309);return await mkdir(dirname(_0x1a55ef),{'recursive':!![]}),await rename(_0x3a5ec3,_0x1a55ef),_0x1a55ef;}function a19_0x52e2(_0x2afe84,_0x1e423d){_0x2afe84=_0x2afe84-0xd0;const _0x29beb2=a19_0x29be();let _0x52e294=_0x29beb2[_0x2afe84];return _0x52e294;}async function cleanupEmptyDirectories(_0x695da1,_0x2f80d2){const _0xcc5046=a19_0x410418;let _0x9c0759=resolve(_0x695da1);const _0x343e9e=resolve(_0x2f80d2);while(_0x9c0759['startsWith'](''+_0x343e9e+sep)||_0x9c0759===_0x343e9e){if(_0x9c0759===_0x343e9e)return;try{const _0x4c2215=await readdir(_0x9c0759);if(_0x4c2215[_0xcc5046(0xd2)]>0x0)return;await rmdir(_0x9c0759);}catch{return;}_0x9c0759=dirname(_0x9c0759);}}
@@ -1 +1 @@
1
- function a20_0x9ec7(_0x438d08,_0x1edd28){_0x438d08=_0x438d08-0x1a4;const _0x21eee0=a20_0x21ee();let _0x9ec7e4=_0x21eee0[_0x438d08];return _0x9ec7e4;}const a20_0x1e3176=a20_0x9ec7;(function(_0x4fb92b,_0x4eb8d6){const _0x29bbc0=a20_0x9ec7,_0x4415a8=_0x4fb92b();while(!![]){try{const _0x13900c=parseInt(_0x29bbc0(0x1b1))/0x1+parseInt(_0x29bbc0(0x1a8))/0x2+parseInt(_0x29bbc0(0x1b9))/0x3+parseInt(_0x29bbc0(0x1ab))/0x4+-parseInt(_0x29bbc0(0x1ac))/0x5*(parseInt(_0x29bbc0(0x1a5))/0x6)+parseInt(_0x29bbc0(0x1bb))/0x7*(parseInt(_0x29bbc0(0x1a7))/0x8)+-parseInt(_0x29bbc0(0x1a4))/0x9*(parseInt(_0x29bbc0(0x1af))/0xa);if(_0x13900c===_0x4eb8d6)break;else _0x4415a8['push'](_0x4415a8['shift']());}catch(_0x43a366){_0x4415a8['push'](_0x4415a8['shift']());}}}(a20_0x21ee,0x3b462));import{getBffScriptInfo}from'../../core/api-client.js';function a20_0x21ee(){const _0x3efcd8=['number','1249443xmSZKa','scriptContent','86114uleSsf','scriptType','45nheROx','79158rBNiNR','bff','56BJfcrU','248058czSkLL','read','bool','250784oSemCz','85epErRI','verbose','detail','914710udPadK','createdTime','235102jlHgEO','num','Script\x20ID','boolean','description','updatedTime','Return\x20full\x20raw\x20script\x20object'];a20_0x21ee=function(){return _0x3efcd8;};return a20_0x21ee();}export const bffDetail={'service':a20_0x1e3176(0x1a6),'command':a20_0x1e3176(0x1ae),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a20_0x1e3176(0x1a9),'flags':[{'name':'id','type':a20_0x1e3176(0x1b8),'required':!![],'description':a20_0x1e3176(0x1b3)},{'name':a20_0x1e3176(0x1ad),'type':a20_0x1e3176(0x1b4),'description':a20_0x1e3176(0x1b7)}],async 'execute'(_0x47843f){const _0x2c0cee=a20_0x1e3176,_0x383fb0=await getBffScriptInfo(_0x47843f[_0x2c0cee(0x1b2)]('id')),_0x20621d=_0x47843f[_0x2c0cee(0x1aa)]('verbose');if(_0x20621d)return{'ok':!![],'data':_0x383fb0};return{'ok':!![],'data':{'id':_0x383fb0['id'],'appCode':_0x383fb0['appCode'],'scriptType':_0x383fb0[_0x2c0cee(0x1bc)],'description':_0x383fb0[_0x2c0cee(0x1b5)]||'(none)','createdTime':_0x383fb0[_0x2c0cee(0x1b0)]??'','updatedTime':_0x383fb0[_0x2c0cee(0x1b6)]??'','scriptContent':_0x383fb0[_0x2c0cee(0x1ba)]??''}};}};
1
+ const a20_0x3fb87d=a20_0x4129;(function(_0x5354d3,_0x3004fe){const _0x327b17=a20_0x4129,_0x1e13e1=_0x5354d3();while(!![]){try{const _0x7ab906=parseInt(_0x327b17(0xad))/0x1+-parseInt(_0x327b17(0xae))/0x2+-parseInt(_0x327b17(0xb8))/0x3+parseInt(_0x327b17(0xb3))/0x4*(-parseInt(_0x327b17(0xab))/0x5)+parseInt(_0x327b17(0xbf))/0x6*(parseInt(_0x327b17(0xb0))/0x7)+parseInt(_0x327b17(0xb2))/0x8*(parseInt(_0x327b17(0xa8))/0x9)+parseInt(_0x327b17(0xbc))/0xa;if(_0x7ab906===_0x3004fe)break;else _0x1e13e1['push'](_0x1e13e1['shift']());}catch(_0x2a7d1d){_0x1e13e1['push'](_0x1e13e1['shift']());}}}(a20_0x2333,0xdd26e));function a20_0x2333(){const _0x5262e7=['250216NuprHv','15676nMIojR','description','createdTime','bool','bff','1000323qTPDEO','scriptType','Script\x20ID','scriptContent','9919060tqGraw','verbose','(none)','44862JengqV','number','387ckJSLa','Get\x20BFF\x20script\x20details\x20by\x20ID','detail','840wAHEph','num','805629wDFmvZ','3536330tKjpKn','boolean','490oKAkcl','updatedTime'];a20_0x2333=function(){return _0x5262e7;};return a20_0x2333();}function a20_0x4129(_0x4c13a3,_0x320b0a){_0x4c13a3=_0x4c13a3-0xa8;const _0x2333b0=a20_0x2333();let _0x4129f7=_0x2333b0[_0x4c13a3];return _0x4129f7;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a20_0x3fb87d(0xb7),'command':a20_0x3fb87d(0xaa),'description':a20_0x3fb87d(0xa9),'risk':'read','flags':[{'name':'id','type':a20_0x3fb87d(0xc0),'required':!![],'description':a20_0x3fb87d(0xba)},{'name':a20_0x3fb87d(0xbd),'type':a20_0x3fb87d(0xaf),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x148048){const _0x3e8e2a=a20_0x3fb87d,_0xbcdf8d=await getBffScriptInfo(_0x148048[_0x3e8e2a(0xac)]('id')),_0x50fd86=_0x148048[_0x3e8e2a(0xb6)](_0x3e8e2a(0xbd));if(_0x50fd86)return{'ok':!![],'data':_0xbcdf8d};return{'ok':!![],'data':{'id':_0xbcdf8d['id'],'appCode':_0xbcdf8d['appCode'],'scriptType':_0xbcdf8d[_0x3e8e2a(0xb9)],'description':_0xbcdf8d[_0x3e8e2a(0xb4)]||_0x3e8e2a(0xbe),'createdTime':_0xbcdf8d[_0x3e8e2a(0xb5)]??'','updatedTime':_0xbcdf8d[_0x3e8e2a(0xb1)]??'','scriptContent':_0xbcdf8d[_0x3e8e2a(0xbb)]??''}};}};
@@ -1 +1 @@
1
- function a21_0x2114(_0x54a1c3,_0xee3197){_0x54a1c3=_0x54a1c3-0xfd;const _0x26fc83=a21_0x26fc();let _0x21145a=_0x26fc83[_0x54a1c3];return _0x21145a;}(function(_0x35e380,_0x4576e4){const _0x2ee42e=a21_0x2114,_0x17e3c6=_0x35e380();while(!![]){try{const _0x5413b5=-parseInt(_0x2ee42e(0x108))/0x1*(parseInt(_0x2ee42e(0xfd))/0x2)+parseInt(_0x2ee42e(0x100))/0x3*(parseInt(_0x2ee42e(0x106))/0x4)+parseInt(_0x2ee42e(0x101))/0x5*(parseInt(_0x2ee42e(0x105))/0x6)+-parseInt(_0x2ee42e(0xff))/0x7+parseInt(_0x2ee42e(0x102))/0x8*(parseInt(_0x2ee42e(0x104))/0x9)+parseInt(_0x2ee42e(0xfe))/0xa*(-parseInt(_0x2ee42e(0x107))/0xb)+parseInt(_0x2ee42e(0x103))/0xc;if(_0x5413b5===_0x4576e4)break;else _0x17e3c6['push'](_0x17e3c6['shift']());}catch(_0x47b719){_0x17e3c6['push'](_0x17e3c6['shift']());}}}(a21_0x26fc,0x7a2d1));import{bffList}from'./list.js';function a21_0x26fc(){const _0x3d7c8e=['360shCURl','1661880ICaaFv','40914WmjVPE','79386yaYXDe','388PfDCfs','1417845DFkCXH','43271HSIINF','22VOcACo','30AtiHIz','619507liVTNw','24873JOIxzm','115FcNQQN'];a21_0x26fc=function(){return _0x3d7c8e;};return a21_0x26fc();}import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';import{bffNew}from'./new.js';import{bffPush}from'./push.js';import{bffPull}from'./pull.js';import{bffDelete}from'./delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
1
+ function a21_0x1c01(_0x445e8a,_0x3ebf93){_0x445e8a=_0x445e8a-0xf2;const _0x4dd069=a21_0x4dd0();let _0x1c01ef=_0x4dd069[_0x445e8a];return _0x1c01ef;}(function(_0x1d36f2,_0x3e313c){const _0x31e9f0=a21_0x1c01,_0x5cb2f6=_0x1d36f2();while(!![]){try{const _0xe48877=parseInt(_0x31e9f0(0xf4))/0x1*(-parseInt(_0x31e9f0(0xf5))/0x2)+parseInt(_0x31e9f0(0xf2))/0x3+parseInt(_0x31e9f0(0xfa))/0x4*(-parseInt(_0x31e9f0(0xf3))/0x5)+-parseInt(_0x31e9f0(0xf6))/0x6+-parseInt(_0x31e9f0(0xf9))/0x7*(parseInt(_0x31e9f0(0xf7))/0x8)+-parseInt(_0x31e9f0(0xfb))/0x9+parseInt(_0x31e9f0(0xf8))/0xa;if(_0xe48877===_0x3e313c)break;else _0x5cb2f6['push'](_0x5cb2f6['shift']());}catch(_0x133817){_0x5cb2f6['push'](_0x5cb2f6['shift']());}}}(a21_0x4dd0,0xe1626));function a21_0x4dd0(){const _0x20020e=['87390KCppMp','4183736MosTHP','12896050fglMcc','7jKEdEq','1105172NaPoKp','4504626ynorUe','4446369rafzSo','10YXLjks','6141yXExmh','84GfTfUV'];a21_0x4dd0=function(){return _0x20020e;};return a21_0x4dd0();}import{bffList}from'./list.js';import{bffDetail}from'./detail.js';import{bffStatus}from'./status.js';import{bffNew}from'./new.js';import{bffPush}from'./push.js';import{bffPull}from'./pull.js';import{bffDelete}from'./delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a22_0x584037=a22_0x5609;(function(_0x316c93,_0x57ef3b){const _0x491999=a22_0x5609,_0x29e95e=_0x316c93();while(!![]){try{const _0x3400cf=parseInt(_0x491999(0x84))/0x1+-parseInt(_0x491999(0x8f))/0x2*(-parseInt(_0x491999(0x75))/0x3)+-parseInt(_0x491999(0x8c))/0x4*(-parseInt(_0x491999(0x7b))/0x5)+parseInt(_0x491999(0x7c))/0x6*(parseInt(_0x491999(0x91))/0x7)+-parseInt(_0x491999(0x78))/0x8+-parseInt(_0x491999(0x8a))/0x9*(parseInt(_0x491999(0x89))/0xa)+-parseInt(_0x491999(0x80))/0xb;if(_0x3400cf===_0x57ef3b)break;else _0x29e95e['push'](_0x29e95e['shift']());}catch(_0x2ed180){_0x29e95e['push'](_0x29e95e['shift']());}}}(a22_0x21b5,0xd267c));function a22_0x5609(_0x1d43f0,_0x373796){_0x1d43f0=_0x1d43f0-0x75;const _0x21b52e=a22_0x21b5();let _0x560965=_0x21b52e[_0x1d43f0];return _0x560965;}function a22_0x21b5(){const _0x4d9ed8=['50644iCFMFd','list','bff','111212EcGmao','No\x20BFF\x20scripts\x20found.','14364gvSdvq','List\x20BFF\x20scripts','type','6CgmfSd','str','description','3048056jmAJTD','functionName','COMMON','105uxpQBA','4506bWTIQX','Script\x20type\x20filter','length','verbose','24502258EyDfhb','boolean','scriptType','ENDPOINT','1607360xJnbSU','name','bool','string','map','24000iSmgPJ','207eZBtKe','Filter\x20by\x20script\x20name'];a22_0x21b5=function(){return _0x4d9ed8;};return a22_0x21b5();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a22_0x584037(0x8e),'command':a22_0x584037(0x8d),'description':a22_0x584037(0x92),'risk':'read','flags':[{'name':a22_0x584037(0x93),'type':a22_0x584037(0x87),'description':a22_0x584037(0x7d),'default':a22_0x584037(0x83),'enum':[a22_0x584037(0x83),a22_0x584037(0x7a)]},{'name':a22_0x584037(0x85),'type':a22_0x584037(0x87),'description':a22_0x584037(0x8b)},{'name':'verbose','type':a22_0x584037(0x81),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x2889a8){const _0x2226d1=a22_0x584037,_0x57447b=await listBffScripts(_0x2889a8['appCode'],_0x2889a8[_0x2226d1(0x76)](_0x2226d1(0x93)),{'scriptName':_0x2889a8[_0x2226d1(0x76)](_0x2226d1(0x85))||undefined}),_0xf90bf1=_0x2889a8[_0x2226d1(0x86)](_0x2226d1(0x7f));return{'ok':!![],'data':_0xf90bf1?_0x57447b:_0x57447b[_0x2226d1(0x88)](_0x232cc8=>({'id':_0x232cc8['id'],'functionName':_0x232cc8[_0x2226d1(0x79)]??'','description':_0x232cc8[_0x2226d1(0x77)]||'(unnamed)','scriptType':_0x232cc8[_0x2226d1(0x82)]})),'message':_0x57447b[_0x2226d1(0x7e)]===0x0?_0x2226d1(0x90):undefined};}};
1
+ const a22_0x3f0660=a22_0x12a1;(function(_0x18f36b,_0x592f76){const _0x426657=a22_0x12a1,_0x204bc6=_0x18f36b();while(!![]){try{const _0x826bdf=parseInt(_0x426657(0x1f4))/0x1*(-parseInt(_0x426657(0x1e6))/0x2)+parseInt(_0x426657(0x1fd))/0x3*(-parseInt(_0x426657(0x1df))/0x4)+-parseInt(_0x426657(0x1f3))/0x5*(parseInt(_0x426657(0x1ff))/0x6)+parseInt(_0x426657(0x1ec))/0x7+parseInt(_0x426657(0x1fe))/0x8*(-parseInt(_0x426657(0x1e0))/0x9)+-parseInt(_0x426657(0x1f9))/0xa*(-parseInt(_0x426657(0x1f7))/0xb)+parseInt(_0x426657(0x1f0))/0xc;if(_0x826bdf===_0x592f76)break;else _0x204bc6['push'](_0x204bc6['shift']());}catch(_0x4859a2){_0x204bc6['push'](_0x204bc6['shift']());}}}(a22_0x385e,0xd4afc));import{listBffScripts}from'../../core/api-client.js';function a22_0x12a1(_0x232d0f,_0x2b2acf){_0x232d0f=_0x232d0f-0x1de;const _0x385e3c=a22_0x385e();let _0x12a104=_0x385e3c[_0x232d0f];return _0x12a104;}function a22_0x385e(){const _0x4b7654=['boolean','List\x20BFF\x20scripts','93049WkAljC','type','580JUxEpZ','read','functionName','Script\x20type\x20filter','105801KtvsLf','8706008tMmyOw','4045506dkhafb','(unnamed)','12zdqDQR','9VspzzT','verbose','No\x20BFF\x20scripts\x20found.','ENDPOINT','bff','Filter\x20by\x20script\x20name','2302bFFPWL','bool','list','name','Return\x20full\x20script\x20objects','COMMON','2654120HImeOf','map','length','description','38554824SHtyAq','str','string','5GFcdcO','1167RXFtxt'];a22_0x385e=function(){return _0x4b7654;};return a22_0x385e();}export const bffList={'service':a22_0x3f0660(0x1e4),'command':a22_0x3f0660(0x1e8),'description':a22_0x3f0660(0x1f6),'risk':a22_0x3f0660(0x1fa),'flags':[{'name':a22_0x3f0660(0x1f8),'type':a22_0x3f0660(0x1f2),'description':a22_0x3f0660(0x1fc),'default':a22_0x3f0660(0x1e3),'enum':['ENDPOINT',a22_0x3f0660(0x1eb)]},{'name':a22_0x3f0660(0x1e9),'type':'string','description':a22_0x3f0660(0x1e5)},{'name':a22_0x3f0660(0x1e1),'type':a22_0x3f0660(0x1f5),'description':a22_0x3f0660(0x1ea)}],async 'execute'(_0x2833ee){const _0x5ada99=a22_0x3f0660,_0x2f2373=await listBffScripts(_0x2833ee['appCode'],_0x2833ee[_0x5ada99(0x1f1)](_0x5ada99(0x1f8)),{'scriptName':_0x2833ee[_0x5ada99(0x1f1)](_0x5ada99(0x1e9))||undefined}),_0x232e7f=_0x2833ee[_0x5ada99(0x1e7)](_0x5ada99(0x1e1));return{'ok':!![],'data':_0x232e7f?_0x2f2373:_0x2f2373[_0x5ada99(0x1ed)](_0x2c7122=>({'id':_0x2c7122['id'],'functionName':_0x2c7122[_0x5ada99(0x1fb)]??'','description':_0x2c7122[_0x5ada99(0x1ef)]||_0x5ada99(0x1de),'scriptType':_0x2c7122['scriptType']})),'message':_0x2f2373[_0x5ada99(0x1ee)]===0x0?_0x5ada99(0x1e2):undefined};}};
@@ -1 +1 @@
1
- const a23_0x1a088d=a23_0x4a89;(function(_0x330fc7,_0x34dc56){const _0x5e8993=a23_0x4a89,_0x422565=_0x330fc7();while(!![]){try{const _0x5e1afe=-parseInt(_0x5e8993(0xbf))/0x1+parseInt(_0x5e8993(0xb3))/0x2+parseInt(_0x5e8993(0xb5))/0x3*(parseInt(_0x5e8993(0xca))/0x4)+parseInt(_0x5e8993(0xcc))/0x5+parseInt(_0x5e8993(0xb8))/0x6+-parseInt(_0x5e8993(0xaf))/0x7+-parseInt(_0x5e8993(0x9a))/0x8;if(_0x5e1afe===_0x34dc56)break;else _0x422565['push'](_0x422565['shift']());}catch(_0x50fdc5){_0x422565['push'](_0x422565['shift']());}}}(a23_0x4a2b,0x96123));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a23_0x4a89(_0x5c9226,_0x2dfb55){_0x5c9226=_0x5c9226-0x7d;const _0x4a2b03=a23_0x4a2b();let _0x4a89b9=_0x4a2b03[_0x5c9226];return _0x4a89b9;}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a23_0x4a2b(){const _0x3e44bf=['str','utf8','function-node','entries','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','File\x20already\x20exists:\x20','76ytRyEh','\x0a\x20*\x20[脚本名称]\x20','4945630eLkuMF','No\x20operation\x20types\x20found\x20for\x20dataset\x20','HOOK','\x22\x20not\x20found.\x20','datasetcode','isInteger','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','string','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','join','before','/endpoint/','\x20function:\x20','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x20api\x20pull`\x20to\x20refresh.','No\x20api.ts\x20found.\x20Run\x20`','code','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','operation-type','stderr','description','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','new','datasetCode','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','includes','nonInteractive','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','length','Invalid\x20dataset\x20selection.','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','Select\x20trigger\x20node:','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Dataset\x20not\x20found\x20for\x20code\x20\x22','Operation\x20type\x20(HOOK\x20only)','Created\x20','7388144sgFcrv','TODO:\x20add\x20script\x20description','trim','question','Available\x20aliases:\x20','type','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','name','map','validation','ENDPOINT','find','operationType','\x22.\x20','Select\x20operation\x20type:','after','functionNode','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','apiDir','write','6884927nuabug','tableName','appCode','Script\x20type','385034ivoMai','Select\x20dataset:','179931ilRAaF','alias','Function\x20name\x20(valid\x20JS\x20identifier)','3134820fSLUyR','COMMON','.js','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','scriptsRootDir','close','Operation\x20type\x20\x22','321906oICVIh','keys','HOOK\x20requires\x20alias/operation/node\x20options.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Invalid\x20function\x20name\x20\x22'];a23_0x4a2b=function(){return _0x3e44bf;};return a23_0x4a2b();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':'bff','command':a23_0x1a088d(0x8b),'description':a23_0x1a088d(0xa0),'risk':a23_0x1a088d(0xae),'flags':[{'name':'type','type':a23_0x1a088d(0xd3),'required':!![],'enum':[a23_0x1a088d(0xb9),a23_0x1a088d(0xa4),a23_0x1a088d(0xce)],'description':a23_0x1a088d(0xb2)},{'name':a23_0x1a088d(0xa1),'type':a23_0x1a088d(0xd3),'required':!![],'description':a23_0x1a088d(0xb7)},{'name':a23_0x1a088d(0x89),'type':a23_0x1a088d(0xd3),'description':'Script\x20description'},{'name':a23_0x1a088d(0xb6),'type':'string','description':a23_0x1a088d(0x81)},{'name':a23_0x1a088d(0xd0),'type':a23_0x1a088d(0xd3),'description':a23_0x1a088d(0xd4)},{'name':a23_0x1a088d(0x87),'type':a23_0x1a088d(0xd3),'description':a23_0x1a088d(0x98)},{'name':a23_0x1a088d(0xc6),'type':'string','description':a23_0x1a088d(0x80),'enum':[a23_0x1a088d(0x7d),a23_0x1a088d(0xa9)]}],async 'validate'(_0x487d4e){const _0x451ea6=a23_0x1a088d,_0x56f506=_0x487d4e[_0x451ea6(0xc4)](_0x451ea6(0xa1));if(!isValidBffFunctionName(_0x56f506))throw CliErrors[_0x451ea6(0xa3)](_0x451ea6(0xc3)+_0x56f506+_0x451ea6(0x8a));},async 'execute'(_0x283c21){const _0x321597=a23_0x1a088d,_0x1af7ba=loadBffProjectConfig(_0x283c21['appCode']),_0x9083a8=_0x283c21['str'](_0x321597(0x9f)),_0x36c50e=_0x283c21[_0x321597(0xc4)](_0x321597(0xa1)),_0x391a08=_0x283c21['str'](_0x321597(0x89))||undefined,_0x419e7e=_0x9083a8==='HOOK'?await resolveHookOptions(_0x1af7ba,_0x283c21):undefined,_0x5f0114=buildFilePath(_0x1af7ba,_0x9083a8,_0x36c50e,_0x419e7e);if(await fileExists(_0x5f0114))throw CliErrors['validation'](_0x321597(0xc9)+_0x5f0114);await mkdir(dirname(_0x5f0114),{'recursive':!![]});const _0x524741=generateTemplate(_0x9083a8,_0x36c50e,_0x1af7ba,_0x391a08,_0x419e7e);await writeFile(_0x5f0114,_0x524741,_0x321597(0xc5));const _0x1dc25d={'type':_0x9083a8,'name':_0x36c50e,'path':_0x5f0114};if(_0x391a08)_0x1dc25d[_0x321597(0x89)]=_0x391a08;if(_0x419e7e){if(_0x419e7e[_0x321597(0xb6)])_0x1dc25d['alias']=_0x419e7e[_0x321597(0xb6)];_0x1dc25d['datasetCode']=_0x419e7e[_0x321597(0x8c)],_0x1dc25d[_0x321597(0xa6)]=_0x419e7e[_0x321597(0xa6)],_0x1dc25d[_0x321597(0xaa)]=_0x419e7e['functionNode'];}return{'ok':!![],'data':_0x1dc25d,'message':_0x321597(0x99)+_0x9083a8+_0x321597(0x7f)+_0x36c50e};}};async function resolveHookOptions(_0x323ed8,_0x2fb27e){const _0x57d6b3=a23_0x1a088d,_0x17527a=loadAliasMap(_0x2fb27e[_0x57d6b3(0xad)]),_0x4d71bb=_0x17527a[_0x57d6b3(0x92)]>0x0;let _0x202412,_0x104f68,_0x20eec3;const _0x4f22b2=_0x2fb27e[_0x57d6b3(0xc4)](_0x57d6b3(0xb6)),_0x54d451=_0x2fb27e[_0x57d6b3(0xc4)](_0x57d6b3(0xd0));if(_0x4f22b2){const _0x53ff7c=resolveAlias(_0x2fb27e[_0x57d6b3(0xad)],_0x4f22b2);if(!_0x53ff7c){const _0x488236=_0x4d71bb?_0x57d6b3(0x9e)+_0x17527a[_0x57d6b3(0xa2)](_0x45c85f=>_0x45c85f[_0x57d6b3(0xb6)])[_0x57d6b3(0xd5)](',\x20'):_0x57d6b3(0x84)+CLI_BIN_NAME+_0x57d6b3(0xbb);throw CliErrors['validation']('Alias\x20\x22'+_0x4f22b2+_0x57d6b3(0xcf)+_0x488236);}_0x202412=_0x4f22b2,_0x104f68=_0x53ff7c;}else{if(_0x54d451){_0x104f68=_0x54d451;const _0x4e1b54=_0x17527a['find'](_0x154cb9=>_0x154cb9[_0x57d6b3(0x8c)]===_0x54d451);_0x202412=_0x4e1b54?.[_0x57d6b3(0xb6)];}else{if(_0x2fb27e['nonInteractive'])throw CliErrors[_0x57d6b3(0xa3)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x4d71bb){const _0x49e933=_0x17527a['map'](_0x53f4d1=>_0x53f4d1['alias']+'\x20('+_0x53f4d1[_0x57d6b3(0xb0)]+')'),_0x59a367=await promptSelect(_0x57d6b3(0xb4),_0x49e933),_0x485cf0=_0x17527a[_0x59a367];if(!_0x485cf0)throw CliErrors['validation'](_0x57d6b3(0x93));_0x202412=_0x485cf0[_0x57d6b3(0xb6)],_0x104f68=_0x485cf0[_0x57d6b3(0x8c)];}else{const _0x150c74=await listDatasets(_0x323ed8[_0x57d6b3(0xb1)]);if(_0x150c74['length']===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x402b05=_0x150c74[_0x57d6b3(0xa2)](_0x2835cf=>_0x2835cf[_0x57d6b3(0xa1)]+'\x20('+_0x2835cf[_0x57d6b3(0x85)]+')'),_0x4174b3=await promptSelect(_0x57d6b3(0xb4),_0x402b05),_0x2661c1=_0x150c74[_0x4174b3];if(!_0x2661c1)throw CliErrors['validation'](_0x57d6b3(0x93));_0x104f68=_0x2661c1[_0x57d6b3(0x85)],_0x202412=undefined;}}}}const _0x44b7f6=await listDatasets(_0x323ed8[_0x57d6b3(0xb1)]),_0x2c889d=_0x44b7f6[_0x57d6b3(0xa5)](_0x51185a=>_0x51185a[_0x57d6b3(0x85)]===_0x104f68);if(!_0x2c889d)throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0x97)+_0x104f68+_0x57d6b3(0xa7)+(_0x202412?_0x57d6b3(0xd2)+CLI_BIN_NAME+_0x57d6b3(0x83):''));_0x20eec3=_0x2c889d['id'];const _0x3c9538=_0x202412??_0x104f68,_0x2b771c=await listBffDatasetOperations(_0x323ed8[_0x57d6b3(0xb1)],_0x20eec3),_0x5532a7=_0x2b771c?Object[_0x57d6b3(0xc0)](_0x2b771c):[];if(_0x5532a7['length']===0x0)throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0xcd)+_0x3c9538+'.');let _0x526d78;const _0x4986ce=_0x2fb27e['str'](_0x57d6b3(0x87));if(_0x4986ce){if(!_0x5532a7[_0x57d6b3(0x8f)](_0x4986ce))throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0xbe)+_0x4986ce+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x3c9538+'.\x20'+('Available:\x20'+_0x5532a7[_0x57d6b3(0xd5)](',\x20')));_0x526d78=_0x4986ce;}else{if(_0x2fb27e[_0x57d6b3(0x90)])throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0x96));const _0x2d1cfe=await promptSelect(_0x57d6b3(0xa8),_0x5532a7);_0x526d78=_0x5532a7[_0x2d1cfe]??_0x5532a7[0x0];}let _0x134814=normalizeHookFunctionNode(_0x2fb27e[_0x57d6b3(0xc4)]('function-node'));if(!_0x134814){if(_0x2fb27e[_0x57d6b3(0xc4)](_0x57d6b3(0xc6)))throw CliErrors[_0x57d6b3(0xa3)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x2fb27e[_0x57d6b3(0x90)])throw CliErrors[_0x57d6b3(0xa3)](_0x57d6b3(0xac));const _0x23cdde=await promptSelect(_0x57d6b3(0x95),['before',_0x57d6b3(0xa9)]);_0x134814=['before','after'][_0x23cdde]??_0x57d6b3(0x7d);}return{'alias':_0x202412,'datasetCode':_0x104f68,'datasetId':_0x20eec3,'operationType':_0x526d78,'functionNode':_0x134814};}async function promptSelect(_0x54f04f,_0x2e4059){const _0x4050f7=a23_0x1a088d;if(_0x2e4059[_0x4050f7(0x92)]===0x1)return 0x0;for(const [_0x3ec072,_0x32cbeb]of _0x2e4059[_0x4050f7(0xc7)]()){process['stderr'][_0x4050f7(0xae)]('\x20\x20'+(_0x3ec072+0x1)+'.\x20'+_0x32cbeb+'\x0a');}const _0x2c1b02=createInterface({'input':process['stdin'],'output':process[_0x4050f7(0x88)]});while(!![]){const _0x432dbd=await new Promise(_0x25a200=>{const _0x1de4b3=_0x4050f7;_0x2c1b02[_0x1de4b3(0x9d)](_0x54f04f+'\x20',_0x25a200);}),_0x218d50=Number['parseInt'](_0x432dbd[_0x4050f7(0x9c)](),0xa);if(Number[_0x4050f7(0xd1)](_0x218d50)&&_0x218d50>=0x1&&_0x218d50<=_0x2e4059[_0x4050f7(0x92)])return _0x2c1b02[_0x4050f7(0xbd)](),_0x218d50-0x1;process[_0x4050f7(0x88)]['write'](_0x4050f7(0xc2)+_0x2e4059['length']+'.\x0a');}}function buildFilePath(_0x31a754,_0x114ed4,_0x5efa82,_0x45eedc){const _0x4acf14=a23_0x1a088d;if(_0x114ed4===_0x4acf14(0xce)){if(!_0x45eedc)throw CliErrors['validation'](_0x4acf14(0xc1));const _0x388b5b=_0x45eedc[_0x4acf14(0xb6)]??_0x45eedc[_0x4acf14(0x8c)];return join(_0x31a754['scriptsRootDir'],'HOOK',_0x388b5b,_0x45eedc[_0x4acf14(0xa6)],_0x45eedc['functionNode'],_0x5efa82+_0x4acf14(0xba));}return join(_0x31a754[_0x4acf14(0xbc)],_0x114ed4,_0x5efa82+_0x4acf14(0xba));}function generateTemplate(_0x34426d,_0x594b6f,_0x2e7e90,_0x1b8111,_0x40cc29){const _0x18e9dd=a23_0x1a088d,_0x4f0581=_0x1b8111?.[_0x18e9dd(0x9c)]()||_0x18e9dd(0x9b);if(_0x34426d===_0x18e9dd(0xb9))return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x4f0581+_0x18e9dd(0xcb)+_0x594b6f+_0x18e9dd(0x8d)+_0x594b6f+_0x18e9dd(0x8e)+_0x594b6f+_0x18e9dd(0x94);if(_0x34426d===_0x18e9dd(0xa4))return _0x18e9dd(0xc8)+_0x4f0581+_0x18e9dd(0x91)+_0x2e7e90['appCode']+_0x18e9dd(0x7e)+_0x594b6f+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x594b6f+_0x18e9dd(0x94);if(!_0x40cc29)throw CliErrors[_0x18e9dd(0xa3)](_0x18e9dd(0x82));return _0x18e9dd(0x86)+_0x4f0581+_0x18e9dd(0x91)+_0x2e7e90[_0x18e9dd(0xb1)]+'/'+_0x40cc29[_0x18e9dd(0x8c)]+'/'+_0x40cc29[_0x18e9dd(0xa6)]+'\x0a\x20*\x20[触发节点]\x20'+_0x40cc29['functionNode']+_0x18e9dd(0xab)+_0x594b6f+_0x18e9dd(0x94);}
1
+ const a23_0x266c6a=a23_0x244c;function a23_0x1854(){const _0xa17af1=['2715327xzpwWn','\x22\x20not\x20found\x20for\x20dataset\x20','str','nonInteractive','datasetcode','description','question','Script\x20description','TODO:\x20add\x20script\x20description','38856cRCQYe','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','isInteger','File\x20already\x20exists:\x20','function-node','stdin','.js','HOOK','keys','496143qJEvAe','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x22.\x20','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Trigger\x20node\x20(HOOK\x20only)','parseInt','Select\x20operation\x20type:','operationType','write','Script\x20type','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','450BEqxKK','after','ENDPOINT','Available:\x20','map','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Alias\x20\x22','2537208xqsRPN','scriptsRootDir','Created\x20','Operation\x20type\x20(HOOK\x20only)','datasetCode','COMMON','(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a','type','No\x20operation\x20types\x20found\x20for\x20dataset\x20','468buwpNH','429aXOSwQ','Select\x20dataset:','4YJLlYl','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','string','No\x20api.ts\x20found.\x20Run\x20`','Invalid\x20dataset\x20selection.','includes','HOOK\x20requires\x20alias/operation/node\x20options.','\x20function:\x20','functionNode','trim','stderr','Available\x20aliases:\x20','name','14bXZpJW','before','\x22\x20not\x20found.\x20','Select\x20trigger\x20node:','772488oSxtit','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','alias','apiDir','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','appCode','\x0a\x20*\x20[触发节点]\x20','operation-type','69672NhtVej','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','length','code','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','utf8','find','\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','130530NEnsBJ','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Function\x20name\x20(valid\x20JS\x20identifier)','new','validation'];a23_0x1854=function(){return _0xa17af1;};return a23_0x1854();}(function(_0x4f5696,_0x1ae804){const _0x190412=a23_0x244c,_0x2daaad=_0x4f5696();while(!![]){try{const _0x5577d3=parseInt(_0x190412(0x174))/0x1+parseInt(_0x190412(0x14a))/0x2+parseInt(_0x190412(0x162))/0x3*(-parseInt(_0x190412(0x139))/0x4)+parseInt(_0x190412(0x181))/0x5*(-parseInt(_0x190412(0x16b))/0x6)+parseInt(_0x190412(0x146))/0x7*(parseInt(_0x190412(0x188))/0x8)+-parseInt(_0x190412(0x136))/0x9*(-parseInt(_0x190412(0x15c))/0xa)+parseInt(_0x190412(0x137))/0xb*(-parseInt(_0x190412(0x152))/0xc);if(_0x5577d3===_0x1ae804)break;else _0x2daaad['push'](_0x2daaad['shift']());}catch(_0x19c2be){_0x2daaad['push'](_0x2daaad['shift']());}}}(a23_0x1854,0x75726));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a23_0x244c(_0x2ad630,_0x19883c){_0x2ad630=_0x2ad630-0x132;const _0x1854c5=a23_0x1854();let _0x244cd2=_0x1854c5[_0x2ad630];return _0x244cd2;}export const bffNew={'service':'bff','command':a23_0x266c6a(0x160),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a23_0x266c6a(0x17c),'flags':[{'name':a23_0x266c6a(0x134),'type':a23_0x266c6a(0x13b),'required':!![],'enum':[a23_0x266c6a(0x132),a23_0x266c6a(0x183),a23_0x266c6a(0x172)],'description':a23_0x266c6a(0x17d)},{'name':a23_0x266c6a(0x145),'type':'string','required':!![],'description':a23_0x266c6a(0x15f)},{'name':a23_0x266c6a(0x167),'type':'string','description':a23_0x266c6a(0x169)},{'name':'alias','type':a23_0x266c6a(0x13b),'description':a23_0x266c6a(0x175)},{'name':'datasetcode','type':a23_0x266c6a(0x13b),'description':a23_0x266c6a(0x15a)},{'name':'operation-type','type':a23_0x266c6a(0x13b),'description':a23_0x266c6a(0x18b)},{'name':a23_0x266c6a(0x16f),'type':'string','description':a23_0x266c6a(0x178),'enum':[a23_0x266c6a(0x147),'after']}],async 'validate'(_0x35b13d){const _0x4d44d6=a23_0x266c6a,_0x57495e=_0x35b13d[_0x4d44d6(0x164)](_0x4d44d6(0x145));if(!isValidBffFunctionName(_0x57495e))throw CliErrors['validation']('Invalid\x20function\x20name\x20\x22'+_0x57495e+_0x4d44d6(0x14e));},async 'execute'(_0x305544){const _0x1891e4=a23_0x266c6a,_0x3e8107=loadBffProjectConfig(_0x305544['appCode']),_0x44dc11=_0x305544[_0x1891e4(0x164)](_0x1891e4(0x134)),_0x4fa0fb=_0x305544[_0x1891e4(0x164)](_0x1891e4(0x145)),_0x168af9=_0x305544['str'](_0x1891e4(0x167))||undefined,_0x4224de=_0x44dc11===_0x1891e4(0x172)?await resolveHookOptions(_0x3e8107,_0x305544):undefined,_0x1afe0d=buildFilePath(_0x3e8107,_0x44dc11,_0x4fa0fb,_0x4224de);if(await fileExists(_0x1afe0d))throw CliErrors[_0x1891e4(0x161)](_0x1891e4(0x16e)+_0x1afe0d);await mkdir(dirname(_0x1afe0d),{'recursive':!![]});const _0x1af3d7=generateTemplate(_0x44dc11,_0x4fa0fb,_0x3e8107,_0x168af9,_0x4224de);await writeFile(_0x1afe0d,_0x1af3d7,_0x1891e4(0x157));const _0x2430e5={'type':_0x44dc11,'name':_0x4fa0fb,'path':_0x1afe0d};if(_0x168af9)_0x2430e5[_0x1891e4(0x167)]=_0x168af9;if(_0x4224de){if(_0x4224de[_0x1891e4(0x14c)])_0x2430e5[_0x1891e4(0x14c)]=_0x4224de[_0x1891e4(0x14c)];_0x2430e5['datasetCode']=_0x4224de['datasetCode'],_0x2430e5[_0x1891e4(0x17b)]=_0x4224de['operationType'],_0x2430e5[_0x1891e4(0x141)]=_0x4224de[_0x1891e4(0x141)];}return{'ok':!![],'data':_0x2430e5,'message':_0x1891e4(0x18a)+_0x44dc11+_0x1891e4(0x140)+_0x4fa0fb};}};async function resolveHookOptions(_0x3473f8,_0x56f1db){const _0x510faa=a23_0x266c6a,_0x44c0cd=loadAliasMap(_0x56f1db[_0x510faa(0x14d)]),_0x467381=_0x44c0cd[_0x510faa(0x154)]>0x0;let _0x339731,_0x557468,_0x1c0838;const _0x65be3c=_0x56f1db[_0x510faa(0x164)](_0x510faa(0x14c)),_0x52f226=_0x56f1db['str'](_0x510faa(0x166));if(_0x65be3c){const _0x257a97=resolveAlias(_0x56f1db[_0x510faa(0x14d)],_0x65be3c);if(!_0x257a97){const _0x38d6d7=_0x467381?_0x510faa(0x144)+_0x44c0cd[_0x510faa(0x185)](_0x319454=>_0x319454[_0x510faa(0x14c)])['join'](',\x20'):_0x510faa(0x13c)+CLI_BIN_NAME+_0x510faa(0x15b);throw CliErrors[_0x510faa(0x161)](_0x510faa(0x187)+_0x65be3c+_0x510faa(0x148)+_0x38d6d7);}_0x339731=_0x65be3c,_0x557468=_0x257a97;}else{if(_0x52f226){_0x557468=_0x52f226;const _0x1ea7e3=_0x44c0cd[_0x510faa(0x158)](_0x352bb5=>_0x352bb5[_0x510faa(0x18c)]===_0x52f226);_0x339731=_0x1ea7e3?.[_0x510faa(0x14c)];}else{if(_0x56f1db[_0x510faa(0x165)])throw CliErrors[_0x510faa(0x161)](_0x510faa(0x16c));else{if(_0x467381){const _0x56a2ec=_0x44c0cd[_0x510faa(0x185)](_0x40f6e2=>_0x40f6e2[_0x510faa(0x14c)]+'\x20('+_0x40f6e2['tableName']+')'),_0x100aeb=await promptSelect(_0x510faa(0x138),_0x56a2ec),_0x43fe82=_0x44c0cd[_0x100aeb];if(!_0x43fe82)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x13d));_0x339731=_0x43fe82[_0x510faa(0x14c)],_0x557468=_0x43fe82[_0x510faa(0x18c)];}else{const _0xdc390e=await listDatasets(_0x3473f8[_0x510faa(0x14f)]);if(_0xdc390e[_0x510faa(0x154)]===0x0)throw CliErrors[_0x510faa(0x161)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x2c03dc=_0xdc390e['map'](_0x26274b=>_0x26274b[_0x510faa(0x145)]+'\x20('+_0x26274b[_0x510faa(0x155)]+')'),_0xd30ea6=await promptSelect(_0x510faa(0x138),_0x2c03dc),_0x3b8d44=_0xdc390e[_0xd30ea6];if(!_0x3b8d44)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x13d));_0x557468=_0x3b8d44[_0x510faa(0x155)],_0x339731=undefined;}}}}const _0x205ee9=await listDatasets(_0x3473f8[_0x510faa(0x14f)]),_0x581ec9=_0x205ee9[_0x510faa(0x158)](_0x3ac5b5=>_0x3ac5b5[_0x510faa(0x155)]===_0x557468);if(!_0x581ec9)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x17f)+_0x557468+_0x510faa(0x176)+(_0x339731?_0x510faa(0x14b)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x1c0838=_0x581ec9['id'];const _0x44373a=_0x339731??_0x557468,_0x422b23=await listBffDatasetOperations(_0x3473f8[_0x510faa(0x14f)],_0x1c0838),_0x4e0bb9=_0x422b23?Object[_0x510faa(0x173)](_0x422b23):[];if(_0x4e0bb9['length']===0x0)throw CliErrors[_0x510faa(0x161)](_0x510faa(0x135)+_0x44373a+'.');let _0x39d658;const _0x2688fb=_0x56f1db['str'](_0x510faa(0x151));if(_0x2688fb){if(!_0x4e0bb9[_0x510faa(0x13e)](_0x2688fb))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x2688fb+_0x510faa(0x163)+_0x44373a+'.\x20'+(_0x510faa(0x184)+_0x4e0bb9['join'](',\x20')));_0x39d658=_0x2688fb;}else{if(_0x56f1db[_0x510faa(0x165)])throw CliErrors[_0x510faa(0x161)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0xfe041f=await promptSelect(_0x510faa(0x17a),_0x4e0bb9);_0x39d658=_0x4e0bb9[_0xfe041f]??_0x4e0bb9[0x0];}let _0xadf71f=normalizeHookFunctionNode(_0x56f1db[_0x510faa(0x164)](_0x510faa(0x16f)));if(!_0xadf71f){if(_0x56f1db[_0x510faa(0x164)](_0x510faa(0x16f)))throw CliErrors['validation'](_0x510faa(0x180));if(_0x56f1db[_0x510faa(0x165)])throw CliErrors['validation'](_0x510faa(0x156));const _0x5e0866=await promptSelect(_0x510faa(0x149),[_0x510faa(0x147),_0x510faa(0x182)]);_0xadf71f=[_0x510faa(0x147),_0x510faa(0x182)][_0x5e0866]??_0x510faa(0x147);}return{'alias':_0x339731,'datasetCode':_0x557468,'datasetId':_0x1c0838,'operationType':_0x39d658,'functionNode':_0xadf71f};}async function promptSelect(_0x2b7287,_0x466c8e){const _0x3eba1a=a23_0x266c6a;if(_0x466c8e[_0x3eba1a(0x154)]===0x1)return 0x0;for(const [_0x43d7da,_0x468128]of _0x466c8e['entries']()){process[_0x3eba1a(0x143)][_0x3eba1a(0x17c)]('\x20\x20'+(_0x43d7da+0x1)+'.\x20'+_0x468128+'\x0a');}const _0x1a0f98=createInterface({'input':process[_0x3eba1a(0x170)],'output':process[_0x3eba1a(0x143)]});while(!![]){const _0x23fac0=await new Promise(_0xcf2d17=>{const _0x5f3ab7=_0x3eba1a;_0x1a0f98[_0x5f3ab7(0x168)](_0x2b7287+'\x20',_0xcf2d17);}),_0x5bc4a3=Number[_0x3eba1a(0x179)](_0x23fac0[_0x3eba1a(0x142)](),0xa);if(Number[_0x3eba1a(0x16d)](_0x5bc4a3)&&_0x5bc4a3>=0x1&&_0x5bc4a3<=_0x466c8e[_0x3eba1a(0x154)])return _0x1a0f98['close'](),_0x5bc4a3-0x1;process[_0x3eba1a(0x143)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x466c8e[_0x3eba1a(0x154)]+'.\x0a');}}function buildFilePath(_0x278f5d,_0x145381,_0x184426,_0x4b301f){const _0x49c54a=a23_0x266c6a;if(_0x145381==='HOOK'){if(!_0x4b301f)throw CliErrors['validation'](_0x49c54a(0x13f));const _0x203539=_0x4b301f[_0x49c54a(0x14c)]??_0x4b301f[_0x49c54a(0x18c)];return join(_0x278f5d[_0x49c54a(0x189)],_0x49c54a(0x172),_0x203539,_0x4b301f[_0x49c54a(0x17b)],_0x4b301f[_0x49c54a(0x141)],_0x184426+_0x49c54a(0x171));}return join(_0x278f5d[_0x49c54a(0x189)],_0x145381,_0x184426+_0x49c54a(0x171));}function generateTemplate(_0x414a3c,_0x45cd57,_0x4d72aa,_0x3002c9,_0x4f313b){const _0x617214=a23_0x266c6a,_0x56bc51=_0x3002c9?.[_0x617214(0x142)]()||_0x617214(0x16a);if(_0x414a3c==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x56bc51+_0x617214(0x159)+_0x45cd57+_0x617214(0x15e)+_0x45cd57+_0x617214(0x177)+_0x45cd57+_0x617214(0x133);if(_0x414a3c==='ENDPOINT')return _0x617214(0x186)+_0x56bc51+_0x617214(0x15d)+_0x4d72aa['appCode']+'/endpoint/'+_0x45cd57+_0x617214(0x153)+_0x45cd57+_0x617214(0x133);if(!_0x4f313b)throw CliErrors[_0x617214(0x161)](_0x617214(0x13a));return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x56bc51+_0x617214(0x15d)+_0x4d72aa[_0x617214(0x14f)]+'/'+_0x4f313b['datasetCode']+'/'+_0x4f313b['operationType']+_0x617214(0x150)+_0x4f313b[_0x617214(0x141)]+_0x617214(0x17e)+_0x45cd57+'(params,\x20context)\x20{\x0a\x20\x20void\x20context;\x0a\x20\x20return\x20params;\x0a}\x0a';}
@@ -1 +1 @@
1
- const a24_0x25d292=a24_0x12a1;(function(_0xd9a952,_0x1a45a5){const _0xf0efc=a24_0x12a1,_0x78fce3=_0xd9a952();while(!![]){try{const _0x336283=parseInt(_0xf0efc(0x161))/0x1+-parseInt(_0xf0efc(0x163))/0x2+-parseInt(_0xf0efc(0x177))/0x3+-parseInt(_0xf0efc(0x18d))/0x4*(parseInt(_0xf0efc(0x180))/0x5)+-parseInt(_0xf0efc(0x176))/0x6+parseInt(_0xf0efc(0x17b))/0x7+parseInt(_0xf0efc(0x186))/0x8;if(_0x336283===_0x1a45a5)break;else _0x78fce3['push'](_0x78fce3['shift']());}catch(_0x3d57b6){_0x78fce3['push'](_0x78fce3['shift']());}}}(a24_0xb09f,0xd959c));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';function a24_0xb09f(){const _0x47f7fc=['3419566NIovyL','alias','Force\x20overwrite\x20local\x20unsynced\x20changes','trim','lastSync','type','toLowerCase','scriptsWorkspaceRoot','all','bff','hookLocation','write','question','str','push','HOOK','ENDPOINT','utf8','cancelled','7143282rDwnjF','644211sebRKu','stderr','boolean','apiDir','10900792NJhUZu','scriptType','appCode','force','version','260SRwVAn','pull','Remote\x20script\x20missing\x20content.','functionName','No\x20remote\x20BFF\x20scripts\x20found.','Would\x20pull\x20','20688576UlxewD','bool','lockFilePath','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','scriptContent','COMMON','\x20skipped,\x20','97628iLJlnS','length','Pull\x20complete:\x20','message','functions','apps','lockKey','\x20failed','nonInteractive','operationType','close','scriptsRoot','\x20file(s)','Remote\x20script\x20missing\x20id.','stdin','datasetCode','string','filePath','1131171fZfyVm','map'];a24_0xb09f=function(){return _0x47f7fc;};return a24_0xb09f();}import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a24_0x25d292(0x16c),'command':a24_0x25d292(0x181),'description':a24_0x25d292(0x189),'risk':a24_0x25d292(0x16e),'flags':[{'name':'type','type':a24_0x25d292(0x15f),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a24_0x25d292(0x18b),a24_0x25d292(0x173),a24_0x25d292(0x172)]},{'name':'force','type':a24_0x25d292(0x179),'description':a24_0x25d292(0x165)}],async 'dryRun'(_0x1ff601){const _0x2cfc35=a24_0x25d292,_0xbba11f=loadBffProjectConfig(_0x1ff601[_0x2cfc35(0x17d)]),_0x12aaed=await readBffLockFile(_0xbba11f[_0x2cfc35(0x188)]),{appLock:_0x28896a}=ensureLockScope(_0x12aaed??createEmptyBffLock(),_0xbba11f[_0x2cfc35(0x17d)],_0xbba11f[_0x2cfc35(0x15a)],_0x2cfc35(0x181),_0xbba11f[_0x2cfc35(0x17d)],_0xbba11f[_0x2cfc35(0x16a)]+'/'+_0xbba11f['appCode']),_0x3ecf34=buildDatasetCodeToAliasMap(_0x1ff601[_0x2cfc35(0x17a)]),_0x19184f=normalizeBffType(_0x1ff601[_0x2cfc35(0x170)](_0x2cfc35(0x168)))??undefined,[_0x13378b,_0x2851f8]=await Promise[_0x2cfc35(0x16b)]([listBffScripts(_0x1ff601[_0x2cfc35(0x17d)],_0x19184f),getBffScriptStatistics(_0x1ff601[_0x2cfc35(0x17d)])]),_0x1a7112=createHookLocationMap(_0x2851f8),_0x58013c=[];for(const _0x2753a8 of _0x13378b){const _0x3606f3=resolveRemoteScriptTarget(_0xbba11f,_0x2753a8,_0x1a7112,_0x28896a[_0x2cfc35(0x153)],_0x3ecf34);if(_0x3606f3)_0x58013c[_0x2cfc35(0x171)](_0x3606f3[_0x2cfc35(0x155)]);}return{'method':'GET','url':'/api/management/library/scripts/list','body':{'scripts':_0x58013c,'appCode':_0x1ff601[_0x2cfc35(0x17d)]},'description':_0x2cfc35(0x185)+_0x58013c[_0x2cfc35(0x18e)]+_0x2cfc35(0x15b)};},async 'execute'(_0x389730){const _0x4a2071=a24_0x25d292,_0x1b80e1=loadBffProjectConfig(_0x389730[_0x4a2071(0x17d)]),_0x427627=await readBffLockFile(_0x1b80e1[_0x4a2071(0x188)]),{lockData:_0x1a82ee,appLock:_0x38e566}=ensureLockScope(_0x427627??createEmptyBffLock(),_0x1b80e1[_0x4a2071(0x17d)],_0x1b80e1[_0x4a2071(0x15a)],_0x4a2071(0x181),_0x1b80e1[_0x4a2071(0x17d)],_0x1b80e1[_0x4a2071(0x16a)]+'/'+_0x1b80e1['appCode']),_0x252960=normalizeBffType(_0x389730[_0x4a2071(0x170)](_0x4a2071(0x168)))??undefined;if(_0x389730[_0x4a2071(0x170)](_0x4a2071(0x168))&&!_0x252960)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x4bf228,_0x4b9ba2]=await Promise[_0x4a2071(0x16b)]([listBffScripts(_0x389730[_0x4a2071(0x17d)],_0x252960),getBffScriptStatistics(_0x389730[_0x4a2071(0x17d)])]);if(_0x4bf228[_0x4a2071(0x18e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4a2071(0x184)};const _0x45a256=_0x389730[_0x4a2071(0x187)](_0x4a2071(0x17e));if(_0x45a256&&!_0x389730[_0x4a2071(0x157)]){const _0x4fc441=await confirmForce();if(!_0x4fc441)throw CliErrors[_0x4a2071(0x175)]('Force\x20pull\x20cancelled.');}if(_0x45a256&&_0x389730[_0x4a2071(0x157)]){}const _0x31ab58=buildDatasetCodeToAliasMap(_0x389730['apiDir']),_0x426c4e=createHookLocationMap(_0x4b9ba2),_0x4df3b8=cloneLockData(_0x1a82ee),_0x1e9dd2=_0x4df3b8[_0x4a2071(0x154)][_0x1b80e1[_0x4a2071(0x17d)]],_0xc5eb29=[],_0x1137bc=[],_0x1bbbea=[];for(const _0x2d7bdf of _0x4bf228){const _0xbbc8f3=resolveRemoteScriptTarget(_0x1b80e1,_0x2d7bdf,_0x426c4e,_0x38e566['functions'],_0x31ab58);if(!_0xbbc8f3){_0x1137bc['push']({'lockKey':_0x2d7bdf[_0x4a2071(0x17c)]+'/'+_0x2d7bdf[_0x4a2071(0x183)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x2bf6c7=_0x38e566[_0x4a2071(0x153)][_0xbbc8f3['lockKey']];try{if(!_0x45a256){const _0x3f8590=await hasUnsyncedLocalChanges(_0xbbc8f3[_0x4a2071(0x160)],_0x2bf6c7);if(_0x3f8590){_0x1137bc['push']({'lockKey':_0xbbc8f3[_0x4a2071(0x155)],'reason':'local\x20unsynced\x20changes'});continue;}}if(!_0x2d7bdf['id'])throw new Error(_0x4a2071(0x15c));if(_0x2d7bdf[_0x4a2071(0x18a)]==null)throw new Error(_0x4a2071(0x182));const _0x233e2e=_0x2d7bdf[_0x4a2071(0x18a)];await ensureParentDirectory(_0xbbc8f3[_0x4a2071(0x160)]),await writeFile(_0xbbc8f3[_0x4a2071(0x160)],_0x233e2e,_0x4a2071(0x174));const _0x22e1fd={'hash':computeContentHash(_0x233e2e),'remoteId':_0x2d7bdf['id'],'version':_0x2d7bdf[_0x4a2071(0x17f)]};_0xbbc8f3[_0x4a2071(0x168)]===_0x4a2071(0x172)&&_0xbbc8f3[_0x4a2071(0x16d)]&&(_0x22e1fd['alias']=_0xbbc8f3[_0x4a2071(0x16d)][_0x4a2071(0x164)],_0x22e1fd['datasetCode']=_0xbbc8f3[_0x4a2071(0x16d)][_0x4a2071(0x15e)],_0x22e1fd['operationType']=_0xbbc8f3[_0x4a2071(0x16d)][_0x4a2071(0x158)],_0x22e1fd['functionNode']=_0xbbc8f3[_0x4a2071(0x16d)]['functionNode']),_0x1e9dd2[_0x4a2071(0x153)][_0xbbc8f3[_0x4a2071(0x155)]]=_0x22e1fd,_0xc5eb29[_0x4a2071(0x171)]({'lockKey':_0xbbc8f3[_0x4a2071(0x155)],'remoteId':_0x2d7bdf['id']});}catch(_0x188f1d){_0x1bbbea[_0x4a2071(0x171)]({'lockKey':_0xbbc8f3[_0x4a2071(0x155)],'error':_0x188f1d instanceof Error?_0x188f1d[_0x4a2071(0x152)]:String(_0x188f1d)});}}return _0x1e9dd2[_0x4a2071(0x167)]=new Date()['toISOString'](),await writeBffLockFile(_0x1b80e1['lockFilePath'],_0x4df3b8),{'ok':_0x1bbbea[_0x4a2071(0x18e)]===0x0,'data':{'pulled':_0xc5eb29,'skipped':_0x1137bc,'failed':_0x1bbbea},'message':_0x4a2071(0x151)+_0xc5eb29['length']+'\x20pulled,\x20'+_0x1137bc[_0x4a2071(0x18e)]+_0x4a2071(0x18c)+_0x1bbbea[_0x4a2071(0x18e)]+_0x4a2071(0x156)};}};async function hasUnsyncedLocalChanges(_0x398882,_0x5f5aa0){if(!await fileExists(_0x398882))return![];const _0x56d044=await computeFileHash(_0x398882);if(!_0x5f5aa0)return!![];return _0x56d044!==_0x5f5aa0['hash'];}function a24_0x12a1(_0x559560,_0x57c586){_0x559560=_0x559560-0x151;const _0xb09fc5=a24_0xb09f();let _0x12a10e=_0xb09fc5[_0x559560];return _0x12a10e;}function cloneLockData(_0x526535){const _0x124edf=a24_0x25d292;return{'aliases':{..._0x526535['aliases']},'apps':Object['fromEntries'](Object['entries'](_0x526535['apps'])['map'](([_0x3aba09,_0x36ccec])=>[_0x3aba09,{'scriptsRoot':_0x36ccec[_0x124edf(0x15a)],'lastSync':_0x36ccec[_0x124edf(0x167)],'functions':{..._0x36ccec[_0x124edf(0x153)]}}]))};}function buildDatasetCodeToAliasMap(_0x3ccc23){const _0x59f535=a24_0x25d292,_0x3b36e2=loadAliasMap(_0x3ccc23);return new Map(_0x3b36e2[_0x59f535(0x162)](_0x329763=>[_0x329763[_0x59f535(0x15e)],_0x329763[_0x59f535(0x164)]]));}async function confirmForce(){const _0x1aeaca=a24_0x25d292,_0x526c32=createInterface({'input':process[_0x1aeaca(0x15d)],'output':process[_0x1aeaca(0x178)]}),_0xeaa7b4=await new Promise(_0x2bfcd0=>{const _0x3b5ae9=_0x1aeaca;_0x526c32[_0x3b5ae9(0x16f)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x2bfcd0);});return _0x526c32[_0x1aeaca(0x159)](),['y','yes']['includes'](_0xeaa7b4[_0x1aeaca(0x166)]()[_0x1aeaca(0x169)]());}
1
+ const a24_0x33e56c=a24_0x4304;(function(_0xb25d04,_0x49c7ca){const _0x1541c9=a24_0x4304,_0x51e820=_0xb25d04();while(!![]){try{const _0x53a00d=parseInt(_0x1541c9(0x102))/0x1+-parseInt(_0x1541c9(0x103))/0x2*(parseInt(_0x1541c9(0x12b))/0x3)+parseInt(_0x1541c9(0x11d))/0x4*(parseInt(_0x1541c9(0x10c))/0x5)+-parseInt(_0x1541c9(0x108))/0x6+-parseInt(_0x1541c9(0x12d))/0x7+parseInt(_0x1541c9(0x114))/0x8+-parseInt(_0x1541c9(0xee))/0x9*(-parseInt(_0x1541c9(0x12e))/0xa);if(_0x53a00d===_0x49c7ca)break;else _0x51e820['push'](_0x51e820['shift']());}catch(_0x4aed41){_0x51e820['push'](_0x51e820['shift']());}}}(a24_0x3039,0xe7c65));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';function a24_0x4304(_0x473ca4,_0x395cff){_0x473ca4=_0x473ca4-0xea;const _0x30396c=a24_0x3039();let _0x43042a=_0x30396c[_0x473ca4];return _0x43042a;}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';function a24_0x3039(){const _0x29c5fa=['lockFilePath','ENDPOINT','filePath','aliases','Force\x20pull\x20cancelled.','859216gJcnCa','datasetCode','bff','functionName','stdin','bool','push','scriptsWorkspaceRoot','functionNode','12pgkoUS','version','scriptType','appCode','Remote\x20script\x20missing\x20id.','validation','hash','HOOK','type','utf8','force','string','/api/management/library/scripts/list','local\x20unsynced\x20changes','249TsWGjP','scriptContent','5834178zYkBoB','3263290mJSEaQ','apps','nonInteractive','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','GET','boolean','\x20pulled,\x20','yes','fromEntries','54kLHUTb','close','functions','COMMON','pull','length','Force\x20overwrite\x20local\x20unsynced\x20changes','trim','str','alias','Pull\x20complete:\x20','lockKey','hookLocation','apiDir','toLowerCase','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','lastSync','unresolvable\x20target\x20path','scriptsRoot','\x20file(s)','695589MTRebR','1852vmVEPC','operationType','all','toISOString','stderr','10743240qhsXJa','\x20failed','write','includes','1482060POOETm','Remote\x20script\x20missing\x20content.','map'];a24_0x3039=function(){return _0x29c5fa;};return a24_0x3039();}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a24_0x33e56c(0x116),'command':'pull','description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a24_0x33e56c(0x10a),'flags':[{'name':a24_0x33e56c(0x125),'type':a24_0x33e56c(0x128),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a24_0x33e56c(0xf1),a24_0x33e56c(0x110),'HOOK']},{'name':a24_0x33e56c(0x127),'type':a24_0x33e56c(0xea),'description':a24_0x33e56c(0xf4)}],async 'dryRun'(_0x4c3da2){const _0x4a35c8=a24_0x33e56c,_0x3b2546=loadBffProjectConfig(_0x4c3da2[_0x4a35c8(0x120)]),_0x19b71c=await readBffLockFile(_0x3b2546[_0x4a35c8(0x10f)]),{appLock:_0x2404d2}=ensureLockScope(_0x19b71c??createEmptyBffLock(),_0x3b2546[_0x4a35c8(0x120)],_0x3b2546[_0x4a35c8(0x100)],_0x4a35c8(0xf2),_0x3b2546[_0x4a35c8(0x120)],_0x3b2546[_0x4a35c8(0x11b)]+'/'+_0x3b2546[_0x4a35c8(0x120)]),_0x4d0748=buildDatasetCodeToAliasMap(_0x4c3da2[_0x4a35c8(0xfb)]),_0x6b9b10=normalizeBffType(_0x4c3da2[_0x4a35c8(0xf6)](_0x4a35c8(0x125)))??undefined,[_0x18bc5e,_0x4b7199]=await Promise['all']([listBffScripts(_0x4c3da2[_0x4a35c8(0x120)],_0x6b9b10),getBffScriptStatistics(_0x4c3da2[_0x4a35c8(0x120)])]),_0x4d6541=createHookLocationMap(_0x4b7199),_0x4b1891=[];for(const _0x2119d8 of _0x18bc5e){const _0x10d780=resolveRemoteScriptTarget(_0x3b2546,_0x2119d8,_0x4d6541,_0x2404d2[_0x4a35c8(0xf0)],_0x4d0748);if(_0x10d780)_0x4b1891[_0x4a35c8(0x11a)](_0x10d780[_0x4a35c8(0xf9)]);}return{'method':_0x4a35c8(0x132),'url':_0x4a35c8(0x129),'body':{'scripts':_0x4b1891,'appCode':_0x4c3da2['appCode']},'description':'Would\x20pull\x20'+_0x4b1891[_0x4a35c8(0xf3)]+_0x4a35c8(0x101)};},async 'execute'(_0x18e9ec){const _0x1e9995=a24_0x33e56c,_0x255cf9=loadBffProjectConfig(_0x18e9ec['appCode']),_0x51bf39=await readBffLockFile(_0x255cf9[_0x1e9995(0x10f)]),{lockData:_0x3a0a3a,appLock:_0x4e9eda}=ensureLockScope(_0x51bf39??createEmptyBffLock(),_0x255cf9[_0x1e9995(0x120)],_0x255cf9[_0x1e9995(0x100)],_0x1e9995(0xf2),_0x255cf9[_0x1e9995(0x120)],_0x255cf9[_0x1e9995(0x11b)]+'/'+_0x255cf9['appCode']),_0x7d026d=normalizeBffType(_0x18e9ec[_0x1e9995(0xf6)](_0x1e9995(0x125)))??undefined;if(_0x18e9ec['str'](_0x1e9995(0x125))&&!_0x7d026d)throw CliErrors[_0x1e9995(0x122)](_0x1e9995(0x131));const [_0x126dc4,_0x36285f]=await Promise[_0x1e9995(0x105)]([listBffScripts(_0x18e9ec[_0x1e9995(0x120)],_0x7d026d),getBffScriptStatistics(_0x18e9ec['appCode'])]);if(_0x126dc4[_0x1e9995(0xf3)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x184655=_0x18e9ec[_0x1e9995(0x119)](_0x1e9995(0x127));if(_0x184655&&!_0x18e9ec[_0x1e9995(0x130)]){const _0x26bd42=await confirmForce();if(!_0x26bd42)throw CliErrors['cancelled'](_0x1e9995(0x113));}if(_0x184655&&_0x18e9ec[_0x1e9995(0x130)]){}const _0x176600=buildDatasetCodeToAliasMap(_0x18e9ec[_0x1e9995(0xfb)]),_0x3c64a1=createHookLocationMap(_0x36285f),_0x46dd87=cloneLockData(_0x3a0a3a),_0x3bdb84=_0x46dd87[_0x1e9995(0x12f)][_0x255cf9[_0x1e9995(0x120)]],_0x39f0ea=[],_0xa5030e=[],_0xb09124=[];for(const _0x3d1c66 of _0x126dc4){const _0x4b45ba=resolveRemoteScriptTarget(_0x255cf9,_0x3d1c66,_0x3c64a1,_0x4e9eda[_0x1e9995(0xf0)],_0x176600);if(!_0x4b45ba){_0xa5030e[_0x1e9995(0x11a)]({'lockKey':_0x3d1c66[_0x1e9995(0x11f)]+'/'+_0x3d1c66[_0x1e9995(0x117)],'reason':_0x1e9995(0xff)});continue;}const _0x2bb4d9=_0x4e9eda[_0x1e9995(0xf0)][_0x4b45ba[_0x1e9995(0xf9)]];try{if(!_0x184655){const _0x591c9a=await hasUnsyncedLocalChanges(_0x4b45ba[_0x1e9995(0x111)],_0x2bb4d9);if(_0x591c9a){_0xa5030e[_0x1e9995(0x11a)]({'lockKey':_0x4b45ba[_0x1e9995(0xf9)],'reason':_0x1e9995(0x12a)});continue;}}if(!_0x3d1c66['id'])throw new Error(_0x1e9995(0x121));if(_0x3d1c66[_0x1e9995(0x12c)]==null)throw new Error(_0x1e9995(0x10d));const _0x41e71b=_0x3d1c66['scriptContent'];await ensureParentDirectory(_0x4b45ba['filePath']),await writeFile(_0x4b45ba[_0x1e9995(0x111)],_0x41e71b,_0x1e9995(0x126));const _0x3c35ad={'hash':computeContentHash(_0x41e71b),'remoteId':_0x3d1c66['id'],'version':_0x3d1c66[_0x1e9995(0x11e)]};_0x4b45ba['type']===_0x1e9995(0x124)&&_0x4b45ba[_0x1e9995(0xfa)]&&(_0x3c35ad[_0x1e9995(0xf7)]=_0x4b45ba[_0x1e9995(0xfa)][_0x1e9995(0xf7)],_0x3c35ad[_0x1e9995(0x115)]=_0x4b45ba[_0x1e9995(0xfa)][_0x1e9995(0x115)],_0x3c35ad['operationType']=_0x4b45ba[_0x1e9995(0xfa)][_0x1e9995(0x104)],_0x3c35ad[_0x1e9995(0x11c)]=_0x4b45ba[_0x1e9995(0xfa)]['functionNode']),_0x3bdb84[_0x1e9995(0xf0)][_0x4b45ba['lockKey']]=_0x3c35ad,_0x39f0ea[_0x1e9995(0x11a)]({'lockKey':_0x4b45ba[_0x1e9995(0xf9)],'remoteId':_0x3d1c66['id']});}catch(_0xd8fa00){_0xb09124[_0x1e9995(0x11a)]({'lockKey':_0x4b45ba['lockKey'],'error':_0xd8fa00 instanceof Error?_0xd8fa00['message']:String(_0xd8fa00)});}}return _0x3bdb84[_0x1e9995(0xfe)]=new Date()[_0x1e9995(0x106)](),await writeBffLockFile(_0x255cf9['lockFilePath'],_0x46dd87),{'ok':_0xb09124[_0x1e9995(0xf3)]===0x0,'data':{'pulled':_0x39f0ea,'skipped':_0xa5030e,'failed':_0xb09124},'message':_0x1e9995(0xf8)+_0x39f0ea[_0x1e9995(0xf3)]+_0x1e9995(0xeb)+_0xa5030e['length']+'\x20skipped,\x20'+_0xb09124[_0x1e9995(0xf3)]+_0x1e9995(0x109)};}};async function hasUnsyncedLocalChanges(_0x421aa7,_0x419f30){const _0x5b7c54=a24_0x33e56c;if(!await fileExists(_0x421aa7))return![];const _0x51239e=await computeFileHash(_0x421aa7);if(!_0x419f30)return!![];return _0x51239e!==_0x419f30[_0x5b7c54(0x123)];}function cloneLockData(_0x246630){const _0x2f3abc=a24_0x33e56c;return{'aliases':{..._0x246630[_0x2f3abc(0x112)]},'apps':Object[_0x2f3abc(0xed)](Object['entries'](_0x246630[_0x2f3abc(0x12f)])[_0x2f3abc(0x10e)](([_0x9abd1d,_0x7dbaa9])=>[_0x9abd1d,{'scriptsRoot':_0x7dbaa9[_0x2f3abc(0x100)],'lastSync':_0x7dbaa9[_0x2f3abc(0xfe)],'functions':{..._0x7dbaa9['functions']}}]))};}function buildDatasetCodeToAliasMap(_0x5307f2){const _0x57c0ee=a24_0x33e56c,_0x511b34=loadAliasMap(_0x5307f2);return new Map(_0x511b34[_0x57c0ee(0x10e)](_0x15a866=>[_0x15a866['datasetCode'],_0x15a866[_0x57c0ee(0xf7)]]));}async function confirmForce(){const _0x581720=a24_0x33e56c,_0x20bfab=createInterface({'input':process[_0x581720(0x118)],'output':process[_0x581720(0x107)]}),_0x4005e1=await new Promise(_0x55210f=>{const _0x46d1bc=_0x581720;_0x20bfab['question'](_0x46d1bc(0xfd),_0x55210f);});return _0x20bfab[_0x581720(0xef)](),['y',_0x581720(0xec)][_0x581720(0x10b)](_0x4005e1[_0x581720(0xf5)]()[_0x581720(0xfc)]());}
@@ -1 +1 @@
1
- const a25_0x4a7acb=a25_0x1af5;(function(_0x44557d,_0x507251){const _0x2f0d0f=a25_0x1af5,_0x45d528=_0x44557d();while(!![]){try{const _0x226d89=parseInt(_0x2f0d0f(0x96))/0x1+parseInt(_0x2f0d0f(0x9e))/0x2*(-parseInt(_0x2f0d0f(0xaf))/0x3)+-parseInt(_0x2f0d0f(0xc4))/0x4+-parseInt(_0x2f0d0f(0xa6))/0x5*(-parseInt(_0x2f0d0f(0xcf))/0x6)+-parseInt(_0x2f0d0f(0x95))/0x7+parseInt(_0x2f0d0f(0x91))/0x8*(parseInt(_0x2f0d0f(0x94))/0x9)+parseInt(_0x2f0d0f(0xc1))/0xa;if(_0x226d89===_0x507251)break;else _0x45d528['push'](_0x45d528['shift']());}catch(_0x4e6182){_0x45d528['push'](_0x45d528['shift']());}}}(a25_0x3a41,0xf33a1));function a25_0x1af5(_0x2c74a7,_0x4cba31){_0x2c74a7=_0x2c74a7-0x8e;const _0x3a41f2=a25_0x3a41();let _0x1af546=_0x3a41f2[_0x2c74a7];return _0x1af546;}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a25_0x3a41(){const _0xf26853=['Push\x20local\x20BFF\x20scripts\x20to\x20remote','Push\x20complete:\x20','\x20uploaded,\x20','\x20failed','functionNode','88NxHsBy','utf8','COMMON','aliasToDatasetCode','filePath','str','toISOString','Incomplete\x20HOOK\x20path:\x20','1055sgPnGq','version','alias','scriptsWorkspaceRoot','lastSync','description','length','Would\x20push\x20','hash','81039xJRmLw','lockKey','code','push','unchanged','Run\x20`','appCode','datasetCode','\x20file(s)','POST','type','high-risk-write','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','HOOK','string','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','apiDir','force','13428670HfPNBO','remoteId','bff','4607420vyvdmG','Cannot\x20resolve\x20dataset\x20for\x20\x22','boolean','get','/api/management/library/scripts/save','validation','map','filter','\x22.\x20','ENDPOINT','No\x20local\x20BFF\x20functions\x20found.','51108oxoxpR','has','datasetId','lockFilePath','scriptsRoot','59352aYYpkD','operationType','message','2151hOkQpD','11735234KOEaZc','99840twmCdl','functions','name'];a25_0x3a41=function(){return _0xf26853;};return a25_0x3a41();}import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a25_0x4a7acb(0xc3),'command':a25_0x4a7acb(0xb2),'description':a25_0x4a7acb(0x99),'risk':a25_0x4a7acb(0xba),'flags':[{'name':a25_0x4a7acb(0xb9),'type':a25_0x4a7acb(0xbd),'description':'Push\x20only\x20this\x20script\x20type','enum':[a25_0x4a7acb(0xa0),a25_0x4a7acb(0xcd),a25_0x4a7acb(0xbc)]},{'name':a25_0x4a7acb(0x98),'type':a25_0x4a7acb(0xbd),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a25_0x4a7acb(0xc0),'type':a25_0x4a7acb(0xc6),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x4aece5){const _0x5ee337=a25_0x4a7acb,_0x22e730=loadBffProjectConfig(_0x4aece5[_0x5ee337(0xb5)]),_0x4fbad4=await readBffLockFile(_0x22e730[_0x5ee337(0x8f)]),{appLock:_0x4e7fd0}=ensureLockScope(_0x4fbad4??createEmptyBffLock(),_0x22e730[_0x5ee337(0xb5)],_0x22e730[_0x5ee337(0x90)],_0x5ee337(0xb2),_0x22e730[_0x5ee337(0xb5)],_0x22e730[_0x5ee337(0xa9)]+'/'+_0x22e730[_0x5ee337(0xb5)]),_0x3c6cdd=await getTargetFunctions(_0x22e730,_0x4aece5),_0x7387a6=_0x4aece5['bool'](_0x5ee337(0xc0)),_0xcbc77c=[];for(const _0x1334a9 of _0x3c6cdd){const _0x16b4fd=await computeFileHash(_0x1334a9['filePath']),_0x4e396d=_0x4e7fd0[_0x5ee337(0x97)][_0x1334a9[_0x5ee337(0xb0)]];if(!_0x7387a6&&_0x4e396d&&_0x4e396d['hash']===_0x16b4fd)continue;_0xcbc77c[_0x5ee337(0xb2)](_0x1334a9[_0x5ee337(0xb0)]);}return{'method':_0x5ee337(0xb8),'url':_0x5ee337(0xc8),'body':{'files':_0xcbc77c,'appCode':_0x4aece5['appCode']},'description':_0x5ee337(0xad)+_0xcbc77c[_0x5ee337(0xac)]+_0x5ee337(0xb7)};},async 'execute'(_0x2d0e33){const _0x32ea72=a25_0x4a7acb,_0x2c5776=loadBffProjectConfig(_0x2d0e33['appCode']),_0x33bd13=await readBffLockFile(_0x2c5776['lockFilePath']),{lockData:_0x1d4c20,appLock:_0xe4eb47}=ensureLockScope(_0x33bd13??createEmptyBffLock(),_0x2c5776['appCode'],_0x2c5776[_0x32ea72(0x90)],_0x32ea72(0xb2),_0x2c5776[_0x32ea72(0xb5)],_0x2c5776[_0x32ea72(0xa9)]+'/'+_0x2c5776['appCode']),_0x1a252a=await getTargetFunctions(_0x2c5776,_0x2d0e33);if(_0x1a252a[_0x32ea72(0xac)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x32ea72(0xce)};const _0x58a807=_0x2d0e33['bool'](_0x32ea72(0xc0)),_0x4e7783=await buildHookMaps(_0x2c5776[_0x32ea72(0xb5)],_0x2d0e33[_0x32ea72(0xbf)],_0x1a252a,_0xe4eb47),_0x2307d7=[],_0x463b90=[],_0x15b915=[];for(const _0x333de4 of _0x1a252a){const _0xcffc91=await computeFileHash(_0x333de4['filePath']),_0x1459a3=_0xe4eb47[_0x32ea72(0x97)][_0x333de4[_0x32ea72(0xb0)]];if(!_0x58a807&&_0x1459a3&&_0x1459a3[_0x32ea72(0xae)]===_0xcffc91){_0x463b90[_0x32ea72(0xb2)]({'lockKey':_0x333de4[_0x32ea72(0xb0)],'reason':_0x32ea72(0xb3)});continue;}try{await uploadSingleFunction(_0x2c5776[_0x32ea72(0xb5)],_0x333de4,_0xe4eb47,_0x4e7783);const _0x14cc6c=_0xe4eb47[_0x32ea72(0x97)][_0x333de4[_0x32ea72(0xb0)]];_0x2307d7[_0x32ea72(0xb2)]({'lockKey':_0x333de4[_0x32ea72(0xb0)],'remoteId':_0x14cc6c?.[_0x32ea72(0xc2)]??0x0});}catch(_0x5eb055){_0x15b915[_0x32ea72(0xb2)]({'lockKey':_0x333de4[_0x32ea72(0xb0)],'error':_0x5eb055 instanceof Error?_0x5eb055[_0x32ea72(0x93)]:String(_0x5eb055)});}}return _0xe4eb47[_0x32ea72(0xaa)]=new Date()[_0x32ea72(0xa4)](),await writeBffLockFile(_0x2c5776['lockFilePath'],_0x1d4c20),{'ok':_0x15b915[_0x32ea72(0xac)]===0x0,'data':{'uploaded':_0x2307d7,'skipped':_0x463b90,'failed':_0x15b915},'message':_0x32ea72(0x9a)+_0x2307d7[_0x32ea72(0xac)]+_0x32ea72(0x9b)+_0x463b90[_0x32ea72(0xac)]+'\x20skipped,\x20'+_0x15b915[_0x32ea72(0xac)]+_0x32ea72(0x9c)};}};async function getTargetFunctions(_0x4e378d,_0x5be06b){const _0x35c55f=a25_0x4a7acb,_0x5803d7=_0x5be06b['str'](_0x35c55f(0xb9)),_0xc7c7cf=_0x5be06b[_0x35c55f(0xa3)](_0x35c55f(0x98)),_0x4e960f=normalizeBffType(_0x5803d7)??undefined;if(_0xc7c7cf&&!_0x4e960f)throw CliErrors['validation'](_0x35c55f(0xbb));const _0x4e9d1b=await scanLocalBffFunctions(_0x4e378d,_0x4e960f);if(_0xc7c7cf){const _0x523162=_0x4e9d1b[_0x35c55f(0xcb)](_0x2fd794=>_0x2fd794[_0x35c55f(0x98)]===_0xc7c7cf);if(_0x523162[_0x35c55f(0xac)]===0x0)throw CliErrors[_0x35c55f(0xc9)]('Local\x20function\x20not\x20found:\x20'+_0x4e960f+'/'+_0xc7c7cf);return _0x523162;}return _0x4e9d1b;}async function buildHookMaps(_0x1a8a24,_0x33e989,_0x3a5730,_0x1cd7da){const _0x3e94e8=a25_0x4a7acb,_0xf514b3=_0x3a5730['some'](_0x456158=>_0x456158[_0x3e94e8(0xb9)]===_0x3e94e8(0xbc));if(!_0xf514b3)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x15af0d=loadAliasMap(_0x33e989),_0x5565cc=new Map(_0x15af0d[_0x3e94e8(0xca)](_0x2a00d2=>[_0x2a00d2[_0x3e94e8(0xa8)],_0x2a00d2[_0x3e94e8(0xb6)]]));for(const _0x2f91a7 of Object['values'](_0x1cd7da[_0x3e94e8(0x97)])){_0x2f91a7['alias']&&_0x2f91a7[_0x3e94e8(0xb6)]&&!_0x5565cc[_0x3e94e8(0xd0)](_0x2f91a7[_0x3e94e8(0xa8)])&&_0x5565cc['set'](_0x2f91a7[_0x3e94e8(0xa8)],_0x2f91a7[_0x3e94e8(0xb6)]);}const _0x153ec2=await listDatasets(_0x1a8a24),_0x98c34e=new Map(_0x153ec2['map'](_0x265c55=>[_0x265c55[_0x3e94e8(0xb1)],_0x265c55['id']]));return{'aliasToDatasetCode':_0x5565cc,'datasetCodeToId':_0x98c34e};}async function uploadSingleFunction(_0x62b542,_0x23c04d,_0x4e7f40,_0xf47861){const _0x1bfb85=a25_0x4a7acb,_0x5dcf3b=await readFile(_0x23c04d[_0x1bfb85(0xa2)],_0x1bfb85(0x9f)),_0x508fb0=await computeFileHash(_0x23c04d['filePath']),_0x41c8c4=_0x4e7f40[_0x1bfb85(0x97)][_0x23c04d[_0x1bfb85(0xb0)]];if(_0x41c8c4?.[_0x1bfb85(0xc2)]&&_0x41c8c4[_0x1bfb85(0xa7)]==null)throw CliErrors[_0x1bfb85(0xc9)](_0x23c04d[_0x1bfb85(0xb0)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x3af762=extractScriptDescription(_0x5dcf3b);if(!_0x3af762&&_0x41c8c4?.['remoteId']){const _0x451ec2=await getBffScriptInfo(_0x41c8c4[_0x1bfb85(0xc2)]);_0x3af762=_0x451ec2[_0x1bfb85(0xab)]||undefined;}const _0x25f183={'appCode':_0x62b542,'functionName':_0x23c04d['name'],'scriptType':_0x23c04d[_0x1bfb85(0xb9)],'scriptContent':_0x5dcf3b};if(_0x41c8c4?.[_0x1bfb85(0xc2)])_0x25f183['id']=_0x41c8c4[_0x1bfb85(0xc2)];if(_0x41c8c4?.['version']!=null)_0x25f183[_0x1bfb85(0xa7)]=_0x41c8c4[_0x1bfb85(0xa7)];if(_0x3af762)_0x25f183[_0x1bfb85(0xab)]=_0x3af762;if(_0x23c04d[_0x1bfb85(0xb9)]==='HOOK'){const _0x1ab891=_0x23c04d[_0x1bfb85(0xa8)];if(!_0x1ab891||!_0x23c04d[_0x1bfb85(0x92)]||!_0x23c04d[_0x1bfb85(0x9d)])throw CliErrors[_0x1bfb85(0xc9)](_0x1bfb85(0xa5)+_0x23c04d[_0x1bfb85(0xb0)]);const _0x521ec7=_0xf47861['aliasToDatasetCode'][_0x1bfb85(0xc7)](_0x1ab891)??_0x41c8c4?.['datasetCode']??_0x1ab891,_0x11b76e=_0xf47861['datasetCodeToId'][_0x1bfb85(0xc7)](_0x521ec7);if(!_0x11b76e)throw CliErrors['validation'](_0x1bfb85(0xc5)+_0x1ab891+_0x1bfb85(0xcc)+(_0x1bfb85(0xb4)+CLI_BIN_NAME+_0x1bfb85(0xbe)));_0x25f183[_0x1bfb85(0x8e)]=_0x11b76e,_0x25f183[_0x1bfb85(0x92)]=_0x23c04d[_0x1bfb85(0x92)],_0x25f183[_0x1bfb85(0x9d)]=_0x23c04d[_0x1bfb85(0x9d)];}const _0x7cea19=await saveBffScript(_0x25f183),_0xb6bdab=await getBffScriptInfo(_0x7cea19),_0xbb3277={'hash':_0x508fb0,'remoteId':_0x7cea19,'version':_0xb6bdab[_0x1bfb85(0xa7)]};if(_0x23c04d[_0x1bfb85(0xb9)]===_0x1bfb85(0xbc)){const _0x4b91be=_0x23c04d[_0x1bfb85(0xa8)],_0x465d52=_0xf47861[_0x1bfb85(0xa1)]['get'](_0x4b91be)??_0x41c8c4?.['datasetCode']??_0x4b91be;_0xf47861[_0x1bfb85(0xa1)][_0x1bfb85(0xd0)](_0x4b91be)?_0xbb3277[_0x1bfb85(0xa8)]=_0x4b91be:_0xbb3277[_0x1bfb85(0xa8)]=_0x41c8c4?.[_0x1bfb85(0xa8)],_0xbb3277[_0x1bfb85(0xb6)]=_0x465d52,_0xbb3277[_0x1bfb85(0x92)]=_0x23c04d[_0x1bfb85(0x92)],_0xbb3277[_0x1bfb85(0x9d)]=_0x23c04d[_0x1bfb85(0x9d)];}_0x4e7f40[_0x1bfb85(0x97)][_0x23c04d['lockKey']]=_0xbb3277;}
1
+ const a25_0x1823de=a25_0x82c4;(function(_0x358452,_0x4f56c5){const _0x565cc5=a25_0x82c4,_0x4ee78b=_0x358452();while(!![]){try{const _0x44ed8f=-parseInt(_0x565cc5(0x122))/0x1*(-parseInt(_0x565cc5(0x121))/0x2)+-parseInt(_0x565cc5(0x130))/0x3*(parseInt(_0x565cc5(0xf7))/0x4)+parseInt(_0x565cc5(0x123))/0x5*(-parseInt(_0x565cc5(0x126))/0x6)+parseInt(_0x565cc5(0x108))/0x7+parseInt(_0x565cc5(0x10c))/0x8*(parseInt(_0x565cc5(0x129))/0x9)+parseInt(_0x565cc5(0x115))/0xa+-parseInt(_0x565cc5(0x114))/0xb*(-parseInt(_0x565cc5(0x125))/0xc);if(_0x44ed8f===_0x4f56c5)break;else _0x4ee78b['push'](_0x4ee78b['shift']());}catch(_0xd9dc8c){_0x4ee78b['push'](_0x4ee78b['shift']());}}}(a25_0x2f99,0x1f011));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a25_0x2f99(){const _0x11d608=['filter','unchanged','has','1179416cXrFFv','get','name','scriptsWorkspaceRoot','8aZZgYh','hash','Would\x20push\x20','functionNode','lockFilePath','\x22.\x20','functions','COMMON','1762233MrmVvC','1686830FYggQD','lastSync','datasetCodeToId','Push\x20local\x20BFF\x20scripts\x20to\x20remote','map','Cannot\x20resolve\x20dataset\x20for\x20\x22','string','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','set','Push\x20complete:\x20','alias','code','2294auqVTN','30xbKrwJ','1256565VoZRRN','operationType','12lcMxsr','6iqRRTb','Incomplete\x20HOOK\x20path:\x20',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','89793XwJlQl','No\x20local\x20BFF\x20functions\x20found.','remoteId','Run\x20`','high-risk-write','type','message','765VpWYeV','str','aliasToDatasetCode','appCode','Force\x20push\x20ignoring\x20hash\x20protection','lockKey','\x20failed','POST','ENDPOINT','filePath','toISOString','validation','\x20file(s)','description','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','force','2564hAUJQm','push','HOOK','boolean','values','some','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Push\x20only\x20this\x20script\x20type','length','scriptsRoot','version','datasetCode','\x20skipped,\x20','bool'];a25_0x2f99=function(){return _0x11d608;};return a25_0x2f99();}function a25_0x82c4(_0x7288aa,_0x351992){_0x7288aa=_0x7288aa-0xf7;const _0x2f99b7=a25_0x2f99();let _0x82c42f=_0x2f99b7[_0x7288aa];return _0x82c42f;}export const bffPush={'service':'bff','command':a25_0x1823de(0xf8),'description':a25_0x1823de(0x118),'risk':a25_0x1823de(0x12d),'flags':[{'name':a25_0x1823de(0x12e),'type':'string','description':a25_0x1823de(0xfe),'enum':[a25_0x1823de(0x113),a25_0x1823de(0x138),a25_0x1823de(0xf9)]},{'name':a25_0x1823de(0x10a),'type':a25_0x1823de(0x11b),'description':a25_0x1823de(0xfd)},{'name':a25_0x1823de(0x13f),'type':a25_0x1823de(0xfa),'description':a25_0x1823de(0x134)}],async 'dryRun'(_0x1e3e6b){const _0x4651c8=a25_0x1823de,_0x2f5bfa=loadBffProjectConfig(_0x1e3e6b[_0x4651c8(0x133)]),_0x10139d=await readBffLockFile(_0x2f5bfa[_0x4651c8(0x110)]),{appLock:_0x5ab78b}=ensureLockScope(_0x10139d??createEmptyBffLock(),_0x2f5bfa[_0x4651c8(0x133)],_0x2f5bfa['scriptsRoot'],'push',_0x2f5bfa[_0x4651c8(0x133)],_0x2f5bfa[_0x4651c8(0x10b)]+'/'+_0x2f5bfa['appCode']),_0x83aed2=await getTargetFunctions(_0x2f5bfa,_0x1e3e6b),_0x30315a=_0x1e3e6b[_0x4651c8(0x104)]('force'),_0x51f2cb=[];for(const _0x320e0c of _0x83aed2){const _0x2eaf8a=await computeFileHash(_0x320e0c['filePath']),_0x49fc65=_0x5ab78b[_0x4651c8(0x112)][_0x320e0c[_0x4651c8(0x135)]];if(!_0x30315a&&_0x49fc65&&_0x49fc65[_0x4651c8(0x10d)]===_0x2eaf8a)continue;_0x51f2cb['push'](_0x320e0c[_0x4651c8(0x135)]);}return{'method':_0x4651c8(0x137),'url':'/api/management/library/scripts/save','body':{'files':_0x51f2cb,'appCode':_0x1e3e6b[_0x4651c8(0x133)]},'description':_0x4651c8(0x10e)+_0x51f2cb['length']+_0x4651c8(0x13c)};},async 'execute'(_0x1324bf){const _0x2bdc39=a25_0x1823de,_0x3e866e=loadBffProjectConfig(_0x1324bf[_0x2bdc39(0x133)]),_0x4c10ef=await readBffLockFile(_0x3e866e[_0x2bdc39(0x110)]),{lockData:_0x57fdb5,appLock:_0x7e36ec}=ensureLockScope(_0x4c10ef??createEmptyBffLock(),_0x3e866e[_0x2bdc39(0x133)],_0x3e866e[_0x2bdc39(0x100)],_0x2bdc39(0xf8),_0x3e866e[_0x2bdc39(0x133)],_0x3e866e[_0x2bdc39(0x10b)]+'/'+_0x3e866e[_0x2bdc39(0x133)]),_0x9318a9=await getTargetFunctions(_0x3e866e,_0x1324bf);if(_0x9318a9[_0x2bdc39(0xff)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x2bdc39(0x12a)};const _0x502278=_0x1324bf['bool']('force'),_0x2f8836=await buildHookMaps(_0x3e866e[_0x2bdc39(0x133)],_0x1324bf['apiDir'],_0x9318a9,_0x7e36ec),_0x22fec7=[],_0x56f18d=[],_0x3b3009=[];for(const _0x4b4ea8 of _0x9318a9){const _0x57af9c=await computeFileHash(_0x4b4ea8[_0x2bdc39(0x139)]),_0xc56ae3=_0x7e36ec[_0x2bdc39(0x112)][_0x4b4ea8['lockKey']];if(!_0x502278&&_0xc56ae3&&_0xc56ae3[_0x2bdc39(0x10d)]===_0x57af9c){_0x56f18d[_0x2bdc39(0xf8)]({'lockKey':_0x4b4ea8[_0x2bdc39(0x135)],'reason':_0x2bdc39(0x106)});continue;}try{await uploadSingleFunction(_0x3e866e[_0x2bdc39(0x133)],_0x4b4ea8,_0x7e36ec,_0x2f8836);const _0x5ea7f5=_0x7e36ec[_0x2bdc39(0x112)][_0x4b4ea8[_0x2bdc39(0x135)]];_0x22fec7[_0x2bdc39(0xf8)]({'lockKey':_0x4b4ea8[_0x2bdc39(0x135)],'remoteId':_0x5ea7f5?.[_0x2bdc39(0x12b)]??0x0});}catch(_0x4f51ad){_0x3b3009['push']({'lockKey':_0x4b4ea8[_0x2bdc39(0x135)],'error':_0x4f51ad instanceof Error?_0x4f51ad[_0x2bdc39(0x12f)]:String(_0x4f51ad)});}}return _0x7e36ec[_0x2bdc39(0x116)]=new Date()[_0x2bdc39(0x13a)](),await writeBffLockFile(_0x3e866e[_0x2bdc39(0x110)],_0x57fdb5),{'ok':_0x3b3009['length']===0x0,'data':{'uploaded':_0x22fec7,'skipped':_0x56f18d,'failed':_0x3b3009},'message':_0x2bdc39(0x11e)+_0x22fec7[_0x2bdc39(0xff)]+'\x20uploaded,\x20'+_0x56f18d['length']+_0x2bdc39(0x103)+_0x3b3009[_0x2bdc39(0xff)]+_0x2bdc39(0x136)};}};async function getTargetFunctions(_0x33fba5,_0x4b8431){const _0x4500a9=a25_0x1823de,_0x5692c2=_0x4b8431[_0x4500a9(0x131)](_0x4500a9(0x12e)),_0x4f0d2f=_0x4b8431[_0x4500a9(0x131)]('name'),_0x1b4bb9=normalizeBffType(_0x5692c2)??undefined;if(_0x4f0d2f&&!_0x1b4bb9)throw CliErrors[_0x4500a9(0x13b)](_0x4500a9(0x13e));const _0x28bdac=await scanLocalBffFunctions(_0x33fba5,_0x1b4bb9);if(_0x4f0d2f){const _0x11961f=_0x28bdac[_0x4500a9(0x105)](_0x509d41=>_0x509d41[_0x4500a9(0x10a)]===_0x4f0d2f);if(_0x11961f[_0x4500a9(0xff)]===0x0)throw CliErrors[_0x4500a9(0x13b)]('Local\x20function\x20not\x20found:\x20'+_0x1b4bb9+'/'+_0x4f0d2f);return _0x11961f;}return _0x28bdac;}async function buildHookMaps(_0x544170,_0x53551e,_0xfd6130,_0x641e77){const _0x110a4b=a25_0x1823de,_0x40f5cb=_0xfd6130[_0x110a4b(0xfc)](_0x263429=>_0x263429['type']===_0x110a4b(0xf9));if(!_0x40f5cb)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x266a67=loadAliasMap(_0x53551e),_0xb96ea3=new Map(_0x266a67[_0x110a4b(0x119)](_0x155b31=>[_0x155b31[_0x110a4b(0x11f)],_0x155b31['datasetCode']]));for(const _0x5927c1 of Object[_0x110a4b(0xfb)](_0x641e77[_0x110a4b(0x112)])){_0x5927c1[_0x110a4b(0x11f)]&&_0x5927c1[_0x110a4b(0x102)]&&!_0xb96ea3['has'](_0x5927c1['alias'])&&_0xb96ea3[_0x110a4b(0x11d)](_0x5927c1['alias'],_0x5927c1['datasetCode']);}const _0x48ce5d=await listDatasets(_0x544170),_0x2b699c=new Map(_0x48ce5d['map'](_0x2b4f9e=>[_0x2b4f9e[_0x110a4b(0x120)],_0x2b4f9e['id']]));return{'aliasToDatasetCode':_0xb96ea3,'datasetCodeToId':_0x2b699c};}async function uploadSingleFunction(_0x3a0c64,_0x407652,_0x10c505,_0x365b4b){const _0x4c9ce9=a25_0x1823de,_0x574765=await readFile(_0x407652[_0x4c9ce9(0x139)],'utf8'),_0x354f53=await computeFileHash(_0x407652[_0x4c9ce9(0x139)]),_0x5effa3=_0x10c505['functions'][_0x407652[_0x4c9ce9(0x135)]];if(_0x5effa3?.[_0x4c9ce9(0x12b)]&&_0x5effa3['version']==null)throw CliErrors['validation'](_0x407652[_0x4c9ce9(0x135)]+_0x4c9ce9(0x128));let _0x805787=extractScriptDescription(_0x574765);if(!_0x805787&&_0x5effa3?.[_0x4c9ce9(0x12b)]){const _0x8efa37=await getBffScriptInfo(_0x5effa3[_0x4c9ce9(0x12b)]);_0x805787=_0x8efa37[_0x4c9ce9(0x13d)]||undefined;}const _0x42274c={'appCode':_0x3a0c64,'functionName':_0x407652['name'],'scriptType':_0x407652[_0x4c9ce9(0x12e)],'scriptContent':_0x574765};if(_0x5effa3?.[_0x4c9ce9(0x12b)])_0x42274c['id']=_0x5effa3['remoteId'];if(_0x5effa3?.[_0x4c9ce9(0x101)]!=null)_0x42274c[_0x4c9ce9(0x101)]=_0x5effa3[_0x4c9ce9(0x101)];if(_0x805787)_0x42274c[_0x4c9ce9(0x13d)]=_0x805787;if(_0x407652[_0x4c9ce9(0x12e)]===_0x4c9ce9(0xf9)){const _0x41c508=_0x407652[_0x4c9ce9(0x11f)];if(!_0x41c508||!_0x407652[_0x4c9ce9(0x124)]||!_0x407652[_0x4c9ce9(0x10f)])throw CliErrors[_0x4c9ce9(0x13b)](_0x4c9ce9(0x127)+_0x407652[_0x4c9ce9(0x135)]);const _0x32af16=_0x365b4b[_0x4c9ce9(0x132)][_0x4c9ce9(0x109)](_0x41c508)??_0x5effa3?.['datasetCode']??_0x41c508,_0x3531eb=_0x365b4b[_0x4c9ce9(0x117)][_0x4c9ce9(0x109)](_0x32af16);if(!_0x3531eb)throw CliErrors['validation'](_0x4c9ce9(0x11a)+_0x41c508+_0x4c9ce9(0x111)+(_0x4c9ce9(0x12c)+CLI_BIN_NAME+_0x4c9ce9(0x11c)));_0x42274c['datasetId']=_0x3531eb,_0x42274c[_0x4c9ce9(0x124)]=_0x407652[_0x4c9ce9(0x124)],_0x42274c['functionNode']=_0x407652[_0x4c9ce9(0x10f)];}const _0x293874=await saveBffScript(_0x42274c),_0x31e918=await getBffScriptInfo(_0x293874),_0x310f68={'hash':_0x354f53,'remoteId':_0x293874,'version':_0x31e918['version']};if(_0x407652[_0x4c9ce9(0x12e)]===_0x4c9ce9(0xf9)){const _0x5cde02=_0x407652[_0x4c9ce9(0x11f)],_0x1b17d5=_0x365b4b[_0x4c9ce9(0x132)][_0x4c9ce9(0x109)](_0x5cde02)??_0x5effa3?.[_0x4c9ce9(0x102)]??_0x5cde02;_0x365b4b['aliasToDatasetCode'][_0x4c9ce9(0x107)](_0x5cde02)?_0x310f68[_0x4c9ce9(0x11f)]=_0x5cde02:_0x310f68[_0x4c9ce9(0x11f)]=_0x5effa3?.[_0x4c9ce9(0x11f)],_0x310f68[_0x4c9ce9(0x102)]=_0x1b17d5,_0x310f68[_0x4c9ce9(0x124)]=_0x407652[_0x4c9ce9(0x124)],_0x310f68[_0x4c9ce9(0x10f)]=_0x407652[_0x4c9ce9(0x10f)];}_0x10c505[_0x4c9ce9(0x112)][_0x407652[_0x4c9ce9(0x135)]]=_0x310f68;}
@@ -1 +1 @@
1
- function a26_0x4b06(){const _0x53a0a8=['apiDir','\x20remote-only','hash','has','alias','length','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','all','1316572LMfKWt','appCode','scriptsRoot','7wSAKIf','\x20modified,\x20','1946157ApWqwq','9676184mPUjNg','5009500HcxSCz','push','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','remote','read','boolean','status','\x20unchanged','50BBMSpG','663849MMLYxo','lockKey','functions','196ZEMCzd','datasetCode','5975436XUABsA','10489WHeYah'];a26_0x4b06=function(){return _0x53a0a8;};return a26_0x4b06();}const a26_0x383af9=a26_0x1260;(function(_0x214f41,_0x6d1cd){const _0x4a54ae=a26_0x1260,_0x406cb1=_0x214f41();while(!![]){try{const _0x4855c4=parseInt(_0x4a54ae(0x104))/0x1*(parseInt(_0x4a54ae(0x101))/0x2)+parseInt(_0x4a54ae(0x112))/0x3+parseInt(_0x4a54ae(0x10d))/0x4+-parseInt(_0x4a54ae(0x114))/0x5+parseInt(_0x4a54ae(0x103))/0x6*(-parseInt(_0x4a54ae(0x110))/0x7)+parseInt(_0x4a54ae(0x113))/0x8+-parseInt(_0x4a54ae(0x11d))/0x9*(parseInt(_0x4a54ae(0x11c))/0xa);if(_0x4855c4===_0x6d1cd)break;else _0x406cb1['push'](_0x406cb1['shift']());}catch(_0x1e5448){_0x406cb1['push'](_0x406cb1['shift']());}}}(a26_0x4b06,0xcf338));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a26_0x1260(_0x26c98c,_0x358e18){_0x26c98c=_0x26c98c-0x100;const _0x4b0652=a26_0x4b06();let _0x1260e4=_0x4b0652[_0x26c98c];return _0x1260e4;}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a26_0x383af9(0x11a),'description':a26_0x383af9(0x116),'risk':a26_0x383af9(0x118),'flags':[{'name':a26_0x383af9(0x117),'type':a26_0x383af9(0x119),'description':a26_0x383af9(0x10b)}],async 'execute'(_0x3e6f3a){const _0x3ca349=a26_0x383af9,_0x2d6ec8=loadBffProjectConfig(_0x3e6f3a['appCode']),_0x41cf97=await readBffLockFile(_0x2d6ec8['lockFilePath']),{appLock:_0x288ec0}=ensureLockScope(_0x41cf97??createEmptyBffLock(),_0x2d6ec8[_0x3ca349(0x10e)],_0x2d6ec8[_0x3ca349(0x10f)],_0x3ca349(0x11a),_0x2d6ec8[_0x3ca349(0x10e)],_0x2d6ec8['scriptsWorkspaceRoot']+'/'+_0x2d6ec8[_0x3ca349(0x10e)]),_0x308186=await scanLocalBffFunctions(_0x2d6ec8),_0x2b3503=[],_0x5040f9=[],_0x101c6a=[];for(const _0x19f2b8 of _0x308186){const _0x332ce1=await computeFileHash(_0x19f2b8['filePath']),_0x119039=_0x288ec0[_0x3ca349(0x100)][_0x19f2b8['lockKey']];if(!_0x119039)_0x2b3503['push'](_0x19f2b8[_0x3ca349(0x11e)]);else _0x119039[_0x3ca349(0x107)]!==_0x332ce1?_0x5040f9[_0x3ca349(0x115)](_0x19f2b8[_0x3ca349(0x11e)]):_0x101c6a[_0x3ca349(0x115)](_0x19f2b8[_0x3ca349(0x11e)]);}const _0x336e47=[];if(_0x3e6f3a['bool'](_0x3ca349(0x117))){const _0x2fee34=loadAliasMap(_0x3e6f3a[_0x3ca349(0x105)]),_0x401c1b=new Map(_0x2fee34['map'](_0x2c96b6=>[_0x2c96b6[_0x3ca349(0x102)],_0x2c96b6[_0x3ca349(0x109)]])),[_0x535e91,_0x661782]=await Promise[_0x3ca349(0x10c)]([listBffScripts(_0x3e6f3a[_0x3ca349(0x10e)]),getBffScriptStatistics(_0x3e6f3a['appCode'])]),_0x1ad41d=createHookLocationMap(_0x661782),_0x524057=new Set(_0x308186['map'](_0x334d0b=>_0x334d0b['lockKey']));for(const _0x358ff7 of _0x535e91){const _0x2ed0dd=resolveRemoteScriptTarget(_0x2d6ec8,_0x358ff7,_0x1ad41d,_0x288ec0[_0x3ca349(0x100)],_0x401c1b);_0x2ed0dd&&!_0x524057[_0x3ca349(0x108)](_0x2ed0dd[_0x3ca349(0x11e)])&&_0x336e47['push'](_0x2ed0dd[_0x3ca349(0x11e)]);}}const _0x331591=_0x2b3503['length']===0x0&&_0x5040f9[_0x3ca349(0x10a)]===0x0&&_0x336e47[_0x3ca349(0x10a)]===0x0;return{'ok':!![],'data':{'added':_0x2b3503,'modified':_0x5040f9,'unchanged':_0x101c6a,'remoteOnly':_0x336e47},'message':_0x331591?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x2b3503[_0x3ca349(0x10a)]+'\x20added,\x20'+_0x5040f9['length']+_0x3ca349(0x111)+_0x101c6a[_0x3ca349(0x10a)]+_0x3ca349(0x11b)+(_0x336e47[_0x3ca349(0x10a)]>0x0?',\x20'+_0x336e47[_0x3ca349(0x10a)]+_0x3ca349(0x106):'')};}};
1
+ const a26_0x55bd1c=a26_0x93e6;(function(_0x8797df,_0x522825){const _0x491faa=a26_0x93e6,_0x2b94f5=_0x8797df();while(!![]){try{const _0x49cdeb=parseInt(_0x491faa(0x13c))/0x1+parseInt(_0x491faa(0x13d))/0x2*(-parseInt(_0x491faa(0x147))/0x3)+-parseInt(_0x491faa(0x145))/0x4*(-parseInt(_0x491faa(0x132))/0x5)+-parseInt(_0x491faa(0x141))/0x6+parseInt(_0x491faa(0x131))/0x7*(parseInt(_0x491faa(0x130))/0x8)+parseInt(_0x491faa(0x128))/0x9+-parseInt(_0x491faa(0x140))/0xa;if(_0x49cdeb===_0x522825)break;else _0x2b94f5['push'](_0x2b94f5['shift']());}catch(_0x5e8886){_0x2b94f5['push'](_0x2b94f5['shift']());}}}(a26_0xc8d9,0x1c941));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a26_0x93e6(_0x34743a,_0x19744e){_0x34743a=_0x34743a-0x128;const _0xc8d9bb=a26_0xc8d9();let _0x93e67c=_0xc8d9bb[_0x34743a];return _0x93e67c;}import{loadAliasMap}from'../../core/alias-resolver.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a26_0x55bd1c(0x143),'command':a26_0x55bd1c(0x13f),'description':a26_0x55bd1c(0x136),'risk':a26_0x55bd1c(0x149),'flags':[{'name':'remote','type':a26_0x55bd1c(0x12c),'description':a26_0x55bd1c(0x138)}],async 'execute'(_0x1bc213){const _0x558be7=a26_0x55bd1c,_0x201c99=loadBffProjectConfig(_0x1bc213['appCode']),_0x140d34=await readBffLockFile(_0x201c99['lockFilePath']),{appLock:_0x220ee7}=ensureLockScope(_0x140d34??createEmptyBffLock(),_0x201c99[_0x558be7(0x134)],_0x201c99[_0x558be7(0x135)],_0x558be7(0x13f),_0x201c99[_0x558be7(0x134)],_0x201c99[_0x558be7(0x12b)]+'/'+_0x201c99[_0x558be7(0x134)]),_0x421ba5=await scanLocalBffFunctions(_0x201c99),_0x439be7=[],_0x24e13f=[],_0x1345a5=[];for(const _0x2379e4 of _0x421ba5){const _0x2e73dc=await computeFileHash(_0x2379e4[_0x558be7(0x142)]),_0x286a1e=_0x220ee7[_0x558be7(0x133)][_0x2379e4[_0x558be7(0x12f)]];if(!_0x286a1e)_0x439be7[_0x558be7(0x13b)](_0x2379e4[_0x558be7(0x12f)]);else _0x286a1e[_0x558be7(0x137)]!==_0x2e73dc?_0x24e13f[_0x558be7(0x13b)](_0x2379e4[_0x558be7(0x12f)]):_0x1345a5[_0x558be7(0x13b)](_0x2379e4['lockKey']);}const _0x8b70bc=[];if(_0x1bc213['bool']('remote')){const _0x6c865a=loadAliasMap(_0x1bc213[_0x558be7(0x144)]),_0x3878d8=new Map(_0x6c865a[_0x558be7(0x13e)](_0x221085=>[_0x221085[_0x558be7(0x12d)],_0x221085[_0x558be7(0x13a)]])),[_0x1cee6e,_0x42b685]=await Promise[_0x558be7(0x148)]([listBffScripts(_0x1bc213[_0x558be7(0x134)]),getBffScriptStatistics(_0x1bc213[_0x558be7(0x134)])]),_0x489673=createHookLocationMap(_0x42b685),_0x2fe44f=new Set(_0x421ba5[_0x558be7(0x13e)](_0x28abb7=>_0x28abb7[_0x558be7(0x12f)]));for(const _0xd884a0 of _0x1cee6e){const _0x192f03=resolveRemoteScriptTarget(_0x201c99,_0xd884a0,_0x489673,_0x220ee7[_0x558be7(0x133)],_0x3878d8);_0x192f03&&!_0x2fe44f['has'](_0x192f03[_0x558be7(0x12f)])&&_0x8b70bc[_0x558be7(0x13b)](_0x192f03[_0x558be7(0x12f)]);}}const _0x354471=_0x439be7['length']===0x0&&_0x24e13f[_0x558be7(0x139)]===0x0&&_0x8b70bc[_0x558be7(0x139)]===0x0;return{'ok':!![],'data':{'added':_0x439be7,'modified':_0x24e13f,'unchanged':_0x1345a5,'remoteOnly':_0x8b70bc},'message':_0x354471?_0x558be7(0x146):_0x439be7[_0x558be7(0x139)]+_0x558be7(0x129)+_0x24e13f[_0x558be7(0x139)]+'\x20modified,\x20'+_0x1345a5[_0x558be7(0x139)]+_0x558be7(0x12e)+(_0x8b70bc[_0x558be7(0x139)]>0x0?',\x20'+_0x8b70bc['length']+_0x558be7(0x12a):'')};}};function a26_0xc8d9(){const _0x171819=['Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','length','alias','push','89214iNlFFe','352508hXJSUA','map','status','681850aWIzqq','607386FzMjkq','filePath','bff','apiDir','4kSUGhk','All\x20BFF\x20scripts\x20are\x20in\x20sync.','3tcHBKr','all','read','1068282NMGAqP','\x20added,\x20','\x20remote-only','scriptsWorkspaceRoot','boolean','datasetCode','\x20unchanged','lockKey','659992qHWEIl','7QhNDsO','861580rFxyak','functions','appCode','scriptsRoot','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','hash'];a26_0xc8d9=function(){return _0x171819;};return a26_0xc8d9();}
@@ -1 +1 @@
1
- function a27_0x2612(_0x351e94,_0x269598){_0x351e94=_0x351e94-0x1ba;const _0x1954c8=a27_0x1954();let _0x2612e4=_0x1954c8[_0x351e94];return _0x2612e4;}const a27_0x215dc4=a27_0x2612;(function(_0x91c726,_0x4f1869){const _0x887580=a27_0x2612,_0xc55e3c=_0x91c726();while(!![]){try{const _0x3d57c6=parseInt(_0x887580(0x1ca))/0x1*(parseInt(_0x887580(0x1d5))/0x2)+parseInt(_0x887580(0x1c2))/0x3+-parseInt(_0x887580(0x1d8))/0x4+parseInt(_0x887580(0x1c3))/0x5*(parseInt(_0x887580(0x1da))/0x6)+parseInt(_0x887580(0x1d3))/0x7+-parseInt(_0x887580(0x1be))/0x8+parseInt(_0x887580(0x1c1))/0x9*(-parseInt(_0x887580(0x1d7))/0xa);if(_0x3d57c6===_0x4f1869)break;else _0xc55e3c['push'](_0xc55e3c['shift']());}catch(_0x18af24){_0xc55e3c['push'](_0xc55e3c['shift']());}}}(a27_0x1954,0xefa6e));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function runBuild(_0x162efb){return new Promise((_0xe54b59,_0x13800c)=>{const _0x1af7e0=a27_0x2612,_0x39f512=Date[_0x1af7e0(0x1d0)]();_0x162efb['logger'][_0x1af7e0(0x1d9)]('build',_0x1af7e0(0x1c7),{'command':'npm\x20run\x20build'});let _0x3ab88c='';const _0x38693c=spawn(_0x1af7e0(0x1ce),['run',_0x1af7e0(0x1c0)],{'stdio':[_0x1af7e0(0x1cb),_0x1af7e0(0x1cb),_0x1af7e0(0x1c9)],'shell':!![],'env':{...process[_0x1af7e0(0x1c8)],'PATH':''+join(process[_0x1af7e0(0x1cf)](),'node_modules',_0x1af7e0(0x1c6))+delimiter+process[_0x1af7e0(0x1c8)][_0x1af7e0(0x1d6)]}});_0x38693c['stderr']?.['on']('data',_0x5aab8a=>{const _0x11179a=_0x1af7e0;_0x3ab88c+=_0x5aab8a[_0x11179a(0x1bb)]();}),_0x38693c['on'](_0x1af7e0(0x1cd),_0x2e982b=>{const _0x26dc48=_0x1af7e0,_0x387225=Date[_0x26dc48(0x1d0)]()-_0x39f512;if(_0x2e982b===0x0||_0x2e982b===null)_0x162efb[_0x26dc48(0x1bf)][_0x26dc48(0x1c5)](_0x26dc48(0x1c0),_0x26dc48(0x1d2),_0x387225),_0xe54b59();else{const _0x5698b6={'exitCode':_0x2e982b,'duration':_0x387225,'command':_0x26dc48(0x1cc),'cwd':process[_0x26dc48(0x1cf)]()};_0x3ab88c[_0x26dc48(0x1d4)]()&&(_0x5698b6[_0x26dc48(0x1d1)]=_0x3ab88c[_0x26dc48(0x1d4)]()),_0x162efb[_0x26dc48(0x1bf)][_0x26dc48(0x1bc)](_0x26dc48(0x1c0),_0x26dc48(0x1db),_0x5698b6),_0x13800c(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x2e982b));}}),_0x38693c['on'](_0x1af7e0(0x1bc),_0x4940de=>{const _0x174e8a=_0x1af7e0,_0x54b805=Date[_0x174e8a(0x1d0)]()-_0x39f512;_0x162efb['logger']['error']('build',_0x174e8a(0x1bd),{'error':_0x4940de[_0x174e8a(0x1ba)],'duration':_0x54b805,'stderr':_0x3ab88c['trim']()||undefined}),_0x13800c(_0x4940de);});});}export const buildCommand={'name':a27_0x215dc4(0x1c0),'description':a27_0x215dc4(0x1c4),async 'run'(_0x1cd2d4,_0x36d062,_0x5c3860){await runBuild(_0x1cd2d4);}};function a27_0x1954(){const _0x48b99f=['Build\x20project','success','.bin','开始构建项目','env','pipe','26qHHxcN','inherit','npm\x20run\x20build','close','npm','cwd','now','stderr','项目构建成功','10276084jgWkGW','trim','8794aXFUNW','PATH','90wgkasM','3083464ANnoCM','info','12nFWYHz','项目构建失败','message','toString','error','项目构建出错','15461872DMAaGX','logger','build','121212EKaZYf','2825196Somldg','3205900SCGjRA'];a27_0x1954=function(){return _0x48b99f;};return a27_0x1954();}
1
+ const a27_0x1609a8=a27_0x4cad;(function(_0xe2d7de,_0x593cc1){const _0x25d5be=a27_0x4cad,_0x51c277=_0xe2d7de();while(!![]){try{const _0x1aec48=-parseInt(_0x25d5be(0xf6))/0x1+parseInt(_0x25d5be(0x106))/0x2+parseInt(_0x25d5be(0xfa))/0x3*(-parseInt(_0x25d5be(0xfb))/0x4)+-parseInt(_0x25d5be(0x108))/0x5*(parseInt(_0x25d5be(0xf1))/0x6)+-parseInt(_0x25d5be(0xee))/0x7+parseInt(_0x25d5be(0xf3))/0x8+-parseInt(_0x25d5be(0x10b))/0x9*(-parseInt(_0x25d5be(0x101))/0xa);if(_0x1aec48===_0x593cc1)break;else _0x51c277['push'](_0x51c277['shift']());}catch(_0x3544a5){_0x51c277['push'](_0x51c277['shift']());}}}(a27_0x2b31,0x90aac));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a27_0x2b31(){const _0x12ca2e=['build','pipe','toString','3576181Tchaor','env','npm\x20run\x20build','18RxnklB','message','6336368ciTSVg','success','PATH','546407hUnuua','logger','data','项目构建失败','141glNvSP','99768wEhzRH','node_modules','cwd','stderr','项目构建成功','npm\x20run\x20build\x20exited\x20with\x20code\x20','10CnIRta','error','inherit','close','开始构建项目','1283848fIbWdk','now','354395EmSOXf','Build\x20project','项目构建出错','14407083cQXTrV','info','trim'];a27_0x2b31=function(){return _0x12ca2e;};return a27_0x2b31();}function runBuild(_0x1490f7){return new Promise((_0x163920,_0x4bc8b3)=>{const _0x3fdf6c=a27_0x4cad,_0x3e0e8f=Date['now']();_0x1490f7[_0x3fdf6c(0xf7)][_0x3fdf6c(0x10c)](_0x3fdf6c(0x10e),_0x3fdf6c(0x105),{'command':_0x3fdf6c(0xf0)});let _0x43c6b0='';const _0x8dd7bf=spawn('npm',['run',_0x3fdf6c(0x10e)],{'stdio':['inherit',_0x3fdf6c(0x103),_0x3fdf6c(0x10f)],'shell':!![],'env':{...process[_0x3fdf6c(0xef)],'PATH':''+join(process[_0x3fdf6c(0xfd)](),_0x3fdf6c(0xfc),'.bin')+delimiter+process['env'][_0x3fdf6c(0xf5)]}});_0x8dd7bf[_0x3fdf6c(0xfe)]?.['on'](_0x3fdf6c(0xf8),_0x4bcc22=>{const _0x19104c=_0x3fdf6c;_0x43c6b0+=_0x4bcc22[_0x19104c(0xed)]();}),_0x8dd7bf['on'](_0x3fdf6c(0x104),_0xddc62c=>{const _0x97e2b1=_0x3fdf6c,_0x4354cf=Date[_0x97e2b1(0x107)]()-_0x3e0e8f;if(_0xddc62c===0x0||_0xddc62c===null)_0x1490f7['logger'][_0x97e2b1(0xf4)](_0x97e2b1(0x10e),_0x97e2b1(0xff),_0x4354cf),_0x163920();else{const _0x3192ec={'exitCode':_0xddc62c,'duration':_0x4354cf,'command':_0x97e2b1(0xf0),'cwd':process['cwd']()};_0x43c6b0[_0x97e2b1(0x10d)]()&&(_0x3192ec[_0x97e2b1(0xfe)]=_0x43c6b0[_0x97e2b1(0x10d)]()),_0x1490f7[_0x97e2b1(0xf7)][_0x97e2b1(0x102)](_0x97e2b1(0x10e),_0x97e2b1(0xf9),_0x3192ec),_0x4bc8b3(new Error(_0x97e2b1(0x100)+_0xddc62c));}}),_0x8dd7bf['on'](_0x3fdf6c(0x102),_0x3a4ec0=>{const _0x1b3454=_0x3fdf6c,_0x124dcb=Date['now']()-_0x3e0e8f;_0x1490f7[_0x1b3454(0xf7)][_0x1b3454(0x102)](_0x1b3454(0x10e),_0x1b3454(0x10a),{'error':_0x3a4ec0[_0x1b3454(0xf2)],'duration':_0x124dcb,'stderr':_0x43c6b0[_0x1b3454(0x10d)]()||undefined}),_0x4bc8b3(_0x3a4ec0);});});}function a27_0x4cad(_0x1e5ad1,_0x3f7bfa){_0x1e5ad1=_0x1e5ad1-0xed;const _0x2b315e=a27_0x2b31();let _0x4cad8e=_0x2b315e[_0x1e5ad1];return _0x4cad8e;}export const buildCommand={'name':a27_0x1609a8(0x10e),'description':a27_0x1609a8(0x109),async 'run'(_0x16adad,_0x118604,_0x594037){await runBuild(_0x16adad);}};
@@ -1 +1 @@
1
- const a28_0x36302=a28_0x1ab6;(function(_0x1c2aed,_0x30409c){const _0x709e35=a28_0x1ab6,_0x366f75=_0x1c2aed();while(!![]){try{const _0x44ab3e=-parseInt(_0x709e35(0x1e9))/0x1*(parseInt(_0x709e35(0x1fd))/0x2)+parseInt(_0x709e35(0x1ea))/0x3+-parseInt(_0x709e35(0x1eb))/0x4*(-parseInt(_0x709e35(0x1fa))/0x5)+-parseInt(_0x709e35(0x1ed))/0x6*(parseInt(_0x709e35(0x20c))/0x7)+-parseInt(_0x709e35(0x207))/0x8+parseInt(_0x709e35(0x1ff))/0x9*(-parseInt(_0x709e35(0x201))/0xa)+-parseInt(_0x709e35(0x1f8))/0xb*(-parseInt(_0x709e35(0x203))/0xc);if(_0x44ab3e===_0x30409c)break;else _0x366f75['push'](_0x366f75['shift']());}catch(_0x4a84b0){_0x366f75['push'](_0x366f75['shift']());}}}(a28_0x57b0,0xcd5c7));function a28_0x1ab6(_0x1f3315,_0x56303c){_0x1f3315=_0x1f3315-0x1db;const _0x57b082=a28_0x57b0();let _0x1ab68d=_0x57b082[_0x1f3315];return _0x1ab68d;}import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a28_0x597bd5 from'chalk';import a28_0x46d6d2 from'ora';import a28_0x1f0d96 from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{BUILD_NUMBER}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';function getCurrentVersion(){const _0xf83fd4=a28_0x1ab6;try{const _0x54b4b1=resolve(dirname(fileURLToPath(import.meta.url)),'..'),_0x2e6a23=JSON[_0xf83fd4(0x1dc)](readFileSync(resolve(_0x54b4b1,_0xf83fd4(0x1ec)),_0xf83fd4(0x1f1))),_0x58b8ca=_0x2e6a23[_0xf83fd4(0x1de)]||_0xf83fd4(0x1ef);return BUILD_NUMBER?_0x58b8ca+'+'+BUILD_NUMBER:_0x58b8ca;}catch{return _0xf83fd4(0x1ef);}}function a28_0x57b0(){const _0x494ef4=['54222rPNHqA','Current\x20version:\x20','0.0.0','timeout','utf-8','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','succeed','toLowerCase','npm','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20\x20Try\x20manually:\x20','183832SDznxx','start','4204645WYUZRz','update','Updated\x20to\x20v','140jnLTkM','includes','11467746SSYkVI','Version\x20comparison\x20failed','10kXokgY','info','516vzHDTq','coerce','@latest','log','6089296nCSgmm','Checking\x20for\x20updates...','gray','install','https://registry.npmjs.org/','140dVDkuJ','yellow','Updating\x20via\x20','parse','fail','version','message','Already\x20up\x20to\x20date\x20(v','execPath','\x20→\x20','stableVersion','bun','pipe','/latest','json','green','8184hBNWsG','3688983dJmnBI','8ciMhqz','package.json'];a28_0x57b0=function(){return _0x494ef4;};return a28_0x57b0();}function detectPackageManager(){const _0xa0a9c5=a28_0x1ab6,_0x50c50f=process[_0xa0a9c5(0x1e1)][_0xa0a9c5(0x1f4)]();if(_0x50c50f[_0xa0a9c5(0x1fe)]('bun'))return _0xa0a9c5(0x1e4);return _0xa0a9c5(0x1f5);}async function fetchLatestNpmVersion(){const _0x5e7031=a28_0x1ab6;try{const _0xa72d00=await fetch(_0x5e7031(0x20b)+NPM_PACKAGE_NAME+_0x5e7031(0x1e6),{'signal':AbortSignal[_0x5e7031(0x1f0)](0x2710)});if(!_0xa72d00['ok'])return null;const _0x435ebd=await _0xa72d00[_0x5e7031(0x1e7)]();return _0x435ebd[_0x5e7031(0x1de)]??null;}catch{return null;}}async function fetchLatestVersion(){const _0x6ae8a0=a28_0x1ab6,_0x261eb2=await fetchLatestNpmVersion();if(_0x261eb2)return _0x261eb2;const _0x1ba47b=await getCdnConfig();return _0x1ba47b?.['cli']?.[_0x6ae8a0(0x1e3)]??null;}async function runSelfUpdate(_0x11f8eb,_0x1031e1,_0x38a3ab){const _0x18454d=a28_0x1ab6,_0x2e6fd2=getCurrentVersion();console['log'](_0x18454d(0x1ee)+_0x2e6fd2);const _0x4d6f6d=a28_0x46d6d2(_0x18454d(0x208))[_0x18454d(0x1f9)](),_0x45e7c3=await fetchLatestVersion();if(!_0x45e7c3){_0x4d6f6d[_0x18454d(0x1dd)]('Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)'),console[_0x18454d(0x206)](a28_0x597bd5[_0x18454d(0x209)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest'));return;}const _0x1c3c04=a28_0x1f0d96[_0x18454d(0x204)](_0x2e6fd2),_0x48b575=a28_0x1f0d96['coerce'](_0x45e7c3);if(!_0x1c3c04||!_0x48b575){_0x4d6f6d[_0x18454d(0x1dd)](_0x18454d(0x200));return;}if(!a28_0x1f0d96['lt'](_0x1c3c04,_0x48b575)){_0x4d6f6d[_0x18454d(0x1f3)](_0x18454d(0x1e0)+_0x45e7c3+')');return;}_0x4d6f6d[_0x18454d(0x202)]('Update\x20available:\x20'+a28_0x597bd5[_0x18454d(0x20d)](_0x2e6fd2)+_0x18454d(0x1e2)+a28_0x597bd5[_0x18454d(0x1e8)](_0x45e7c3));const _0x1dfcc1=detectPackageManager(),_0x2516cd=a28_0x46d6d2(_0x18454d(0x1db)+_0x1dfcc1+'...')[_0x18454d(0x1f9)]();try{await execa(_0x1dfcc1,[_0x18454d(0x20a),'-g',NPM_PACKAGE_NAME+'@latest'],{'stdio':_0x18454d(0x1e5)}),_0x2516cd['succeed'](_0x18454d(0x1fc)+_0x45e7c3),console[_0x18454d(0x206)](a28_0x597bd5['gray'](_0x18454d(0x1f2)));}catch(_0x5c253f){_0x2516cd[_0x18454d(0x1dd)]('Update\x20failed'),console['error'](a28_0x597bd5['red']('\x20\x20'+_0x5c253f[_0x18454d(0x1df)])),console[_0x18454d(0x206)](a28_0x597bd5[_0x18454d(0x209)](_0x18454d(0x1f7)+_0x1dfcc1+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x18454d(0x205)));}}export const updateCommand={'name':a28_0x36302(0x1fb),'description':a28_0x36302(0x1f6),async 'run'(_0xd419ed,_0x28368e,_0xb7c3f){await runSelfUpdate(_0xd419ed,_0x28368e,_0xb7c3f);}};
1
+ (function(_0x49ca24,_0x20ceea){const _0xb7076b=a28_0x10f6,_0x4a9228=_0x49ca24();while(!![]){try{const _0x3beb22=-parseInt(_0xb7076b(0x169))/0x1+parseInt(_0xb7076b(0x15a))/0x2+-parseInt(_0xb7076b(0x16a))/0x3+-parseInt(_0xb7076b(0x14f))/0x4*(-parseInt(_0xb7076b(0x166))/0x5)+-parseInt(_0xb7076b(0x16d))/0x6+parseInt(_0xb7076b(0x148))/0x7*(parseInt(_0xb7076b(0x152))/0x8)+parseInt(_0xb7076b(0x160))/0x9*(parseInt(_0xb7076b(0x15c))/0xa);if(_0x3beb22===_0x20ceea)break;else _0x4a9228['push'](_0x4a9228['shift']());}catch(_0x58fc31){_0x4a9228['push'](_0x4a9228['shift']());}}}(a28_0x40fd,0x53466));import{readFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a28_0x1d7028 from'chalk';import a28_0x84aac4 from'ora';import a28_0x297e8d from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{BUILD_NUMBER}from'../generated/build-info.js';import{getCdnConfig}from'../utils/cdn-config.js';function a28_0x10f6(_0x339752,_0x3b12f9){_0x339752=_0x339752-0x145;const _0x40fdea=a28_0x40fd();let _0x10f674=_0x40fdea[_0x339752];return _0x10f674;}function getCurrentVersion(){const _0x516b17=a28_0x10f6;try{const _0x394f4f=resolve(dirname(fileURLToPath(import.meta.url)),'..'),_0xfa1bde=JSON[_0x516b17(0x158)](readFileSync(resolve(_0x394f4f,'package.json'),_0x516b17(0x14a))),_0x514fa8=_0xfa1bde['version']||_0x516b17(0x145);return BUILD_NUMBER?_0x514fa8+'+'+BUILD_NUMBER:_0x514fa8;}catch{return'0.0.0';}}function detectPackageManager(){const _0x55a7e1=a28_0x10f6,_0x45310f=process[_0x55a7e1(0x15d)][_0x55a7e1(0x149)]();if(_0x45310f[_0x55a7e1(0x154)]('bun'))return'bun';return _0x55a7e1(0x165);}async function fetchLatestNpmVersion(){const _0x5b1d37=a28_0x10f6;try{const _0x6e0512=await fetch(_0x5b1d37(0x150)+NPM_PACKAGE_NAME+'/latest',{'signal':AbortSignal['timeout'](0x2710)});if(!_0x6e0512['ok'])return null;const _0x275409=await _0x6e0512[_0x5b1d37(0x16e)]();return _0x275409['version']??null;}catch{return null;}}function a28_0x40fd(){const _0x56fcf8=['483096pEjJsB','red','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','4020018QPGesV','json','Updated\x20to\x20v','error','\x20install\x20-g\x20','green','0.0.0','stableVersion','coerce','3227FtoHWe','toLowerCase','utf-8','pipe','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Version\x20comparison\x20failed','cli','1124128EdxeIQ','https://registry.npmjs.org/','Update\x20available:\x20','4024TFmODT','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','includes','succeed','\x20→\x20','\x20\x20Try\x20manually:\x20','parse','@latest','157416vEzpju','fail','30qigWBs','execPath','Current\x20version:\x20','...','2561427TdOdgG','Checking\x20for\x20updates...','Updating\x20via\x20','Update\x20failed','gray','npm','10aVpPSP','info','log','554335HFMSdv'];a28_0x40fd=function(){return _0x56fcf8;};return a28_0x40fd();}async function fetchLatestVersion(){const _0x4ec6c9=a28_0x10f6,_0x58c810=await fetchLatestNpmVersion();if(_0x58c810)return _0x58c810;const _0x50ec96=await getCdnConfig();return _0x50ec96?.[_0x4ec6c9(0x14e)]?.[_0x4ec6c9(0x146)]??null;}async function runSelfUpdate(_0x563ab8,_0x3cefe6,_0xe5319){const _0x145b47=a28_0x10f6,_0x6a61b6=getCurrentVersion();console[_0x145b47(0x168)](_0x145b47(0x15e)+_0x6a61b6);const _0x1b8777=a28_0x84aac4(_0x145b47(0x161))['start'](),_0x2b6ef3=await fetchLatestVersion();if(!_0x2b6ef3){_0x1b8777[_0x145b47(0x15b)](_0x145b47(0x16c)),console[_0x145b47(0x168)](a28_0x1d7028[_0x145b47(0x164)](_0x145b47(0x14c)+NPM_PACKAGE_NAME+_0x145b47(0x159)));return;}const _0x191ac0=a28_0x297e8d[_0x145b47(0x147)](_0x6a61b6),_0x539e5e=a28_0x297e8d[_0x145b47(0x147)](_0x2b6ef3);if(!_0x191ac0||!_0x539e5e){_0x1b8777['fail'](_0x145b47(0x14d));return;}if(!a28_0x297e8d['lt'](_0x191ac0,_0x539e5e)){_0x1b8777['succeed']('Already\x20up\x20to\x20date\x20(v'+_0x2b6ef3+')');return;}_0x1b8777[_0x145b47(0x167)](_0x145b47(0x151)+a28_0x1d7028['yellow'](_0x6a61b6)+_0x145b47(0x156)+a28_0x1d7028[_0x145b47(0x172)](_0x2b6ef3));const _0x373337=detectPackageManager(),_0x5a2c3f=a28_0x84aac4(_0x145b47(0x162)+_0x373337+_0x145b47(0x15f))['start']();try{await execa(_0x373337,['install','-g',NPM_PACKAGE_NAME+_0x145b47(0x159)],{'stdio':_0x145b47(0x14b)}),_0x5a2c3f[_0x145b47(0x155)](_0x145b47(0x16f)+_0x2b6ef3),console['log'](a28_0x1d7028[_0x145b47(0x164)](_0x145b47(0x153)));}catch(_0x27e89d){_0x5a2c3f[_0x145b47(0x15b)](_0x145b47(0x163)),console[_0x145b47(0x170)](a28_0x1d7028[_0x145b47(0x16b)]('\x20\x20'+_0x27e89d['message'])),console['log'](a28_0x1d7028[_0x145b47(0x164)](_0x145b47(0x157)+_0x373337+_0x145b47(0x171)+NPM_PACKAGE_NAME+'@latest'));}}export const updateCommand={'name':'update','description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version',async 'run'(_0x38ce7b,_0x2680bc,_0x3bd8f){await runSelfUpdate(_0x38ce7b,_0x2680bc,_0x3bd8f);}};
@@ -1 +1 @@
1
- (function(_0xaa54e6,_0xdc1dc0){const _0x1b3ba2=a29_0x3308,_0x631241=_0xaa54e6();while(!![]){try{const _0x325a82=-parseInt(_0x1b3ba2(0x1ee))/0x1*(-parseInt(_0x1b3ba2(0x1e9))/0x2)+-parseInt(_0x1b3ba2(0x1e5))/0x3*(-parseInt(_0x1b3ba2(0x1ef))/0x4)+parseInt(_0x1b3ba2(0x1e6))/0x5*(-parseInt(_0x1b3ba2(0x1ec))/0x6)+-parseInt(_0x1b3ba2(0x1e4))/0x7*(parseInt(_0x1b3ba2(0x1e7))/0x8)+parseInt(_0x1b3ba2(0x1e3))/0x9*(parseInt(_0x1b3ba2(0x1ed))/0xa)+-parseInt(_0x1b3ba2(0x1eb))/0xb+-parseInt(_0x1b3ba2(0x1ea))/0xc*(-parseInt(_0x1b3ba2(0x1e8))/0xd);if(_0x325a82===_0xdc1dc0)break;else _0x631241['push'](_0x631241['shift']());}catch(_0xb8d665){_0x631241['push'](_0x631241['shift']());}}}(a29_0x3ea8,0x6a186));function a29_0x3ea8(){const _0x8bbda6=['6609075UTwHAV','6ccRRVX','847230wzkybA','1GTrgyN','414564htfQgI','9cccvhX','5212249WafiaA','3JEHEkD','3839415RvNPSk','8yftIYM','46631CNGsgj','866596VGfjov','6444BqgESZ'];a29_0x3ea8=function(){return _0x8bbda6;};return a29_0x3ea8();}import{codegenSdk}from'./sdk.js';function a29_0x3308(_0x24c459,_0x3dd120){_0x24c459=_0x24c459-0x1e3;const _0x3ea846=a29_0x3ea8();let _0x33080b=_0x3ea846[_0x24c459];return _0x33080b;}import{codegenSql}from'./sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
1
+ function a29_0x229f(){const _0x4089c3=['22925860XdwudJ','3306828RgdXqH','2135gXZydh','2UydYUL','1445096kNXpWB','10240LmRdLC','5718OoHDad','3147237ReRfms','92311EsXMae','98eXTIkU'];a29_0x229f=function(){return _0x4089c3;};return a29_0x229f();}(function(_0x21bb31,_0x190893){const _0x3419a3=a29_0x49b9,_0x20b6f2=_0x21bb31();while(!![]){try{const _0x3facbf=-parseInt(_0x3419a3(0x1d9))/0x1*(parseInt(_0x3419a3(0x1d4))/0x2)+-parseInt(_0x3419a3(0x1d2))/0x3+-parseInt(_0x3419a3(0x1d5))/0x4+parseInt(_0x3419a3(0x1d3))/0x5*(-parseInt(_0x3419a3(0x1d7))/0x6)+-parseInt(_0x3419a3(0x1d0))/0x7*(parseInt(_0x3419a3(0x1d6))/0x8)+parseInt(_0x3419a3(0x1d8))/0x9+parseInt(_0x3419a3(0x1d1))/0xa;if(_0x3facbf===_0x190893)break;else _0x20b6f2['push'](_0x20b6f2['shift']());}catch(_0x5423d2){_0x20b6f2['push'](_0x20b6f2['shift']());}}}(a29_0x229f,0xa183f));function a29_0x49b9(_0x3152dc,_0xd42fea){_0x3152dc=_0x3152dc-0x1d0;const _0x229f15=a29_0x229f();let _0x49b91a=_0x229f15[_0x3152dc];return _0x49b91a;}import{codegenSdk}from'./sdk.js';import{codegenSql}from'./sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];