@lovrabet/rabetbase-cli 2.1.2-beta.2 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.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/generate.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/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/delete.js +1 -1
  28. package/lib/commands/bff/detail.js +1 -1
  29. package/lib/commands/bff/index.js +1 -1
  30. package/lib/commands/bff/list.js +1 -1
  31. package/lib/commands/bff/new.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -1
  53. package/lib/commands/db/analyze-start.js +1 -1
  54. package/lib/commands/db/analyze-status.js +1 -1
  55. package/lib/commands/db/create.js +1 -1
  56. package/lib/commands/db/delete.js +1 -1
  57. package/lib/commands/db/detail.js +1 -1
  58. package/lib/commands/db/diff.js +1 -1
  59. package/lib/commands/db/index.js +1 -1
  60. package/lib/commands/db/list.js +1 -1
  61. package/lib/commands/db/shared.js +1 -1
  62. package/lib/commands/db/tables.js +1 -1
  63. package/lib/commands/db/test.js +1 -1
  64. package/lib/commands/db/update.js +1 -1
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  81. package/lib/commands/project/create/format-elapsed.js +1 -1
  82. package/lib/commands/project/create/main.js +1 -1
  83. package/lib/commands/project/create/non-interactive.js +1 -1
  84. package/lib/commands/project/create/project-template-path.js +1 -1
  85. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  86. package/lib/commands/project/create/use-format-code.js +1 -1
  87. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  88. package/lib/commands/project/index.js +1 -1
  89. package/lib/commands/project/init.js +1 -1
  90. package/lib/commands/project/upgrade.js +1 -1
  91. package/lib/commands/registry.js +1 -1
  92. package/lib/commands/run/index.js +1 -1
  93. package/lib/commands/schema.js +1 -1
  94. package/lib/commands/skill/index.js +1 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +1 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/sql/list.js +1 -1
  99. package/lib/commands/sql/pull.js +1 -1
  100. package/lib/commands/sql/save.js +1 -1
  101. package/lib/commands/sql/shared.js +1 -1
  102. package/lib/commands/sql/validate.js +1 -1
  103. package/lib/config/schema.js +1 -1
  104. package/lib/constant/cli.js +1 -1
  105. package/lib/constant/defaults.js +1 -1
  106. package/lib/constant/domain.js +1 -1
  107. package/lib/constant/env.js +1 -1
  108. package/lib/constant/output.js +1 -1
  109. package/lib/constant/paths.js +1 -1
  110. package/lib/constant/risk.js +1 -1
  111. package/lib/context.js +1 -1
  112. package/lib/core/alias-resolver.js +1 -1
  113. package/lib/core/api-client.js +1 -1
  114. package/lib/core/bff/config.js +1 -1
  115. package/lib/core/bff/file-system.js +1 -1
  116. package/lib/core/bff/hash.js +1 -1
  117. package/lib/core/bff/lock.js +1 -1
  118. package/lib/core/bff/utils.js +1 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/sql-validator.js +1 -1
  121. package/lib/errors.js +1 -1
  122. package/lib/framework/build-all-flags.js +1 -1
  123. package/lib/framework/flags.js +1 -1
  124. package/lib/framework/help.js +1 -1
  125. package/lib/framework/index.js +1 -1
  126. package/lib/framework/output.js +1 -1
  127. package/lib/framework/response.js +1 -1
  128. package/lib/framework/runner-alias.js +1 -1
  129. package/lib/framework/runner.js +1 -1
  130. package/lib/framework/schema-export.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/skills/main.js +1 -1
  135. package/lib/skills/npx-skills-add.js +1 -1
  136. package/lib/telemetry/cli-command-trace.js +1 -1
  137. package/lib/telemetry/cli-help-trace.js +1 -1
  138. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  139. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  140. package/lib/telemetry/send-cli-trace-log.js +1 -1
  141. package/lib/utils/ai_config.js +1 -1
  142. package/lib/utils/apply-jq-filter.js +1 -1
  143. package/lib/utils/cdn-config.js +1 -1
  144. package/lib/utils/check-sdk-version.js +1 -1
  145. package/lib/utils/cli-version-check.js +1 -1
  146. package/lib/utils/config.js +1 -1
  147. package/lib/utils/copy-directory.js +1 -1
  148. package/lib/utils/entity-with-id.js +1 -1
  149. package/lib/utils/file-utils.js +1 -1
  150. package/lib/utils/guides-cdn.js +1 -1
  151. package/lib/utils/http-client.js +1 -1
  152. package/lib/utils/is-non-interactive.js +1 -1
  153. package/lib/utils/logger.js +1 -1
  154. package/lib/utils/platform.js +1 -1
  155. package/lib/utils/rules-cdn.js +1 -1
  156. package/lib/utils/sleep.js +1 -1
  157. package/lib/utils/template-replacer.js +1 -1
  158. package/lib/utils/version.js +1 -1
  159. package/lib/utils/with-active-cookie.js +1 -1
  160. package/lib/utils/write-cli-side-channel.js +1 -1
  161. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x318901,_0x6f26fa){const _0x1ecbb5=a20_0x49d4,_0x2432d6=_0x318901();while(!![]){try{const _0x5485aa=-parseInt(_0x1ecbb5(0x136))/0x1+parseInt(_0x1ecbb5(0x137))/0x2+parseInt(_0x1ecbb5(0x133))/0x3+-parseInt(_0x1ecbb5(0x135))/0x4*(-parseInt(_0x1ecbb5(0x132))/0x5)+parseInt(_0x1ecbb5(0x131))/0x6+parseInt(_0x1ecbb5(0x134))/0x7+parseInt(_0x1ecbb5(0x130))/0x8*(-parseInt(_0x1ecbb5(0x12f))/0x9);if(_0x5485aa===_0x6f26fa)break;else _0x2432d6['push'](_0x2432d6['shift']());}catch(_0xb3f258){_0x2432d6['push'](_0x2432d6['shift']());}}}(a20_0x3e44,0xeb5b8));import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];function a20_0x49d4(_0x223d32,_0x23ddd4){_0x223d32=_0x223d32-0x12f;const _0x3e4491=a20_0x3e44();let _0x49d489=_0x3e4491[_0x223d32];return _0x49d489;}function a20_0x3e44(){const _0x3b32d1=['9725093SJYkzL','2236appSpV','1340672ZIebVb','162346zTsKbJ','18JixGhQ','8417096UOvCAu','1833324YaeXgV','8465HrEnCM','5059671VJEPLO'];a20_0x3e44=function(){return _0x3b32d1;};return a20_0x3e44();}
1
+ function a103_0x5e1c(){const _0x39086c=['91546nZvHXg','87ngivtF','8084795HmJkyw','50389430tsLGCy','6MmNtNa','180072DnnUGC','4493363LEunWr','2233440sRPjrm','1625636WZZwbi','8TaJVmm'];a103_0x5e1c=function(){return _0x39086c;};return a103_0x5e1c();}(function(_0x1bbcd5,_0x3bd52a){const _0x1a4dd2=a103_0x5689,_0x28c6eb=_0x1bbcd5();while(!![]){try{const _0x3ff814=parseInt(_0x1a4dd2(0xdb))/0x1+-parseInt(_0x1a4dd2(0xd6))/0x2*(parseInt(_0x1a4dd2(0xd7))/0x3)+-parseInt(_0x1a4dd2(0xde))/0x4+parseInt(_0x1a4dd2(0xd8))/0x5*(-parseInt(_0x1a4dd2(0xda))/0x6)+parseInt(_0x1a4dd2(0xdc))/0x7*(-parseInt(_0x1a4dd2(0xd5))/0x8)+-parseInt(_0x1a4dd2(0xdd))/0x9+parseInt(_0x1a4dd2(0xd9))/0xa;if(_0x3ff814===_0x3bd52a)break;else _0x28c6eb['push'](_0x28c6eb['shift']());}catch(_0x3824c2){_0x28c6eb['push'](_0x28c6eb['shift']());}}}(a103_0x5e1c,0xeecf1));import{appListDefinition}from'../../commands/app/list.js';function a103_0x5689(_0x3fa523,_0x3f71b1){_0x3fa523=_0x3fa523-0xd5;const _0x5e1c63=a103_0x5e1c();let _0x568982=_0x5e1c63[_0x3fa523];return _0x568982;}import{appRemoteDefinition}from'../../commands/app/discover.js';import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];
@@ -1 +1 @@
1
- const a21_0x233117=a21_0x284c;function a21_0x284c(_0x1cb021,_0x3d5886){_0x1cb021=_0x1cb021-0x14f;const _0x49d64f=a21_0x49d6();let _0x284ca3=_0x49d64f[_0x1cb021];return _0x284ca3;}(function(_0x1fcdfd,_0x5b1ffe){const _0x1b725a=a21_0x284c,_0x46a223=_0x1fcdfd();while(!![]){try{const _0xb693b6=-parseInt(_0x1b725a(0x157))/0x1*(parseInt(_0x1b725a(0x152))/0x2)+-parseInt(_0x1b725a(0x15f))/0x3*(-parseInt(_0x1b725a(0x15b))/0x4)+parseInt(_0x1b725a(0x15d))/0x5*(-parseInt(_0x1b725a(0x159))/0x6)+-parseInt(_0x1b725a(0x174))/0x7+parseInt(_0x1b725a(0x171))/0x8*(-parseInt(_0x1b725a(0x161))/0x9)+parseInt(_0x1b725a(0x166))/0xa+parseInt(_0x1b725a(0x160))/0xb;if(_0xb693b6===_0x5b1ffe)break;else _0x46a223['push'](_0x46a223['shift']());}catch(_0x16d36e){_0x46a223['push'](_0x46a223['shift']());}}}(a21_0x49d6,0x1de0e));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{buildAppProfileListFields}from'../../config/schema.js';function a21_0x49d6(){const _0x2f0a86=['300074TqrUzw','No\x20apps\x20configured','app','length','bool','1gQRScl','globalConfig','618PbesoU','read','8612seOrVj','project','2340YIWmED','boolean','213rnsZRT','3213551MQActu','18kjsqzw','\x20in\x20','global','merged','projectConfig','349890TnkUFB','apps','list','globalPath','.\x20Use\x20`','\x20config','map','object','isCurrent','appcode','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','140552xjltqq','entries','push','869624qnDgoQ','defaultApp','projectPath','List\x20all\x20configured\x20apps'];a21_0x49d6=function(){return _0x2f0a86;};return a21_0x49d6();}import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';function buildItemsFromLayer(_0x5b20a9,_0x249ec3){const _0x12c219=a21_0x284c,_0xcadbdf=[],_0x12f1ca=_0x5b20a9['apps']&&typeof _0x5b20a9[_0x12c219(0x167)]===_0x12c219(0x16d)?_0x5b20a9[_0x12c219(0x167)]:{},_0xdd20d=_0x5b20a9[_0x12c219(0x14f)]||undefined;for(const [_0x3a4f31,_0x5e895b]of Object[_0x12c219(0x172)](_0x12f1ca)){if(!_0x5e895b||typeof _0x5e895b!==_0x12c219(0x16d)||!_0x5e895b[_0x12c219(0x16f)])continue;_0xcadbdf[_0x12c219(0x173)]({'name':_0x3a4f31,'appcode':_0x5e895b['appcode'],'named':!![],'definedIn':_0x249ec3,'isDefault':_0x3a4f31===_0xdd20d,...buildAppProfileListFields(_0x5e895b)});}return _0xcadbdf;}function buildMergedItems(_0x48a0d2,_0x5cc6f0){const _0x1b4753=a21_0x284c,{apps:apps={},defaultApp:_0x26d898}=_0x48a0d2,_0x5623c7=_0x5cc6f0[_0x1b4753(0x158)][_0x1b4753(0x167)]&&typeof _0x5cc6f0[_0x1b4753(0x158)][_0x1b4753(0x167)]==='object'?_0x5cc6f0['globalConfig']['apps']:{},_0x522b17=_0x5cc6f0[_0x1b4753(0x165)][_0x1b4753(0x167)]&&typeof _0x5cc6f0[_0x1b4753(0x165)]['apps']==='object'?_0x5cc6f0[_0x1b4753(0x165)][_0x1b4753(0x167)]:{},_0x2ab9ad=_0x5cc6f0[_0x1b4753(0x165)]['inherit']===![],_0x1e6316=Object[_0x1b4753(0x172)](apps),_0x2ed214=_0x1e6316[_0x1b4753(0x16c)](([_0x5f04ad,_0x318d38])=>({'name':_0x5f04ad,'appcode':_0x318d38['appcode'],'named':!![],'definedIn':appDefinedIn(_0x5f04ad,_0x5623c7,_0x522b17,_0x2ab9ad),'isDefault':_0x5f04ad===_0x26d898,...buildAppProfileListFields(_0x318d38)}));return _0x2ed214;}async function execute(_0x22ffc5){const _0x43d095=a21_0x284c,_0x4e5bb0=_0x22ffc5[_0x43d095(0x156)](_0x43d095(0x163)),_0x5a802a=_0x22ffc5[_0x43d095(0x156)](_0x43d095(0x15c)),_0x37e3b2=_0x4e5bb0?_0x43d095(0x163):_0x5a802a?'project':_0x43d095(0x164),{config:_0x39e51c,layers:_0x5c4acd}=readRawConfigWithLayers(),_0x76057c=resolveDefaultAppSource(_0x5c4acd),{defaultApp:_0x4baee6}=_0x39e51c;let _0x32c7c1,_0x14c02e;switch(_0x37e3b2){case _0x43d095(0x163):_0x32c7c1=buildItemsFromLayer(_0x5c4acd[_0x43d095(0x158)],'global'),_0x14c02e=_0x5c4acd['globalPath'];break;case _0x43d095(0x15c):_0x32c7c1=buildItemsFromLayer(_0x5c4acd[_0x43d095(0x165)],_0x43d095(0x15c)),_0x14c02e=_0x5c4acd[_0x43d095(0x150)];break;default:_0x32c7c1=buildMergedItems(_0x39e51c,_0x5c4acd);break;}enrichAppListItemsWithMergedSelection(_0x32c7c1,_0x22ffc5['mergedCli']);if(_0x32c7c1[_0x43d095(0x155)]===0x0){const _0x4bbb1f=_0x37e3b2===_0x43d095(0x164)?'':_0x43d095(0x162)+_0x37e3b2+_0x43d095(0x16b);return{'ok':!![],'data':[],'message':_0x43d095(0x153)+_0x4bbb1f+_0x43d095(0x16a)+CLI_BIN_NAME+_0x43d095(0x170)};}const _0xb89aa3=_0x32c7c1['find'](_0x2087ca=>_0x2087ca[_0x43d095(0x16e)]===!![]),_0x18b735=_0x4baee6??_0xb89aa3?.[_0x43d095(0x16f)]??null,_0x5c9bf9=_0x37e3b2===_0x43d095(0x164)?{'globalPath':_0x5c4acd[_0x43d095(0x169)]??null,'projectPath':_0x5c4acd[_0x43d095(0x150)]??null,'defaultApp':_0x18b735,'defaultAppSource':_0x4baee6!=null?_0x76057c:null}:{'scope':_0x37e3b2,'configPath':_0x14c02e??null};return{'ok':!![],'data':{'items':_0x32c7c1,'meta':_0x5c9bf9}};}export const appListDefinition={'service':a21_0x233117(0x154),'command':a21_0x233117(0x168),'description':a21_0x233117(0x151),'risk':a21_0x233117(0x15a),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x233117(0x163),'type':a21_0x233117(0x15e),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a21_0x233117(0x15c),'type':'boolean','description':'Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','default':![]}],'execute':execute};
1
+ const a102_0x1707aa=a102_0x427c;(function(_0x39eb24,_0x180d0d){const _0x380673=a102_0x427c,_0x9ce65f=_0x39eb24();while(!![]){try{const _0x473321=parseInt(_0x380673(0x15c))/0x1+-parseInt(_0x380673(0x158))/0x2+parseInt(_0x380673(0x16e))/0x3+-parseInt(_0x380673(0x166))/0x4*(-parseInt(_0x380673(0x151))/0x5)+parseInt(_0x380673(0x15a))/0x6*(parseInt(_0x380673(0x156))/0x7)+-parseInt(_0x380673(0x155))/0x8*(-parseInt(_0x380673(0x16c))/0x9)+-parseInt(_0x380673(0x168))/0xa;if(_0x473321===_0x180d0d)break;else _0x9ce65f['push'](_0x9ce65f['shift']());}catch(_0x25dc18){_0x9ce65f['push'](_0x9ce65f['shift']());}}}(a102_0x38f9,0x20c60));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';function a102_0x38f9(){const _0x2c1e3f=['249465UPczFR','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','object','globalConfig','bool','List\x20all\x20configured\x20apps','find','push','appcode','length','28EeceQN','isCurrent','1816620FmPjpP','globalPath','merged','boolean','9IDbKJH','apps','37362ZypSTP','entries','\x20in\x20','project','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','107385zlrNSU','defaultApp','read','projectConfig','829208YFRnLt','14mlQPHj','.\x20Use\x20`','447506JLoXDq','projectPath','71238avJbCg','global'];a102_0x38f9=function(){return _0x2c1e3f;};return a102_0x38f9();}function buildItemsFromLayer(_0x536d74,_0x173078){const _0x40a3af=a102_0x427c,_0xbab1c2=[],_0x4b6c01=_0x536d74[_0x40a3af(0x16d)]&&typeof _0x536d74[_0x40a3af(0x16d)]==='object'?_0x536d74[_0x40a3af(0x16d)]:{},_0x43c087=_0x536d74[_0x40a3af(0x152)]||undefined;for(const [_0x27ef43,_0x16b6ad]of Object[_0x40a3af(0x16f)](_0x4b6c01)){if(!_0x16b6ad||typeof _0x16b6ad!=='object'||!_0x16b6ad['appcode'])continue;_0xbab1c2[_0x40a3af(0x163)]({'name':_0x27ef43,'appcode':_0x16b6ad[_0x40a3af(0x164)],'named':!![],'definedIn':_0x173078,'isDefault':_0x27ef43===_0x43c087,...buildAppProfileListFields(_0x16b6ad)});}return _0xbab1c2;}function a102_0x427c(_0x2afa1b,_0xd02251){_0x2afa1b=_0x2afa1b-0x14e;const _0x38f9e4=a102_0x38f9();let _0x427cf1=_0x38f9e4[_0x2afa1b];return _0x427cf1;}function buildMergedItems(_0x3778c5,_0x48bec8){const _0x3b83b5=a102_0x427c,{apps:apps={},defaultApp:_0x12ced0}=_0x3778c5,_0x48ca25=_0x48bec8[_0x3b83b5(0x15f)][_0x3b83b5(0x16d)]&&typeof _0x48bec8[_0x3b83b5(0x15f)][_0x3b83b5(0x16d)]==='object'?_0x48bec8['globalConfig'][_0x3b83b5(0x16d)]:{},_0x365a99=_0x48bec8[_0x3b83b5(0x154)][_0x3b83b5(0x16d)]&&typeof _0x48bec8[_0x3b83b5(0x154)][_0x3b83b5(0x16d)]===_0x3b83b5(0x15e)?_0x48bec8[_0x3b83b5(0x154)]['apps']:{},_0x932e72=_0x48bec8[_0x3b83b5(0x154)]['inherit']===![],_0x1fc269=Object['entries'](apps),_0x3a6fb2=_0x1fc269['map'](([_0x4c679b,_0x363588])=>({'name':_0x4c679b,'appcode':_0x363588[_0x3b83b5(0x164)],'named':!![],'definedIn':appDefinedIn(_0x4c679b,_0x48ca25,_0x365a99,_0x932e72),'isDefault':_0x4c679b===_0x12ced0,...buildAppProfileListFields(_0x363588)}));return _0x3a6fb2;}async function execute(_0x151c03){const _0x4f6559=a102_0x427c,_0x24e804=_0x151c03[_0x4f6559(0x160)](_0x4f6559(0x15b)),_0x47da94=_0x151c03[_0x4f6559(0x160)]('project'),_0x3e4191=_0x24e804?_0x4f6559(0x15b):_0x47da94?_0x4f6559(0x14f):'merged',{config:_0x225df4,layers:_0x587ca8}=readRawConfigWithLayers(),_0x4f9bde=resolveDefaultAppSource(_0x587ca8),{defaultApp:_0x583cf7}=_0x225df4;let _0x5d8aa6,_0x7825b8;switch(_0x3e4191){case'global':_0x5d8aa6=buildItemsFromLayer(_0x587ca8['globalConfig'],'global'),_0x7825b8=_0x587ca8[_0x4f6559(0x169)];break;case _0x4f6559(0x14f):_0x5d8aa6=buildItemsFromLayer(_0x587ca8[_0x4f6559(0x154)],_0x4f6559(0x14f)),_0x7825b8=_0x587ca8[_0x4f6559(0x159)];break;default:_0x5d8aa6=buildMergedItems(_0x225df4,_0x587ca8);break;}enrichAppListItemsWithMergedSelection(_0x5d8aa6,_0x151c03['mergedCli']);if(_0x5d8aa6[_0x4f6559(0x165)]===0x0){const _0x5d1b4a=_0x3e4191===_0x4f6559(0x16a)?'':_0x4f6559(0x14e)+_0x3e4191+'\x20config';return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x5d1b4a+_0x4f6559(0x157)+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x239240=_0x5d8aa6[_0x4f6559(0x162)](_0xd29d6f=>_0xd29d6f[_0x4f6559(0x167)]===!![]),_0x36935a=_0x583cf7??_0x239240?.[_0x4f6559(0x164)]??null,_0x365a64=_0x3e4191===_0x4f6559(0x16a)?{'globalPath':_0x587ca8[_0x4f6559(0x169)]??null,'projectPath':_0x587ca8[_0x4f6559(0x159)]??null,'defaultApp':_0x36935a,'defaultAppSource':_0x583cf7!=null?_0x4f9bde:null}:{'scope':_0x3e4191,'configPath':_0x7825b8??null};return{'ok':!![],'data':{'items':_0x5d8aa6,'meta':_0x365a64}};}export const appListDefinition={'service':'app','command':'list','description':a102_0x1707aa(0x161),'risk':a102_0x1707aa(0x153),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a102_0x1707aa(0x15b),'type':'boolean','description':a102_0x1707aa(0x15d),'default':![]},{'name':'project','type':a102_0x1707aa(0x16b),'description':a102_0x1707aa(0x150),'default':![]}],'execute':execute};
@@ -1 +1 @@
1
- const a22_0x2b2830=a22_0x302a;(function(_0x2805b3,_0x1147f1){const _0x289c17=a22_0x302a,_0x80398f=_0x2805b3();while(!![]){try{const _0x474709=parseInt(_0x289c17(0xe9))/0x1*(parseInt(_0x289c17(0xf2))/0x2)+-parseInt(_0x289c17(0xef))/0x3*(-parseInt(_0x289c17(0xeb))/0x4)+parseInt(_0x289c17(0x10d))/0x5+parseInt(_0x289c17(0xea))/0x6+parseInt(_0x289c17(0x112))/0x7*(-parseInt(_0x289c17(0x105))/0x8)+parseInt(_0x289c17(0xff))/0x9*(parseInt(_0x289c17(0x100))/0xa)+parseInt(_0x289c17(0x101))/0xb*(-parseInt(_0x289c17(0x103))/0xc);if(_0x474709===_0x1147f1)break;else _0x80398f['push'](_0x80398f['shift']());}catch(_0x5b1b14){_0x80398f['push'](_0x80398f['shift']());}}}(a22_0x1d09,0xe274f));function a22_0x1d09(){const _0x5bd16a=['\x20Default\x20app\x20changed\x20to\x20\x22','144806YUtHKx','apps','Missing\x20app\x20name.','Use\x20global\x20config\x20scope','App\x20\x22','keys','defaultApp','args','\x20config.','App\x20profile\x20name\x20to\x20remove','bool','Remove\x20an\x20app\x20from\x20config','inherit','9cNUOeu','4860710vvpjFf','2305391yinqhr','boolean','12ipJFYK','globalConfig','14585240MENrpe','trim','global','both','high-risk-write','Removed\x20app\x20\x22','validation','\x22\x20not\x20found.','3781000TjYdpv','\x20Note:\x20app\x20\x22','project','object','\x20app\x20remove\x20<name>\x20[--global]','7MPsnau','projectConfig','13xoeflO','1490016EQHFAV','2113828oBSWlf','app','\x22\x20still\x20defined\x20in\x20','Usage:\x20','3WUxLAf','length'];a22_0x1d09=function(){return _0x5bd16a;};return a22_0x1d09();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a22_0x302a(_0x232411,_0x33ccaf){_0x232411=_0x232411-0xe8;const _0x1d097b=a22_0x1d09();let _0x302a96=_0x1d097b[_0x232411];return _0x302a96;}import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x46943f){const _0x4c5122=a22_0x302a,_0x12ce08=_0x46943f[_0x4c5122(0xf9)][0x0]?.[_0x4c5122(0x106)]();if(!_0x12ce08)throw CliErrors[_0x4c5122(0x10b)](_0x4c5122(0xf4),_0x4c5122(0xee)+CLI_BIN_NAME+_0x4c5122(0x111));}async function execute(_0x15aad9){const _0xac0154=a22_0x302a,_0x173763=_0x15aad9[_0xac0154(0xf9)][0x0]?.[_0xac0154(0x106)]();if(!_0x173763)throw CliErrors[_0xac0154(0x10b)]('Missing\x20app\x20name.',_0xac0154(0xee)+CLI_BIN_NAME+_0xac0154(0x111));const _0x27e49c=_0x15aad9[_0xac0154(0xfc)](_0xac0154(0x107)),{config:_0x2347bb,layers:_0x192f59}=readRawConfigWithLayers(),_0x431ce5=_0x2347bb[_0xac0154(0xf3)]??{};if(!_0x431ce5[_0x173763])throw CliErrors[_0xac0154(0x10b)](_0xac0154(0xf6)+_0x173763+_0xac0154(0x10c));const _0x2598b7=_0x192f59['globalConfig'][_0xac0154(0xf3)]&&typeof _0x192f59['globalConfig'][_0xac0154(0xf3)]===_0xac0154(0x110)?_0x192f59[_0xac0154(0x104)]['apps']:{},_0xc0f0ff=_0x192f59[_0xac0154(0xe8)][_0xac0154(0xf3)]&&typeof _0x192f59[_0xac0154(0xe8)][_0xac0154(0xf3)]===_0xac0154(0x110)?_0x192f59[_0xac0154(0xe8)][_0xac0154(0xf3)]:{},_0x126825=appDefinedIn(_0x173763,_0x2598b7,_0xc0f0ff,_0x192f59[_0xac0154(0xe8)][_0xac0154(0xfe)]===![]),_0x374dac=resolveAppScopeForWrite(_0x173763,_0x27e49c,_0x192f59),_0x10b498={'global':_0x374dac==='global'},_0x206668=readConfig(_0x10b498),_0x4f8b88=_0x206668[_0xac0154(0xf3)];if(!_0x4f8b88||!_0x4f8b88[_0x173763])throw CliErrors[_0xac0154(0x10b)]('App\x20\x22'+_0x173763+_0xac0154(0x10c));delete _0x4f8b88[_0x173763];let _0xbde347='';if(_0x206668['defaultApp']===_0x173763){const _0x3072de=Object[_0xac0154(0xf7)](_0x4f8b88);_0x206668[_0xac0154(0xf8)]=_0x3072de[_0xac0154(0xf0)]>0x0?_0x3072de[0x0]:undefined,_0x206668[_0xac0154(0xf8)]?_0xbde347=_0xac0154(0xf1)+_0x206668['defaultApp']+'\x22.':delete _0x206668[_0xac0154(0xf8)];}Object[_0xac0154(0xf7)](_0x4f8b88)['length']===0x0&&(delete _0x206668[_0xac0154(0xf3)],delete _0x206668['defaultApp']);writeConfig(_0x206668,_0x10b498);const _0x59ea8f=_0x126825===_0xac0154(0x108)?_0xac0154(0x10e)+_0x173763+_0xac0154(0xed)+(_0x374dac==='project'?_0xac0154(0x107):_0xac0154(0x10f))+_0xac0154(0xfa):'';return{'ok':!![],'message':_0xac0154(0x10a)+_0x173763+'\x22'+scopeLabel(_0x10b498)+'.'+_0xbde347+_0x59ea8f};}export const appRemoveDefinition={'service':a22_0x2b2830(0xec),'command':'remove','description':a22_0x2b2830(0xfd),'risk':a22_0x2b2830(0x109),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a22_0x2b2830(0xfb),'required':!![]}],'flags':[{'name':'global','type':a22_0x2b2830(0x102),'description':a22_0x2b2830(0xf5),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ function a101_0x5f25(){const _0x5de506=['globalConfig','1395npWoJB','\x20app\x20remove\x20<name>\x20[--global]','Missing\x20app\x20name.','App\x20profile\x20name\x20to\x20remove','inherit','4326795IuCJWi','\x20Note:\x20app\x20\x22','1610616MjYclT','boolean','both','global','3434188gPcyDY','length','object','598giuHKm','2642553mxEWVz','defaultApp','validation','Remove\x20an\x20app\x20from\x20config','trim','app','keys','args','5aXjrqE','675872ilLPaj','Use\x20global\x20config\x20scope','projectConfig','Removed\x20app\x20\x22','\x22\x20not\x20found.','2600754BjooAs','high-risk-write','Usage:\x20','project','App\x20\x22','bool','name','apps'];a101_0x5f25=function(){return _0x5de506;};return a101_0x5f25();}const a101_0x343c68=a101_0x2aa7;function a101_0x2aa7(_0xcf85d2,_0x26dcf7){_0xcf85d2=_0xcf85d2-0xa0;const _0x5f258a=a101_0x5f25();let _0x2aa77b=_0x5f258a[_0xcf85d2];return _0x2aa77b;}(function(_0x3a1889,_0x53b945){const _0x515266=a101_0x2aa7,_0x4aedc3=_0x3a1889();while(!![]){try{const _0x38e654=parseInt(_0x515266(0xb7))/0x1*(parseInt(_0x515266(0xc5))/0x2)+-parseInt(_0x515266(0xa0))/0x3+parseInt(_0x515266(0xc2))/0x4*(parseInt(_0x515266(0xa8))/0x5)+parseInt(_0x515266(0xae))/0x6+parseInt(_0x515266(0xbe))/0x7+parseInt(_0x515266(0xa9))/0x8+-parseInt(_0x515266(0xbc))/0x9;if(_0x38e654===_0x53b945)break;else _0x4aedc3['push'](_0x4aedc3['shift']());}catch(_0x1527c5){_0x4aedc3['push'](_0x4aedc3['shift']());}}}(a101_0x5f25,0xa1a3d));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x427a81){const _0x3dda21=a101_0x2aa7,_0x4fd48f=_0x427a81[_0x3dda21(0xa7)][0x0]?.['trim']();if(!_0x4fd48f)throw CliErrors[_0x3dda21(0xa2)](_0x3dda21(0xb9),'Usage:\x20'+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');}async function execute(_0x3665b1){const _0x25bbc7=a101_0x2aa7,_0x2e0e9d=_0x3665b1[_0x25bbc7(0xa7)][0x0]?.[_0x25bbc7(0xa4)]();if(!_0x2e0e9d)throw CliErrors[_0x25bbc7(0xa2)](_0x25bbc7(0xb9),_0x25bbc7(0xb0)+CLI_BIN_NAME+_0x25bbc7(0xb8));const _0x5ee22e=_0x3665b1[_0x25bbc7(0xb3)](_0x25bbc7(0xc1)),{config:_0x1c7571,layers:_0x436a28}=readRawConfigWithLayers(),_0x4520e7=_0x1c7571[_0x25bbc7(0xb5)]??{};if(!_0x4520e7[_0x2e0e9d])throw CliErrors['validation'](_0x25bbc7(0xb2)+_0x2e0e9d+_0x25bbc7(0xad));const _0x1b3aef=_0x436a28[_0x25bbc7(0xb6)]['apps']&&typeof _0x436a28[_0x25bbc7(0xb6)][_0x25bbc7(0xb5)]===_0x25bbc7(0xc4)?_0x436a28[_0x25bbc7(0xb6)][_0x25bbc7(0xb5)]:{},_0x1d2e26=_0x436a28['projectConfig'][_0x25bbc7(0xb5)]&&typeof _0x436a28[_0x25bbc7(0xab)][_0x25bbc7(0xb5)]===_0x25bbc7(0xc4)?_0x436a28['projectConfig'][_0x25bbc7(0xb5)]:{},_0x52dd67=appDefinedIn(_0x2e0e9d,_0x1b3aef,_0x1d2e26,_0x436a28[_0x25bbc7(0xab)][_0x25bbc7(0xbb)]===![]),_0x3989bf=resolveAppScopeForWrite(_0x2e0e9d,_0x5ee22e,_0x436a28),_0x3c3200={'global':_0x3989bf==='global'},_0x25e12e=readConfig(_0x3c3200),_0x58746d=_0x25e12e['apps'];if(!_0x58746d||!_0x58746d[_0x2e0e9d])throw CliErrors[_0x25bbc7(0xa2)](_0x25bbc7(0xb2)+_0x2e0e9d+_0x25bbc7(0xad));delete _0x58746d[_0x2e0e9d];let _0x34919b='';if(_0x25e12e[_0x25bbc7(0xa1)]===_0x2e0e9d){const _0x27ed02=Object['keys'](_0x58746d);_0x25e12e[_0x25bbc7(0xa1)]=_0x27ed02[_0x25bbc7(0xc3)]>0x0?_0x27ed02[0x0]:undefined,_0x25e12e[_0x25bbc7(0xa1)]?_0x34919b='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x25e12e[_0x25bbc7(0xa1)]+'\x22.':delete _0x25e12e['defaultApp'];}Object[_0x25bbc7(0xa6)](_0x58746d)[_0x25bbc7(0xc3)]===0x0&&(delete _0x25e12e[_0x25bbc7(0xb5)],delete _0x25e12e[_0x25bbc7(0xa1)]);writeConfig(_0x25e12e,_0x3c3200);const _0x230b3c=_0x52dd67===_0x25bbc7(0xc0)?_0x25bbc7(0xbd)+_0x2e0e9d+'\x22\x20still\x20defined\x20in\x20'+(_0x3989bf===_0x25bbc7(0xb1)?_0x25bbc7(0xc1):'project')+'\x20config.':'';return{'ok':!![],'message':_0x25bbc7(0xac)+_0x2e0e9d+'\x22'+scopeLabel(_0x3c3200)+'.'+_0x34919b+_0x230b3c};}export const appRemoveDefinition={'service':a101_0x343c68(0xa5),'command':'remove','description':a101_0x343c68(0xa3),'risk':a101_0x343c68(0xaf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a101_0x343c68(0xb4),'description':a101_0x343c68(0xba),'required':!![]}],'flags':[{'name':'global','type':a101_0x343c68(0xbf),'description':a101_0x343c68(0xaa),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- (function(_0x5d00fb,_0x414ab6){const _0x503166=a23_0x6518,_0x201a26=_0x5d00fb();while(!![]){try{const _0x416285=-parseInt(_0x503166(0x175))/0x1*(-parseInt(_0x503166(0x185))/0x2)+-parseInt(_0x503166(0x18c))/0x3+-parseInt(_0x503166(0x17d))/0x4+parseInt(_0x503166(0x188))/0x5+parseInt(_0x503166(0x181))/0x6+-parseInt(_0x503166(0x177))/0x7+parseInt(_0x503166(0x17c))/0x8;if(_0x416285===_0x414ab6)break;else _0x201a26['push'](_0x201a26['shift']());}catch(_0xcb287a){_0x201a26['push'](_0x201a26['shift']());}}}(a23_0x3239,0xdbce1));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x1582d5,_0x1edd5b){const _0x1ff3fc=a23_0x6518;if(!_0x1edd5b)return;const _0x3bd278=_0x1edd5b[_0x1ff3fc(0x172)]&&typeof _0x1edd5b[_0x1ff3fc(0x172)]===_0x1ff3fc(0x184)?_0x1edd5b[_0x1ff3fc(0x172)]:{},_0x4708a6=Object['keys'](_0x3bd278)[_0x1ff3fc(0x17f)]>0x0;for(const _0x142ac6 of _0x1582d5){_0x142ac6[_0x1ff3fc(0x182)]=![];}const _0x7045f7=_0x1edd5b[_0x1ff3fc(0x179)]!=null?String(_0x1edd5b[_0x1ff3fc(0x179)])[_0x1ff3fc(0x18a)]():'';if(_0x4708a6){const _0x22f76f=_0x1edd5b[_0x1ff3fc(0x187)]??_0x1edd5b[_0x1ff3fc(0x186)];if(_0x22f76f)for(const _0x5a4f40 of _0x1582d5){_0x5a4f40['named']===!![]&&_0x5a4f40[_0x1ff3fc(0x17e)]===_0x22f76f&&(_0x5a4f40['isCurrent']=!![]);}for(const _0x38bf4e of _0x1582d5){if(_0x38bf4e['named']!==![])continue;if(_0x1edd5b[_0x1ff3fc(0x186)])continue;_0x7045f7&&String(_0x38bf4e['appcode']??'')[_0x1ff3fc(0x18a)]()===_0x7045f7&&(_0x38bf4e[_0x1ff3fc(0x182)]=!![]);}return;}if(!_0x7045f7)return;for(const _0x560734 of _0x1582d5){String(_0x560734[_0x1ff3fc(0x189)]??'')['trim']()===_0x7045f7&&(_0x560734[_0x1ff3fc(0x182)]=!![]);}}export function resolveAppScopeForWrite(_0x1bd033,_0x476a01,_0x3b1b92){const _0x1b3084=a23_0x6518;if(_0x476a01)return _0x1b3084(0x173);const _0x2b9eaa=_0x3b1b92[_0x1b3084(0x17a)][_0x1b3084(0x172)]&&typeof _0x3b1b92[_0x1b3084(0x17a)][_0x1b3084(0x172)]===_0x1b3084(0x184)?_0x3b1b92[_0x1b3084(0x17a)][_0x1b3084(0x172)]:{},_0x55c65f=_0x3b1b92[_0x1b3084(0x176)][_0x1b3084(0x172)]&&typeof _0x3b1b92[_0x1b3084(0x176)][_0x1b3084(0x172)]===_0x1b3084(0x184)?_0x3b1b92[_0x1b3084(0x176)]['apps']:{};if(Object[_0x1b3084(0x17b)][_0x1b3084(0x18b)]['call'](_0x2b9eaa,_0x1bd033))return'project';if(Object['prototype'][_0x1b3084(0x18b)][_0x1b3084(0x183)](_0x55c65f,_0x1bd033))return'global';return _0x1b3084(0x180);}export function appDefinedIn(_0x2818fa,_0x4974e9,_0x369e1d,_0x47512f){const _0x29f7ce=a23_0x6518;if(_0x47512f)return Object[_0x29f7ce(0x17b)][_0x29f7ce(0x18b)][_0x29f7ce(0x183)](_0x369e1d,_0x2818fa)?'project':_0x29f7ce(0x173);const _0x2b3304=Object[_0x29f7ce(0x17b)][_0x29f7ce(0x18b)][_0x29f7ce(0x183)](_0x4974e9,_0x2818fa),_0x403f83=Object[_0x29f7ce(0x17b)][_0x29f7ce(0x18b)][_0x29f7ce(0x183)](_0x369e1d,_0x2818fa);if(_0x2b3304&&_0x403f83)return _0x29f7ce(0x18d);if(_0x403f83)return'project';return _0x29f7ce(0x173);}export function resolveDefaultAppSource(_0x3d2ff9){const _0x3f1879=a23_0x6518,_0x5958af=_0x3d2ff9['projectConfig'][_0x3f1879(0x172)]&&typeof _0x3d2ff9['projectConfig'][_0x3f1879(0x172)]===_0x3f1879(0x184)?_0x3d2ff9[_0x3f1879(0x17a)]['apps']:{};if(_0x3f1879(0x186)in _0x3d2ff9['projectConfig'])return _0x3f1879(0x180);if(Object[_0x3f1879(0x174)](_0x5958af)[_0x3f1879(0x17f)]>0x0)return _0x3f1879(0x180);if(_0x3d2ff9[_0x3f1879(0x17a)]['inherit']===![])return null;if(_0x3d2ff9[_0x3f1879(0x176)][_0x3f1879(0x186)])return _0x3f1879(0x173);return null;}export function getConfigPath(_0x5a71c7={}){const _0x2f0901=a23_0x6518,_0xaeb1e4=_0x5a71c7['global']?_0x2f0901(0x173):_0x2f0901(0x180);return resolveWriteConfigPath(_0xaeb1e4);}export function readConfig(_0x51cd83={}){return readConfigFile(getConfigPath(_0x51cd83));}export function writeConfig(_0x2b485e,_0x2b3be7={}){writeConfigFile(getConfigPath(_0x2b3be7),_0x2b485e);}function a23_0x3239(){const _0x12f588=['appCode','projectConfig','prototype','4276080RiDQKi','5212100ZwSZIu','name','length','project','7032144NQOAwO','isCurrent','call','object','4346ukVrPr','defaultApp','currentApp','1662510xwfpJs','appcode','trim','hasOwnProperty','366711UGSJzy','both','apps','global','keys','211cbzJXw','globalConfig','1203692LOkqfk','\x20(global)'];a23_0x3239=function(){return _0x12f588;};return a23_0x3239();}function a23_0x6518(_0x5a49fb,_0x2d3633){_0x5a49fb=_0x5a49fb-0x172;const _0x323949=a23_0x3239();let _0x6518af=_0x323949[_0x5a49fb];return _0x6518af;}export function scopeLabel(_0x1d5418){const _0x5609d2=a23_0x6518;return _0x1d5418[_0x5609d2(0x173)]?_0x5609d2(0x178):'';}
1
+ (function(_0x4e0f9e,_0x3eafed){const _0x47af24=a105_0x45e9,_0x4629e2=_0x4e0f9e();while(!![]){try{const _0x45c91d=parseInt(_0x47af24(0x149))/0x1+-parseInt(_0x47af24(0x158))/0x2+-parseInt(_0x47af24(0x148))/0x3*(parseInt(_0x47af24(0x14f))/0x4)+parseInt(_0x47af24(0x144))/0x5+-parseInt(_0x47af24(0x157))/0x6*(-parseInt(_0x47af24(0x14d))/0x7)+parseInt(_0x47af24(0x15d))/0x8+-parseInt(_0x47af24(0x155))/0x9;if(_0x45c91d===_0x3eafed)break;else _0x4629e2['push'](_0x4629e2['shift']());}catch(_0x5d9fa4){_0x4629e2['push'](_0x4629e2['shift']());}}}(a105_0x43de,0x3554e));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x5374e6,_0x2a18cf){const _0x21721e=a105_0x45e9;if(!_0x2a18cf)return;const _0x5d16ea=_0x2a18cf[_0x21721e(0x156)]&&typeof _0x2a18cf[_0x21721e(0x156)]==='object'?_0x2a18cf[_0x21721e(0x156)]:{},_0xa94280=Object[_0x21721e(0x154)](_0x5d16ea)[_0x21721e(0x147)]>0x0;for(const _0x5137d9 of _0x5374e6){_0x5137d9[_0x21721e(0x146)]=![];}const _0x4db17c=_0x2a18cf[_0x21721e(0x153)]!=null?String(_0x2a18cf['appCode'])[_0x21721e(0x14e)]():'';if(_0xa94280){const _0xe7f767=_0x2a18cf[_0x21721e(0x145)]??_0x2a18cf[_0x21721e(0x159)];if(_0xe7f767)for(const _0x441202 of _0x5374e6){_0x441202[_0x21721e(0x15c)]===!![]&&_0x441202[_0x21721e(0x143)]===_0xe7f767&&(_0x441202[_0x21721e(0x146)]=!![]);}for(const _0x5200ea of _0x5374e6){if(_0x5200ea[_0x21721e(0x15c)]!==![])continue;if(_0x2a18cf[_0x21721e(0x159)])continue;_0x4db17c&&String(_0x5200ea[_0x21721e(0x151)]??'')[_0x21721e(0x14e)]()===_0x4db17c&&(_0x5200ea[_0x21721e(0x146)]=!![]);}return;}if(!_0x4db17c)return;for(const _0x44aaef of _0x5374e6){String(_0x44aaef[_0x21721e(0x151)]??'')[_0x21721e(0x14e)]()===_0x4db17c&&(_0x44aaef[_0x21721e(0x146)]=!![]);}}export function resolveAppScopeForWrite(_0x4919f0,_0x4f38bc,_0x3a4efe){const _0x438eef=a105_0x45e9;if(_0x4f38bc)return'global';const _0x3302e1=_0x3a4efe[_0x438eef(0x15b)][_0x438eef(0x156)]&&typeof _0x3a4efe['projectConfig'][_0x438eef(0x156)]===_0x438eef(0x14c)?_0x3a4efe[_0x438eef(0x15b)][_0x438eef(0x156)]:{},_0x1039b2=_0x3a4efe[_0x438eef(0x14b)]['apps']&&typeof _0x3a4efe[_0x438eef(0x14b)][_0x438eef(0x156)]===_0x438eef(0x14c)?_0x3a4efe['globalConfig'][_0x438eef(0x156)]:{};if(Object[_0x438eef(0x152)][_0x438eef(0x15a)][_0x438eef(0x150)](_0x3302e1,_0x4919f0))return'project';if(Object['prototype'][_0x438eef(0x15a)][_0x438eef(0x150)](_0x1039b2,_0x4919f0))return _0x438eef(0x14a);return _0x438eef(0x15e);}export function appDefinedIn(_0x3901c0,_0x33bb5c,_0x9a95ea,_0x3da849){const _0x20174b=a105_0x45e9;if(_0x3da849)return Object[_0x20174b(0x152)]['hasOwnProperty'][_0x20174b(0x150)](_0x9a95ea,_0x3901c0)?_0x20174b(0x15e):_0x20174b(0x14a);const _0x1dffac=Object[_0x20174b(0x152)][_0x20174b(0x15a)][_0x20174b(0x150)](_0x33bb5c,_0x3901c0),_0x3d61ec=Object[_0x20174b(0x152)][_0x20174b(0x15a)]['call'](_0x9a95ea,_0x3901c0);if(_0x1dffac&&_0x3d61ec)return'both';if(_0x3d61ec)return'project';return'global';}export function resolveDefaultAppSource(_0x52cd5d){const _0x2fa0e0=a105_0x45e9,_0xb35049=_0x52cd5d[_0x2fa0e0(0x15b)][_0x2fa0e0(0x156)]&&typeof _0x52cd5d[_0x2fa0e0(0x15b)][_0x2fa0e0(0x156)]===_0x2fa0e0(0x14c)?_0x52cd5d[_0x2fa0e0(0x15b)]['apps']:{};if(_0x2fa0e0(0x159)in _0x52cd5d['projectConfig'])return _0x2fa0e0(0x15e);if(Object[_0x2fa0e0(0x154)](_0xb35049)[_0x2fa0e0(0x147)]>0x0)return'project';if(_0x52cd5d[_0x2fa0e0(0x15b)]['inherit']===![])return null;if(_0x52cd5d[_0x2fa0e0(0x14b)][_0x2fa0e0(0x159)])return _0x2fa0e0(0x14a);return null;}export function getConfigPath(_0x36cba0={}){const _0x169602=a105_0x45e9,_0x3c8641=_0x36cba0[_0x169602(0x14a)]?_0x169602(0x14a):_0x169602(0x15e);return resolveWriteConfigPath(_0x3c8641);}function a105_0x45e9(_0x5cbe07,_0x5cfcca){_0x5cbe07=_0x5cbe07-0x143;const _0x43de96=a105_0x43de();let _0x45e91b=_0x43de96[_0x5cbe07];return _0x45e91b;}function a105_0x43de(){const _0x3592f0=['appcode','prototype','appCode','keys','6213654pwrelN','apps','337218yjtEPh','53486smCoKj','defaultApp','hasOwnProperty','projectConfig','named','819680kDlyWv','project','name','663280GZmnEh','currentApp','isCurrent','length','3lVWcsG','346351WKtBwg','global','globalConfig','object','49NehZRi','trim','157172tJkUma','call'];a105_0x43de=function(){return _0x3592f0;};return a105_0x43de();}export function readConfig(_0x4035a0={}){return readConfigFile(getConfigPath(_0x4035a0));}export function writeConfig(_0x5b2a54,_0x5ded45={}){writeConfigFile(getConfigPath(_0x5ded45),_0x5b2a54);}export function scopeLabel(_0x33f5c3){const _0x4215ac=a105_0x45e9;return _0x33f5c3[_0x4215ac(0x14a)]?'\x20(global)':'';}
@@ -1 +1 @@
1
- const a24_0x19d072=a24_0x3834;(function(_0x4ae860,_0xdcc8ca){const _0x5742d3=a24_0x3834,_0x5b9382=_0x4ae860();while(!![]){try{const _0xcbc501=-parseInt(_0x5742d3(0x105))/0x1*(parseInt(_0x5742d3(0x10d))/0x2)+parseInt(_0x5742d3(0x102))/0x3*(parseInt(_0x5742d3(0x10f))/0x4)+parseInt(_0x5742d3(0x110))/0x5+parseInt(_0x5742d3(0xff))/0x6*(-parseInt(_0x5742d3(0x104))/0x7)+parseInt(_0x5742d3(0x101))/0x8*(-parseInt(_0x5742d3(0x10e))/0x9)+-parseInt(_0x5742d3(0x100))/0xa*(-parseInt(_0x5742d3(0xf5))/0xb)+parseInt(_0x5742d3(0x112))/0xc*(parseInt(_0x5742d3(0xf6))/0xd);if(_0xcbc501===_0xdcc8ca)break;else _0x5b9382['push'](_0x5b9382['shift']());}catch(_0x3d367a){_0x5b9382['push'](_0x5b9382['shift']());}}}(a24_0x5b0b,0xb548c));import{CliErrors}from'../../errors.js';function a24_0x5b0b(){const _0x472f9b=['4VbEzFh','5345245LmpvpC','keys','29724fbDMOa','\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.','global','defaultApp','hasOwnProperty','bool','args','validation','use','length','trim','App\x20profile\x20name\x20to\x20activate','Switch\x20the\x20default\x20app','\x20app\x20add\x20','\x0aNote:\x20\x22','Usage:\x20','319FOGEsl','4472GLeYrd','app','Available:\x20','write','\x20--appcode\x20<code>`\x20first.','appcode','name','\x22\x20not\x20found.','projectPath','332616RLWszE','138070TCzUYp','16rYkpfZ','3976671DKmLiE','Missing\x20app\x20name.','126OkkVdX','9eZNHjM','Use\x20global\x20config\x20scope','apps','Default\x20app\x20set\x20to\x20\x22','projectConfig','prototype','boolean','call','149026alQBfW','5562414DssfEN'];a24_0x5b0b=function(){return _0x472f9b;};return a24_0x5b0b();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers,isInProject}from'../../context.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x13554c){const _0x55604d=a24_0x3834,_0x398c09=_0x13554c[_0x55604d(0xeb)][0x0]?.[_0x55604d(0xef)]();if(!_0x398c09)throw CliErrors[_0x55604d(0xec)](_0x55604d(0x103),_0x55604d(0xf4)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');}function a24_0x3834(_0x55f968,_0x328168){_0x55f968=_0x55f968-0xe6;const _0x5b0b49=a24_0x5b0b();let _0x38345f=_0x5b0b49[_0x55f968];return _0x38345f;}async function execute(_0x23f6e5){const _0x5a297f=a24_0x3834,_0x5ac534=_0x23f6e5[_0x5a297f(0xeb)][0x0]?.['trim']();if(!_0x5ac534)throw CliErrors['validation']('Missing\x20app\x20name.',_0x5a297f(0xf4)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');const _0x6bf829=_0x23f6e5[_0x5a297f(0xea)](_0x5a297f(0xe7)),{config:_0x363a76,layers:_0x436701}=readRawConfigWithLayers(),_0x2f1867=_0x363a76['apps']??{};if(!_0x2f1867[_0x5ac534]){const _0x55d152=Object[_0x5a297f(0x111)](_0x2f1867),_0x2375d3=_0x55d152[_0x5a297f(0xee)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x5a297f(0xf2)+_0x5ac534+_0x5a297f(0xfa):_0x5a297f(0xf8)+_0x55d152['join'](',\x20');throw CliErrors[_0x5a297f(0xec)]('App\x20\x22'+_0x5ac534+_0x5a297f(0xfd),_0x2375d3);}let _0x427244,_0x131d8e='';if(_0x6bf829)_0x427244={'global':!![]};else{const _0x30e183=isInProject()&&!!_0x436701[_0x5a297f(0xfe)];_0x427244={'global':!_0x30e183};if(_0x30e183){const _0x3233c6=_0x436701['projectConfig'][_0x5a297f(0x107)]&&typeof _0x436701['projectConfig'][_0x5a297f(0x107)]==='object'?_0x436701[_0x5a297f(0x109)][_0x5a297f(0x107)]:{};!Object[_0x5a297f(0x10a)][_0x5a297f(0xe9)][_0x5a297f(0x10c)](_0x3233c6,_0x5ac534)&&(_0x131d8e=_0x5a297f(0xf3)+_0x5ac534+_0x5a297f(0xe6));}}const _0x3a769c=readConfig(_0x427244);return _0x3a769c[_0x5a297f(0xe8)]=_0x5ac534,writeConfig(_0x3a769c,_0x427244),{'ok':!![],'message':_0x5a297f(0x108)+_0x5ac534+'\x22\x20(appcode:\x20'+_0x2f1867[_0x5ac534][_0x5a297f(0xfb)]+')'+scopeLabel(_0x427244)+_0x131d8e};}export const appUseDefinition={'service':a24_0x19d072(0xf7),'command':a24_0x19d072(0xed),'description':a24_0x19d072(0xf1),'risk':a24_0x19d072(0xf9),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a24_0x19d072(0xfc),'description':a24_0x19d072(0xf0),'required':!![]}],'flags':[{'name':a24_0x19d072(0xe7),'type':a24_0x19d072(0x10b),'description':a24_0x19d072(0x106),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a104_0xd01a35=a104_0x171b;(function(_0x24b272,_0x3517b7){const _0x4d6d80=a104_0x171b,_0x5c86e8=_0x24b272();while(!![]){try{const _0x41a846=-parseInt(_0x4d6d80(0x1a5))/0x1*(-parseInt(_0x4d6d80(0x1b2))/0x2)+-parseInt(_0x4d6d80(0x1a3))/0x3*(parseInt(_0x4d6d80(0x19d))/0x4)+parseInt(_0x4d6d80(0x1ab))/0x5+parseInt(_0x4d6d80(0x1a6))/0x6+parseInt(_0x4d6d80(0x194))/0x7+-parseInt(_0x4d6d80(0x1a1))/0x8*(parseInt(_0x4d6d80(0x1b7))/0x9)+-parseInt(_0x4d6d80(0x19a))/0xa;if(_0x41a846===_0x3517b7)break;else _0x5c86e8['push'](_0x5c86e8['shift']());}catch(_0x5a9add){_0x5c86e8['push'](_0x5c86e8['shift']());}}}(a104_0x3aca,0x62d71));import{CliErrors}from'../../errors.js';function a104_0x171b(_0xd40c5f,_0x2d9160){_0xd40c5f=_0xd40c5f-0x193;const _0x3acadb=a104_0x3aca();let _0x171b56=_0x3acadb[_0xd40c5f];return _0x171b56;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers,isInProject}from'../../context.js';function a104_0x3aca(){const _0xd6a742=['Missing\x20app\x20name.','hasOwnProperty','65138SxtwSY','Use\x20`','App\x20profile\x20name\x20to\x20activate','\x22\x20(appcode:\x20','defaultApp','6089247VAsXzR','call','App\x20\x22','args','3857266yyeejm','prototype','length','keys','Usage:\x20','boolean','2017080JKcgEi','\x20app\x20add\x20','app','18380Dymtdm','validation','projectPath','global','8JAvTUQ','name','51kxVhzw','\x20app\x20use\x20<name>\x20[--global]','3kTBHdT','3008610QtnBbo','Use\x20global\x20config\x20scope','\x0aNote:\x20\x22','bool','projectConfig','1055375bMVWoL','\x20--appcode\x20<code>`\x20first.','apps','appcode','Default\x20app\x20set\x20to\x20\x22'];a104_0x3aca=function(){return _0xd6a742;};return a104_0x3aca();}import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x47de45){const _0x43e164=a104_0x171b,_0x1dc0c3=_0x47de45[_0x43e164(0x193)][0x0]?.['trim']();if(!_0x1dc0c3)throw CliErrors['validation'](_0x43e164(0x1b0),'Usage:\x20'+CLI_BIN_NAME+_0x43e164(0x1a4));}async function execute(_0x1e2ff1){const _0x3ec3c2=a104_0x171b,_0x50b62e=_0x1e2ff1['args'][0x0]?.['trim']();if(!_0x50b62e)throw CliErrors['validation'](_0x3ec3c2(0x1b0),_0x3ec3c2(0x198)+CLI_BIN_NAME+_0x3ec3c2(0x1a4));const _0x45b6a0=_0x1e2ff1[_0x3ec3c2(0x1a9)](_0x3ec3c2(0x1a0)),{config:_0x3a7ee8,layers:_0x5a022}=readRawConfigWithLayers(),_0x4076d7=_0x3a7ee8[_0x3ec3c2(0x1ad)]??{};if(!_0x4076d7[_0x50b62e]){const _0x479c24=Object[_0x3ec3c2(0x197)](_0x4076d7),_0x225ede=_0x479c24[_0x3ec3c2(0x196)]===0x0?_0x3ec3c2(0x1b3)+CLI_BIN_NAME+_0x3ec3c2(0x19b)+_0x50b62e+_0x3ec3c2(0x1ac):'Available:\x20'+_0x479c24['join'](',\x20');throw CliErrors[_0x3ec3c2(0x19e)](_0x3ec3c2(0x1b9)+_0x50b62e+'\x22\x20not\x20found.',_0x225ede);}let _0x1899f1,_0x25b290='';if(_0x45b6a0)_0x1899f1={'global':!![]};else{const _0x57a61d=isInProject()&&!!_0x5a022[_0x3ec3c2(0x19f)];_0x1899f1={'global':!_0x57a61d};if(_0x57a61d){const _0x4a3746=_0x5a022[_0x3ec3c2(0x1aa)][_0x3ec3c2(0x1ad)]&&typeof _0x5a022[_0x3ec3c2(0x1aa)]['apps']==='object'?_0x5a022['projectConfig'][_0x3ec3c2(0x1ad)]:{};!Object[_0x3ec3c2(0x195)][_0x3ec3c2(0x1b1)][_0x3ec3c2(0x1b8)](_0x4a3746,_0x50b62e)&&(_0x25b290=_0x3ec3c2(0x1a8)+_0x50b62e+'\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.');}}const _0x34d301=readConfig(_0x1899f1);return _0x34d301[_0x3ec3c2(0x1b6)]=_0x50b62e,writeConfig(_0x34d301,_0x1899f1),{'ok':!![],'message':_0x3ec3c2(0x1af)+_0x50b62e+_0x3ec3c2(0x1b5)+_0x4076d7[_0x50b62e][_0x3ec3c2(0x1ae)]+')'+scopeLabel(_0x1899f1)+_0x25b290};}export const appUseDefinition={'service':a104_0xd01a35(0x19c),'command':'use','description':'Switch\x20the\x20default\x20app','risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a104_0xd01a35(0x1a2),'description':a104_0xd01a35(0x1b4),'required':!![]}],'flags':[{'name':a104_0xd01a35(0x1a0),'type':a104_0xd01a35(0x199),'description':a104_0xd01a35(0x1a7),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- const a25_0x133bfb=a25_0x4880;function a25_0x4880(_0x4fdd54,_0x1f4b87){_0x4fdd54=_0x4fdd54-0x1a4;const _0x2ae333=a25_0x2ae3();let _0x488058=_0x2ae333[_0x4fdd54];return _0x488058;}function a25_0x2ae3(){const _0x13bbe2=['208472QXwdhP','178uiUlhD','393096zxQjcp','✓\x20Logged\x20out','173385aHjTlp','361375rIqGDX','235102nQUBdM','log','login','auth','Clear\x20login\x20session','!\x20Not\x20logged\x20in','logout','4149GMdWWH','16cpjkTL','444520qvXvRg'];a25_0x2ae3=function(){return _0x13bbe2;};return a25_0x2ae3();}(function(_0x23caab,_0x43804b){const _0x20cbe9=a25_0x4880,_0x46a6c2=_0x23caab();while(!![]){try{const _0x498cbf=parseInt(_0x20cbe9(0x1b0))/0x1+-parseInt(_0x20cbe9(0x1ab))/0x2*(parseInt(_0x20cbe9(0x1a7))/0x3)+parseInt(_0x20cbe9(0x1aa))/0x4+-parseInt(_0x20cbe9(0x1a9))/0x5+parseInt(_0x20cbe9(0x1ac))/0x6+parseInt(_0x20cbe9(0x1af))/0x7+-parseInt(_0x20cbe9(0x1a8))/0x8*(parseInt(_0x20cbe9(0x1ae))/0x9);if(_0x498cbf===_0x43804b)break;else _0x46a6c2['push'](_0x46a6c2['shift']());}catch(_0x44b291){_0x46a6c2['push'](_0x46a6c2['shift']());}}}(a25_0x2ae3,0x258f0));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a25_0x133bfb(0x1b3),'command':a25_0x133bfb(0x1b2),'description':'Login\x20via\x20browser','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xa36781){const {runAuthServer:_0x77b3e1}=await import('../../auth/auth-server-ui.js');return await _0x77b3e1(),{'ok':!![]};}},{'service':a25_0x133bfb(0x1b3),'command':a25_0x133bfb(0x1a6),'description':a25_0x133bfb(0x1a4),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x230aa2){const _0x4ad1f4=a25_0x133bfb;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x4ad1f4(0x1b1)](_0x4ad1f4(0x1ad))):console['log'](_0x4ad1f4(0x1a5)),{'ok':!![]};}}];
1
+ const a91_0x2eb9f2=a91_0x5f33;function a91_0x57a5(){const _0x3ae179=['Login\x20via\x20browser','auth','17wAMWRT','read','Clear\x20login\x20session','2396115uWSYVj','1296856luwPYu','121uzgHuK','log','✓\x20Logged\x20out','33914OOYxUj','../../auth/auth-server-ui.js','309648aiUSqV','write','6SjRtaS','1155470TuiqBZ','691016NpGWIl','587925xSQaqw','56fGAmTx'];a91_0x57a5=function(){return _0x3ae179;};return a91_0x57a5();}(function(_0x33dbb4,_0x632d3a){const _0x10c4e5=a91_0x5f33,_0x32248d=_0x33dbb4();while(!![]){try{const _0x28720c=-parseInt(_0x10c4e5(0xa0))/0x1*(parseInt(_0x10c4e5(0x95))/0x2)+parseInt(_0x10c4e5(0x99))/0x3*(-parseInt(_0x10c4e5(0x9b))/0x4)+parseInt(_0x10c4e5(0x9c))/0x5+-parseInt(_0x10c4e5(0x97))/0x6*(parseInt(_0x10c4e5(0x9d))/0x7)+parseInt(_0x10c4e5(0x91))/0x8+-parseInt(_0x10c4e5(0x90))/0x9+-parseInt(_0x10c4e5(0x9a))/0xa*(-parseInt(_0x10c4e5(0x92))/0xb);if(_0x28720c===_0x632d3a)break;else _0x32248d['push'](_0x32248d['shift']());}catch(_0x25f7ad){_0x32248d['push'](_0x32248d['shift']());}}}(a91_0x57a5,0x3a109));import{unlinkSync,existsSync}from'node:fs';function a91_0x5f33(_0x1ec9df,_0x23f385){_0x1ec9df=_0x1ec9df-0x8e;const _0x57a578=a91_0x57a5();let _0x5f33e9=_0x57a578[_0x1ec9df];return _0x5f33e9;}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a91_0x2eb9f2(0x9f),'command':'login','description':a91_0x2eb9f2(0x9e),'risk':a91_0x2eb9f2(0x8e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xd563e5){const _0x1b5f85=a91_0x2eb9f2,{runAuthServer:_0x4e95c7}=await import(_0x1b5f85(0x96));return await _0x4e95c7(),{'ok':!![]};}},{'service':a91_0x2eb9f2(0x9f),'command':'logout','description':a91_0x2eb9f2(0x8f),'risk':a91_0x2eb9f2(0x98),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x225c8d){const _0xea000b=a91_0x2eb9f2;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0xea000b(0x93)](_0xea000b(0x94))):console[_0xea000b(0x93)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a26_0x5d1618=a26_0x567b;(function(_0x3e700b,_0x48c972){const _0x512d6a=a26_0x567b,_0x1179b4=_0x3e700b();while(!![]){try{const _0x235ced=parseInt(_0x512d6a(0xd7))/0x1+parseInt(_0x512d6a(0xed))/0x2+-parseInt(_0x512d6a(0xda))/0x3+parseInt(_0x512d6a(0xf8))/0x4*(parseInt(_0x512d6a(0xe6))/0x5)+-parseInt(_0x512d6a(0xe2))/0x6*(-parseInt(_0x512d6a(0xe1))/0x7)+parseInt(_0x512d6a(0xd4))/0x8+-parseInt(_0x512d6a(0xdd))/0x9;if(_0x235ced===_0x48c972)break;else _0x1179b4['push'](_0x1179b4['shift']());}catch(_0x20cb22){_0x1179b4['push'](_0x1179b4['shift']());}}}(a26_0x5aea,0x1d457));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';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':a26_0x5d1618(0xd9),'command':a26_0x5d1618(0xe8),'description':a26_0x5d1618(0xd2),'risk':a26_0x5d1618(0xd3),'flags':[{'name':a26_0x5d1618(0xe0),'type':a26_0x5d1618(0xe3),'required':!![],'description':a26_0x5d1618(0xdf)}],async 'validate'(_0x4adedb){const _0x30940d=a26_0x5d1618,_0x3242d0=loadBffProjectConfig(_0x4adedb['appCode']),_0x38137a=await readBffLockFile(_0x3242d0[_0x30940d(0xf1)]);if(!_0x38137a)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x170c22){const _0x162b52=a26_0x5d1618,_0x23c324=loadBffProjectConfig(_0x170c22[_0x162b52(0xf6)]),_0x142454=await readBffLockFile(_0x23c324[_0x162b52(0xf1)]);if(!_0x142454)throw CliErrors['validation'](_0x162b52(0xde));const {appLock:_0x1ee361}=ensureLockScope(_0x142454,_0x170c22['appCode'],_0x23c324[_0x162b52(0xd8)],_0x162b52(0xe8)),_0x40b6e8=_0x170c22[_0x162b52(0xfa)](_0x162b52(0xe0)),_0x2691e2=Object['keys'](_0x1ee361['functions']),_0x328a4a=resolveDeleteTarget(_0x40b6e8,_0x2691e2),_0x49d264=_0x1ee361[_0x162b52(0xd0)][_0x328a4a];if(!_0x49d264)throw CliErrors[_0x162b52(0xf2)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x328a4a+'\x22.');const _0x4d0cfd=resolveLocalFilePathFromLockKey(_0x23c324,_0x328a4a),_0x220204=relative(_0x23c324[_0x162b52(0xee)],_0x4d0cfd),_0x1b24ed=join(_0x23c324[_0x162b52(0xd5)],_0x162b52(0xdc),_0x220204);return{'method':_0x162b52(0xe7),'url':_0x162b52(0xea),'body':{'appCode':_0x170c22[_0x162b52(0xf6)],'target':_0x328a4a,'remoteId':_0x49d264[_0x162b52(0xf4)],'localFilePath':_0x4d0cfd,'trashedPath':_0x1b24ed},'description':_0x162b52(0xf5)+_0x328a4a+_0x162b52(0xef)};},async 'execute'(_0xac65f0){const _0x25a580=a26_0x5d1618,_0x3aa4b0=loadBffProjectConfig(_0xac65f0[_0x25a580(0xf6)]),_0x5be9ba=await readBffLockFile(_0x3aa4b0['lockFilePath']);if(!_0x5be9ba)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x505862,appLock:_0x29f812}=ensureLockScope(_0x5be9ba,_0xac65f0[_0x25a580(0xf6)],_0x3aa4b0[_0x25a580(0xd8)],_0x25a580(0xe8)),_0x3fe137=_0xac65f0[_0x25a580(0xfa)](_0x25a580(0xe0)),_0x2edeed=Object[_0x25a580(0xeb)](_0x29f812['functions']),_0x4c449b=resolveDeleteTarget(_0x3fe137,_0x2edeed),_0x578d29=_0x29f812[_0x25a580(0xd0)][_0x4c449b];if(!_0x578d29)throw CliErrors[_0x25a580(0xf2)](_0x25a580(0xf3)+_0x4c449b+'\x22.');await deleteBffScript(_0x578d29[_0x25a580(0xf4)]),delete _0x29f812[_0x25a580(0xd0)][_0x4c449b],_0x29f812[_0x25a580(0xd1)]=new Date()[_0x25a580(0xe4)](),await writeBffLockFile(_0x3aa4b0[_0x25a580(0xf1)],_0x505862);const _0x1320fa=resolveLocalFilePathFromLockKey(_0x3aa4b0,_0x4c449b);let _0x3c43a8;await fileExists(_0x1320fa)&&(_0x3c43a8=await moveToTrash(_0x3aa4b0[_0x25a580(0xee)],_0x3aa4b0[_0x25a580(0xd5)],_0x1320fa),await cleanupEmptyDirectories(dirname(_0x1320fa),_0x3aa4b0['scriptsRootDir']));const _0x13c4c2={'deleted':_0x4c449b,'remoteId':_0x578d29[_0x25a580(0xf4)]};if(_0x3c43a8)_0x13c4c2['trashedTo']=_0x3c43a8;return{'ok':!![],'data':_0x13c4c2,'message':'Deleted\x20'+_0x4c449b+(_0x3c43a8?_0x25a580(0xdb):'')};}};function a26_0x567b(_0x847b3c,_0x553bc8){_0x847b3c=_0x847b3c-0xcf;const _0x5aea65=a26_0x5aea();let _0x567bbf=_0x5aea65[_0x847b3c];return _0x567bbf;}function a26_0x5aea(){const _0x47e34e=['scriptsRoot','bff','575316LEzHdY','\x20(local\x20file\x20moved\x20to\x20trash)','<timestamp>','3878190lugvBw','BFF\x20lock\x20file\x20not\x20found.','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','target','203oIpmnl','43302YsZbbS','string','toISOString','\x20\x20-\x20','90cunJvi','POST','delete','map','/api/management/library/scripts/delete','keys','startsWith','472664HuYmOB','projectRoot','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','length','lockFilePath','validation','No\x20lock\x20entry\x20found\x20for\x20\x22','remoteId','Would\x20delete\x20','appCode','includes','24988FPbNTa','replace','str','join','Multiple\x20functions\x20match\x20\x22','functions','lastSync','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','high-risk-write','198144YEXwJr','trashDir','Function\x20not\x20found:\x20','159738YwTNjP'];a26_0x5aea=function(){return _0x47e34e;};return a26_0x5aea();}function resolveDeleteTarget(_0x2a3fd2,_0x3adb09){const _0x26d31a=a26_0x5d1618;if(_0x2a3fd2[_0x26d31a(0xf7)]('/')){const _0x4846fa=_0x3adb09['find'](_0x3ae613=>_0x3ae613===_0x2a3fd2);if(!_0x4846fa)throw CliErrors[_0x26d31a(0xf2)](_0x26d31a(0xd6)+_0x2a3fd2);return _0x4846fa;}const _0x21e5e7=_0x3adb09['filter'](_0x4b6f28=>_0x4b6f28['split']('/')['at'](-0x1)===_0x2a3fd2);if(_0x21e5e7['length']===0x0)throw CliErrors[_0x26d31a(0xf2)]('Function\x20not\x20found:\x20'+_0x2a3fd2);if(_0x21e5e7[_0x26d31a(0xf0)]>0x1)throw CliErrors[_0x26d31a(0xf2)](_0x26d31a(0xcf)+_0x2a3fd2+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x21e5e7[_0x26d31a(0xe9)](_0x444592=>_0x26d31a(0xe5)+_0x444592)[_0x26d31a(0xfb)]('\x0a'));return _0x21e5e7[0x0];}async function moveToTrash(_0x197d60,_0x532d83,_0x17edb5){const _0xf0cc4=a26_0x5d1618,_0xcf9806=new Date()['toISOString']()[_0xf0cc4(0xf9)](/[:.]/g,'-'),_0x13c949=relative(_0x197d60,_0x17edb5),_0x1dce31=join(_0x532d83,_0xcf9806,_0x13c949);return await mkdir(dirname(_0x1dce31),{'recursive':!![]}),await rename(_0x17edb5,_0x1dce31),_0x1dce31;}async function cleanupEmptyDirectories(_0x3b00c6,_0x4f0cfd){const _0x55ed22=a26_0x5d1618;let _0x1d7cb8=resolve(_0x3b00c6);const _0x1cdb96=resolve(_0x4f0cfd);while(_0x1d7cb8[_0x55ed22(0xec)](''+_0x1cdb96+sep)||_0x1d7cb8===_0x1cdb96){if(_0x1d7cb8===_0x1cdb96)return;try{const _0x53c340=await readdir(_0x1d7cb8);if(_0x53c340[_0x55ed22(0xf0)]>0x0)return;await rmdir(_0x1d7cb8);}catch{return;}_0x1d7cb8=dirname(_0x1d7cb8);}}
1
+ const a69_0x3ac8e3=a69_0x4727;(function(_0x309b62,_0x33672c){const _0x467d12=a69_0x4727,_0x122057=_0x309b62();while(!![]){try{const _0x2fa61b=-parseInt(_0x467d12(0x87))/0x1+parseInt(_0x467d12(0x77))/0x2+parseInt(_0x467d12(0x81))/0x3*(-parseInt(_0x467d12(0x70))/0x4)+-parseInt(_0x467d12(0x94))/0x5*(-parseInt(_0x467d12(0x6d))/0x6)+parseInt(_0x467d12(0x74))/0x7*(parseInt(_0x467d12(0x8a))/0x8)+parseInt(_0x467d12(0x6a))/0x9*(parseInt(_0x467d12(0x80))/0xa)+-parseInt(_0x467d12(0x71))/0xb;if(_0x2fa61b===_0x33672c)break;else _0x122057['push'](_0x122057['shift']());}catch(_0x2696de){_0x122057['push'](_0x122057['shift']());}}}(a69_0x50f9,0xccc23));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';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';function a69_0x4727(_0x23e7e4,_0x6f3720){_0x23e7e4=_0x23e7e4-0x6a;const _0x50f9b3=a69_0x50f9();let _0x4727a7=_0x50f9b3[_0x23e7e4];return _0x4727a7;}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';function a69_0x50f9(){const _0x310ec1=['\x20\x20-\x20','Multiple\x20functions\x20match\x20\x22','9426263rVYyeY','delete','Deleted\x20','1688706ZNYdQE','high-risk-write','Would\x20delete\x20','keys','\x20(local\x20file\x20moved\x20to\x20trash)','Function\x20not\x20found:\x20','lockFilePath','toISOString','/api/management/library/scripts/delete','278230RZQbdW','1530954cwjUDq','replace','No\x20lock\x20entry\x20found\x20for\x20\x22','length','scriptsRoot','<timestamp>','1222094MtTDSB','functions','BFF\x20lock\x20file\x20not\x20found.','8WrvmWz','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','includes','split','appCode','scriptsRootDir','POST','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','startsWith','map','133645GNzkFz','filter','bff','str','trashedTo','join','remoteId','string','279nQYlny','trashDir','projectRoot','174FKyNTm','validation','target','4GhbweK','13832643dXmgHw'];a69_0x50f9=function(){return _0x310ec1;};return a69_0x50f9();}export const bffDelete={'service':a69_0x3ac8e3(0x96),'command':a69_0x3ac8e3(0x75),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a69_0x3ac8e3(0x78),'flags':[{'name':'target','type':a69_0x3ac8e3(0x9b),'required':!![],'description':a69_0x3ac8e3(0x91)}],async 'validate'(_0x31b048){const _0x1a3d0c=a69_0x3ac8e3,_0x46024c=loadBffProjectConfig(_0x31b048[_0x1a3d0c(0x8e)]),_0x57c541=await readBffLockFile(_0x46024c[_0x1a3d0c(0x7d)]);if(!_0x57c541)throw CliErrors[_0x1a3d0c(0x6e)]('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x344dd5){const _0x461b92=a69_0x3ac8e3,_0x7bb39b=loadBffProjectConfig(_0x344dd5['appCode']),_0x116654=await readBffLockFile(_0x7bb39b[_0x461b92(0x7d)]);if(!_0x116654)throw CliErrors['validation'](_0x461b92(0x89));const {appLock:_0x170d56}=ensureLockScope(_0x116654,_0x344dd5['appCode'],_0x7bb39b[_0x461b92(0x85)],_0x461b92(0x75)),_0x333a3d=_0x344dd5[_0x461b92(0x97)](_0x461b92(0x6f)),_0x3b6310=Object['keys'](_0x170d56[_0x461b92(0x88)]),_0x219709=resolveDeleteTarget(_0x333a3d,_0x3b6310),_0x2fe080=_0x170d56[_0x461b92(0x88)][_0x219709];if(!_0x2fe080)throw CliErrors[_0x461b92(0x6e)](_0x461b92(0x83)+_0x219709+'\x22.');const _0x3141a4=resolveLocalFilePathFromLockKey(_0x7bb39b,_0x219709),_0x1ef658=relative(_0x7bb39b['projectRoot'],_0x3141a4),_0x1ea110=join(_0x7bb39b[_0x461b92(0x6b)],_0x461b92(0x86),_0x1ef658);return{'method':_0x461b92(0x90),'url':_0x461b92(0x7f),'body':{'appCode':_0x344dd5[_0x461b92(0x8e)],'target':_0x219709,'remoteId':_0x2fe080['remoteId'],'localFilePath':_0x3141a4,'trashedPath':_0x1ea110},'description':_0x461b92(0x79)+_0x219709+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x2d6e2d){const _0x3d5297=a69_0x3ac8e3,_0x7dde0=loadBffProjectConfig(_0x2d6e2d[_0x3d5297(0x8e)]),_0x332c64=await readBffLockFile(_0x7dde0[_0x3d5297(0x7d)]);if(!_0x332c64)throw CliErrors['validation'](_0x3d5297(0x89));const {lockData:_0x32b99f,appLock:_0x21754c}=ensureLockScope(_0x332c64,_0x2d6e2d[_0x3d5297(0x8e)],_0x7dde0[_0x3d5297(0x85)],_0x3d5297(0x75)),_0x547bb7=_0x2d6e2d[_0x3d5297(0x97)](_0x3d5297(0x6f)),_0x309f1c=Object[_0x3d5297(0x7a)](_0x21754c[_0x3d5297(0x88)]),_0x1159d3=resolveDeleteTarget(_0x547bb7,_0x309f1c),_0x189d21=_0x21754c[_0x3d5297(0x88)][_0x1159d3];if(!_0x189d21)throw CliErrors['validation'](_0x3d5297(0x83)+_0x1159d3+'\x22.');await deleteBffScript(_0x189d21[_0x3d5297(0x9a)]),delete _0x21754c['functions'][_0x1159d3],_0x21754c['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x7dde0[_0x3d5297(0x7d)],_0x32b99f);const _0x33429e=resolveLocalFilePathFromLockKey(_0x7dde0,_0x1159d3);let _0x1765ee;await fileExists(_0x33429e)&&(_0x1765ee=await moveToTrash(_0x7dde0[_0x3d5297(0x6c)],_0x7dde0['trashDir'],_0x33429e),await cleanupEmptyDirectories(dirname(_0x33429e),_0x7dde0[_0x3d5297(0x8f)]));const _0x3cb783={'deleted':_0x1159d3,'remoteId':_0x189d21[_0x3d5297(0x9a)]};if(_0x1765ee)_0x3cb783[_0x3d5297(0x98)]=_0x1765ee;return{'ok':!![],'data':_0x3cb783,'message':_0x3d5297(0x76)+_0x1159d3+(_0x1765ee?_0x3d5297(0x7b):'')};}};function resolveDeleteTarget(_0x46efc0,_0x277c0d){const _0x4a063b=a69_0x3ac8e3;if(_0x46efc0[_0x4a063b(0x8c)]('/')){const _0x13082e=_0x277c0d['find'](_0x4e94eb=>_0x4e94eb===_0x46efc0);if(!_0x13082e)throw CliErrors['validation'](_0x4a063b(0x7c)+_0x46efc0);return _0x13082e;}const _0x43e346=_0x277c0d[_0x4a063b(0x95)](_0x5efa5e=>_0x5efa5e[_0x4a063b(0x8d)]('/')['at'](-0x1)===_0x46efc0);if(_0x43e346['length']===0x0)throw CliErrors[_0x4a063b(0x6e)](_0x4a063b(0x7c)+_0x46efc0);if(_0x43e346['length']>0x1)throw CliErrors[_0x4a063b(0x6e)](_0x4a063b(0x73)+_0x46efc0+_0x4a063b(0x8b)+_0x43e346[_0x4a063b(0x93)](_0x1c1f68=>_0x4a063b(0x72)+_0x1c1f68)[_0x4a063b(0x99)]('\x0a'));return _0x43e346[0x0];}async function moveToTrash(_0x448e5a,_0x1d3e53,_0xf5779b){const _0x2c607f=a69_0x3ac8e3,_0x4684bf=new Date()[_0x2c607f(0x7e)]()[_0x2c607f(0x82)](/[:.]/g,'-'),_0x4a89b7=relative(_0x448e5a,_0xf5779b),_0x5a9be3=join(_0x1d3e53,_0x4684bf,_0x4a89b7);return await mkdir(dirname(_0x5a9be3),{'recursive':!![]}),await rename(_0xf5779b,_0x5a9be3),_0x5a9be3;}async function cleanupEmptyDirectories(_0xb800e9,_0x538cab){const _0x4bff85=a69_0x3ac8e3;let _0x3fa62a=resolve(_0xb800e9);const _0x1a66bd=resolve(_0x538cab);while(_0x3fa62a[_0x4bff85(0x92)](''+_0x1a66bd+sep)||_0x3fa62a===_0x1a66bd){if(_0x3fa62a===_0x1a66bd)return;try{const _0x5d77c0=await readdir(_0x3fa62a);if(_0x5d77c0[_0x4bff85(0x84)]>0x0)return;await rmdir(_0x3fa62a);}catch{return;}_0x3fa62a=dirname(_0x3fa62a);}}
@@ -1 +1 @@
1
- const a27_0x8e0d88=a27_0x5124;(function(_0x4aa51f,_0x116614){const _0x1f1d64=a27_0x5124,_0x441df0=_0x4aa51f();while(!![]){try{const _0x1e185a=parseInt(_0x1f1d64(0x119))/0x1+parseInt(_0x1f1d64(0x116))/0x2*(-parseInt(_0x1f1d64(0x11f))/0x3)+-parseInt(_0x1f1d64(0x10c))/0x4+-parseInt(_0x1f1d64(0x10a))/0x5*(-parseInt(_0x1f1d64(0x115))/0x6)+-parseInt(_0x1f1d64(0x111))/0x7*(parseInt(_0x1f1d64(0x121))/0x8)+-parseInt(_0x1f1d64(0x117))/0x9+parseInt(_0x1f1d64(0x11e))/0xa;if(_0x1e185a===_0x116614)break;else _0x441df0['push'](_0x441df0['shift']());}catch(_0x615b5b){_0x441df0['push'](_0x441df0['shift']());}}}(a27_0xcc9e,0xccbad));function a27_0xcc9e(){const _0x2b3308=['7615RSzSLk','boolean','3234844CfRiOu','Return\x20full\x20raw\x20script\x20object','createdTime','updatedTime','Script\x20ID','56kBCFAP','num','verbose','bool','6390aHfINP','12162GOuMaE','14849397svoXWs','appCode','602882dspCGF','Get\x20BFF\x20script\x20details\x20by\x20ID','scriptType','bff','(none)','30160060StQPyI','606eSzfRR','read','715304DYAVPu'];a27_0xcc9e=function(){return _0x2b3308;};return a27_0xcc9e();}function a27_0x5124(_0x5b7009,_0x2b6184){_0x5b7009=_0x5b7009-0x10a;const _0xcc9eee=a27_0xcc9e();let _0x51249b=_0xcc9eee[_0x5b7009];return _0x51249b;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a27_0x8e0d88(0x11c),'command':'detail','description':a27_0x8e0d88(0x11a),'risk':a27_0x8e0d88(0x120),'flags':[{'name':'id','type':'number','required':!![],'description':a27_0x8e0d88(0x110)},{'name':a27_0x8e0d88(0x113),'type':a27_0x8e0d88(0x10b),'description':a27_0x8e0d88(0x10d)}],async 'execute'(_0x3c65b5){const _0x4dd815=a27_0x8e0d88,_0x311008=await getBffScriptInfo(_0x3c65b5[_0x4dd815(0x112)]('id')),_0x3c4104=_0x3c65b5[_0x4dd815(0x114)]('verbose');if(_0x3c4104)return{'ok':!![],'data':_0x311008};return{'ok':!![],'data':{'id':_0x311008['id'],'appCode':_0x311008[_0x4dd815(0x118)],'scriptType':_0x311008[_0x4dd815(0x11b)],'description':_0x311008['description']||_0x4dd815(0x11d),'createdTime':_0x311008[_0x4dd815(0x10e)]??'','updatedTime':_0x311008[_0x4dd815(0x10f)]??'','scriptContent':_0x311008['scriptContent']??''}};}};
1
+ const a74_0x4ae69c=a74_0x391e;function a74_0x391e(_0x2f2b0a,_0x34b8f9){_0x2f2b0a=_0x2f2b0a-0x15a;const _0x5f2fe7=a74_0x5f2f();let _0x391e9d=_0x5f2fe7[_0x2f2b0a];return _0x391e9d;}function a74_0x5f2f(){const _0x3506b2=['741208EQEIaC','number','detail','updatedTime','1461252DjtQyW','boolean','4939800LThYPs','2JrwPme','1407769YWxflg','bff','scriptType','1478166qSGvub','appCode','Script\x20ID','verbose','264136GBzGTM','Return\x20full\x20raw\x20script\x20object','Get\x20BFF\x20script\x20details\x20by\x20ID','description','2553210HKLHCU','(none)','scriptContent','133voGOfC','bool'];a74_0x5f2f=function(){return _0x3506b2;};return a74_0x5f2f();}(function(_0x228df6,_0xb5e548){const _0x6ba0f1=a74_0x391e,_0x451168=_0x228df6();while(!![]){try{const _0x1e4fc3=parseInt(_0x6ba0f1(0x15e))/0x1*(parseInt(_0x6ba0f1(0x15d))/0x2)+-parseInt(_0x6ba0f1(0x15a))/0x3+parseInt(_0x6ba0f1(0x16e))/0x4+-parseInt(_0x6ba0f1(0x15c))/0x5+parseInt(_0x6ba0f1(0x161))/0x6+parseInt(_0x6ba0f1(0x16c))/0x7*(parseInt(_0x6ba0f1(0x165))/0x8)+-parseInt(_0x6ba0f1(0x169))/0x9;if(_0x1e4fc3===_0xb5e548)break;else _0x451168['push'](_0x451168['shift']());}catch(_0x2c0662){_0x451168['push'](_0x451168['shift']());}}}(a74_0x5f2f,0xacdb5));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a74_0x4ae69c(0x15f),'command':a74_0x4ae69c(0x170),'description':a74_0x4ae69c(0x167),'risk':'read','flags':[{'name':'id','type':a74_0x4ae69c(0x16f),'required':!![],'description':a74_0x4ae69c(0x163)},{'name':a74_0x4ae69c(0x164),'type':a74_0x4ae69c(0x15b),'description':a74_0x4ae69c(0x166)}],async 'execute'(_0x12c30d){const _0x3da3d8=a74_0x4ae69c,_0x57e186=await getBffScriptInfo(_0x12c30d['num']('id')),_0x227ded=_0x12c30d[_0x3da3d8(0x16d)](_0x3da3d8(0x164));if(_0x227ded)return{'ok':!![],'data':_0x57e186};return{'ok':!![],'data':{'id':_0x57e186['id'],'appCode':_0x57e186[_0x3da3d8(0x162)],'scriptType':_0x57e186[_0x3da3d8(0x160)],'description':_0x57e186[_0x3da3d8(0x168)]||_0x3da3d8(0x16a),'createdTime':_0x57e186['createdTime']??'','updatedTime':_0x57e186[_0x3da3d8(0x171)]??'','scriptContent':_0x57e186[_0x3da3d8(0x16b)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x1dd5c7,_0x1ee47d){const _0x12a2c4=a28_0x40e9,_0x3a1163=_0x1dd5c7();while(!![]){try{const _0x2adf0b=-parseInt(_0x12a2c4(0x1df))/0x1+parseInt(_0x12a2c4(0x1e0))/0x2+parseInt(_0x12a2c4(0x1e5))/0x3+-parseInt(_0x12a2c4(0x1e2))/0x4*(parseInt(_0x12a2c4(0x1e1))/0x5)+-parseInt(_0x12a2c4(0x1e3))/0x6*(parseInt(_0x12a2c4(0x1de))/0x7)+parseInt(_0x12a2c4(0x1e6))/0x8*(-parseInt(_0x12a2c4(0x1dd))/0x9)+-parseInt(_0x12a2c4(0x1e4))/0xa;if(_0x2adf0b===_0x1ee47d)break;else _0x3a1163['push'](_0x3a1163['shift']());}catch(_0xda8a65){_0x3a1163['push'](_0x3a1163['shift']());}}}(a28_0x6e4c,0x4520c));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a28_0x40e9(_0x17a1c8,_0xfd9853){_0x17a1c8=_0x17a1c8-0x1dd;const _0x6e4c20=a28_0x6e4c();let _0x40e983=_0x6e4c20[_0x17a1c8];return _0x40e983;}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];function a28_0x6e4c(){const _0x102341=['938OORpDS','401433EBFRmY','966018hmBdzU','95kVZpQd','7276mPRPCs','942OkJaWS','53280hmVQJV','1203741TeqpiV','32mjnQHJ','312183ubdlGF'];a28_0x6e4c=function(){return _0x102341;};return a28_0x6e4c();}
1
+ function a73_0xf50c(_0x2b6174,_0xdc7d51){_0x2b6174=_0x2b6174-0x1de;const _0x431be0=a73_0x431b();let _0xf50cc9=_0x431be0[_0x2b6174];return _0xf50cc9;}function a73_0x431b(){const _0xd15ea=['2616273qevGue','482322TGmDyT','31764amcbPT','10ZaMpbM','272289HgewSS','7vLiUOL','112DYFJkH','512432GpqlhY','2290240gpYWxj','381925gElPYQ'];a73_0x431b=function(){return _0xd15ea;};return a73_0x431b();}(function(_0x43d653,_0x44cf5e){const _0x2eb077=a73_0xf50c,_0x40a2ca=_0x43d653();while(!![]){try{const _0x458d3c=parseInt(_0x2eb077(0x1e2))/0x1+-parseInt(_0x2eb077(0x1e5))/0x2+-parseInt(_0x2eb077(0x1e0))/0x3*(-parseInt(_0x2eb077(0x1e4))/0x4)+-parseInt(_0x2eb077(0x1e7))/0x5+parseInt(_0x2eb077(0x1df))/0x6*(-parseInt(_0x2eb077(0x1e3))/0x7)+-parseInt(_0x2eb077(0x1e6))/0x8+parseInt(_0x2eb077(0x1de))/0x9*(parseInt(_0x2eb077(0x1e1))/0xa);if(_0x458d3c===_0x44cf5e)break;else _0x40a2ca['push'](_0x40a2ca['shift']());}catch(_0x58d9b8){_0x40a2ca['push'](_0x40a2ca['shift']());}}}(a73_0x431b,0x271b6));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a29_0x5e68ec=a29_0xdb72;(function(_0x44cc8e,_0x2dd339){const _0x10da95=a29_0xdb72,_0x312ad8=_0x44cc8e();while(!![]){try{const _0x2aa5de=parseInt(_0x10da95(0xc3))/0x1*(parseInt(_0x10da95(0xa9))/0x2)+-parseInt(_0x10da95(0xbb))/0x3*(parseInt(_0x10da95(0xc5))/0x4)+-parseInt(_0x10da95(0xb2))/0x5+-parseInt(_0x10da95(0xb8))/0x6*(parseInt(_0x10da95(0xa7))/0x7)+-parseInt(_0x10da95(0xbf))/0x8*(-parseInt(_0x10da95(0xb7))/0x9)+-parseInt(_0x10da95(0xb0))/0xa+parseInt(_0x10da95(0xba))/0xb;if(_0x2aa5de===_0x2dd339)break;else _0x312ad8['push'](_0x312ad8['shift']());}catch(_0x52c460){_0x312ad8['push'](_0x312ad8['shift']());}}}(a29_0x1705,0x7d2d0));import{listBffScripts}from'../../core/api-client.js';function a29_0xdb72(_0x41fb24,_0x1d8e06){_0x41fb24=_0x41fb24-0xa6;const _0x1705b6=a29_0x1705();let _0xdb72bd=_0x1705b6[_0x41fb24];return _0xdb72bd;}export const bffList={'service':a29_0x5e68ec(0xa6),'command':a29_0x5e68ec(0xb4),'description':a29_0x5e68ec(0xc1),'risk':'read','flags':[{'name':a29_0x5e68ec(0xbe),'type':a29_0x5e68ec(0xbc),'description':a29_0x5e68ec(0xac),'default':'ENDPOINT','enum':[a29_0x5e68ec(0xb1),a29_0x5e68ec(0xc0)]},{'name':a29_0x5e68ec(0xc2),'type':'string','description':a29_0x5e68ec(0xb5)},{'name':a29_0x5e68ec(0xb3),'type':a29_0x5e68ec(0xad),'description':a29_0x5e68ec(0xae)}],async 'execute'(_0x66ca80){const _0x206c71=a29_0x5e68ec,_0x111326=await listBffScripts(_0x66ca80[_0x206c71(0xab)],_0x66ca80[_0x206c71(0xb6)](_0x206c71(0xbe)),{'scriptName':_0x66ca80[_0x206c71(0xb6)](_0x206c71(0xc2))||undefined}),_0x36945d=_0x66ca80[_0x206c71(0xb9)](_0x206c71(0xb3));return{'ok':!![],'data':_0x36945d?_0x111326:_0x111326[_0x206c71(0xaa)](_0x2f0478=>({'id':_0x2f0478['id'],'functionName':_0x2f0478[_0x206c71(0xa8)]??'','description':_0x2f0478[_0x206c71(0xaf)]||_0x206c71(0xc4),'scriptType':_0x2f0478['scriptType']})),'message':_0x111326[_0x206c71(0xbd)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};function a29_0x1705(){const _0x234597=['verbose','list','Filter\x20by\x20script\x20name','str','126HFZdEY','24iWiSAS','bool','17689551YYSfSd','2951433wFNoTM','string','length','type','499768EbzUAW','COMMON','List\x20BFF\x20scripts','name','1WkfNCQ','(unnamed)','4eYvpQK','bff','204869tvTrCH','functionName','229946DikPDO','map','appCode','Script\x20type\x20filter','boolean','Return\x20full\x20script\x20objects','description','1820010jPzsoz','ENDPOINT','4010540vThDwa'];a29_0x1705=function(){return _0x234597;};return a29_0x1705();}
1
+ const a72_0x35d8c1=a72_0x450a;function a72_0x2175(){const _0x5430d3=['2274205KChNhl','104AsxujS','4592844qoIEiG','length','1952832klqJEn','COMMON','670qQCPbU','592011VejrKu','174EedpWo','map','32068rXxZNP','No\x20BFF\x20scripts\x20found.','Return\x20full\x20script\x20objects','Filter\x20by\x20script\x20name','ENDPOINT','appCode','functionName','boolean','3944840ibDlMc','scriptType','description','string','138UchdeX','read','type','name','str'];a72_0x2175=function(){return _0x5430d3;};return a72_0x2175();}(function(_0x4d9d48,_0x4b4804){const _0xafa94b=a72_0x450a,_0x16033e=_0x4d9d48();while(!![]){try{const _0x14d932=parseInt(_0xafa94b(0xc1))/0x1*(-parseInt(_0xafa94b(0xd1))/0x2)+parseInt(_0xafa94b(0xc3))/0x3*(-parseInt(_0xafa94b(0xc5))/0x4)+-parseInt(_0xafa94b(0xd6))/0x5+parseInt(_0xafa94b(0xda))/0x6+-parseInt(_0xafa94b(0xc2))/0x7*(-parseInt(_0xafa94b(0xd7))/0x8)+parseInt(_0xafa94b(0xd8))/0x9+-parseInt(_0xafa94b(0xcd))/0xa;if(_0x14d932===_0x4b4804)break;else _0x16033e['push'](_0x16033e['shift']());}catch(_0x44d594){_0x16033e['push'](_0x16033e['shift']());}}}(a72_0x2175,0x8c4e8));import{listBffScripts}from'../../core/api-client.js';function a72_0x450a(_0x26786b,_0x11444a){_0x26786b=_0x26786b-0xc0;const _0x2175e9=a72_0x2175();let _0x450a78=_0x2175e9[_0x26786b];return _0x450a78;}export const bffList={'service':'bff','command':'list','description':'List\x20BFF\x20scripts','risk':a72_0x35d8c1(0xd2),'flags':[{'name':a72_0x35d8c1(0xd3),'type':a72_0x35d8c1(0xd0),'description':'Script\x20type\x20filter','default':a72_0x35d8c1(0xc9),'enum':[a72_0x35d8c1(0xc9),a72_0x35d8c1(0xc0)]},{'name':a72_0x35d8c1(0xd4),'type':a72_0x35d8c1(0xd0),'description':a72_0x35d8c1(0xc8)},{'name':'verbose','type':a72_0x35d8c1(0xcc),'description':a72_0x35d8c1(0xc7)}],async 'execute'(_0x292c22){const _0x2c358c=a72_0x35d8c1,_0x21563d=await listBffScripts(_0x292c22[_0x2c358c(0xca)],_0x292c22[_0x2c358c(0xd5)]('type'),{'scriptName':_0x292c22['str'](_0x2c358c(0xd4))||undefined}),_0x2d68c2=_0x292c22['bool']('verbose');return{'ok':!![],'data':_0x2d68c2?_0x21563d:_0x21563d[_0x2c358c(0xc4)](_0x464056=>({'id':_0x464056['id'],'functionName':_0x464056[_0x2c358c(0xcb)]??'','description':_0x464056[_0x2c358c(0xcf)]||'(unnamed)','scriptType':_0x464056[_0x2c358c(0xce)]})),'message':_0x21563d[_0x2c358c(0xd9)]===0x0?_0x2c358c(0xc6):undefined};}};
@@ -1 +1 @@
1
- const a30_0x5eee9d=a30_0x163a;(function(_0x259a22,_0x14d600){const _0x494b4e=a30_0x163a,_0x30525e=_0x259a22();while(!![]){try{const _0x3dbee9=-parseInt(_0x494b4e(0xba))/0x1+parseInt(_0x494b4e(0x94))/0x2+-parseInt(_0x494b4e(0xd7))/0x3*(-parseInt(_0x494b4e(0x93))/0x4)+parseInt(_0x494b4e(0xcf))/0x5*(parseInt(_0x494b4e(0xc8))/0x6)+-parseInt(_0x494b4e(0xa3))/0x7*(parseInt(_0x494b4e(0xdb))/0x8)+-parseInt(_0x494b4e(0xe0))/0x9*(parseInt(_0x494b4e(0xa1))/0xa)+parseInt(_0x494b4e(0xe2))/0xb*(parseInt(_0x494b4e(0xb3))/0xc);if(_0x3dbee9===_0x14d600)break;else _0x30525e['push'](_0x30525e['shift']());}catch(_0x2023e7){_0x30525e['push'](_0x30525e['shift']());}}}(a30_0x1aa2,0xddc35));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';function a30_0x163a(_0x5b6a31,_0x473605){_0x5b6a31=_0x5b6a31-0x88;const _0x1aa269=a30_0x1aa2();let _0x163a6d=_0x1aa269[_0x5b6a31];return _0x163a6d;}import{resolveApiFilePath}from'../../context.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';export const bffNew={'service':'bff','command':a30_0x5eee9d(0xbf),'description':a30_0x5eee9d(0xe3),'risk':a30_0x5eee9d(0xd5),'flags':[{'name':'type','type':a30_0x5eee9d(0x8a),'required':!![],'enum':['COMMON',a30_0x5eee9d(0x9c),a30_0x5eee9d(0xb8)],'description':a30_0x5eee9d(0xc1)},{'name':a30_0x5eee9d(0xa9),'type':'string','required':!![],'description':a30_0x5eee9d(0xca)},{'name':a30_0x5eee9d(0x91),'type':a30_0x5eee9d(0x8a),'description':a30_0x5eee9d(0xbe)},{'name':a30_0x5eee9d(0xa2),'type':a30_0x5eee9d(0x8a),'description':a30_0x5eee9d(0xdf)},{'name':a30_0x5eee9d(0x95),'type':'string','description':a30_0x5eee9d(0xcd)},{'name':a30_0x5eee9d(0xd1),'type':a30_0x5eee9d(0x8a),'description':a30_0x5eee9d(0xb0)},{'name':a30_0x5eee9d(0xc4),'type':'string','description':a30_0x5eee9d(0xab),'enum':[a30_0x5eee9d(0x99),a30_0x5eee9d(0xd6)]}],async 'validate'(_0x23f910){const _0x77ced4=a30_0x5eee9d,_0x1ebfc8=_0x23f910[_0x77ced4(0xad)]('name');if(!isValidBffFunctionName(_0x1ebfc8))throw CliErrors['validation'](_0x77ced4(0x90)+_0x1ebfc8+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x352d92){const _0x5645df=a30_0x5eee9d,_0x40b2bf=loadBffProjectConfig(_0x352d92[_0x5645df(0xc2)]),_0x4985a4=_0x352d92[_0x5645df(0xad)](_0x5645df(0xda)),_0x4cea2b=_0x352d92[_0x5645df(0xad)]('name'),_0xdf2ca8=_0x352d92['str'](_0x5645df(0x91))||undefined,_0x323d0b=_0x4985a4==='HOOK'?await resolveHookOptions(_0x40b2bf,_0x352d92):undefined,_0x2e3029=buildFilePath(_0x40b2bf,_0x4985a4,_0x4cea2b,_0x323d0b);if(await fileExists(_0x2e3029))throw CliErrors[_0x5645df(0xa8)](_0x5645df(0xb7)+_0x2e3029);await mkdir(dirname(_0x2e3029),{'recursive':!![]});const _0x3a8bdc=generateTemplate(_0x4985a4,_0x4cea2b,_0x352d92['appCode'],_0xdf2ca8,_0x323d0b);await writeFile(_0x2e3029,_0x3a8bdc,'utf8');const _0x20095d={'type':_0x4985a4,'name':_0x4cea2b,'path':_0x2e3029};if(_0xdf2ca8)_0x20095d[_0x5645df(0x91)]=_0xdf2ca8;if(_0x323d0b){if(_0x323d0b[_0x5645df(0xa2)])_0x20095d[_0x5645df(0xa2)]=_0x323d0b['alias'];_0x20095d[_0x5645df(0xd4)]=_0x323d0b[_0x5645df(0xd4)],_0x20095d[_0x5645df(0xdc)]=_0x323d0b[_0x5645df(0xdc)],_0x20095d['functionNode']=_0x323d0b['functionNode'];}return{'ok':!![],'data':_0x20095d,'message':'Created\x20'+_0x4985a4+_0x5645df(0xe1)+_0x4cea2b};}};function a30_0x1aa2(){const _0x173d08=['(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x22.\x20','Available\x20aliases:\x20','970IwOecZ','alias','107303SJKJHu','Select\x20dataset:','stderr','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','trim','validation','name','No\x20api.ts\x20found.\x20Run\x20`','Trigger\x20node\x20(HOOK\x20only)','question','str','Invalid\x20dataset\x20selection.','\x22\x20not\x20found\x20for\x20dataset\x20','Operation\x20type\x20(HOOK\x20only)','code','apiDir','368124NUVnZC','\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','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','File\x20already\x20exists:\x20','HOOK','parseInt','1252154EGkngH','join','stdin','tableName','Script\x20description','new','No\x20datasets\x20found\x20for\x20this\x20app.','Script\x20type','appCode','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','function-node','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','map','\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','6MKhhRu','Available:\x20','Function\x20name\x20(valid\x20JS\x20identifier)','TODO:\x20add\x20script\x20description','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','7824605GFWybf','Select\x20operation\x20type:','operation-type','functionNode','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','datasetCode','write','after','3itnoDk','find','COMMON','type','488IwesIB','operationType','keys','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','130770dBbOMG','\x20function:\x20','275RLZNqO','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','.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','string','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x0a\x20*\x20[触发节点]\x20','scriptsRootDir','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Invalid\x20function\x20name\x20\x22','description','length','2013848kuezxy','3339332aZPmkw','datasetcode','No\x20operation\x20types\x20found\x20for\x20dataset\x20','nonInteractive','\x22\x20not\x20found.\x20','before','includes','.js','ENDPOINT','Alias\x20\x22'];a30_0x1aa2=function(){return _0x173d08;};return a30_0x1aa2();}async function resolveHookOptions(_0x140de3,_0x4fe3b1){const _0x1f0f3c=a30_0x5eee9d,_0x4c89b7=loadAliasMap(_0x4fe3b1[_0x1f0f3c(0xb2)],undefined,resolveApiFilePath(_0x4fe3b1[_0x1f0f3c(0xb2)],_0x4fe3b1[_0x1f0f3c(0xc2)])),_0x3ada06=_0x4c89b7[_0x1f0f3c(0x92)]>0x0;let _0x4d4cb4,_0x7a78b5,_0x1abd11;const _0x13b0a5=_0x4fe3b1[_0x1f0f3c(0xad)]('alias'),_0x2d1a01=_0x4fe3b1[_0x1f0f3c(0xad)](_0x1f0f3c(0x95));if(_0x13b0a5){const _0x54c6d1=resolveAlias(_0x4fe3b1['apiDir'],_0x13b0a5,undefined,resolveApiFilePath(_0x4fe3b1['apiDir'],_0x4fe3b1[_0x1f0f3c(0xc2)]));if(!_0x54c6d1){const _0x1475aa=_0x3ada06?_0x1f0f3c(0xa0)+_0x4c89b7[_0x1f0f3c(0xc6)](_0x4ed1e7=>_0x4ed1e7[_0x1f0f3c(0xa2)])[_0x1f0f3c(0xbb)](',\x20'):_0x1f0f3c(0xaa)+CLI_BIN_NAME+_0x1f0f3c(0xc3);throw CliErrors['validation'](_0x1f0f3c(0x9d)+_0x13b0a5+_0x1f0f3c(0x98)+_0x1475aa);}_0x4d4cb4=_0x13b0a5,_0x7a78b5=_0x54c6d1;}else{if(_0x2d1a01){_0x7a78b5=_0x2d1a01;const _0x111d2d=_0x4c89b7[_0x1f0f3c(0xd8)](_0x443c64=>_0x443c64[_0x1f0f3c(0xd4)]===_0x2d1a01);_0x4d4cb4=_0x111d2d?.[_0x1f0f3c(0xa2)];}else{if(_0x4fe3b1[_0x1f0f3c(0x97)])throw CliErrors[_0x1f0f3c(0xa8)](_0x1f0f3c(0x8f));else{if(_0x3ada06){const _0xfce5bb=_0x4c89b7['map'](_0x848939=>_0x848939[_0x1f0f3c(0xa2)]+'\x20('+_0x848939[_0x1f0f3c(0xbd)]+')'),_0x1f8545=await promptSelect(_0x1f0f3c(0xa4),_0xfce5bb),_0x4b57ae=_0x4c89b7[_0x1f8545];if(!_0x4b57ae)throw CliErrors['validation'](_0x1f0f3c(0xae));_0x4d4cb4=_0x4b57ae[_0x1f0f3c(0xa2)],_0x7a78b5=_0x4b57ae[_0x1f0f3c(0xd4)];}else{const _0x5db187=await listDatasets(_0x4fe3b1[_0x1f0f3c(0xc2)]);if(_0x5db187['length']===0x0)throw CliErrors[_0x1f0f3c(0xa8)](_0x1f0f3c(0xc0));const _0x27aa09=_0x5db187['map'](_0x446ac0=>_0x446ac0[_0x1f0f3c(0xa9)]+'\x20('+_0x446ac0[_0x1f0f3c(0xb1)]+')'),_0x21feec=await promptSelect(_0x1f0f3c(0xa4),_0x27aa09),_0x3f4d7a=_0x5db187[_0x21feec];if(!_0x3f4d7a)throw CliErrors[_0x1f0f3c(0xa8)](_0x1f0f3c(0xae));_0x7a78b5=_0x3f4d7a[_0x1f0f3c(0xb1)],_0x4d4cb4=undefined;}}}}const _0x48eee4=await listDatasets(_0x4fe3b1[_0x1f0f3c(0xc2)]),_0x3465df=_0x48eee4['find'](_0x51b327=>_0x51b327[_0x1f0f3c(0xb1)]===_0x7a78b5);if(!_0x3465df)throw CliErrors[_0x1f0f3c(0xa8)](_0x1f0f3c(0x8b)+_0x7a78b5+_0x1f0f3c(0x9f)+(_0x4d4cb4?_0x1f0f3c(0xde)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x1abd11=_0x3465df['id'];const _0x433399=_0x4d4cb4??_0x7a78b5,_0x1d23c0=await listBffDatasetOperations(_0x4fe3b1[_0x1f0f3c(0xc2)],_0x1abd11),_0x3fdc7b=_0x1d23c0?Object[_0x1f0f3c(0xdd)](_0x1d23c0):[];if(_0x3fdc7b[_0x1f0f3c(0x92)]===0x0)throw CliErrors['validation'](_0x1f0f3c(0x96)+_0x433399+'.');let _0x5858df;const _0x438fc7=_0x4fe3b1[_0x1f0f3c(0xad)](_0x1f0f3c(0xd1));if(_0x438fc7){if(!_0x3fdc7b[_0x1f0f3c(0x9a)](_0x438fc7))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x438fc7+_0x1f0f3c(0xaf)+_0x433399+'.\x20'+(_0x1f0f3c(0xc9)+_0x3fdc7b[_0x1f0f3c(0xbb)](',\x20')));_0x5858df=_0x438fc7;}else{if(_0x4fe3b1[_0x1f0f3c(0x97)])throw CliErrors[_0x1f0f3c(0xa8)](_0x1f0f3c(0xb6));const _0x391a78=await promptSelect(_0x1f0f3c(0xd0),_0x3fdc7b);_0x5858df=_0x3fdc7b[_0x391a78]??_0x3fdc7b[0x0];}let _0x50ee72=normalizeHookFunctionNode(_0x4fe3b1[_0x1f0f3c(0xad)](_0x1f0f3c(0xc4)));if(!_0x50ee72){if(_0x4fe3b1['str']('function-node'))throw CliErrors['validation'](_0x1f0f3c(0x88));if(_0x4fe3b1[_0x1f0f3c(0x97)])throw CliErrors['validation']('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x3910d5=await promptSelect('Select\x20trigger\x20node:',[_0x1f0f3c(0x99),_0x1f0f3c(0xd6)]);_0x50ee72=[_0x1f0f3c(0x99),_0x1f0f3c(0xd6)][_0x3910d5]??_0x1f0f3c(0x99);}return{'alias':_0x4d4cb4,'datasetCode':_0x7a78b5,'datasetId':_0x1abd11,'operationType':_0x5858df,'functionNode':_0x50ee72};}async function promptSelect(_0x51e5de,_0x42c307){const _0x437858=a30_0x5eee9d;if(_0x42c307[_0x437858(0x92)]===0x1)return 0x0;for(const [_0x364605,_0x1642a9]of _0x42c307['entries']()){process[_0x437858(0xa5)][_0x437858(0xd5)]('\x20\x20'+(_0x364605+0x1)+'.\x20'+_0x1642a9+'\x0a');}const _0x49fb78=createInterface({'input':process[_0x437858(0xbc)],'output':process[_0x437858(0xa5)]});while(!![]){const _0x585fae=await new Promise(_0x476258=>{const _0x592479=_0x437858;_0x49fb78[_0x592479(0xac)](_0x51e5de+'\x20',_0x476258);}),_0x18ba06=Number[_0x437858(0xb9)](_0x585fae[_0x437858(0xa7)](),0xa);if(Number['isInteger'](_0x18ba06)&&_0x18ba06>=0x1&&_0x18ba06<=_0x42c307[_0x437858(0x92)])return _0x49fb78['close'](),_0x18ba06-0x1;process['stderr']['write'](_0x437858(0x8e)+_0x42c307[_0x437858(0x92)]+'.\x0a');}}function buildFilePath(_0x157504,_0xb5db34,_0x571067,_0x81d04b){const _0x5599fe=a30_0x5eee9d;if(_0xb5db34===_0x5599fe(0xb8)){if(!_0x81d04b)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0xe06c41=_0x81d04b[_0x5599fe(0xa2)]??_0x81d04b[_0x5599fe(0xd4)];return join(_0x157504['scriptsRootDir'],_0x5599fe(0xb8),_0xe06c41,_0x81d04b[_0x5599fe(0xdc)],_0x81d04b['functionNode'],_0x571067+_0x5599fe(0x9b));}return join(_0x157504[_0x5599fe(0x8d)],_0xb5db34,_0x571067+_0x5599fe(0x9b));}export function generateTemplate(_0x1a5483,_0x2f3b8e,_0x1317ce,_0x333b1c,_0x2e15a6){const _0x229563=a30_0x5eee9d,_0x470504=_0x333b1c?.[_0x229563(0xa7)]()||_0x229563(0xcb);if(_0x1a5483===_0x229563(0xd9))return _0x229563(0xcc)+_0x470504+'\x0a\x20*\x20[脚本名称]\x20'+_0x2f3b8e+_0x229563(0xd3)+_0x2f3b8e+_0x229563(0x89)+_0x2f3b8e+_0x229563(0x9e);if(_0x1a5483===_0x229563(0x9c))return'/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x470504+_0x229563(0xb5)+_0x1317ce+'/'+_0x2f3b8e+_0x229563(0xc7)+_0x2f3b8e+_0x229563(0x9e);if(!_0x2e15a6)throw CliErrors['validation'](_0x229563(0xce));return _0x229563(0xa6)+_0x470504+_0x229563(0xc5)+_0x1317ce+'/'+_0x2e15a6[_0x229563(0xd4)]+'/'+_0x2e15a6[_0x229563(0xdc)]+_0x229563(0x8c)+_0x2e15a6[_0x229563(0xd2)]+_0x229563(0xb4)+_0x2f3b8e+_0x229563(0x9e);}
1
+ const a68_0x3a967b=a68_0x5e4c;(function(_0x36b0b9,_0x200c86){const _0x1d6883=a68_0x5e4c,_0x3639a7=_0x36b0b9();while(!![]){try{const _0x14e44c=parseInt(_0x1d6883(0x1f6))/0x1*(-parseInt(_0x1d6883(0x235))/0x2)+parseInt(_0x1d6883(0x214))/0x3+parseInt(_0x1d6883(0x239))/0x4+parseInt(_0x1d6883(0x23b))/0x5+-parseInt(_0x1d6883(0x1f0))/0x6+parseInt(_0x1d6883(0x23a))/0x7+-parseInt(_0x1d6883(0x1ed))/0x8*(parseInt(_0x1d6883(0x20b))/0x9);if(_0x14e44c===_0x200c86)break;else _0x3639a7['push'](_0x3639a7['shift']());}catch(_0x4e0a35){_0x3639a7['push'](_0x3639a7['shift']());}}}(a68_0x5a03,0xf3ae2));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{resolveApiFilePath}from'../../context.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';export const bffNew={'service':'bff','command':a68_0x3a967b(0x225),'description':'Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','risk':a68_0x3a967b(0x1fb),'flags':[{'name':a68_0x3a967b(0x208),'type':a68_0x3a967b(0x1f1),'required':!![],'enum':['COMMON',a68_0x3a967b(0x217),'HOOK'],'description':a68_0x3a967b(0x1f3)},{'name':a68_0x3a967b(0x205),'type':a68_0x3a967b(0x1f1),'required':!![],'description':a68_0x3a967b(0x21e)},{'name':a68_0x3a967b(0x21a),'type':a68_0x3a967b(0x1f1),'description':a68_0x3a967b(0x234)},{'name':'alias','type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a68_0x3a967b(0x1f1),'description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':'operation-type','type':a68_0x3a967b(0x1f1),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a68_0x3a967b(0x206),'type':'string','description':a68_0x3a967b(0x221),'enum':[a68_0x3a967b(0x200),a68_0x3a967b(0x1fd)]}],async 'validate'(_0x2b4c9f){const _0x198d23=a68_0x3a967b,_0x18a5fd=_0x2b4c9f['str'](_0x198d23(0x205));if(!isValidBffFunctionName(_0x18a5fd))throw CliErrors[_0x198d23(0x219)](_0x198d23(0x223)+_0x18a5fd+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x17543d){const _0x123f2f=a68_0x3a967b,_0x2f7181=loadBffProjectConfig(_0x17543d[_0x123f2f(0x211)]),_0x1c6bee=_0x17543d[_0x123f2f(0x1f2)]('type'),_0x5f1fa7=_0x17543d[_0x123f2f(0x1f2)]('name'),_0x24a820=_0x17543d['str'](_0x123f2f(0x21a))||undefined,_0x488f3d=_0x1c6bee===_0x123f2f(0x22a)?await resolveHookOptions(_0x2f7181,_0x17543d):undefined,_0x9f6a73=buildFilePath(_0x2f7181,_0x1c6bee,_0x5f1fa7,_0x488f3d);if(await fileExists(_0x9f6a73))throw CliErrors[_0x123f2f(0x219)](_0x123f2f(0x23e)+_0x9f6a73);await mkdir(dirname(_0x9f6a73),{'recursive':!![]});const _0x151cbc=generateTemplate(_0x1c6bee,_0x5f1fa7,_0x17543d[_0x123f2f(0x211)],_0x24a820,_0x488f3d);await writeFile(_0x9f6a73,_0x151cbc,_0x123f2f(0x1f8));const _0x4ff726={'type':_0x1c6bee,'name':_0x5f1fa7,'path':_0x9f6a73};if(_0x24a820)_0x4ff726[_0x123f2f(0x21a)]=_0x24a820;if(_0x488f3d){if(_0x488f3d[_0x123f2f(0x231)])_0x4ff726['alias']=_0x488f3d[_0x123f2f(0x231)];_0x4ff726[_0x123f2f(0x1ef)]=_0x488f3d[_0x123f2f(0x1ef)],_0x4ff726[_0x123f2f(0x233)]=_0x488f3d[_0x123f2f(0x233)],_0x4ff726[_0x123f2f(0x1f4)]=_0x488f3d[_0x123f2f(0x1f4)];}return{'ok':!![],'data':_0x4ff726,'message':'Created\x20'+_0x1c6bee+_0x123f2f(0x226)+_0x5f1fa7};}};async function resolveHookOptions(_0x3fb699,_0x45a649){const _0x41c916=a68_0x3a967b,_0x3f9399=loadAliasMap(_0x45a649['apiDir'],undefined,resolveApiFilePath(_0x45a649[_0x41c916(0x1ff)],_0x45a649[_0x41c916(0x211)])),_0x1bef49=_0x3f9399[_0x41c916(0x227)]>0x0;let _0x41ad81,_0x1a8f7b,_0x3cc780;const _0x4a6bfc=_0x45a649[_0x41c916(0x1f2)]('alias'),_0x4bc2ff=_0x45a649[_0x41c916(0x1f2)](_0x41c916(0x236));if(_0x4a6bfc){const _0x2e6939=resolveAlias(_0x45a649[_0x41c916(0x1ff)],_0x4a6bfc,undefined,resolveApiFilePath(_0x45a649[_0x41c916(0x1ff)],_0x45a649[_0x41c916(0x211)]));if(!_0x2e6939){const _0x3f8b01=_0x1bef49?_0x41c916(0x22b)+_0x3f9399[_0x41c916(0x215)](_0x48f31b=>_0x48f31b[_0x41c916(0x231)])[_0x41c916(0x210)](',\x20'):_0x41c916(0x230)+CLI_BIN_NAME+_0x41c916(0x202);throw CliErrors[_0x41c916(0x219)](_0x41c916(0x1f5)+_0x4a6bfc+_0x41c916(0x1f9)+_0x3f8b01);}_0x41ad81=_0x4a6bfc,_0x1a8f7b=_0x2e6939;}else{if(_0x4bc2ff){_0x1a8f7b=_0x4bc2ff;const _0x184416=_0x3f9399[_0x41c916(0x222)](_0x986444=>_0x986444['datasetCode']===_0x4bc2ff);_0x41ad81=_0x184416?.[_0x41c916(0x231)];}else{if(_0x45a649['nonInteractive'])throw CliErrors[_0x41c916(0x219)](_0x41c916(0x23c));else{if(_0x1bef49){const _0x446d5d=_0x3f9399[_0x41c916(0x215)](_0x35f17b=>_0x35f17b[_0x41c916(0x231)]+'\x20('+_0x35f17b['tableName']+')'),_0x4024fa=await promptSelect('Select\x20dataset:',_0x446d5d),_0x54a925=_0x3f9399[_0x4024fa];if(!_0x54a925)throw CliErrors[_0x41c916(0x219)](_0x41c916(0x22c));_0x41ad81=_0x54a925[_0x41c916(0x231)],_0x1a8f7b=_0x54a925['datasetCode'];}else{const _0x472848=await listDatasets(_0x45a649[_0x41c916(0x211)]);if(_0x472848[_0x41c916(0x227)]===0x0)throw CliErrors[_0x41c916(0x219)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x193995=_0x472848[_0x41c916(0x215)](_0x50c5c7=>_0x50c5c7['name']+'\x20('+_0x50c5c7['code']+')'),_0x4d6a64=await promptSelect('Select\x20dataset:',_0x193995),_0x322ea0=_0x472848[_0x4d6a64];if(!_0x322ea0)throw CliErrors[_0x41c916(0x219)](_0x41c916(0x22c));_0x1a8f7b=_0x322ea0['code'],_0x41ad81=undefined;}}}}const _0x10badf=await listDatasets(_0x45a649['appCode']),_0x1ab84c=_0x10badf['find'](_0x329122=>_0x329122['code']===_0x1a8f7b);if(!_0x1ab84c)throw CliErrors['validation'](_0x41c916(0x22e)+_0x1a8f7b+_0x41c916(0x20e)+(_0x41ad81?_0x41c916(0x1f7)+CLI_BIN_NAME+_0x41c916(0x20f):''));_0x3cc780=_0x1ab84c['id'];const _0x52e17b=_0x41ad81??_0x1a8f7b,_0x27dcc7=await listBffDatasetOperations(_0x45a649[_0x41c916(0x211)],_0x3cc780),_0x55c6f6=_0x27dcc7?Object[_0x41c916(0x207)](_0x27dcc7):[];if(_0x55c6f6[_0x41c916(0x227)]===0x0)throw CliErrors[_0x41c916(0x219)](_0x41c916(0x216)+_0x52e17b+'.');let _0x62c2a9;const _0x33dcf0=_0x45a649[_0x41c916(0x1f2)](_0x41c916(0x238));if(_0x33dcf0){if(!_0x55c6f6[_0x41c916(0x21d)](_0x33dcf0))throw CliErrors[_0x41c916(0x219)]('Operation\x20type\x20\x22'+_0x33dcf0+_0x41c916(0x21c)+_0x52e17b+'.\x20'+(_0x41c916(0x22d)+_0x55c6f6[_0x41c916(0x210)](',\x20')));_0x62c2a9=_0x33dcf0;}else{if(_0x45a649[_0x41c916(0x22f)])throw CliErrors['validation'](_0x41c916(0x212));const _0x383953=await promptSelect('Select\x20operation\x20type:',_0x55c6f6);_0x62c2a9=_0x55c6f6[_0x383953]??_0x55c6f6[0x0];}let _0x44828d=normalizeHookFunctionNode(_0x45a649[_0x41c916(0x1f2)](_0x41c916(0x206)));if(!_0x44828d){if(_0x45a649[_0x41c916(0x1f2)](_0x41c916(0x206)))throw CliErrors[_0x41c916(0x219)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x45a649[_0x41c916(0x22f)])throw CliErrors[_0x41c916(0x219)](_0x41c916(0x213));const _0x3a34c1=await promptSelect(_0x41c916(0x232),[_0x41c916(0x200),_0x41c916(0x1fd)]);_0x44828d=[_0x41c916(0x200),_0x41c916(0x1fd)][_0x3a34c1]??_0x41c916(0x200);}return{'alias':_0x41ad81,'datasetCode':_0x1a8f7b,'datasetId':_0x3cc780,'operationType':_0x62c2a9,'functionNode':_0x44828d};}function a68_0x5a03(){const _0x39e0e7=['close','.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','\x22.\x20','\x20api\x20pull`\x20to\x20refresh.','join','appCode','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','435756mIAigE','map','No\x20operation\x20types\x20found\x20for\x20dataset\x20','ENDPOINT','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','validation','description','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','\x22\x20not\x20found\x20for\x20dataset\x20','includes','Function\x20name\x20(valid\x20JS\x20identifier)','TODO:\x20add\x20script\x20description','question','Trigger\x20node\x20(HOOK\x20only)','find','Invalid\x20function\x20name\x20\x22','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','new','\x20function:\x20','length','\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','\x0a\x20*\x20[脚本名称]\x20','HOOK','Available\x20aliases:\x20','Invalid\x20dataset\x20selection.','Available:\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','nonInteractive','No\x20api.ts\x20found.\x20Run\x20`','alias','Select\x20trigger\x20node:','operationType','Script\x20description','18shutQn','datasetcode','.js','operation-type','4015064xHvHCQ','8901501dxXLxq','7184620wwBSDF','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','stdin','File\x20already\x20exists:\x20','4433568PhGlzp','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','datasetCode','313524fyIgFS','string','str','Script\x20type','functionNode','Alias\x20\x22','127181xWCMoI','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','utf8','\x22\x20not\x20found.\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','write','stderr','after','scriptsRootDir','apiDir','before','\x0a\x20*\x20[触发节点]\x20','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','trim','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','name','function-node','keys','type','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','27OfqbmR'];a68_0x5a03=function(){return _0x39e0e7;};return a68_0x5a03();}async function promptSelect(_0x5403b0,_0x2cae8a){const _0x147d24=a68_0x3a967b;if(_0x2cae8a[_0x147d24(0x227)]===0x1)return 0x0;for(const [_0x5436f6,_0x3b0640]of _0x2cae8a['entries']()){process[_0x147d24(0x1fc)]['write']('\x20\x20'+(_0x5436f6+0x1)+'.\x20'+_0x3b0640+'\x0a');}const _0x1bf42d=createInterface({'input':process[_0x147d24(0x23d)],'output':process['stderr']});while(!![]){const _0x3d6948=await new Promise(_0x432e74=>{const _0x1cbc69=_0x147d24;_0x1bf42d[_0x1cbc69(0x220)](_0x5403b0+'\x20',_0x432e74);}),_0x316f95=Number['parseInt'](_0x3d6948[_0x147d24(0x203)](),0xa);if(Number['isInteger'](_0x316f95)&&_0x316f95>=0x1&&_0x316f95<=_0x2cae8a[_0x147d24(0x227)])return _0x1bf42d[_0x147d24(0x20c)](),_0x316f95-0x1;process[_0x147d24(0x1fc)][_0x147d24(0x1fb)](_0x147d24(0x21b)+_0x2cae8a[_0x147d24(0x227)]+'.\x0a');}}function a68_0x5e4c(_0x2937b3,_0x45335e){_0x2937b3=_0x2937b3-0x1ed;const _0x5a03e3=a68_0x5a03();let _0x5e4c12=_0x5a03e3[_0x2937b3];return _0x5e4c12;}function buildFilePath(_0x3e071b,_0x3e8197,_0x18376e,_0x43dc02){const _0x628e8a=a68_0x3a967b;if(_0x3e8197==='HOOK'){if(!_0x43dc02)throw CliErrors[_0x628e8a(0x219)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x453c15=_0x43dc02[_0x628e8a(0x231)]??_0x43dc02[_0x628e8a(0x1ef)];return join(_0x3e071b[_0x628e8a(0x1fe)],_0x628e8a(0x22a),_0x453c15,_0x43dc02[_0x628e8a(0x233)],_0x43dc02[_0x628e8a(0x1f4)],_0x18376e+_0x628e8a(0x237));}return join(_0x3e071b[_0x628e8a(0x1fe)],_0x3e8197,_0x18376e+'.js');}export function generateTemplate(_0x55fd7d,_0x2e93e9,_0x2cd7a1,_0x58b1ad,_0x1668eb){const _0x950174=a68_0x3a967b,_0x25d21c=_0x58b1ad?.[_0x950174(0x203)]()||_0x950174(0x21f);if(_0x55fd7d==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x25d21c+_0x950174(0x229)+_0x2e93e9+_0x950174(0x204)+_0x2e93e9+_0x950174(0x20d)+_0x2e93e9+_0x950174(0x1ee);if(_0x55fd7d===_0x950174(0x217))return _0x950174(0x1fa)+_0x25d21c+_0x950174(0x209)+_0x2cd7a1+'/'+_0x2e93e9+_0x950174(0x228)+_0x2e93e9+_0x950174(0x1ee);if(!_0x1668eb)throw CliErrors[_0x950174(0x219)](_0x950174(0x20a));return _0x950174(0x224)+_0x25d21c+_0x950174(0x218)+_0x2cd7a1+'/'+_0x1668eb[_0x950174(0x1ef)]+'/'+_0x1668eb[_0x950174(0x233)]+_0x950174(0x201)+_0x1668eb[_0x950174(0x1f4)]+'\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'+_0x2e93e9+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
@@ -1 +1 @@
1
- const a31_0x3cd403=a31_0x3c63;function a31_0x38f3(){const _0x3b79cd=['datasetCode','trim','scriptType','functions','6116649zPwdoD','yes','\x20skipped,\x20','appCode','type','/api/management/library/scripts/list?appCode=','Pull\x20only\x20this\x20script\x20type','unresolvable\x20target\x20path','length','force','utf8','Would\x20inspect\x20','apiDir','1913512XBEAGm','stderr','1386210oePKLL','toLowerCase','2045223uRXiyp','would_pull','functionNode','all','scriptsRoot','write','\x20remote\x20BFF\x20script(s)\x20for\x20pull','stdin','scriptContent','\x20failed','close','hookLocation','stringify','message','915011TiLLbG','operationType','GET','lockKey','Lock\x20scope\x20for\x20app\x20\x22','functionName','apps','lockFilePath','8BGofun','Remote\x20script\x20missing\x20id.','113281QwGsOe','No\x20remote\x20BFF\x20scripts\x20found.','Force\x20pull\x20cancelled.','18AlWzRw','HOOK','Remote\x20script\x20missing\x20content.','Pull\x20complete:\x20','alias','2EIrKAE','conflict','222OYTaKY','\x20pulled,\x20','string','filePath','2837090IehpBS','COMMON','push','nonInteractive','pull','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','validation','map','str','lastSync','Pull\x20remote\x20BFF\x20scripts\x20to\x20local'];a31_0x38f3=function(){return _0x3b79cd;};return a31_0x38f3();}(function(_0x4c1a28,_0x40ed00){const _0x4e4710=a31_0x3c63,_0x2ba045=_0x4c1a28();while(!![]){try{const _0x2bd4b5=parseInt(_0x4e4710(0x1a9))/0x1*(parseInt(_0x4e4710(0x175))/0x2)+parseInt(_0x4e4710(0x19b))/0x3+parseInt(_0x4e4710(0x1b1))/0x4*(-parseInt(_0x4e4710(0x199))/0x5)+parseInt(_0x4e4710(0x177))/0x6*(parseInt(_0x4e4710(0x1b3))/0x7)+parseInt(_0x4e4710(0x197))/0x8+-parseInt(_0x4e4710(0x1b6))/0x9*(parseInt(_0x4e4710(0x17b))/0xa)+-parseInt(_0x4e4710(0x18a))/0xb;if(_0x2bd4b5===_0x40ed00)break;else _0x2ba045['push'](_0x2ba045['shift']());}catch(_0xf21869){_0x2ba045['push'](_0x2ba045['shift']());}}}(a31_0x38f3,0xb8c0f));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{resolveApiFilePath}from'../../context.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';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a31_0x3cd403(0x17f),'description':a31_0x3cd403(0x185),'risk':a31_0x3cd403(0x1a0),'flags':[{'name':a31_0x3cd403(0x18e),'type':a31_0x3cd403(0x179),'description':a31_0x3cd403(0x190),'enum':[a31_0x3cd403(0x17c),'ENDPOINT',a31_0x3cd403(0x1b7)]},{'name':a31_0x3cd403(0x193),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x1ec50d){const _0x4b4955=a31_0x3cd403,_0x4e4b2b=loadBffProjectConfig(_0x1ec50d[_0x4b4955(0x18d)]),_0x31b067=await readBffLockFile(_0x4e4b2b[_0x4b4955(0x1b0)]),{appLock:_0x2bba2c}=ensureLockScope(_0x31b067??createEmptyBffLock(),_0x1ec50d[_0x4b4955(0x18d)],_0x4e4b2b[_0x4b4955(0x19f)],_0x4b4955(0x17f)),_0x3c5136=normalizeBffType(_0x1ec50d[_0x4b4955(0x183)]('type'))??undefined,_0xc2306c=buildDatasetCodeToAliasMap(_0x1ec50d[_0x4b4955(0x196)],_0x1ec50d['appCode']),[_0x5881c5,_0x183a06]=await Promise[_0x4b4955(0x19e)]([listBffScripts(_0x1ec50d[_0x4b4955(0x18d)],_0x3c5136),getBffScriptStatistics(_0x1ec50d['appCode'])]),_0x19b063=createHookLocationMap(_0x183a06),_0x557b62=[];for(const _0x3248a5 of _0x5881c5){const _0x167ff1=resolveRemoteScriptTarget(_0x4e4b2b,_0x3248a5,_0x19b063,_0x2bba2c[_0x4b4955(0x189)],_0xc2306c);if(!_0x167ff1){_0x557b62[_0x4b4955(0x17d)]({'scriptType':_0x3248a5[_0x4b4955(0x188)],'functionName':_0x3248a5[_0x4b4955(0x1ae)]??'','status':'skipped','reason':_0x4b4955(0x191)});continue;}const _0x42ffc7=_0x2bba2c[_0x4b4955(0x189)][_0x167ff1[_0x4b4955(0x1ac)]],_0x407b59=_0x3248a5['scriptContent']!=null?computeContentHash(_0x3248a5[_0x4b4955(0x1a3)]):undefined,_0xb14417=await hasUnsyncedLocalChanges(_0x167ff1['filePath'],_0x42ffc7,_0x407b59);_0x557b62[_0x4b4955(0x17d)]({'lockKey':_0x167ff1['lockKey'],'filePath':_0x167ff1[_0x4b4955(0x17a)],'remoteId':_0x3248a5['id']??null,'status':_0xb14417?_0x4b4955(0x176):_0x4b4955(0x19c)});}return{'method':_0x4b4955(0x1ab),'url':_0x4b4955(0x18f)+_0x1ec50d['appCode']+(_0x3c5136?'&type='+_0x3c5136:''),'body':{'appCode':_0x1ec50d[_0x4b4955(0x18d)],'filterType':_0x3c5136??null,'files':_0x557b62},'description':_0x4b4955(0x195)+_0x557b62[_0x4b4955(0x192)]+_0x4b4955(0x1a1)};},async 'execute'(_0x4f5b0f){const _0x147cde=a31_0x3cd403,_0x219767=loadBffProjectConfig(_0x4f5b0f[_0x147cde(0x18d)]),_0x1bbee8=await readBffLockFile(_0x219767['lockFilePath']),{lockData:_0x305a0,appLock:_0x268fef}=ensureLockScope(_0x1bbee8??createEmptyBffLock(),_0x4f5b0f[_0x147cde(0x18d)],_0x219767[_0x147cde(0x19f)],_0x147cde(0x17f)),_0x146236=normalizeBffType(_0x4f5b0f[_0x147cde(0x183)]('type'))??undefined;if(_0x4f5b0f[_0x147cde(0x183)](_0x147cde(0x18e))&&!_0x146236)throw CliErrors[_0x147cde(0x181)](_0x147cde(0x180));const [_0x515aba,_0x5d5835]=await Promise[_0x147cde(0x19e)]([listBffScripts(_0x4f5b0f[_0x147cde(0x18d)],_0x146236),getBffScriptStatistics(_0x4f5b0f[_0x147cde(0x18d)])]);if(_0x515aba[_0x147cde(0x192)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x147cde(0x1b4)};const _0xd215fe=_0x4f5b0f['bool'](_0x147cde(0x193));if(_0xd215fe&&!_0x4f5b0f[_0x147cde(0x17e)]){const _0x208957=await confirmForce();if(!_0x208957)throw CliErrors['cancelled'](_0x147cde(0x1b5));}if(_0xd215fe&&_0x4f5b0f['nonInteractive']){}const _0x11ea14=buildDatasetCodeToAliasMap(_0x4f5b0f['apiDir'],_0x4f5b0f[_0x147cde(0x18d)]),_0x3eab69=createHookLocationMap(_0x5d5835),_0x4482b2=JSON['parse'](JSON[_0x147cde(0x1a7)](_0x305a0)),_0x29de38=_0x4f5b0f['appCode'],_0x501426=_0x4482b2[_0x147cde(0x1af)][_0x29de38];if(!_0x501426)throw new Error(_0x147cde(0x1ad)+_0x29de38+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x8b6eab=[],_0x2439ae=[],_0x4f55b8=[];for(const _0x4e4d9a of _0x515aba){const _0x33219e=resolveRemoteScriptTarget(_0x219767,_0x4e4d9a,_0x3eab69,_0x268fef[_0x147cde(0x189)],_0x11ea14);if(!_0x33219e){_0x2439ae[_0x147cde(0x17d)]({'lockKey':_0x4e4d9a[_0x147cde(0x188)]+'/'+_0x4e4d9a[_0x147cde(0x1ae)],'reason':_0x147cde(0x191)});continue;}const _0x54bbaf=_0x268fef[_0x147cde(0x189)][_0x33219e[_0x147cde(0x1ac)]];try{if(!_0x4e4d9a['id'])throw new Error(_0x147cde(0x1b2));if(_0x4e4d9a[_0x147cde(0x1a3)]==null)throw new Error(_0x147cde(0x1b8));const _0x3113e6=_0x4e4d9a[_0x147cde(0x1a3)],_0x3ed6cb=computeContentHash(_0x3113e6);if(!_0xd215fe){const _0x1bcd6a=await hasUnsyncedLocalChanges(_0x33219e['filePath'],_0x54bbaf,_0x3ed6cb);if(_0x1bcd6a){_0x2439ae[_0x147cde(0x17d)]({'lockKey':_0x33219e['lockKey'],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x33219e[_0x147cde(0x17a)]),await writeFile(_0x33219e[_0x147cde(0x17a)],_0x3113e6,_0x147cde(0x194));const _0x5adbf7={'hash':_0x3ed6cb,'remoteId':_0x4e4d9a['id'],'version':_0x4e4d9a['version']};_0x33219e[_0x147cde(0x18e)]===_0x147cde(0x1b7)&&_0x33219e[_0x147cde(0x1a6)]&&(_0x5adbf7[_0x147cde(0x1ba)]=_0x33219e[_0x147cde(0x1a6)]['alias'],_0x5adbf7[_0x147cde(0x186)]=_0x33219e[_0x147cde(0x1a6)]['datasetCode'],_0x5adbf7[_0x147cde(0x1aa)]=_0x33219e['hookLocation'][_0x147cde(0x1aa)],_0x5adbf7[_0x147cde(0x19d)]=_0x33219e['hookLocation'][_0x147cde(0x19d)]),_0x501426[_0x147cde(0x189)][_0x33219e[_0x147cde(0x1ac)]]=_0x5adbf7,_0x8b6eab[_0x147cde(0x17d)]({'lockKey':_0x33219e[_0x147cde(0x1ac)],'remoteId':_0x4e4d9a['id']});}catch(_0x18f8de){_0x4f55b8[_0x147cde(0x17d)]({'lockKey':_0x33219e['lockKey'],'error':_0x18f8de instanceof Error?_0x18f8de[_0x147cde(0x1a8)]:String(_0x18f8de)});}}return _0x501426[_0x147cde(0x184)]=new Date()['toISOString'](),await writeBffLockFile(_0x219767[_0x147cde(0x1b0)],_0x4482b2),{'ok':_0x4f55b8[_0x147cde(0x192)]===0x0,'data':{'pulled':_0x8b6eab,'skipped':_0x2439ae,'failed':_0x4f55b8},'message':_0x147cde(0x1b9)+_0x8b6eab[_0x147cde(0x192)]+_0x147cde(0x178)+_0x2439ae[_0x147cde(0x192)]+_0x147cde(0x18c)+_0x4f55b8['length']+_0x147cde(0x1a4)};}};async function hasUnsyncedLocalChanges(_0xc0ce58,_0x35ecd1,_0x24aef6){if(!await fileExists(_0xc0ce58))return![];const _0x50c057=await computeFileHash(_0xc0ce58);if(!_0x35ecd1)return _0x24aef6?_0x50c057!==_0x24aef6:!![];return _0x50c057!==_0x35ecd1['hash'];}function buildDatasetCodeToAliasMap(_0x3b63ff,_0x2b0393){const _0x451dc4=a31_0x3cd403,_0x5724ac=loadAliasMap(_0x3b63ff,undefined,resolveApiFilePath(_0x3b63ff,_0x2b0393));return new Map(_0x5724ac[_0x451dc4(0x182)](_0x43c321=>[_0x43c321[_0x451dc4(0x186)],_0x43c321[_0x451dc4(0x1ba)]]));}function a31_0x3c63(_0x5c2c3c,_0x3ad1ad){_0x5c2c3c=_0x5c2c3c-0x175;const _0x38f334=a31_0x38f3();let _0x3c63f8=_0x38f334[_0x5c2c3c];return _0x3c63f8;}async function confirmForce(){const _0x2cc8bc=a31_0x3cd403,_0x52d208=createInterface({'input':process[_0x2cc8bc(0x1a2)],'output':process[_0x2cc8bc(0x198)]}),_0x1dfc92=await new Promise(_0x503976=>{_0x52d208['question']('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x503976);});return _0x52d208[_0x2cc8bc(0x1a5)](),['y',_0x2cc8bc(0x18b)]['includes'](_0x1dfc92[_0x2cc8bc(0x187)]()[_0x2cc8bc(0x19a)]());}
1
+ function a70_0x476d(_0x29292f,_0x74fbcc){_0x29292f=_0x29292f-0xce;const _0x35117a=a70_0x3511();let _0x476d2d=_0x35117a[_0x29292f];return _0x476d2d;}const a70_0x231e3f=a70_0x476d;(function(_0x540340,_0x150256){const _0xb2105=a70_0x476d,_0x1ac3d6=_0x540340();while(!![]){try{const _0x12e461=parseInt(_0xb2105(0xe7))/0x1*(parseInt(_0xb2105(0xe0))/0x2)+-parseInt(_0xb2105(0xcf))/0x3*(-parseInt(_0xb2105(0x10f))/0x4)+-parseInt(_0xb2105(0xee))/0x5+-parseInt(_0xb2105(0xdc))/0x6*(parseInt(_0xb2105(0xf4))/0x7)+parseInt(_0xb2105(0xea))/0x8+-parseInt(_0xb2105(0xf2))/0x9*(parseInt(_0xb2105(0x112))/0xa)+parseInt(_0xb2105(0x109))/0xb;if(_0x12e461===_0x150256)break;else _0x1ac3d6['push'](_0x1ac3d6['shift']());}catch(_0xb48e40){_0x1ac3d6['push'](_0x1ac3d6['shift']());}}}(a70_0x3511,0x3d877));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{resolveApiFilePath}from'../../context.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 a70_0x3511(){const _0x25cb1d=['2886XIsZNi','bool','stringify','question','2HNSKPs','version','parse','ENDPOINT','functions','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','type','53487tJQicq','force','str','1986928tiTEJO','string','Force\x20pull\x20cancelled.','apiDir','2439485nsPHwq','HOOK','Remote\x20script\x20missing\x20content.','Would\x20inspect\x20','9DjZNRY','pull','2317uXsuMd','scriptsRoot','toLowerCase','functionNode','stdin','No\x20remote\x20BFF\x20scripts\x20found.','stderr','functionName','conflict','apps','length','Remote\x20script\x20missing\x20id.','scriptType','hash','appCode','unresolvable\x20target\x20path','operationType','alias','lockFilePath','scriptContent','nonInteractive','8712891aQmAMu','filePath','lastSync','\x20failed','hookLocation','write','281620sYnJmt','COMMON','all','2652080vOfRiX','Pull\x20only\x20this\x20script\x20type','message','includes','push','datasetCode','3GttuaF','\x20skipped,\x20','skipped','Pull\x20complete:\x20','local\x20unsynced\x20changes','\x22\x20not\x20found\x20after\x20ensureLockScope.','Force\x20overwrite\x20local\x20unsynced\x20changes','/api/management/library/scripts/list?appCode=','lockKey','toISOString','yes','map','GET'];a70_0x3511=function(){return _0x25cb1d;};return a70_0x3511();}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a70_0x231e3f(0xf3),'description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a70_0x231e3f(0x10e),'flags':[{'name':a70_0x231e3f(0xe6),'type':a70_0x231e3f(0xeb),'description':a70_0x231e3f(0x113),'enum':[a70_0x231e3f(0x110),a70_0x231e3f(0xe3),'HOOK']},{'name':a70_0x231e3f(0xe8),'type':'boolean','description':a70_0x231e3f(0xd5)}],async 'dryRun'(_0x4fd6c9){const _0x33aa0b=a70_0x231e3f,_0x1db6de=loadBffProjectConfig(_0x4fd6c9['appCode']),_0xaeaa9f=await readBffLockFile(_0x1db6de[_0x33aa0b(0x106)]),{appLock:_0x2dd9fe}=ensureLockScope(_0xaeaa9f??createEmptyBffLock(),_0x4fd6c9[_0x33aa0b(0x102)],_0x1db6de['scriptsRoot'],_0x33aa0b(0xf3)),_0x1e1e7e=normalizeBffType(_0x4fd6c9[_0x33aa0b(0xe9)](_0x33aa0b(0xe6)))??undefined,_0x46185a=buildDatasetCodeToAliasMap(_0x4fd6c9[_0x33aa0b(0xed)],_0x4fd6c9[_0x33aa0b(0x102)]),[_0x20817b,_0xd7d78b]=await Promise[_0x33aa0b(0x111)]([listBffScripts(_0x4fd6c9['appCode'],_0x1e1e7e),getBffScriptStatistics(_0x4fd6c9[_0x33aa0b(0x102)])]),_0x77b0e5=createHookLocationMap(_0xd7d78b),_0x5f1caf=[];for(const _0x3b4afc of _0x20817b){const _0x5dec73=resolveRemoteScriptTarget(_0x1db6de,_0x3b4afc,_0x77b0e5,_0x2dd9fe['functions'],_0x46185a);if(!_0x5dec73){_0x5f1caf[_0x33aa0b(0x116)]({'scriptType':_0x3b4afc[_0x33aa0b(0x100)],'functionName':_0x3b4afc[_0x33aa0b(0xfb)]??'','status':_0x33aa0b(0xd1),'reason':_0x33aa0b(0x103)});continue;}const _0x362481=_0x2dd9fe[_0x33aa0b(0xe4)][_0x5dec73[_0x33aa0b(0xd7)]],_0x472f3c=_0x3b4afc[_0x33aa0b(0x107)]!=null?computeContentHash(_0x3b4afc['scriptContent']):undefined,_0x149158=await hasUnsyncedLocalChanges(_0x5dec73[_0x33aa0b(0x10a)],_0x362481,_0x472f3c);_0x5f1caf[_0x33aa0b(0x116)]({'lockKey':_0x5dec73['lockKey'],'filePath':_0x5dec73['filePath'],'remoteId':_0x3b4afc['id']??null,'status':_0x149158?_0x33aa0b(0xfc):'would_pull'});}return{'method':_0x33aa0b(0xdb),'url':_0x33aa0b(0xd6)+_0x4fd6c9[_0x33aa0b(0x102)]+(_0x1e1e7e?'&type='+_0x1e1e7e:''),'body':{'appCode':_0x4fd6c9[_0x33aa0b(0x102)],'filterType':_0x1e1e7e??null,'files':_0x5f1caf},'description':_0x33aa0b(0xf1)+_0x5f1caf[_0x33aa0b(0xfe)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x3ef63e){const _0x40bccf=a70_0x231e3f,_0x5cdd2f=loadBffProjectConfig(_0x3ef63e[_0x40bccf(0x102)]),_0x5362be=await readBffLockFile(_0x5cdd2f[_0x40bccf(0x106)]),{lockData:_0x15c8d2,appLock:_0x5eb442}=ensureLockScope(_0x5362be??createEmptyBffLock(),_0x3ef63e[_0x40bccf(0x102)],_0x5cdd2f[_0x40bccf(0xf5)],_0x40bccf(0xf3)),_0x1f49df=normalizeBffType(_0x3ef63e['str'](_0x40bccf(0xe6)))??undefined;if(_0x3ef63e['str']('type')&&!_0x1f49df)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x45e592,_0x52aad9]=await Promise[_0x40bccf(0x111)]([listBffScripts(_0x3ef63e[_0x40bccf(0x102)],_0x1f49df),getBffScriptStatistics(_0x3ef63e['appCode'])]);if(_0x45e592[_0x40bccf(0xfe)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x40bccf(0xf9)};const _0x29beb0=_0x3ef63e[_0x40bccf(0xdd)](_0x40bccf(0xe8));if(_0x29beb0&&!_0x3ef63e[_0x40bccf(0x108)]){const _0x4c7fe6=await confirmForce();if(!_0x4c7fe6)throw CliErrors['cancelled'](_0x40bccf(0xec));}if(_0x29beb0&&_0x3ef63e[_0x40bccf(0x108)]){}const _0x54e866=buildDatasetCodeToAliasMap(_0x3ef63e['apiDir'],_0x3ef63e[_0x40bccf(0x102)]),_0x1bb5da=createHookLocationMap(_0x52aad9),_0x425972=JSON[_0x40bccf(0xe2)](JSON[_0x40bccf(0xde)](_0x15c8d2)),_0x23efc4=_0x3ef63e['appCode'],_0x1eba25=_0x425972[_0x40bccf(0xfd)][_0x23efc4];if(!_0x1eba25)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x23efc4+_0x40bccf(0xd4));const _0x3d2eab=[],_0xf48753=[],_0x506ed2=[];for(const _0x515369 of _0x45e592){const _0x593abf=resolveRemoteScriptTarget(_0x5cdd2f,_0x515369,_0x1bb5da,_0x5eb442[_0x40bccf(0xe4)],_0x54e866);if(!_0x593abf){_0xf48753[_0x40bccf(0x116)]({'lockKey':_0x515369['scriptType']+'/'+_0x515369[_0x40bccf(0xfb)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x436e07=_0x5eb442[_0x40bccf(0xe4)][_0x593abf[_0x40bccf(0xd7)]];try{if(!_0x515369['id'])throw new Error(_0x40bccf(0xff));if(_0x515369[_0x40bccf(0x107)]==null)throw new Error(_0x40bccf(0xf0));const _0x281646=_0x515369[_0x40bccf(0x107)],_0x479a4f=computeContentHash(_0x281646);if(!_0x29beb0){const _0x58a0e1=await hasUnsyncedLocalChanges(_0x593abf['filePath'],_0x436e07,_0x479a4f);if(_0x58a0e1){_0xf48753[_0x40bccf(0x116)]({'lockKey':_0x593abf[_0x40bccf(0xd7)],'reason':_0x40bccf(0xd3)});continue;}}await ensureParentDirectory(_0x593abf[_0x40bccf(0x10a)]),await writeFile(_0x593abf[_0x40bccf(0x10a)],_0x281646,'utf8');const _0x276efa={'hash':_0x479a4f,'remoteId':_0x515369['id'],'version':_0x515369[_0x40bccf(0xe1)]};_0x593abf[_0x40bccf(0xe6)]===_0x40bccf(0xef)&&_0x593abf[_0x40bccf(0x10d)]&&(_0x276efa['alias']=_0x593abf[_0x40bccf(0x10d)][_0x40bccf(0x105)],_0x276efa[_0x40bccf(0xce)]=_0x593abf['hookLocation'][_0x40bccf(0xce)],_0x276efa['operationType']=_0x593abf[_0x40bccf(0x10d)][_0x40bccf(0x104)],_0x276efa[_0x40bccf(0xf7)]=_0x593abf[_0x40bccf(0x10d)][_0x40bccf(0xf7)]),_0x1eba25[_0x40bccf(0xe4)][_0x593abf[_0x40bccf(0xd7)]]=_0x276efa,_0x3d2eab['push']({'lockKey':_0x593abf[_0x40bccf(0xd7)],'remoteId':_0x515369['id']});}catch(_0x2fa18a){_0x506ed2['push']({'lockKey':_0x593abf[_0x40bccf(0xd7)],'error':_0x2fa18a instanceof Error?_0x2fa18a[_0x40bccf(0x114)]:String(_0x2fa18a)});}}return _0x1eba25[_0x40bccf(0x10b)]=new Date()[_0x40bccf(0xd8)](),await writeBffLockFile(_0x5cdd2f[_0x40bccf(0x106)],_0x425972),{'ok':_0x506ed2[_0x40bccf(0xfe)]===0x0,'data':{'pulled':_0x3d2eab,'skipped':_0xf48753,'failed':_0x506ed2},'message':_0x40bccf(0xd2)+_0x3d2eab[_0x40bccf(0xfe)]+'\x20pulled,\x20'+_0xf48753[_0x40bccf(0xfe)]+_0x40bccf(0xd0)+_0x506ed2[_0x40bccf(0xfe)]+_0x40bccf(0x10c)};}};async function hasUnsyncedLocalChanges(_0x721ab3,_0x209987,_0x38da0a){const _0x3c6ab6=a70_0x231e3f;if(!await fileExists(_0x721ab3))return![];const _0x372f20=await computeFileHash(_0x721ab3);if(!_0x209987)return _0x38da0a?_0x372f20!==_0x38da0a:!![];return _0x372f20!==_0x209987[_0x3c6ab6(0x101)];}function buildDatasetCodeToAliasMap(_0x13adc6,_0x3a1dfa){const _0xbc240=a70_0x231e3f,_0xf7be1d=loadAliasMap(_0x13adc6,undefined,resolveApiFilePath(_0x13adc6,_0x3a1dfa));return new Map(_0xf7be1d[_0xbc240(0xda)](_0x5cc195=>[_0x5cc195[_0xbc240(0xce)],_0x5cc195['alias']]));}async function confirmForce(){const _0x2eb86c=a70_0x231e3f,_0x44ac31=createInterface({'input':process[_0x2eb86c(0xf8)],'output':process[_0x2eb86c(0xfa)]}),_0xcdc559=await new Promise(_0x3791d5=>{const _0x5c4d19=_0x2eb86c;_0x44ac31[_0x5c4d19(0xdf)](_0x5c4d19(0xe5),_0x3791d5);});return _0x44ac31['close'](),['y',_0x2eb86c(0xd9)][_0x2eb86c(0x115)](_0xcdc559['trim']()[_0x2eb86c(0xf6)]());}
@@ -1 +1 @@
1
- const a32_0x49a5cb=a32_0xe63a;(function(_0x47e218,_0xad9726){const _0x5b88a5=a32_0xe63a,_0x1beff0=_0x47e218();while(!![]){try{const _0x59e6fc=-parseInt(_0x5b88a5(0x1a2))/0x1*(-parseInt(_0x5b88a5(0x19a))/0x2)+parseInt(_0x5b88a5(0x1da))/0x3*(parseInt(_0x5b88a5(0x1a3))/0x4)+parseInt(_0x5b88a5(0x1b6))/0x5*(parseInt(_0x5b88a5(0x1cf))/0x6)+-parseInt(_0x5b88a5(0x1cb))/0x7*(-parseInt(_0x5b88a5(0x1c6))/0x8)+-parseInt(_0x5b88a5(0x1d6))/0x9*(parseInt(_0x5b88a5(0x19e))/0xa)+parseInt(_0x5b88a5(0x1a9))/0xb+-parseInt(_0x5b88a5(0x1b7))/0xc;if(_0x59e6fc===_0xad9726)break;else _0x1beff0['push'](_0x1beff0['shift']());}catch(_0x797c58){_0x1beff0['push'](_0x1beff0['shift']());}}}(a32_0xfe04,0x848ae));import{readFile}from'node:fs/promises';function a32_0xfe04(){const _0x58363b=['scriptsRoot','filePath','434qDRAyO',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','code','functionNode','50688jkjaJQ','datasetCodeToId','POST','bool','datasetCode','bff','get','1216881bEmxYi','hash','alias','Cannot\x20resolve\x20dataset\x20for\x20\x22','21DGADoK','update','boolean','some','\x20failed','operationType','1085318hWhWHw','\x22.\x20','lockFilePath','name','10XQcrWJ','lockKey','Push\x20complete:\x20','apiDir','2wclspZ','456908KHkJWk','\x20uploaded,\x20','toISOString','Would\x20inspect\x20','functions','would_push','10143683FSSivk','version','message','Force\x20push\x20ignoring\x20hash\x20protection','has','lastSync','utf8','Push\x20only\x20this\x20script\x20type','length','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','aliasToDatasetCode','str','push','295URYvGS','35096892HeeRLo','type','string','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','remoteId','appCode','filter','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','map','No\x20local\x20BFF\x20functions\x20found.','HOOK','validation','description','force','Local\x20function\x20not\x20found:\x20','38368ZkuTJQ','high-risk-write','ENDPOINT'];a32_0xfe04=function(){return _0x58363b;};return a32_0xfe04();}import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.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';export const bffPush={'service':a32_0x49a5cb(0x1d4),'command':a32_0x49a5cb(0x1b5),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a32_0x49a5cb(0x1c7),'flags':[{'name':'type','type':'string','description':a32_0x49a5cb(0x1b0),'enum':['COMMON',a32_0x49a5cb(0x1c8),a32_0x49a5cb(0x1c1)]},{'name':a32_0x49a5cb(0x19d),'type':a32_0x49a5cb(0x1b9),'description':a32_0x49a5cb(0x1b2)},{'name':'force','type':a32_0x49a5cb(0x196),'description':a32_0x49a5cb(0x1ac)}],async 'dryRun'(_0x5d9feb){const _0x3ac844=a32_0x49a5cb,_0x4e8cc6=loadBffProjectConfig(_0x5d9feb['appCode']),_0x31d400=await readBffLockFile(_0x4e8cc6[_0x3ac844(0x19c)]),{appLock:_0x244b9f}=ensureLockScope(_0x31d400??createEmptyBffLock(),_0x5d9feb[_0x3ac844(0x1bc)],_0x4e8cc6[_0x3ac844(0x1c9)],_0x3ac844(0x1b5)),_0x3deae1=await getTargetFunctions(_0x4e8cc6,_0x5d9feb),_0x303abb=_0x5d9feb[_0x3ac844(0x1d2)](_0x3ac844(0x1c4)),_0x47ccd8=[];for(const _0x47ad4d of _0x3deae1){const _0x4c2df8=await computeFileHash(_0x47ad4d[_0x3ac844(0x1ca)]),_0x4a8cb3=_0x244b9f['functions'][_0x47ad4d['lockKey']],_0x452679=!!_0x4a8cb3&&_0x4a8cb3[_0x3ac844(0x1d7)]===_0x4c2df8;_0x47ccd8[_0x3ac844(0x1b5)]({'lockKey':_0x47ad4d[_0x3ac844(0x19f)],'filePath':_0x47ad4d[_0x3ac844(0x1ca)],'remoteId':_0x4a8cb3?.[_0x3ac844(0x1bb)]??null,'mode':_0x4a8cb3?.[_0x3ac844(0x1bb)]?_0x3ac844(0x1db):'create','status':!_0x303abb&&_0x452679?'unchanged':_0x3ac844(0x1a8)});}return{'method':_0x3ac844(0x1d1),'url':'/api/management/library/scripts/save','body':{'appCode':_0x5d9feb[_0x3ac844(0x1bc)],'force':_0x303abb,'files':_0x47ccd8},'description':_0x3ac844(0x1a6)+_0x47ccd8[_0x3ac844(0x1b1)]+'\x20local\x20BFF\x20script(s)\x20for\x20push'};},async 'execute'(_0x118b24){const _0xac6dc3=a32_0x49a5cb,_0x49ffe2=loadBffProjectConfig(_0x118b24['appCode']),_0x21ba1d=await readBffLockFile(_0x49ffe2[_0xac6dc3(0x19c)]),{lockData:_0x2a5d74,appLock:_0x4c172c}=ensureLockScope(_0x21ba1d??createEmptyBffLock(),_0x118b24['appCode'],_0x49ffe2[_0xac6dc3(0x1c9)],'push'),_0x1845de=await getTargetFunctions(_0x49ffe2,_0x118b24);if(_0x1845de[_0xac6dc3(0x1b1)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xac6dc3(0x1c0)};const _0x5ee3f8=_0x118b24[_0xac6dc3(0x1d2)](_0xac6dc3(0x1c4)),_0x2586d6=await buildHookMaps(_0x118b24[_0xac6dc3(0x1bc)],_0x118b24[_0xac6dc3(0x1a1)],_0x1845de,_0x4c172c),_0x11b911=[],_0xfa374f=[],_0x2e5a40=[];for(const _0x54d5fc of _0x1845de){const _0x3bd8da=await computeFileHash(_0x54d5fc[_0xac6dc3(0x1ca)]),_0x871bc=_0x4c172c['functions'][_0x54d5fc[_0xac6dc3(0x19f)]];if(!_0x5ee3f8&&_0x871bc&&_0x871bc[_0xac6dc3(0x1d7)]===_0x3bd8da){_0xfa374f['push']({'lockKey':_0x54d5fc['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x118b24['appCode'],_0x54d5fc,_0x4c172c,_0x2586d6);const _0x197865=_0x4c172c[_0xac6dc3(0x1a7)][_0x54d5fc[_0xac6dc3(0x19f)]];_0x11b911[_0xac6dc3(0x1b5)]({'lockKey':_0x54d5fc[_0xac6dc3(0x19f)],'remoteId':_0x197865?.[_0xac6dc3(0x1bb)]??0x0});}catch(_0x5afa53){_0x2e5a40['push']({'lockKey':_0x54d5fc[_0xac6dc3(0x19f)],'error':_0x5afa53 instanceof Error?_0x5afa53[_0xac6dc3(0x1ab)]:String(_0x5afa53)});}}return _0x4c172c[_0xac6dc3(0x1ae)]=new Date()[_0xac6dc3(0x1a5)](),await writeBffLockFile(_0x49ffe2['lockFilePath'],_0x2a5d74),{'ok':_0x2e5a40[_0xac6dc3(0x1b1)]===0x0,'data':{'uploaded':_0x11b911,'skipped':_0xfa374f,'failed':_0x2e5a40},'message':_0xac6dc3(0x1a0)+_0x11b911[_0xac6dc3(0x1b1)]+_0xac6dc3(0x1a4)+_0xfa374f[_0xac6dc3(0x1b1)]+'\x20skipped,\x20'+_0x2e5a40[_0xac6dc3(0x1b1)]+_0xac6dc3(0x198)};}};async function getTargetFunctions(_0xd37cd9,_0x1c575f){const _0x474172=a32_0x49a5cb,_0x374b69=_0x1c575f[_0x474172(0x1b4)](_0x474172(0x1b8)),_0x1cfecb=_0x1c575f[_0x474172(0x1b4)](_0x474172(0x19d)),_0x2360cd=normalizeBffType(_0x374b69)??undefined;if(_0x1cfecb&&!_0x2360cd)throw CliErrors[_0x474172(0x1c2)](_0x474172(0x1ba));const _0x813b10=await scanLocalBffFunctions(_0xd37cd9,_0x2360cd);if(_0x1cfecb){const _0x5db23d=_0x813b10[_0x474172(0x1bd)](_0x47c241=>_0x47c241['name']===_0x1cfecb);if(_0x5db23d[_0x474172(0x1b1)]===0x0)throw CliErrors[_0x474172(0x1c2)](_0x474172(0x1c5)+_0x2360cd+'/'+_0x1cfecb);return _0x5db23d;}return _0x813b10;}async function buildHookMaps(_0x3feb7c,_0x47a330,_0x229d57,_0x3fb397){const _0x34caa4=a32_0x49a5cb,_0x9b25bf=_0x229d57[_0x34caa4(0x197)](_0x8caa12=>_0x8caa12[_0x34caa4(0x1b8)]===_0x34caa4(0x1c1));if(!_0x9b25bf)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x32a8bb=loadAliasMap(_0x47a330,undefined,resolveApiFilePath(_0x47a330,_0x3feb7c)),_0x42152a=new Map(_0x32a8bb[_0x34caa4(0x1bf)](_0x1c5668=>[_0x1c5668[_0x34caa4(0x1d8)],_0x1c5668[_0x34caa4(0x1d3)]]));for(const _0x499c00 of Object['values'](_0x3fb397['functions'])){_0x499c00[_0x34caa4(0x1d8)]&&_0x499c00[_0x34caa4(0x1d3)]&&!_0x42152a[_0x34caa4(0x1ad)](_0x499c00[_0x34caa4(0x1d8)])&&_0x42152a['set'](_0x499c00[_0x34caa4(0x1d8)],_0x499c00['datasetCode']);}const _0x1f3f89=await listDatasets(_0x3feb7c),_0x4f713c=new Map(_0x1f3f89['map'](_0xcbd09b=>[_0xcbd09b[_0x34caa4(0x1cd)],_0xcbd09b['id']]));return{'aliasToDatasetCode':_0x42152a,'datasetCodeToId':_0x4f713c};}function a32_0xe63a(_0x39a9d5,_0x1fcbda){_0x39a9d5=_0x39a9d5-0x196;const _0xfe0404=a32_0xfe04();let _0xe63a8c=_0xfe0404[_0x39a9d5];return _0xe63a8c;}async function uploadSingleFunction(_0x288921,_0x1669fa,_0x2f08c0,_0x35da95){const _0x164925=a32_0x49a5cb,_0x152ebf=await readFile(_0x1669fa[_0x164925(0x1ca)],_0x164925(0x1af)),_0x539d8c=await computeFileHash(_0x1669fa['filePath']),_0x275dbd=_0x2f08c0['functions'][_0x1669fa['lockKey']];if(_0x275dbd?.['remoteId']&&_0x275dbd[_0x164925(0x1aa)]==null)throw CliErrors[_0x164925(0x1c2)](_0x1669fa['lockKey']+_0x164925(0x1cc));let _0x5d2e84=extractScriptDescription(_0x152ebf);if(!_0x5d2e84&&_0x275dbd?.[_0x164925(0x1bb)]){const _0x416886=await getBffScriptInfo(_0x275dbd[_0x164925(0x1bb)]);_0x5d2e84=_0x416886[_0x164925(0x1c3)]||undefined;}const _0x3e3bcc={'appCode':_0x288921,'functionName':_0x1669fa[_0x164925(0x19d)],'scriptType':_0x1669fa['type'],'scriptContent':_0x152ebf};if(_0x275dbd?.[_0x164925(0x1bb)])_0x3e3bcc['id']=_0x275dbd[_0x164925(0x1bb)];if(_0x275dbd?.[_0x164925(0x1aa)]!=null)_0x3e3bcc[_0x164925(0x1aa)]=_0x275dbd[_0x164925(0x1aa)];if(_0x5d2e84)_0x3e3bcc[_0x164925(0x1c3)]=_0x5d2e84;if(_0x1669fa[_0x164925(0x1b8)]===_0x164925(0x1c1)){const _0x168026=_0x1669fa[_0x164925(0x1d8)];if(!_0x168026||!_0x1669fa[_0x164925(0x199)]||!_0x1669fa[_0x164925(0x1ce)])throw CliErrors['validation']('Incomplete\x20HOOK\x20path:\x20'+_0x1669fa[_0x164925(0x19f)]);const _0x2f8842=_0x35da95[_0x164925(0x1b3)][_0x164925(0x1d5)](_0x168026)??_0x275dbd?.['datasetCode']??_0x168026,_0x5e4589=_0x35da95[_0x164925(0x1d0)]['get'](_0x2f8842);if(!_0x5e4589)throw CliErrors[_0x164925(0x1c2)](_0x164925(0x1d9)+_0x168026+_0x164925(0x19b)+('Run\x20`'+CLI_BIN_NAME+_0x164925(0x1be)));_0x3e3bcc['datasetId']=_0x5e4589,_0x3e3bcc[_0x164925(0x199)]=_0x1669fa[_0x164925(0x199)],_0x3e3bcc[_0x164925(0x1ce)]=_0x1669fa[_0x164925(0x1ce)];}const _0x96288=await saveBffScript(_0x3e3bcc),_0xe13491=await getBffScriptInfo(_0x96288),_0x2edaf2={'hash':_0x539d8c,'remoteId':_0x96288,'version':_0xe13491[_0x164925(0x1aa)]};if(_0x1669fa[_0x164925(0x1b8)]==='HOOK'){const _0x285d42=_0x1669fa[_0x164925(0x1d8)],_0x142b1e=_0x35da95[_0x164925(0x1b3)]['get'](_0x285d42)??_0x275dbd?.['datasetCode']??_0x285d42;_0x35da95[_0x164925(0x1b3)]['has'](_0x285d42)?_0x2edaf2['alias']=_0x285d42:_0x2edaf2[_0x164925(0x1d8)]=_0x275dbd?.['alias'],_0x2edaf2[_0x164925(0x1d3)]=_0x142b1e,_0x2edaf2['operationType']=_0x1669fa['operationType'],_0x2edaf2['functionNode']=_0x1669fa[_0x164925(0x1ce)];}_0x2f08c0[_0x164925(0x1a7)][_0x1669fa[_0x164925(0x19f)]]=_0x2edaf2;}
1
+ const a75_0x3b8ee5=a75_0x2f04;(function(_0x3304d0,_0x1a11d0){const _0x9d5e67=a75_0x2f04,_0x4cb2cf=_0x3304d0();while(!![]){try{const _0x3d5fd8=-parseInt(_0x9d5e67(0x126))/0x1+parseInt(_0x9d5e67(0x12b))/0x2*(-parseInt(_0x9d5e67(0x127))/0x3)+-parseInt(_0x9d5e67(0x136))/0x4+parseInt(_0x9d5e67(0x11e))/0x5*(-parseInt(_0x9d5e67(0x12d))/0x6)+parseInt(_0x9d5e67(0x122))/0x7*(-parseInt(_0x9d5e67(0x14f))/0x8)+-parseInt(_0x9d5e67(0x138))/0x9+parseInt(_0x9d5e67(0x131))/0xa;if(_0x3d5fd8===_0x1a11d0)break;else _0x4cb2cf['push'](_0x4cb2cf['shift']());}catch(_0x55783c){_0x4cb2cf['push'](_0x4cb2cf['shift']());}}}(a75_0x7d52,0x6d552));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a75_0x7d52(){const _0xeb604e=['datasetCode','utf8','name','functions','scriptsRoot','apiDir','\x20uploaded,\x20','Would\x20inspect\x20','Cannot\x20resolve\x20dataset\x20for\x20\x22','appCode','toISOString','364224uAiGnm','lockFilePath','version','lastSync','POST','boolean','\x20skipped,\x20','Force\x20push\x20ignoring\x20hash\x20protection','datasetId','set','HOOK','lockKey','has','ENDPOINT','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','length','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','alias','push','remoteId','\x22.\x20',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','5LEuyiS','Local\x20function\x20not\x20found:\x20','hash','aliasToDatasetCode','49NNtwYq','No\x20local\x20BFF\x20functions\x20found.','force','description','107836sYshDq','127311yCbXRl','COMMON','unchanged','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','18fKeSvj','str','1881582rgjNUv','Push\x20complete:\x20','datasetCodeToId','type','23291520vjMGLT','Push\x20only\x20this\x20script\x20type','operationType','map','\x20local\x20BFF\x20script(s)\x20for\x20push','348424CwDamt','filePath','6049422xmBtYf','functionNode','\x20failed','get','Run\x20`','validation','filter','bool','some','code','string','high-risk-write'];a75_0x7d52=function(){return _0xeb604e;};return a75_0x7d52();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a75_0x2f04(_0x39f9e7,_0x4e7d55){_0x39f9e7=_0x39f9e7-0x109;const _0x7d522c=a75_0x7d52();let _0x2f0467=_0x7d522c[_0x39f9e7];return _0x2f0467;}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';export const bffPush={'service':'bff','command':'push','description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a75_0x3b8ee5(0x143),'flags':[{'name':a75_0x3b8ee5(0x130),'type':a75_0x3b8ee5(0x142),'description':a75_0x3b8ee5(0x132),'enum':[a75_0x3b8ee5(0x128),a75_0x3b8ee5(0x115),'HOOK']},{'name':a75_0x3b8ee5(0x146),'type':a75_0x3b8ee5(0x142),'description':a75_0x3b8ee5(0x118)},{'name':a75_0x3b8ee5(0x124),'type':a75_0x3b8ee5(0x10d),'description':a75_0x3b8ee5(0x10f)}],async 'dryRun'(_0x18573a){const _0x566010=a75_0x3b8ee5,_0x316795=loadBffProjectConfig(_0x18573a[_0x566010(0x14d)]),_0x27d886=await readBffLockFile(_0x316795[_0x566010(0x109)]),{appLock:_0x1125fd}=ensureLockScope(_0x27d886??createEmptyBffLock(),_0x18573a[_0x566010(0x14d)],_0x316795[_0x566010(0x148)],_0x566010(0x11a)),_0x10f4b=await getTargetFunctions(_0x316795,_0x18573a),_0x29d9cb=_0x18573a[_0x566010(0x13f)](_0x566010(0x124)),_0x44e2a1=[];for(const _0x34395e of _0x10f4b){const _0x1ed999=await computeFileHash(_0x34395e[_0x566010(0x137)]),_0x5b072f=_0x1125fd['functions'][_0x34395e[_0x566010(0x113)]],_0xa487ff=!!_0x5b072f&&_0x5b072f['hash']===_0x1ed999;_0x44e2a1[_0x566010(0x11a)]({'lockKey':_0x34395e[_0x566010(0x113)],'filePath':_0x34395e[_0x566010(0x137)],'remoteId':_0x5b072f?.[_0x566010(0x11b)]??null,'mode':_0x5b072f?.[_0x566010(0x11b)]?'update':'create','status':!_0x29d9cb&&_0xa487ff?'unchanged':'would_push'});}return{'method':_0x566010(0x10c),'url':'/api/management/library/scripts/save','body':{'appCode':_0x18573a[_0x566010(0x14d)],'force':_0x29d9cb,'files':_0x44e2a1},'description':_0x566010(0x14b)+_0x44e2a1['length']+_0x566010(0x135)};},async 'execute'(_0x24da2a){const _0x35087f=a75_0x3b8ee5,_0x575f37=loadBffProjectConfig(_0x24da2a[_0x35087f(0x14d)]),_0x2e9281=await readBffLockFile(_0x575f37['lockFilePath']),{lockData:_0x38b4bc,appLock:_0x38f357}=ensureLockScope(_0x2e9281??createEmptyBffLock(),_0x24da2a[_0x35087f(0x14d)],_0x575f37[_0x35087f(0x148)],_0x35087f(0x11a)),_0x1836e2=await getTargetFunctions(_0x575f37,_0x24da2a);if(_0x1836e2[_0x35087f(0x117)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x35087f(0x123)};const _0x376ca4=_0x24da2a[_0x35087f(0x13f)](_0x35087f(0x124)),_0x55e75e=await buildHookMaps(_0x24da2a[_0x35087f(0x14d)],_0x24da2a[_0x35087f(0x149)],_0x1836e2,_0x38f357),_0x162bec=[],_0x9cb7cc=[],_0x222392=[];for(const _0x46d518 of _0x1836e2){const _0xbbc5b9=await computeFileHash(_0x46d518[_0x35087f(0x137)]),_0xbde143=_0x38f357[_0x35087f(0x147)][_0x46d518[_0x35087f(0x113)]];if(!_0x376ca4&&_0xbde143&&_0xbde143[_0x35087f(0x120)]===_0xbbc5b9){_0x9cb7cc[_0x35087f(0x11a)]({'lockKey':_0x46d518[_0x35087f(0x113)],'reason':_0x35087f(0x129)});continue;}try{await uploadSingleFunction(_0x24da2a['appCode'],_0x46d518,_0x38f357,_0x55e75e);const _0x5941fc=_0x38f357[_0x35087f(0x147)][_0x46d518['lockKey']];_0x162bec[_0x35087f(0x11a)]({'lockKey':_0x46d518[_0x35087f(0x113)],'remoteId':_0x5941fc?.[_0x35087f(0x11b)]??0x0});}catch(_0x7fb317){_0x222392[_0x35087f(0x11a)]({'lockKey':_0x46d518[_0x35087f(0x113)],'error':_0x7fb317 instanceof Error?_0x7fb317['message']:String(_0x7fb317)});}}return _0x38f357[_0x35087f(0x10b)]=new Date()[_0x35087f(0x14e)](),await writeBffLockFile(_0x575f37[_0x35087f(0x109)],_0x38b4bc),{'ok':_0x222392[_0x35087f(0x117)]===0x0,'data':{'uploaded':_0x162bec,'skipped':_0x9cb7cc,'failed':_0x222392},'message':_0x35087f(0x12e)+_0x162bec[_0x35087f(0x117)]+_0x35087f(0x14a)+_0x9cb7cc[_0x35087f(0x117)]+_0x35087f(0x10e)+_0x222392[_0x35087f(0x117)]+_0x35087f(0x13a)};}};async function getTargetFunctions(_0x317d01,_0x5ec7eb){const _0x40f44f=a75_0x3b8ee5,_0xae9a73=_0x5ec7eb[_0x40f44f(0x12c)](_0x40f44f(0x130)),_0x183cf8=_0x5ec7eb[_0x40f44f(0x12c)](_0x40f44f(0x146)),_0x502524=normalizeBffType(_0xae9a73)??undefined;if(_0x183cf8&&!_0x502524)throw CliErrors['validation'](_0x40f44f(0x12a));const _0x595379=await scanLocalBffFunctions(_0x317d01,_0x502524);if(_0x183cf8){const _0x543099=_0x595379[_0x40f44f(0x13e)](_0x5bc418=>_0x5bc418[_0x40f44f(0x146)]===_0x183cf8);if(_0x543099[_0x40f44f(0x117)]===0x0)throw CliErrors['validation'](_0x40f44f(0x11f)+_0x502524+'/'+_0x183cf8);return _0x543099;}return _0x595379;}async function buildHookMaps(_0x16285a,_0x34a9b2,_0x4b9561,_0x12e832){const _0x305c7=a75_0x3b8ee5,_0x550737=_0x4b9561[_0x305c7(0x140)](_0x18007c=>_0x18007c['type']===_0x305c7(0x112));if(!_0x550737)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x55132d=loadAliasMap(_0x34a9b2,undefined,resolveApiFilePath(_0x34a9b2,_0x16285a)),_0x535683=new Map(_0x55132d[_0x305c7(0x134)](_0x508428=>[_0x508428[_0x305c7(0x119)],_0x508428[_0x305c7(0x144)]]));for(const _0x20dab of Object['values'](_0x12e832[_0x305c7(0x147)])){_0x20dab[_0x305c7(0x119)]&&_0x20dab[_0x305c7(0x144)]&&!_0x535683[_0x305c7(0x114)](_0x20dab[_0x305c7(0x119)])&&_0x535683[_0x305c7(0x111)](_0x20dab[_0x305c7(0x119)],_0x20dab['datasetCode']);}const _0x244eef=await listDatasets(_0x16285a),_0x222b79=new Map(_0x244eef[_0x305c7(0x134)](_0x2ba10f=>[_0x2ba10f[_0x305c7(0x141)],_0x2ba10f['id']]));return{'aliasToDatasetCode':_0x535683,'datasetCodeToId':_0x222b79};}async function uploadSingleFunction(_0x40a5ca,_0x211179,_0xc02ca6,_0x2a959f){const _0x36af19=a75_0x3b8ee5,_0x7790d8=await readFile(_0x211179[_0x36af19(0x137)],_0x36af19(0x145)),_0x3c7791=await computeFileHash(_0x211179['filePath']),_0x277ddc=_0xc02ca6[_0x36af19(0x147)][_0x211179[_0x36af19(0x113)]];if(_0x277ddc?.[_0x36af19(0x11b)]&&_0x277ddc[_0x36af19(0x10a)]==null)throw CliErrors['validation'](_0x211179[_0x36af19(0x113)]+_0x36af19(0x11d));let _0x5372e9=extractScriptDescription(_0x7790d8);if(!_0x5372e9&&_0x277ddc?.[_0x36af19(0x11b)]){const _0x2fa49b=await getBffScriptInfo(_0x277ddc[_0x36af19(0x11b)]);_0x5372e9=_0x2fa49b[_0x36af19(0x125)]||undefined;}const _0x4d95f1={'appCode':_0x40a5ca,'functionName':_0x211179[_0x36af19(0x146)],'scriptType':_0x211179[_0x36af19(0x130)],'scriptContent':_0x7790d8};if(_0x277ddc?.[_0x36af19(0x11b)])_0x4d95f1['id']=_0x277ddc[_0x36af19(0x11b)];if(_0x277ddc?.[_0x36af19(0x10a)]!=null)_0x4d95f1[_0x36af19(0x10a)]=_0x277ddc[_0x36af19(0x10a)];if(_0x5372e9)_0x4d95f1[_0x36af19(0x125)]=_0x5372e9;if(_0x211179[_0x36af19(0x130)]===_0x36af19(0x112)){const _0x1d1fe3=_0x211179[_0x36af19(0x119)];if(!_0x1d1fe3||!_0x211179[_0x36af19(0x133)]||!_0x211179['functionNode'])throw CliErrors['validation']('Incomplete\x20HOOK\x20path:\x20'+_0x211179[_0x36af19(0x113)]);const _0xfa316e=_0x2a959f['aliasToDatasetCode'][_0x36af19(0x13b)](_0x1d1fe3)??_0x277ddc?.[_0x36af19(0x144)]??_0x1d1fe3,_0x1dbd9a=_0x2a959f[_0x36af19(0x12f)][_0x36af19(0x13b)](_0xfa316e);if(!_0x1dbd9a)throw CliErrors[_0x36af19(0x13d)](_0x36af19(0x14c)+_0x1d1fe3+_0x36af19(0x11c)+(_0x36af19(0x13c)+CLI_BIN_NAME+_0x36af19(0x116)));_0x4d95f1[_0x36af19(0x110)]=_0x1dbd9a,_0x4d95f1[_0x36af19(0x133)]=_0x211179[_0x36af19(0x133)],_0x4d95f1[_0x36af19(0x139)]=_0x211179[_0x36af19(0x139)];}const _0x2ff87f=await saveBffScript(_0x4d95f1),_0xddae8f=await getBffScriptInfo(_0x2ff87f),_0x2a1b01={'hash':_0x3c7791,'remoteId':_0x2ff87f,'version':_0xddae8f['version']};if(_0x211179[_0x36af19(0x130)]===_0x36af19(0x112)){const _0x5c6601=_0x211179[_0x36af19(0x119)],_0x851223=_0x2a959f['aliasToDatasetCode'][_0x36af19(0x13b)](_0x5c6601)??_0x277ddc?.[_0x36af19(0x144)]??_0x5c6601;_0x2a959f[_0x36af19(0x121)][_0x36af19(0x114)](_0x5c6601)?_0x2a1b01[_0x36af19(0x119)]=_0x5c6601:_0x2a1b01[_0x36af19(0x119)]=_0x277ddc?.[_0x36af19(0x119)],_0x2a1b01[_0x36af19(0x144)]=_0x851223,_0x2a1b01[_0x36af19(0x133)]=_0x211179[_0x36af19(0x133)],_0x2a1b01[_0x36af19(0x139)]=_0x211179['functionNode'];}_0xc02ca6[_0x36af19(0x147)][_0x211179[_0x36af19(0x113)]]=_0x2a1b01;}
@@ -1 +1 @@
1
- const a33_0x8db9d0=a33_0x5c0b;function a33_0x2608(){const _0x3af971=['bool','\x20unchanged','90270wXCzKU','read','571687mZyvpf','status','\x20remote-only','all','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','lockKey','2UTMWNS','10200339tRgRnF','7363620ZtpXbn','hash','\x20added,\x20','3KwZKSV','length','2190xxDZbQ','apiDir','push','2712UpyQAU','5874xiaEJp','map','boolean','functions','filePath','appCode','\x20modified,\x20','7847NBDKXp','remote','5310652eoGEAT','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file'];a33_0x2608=function(){return _0x3af971;};return a33_0x2608();}(function(_0x970e7e,_0x2a7524){const _0x5596db=a33_0x5c0b,_0x270b24=_0x970e7e();while(!![]){try{const _0x194fb3=-parseInt(_0x5596db(0x1d6))/0x1*(parseInt(_0x5596db(0x1dc))/0x2)+-parseInt(_0x5596db(0x1e1))/0x3*(parseInt(_0x5596db(0x1d0))/0x4)+parseInt(_0x5596db(0x1d4))/0x5+parseInt(_0x5596db(0x1de))/0x6+-parseInt(_0x5596db(0x1ce))/0x7*(-parseInt(_0x5596db(0x1e6))/0x8)+parseInt(_0x5596db(0x1dd))/0x9+parseInt(_0x5596db(0x1e3))/0xa*(-parseInt(_0x5596db(0x1e7))/0xb);if(_0x194fb3===_0x2a7524)break;else _0x270b24['push'](_0x270b24['shift']());}catch(_0x3b7763){_0x270b24['push'](_0x270b24['shift']());}}}(a33_0x2608,0xb5412));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.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';function a33_0x5c0b(_0x2b4872,_0x33cb9d){_0x2b4872=_0x2b4872-0x1c8;const _0x26085e=a33_0x2608();let _0x5c0b36=_0x26085e[_0x2b4872];return _0x5c0b36;}export const bffStatus={'service':'bff','command':a33_0x8db9d0(0x1d7),'description':a33_0x8db9d0(0x1d1),'risk':a33_0x8db9d0(0x1d5),'flags':[{'name':a33_0x8db9d0(0x1cf),'type':a33_0x8db9d0(0x1c9),'description':a33_0x8db9d0(0x1da)}],async 'execute'(_0xab0b66){const _0x5a804a=a33_0x8db9d0,_0x1b0094=loadBffProjectConfig(_0xab0b66['appCode']),_0x411952=await readBffLockFile(_0x1b0094['lockFilePath']),{appLock:_0x2c05f4}=ensureLockScope(_0x411952??createEmptyBffLock(),_0xab0b66[_0x5a804a(0x1cc)],_0x1b0094['scriptsRoot'],'status'),_0x1fb2b5=await scanLocalBffFunctions(_0x1b0094),_0x151a6b=[],_0x46aafa=[],_0x44aad2=[];for(const _0x30dd01 of _0x1fb2b5){const _0x5baefd=await computeFileHash(_0x30dd01[_0x5a804a(0x1cb)]),_0x554b03=_0x2c05f4[_0x5a804a(0x1ca)][_0x30dd01['lockKey']];if(!_0x554b03)_0x151a6b[_0x5a804a(0x1e5)](_0x30dd01[_0x5a804a(0x1db)]);else _0x554b03[_0x5a804a(0x1df)]!==_0x5baefd?_0x46aafa[_0x5a804a(0x1e5)](_0x30dd01['lockKey']):_0x44aad2[_0x5a804a(0x1e5)](_0x30dd01[_0x5a804a(0x1db)]);}const _0x5c07ff=[];if(_0xab0b66[_0x5a804a(0x1d2)](_0x5a804a(0x1cf))){const _0x474d20=loadAliasMap(_0xab0b66[_0x5a804a(0x1e4)],undefined,resolveApiFilePath(_0xab0b66['apiDir'],_0xab0b66[_0x5a804a(0x1cc)])),_0x425b05=new Map(_0x474d20['map'](_0x575819=>[_0x575819['datasetCode'],_0x575819['alias']])),[_0x1d4f92,_0x4ee545]=await Promise[_0x5a804a(0x1d9)]([listBffScripts(_0xab0b66['appCode']),getBffScriptStatistics(_0xab0b66[_0x5a804a(0x1cc)])]),_0x1539f8=createHookLocationMap(_0x4ee545),_0x4d3b7a=new Set(_0x1fb2b5[_0x5a804a(0x1c8)](_0x3b3caf=>_0x3b3caf[_0x5a804a(0x1db)]));for(const _0xd33104 of _0x1d4f92){const _0x2ff3c9=resolveRemoteScriptTarget(_0x1b0094,_0xd33104,_0x1539f8,_0x2c05f4['functions'],_0x425b05);_0x2ff3c9&&!_0x4d3b7a['has'](_0x2ff3c9[_0x5a804a(0x1db)])&&_0x5c07ff[_0x5a804a(0x1e5)](_0x2ff3c9[_0x5a804a(0x1db)]);}}const _0x4c106b=_0x151a6b['length']===0x0&&_0x46aafa[_0x5a804a(0x1e2)]===0x0&&_0x5c07ff[_0x5a804a(0x1e2)]===0x0;return{'ok':!![],'data':{'added':_0x151a6b,'modified':_0x46aafa,'unchanged':_0x44aad2,'remoteOnly':_0x5c07ff},'message':_0x4c106b?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x151a6b['length']+_0x5a804a(0x1e0)+_0x46aafa[_0x5a804a(0x1e2)]+_0x5a804a(0x1cd)+_0x44aad2[_0x5a804a(0x1e2)]+_0x5a804a(0x1d3)+(_0x5c07ff[_0x5a804a(0x1e2)]>0x0?',\x20'+_0x5c07ff[_0x5a804a(0x1e2)]+_0x5a804a(0x1d8):'')};}};
1
+ const a71_0x5a29cc=a71_0x21f4;function a71_0x153d(){const _0x34eca9=['\x20remote-only','bool','functions','9350705mSFogP','all','length','push','3884109qsaSzG','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','filePath','datasetCode','alias','read','3225922nXkkfp','lockFilePath','bff','\x20unchanged','appCode','568240juemEF','apiDir','2537101iFlypb','1515052dDISfg','boolean','lockKey','7101948iUypXa','\x20added,\x20','status','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','scriptsRoot','hash'];a71_0x153d=function(){return _0x34eca9;};return a71_0x153d();}(function(_0x38d87d,_0x392625){const _0x7fd56e=a71_0x21f4,_0xb53bf5=_0x38d87d();while(!![]){try{const _0x1ed714=parseInt(_0x7fd56e(0xf4))/0x1+-parseInt(_0x7fd56e(0xef))/0x2+parseInt(_0x7fd56e(0xe9))/0x3+parseInt(_0x7fd56e(0xf7))/0x4+parseInt(_0x7fd56e(0x103))/0x5+-parseInt(_0x7fd56e(0xfa))/0x6+-parseInt(_0x7fd56e(0xf6))/0x7;if(_0x1ed714===_0x392625)break;else _0xb53bf5['push'](_0xb53bf5['shift']());}catch(_0x57519f){_0xb53bf5['push'](_0xb53bf5['shift']());}}}(a71_0x153d,0xe89d1));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a71_0x21f4(_0xb3790d,_0x229ee2){_0xb3790d=_0xb3790d-0xe7;const _0x153d3c=a71_0x153d();let _0x21f44b=_0x153d3c[_0xb3790d];return _0x21f44b;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.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':a71_0x5a29cc(0xf1),'command':'status','description':a71_0x5a29cc(0xfd),'risk':a71_0x5a29cc(0xee),'flags':[{'name':'remote','type':a71_0x5a29cc(0xf8),'description':a71_0x5a29cc(0xea)}],async 'execute'(_0x53d2c5){const _0x5b5637=a71_0x5a29cc,_0x24d986=loadBffProjectConfig(_0x53d2c5[_0x5b5637(0xf3)]),_0x26b9a0=await readBffLockFile(_0x24d986[_0x5b5637(0xf0)]),{appLock:_0x389cf3}=ensureLockScope(_0x26b9a0??createEmptyBffLock(),_0x53d2c5[_0x5b5637(0xf3)],_0x24d986[_0x5b5637(0xfe)],_0x5b5637(0xfc)),_0x52c02e=await scanLocalBffFunctions(_0x24d986),_0xaad4f5=[],_0x1c2abc=[],_0x1126a4=[];for(const _0x1831a7 of _0x52c02e){const _0x188720=await computeFileHash(_0x1831a7[_0x5b5637(0xeb)]),_0x424840=_0x389cf3['functions'][_0x1831a7['lockKey']];if(!_0x424840)_0xaad4f5[_0x5b5637(0xe8)](_0x1831a7[_0x5b5637(0xf9)]);else _0x424840[_0x5b5637(0xff)]!==_0x188720?_0x1c2abc[_0x5b5637(0xe8)](_0x1831a7[_0x5b5637(0xf9)]):_0x1126a4['push'](_0x1831a7[_0x5b5637(0xf9)]);}const _0x2bd547=[];if(_0x53d2c5[_0x5b5637(0x101)]('remote')){const _0x266e0a=loadAliasMap(_0x53d2c5[_0x5b5637(0xf5)],undefined,resolveApiFilePath(_0x53d2c5[_0x5b5637(0xf5)],_0x53d2c5[_0x5b5637(0xf3)])),_0x45cce1=new Map(_0x266e0a['map'](_0x3f129d=>[_0x3f129d[_0x5b5637(0xec)],_0x3f129d[_0x5b5637(0xed)]])),[_0x29ab83,_0x3ea13e]=await Promise[_0x5b5637(0x104)]([listBffScripts(_0x53d2c5[_0x5b5637(0xf3)]),getBffScriptStatistics(_0x53d2c5[_0x5b5637(0xf3)])]),_0xb33cc8=createHookLocationMap(_0x3ea13e),_0x4f4e36=new Set(_0x52c02e['map'](_0x364666=>_0x364666['lockKey']));for(const _0x1efc9e of _0x29ab83){const _0x539aff=resolveRemoteScriptTarget(_0x24d986,_0x1efc9e,_0xb33cc8,_0x389cf3[_0x5b5637(0x102)],_0x45cce1);_0x539aff&&!_0x4f4e36['has'](_0x539aff[_0x5b5637(0xf9)])&&_0x2bd547['push'](_0x539aff['lockKey']);}}const _0x5a5314=_0xaad4f5[_0x5b5637(0xe7)]===0x0&&_0x1c2abc[_0x5b5637(0xe7)]===0x0&&_0x2bd547['length']===0x0;return{'ok':!![],'data':{'added':_0xaad4f5,'modified':_0x1c2abc,'unchanged':_0x1126a4,'remoteOnly':_0x2bd547},'message':_0x5a5314?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0xaad4f5[_0x5b5637(0xe7)]+_0x5b5637(0xfb)+_0x1c2abc['length']+'\x20modified,\x20'+_0x1126a4['length']+_0x5b5637(0xf2)+(_0x2bd547['length']>0x0?',\x20'+_0x2bd547[_0x5b5637(0xe7)]+_0x5b5637(0x100):'')};}};