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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 -0
  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 +2 -2
@@ -1 +1 @@
1
- function a20_0x477d(_0x37f5d8,_0x49f4de){_0x37f5d8=_0x37f5d8-0x1ec;const _0x2d518a=a20_0x2d51();let _0x477dbd=_0x2d518a[_0x37f5d8];return _0x477dbd;}(function(_0x39c263,_0x378395){const _0x137fba=a20_0x477d,_0x529519=_0x39c263();while(!![]){try{const _0x21d608=-parseInt(_0x137fba(0x1f3))/0x1*(-parseInt(_0x137fba(0x1ec))/0x2)+parseInt(_0x137fba(0x1f1))/0x3*(parseInt(_0x137fba(0x1ed))/0x4)+parseInt(_0x137fba(0x1ee))/0x5*(-parseInt(_0x137fba(0x1f0))/0x6)+parseInt(_0x137fba(0x1f5))/0x7*(-parseInt(_0x137fba(0x1f6))/0x8)+parseInt(_0x137fba(0x1f4))/0x9+-parseInt(_0x137fba(0x1f2))/0xa+parseInt(_0x137fba(0x1ef))/0xb;if(_0x21d608===_0x378395)break;else _0x529519['push'](_0x529519['shift']());}catch(_0x3c033e){_0x529519['push'](_0x529519['shift']());}}}(a20_0x2d51,0x34ab7));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_0x2d51(){const _0x372ebe=['463401jMRQYs','245AxlMDD','53864AvShhC','2qBveCs','1656764FHMxhb','421615XAqnzy','3894220oFCQsj','6uMidvX','3MFITNy','3903240vQJRLt','106337MFLgxQ'];a20_0x2d51=function(){return _0x372ebe;};return a20_0x2d51();}
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 +1 @@
1
- const a21_0x2976d4=a21_0x5a4f;(function(_0x33423f,_0x1e3768){const _0x48cda9=a21_0x5a4f,_0x127e0d=_0x33423f();while(!![]){try{const _0x49cc1c=-parseInt(_0x48cda9(0xd8))/0x1*(-parseInt(_0x48cda9(0xde))/0x2)+parseInt(_0x48cda9(0xd6))/0x3*(-parseInt(_0x48cda9(0xcc))/0x4)+-parseInt(_0x48cda9(0xe8))/0x5+parseInt(_0x48cda9(0xd5))/0x6+parseInt(_0x48cda9(0xc6))/0x7*(-parseInt(_0x48cda9(0xca))/0x8)+-parseInt(_0x48cda9(0xc9))/0x9*(-parseInt(_0x48cda9(0xcf))/0xa)+parseInt(_0x48cda9(0xe0))/0xb;if(_0x49cc1c===_0x1e3768)break;else _0x127e0d['push'](_0x127e0d['shift']());}catch(_0x84ebd){_0x127e0d['push'](_0x127e0d['shift']());}}}(a21_0x1117,0x91fb1));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 buildItemsFromLayer(_0x5dda43,_0x3b5f6b){const _0x5d6290=a21_0x5a4f,_0x4311c8=[],_0x3829bc=_0x5dda43[_0x5d6290(0xd0)]&&typeof _0x5dda43['apps']===_0x5d6290(0xdc)?_0x5dda43[_0x5d6290(0xd0)]:{},_0x387104=_0x5dda43[_0x5d6290(0xd2)]||undefined;for(const [_0x3a6844,_0x367433]of Object['entries'](_0x3829bc)){if(!_0x367433||typeof _0x367433!=='object'||!_0x367433[_0x5d6290(0xc5)])continue;_0x4311c8[_0x5d6290(0xdd)]({'name':_0x3a6844,'appcode':_0x367433[_0x5d6290(0xc5)],'named':!![],'definedIn':_0x3b5f6b,'isDefault':_0x3a6844===_0x387104,...buildAppProfileListFields(_0x367433)});}return _0x4311c8;}function a21_0x5a4f(_0x21743f,_0x4ee2b3){_0x21743f=_0x21743f-0xc5;const _0x111733=a21_0x1117();let _0x5a4ff2=_0x111733[_0x21743f];return _0x5a4ff2;}function a21_0x1117(){const _0x58fb3b=['Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','3988488bzfgEX','15QtNTJh','projectPath','17vbAVmG','mergedCli','list','globalConfig','object','push','44174AczMXg','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','10872444Ylcpsz','\x20in\x20','\x20config','bool','.\x20Use\x20`','project','inherit','globalPath','2525170dtkHmd','projectConfig','appcode','5683538lPkolX','No\x20apps\x20configured','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','31059MDAgBS','8eiZouW','merged','640380ZFwjEC','read','boolean','1990QszaFk','apps','global','defaultApp','length'];a21_0x1117=function(){return _0x58fb3b;};return a21_0x1117();}function buildMergedItems(_0x2e5fcc,_0x117945){const _0x53e4b4=a21_0x5a4f,{apps:apps={},defaultApp:_0x138a21}=_0x2e5fcc,_0x11b0cd=_0x117945[_0x53e4b4(0xdb)]['apps']&&typeof _0x117945[_0x53e4b4(0xdb)][_0x53e4b4(0xd0)]===_0x53e4b4(0xdc)?_0x117945['globalConfig'][_0x53e4b4(0xd0)]:{},_0x3291db=_0x117945[_0x53e4b4(0xe9)]['apps']&&typeof _0x117945[_0x53e4b4(0xe9)][_0x53e4b4(0xd0)]===_0x53e4b4(0xdc)?_0x117945['projectConfig']['apps']:{},_0xfb6b78=_0x117945[_0x53e4b4(0xe9)][_0x53e4b4(0xe6)]===![],_0x4de258=Object['entries'](apps),_0x5afbae=_0x4de258['map'](([_0x53ee88,_0x37fcf0])=>({'name':_0x53ee88,'appcode':_0x37fcf0[_0x53e4b4(0xc5)],'named':!![],'definedIn':appDefinedIn(_0x53ee88,_0x11b0cd,_0x3291db,_0xfb6b78),'isDefault':_0x53ee88===_0x138a21,...buildAppProfileListFields(_0x37fcf0)}));return _0x5afbae;}async function execute(_0x4bafc4){const _0x1a4046=a21_0x5a4f,_0x3d991c=_0x4bafc4[_0x1a4046(0xe3)](_0x1a4046(0xd1)),_0x3e015d=_0x4bafc4[_0x1a4046(0xe3)](_0x1a4046(0xe5)),_0x4ddc13=_0x3d991c?'global':_0x3e015d?'project':_0x1a4046(0xcb),{config:_0x12c4c9,layers:_0x1f05a1}=readRawConfigWithLayers(),_0x487edc=resolveDefaultAppSource(_0x1f05a1),{defaultApp:_0xe43d90}=_0x12c4c9;let _0x56551b,_0x215de9;switch(_0x4ddc13){case'global':_0x56551b=buildItemsFromLayer(_0x1f05a1[_0x1a4046(0xdb)],_0x1a4046(0xd1)),_0x215de9=_0x1f05a1[_0x1a4046(0xe7)];break;case _0x1a4046(0xe5):_0x56551b=buildItemsFromLayer(_0x1f05a1['projectConfig'],_0x1a4046(0xe5)),_0x215de9=_0x1f05a1[_0x1a4046(0xd7)];break;default:_0x56551b=buildMergedItems(_0x12c4c9,_0x1f05a1);break;}enrichAppListItemsWithMergedSelection(_0x56551b,_0x4bafc4[_0x1a4046(0xd9)]);if(_0x56551b[_0x1a4046(0xd3)]===0x0){const _0x377b0d=_0x4ddc13==='merged'?'':_0x1a4046(0xe1)+_0x4ddc13+_0x1a4046(0xe2);return{'ok':!![],'data':[],'message':_0x1a4046(0xc7)+_0x377b0d+_0x1a4046(0xe4)+CLI_BIN_NAME+_0x1a4046(0xc8)};}const _0x26f03b=_0x56551b['find'](_0x457dea=>_0x457dea['isCurrent']===!![]),_0x5792d0=_0xe43d90??_0x26f03b?.['appcode']??null,_0x5c2e38=_0x4ddc13===_0x1a4046(0xcb)?{'globalPath':_0x1f05a1[_0x1a4046(0xe7)]??null,'projectPath':_0x1f05a1[_0x1a4046(0xd7)]??null,'defaultApp':_0x5792d0,'defaultAppSource':_0xe43d90!=null?_0x487edc:null}:{'scope':_0x4ddc13,'configPath':_0x215de9??null};return{'ok':!![],'data':{'items':_0x56551b,'meta':_0x5c2e38}};}export const appListDefinition={'service':'app','command':a21_0x2976d4(0xda),'description':'List\x20all\x20configured\x20apps','risk':a21_0x2976d4(0xcd),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x2976d4(0xd1),'type':a21_0x2976d4(0xce),'description':a21_0x2976d4(0xdf),'default':![]},{'name':a21_0x2976d4(0xe5),'type':a21_0x2976d4(0xce),'description':a21_0x2976d4(0xd4),'default':![]}],'execute':execute};
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 +1 @@
1
- const a22_0x4e8c54=a22_0x2261;function a22_0xbc79(){const _0x1de115=['bool','\x20app\x20remove\x20<name>\x20[--global]','boolean','high-risk-write','\x20Default\x20app\x20changed\x20to\x20\x22','1097614ovjsJr','Removed\x20app\x20\x22','length','Usage:\x20','App\x20\x22','17310aHeVeN','684CGKeoL','globalConfig','1749736Eclslk','\x20Note:\x20app\x20\x22','app','defaultApp','apps','trim','App\x20profile\x20name\x20to\x20remove','Use\x20global\x20config\x20scope','project','14DdQIfk','\x22\x20not\x20found.','Remove\x20an\x20app\x20from\x20config','remove','\x20config.','args','object','projectConfig','188320ClYvjv','global','keys','validation','387GkHmLE','108SUIPhF','924459qHDVkI','20482935WkFWrv','Missing\x20app\x20name.','51492GtMCyS'];a22_0xbc79=function(){return _0x1de115;};return a22_0xbc79();}(function(_0x2403a6,_0x43c34d){const _0x434cb2=a22_0x2261,_0x59e150=_0x2403a6();while(!![]){try{const _0x578fd0=parseInt(_0x434cb2(0x13b))/0x1+-parseInt(_0x434cb2(0x144))/0x2+parseInt(_0x434cb2(0x13a))/0x3*(parseInt(_0x434cb2(0x13e))/0x4)+parseInt(_0x434cb2(0x149))/0x5*(parseInt(_0x434cb2(0x14a))/0x6)+parseInt(_0x434cb2(0x12d))/0x7*(parseInt(_0x434cb2(0x14c))/0x8)+parseInt(_0x434cb2(0x139))/0x9*(parseInt(_0x434cb2(0x135))/0xa)+-parseInt(_0x434cb2(0x13c))/0xb;if(_0x578fd0===_0x43c34d)break;else _0x59e150['push'](_0x59e150['shift']());}catch(_0x37388c){_0x59e150['push'](_0x59e150['shift']());}}}(a22_0xbc79,0x97179));import{CliErrors}from'../../errors.js';function a22_0x2261(_0x48ec35,_0x36b6e6){_0x48ec35=_0x48ec35-0x12d;const _0xbc7932=a22_0xbc79();let _0x2261a7=_0xbc7932[_0x48ec35];return _0x2261a7;}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(_0x4e921e){const _0x32a283=a22_0x2261,_0x4e218b=_0x4e921e['args'][0x0]?.['trim']();if(!_0x4e218b)throw CliErrors[_0x32a283(0x138)](_0x32a283(0x13d),_0x32a283(0x147)+CLI_BIN_NAME+_0x32a283(0x140));}async function execute(_0x108202){const _0x1d2140=a22_0x2261,_0x5a0ec3=_0x108202[_0x1d2140(0x132)][0x0]?.[_0x1d2140(0x151)]();if(!_0x5a0ec3)throw CliErrors[_0x1d2140(0x138)]('Missing\x20app\x20name.',_0x1d2140(0x147)+CLI_BIN_NAME+_0x1d2140(0x140));const _0x18bfc9=_0x108202[_0x1d2140(0x13f)]('global'),{config:_0x3b66fa,layers:_0x5c30cc}=readRawConfigWithLayers(),_0x8626bc=_0x3b66fa[_0x1d2140(0x150)]??{};if(!_0x8626bc[_0x5a0ec3])throw CliErrors['validation']('App\x20\x22'+_0x5a0ec3+_0x1d2140(0x12e));const _0x1e67c7=_0x5c30cc['globalConfig'][_0x1d2140(0x150)]&&typeof _0x5c30cc[_0x1d2140(0x14b)][_0x1d2140(0x150)]==='object'?_0x5c30cc[_0x1d2140(0x14b)]['apps']:{},_0x23dba4=_0x5c30cc[_0x1d2140(0x134)]['apps']&&typeof _0x5c30cc[_0x1d2140(0x134)][_0x1d2140(0x150)]===_0x1d2140(0x133)?_0x5c30cc[_0x1d2140(0x134)][_0x1d2140(0x150)]:{},_0x4d1cac=appDefinedIn(_0x5a0ec3,_0x1e67c7,_0x23dba4,_0x5c30cc[_0x1d2140(0x134)]['inherit']===![]),_0x470378=resolveAppScopeForWrite(_0x5a0ec3,_0x18bfc9,_0x5c30cc),_0x549142={'global':_0x470378===_0x1d2140(0x136)},_0x308374=readConfig(_0x549142),_0xa5acb6=_0x308374['apps'];if(!_0xa5acb6||!_0xa5acb6[_0x5a0ec3])throw CliErrors[_0x1d2140(0x138)](_0x1d2140(0x148)+_0x5a0ec3+_0x1d2140(0x12e));delete _0xa5acb6[_0x5a0ec3];let _0x559b37='';if(_0x308374[_0x1d2140(0x14f)]===_0x5a0ec3){const _0x4728a6=Object[_0x1d2140(0x137)](_0xa5acb6);_0x308374['defaultApp']=_0x4728a6[_0x1d2140(0x146)]>0x0?_0x4728a6[0x0]:undefined,_0x308374[_0x1d2140(0x14f)]?_0x559b37=_0x1d2140(0x143)+_0x308374[_0x1d2140(0x14f)]+'\x22.':delete _0x308374[_0x1d2140(0x14f)];}Object[_0x1d2140(0x137)](_0xa5acb6)[_0x1d2140(0x146)]===0x0&&(delete _0x308374['apps'],delete _0x308374['defaultApp']);writeConfig(_0x308374,_0x549142);const _0x1520a5=_0x4d1cac==='both'?_0x1d2140(0x14d)+_0x5a0ec3+'\x22\x20still\x20defined\x20in\x20'+(_0x470378===_0x1d2140(0x154)?'global':_0x1d2140(0x154))+_0x1d2140(0x131):'';return{'ok':!![],'message':_0x1d2140(0x145)+_0x5a0ec3+'\x22'+scopeLabel(_0x549142)+'.'+_0x559b37+_0x1520a5};}export const appRemoveDefinition={'service':a22_0x4e8c54(0x14e),'command':a22_0x4e8c54(0x130),'description':a22_0x4e8c54(0x12f),'risk':a22_0x4e8c54(0x142),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a22_0x4e8c54(0x152),'required':!![]}],'flags':[{'name':a22_0x4e8c54(0x136),'type':a22_0x4e8c54(0x141),'description':a22_0x4e8c54(0x153),'default':![]}],'validate':validateArgs,'execute':execute};
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 +1 @@
1
- (function(_0x50fcba,_0x20fc0d){const _0x1457f2=a23_0x4d6f,_0x3efbca=_0x50fcba();while(!![]){try{const _0x534879=parseInt(_0x1457f2(0xf2))/0x1*(parseInt(_0x1457f2(0xef))/0x2)+-parseInt(_0x1457f2(0xf9))/0x3+parseInt(_0x1457f2(0x106))/0x4+parseInt(_0x1457f2(0xf1))/0x5*(-parseInt(_0x1457f2(0xfc))/0x6)+parseInt(_0x1457f2(0xf6))/0x7+parseInt(_0x1457f2(0xfd))/0x8*(parseInt(_0x1457f2(0x109))/0x9)+parseInt(_0x1457f2(0x10c))/0xa*(-parseInt(_0x1457f2(0x103))/0xb);if(_0x534879===_0x20fc0d)break;else _0x3efbca['push'](_0x3efbca['shift']());}catch(_0x4e1055){_0x3efbca['push'](_0x3efbca['shift']());}}}(a23_0x2b5c,0xebff2));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x39c029,_0x24a71c){const _0xb80c9b=a23_0x4d6f;if(!_0x24a71c)return;const _0x396587=_0x24a71c[_0xb80c9b(0x10a)]&&typeof _0x24a71c[_0xb80c9b(0x10a)]===_0xb80c9b(0xf8)?_0x24a71c[_0xb80c9b(0x10a)]:{},_0x474f99=Object[_0xb80c9b(0xfa)](_0x396587)['length']>0x0;for(const _0x5bbca8 of _0x39c029){_0x5bbca8[_0xb80c9b(0xf7)]=![];}const _0x4bc62c=_0x24a71c[_0xb80c9b(0xf4)]!=null?String(_0x24a71c[_0xb80c9b(0xf4)])[_0xb80c9b(0xfe)]():'';if(_0x474f99){const _0x3aa303=_0x24a71c['currentApp']??_0x24a71c[_0xb80c9b(0x107)];if(_0x3aa303)for(const _0x4e366b of _0x39c029){_0x4e366b[_0xb80c9b(0x105)]===!![]&&_0x4e366b[_0xb80c9b(0xff)]===_0x3aa303&&(_0x4e366b[_0xb80c9b(0xf7)]=!![]);}for(const _0x3bcb18 of _0x39c029){if(_0x3bcb18[_0xb80c9b(0x105)]!==![])continue;if(_0x24a71c[_0xb80c9b(0x107)])continue;_0x4bc62c&&String(_0x3bcb18['appcode']??'')[_0xb80c9b(0xfe)]()===_0x4bc62c&&(_0x3bcb18[_0xb80c9b(0xf7)]=!![]);}return;}if(!_0x4bc62c)return;for(const _0x1021dc of _0x39c029){String(_0x1021dc[_0xb80c9b(0x108)]??'')['trim']()===_0x4bc62c&&(_0x1021dc[_0xb80c9b(0xf7)]=!![]);}}export function resolveAppScopeForWrite(_0x5a9999,_0x214dcf,_0x1f53c4){const _0x1e6879=a23_0x4d6f;if(_0x214dcf)return _0x1e6879(0xf0);const _0x594682=_0x1f53c4['projectConfig']['apps']&&typeof _0x1f53c4['projectConfig'][_0x1e6879(0x10a)]===_0x1e6879(0xf8)?_0x1f53c4[_0x1e6879(0x10b)]['apps']:{},_0x87ff34=_0x1f53c4[_0x1e6879(0x104)][_0x1e6879(0x10a)]&&typeof _0x1f53c4[_0x1e6879(0x104)]['apps']===_0x1e6879(0xf8)?_0x1f53c4[_0x1e6879(0x104)][_0x1e6879(0x10a)]:{};if(Object[_0x1e6879(0xf3)]['hasOwnProperty'][_0x1e6879(0x102)](_0x594682,_0x5a9999))return _0x1e6879(0x101);if(Object[_0x1e6879(0xf3)]['hasOwnProperty']['call'](_0x87ff34,_0x5a9999))return _0x1e6879(0xf0);return _0x1e6879(0x101);}export function appDefinedIn(_0x363342,_0x36eddf,_0x215f6e,_0x28ec76){const _0x4a0553=a23_0x4d6f;if(_0x28ec76)return Object['prototype']['hasOwnProperty'][_0x4a0553(0x102)](_0x215f6e,_0x363342)?_0x4a0553(0x101):_0x4a0553(0xf0);const _0x378bf7=Object[_0x4a0553(0xf3)][_0x4a0553(0x100)][_0x4a0553(0x102)](_0x36eddf,_0x363342),_0x5a6771=Object[_0x4a0553(0xf3)]['hasOwnProperty'][_0x4a0553(0x102)](_0x215f6e,_0x363342);if(_0x378bf7&&_0x5a6771)return'both';if(_0x5a6771)return _0x4a0553(0x101);return _0x4a0553(0xf0);}export function resolveDefaultAppSource(_0x4935f6){const _0x48b3cd=a23_0x4d6f,_0x12fd9f=_0x4935f6[_0x48b3cd(0x10b)][_0x48b3cd(0x10a)]&&typeof _0x4935f6[_0x48b3cd(0x10b)][_0x48b3cd(0x10a)]===_0x48b3cd(0xf8)?_0x4935f6[_0x48b3cd(0x10b)][_0x48b3cd(0x10a)]:{};if(_0x48b3cd(0x107)in _0x4935f6[_0x48b3cd(0x10b)])return _0x48b3cd(0x101);if(Object[_0x48b3cd(0xfa)](_0x12fd9f)[_0x48b3cd(0xf5)]>0x0)return _0x48b3cd(0x101);if(_0x4935f6[_0x48b3cd(0x10b)]['inherit']===![])return null;if(_0x4935f6[_0x48b3cd(0x104)][_0x48b3cd(0x107)])return _0x48b3cd(0xf0);return null;}export function getConfigPath(_0x3dc3ee={}){const _0x1c7e48=a23_0x4d6f,_0x25ce76=_0x3dc3ee['global']?_0x1c7e48(0xf0):_0x1c7e48(0x101);return resolveWriteConfigPath(_0x25ce76);}function a23_0x2b5c(){const _0x62f43f=['22202ZwZXCx','global','5gAaCYH','139lDXBRt','prototype','appCode','length','1473269MzjByr','isCurrent','object','5092404VzCLPA','keys','\x20(global)','2704866OJbpLo','56BeCizz','trim','name','hasOwnProperty','project','call','143gqZLsP','globalConfig','named','3466820XtgdWI','defaultApp','appcode','895311iAEzBU','apps','projectConfig','155110RavltE'];a23_0x2b5c=function(){return _0x62f43f;};return a23_0x2b5c();}export function readConfig(_0x4a0dbe={}){return readConfigFile(getConfigPath(_0x4a0dbe));}export function writeConfig(_0x235b2d,_0x22690e={}){writeConfigFile(getConfigPath(_0x22690e),_0x235b2d);}function a23_0x4d6f(_0x1a1f74,_0x4d0be3){_0x1a1f74=_0x1a1f74-0xef;const _0x2b5c=a23_0x2b5c();let _0x4d6f3a=_0x2b5c[_0x1a1f74];return _0x4d6f3a;}export function scopeLabel(_0x36bdc5){const _0x1bd363=a23_0x4d6f;return _0x36bdc5[_0x1bd363(0xf0)]?_0x1bd363(0xfb):'';}
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 +1 @@
1
- const a24_0x48dda8=a24_0x2457;(function(_0x1b7b97,_0x33b061){const _0x400fc0=a24_0x2457,_0x198500=_0x1b7b97();while(!![]){try{const _0x7a07cf=parseInt(_0x400fc0(0xf7))/0x1*(-parseInt(_0x400fc0(0xcf))/0x2)+parseInt(_0x400fc0(0xe4))/0x3*(-parseInt(_0x400fc0(0xf2))/0x4)+-parseInt(_0x400fc0(0xf5))/0x5*(parseInt(_0x400fc0(0xd2))/0x6)+-parseInt(_0x400fc0(0xe1))/0x7*(parseInt(_0x400fc0(0xd1))/0x8)+-parseInt(_0x400fc0(0xeb))/0x9*(-parseInt(_0x400fc0(0xf6))/0xa)+-parseInt(_0x400fc0(0xed))/0xb+parseInt(_0x400fc0(0xf4))/0xc*(parseInt(_0x400fc0(0xdd))/0xd);if(_0x7a07cf===_0x33b061)break;else _0x198500['push'](_0x198500['shift']());}catch(_0x18abb4){_0x198500['push'](_0x198500['shift']());}}}(a24_0x1e21,0x1ed3c));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a24_0x2457(_0xe5e40d,_0xf87d2b){_0xe5e40d=_0xe5e40d-0xcb;const _0x1e21d0=a24_0x1e21();let _0x245710=_0x1e21d0[_0xe5e40d];return _0x245710;}import{readRawConfigWithLayers,isInProject}from'../../context.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x189284){const _0x55236f=a24_0x2457,_0x4d5e7a=_0x189284[_0x55236f(0xcd)][0x0]?.[_0x55236f(0xd7)]();if(!_0x4d5e7a)throw CliErrors[_0x55236f(0xd8)](_0x55236f(0xea),_0x55236f(0xee)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');}function a24_0x1e21(){const _0x35e8f9=['trim','validation','\x22\x20(appcode:\x20','app','\x22\x20not\x20found.','keys','3406Voefqq','App\x20\x22','write','apps','3269EnpySh','\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.','projectPath','449679GtDTel','\x20app\x20use\x20<name>\x20[--global]','bool','Use\x20`','appcode','global','Missing\x20app\x20name.','348021dtzbUo','join','452628ekybuL','Usage:\x20','App\x20profile\x20name\x20to\x20activate','boolean','name','4hRpAXn','Use\x20global\x20config\x20scope','9504kMmlIJ','5qleXlM','50aqNrqc','1642TzlyNB','call','\x0aNote:\x20\x22','args','projectConfig','6fGqXpQ','hasOwnProperty','792jUsBrH','194286KTSOwv','length','Switch\x20the\x20default\x20app','use','prototype'];a24_0x1e21=function(){return _0x35e8f9;};return a24_0x1e21();}async function execute(_0x3a8464){const _0x37b60d=a24_0x2457,_0x434664=_0x3a8464[_0x37b60d(0xcd)][0x0]?.[_0x37b60d(0xd7)]();if(!_0x434664)throw CliErrors[_0x37b60d(0xd8)]('Missing\x20app\x20name.',_0x37b60d(0xee)+CLI_BIN_NAME+_0x37b60d(0xe5));const _0x5d4e92=_0x3a8464[_0x37b60d(0xe6)](_0x37b60d(0xe9)),{config:_0x2827b9,layers:_0x182563}=readRawConfigWithLayers(),_0x1acb86=_0x2827b9[_0x37b60d(0xe0)]??{};if(!_0x1acb86[_0x434664]){const _0x16934d=Object[_0x37b60d(0xdc)](_0x1acb86),_0x45a4b5=_0x16934d[_0x37b60d(0xd3)]===0x0?_0x37b60d(0xe7)+CLI_BIN_NAME+'\x20app\x20add\x20'+_0x434664+'\x20--appcode\x20<code>`\x20first.':'Available:\x20'+_0x16934d[_0x37b60d(0xec)](',\x20');throw CliErrors[_0x37b60d(0xd8)](_0x37b60d(0xde)+_0x434664+_0x37b60d(0xdb),_0x45a4b5);}let _0x489dc1,_0x376db3='';if(_0x5d4e92)_0x489dc1={'global':!![]};else{const _0x4577a7=isInProject()&&!!_0x182563[_0x37b60d(0xe3)];_0x489dc1={'global':!_0x4577a7};if(_0x4577a7){const _0x54d706=_0x182563[_0x37b60d(0xce)][_0x37b60d(0xe0)]&&typeof _0x182563['projectConfig'][_0x37b60d(0xe0)]==='object'?_0x182563[_0x37b60d(0xce)][_0x37b60d(0xe0)]:{};!Object[_0x37b60d(0xd6)][_0x37b60d(0xd0)][_0x37b60d(0xcb)](_0x54d706,_0x434664)&&(_0x376db3=_0x37b60d(0xcc)+_0x434664+_0x37b60d(0xe2));}}const _0x45f0cc=readConfig(_0x489dc1);return _0x45f0cc['defaultApp']=_0x434664,writeConfig(_0x45f0cc,_0x489dc1),{'ok':!![],'message':'Default\x20app\x20set\x20to\x20\x22'+_0x434664+_0x37b60d(0xd9)+_0x1acb86[_0x434664][_0x37b60d(0xe8)]+')'+scopeLabel(_0x489dc1)+_0x376db3};}export const appUseDefinition={'service':a24_0x48dda8(0xda),'command':a24_0x48dda8(0xd5),'description':a24_0x48dda8(0xd4),'risk':a24_0x48dda8(0xdf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a24_0x48dda8(0xf1),'description':a24_0x48dda8(0xef),'required':!![]}],'flags':[{'name':a24_0x48dda8(0xe9),'type':a24_0x48dda8(0xf0),'description':a24_0x48dda8(0xf3),'default':![]}],'validate':validateArgs,'execute':execute};
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 +1 @@
1
- const a25_0x26d661=a25_0x28f8;function a25_0x28f8(_0x10c800,_0x533730){_0x10c800=_0x10c800-0x146;const _0x5dbade=a25_0x5dba();let _0x28f8fe=_0x5dbade[_0x10c800];return _0x28f8fe;}(function(_0x97a213,_0x297997){const _0x2d8a5f=a25_0x28f8,_0x1bb5d9=_0x97a213();while(!![]){try{const _0x1a4e8f=-parseInt(_0x2d8a5f(0x156))/0x1+-parseInt(_0x2d8a5f(0x159))/0x2*(parseInt(_0x2d8a5f(0x153))/0x3)+parseInt(_0x2d8a5f(0x148))/0x4*(parseInt(_0x2d8a5f(0x149))/0x5)+-parseInt(_0x2d8a5f(0x154))/0x6*(parseInt(_0x2d8a5f(0x14d))/0x7)+parseInt(_0x2d8a5f(0x14c))/0x8*(parseInt(_0x2d8a5f(0x157))/0x9)+-parseInt(_0x2d8a5f(0x152))/0xa*(parseInt(_0x2d8a5f(0x14a))/0xb)+parseInt(_0x2d8a5f(0x151))/0xc;if(_0x1a4e8f===_0x297997)break;else _0x1bb5d9['push'](_0x1bb5d9['shift']());}catch(_0x585982){_0x1bb5d9['push'](_0x1bb5d9['shift']());}}}(a25_0x5dba,0x8cfda));import{unlinkSync,existsSync}from'node:fs';function a25_0x5dba(){const _0x1fa09b=['218614aGGtiZ','Login\x20via\x20browser','log','Clear\x20login\x20session','1852GzaHwY','10615CvfLMV','8740996IIedZX','logout','555920wMTlnw','2877ANRffG','write','login','✓\x20Logged\x20out','6693060KgOgcq','10UQnEtg','3dMDyfy','4266Yhdetq','read','253472VJOtDX','63oHYxhC','auth'];a25_0x5dba=function(){return _0x1fa09b;};return a25_0x5dba();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a25_0x26d661(0x14f),'description':a25_0x26d661(0x15a),'risk':a25_0x26d661(0x155),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3947e9){const {runAuthServer:_0x5bbd60}=await import('../../auth/auth-server-ui.js');return await _0x5bbd60(),{'ok':!![]};}},{'service':a25_0x26d661(0x158),'command':a25_0x26d661(0x14b),'description':a25_0x26d661(0x147),'risk':a25_0x26d661(0x14e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1270b7){const _0x59a9e5=a25_0x26d661;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x59a9e5(0x150))):console[_0x59a9e5(0x146)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
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 +1 @@
1
- const a26_0x2b38d1=a26_0x2ba6;(function(_0x5e6275,_0x3aab1b){const _0x52edba=a26_0x2ba6,_0x2ce0db=_0x5e6275();while(!![]){try{const _0x4cafba=parseInt(_0x52edba(0xae))/0x1+parseInt(_0x52edba(0xac))/0x2*(-parseInt(_0x52edba(0xb0))/0x3)+parseInt(_0x52edba(0xbb))/0x4*(-parseInt(_0x52edba(0xb2))/0x5)+-parseInt(_0x52edba(0xb7))/0x6*(parseInt(_0x52edba(0xc5))/0x7)+parseInt(_0x52edba(0xc7))/0x8*(-parseInt(_0x52edba(0xa9))/0x9)+parseInt(_0x52edba(0xc0))/0xa*(parseInt(_0x52edba(0xb6))/0xb)+parseInt(_0x52edba(0xc6))/0xc;if(_0x4cafba===_0x3aab1b)break;else _0x2ce0db['push'](_0x2ce0db['shift']());}catch(_0x4bfee5){_0x2ce0db['push'](_0x2ce0db['shift']());}}}(a26_0x493d,0x24c36));function a26_0x2ba6(_0x26b615,_0x682774){_0x26b615=_0x26b615-0xa3;const _0x493d9f=a26_0x493d();let _0x2ba634=_0x493d9f[_0x26b615];return _0x2ba634;}function a26_0x493d(){const _0x2be155=['Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','Would\x20delete\x20','join','\x20(local\x20file\x20moved\x20to\x20trash)','length','startsWith','1908702GPDWff','validation','remoteId','2warWfr','str','192605sDBrsN','projectRoot','9642tpnktw','No\x20lock\x20entry\x20found\x20for\x20\x22','113055ZjSKbA','high-risk-write','toISOString','POST','2332088UKKVUj','618BIAePE','appCode','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','scriptsRoot','52KUPgmT','find','delete','lastSync','trashDir','10UVyVvn','split','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','Function\x20not\x20found:\x20','includes','5943sOjXYJ','4111812BEnmsb','8WUvdrp','scriptsRootDir','lockFilePath','target','map','functions','Deleted\x20','string','BFF\x20lock\x20file\x20not\x20found.'];a26_0x493d=function(){return _0x2be155;};return a26_0x493d();}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':'bff','command':a26_0x2b38d1(0xbd),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a26_0x2b38d1(0xb3),'flags':[{'name':'target','type':a26_0x2b38d1(0xce),'required':!![],'description':a26_0x2b38d1(0xa3)}],async 'validate'(_0x5e02d8){const _0x39341d=a26_0x2b38d1,_0x318b38=loadBffProjectConfig(_0x5e02d8[_0x39341d(0xb8)]),_0x58cfd9=await readBffLockFile(_0x318b38[_0x39341d(0xc9)]);if(!_0x58cfd9)throw CliErrors[_0x39341d(0xaa)](_0x39341d(0xc2));},async 'dryRun'(_0x324e07){const _0x5c56a4=a26_0x2b38d1,_0x37ff2d=loadBffProjectConfig(_0x324e07['appCode']),_0x5a8d22=await readBffLockFile(_0x37ff2d[_0x5c56a4(0xc9)]);if(!_0x5a8d22)throw CliErrors[_0x5c56a4(0xaa)](_0x5c56a4(0xcf));const {appLock:_0x4955db}=ensureLockScope(_0x5a8d22,_0x324e07[_0x5c56a4(0xb8)],_0x37ff2d[_0x5c56a4(0xba)],_0x5c56a4(0xbd)),_0x3ca8ec=_0x324e07[_0x5c56a4(0xad)]('target'),_0x10c066=Object['keys'](_0x4955db[_0x5c56a4(0xcc)]),_0x3345eb=resolveDeleteTarget(_0x3ca8ec,_0x10c066),_0x388dc5=_0x4955db['functions'][_0x3345eb];if(!_0x388dc5)throw CliErrors[_0x5c56a4(0xaa)](_0x5c56a4(0xb1)+_0x3345eb+'\x22.');const _0x1be61f=resolveLocalFilePathFromLockKey(_0x37ff2d,_0x3345eb),_0x27132b=relative(_0x37ff2d[_0x5c56a4(0xaf)],_0x1be61f),_0x2c63ce=join(_0x37ff2d['trashDir'],'<timestamp>',_0x27132b);return{'method':_0x5c56a4(0xb5),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x324e07[_0x5c56a4(0xb8)],'target':_0x3345eb,'remoteId':_0x388dc5['remoteId'],'localFilePath':_0x1be61f,'trashedPath':_0x2c63ce},'description':_0x5c56a4(0xa4)+_0x3345eb+_0x5c56a4(0xb9)};},async 'execute'(_0x5e7dff){const _0x26cb87=a26_0x2b38d1,_0x2275d2=loadBffProjectConfig(_0x5e7dff[_0x26cb87(0xb8)]),_0x28889b=await readBffLockFile(_0x2275d2[_0x26cb87(0xc9)]);if(!_0x28889b)throw CliErrors[_0x26cb87(0xaa)](_0x26cb87(0xcf));const {lockData:_0x30924c,appLock:_0x15d401}=ensureLockScope(_0x28889b,_0x5e7dff[_0x26cb87(0xb8)],_0x2275d2[_0x26cb87(0xba)],_0x26cb87(0xbd)),_0x2c371a=_0x5e7dff[_0x26cb87(0xad)](_0x26cb87(0xca)),_0x30da32=Object['keys'](_0x15d401['functions']),_0xb46ee=resolveDeleteTarget(_0x2c371a,_0x30da32),_0x38ecc3=_0x15d401[_0x26cb87(0xcc)][_0xb46ee];if(!_0x38ecc3)throw CliErrors[_0x26cb87(0xaa)](_0x26cb87(0xb1)+_0xb46ee+'\x22.');await deleteBffScript(_0x38ecc3['remoteId']),delete _0x15d401['functions'][_0xb46ee],_0x15d401[_0x26cb87(0xbe)]=new Date()['toISOString'](),await writeBffLockFile(_0x2275d2[_0x26cb87(0xc9)],_0x30924c);const _0x2b5c87=resolveLocalFilePathFromLockKey(_0x2275d2,_0xb46ee);let _0x146693;await fileExists(_0x2b5c87)&&(_0x146693=await moveToTrash(_0x2275d2[_0x26cb87(0xaf)],_0x2275d2[_0x26cb87(0xbf)],_0x2b5c87),await cleanupEmptyDirectories(dirname(_0x2b5c87),_0x2275d2[_0x26cb87(0xc8)]));const _0xdb28ff={'deleted':_0xb46ee,'remoteId':_0x38ecc3[_0x26cb87(0xab)]};if(_0x146693)_0xdb28ff['trashedTo']=_0x146693;return{'ok':!![],'data':_0xdb28ff,'message':_0x26cb87(0xcd)+_0xb46ee+(_0x146693?_0x26cb87(0xa6):'')};}};function resolveDeleteTarget(_0x54ce44,_0x4a82ad){const _0xe5fca9=a26_0x2b38d1;if(_0x54ce44[_0xe5fca9(0xc4)]('/')){const _0x3c13dd=_0x4a82ad[_0xe5fca9(0xbc)](_0xc875ea=>_0xc875ea===_0x54ce44);if(!_0x3c13dd)throw CliErrors[_0xe5fca9(0xaa)]('Function\x20not\x20found:\x20'+_0x54ce44);return _0x3c13dd;}const _0x1e5958=_0x4a82ad['filter'](_0x49302f=>_0x49302f[_0xe5fca9(0xc1)]('/')['at'](-0x1)===_0x54ce44);if(_0x1e5958[_0xe5fca9(0xa7)]===0x0)throw CliErrors[_0xe5fca9(0xaa)](_0xe5fca9(0xc3)+_0x54ce44);if(_0x1e5958[_0xe5fca9(0xa7)]>0x1)throw CliErrors[_0xe5fca9(0xaa)]('Multiple\x20functions\x20match\x20\x22'+_0x54ce44+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x1e5958[_0xe5fca9(0xcb)](_0x131844=>'\x20\x20-\x20'+_0x131844)[_0xe5fca9(0xa5)]('\x0a'));return _0x1e5958[0x0];}async function moveToTrash(_0x1e2349,_0x407d27,_0x1d7580){const _0x21267b=a26_0x2b38d1,_0x39dda8=new Date()[_0x21267b(0xb4)]()['replace'](/[:.]/g,'-'),_0x374ab9=relative(_0x1e2349,_0x1d7580),_0x10e94d=join(_0x407d27,_0x39dda8,_0x374ab9);return await mkdir(dirname(_0x10e94d),{'recursive':!![]}),await rename(_0x1d7580,_0x10e94d),_0x10e94d;}async function cleanupEmptyDirectories(_0x93f204,_0x586feb){const _0x9490ae=a26_0x2b38d1;let _0x3713b9=resolve(_0x93f204);const _0x1466e1=resolve(_0x586feb);while(_0x3713b9[_0x9490ae(0xa8)](''+_0x1466e1+sep)||_0x3713b9===_0x1466e1){if(_0x3713b9===_0x1466e1)return;try{const _0x180088=await readdir(_0x3713b9);if(_0x180088[_0x9490ae(0xa7)]>0x0)return;await rmdir(_0x3713b9);}catch{return;}_0x3713b9=dirname(_0x3713b9);}}
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 +1 @@
1
- const a27_0x5a63be=a27_0x27bc;function a27_0x1ac3(){const _0x1e4850=['boolean','read','172843Nmhotp','6FJtsnJ','(none)','13uqdQNe','604174fYXBdv','835165OUZupL','scriptContent','verbose','921HxWomx','number','10116yManfQ','10dqwUyj','bool','updatedTime','description','Return\x20full\x20raw\x20script\x20object','598073vyoZro','1DXDAIi','24hzzslT','904zrascB','4082344iAJdnr','324jyAapg','appCode'];a27_0x1ac3=function(){return _0x1e4850;};return a27_0x1ac3();}function a27_0x27bc(_0x5845ff,_0x36b959){_0x5845ff=_0x5845ff-0x17e;const _0x1ac3ab=a27_0x1ac3();let _0x27bca7=_0x1ac3ab[_0x5845ff];return _0x27bca7;}(function(_0x68f166,_0x38e81e){const _0x3ba969=a27_0x27bc,_0x484e95=_0x68f166();while(!![]){try{const _0x577f03=-parseInt(_0x3ba969(0x18f))/0x1*(parseInt(_0x3ba969(0x182))/0x2)+parseInt(_0x3ba969(0x186))/0x3*(-parseInt(_0x3ba969(0x191))/0x4)+-parseInt(_0x3ba969(0x183))/0x5*(-parseInt(_0x3ba969(0x17f))/0x6)+-parseInt(_0x3ba969(0x18e))/0x7*(parseInt(_0x3ba969(0x190))/0x8)+-parseInt(_0x3ba969(0x188))/0x9*(-parseInt(_0x3ba969(0x189))/0xa)+-parseInt(_0x3ba969(0x17e))/0xb*(-parseInt(_0x3ba969(0x193))/0xc)+parseInt(_0x3ba969(0x181))/0xd*(parseInt(_0x3ba969(0x192))/0xe);if(_0x577f03===_0x38e81e)break;else _0x484e95['push'](_0x484e95['shift']());}catch(_0x39818f){_0x484e95['push'](_0x484e95['shift']());}}}(a27_0x1ac3,0x3e8da));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':'detail','description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a27_0x5a63be(0x196),'flags':[{'name':'id','type':a27_0x5a63be(0x187),'required':!![],'description':'Script\x20ID'},{'name':'verbose','type':a27_0x5a63be(0x195),'description':a27_0x5a63be(0x18d)}],async 'execute'(_0x4070ff){const _0x970a74=a27_0x5a63be,_0x5d53d0=await getBffScriptInfo(_0x4070ff['num']('id')),_0x209ec4=_0x4070ff[_0x970a74(0x18a)](_0x970a74(0x185));if(_0x209ec4)return{'ok':!![],'data':_0x5d53d0};return{'ok':!![],'data':{'id':_0x5d53d0['id'],'appCode':_0x5d53d0[_0x970a74(0x194)],'scriptType':_0x5d53d0['scriptType'],'description':_0x5d53d0[_0x970a74(0x18c)]||_0x970a74(0x180),'createdTime':_0x5d53d0['createdTime']??'','updatedTime':_0x5d53d0[_0x970a74(0x18b)]??'','scriptContent':_0x5d53d0[_0x970a74(0x184)]??''}};}};
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 +1 @@
1
- (function(_0x43efbe,_0x2b3c71){const _0x3572aa=a28_0x1abc,_0x413ce9=_0x43efbe();while(!![]){try{const _0x453a20=parseInt(_0x3572aa(0x15b))/0x1*(-parseInt(_0x3572aa(0x15e))/0x2)+-parseInt(_0x3572aa(0x15d))/0x3+parseInt(_0x3572aa(0x15c))/0x4+parseInt(_0x3572aa(0x15a))/0x5+-parseInt(_0x3572aa(0x160))/0x6+-parseInt(_0x3572aa(0x159))/0x7+parseInt(_0x3572aa(0x15f))/0x8;if(_0x453a20===_0x2b3c71)break;else _0x413ce9['push'](_0x413ce9['shift']());}catch(_0x24b64b){_0x413ce9['push'](_0x413ce9['shift']());}}}(a28_0xe711,0xedacc));function a28_0x1abc(_0x562d8c,_0x24e89a){_0x562d8c=_0x562d8c-0x159;const _0xe71197=a28_0xe711();let _0x1abc1a=_0xe71197[_0x562d8c];return _0x1abc1a;}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];function a28_0xe711(){const _0x4da569=['8763006dvVLcB','7790890kCwZCQ','6746mRxleB','1143888PCmDZl','2082063UuLgao','116LLWqJv','19915424faMAjl','6137490RCoDeG'];a28_0xe711=function(){return _0x4da569;};return a28_0xe711();}
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 +1 @@
1
- const a29_0x1ee724=a29_0x2a9a;(function(_0x5930f6,_0x22bacd){const _0x291aa6=a29_0x2a9a,_0x515f90=_0x5930f6();while(!![]){try{const _0x58a57a=parseInt(_0x291aa6(0xf4))/0x1*(parseInt(_0x291aa6(0xe7))/0x2)+parseInt(_0x291aa6(0xe4))/0x3+-parseInt(_0x291aa6(0xe2))/0x4+-parseInt(_0x291aa6(0xf0))/0x5+parseInt(_0x291aa6(0xdb))/0x6+-parseInt(_0x291aa6(0xf2))/0x7*(parseInt(_0x291aa6(0xda))/0x8)+parseInt(_0x291aa6(0xe6))/0x9;if(_0x58a57a===_0x22bacd)break;else _0x515f90['push'](_0x515f90['shift']());}catch(_0x3490d6){_0x515f90['push'](_0x515f90['shift']());}}}(a29_0x3af4,0xc5b4c));function a29_0x3af4(){const _0x1fd589=['functionName','verbose','string','Return\x20full\x20script\x20objects','bool','list','2304928sPOSWA','description','1400520szZNgR','Script\x20type\x20filter','8505279WTinsc','6luGscO','ENDPOINT','str','appCode','Filter\x20by\x20script\x20name','name','boolean','List\x20BFF\x20scripts','No\x20BFF\x20scripts\x20found.','7484070JmELKZ','(unnamed)','7GaTEQS','scriptType','516707tNuOmA','3400840pynMbC','2075778YLHJdk'];a29_0x3af4=function(){return _0x1fd589;};return a29_0x3af4();}function a29_0x2a9a(_0x2185d6,_0x216dc1){_0x2185d6=_0x2185d6-0xda;const _0x3af43b=a29_0x3af4();let _0x2a9a3d=_0x3af43b[_0x2185d6];return _0x2a9a3d;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a29_0x1ee724(0xe1),'description':a29_0x1ee724(0xee),'risk':'read','flags':[{'name':'type','type':'string','description':a29_0x1ee724(0xe5),'default':a29_0x1ee724(0xe8),'enum':[a29_0x1ee724(0xe8),'COMMON']},{'name':a29_0x1ee724(0xec),'type':a29_0x1ee724(0xde),'description':a29_0x1ee724(0xeb)},{'name':'verbose','type':a29_0x1ee724(0xed),'description':a29_0x1ee724(0xdf)}],async 'execute'(_0x1d0bc4){const _0x4381c3=a29_0x1ee724,_0x12ff6c=await listBffScripts(_0x1d0bc4[_0x4381c3(0xea)],_0x1d0bc4['str']('type'),{'scriptName':_0x1d0bc4[_0x4381c3(0xe9)](_0x4381c3(0xec))||undefined}),_0x3a63a2=_0x1d0bc4[_0x4381c3(0xe0)](_0x4381c3(0xdd));return{'ok':!![],'data':_0x3a63a2?_0x12ff6c:_0x12ff6c['map'](_0x53cbd4=>({'id':_0x53cbd4['id'],'functionName':_0x53cbd4[_0x4381c3(0xdc)]??'','description':_0x53cbd4[_0x4381c3(0xe3)]||_0x4381c3(0xf1),'scriptType':_0x53cbd4[_0x4381c3(0xf3)]})),'message':_0x12ff6c['length']===0x0?_0x4381c3(0xef):undefined};}};
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 +1 @@
1
- const a30_0x3f3386=a30_0x14b4;function a30_0x4c84(){const _0x2ee11b=['10ntPWlw','new','No\x20api.ts\x20found.\x20Run\x20`','\x0a\x20*\x20[脚本名称]\x20','99GmZEPY','map','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','functionNode','Available:\x20','4AInEFI','code','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','isInteger','find','function-node','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x20[触发节点]\x20','operation-type','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','14XnQVdC','Dataset\x20not\x20found\x20for\x20code\x20\x22','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','name','string','nonInteractive','parseInt','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x22.\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','write','scriptsRootDir','datasetCode','Alias\x20\x22','File\x20already\x20exists:\x20','No\x20datasets\x20found\x20for\x20this\x20app.','.js','18940801cKnXTK','keys','Operation\x20type\x20(HOOK\x20only)','\x20function:\x20','Trigger\x20node\x20(HOOK\x20only)','COMMON','Available\x20aliases:\x20','5109400NFmVAx','str','\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','before','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','bff','appCode','type','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','ENDPOINT','close','Created\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Select\x20operation\x20type:','657656KZwGSD','trim','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','validation','operationType','1008804HhiADY','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','length','alias','Select\x20dataset:','description','tableName','apiDir','Invalid\x20dataset\x20selection.','stderr','includes','\x22\x20not\x20found\x20for\x20dataset\x20','datasetcode','No\x20operation\x20types\x20found\x20for\x20dataset\x20','after','entries','TODO:\x20add\x20script\x20description','2700344NpVfxZ','.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','22511tJjYvG','HOOK','\x20api\x20pull`\x20to\x20refresh.','Script\x20type','1074414PKjYYt','question','utf8','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'];a30_0x4c84=function(){return _0x2ee11b;};return a30_0x4c84();}(function(_0x24e351,_0x415936){const _0x2f2536=a30_0x14b4,_0x1b340f=_0x24e351();while(!![]){try{const _0x13be67=-parseInt(_0x2f2536(0xb8))/0x1+parseInt(_0x2f2536(0x6e))/0x2*(parseInt(_0x2f2536(0xbc))/0x3)+-parseInt(_0x2f2536(0xb6))/0x4+parseInt(_0x2f2536(0x92))/0x5+-parseInt(_0x2f2536(0xa5))/0x6*(-parseInt(_0x2f2536(0x79))/0x7)+parseInt(_0x2f2536(0xa0))/0x8*(parseInt(_0x2f2536(0xc4))/0x9)+parseInt(_0x2f2536(0xc0))/0xa*(-parseInt(_0x2f2536(0x8b))/0xb);if(_0x13be67===_0x415936)break;else _0x1b340f['push'](_0x1b340f['shift']());}catch(_0xd6ff84){_0x1b340f['push'](_0x1b340f['shift']());}}}(a30_0x4c84,0x8886d));function a30_0x14b4(_0x4d22a6,_0x5a58fb){_0x4d22a6=_0x4d22a6-0x6e;const _0x4c84a0=a30_0x4c84();let _0x14b400=_0x4c84a0[_0x4d22a6];return _0x14b400;}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':a30_0x3f3386(0x97),'command':a30_0x3f3386(0xc1),'description':a30_0x3f3386(0x70),'risk':a30_0x3f3386(0x84),'flags':[{'name':a30_0x3f3386(0x99),'type':'string','required':!![],'enum':[a30_0x3f3386(0x90),a30_0x3f3386(0x9b),a30_0x3f3386(0xb9)],'description':a30_0x3f3386(0xbb)},{'name':a30_0x3f3386(0x7d),'type':'string','required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a30_0x3f3386(0xaa),'type':a30_0x3f3386(0x7e),'description':'Script\x20description'},{'name':a30_0x3f3386(0xa8),'type':a30_0x3f3386(0x7e),'description':a30_0x3f3386(0xa2)},{'name':'datasetcode','type':a30_0x3f3386(0x7e),'description':a30_0x3f3386(0x96)},{'name':a30_0x3f3386(0x77),'type':a30_0x3f3386(0x7e),'description':a30_0x3f3386(0x8d)},{'name':a30_0x3f3386(0x73),'type':'string','description':a30_0x3f3386(0x8f),'enum':[a30_0x3f3386(0x95),'after']}],async 'validate'(_0x26fa24){const _0x97f98a=a30_0x3f3386,_0x3d2658=_0x26fa24[_0x97f98a(0x93)](_0x97f98a(0x7d));if(!isValidBffFunctionName(_0x3d2658))throw CliErrors['validation']('Invalid\x20function\x20name\x20\x22'+_0x3d2658+_0x97f98a(0x7c));},async 'execute'(_0x503ec8){const _0x294233=a30_0x3f3386,_0x2070b7=loadBffProjectConfig(_0x503ec8[_0x294233(0x98)]),_0x3a0aa4=_0x503ec8[_0x294233(0x93)](_0x294233(0x99)),_0x5cdaba=_0x503ec8[_0x294233(0x93)](_0x294233(0x7d)),_0x380623=_0x503ec8[_0x294233(0x93)](_0x294233(0xaa))||undefined,_0x3deb82=_0x3a0aa4===_0x294233(0xb9)?await resolveHookOptions(_0x2070b7,_0x503ec8):undefined,_0x39156b=buildFilePath(_0x2070b7,_0x3a0aa4,_0x5cdaba,_0x3deb82);if(await fileExists(_0x39156b))throw CliErrors['validation'](_0x294233(0x88)+_0x39156b);await mkdir(dirname(_0x39156b),{'recursive':!![]});const _0x9d9ce8=generateTemplate(_0x3a0aa4,_0x5cdaba,_0x503ec8[_0x294233(0x98)],_0x380623,_0x3deb82);await writeFile(_0x39156b,_0x9d9ce8,_0x294233(0xbe));const _0x7cf484={'type':_0x3a0aa4,'name':_0x5cdaba,'path':_0x39156b};if(_0x380623)_0x7cf484[_0x294233(0xaa)]=_0x380623;if(_0x3deb82){if(_0x3deb82['alias'])_0x7cf484[_0x294233(0xa8)]=_0x3deb82['alias'];_0x7cf484['datasetCode']=_0x3deb82[_0x294233(0x86)],_0x7cf484[_0x294233(0xa4)]=_0x3deb82['operationType'],_0x7cf484['functionNode']=_0x3deb82[_0x294233(0xc7)];}return{'ok':!![],'data':_0x7cf484,'message':_0x294233(0x9d)+_0x3a0aa4+_0x294233(0x8e)+_0x5cdaba};}};async function resolveHookOptions(_0x2f63ce,_0x21c238){const _0x1606db=a30_0x3f3386,_0x2b550a=loadAliasMap(_0x21c238['apiDir'],undefined,resolveApiFilePath(_0x21c238[_0x1606db(0xac)],_0x21c238[_0x1606db(0x98)])),_0x451446=_0x2b550a[_0x1606db(0xa7)]>0x0;let _0x45dd22,_0x59f940,_0xbaf0bf;const _0x3388af=_0x21c238['str']('alias'),_0x225855=_0x21c238['str'](_0x1606db(0xb1));if(_0x3388af){const _0x46061f=resolveAlias(_0x21c238[_0x1606db(0xac)],_0x3388af,undefined,resolveApiFilePath(_0x21c238[_0x1606db(0xac)],_0x21c238[_0x1606db(0x98)]));if(!_0x46061f){const _0x14350f=_0x451446?_0x1606db(0x91)+_0x2b550a[_0x1606db(0xc5)](_0x1b86d8=>_0x1b86d8[_0x1606db(0xa8)])['join'](',\x20'):_0x1606db(0xc2)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x87)+_0x3388af+'\x22\x20not\x20found.\x20'+_0x14350f);}_0x45dd22=_0x3388af,_0x59f940=_0x46061f;}else{if(_0x225855){_0x59f940=_0x225855;const _0x259ab0=_0x2b550a[_0x1606db(0x72)](_0x2d3ec9=>_0x2d3ec9[_0x1606db(0x86)]===_0x225855);_0x45dd22=_0x259ab0?.[_0x1606db(0xa8)];}else{if(_0x21c238[_0x1606db(0x7f)])throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x83));else{if(_0x451446){const _0xde7258=_0x2b550a[_0x1606db(0xc5)](_0x4f783f=>_0x4f783f['alias']+'\x20('+_0x4f783f[_0x1606db(0xab)]+')'),_0x4cc6cf=await promptSelect(_0x1606db(0xa9),_0xde7258),_0x4e0bd1=_0x2b550a[_0x4cc6cf];if(!_0x4e0bd1)throw CliErrors['validation'](_0x1606db(0xad));_0x45dd22=_0x4e0bd1[_0x1606db(0xa8)],_0x59f940=_0x4e0bd1[_0x1606db(0x86)];}else{const _0xddbb71=await listDatasets(_0x21c238[_0x1606db(0x98)]);if(_0xddbb71[_0x1606db(0xa7)]===0x0)throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x89));const _0x2bd306=_0xddbb71['map'](_0x168fc9=>_0x168fc9[_0x1606db(0x7d)]+'\x20('+_0x168fc9[_0x1606db(0x6f)]+')'),_0xdede99=await promptSelect(_0x1606db(0xa9),_0x2bd306),_0x2c3185=_0xddbb71[_0xdede99];if(!_0x2c3185)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x59f940=_0x2c3185[_0x1606db(0x6f)],_0x45dd22=undefined;}}}}const _0x2a79a2=await listDatasets(_0x21c238[_0x1606db(0x98)]),_0x54935c=_0x2a79a2['find'](_0x368b1e=>_0x368b1e[_0x1606db(0x6f)]===_0x59f940);if(!_0x54935c)throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x7a)+_0x59f940+_0x1606db(0x82)+(_0x45dd22?_0x1606db(0xbf)+CLI_BIN_NAME+_0x1606db(0xba):''));_0xbaf0bf=_0x54935c['id'];const _0x21c339=_0x45dd22??_0x59f940,_0x168ccd=await listBffDatasetOperations(_0x21c238[_0x1606db(0x98)],_0xbaf0bf),_0x130609=_0x168ccd?Object[_0x1606db(0x8c)](_0x168ccd):[];if(_0x130609[_0x1606db(0xa7)]===0x0)throw CliErrors[_0x1606db(0xa3)](_0x1606db(0xb2)+_0x21c339+'.');let _0x4e6d95;const _0x32f39d=_0x21c238[_0x1606db(0x93)](_0x1606db(0x77));if(_0x32f39d){if(!_0x130609[_0x1606db(0xaf)](_0x32f39d))throw CliErrors[_0x1606db(0xa3)]('Operation\x20type\x20\x22'+_0x32f39d+_0x1606db(0xb0)+_0x21c339+'.\x20'+(_0x1606db(0xc8)+_0x130609['join'](',\x20')));_0x4e6d95=_0x32f39d;}else{if(_0x21c238[_0x1606db(0x7f)])throw CliErrors[_0x1606db(0xa3)](_0x1606db(0xa6));const _0x5f40de=await promptSelect(_0x1606db(0x9f),_0x130609);_0x4e6d95=_0x130609[_0x5f40de]??_0x130609[0x0];}let _0x489f1f=normalizeHookFunctionNode(_0x21c238['str']('function-node'));if(!_0x489f1f){if(_0x21c238[_0x1606db(0x93)]('function-node'))throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x74));if(_0x21c238[_0x1606db(0x7f)])throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x75));const _0x482007=await promptSelect('Select\x20trigger\x20node:',['before',_0x1606db(0xb3)]);_0x489f1f=[_0x1606db(0x95),_0x1606db(0xb3)][_0x482007]??_0x1606db(0x95);}return{'alias':_0x45dd22,'datasetCode':_0x59f940,'datasetId':_0xbaf0bf,'operationType':_0x4e6d95,'functionNode':_0x489f1f};}async function promptSelect(_0x51de10,_0x954568){const _0x59ac9c=a30_0x3f3386;if(_0x954568[_0x59ac9c(0xa7)]===0x1)return 0x0;for(const [_0x49ca90,_0x4204ee]of _0x954568[_0x59ac9c(0xb4)]()){process[_0x59ac9c(0xae)][_0x59ac9c(0x84)]('\x20\x20'+(_0x49ca90+0x1)+'.\x20'+_0x4204ee+'\x0a');}const _0x5419a6=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x57a348=await new Promise(_0x45dbb2=>{const _0x520c4e=_0x59ac9c;_0x5419a6[_0x520c4e(0xbd)](_0x51de10+'\x20',_0x45dbb2);}),_0x5a88b7=Number[_0x59ac9c(0x80)](_0x57a348[_0x59ac9c(0xa1)](),0xa);if(Number[_0x59ac9c(0x71)](_0x5a88b7)&&_0x5a88b7>=0x1&&_0x5a88b7<=_0x954568[_0x59ac9c(0xa7)])return _0x5419a6[_0x59ac9c(0x9c)](),_0x5a88b7-0x1;process[_0x59ac9c(0xae)][_0x59ac9c(0x84)](_0x59ac9c(0x9a)+_0x954568[_0x59ac9c(0xa7)]+'.\x0a');}}function buildFilePath(_0x59a855,_0x3f88f3,_0x43c3fd,_0x2fc4d9){const _0x4ffcf8=a30_0x3f3386;if(_0x3f88f3==='HOOK'){if(!_0x2fc4d9)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x203af4=_0x2fc4d9[_0x4ffcf8(0xa8)]??_0x2fc4d9[_0x4ffcf8(0x86)];return join(_0x59a855['scriptsRootDir'],_0x4ffcf8(0xb9),_0x203af4,_0x2fc4d9[_0x4ffcf8(0xa4)],_0x2fc4d9[_0x4ffcf8(0xc7)],_0x43c3fd+_0x4ffcf8(0x8a));}return join(_0x59a855[_0x4ffcf8(0x85)],_0x3f88f3,_0x43c3fd+'.js');}export function generateTemplate(_0x340136,_0x3c4047,_0x253a9c,_0x2f9664,_0x223029){const _0x555235=a30_0x3f3386,_0x2d3cc9=_0x2f9664?.['trim']()||_0x555235(0xb5);if(_0x340136===_0x555235(0x90))return _0x555235(0xc6)+_0x2d3cc9+_0x555235(0xc3)+_0x3c4047+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x3c4047+_0x555235(0xb7)+_0x3c4047+_0x555235(0x9e);if(_0x340136===_0x555235(0x9b))return'/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x2d3cc9+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x253a9c+'/'+_0x3c4047+'\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'+_0x3c4047+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x223029)throw CliErrors['validation'](_0x555235(0x7b));return _0x555235(0x78)+_0x2d3cc9+_0x555235(0x81)+_0x253a9c+'/'+_0x223029['datasetCode']+'/'+_0x223029[_0x555235(0xa4)]+_0x555235(0x76)+_0x223029['functionNode']+_0x555235(0x94)+_0x3c4047+_0x555235(0x9e);}
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 +1 @@
1
- const a31_0x588169=a31_0x30aa;(function(_0x4e628d,_0x3dfe14){const _0x33f88d=a31_0x30aa,_0x451b15=_0x4e628d();while(!![]){try{const _0x30716f=-parseInt(_0x33f88d(0x150))/0x1+-parseInt(_0x33f88d(0x158))/0x2*(-parseInt(_0x33f88d(0x13f))/0x3)+parseInt(_0x33f88d(0x145))/0x4*(-parseInt(_0x33f88d(0x149))/0x5)+-parseInt(_0x33f88d(0x16d))/0x6*(parseInt(_0x33f88d(0x172))/0x7)+parseInt(_0x33f88d(0x162))/0x8*(parseInt(_0x33f88d(0x165))/0x9)+-parseInt(_0x33f88d(0x15b))/0xa+parseInt(_0x33f88d(0x156))/0xb;if(_0x30716f===_0x3dfe14)break;else _0x451b15['push'](_0x451b15['shift']());}catch(_0x544a38){_0x451b15['push'](_0x451b15['shift']());}}}(a31_0x11bb,0xce205));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';function a31_0x11bb(){const _0x494230=['bool','Force\x20pull\x20cancelled.','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','filePath','skipped','stderr','123ZwWriT','close','datasetCode','lastSync','all','conflict','24eGAqBX','scriptsRoot','message','version','564105DHhHEK','scriptContent','pull','parse','\x22\x20not\x20found\x20after\x20ensureLockScope.','push','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','141329GVJKBt','apiDir','hash','COMMON','lockFilePath','type','4550018TqVfCU','string','75938ZSSboS','force','\x20failed','7215440ITxfkb','includes','lockKey','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','toLowerCase','length','/api/management/library/scripts/list?appCode=','16cNrYZC','would_pull','&type=','4325274JjyREH','No\x20remote\x20BFF\x20scripts\x20found.','operationType','map','\x20remote\x20BFF\x20script(s)\x20for\x20pull','trim','appCode','scriptType','3284682vBXEGB','HOOK','functions','local\x20unsynced\x20changes','str','7PiJsxX','boolean','Remote\x20script\x20missing\x20id.','\x20pulled,\x20','hookLocation','functionNode','functionName','Lock\x20scope\x20for\x20app\x20\x22','Would\x20inspect\x20','alias','yes'];a31_0x11bb=function(){return _0x494230;};return a31_0x11bb();}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_0x588169(0x14b),'description':a31_0x588169(0x14f),'risk':'write','flags':[{'name':a31_0x588169(0x155),'type':a31_0x588169(0x157),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a31_0x588169(0x153),'ENDPOINT',a31_0x588169(0x16e)]},{'name':'force','type':a31_0x588169(0x173),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4e441d){const _0x55738f=a31_0x588169,_0x57fcaf=loadBffProjectConfig(_0x4e441d[_0x55738f(0x16b)]),_0x58dd51=await readBffLockFile(_0x57fcaf['lockFilePath']),{appLock:_0x228af8}=ensureLockScope(_0x58dd51??createEmptyBffLock(),_0x4e441d[_0x55738f(0x16b)],_0x57fcaf['scriptsRoot'],_0x55738f(0x14b)),_0x3586ec=normalizeBffType(_0x4e441d[_0x55738f(0x171)](_0x55738f(0x155)))??undefined,_0xc40218=buildDatasetCodeToAliasMap(_0x4e441d[_0x55738f(0x151)],_0x4e441d[_0x55738f(0x16b)]),[_0x164fc0,_0x5c1fec]=await Promise['all']([listBffScripts(_0x4e441d['appCode'],_0x3586ec),getBffScriptStatistics(_0x4e441d[_0x55738f(0x16b)])]),_0x4eeace=createHookLocationMap(_0x5c1fec),_0x5d5bc1=[];for(const _0xf55a11 of _0x164fc0){const _0xb9363d=resolveRemoteScriptTarget(_0x57fcaf,_0xf55a11,_0x4eeace,_0x228af8[_0x55738f(0x16f)],_0xc40218);if(!_0xb9363d){_0x5d5bc1['push']({'scriptType':_0xf55a11['scriptType'],'functionName':_0xf55a11[_0x55738f(0x178)]??'','status':_0x55738f(0x13d),'reason':'unresolvable\x20target\x20path'});continue;}const _0x552c42=_0x228af8[_0x55738f(0x16f)][_0xb9363d[_0x55738f(0x15d)]],_0x3d2cff=_0xf55a11[_0x55738f(0x14a)]!=null?computeContentHash(_0xf55a11[_0x55738f(0x14a)]):undefined,_0x539da3=await hasUnsyncedLocalChanges(_0xb9363d[_0x55738f(0x13c)],_0x552c42,_0x3d2cff);_0x5d5bc1[_0x55738f(0x14e)]({'lockKey':_0xb9363d[_0x55738f(0x15d)],'filePath':_0xb9363d['filePath'],'remoteId':_0xf55a11['id']??null,'status':_0x539da3?_0x55738f(0x144):_0x55738f(0x163)});}return{'method':'GET','url':_0x55738f(0x161)+_0x4e441d['appCode']+(_0x3586ec?_0x55738f(0x164)+_0x3586ec:''),'body':{'appCode':_0x4e441d[_0x55738f(0x16b)],'filterType':_0x3586ec??null,'files':_0x5d5bc1},'description':_0x55738f(0x136)+_0x5d5bc1[_0x55738f(0x160)]+_0x55738f(0x169)};},async 'execute'(_0x4b345e){const _0x454c62=a31_0x588169,_0x2ecf4a=loadBffProjectConfig(_0x4b345e[_0x454c62(0x16b)]),_0x141b51=await readBffLockFile(_0x2ecf4a[_0x454c62(0x154)]),{lockData:_0x6e2b11,appLock:_0x14ee8b}=ensureLockScope(_0x141b51??createEmptyBffLock(),_0x4b345e['appCode'],_0x2ecf4a[_0x454c62(0x146)],_0x454c62(0x14b)),_0x3e995c=normalizeBffType(_0x4b345e[_0x454c62(0x171)](_0x454c62(0x155)))??undefined;if(_0x4b345e[_0x454c62(0x171)](_0x454c62(0x155))&&!_0x3e995c)throw CliErrors['validation'](_0x454c62(0x15e));const [_0x530ca5,_0x2e0947]=await Promise[_0x454c62(0x143)]([listBffScripts(_0x4b345e[_0x454c62(0x16b)],_0x3e995c),getBffScriptStatistics(_0x4b345e[_0x454c62(0x16b)])]);if(_0x530ca5[_0x454c62(0x160)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x454c62(0x166)};const _0x2e230c=_0x4b345e[_0x454c62(0x139)](_0x454c62(0x159));if(_0x2e230c&&!_0x4b345e['nonInteractive']){const _0x226895=await confirmForce();if(!_0x226895)throw CliErrors['cancelled'](_0x454c62(0x13a));}if(_0x2e230c&&_0x4b345e['nonInteractive']){}const _0x30b19e=buildDatasetCodeToAliasMap(_0x4b345e[_0x454c62(0x151)],_0x4b345e[_0x454c62(0x16b)]),_0x577445=createHookLocationMap(_0x2e0947),_0x44c897=JSON[_0x454c62(0x14c)](JSON['stringify'](_0x6e2b11)),_0x1bc839=_0x4b345e[_0x454c62(0x16b)],_0x444318=_0x44c897['apps'][_0x1bc839];if(!_0x444318)throw new Error(_0x454c62(0x135)+_0x1bc839+_0x454c62(0x14d));const _0x22e7ea=[],_0xbb90fe=[],_0x7dc2bf=[];for(const _0x20b704 of _0x530ca5){const _0x54c5ab=resolveRemoteScriptTarget(_0x2ecf4a,_0x20b704,_0x577445,_0x14ee8b[_0x454c62(0x16f)],_0x30b19e);if(!_0x54c5ab){_0xbb90fe['push']({'lockKey':_0x20b704[_0x454c62(0x16c)]+'/'+_0x20b704[_0x454c62(0x178)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x2fe894=_0x14ee8b[_0x454c62(0x16f)][_0x54c5ab[_0x454c62(0x15d)]];try{if(!_0x20b704['id'])throw new Error(_0x454c62(0x174));if(_0x20b704[_0x454c62(0x14a)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x33566e=_0x20b704['scriptContent'],_0x388fdf=computeContentHash(_0x33566e);if(!_0x2e230c){const _0x4beaf0=await hasUnsyncedLocalChanges(_0x54c5ab['filePath'],_0x2fe894,_0x388fdf);if(_0x4beaf0){_0xbb90fe[_0x454c62(0x14e)]({'lockKey':_0x54c5ab[_0x454c62(0x15d)],'reason':_0x454c62(0x170)});continue;}}await ensureParentDirectory(_0x54c5ab[_0x454c62(0x13c)]),await writeFile(_0x54c5ab[_0x454c62(0x13c)],_0x33566e,'utf8');const _0x253beb={'hash':_0x388fdf,'remoteId':_0x20b704['id'],'version':_0x20b704[_0x454c62(0x148)]};_0x54c5ab['type']===_0x454c62(0x16e)&&_0x54c5ab[_0x454c62(0x176)]&&(_0x253beb['alias']=_0x54c5ab[_0x454c62(0x176)][_0x454c62(0x137)],_0x253beb[_0x454c62(0x141)]=_0x54c5ab[_0x454c62(0x176)][_0x454c62(0x141)],_0x253beb[_0x454c62(0x167)]=_0x54c5ab[_0x454c62(0x176)]['operationType'],_0x253beb['functionNode']=_0x54c5ab[_0x454c62(0x176)][_0x454c62(0x177)]),_0x444318['functions'][_0x54c5ab['lockKey']]=_0x253beb,_0x22e7ea['push']({'lockKey':_0x54c5ab[_0x454c62(0x15d)],'remoteId':_0x20b704['id']});}catch(_0x4bf79b){_0x7dc2bf[_0x454c62(0x14e)]({'lockKey':_0x54c5ab[_0x454c62(0x15d)],'error':_0x4bf79b instanceof Error?_0x4bf79b[_0x454c62(0x147)]:String(_0x4bf79b)});}}return _0x444318[_0x454c62(0x142)]=new Date()['toISOString'](),await writeBffLockFile(_0x2ecf4a[_0x454c62(0x154)],_0x44c897),{'ok':_0x7dc2bf[_0x454c62(0x160)]===0x0,'data':{'pulled':_0x22e7ea,'skipped':_0xbb90fe,'failed':_0x7dc2bf},'message':'Pull\x20complete:\x20'+_0x22e7ea[_0x454c62(0x160)]+_0x454c62(0x175)+_0xbb90fe[_0x454c62(0x160)]+'\x20skipped,\x20'+_0x7dc2bf[_0x454c62(0x160)]+_0x454c62(0x15a)};}};function a31_0x30aa(_0x4c0d18,_0x5a10dc){_0x4c0d18=_0x4c0d18-0x135;const _0x11bb49=a31_0x11bb();let _0x30aa48=_0x11bb49[_0x4c0d18];return _0x30aa48;}async function hasUnsyncedLocalChanges(_0x3b6751,_0x4d9cb3,_0x3e0638){const _0x7069cb=a31_0x588169;if(!await fileExists(_0x3b6751))return![];const _0x4e7d3d=await computeFileHash(_0x3b6751);if(!_0x4d9cb3)return _0x3e0638?_0x4e7d3d!==_0x3e0638:!![];return _0x4e7d3d!==_0x4d9cb3[_0x7069cb(0x152)];}function buildDatasetCodeToAliasMap(_0x585ea3,_0x5cc32f){const _0x3cd9cc=a31_0x588169,_0x5a91fd=loadAliasMap(_0x585ea3,undefined,resolveApiFilePath(_0x585ea3,_0x5cc32f));return new Map(_0x5a91fd[_0x3cd9cc(0x168)](_0x5f3bd8=>[_0x5f3bd8['datasetCode'],_0x5f3bd8[_0x3cd9cc(0x137)]]));}async function confirmForce(){const _0x24cfc5=a31_0x588169,_0x6919da=createInterface({'input':process['stdin'],'output':process[_0x24cfc5(0x13e)]}),_0x1a0375=await new Promise(_0x5f219c=>{const _0x582d24=_0x24cfc5;_0x6919da['question'](_0x582d24(0x13b),_0x5f219c);});return _0x6919da[_0x24cfc5(0x140)](),['y',_0x24cfc5(0x138)][_0x24cfc5(0x15c)](_0x1a0375[_0x24cfc5(0x16a)]()[_0x24cfc5(0x15f)]());}
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 +1 @@
1
- const a32_0x3f979a=a32_0x3ecb;(function(_0x1cf5cb,_0xb18b99){const _0x3a47eb=a32_0x3ecb,_0x252e1c=_0x1cf5cb();while(!![]){try{const _0x3d67ef=parseInt(_0x3a47eb(0x165))/0x1*(parseInt(_0x3a47eb(0x12d))/0x2)+parseInt(_0x3a47eb(0x14b))/0x3+-parseInt(_0x3a47eb(0x150))/0x4*(parseInt(_0x3a47eb(0x13b))/0x5)+parseInt(_0x3a47eb(0x14f))/0x6*(-parseInt(_0x3a47eb(0x159))/0x7)+-parseInt(_0x3a47eb(0x15b))/0x8+-parseInt(_0x3a47eb(0x126))/0x9*(parseInt(_0x3a47eb(0x15c))/0xa)+-parseInt(_0x3a47eb(0x140))/0xb*(-parseInt(_0x3a47eb(0x134))/0xc);if(_0x3d67ef===_0xb18b99)break;else _0x252e1c['push'](_0x252e1c['shift']());}catch(_0x2ff8aa){_0x252e1c['push'](_0x252e1c['shift']());}}}(a32_0x34a1,0x2b6e7));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';function a32_0x3ecb(_0x7732ec,_0x5abb28){_0x7732ec=_0x7732ec-0x11c;const _0x34a19b=a32_0x34a1();let _0x3ecb7f=_0x34a19b[_0x7732ec];return _0x3ecb7f;}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';function a32_0x34a1(){const _0x3f2dfd=['4bOJMii','some','aliasToDatasetCode','datasetCode','update','filter','force','str','COMMON','7yEnWjU','map','286584mAtmre','30DYdQAo','apiDir',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','has','code','Push\x20complete:\x20','lockFilePath','create','operationType','167269cCaRUk','Local\x20function\x20not\x20found:\x20','Push\x20only\x20this\x20script\x20type','Cannot\x20resolve\x20dataset\x20for\x20\x22','string','length','push','description','lastSync','get','remoteId','856332kzcBsk','functions','HOOK','/api/management/library/scripts/save','bool','alias','ENDPOINT','2XSQMAC','toISOString','filePath','high-risk-write','\x20uploaded,\x20','message','Incomplete\x20HOOK\x20path:\x20','278904ulJcGq','bff','set','Push\x20local\x20BFF\x20scripts\x20to\x20remote','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','datasetId','validation','564430DEOsER','functionNode','would_push','version','appCode','220admQNq','\x20local\x20BFF\x20script(s)\x20for\x20push','type','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','unchanged','scriptsRoot','\x20failed','lockKey','POST','hash','boolean','94611MaDaTl','utf8','name','Force\x20push\x20ignoring\x20hash\x20protection','309588qsRpLM'];a32_0x34a1=function(){return _0x3f2dfd;};return a32_0x34a1();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a32_0x3f979a(0x135),'command':'push','description':a32_0x3f979a(0x137),'risk':a32_0x3f979a(0x130),'flags':[{'name':a32_0x3f979a(0x142),'type':a32_0x3f979a(0x11f),'description':a32_0x3f979a(0x11d),'enum':[a32_0x3f979a(0x158),a32_0x3f979a(0x12c),a32_0x3f979a(0x128)]},{'name':a32_0x3f979a(0x14d),'type':a32_0x3f979a(0x11f),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a32_0x3f979a(0x156),'type':a32_0x3f979a(0x14a),'description':a32_0x3f979a(0x14e)}],async 'dryRun'(_0x1b87de){const _0x4932bc=a32_0x3f979a,_0x2ddb73=loadBffProjectConfig(_0x1b87de[_0x4932bc(0x13f)]),_0xbcc0cf=await readBffLockFile(_0x2ddb73[_0x4932bc(0x162)]),{appLock:_0x3a8081}=ensureLockScope(_0xbcc0cf??createEmptyBffLock(),_0x1b87de[_0x4932bc(0x13f)],_0x2ddb73[_0x4932bc(0x145)],_0x4932bc(0x121)),_0x5e570e=await getTargetFunctions(_0x2ddb73,_0x1b87de),_0x146628=_0x1b87de['bool'](_0x4932bc(0x156)),_0x24817c=[];for(const _0x4489b9 of _0x5e570e){const _0x53949c=await computeFileHash(_0x4489b9[_0x4932bc(0x12f)]),_0x2d84c5=_0x3a8081[_0x4932bc(0x127)][_0x4489b9[_0x4932bc(0x147)]],_0x56a115=!!_0x2d84c5&&_0x2d84c5['hash']===_0x53949c;_0x24817c[_0x4932bc(0x121)]({'lockKey':_0x4489b9['lockKey'],'filePath':_0x4489b9['filePath'],'remoteId':_0x2d84c5?.['remoteId']??null,'mode':_0x2d84c5?.[_0x4932bc(0x125)]?_0x4932bc(0x154):_0x4932bc(0x163),'status':!_0x146628&&_0x56a115?_0x4932bc(0x144):_0x4932bc(0x13d)});}return{'method':_0x4932bc(0x148),'url':_0x4932bc(0x129),'body':{'appCode':_0x1b87de[_0x4932bc(0x13f)],'force':_0x146628,'files':_0x24817c},'description':'Would\x20inspect\x20'+_0x24817c['length']+_0x4932bc(0x141)};},async 'execute'(_0x2ab237){const _0x2f1932=a32_0x3f979a,_0x3a5abd=loadBffProjectConfig(_0x2ab237[_0x2f1932(0x13f)]),_0x4348e6=await readBffLockFile(_0x3a5abd['lockFilePath']),{lockData:_0x19b5e9,appLock:_0xa123ad}=ensureLockScope(_0x4348e6??createEmptyBffLock(),_0x2ab237[_0x2f1932(0x13f)],_0x3a5abd[_0x2f1932(0x145)],'push'),_0xe5b2b7=await getTargetFunctions(_0x3a5abd,_0x2ab237);if(_0xe5b2b7[_0x2f1932(0x120)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x3c3c9c=_0x2ab237[_0x2f1932(0x12a)](_0x2f1932(0x156)),_0x1bbed9=await buildHookMaps(_0x2ab237[_0x2f1932(0x13f)],_0x2ab237[_0x2f1932(0x15d)],_0xe5b2b7,_0xa123ad),_0x5ad152=[],_0x176421=[],_0x4e6185=[];for(const _0x5b3d51 of _0xe5b2b7){const _0x26a936=await computeFileHash(_0x5b3d51['filePath']),_0x31f964=_0xa123ad[_0x2f1932(0x127)][_0x5b3d51[_0x2f1932(0x147)]];if(!_0x3c3c9c&&_0x31f964&&_0x31f964[_0x2f1932(0x149)]===_0x26a936){_0x176421[_0x2f1932(0x121)]({'lockKey':_0x5b3d51[_0x2f1932(0x147)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x2ab237[_0x2f1932(0x13f)],_0x5b3d51,_0xa123ad,_0x1bbed9);const _0x8e63bf=_0xa123ad[_0x2f1932(0x127)][_0x5b3d51[_0x2f1932(0x147)]];_0x5ad152[_0x2f1932(0x121)]({'lockKey':_0x5b3d51['lockKey'],'remoteId':_0x8e63bf?.[_0x2f1932(0x125)]??0x0});}catch(_0x26216c){_0x4e6185['push']({'lockKey':_0x5b3d51['lockKey'],'error':_0x26216c instanceof Error?_0x26216c[_0x2f1932(0x132)]:String(_0x26216c)});}}return _0xa123ad[_0x2f1932(0x123)]=new Date()[_0x2f1932(0x12e)](),await writeBffLockFile(_0x3a5abd[_0x2f1932(0x162)],_0x19b5e9),{'ok':_0x4e6185[_0x2f1932(0x120)]===0x0,'data':{'uploaded':_0x5ad152,'skipped':_0x176421,'failed':_0x4e6185},'message':_0x2f1932(0x161)+_0x5ad152[_0x2f1932(0x120)]+_0x2f1932(0x131)+_0x176421[_0x2f1932(0x120)]+'\x20skipped,\x20'+_0x4e6185[_0x2f1932(0x120)]+_0x2f1932(0x146)};}};async function getTargetFunctions(_0x14bb96,_0x4808bd){const _0x3ec63f=a32_0x3f979a,_0x250a17=_0x4808bd[_0x3ec63f(0x157)](_0x3ec63f(0x142)),_0x3b696e=_0x4808bd[_0x3ec63f(0x157)]('name'),_0x48a187=normalizeBffType(_0x250a17)??undefined;if(_0x3b696e&&!_0x48a187)throw CliErrors[_0x3ec63f(0x13a)](_0x3ec63f(0x138));const _0x4cd427=await scanLocalBffFunctions(_0x14bb96,_0x48a187);if(_0x3b696e){const _0x58407c=_0x4cd427[_0x3ec63f(0x155)](_0x2c9fce=>_0x2c9fce['name']===_0x3b696e);if(_0x58407c[_0x3ec63f(0x120)]===0x0)throw CliErrors[_0x3ec63f(0x13a)](_0x3ec63f(0x11c)+_0x48a187+'/'+_0x3b696e);return _0x58407c;}return _0x4cd427;}async function buildHookMaps(_0x2ca5ef,_0xe17aa,_0x4f3a20,_0x517864){const _0x44d422=a32_0x3f979a,_0x46f0e4=_0x4f3a20[_0x44d422(0x151)](_0x50b261=>_0x50b261[_0x44d422(0x142)]==='HOOK');if(!_0x46f0e4)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x50b976=loadAliasMap(_0xe17aa,undefined,resolveApiFilePath(_0xe17aa,_0x2ca5ef)),_0x3b9de6=new Map(_0x50b976[_0x44d422(0x15a)](_0x336fde=>[_0x336fde[_0x44d422(0x12b)],_0x336fde[_0x44d422(0x153)]]));for(const _0x174569 of Object['values'](_0x517864[_0x44d422(0x127)])){_0x174569[_0x44d422(0x12b)]&&_0x174569[_0x44d422(0x153)]&&!_0x3b9de6['has'](_0x174569[_0x44d422(0x12b)])&&_0x3b9de6[_0x44d422(0x136)](_0x174569['alias'],_0x174569['datasetCode']);}const _0x2696d3=await listDatasets(_0x2ca5ef),_0xb20e03=new Map(_0x2696d3[_0x44d422(0x15a)](_0x56bf64=>[_0x56bf64[_0x44d422(0x160)],_0x56bf64['id']]));return{'aliasToDatasetCode':_0x3b9de6,'datasetCodeToId':_0xb20e03};}async function uploadSingleFunction(_0x1f49b0,_0x38a887,_0x1aa0e3,_0x5f270b){const _0x38087d=a32_0x3f979a,_0x4db9f4=await readFile(_0x38a887['filePath'],_0x38087d(0x14c)),_0x5b8cb1=await computeFileHash(_0x38a887[_0x38087d(0x12f)]),_0x516ed1=_0x1aa0e3[_0x38087d(0x127)][_0x38a887[_0x38087d(0x147)]];if(_0x516ed1?.['remoteId']&&_0x516ed1[_0x38087d(0x13e)]==null)throw CliErrors['validation'](_0x38a887[_0x38087d(0x147)]+_0x38087d(0x15e));let _0x2cde62=extractScriptDescription(_0x4db9f4);if(!_0x2cde62&&_0x516ed1?.['remoteId']){const _0x9b5285=await getBffScriptInfo(_0x516ed1[_0x38087d(0x125)]);_0x2cde62=_0x9b5285[_0x38087d(0x122)]||undefined;}const _0x576576={'appCode':_0x1f49b0,'functionName':_0x38a887[_0x38087d(0x14d)],'scriptType':_0x38a887[_0x38087d(0x142)],'scriptContent':_0x4db9f4};if(_0x516ed1?.[_0x38087d(0x125)])_0x576576['id']=_0x516ed1[_0x38087d(0x125)];if(_0x516ed1?.['version']!=null)_0x576576[_0x38087d(0x13e)]=_0x516ed1[_0x38087d(0x13e)];if(_0x2cde62)_0x576576[_0x38087d(0x122)]=_0x2cde62;if(_0x38a887[_0x38087d(0x142)]===_0x38087d(0x128)){const _0x3bdf8d=_0x38a887[_0x38087d(0x12b)];if(!_0x3bdf8d||!_0x38a887[_0x38087d(0x164)]||!_0x38a887[_0x38087d(0x13c)])throw CliErrors[_0x38087d(0x13a)](_0x38087d(0x133)+_0x38a887[_0x38087d(0x147)]);const _0x843a1a=_0x5f270b['aliasToDatasetCode'][_0x38087d(0x124)](_0x3bdf8d)??_0x516ed1?.[_0x38087d(0x153)]??_0x3bdf8d,_0x31200e=_0x5f270b['datasetCodeToId']['get'](_0x843a1a);if(!_0x31200e)throw CliErrors[_0x38087d(0x13a)](_0x38087d(0x11e)+_0x3bdf8d+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x38087d(0x143)));_0x576576[_0x38087d(0x139)]=_0x31200e,_0x576576['operationType']=_0x38a887[_0x38087d(0x164)],_0x576576[_0x38087d(0x13c)]=_0x38a887[_0x38087d(0x13c)];}const _0x1680d1=await saveBffScript(_0x576576),_0x4f8728=await getBffScriptInfo(_0x1680d1),_0x5934e7={'hash':_0x5b8cb1,'remoteId':_0x1680d1,'version':_0x4f8728[_0x38087d(0x13e)]};if(_0x38a887[_0x38087d(0x142)]==='HOOK'){const _0x12a4b4=_0x38a887['alias'],_0x3828d4=_0x5f270b['aliasToDatasetCode'][_0x38087d(0x124)](_0x12a4b4)??_0x516ed1?.[_0x38087d(0x153)]??_0x12a4b4;_0x5f270b[_0x38087d(0x152)][_0x38087d(0x15f)](_0x12a4b4)?_0x5934e7[_0x38087d(0x12b)]=_0x12a4b4:_0x5934e7[_0x38087d(0x12b)]=_0x516ed1?.[_0x38087d(0x12b)],_0x5934e7[_0x38087d(0x153)]=_0x3828d4,_0x5934e7[_0x38087d(0x164)]=_0x38a887[_0x38087d(0x164)],_0x5934e7['functionNode']=_0x38a887['functionNode'];}_0x1aa0e3[_0x38087d(0x127)][_0x38a887['lockKey']]=_0x5934e7;}
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 +1 @@
1
- function a33_0xefcb(_0x629d67,_0x11e51c){_0x629d67=_0x629d67-0x125;const _0x2c855d=a33_0x2c85();let _0xefcbe5=_0x2c855d[_0x629d67];return _0xefcbe5;}function a33_0x2c85(){const _0x3ea5b7=['all','bff','\x20added,\x20','appCode','status','alias','remote','functions','4576ftQPGB','1384806lpCHem','datasetCode','10680sCAknE','hash','length','has','361998hEetXY','4ChFywG','4572152XjFfTQ','3830ihdiKN','apiDir','All\x20BFF\x20scripts\x20are\x20in\x20sync.','\x20modified,\x20','1424910VoyFFI','read','lockKey','\x20unchanged','\x20remote-only','scriptsRoot','bool','1061029AoVvaN','filePath','4206wBMJOR','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','lockFilePath','9HkDTGL','boolean','push','map'];a33_0x2c85=function(){return _0x3ea5b7;};return a33_0x2c85();}const a33_0x45822a=a33_0xefcb;(function(_0x17cde2,_0x117704){const _0x3c5e57=a33_0xefcb,_0x315c1a=_0x17cde2();while(!![]){try{const _0x14614b=parseInt(_0x3c5e57(0x144))/0x1+parseInt(_0x3c5e57(0x13d))/0x2+-parseInt(_0x3c5e57(0x130))/0x3*(parseInt(_0x3c5e57(0x137))/0x4)+-parseInt(_0x3c5e57(0x139))/0x5*(parseInt(_0x3c5e57(0x146))/0x6)+-parseInt(_0x3c5e57(0x136))/0x7+-parseInt(_0x3c5e57(0x138))/0x8*(parseInt(_0x3c5e57(0x149))/0x9)+parseInt(_0x3c5e57(0x132))/0xa*(parseInt(_0x3c5e57(0x12f))/0xb);if(_0x14614b===_0x117704)break;else _0x315c1a['push'](_0x315c1a['shift']());}catch(_0x588cd0){_0x315c1a['push'](_0x315c1a['shift']());}}}(a33_0x2c85,0x91803));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';export const bffStatus={'service':a33_0x45822a(0x128),'command':a33_0x45822a(0x12b),'description':a33_0x45822a(0x147),'risk':a33_0x45822a(0x13e),'flags':[{'name':a33_0x45822a(0x12d),'type':a33_0x45822a(0x14a),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x261c71){const _0x17e179=a33_0x45822a,_0x1df76c=loadBffProjectConfig(_0x261c71[_0x17e179(0x12a)]),_0x1f8fa9=await readBffLockFile(_0x1df76c[_0x17e179(0x148)]),{appLock:_0x2b9fbf}=ensureLockScope(_0x1f8fa9??createEmptyBffLock(),_0x261c71[_0x17e179(0x12a)],_0x1df76c[_0x17e179(0x142)],_0x17e179(0x12b)),_0x3e2100=await scanLocalBffFunctions(_0x1df76c),_0x11ae6a=[],_0x20e6b5=[],_0x2844f6=[];for(const _0x10c287 of _0x3e2100){const _0x5bf63d=await computeFileHash(_0x10c287[_0x17e179(0x145)]),_0x3cdd50=_0x2b9fbf[_0x17e179(0x12e)][_0x10c287['lockKey']];if(!_0x3cdd50)_0x11ae6a[_0x17e179(0x125)](_0x10c287[_0x17e179(0x13f)]);else _0x3cdd50[_0x17e179(0x133)]!==_0x5bf63d?_0x20e6b5[_0x17e179(0x125)](_0x10c287[_0x17e179(0x13f)]):_0x2844f6[_0x17e179(0x125)](_0x10c287[_0x17e179(0x13f)]);}const _0x521461=[];if(_0x261c71[_0x17e179(0x143)](_0x17e179(0x12d))){const _0x82f640=loadAliasMap(_0x261c71[_0x17e179(0x13a)],undefined,resolveApiFilePath(_0x261c71[_0x17e179(0x13a)],_0x261c71['appCode'])),_0x59b26b=new Map(_0x82f640[_0x17e179(0x126)](_0x3dd415=>[_0x3dd415[_0x17e179(0x131)],_0x3dd415[_0x17e179(0x12c)]])),[_0xf128e0,_0x31cb78]=await Promise[_0x17e179(0x127)]([listBffScripts(_0x261c71[_0x17e179(0x12a)]),getBffScriptStatistics(_0x261c71[_0x17e179(0x12a)])]),_0x1971a5=createHookLocationMap(_0x31cb78),_0x3dacf6=new Set(_0x3e2100['map'](_0x5773a2=>_0x5773a2['lockKey']));for(const _0x51d05f of _0xf128e0){const _0x4ec92c=resolveRemoteScriptTarget(_0x1df76c,_0x51d05f,_0x1971a5,_0x2b9fbf[_0x17e179(0x12e)],_0x59b26b);_0x4ec92c&&!_0x3dacf6[_0x17e179(0x135)](_0x4ec92c['lockKey'])&&_0x521461[_0x17e179(0x125)](_0x4ec92c[_0x17e179(0x13f)]);}}const _0x36e454=_0x11ae6a[_0x17e179(0x134)]===0x0&&_0x20e6b5[_0x17e179(0x134)]===0x0&&_0x521461[_0x17e179(0x134)]===0x0;return{'ok':!![],'data':{'added':_0x11ae6a,'modified':_0x20e6b5,'unchanged':_0x2844f6,'remoteOnly':_0x521461},'message':_0x36e454?_0x17e179(0x13b):_0x11ae6a['length']+_0x17e179(0x129)+_0x20e6b5[_0x17e179(0x134)]+_0x17e179(0x13c)+_0x2844f6[_0x17e179(0x134)]+_0x17e179(0x140)+(_0x521461[_0x17e179(0x134)]>0x0?',\x20'+_0x521461[_0x17e179(0x134)]+_0x17e179(0x141):'')};}};
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):'')};}};