@lovrabet/rabetbase-cli 2.1.6 → 2.1.7-beta.10

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 (197) 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/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.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/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/delete.js +1 -0
  52. package/lib/commands/dataset/detail.js +1 -1
  53. package/lib/commands/dataset/index.js +1 -1
  54. package/lib/commands/dataset/link-create.js +1 -0
  55. package/lib/commands/dataset/link-delete.js +1 -0
  56. package/lib/commands/dataset/link-shared.js +1 -0
  57. package/lib/commands/dataset/link-update.js +1 -0
  58. package/lib/commands/dataset/links.js +1 -1
  59. package/lib/commands/dataset/list.js +1 -1
  60. package/lib/commands/dataset/operations.js +1 -1
  61. package/lib/commands/db/analyze-cancel.js +1 -1
  62. package/lib/commands/db/analyze-start.js +1 -1
  63. package/lib/commands/db/analyze-status.js +1 -1
  64. package/lib/commands/db/create.js +1 -1
  65. package/lib/commands/db/delete.js +1 -1
  66. package/lib/commands/db/detail.js +1 -1
  67. package/lib/commands/db/diff.js +1 -1
  68. package/lib/commands/db/index.js +1 -1
  69. package/lib/commands/db/list.js +1 -1
  70. package/lib/commands/db/shared.js +1 -1
  71. package/lib/commands/db/tables.js +1 -1
  72. package/lib/commands/db/test.js +1 -1
  73. package/lib/commands/db/update.js +1 -1
  74. package/lib/commands/doctor.js +1 -1
  75. package/lib/commands/init/index.js +1 -1
  76. package/lib/commands/issue/index.js +1 -0
  77. package/lib/commands/issue/report.js +1 -0
  78. package/lib/commands/logs/index.js +1 -1
  79. package/lib/commands/menu/index.js +1 -1
  80. package/lib/commands/menu/shared/compare-table.js +1 -1
  81. package/lib/commands/menu/shared/index.js +1 -1
  82. package/lib/commands/menu/shared/inquirer.js +1 -1
  83. package/lib/commands/menu/shared/local-pages.js +1 -1
  84. package/lib/commands/menu/shared/logic.js +1 -1
  85. package/lib/commands/menu/shared/service.js +1 -1
  86. package/lib/commands/menu/shared/sync-core.js +1 -1
  87. package/lib/commands/menu/shared/update-core.js +1 -1
  88. package/lib/commands/menu/shared/valid-url.js +1 -1
  89. package/lib/commands/menu/sync.js +1 -1
  90. package/lib/commands/menu/update.js +1 -1
  91. package/lib/commands/page/generate-start.js +1 -1
  92. package/lib/commands/page/generate-status.js +1 -1
  93. package/lib/commands/page/index.js +1 -1
  94. package/lib/commands/page/pull.js +1 -1
  95. package/lib/commands/page/push.js +1 -1
  96. package/lib/commands/page/shared.js +1 -1
  97. package/lib/commands/page/standard-page-status.js +1 -1
  98. package/lib/commands/page/sync.js +1 -1
  99. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  100. package/lib/commands/project/create/format-elapsed.js +1 -1
  101. package/lib/commands/project/create/main.js +1 -1
  102. package/lib/commands/project/create/non-interactive.js +1 -1
  103. package/lib/commands/project/create/project-template-path.js +1 -1
  104. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  105. package/lib/commands/project/create/use-format-code.js +1 -1
  106. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  107. package/lib/commands/project/index.js +1 -1
  108. package/lib/commands/project/init.js +1 -1
  109. package/lib/commands/project/upgrade.js +1 -1
  110. package/lib/commands/registry.js +1 -1
  111. package/lib/commands/run/index.js +1 -1
  112. package/lib/commands/schema.js +1 -1
  113. package/lib/commands/skill/index.js +1 -1
  114. package/lib/commands/sql/create.js +1 -1
  115. package/lib/commands/sql/delete.js +1 -1
  116. package/lib/commands/sql/detail.js +1 -1
  117. package/lib/commands/sql/exec.js +1 -1
  118. package/lib/commands/sql/index.js +1 -1
  119. package/lib/commands/sql/list.js +1 -1
  120. package/lib/commands/sql/pull.js +1 -1
  121. package/lib/commands/sql/push.js +1 -1
  122. package/lib/commands/sql/save.js +1 -1
  123. package/lib/commands/sql/shared.js +1 -1
  124. package/lib/commands/sql/status.js +1 -1
  125. package/lib/commands/sql/validate.js +1 -1
  126. package/lib/config/schema.js +1 -1
  127. package/lib/constant/cdn.js +1 -1
  128. package/lib/constant/cli.js +1 -1
  129. package/lib/constant/defaults.js +1 -1
  130. package/lib/constant/domain.js +1 -1
  131. package/lib/constant/env.js +1 -1
  132. package/lib/constant/output.js +1 -1
  133. package/lib/constant/paths.js +1 -1
  134. package/lib/constant/risk.js +1 -1
  135. package/lib/context.js +1 -1
  136. package/lib/core/alias-resolver.js +1 -1
  137. package/lib/core/api-client.js +1 -1
  138. package/lib/core/bff/config.js +1 -1
  139. package/lib/core/bff/file-system.js +1 -1
  140. package/lib/core/bff/hash.js +1 -1
  141. package/lib/core/bff/lock.js +1 -1
  142. package/lib/core/bff/utils.js +1 -1
  143. package/lib/core/db-resolver.js +1 -1
  144. package/lib/core/page/file-system.js +1 -1
  145. package/lib/core/page/hash.js +1 -1
  146. package/lib/core/page/lock.js +1 -1
  147. package/lib/core/sql-sync/config.js +1 -1
  148. package/lib/core/sql-sync/file-system.js +1 -1
  149. package/lib/core/sql-sync/hash.js +1 -1
  150. package/lib/core/sql-sync/lock.js +1 -1
  151. package/lib/core/sql-sync/utils.js +1 -1
  152. package/lib/core/sql-validator.js +1 -1
  153. package/lib/errors.js +1 -1
  154. package/lib/framework/build-all-flags.js +1 -1
  155. package/lib/framework/flags.js +1 -1
  156. package/lib/framework/help.js +1 -1
  157. package/lib/framework/index.js +1 -1
  158. package/lib/framework/output.js +1 -1
  159. package/lib/framework/response.js +1 -1
  160. package/lib/framework/runner-alias.js +1 -1
  161. package/lib/framework/runner.js +1 -1
  162. package/lib/framework/schema-export.js +1 -1
  163. package/lib/framework/types.js +1 -1
  164. package/lib/generated/build-info.js +1 -1
  165. package/lib/help.js +1 -1
  166. package/lib/skills/main.js +1 -1
  167. package/lib/skills/npx-skills-add.js +1 -1
  168. package/lib/telemetry/cli-command-trace.js +1 -1
  169. package/lib/telemetry/cli-help-trace.js +1 -1
  170. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  171. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  172. package/lib/telemetry/send-cli-trace-log.js +1 -1
  173. package/lib/telemetry/send-platform-issue-collect-log.js +1 -0
  174. package/lib/utils/ai_config.js +1 -1
  175. package/lib/utils/apply-jq-filter.js +1 -1
  176. package/lib/utils/cdn-config.js +1 -1
  177. package/lib/utils/check-sdk-version.js +1 -1
  178. package/lib/utils/cli-version-check.js +1 -1
  179. package/lib/utils/cli-version-policy.js +1 -1
  180. package/lib/utils/config.js +1 -1
  181. package/lib/utils/copy-directory.js +1 -1
  182. package/lib/utils/entity-with-id.js +1 -1
  183. package/lib/utils/file-utils.js +1 -1
  184. package/lib/utils/guides-cdn.js +1 -1
  185. package/lib/utils/http-client.js +1 -1
  186. package/lib/utils/is-non-interactive.js +1 -1
  187. package/lib/utils/logger.js +1 -1
  188. package/lib/utils/params.js +1 -1
  189. package/lib/utils/platform.js +1 -1
  190. package/lib/utils/rules-cdn.js +1 -1
  191. package/lib/utils/sleep.js +1 -1
  192. package/lib/utils/template-replacer.js +1 -1
  193. package/lib/utils/version.js +1 -1
  194. package/lib/utils/with-active-cookie.js +1 -1
  195. package/lib/utils/write-cli-side-channel.js +1 -1
  196. package/package.json +2 -1
  197. package/templates/projects/sub-app-react-demo/README.md +1 -1
@@ -1 +1 @@
1
- (function(_0x552256,_0x568676){const _0x10c696=a20_0xb4f3,_0x1c03a6=_0x552256();while(!![]){try{const _0x43e262=-parseInt(_0x10c696(0xbf))/0x1+parseInt(_0x10c696(0xc1))/0x2*(-parseInt(_0x10c696(0xbe))/0x3)+-parseInt(_0x10c696(0xc0))/0x4*(parseInt(_0x10c696(0xbd))/0x5)+-parseInt(_0x10c696(0xba))/0x6+-parseInt(_0x10c696(0xb9))/0x7+-parseInt(_0x10c696(0xbc))/0x8+parseInt(_0x10c696(0xbb))/0x9;if(_0x43e262===_0x568676)break;else _0x1c03a6['push'](_0x1c03a6['shift']());}catch(_0xcdd350){_0x1c03a6['push'](_0x1c03a6['shift']());}}}(a20_0x15ff,0x72471));import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';function a20_0x15ff(){const _0x2aac4a=['2977016kYgTkI','135CnRnNi','3fLAipA','149267tYdnAY','79256UmVDnG','1842770HOnhbX','1514394YjkeDL','5095134miWsgK','31602321lohiMT'];a20_0x15ff=function(){return _0x2aac4a;};return a20_0x15ff();}import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';function a20_0xb4f3(_0x4a9d53,_0x30e3a5){_0x4a9d53=_0x4a9d53-0xb9;const _0x15ff90=a20_0x15ff();let _0xb4f3cf=_0x15ff90[_0x4a9d53];return _0xb4f3cf;}export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];
1
+ (function(_0x557c6b,_0x519dc6){const _0x2ab12a=a20_0x4032,_0x1f6220=_0x557c6b();while(!![]){try{const _0x1f3798=-parseInt(_0x2ab12a(0x19e))/0x1*(-parseInt(_0x2ab12a(0x1a0))/0x2)+parseInt(_0x2ab12a(0x196))/0x3*(parseInt(_0x2ab12a(0x1a1))/0x4)+-parseInt(_0x2ab12a(0x19f))/0x5*(parseInt(_0x2ab12a(0x197))/0x6)+parseInt(_0x2ab12a(0x19a))/0x7*(-parseInt(_0x2ab12a(0x19b))/0x8)+-parseInt(_0x2ab12a(0x1a2))/0x9+parseInt(_0x2ab12a(0x199))/0xa*(-parseInt(_0x2ab12a(0x19d))/0xb)+parseInt(_0x2ab12a(0x19c))/0xc*(parseInt(_0x2ab12a(0x198))/0xd);if(_0x1f3798===_0x519dc6)break;else _0x1f6220['push'](_0x1f6220['shift']());}catch(_0x13f83e){_0x1f6220['push'](_0x1f6220['shift']());}}}(a20_0x1ca7,0x45b2a));import{appListDefinition}from'../../commands/app/list.js';function a20_0x1ca7(){const _0x510b5d=['6xgEuqk','20430631DYPElY','10dyCHwu','166607wNYqSm','24dpIHsb','12SMWArq','4537115GURlIZ','1LLNxOg','1665355tkoMaF','52278zGYjBt','380IayDRT','4797180ttYYsx','1191NXeMQZ'];a20_0x1ca7=function(){return _0x510b5d;};return a20_0x1ca7();}import{appRemoteDefinition}from'../../commands/app/discover.js';function a20_0x4032(_0x5e4adf,_0x316392){_0x5e4adf=_0x5e4adf-0x196;const _0x1ca759=a20_0x1ca7();let _0x40323f=_0x1ca759[_0x5e4adf];return _0x40323f;}import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];
@@ -1 +1 @@
1
- function a21_0x7e75(_0x38f65f,_0x251c7d){_0x38f65f=_0x38f65f-0xd4;const _0x151b2e=a21_0x151b();let _0x7e75ae=_0x151b2e[_0x38f65f];return _0x7e75ae;}const a21_0x469b86=a21_0x7e75;(function(_0x1de688,_0x3c58e3){const _0x3dd689=a21_0x7e75,_0x582d1=_0x1de688();while(!![]){try{const _0x155217=parseInt(_0x3dd689(0xdb))/0x1+-parseInt(_0x3dd689(0xf4))/0x2*(parseInt(_0x3dd689(0xf1))/0x3)+parseInt(_0x3dd689(0xe5))/0x4+-parseInt(_0x3dd689(0xee))/0x5+-parseInt(_0x3dd689(0xd7))/0x6+parseInt(_0x3dd689(0xf3))/0x7+-parseInt(_0x3dd689(0xda))/0x8;if(_0x155217===_0x3c58e3)break;else _0x582d1['push'](_0x582d1['shift']());}catch(_0x407d73){_0x582d1['push'](_0x582d1['shift']());}}}(a21_0x151b,0x95c35));import{readRawConfigWithLayers}from'../../context.js';function a21_0x151b(){const _0x3c245f=['mergedCli','global','489590TzXHvV','globalConfig','projectPath','3UirLEt','appcode','6686470YVHZeh','216686sfUWWv','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','read','bool','entries','1939932qVQaGw','inherit','object','11102224xXQhqr','355462XLHxBI','\x20config','globalPath','List\x20all\x20configured\x20apps','defaultApp','project','projectConfig','isCurrent','length','merged','4880472zQroNG','\x20in\x20','.\x20Use\x20`','map','list','apps','app'];a21_0x151b=function(){return _0x3c245f;};return a21_0x151b();}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(_0x1dfb4f,_0x163422){const _0x4aeaca=a21_0x7e75,_0x28c760=[],_0x462bcf=_0x1dfb4f[_0x4aeaca(0xea)]&&typeof _0x1dfb4f[_0x4aeaca(0xea)]===_0x4aeaca(0xd9)?_0x1dfb4f[_0x4aeaca(0xea)]:{},_0x19b211=_0x1dfb4f[_0x4aeaca(0xdf)]||undefined;for(const [_0x48381e,_0x41c2f2]of Object['entries'](_0x462bcf)){if(!_0x41c2f2||typeof _0x41c2f2!=='object'||!_0x41c2f2['appcode'])continue;_0x28c760['push']({'name':_0x48381e,'appcode':_0x41c2f2[_0x4aeaca(0xf2)],'named':!![],'definedIn':_0x163422,'isDefault':_0x48381e===_0x19b211,...buildAppProfileListFields(_0x41c2f2)});}return _0x28c760;}function buildMergedItems(_0x17e827,_0xd2934d){const _0x4ca165=a21_0x7e75,{apps:apps={},defaultApp:_0x12a4a5}=_0x17e827,_0xb53472=_0xd2934d['globalConfig']['apps']&&typeof _0xd2934d[_0x4ca165(0xef)][_0x4ca165(0xea)]===_0x4ca165(0xd9)?_0xd2934d[_0x4ca165(0xef)][_0x4ca165(0xea)]:{},_0x28f6c2=_0xd2934d[_0x4ca165(0xe1)][_0x4ca165(0xea)]&&typeof _0xd2934d[_0x4ca165(0xe1)][_0x4ca165(0xea)]===_0x4ca165(0xd9)?_0xd2934d[_0x4ca165(0xe1)]['apps']:{},_0x4cb429=_0xd2934d[_0x4ca165(0xe1)][_0x4ca165(0xd8)]===![],_0x4d6a3c=Object[_0x4ca165(0xd6)](apps),_0x554316=_0x4d6a3c[_0x4ca165(0xe8)](([_0x24ebd8,_0x20ad96])=>({'name':_0x24ebd8,'appcode':_0x20ad96[_0x4ca165(0xf2)],'named':!![],'definedIn':appDefinedIn(_0x24ebd8,_0xb53472,_0x28f6c2,_0x4cb429),'isDefault':_0x24ebd8===_0x12a4a5,...buildAppProfileListFields(_0x20ad96)}));return _0x554316;}async function execute(_0x54d8fb){const _0x3dac44=a21_0x7e75,_0x84c5e=_0x54d8fb[_0x3dac44(0xd5)]('global'),_0x55a700=_0x54d8fb[_0x3dac44(0xd5)](_0x3dac44(0xe0)),_0x44ba8b=_0x84c5e?_0x3dac44(0xed):_0x55a700?_0x3dac44(0xe0):_0x3dac44(0xe4),{config:_0x309f17,layers:_0x53b3a2}=readRawConfigWithLayers(),_0x230b97=resolveDefaultAppSource(_0x53b3a2),{defaultApp:_0x1a3100}=_0x309f17;let _0x48011c,_0x10d2e8;switch(_0x44ba8b){case _0x3dac44(0xed):_0x48011c=buildItemsFromLayer(_0x53b3a2[_0x3dac44(0xef)],_0x3dac44(0xed)),_0x10d2e8=_0x53b3a2[_0x3dac44(0xdd)];break;case _0x3dac44(0xe0):_0x48011c=buildItemsFromLayer(_0x53b3a2[_0x3dac44(0xe1)],_0x3dac44(0xe0)),_0x10d2e8=_0x53b3a2['projectPath'];break;default:_0x48011c=buildMergedItems(_0x309f17,_0x53b3a2);break;}enrichAppListItemsWithMergedSelection(_0x48011c,_0x54d8fb[_0x3dac44(0xec)]);if(_0x48011c[_0x3dac44(0xe3)]===0x0){const _0x2588f7=_0x44ba8b===_0x3dac44(0xe4)?'':_0x3dac44(0xe6)+_0x44ba8b+_0x3dac44(0xdc);return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x2588f7+_0x3dac44(0xe7)+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x27dede=_0x48011c['find'](_0x3ac2f2=>_0x3ac2f2[_0x3dac44(0xe2)]===!![]),_0x23355e=_0x1a3100??_0x27dede?.[_0x3dac44(0xf2)]??null,_0x488da6=_0x44ba8b==='merged'?{'globalPath':_0x53b3a2[_0x3dac44(0xdd)]??null,'projectPath':_0x53b3a2[_0x3dac44(0xf0)]??null,'defaultApp':_0x23355e,'defaultAppSource':_0x1a3100!=null?_0x230b97:null}:{'scope':_0x44ba8b,'configPath':_0x10d2e8??null};return{'ok':!![],'data':{'items':_0x48011c,'meta':_0x488da6}};}export const appListDefinition={'service':a21_0x469b86(0xeb),'command':a21_0x469b86(0xe9),'description':a21_0x469b86(0xde),'risk':a21_0x469b86(0xd4),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'global','type':'boolean','description':a21_0x469b86(0xf5),'default':![]},{'name':a21_0x469b86(0xe0),'type':'boolean','description':'Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','default':![]}],'execute':execute};
1
+ const a21_0x471d07=a21_0x3af8;(function(_0x280cb3,_0x3945df){const _0x1f72b=a21_0x3af8,_0x2befda=_0x280cb3();while(!![]){try{const _0x8884a=-parseInt(_0x1f72b(0x6f))/0x1+-parseInt(_0x1f72b(0x78))/0x2*(-parseInt(_0x1f72b(0x75))/0x3)+-parseInt(_0x1f72b(0x6d))/0x4*(parseInt(_0x1f72b(0x6a))/0x5)+parseInt(_0x1f72b(0x7e))/0x6+parseInt(_0x1f72b(0x86))/0x7*(parseInt(_0x1f72b(0x84))/0x8)+-parseInt(_0x1f72b(0x7b))/0x9*(-parseInt(_0x1f72b(0x69))/0xa)+parseInt(_0x1f72b(0x7d))/0xb;if(_0x8884a===_0x3945df)break;else _0x2befda['push'](_0x2befda['shift']());}catch(_0x497723){_0x2befda['push'](_0x2befda['shift']());}}}(a21_0x50f4,0x89c87));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(_0x32d085,_0x57ce50){const _0x2c15db=a21_0x3af8,_0x273cef=[],_0x49ec00=_0x32d085[_0x2c15db(0x72)]&&typeof _0x32d085[_0x2c15db(0x72)]===_0x2c15db(0x87)?_0x32d085[_0x2c15db(0x72)]:{},_0x126650=_0x32d085[_0x2c15db(0x6c)]||undefined;for(const [_0x2cb232,_0x4524eb]of Object[_0x2c15db(0x79)](_0x49ec00)){if(!_0x4524eb||typeof _0x4524eb!=='object'||!_0x4524eb['appcode'])continue;_0x273cef[_0x2c15db(0x85)]({'name':_0x2cb232,'appcode':_0x4524eb['appcode'],'named':!![],'definedIn':_0x57ce50,'isDefault':_0x2cb232===_0x126650,...buildAppProfileListFields(_0x4524eb)});}return _0x273cef;}function a21_0x3af8(_0x5272d0,_0x37f518){_0x5272d0=_0x5272d0-0x66;const _0x50f435=a21_0x50f4();let _0x3af8bf=_0x50f435[_0x5272d0];return _0x3af8bf;}function buildMergedItems(_0x9c0980,_0x2b4894){const _0x54897f=a21_0x3af8,{apps:apps={},defaultApp:_0x4a26a7}=_0x9c0980,_0x13d7e4=_0x2b4894[_0x54897f(0x76)]['apps']&&typeof _0x2b4894[_0x54897f(0x76)][_0x54897f(0x72)]===_0x54897f(0x87)?_0x2b4894[_0x54897f(0x76)][_0x54897f(0x72)]:{},_0x5d6e9c=_0x2b4894[_0x54897f(0x66)]['apps']&&typeof _0x2b4894['projectConfig'][_0x54897f(0x72)]===_0x54897f(0x87)?_0x2b4894['projectConfig']['apps']:{},_0x5002d3=_0x2b4894[_0x54897f(0x66)][_0x54897f(0x82)]===![],_0x28201d=Object['entries'](apps),_0x440cfb=_0x28201d['map'](([_0x4eaa80,_0x63c15f])=>({'name':_0x4eaa80,'appcode':_0x63c15f[_0x54897f(0x73)],'named':!![],'definedIn':appDefinedIn(_0x4eaa80,_0x13d7e4,_0x5d6e9c,_0x5002d3),'isDefault':_0x4eaa80===_0x4a26a7,...buildAppProfileListFields(_0x63c15f)}));return _0x440cfb;}function a21_0x50f4(){const _0xb479df=['3407280zbyhCP','merged','defaultApp','4VCSoUg','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','723320mKzGkm','\x20in\x20','project','apps','appcode','find','3RrBxoa','globalConfig','mergedCli','1027592FNLWWG','entries','length','9DMYRMk','boolean','3242382imgkri','3401262ZAJTXz','bool','global','isCurrent','inherit','projectPath','696568ThWvCd','push','7KxjAJV','object','projectConfig','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','globalPath','5066290zxZAHx'];a21_0x50f4=function(){return _0xb479df;};return a21_0x50f4();}async function execute(_0xe832b2){const _0x481f17=a21_0x3af8,_0x173fa8=_0xe832b2['bool'](_0x481f17(0x80)),_0x2f97fb=_0xe832b2[_0x481f17(0x7f)](_0x481f17(0x71)),_0x117e77=_0x173fa8?_0x481f17(0x80):_0x2f97fb?_0x481f17(0x71):_0x481f17(0x6b),{config:_0x2b867d,layers:_0x159282}=readRawConfigWithLayers(),_0x2ec4fb=resolveDefaultAppSource(_0x159282),{defaultApp:_0x259c8f}=_0x2b867d;let _0xef8efc,_0x35edef;switch(_0x117e77){case _0x481f17(0x80):_0xef8efc=buildItemsFromLayer(_0x159282[_0x481f17(0x76)],_0x481f17(0x80)),_0x35edef=_0x159282[_0x481f17(0x68)];break;case'project':_0xef8efc=buildItemsFromLayer(_0x159282['projectConfig'],'project'),_0x35edef=_0x159282[_0x481f17(0x83)];break;default:_0xef8efc=buildMergedItems(_0x2b867d,_0x159282);break;}enrichAppListItemsWithMergedSelection(_0xef8efc,_0xe832b2[_0x481f17(0x77)]);if(_0xef8efc[_0x481f17(0x7a)]===0x0){const _0x2e7711=_0x117e77===_0x481f17(0x6b)?'':_0x481f17(0x70)+_0x117e77+'\x20config';return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x2e7711+'.\x20Use\x20`'+CLI_BIN_NAME+_0x481f17(0x67)};}const _0x2eae5a=_0xef8efc[_0x481f17(0x74)](_0x5f32c2=>_0x5f32c2[_0x481f17(0x81)]===!![]),_0x228fd4=_0x259c8f??_0x2eae5a?.[_0x481f17(0x73)]??null,_0x29a596=_0x117e77===_0x481f17(0x6b)?{'globalPath':_0x159282[_0x481f17(0x68)]??null,'projectPath':_0x159282[_0x481f17(0x83)]??null,'defaultApp':_0x228fd4,'defaultAppSource':_0x259c8f!=null?_0x2ec4fb:null}:{'scope':_0x117e77,'configPath':_0x35edef??null};return{'ok':!![],'data':{'items':_0xef8efc,'meta':_0x29a596}};}export const appListDefinition={'service':'app','command':'list','description':'List\x20all\x20configured\x20apps','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x471d07(0x80),'type':a21_0x471d07(0x7c),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a21_0x471d07(0x71),'type':'boolean','description':a21_0x471d07(0x6e),'default':![]}],'execute':execute};
@@ -1 +1 @@
1
- const a22_0x2e1264=a22_0x5be3;function a22_0x2c81(){const _0x5c93cd=['object','globalConfig','high-risk-write','237sUbRIx','apps','110rdzHkN','\x22\x20still\x20defined\x20in\x20','name','\x20config.','App\x20profile\x20name\x20to\x20remove','16YXAoxe','713457HmObhE','2976PpvVFF','project','boolean','global','projectConfig','972BWyFtz','Removed\x20app\x20\x22','13XexPux','defaultApp','459906McmbJA','20JOWAWN','length','8283FCweYb','Usage:\x20','Remove\x20an\x20app\x20from\x20config','remove','\x20app\x20remove\x20<name>\x20[--global]','Use\x20global\x20config\x20scope','App\x20\x22','trim','keys','38751852FejxHj','4449711BgUneM','14781547KJpyPh','inherit','both','app','validation'];a22_0x2c81=function(){return _0x5c93cd;};return a22_0x2c81();}(function(_0x1bc168,_0x2774c0){const _0x414fe5=a22_0x5be3,_0x4a0f78=_0x1bc168();while(!![]){try{const _0x3fe26f=parseInt(_0x414fe5(0x12b))/0x1*(-parseInt(_0x414fe5(0x134))/0x2)+-parseInt(_0x414fe5(0x118))/0x3*(parseInt(_0x414fe5(0x111))/0x4)+parseInt(_0x414fe5(0x116))/0x5*(parseInt(_0x414fe5(0x115))/0x6)+parseInt(_0x414fe5(0x122))/0x7*(-parseInt(_0x414fe5(0x132))/0x8)+-parseInt(_0x414fe5(0x133))/0x9*(-parseInt(_0x414fe5(0x12d))/0xa)+-parseInt(_0x414fe5(0x123))/0xb+-parseInt(_0x414fe5(0x121))/0xc*(-parseInt(_0x414fe5(0x113))/0xd);if(_0x3fe26f===_0x2774c0)break;else _0x4a0f78['push'](_0x4a0f78['shift']());}catch(_0x3ab788){_0x4a0f78['push'](_0x4a0f78['shift']());}}}(a22_0x2c81,0xbbcca));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a22_0x5be3(_0x54dce4,_0x204e7e){_0x54dce4=_0x54dce4-0x10f;const _0x2c81cf=a22_0x2c81();let _0x5be3c0=_0x2c81cf[_0x54dce4];return _0x5be3c0;}async function validateArgs(_0x305fef){const _0xd75507=a22_0x5be3,_0x5c0879=_0x305fef['args'][0x0]?.[_0xd75507(0x11f)]();if(!_0x5c0879)throw CliErrors[_0xd75507(0x127)]('Missing\x20app\x20name.',_0xd75507(0x119)+CLI_BIN_NAME+_0xd75507(0x11c));}async function execute(_0x45d8d4){const _0x5398f1=a22_0x5be3,_0x733896=_0x45d8d4['args'][0x0]?.[_0x5398f1(0x11f)]();if(!_0x733896)throw CliErrors[_0x5398f1(0x127)]('Missing\x20app\x20name.',_0x5398f1(0x119)+CLI_BIN_NAME+_0x5398f1(0x11c));const _0x13d6cc=_0x45d8d4['bool']('global'),{config:_0x47f737,layers:_0x39f609}=readRawConfigWithLayers(),_0x12ee5e=_0x47f737[_0x5398f1(0x12c)]??{};if(!_0x12ee5e[_0x733896])throw CliErrors[_0x5398f1(0x127)]('App\x20\x22'+_0x733896+'\x22\x20not\x20found.');const _0x301972=_0x39f609[_0x5398f1(0x129)][_0x5398f1(0x12c)]&&typeof _0x39f609[_0x5398f1(0x129)][_0x5398f1(0x12c)]===_0x5398f1(0x128)?_0x39f609[_0x5398f1(0x129)][_0x5398f1(0x12c)]:{},_0x254702=_0x39f609['projectConfig'][_0x5398f1(0x12c)]&&typeof _0x39f609['projectConfig'][_0x5398f1(0x12c)]===_0x5398f1(0x128)?_0x39f609['projectConfig'][_0x5398f1(0x12c)]:{},_0x5ac879=appDefinedIn(_0x733896,_0x301972,_0x254702,_0x39f609[_0x5398f1(0x110)][_0x5398f1(0x124)]===![]),_0x5e4907=resolveAppScopeForWrite(_0x733896,_0x13d6cc,_0x39f609),_0x26d0f8={'global':_0x5e4907===_0x5398f1(0x10f)},_0x33e22e=readConfig(_0x26d0f8),_0x1e2636=_0x33e22e[_0x5398f1(0x12c)];if(!_0x1e2636||!_0x1e2636[_0x733896])throw CliErrors['validation'](_0x5398f1(0x11e)+_0x733896+'\x22\x20not\x20found.');delete _0x1e2636[_0x733896];let _0x9d8c46='';if(_0x33e22e[_0x5398f1(0x114)]===_0x733896){const _0x472a8f=Object['keys'](_0x1e2636);_0x33e22e[_0x5398f1(0x114)]=_0x472a8f[_0x5398f1(0x117)]>0x0?_0x472a8f[0x0]:undefined,_0x33e22e[_0x5398f1(0x114)]?_0x9d8c46='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x33e22e['defaultApp']+'\x22.':delete _0x33e22e[_0x5398f1(0x114)];}Object[_0x5398f1(0x120)](_0x1e2636)[_0x5398f1(0x117)]===0x0&&(delete _0x33e22e[_0x5398f1(0x12c)],delete _0x33e22e[_0x5398f1(0x114)]);writeConfig(_0x33e22e,_0x26d0f8);const _0x3e8481=_0x5ac879===_0x5398f1(0x125)?'\x20Note:\x20app\x20\x22'+_0x733896+_0x5398f1(0x12e)+(_0x5e4907===_0x5398f1(0x135)?_0x5398f1(0x10f):'project')+_0x5398f1(0x130):'';return{'ok':!![],'message':_0x5398f1(0x112)+_0x733896+'\x22'+scopeLabel(_0x26d0f8)+'.'+_0x9d8c46+_0x3e8481};}export const appRemoveDefinition={'service':a22_0x2e1264(0x126),'command':a22_0x2e1264(0x11b),'description':a22_0x2e1264(0x11a),'risk':a22_0x2e1264(0x12a),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a22_0x2e1264(0x12f),'description':a22_0x2e1264(0x131),'required':!![]}],'flags':[{'name':'global','type':a22_0x2e1264(0x136),'description':a22_0x2e1264(0x11d),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a22_0x524db3=a22_0x3cc8;(function(_0x15f4c6,_0x2ed4df){const _0x3ccf58=a22_0x3cc8,_0x1507d5=_0x15f4c6();while(!![]){try{const _0x2337a0=-parseInt(_0x3ccf58(0x9f))/0x1*(-parseInt(_0x3ccf58(0xa8))/0x2)+parseInt(_0x3ccf58(0xa1))/0x3+parseInt(_0x3ccf58(0x86))/0x4+-parseInt(_0x3ccf58(0x89))/0x5*(-parseInt(_0x3ccf58(0x9a))/0x6)+parseInt(_0x3ccf58(0x9b))/0x7+parseInt(_0x3ccf58(0xa4))/0x8*(-parseInt(_0x3ccf58(0x96))/0x9)+-parseInt(_0x3ccf58(0xa0))/0xa*(parseInt(_0x3ccf58(0x85))/0xb);if(_0x2337a0===_0x2ed4df)break;else _0x1507d5['push'](_0x1507d5['shift']());}catch(_0x2d7701){_0x1507d5['push'](_0x1507d5['shift']());}}}(a22_0x53b6,0xf1dee));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a22_0x53b6(){const _0x28e9af=['inherit','Remove\x20an\x20app\x20from\x20config','args','projectConfig','App\x20\x22','defaultApp','remove','Usage:\x20','length','\x20Default\x20app\x20changed\x20to\x20\x22','10425204ztaUrH','App\x20profile\x20name\x20to\x20remove','globalConfig','project','6eIkCed','3238928YzLizr','Missing\x20app\x20name.','trim','name','1304876ZcLSNW','433600dCLGuX','5020719UsuSOM','\x20Note:\x20app\x20\x22','validation','8RtfuIP','app','global','\x22\x20not\x20found.','2byJDHq','Removed\x20app\x20\x22','high-risk-write','Use\x20global\x20config\x20scope','object','bool','\x20config.','boolean','\x22\x20still\x20defined\x20in\x20','869MGofrI','5506280uchwHm','\x20app\x20remove\x20<name>\x20[--global]','both','3783875WKzvvv','apps','keys'];a22_0x53b6=function(){return _0x28e9af;};return a22_0x53b6();}async function validateArgs(_0x332ed7){const _0x22145e=a22_0x3cc8,_0x14aac5=_0x332ed7[_0x22145e(0x8e)][0x0]?.[_0x22145e(0x9d)]();if(!_0x14aac5)throw CliErrors[_0x22145e(0xa3)](_0x22145e(0x9c),_0x22145e(0x93)+CLI_BIN_NAME+_0x22145e(0x87));}async function execute(_0xac4038){const _0x7a5ad6=a22_0x3cc8,_0x5a6371=_0xac4038[_0x7a5ad6(0x8e)][0x0]?.[_0x7a5ad6(0x9d)]();if(!_0x5a6371)throw CliErrors[_0x7a5ad6(0xa3)](_0x7a5ad6(0x9c),'Usage:\x20'+CLI_BIN_NAME+_0x7a5ad6(0x87));const _0x154bb9=_0xac4038[_0x7a5ad6(0x81)](_0x7a5ad6(0xa6)),{config:_0x1e3422,layers:_0x294ab0}=readRawConfigWithLayers(),_0x4d59d7=_0x1e3422[_0x7a5ad6(0x8a)]??{};if(!_0x4d59d7[_0x5a6371])throw CliErrors[_0x7a5ad6(0xa3)](_0x7a5ad6(0x90)+_0x5a6371+'\x22\x20not\x20found.');const _0x599d2d=_0x294ab0['globalConfig']['apps']&&typeof _0x294ab0[_0x7a5ad6(0x98)][_0x7a5ad6(0x8a)]===_0x7a5ad6(0x80)?_0x294ab0['globalConfig'][_0x7a5ad6(0x8a)]:{},_0x72f0de=_0x294ab0['projectConfig'][_0x7a5ad6(0x8a)]&&typeof _0x294ab0[_0x7a5ad6(0x8f)][_0x7a5ad6(0x8a)]==='object'?_0x294ab0[_0x7a5ad6(0x8f)][_0x7a5ad6(0x8a)]:{},_0x20e64b=appDefinedIn(_0x5a6371,_0x599d2d,_0x72f0de,_0x294ab0[_0x7a5ad6(0x8f)][_0x7a5ad6(0x8c)]===![]),_0x126c83=resolveAppScopeForWrite(_0x5a6371,_0x154bb9,_0x294ab0),_0x148c2b={'global':_0x126c83===_0x7a5ad6(0xa6)},_0x5b5501=readConfig(_0x148c2b),_0x1699fa=_0x5b5501[_0x7a5ad6(0x8a)];if(!_0x1699fa||!_0x1699fa[_0x5a6371])throw CliErrors[_0x7a5ad6(0xa3)](_0x7a5ad6(0x90)+_0x5a6371+_0x7a5ad6(0xa7));delete _0x1699fa[_0x5a6371];let _0x434d28='';if(_0x5b5501[_0x7a5ad6(0x91)]===_0x5a6371){const _0x68e78=Object[_0x7a5ad6(0x8b)](_0x1699fa);_0x5b5501[_0x7a5ad6(0x91)]=_0x68e78[_0x7a5ad6(0x94)]>0x0?_0x68e78[0x0]:undefined,_0x5b5501[_0x7a5ad6(0x91)]?_0x434d28=_0x7a5ad6(0x95)+_0x5b5501['defaultApp']+'\x22.':delete _0x5b5501[_0x7a5ad6(0x91)];}Object['keys'](_0x1699fa)['length']===0x0&&(delete _0x5b5501[_0x7a5ad6(0x8a)],delete _0x5b5501['defaultApp']);writeConfig(_0x5b5501,_0x148c2b);const _0x5b7f08=_0x20e64b===_0x7a5ad6(0x88)?_0x7a5ad6(0xa2)+_0x5a6371+_0x7a5ad6(0x84)+(_0x126c83===_0x7a5ad6(0x99)?'global':_0x7a5ad6(0x99))+_0x7a5ad6(0x82):'';return{'ok':!![],'message':_0x7a5ad6(0xa9)+_0x5a6371+'\x22'+scopeLabel(_0x148c2b)+'.'+_0x434d28+_0x5b7f08};}function a22_0x3cc8(_0x2aece1,_0x31ee26){_0x2aece1=_0x2aece1-0x7f;const _0x53b67e=a22_0x53b6();let _0x3cc84f=_0x53b67e[_0x2aece1];return _0x3cc84f;}export const appRemoveDefinition={'service':a22_0x524db3(0xa5),'command':a22_0x524db3(0x92),'description':a22_0x524db3(0x8d),'risk':a22_0x524db3(0xaa),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a22_0x524db3(0x9e),'description':a22_0x524db3(0x97),'required':!![]}],'flags':[{'name':'global','type':a22_0x524db3(0x83),'description':a22_0x524db3(0x7f),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- (function(_0x343c85,_0x114f10){const _0x431ab8=a23_0xe25a,_0x55b56d=_0x343c85();while(!![]){try{const _0x559cec=-parseInt(_0x431ab8(0x1c7))/0x1*(-parseInt(_0x431ab8(0x1d7))/0x2)+parseInt(_0x431ab8(0x1c8))/0x3*(parseInt(_0x431ab8(0x1c2))/0x4)+parseInt(_0x431ab8(0x1c3))/0x5*(parseInt(_0x431ab8(0x1be))/0x6)+-parseInt(_0x431ab8(0x1c9))/0x7*(parseInt(_0x431ab8(0x1c6))/0x8)+-parseInt(_0x431ab8(0x1d3))/0x9*(parseInt(_0x431ab8(0x1cb))/0xa)+parseInt(_0x431ab8(0x1bc))/0xb+-parseInt(_0x431ab8(0x1bd))/0xc;if(_0x559cec===_0x114f10)break;else _0x55b56d['push'](_0x55b56d['shift']());}catch(_0x5eebde){_0x55b56d['push'](_0x55b56d['shift']());}}}(a23_0x61eb,0x5d2e7));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x1a2096,_0x5a877e){const _0x4d5187=a23_0xe25a;if(!_0x5a877e)return;const _0x2dfaed=_0x5a877e['apps']&&typeof _0x5a877e['apps']===_0x4d5187(0x1d8)?_0x5a877e[_0x4d5187(0x1ce)]:{},_0x464efb=Object[_0x4d5187(0x1cf)](_0x2dfaed)[_0x4d5187(0x1dc)]>0x0;for(const _0x3816ff of _0x1a2096){_0x3816ff[_0x4d5187(0x1ca)]=![];}const _0x55315c=_0x5a877e[_0x4d5187(0x1d2)]!=null?String(_0x5a877e[_0x4d5187(0x1d2)])[_0x4d5187(0x1d0)]():'';if(_0x464efb){const _0x57ddb1=_0x5a877e[_0x4d5187(0x1d9)]??_0x5a877e[_0x4d5187(0x1d4)];if(_0x57ddb1)for(const _0x1dec1b of _0x1a2096){_0x1dec1b['named']===!![]&&_0x1dec1b[_0x4d5187(0x1d1)]===_0x57ddb1&&(_0x1dec1b[_0x4d5187(0x1ca)]=!![]);}for(const _0x368158 of _0x1a2096){if(_0x368158[_0x4d5187(0x1cd)]!==![])continue;if(_0x5a877e['defaultApp'])continue;_0x55315c&&String(_0x368158[_0x4d5187(0x1cc)]??'')[_0x4d5187(0x1d0)]()===_0x55315c&&(_0x368158[_0x4d5187(0x1ca)]=!![]);}return;}if(!_0x55315c)return;for(const _0xea18ba of _0x1a2096){String(_0xea18ba[_0x4d5187(0x1cc)]??'')['trim']()===_0x55315c&&(_0xea18ba[_0x4d5187(0x1ca)]=!![]);}}export function resolveAppScopeForWrite(_0x45ea69,_0x4a23dc,_0x19bf2c){const _0x7cae03=a23_0xe25a;if(_0x4a23dc)return _0x7cae03(0x1dd);const _0x5bcab3=_0x19bf2c[_0x7cae03(0x1d5)][_0x7cae03(0x1ce)]&&typeof _0x19bf2c['projectConfig']['apps']===_0x7cae03(0x1d8)?_0x19bf2c[_0x7cae03(0x1d5)][_0x7cae03(0x1ce)]:{},_0x2bc1be=_0x19bf2c[_0x7cae03(0x1c4)][_0x7cae03(0x1ce)]&&typeof _0x19bf2c[_0x7cae03(0x1c4)]['apps']===_0x7cae03(0x1d8)?_0x19bf2c[_0x7cae03(0x1c4)][_0x7cae03(0x1ce)]:{};if(Object[_0x7cae03(0x1bf)][_0x7cae03(0x1c5)]['call'](_0x5bcab3,_0x45ea69))return _0x7cae03(0x1d6);if(Object[_0x7cae03(0x1bf)]['hasOwnProperty'][_0x7cae03(0x1db)](_0x2bc1be,_0x45ea69))return _0x7cae03(0x1dd);return _0x7cae03(0x1d6);}export function appDefinedIn(_0xac7558,_0x3b154a,_0x2adc12,_0x3f980c){const _0x37e8e1=a23_0xe25a;if(_0x3f980c)return Object[_0x37e8e1(0x1bf)][_0x37e8e1(0x1c5)][_0x37e8e1(0x1db)](_0x2adc12,_0xac7558)?'project':_0x37e8e1(0x1dd);const _0x519e2c=Object[_0x37e8e1(0x1bf)]['hasOwnProperty'][_0x37e8e1(0x1db)](_0x3b154a,_0xac7558),_0x5d831b=Object[_0x37e8e1(0x1bf)][_0x37e8e1(0x1c5)][_0x37e8e1(0x1db)](_0x2adc12,_0xac7558);if(_0x519e2c&&_0x5d831b)return _0x37e8e1(0x1c0);if(_0x5d831b)return _0x37e8e1(0x1d6);return _0x37e8e1(0x1dd);}function a23_0x61eb(){const _0x14ace8=['4jeuBVb','object','currentApp','inherit','call','length','global','7289623lfjyFo','8797032NGSgvj','57306tEyVuy','prototype','both','\x20(global)','2360HBEVgB','75yaViYI','globalConfig','hasOwnProperty','192fcfMhz','17905HvFTul','1896tgLaTk','224OWGKFp','isCurrent','7030xoSEKN','appcode','named','apps','keys','trim','name','appCode','1269HOtiZY','defaultApp','projectConfig','project'];a23_0x61eb=function(){return _0x14ace8;};return a23_0x61eb();}export function resolveDefaultAppSource(_0x1a8edc){const _0x506cad=a23_0xe25a,_0x8a22af=_0x1a8edc[_0x506cad(0x1d5)][_0x506cad(0x1ce)]&&typeof _0x1a8edc[_0x506cad(0x1d5)][_0x506cad(0x1ce)]===_0x506cad(0x1d8)?_0x1a8edc[_0x506cad(0x1d5)][_0x506cad(0x1ce)]:{};if(_0x506cad(0x1d4)in _0x1a8edc[_0x506cad(0x1d5)])return _0x506cad(0x1d6);if(Object[_0x506cad(0x1cf)](_0x8a22af)[_0x506cad(0x1dc)]>0x0)return _0x506cad(0x1d6);if(_0x1a8edc[_0x506cad(0x1d5)][_0x506cad(0x1da)]===![])return null;if(_0x1a8edc['globalConfig'][_0x506cad(0x1d4)])return _0x506cad(0x1dd);return null;}export function getConfigPath(_0x1fd4bb={}){const _0x57014f=a23_0xe25a,_0x4ef894=_0x1fd4bb[_0x57014f(0x1dd)]?_0x57014f(0x1dd):_0x57014f(0x1d6);return resolveWriteConfigPath(_0x4ef894);}export function readConfig(_0x5b5f1c={}){return readConfigFile(getConfigPath(_0x5b5f1c));}function a23_0xe25a(_0x389710,_0x196a68){_0x389710=_0x389710-0x1bc;const _0x61eb41=a23_0x61eb();let _0xe25aef=_0x61eb41[_0x389710];return _0xe25aef;}export function writeConfig(_0x28f6f7,_0x38b7ed={}){writeConfigFile(getConfigPath(_0x38b7ed),_0x28f6f7);}export function scopeLabel(_0x550b3d){const _0x10102a=a23_0xe25a;return _0x550b3d[_0x10102a(0x1dd)]?_0x10102a(0x1c1):'';}
1
+ (function(_0x1852f8,_0x39ec4f){const _0x12e0f9=a23_0x1a16,_0x2cf1ad=_0x1852f8();while(!![]){try{const _0x537864=-parseInt(_0x12e0f9(0xd4))/0x1*(-parseInt(_0x12e0f9(0xc6))/0x2)+parseInt(_0x12e0f9(0xd5))/0x3*(-parseInt(_0x12e0f9(0xcb))/0x4)+parseInt(_0x12e0f9(0xd9))/0x5*(-parseInt(_0x12e0f9(0xcc))/0x6)+parseInt(_0x12e0f9(0xda))/0x7*(-parseInt(_0x12e0f9(0xc9))/0x8)+-parseInt(_0x12e0f9(0xc5))/0x9*(parseInt(_0x12e0f9(0xd3))/0xa)+parseInt(_0x12e0f9(0xc8))/0xb+parseInt(_0x12e0f9(0xbf))/0xc;if(_0x537864===_0x39ec4f)break;else _0x2cf1ad['push'](_0x2cf1ad['shift']());}catch(_0x647147){_0x2cf1ad['push'](_0x2cf1ad['shift']());}}}(a23_0x5d96,0x4c27a));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x30019c,_0x3719a5){const _0x40f59d=a23_0x1a16;if(!_0x3719a5)return;const _0x506483=_0x3719a5[_0x40f59d(0xd7)]&&typeof _0x3719a5[_0x40f59d(0xd7)]==='object'?_0x3719a5['apps']:{},_0x56016a=Object[_0x40f59d(0xc7)](_0x506483)[_0x40f59d(0xc4)]>0x0;for(const _0x14d1d0 of _0x30019c){_0x14d1d0[_0x40f59d(0xc0)]=![];}const _0x2eaf83=_0x3719a5['appCode']!=null?String(_0x3719a5[_0x40f59d(0xc2)])[_0x40f59d(0xbd)]():'';if(_0x56016a){const _0x20211f=_0x3719a5[_0x40f59d(0xce)]??_0x3719a5[_0x40f59d(0xbe)];if(_0x20211f)for(const _0x2a6841 of _0x30019c){_0x2a6841['named']===!![]&&_0x2a6841[_0x40f59d(0xbc)]===_0x20211f&&(_0x2a6841[_0x40f59d(0xc0)]=!![]);}for(const _0x53af2c of _0x30019c){if(_0x53af2c['named']!==![])continue;if(_0x3719a5[_0x40f59d(0xbe)])continue;_0x2eaf83&&String(_0x53af2c['appcode']??'')[_0x40f59d(0xbd)]()===_0x2eaf83&&(_0x53af2c[_0x40f59d(0xc0)]=!![]);}return;}if(!_0x2eaf83)return;for(const _0x234175 of _0x30019c){String(_0x234175[_0x40f59d(0xd6)]??'')[_0x40f59d(0xbd)]()===_0x2eaf83&&(_0x234175[_0x40f59d(0xc0)]=!![]);}}export function resolveAppScopeForWrite(_0x1cca1c,_0x5146d9,_0xa8e5da){const _0x256fae=a23_0x1a16;if(_0x5146d9)return _0x256fae(0xc3);const _0x35c768=_0xa8e5da['projectConfig'][_0x256fae(0xd7)]&&typeof _0xa8e5da[_0x256fae(0xc1)]['apps']===_0x256fae(0xd0)?_0xa8e5da['projectConfig'][_0x256fae(0xd7)]:{},_0x311bd3=_0xa8e5da[_0x256fae(0xcf)][_0x256fae(0xd7)]&&typeof _0xa8e5da[_0x256fae(0xcf)][_0x256fae(0xd7)]===_0x256fae(0xd0)?_0xa8e5da[_0x256fae(0xcf)]['apps']:{};if(Object[_0x256fae(0xbb)]['hasOwnProperty']['call'](_0x35c768,_0x1cca1c))return _0x256fae(0xca);if(Object['prototype'][_0x256fae(0xd1)][_0x256fae(0xcd)](_0x311bd3,_0x1cca1c))return _0x256fae(0xc3);return _0x256fae(0xca);}function a23_0x1a16(_0x70179e,_0x58c3e5){_0x70179e=_0x70179e-0xbb;const _0x5d96b2=a23_0x5d96();let _0x1a1693=_0x5d96b2[_0x70179e];return _0x1a1693;}export function appDefinedIn(_0x3f0f27,_0x31ee51,_0x585fa2,_0x1c2dda){const _0x20fd18=a23_0x1a16;if(_0x1c2dda)return Object[_0x20fd18(0xbb)][_0x20fd18(0xd1)][_0x20fd18(0xcd)](_0x585fa2,_0x3f0f27)?_0x20fd18(0xca):_0x20fd18(0xc3);const _0x56d66b=Object[_0x20fd18(0xbb)][_0x20fd18(0xd1)][_0x20fd18(0xcd)](_0x31ee51,_0x3f0f27),_0x5ce3e6=Object[_0x20fd18(0xbb)][_0x20fd18(0xd1)][_0x20fd18(0xcd)](_0x585fa2,_0x3f0f27);if(_0x56d66b&&_0x5ce3e6)return'both';if(_0x5ce3e6)return _0x20fd18(0xca);return _0x20fd18(0xc3);}export function resolveDefaultAppSource(_0x17aeb1){const _0x187894=a23_0x1a16,_0x383517=_0x17aeb1[_0x187894(0xc1)][_0x187894(0xd7)]&&typeof _0x17aeb1[_0x187894(0xc1)][_0x187894(0xd7)]===_0x187894(0xd0)?_0x17aeb1[_0x187894(0xc1)][_0x187894(0xd7)]:{};if(_0x187894(0xbe)in _0x17aeb1[_0x187894(0xc1)])return _0x187894(0xca);if(Object[_0x187894(0xc7)](_0x383517)['length']>0x0)return _0x187894(0xca);if(_0x17aeb1[_0x187894(0xc1)][_0x187894(0xd2)]===![])return null;if(_0x17aeb1[_0x187894(0xcf)][_0x187894(0xbe)])return _0x187894(0xc3);return null;}export function getConfigPath(_0x202257={}){const _0xf54fc6=a23_0x1a16,_0x1f7db2=_0x202257[_0xf54fc6(0xc3)]?_0xf54fc6(0xc3):_0xf54fc6(0xca);return resolveWriteConfigPath(_0x1f7db2);}export function readConfig(_0xdd0d84={}){return readConfigFile(getConfigPath(_0xdd0d84));}export function writeConfig(_0x481f7d,_0x3ed2be={}){writeConfigFile(getConfigPath(_0x3ed2be),_0x481f7d);}function a23_0x5d96(){const _0x24ccfd=['apps','\x20(global)','4255dStRlr','14308wDNvDO','prototype','name','trim','defaultApp','6887388golHqz','isCurrent','projectConfig','appCode','global','length','1102149BSgQNP','12pVAZtm','keys','3216070LJsOSr','1072zHfpFG','project','8jADzkR','2634pvVnjb','call','currentApp','globalConfig','object','hasOwnProperty','inherit','20yuvzeU','92572KVTniK','326121DyxJDG','appcode'];a23_0x5d96=function(){return _0x24ccfd;};return a23_0x5d96();}export function scopeLabel(_0x10f64d){const _0x576972=a23_0x1a16;return _0x10f64d[_0x576972(0xc3)]?_0x576972(0xd8):'';}
@@ -1 +1 @@
1
- const a24_0x177d92=a24_0x55e1;function a24_0x24b9(){const _0x441f9e=['837108ETHpwA','write','Default\x20app\x20set\x20to\x20\x22','projectConfig','hasOwnProperty','App\x20profile\x20name\x20to\x20activate','Usage:\x20','\x22\x20(appcode:\x20','\x0aNote:\x20\x22','4hSuFKg','appcode','call','use','defaultApp','app','projectPath','trim','\x20app\x20use\x20<name>\x20[--global]','App\x20\x22','\x20--appcode\x20<code>`\x20first.','2994568apEsdN','length','7CddyiD','1345611QQwHqM','2624220AmaGLH','global','Missing\x20app\x20name.','apps','Switch\x20the\x20default\x20app','2OPjCkP','2363730dGCEpI','bool','\x22\x20not\x20found.','validation','\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.','\x20app\x20add\x20','keys','2169165Ijnfit','222017zWEfyM','args','Available:\x20','Use\x20global\x20config\x20scope'];a24_0x24b9=function(){return _0x441f9e;};return a24_0x24b9();}(function(_0x43f0ee,_0x5ebaca){const _0x67d3f5=a24_0x55e1,_0x4373d3=_0x43f0ee();while(!![]){try{const _0x3242b0=parseInt(_0x67d3f5(0xd8))/0x1+parseInt(_0x67d3f5(0xcf))/0x2*(parseInt(_0x67d3f5(0xc9))/0x3)+-parseInt(_0x67d3f5(0xe5))/0x4*(parseInt(_0x67d3f5(0xd7))/0x5)+-parseInt(_0x67d3f5(0xdc))/0x6+-parseInt(_0x67d3f5(0xc8))/0x7*(parseInt(_0x67d3f5(0xc6))/0x8)+parseInt(_0x67d3f5(0xca))/0x9+parseInt(_0x67d3f5(0xd0))/0xa;if(_0x3242b0===_0x5ebaca)break;else _0x4373d3['push'](_0x4373d3['shift']());}catch(_0x5e1265){_0x4373d3['push'](_0x4373d3['shift']());}}}(a24_0x24b9,0x3d3d3));import{CliErrors}from'../../errors.js';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(_0x4ce6dc){const _0x35544f=a24_0x55e1,_0x2e7181=_0x4ce6dc[_0x35544f(0xd9)][0x0]?.[_0x35544f(0xec)]();if(!_0x2e7181)throw CliErrors['validation'](_0x35544f(0xcc),'Usage:\x20'+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');}function a24_0x55e1(_0x663be2,_0x2771de){_0x663be2=_0x663be2-0xc3;const _0x24b984=a24_0x24b9();let _0x55e1bf=_0x24b984[_0x663be2];return _0x55e1bf;}async function execute(_0x458798){const _0x2ec972=a24_0x55e1,_0x6f0ebb=_0x458798[_0x2ec972(0xd9)][0x0]?.[_0x2ec972(0xec)]();if(!_0x6f0ebb)throw CliErrors[_0x2ec972(0xd3)]('Missing\x20app\x20name.',_0x2ec972(0xe2)+CLI_BIN_NAME+_0x2ec972(0xc3));const _0x2ffda5=_0x458798[_0x2ec972(0xd1)]('global'),{config:_0x3e115d,layers:_0x51901a}=readRawConfigWithLayers(),_0x51ba6f=_0x3e115d[_0x2ec972(0xcd)]??{};if(!_0x51ba6f[_0x6f0ebb]){const _0x25c9b1=Object[_0x2ec972(0xd6)](_0x51ba6f),_0x3b7829=_0x25c9b1[_0x2ec972(0xc7)]===0x0?'Use\x20`'+CLI_BIN_NAME+_0x2ec972(0xd5)+_0x6f0ebb+_0x2ec972(0xc5):_0x2ec972(0xda)+_0x25c9b1['join'](',\x20');throw CliErrors[_0x2ec972(0xd3)](_0x2ec972(0xc4)+_0x6f0ebb+_0x2ec972(0xd2),_0x3b7829);}let _0x2a8c19,_0x330974='';if(_0x2ffda5)_0x2a8c19={'global':!![]};else{const _0x4eea54=isInProject()&&!!_0x51901a[_0x2ec972(0xeb)];_0x2a8c19={'global':!_0x4eea54};if(_0x4eea54){const _0x219079=_0x51901a[_0x2ec972(0xdf)][_0x2ec972(0xcd)]&&typeof _0x51901a[_0x2ec972(0xdf)][_0x2ec972(0xcd)]==='object'?_0x51901a[_0x2ec972(0xdf)][_0x2ec972(0xcd)]:{};!Object['prototype'][_0x2ec972(0xe0)][_0x2ec972(0xe7)](_0x219079,_0x6f0ebb)&&(_0x330974=_0x2ec972(0xe4)+_0x6f0ebb+_0x2ec972(0xd4));}}const _0x5a1e33=readConfig(_0x2a8c19);return _0x5a1e33[_0x2ec972(0xe9)]=_0x6f0ebb,writeConfig(_0x5a1e33,_0x2a8c19),{'ok':!![],'message':_0x2ec972(0xde)+_0x6f0ebb+_0x2ec972(0xe3)+_0x51ba6f[_0x6f0ebb][_0x2ec972(0xe6)]+')'+scopeLabel(_0x2a8c19)+_0x330974};}export const appUseDefinition={'service':a24_0x177d92(0xea),'command':a24_0x177d92(0xe8),'description':a24_0x177d92(0xce),'risk':a24_0x177d92(0xdd),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a24_0x177d92(0xe1),'required':!![]}],'flags':[{'name':a24_0x177d92(0xcb),'type':'boolean','description':a24_0x177d92(0xdb),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a24_0x489952=a24_0x5b05;(function(_0x2835e7,_0x32bc89){const _0x2d3e88=a24_0x5b05,_0x4f84bd=_0x2835e7();while(!![]){try{const _0xab714a=-parseInt(_0x2d3e88(0xc2))/0x1+-parseInt(_0x2d3e88(0xc9))/0x2*(parseInt(_0x2d3e88(0xd0))/0x3)+parseInt(_0x2d3e88(0xe0))/0x4+parseInt(_0x2d3e88(0xbd))/0x5*(-parseInt(_0x2d3e88(0xcd))/0x6)+parseInt(_0x2d3e88(0xd1))/0x7+parseInt(_0x2d3e88(0xc0))/0x8+-parseInt(_0x2d3e88(0xcc))/0x9*(-parseInt(_0x2d3e88(0xcb))/0xa);if(_0xab714a===_0x32bc89)break;else _0x4f84bd['push'](_0x4f84bd['shift']());}catch(_0x1553f0){_0x4f84bd['push'](_0x4f84bd['shift']());}}}(a24_0x1ed1,0xac484));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers,isInProject}from'../../context.js';function a24_0x1ed1(){const _0x47cb9d=['object','boolean','defaultApp','projectConfig','Usage:\x20','args','Use\x20`','App\x20\x22','join','use','\x20app\x20add\x20','validation','appcode','Missing\x20app\x20name.','828680DzVVCk','app','prototype','trim','\x0aNote:\x20\x22','79990wFznjr','bool','apps','1338088iOZRJf','\x20app\x20use\x20<name>\x20[--global]','395191cbqUaB','\x22\x20(appcode:\x20','projectPath','App\x20profile\x20name\x20to\x20activate','Default\x20app\x20set\x20to\x20\x22','keys','hasOwnProperty','828074EsFqZg','Available:\x20','10mrhsxO','13606119UcZFtK','366KJjuuw','name','write','3dlBUzv','4231864owmjif'];a24_0x1ed1=function(){return _0x47cb9d;};return a24_0x1ed1();}import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x36e9dc){const _0xc78101=a24_0x5b05,_0x494bde=_0x36e9dc[_0xc78101(0xd7)][0x0]?.[_0xc78101(0xbb)]();if(!_0x494bde)throw CliErrors[_0xc78101(0xdd)](_0xc78101(0xdf),'Usage:\x20'+CLI_BIN_NAME+_0xc78101(0xc1));}function a24_0x5b05(_0x5d72ed,_0x2ccbc2){_0x5d72ed=_0x5d72ed-0xbb;const _0x1ed121=a24_0x1ed1();let _0x5b0590=_0x1ed121[_0x5d72ed];return _0x5b0590;}async function execute(_0x284173){const _0x2a4474=a24_0x5b05,_0x27d97b=_0x284173[_0x2a4474(0xd7)][0x0]?.[_0x2a4474(0xbb)]();if(!_0x27d97b)throw CliErrors[_0x2a4474(0xdd)](_0x2a4474(0xdf),_0x2a4474(0xd6)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');const _0x5ab9c4=_0x284173[_0x2a4474(0xbe)]('global'),{config:_0x435bea,layers:_0x56b52f}=readRawConfigWithLayers(),_0x2df715=_0x435bea[_0x2a4474(0xbf)]??{};if(!_0x2df715[_0x27d97b]){const _0x5879fa=Object[_0x2a4474(0xc7)](_0x2df715),_0x284a9c=_0x5879fa['length']===0x0?_0x2a4474(0xd8)+CLI_BIN_NAME+_0x2a4474(0xdc)+_0x27d97b+'\x20--appcode\x20<code>`\x20first.':_0x2a4474(0xca)+_0x5879fa[_0x2a4474(0xda)](',\x20');throw CliErrors[_0x2a4474(0xdd)](_0x2a4474(0xd9)+_0x27d97b+'\x22\x20not\x20found.',_0x284a9c);}let _0x19a318,_0x1df81a='';if(_0x5ab9c4)_0x19a318={'global':!![]};else{const _0xb858ba=isInProject()&&!!_0x56b52f[_0x2a4474(0xc4)];_0x19a318={'global':!_0xb858ba};if(_0xb858ba){const _0x4a924a=_0x56b52f[_0x2a4474(0xd5)][_0x2a4474(0xbf)]&&typeof _0x56b52f[_0x2a4474(0xd5)][_0x2a4474(0xbf)]===_0x2a4474(0xd2)?_0x56b52f['projectConfig'][_0x2a4474(0xbf)]:{};!Object[_0x2a4474(0xe2)][_0x2a4474(0xc8)]['call'](_0x4a924a,_0x27d97b)&&(_0x1df81a=_0x2a4474(0xbc)+_0x27d97b+'\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.');}}const _0x39fecb=readConfig(_0x19a318);return _0x39fecb[_0x2a4474(0xd4)]=_0x27d97b,writeConfig(_0x39fecb,_0x19a318),{'ok':!![],'message':_0x2a4474(0xc6)+_0x27d97b+_0x2a4474(0xc3)+_0x2df715[_0x27d97b][_0x2a4474(0xde)]+')'+scopeLabel(_0x19a318)+_0x1df81a};}export const appUseDefinition={'service':a24_0x489952(0xe1),'command':a24_0x489952(0xdb),'description':'Switch\x20the\x20default\x20app','risk':a24_0x489952(0xcf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a24_0x489952(0xce),'description':a24_0x489952(0xc5),'required':!![]}],'flags':[{'name':'global','type':a24_0x489952(0xd3),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- function a25_0x24e5(_0x2182f0,_0x4891c3){_0x2182f0=_0x2182f0-0xb2;const _0xf7f974=a25_0xf7f9();let _0x24e52d=_0xf7f974[_0x2182f0];return _0x24e52d;}function a25_0xf7f9(){const _0x6d88=['bool','login','boolean','write','nonInteractive','390Utjfub','yes','1431856RBAGuY','!\x20Not\x20logged\x20in','647544GptzxO','Login\x20via\x20browser','✓\x20Logged\x20out','log','2717856HBUVvs','Clear\x20login\x20session','auth','../../auth/auth-server-ui.js','140038EWTsLU','1188470lahVnt','70551uwDmUj','217IlxgFF','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','read','30536mQsFPe','1JNTCua'];a25_0xf7f9=function(){return _0x6d88;};return a25_0xf7f9();}const a25_0x4916f8=a25_0x24e5;(function(_0x39a02e,_0x11bf98){const _0x54ef2c=a25_0x24e5,_0x1a0c8c=_0x39a02e();while(!![]){try{const _0x5006e7=parseInt(_0x54ef2c(0xba))/0x1*(-parseInt(_0x54ef2c(0xb3))/0x2)+-parseInt(_0x54ef2c(0xc4))/0x3+parseInt(_0x54ef2c(0xc2))/0x4+parseInt(_0x54ef2c(0xb4))/0x5+-parseInt(_0x54ef2c(0xc8))/0x6+-parseInt(_0x54ef2c(0xb6))/0x7*(-parseInt(_0x54ef2c(0xb9))/0x8)+-parseInt(_0x54ef2c(0xb5))/0x9*(-parseInt(_0x54ef2c(0xc0))/0xa);if(_0x5006e7===_0x11bf98)break;else _0x1a0c8c['push'](_0x1a0c8c['shift']());}catch(_0x39bd64){_0x1a0c8c['push'](_0x1a0c8c['shift']());}}}(a25_0xf7f9,0x4491f));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a25_0x4916f8(0xca),'command':a25_0x4916f8(0xbc),'description':a25_0x4916f8(0xc5),'risk':a25_0x4916f8(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':a25_0x4916f8(0xbd),'description':a25_0x4916f8(0xb7),'default':![]}],async 'execute'(_0x1d2530){const _0x1238c6=a25_0x4916f8,{runAuthServer:_0x1b7524}=await import(_0x1238c6(0xb2));return await _0x1b7524({'autoYes':_0x1d2530[_0x1238c6(0xbb)](_0x1238c6(0xc1)),'nonInteractive':_0x1d2530[_0x1238c6(0xbf)]}),{'ok':!![]};}},{'service':a25_0x4916f8(0xca),'command':'logout','description':a25_0x4916f8(0xc9),'risk':a25_0x4916f8(0xbe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4e0f32){const _0x30eb32=a25_0x4916f8;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x30eb32(0xc7)](_0x30eb32(0xc6))):console['log'](_0x30eb32(0xc3)),{'ok':!![]};}}];
1
+ const a25_0x4f5805=a25_0x5608;function a25_0x5608(_0x35eca9,_0x2efe30){_0x35eca9=_0x35eca9-0xbd;const _0x25062f=a25_0x2506();let _0x5608fd=_0x25062f[_0x35eca9];return _0x5608fd;}(function(_0x292bfe,_0x3d8c8d){const _0x39cfe0=a25_0x5608,_0x5af932=_0x292bfe();while(!![]){try{const _0xb76ca4=-parseInt(_0x39cfe0(0xbe))/0x1+-parseInt(_0x39cfe0(0xc5))/0x2*(-parseInt(_0x39cfe0(0xbf))/0x3)+-parseInt(_0x39cfe0(0xc1))/0x4+-parseInt(_0x39cfe0(0xc8))/0x5+-parseInt(_0x39cfe0(0xc4))/0x6+parseInt(_0x39cfe0(0xc9))/0x7*(-parseInt(_0x39cfe0(0xbd))/0x8)+parseInt(_0x39cfe0(0xd2))/0x9;if(_0xb76ca4===_0x3d8c8d)break;else _0x5af932['push'](_0x5af932['shift']());}catch(_0x269524){_0x5af932['push'](_0x5af932['shift']());}}}(a25_0x2506,0x921b5));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a25_0x4f5805(0xd0),'command':a25_0x4f5805(0xcc),'description':'Login\x20via\x20browser','risk':a25_0x4f5805(0xcd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a25_0x4f5805(0xca),'type':a25_0x4f5805(0xcb),'description':a25_0x4f5805(0xc6),'default':![]}],async 'execute'(_0x25ab0a){const _0x1d76b6=a25_0x4f5805,{runAuthServer:_0x5439c5}=await import(_0x1d76b6(0xc0));return await _0x5439c5({'autoYes':_0x25ab0a[_0x1d76b6(0xd3)](_0x1d76b6(0xca)),'nonInteractive':_0x25ab0a['nonInteractive']}),{'ok':!![]};}},{'service':'auth','command':a25_0x4f5805(0xc7),'description':a25_0x4f5805(0xc2),'risk':a25_0x4f5805(0xce),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1c1abb){const _0x44f5f6=a25_0x4f5805;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x44f5f6(0xd1))):console[_0x44f5f6(0xcf)](_0x44f5f6(0xc3)),{'ok':!![]};}}];function a25_0x2506(){const _0x11fb3e=['40920rgLDLN','42966fYDNTK','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','logout','3948355wHjbZV','7TUnrkd','yes','boolean','login','read','write','log','auth','✓\x20Logged\x20out','23305167Kjpnsi','bool','4097680mdTtjO','850828tQTghG','69QrdkVr','../../auth/auth-server-ui.js','1302360NRvZhB','Clear\x20login\x20session','!\x20Not\x20logged\x20in'];a25_0x2506=function(){return _0x11fb3e;};return a25_0x2506();}
@@ -1 +1 @@
1
- const a26_0x3596b9=a26_0x1372;(function(_0x419038,_0x4f0e11){const _0x318e53=a26_0x1372,_0x2b2c22=_0x419038();while(!![]){try{const _0xd1460d=parseInt(_0x318e53(0x1f7))/0x1+-parseInt(_0x318e53(0x1dd))/0x2*(-parseInt(_0x318e53(0x1e4))/0x3)+parseInt(_0x318e53(0x1fd))/0x4+parseInt(_0x318e53(0x218))/0x5+parseInt(_0x318e53(0x1cf))/0x6+parseInt(_0x318e53(0x1d0))/0x7*(parseInt(_0x318e53(0x1f6))/0x8)+parseInt(_0x318e53(0x20e))/0x9*(-parseInt(_0x318e53(0x1e3))/0xa);if(_0xd1460d===_0x4f0e11)break;else _0x2b2c22['push'](_0x2b2c22['shift']());}catch(_0xfeb9a4){_0x2b2c22['push'](_0x2b2c22['shift']());}}}(a26_0x4251,0x5020d));import{createInterface}from'node:readline';function a26_0x4251(){const _0x2037bb=['\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','type','keys','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','map','utf8','create','Script\x20type','685365KUPRSU','No\x20operation\x20types\x20found\x20for\x20dataset\x20','join','\x22\x20not\x20found\x20for\x20dataset\x20','parseInt','Alias\x20\x22','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','after','Available\x20aliases:\x20','operationType','string','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','nonInteractive','length','entries','scriptsRootDir','Invalid\x20function\x20name\x20\x22','name','2314962xZfqSy','8428lOgLJw','stderr','function-node','write','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','alias','\x0a\x20*\x20[触发节点]\x20','.js','includes','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Select\x20dataset:','Operation\x20type\x20(HOOK\x20only)','find','9182MkkxDB','str','HOOK\x20requires\x20alias/operation/node\x20options.','description','.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','\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','10735810hxZojj','156fLsDyd','HOOK','TODO:\x20add\x20script\x20description','File\x20already\x20exists:\x20','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Invalid\x20dataset\x20selection.','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','before','apiDir','tableName','\x20function:\x20','datasetCode','functionNode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20datasets\x20found\x20for\x20this\x20app.','trim','424hVYDLM','51761AivfvR','bff','Function\x20name\x20(valid\x20JS\x20identifier)','No\x20api.ts\x20found.\x20Run\x20`','\x22.\x20','\x22\x20not\x20found.\x20','2098324vzQFnD','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','question','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20not\x20found\x20for\x20code\x20\x22','COMMON','operation-type','stdin','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','validation','Select\x20operation\x20type:','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','code','close','appCode','9aJketQ','ENDPOINT'];a26_0x4251=function(){return _0x2037bb;};return a26_0x4251();}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 bffCreate={'service':a26_0x3596b9(0x1f8),'command':a26_0x3596b9(0x216),'description':a26_0x3596b9(0x21e),'risk':'write','flags':[{'name':a26_0x3596b9(0x211),'type':a26_0x3596b9(0x223),'required':!![],'enum':['COMMON',a26_0x3596b9(0x20f),'HOOK'],'description':a26_0x3596b9(0x217)},{'name':a26_0x3596b9(0x1ce),'type':a26_0x3596b9(0x223),'required':!![],'description':a26_0x3596b9(0x1f9)},{'name':a26_0x3596b9(0x1e0),'type':a26_0x3596b9(0x223),'description':'Script\x20description'},{'name':a26_0x3596b9(0x1d5),'type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x1d9)},{'name':'datasetcode','type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x1ff)},{'name':a26_0x3596b9(0x204),'type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x1db)},{'name':a26_0x3596b9(0x1d2),'type':a26_0x3596b9(0x223),'description':a26_0x3596b9(0x201),'enum':[a26_0x3596b9(0x1ec),a26_0x3596b9(0x220)]}],async 'validate'(_0xc2f7e7){const _0xe9e50=a26_0x3596b9,_0x2f8069=_0xc2f7e7['str']('name');if(!isValidBffFunctionName(_0x2f8069))throw CliErrors[_0xe9e50(0x207)](_0xe9e50(0x1cd)+_0x2f8069+_0xe9e50(0x20a));},async 'execute'(_0x30fc16){const _0x4b18e0=a26_0x3596b9,_0x3951ee=loadBffProjectConfig(_0x30fc16[_0x4b18e0(0x20d)]),_0x4105c5=_0x30fc16[_0x4b18e0(0x1de)](_0x4b18e0(0x211)),_0x54a8dc=_0x30fc16[_0x4b18e0(0x1de)]('name'),_0x4ebdfc=_0x30fc16[_0x4b18e0(0x1de)](_0x4b18e0(0x1e0))||undefined,_0x402dcb=_0x4105c5===_0x4b18e0(0x1e5)?await resolveHookOptions(_0x3951ee,_0x30fc16):undefined,_0x1f2609=buildFilePath(_0x3951ee,_0x4105c5,_0x54a8dc,_0x402dcb);if(await fileExists(_0x1f2609))throw CliErrors['validation'](_0x4b18e0(0x1e7)+_0x1f2609);await mkdir(dirname(_0x1f2609),{'recursive':!![]});const _0x2cfbd9=generateTemplate(_0x4105c5,_0x54a8dc,_0x30fc16['appCode'],_0x4ebdfc,_0x402dcb);await writeFile(_0x1f2609,_0x2cfbd9,_0x4b18e0(0x215));const _0x3a79d6={'type':_0x4105c5,'name':_0x54a8dc,'path':_0x1f2609};if(_0x4ebdfc)_0x3a79d6[_0x4b18e0(0x1e0)]=_0x4ebdfc;if(_0x402dcb){if(_0x402dcb[_0x4b18e0(0x1d5)])_0x3a79d6[_0x4b18e0(0x1d5)]=_0x402dcb['alias'];_0x3a79d6[_0x4b18e0(0x1f0)]=_0x402dcb[_0x4b18e0(0x1f0)],_0x3a79d6['operationType']=_0x402dcb[_0x4b18e0(0x222)],_0x3a79d6[_0x4b18e0(0x1f1)]=_0x402dcb['functionNode'];}return{'ok':!![],'data':_0x3a79d6,'message':'Created\x20'+_0x4105c5+_0x4b18e0(0x1ef)+_0x54a8dc};}};async function resolveHookOptions(_0x21c539,_0x33f56d){const _0x2d71ff=a26_0x3596b9,_0x38f1de=loadAliasMap(_0x33f56d[_0x2d71ff(0x1ed)],undefined,resolveApiFilePath(_0x33f56d['apiDir'],_0x33f56d[_0x2d71ff(0x20d)])),_0x16b417=_0x38f1de[_0x2d71ff(0x226)]>0x0;let _0x57670b,_0x337ce0,_0x353e0d;const _0x992fcc=_0x33f56d['str'](_0x2d71ff(0x1d5)),_0x1c4f66=_0x33f56d['str']('datasetcode');if(_0x992fcc){const _0x39d3aa=resolveAlias(_0x33f56d[_0x2d71ff(0x1ed)],_0x992fcc,undefined,resolveApiFilePath(_0x33f56d[_0x2d71ff(0x1ed)],_0x33f56d[_0x2d71ff(0x20d)]));if(!_0x39d3aa){const _0x5adf96=_0x16b417?_0x2d71ff(0x221)+_0x38f1de[_0x2d71ff(0x214)](_0x5b0446=>_0x5b0446[_0x2d71ff(0x1d5)])[_0x2d71ff(0x21a)](',\x20'):_0x2d71ff(0x1fa)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors['validation'](_0x2d71ff(0x21d)+_0x992fcc+_0x2d71ff(0x1fc)+_0x5adf96);}_0x57670b=_0x992fcc,_0x337ce0=_0x39d3aa;}else{if(_0x1c4f66){_0x337ce0=_0x1c4f66;const _0x171e24=_0x38f1de[_0x2d71ff(0x1dc)](_0x3eec74=>_0x3eec74['datasetCode']===_0x1c4f66);_0x57670b=_0x171e24?.[_0x2d71ff(0x1d5)];}else{if(_0x33f56d[_0x2d71ff(0x225)])throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1f2));else{if(_0x16b417){const _0xfcd7f1=_0x38f1de[_0x2d71ff(0x214)](_0x1aabce=>_0x1aabce['alias']+'\x20('+_0x1aabce[_0x2d71ff(0x1ee)]+')'),_0x250dc2=await promptSelect(_0x2d71ff(0x1da),_0xfcd7f1),_0x21b53f=_0x38f1de[_0x250dc2];if(!_0x21b53f)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1e9));_0x57670b=_0x21b53f[_0x2d71ff(0x1d5)],_0x337ce0=_0x21b53f[_0x2d71ff(0x1f0)];}else{const _0x5c13d8=await listDatasets(_0x33f56d[_0x2d71ff(0x20d)]);if(_0x5c13d8[_0x2d71ff(0x226)]===0x0)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1f4));const _0x12691c=_0x5c13d8[_0x2d71ff(0x214)](_0xc9c576=>_0xc9c576['name']+'\x20('+_0xc9c576[_0x2d71ff(0x20b)]+')'),_0x13325b=await promptSelect(_0x2d71ff(0x1da),_0x12691c),_0x596e1c=_0x5c13d8[_0x13325b];if(!_0x596e1c)throw CliErrors[_0x2d71ff(0x207)]('Invalid\x20dataset\x20selection.');_0x337ce0=_0x596e1c[_0x2d71ff(0x20b)],_0x57670b=undefined;}}}}const _0x471909=await listDatasets(_0x33f56d[_0x2d71ff(0x20d)]),_0x4718c1=_0x471909['find'](_0x26aba1=>_0x26aba1[_0x2d71ff(0x20b)]===_0x337ce0);if(!_0x4718c1)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x202)+_0x337ce0+_0x2d71ff(0x1fb)+(_0x57670b?_0x2d71ff(0x1fe)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x353e0d=_0x4718c1['id'];const _0x27d591=_0x57670b??_0x337ce0,_0x1f9990=await listBffDatasetOperations(_0x33f56d['appCode'],_0x353e0d),_0x152bf5=_0x1f9990?Object[_0x2d71ff(0x212)](_0x1f9990):[];if(_0x152bf5[_0x2d71ff(0x226)]===0x0)throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x219)+_0x27d591+'.');let _0x18a4b3;const _0x53e9b0=_0x33f56d[_0x2d71ff(0x1de)](_0x2d71ff(0x204));if(_0x53e9b0){if(!_0x152bf5[_0x2d71ff(0x1d8)](_0x53e9b0))throw CliErrors[_0x2d71ff(0x207)]('Operation\x20type\x20\x22'+_0x53e9b0+_0x2d71ff(0x21b)+_0x27d591+'.\x20'+('Available:\x20'+_0x152bf5[_0x2d71ff(0x21a)](',\x20')));_0x18a4b3=_0x53e9b0;}else{if(_0x33f56d['nonInteractive'])throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1f3));const _0x433d15=await promptSelect(_0x2d71ff(0x208),_0x152bf5);_0x18a4b3=_0x152bf5[_0x433d15]??_0x152bf5[0x0];}let _0x95c4ba=normalizeHookFunctionNode(_0x33f56d['str'](_0x2d71ff(0x1d2)));if(!_0x95c4ba){if(_0x33f56d[_0x2d71ff(0x1de)](_0x2d71ff(0x1d2)))throw CliErrors['validation'](_0x2d71ff(0x224));if(_0x33f56d[_0x2d71ff(0x225)])throw CliErrors[_0x2d71ff(0x207)](_0x2d71ff(0x1e8));const _0x236ec5=await promptSelect('Select\x20trigger\x20node:',[_0x2d71ff(0x1ec),_0x2d71ff(0x220)]);_0x95c4ba=['before',_0x2d71ff(0x220)][_0x236ec5]??'before';}return{'alias':_0x57670b,'datasetCode':_0x337ce0,'datasetId':_0x353e0d,'operationType':_0x18a4b3,'functionNode':_0x95c4ba};}async function promptSelect(_0x17ce9a,_0x21cd3d){const _0x568bf3=a26_0x3596b9;if(_0x21cd3d[_0x568bf3(0x226)]===0x1)return 0x0;for(const [_0x5efcc3,_0x52db1c]of _0x21cd3d[_0x568bf3(0x1cb)]()){process[_0x568bf3(0x1d1)][_0x568bf3(0x1d3)]('\x20\x20'+(_0x5efcc3+0x1)+'.\x20'+_0x52db1c+'\x0a');}const _0x1f1646=createInterface({'input':process[_0x568bf3(0x205)],'output':process[_0x568bf3(0x1d1)]});while(!![]){const _0x19ce18=await new Promise(_0x12568a=>{const _0x2c5306=_0x568bf3;_0x1f1646[_0x2c5306(0x200)](_0x17ce9a+'\x20',_0x12568a);}),_0x3bf1e8=Number[_0x568bf3(0x21c)](_0x19ce18[_0x568bf3(0x1f5)](),0xa);if(Number['isInteger'](_0x3bf1e8)&&_0x3bf1e8>=0x1&&_0x3bf1e8<=_0x21cd3d[_0x568bf3(0x226)])return _0x1f1646[_0x568bf3(0x20c)](),_0x3bf1e8-0x1;process[_0x568bf3(0x1d1)][_0x568bf3(0x1d3)](_0x568bf3(0x1eb)+_0x21cd3d[_0x568bf3(0x226)]+'.\x0a');}}function a26_0x1372(_0x162ec3,_0x588454){_0x162ec3=_0x162ec3-0x1cb;const _0x4251fd=a26_0x4251();let _0x137219=_0x4251fd[_0x162ec3];return _0x137219;}function buildFilePath(_0x25810f,_0x31c9e3,_0x59b84b,_0x20447c){const _0x2dd549=a26_0x3596b9;if(_0x31c9e3===_0x2dd549(0x1e5)){if(!_0x20447c)throw CliErrors['validation'](_0x2dd549(0x1df));const _0x1aed5c=_0x20447c[_0x2dd549(0x1d5)]??_0x20447c[_0x2dd549(0x1f0)];return join(_0x25810f['scriptsRootDir'],_0x2dd549(0x1e5),_0x1aed5c,_0x20447c['operationType'],_0x20447c[_0x2dd549(0x1f1)],_0x59b84b+_0x2dd549(0x1d7));}return join(_0x25810f[_0x2dd549(0x1cc)],_0x31c9e3,_0x59b84b+_0x2dd549(0x1d7));}export function generateTemplate(_0x48075d,_0x57d6c7,_0x20b1ee,_0xf6d35e,_0x4e4223){const _0x24c7e0=a26_0x3596b9,_0x420d32=_0xf6d35e?.[_0x24c7e0(0x1f5)]()||_0x24c7e0(0x1e6);if(_0x48075d===_0x24c7e0(0x203))return _0x24c7e0(0x1d4)+_0x420d32+'\x0a\x20*\x20[脚本名称]\x20'+_0x57d6c7+_0x24c7e0(0x206)+_0x57d6c7+_0x24c7e0(0x1e1)+_0x57d6c7+_0x24c7e0(0x213);if(_0x48075d===_0x24c7e0(0x20f))return _0x24c7e0(0x1ea)+_0x420d32+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x20b1ee+'/'+_0x57d6c7+_0x24c7e0(0x210)+_0x57d6c7+_0x24c7e0(0x213);if(!_0x4e4223)throw CliErrors[_0x24c7e0(0x207)](_0x24c7e0(0x209));return _0x24c7e0(0x21f)+_0x420d32+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x20b1ee+'/'+_0x4e4223[_0x24c7e0(0x1f0)]+'/'+_0x4e4223[_0x24c7e0(0x222)]+_0x24c7e0(0x1d6)+_0x4e4223['functionNode']+_0x24c7e0(0x1e2)+_0x57d6c7+_0x24c7e0(0x213);}
1
+ const a26_0x3c9470=a26_0x383d;(function(_0x35178f,_0x2dfd91){const _0x53df3d=a26_0x383d,_0x20b351=_0x35178f();while(!![]){try{const _0x9cf08f=parseInt(_0x53df3d(0xa0))/0x1+-parseInt(_0x53df3d(0xc9))/0x2*(parseInt(_0x53df3d(0xbf))/0x3)+parseInt(_0x53df3d(0xac))/0x4+parseInt(_0x53df3d(0xc0))/0x5+-parseInt(_0x53df3d(0xda))/0x6*(-parseInt(_0x53df3d(0xdb))/0x7)+parseInt(_0x53df3d(0x99))/0x8*(-parseInt(_0x53df3d(0xd7))/0x9)+-parseInt(_0x53df3d(0x95))/0xa*(parseInt(_0x53df3d(0x9f))/0xb);if(_0x9cf08f===_0x2dfd91)break;else _0x20b351['push'](_0x20b351['shift']());}catch(_0x2e48d0){_0x20b351['push'](_0x20b351['shift']());}}}(a26_0x4ff5,0x66710));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a26_0x4ff5(){const _0x3113a4=['\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','\x0a\x20*\x20[脚本名称]\x20','\x22\x20not\x20found\x20for\x20dataset\x20','tableName','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','58BzfkTz','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','Alias\x20\x22','Script\x20type','join','parseInt','HOOK','close','Available\x20aliases:\x20','function-node','create','Script\x20description','\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','find','2124HEctvT','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Trigger\x20node\x20(HOOK\x20only)','5508vSjEOx','6181rsSoGU','No\x20datasets\x20found\x20for\x20this\x20app.','str','operation-type','length','COMMON','Created\x20','Select\x20trigger\x20node:','.js','after','entries','bff','TODO:\x20add\x20script\x20description','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','Select\x20operation\x20type:','stderr','Invalid\x20dataset\x20selection.','write','type','alias','1483100OwsaSt','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','keys','map','16232YTwEDZ','name','\x20api\x20pull`\x20to\x20refresh.','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','Available:\x20','includes','55otXxRs','377171KxVyMM','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','validation','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Function\x20name\x20(valid\x20JS\x20identifier)','appCode','operationType','\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','scriptsRootDir','nonInteractive','isInteger','question','2943620bWmMuz','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Select\x20dataset:','functionNode','No\x20api.ts\x20found.\x20Run\x20`','datasetcode','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','before','ENDPOINT','apiDir','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','code','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Operation\x20type\x20(HOOK\x20only)','datasetCode','string','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Operation\x20type\x20\x22','53565CpLscu','1170595eijrHu','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','description','trim'];a26_0x4ff5=function(){return _0x3113a4;};return a26_0x4ff5();}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';function a26_0x383d(_0x17abd8,_0x10d234){_0x17abd8=_0x17abd8-0x93;const _0x4ff558=a26_0x4ff5();let _0x383d97=_0x4ff558[_0x17abd8];return _0x383d97;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffCreate={'service':a26_0x3c9470(0xe6),'command':a26_0x3c9470(0xd3),'description':a26_0x3c9470(0x9c),'risk':a26_0x3c9470(0xec),'flags':[{'name':a26_0x3c9470(0x93),'type':a26_0x3c9470(0xbb),'required':!![],'enum':[a26_0x3c9470(0xe0),a26_0x3c9470(0xb4),a26_0x3c9470(0xcf)],'description':a26_0x3c9470(0xcc)},{'name':a26_0x3c9470(0x9a),'type':a26_0x3c9470(0xbb),'required':!![],'description':a26_0x3c9470(0xa4)},{'name':a26_0x3c9470(0xc2),'type':a26_0x3c9470(0xbb),'description':a26_0x3c9470(0xd4)},{'name':a26_0x3c9470(0x94),'type':a26_0x3c9470(0xbb),'description':a26_0x3c9470(0xa1)},{'name':a26_0x3c9470(0xb1),'type':'string','description':'Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)'},{'name':a26_0x3c9470(0xde),'type':'string','description':a26_0x3c9470(0xb9)},{'name':'function-node','type':a26_0x3c9470(0xbb),'description':a26_0x3c9470(0xd9),'enum':[a26_0x3c9470(0xb3),a26_0x3c9470(0xe4)]}],async 'validate'(_0x332469){const _0x501671=a26_0x3c9470,_0x5aea77=_0x332469[_0x501671(0xdd)](_0x501671(0x9a));if(!isValidBffFunctionName(_0x5aea77))throw CliErrors[_0x501671(0xa2)]('Invalid\x20function\x20name\x20\x22'+_0x5aea77+_0x501671(0xa3));},async 'execute'(_0x403d04){const _0x46cca0=a26_0x3c9470,_0x29ecb5=loadBffProjectConfig(_0x403d04[_0x46cca0(0xa5)]),_0x1daff8=_0x403d04[_0x46cca0(0xdd)](_0x46cca0(0x93)),_0x4d8af8=_0x403d04[_0x46cca0(0xdd)]('name'),_0x317068=_0x403d04[_0x46cca0(0xdd)](_0x46cca0(0xc2))||undefined,_0x470043=_0x1daff8===_0x46cca0(0xcf)?await resolveHookOptions(_0x29ecb5,_0x403d04):undefined,_0x5b2362=buildFilePath(_0x29ecb5,_0x1daff8,_0x4d8af8,_0x470043);if(await fileExists(_0x5b2362))throw CliErrors[_0x46cca0(0xa2)]('File\x20already\x20exists:\x20'+_0x5b2362);await mkdir(dirname(_0x5b2362),{'recursive':!![]});const _0x4a1f1c=generateTemplate(_0x1daff8,_0x4d8af8,_0x403d04[_0x46cca0(0xa5)],_0x317068,_0x470043);await writeFile(_0x5b2362,_0x4a1f1c,'utf8');const _0x3d67c5={'type':_0x1daff8,'name':_0x4d8af8,'path':_0x5b2362};if(_0x317068)_0x3d67c5[_0x46cca0(0xc2)]=_0x317068;if(_0x470043){if(_0x470043['alias'])_0x3d67c5['alias']=_0x470043[_0x46cca0(0x94)];_0x3d67c5[_0x46cca0(0xba)]=_0x470043[_0x46cca0(0xba)],_0x3d67c5['operationType']=_0x470043[_0x46cca0(0xa6)],_0x3d67c5[_0x46cca0(0xaf)]=_0x470043[_0x46cca0(0xaf)];}return{'ok':!![],'data':_0x3d67c5,'message':_0x46cca0(0xe1)+_0x1daff8+'\x20function:\x20'+_0x4d8af8};}};async function resolveHookOptions(_0x4a9389,_0x1a4a4c){const _0x5f20b8=a26_0x3c9470,_0x40c654=loadAliasMap(_0x1a4a4c[_0x5f20b8(0xb5)],undefined,resolveApiFilePath(_0x1a4a4c['apiDir'],_0x1a4a4c['appCode'])),_0x420707=_0x40c654[_0x5f20b8(0xdf)]>0x0;let _0x7744f9,_0xff5f1c,_0x27f6a1;const _0x176534=_0x1a4a4c[_0x5f20b8(0xdd)]('alias'),_0x4020f1=_0x1a4a4c[_0x5f20b8(0xdd)](_0x5f20b8(0xb1));if(_0x176534){const _0x3e9828=resolveAlias(_0x1a4a4c['apiDir'],_0x176534,undefined,resolveApiFilePath(_0x1a4a4c['apiDir'],_0x1a4a4c[_0x5f20b8(0xa5)]));if(!_0x3e9828){const _0x2705a1=_0x420707?_0x5f20b8(0xd1)+_0x40c654['map'](_0xbe2108=>_0xbe2108[_0x5f20b8(0x94)])[_0x5f20b8(0xcd)](',\x20'):_0x5f20b8(0xb0)+CLI_BIN_NAME+_0x5f20b8(0xbd);throw CliErrors['validation'](_0x5f20b8(0xcb)+_0x176534+'\x22\x20not\x20found.\x20'+_0x2705a1);}_0x7744f9=_0x176534,_0xff5f1c=_0x3e9828;}else{if(_0x4020f1){_0xff5f1c=_0x4020f1;const _0x1758d9=_0x40c654[_0x5f20b8(0xd6)](_0x20fd35=>_0x20fd35[_0x5f20b8(0xba)]===_0x4020f1);_0x7744f9=_0x1758d9?.[_0x5f20b8(0x94)];}else{if(_0x1a4a4c[_0x5f20b8(0xa9)])throw CliErrors[_0x5f20b8(0xa2)](_0x5f20b8(0xb8));else{if(_0x420707){const _0xb7a1f2=_0x40c654[_0x5f20b8(0x98)](_0x9af9b5=>_0x9af9b5[_0x5f20b8(0x94)]+'\x20('+_0x9af9b5[_0x5f20b8(0xc7)]+')'),_0x396bea=await promptSelect(_0x5f20b8(0xae),_0xb7a1f2),_0x1af2ed=_0x40c654[_0x396bea];if(!_0x1af2ed)throw CliErrors[_0x5f20b8(0xa2)]('Invalid\x20dataset\x20selection.');_0x7744f9=_0x1af2ed[_0x5f20b8(0x94)],_0xff5f1c=_0x1af2ed['datasetCode'];}else{const _0x198414=await listDatasets(_0x1a4a4c['appCode']);if(_0x198414[_0x5f20b8(0xdf)]===0x0)throw CliErrors[_0x5f20b8(0xa2)](_0x5f20b8(0xdc));const _0x6b7d01=_0x198414['map'](_0x827094=>_0x827094[_0x5f20b8(0x9a)]+'\x20('+_0x827094['code']+')'),_0x381a28=await promptSelect(_0x5f20b8(0xae),_0x6b7d01),_0x2ccd11=_0x198414[_0x381a28];if(!_0x2ccd11)throw CliErrors['validation'](_0x5f20b8(0xeb));_0xff5f1c=_0x2ccd11['code'],_0x7744f9=undefined;}}}}const _0x53699e=await listDatasets(_0x1a4a4c[_0x5f20b8(0xa5)]),_0x4c1d9c=_0x53699e[_0x5f20b8(0xd6)](_0x2abdbd=>_0x2abdbd[_0x5f20b8(0xb7)]===_0xff5f1c);if(!_0x4c1d9c)throw CliErrors['validation']('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0xff5f1c+'\x22.\x20'+(_0x7744f9?_0x5f20b8(0xca)+CLI_BIN_NAME+_0x5f20b8(0x9b):''));_0x27f6a1=_0x4c1d9c['id'];const _0x4a9b26=_0x7744f9??_0xff5f1c,_0x5ea101=await listBffDatasetOperations(_0x1a4a4c[_0x5f20b8(0xa5)],_0x27f6a1),_0x372ae2=_0x5ea101?Object[_0x5f20b8(0x97)](_0x5ea101):[];if(_0x372ae2[_0x5f20b8(0xdf)]===0x0)throw CliErrors[_0x5f20b8(0xa2)](_0x5f20b8(0xad)+_0x4a9b26+'.');let _0x35d78b;const _0x1341ae=_0x1a4a4c[_0x5f20b8(0xdd)](_0x5f20b8(0xde));if(_0x1341ae){if(!_0x372ae2[_0x5f20b8(0x9e)](_0x1341ae))throw CliErrors[_0x5f20b8(0xa2)](_0x5f20b8(0xbe)+_0x1341ae+_0x5f20b8(0xc6)+_0x4a9b26+'.\x20'+(_0x5f20b8(0x9d)+_0x372ae2[_0x5f20b8(0xcd)](',\x20')));_0x35d78b=_0x1341ae;}else{if(_0x1a4a4c[_0x5f20b8(0xa9)])throw CliErrors['validation'](_0x5f20b8(0xc8));const _0x2e7d93=await promptSelect(_0x5f20b8(0xe9),_0x372ae2);_0x35d78b=_0x372ae2[_0x2e7d93]??_0x372ae2[0x0];}let _0x5333ba=normalizeHookFunctionNode(_0x1a4a4c[_0x5f20b8(0xdd)](_0x5f20b8(0xd2)));if(!_0x5333ba){if(_0x1a4a4c[_0x5f20b8(0xdd)]('function-node'))throw CliErrors[_0x5f20b8(0xa2)](_0x5f20b8(0xbc));if(_0x1a4a4c[_0x5f20b8(0xa9)])throw CliErrors[_0x5f20b8(0xa2)](_0x5f20b8(0xc1));const _0x26e937=await promptSelect(_0x5f20b8(0xe2),[_0x5f20b8(0xb3),_0x5f20b8(0xe4)]);_0x5333ba=[_0x5f20b8(0xb3),_0x5f20b8(0xe4)][_0x26e937]??_0x5f20b8(0xb3);}return{'alias':_0x7744f9,'datasetCode':_0xff5f1c,'datasetId':_0x27f6a1,'operationType':_0x35d78b,'functionNode':_0x5333ba};}async function promptSelect(_0x22b4bc,_0x139a94){const _0x23468a=a26_0x3c9470;if(_0x139a94['length']===0x1)return 0x0;for(const [_0x3fc370,_0x6bc60]of _0x139a94[_0x23468a(0xe5)]()){process[_0x23468a(0xea)][_0x23468a(0xec)]('\x20\x20'+(_0x3fc370+0x1)+'.\x20'+_0x6bc60+'\x0a');}const _0x1f1525=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x36bb2c=await new Promise(_0x269c26=>{const _0x19f83c=_0x23468a;_0x1f1525[_0x19f83c(0xab)](_0x22b4bc+'\x20',_0x269c26);}),_0x2c8e21=Number[_0x23468a(0xce)](_0x36bb2c[_0x23468a(0xc3)](),0xa);if(Number[_0x23468a(0xaa)](_0x2c8e21)&&_0x2c8e21>=0x1&&_0x2c8e21<=_0x139a94['length'])return _0x1f1525[_0x23468a(0xd0)](),_0x2c8e21-0x1;process[_0x23468a(0xea)]['write'](_0x23468a(0xc4)+_0x139a94['length']+'.\x0a');}}function buildFilePath(_0x5f5c38,_0x27319b,_0x272d4c,_0x4ef056){const _0x4622b3=a26_0x3c9470;if(_0x27319b===_0x4622b3(0xcf)){if(!_0x4ef056)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x28ccf1=_0x4ef056['alias']??_0x4ef056[_0x4622b3(0xba)];return join(_0x5f5c38[_0x4622b3(0xa8)],'HOOK',_0x28ccf1,_0x4ef056[_0x4622b3(0xa6)],_0x4ef056[_0x4622b3(0xaf)],_0x272d4c+_0x4622b3(0xe3));}return join(_0x5f5c38[_0x4622b3(0xa8)],_0x27319b,_0x272d4c+_0x4622b3(0xe3));}export function generateTemplate(_0x2c7da5,_0xfd5a4a,_0x4776a5,_0x583f7a,_0x454c37){const _0x28a1df=a26_0x3c9470,_0x2fb5cb=_0x583f7a?.[_0x28a1df(0xc3)]()||_0x28a1df(0xe7);if(_0x2c7da5==='COMMON')return _0x28a1df(0xb6)+_0x2fb5cb+_0x28a1df(0xc5)+_0xfd5a4a+_0x28a1df(0xe8)+_0xfd5a4a+'.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'+_0xfd5a4a+_0x28a1df(0x96);if(_0x2c7da5===_0x28a1df(0xb4))return _0x28a1df(0xb2)+_0x2fb5cb+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x4776a5+'/'+_0xfd5a4a+_0x28a1df(0xa7)+_0xfd5a4a+_0x28a1df(0x96);if(!_0x454c37)throw CliErrors[_0x28a1df(0xa2)](_0x28a1df(0xd8));return'/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x2fb5cb+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x4776a5+'/'+_0x454c37[_0x28a1df(0xba)]+'/'+_0x454c37[_0x28a1df(0xa6)]+'\x0a\x20*\x20[触发节点]\x20'+_0x454c37['functionNode']+_0x28a1df(0xd5)+_0xfd5a4a+_0x28a1df(0x96);}
@@ -1 +1 @@
1
- const a27_0x4957d9=a27_0x5d86;(function(_0x1e8aeb,_0x297216){const _0xcb4879=a27_0x5d86,_0x39e2cb=_0x1e8aeb();while(!![]){try{const _0x276531=parseInt(_0xcb4879(0x184))/0x1+parseInt(_0xcb4879(0x186))/0x2+-parseInt(_0xcb4879(0x189))/0x3*(-parseInt(_0xcb4879(0x19d))/0x4)+-parseInt(_0xcb4879(0x19a))/0x5*(-parseInt(_0xcb4879(0x1a1))/0x6)+-parseInt(_0xcb4879(0x1af))/0x7*(-parseInt(_0xcb4879(0x19c))/0x8)+-parseInt(_0xcb4879(0x181))/0x9+-parseInt(_0xcb4879(0x180))/0xa*(parseInt(_0xcb4879(0x191))/0xb);if(_0x276531===_0x297216)break;else _0x39e2cb['push'](_0x39e2cb['shift']());}catch(_0x205bdd){_0x39e2cb['push'](_0x39e2cb['shift']());}}}(a27_0x5c70,0x2ea15));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';function a27_0x5d86(_0xd9d62,_0x4b35b1){_0xd9d62=_0xd9d62-0x17a;const _0x5c705f=a27_0x5c70();let _0x5d8640=_0x5c705f[_0xd9d62];return _0x5d8640;}import{CliErrors}from'../../errors.js';export const bffDelete={'service':a27_0x4957d9(0x1a4),'command':'delete','description':a27_0x4957d9(0x17c),'risk':a27_0x4957d9(0x1ac),'flags':[{'name':a27_0x4957d9(0x1a8),'type':a27_0x4957d9(0x18e),'required':!![],'description':a27_0x4957d9(0x18d)}],async 'validate'(_0x5e2ef6){const _0x119573=a27_0x4957d9,_0x622dcb=loadBffProjectConfig(_0x5e2ef6[_0x119573(0x1aa)]),_0x2a22bc=await readBffLockFile(_0x622dcb['lockFilePath']);if(!_0x2a22bc)throw CliErrors[_0x119573(0x190)](_0x119573(0x196));},async 'dryRun'(_0x244fc6){const _0x2ff85b=a27_0x4957d9,_0x247f3a=loadBffProjectConfig(_0x244fc6[_0x2ff85b(0x1aa)]),_0x146e5a=await readBffLockFile(_0x247f3a[_0x2ff85b(0x193)]);if(!_0x146e5a)throw CliErrors[_0x2ff85b(0x190)](_0x2ff85b(0x18f));const {appLock:_0x2c5d19}=ensureLockScope(_0x146e5a,_0x244fc6['appCode'],_0x247f3a[_0x2ff85b(0x1a5)],_0x2ff85b(0x17e)),_0x22e9f0=_0x244fc6[_0x2ff85b(0x17b)](_0x2ff85b(0x1a8)),_0x3802aa=Object[_0x2ff85b(0x1ae)](_0x2c5d19[_0x2ff85b(0x199)]),_0x5582ab=resolveDeleteTarget(_0x22e9f0,_0x3802aa),_0x2c498c=_0x2c5d19[_0x2ff85b(0x199)][_0x5582ab];if(!_0x2c498c)throw CliErrors['validation'](_0x2ff85b(0x19f)+_0x5582ab+'\x22.');const _0x4e258f=resolveLocalFilePathFromLockKey(_0x247f3a,_0x5582ab),_0x86612e=relative(_0x247f3a[_0x2ff85b(0x1a3)],_0x4e258f),_0x1dace9=join(_0x247f3a[_0x2ff85b(0x1ab)],_0x2ff85b(0x183),_0x86612e);return{'method':_0x2ff85b(0x195),'url':_0x2ff85b(0x17d),'body':{'appCode':_0x244fc6[_0x2ff85b(0x1aa)],'target':_0x5582ab,'remoteId':_0x2c498c['remoteId'],'localFilePath':_0x4e258f,'trashedPath':_0x1dace9},'description':_0x2ff85b(0x17f)+_0x5582ab+_0x2ff85b(0x1a0)};},async 'execute'(_0x25675a){const _0x16f05a=a27_0x4957d9,_0x43475f=loadBffProjectConfig(_0x25675a[_0x16f05a(0x1aa)]),_0x2f43f6=await readBffLockFile(_0x43475f[_0x16f05a(0x193)]);if(!_0x2f43f6)throw CliErrors[_0x16f05a(0x190)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x24f046,appLock:_0xcf7e72}=ensureLockScope(_0x2f43f6,_0x25675a['appCode'],_0x43475f[_0x16f05a(0x1a5)],'delete'),_0x105df8=_0x25675a[_0x16f05a(0x17b)](_0x16f05a(0x1a8)),_0x5c594f=Object['keys'](_0xcf7e72['functions']),_0x36c680=resolveDeleteTarget(_0x105df8,_0x5c594f),_0x52d832=_0xcf7e72[_0x16f05a(0x199)][_0x36c680];if(!_0x52d832)throw CliErrors[_0x16f05a(0x190)](_0x16f05a(0x19f)+_0x36c680+'\x22.');await deleteBffScript(_0x52d832[_0x16f05a(0x19e)]),delete _0xcf7e72[_0x16f05a(0x199)][_0x36c680],_0xcf7e72[_0x16f05a(0x19b)]=new Date()['toISOString'](),await writeBffLockFile(_0x43475f['lockFilePath'],_0x24f046);const _0x3839c6=resolveLocalFilePathFromLockKey(_0x43475f,_0x36c680);let _0xd02de6;await fileExists(_0x3839c6)&&(_0xd02de6=await moveToTrash(_0x43475f[_0x16f05a(0x1a3)],_0x43475f[_0x16f05a(0x1ab)],_0x3839c6),await cleanupEmptyDirectories(dirname(_0x3839c6),_0x43475f[_0x16f05a(0x185)]));const _0x1a52c5={'deleted':_0x36c680,'remoteId':_0x52d832[_0x16f05a(0x19e)]};if(_0xd02de6)_0x1a52c5[_0x16f05a(0x187)]=_0xd02de6;return{'ok':!![],'data':_0x1a52c5,'message':_0x16f05a(0x18b)+_0x36c680+(_0xd02de6?_0x16f05a(0x1a7):'')};}};function a27_0x5c70(){const _0x47468c=['find','\x20(local\x20file\x20moved\x20to\x20trash)','target','join','appCode','trashDir','high-risk-write','startsWith','keys','7TItUKx','replace','str','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','/api/management/library/scripts/delete','delete','Would\x20delete\x20','2035660QXFral','3075048SaRAuZ','Function\x20not\x20found:\x20','<timestamp>','214295Mubkip','scriptsRootDir','104804JFtEPl','trashedTo','map','1713HcEoDj','Multiple\x20functions\x20match\x20\x22','Deleted\x20','filter','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','string','BFF\x20lock\x20file\x20not\x20found.','validation','11PYETXh','\x20\x20-\x20','lockFilePath','toISOString','POST','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','includes','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','functions','10KcvdDT','lastSync','427368wihBeD','2052mERbVH','remoteId','No\x20lock\x20entry\x20found\x20for\x20\x22','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','369582tfHycy','length','projectRoot','bff','scriptsRoot'];a27_0x5c70=function(){return _0x47468c;};return a27_0x5c70();}function resolveDeleteTarget(_0x2d9f01,_0x3054b4){const _0x4687fd=a27_0x4957d9;if(_0x2d9f01[_0x4687fd(0x197)]('/')){const _0x45d182=_0x3054b4[_0x4687fd(0x1a6)](_0x1d1dd2=>_0x1d1dd2===_0x2d9f01);if(!_0x45d182)throw CliErrors[_0x4687fd(0x190)](_0x4687fd(0x182)+_0x2d9f01);return _0x45d182;}const _0x57b26c=_0x3054b4[_0x4687fd(0x18c)](_0x376d25=>_0x376d25['split']('/')['at'](-0x1)===_0x2d9f01);if(_0x57b26c[_0x4687fd(0x1a2)]===0x0)throw CliErrors[_0x4687fd(0x190)](_0x4687fd(0x182)+_0x2d9f01);if(_0x57b26c[_0x4687fd(0x1a2)]>0x1)throw CliErrors[_0x4687fd(0x190)](_0x4687fd(0x18a)+_0x2d9f01+_0x4687fd(0x198)+_0x57b26c[_0x4687fd(0x188)](_0x569893=>_0x4687fd(0x192)+_0x569893)[_0x4687fd(0x1a9)]('\x0a'));return _0x57b26c[0x0];}async function moveToTrash(_0x1ac32e,_0x226958,_0x2c798f){const _0x44a0d3=a27_0x4957d9,_0x29f82e=new Date()[_0x44a0d3(0x194)]()[_0x44a0d3(0x17a)](/[:.]/g,'-'),_0x3b6476=relative(_0x1ac32e,_0x2c798f),_0x64ead8=join(_0x226958,_0x29f82e,_0x3b6476);return await mkdir(dirname(_0x64ead8),{'recursive':!![]}),await rename(_0x2c798f,_0x64ead8),_0x64ead8;}async function cleanupEmptyDirectories(_0x1ba917,_0x2a19ec){const _0xab9c32=a27_0x4957d9;let _0x19ba79=resolve(_0x1ba917);const _0x120d74=resolve(_0x2a19ec);while(_0x19ba79[_0xab9c32(0x1ad)](''+_0x120d74+sep)||_0x19ba79===_0x120d74){if(_0x19ba79===_0x120d74)return;try{const _0x591492=await readdir(_0x19ba79);if(_0x591492[_0xab9c32(0x1a2)]>0x0)return;await rmdir(_0x19ba79);}catch{return;}_0x19ba79=dirname(_0x19ba79);}}
1
+ const a27_0x401d04=a27_0x5c7d;(function(_0x11efca,_0x52ce75){const _0x56bdf1=a27_0x5c7d,_0x5c1a38=_0x11efca();while(!![]){try{const _0x1ce2c6=-parseInt(_0x56bdf1(0x1b6))/0x1+parseInt(_0x56bdf1(0x1c5))/0x2+-parseInt(_0x56bdf1(0x19b))/0x3*(parseInt(_0x56bdf1(0x19c))/0x4)+parseInt(_0x56bdf1(0x1aa))/0x5*(-parseInt(_0x56bdf1(0x1b1))/0x6)+parseInt(_0x56bdf1(0x1a5))/0x7*(parseInt(_0x56bdf1(0x197))/0x8)+-parseInt(_0x56bdf1(0x1a2))/0x9+parseInt(_0x56bdf1(0x1b7))/0xa*(parseInt(_0x56bdf1(0x19d))/0xb);if(_0x1ce2c6===_0x52ce75)break;else _0x5c1a38['push'](_0x5c1a38['shift']());}catch(_0x1262a7){_0x5c1a38['push'](_0x5c1a38['shift']());}}}(a27_0x25c1,0xed608));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';function a27_0x25c1(){const _0x30d276=['toISOString','remoteId','join','scriptsRoot','8504gyGKfb','Would\x20delete\x20','target','filter','50355PtooCs','172vIYivN','38098038tQFxZf','apps','find','/api/management/library/scripts/delete','trashedTo','611775pUpUgn','includes','length','7658XSmlmZ','startsWith','Function\x20not\x20found:\x20','\x20(local\x20file\x20moved\x20to\x20trash)','stringify','32255zJbror','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','lockFilePath','Deleted\x20','str','validation','keys','1632nhdNfA','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','\x20\x20-\x20','No\x20lock\x20entry\x20found\x20for\x20\x22','Multiple\x20functions\x20match\x20\x22','1718431pJuHNS','10pvwRiJ','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','string','projectRoot','high-risk-write','trashDir','Local\x20delete\x20not\x20settled\x20for\x20','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','appCode','functions','\x22\x20not\x20found\x20after\x20ensureLockScope.','Lock\x20scope\x20for\x20app\x20\x22','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','BFF\x20lock\x20file\x20not\x20found.','1217498IysIsO','delete'];a27_0x25c1=function(){return _0x30d276;};return a27_0x25c1();}import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':'bff','command':'delete','description':a27_0x401d04(0x1b8),'risk':a27_0x401d04(0x1bb),'flags':[{'name':a27_0x401d04(0x199),'type':a27_0x401d04(0x1b9),'required':!![],'description':a27_0x401d04(0x1c3)}],async 'validate'(_0x178b1b){const _0x29138d=a27_0x401d04,_0x31167c=loadBffProjectConfig(_0x178b1b['appCode']),_0x300bab=await readBffLockFile(_0x31167c['lockFilePath']);if(!_0x300bab)throw CliErrors[_0x29138d(0x1af)](_0x29138d(0x1be));},async 'dryRun'(_0x53fb53){const _0x55711b=a27_0x401d04,_0x5aa453=loadBffProjectConfig(_0x53fb53['appCode']),_0x578403=await readBffLockFile(_0x5aa453['lockFilePath']);if(!_0x578403)throw CliErrors[_0x55711b(0x1af)](_0x55711b(0x1c4));const {appLock:_0x5b7223}=ensureLockScope(_0x578403,_0x53fb53[_0x55711b(0x1bf)],_0x5aa453[_0x55711b(0x1ca)],_0x55711b(0x1c6)),_0x1725a4=_0x53fb53['str'](_0x55711b(0x199)),_0xe27056=Object[_0x55711b(0x1b0)](_0x5b7223[_0x55711b(0x1c0)]),_0x3f3bf6=resolveDeleteTarget(_0x1725a4,_0xe27056),_0x151f9e=_0x5b7223[_0x55711b(0x1c0)][_0x3f3bf6];if(!_0x151f9e)throw CliErrors[_0x55711b(0x1af)](_0x55711b(0x1b4)+_0x3f3bf6+'\x22.');const _0x45beac=resolveLocalFilePathFromLockKey(_0x5aa453,_0x3f3bf6),_0x27c9e5=relative(_0x5aa453['projectRoot'],_0x45beac),_0x520fb4=join(_0x5aa453[_0x55711b(0x1bc)],'<timestamp>',_0x27c9e5);return{'method':'POST','url':_0x55711b(0x1a0),'body':{'appCode':_0x53fb53[_0x55711b(0x1bf)],'target':_0x3f3bf6,'remoteId':_0x151f9e['remoteId'],'localFilePath':_0x45beac,'trashedPath':_0x520fb4},'description':_0x55711b(0x198)+_0x3f3bf6+_0x55711b(0x1b2)};},async 'execute'(_0x5d6437){const _0x3fe866=a27_0x401d04,_0x50481b=loadBffProjectConfig(_0x5d6437['appCode']),_0x454e76=await readBffLockFile(_0x50481b['lockFilePath']);if(!_0x454e76)throw CliErrors['validation'](_0x3fe866(0x1c4));const {lockData:_0x2f8e1c,appLock:_0x332ebf}=ensureLockScope(_0x454e76,_0x5d6437[_0x3fe866(0x1bf)],_0x50481b['scriptsRoot'],_0x3fe866(0x1c6)),_0x360a6e=JSON['parse'](JSON[_0x3fe866(0x1a9)](_0x2f8e1c)),_0x114f06=_0x360a6e[_0x3fe866(0x19e)][_0x5d6437[_0x3fe866(0x1bf)]];if(!_0x114f06)throw new Error(_0x3fe866(0x1c2)+_0x5d6437[_0x3fe866(0x1bf)]+_0x3fe866(0x1c1));const _0x3890fa=_0x5d6437[_0x3fe866(0x1ae)](_0x3fe866(0x199)),_0x3cfd4e=Object[_0x3fe866(0x1b0)](_0x114f06[_0x3fe866(0x1c0)]),_0x747656=resolveDeleteTarget(_0x3890fa,_0x3cfd4e),_0x41ec10=_0x114f06[_0x3fe866(0x1c0)][_0x747656];if(!_0x41ec10)throw CliErrors[_0x3fe866(0x1af)](_0x3fe866(0x1b4)+_0x747656+'\x22.');await deleteBffScript(_0x41ec10[_0x3fe866(0x1c8)]),delete _0x114f06[_0x3fe866(0x1c0)][_0x747656],_0x114f06['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x50481b[_0x3fe866(0x1ac)],_0x360a6e);const _0x4f5afa=resolveLocalFilePathFromLockKey(_0x50481b,_0x747656);let _0x3a31e4;await fileExists(_0x4f5afa)&&(_0x3a31e4=await moveToTrash(_0x50481b[_0x3fe866(0x1ba)],_0x50481b[_0x3fe866(0x1bc)],_0x4f5afa),await cleanupEmptyDirectories(dirname(_0x4f5afa),_0x50481b['scriptsRootDir']));await waitForDeleteSettlement(_0x50481b[_0x3fe866(0x1ac)],_0x5d6437['appCode'],_0x747656,_0x4f5afa),await sleep(0x96);const _0x5a3681={'deleted':_0x747656,'remoteId':_0x41ec10[_0x3fe866(0x1c8)]};if(_0x3a31e4)_0x5a3681[_0x3fe866(0x1a1)]=_0x3a31e4;return{'ok':!![],'data':_0x5a3681,'message':_0x3fe866(0x1ad)+_0x747656+(_0x3a31e4?_0x3fe866(0x1a8):'')};}};function a27_0x5c7d(_0x34b994,_0x21070d){_0x34b994=_0x34b994-0x197;const _0x25c1a0=a27_0x25c1();let _0x5c7d87=_0x25c1a0[_0x34b994];return _0x5c7d87;}function resolveDeleteTarget(_0xf14ce0,_0x1044f7){const _0x139d9e=a27_0x401d04;if(_0xf14ce0[_0x139d9e(0x1a3)]('/')){const _0x21118a=_0x1044f7[_0x139d9e(0x19f)](_0x1e4073=>_0x1e4073===_0xf14ce0);if(!_0x21118a)throw CliErrors[_0x139d9e(0x1af)](_0x139d9e(0x1a7)+_0xf14ce0);return _0x21118a;}const _0x18a7b=_0x1044f7[_0x139d9e(0x19a)](_0x40dc35=>_0x40dc35['split']('/')['at'](-0x1)===_0xf14ce0);if(_0x18a7b[_0x139d9e(0x1a4)]===0x0)throw CliErrors[_0x139d9e(0x1af)](_0x139d9e(0x1a7)+_0xf14ce0);if(_0x18a7b[_0x139d9e(0x1a4)]>0x1)throw CliErrors[_0x139d9e(0x1af)](_0x139d9e(0x1b5)+_0xf14ce0+_0x139d9e(0x1ab)+_0x18a7b['map'](_0x307a56=>_0x139d9e(0x1b3)+_0x307a56)[_0x139d9e(0x1c9)]('\x0a'));return _0x18a7b[0x0];}async function moveToTrash(_0x5f4b53,_0x4080a7,_0x222625){const _0x1d523f=a27_0x401d04,_0x1a92da=new Date()[_0x1d523f(0x1c7)]()['replace'](/[:.]/g,'-'),_0x137491=relative(_0x5f4b53,_0x222625),_0x7d9384=join(_0x4080a7,_0x1a92da,_0x137491);return await mkdir(dirname(_0x7d9384),{'recursive':!![]}),await rename(_0x222625,_0x7d9384),_0x7d9384;}async function cleanupEmptyDirectories(_0x3d017b,_0x3914ef){const _0x1c4d34=a27_0x401d04;let _0x4390e8=resolve(_0x3d017b);const _0x5ebe3e=resolve(_0x3914ef);while(_0x4390e8[_0x1c4d34(0x1a6)](''+_0x5ebe3e+sep)||_0x4390e8===_0x5ebe3e){if(_0x4390e8===_0x5ebe3e)return;try{const _0x5471d3=await readdir(_0x4390e8);if(_0x5471d3[_0x1c4d34(0x1a4)]>0x0)return;await rmdir(_0x4390e8);}catch{return;}_0x4390e8=dirname(_0x4390e8);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0xa6474f,_0x39ebb0,_0x15d55b,_0x1a2f57){const _0x13058e=a27_0x401d04;for(let _0x39b8d0=0x0;_0x39b8d0<DELETE_SETTLE_RETRY_COUNT;_0x39b8d0+=0x1){const _0x7da731=await readBffLockFile(_0xa6474f),_0x874a24=!!_0x7da731?.[_0x13058e(0x19e)]?.[_0x39ebb0]?.[_0x13058e(0x1c0)]?.[_0x15d55b],_0x3693f2=await fileExists(_0x1a2f57);if(!_0x874a24&&!_0x3693f2)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x13058e(0x1bd)+_0x15d55b+'.');}
@@ -1 +1 @@
1
- const a28_0x2aff89=a28_0x22c8;function a28_0x22c8(_0x1a0fbf,_0x3f240b){_0x1a0fbf=_0x1a0fbf-0xad;const _0x197bda=a28_0x197b();let _0x22c88b=_0x197bda[_0x1a0fbf];return _0x22c88b;}function a28_0x197b(){const _0x434e59=['verbose','num','11BPiQRz','updatedTime','969080fQumop','691065ypTQHt','number','Get\x20BFF\x20script\x20details\x20by\x20ID','1tIgWQd','30EWrJZp','1316604OusoUZ','55TgwxcN','detail','603426QpqxtK','176622ZSZUBw','appCode','843192iXDvsz','(none)','Script\x20ID','scriptType','12clfxUx','Return\x20full\x20raw\x20script\x20object','157124JQuAFC','read','description'];a28_0x197b=function(){return _0x434e59;};return a28_0x197b();}(function(_0x147d47,_0x498ed9){const _0x54716d=a28_0x22c8,_0x3092e6=_0x147d47();while(!![]){try{const _0x1950ce=-parseInt(_0x54716d(0xbe))/0x1*(-parseInt(_0x54716d(0xc3))/0x2)+-parseInt(_0x54716d(0xb1))/0x3*(-parseInt(_0x54716d(0xb3))/0x4)+parseInt(_0x54716d(0xc1))/0x5*(parseInt(_0x54716d(0xc4))/0x6)+-parseInt(_0x54716d(0xad))/0x7+-parseInt(_0x54716d(0xba))/0x8+-parseInt(_0x54716d(0xbb))/0x9*(parseInt(_0x54716d(0xbf))/0xa)+parseInt(_0x54716d(0xb8))/0xb*(-parseInt(_0x54716d(0xc0))/0xc);if(_0x1950ce===_0x498ed9)break;else _0x3092e6['push'](_0x3092e6['shift']());}catch(_0x130b78){_0x3092e6['push'](_0x3092e6['shift']());}}}(a28_0x197b,0x31115));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a28_0x2aff89(0xc2),'description':a28_0x2aff89(0xbd),'risk':a28_0x2aff89(0xb4),'flags':[{'name':'id','type':a28_0x2aff89(0xbc),'required':!![],'description':a28_0x2aff89(0xaf)},{'name':a28_0x2aff89(0xb6),'type':'boolean','description':a28_0x2aff89(0xb2)}],async 'execute'(_0x10c1b0){const _0x4e011b=a28_0x2aff89,_0x9be52c=await getBffScriptInfo(_0x10c1b0[_0x4e011b(0xb7)]('id')),_0xb99f06=_0x10c1b0['bool'](_0x4e011b(0xb6));if(_0xb99f06)return{'ok':!![],'data':_0x9be52c};return{'ok':!![],'data':{'id':_0x9be52c['id'],'appCode':_0x9be52c[_0x4e011b(0xc5)],'scriptType':_0x9be52c[_0x4e011b(0xb0)],'description':_0x9be52c[_0x4e011b(0xb5)]||_0x4e011b(0xae),'createdTime':_0x9be52c['createdTime']??'','updatedTime':_0x9be52c[_0x4e011b(0xb9)]??'','scriptContent':_0x9be52c['scriptContent']??''}};}};
1
+ const a28_0x66e0a0=a28_0x40c2;function a28_0x40c2(_0x53cac4,_0x3d7e43){_0x53cac4=_0x53cac4-0x1d4;const _0x5ec0e8=a28_0x5ec0();let _0x40c2b7=_0x5ec0e8[_0x53cac4];return _0x40c2b7;}(function(_0x181a23,_0x54c567){const _0xccd28d=a28_0x40c2,_0x3f61b0=_0x181a23();while(!![]){try{const _0x4a91b9=parseInt(_0xccd28d(0x1dd))/0x1+-parseInt(_0xccd28d(0x1e0))/0x2+parseInt(_0xccd28d(0x1e6))/0x3+parseInt(_0xccd28d(0x1e5))/0x4*(parseInt(_0xccd28d(0x1d4))/0x5)+parseInt(_0xccd28d(0x1da))/0x6+parseInt(_0xccd28d(0x1e2))/0x7+-parseInt(_0xccd28d(0x1e3))/0x8;if(_0x4a91b9===_0x54c567)break;else _0x3f61b0['push'](_0x3f61b0['shift']());}catch(_0x39a3ae){_0x3f61b0['push'](_0x3f61b0['shift']());}}}(a28_0x5ec0,0x49067));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a28_0x66e0a0(0x1e4),'command':a28_0x66e0a0(0x1d6),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':'read','flags':[{'name':'id','type':'number','required':!![],'description':a28_0x66e0a0(0x1db)},{'name':a28_0x66e0a0(0x1e1),'type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x13d9f4){const _0x748ed3=a28_0x66e0a0,_0x5daa9f=await getBffScriptInfo(_0x13d9f4[_0x748ed3(0x1d7)]('id')),_0x4cc902=_0x13d9f4[_0x748ed3(0x1d8)]('verbose');if(_0x4cc902)return{'ok':!![],'data':_0x5daa9f};return{'ok':!![],'data':{'id':_0x5daa9f['id'],'appCode':_0x5daa9f[_0x748ed3(0x1d9)],'scriptType':_0x5daa9f[_0x748ed3(0x1dc)],'description':_0x5daa9f[_0x748ed3(0x1d5)]||'(none)','createdTime':_0x5daa9f[_0x748ed3(0x1de)]??'','updatedTime':_0x5daa9f['updatedTime']??'','scriptContent':_0x5daa9f[_0x748ed3(0x1df)]??''}};}};function a28_0x5ec0(){const _0x56da69=['verbose','866425kTrKEg','6714016QKFROg','bff','976TLfsKB','1242153WXVMin','7550IwcqbV','description','detail','num','bool','appCode','1596444BhBAXc','Script\x20ID','scriptType','167853ZhyQsn','createdTime','scriptContent','403660uHCbXz'];a28_0x5ec0=function(){return _0x56da69;};return a28_0x5ec0();}
@@ -1 +1 @@
1
- (function(_0x4c430a,_0x4a25a4){const _0x5e34a8=a29_0x11a6,_0x378d17=_0x4c430a();while(!![]){try{const _0x4d48f5=parseInt(_0x5e34a8(0xd5))/0x1+-parseInt(_0x5e34a8(0xd6))/0x2+parseInt(_0x5e34a8(0xd1))/0x3+parseInt(_0x5e34a8(0xd4))/0x4*(parseInt(_0x5e34a8(0xd7))/0x5)+parseInt(_0x5e34a8(0xd0))/0x6+parseInt(_0x5e34a8(0xd3))/0x7+-parseInt(_0x5e34a8(0xd2))/0x8;if(_0x4d48f5===_0x4a25a4)break;else _0x378d17['push'](_0x378d17['shift']());}catch(_0x5e84cf){_0x378d17['push'](_0x378d17['shift']());}}}(a29_0x2927,0x5f22e));function a29_0x2927(){const _0x2243a6=['1009602pZRWxb','1000285jzLjvC','2822670inAhvn','749136JbEsXX','6709592lMidMu','595721MtsAnZ','8IReRje','527804lKHZzd'];a29_0x2927=function(){return _0x2243a6;};return a29_0x2927();}import{bffList}from'../../commands/bff/list.js';function a29_0x11a6(_0x375f95,_0x49bdb4){_0x375f95=_0x375f95-0xd0;const _0x29271a=a29_0x2927();let _0x11a6f7=_0x29271a[_0x375f95];return _0x11a6f7;}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.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,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x5ed13f,_0x332e60){const _0x35444c=a29_0x3404,_0x26cf34=_0x5ed13f();while(!![]){try{const _0x1ff937=-parseInt(_0x35444c(0xe4))/0x1*(-parseInt(_0x35444c(0xe8))/0x2)+-parseInt(_0x35444c(0xee))/0x3*(parseInt(_0x35444c(0xe6))/0x4)+-parseInt(_0x35444c(0xe7))/0x5*(-parseInt(_0x35444c(0xed))/0x6)+parseInt(_0x35444c(0xe5))/0x7*(parseInt(_0x35444c(0xec))/0x8)+parseInt(_0x35444c(0xeb))/0x9*(-parseInt(_0x35444c(0xe3))/0xa)+parseInt(_0x35444c(0xe9))/0xb*(-parseInt(_0x35444c(0xe1))/0xc)+parseInt(_0x35444c(0xe2))/0xd*(parseInt(_0x35444c(0xea))/0xe);if(_0x1ff937===_0x332e60)break;else _0x26cf34['push'](_0x26cf34['shift']());}catch(_0x41f8ea){_0x26cf34['push'](_0x26cf34['shift']());}}}(a29_0xb281,0x7b64a));function a29_0xb281(){const _0x2a934b=['377Gnniqa','25160tFuzUp','9616UdwsWD','50393kNQflb','43744EAJazW','425dNcLfF','208UIZrzT','47267eXNlCC','144214cIatNA','1989aDXAsv','632vEFpBn','21546qTRUqq','108GLPGmM','2004CHbdpl'];a29_0xb281=function(){return _0x2a934b;};return a29_0xb281();}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a29_0x3404(_0x4314a3,_0x2dba65){_0x4314a3=_0x4314a3-0xe1;const _0xb2816=a29_0xb281();let _0x3404e=_0xb2816[_0x4314a3];return _0x3404e;}import{bffCreate}from'../../commands/bff/create.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,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a30_0xaf79fb=a30_0x1a03;(function(_0x313387,_0x3981f8){const _0x27a86f=a30_0x1a03,_0x45b71a=_0x313387();while(!![]){try{const _0x2982b8=parseInt(_0x27a86f(0x8e))/0x1+-parseInt(_0x27a86f(0x93))/0x2+-parseInt(_0x27a86f(0x98))/0x3+parseInt(_0x27a86f(0x97))/0x4*(parseInt(_0x27a86f(0x96))/0x5)+-parseInt(_0x27a86f(0x9f))/0x6+parseInt(_0x27a86f(0xa2))/0x7*(parseInt(_0x27a86f(0x9c))/0x8)+-parseInt(_0x27a86f(0xa6))/0x9;if(_0x2982b8===_0x3981f8)break;else _0x45b71a['push'](_0x45b71a['shift']());}catch(_0x5da71f){_0x45b71a['push'](_0x45b71a['shift']());}}}(a30_0x5902,0x694a1));function a30_0x5902(){const _0x366647=['str','map','8OMjarx','name','type','805884egJlrn','Return\x20full\x20script\x20objects','boolean','2943416VGLiDM','bool','read','verbose','1010754xmcbxE','ENDPOINT','Script\x20type\x20filter','description','No\x20BFF\x20scripts\x20found.','string','bff','19692GFfRRb','list','functionName','COMMON','(unnamed)','589320eCzKTS','List\x20BFF\x20scripts','length','85fBSYAL','191944IPXhDk','850191rHdhOS','appCode'];a30_0x5902=function(){return _0x366647;};return a30_0x5902();}import{listBffScripts}from'../../core/api-client.js';function a30_0x1a03(_0x5b291d,_0x16366c){_0x5b291d=_0x5b291d-0x8e;const _0x5902a9=a30_0x5902();let _0x1a030e=_0x5902a9[_0x5b291d];return _0x1a030e;}export const bffList={'service':a30_0xaf79fb(0xac),'command':a30_0xaf79fb(0x8f),'description':a30_0xaf79fb(0x94),'risk':a30_0xaf79fb(0xa4),'flags':[{'name':'type','type':a30_0xaf79fb(0xab),'description':a30_0xaf79fb(0xa8),'default':a30_0xaf79fb(0xa7),'enum':[a30_0xaf79fb(0xa7),a30_0xaf79fb(0x91)]},{'name':a30_0xaf79fb(0x9d),'type':a30_0xaf79fb(0xab),'description':'Filter\x20by\x20script\x20name'},{'name':a30_0xaf79fb(0xa5),'type':a30_0xaf79fb(0xa1),'description':a30_0xaf79fb(0xa0)}],async 'execute'(_0x346596){const _0x160c79=a30_0xaf79fb,_0x1e565a=await listBffScripts(_0x346596[_0x160c79(0x99)],_0x346596[_0x160c79(0x9a)](_0x160c79(0x9e)),{'scriptName':_0x346596[_0x160c79(0x9a)]('name')||undefined}),_0xac950b=_0x346596[_0x160c79(0xa3)](_0x160c79(0xa5));return{'ok':!![],'data':_0xac950b?_0x1e565a:_0x1e565a[_0x160c79(0x9b)](_0x23d029=>({'id':_0x23d029['id'],'functionName':_0x23d029[_0x160c79(0x90)]??'','description':_0x23d029[_0x160c79(0xa9)]||_0x160c79(0x92),'scriptType':_0x23d029['scriptType']})),'message':_0x1e565a[_0x160c79(0x95)]===0x0?_0x160c79(0xaa):undefined};}};
1
+ const a30_0x5576f2=a30_0x4252;function a30_0x4252(_0x2ed033,_0x268fc1){_0x2ed033=_0x2ed033-0x139;const _0x317916=a30_0x3179();let _0x42522d=_0x317916[_0x2ed033];return _0x42522d;}(function(_0x16872a,_0x2690c0){const _0x134a8e=a30_0x4252,_0xc7a71a=_0x16872a();while(!![]){try{const _0x1e6c96=-parseInt(_0x134a8e(0x13a))/0x1+-parseInt(_0x134a8e(0x145))/0x2+-parseInt(_0x134a8e(0x142))/0x3+parseInt(_0x134a8e(0x14f))/0x4+-parseInt(_0x134a8e(0x141))/0x5+-parseInt(_0x134a8e(0x151))/0x6*(-parseInt(_0x134a8e(0x139))/0x7)+parseInt(_0x134a8e(0x143))/0x8;if(_0x1e6c96===_0x2690c0)break;else _0xc7a71a['push'](_0xc7a71a['shift']());}catch(_0x1df235){_0xc7a71a['push'](_0xc7a71a['shift']());}}}(a30_0x3179,0xaecb7));import{listBffScripts}from'../../core/api-client.js';function a30_0x3179(){const _0xc3977=['(unnamed)','string','51317mLuBsa','1378301iKLEoy','COMMON','list','Return\x20full\x20script\x20objects','verbose','type','Filter\x20by\x20script\x20name','1181020WLXRJM','2628933wxyyAW','23490640rLWCbC','name','2777504IvOSxf','str','boolean','bff','bool','List\x20BFF\x20scripts','scriptType','ENDPOINT','read','Script\x20type\x20filter','1270496ZqasHW','length','1098PKAiJW','description'];a30_0x3179=function(){return _0xc3977;};return a30_0x3179();}export const bffList={'service':a30_0x5576f2(0x148),'command':a30_0x5576f2(0x13c),'description':a30_0x5576f2(0x14a),'risk':a30_0x5576f2(0x14d),'flags':[{'name':'type','type':a30_0x5576f2(0x154),'description':a30_0x5576f2(0x14e),'default':a30_0x5576f2(0x14c),'enum':['ENDPOINT',a30_0x5576f2(0x13b)]},{'name':a30_0x5576f2(0x144),'type':'string','description':a30_0x5576f2(0x140)},{'name':a30_0x5576f2(0x13e),'type':a30_0x5576f2(0x147),'description':a30_0x5576f2(0x13d)}],async 'execute'(_0xec95b5){const _0x49bdc6=a30_0x5576f2,_0x1a4b69=await listBffScripts(_0xec95b5['appCode'],_0xec95b5[_0x49bdc6(0x146)](_0x49bdc6(0x13f)),{'scriptName':_0xec95b5[_0x49bdc6(0x146)](_0x49bdc6(0x144))||undefined}),_0x46f756=_0xec95b5[_0x49bdc6(0x149)](_0x49bdc6(0x13e));return{'ok':!![],'data':_0x46f756?_0x1a4b69:_0x1a4b69['map'](_0x30ed71=>({'id':_0x30ed71['id'],'functionName':_0x30ed71['functionName']??'','description':_0x30ed71[_0x49bdc6(0x152)]||_0x49bdc6(0x153),'scriptType':_0x30ed71[_0x49bdc6(0x14b)]})),'message':_0x1a4b69[_0x49bdc6(0x150)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
@@ -1 +1 @@
1
- const a31_0x37e81b=a31_0x525a;(function(_0x197096,_0x30efc7){const _0x4afe7c=a31_0x525a,_0x3b082b=_0x197096();while(!![]){try{const _0x1cd067=parseInt(_0x4afe7c(0xba))/0x1+parseInt(_0x4afe7c(0xa1))/0x2*(parseInt(_0x4afe7c(0xa6))/0x3)+-parseInt(_0x4afe7c(0xb2))/0x4+parseInt(_0x4afe7c(0xa0))/0x5+-parseInt(_0x4afe7c(0x9a))/0x6*(parseInt(_0x4afe7c(0xb3))/0x7)+parseInt(_0x4afe7c(0xc4))/0x8+-parseInt(_0x4afe7c(0x92))/0x9*(parseInt(_0x4afe7c(0xa4))/0xa);if(_0x1cd067===_0x30efc7)break;else _0x3b082b['push'](_0x3b082b['shift']());}catch(_0x28d494){_0x3b082b['push'](_0x3b082b['shift']());}}}(a31_0x576e,0x3803d));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_0x525a(_0xbfde82,_0x1de8a0){_0xbfde82=_0xbfde82-0x88;const _0x576e24=a31_0x576e();let _0x525a6c=_0x576e24[_0xbfde82];return _0x525a6c;}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':a31_0x37e81b(0xac),'command':a31_0x37e81b(0xc2),'description':a31_0x37e81b(0x91),'risk':'write','flags':[{'name':a31_0x37e81b(0x98),'type':a31_0x37e81b(0x93),'description':a31_0x37e81b(0xd2),'enum':[a31_0x37e81b(0xc8),'ENDPOINT','HOOK']},{'name':a31_0x37e81b(0xc7),'type':a31_0x37e81b(0x9e),'description':a31_0x37e81b(0xad)}],async 'dryRun'(_0x40604d){const _0x1e1362=a31_0x37e81b,_0x11698d=loadBffProjectConfig(_0x40604d[_0x1e1362(0xc0)]),_0x14fc8c=await readBffLockFile(_0x11698d[_0x1e1362(0xa8)]),{appLock:_0x31f854}=ensureLockScope(_0x14fc8c??createEmptyBffLock(),_0x40604d[_0x1e1362(0xc0)],_0x11698d['scriptsRoot'],'pull'),_0x592772=normalizeBffType(_0x40604d[_0x1e1362(0xbf)]('type'))??undefined,_0x13aab6=buildDatasetCodeToAliasMap(_0x40604d[_0x1e1362(0xb5)],_0x40604d[_0x1e1362(0xc0)]),[_0x3bcb4e,_0x105951]=await Promise[_0x1e1362(0xbd)]([listBffScripts(_0x40604d['appCode'],_0x592772),getBffScriptStatistics(_0x40604d[_0x1e1362(0xc0)])]),_0xe6c01d=createHookLocationMap(_0x105951),_0x274e5d=[];for(const _0x7deb13 of _0x3bcb4e){const _0x821a5e=resolveRemoteScriptTarget(_0x11698d,_0x7deb13,_0xe6c01d,_0x31f854[_0x1e1362(0xc5)],_0x13aab6);if(!_0x821a5e){_0x274e5d[_0x1e1362(0xb9)]({'scriptType':_0x7deb13['scriptType'],'functionName':_0x7deb13['functionName']??'','status':_0x1e1362(0x88),'reason':_0x1e1362(0xb4)});continue;}const _0x18e476=_0x31f854[_0x1e1362(0xc5)][_0x821a5e[_0x1e1362(0x89)]],_0x48e3a7=_0x7deb13['scriptContent']!=null?computeContentHash(_0x7deb13[_0x1e1362(0xcd)]):undefined,_0x3a9200=await hasUnsyncedLocalChanges(_0x821a5e[_0x1e1362(0xab)],_0x18e476,_0x48e3a7);_0x274e5d[_0x1e1362(0xb9)]({'lockKey':_0x821a5e['lockKey'],'filePath':_0x821a5e['filePath'],'remoteId':_0x7deb13['id']??null,'status':_0x3a9200?_0x1e1362(0x8c):_0x1e1362(0xcb)});}return{'method':_0x1e1362(0xbc),'url':_0x1e1362(0xd0)+_0x40604d['appCode']+(_0x592772?_0x1e1362(0x8e)+_0x592772:''),'body':{'appCode':_0x40604d[_0x1e1362(0xc0)],'filterType':_0x592772??null,'files':_0x274e5d},'description':'Would\x20inspect\x20'+_0x274e5d[_0x1e1362(0x9f)]+_0x1e1362(0xb7)};},async 'execute'(_0x89e3c4){const _0x5cc8ee=a31_0x37e81b,_0x350faa=loadBffProjectConfig(_0x89e3c4['appCode']),_0x1056b9=await readBffLockFile(_0x350faa[_0x5cc8ee(0xa8)]),{lockData:_0x1611cf,appLock:_0xccf9b7}=ensureLockScope(_0x1056b9??createEmptyBffLock(),_0x89e3c4[_0x5cc8ee(0xc0)],_0x350faa[_0x5cc8ee(0x94)],'pull'),_0x17eeab=normalizeBffType(_0x89e3c4[_0x5cc8ee(0xbf)](_0x5cc8ee(0x98)))??undefined;if(_0x89e3c4['str'](_0x5cc8ee(0x98))&&!_0x17eeab)throw CliErrors['validation'](_0x5cc8ee(0xc9));const [_0x2659ad,_0x2871ec]=await Promise['all']([listBffScripts(_0x89e3c4[_0x5cc8ee(0xc0)],_0x17eeab),getBffScriptStatistics(_0x89e3c4[_0x5cc8ee(0xc0)])]);if(_0x2659ad[_0x5cc8ee(0x9f)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x5cc8ee(0x99)};const _0x2c3d0e=_0x89e3c4[_0x5cc8ee(0x95)](_0x5cc8ee(0xc7));if(_0x2c3d0e&&!_0x89e3c4[_0x5cc8ee(0xcf)]){const _0x27c542=await confirmForce();if(!_0x27c542)throw CliErrors['cancelled'](_0x5cc8ee(0xae));}if(_0x2c3d0e&&_0x89e3c4[_0x5cc8ee(0xcf)]){}const _0x3d6881=buildDatasetCodeToAliasMap(_0x89e3c4[_0x5cc8ee(0xb5)],_0x89e3c4[_0x5cc8ee(0xc0)]),_0x4a7bc8=createHookLocationMap(_0x2871ec),_0x2f45b9=JSON[_0x5cc8ee(0x8d)](JSON[_0x5cc8ee(0x8f)](_0x1611cf)),_0xe10a80=_0x89e3c4[_0x5cc8ee(0xc0)],_0x1834f7=_0x2f45b9[_0x5cc8ee(0x8a)][_0xe10a80];if(!_0x1834f7)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0xe10a80+_0x5cc8ee(0xc1));const _0x422680=[],_0x5caf40=[],_0x27206a=[];for(const _0x1e8ca3 of _0x2659ad){const _0x58a013=resolveRemoteScriptTarget(_0x350faa,_0x1e8ca3,_0x4a7bc8,_0xccf9b7['functions'],_0x3d6881);if(!_0x58a013){_0x5caf40[_0x5cc8ee(0xb9)]({'lockKey':_0x1e8ca3[_0x5cc8ee(0x9c)]+'/'+_0x1e8ca3[_0x5cc8ee(0xb1)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x2abfd8=_0xccf9b7[_0x5cc8ee(0xc5)][_0x58a013['lockKey']];try{if(!_0x1e8ca3['id'])throw new Error(_0x5cc8ee(0xce));if(_0x1e8ca3[_0x5cc8ee(0xcd)]==null)throw new Error(_0x5cc8ee(0xcc));const _0x270041=_0x1e8ca3[_0x5cc8ee(0xcd)],_0x12657a=computeContentHash(_0x270041);if(!_0x2c3d0e){const _0x592e46=await hasUnsyncedLocalChanges(_0x58a013[_0x5cc8ee(0xab)],_0x2abfd8,_0x12657a);if(_0x592e46){_0x5caf40[_0x5cc8ee(0xb9)]({'lockKey':_0x58a013[_0x5cc8ee(0x89)],'reason':_0x5cc8ee(0xa3)});continue;}}await ensureParentDirectory(_0x58a013['filePath']),await writeFile(_0x58a013[_0x5cc8ee(0xab)],_0x270041,_0x5cc8ee(0xa5));const _0x1b4871={'hash':_0x12657a,'remoteId':_0x1e8ca3['id'],'version':_0x1e8ca3[_0x5cc8ee(0xca)]};_0x58a013[_0x5cc8ee(0x98)]===_0x5cc8ee(0x97)&&_0x58a013['hookLocation']&&(_0x1b4871['alias']=_0x58a013['hookLocation'][_0x5cc8ee(0x90)],_0x1b4871[_0x5cc8ee(0xd3)]=_0x58a013[_0x5cc8ee(0xb8)][_0x5cc8ee(0xd3)],_0x1b4871['operationType']=_0x58a013[_0x5cc8ee(0xb8)][_0x5cc8ee(0xc3)],_0x1b4871[_0x5cc8ee(0xa9)]=_0x58a013['hookLocation'][_0x5cc8ee(0xa9)]),_0x1834f7['functions'][_0x58a013[_0x5cc8ee(0x89)]]=_0x1b4871,_0x422680[_0x5cc8ee(0xb9)]({'lockKey':_0x58a013[_0x5cc8ee(0x89)],'remoteId':_0x1e8ca3['id']});}catch(_0x5a9a8d){_0x27206a[_0x5cc8ee(0xb9)]({'lockKey':_0x58a013[_0x5cc8ee(0x89)],'error':_0x5a9a8d instanceof Error?_0x5a9a8d[_0x5cc8ee(0x96)]:String(_0x5a9a8d)});}}return _0x1834f7[_0x5cc8ee(0xc6)]=new Date()['toISOString'](),await writeBffLockFile(_0x350faa['lockFilePath'],_0x2f45b9),{'ok':_0x27206a[_0x5cc8ee(0x9f)]===0x0,'data':{'pulled':_0x422680,'skipped':_0x5caf40,'failed':_0x27206a},'message':_0x5cc8ee(0xbb)+_0x422680['length']+_0x5cc8ee(0xbe)+_0x5caf40[_0x5cc8ee(0x9f)]+_0x5cc8ee(0xb6)+_0x27206a[_0x5cc8ee(0x9f)]+_0x5cc8ee(0x9b)};}};async function hasUnsyncedLocalChanges(_0x2876f7,_0x17e828,_0xf652e3){const _0x1660e0=a31_0x37e81b;if(!await fileExists(_0x2876f7))return![];const _0x1f9466=await computeFileHash(_0x2876f7);if(!_0x17e828)return _0xf652e3?_0x1f9466!==_0xf652e3:!![];return _0x1f9466!==_0x17e828[_0x1660e0(0xaa)];}function buildDatasetCodeToAliasMap(_0x516d4b,_0x3a7a58){const _0x9ad70a=a31_0x37e81b,_0x2c0f62=loadAliasMap(_0x516d4b,undefined,resolveApiFilePath(_0x516d4b,_0x3a7a58));return new Map(_0x2c0f62[_0x9ad70a(0xaf)](_0x3bb428=>[_0x3bb428['datasetCode'],_0x3bb428[_0x9ad70a(0x90)]]));}function a31_0x576e(){const _0x2ec42d=['7fRiUlR','unresolvable\x20target\x20path','apiDir','\x20skipped,\x20','\x20remote\x20BFF\x20script(s)\x20for\x20pull','hookLocation','push','380057xtsnps','Pull\x20complete:\x20','GET','all','\x20pulled,\x20','str','appCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','pull','operationType','3547840hmEBGT','functions','lastSync','force','COMMON','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','version','would_pull','Remote\x20script\x20missing\x20content.','scriptContent','Remote\x20script\x20missing\x20id.','nonInteractive','/api/management/library/scripts/list?appCode=','stderr','Pull\x20only\x20this\x20script\x20type','datasetCode','skipped','lockKey','apps','toLowerCase','conflict','parse','&type=','stringify','alias','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','45BnVqqm','string','scriptsRoot','bool','message','HOOK','type','No\x20remote\x20BFF\x20scripts\x20found.','913782gPMvMT','\x20failed','scriptType','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','boolean','length','680650sMaXDg','6jsXJmH','trim','local\x20unsynced\x20changes','691970kqZObO','utf8','50835wNTDwm','close','lockFilePath','functionNode','hash','filePath','bff','Force\x20overwrite\x20local\x20unsynced\x20changes','Force\x20pull\x20cancelled.','map','includes','functionName','1131132ZEybgq'];a31_0x576e=function(){return _0x2ec42d;};return a31_0x576e();}async function confirmForce(){const _0x42f3cb=a31_0x37e81b,_0x1553d7=createInterface({'input':process['stdin'],'output':process[_0x42f3cb(0xd1)]}),_0x46d09e=await new Promise(_0x33a75a=>{const _0x1064f8=_0x42f3cb;_0x1553d7['question'](_0x1064f8(0x9d),_0x33a75a);});return _0x1553d7[_0x42f3cb(0xa7)](),['y','yes'][_0x42f3cb(0xb0)](_0x46d09e[_0x42f3cb(0xa2)]()[_0x42f3cb(0x8b)]());}
1
+ const a31_0x600960=a31_0x145b;(function(_0x4ad62f,_0x4eaf65){const _0x319c8f=a31_0x145b,_0x261583=_0x4ad62f();while(!![]){try{const _0x46d1ee=-parseInt(_0x319c8f(0xf8))/0x1+parseInt(_0x319c8f(0xed))/0x2*(-parseInt(_0x319c8f(0xe7))/0x3)+-parseInt(_0x319c8f(0x129))/0x4+-parseInt(_0x319c8f(0xff))/0x5*(-parseInt(_0x319c8f(0x103))/0x6)+-parseInt(_0x319c8f(0xfd))/0x7*(parseInt(_0x319c8f(0x111))/0x8)+-parseInt(_0x319c8f(0xef))/0x9+-parseInt(_0x319c8f(0x110))/0xa*(-parseInt(_0x319c8f(0xe9))/0xb);if(_0x46d1ee===_0x4eaf65)break;else _0x261583['push'](_0x261583['shift']());}catch(_0x197ed2){_0x261583['push'](_0x261583['shift']());}}}(a31_0x40ba,0x1f843));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a31_0x145b(_0x31ad43,_0x1d17ac){_0x31ad43=_0x31ad43-0xe0;const _0x40ba66=a31_0x40ba();let _0x145b29=_0x40ba66[_0x31ad43];return _0x145b29;}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':a31_0x600960(0xf4),'command':'pull','description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a31_0x600960(0xec),'flags':[{'name':a31_0x600960(0x108),'type':a31_0x600960(0x117),'description':a31_0x600960(0x10b),'enum':[a31_0x600960(0x10d),a31_0x600960(0x100),a31_0x600960(0x125)]},{'name':a31_0x600960(0x11f),'type':a31_0x600960(0xf2),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4dd944){const _0x527693=a31_0x600960,_0x5a33b3=loadBffProjectConfig(_0x4dd944[_0x527693(0xeb)]),_0x3e4632=await readBffLockFile(_0x5a33b3['lockFilePath']),{appLock:_0x1aba0b}=ensureLockScope(_0x3e4632??createEmptyBffLock(),_0x4dd944[_0x527693(0xeb)],_0x5a33b3[_0x527693(0xe4)],_0x527693(0xf9)),_0x2c7c0c=normalizeBffType(_0x4dd944[_0x527693(0xf3)](_0x527693(0x108)))??undefined,_0x3ae91b=buildDatasetCodeToAliasMap(_0x4dd944[_0x527693(0xe3)],_0x4dd944['appCode']),[_0x5dab21,_0x550c3b]=await Promise[_0x527693(0x10f)]([listBffScripts(_0x4dd944['appCode'],_0x2c7c0c),getBffScriptStatistics(_0x4dd944[_0x527693(0xeb)])]),_0x4d979e=createHookLocationMap(_0x550c3b),_0x17330f=[];for(const _0x317011 of _0x5dab21){const _0xb0093f=resolveRemoteScriptTarget(_0x5a33b3,_0x317011,_0x4d979e,_0x1aba0b[_0x527693(0x126)],_0x3ae91b);if(!_0xb0093f){_0x17330f[_0x527693(0xf0)]({'scriptType':_0x317011[_0x527693(0xe2)],'functionName':_0x317011['functionName']??'','status':_0x527693(0x122),'reason':_0x527693(0x102)});continue;}const _0x1c364a=_0x1aba0b['functions'][_0xb0093f['lockKey']],_0x405d62=_0x317011[_0x527693(0xe6)]!=null?computeContentHash(_0x317011['scriptContent']):undefined,_0x5161aa=await hasUnsyncedLocalChanges(_0xb0093f[_0x527693(0x112)],_0x1c364a,_0x405d62);_0x17330f['push']({'lockKey':_0xb0093f[_0x527693(0x121)],'filePath':_0xb0093f[_0x527693(0x112)],'remoteId':_0x317011['id']??null,'status':_0x5161aa?_0x527693(0x109):_0x527693(0x11d)});}return{'method':_0x527693(0xe0),'url':'/api/management/library/scripts/list?appCode='+_0x4dd944['appCode']+(_0x2c7c0c?_0x527693(0x114)+_0x2c7c0c:''),'body':{'appCode':_0x4dd944['appCode'],'filterType':_0x2c7c0c??null,'files':_0x17330f},'description':_0x527693(0x106)+_0x17330f[_0x527693(0x115)]+_0x527693(0x10c)};},async 'execute'(_0x35895e){const _0x4281cb=a31_0x600960,_0x29e0a8=loadBffProjectConfig(_0x35895e[_0x4281cb(0xeb)]),_0xf04895=await readBffLockFile(_0x29e0a8[_0x4281cb(0xe5)]),{lockData:_0x41b048,appLock:_0x347377}=ensureLockScope(_0xf04895??createEmptyBffLock(),_0x35895e[_0x4281cb(0xeb)],_0x29e0a8[_0x4281cb(0xe4)],'pull'),_0x35e682=normalizeBffType(_0x35895e['str']('type'))??undefined;if(_0x35895e['str'](_0x4281cb(0x108))&&!_0x35e682)throw CliErrors[_0x4281cb(0x118)](_0x4281cb(0x107));const [_0x3f887d,_0x47d306]=await Promise[_0x4281cb(0x10f)]([listBffScripts(_0x35895e[_0x4281cb(0xeb)],_0x35e682),getBffScriptStatistics(_0x35895e[_0x4281cb(0xeb)])]);if(_0x3f887d[_0x4281cb(0x115)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x387a83=_0x35895e[_0x4281cb(0x124)](_0x4281cb(0x11f));if(_0x387a83&&!_0x35895e[_0x4281cb(0xe1)]){const _0x4cf577=await confirmForce();if(!_0x4cf577)throw CliErrors['cancelled'](_0x4281cb(0x11b));}if(_0x387a83&&_0x35895e[_0x4281cb(0xe1)]){}const _0x46dbc8=buildDatasetCodeToAliasMap(_0x35895e['apiDir'],_0x35895e[_0x4281cb(0xeb)]),_0x33c725=createHookLocationMap(_0x47d306),_0x35c3ad=JSON[_0x4281cb(0x127)](JSON['stringify'](_0x41b048)),_0x322157=_0x35895e[_0x4281cb(0xeb)],_0x5c352d=_0x35c3ad[_0x4281cb(0x119)][_0x322157];if(!_0x5c352d)throw new Error(_0x4281cb(0x11c)+_0x322157+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x2d2497=[],_0x26ecac=[],_0x12873a=[];for(const _0x53be9b of _0x3f887d){const _0x25d134=resolveRemoteScriptTarget(_0x29e0a8,_0x53be9b,_0x33c725,_0x347377['functions'],_0x46dbc8);if(!_0x25d134){_0x26ecac[_0x4281cb(0xf0)]({'lockKey':_0x53be9b['scriptType']+'/'+_0x53be9b[_0x4281cb(0xf5)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x54e2ad=_0x347377['functions'][_0x25d134[_0x4281cb(0x121)]];try{if(!_0x53be9b['id'])throw new Error(_0x4281cb(0xfe));if(_0x53be9b[_0x4281cb(0xe6)]==null)throw new Error(_0x4281cb(0x11e));const _0x59bb2b=_0x53be9b[_0x4281cb(0xe6)],_0x2bf9e1=computeContentHash(_0x59bb2b);if(!_0x387a83){const _0x31ba65=await hasUnsyncedLocalChanges(_0x25d134['filePath'],_0x54e2ad,_0x2bf9e1);if(_0x31ba65){_0x26ecac[_0x4281cb(0xf0)]({'lockKey':_0x25d134[_0x4281cb(0x121)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x25d134['filePath']),await writeFile(_0x25d134[_0x4281cb(0x112)],_0x59bb2b,_0x4281cb(0x128));const _0x351fa3={'hash':_0x2bf9e1,'remoteId':_0x53be9b['id'],'version':_0x53be9b[_0x4281cb(0x10a)]};_0x25d134[_0x4281cb(0x108)]==='HOOK'&&_0x25d134[_0x4281cb(0x11a)]&&(_0x351fa3[_0x4281cb(0xf7)]=_0x25d134['hookLocation']['alias'],_0x351fa3[_0x4281cb(0xf1)]=_0x25d134[_0x4281cb(0x11a)][_0x4281cb(0xf1)],_0x351fa3['operationType']=_0x25d134[_0x4281cb(0x11a)][_0x4281cb(0xfc)],_0x351fa3[_0x4281cb(0xfb)]=_0x25d134[_0x4281cb(0x11a)]['functionNode']),_0x5c352d[_0x4281cb(0x126)][_0x25d134[_0x4281cb(0x121)]]=_0x351fa3,_0x2d2497[_0x4281cb(0xf0)]({'lockKey':_0x25d134['lockKey'],'remoteId':_0x53be9b['id']});}catch(_0x12f15f){_0x12873a[_0x4281cb(0xf0)]({'lockKey':_0x25d134[_0x4281cb(0x121)],'error':_0x12f15f instanceof Error?_0x12f15f[_0x4281cb(0x123)]:String(_0x12f15f)});}}return _0x5c352d['lastSync']=new Date()[_0x4281cb(0xfa)](),await writeBffLockFile(_0x29e0a8[_0x4281cb(0xe5)],_0x35c3ad),{'ok':_0x12873a[_0x4281cb(0x115)]===0x0,'data':{'pulled':_0x2d2497,'skipped':_0x26ecac,'failed':_0x12873a},'message':'Pull\x20complete:\x20'+_0x2d2497[_0x4281cb(0x115)]+_0x4281cb(0x113)+_0x26ecac[_0x4281cb(0x115)]+_0x4281cb(0xf6)+_0x12873a['length']+_0x4281cb(0x10e)};}};function a31_0x40ba(){const _0x281183=['length','hash','string','validation','apps','hookLocation','Force\x20pull\x20cancelled.','Lock\x20scope\x20for\x20app\x20\x22','would_pull','Remote\x20script\x20missing\x20content.','force','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','lockKey','skipped','message','bool','HOOK','functions','parse','utf8','192216iVETRF','GET','nonInteractive','scriptType','apiDir','scriptsRoot','lockFilePath','scriptContent','3ozPzBr','map','671MpsYYu','toLowerCase','appCode','write','69406HcSAVc','stderr','276651dQojXQ','push','datasetCode','boolean','str','bff','functionName','\x20skipped,\x20','alias','197123DMLegj','pull','toISOString','functionNode','operationType','15078ocyrlO','Remote\x20script\x20missing\x20id.','434255VdJFil','ENDPOINT','question','unresolvable\x20target\x20path','6ZWIOAy','trim','close','Would\x20inspect\x20','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','type','conflict','version','Pull\x20only\x20this\x20script\x20type','\x20remote\x20BFF\x20script(s)\x20for\x20pull','COMMON','\x20failed','all','83270ZOtKyt','576qXXJtN','filePath','\x20pulled,\x20','&type='];a31_0x40ba=function(){return _0x281183;};return a31_0x40ba();}async function hasUnsyncedLocalChanges(_0x229cd1,_0x4a5ec1,_0x58550b){const _0x1ce402=a31_0x600960;if(!await fileExists(_0x229cd1))return![];const _0x449898=await computeFileHash(_0x229cd1);if(!_0x4a5ec1)return _0x58550b?_0x449898!==_0x58550b:!![];return _0x449898!==_0x4a5ec1[_0x1ce402(0x116)];}function buildDatasetCodeToAliasMap(_0x1297e2,_0x5bcc35){const _0x1f625d=a31_0x600960,_0x4fd0cf=loadAliasMap(_0x1297e2,undefined,resolveApiFilePath(_0x1297e2,_0x5bcc35));return new Map(_0x4fd0cf[_0x1f625d(0xe8)](_0x443d69=>[_0x443d69['datasetCode'],_0x443d69[_0x1f625d(0xf7)]]));}async function confirmForce(){const _0x7c49b=a31_0x600960,_0x2fb401=createInterface({'input':process['stdin'],'output':process[_0x7c49b(0xee)]}),_0x565ab0=await new Promise(_0x39e6fb=>{const _0x1ab2d2=_0x7c49b;_0x2fb401[_0x1ab2d2(0x101)](_0x1ab2d2(0x120),_0x39e6fb);});return _0x2fb401[_0x7c49b(0x105)](),['y','yes']['includes'](_0x565ab0[_0x7c49b(0x104)]()[_0x7c49b(0xea)]());}
@@ -1 +1 @@
1
- const a32_0x2a9260=a32_0x2ea1;(function(_0x5d5a24,_0x15fa0e){const _0x56427b=a32_0x2ea1,_0x5039c6=_0x5d5a24();while(!![]){try{const _0x3b5a09=-parseInt(_0x56427b(0x1ab))/0x1*(parseInt(_0x56427b(0x1a4))/0x2)+parseInt(_0x56427b(0x1b1))/0x3*(-parseInt(_0x56427b(0x19c))/0x4)+-parseInt(_0x56427b(0x1a0))/0x5+parseInt(_0x56427b(0x18a))/0x6+-parseInt(_0x56427b(0x1a6))/0x7+-parseInt(_0x56427b(0x1ac))/0x8*(parseInt(_0x56427b(0x1af))/0x9)+parseInt(_0x56427b(0x183))/0xa;if(_0x3b5a09===_0x15fa0e)break;else _0x5039c6['push'](_0x5039c6['shift']());}catch(_0x1eed28){_0x5039c6['push'](_0x5039c6['shift']());}}}(a32_0x4845,0x6e203));import{readFile}from'node:fs/promises';function a32_0x2ea1(_0x5b4e34,_0x80388){_0x5b4e34=_0x5b4e34-0x16d;const _0x4845af=a32_0x4845();let _0x2ea194=_0x4845af[_0x5b4e34];return _0x2ea194;}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';function a32_0x4845(){const _0x4a0455=['Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Cannot\x20resolve\x20dataset\x20for\x20\x22','has','push','5279304iXMSjB','\x20local\x20BFF\x20script(s)\x20for\x20push','str','Run\x20`','datasetCode','Would\x20inspect\x20','Incomplete\x20HOOK\x20path:\x20','force','functions','string','filter',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','description','HOOK','COMMON','Push\x20complete:\x20','unchanged','\x20uploaded,\x20','943252IMxZeC','hash','map','Push\x20local\x20BFF\x20scripts\x20to\x20remote','4167865Wxnobq','create','utf8','length','311294lfWfsn','message','4103113YCCqDs','script','name','functionNode','version','3sdTOBF','16WlBxgT','scriptsRoot','set','186174bxwwIO','bff','6zVurLz','datasetCodeToId','validation','high-risk-write','some','bool','appCode','\x22.\x20','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','/api/management/library/scripts/save','filePath','update','aliasToDatasetCode','code','operationType','remoteId','lockFilePath','toISOString','boolean','Push\x20only\x20this\x20script\x20type','lockKey','\x20skipped,\x20','type','19708620ARZwgq','alias','\x20failed'];a32_0x4845=function(){return _0x4a0455;};return a32_0x4845();}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_0x2a9260(0x1b0),'command':'push','description':a32_0x2a9260(0x19f),'risk':a32_0x2a9260(0x16f),'flags':[{'name':'type','type':a32_0x2a9260(0x193),'description':a32_0x2a9260(0x17f),'enum':[a32_0x2a9260(0x198),'ENDPOINT',a32_0x2a9260(0x197)]},{'name':a32_0x2a9260(0x1a8),'type':'string','description':a32_0x2a9260(0x186)},{'name':a32_0x2a9260(0x191),'type':a32_0x2a9260(0x17e),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x28e841){const _0x20997c=a32_0x2a9260,_0x3f14bc=loadBffProjectConfig(_0x28e841['appCode']),_0x56a6da=await readBffLockFile(_0x3f14bc['lockFilePath']),{appLock:_0x26471b}=ensureLockScope(_0x56a6da??createEmptyBffLock(),_0x28e841[_0x20997c(0x172)],_0x3f14bc[_0x20997c(0x1ad)],'push'),_0x165f53=await getTargetFunctions(_0x3f14bc,_0x28e841),_0x1a1de0=_0x28e841[_0x20997c(0x171)](_0x20997c(0x191)),_0x2ad6e1=[];for(const _0x508b19 of _0x165f53){const _0x4c40bd=await computeFileHash(_0x508b19[_0x20997c(0x176)]),_0x46405f=_0x26471b[_0x20997c(0x192)][_0x508b19[_0x20997c(0x180)]],_0x1757a7=!!_0x46405f&&_0x46405f[_0x20997c(0x19d)]===_0x4c40bd;_0x2ad6e1['push']({'lockKey':_0x508b19[_0x20997c(0x180)],'filePath':_0x508b19[_0x20997c(0x176)],'remoteId':_0x46405f?.[_0x20997c(0x17b)]??null,'mode':_0x46405f?.[_0x20997c(0x17b)]?_0x20997c(0x177):_0x20997c(0x1a1),'status':!_0x1a1de0&&_0x1757a7?_0x20997c(0x19a):'would_push'});}return{'method':'POST','url':_0x20997c(0x175),'body':{'appCode':_0x28e841[_0x20997c(0x172)],'force':_0x1a1de0,'files':_0x2ad6e1},'description':_0x20997c(0x18f)+_0x2ad6e1[_0x20997c(0x1a3)]+_0x20997c(0x18b)};},async 'execute'(_0x3dea98){const _0x3badea=a32_0x2a9260,_0x35b5a1=loadBffProjectConfig(_0x3dea98[_0x3badea(0x172)]),_0x4d0504=await readBffLockFile(_0x35b5a1[_0x3badea(0x17c)]),{lockData:_0x1d844e,appLock:_0x2a47e9}=ensureLockScope(_0x4d0504??createEmptyBffLock(),_0x3dea98['appCode'],_0x35b5a1[_0x3badea(0x1ad)],_0x3badea(0x189)),_0x21fe93=await getTargetFunctions(_0x35b5a1,_0x3dea98);if(_0x21fe93[_0x3badea(0x1a3)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x3fd138=_0x3dea98[_0x3badea(0x171)]('force'),_0x182525=await buildHookMaps(_0x3dea98['appCode'],_0x3dea98['apiDir'],_0x21fe93,_0x2a47e9),_0x345eb5=[],_0x5aa602=[],_0xe7278d=[];for(const _0x3134af of _0x21fe93){const _0x20c8d5=await computeFileHash(_0x3134af[_0x3badea(0x176)]),_0x117dc7=_0x2a47e9['functions'][_0x3134af['lockKey']];if(!_0x3fd138&&_0x117dc7&&_0x117dc7['hash']===_0x20c8d5){_0x5aa602[_0x3badea(0x189)]({'lockKey':_0x3134af[_0x3badea(0x180)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x3dea98[_0x3badea(0x172)],_0x3134af,_0x2a47e9,_0x182525);const _0x1b890e=_0x2a47e9[_0x3badea(0x192)][_0x3134af[_0x3badea(0x180)]];_0x345eb5[_0x3badea(0x189)]({'lockKey':_0x3134af[_0x3badea(0x180)],'remoteId':_0x1b890e?.[_0x3badea(0x17b)]??0x0});}catch(_0x5e6943){_0xe7278d[_0x3badea(0x189)]({'lockKey':_0x3134af[_0x3badea(0x180)],'error':_0x5e6943 instanceof Error?_0x5e6943[_0x3badea(0x1a5)]:String(_0x5e6943)});}}return _0x2a47e9['lastSync']=new Date()[_0x3badea(0x17d)](),await writeBffLockFile(_0x35b5a1[_0x3badea(0x17c)],_0x1d844e),{'ok':_0xe7278d[_0x3badea(0x1a3)]===0x0,'data':{'uploaded':_0x345eb5,'skipped':_0x5aa602,'failed':_0xe7278d},'message':_0x3badea(0x199)+_0x345eb5[_0x3badea(0x1a3)]+_0x3badea(0x19b)+_0x5aa602['length']+_0x3badea(0x181)+_0xe7278d[_0x3badea(0x1a3)]+_0x3badea(0x185)};}};async function getTargetFunctions(_0xe6fafd,_0x144c34){const _0x31f959=a32_0x2a9260,_0x48cee6=_0x144c34[_0x31f959(0x18c)](_0x31f959(0x182)),_0x11c40e=_0x144c34[_0x31f959(0x18c)](_0x31f959(0x1a8)),_0x378ba9=normalizeBffType(_0x48cee6)??undefined;if(_0x11c40e&&!_0x378ba9)throw CliErrors[_0x31f959(0x16e)](_0x31f959(0x174));const _0x43d2da=await scanLocalBffFunctions(_0xe6fafd,_0x378ba9);if(_0x11c40e){const _0xe1258d=_0x43d2da[_0x31f959(0x194)](_0x3e7a44=>_0x3e7a44[_0x31f959(0x1a8)]===_0x11c40e);if(_0xe1258d[_0x31f959(0x1a3)]===0x0)throw CliErrors[_0x31f959(0x16e)]('Local\x20function\x20not\x20found:\x20'+_0x378ba9+'/'+_0x11c40e);return _0xe1258d;}return _0x43d2da;}async function buildHookMaps(_0xc49bab,_0x349f7a,_0x2b845c,_0x3066c5){const _0x13a4cf=a32_0x2a9260,_0x1a43dd=_0x2b845c[_0x13a4cf(0x170)](_0x5b3d4b=>_0x5b3d4b['type']==='HOOK');if(!_0x1a43dd)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x4f0a34=loadAliasMap(_0x349f7a,undefined,resolveApiFilePath(_0x349f7a,_0xc49bab)),_0x82b939=new Map(_0x4f0a34[_0x13a4cf(0x19e)](_0x56f587=>[_0x56f587[_0x13a4cf(0x184)],_0x56f587[_0x13a4cf(0x18e)]]));for(const _0x4f5933 of Object['values'](_0x3066c5[_0x13a4cf(0x192)])){_0x4f5933[_0x13a4cf(0x184)]&&_0x4f5933[_0x13a4cf(0x18e)]&&!_0x82b939[_0x13a4cf(0x188)](_0x4f5933[_0x13a4cf(0x184)])&&_0x82b939[_0x13a4cf(0x1ae)](_0x4f5933[_0x13a4cf(0x184)],_0x4f5933[_0x13a4cf(0x18e)]);}const _0x1acef9=await listDatasets(_0xc49bab),_0x497d3f=new Map(_0x1acef9[_0x13a4cf(0x19e)](_0x44ff8c=>[_0x44ff8c[_0x13a4cf(0x179)],_0x44ff8c['id']]));return{'aliasToDatasetCode':_0x82b939,'datasetCodeToId':_0x497d3f};}async function uploadSingleFunction(_0x1446b3,_0x1d991e,_0x2777d4,_0x4dd07e){const _0x1a0ee3=a32_0x2a9260,_0x1faee7=await readFile(_0x1d991e['filePath'],_0x1a0ee3(0x1a2)),_0x1a89bf=await computeFileHash(_0x1d991e['filePath']),_0x250d66=_0x2777d4['functions'][_0x1d991e[_0x1a0ee3(0x180)]];if(_0x250d66?.[_0x1a0ee3(0x17b)]&&_0x250d66[_0x1a0ee3(0x1aa)]==null)throw CliErrors[_0x1a0ee3(0x16e)](_0x1d991e[_0x1a0ee3(0x180)]+_0x1a0ee3(0x195));let _0x2702f0=extractScriptDescription(_0x1faee7);if(!_0x2702f0&&_0x250d66?.[_0x1a0ee3(0x17b)]){const _0x25c760=await getBffScriptInfo(_0x250d66[_0x1a0ee3(0x17b)]);_0x2702f0=_0x25c760[_0x1a0ee3(0x196)]||undefined;}const _0x4f38b7={'appCode':_0x1446b3,'functionName':_0x1d991e[_0x1a0ee3(0x1a8)],'scriptType':_0x1d991e[_0x1a0ee3(0x182)],'scriptContent':_0x1faee7};if(_0x250d66?.[_0x1a0ee3(0x17b)])_0x4f38b7['id']=_0x250d66['remoteId'];if(_0x250d66?.[_0x1a0ee3(0x1aa)]!=null)_0x4f38b7['version']=_0x250d66[_0x1a0ee3(0x1aa)];if(_0x2702f0)_0x4f38b7[_0x1a0ee3(0x196)]=_0x2702f0;if(_0x1d991e[_0x1a0ee3(0x182)]===_0x1a0ee3(0x197)){const _0x5f381f=_0x1d991e[_0x1a0ee3(0x184)];if(!_0x5f381f||!_0x1d991e[_0x1a0ee3(0x17a)]||!_0x1d991e[_0x1a0ee3(0x1a9)])throw CliErrors[_0x1a0ee3(0x16e)](_0x1a0ee3(0x190)+_0x1d991e[_0x1a0ee3(0x180)]);const _0x57cb5d=_0x4dd07e['aliasToDatasetCode']['get'](_0x5f381f)??_0x250d66?.[_0x1a0ee3(0x18e)]??_0x5f381f,_0x56a7ec=_0x4dd07e[_0x1a0ee3(0x16d)]['get'](_0x57cb5d);if(!_0x56a7ec)throw CliErrors[_0x1a0ee3(0x16e)](_0x1a0ee3(0x187)+_0x5f381f+_0x1a0ee3(0x173)+(_0x1a0ee3(0x18d)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x4f38b7['datasetId']=_0x56a7ec,_0x4f38b7[_0x1a0ee3(0x17a)]=_0x1d991e[_0x1a0ee3(0x17a)],_0x4f38b7[_0x1a0ee3(0x1a9)]=_0x1d991e[_0x1a0ee3(0x1a9)];}const _0x13089=await saveBffScript(_0x4f38b7),_0x118209=_0x13089['id'],_0x170978=_0x13089[_0x1a0ee3(0x1a7)]??await getBffScriptInfo(_0x118209),_0x11f499={'hash':_0x1a89bf,'remoteId':_0x118209,'version':_0x170978[_0x1a0ee3(0x1aa)]};if(_0x1d991e[_0x1a0ee3(0x182)]===_0x1a0ee3(0x197)){const _0x46dc2c=_0x1d991e[_0x1a0ee3(0x184)],_0x44fe92=_0x4dd07e[_0x1a0ee3(0x178)]['get'](_0x46dc2c)??_0x250d66?.[_0x1a0ee3(0x18e)]??_0x46dc2c;_0x4dd07e[_0x1a0ee3(0x178)][_0x1a0ee3(0x188)](_0x46dc2c)?_0x11f499[_0x1a0ee3(0x184)]=_0x46dc2c:_0x11f499[_0x1a0ee3(0x184)]=_0x250d66?.[_0x1a0ee3(0x184)],_0x11f499[_0x1a0ee3(0x18e)]=_0x44fe92,_0x11f499['operationType']=_0x1d991e[_0x1a0ee3(0x17a)],_0x11f499['functionNode']=_0x1d991e[_0x1a0ee3(0x1a9)];}_0x2777d4[_0x1a0ee3(0x192)][_0x1d991e[_0x1a0ee3(0x180)]]=_0x11f499;}
1
+ const a32_0x5cd75f=a32_0x2964;(function(_0x1c9738,_0x57f02b){const _0x4ed8a0=a32_0x2964,_0x4d7bf7=_0x1c9738();while(!![]){try{const _0x5d4921=parseInt(_0x4ed8a0(0x165))/0x1+parseInt(_0x4ed8a0(0x14d))/0x2+parseInt(_0x4ed8a0(0x186))/0x3+parseInt(_0x4ed8a0(0x172))/0x4*(-parseInt(_0x4ed8a0(0x150))/0x5)+parseInt(_0x4ed8a0(0x144))/0x6+-parseInt(_0x4ed8a0(0x16f))/0x7+parseInt(_0x4ed8a0(0x15d))/0x8*(-parseInt(_0x4ed8a0(0x14e))/0x9);if(_0x5d4921===_0x57f02b)break;else _0x4d7bf7['push'](_0x4d7bf7['shift']());}catch(_0x49d139){_0x4d7bf7['push'](_0x4d7bf7['shift']());}}}(a32_0x58f9,0x553b4));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a32_0x58f9(){const _0x2ae77e=['unchanged',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Runtime\x20script\x20cache\x20cleared.','apps','type','get','push','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','description','validation','utf8','create','some','length','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','1078908SgFavG','version','POST','str','Local\x20function\x20not\x20found:\x20','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','string','stringify','every','bff','scriptsRoot','3750468APfXsH','Run\x20`','high-risk-write','name','map','\x20failed,\x20','update','parse','\x20uploaded,\x20','1148812QiPdDy','909SijOEv','functionNode','15rGAyzJ','message','datasetCodeToId','\x22.\x20','boolean','would_push','toISOString','/api/management/library/scripts/save','attempted','filePath','appCode','datasetCode','lastSync','70568xvJeLU','\x22\x20not\x20found\x20after\x20ensureLockScope.','Push\x20complete:\x20','operationType','cleared','No\x20local\x20BFF\x20functions\x20found.','HOOK','alias','16249ItOLMg','remoteId','functions','lockKey','values','runtime\x20cache\x20cleared','bool','aliasToDatasetCode','Push\x20local\x20BFF\x20scripts\x20to\x20remote','lockFilePath','218442ZcfMrq','force','datasetId','405512TWsovL','Incomplete\x20HOOK\x20path:\x20','hash','set','runtime\x20cache\x20not\x20needed'];a32_0x58f9=function(){return _0x2ae77e;};return a32_0x58f9();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a32_0x2964(_0x36543a,_0x478c7c){_0x36543a=_0x36543a-0x13b;const _0x58f931=a32_0x58f9();let _0x296451=_0x58f931[_0x36543a];return _0x296451;}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{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a32_0x5cd75f(0x142),'command':'push','description':a32_0x5cd75f(0x16d),'risk':a32_0x5cd75f(0x146),'flags':[{'name':a32_0x5cd75f(0x17b),'type':'string','description':'Push\x20only\x20this\x20script\x20type','enum':['COMMON','ENDPOINT','HOOK']},{'name':a32_0x5cd75f(0x147),'type':a32_0x5cd75f(0x13f),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':'force','type':a32_0x5cd75f(0x154),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x591f6f){const _0x5d3a33=a32_0x5cd75f,_0x46e67e=loadBffProjectConfig(_0x591f6f['appCode']),_0x4c2461=await readBffLockFile(_0x46e67e[_0x5d3a33(0x16e)]),{appLock:_0x443b34}=ensureLockScope(_0x4c2461??createEmptyBffLock(),_0x591f6f[_0x5d3a33(0x15a)],_0x46e67e[_0x5d3a33(0x143)],'push'),_0x4d9b52=await getTargetFunctions(_0x46e67e,_0x591f6f),_0x28fd52=_0x591f6f[_0x5d3a33(0x16b)](_0x5d3a33(0x170)),_0x5a1d9e=[];for(const _0x4af626 of _0x4d9b52){const _0x3c5fc0=await computeFileHash(_0x4af626['filePath']),_0x3181e5=_0x443b34[_0x5d3a33(0x167)][_0x4af626[_0x5d3a33(0x168)]],_0x4fee1a=!!_0x3181e5&&_0x3181e5[_0x5d3a33(0x174)]===_0x3c5fc0;_0x5a1d9e[_0x5d3a33(0x17d)]({'lockKey':_0x4af626[_0x5d3a33(0x168)],'filePath':_0x4af626[_0x5d3a33(0x159)],'remoteId':_0x3181e5?.['remoteId']??null,'mode':_0x3181e5?.[_0x5d3a33(0x166)]?_0x5d3a33(0x14a):_0x5d3a33(0x182),'status':!_0x28fd52&&_0x4fee1a?'unchanged':_0x5d3a33(0x155)});}return{'method':_0x5d3a33(0x13b),'url':_0x5d3a33(0x157),'body':{'appCode':_0x591f6f[_0x5d3a33(0x15a)],'force':_0x28fd52,'files':_0x5a1d9e,'cacheClearAtRuntime':_0x5a1d9e[_0x5d3a33(0x183)](_0x4e2747=>_0x4e2747['status']==='would_push'),'cacheClearAtRuntimeTimes':_0x5a1d9e[_0x5d3a33(0x183)](_0x614f9f=>_0x614f9f['status']==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x5a1d9e[_0x5d3a33(0x184)]+_0x5d3a33(0x17e)};},async 'execute'(_0x58c7fb){const _0x3e4179=a32_0x5cd75f,_0x339add=loadBffProjectConfig(_0x58c7fb[_0x3e4179(0x15a)]),_0xa2e5cd=await readBffLockFile(_0x339add[_0x3e4179(0x16e)]),{lockData:_0x19bb38,appLock:_0x420f7e}=ensureLockScope(_0xa2e5cd??createEmptyBffLock(),_0x58c7fb['appCode'],_0x339add[_0x3e4179(0x143)],_0x3e4179(0x17d)),_0x809937=await getTargetFunctions(_0x339add,_0x58c7fb);if(_0x809937[_0x3e4179(0x184)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x3e4179(0x162)};const _0xf59d7f=_0x58c7fb['bool'](_0x3e4179(0x170)),_0x21f870=JSON[_0x3e4179(0x14b)](JSON[_0x3e4179(0x140)](_0x19bb38)),_0x183fd9=_0x21f870[_0x3e4179(0x17a)][_0x58c7fb[_0x3e4179(0x15a)]];if(!_0x183fd9)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x58c7fb[_0x3e4179(0x15a)]+_0x3e4179(0x15e));const _0x4f22dd=await buildHookMaps(_0x58c7fb[_0x3e4179(0x15a)],_0x58c7fb['apiDir'],_0x809937,_0x183fd9),_0x1ed02b=[],_0x1bfb8f=[],_0x53b927=[];for(const _0xd33ab3 of _0x809937){const _0x4e4909=await computeFileHash(_0xd33ab3[_0x3e4179(0x159)]),_0x393244=_0x183fd9[_0x3e4179(0x167)][_0xd33ab3[_0x3e4179(0x168)]];if(!_0xf59d7f&&_0x393244&&_0x393244['hash']===_0x4e4909){_0x1bfb8f[_0x3e4179(0x17d)]({'lockKey':_0xd33ab3[_0x3e4179(0x168)],'reason':_0x3e4179(0x177)});continue;}try{await uploadSingleFunction(_0x58c7fb[_0x3e4179(0x15a)],_0xd33ab3,_0x183fd9,_0x4f22dd);const _0xd85f98=_0x183fd9['functions'][_0xd33ab3[_0x3e4179(0x168)]];_0x1ed02b[_0x3e4179(0x17d)]({'lockKey':_0xd33ab3[_0x3e4179(0x168)],'remoteId':_0xd85f98?.[_0x3e4179(0x166)]??0x0});}catch(_0x579146){_0x53b927[_0x3e4179(0x17d)]({'lockKey':_0xd33ab3[_0x3e4179(0x168)],'error':_0x579146 instanceof Error?_0x579146[_0x3e4179(0x151)]:String(_0x579146)});}}_0x183fd9[_0x3e4179(0x15c)]=new Date()[_0x3e4179(0x156)](),await writeBffLockFile(_0x339add[_0x3e4179(0x16e)],_0x21f870),await waitForUploadedLockEntries(_0x339add[_0x3e4179(0x16e)],_0x58c7fb[_0x3e4179(0x15a)],_0x1ed02b[_0x3e4179(0x148)](_0x776cf2=>_0x776cf2[_0x3e4179(0x168)]));let _0xe5edf8={'attempted':![],'cleared':![]};if(_0x1ed02b[_0x3e4179(0x184)]>0x0)try{let _0x5af4e2='';for(let _0x1040b3=0x0;_0x1040b3<CACHE_CLEAR_ATTEMPTS;_0x1040b3+=0x1){_0x5af4e2=await clearBffScriptCache(),_0x1040b3<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0xe5edf8={'attempted':!![],'cleared':!![],'message':_0x5af4e2||_0x3e4179(0x179)};}catch(_0x57c4f5){_0xe5edf8={'attempted':!![],'cleared':![],'error':_0x57c4f5 instanceof Error?_0x57c4f5[_0x3e4179(0x151)]:String(_0x57c4f5)};}const _0x3f7274=_0x53b927[_0x3e4179(0x184)]===0x0&&(_0xe5edf8[_0x3e4179(0x158)]?_0xe5edf8[_0x3e4179(0x161)]:!![]),_0x5c56fa=_0xe5edf8[_0x3e4179(0x158)]?_0xe5edf8[_0x3e4179(0x161)]?_0x3e4179(0x16a):'runtime\x20cache\x20clear\x20failed':_0x3e4179(0x176);return{'ok':_0x3f7274,'data':{'uploaded':_0x1ed02b,'skipped':_0x1bfb8f,'failed':_0x53b927,'cacheClear':_0xe5edf8},'message':_0x3e4179(0x15f)+_0x1ed02b[_0x3e4179(0x184)]+_0x3e4179(0x14c)+_0x1bfb8f[_0x3e4179(0x184)]+'\x20skipped,\x20'+_0x53b927[_0x3e4179(0x184)]+_0x3e4179(0x149)+_0x5c56fa};}};async function getTargetFunctions(_0x210805,_0x211a48){const _0x37e94c=a32_0x5cd75f,_0x2eed96=_0x211a48[_0x37e94c(0x13c)]('type'),_0x12ec6c=_0x211a48[_0x37e94c(0x13c)](_0x37e94c(0x147)),_0x53d92b=normalizeBffType(_0x2eed96)??undefined;if(_0x12ec6c&&!_0x53d92b)throw CliErrors[_0x37e94c(0x180)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x2dce82=await scanLocalBffFunctions(_0x210805,_0x53d92b);if(_0x12ec6c){const _0x5087ad=_0x2dce82['filter'](_0x12f087=>_0x12f087[_0x37e94c(0x147)]===_0x12ec6c);if(_0x5087ad['length']===0x0)throw CliErrors['validation'](_0x37e94c(0x13d)+_0x53d92b+'/'+_0x12ec6c);return _0x5087ad;}return _0x2dce82;}async function buildHookMaps(_0x17afee,_0x48641f,_0x3c464f,_0x56fd96){const _0x430692=a32_0x5cd75f,_0x508783=_0x3c464f[_0x430692(0x183)](_0x13f95c=>_0x13f95c['type']===_0x430692(0x163));if(!_0x508783)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x5a977e=loadAliasMap(_0x48641f,undefined,resolveApiFilePath(_0x48641f,_0x17afee)),_0x5b03bb=new Map(_0x5a977e[_0x430692(0x148)](_0x1db4e0=>[_0x1db4e0['alias'],_0x1db4e0[_0x430692(0x15b)]]));for(const _0x5b537f of Object[_0x430692(0x169)](_0x56fd96[_0x430692(0x167)])){_0x5b537f[_0x430692(0x164)]&&_0x5b537f[_0x430692(0x15b)]&&!_0x5b03bb['has'](_0x5b537f[_0x430692(0x164)])&&_0x5b03bb[_0x430692(0x175)](_0x5b537f[_0x430692(0x164)],_0x5b537f[_0x430692(0x15b)]);}const _0x232e80=await listDatasets(_0x17afee),_0x5698c5=new Map(_0x232e80['map'](_0x4cec68=>[_0x4cec68['code'],_0x4cec68['id']]));return{'aliasToDatasetCode':_0x5b03bb,'datasetCodeToId':_0x5698c5};}async function uploadSingleFunction(_0x492a53,_0x2ea090,_0x333107,_0xc67d0f){const _0x107fd1=a32_0x5cd75f,_0x3768bc=await readFile(_0x2ea090[_0x107fd1(0x159)],_0x107fd1(0x181)),_0x2bf711=await computeFileHash(_0x2ea090[_0x107fd1(0x159)]),_0x1fbf79=_0x333107[_0x107fd1(0x167)][_0x2ea090[_0x107fd1(0x168)]];if(_0x1fbf79?.[_0x107fd1(0x166)]&&_0x1fbf79[_0x107fd1(0x187)]==null)throw CliErrors[_0x107fd1(0x180)](_0x2ea090[_0x107fd1(0x168)]+_0x107fd1(0x178));let _0x2b0d47=extractScriptDescription(_0x3768bc);if(!_0x2b0d47&&_0x1fbf79?.[_0x107fd1(0x166)]){const _0x4c6f75=await getBffScriptInfo(_0x1fbf79[_0x107fd1(0x166)]);_0x2b0d47=_0x4c6f75['description']||undefined;}const _0x240d31={'appCode':_0x492a53,'functionName':_0x2ea090[_0x107fd1(0x147)],'scriptType':_0x2ea090['type'],'scriptContent':_0x3768bc};if(_0x1fbf79?.[_0x107fd1(0x166)])_0x240d31['id']=_0x1fbf79[_0x107fd1(0x166)];if(_0x1fbf79?.[_0x107fd1(0x187)]!=null)_0x240d31[_0x107fd1(0x187)]=_0x1fbf79[_0x107fd1(0x187)];if(_0x2b0d47)_0x240d31[_0x107fd1(0x17f)]=_0x2b0d47;if(_0x2ea090[_0x107fd1(0x17b)]===_0x107fd1(0x163)){const _0x30bc79=_0x2ea090[_0x107fd1(0x164)];if(!_0x30bc79||!_0x2ea090[_0x107fd1(0x160)]||!_0x2ea090[_0x107fd1(0x14f)])throw CliErrors[_0x107fd1(0x180)](_0x107fd1(0x173)+_0x2ea090['lockKey']);const _0x28fdad=_0xc67d0f[_0x107fd1(0x16c)][_0x107fd1(0x17c)](_0x30bc79)??_0x1fbf79?.['datasetCode']??_0x30bc79,_0x2325a0=_0xc67d0f[_0x107fd1(0x152)][_0x107fd1(0x17c)](_0x28fdad);if(!_0x2325a0)throw CliErrors[_0x107fd1(0x180)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x30bc79+_0x107fd1(0x153)+(_0x107fd1(0x145)+CLI_BIN_NAME+_0x107fd1(0x185)));_0x240d31[_0x107fd1(0x171)]=_0x2325a0,_0x240d31['operationType']=_0x2ea090[_0x107fd1(0x160)],_0x240d31[_0x107fd1(0x14f)]=_0x2ea090[_0x107fd1(0x14f)];}const _0x46da4f=await saveBffScript(_0x240d31),_0x28abd9=_0x46da4f['id'],_0x30a8ad=_0x46da4f['script']??await getBffScriptInfo(_0x28abd9),_0x546bb0={'hash':_0x2bf711,'remoteId':_0x28abd9,'version':_0x30a8ad[_0x107fd1(0x187)]};if(_0x2ea090[_0x107fd1(0x17b)]==='HOOK'){const _0x1fc40a=_0x2ea090['alias'],_0x55eea0=_0xc67d0f[_0x107fd1(0x16c)]['get'](_0x1fc40a)??_0x1fbf79?.[_0x107fd1(0x15b)]??_0x1fc40a;_0xc67d0f['aliasToDatasetCode']['has'](_0x1fc40a)?_0x546bb0['alias']=_0x1fc40a:_0x546bb0[_0x107fd1(0x164)]=_0x1fbf79?.[_0x107fd1(0x164)],_0x546bb0[_0x107fd1(0x15b)]=_0x55eea0,_0x546bb0[_0x107fd1(0x160)]=_0x2ea090['operationType'],_0x546bb0['functionNode']=_0x2ea090['functionNode'];}_0x333107[_0x107fd1(0x167)][_0x2ea090[_0x107fd1(0x168)]]=_0x546bb0;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3fd069,_0x18f9c6,_0x2a609f){const _0x4b3143=a32_0x5cd75f;if(_0x2a609f[_0x4b3143(0x184)]===0x0)return;for(let _0x3555c=0x0;_0x3555c<LOCK_SETTLE_RETRY_COUNT;_0x3555c+=0x1){const _0x4e1860=await readBffLockFile(_0x3fd069),_0x1a7685=_0x4e1860?.[_0x4b3143(0x17a)]?.[_0x18f9c6]?.[_0x4b3143(0x167)]??{},_0x34e1d6=_0x2a609f[_0x4b3143(0x141)](_0x1c3e19=>!!_0x1a7685[_0x1c3e19]?.['remoteId']);if(_0x34e1d6)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x4b3143(0x13e)+_0x2a609f['join'](',\x20')+'.');}