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

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 (162) 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 -0
  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 -0
  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 -0
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/delete.js +1 -1
  28. package/lib/commands/bff/detail.js +1 -1
  29. package/lib/commands/bff/index.js +1 -1
  30. package/lib/commands/bff/list.js +1 -1
  31. package/lib/commands/bff/new.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -1
  53. package/lib/commands/db/analyze-start.js +1 -1
  54. package/lib/commands/db/analyze-status.js +1 -1
  55. package/lib/commands/db/create.js +1 -1
  56. package/lib/commands/db/delete.js +1 -1
  57. package/lib/commands/db/detail.js +1 -1
  58. package/lib/commands/db/diff.js +1 -1
  59. package/lib/commands/db/index.js +1 -1
  60. package/lib/commands/db/list.js +1 -1
  61. package/lib/commands/db/shared.js +1 -1
  62. package/lib/commands/db/tables.js +1 -1
  63. package/lib/commands/db/test.js +1 -1
  64. package/lib/commands/db/update.js +1 -1
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  81. package/lib/commands/project/create/format-elapsed.js +1 -1
  82. package/lib/commands/project/create/main.js +1 -1
  83. package/lib/commands/project/create/non-interactive.js +1 -1
  84. package/lib/commands/project/create/project-template-path.js +1 -1
  85. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  86. package/lib/commands/project/create/use-format-code.js +1 -1
  87. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  88. package/lib/commands/project/index.js +1 -1
  89. package/lib/commands/project/init.js +1 -1
  90. package/lib/commands/project/upgrade.js +1 -1
  91. package/lib/commands/registry.js +1 -1
  92. package/lib/commands/run/index.js +1 -1
  93. package/lib/commands/schema.js +1 -1
  94. package/lib/commands/skill/index.js +1 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +1 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/sql/list.js +1 -1
  99. package/lib/commands/sql/pull.js +1 -1
  100. package/lib/commands/sql/save.js +1 -1
  101. package/lib/commands/sql/shared.js +1 -1
  102. package/lib/commands/sql/validate.js +1 -1
  103. package/lib/config/schema.js +1 -0
  104. package/lib/constant/cli.js +1 -1
  105. package/lib/constant/defaults.js +1 -0
  106. package/lib/constant/domain.js +1 -1
  107. package/lib/constant/env.js +1 -1
  108. package/lib/constant/output.js +1 -0
  109. package/lib/constant/paths.js +1 -1
  110. package/lib/constant/risk.js +1 -0
  111. package/lib/context.js +1 -1
  112. package/lib/core/alias-resolver.js +1 -1
  113. package/lib/core/api-client.js +1 -1
  114. package/lib/core/bff/config.js +1 -1
  115. package/lib/core/bff/file-system.js +1 -1
  116. package/lib/core/bff/hash.js +1 -1
  117. package/lib/core/bff/lock.js +1 -1
  118. package/lib/core/bff/utils.js +1 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/sql-validator.js +1 -1
  121. package/lib/errors.js +1 -1
  122. package/lib/framework/build-all-flags.js +1 -1
  123. package/lib/framework/flags.js +1 -1
  124. package/lib/framework/help.js +1 -1
  125. package/lib/framework/index.js +1 -1
  126. package/lib/framework/output.js +1 -1
  127. package/lib/framework/response.js +1 -1
  128. package/lib/framework/runner-alias.js +1 -0
  129. package/lib/framework/runner.js +1 -1
  130. package/lib/framework/schema-export.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/skills/main.js +1 -1
  135. package/lib/skills/npx-skills-add.js +1 -1
  136. package/lib/telemetry/cli-command-trace.js +1 -1
  137. package/lib/telemetry/cli-help-trace.js +1 -1
  138. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  139. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  140. package/lib/telemetry/send-cli-trace-log.js +1 -1
  141. package/lib/utils/ai_config.js +1 -1
  142. package/lib/utils/apply-jq-filter.js +1 -1
  143. package/lib/utils/cdn-config.js +1 -1
  144. package/lib/utils/check-sdk-version.js +1 -1
  145. package/lib/utils/cli-version-check.js +1 -1
  146. package/lib/utils/config.js +1 -1
  147. package/lib/utils/copy-directory.js +1 -1
  148. package/lib/utils/file-utils.js +1 -1
  149. package/lib/utils/guides-cdn.js +1 -1
  150. package/lib/utils/http-client.js +1 -1
  151. package/lib/utils/is-non-interactive.js +1 -1
  152. package/lib/utils/logger.js +1 -1
  153. package/lib/utils/platform.js +1 -1
  154. package/lib/utils/rules-cdn.js +1 -1
  155. package/lib/utils/sleep.js +1 -1
  156. package/lib/utils/template-replacer.js +1 -1
  157. package/lib/utils/version.js +1 -1
  158. package/lib/utils/with-active-cookie.js +1 -1
  159. package/lib/utils/write-cli-side-channel.js +1 -1
  160. package/package.json +3 -2
  161. package/lib/commands/api/doc.js +0 -1
  162. package/lib/commands/app/remote.js +0 -1
@@ -1 +1 @@
1
- const a19_0x570dde=a19_0x3ee5;(function(_0x231236,_0x573c98){const _0x1771ad=a19_0x3ee5,_0x2bcd53=_0x231236();while(!![]){try{const _0x352c47=-parseInt(_0x1771ad(0xc4))/0x1*(-parseInt(_0x1771ad(0xb5))/0x2)+-parseInt(_0x1771ad(0xbc))/0x3+parseInt(_0x1771ad(0xc0))/0x4*(-parseInt(_0x1771ad(0x97))/0x5)+parseInt(_0x1771ad(0xb4))/0x6+parseInt(_0x1771ad(0xb1))/0x7*(parseInt(_0x1771ad(0x9b))/0x8)+-parseInt(_0x1771ad(0x9d))/0x9+parseInt(_0x1771ad(0xa4))/0xa*(parseInt(_0x1771ad(0x9f))/0xb);if(_0x352c47===_0x573c98)break;else _0x2bcd53['push'](_0x2bcd53['shift']());}catch(_0x2e0ff7){_0x2bcd53['push'](_0x2bcd53['shift']());}}}(a19_0x2a71,0x1b716));import{readRawConfigWithLayers}from'../../context.js';function a19_0x2a71(){const _0x5207b2=['project','1369044DntNVh','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','200959CGbQaG','globalConfig','object','length','merged','150jfEBUx','\x20config','boolean','map','app','entries','env','read','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','keys','projectPath','apps','find','7CGZiFT','riskLevel','appcode','342222wbQLBd','4856zfAJrJ','locale','pageSize','cookie','format','projectConfig','global','281664hVbvmq','apiDir','globalPath','.\x20Use\x20`','4inHlJm','List\x20all\x20configured\x20apps','No\x20apps\x20configured','list','23bxNprI','inherit','204285rqALjL','accessKey','push','bool','98808BDewOA'];a19_0x2a71=function(){return _0x5207b2;};return a19_0x2a71();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{appDefinedIn,resolveDefaultAppSource}from'../../commands/app/shared.js';function buildItemsFromLayer(_0x1e9456,_0x58c436){const _0x81c5e9=a19_0x3ee5,_0x26859f=[],_0x17cd10=_0x1e9456[_0x81c5e9(0xaf)]&&typeof _0x1e9456[_0x81c5e9(0xaf)]===_0x81c5e9(0xa1)?_0x1e9456[_0x81c5e9(0xaf)]:{},_0x40f52d=_0x1e9456['defaultApp']||undefined;for(const [_0x530bf0,_0x268f3a]of Object[_0x81c5e9(0xa9)](_0x17cd10)){if(!_0x268f3a||typeof _0x268f3a!==_0x81c5e9(0xa1)||!_0x268f3a[_0x81c5e9(0xb3)])continue;_0x26859f['push']({'name':_0x530bf0,'appcode':_0x268f3a[_0x81c5e9(0xb3)],'named':!![],'definedIn':_0x58c436,'isDefault':_0x530bf0===_0x40f52d,'env':_0x268f3a[_0x81c5e9(0xaa)]??null,'apiDir':_0x268f3a[_0x81c5e9(0xbd)]??null,'hasCookie':!!_0x268f3a[_0x81c5e9(0xb8)],'hasAccessKey':!!_0x268f3a[_0x81c5e9(0x98)],'format':_0x268f3a[_0x81c5e9(0xb9)]??null,'pageSize':_0x268f3a[_0x81c5e9(0xb7)]??null,'riskLevel':_0x268f3a[_0x81c5e9(0xb2)]??null,'locale':_0x268f3a[_0x81c5e9(0xb6)]??null});}const _0xf5381d=Object['keys'](_0x17cd10)['length']>0x0,_0x54ae11=_0x1e9456[_0x81c5e9(0xb3)]||_0x1e9456[_0x81c5e9(0xa8)];return _0x54ae11&&!_0xf5381d&&_0x26859f['push']({'name':null,'appcode':String(_0x54ae11),'named':![],'definedIn':_0x58c436,'isDefault':![],'env':_0x1e9456[_0x81c5e9(0xaa)]??null,'apiDir':_0x1e9456[_0x81c5e9(0xbd)]??null,'hasCookie':!!_0x1e9456[_0x81c5e9(0xb8)],'hasAccessKey':!!_0x1e9456['accessKey'],'format':_0x1e9456[_0x81c5e9(0xb9)]??null,'pageSize':_0x1e9456[_0x81c5e9(0xb7)]??null,'riskLevel':_0x1e9456[_0x81c5e9(0xb2)]??null,'locale':_0x1e9456[_0x81c5e9(0xb6)]??null}),_0x26859f;}function buildMergedItems(_0x398d50,_0x4fbd13){const _0x109794=a19_0x3ee5,{apps:apps={},defaultApp:_0x326d27,currentApp:_0x567007}=_0x398d50,_0x220c83=_0x4fbd13[_0x109794(0xa0)][_0x109794(0xaf)]&&typeof _0x4fbd13[_0x109794(0xa0)][_0x109794(0xaf)]===_0x109794(0xa1)?_0x4fbd13[_0x109794(0xa0)][_0x109794(0xaf)]:{},_0x472afd=_0x4fbd13[_0x109794(0xba)][_0x109794(0xaf)]&&typeof _0x4fbd13['projectConfig'][_0x109794(0xaf)]==='object'?_0x4fbd13['projectConfig']['apps']:{},_0x57d711=_0x4fbd13[_0x109794(0xba)][_0x109794(0xc5)]===![],_0x1a565e=Object[_0x109794(0xa9)](apps),_0x13b7f1=_0x1a565e[_0x109794(0xa7)](([_0x167b1f,_0x214e13])=>({'name':_0x167b1f,'appcode':_0x214e13[_0x109794(0xb3)],'named':!![],'definedIn':appDefinedIn(_0x167b1f,_0x220c83,_0x472afd,_0x57d711),'isDefault':_0x167b1f===_0x326d27,'isCurrent':_0x167b1f===(_0x567007??_0x326d27),'env':_0x214e13[_0x109794(0xaa)]??null,'apiDir':_0x214e13[_0x109794(0xbd)]??null,'hasCookie':!!_0x214e13[_0x109794(0xb8)],'hasAccessKey':!!_0x214e13[_0x109794(0x98)],'format':_0x214e13[_0x109794(0xb9)]??null,'pageSize':_0x214e13[_0x109794(0xb7)]??null,'riskLevel':_0x214e13[_0x109794(0xb2)]??null,'locale':_0x214e13[_0x109794(0xb6)]??null})),_0x3f59d2=(_0x4fbd13[_0x109794(0xba)][_0x109794(0xb3)]||_0x4fbd13[_0x109794(0xba)][_0x109794(0xa8)])&&(!_0x4fbd13[_0x109794(0xba)][_0x109794(0xaf)]||Object[_0x109794(0xad)](_0x4fbd13[_0x109794(0xba)][_0x109794(0xaf)])[_0x109794(0xa2)]===0x0)?String(_0x4fbd13['projectConfig'][_0x109794(0xb3)]||_0x4fbd13[_0x109794(0xba)][_0x109794(0xa8)]):undefined,_0x3a6248=(_0x4fbd13['globalConfig'][_0x109794(0xb3)]||_0x4fbd13[_0x109794(0xa0)][_0x109794(0xa8)])&&(!_0x4fbd13[_0x109794(0xa0)]['apps']||Object[_0x109794(0xad)](_0x4fbd13[_0x109794(0xa0)][_0x109794(0xaf)])[_0x109794(0xa2)]===0x0)?String(_0x4fbd13[_0x109794(0xa0)][_0x109794(0xb3)]||_0x4fbd13[_0x109794(0xa0)][_0x109794(0xa8)]):undefined;if(_0x3f59d2)_0x13b7f1[_0x109794(0x99)]({'name':null,'appcode':_0x3f59d2,'named':![],'definedIn':_0x109794(0x9c),'isDefault':![],'isCurrent':!_0x326d27,'env':_0x4fbd13['projectConfig']['env']??null,'apiDir':_0x4fbd13[_0x109794(0xba)][_0x109794(0xbd)]??null,'hasCookie':!!_0x4fbd13[_0x109794(0xba)]['cookie'],'hasAccessKey':!!_0x4fbd13[_0x109794(0xba)]['accessKey'],'format':_0x4fbd13[_0x109794(0xba)][_0x109794(0xb9)]??null,'pageSize':_0x4fbd13['projectConfig']['pageSize']??null,'riskLevel':_0x4fbd13['projectConfig'][_0x109794(0xb2)]??null,'locale':_0x4fbd13[_0x109794(0xba)][_0x109794(0xb6)]??null});else _0x3a6248&&_0x1a565e[_0x109794(0xa2)]===0x0&&_0x13b7f1[_0x109794(0x99)]({'name':null,'appcode':_0x3a6248,'named':![],'definedIn':'global','isDefault':![],'isCurrent':!_0x326d27,'env':_0x4fbd13[_0x109794(0xa0)][_0x109794(0xaa)]??null,'apiDir':_0x4fbd13['globalConfig'][_0x109794(0xbd)]??null,'hasCookie':!!_0x4fbd13[_0x109794(0xa0)][_0x109794(0xb8)],'hasAccessKey':!!_0x4fbd13['globalConfig'][_0x109794(0x98)],'format':_0x4fbd13[_0x109794(0xa0)][_0x109794(0xb9)]??null,'pageSize':_0x4fbd13[_0x109794(0xa0)][_0x109794(0xb7)]??null,'riskLevel':_0x4fbd13[_0x109794(0xa0)][_0x109794(0xb2)]??null,'locale':_0x4fbd13[_0x109794(0xa0)][_0x109794(0xb6)]??null});return _0x13b7f1;}function a19_0x3ee5(_0x5b755f,_0x311f0d){_0x5b755f=_0x5b755f-0x97;const _0x2a7146=a19_0x2a71();let _0x3ee546=_0x2a7146[_0x5b755f];return _0x3ee546;}async function execute(_0x5d9932){const _0x126950=a19_0x3ee5,_0x3a08b8=_0x5d9932[_0x126950(0x9a)]('global'),_0xd76da8=_0x5d9932[_0x126950(0x9a)](_0x126950(0x9c)),_0x582844=_0x3a08b8?_0x126950(0xbb):_0xd76da8?_0x126950(0x9c):_0x126950(0xa3),{config:_0x25fd61,layers:_0x3f4672}=readRawConfigWithLayers(),_0x49161e=resolveDefaultAppSource(_0x3f4672),{defaultApp:_0x53505d}=_0x25fd61;let _0x1795e3,_0x3ca40c;switch(_0x582844){case'global':_0x1795e3=buildItemsFromLayer(_0x3f4672[_0x126950(0xa0)],'global'),_0x3ca40c=_0x3f4672['globalPath'];break;case _0x126950(0x9c):_0x1795e3=buildItemsFromLayer(_0x3f4672[_0x126950(0xba)],_0x126950(0x9c)),_0x3ca40c=_0x3f4672[_0x126950(0xae)];break;default:_0x1795e3=buildMergedItems(_0x25fd61,_0x3f4672);break;}if(_0x1795e3[_0x126950(0xa2)]===0x0){const _0x26595b=_0x582844===_0x126950(0xa3)?'':'\x20in\x20'+_0x582844+_0x126950(0xa5);return{'ok':!![],'data':[],'message':_0x126950(0xc2)+_0x26595b+_0x126950(0xbf)+CLI_BIN_NAME+_0x126950(0xac)};}const _0x2fb104=_0x1795e3[_0x126950(0xb0)](_0x55d110=>_0x55d110['isCurrent']===!![]),_0x349658=_0x53505d??_0x2fb104?.[_0x126950(0xb3)]??null,_0x384f3b=_0x582844===_0x126950(0xa3)?{'globalPath':_0x3f4672[_0x126950(0xbe)]??null,'projectPath':_0x3f4672['projectPath']??null,'defaultApp':_0x349658,'defaultAppSource':_0x53505d!=null?_0x49161e:null}:{'scope':_0x582844,'configPath':_0x3ca40c??null};return{'ok':!![],'data':{'items':_0x1795e3,'meta':_0x384f3b}};}export const appListDefinition={'service':a19_0x570dde(0xa8),'command':a19_0x570dde(0xc3),'description':a19_0x570dde(0xc1),'risk':a19_0x570dde(0xab),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x570dde(0xbb),'type':'boolean','description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a19_0x570dde(0x9c),'type':a19_0x570dde(0xa6),'description':a19_0x570dde(0x9e),'default':![]}],'execute':execute};
1
+ const a21_0x2976d4=a21_0x5a4f;(function(_0x33423f,_0x1e3768){const _0x48cda9=a21_0x5a4f,_0x127e0d=_0x33423f();while(!![]){try{const _0x49cc1c=-parseInt(_0x48cda9(0xd8))/0x1*(-parseInt(_0x48cda9(0xde))/0x2)+parseInt(_0x48cda9(0xd6))/0x3*(-parseInt(_0x48cda9(0xcc))/0x4)+-parseInt(_0x48cda9(0xe8))/0x5+parseInt(_0x48cda9(0xd5))/0x6+parseInt(_0x48cda9(0xc6))/0x7*(-parseInt(_0x48cda9(0xca))/0x8)+-parseInt(_0x48cda9(0xc9))/0x9*(-parseInt(_0x48cda9(0xcf))/0xa)+parseInt(_0x48cda9(0xe0))/0xb;if(_0x49cc1c===_0x1e3768)break;else _0x127e0d['push'](_0x127e0d['shift']());}catch(_0x84ebd){_0x127e0d['push'](_0x127e0d['shift']());}}}(a21_0x1117,0x91fb1));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{buildAppProfileListFields}from'../../config/schema.js';import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';function buildItemsFromLayer(_0x5dda43,_0x3b5f6b){const _0x5d6290=a21_0x5a4f,_0x4311c8=[],_0x3829bc=_0x5dda43[_0x5d6290(0xd0)]&&typeof _0x5dda43['apps']===_0x5d6290(0xdc)?_0x5dda43[_0x5d6290(0xd0)]:{},_0x387104=_0x5dda43[_0x5d6290(0xd2)]||undefined;for(const [_0x3a6844,_0x367433]of Object['entries'](_0x3829bc)){if(!_0x367433||typeof _0x367433!=='object'||!_0x367433[_0x5d6290(0xc5)])continue;_0x4311c8[_0x5d6290(0xdd)]({'name':_0x3a6844,'appcode':_0x367433[_0x5d6290(0xc5)],'named':!![],'definedIn':_0x3b5f6b,'isDefault':_0x3a6844===_0x387104,...buildAppProfileListFields(_0x367433)});}return _0x4311c8;}function a21_0x5a4f(_0x21743f,_0x4ee2b3){_0x21743f=_0x21743f-0xc5;const _0x111733=a21_0x1117();let _0x5a4ff2=_0x111733[_0x21743f];return _0x5a4ff2;}function a21_0x1117(){const _0x58fb3b=['Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','3988488bzfgEX','15QtNTJh','projectPath','17vbAVmG','mergedCli','list','globalConfig','object','push','44174AczMXg','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','10872444Ylcpsz','\x20in\x20','\x20config','bool','.\x20Use\x20`','project','inherit','globalPath','2525170dtkHmd','projectConfig','appcode','5683538lPkolX','No\x20apps\x20configured','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','31059MDAgBS','8eiZouW','merged','640380ZFwjEC','read','boolean','1990QszaFk','apps','global','defaultApp','length'];a21_0x1117=function(){return _0x58fb3b;};return a21_0x1117();}function buildMergedItems(_0x2e5fcc,_0x117945){const _0x53e4b4=a21_0x5a4f,{apps:apps={},defaultApp:_0x138a21}=_0x2e5fcc,_0x11b0cd=_0x117945[_0x53e4b4(0xdb)]['apps']&&typeof _0x117945[_0x53e4b4(0xdb)][_0x53e4b4(0xd0)]===_0x53e4b4(0xdc)?_0x117945['globalConfig'][_0x53e4b4(0xd0)]:{},_0x3291db=_0x117945[_0x53e4b4(0xe9)]['apps']&&typeof _0x117945[_0x53e4b4(0xe9)][_0x53e4b4(0xd0)]===_0x53e4b4(0xdc)?_0x117945['projectConfig']['apps']:{},_0xfb6b78=_0x117945[_0x53e4b4(0xe9)][_0x53e4b4(0xe6)]===![],_0x4de258=Object['entries'](apps),_0x5afbae=_0x4de258['map'](([_0x53ee88,_0x37fcf0])=>({'name':_0x53ee88,'appcode':_0x37fcf0[_0x53e4b4(0xc5)],'named':!![],'definedIn':appDefinedIn(_0x53ee88,_0x11b0cd,_0x3291db,_0xfb6b78),'isDefault':_0x53ee88===_0x138a21,...buildAppProfileListFields(_0x37fcf0)}));return _0x5afbae;}async function execute(_0x4bafc4){const _0x1a4046=a21_0x5a4f,_0x3d991c=_0x4bafc4[_0x1a4046(0xe3)](_0x1a4046(0xd1)),_0x3e015d=_0x4bafc4[_0x1a4046(0xe3)](_0x1a4046(0xe5)),_0x4ddc13=_0x3d991c?'global':_0x3e015d?'project':_0x1a4046(0xcb),{config:_0x12c4c9,layers:_0x1f05a1}=readRawConfigWithLayers(),_0x487edc=resolveDefaultAppSource(_0x1f05a1),{defaultApp:_0xe43d90}=_0x12c4c9;let _0x56551b,_0x215de9;switch(_0x4ddc13){case'global':_0x56551b=buildItemsFromLayer(_0x1f05a1[_0x1a4046(0xdb)],_0x1a4046(0xd1)),_0x215de9=_0x1f05a1[_0x1a4046(0xe7)];break;case _0x1a4046(0xe5):_0x56551b=buildItemsFromLayer(_0x1f05a1['projectConfig'],_0x1a4046(0xe5)),_0x215de9=_0x1f05a1[_0x1a4046(0xd7)];break;default:_0x56551b=buildMergedItems(_0x12c4c9,_0x1f05a1);break;}enrichAppListItemsWithMergedSelection(_0x56551b,_0x4bafc4[_0x1a4046(0xd9)]);if(_0x56551b[_0x1a4046(0xd3)]===0x0){const _0x377b0d=_0x4ddc13==='merged'?'':_0x1a4046(0xe1)+_0x4ddc13+_0x1a4046(0xe2);return{'ok':!![],'data':[],'message':_0x1a4046(0xc7)+_0x377b0d+_0x1a4046(0xe4)+CLI_BIN_NAME+_0x1a4046(0xc8)};}const _0x26f03b=_0x56551b['find'](_0x457dea=>_0x457dea['isCurrent']===!![]),_0x5792d0=_0xe43d90??_0x26f03b?.['appcode']??null,_0x5c2e38=_0x4ddc13===_0x1a4046(0xcb)?{'globalPath':_0x1f05a1[_0x1a4046(0xe7)]??null,'projectPath':_0x1f05a1[_0x1a4046(0xd7)]??null,'defaultApp':_0x5792d0,'defaultAppSource':_0xe43d90!=null?_0x487edc:null}:{'scope':_0x4ddc13,'configPath':_0x215de9??null};return{'ok':!![],'data':{'items':_0x56551b,'meta':_0x5c2e38}};}export const appListDefinition={'service':'app','command':a21_0x2976d4(0xda),'description':'List\x20all\x20configured\x20apps','risk':a21_0x2976d4(0xcd),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x2976d4(0xd1),'type':a21_0x2976d4(0xce),'description':a21_0x2976d4(0xdf),'default':![]},{'name':a21_0x2976d4(0xe5),'type':a21_0x2976d4(0xce),'description':a21_0x2976d4(0xd4),'default':![]}],'execute':execute};
@@ -1 +1 @@
1
- const a21_0x50d527=a21_0x14ed;(function(_0x29f45e,_0x4b820d){const _0x1a1576=a21_0x14ed,_0x2b33da=_0x29f45e();while(!![]){try{const _0x377162=-parseInt(_0x1a1576(0x163))/0x1*(parseInt(_0x1a1576(0x154))/0x2)+parseInt(_0x1a1576(0x14e))/0x3*(-parseInt(_0x1a1576(0x14d))/0x4)+-parseInt(_0x1a1576(0x152))/0x5*(parseInt(_0x1a1576(0x151))/0x6)+-parseInt(_0x1a1576(0x16c))/0x7+-parseInt(_0x1a1576(0x159))/0x8+parseInt(_0x1a1576(0x148))/0x9*(parseInt(_0x1a1576(0x14f))/0xa)+parseInt(_0x1a1576(0x158))/0xb*(parseInt(_0x1a1576(0x162))/0xc);if(_0x377162===_0x4b820d)break;else _0x2b33da['push'](_0x2b33da['shift']());}catch(_0x474849){_0x2b33da['push'](_0x2b33da['shift']());}}}(a21_0x466d,0x6488c));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a21_0x14ed(_0x56c04e,_0x70c93e){_0x56c04e=_0x56c04e-0x147;const _0x466d3f=a21_0x466d();let _0x14ed9b=_0x466d3f[_0x56c04e];return _0x14ed9b;}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x4d8a15){const _0x249d48=a21_0x14ed,_0x1f102a=_0x4d8a15[_0x249d48(0x168)][0x0]?.[_0x249d48(0x15d)]();if(!_0x1f102a)throw CliErrors['validation'](_0x249d48(0x157),_0x249d48(0x156)+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');}async function execute(_0x4d2d30){const _0x24e18e=a21_0x14ed,_0x31f1e9=_0x4d2d30[_0x24e18e(0x168)][0x0]?.[_0x24e18e(0x15d)]();if(!_0x31f1e9)throw CliErrors[_0x24e18e(0x16d)](_0x24e18e(0x157),'Usage:\x20'+CLI_BIN_NAME+_0x24e18e(0x16a));const _0x38ecf7=_0x4d2d30[_0x24e18e(0x153)](_0x24e18e(0x147)),{config:_0x4a1579,layers:_0x133ca5}=readRawConfigWithLayers(),_0x549e61=_0x4a1579[_0x24e18e(0x14c)]??{};if(!_0x549e61[_0x31f1e9])throw CliErrors[_0x24e18e(0x16d)](_0x24e18e(0x161)+_0x31f1e9+_0x24e18e(0x15c));const _0x255cdd=_0x133ca5[_0x24e18e(0x149)][_0x24e18e(0x14c)]&&typeof _0x133ca5[_0x24e18e(0x149)][_0x24e18e(0x14c)]===_0x24e18e(0x14a)?_0x133ca5['globalConfig'][_0x24e18e(0x14c)]:{},_0x384472=_0x133ca5['projectConfig'][_0x24e18e(0x14c)]&&typeof _0x133ca5[_0x24e18e(0x15f)][_0x24e18e(0x14c)]===_0x24e18e(0x14a)?_0x133ca5['projectConfig']['apps']:{},_0x4483db=appDefinedIn(_0x31f1e9,_0x255cdd,_0x384472,_0x133ca5[_0x24e18e(0x15f)][_0x24e18e(0x15b)]===![]),_0x39f679=resolveAppScopeForWrite(_0x31f1e9,_0x38ecf7,_0x133ca5),_0x5c3439={'global':_0x39f679==='global'},_0x288567=readConfig(_0x5c3439),_0x4ef6ae=_0x288567[_0x24e18e(0x14c)];if(!_0x4ef6ae||!_0x4ef6ae[_0x31f1e9])throw CliErrors[_0x24e18e(0x16d)](_0x24e18e(0x161)+_0x31f1e9+_0x24e18e(0x15c));delete _0x4ef6ae[_0x31f1e9];let _0x21e426='';if(_0x288567[_0x24e18e(0x15e)]===_0x31f1e9){const _0x3a6979=Object[_0x24e18e(0x164)](_0x4ef6ae);_0x288567[_0x24e18e(0x15e)]=_0x3a6979['length']>0x0?_0x3a6979[0x0]:undefined,_0x288567[_0x24e18e(0x15e)]?_0x21e426=_0x24e18e(0x16b)+_0x288567[_0x24e18e(0x15e)]+'\x22.':delete _0x288567['defaultApp'];}Object[_0x24e18e(0x164)](_0x4ef6ae)[_0x24e18e(0x14b)]===0x0&&(delete _0x288567[_0x24e18e(0x14c)],delete _0x288567[_0x24e18e(0x15e)]);writeConfig(_0x288567,_0x5c3439);const _0x502f90=_0x4483db==='both'?_0x24e18e(0x155)+_0x31f1e9+_0x24e18e(0x150)+(_0x39f679===_0x24e18e(0x166)?_0x24e18e(0x147):_0x24e18e(0x166))+'\x20config.':'';return{'ok':!![],'message':_0x24e18e(0x16e)+_0x31f1e9+'\x22'+scopeLabel(_0x5c3439)+'.'+_0x21e426+_0x502f90};}function a21_0x466d(){const _0x58abf1=['globalConfig','object','length','apps','4BQSnhh','897378YuwZMB','10RZMoEW','\x22\x20still\x20defined\x20in\x20','18SNGmlb','275395xXxTga','bool','609686TPlEhI','\x20Note:\x20app\x20\x22','Usage:\x20','Missing\x20app\x20name.','44wwoYns','6065432ZPRPZN','Use\x20global\x20config\x20scope','inherit','\x22\x20not\x20found.','trim','defaultApp','projectConfig','high-risk-write','App\x20\x22','7435272UsVuEO','1uaFdRe','keys','Remove\x20an\x20app\x20from\x20config','project','remove','args','boolean','\x20app\x20remove\x20<name>\x20[--global]','\x20Default\x20app\x20changed\x20to\x20\x22','3842244AiLqCi','validation','Removed\x20app\x20\x22','global','86769FFALww'];a21_0x466d=function(){return _0x58abf1;};return a21_0x466d();}export const appRemoveDefinition={'service':'app','command':a21_0x50d527(0x167),'description':a21_0x50d527(0x165),'risk':a21_0x50d527(0x160),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':[{'name':a21_0x50d527(0x147),'type':a21_0x50d527(0x169),'description':a21_0x50d527(0x15a),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a22_0x4e8c54=a22_0x2261;function a22_0xbc79(){const _0x1de115=['bool','\x20app\x20remove\x20<name>\x20[--global]','boolean','high-risk-write','\x20Default\x20app\x20changed\x20to\x20\x22','1097614ovjsJr','Removed\x20app\x20\x22','length','Usage:\x20','App\x20\x22','17310aHeVeN','684CGKeoL','globalConfig','1749736Eclslk','\x20Note:\x20app\x20\x22','app','defaultApp','apps','trim','App\x20profile\x20name\x20to\x20remove','Use\x20global\x20config\x20scope','project','14DdQIfk','\x22\x20not\x20found.','Remove\x20an\x20app\x20from\x20config','remove','\x20config.','args','object','projectConfig','188320ClYvjv','global','keys','validation','387GkHmLE','108SUIPhF','924459qHDVkI','20482935WkFWrv','Missing\x20app\x20name.','51492GtMCyS'];a22_0xbc79=function(){return _0x1de115;};return a22_0xbc79();}(function(_0x2403a6,_0x43c34d){const _0x434cb2=a22_0x2261,_0x59e150=_0x2403a6();while(!![]){try{const _0x578fd0=parseInt(_0x434cb2(0x13b))/0x1+-parseInt(_0x434cb2(0x144))/0x2+parseInt(_0x434cb2(0x13a))/0x3*(parseInt(_0x434cb2(0x13e))/0x4)+parseInt(_0x434cb2(0x149))/0x5*(parseInt(_0x434cb2(0x14a))/0x6)+parseInt(_0x434cb2(0x12d))/0x7*(parseInt(_0x434cb2(0x14c))/0x8)+parseInt(_0x434cb2(0x139))/0x9*(parseInt(_0x434cb2(0x135))/0xa)+-parseInt(_0x434cb2(0x13c))/0xb;if(_0x578fd0===_0x43c34d)break;else _0x59e150['push'](_0x59e150['shift']());}catch(_0x37388c){_0x59e150['push'](_0x59e150['shift']());}}}(a22_0xbc79,0x97179));import{CliErrors}from'../../errors.js';function a22_0x2261(_0x48ec35,_0x36b6e6){_0x48ec35=_0x48ec35-0x12d;const _0xbc7932=a22_0xbc79();let _0x2261a7=_0xbc7932[_0x48ec35];return _0x2261a7;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x4e921e){const _0x32a283=a22_0x2261,_0x4e218b=_0x4e921e['args'][0x0]?.['trim']();if(!_0x4e218b)throw CliErrors[_0x32a283(0x138)](_0x32a283(0x13d),_0x32a283(0x147)+CLI_BIN_NAME+_0x32a283(0x140));}async function execute(_0x108202){const _0x1d2140=a22_0x2261,_0x5a0ec3=_0x108202[_0x1d2140(0x132)][0x0]?.[_0x1d2140(0x151)]();if(!_0x5a0ec3)throw CliErrors[_0x1d2140(0x138)]('Missing\x20app\x20name.',_0x1d2140(0x147)+CLI_BIN_NAME+_0x1d2140(0x140));const _0x18bfc9=_0x108202[_0x1d2140(0x13f)]('global'),{config:_0x3b66fa,layers:_0x5c30cc}=readRawConfigWithLayers(),_0x8626bc=_0x3b66fa[_0x1d2140(0x150)]??{};if(!_0x8626bc[_0x5a0ec3])throw CliErrors['validation']('App\x20\x22'+_0x5a0ec3+_0x1d2140(0x12e));const _0x1e67c7=_0x5c30cc['globalConfig'][_0x1d2140(0x150)]&&typeof _0x5c30cc[_0x1d2140(0x14b)][_0x1d2140(0x150)]==='object'?_0x5c30cc[_0x1d2140(0x14b)]['apps']:{},_0x23dba4=_0x5c30cc[_0x1d2140(0x134)]['apps']&&typeof _0x5c30cc[_0x1d2140(0x134)][_0x1d2140(0x150)]===_0x1d2140(0x133)?_0x5c30cc[_0x1d2140(0x134)][_0x1d2140(0x150)]:{},_0x4d1cac=appDefinedIn(_0x5a0ec3,_0x1e67c7,_0x23dba4,_0x5c30cc[_0x1d2140(0x134)]['inherit']===![]),_0x470378=resolveAppScopeForWrite(_0x5a0ec3,_0x18bfc9,_0x5c30cc),_0x549142={'global':_0x470378===_0x1d2140(0x136)},_0x308374=readConfig(_0x549142),_0xa5acb6=_0x308374['apps'];if(!_0xa5acb6||!_0xa5acb6[_0x5a0ec3])throw CliErrors[_0x1d2140(0x138)](_0x1d2140(0x148)+_0x5a0ec3+_0x1d2140(0x12e));delete _0xa5acb6[_0x5a0ec3];let _0x559b37='';if(_0x308374[_0x1d2140(0x14f)]===_0x5a0ec3){const _0x4728a6=Object[_0x1d2140(0x137)](_0xa5acb6);_0x308374['defaultApp']=_0x4728a6[_0x1d2140(0x146)]>0x0?_0x4728a6[0x0]:undefined,_0x308374[_0x1d2140(0x14f)]?_0x559b37=_0x1d2140(0x143)+_0x308374[_0x1d2140(0x14f)]+'\x22.':delete _0x308374[_0x1d2140(0x14f)];}Object[_0x1d2140(0x137)](_0xa5acb6)[_0x1d2140(0x146)]===0x0&&(delete _0x308374['apps'],delete _0x308374['defaultApp']);writeConfig(_0x308374,_0x549142);const _0x1520a5=_0x4d1cac==='both'?_0x1d2140(0x14d)+_0x5a0ec3+'\x22\x20still\x20defined\x20in\x20'+(_0x470378===_0x1d2140(0x154)?'global':_0x1d2140(0x154))+_0x1d2140(0x131):'';return{'ok':!![],'message':_0x1d2140(0x145)+_0x5a0ec3+'\x22'+scopeLabel(_0x549142)+'.'+_0x559b37+_0x1520a5};}export const appRemoveDefinition={'service':a22_0x4e8c54(0x14e),'command':a22_0x4e8c54(0x130),'description':a22_0x4e8c54(0x12f),'risk':a22_0x4e8c54(0x142),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a22_0x4e8c54(0x152),'required':!![]}],'flags':[{'name':a22_0x4e8c54(0x136),'type':a22_0x4e8c54(0x141),'description':a22_0x4e8c54(0x153),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- function a22_0x4008(_0x16ecb7,_0x2b2c59){_0x16ecb7=_0x16ecb7-0x6e;const _0x523b82=a22_0x523b();let _0x40082e=_0x523b82[_0x16ecb7];return _0x40082e;}(function(_0x504d47,_0x3abedf){const _0x3d3e13=a22_0x4008,_0x47f984=_0x504d47();while(!![]){try{const _0x10458b=parseInt(_0x3d3e13(0x6e))/0x1+parseInt(_0x3d3e13(0x7a))/0x2+parseInt(_0x3d3e13(0x7d))/0x3*(parseInt(_0x3d3e13(0x73))/0x4)+parseInt(_0x3d3e13(0x79))/0x5*(parseInt(_0x3d3e13(0x87))/0x6)+parseInt(_0x3d3e13(0x8d))/0x7+-parseInt(_0x3d3e13(0x7b))/0x8+-parseInt(_0x3d3e13(0x8e))/0x9*(parseInt(_0x3d3e13(0x75))/0xa);if(_0x10458b===_0x3abedf)break;else _0x47f984['push'](_0x47f984['shift']());}catch(_0x40915a){_0x47f984['push'](_0x47f984['shift']());}}}(a22_0x523b,0x1df7a));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function resolveAppScopeForWrite(_0x11be79,_0x5e5eae,_0x40fea4){const _0x1015de=a22_0x4008;if(_0x5e5eae)return _0x1015de(0x89);const _0x4afa80=_0x40fea4[_0x1015de(0x71)]['apps']&&typeof _0x40fea4[_0x1015de(0x71)][_0x1015de(0x78)]===_0x1015de(0x81)?_0x40fea4[_0x1015de(0x71)][_0x1015de(0x78)]:{},_0x23fe73=_0x40fea4[_0x1015de(0x8a)][_0x1015de(0x78)]&&typeof _0x40fea4['globalConfig'][_0x1015de(0x78)]===_0x1015de(0x81)?_0x40fea4[_0x1015de(0x8a)][_0x1015de(0x78)]:{};if(Object[_0x1015de(0x72)][_0x1015de(0x7e)]['call'](_0x4afa80,_0x11be79))return _0x1015de(0x8c);if(Object[_0x1015de(0x72)][_0x1015de(0x7e)][_0x1015de(0x8b)](_0x23fe73,_0x11be79))return'global';return _0x1015de(0x8c);}export function appDefinedIn(_0x210a9c,_0x181e0d,_0x57f208,_0x2d9181){const _0x4b5c52=a22_0x4008;if(_0x2d9181)return Object[_0x4b5c52(0x72)]['hasOwnProperty'][_0x4b5c52(0x8b)](_0x57f208,_0x210a9c)?_0x4b5c52(0x8c):'global';const _0x53fcdc=Object['prototype'][_0x4b5c52(0x7e)][_0x4b5c52(0x8b)](_0x181e0d,_0x210a9c),_0x7e1306=Object[_0x4b5c52(0x72)]['hasOwnProperty']['call'](_0x57f208,_0x210a9c);if(_0x53fcdc&&_0x7e1306)return _0x4b5c52(0x88);if(_0x7e1306)return _0x4b5c52(0x8c);return _0x4b5c52(0x89);}export function resolveDefaultAppSource(_0x36120b){const _0x4e42a7=a22_0x4008,_0x1fb838=_0x36120b[_0x4e42a7(0x71)]['apps']&&typeof _0x36120b['projectConfig'][_0x4e42a7(0x78)]===_0x4e42a7(0x81)?_0x36120b[_0x4e42a7(0x71)][_0x4e42a7(0x78)]:{};if(_0x4e42a7(0x85)in _0x36120b[_0x4e42a7(0x71)])return _0x4e42a7(0x8c);if(Object[_0x4e42a7(0x70)](_0x1fb838)['length']>0x0)return'project';if(_0x36120b[_0x4e42a7(0x71)][_0x4e42a7(0x7c)]===![])return null;if(_0x36120b[_0x4e42a7(0x8a)]['defaultApp'])return'global';return null;}export function getConfigPath(_0x5619db={}){const _0x1831eb=a22_0x4008,_0x252ada=_0x5619db[_0x1831eb(0x89)]?_0x1831eb(0x89):_0x1831eb(0x8c);return resolveWriteConfigPath(_0x252ada);}function a22_0x523b(){const _0x4e70f9=['396296Hgynlk','pageSize','520MvytCe','apiDir','format','apps','60qcfOvG','172786HoWrgZ','606344Mewemu','inherit','6VgNpPX','hasOwnProperty','riskLevel','\x20(global)','object','cookie','locale','appcode','defaultApp','app','15414vvbfHz','both','global','globalConfig','call','project','714329rqKkdg','37890ktwZyC','43kycgnj','Migrated\x20existing\x20app\x20\x22','keys','projectConfig','prototype'];a22_0x523b=function(){return _0x4e70f9;};return a22_0x523b();}export function readConfig(_0x22f6d0={}){return readConfigFile(getConfigPath(_0x22f6d0));}export function writeConfig(_0x4a6819,_0x1e9ca3={}){writeConfigFile(getConfigPath(_0x1e9ca3),_0x4a6819);}export function scopeLabel(_0x386429){const _0x234a97=a22_0x4008;return _0x386429[_0x234a97(0x89)]?_0x234a97(0x80):'';}export function migrateLegacySingleApp(_0x4293d8,_0x2a8705){const _0x24bc96=a22_0x4008,_0x29bb26=_0x4293d8[_0x24bc96(0x84)]||_0x4293d8[_0x24bc96(0x86)];if(!_0x29bb26)return undefined;const _0x2228d5=String(_0x29bb26);if(_0x2228d5===_0x2a8705)return undefined;const _0x1fc96c=['env',_0x24bc96(0x76),_0x24bc96(0x82),'accessKey',_0x24bc96(0x77),_0x24bc96(0x74),_0x24bc96(0x7f),_0x24bc96(0x83)],_0x5d2dcd={'appcode':_0x29bb26};for(const _0x11ad54 of _0x1fc96c){if(_0x4293d8[_0x11ad54]!=null)_0x5d2dcd[_0x11ad54]=_0x4293d8[_0x11ad54];}return _0x4293d8['apps'][_0x2228d5]=_0x5d2dcd,_0x4293d8[_0x24bc96(0x85)]=_0x2228d5,delete _0x4293d8['appcode'],delete _0x4293d8['app'],_0x24bc96(0x6f)+_0x2228d5+'\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).';}
1
+ (function(_0x50fcba,_0x20fc0d){const _0x1457f2=a23_0x4d6f,_0x3efbca=_0x50fcba();while(!![]){try{const _0x534879=parseInt(_0x1457f2(0xf2))/0x1*(parseInt(_0x1457f2(0xef))/0x2)+-parseInt(_0x1457f2(0xf9))/0x3+parseInt(_0x1457f2(0x106))/0x4+parseInt(_0x1457f2(0xf1))/0x5*(-parseInt(_0x1457f2(0xfc))/0x6)+parseInt(_0x1457f2(0xf6))/0x7+parseInt(_0x1457f2(0xfd))/0x8*(parseInt(_0x1457f2(0x109))/0x9)+parseInt(_0x1457f2(0x10c))/0xa*(-parseInt(_0x1457f2(0x103))/0xb);if(_0x534879===_0x20fc0d)break;else _0x3efbca['push'](_0x3efbca['shift']());}catch(_0x4e1055){_0x3efbca['push'](_0x3efbca['shift']());}}}(a23_0x2b5c,0xebff2));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x39c029,_0x24a71c){const _0xb80c9b=a23_0x4d6f;if(!_0x24a71c)return;const _0x396587=_0x24a71c[_0xb80c9b(0x10a)]&&typeof _0x24a71c[_0xb80c9b(0x10a)]===_0xb80c9b(0xf8)?_0x24a71c[_0xb80c9b(0x10a)]:{},_0x474f99=Object[_0xb80c9b(0xfa)](_0x396587)['length']>0x0;for(const _0x5bbca8 of _0x39c029){_0x5bbca8[_0xb80c9b(0xf7)]=![];}const _0x4bc62c=_0x24a71c[_0xb80c9b(0xf4)]!=null?String(_0x24a71c[_0xb80c9b(0xf4)])[_0xb80c9b(0xfe)]():'';if(_0x474f99){const _0x3aa303=_0x24a71c['currentApp']??_0x24a71c[_0xb80c9b(0x107)];if(_0x3aa303)for(const _0x4e366b of _0x39c029){_0x4e366b[_0xb80c9b(0x105)]===!![]&&_0x4e366b[_0xb80c9b(0xff)]===_0x3aa303&&(_0x4e366b[_0xb80c9b(0xf7)]=!![]);}for(const _0x3bcb18 of _0x39c029){if(_0x3bcb18[_0xb80c9b(0x105)]!==![])continue;if(_0x24a71c[_0xb80c9b(0x107)])continue;_0x4bc62c&&String(_0x3bcb18['appcode']??'')[_0xb80c9b(0xfe)]()===_0x4bc62c&&(_0x3bcb18[_0xb80c9b(0xf7)]=!![]);}return;}if(!_0x4bc62c)return;for(const _0x1021dc of _0x39c029){String(_0x1021dc[_0xb80c9b(0x108)]??'')['trim']()===_0x4bc62c&&(_0x1021dc[_0xb80c9b(0xf7)]=!![]);}}export function resolveAppScopeForWrite(_0x5a9999,_0x214dcf,_0x1f53c4){const _0x1e6879=a23_0x4d6f;if(_0x214dcf)return _0x1e6879(0xf0);const _0x594682=_0x1f53c4['projectConfig']['apps']&&typeof _0x1f53c4['projectConfig'][_0x1e6879(0x10a)]===_0x1e6879(0xf8)?_0x1f53c4[_0x1e6879(0x10b)]['apps']:{},_0x87ff34=_0x1f53c4[_0x1e6879(0x104)][_0x1e6879(0x10a)]&&typeof _0x1f53c4[_0x1e6879(0x104)]['apps']===_0x1e6879(0xf8)?_0x1f53c4[_0x1e6879(0x104)][_0x1e6879(0x10a)]:{};if(Object[_0x1e6879(0xf3)]['hasOwnProperty'][_0x1e6879(0x102)](_0x594682,_0x5a9999))return _0x1e6879(0x101);if(Object[_0x1e6879(0xf3)]['hasOwnProperty']['call'](_0x87ff34,_0x5a9999))return _0x1e6879(0xf0);return _0x1e6879(0x101);}export function appDefinedIn(_0x363342,_0x36eddf,_0x215f6e,_0x28ec76){const _0x4a0553=a23_0x4d6f;if(_0x28ec76)return Object['prototype']['hasOwnProperty'][_0x4a0553(0x102)](_0x215f6e,_0x363342)?_0x4a0553(0x101):_0x4a0553(0xf0);const _0x378bf7=Object[_0x4a0553(0xf3)][_0x4a0553(0x100)][_0x4a0553(0x102)](_0x36eddf,_0x363342),_0x5a6771=Object[_0x4a0553(0xf3)]['hasOwnProperty'][_0x4a0553(0x102)](_0x215f6e,_0x363342);if(_0x378bf7&&_0x5a6771)return'both';if(_0x5a6771)return _0x4a0553(0x101);return _0x4a0553(0xf0);}export function resolveDefaultAppSource(_0x4935f6){const _0x48b3cd=a23_0x4d6f,_0x12fd9f=_0x4935f6[_0x48b3cd(0x10b)][_0x48b3cd(0x10a)]&&typeof _0x4935f6[_0x48b3cd(0x10b)][_0x48b3cd(0x10a)]===_0x48b3cd(0xf8)?_0x4935f6[_0x48b3cd(0x10b)][_0x48b3cd(0x10a)]:{};if(_0x48b3cd(0x107)in _0x4935f6[_0x48b3cd(0x10b)])return _0x48b3cd(0x101);if(Object[_0x48b3cd(0xfa)](_0x12fd9f)[_0x48b3cd(0xf5)]>0x0)return _0x48b3cd(0x101);if(_0x4935f6[_0x48b3cd(0x10b)]['inherit']===![])return null;if(_0x4935f6[_0x48b3cd(0x104)][_0x48b3cd(0x107)])return _0x48b3cd(0xf0);return null;}export function getConfigPath(_0x3dc3ee={}){const _0x1c7e48=a23_0x4d6f,_0x25ce76=_0x3dc3ee['global']?_0x1c7e48(0xf0):_0x1c7e48(0x101);return resolveWriteConfigPath(_0x25ce76);}function a23_0x2b5c(){const _0x62f43f=['22202ZwZXCx','global','5gAaCYH','139lDXBRt','prototype','appCode','length','1473269MzjByr','isCurrent','object','5092404VzCLPA','keys','\x20(global)','2704866OJbpLo','56BeCizz','trim','name','hasOwnProperty','project','call','143gqZLsP','globalConfig','named','3466820XtgdWI','defaultApp','appcode','895311iAEzBU','apps','projectConfig','155110RavltE'];a23_0x2b5c=function(){return _0x62f43f;};return a23_0x2b5c();}export function readConfig(_0x4a0dbe={}){return readConfigFile(getConfigPath(_0x4a0dbe));}export function writeConfig(_0x235b2d,_0x22690e={}){writeConfigFile(getConfigPath(_0x22690e),_0x235b2d);}function a23_0x4d6f(_0x1a1f74,_0x4d0be3){_0x1a1f74=_0x1a1f74-0xef;const _0x2b5c=a23_0x2b5c();let _0x4d6f3a=_0x2b5c[_0x1a1f74];return _0x4d6f3a;}export function scopeLabel(_0x36bdc5){const _0x1bd363=a23_0x4d6f;return _0x36bdc5[_0x1bd363(0xf0)]?_0x1bd363(0xfb):'';}
@@ -1 +1 @@
1
- const a23_0x55addb=a23_0x490d;(function(_0x2b1cbc,_0x3cecda){const _0x55cec7=a23_0x490d,_0x49b31e=_0x2b1cbc();while(!![]){try{const _0x4ac77f=-parseInt(_0x55cec7(0x9d))/0x1*(parseInt(_0x55cec7(0x86))/0x2)+-parseInt(_0x55cec7(0x95))/0x3*(parseInt(_0x55cec7(0x99))/0x4)+parseInt(_0x55cec7(0x8e))/0x5*(parseInt(_0x55cec7(0x97))/0x6)+-parseInt(_0x55cec7(0x9e))/0x7*(parseInt(_0x55cec7(0x87))/0x8)+parseInt(_0x55cec7(0x93))/0x9*(-parseInt(_0x55cec7(0x8a))/0xa)+-parseInt(_0x55cec7(0x82))/0xb+parseInt(_0x55cec7(0x96))/0xc*(parseInt(_0x55cec7(0x92))/0xd);if(_0x4ac77f===_0x3cecda)break;else _0x49b31e['push'](_0x49b31e['shift']());}catch(_0x4bb36a){_0x49b31e['push'](_0x49b31e['shift']());}}}(a23_0x3e6e,0x7a2b7));import{CliErrors}from'../../errors.js';function a23_0x490d(_0x588da6,_0x53aae1){_0x588da6=_0x588da6-0x7d;const _0x3e6e1b=a23_0x3e6e();let _0x490db1=_0x3e6e1b[_0x588da6];return _0x490db1;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite}from'../../commands/app/shared.js';async function validateArgs(_0x201854){const _0x464798=a23_0x490d,_0x1cb13f=_0x201854[_0x464798(0x81)][0x0]?.[_0x464798(0x8c)]();if(!_0x1cb13f)throw CliErrors[_0x464798(0x88)](_0x464798(0x7e),_0x464798(0xa1)+CLI_BIN_NAME+_0x464798(0x7d));}async function execute(_0x196120){const _0x5b940c=a23_0x490d,_0x24916c=_0x196120['args'][0x0]?.[_0x5b940c(0x8c)]();if(!_0x24916c)throw CliErrors[_0x5b940c(0x88)](_0x5b940c(0x7e),'Usage:\x20'+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');const _0x58c446=_0x196120[_0x5b940c(0x8b)](_0x5b940c(0x94)),{config:_0x14cd12,layers:_0xb88cbb}=readRawConfigWithLayers(),_0x5a40fc=_0x14cd12[_0x5b940c(0x8f)]??{};if(!_0x5a40fc[_0x24916c]){const _0x33545e=Object['keys'](_0x5a40fc),_0x510c21=_0x33545e['length']===0x0?_0x5b940c(0x84)+CLI_BIN_NAME+_0x5b940c(0x9c)+_0x24916c+_0x5b940c(0x9f):_0x5b940c(0x8d)+_0x33545e[_0x5b940c(0x89)](',\x20');throw CliErrors[_0x5b940c(0x88)](_0x5b940c(0x7f)+_0x24916c+_0x5b940c(0x85),_0x510c21);}const _0x36a517=resolveAppScopeForWrite(_0x24916c,_0x58c446,_0xb88cbb),_0x5676c7={'global':_0x36a517==='global'},_0x4847b1=readConfig(_0x5676c7);return _0x4847b1['defaultApp']=_0x24916c,writeConfig(_0x4847b1,_0x5676c7),{'ok':!![],'message':_0x5b940c(0x91)+_0x24916c+'\x22\x20(appcode:\x20'+_0x5a40fc[_0x24916c]['appcode']+')'+scopeLabel(_0x5676c7)};}export const appUseDefinition={'service':a23_0x55addb(0x90),'command':'use','description':a23_0x55addb(0x9a),'risk':a23_0x55addb(0x9b),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a23_0x55addb(0x98),'description':a23_0x55addb(0xa0),'required':!![]}],'flags':[{'name':a23_0x55addb(0x94),'type':a23_0x55addb(0x83),'description':a23_0x55addb(0x80),'default':![]}],'validate':validateArgs,'execute':execute};function a23_0x3e6e(){const _0x2b59b0=['bool','trim','Available:\x20','5Ybfwhf','apps','app','Default\x20app\x20set\x20to\x20\x22','13JPpxLZ','81bgXkZq','global','2560707PJcWUP','35935452wtkWQS','2718396foioPt','name','4wcqAwF','Switch\x20the\x20default\x20app','write','\x20app\x20add\x20','34XcImzC','42jJdMft','\x20--appcode\x20<code>`\x20first.','App\x20profile\x20name\x20to\x20activate','Usage:\x20','\x20app\x20use\x20<name>\x20[--global]','Missing\x20app\x20name.','App\x20\x22','Use\x20global\x20config\x20scope','args','10674356vRsSZH','boolean','Use\x20`','\x22\x20not\x20found.','24962QOJHAY','664njkBPP','validation','join','776070dexIuw'];a23_0x3e6e=function(){return _0x2b59b0;};return a23_0x3e6e();}
1
+ const a24_0x48dda8=a24_0x2457;(function(_0x1b7b97,_0x33b061){const _0x400fc0=a24_0x2457,_0x198500=_0x1b7b97();while(!![]){try{const _0x7a07cf=parseInt(_0x400fc0(0xf7))/0x1*(-parseInt(_0x400fc0(0xcf))/0x2)+parseInt(_0x400fc0(0xe4))/0x3*(-parseInt(_0x400fc0(0xf2))/0x4)+-parseInt(_0x400fc0(0xf5))/0x5*(parseInt(_0x400fc0(0xd2))/0x6)+-parseInt(_0x400fc0(0xe1))/0x7*(parseInt(_0x400fc0(0xd1))/0x8)+-parseInt(_0x400fc0(0xeb))/0x9*(-parseInt(_0x400fc0(0xf6))/0xa)+-parseInt(_0x400fc0(0xed))/0xb+parseInt(_0x400fc0(0xf4))/0xc*(parseInt(_0x400fc0(0xdd))/0xd);if(_0x7a07cf===_0x33b061)break;else _0x198500['push'](_0x198500['shift']());}catch(_0x18abb4){_0x198500['push'](_0x198500['shift']());}}}(a24_0x1e21,0x1ed3c));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a24_0x2457(_0xe5e40d,_0xf87d2b){_0xe5e40d=_0xe5e40d-0xcb;const _0x1e21d0=a24_0x1e21();let _0x245710=_0x1e21d0[_0xe5e40d];return _0x245710;}import{readRawConfigWithLayers,isInProject}from'../../context.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x189284){const _0x55236f=a24_0x2457,_0x4d5e7a=_0x189284[_0x55236f(0xcd)][0x0]?.[_0x55236f(0xd7)]();if(!_0x4d5e7a)throw CliErrors[_0x55236f(0xd8)](_0x55236f(0xea),_0x55236f(0xee)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');}function a24_0x1e21(){const _0x35e8f9=['trim','validation','\x22\x20(appcode:\x20','app','\x22\x20not\x20found.','keys','3406Voefqq','App\x20\x22','write','apps','3269EnpySh','\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.','projectPath','449679GtDTel','\x20app\x20use\x20<name>\x20[--global]','bool','Use\x20`','appcode','global','Missing\x20app\x20name.','348021dtzbUo','join','452628ekybuL','Usage:\x20','App\x20profile\x20name\x20to\x20activate','boolean','name','4hRpAXn','Use\x20global\x20config\x20scope','9504kMmlIJ','5qleXlM','50aqNrqc','1642TzlyNB','call','\x0aNote:\x20\x22','args','projectConfig','6fGqXpQ','hasOwnProperty','792jUsBrH','194286KTSOwv','length','Switch\x20the\x20default\x20app','use','prototype'];a24_0x1e21=function(){return _0x35e8f9;};return a24_0x1e21();}async function execute(_0x3a8464){const _0x37b60d=a24_0x2457,_0x434664=_0x3a8464[_0x37b60d(0xcd)][0x0]?.[_0x37b60d(0xd7)]();if(!_0x434664)throw CliErrors[_0x37b60d(0xd8)]('Missing\x20app\x20name.',_0x37b60d(0xee)+CLI_BIN_NAME+_0x37b60d(0xe5));const _0x5d4e92=_0x3a8464[_0x37b60d(0xe6)](_0x37b60d(0xe9)),{config:_0x2827b9,layers:_0x182563}=readRawConfigWithLayers(),_0x1acb86=_0x2827b9[_0x37b60d(0xe0)]??{};if(!_0x1acb86[_0x434664]){const _0x16934d=Object[_0x37b60d(0xdc)](_0x1acb86),_0x45a4b5=_0x16934d[_0x37b60d(0xd3)]===0x0?_0x37b60d(0xe7)+CLI_BIN_NAME+'\x20app\x20add\x20'+_0x434664+'\x20--appcode\x20<code>`\x20first.':'Available:\x20'+_0x16934d[_0x37b60d(0xec)](',\x20');throw CliErrors[_0x37b60d(0xd8)](_0x37b60d(0xde)+_0x434664+_0x37b60d(0xdb),_0x45a4b5);}let _0x489dc1,_0x376db3='';if(_0x5d4e92)_0x489dc1={'global':!![]};else{const _0x4577a7=isInProject()&&!!_0x182563[_0x37b60d(0xe3)];_0x489dc1={'global':!_0x4577a7};if(_0x4577a7){const _0x54d706=_0x182563[_0x37b60d(0xce)][_0x37b60d(0xe0)]&&typeof _0x182563['projectConfig'][_0x37b60d(0xe0)]==='object'?_0x182563[_0x37b60d(0xce)][_0x37b60d(0xe0)]:{};!Object[_0x37b60d(0xd6)][_0x37b60d(0xd0)][_0x37b60d(0xcb)](_0x54d706,_0x434664)&&(_0x376db3=_0x37b60d(0xcc)+_0x434664+_0x37b60d(0xe2));}}const _0x45f0cc=readConfig(_0x489dc1);return _0x45f0cc['defaultApp']=_0x434664,writeConfig(_0x45f0cc,_0x489dc1),{'ok':!![],'message':'Default\x20app\x20set\x20to\x20\x22'+_0x434664+_0x37b60d(0xd9)+_0x1acb86[_0x434664][_0x37b60d(0xe8)]+')'+scopeLabel(_0x489dc1)+_0x376db3};}export const appUseDefinition={'service':a24_0x48dda8(0xda),'command':a24_0x48dda8(0xd5),'description':a24_0x48dda8(0xd4),'risk':a24_0x48dda8(0xdf),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a24_0x48dda8(0xf1),'description':a24_0x48dda8(0xef),'required':!![]}],'flags':[{'name':a24_0x48dda8(0xe9),'type':a24_0x48dda8(0xf0),'description':a24_0x48dda8(0xf3),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- const a24_0x23b708=a24_0x450d;(function(_0x33315b,_0x1f4a76){const _0x26a184=a24_0x450d,_0x3da849=_0x33315b();while(!![]){try{const _0x433e23=-parseInt(_0x26a184(0x179))/0x1*(parseInt(_0x26a184(0x169))/0x2)+-parseInt(_0x26a184(0x171))/0x3*(-parseInt(_0x26a184(0x175))/0x4)+parseInt(_0x26a184(0x173))/0x5+parseInt(_0x26a184(0x168))/0x6*(-parseInt(_0x26a184(0x16d))/0x7)+-parseInt(_0x26a184(0x16a))/0x8+parseInt(_0x26a184(0x16c))/0x9+-parseInt(_0x26a184(0x176))/0xa;if(_0x433e23===_0x1f4a76)break;else _0x3da849['push'](_0x3da849['shift']());}catch(_0x29bfb9){_0x3da849['push'](_0x3da849['shift']());}}}(a24_0x223f,0x5152f));import{unlinkSync,existsSync}from'node:fs';function a24_0x223f(){const _0x29ddf9=['9949OnNkrL','log','1453362VYkBWx','6tqCIWz','726912AFtkiu','read','5619213dErgYa','7VTIkym','auth','Login\x20via\x20browser','login','12tyJvHE','../../auth/auth-server-ui.js','1128750BDDXgq','!\x20Not\x20logged\x20in','474160MyNIaZ','6282260dRFdIT','Clear\x20login\x20session','✓\x20Logged\x20out'];a24_0x223f=function(){return _0x29ddf9;};return a24_0x223f();}function a24_0x450d(_0x2f1538,_0x1c915a){_0x2f1538=_0x2f1538-0x168;const _0x223f86=a24_0x223f();let _0x450dab=_0x223f86[_0x2f1538];return _0x450dab;}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a24_0x23b708(0x16e),'command':a24_0x23b708(0x170),'description':a24_0x23b708(0x16f),'risk':a24_0x23b708(0x16b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x37dde5){const _0x46ffa0=a24_0x23b708,{runAuthServer:_0x7f6671}=await import(_0x46ffa0(0x172));return await _0x7f6671(),{'ok':!![]};}},{'service':a24_0x23b708(0x16e),'command':'logout','description':a24_0x23b708(0x177),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3086a2){const _0x360e2f=a24_0x23b708;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x360e2f(0x17a)](_0x360e2f(0x178))):console[_0x360e2f(0x17a)](_0x360e2f(0x174)),{'ok':!![]};}}];
1
+ const a25_0x26d661=a25_0x28f8;function a25_0x28f8(_0x10c800,_0x533730){_0x10c800=_0x10c800-0x146;const _0x5dbade=a25_0x5dba();let _0x28f8fe=_0x5dbade[_0x10c800];return _0x28f8fe;}(function(_0x97a213,_0x297997){const _0x2d8a5f=a25_0x28f8,_0x1bb5d9=_0x97a213();while(!![]){try{const _0x1a4e8f=-parseInt(_0x2d8a5f(0x156))/0x1+-parseInt(_0x2d8a5f(0x159))/0x2*(parseInt(_0x2d8a5f(0x153))/0x3)+parseInt(_0x2d8a5f(0x148))/0x4*(parseInt(_0x2d8a5f(0x149))/0x5)+-parseInt(_0x2d8a5f(0x154))/0x6*(parseInt(_0x2d8a5f(0x14d))/0x7)+parseInt(_0x2d8a5f(0x14c))/0x8*(parseInt(_0x2d8a5f(0x157))/0x9)+-parseInt(_0x2d8a5f(0x152))/0xa*(parseInt(_0x2d8a5f(0x14a))/0xb)+parseInt(_0x2d8a5f(0x151))/0xc;if(_0x1a4e8f===_0x297997)break;else _0x1bb5d9['push'](_0x1bb5d9['shift']());}catch(_0x585982){_0x1bb5d9['push'](_0x1bb5d9['shift']());}}}(a25_0x5dba,0x8cfda));import{unlinkSync,existsSync}from'node:fs';function a25_0x5dba(){const _0x1fa09b=['218614aGGtiZ','Login\x20via\x20browser','log','Clear\x20login\x20session','1852GzaHwY','10615CvfLMV','8740996IIedZX','logout','555920wMTlnw','2877ANRffG','write','login','✓\x20Logged\x20out','6693060KgOgcq','10UQnEtg','3dMDyfy','4266Yhdetq','read','253472VJOtDX','63oHYxhC','auth'];a25_0x5dba=function(){return _0x1fa09b;};return a25_0x5dba();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a25_0x26d661(0x14f),'description':a25_0x26d661(0x15a),'risk':a25_0x26d661(0x155),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3947e9){const {runAuthServer:_0x5bbd60}=await import('../../auth/auth-server-ui.js');return await _0x5bbd60(),{'ok':!![]};}},{'service':a25_0x26d661(0x158),'command':a25_0x26d661(0x14b),'description':a25_0x26d661(0x147),'risk':a25_0x26d661(0x14e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1270b7){const _0x59a9e5=a25_0x26d661;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x59a9e5(0x150))):console[_0x59a9e5(0x146)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a25_0x4a6f8a=a25_0x1768;(function(_0x4c3da1,_0x530f46){const _0xea113=a25_0x1768,_0x2b15b5=_0x4c3da1();while(!![]){try{const _0x265aa4=parseInt(_0xea113(0xaa))/0x1*(parseInt(_0xea113(0xbc))/0x2)+parseInt(_0xea113(0xaf))/0x3*(-parseInt(_0xea113(0x9b))/0x4)+parseInt(_0xea113(0x9e))/0x5*(-parseInt(_0xea113(0xad))/0x6)+-parseInt(_0xea113(0x9c))/0x7*(-parseInt(_0xea113(0xa1))/0x8)+parseInt(_0xea113(0x9f))/0x9*(-parseInt(_0xea113(0xa5))/0xa)+parseInt(_0xea113(0xa0))/0xb+parseInt(_0xea113(0xbb))/0xc*(-parseInt(_0xea113(0xca))/0xd);if(_0x265aa4===_0x530f46)break;else _0x2b15b5['push'](_0x2b15b5['shift']());}catch(_0x448aeb){_0x2b15b5['push'](_0x2b15b5['shift']());}}}(a25_0x5482,0xa94b4));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a25_0x5482(){const _0x124085=['functions','startsWith','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','includes','692884PBPCiS','518xijlmB','trashDir','2099795bYiEVX','4849587VgZIMR','14555332CLAroc','49152IjGZFq','map','Function\x20not\x20found:\x20','high-risk-write','20xHohyl','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','\x20\x20-\x20','BFF\x20lock\x20file\x20not\x20found.','delete','1042jmFdRb','scriptsRoot','trashedTo','6zSmxlF','Multiple\x20functions\x20match\x20\x22','6upORdz','POST','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','keys','length','validation','join','split','replace','Would\x20delete\x20','str','projectRoot','12bNOsUX','1502xKyXwZ','lockFilePath','bff','appCode','scriptsRootDir','filter','\x20(local\x20file\x20moved\x20to\x20trash)','lastSync','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','No\x20lock\x20entry\x20found\x20for\x20\x22','remoteId','string','<timestamp>','find','297635HZsJeY','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'];a25_0x5482=function(){return _0x124085;};return a25_0x5482();}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a25_0x4a6f8a(0xbe),'command':a25_0x4a6f8a(0xa9),'description':a25_0x4a6f8a(0xa6),'risk':a25_0x4a6f8a(0xa4),'flags':[{'name':'target','type':a25_0x4a6f8a(0xc7),'required':!![],'description':a25_0x4a6f8a(0xb1)}],async 'validate'(_0x458e28){const _0x183ebc=a25_0x4a6f8a,_0x3549d7=loadBffProjectConfig(_0x458e28[_0x183ebc(0xbf)]),_0xaf7692=await readBffLockFile(_0x3549d7[_0x183ebc(0xbd)]);if(!_0xaf7692)throw CliErrors['validation'](_0x183ebc(0x99));},async 'dryRun'(_0x2e41eb){const _0xdc0e60=a25_0x4a6f8a,_0x22360f=loadBffProjectConfig(_0x2e41eb[_0xdc0e60(0xbf)]),_0x198097=await readBffLockFile(_0x22360f[_0xdc0e60(0xbd)]);if(!_0x198097)throw CliErrors[_0xdc0e60(0xb4)]('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x327e83}=ensureLockScope(_0x198097,_0x2e41eb[_0xdc0e60(0xbf)],_0x22360f[_0xdc0e60(0xab)],_0xdc0e60(0xa9)),_0x2d0a72=_0x2e41eb[_0xdc0e60(0xb9)]('target'),_0x750217=Object[_0xdc0e60(0xb2)](_0x327e83[_0xdc0e60(0xcc)]),_0x1e9667=resolveDeleteTarget(_0x2d0a72,_0x750217),_0x5486ef=_0x327e83[_0xdc0e60(0xcc)][_0x1e9667];if(!_0x5486ef)throw CliErrors[_0xdc0e60(0xb4)](_0xdc0e60(0xc5)+_0x1e9667+'\x22.');const _0x2f9146=resolveLocalFilePathFromLockKey(_0x22360f,_0x1e9667),_0x19d10f=relative(_0x22360f[_0xdc0e60(0xba)],_0x2f9146),_0x33de59=join(_0x22360f[_0xdc0e60(0x9d)],_0xdc0e60(0xc8),_0x19d10f);return{'method':_0xdc0e60(0xb0),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x2e41eb['appCode'],'target':_0x1e9667,'remoteId':_0x5486ef[_0xdc0e60(0xc6)],'localFilePath':_0x2f9146,'trashedPath':_0x33de59},'description':_0xdc0e60(0xb8)+_0x1e9667+_0xdc0e60(0xcb)};},async 'execute'(_0x3ddd31){const _0x20261f=a25_0x4a6f8a,_0x310d9d=loadBffProjectConfig(_0x3ddd31['appCode']),_0x2ac621=await readBffLockFile(_0x310d9d[_0x20261f(0xbd)]);if(!_0x2ac621)throw CliErrors[_0x20261f(0xb4)](_0x20261f(0xa8));const {lockData:_0x4b934d,appLock:_0x4f50d1}=ensureLockScope(_0x2ac621,_0x3ddd31[_0x20261f(0xbf)],_0x310d9d[_0x20261f(0xab)],'delete'),_0x641cfe=_0x3ddd31[_0x20261f(0xb9)]('target'),_0x4b4af5=Object['keys'](_0x4f50d1[_0x20261f(0xcc)]),_0x503036=resolveDeleteTarget(_0x641cfe,_0x4b4af5),_0x4b4068=_0x4f50d1[_0x20261f(0xcc)][_0x503036];if(!_0x4b4068)throw CliErrors['validation'](_0x20261f(0xc5)+_0x503036+'\x22.');await deleteBffScript(_0x4b4068['remoteId']),delete _0x4f50d1[_0x20261f(0xcc)][_0x503036],_0x4f50d1[_0x20261f(0xc3)]=new Date()['toISOString'](),await writeBffLockFile(_0x310d9d[_0x20261f(0xbd)],_0x4b934d);const _0x3e90ca=resolveLocalFilePathFromLockKey(_0x310d9d,_0x503036);let _0x1cffcf;await fileExists(_0x3e90ca)&&(_0x1cffcf=await moveToTrash(_0x310d9d[_0x20261f(0xba)],_0x310d9d[_0x20261f(0x9d)],_0x3e90ca),await cleanupEmptyDirectories(dirname(_0x3e90ca),_0x310d9d[_0x20261f(0xc0)]));const _0x1bb223={'deleted':_0x503036,'remoteId':_0x4b4068['remoteId']};if(_0x1cffcf)_0x1bb223[_0x20261f(0xac)]=_0x1cffcf;return{'ok':!![],'data':_0x1bb223,'message':'Deleted\x20'+_0x503036+(_0x1cffcf?_0x20261f(0xc2):'')};}};function resolveDeleteTarget(_0x5ec504,_0x4e69d7){const _0x5425d6=a25_0x4a6f8a;if(_0x5ec504[_0x5425d6(0x9a)]('/')){const _0x1a46f9=_0x4e69d7[_0x5425d6(0xc9)](_0x2ca423=>_0x2ca423===_0x5ec504);if(!_0x1a46f9)throw CliErrors['validation'](_0x5425d6(0xa3)+_0x5ec504);return _0x1a46f9;}const _0x48a93c=_0x4e69d7[_0x5425d6(0xc1)](_0x16232a=>_0x16232a[_0x5425d6(0xb6)]('/')['at'](-0x1)===_0x5ec504);if(_0x48a93c[_0x5425d6(0xb3)]===0x0)throw CliErrors[_0x5425d6(0xb4)]('Function\x20not\x20found:\x20'+_0x5ec504);if(_0x48a93c[_0x5425d6(0xb3)]>0x1)throw CliErrors[_0x5425d6(0xb4)](_0x5425d6(0xae)+_0x5ec504+_0x5425d6(0xc4)+_0x48a93c[_0x5425d6(0xa2)](_0x31a3bc=>_0x5425d6(0xa7)+_0x31a3bc)[_0x5425d6(0xb5)]('\x0a'));return _0x48a93c[0x0];}function a25_0x1768(_0x4c5d0b,_0x1282d0){_0x4c5d0b=_0x4c5d0b-0x99;const _0x5482f6=a25_0x5482();let _0x1768cc=_0x5482f6[_0x4c5d0b];return _0x1768cc;}async function moveToTrash(_0x440616,_0x2cc146,_0x5630a7){const _0x1f6058=a25_0x4a6f8a,_0x345f17=new Date()['toISOString']()[_0x1f6058(0xb7)](/[:.]/g,'-'),_0x4b13e5=relative(_0x440616,_0x5630a7),_0x91fe25=join(_0x2cc146,_0x345f17,_0x4b13e5);return await mkdir(dirname(_0x91fe25),{'recursive':!![]}),await rename(_0x5630a7,_0x91fe25),_0x91fe25;}async function cleanupEmptyDirectories(_0x3659eb,_0x5aa7e7){const _0x340dac=a25_0x4a6f8a;let _0x10ad05=resolve(_0x3659eb);const _0x239de1=resolve(_0x5aa7e7);while(_0x10ad05[_0x340dac(0xcd)](''+_0x239de1+sep)||_0x10ad05===_0x239de1){if(_0x10ad05===_0x239de1)return;try{const _0x2ba5a=await readdir(_0x10ad05);if(_0x2ba5a[_0x340dac(0xb3)]>0x0)return;await rmdir(_0x10ad05);}catch{return;}_0x10ad05=dirname(_0x10ad05);}}
1
+ const a26_0x2b38d1=a26_0x2ba6;(function(_0x5e6275,_0x3aab1b){const _0x52edba=a26_0x2ba6,_0x2ce0db=_0x5e6275();while(!![]){try{const _0x4cafba=parseInt(_0x52edba(0xae))/0x1+parseInt(_0x52edba(0xac))/0x2*(-parseInt(_0x52edba(0xb0))/0x3)+parseInt(_0x52edba(0xbb))/0x4*(-parseInt(_0x52edba(0xb2))/0x5)+-parseInt(_0x52edba(0xb7))/0x6*(parseInt(_0x52edba(0xc5))/0x7)+parseInt(_0x52edba(0xc7))/0x8*(-parseInt(_0x52edba(0xa9))/0x9)+parseInt(_0x52edba(0xc0))/0xa*(parseInt(_0x52edba(0xb6))/0xb)+parseInt(_0x52edba(0xc6))/0xc;if(_0x4cafba===_0x3aab1b)break;else _0x2ce0db['push'](_0x2ce0db['shift']());}catch(_0x4bfee5){_0x2ce0db['push'](_0x2ce0db['shift']());}}}(a26_0x493d,0x24c36));function a26_0x2ba6(_0x26b615,_0x682774){_0x26b615=_0x26b615-0xa3;const _0x493d9f=a26_0x493d();let _0x2ba634=_0x493d9f[_0x26b615];return _0x2ba634;}function a26_0x493d(){const _0x2be155=['Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','Would\x20delete\x20','join','\x20(local\x20file\x20moved\x20to\x20trash)','length','startsWith','1908702GPDWff','validation','remoteId','2warWfr','str','192605sDBrsN','projectRoot','9642tpnktw','No\x20lock\x20entry\x20found\x20for\x20\x22','113055ZjSKbA','high-risk-write','toISOString','POST','2332088UKKVUj','618BIAePE','appCode','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','scriptsRoot','52KUPgmT','find','delete','lastSync','trashDir','10UVyVvn','split','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','Function\x20not\x20found:\x20','includes','5943sOjXYJ','4111812BEnmsb','8WUvdrp','scriptsRootDir','lockFilePath','target','map','functions','Deleted\x20','string','BFF\x20lock\x20file\x20not\x20found.'];a26_0x493d=function(){return _0x2be155;};return a26_0x493d();}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':'bff','command':a26_0x2b38d1(0xbd),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a26_0x2b38d1(0xb3),'flags':[{'name':'target','type':a26_0x2b38d1(0xce),'required':!![],'description':a26_0x2b38d1(0xa3)}],async 'validate'(_0x5e02d8){const _0x39341d=a26_0x2b38d1,_0x318b38=loadBffProjectConfig(_0x5e02d8[_0x39341d(0xb8)]),_0x58cfd9=await readBffLockFile(_0x318b38[_0x39341d(0xc9)]);if(!_0x58cfd9)throw CliErrors[_0x39341d(0xaa)](_0x39341d(0xc2));},async 'dryRun'(_0x324e07){const _0x5c56a4=a26_0x2b38d1,_0x37ff2d=loadBffProjectConfig(_0x324e07['appCode']),_0x5a8d22=await readBffLockFile(_0x37ff2d[_0x5c56a4(0xc9)]);if(!_0x5a8d22)throw CliErrors[_0x5c56a4(0xaa)](_0x5c56a4(0xcf));const {appLock:_0x4955db}=ensureLockScope(_0x5a8d22,_0x324e07[_0x5c56a4(0xb8)],_0x37ff2d[_0x5c56a4(0xba)],_0x5c56a4(0xbd)),_0x3ca8ec=_0x324e07[_0x5c56a4(0xad)]('target'),_0x10c066=Object['keys'](_0x4955db[_0x5c56a4(0xcc)]),_0x3345eb=resolveDeleteTarget(_0x3ca8ec,_0x10c066),_0x388dc5=_0x4955db['functions'][_0x3345eb];if(!_0x388dc5)throw CliErrors[_0x5c56a4(0xaa)](_0x5c56a4(0xb1)+_0x3345eb+'\x22.');const _0x1be61f=resolveLocalFilePathFromLockKey(_0x37ff2d,_0x3345eb),_0x27132b=relative(_0x37ff2d[_0x5c56a4(0xaf)],_0x1be61f),_0x2c63ce=join(_0x37ff2d['trashDir'],'<timestamp>',_0x27132b);return{'method':_0x5c56a4(0xb5),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x324e07[_0x5c56a4(0xb8)],'target':_0x3345eb,'remoteId':_0x388dc5['remoteId'],'localFilePath':_0x1be61f,'trashedPath':_0x2c63ce},'description':_0x5c56a4(0xa4)+_0x3345eb+_0x5c56a4(0xb9)};},async 'execute'(_0x5e7dff){const _0x26cb87=a26_0x2b38d1,_0x2275d2=loadBffProjectConfig(_0x5e7dff[_0x26cb87(0xb8)]),_0x28889b=await readBffLockFile(_0x2275d2[_0x26cb87(0xc9)]);if(!_0x28889b)throw CliErrors[_0x26cb87(0xaa)](_0x26cb87(0xcf));const {lockData:_0x30924c,appLock:_0x15d401}=ensureLockScope(_0x28889b,_0x5e7dff[_0x26cb87(0xb8)],_0x2275d2[_0x26cb87(0xba)],_0x26cb87(0xbd)),_0x2c371a=_0x5e7dff[_0x26cb87(0xad)](_0x26cb87(0xca)),_0x30da32=Object['keys'](_0x15d401['functions']),_0xb46ee=resolveDeleteTarget(_0x2c371a,_0x30da32),_0x38ecc3=_0x15d401[_0x26cb87(0xcc)][_0xb46ee];if(!_0x38ecc3)throw CliErrors[_0x26cb87(0xaa)](_0x26cb87(0xb1)+_0xb46ee+'\x22.');await deleteBffScript(_0x38ecc3['remoteId']),delete _0x15d401['functions'][_0xb46ee],_0x15d401[_0x26cb87(0xbe)]=new Date()['toISOString'](),await writeBffLockFile(_0x2275d2[_0x26cb87(0xc9)],_0x30924c);const _0x2b5c87=resolveLocalFilePathFromLockKey(_0x2275d2,_0xb46ee);let _0x146693;await fileExists(_0x2b5c87)&&(_0x146693=await moveToTrash(_0x2275d2[_0x26cb87(0xaf)],_0x2275d2[_0x26cb87(0xbf)],_0x2b5c87),await cleanupEmptyDirectories(dirname(_0x2b5c87),_0x2275d2[_0x26cb87(0xc8)]));const _0xdb28ff={'deleted':_0xb46ee,'remoteId':_0x38ecc3[_0x26cb87(0xab)]};if(_0x146693)_0xdb28ff['trashedTo']=_0x146693;return{'ok':!![],'data':_0xdb28ff,'message':_0x26cb87(0xcd)+_0xb46ee+(_0x146693?_0x26cb87(0xa6):'')};}};function resolveDeleteTarget(_0x54ce44,_0x4a82ad){const _0xe5fca9=a26_0x2b38d1;if(_0x54ce44[_0xe5fca9(0xc4)]('/')){const _0x3c13dd=_0x4a82ad[_0xe5fca9(0xbc)](_0xc875ea=>_0xc875ea===_0x54ce44);if(!_0x3c13dd)throw CliErrors[_0xe5fca9(0xaa)]('Function\x20not\x20found:\x20'+_0x54ce44);return _0x3c13dd;}const _0x1e5958=_0x4a82ad['filter'](_0x49302f=>_0x49302f[_0xe5fca9(0xc1)]('/')['at'](-0x1)===_0x54ce44);if(_0x1e5958[_0xe5fca9(0xa7)]===0x0)throw CliErrors[_0xe5fca9(0xaa)](_0xe5fca9(0xc3)+_0x54ce44);if(_0x1e5958[_0xe5fca9(0xa7)]>0x1)throw CliErrors[_0xe5fca9(0xaa)]('Multiple\x20functions\x20match\x20\x22'+_0x54ce44+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x1e5958[_0xe5fca9(0xcb)](_0x131844=>'\x20\x20-\x20'+_0x131844)[_0xe5fca9(0xa5)]('\x0a'));return _0x1e5958[0x0];}async function moveToTrash(_0x1e2349,_0x407d27,_0x1d7580){const _0x21267b=a26_0x2b38d1,_0x39dda8=new Date()[_0x21267b(0xb4)]()['replace'](/[:.]/g,'-'),_0x374ab9=relative(_0x1e2349,_0x1d7580),_0x10e94d=join(_0x407d27,_0x39dda8,_0x374ab9);return await mkdir(dirname(_0x10e94d),{'recursive':!![]}),await rename(_0x1d7580,_0x10e94d),_0x10e94d;}async function cleanupEmptyDirectories(_0x93f204,_0x586feb){const _0x9490ae=a26_0x2b38d1;let _0x3713b9=resolve(_0x93f204);const _0x1466e1=resolve(_0x586feb);while(_0x3713b9[_0x9490ae(0xa8)](''+_0x1466e1+sep)||_0x3713b9===_0x1466e1){if(_0x3713b9===_0x1466e1)return;try{const _0x180088=await readdir(_0x3713b9);if(_0x180088[_0x9490ae(0xa7)]>0x0)return;await rmdir(_0x3713b9);}catch{return;}_0x3713b9=dirname(_0x3713b9);}}
@@ -1 +1 @@
1
- const a26_0x46380c=a26_0x3ba4;(function(_0x15fb43,_0x2c2991){const _0x3e86c0=a26_0x3ba4,_0x5481d2=_0x15fb43();while(!![]){try{const _0x1fcaf6=parseInt(_0x3e86c0(0x87))/0x1*(parseInt(_0x3e86c0(0x7d))/0x2)+parseInt(_0x3e86c0(0x72))/0x3+parseInt(_0x3e86c0(0x81))/0x4*(-parseInt(_0x3e86c0(0x82))/0x5)+parseInt(_0x3e86c0(0x70))/0x6+parseInt(_0x3e86c0(0x7f))/0x7+-parseInt(_0x3e86c0(0x86))/0x8*(-parseInt(_0x3e86c0(0x73))/0x9)+-parseInt(_0x3e86c0(0x84))/0xa*(parseInt(_0x3e86c0(0x83))/0xb);if(_0x1fcaf6===_0x2c2991)break;else _0x5481d2['push'](_0x5481d2['shift']());}catch(_0x1ea4e5){_0x5481d2['push'](_0x5481d2['shift']());}}}(a26_0xadc9,0x28e70));function a26_0x3ba4(_0x373711,_0x573889){_0x373711=_0x373711-0x6d;const _0xadc94=a26_0xadc9();let _0x3ba4fd=_0xadc94[_0x373711];return _0x3ba4fd;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a26_0x46380c(0x6d),'command':a26_0x46380c(0x80),'description':a26_0x46380c(0x7c),'risk':a26_0x46380c(0x75),'flags':[{'name':'id','type':a26_0x46380c(0x7e),'required':!![],'description':a26_0x46380c(0x74)},{'name':a26_0x46380c(0x85),'type':'boolean','description':a26_0x46380c(0x7a)}],async 'execute'(_0x1aa512){const _0x27a220=a26_0x46380c,_0x2e84f0=await getBffScriptInfo(_0x1aa512[_0x27a220(0x7b)]('id')),_0x10ce96=_0x1aa512[_0x27a220(0x71)](_0x27a220(0x85));if(_0x10ce96)return{'ok':!![],'data':_0x2e84f0};return{'ok':!![],'data':{'id':_0x2e84f0['id'],'appCode':_0x2e84f0[_0x27a220(0x76)],'scriptType':_0x2e84f0['scriptType'],'description':_0x2e84f0[_0x27a220(0x6e)]||_0x27a220(0x6f),'createdTime':_0x2e84f0[_0x27a220(0x79)]??'','updatedTime':_0x2e84f0[_0x27a220(0x78)]??'','scriptContent':_0x2e84f0[_0x27a220(0x77)]??''}};}};function a26_0xadc9(){const _0x5a08ab=['482475WiINkD','2827tbIXcq','21590ajYkYK','verbose','483208qIMdPH','105211NJPuKN','bff','description','(none)','1670892Tecnbc','bool','361611uKfmOS','18bzCHjb','Script\x20ID','read','appCode','scriptContent','updatedTime','createdTime','Return\x20full\x20raw\x20script\x20object','num','Get\x20BFF\x20script\x20details\x20by\x20ID','2zbhpUd','number','2032499pnaZjh','detail','8jatsgd'];a26_0xadc9=function(){return _0x5a08ab;};return a26_0xadc9();}
1
+ const a27_0x5a63be=a27_0x27bc;function a27_0x1ac3(){const _0x1e4850=['boolean','read','172843Nmhotp','6FJtsnJ','(none)','13uqdQNe','604174fYXBdv','835165OUZupL','scriptContent','verbose','921HxWomx','number','10116yManfQ','10dqwUyj','bool','updatedTime','description','Return\x20full\x20raw\x20script\x20object','598073vyoZro','1DXDAIi','24hzzslT','904zrascB','4082344iAJdnr','324jyAapg','appCode'];a27_0x1ac3=function(){return _0x1e4850;};return a27_0x1ac3();}function a27_0x27bc(_0x5845ff,_0x36b959){_0x5845ff=_0x5845ff-0x17e;const _0x1ac3ab=a27_0x1ac3();let _0x27bca7=_0x1ac3ab[_0x5845ff];return _0x27bca7;}(function(_0x68f166,_0x38e81e){const _0x3ba969=a27_0x27bc,_0x484e95=_0x68f166();while(!![]){try{const _0x577f03=-parseInt(_0x3ba969(0x18f))/0x1*(parseInt(_0x3ba969(0x182))/0x2)+parseInt(_0x3ba969(0x186))/0x3*(-parseInt(_0x3ba969(0x191))/0x4)+-parseInt(_0x3ba969(0x183))/0x5*(-parseInt(_0x3ba969(0x17f))/0x6)+-parseInt(_0x3ba969(0x18e))/0x7*(parseInt(_0x3ba969(0x190))/0x8)+-parseInt(_0x3ba969(0x188))/0x9*(-parseInt(_0x3ba969(0x189))/0xa)+-parseInt(_0x3ba969(0x17e))/0xb*(-parseInt(_0x3ba969(0x193))/0xc)+parseInt(_0x3ba969(0x181))/0xd*(parseInt(_0x3ba969(0x192))/0xe);if(_0x577f03===_0x38e81e)break;else _0x484e95['push'](_0x484e95['shift']());}catch(_0x39818f){_0x484e95['push'](_0x484e95['shift']());}}}(a27_0x1ac3,0x3e8da));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':'detail','description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a27_0x5a63be(0x196),'flags':[{'name':'id','type':a27_0x5a63be(0x187),'required':!![],'description':'Script\x20ID'},{'name':'verbose','type':a27_0x5a63be(0x195),'description':a27_0x5a63be(0x18d)}],async 'execute'(_0x4070ff){const _0x970a74=a27_0x5a63be,_0x5d53d0=await getBffScriptInfo(_0x4070ff['num']('id')),_0x209ec4=_0x4070ff[_0x970a74(0x18a)](_0x970a74(0x185));if(_0x209ec4)return{'ok':!![],'data':_0x5d53d0};return{'ok':!![],'data':{'id':_0x5d53d0['id'],'appCode':_0x5d53d0[_0x970a74(0x194)],'scriptType':_0x5d53d0['scriptType'],'description':_0x5d53d0[_0x970a74(0x18c)]||_0x970a74(0x180),'createdTime':_0x5d53d0['createdTime']??'','updatedTime':_0x5d53d0[_0x970a74(0x18b)]??'','scriptContent':_0x5d53d0[_0x970a74(0x184)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x126c8f,_0x3a2183){const _0x2a4e57=a27_0x5a6b,_0x2352ba=_0x126c8f();while(!![]){try{const _0x1da954=parseInt(_0x2a4e57(0x70))/0x1*(parseInt(_0x2a4e57(0x72))/0x2)+-parseInt(_0x2a4e57(0x77))/0x3+parseInt(_0x2a4e57(0x71))/0x4+-parseInt(_0x2a4e57(0x75))/0x5+parseInt(_0x2a4e57(0x73))/0x6+parseInt(_0x2a4e57(0x74))/0x7+-parseInt(_0x2a4e57(0x76))/0x8*(parseInt(_0x2a4e57(0x6f))/0x9);if(_0x1da954===_0x3a2183)break;else _0x2352ba['push'](_0x2352ba['shift']());}catch(_0x5a9e28){_0x2352ba['push'](_0x2352ba['shift']());}}}(a27_0x2824,0x91145));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';function a27_0x5a6b(_0x13491d,_0x14b5bf){_0x13491d=_0x13491d-0x6f;const _0x282443=a27_0x2824();let _0x5a6be2=_0x282443[_0x13491d];return _0x5a6be2;}import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a27_0x2824(){const _0x24072c=['1039710cIwyem','7107255GuNGRe','105489sAqWoy','108244tCvMsj','18atoGvS','6480174SUirud','3222191liDPXm','3931470mhshGP','8cjpwGE'];a27_0x2824=function(){return _0x24072c;};return a27_0x2824();}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
1
+ (function(_0x43efbe,_0x2b3c71){const _0x3572aa=a28_0x1abc,_0x413ce9=_0x43efbe();while(!![]){try{const _0x453a20=parseInt(_0x3572aa(0x15b))/0x1*(-parseInt(_0x3572aa(0x15e))/0x2)+-parseInt(_0x3572aa(0x15d))/0x3+parseInt(_0x3572aa(0x15c))/0x4+parseInt(_0x3572aa(0x15a))/0x5+-parseInt(_0x3572aa(0x160))/0x6+-parseInt(_0x3572aa(0x159))/0x7+parseInt(_0x3572aa(0x15f))/0x8;if(_0x453a20===_0x2b3c71)break;else _0x413ce9['push'](_0x413ce9['shift']());}catch(_0x24b64b){_0x413ce9['push'](_0x413ce9['shift']());}}}(a28_0xe711,0xedacc));function a28_0x1abc(_0x562d8c,_0x24e89a){_0x562d8c=_0x562d8c-0x159;const _0xe71197=a28_0xe711();let _0x1abc1a=_0xe71197[_0x562d8c];return _0x1abc1a;}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];function a28_0xe711(){const _0x4da569=['8763006dvVLcB','7790890kCwZCQ','6746mRxleB','1143888PCmDZl','2082063UuLgao','116LLWqJv','19915424faMAjl','6137490RCoDeG'];a28_0xe711=function(){return _0x4da569;};return a28_0xe711();}
@@ -1 +1 @@
1
- const a28_0x44c280=a28_0x2a77;function a28_0x2a77(_0x28e5fc,_0x1cb354){_0x28e5fc=_0x28e5fc-0x144;const _0x2f6f5f=a28_0x2f6f();let _0x2a77af=_0x2f6f5f[_0x28e5fc];return _0x2a77af;}function a28_0x2f6f(){const _0xfa0ca5=['492EexGZw','read','702732lFpNet','32wgaBhE','bff','ENDPOINT','271101qQZGYi','functionName','76671TpGEgb','string','length','Filter\x20by\x20script\x20name','boolean','description','386557MVUEKj','str','3389080VIHrfI','scriptType','Script\x20type\x20filter','list','150rDsvpD','name','1710448mbPVxl','verbose','bool','319ODmuxv','map','4stWIVp','appCode','type','10171dqmNwx'];a28_0x2f6f=function(){return _0xfa0ca5;};return a28_0x2f6f();}(function(_0x53bf57,_0x34f27a){const _0x4c3b92=a28_0x2a77,_0x8df745=_0x53bf57();while(!![]){try{const _0x335f49=-parseInt(_0x4c3b92(0x156))/0x1*(-parseInt(_0x4c3b92(0x144))/0x2)+parseInt(_0x4c3b92(0x14e))/0x3*(parseInt(_0x4c3b92(0x14b))/0x4)+parseInt(_0x4c3b92(0x158))/0x5+-parseInt(_0x4c3b92(0x148))/0x6*(-parseInt(_0x4c3b92(0x147))/0x7)+-parseInt(_0x4c3b92(0x15e))/0x8+-parseInt(_0x4c3b92(0x150))/0x9*(-parseInt(_0x4c3b92(0x15c))/0xa)+parseInt(_0x4c3b92(0x161))/0xb*(-parseInt(_0x4c3b92(0x14a))/0xc);if(_0x335f49===_0x34f27a)break;else _0x8df745['push'](_0x8df745['shift']());}catch(_0x1bb743){_0x8df745['push'](_0x8df745['shift']());}}}(a28_0x2f6f,0x7c332));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a28_0x44c280(0x14c),'command':a28_0x44c280(0x15b),'description':'List\x20BFF\x20scripts','risk':a28_0x44c280(0x149),'flags':[{'name':a28_0x44c280(0x146),'type':a28_0x44c280(0x151),'description':a28_0x44c280(0x15a),'default':a28_0x44c280(0x14d),'enum':[a28_0x44c280(0x14d),'COMMON']},{'name':a28_0x44c280(0x15d),'type':a28_0x44c280(0x151),'description':a28_0x44c280(0x153)},{'name':a28_0x44c280(0x15f),'type':a28_0x44c280(0x154),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x3332a6){const _0x1f70fe=a28_0x44c280,_0x3c4636=await listBffScripts(_0x3332a6[_0x1f70fe(0x145)],_0x3332a6[_0x1f70fe(0x157)](_0x1f70fe(0x146)),{'scriptName':_0x3332a6[_0x1f70fe(0x157)](_0x1f70fe(0x15d))||undefined}),_0x284713=_0x3332a6[_0x1f70fe(0x160)](_0x1f70fe(0x15f));return{'ok':!![],'data':_0x284713?_0x3c4636:_0x3c4636[_0x1f70fe(0x162)](_0x5356b4=>({'id':_0x5356b4['id'],'functionName':_0x5356b4[_0x1f70fe(0x14f)]??'','description':_0x5356b4[_0x1f70fe(0x155)]||'(unnamed)','scriptType':_0x5356b4[_0x1f70fe(0x159)]})),'message':_0x3c4636[_0x1f70fe(0x152)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
1
+ const a29_0x1ee724=a29_0x2a9a;(function(_0x5930f6,_0x22bacd){const _0x291aa6=a29_0x2a9a,_0x515f90=_0x5930f6();while(!![]){try{const _0x58a57a=parseInt(_0x291aa6(0xf4))/0x1*(parseInt(_0x291aa6(0xe7))/0x2)+parseInt(_0x291aa6(0xe4))/0x3+-parseInt(_0x291aa6(0xe2))/0x4+-parseInt(_0x291aa6(0xf0))/0x5+parseInt(_0x291aa6(0xdb))/0x6+-parseInt(_0x291aa6(0xf2))/0x7*(parseInt(_0x291aa6(0xda))/0x8)+parseInt(_0x291aa6(0xe6))/0x9;if(_0x58a57a===_0x22bacd)break;else _0x515f90['push'](_0x515f90['shift']());}catch(_0x3490d6){_0x515f90['push'](_0x515f90['shift']());}}}(a29_0x3af4,0xc5b4c));function a29_0x3af4(){const _0x1fd589=['functionName','verbose','string','Return\x20full\x20script\x20objects','bool','list','2304928sPOSWA','description','1400520szZNgR','Script\x20type\x20filter','8505279WTinsc','6luGscO','ENDPOINT','str','appCode','Filter\x20by\x20script\x20name','name','boolean','List\x20BFF\x20scripts','No\x20BFF\x20scripts\x20found.','7484070JmELKZ','(unnamed)','7GaTEQS','scriptType','516707tNuOmA','3400840pynMbC','2075778YLHJdk'];a29_0x3af4=function(){return _0x1fd589;};return a29_0x3af4();}function a29_0x2a9a(_0x2185d6,_0x216dc1){_0x2185d6=_0x2185d6-0xda;const _0x3af43b=a29_0x3af4();let _0x2a9a3d=_0x3af43b[_0x2185d6];return _0x2a9a3d;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a29_0x1ee724(0xe1),'description':a29_0x1ee724(0xee),'risk':'read','flags':[{'name':'type','type':'string','description':a29_0x1ee724(0xe5),'default':a29_0x1ee724(0xe8),'enum':[a29_0x1ee724(0xe8),'COMMON']},{'name':a29_0x1ee724(0xec),'type':a29_0x1ee724(0xde),'description':a29_0x1ee724(0xeb)},{'name':'verbose','type':a29_0x1ee724(0xed),'description':a29_0x1ee724(0xdf)}],async 'execute'(_0x1d0bc4){const _0x4381c3=a29_0x1ee724,_0x12ff6c=await listBffScripts(_0x1d0bc4[_0x4381c3(0xea)],_0x1d0bc4['str']('type'),{'scriptName':_0x1d0bc4[_0x4381c3(0xe9)](_0x4381c3(0xec))||undefined}),_0x3a63a2=_0x1d0bc4[_0x4381c3(0xe0)](_0x4381c3(0xdd));return{'ok':!![],'data':_0x3a63a2?_0x12ff6c:_0x12ff6c['map'](_0x53cbd4=>({'id':_0x53cbd4['id'],'functionName':_0x53cbd4[_0x4381c3(0xdc)]??'','description':_0x53cbd4[_0x4381c3(0xe3)]||_0x4381c3(0xf1),'scriptType':_0x53cbd4[_0x4381c3(0xf3)]})),'message':_0x12ff6c['length']===0x0?_0x4381c3(0xef):undefined};}};
@@ -1 +1 @@
1
- const a29_0x543ed9=a29_0x5c2e;(function(_0x146702,_0x1542ac){const _0x33f6b0=a29_0x5c2e,_0x2becae=_0x146702();while(!![]){try{const _0x1d7183=-parseInt(_0x33f6b0(0x164))/0x1*(parseInt(_0x33f6b0(0x178))/0x2)+parseInt(_0x33f6b0(0x158))/0x3+-parseInt(_0x33f6b0(0x140))/0x4+-parseInt(_0x33f6b0(0x12b))/0x5*(parseInt(_0x33f6b0(0x176))/0x6)+parseInt(_0x33f6b0(0x159))/0x7+parseInt(_0x33f6b0(0x16d))/0x8+parseInt(_0x33f6b0(0x146))/0x9*(-parseInt(_0x33f6b0(0x148))/0xa);if(_0x1d7183===_0x1542ac)break;else _0x2becae['push'](_0x2becae['shift']());}catch(_0x42af68){_0x2becae['push'](_0x2becae['shift']());}}}(a29_0x4767,0xa32cd));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';function a29_0x5c2e(_0x2db600,_0x1fe889){_0x2db600=_0x2db600-0x12b;const _0x476734=a29_0x4767();let _0x5c2ea6=_0x476734[_0x2db600];return _0x5c2ea6;}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';function a29_0x4767(){const _0xfba880=['includes','Created\x20','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Select\x20trigger\x20node:','Select\x20operation\x20type:','10046312DpPQKg','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','functionNode','join','code','validation','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','description','HOOK\x20requires\x20alias/operation/node\x20options.','5084952yHxEDQ','parseInt','6MiunGT','Invalid\x20function\x20name\x20\x22','map','stderr','trim','TODO:\x20add\x20script\x20description','Available:\x20','apiDir','No\x20datasets\x20found\x20for\x20this\x20app.','ENDPOINT','Select\x20dataset:','function-node','Invalid\x20dataset\x20selection.','string','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','5yYJadM','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','nonInteractive','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22.\x20','bff','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','datasetcode','operationType','operation-type','name','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','File\x20already\x20exists:\x20','\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','stdin','isInteger','.js','\x0a\x20*\x20[脚本名称]\x20','HOOK','\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','Script\x20type','4826924WuEHsz','\x22\x20not\x20found\x20for\x20dataset\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','after','question','\x20function:\x20','2529kRhTOA','No\x20operation\x20types\x20found\x20for\x20dataset\x20','13940ScYusU','str','length','Operation\x20type\x20(HOOK\x20only)','alias','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Available\x20aliases:\x20','Trigger\x20node\x20(HOOK\x20only)','Script\x20description','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','entries','scriptsRootDir','Alias\x20\x22','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','datasetCode','close','3763281AUGIYi','6596541shURVQ','type','Operation\x20type\x20\x22','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','keys','\x20api\x20pull`\x20to\x20refresh.','write','COMMON','appCode','Dataset\x20not\x20found\x20for\x20code\x20\x22','112759EZYWHz','before','/endpoint/','\x0a\x20*\x20[触发节点]\x20'];a29_0x4767=function(){return _0xfba880;};return a29_0x4767();}import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a29_0x543ed9(0x130),'command':'new','description':a29_0x543ed9(0x151),'risk':a29_0x543ed9(0x160),'flags':[{'name':a29_0x543ed9(0x15a),'type':a29_0x543ed9(0x185),'required':!![],'enum':[a29_0x543ed9(0x161),a29_0x543ed9(0x181),a29_0x543ed9(0x13d)],'description':a29_0x543ed9(0x13f)},{'name':a29_0x543ed9(0x135),'type':a29_0x543ed9(0x185),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a29_0x543ed9(0x174),'type':a29_0x543ed9(0x185),'description':a29_0x543ed9(0x150)},{'name':a29_0x543ed9(0x14c),'type':a29_0x543ed9(0x185),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a29_0x543ed9(0x132),'type':'string','description':a29_0x543ed9(0x142)},{'name':a29_0x543ed9(0x134),'type':a29_0x543ed9(0x185),'description':a29_0x543ed9(0x14b)},{'name':a29_0x543ed9(0x183),'type':a29_0x543ed9(0x185),'description':a29_0x543ed9(0x14f),'enum':['before',a29_0x543ed9(0x143)]}],async 'validate'(_0x297996){const _0x3bfe9f=a29_0x543ed9,_0xa2b3b8=_0x297996['str'](_0x3bfe9f(0x135));if(!isValidBffFunctionName(_0xa2b3b8))throw CliErrors[_0x3bfe9f(0x172)](_0x3bfe9f(0x179)+_0xa2b3b8+_0x3bfe9f(0x136));},async 'execute'(_0x344441){const _0x17bc51=a29_0x543ed9,_0x42f9ad=loadBffProjectConfig(_0x344441['appCode']),_0x2712ff=_0x344441['str'](_0x17bc51(0x15a)),_0x19d455=_0x344441[_0x17bc51(0x149)](_0x17bc51(0x135)),_0x3488cb=_0x344441[_0x17bc51(0x149)](_0x17bc51(0x174))||undefined,_0xc6d5c9=_0x2712ff===_0x17bc51(0x13d)?await resolveHookOptions(_0x42f9ad,_0x344441):undefined,_0x40e234=buildFilePath(_0x42f9ad,_0x2712ff,_0x19d455,_0xc6d5c9);if(await fileExists(_0x40e234))throw CliErrors[_0x17bc51(0x172)](_0x17bc51(0x137)+_0x40e234);await mkdir(dirname(_0x40e234),{'recursive':!![]});const _0x4ed9ce=generateTemplate(_0x2712ff,_0x19d455,_0x344441['appCode'],_0x3488cb,_0xc6d5c9);await writeFile(_0x40e234,_0x4ed9ce,'utf8');const _0x3d0a42={'type':_0x2712ff,'name':_0x19d455,'path':_0x40e234};if(_0x3488cb)_0x3d0a42['description']=_0x3488cb;if(_0xc6d5c9){if(_0xc6d5c9[_0x17bc51(0x14c)])_0x3d0a42[_0x17bc51(0x14c)]=_0xc6d5c9['alias'];_0x3d0a42[_0x17bc51(0x156)]=_0xc6d5c9[_0x17bc51(0x156)],_0x3d0a42[_0x17bc51(0x133)]=_0xc6d5c9[_0x17bc51(0x133)],_0x3d0a42['functionNode']=_0xc6d5c9['functionNode'];}return{'ok':!![],'data':_0x3d0a42,'message':_0x17bc51(0x169)+_0x2712ff+_0x17bc51(0x145)+_0x19d455};}};async function resolveHookOptions(_0x5c8d50,_0x1cd3e6){const _0x2c8be9=a29_0x543ed9,_0x2e43ee=loadAliasMap(_0x1cd3e6['apiDir'],undefined,resolveApiFilePath(_0x1cd3e6[_0x2c8be9(0x17f)],_0x1cd3e6['appCode'])),_0x2a526d=_0x2e43ee['length']>0x0;let _0x50aec4,_0xf4a575,_0x6c9a3a;const _0x30ac30=_0x1cd3e6['str'](_0x2c8be9(0x14c)),_0x1ed392=_0x1cd3e6[_0x2c8be9(0x149)]('datasetcode');if(_0x30ac30){const _0x1fff0c=resolveAlias(_0x1cd3e6[_0x2c8be9(0x17f)],_0x30ac30,undefined,resolveApiFilePath(_0x1cd3e6[_0x2c8be9(0x17f)],_0x1cd3e6[_0x2c8be9(0x162)]));if(!_0x1fff0c){const _0x5b0216=_0x2a526d?_0x2c8be9(0x14e)+_0x2e43ee[_0x2c8be9(0x17a)](_0x2593f7=>_0x2593f7[_0x2c8be9(0x14c)])[_0x2c8be9(0x170)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x2c8be9(0x16e);throw CliErrors[_0x2c8be9(0x172)](_0x2c8be9(0x154)+_0x30ac30+'\x22\x20not\x20found.\x20'+_0x5b0216);}_0x50aec4=_0x30ac30,_0xf4a575=_0x1fff0c;}else{if(_0x1ed392){_0xf4a575=_0x1ed392;const _0xcdd7cb=_0x2e43ee['find'](_0x27f469=>_0x27f469['datasetCode']===_0x1ed392);_0x50aec4=_0xcdd7cb?.['alias'];}else{if(_0x1cd3e6[_0x2c8be9(0x12d)])throw CliErrors['validation'](_0x2c8be9(0x12e));else{if(_0x2a526d){const _0x55cc31=_0x2e43ee[_0x2c8be9(0x17a)](_0x3a2511=>_0x3a2511[_0x2c8be9(0x14c)]+'\x20('+_0x3a2511['tableName']+')'),_0x461e17=await promptSelect(_0x2c8be9(0x182),_0x55cc31),_0x15466e=_0x2e43ee[_0x461e17];if(!_0x15466e)throw CliErrors[_0x2c8be9(0x172)](_0x2c8be9(0x184));_0x50aec4=_0x15466e['alias'],_0xf4a575=_0x15466e['datasetCode'];}else{const _0x14078f=await listDatasets(_0x1cd3e6['appCode']);if(_0x14078f[_0x2c8be9(0x14a)]===0x0)throw CliErrors[_0x2c8be9(0x172)](_0x2c8be9(0x180));const _0x592b3f=_0x14078f[_0x2c8be9(0x17a)](_0x448405=>_0x448405['name']+'\x20('+_0x448405[_0x2c8be9(0x171)]+')'),_0x20823a=await promptSelect('Select\x20dataset:',_0x592b3f),_0x5c0015=_0x14078f[_0x20823a];if(!_0x5c0015)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0xf4a575=_0x5c0015[_0x2c8be9(0x171)],_0x50aec4=undefined;}}}}const _0x22a434=await listDatasets(_0x1cd3e6[_0x2c8be9(0x162)]),_0x514463=_0x22a434['find'](_0x518f52=>_0x518f52[_0x2c8be9(0x171)]===_0xf4a575);if(!_0x514463)throw CliErrors[_0x2c8be9(0x172)](_0x2c8be9(0x163)+_0xf4a575+_0x2c8be9(0x12f)+(_0x50aec4?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x2c8be9(0x15f):''));_0x6c9a3a=_0x514463['id'];const _0x2efe71=_0x50aec4??_0xf4a575,_0x48f3e9=await listBffDatasetOperations(_0x1cd3e6[_0x2c8be9(0x162)],_0x6c9a3a),_0x2b9193=_0x48f3e9?Object[_0x2c8be9(0x15e)](_0x48f3e9):[];if(_0x2b9193['length']===0x0)throw CliErrors['validation'](_0x2c8be9(0x147)+_0x2efe71+'.');let _0x5a1262;const _0x39a2e7=_0x1cd3e6[_0x2c8be9(0x149)]('operation-type');if(_0x39a2e7){if(!_0x2b9193[_0x2c8be9(0x168)](_0x39a2e7))throw CliErrors['validation'](_0x2c8be9(0x15b)+_0x39a2e7+_0x2c8be9(0x141)+_0x2efe71+'.\x20'+(_0x2c8be9(0x17e)+_0x2b9193[_0x2c8be9(0x170)](',\x20')));_0x5a1262=_0x39a2e7;}else{if(_0x1cd3e6['nonInteractive'])throw CliErrors['validation']('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x20e692=await promptSelect(_0x2c8be9(0x16c),_0x2b9193);_0x5a1262=_0x2b9193[_0x20e692]??_0x2b9193[0x0];}let _0x673e9d=normalizeHookFunctionNode(_0x1cd3e6[_0x2c8be9(0x149)](_0x2c8be9(0x183)));if(!_0x673e9d){if(_0x1cd3e6[_0x2c8be9(0x149)](_0x2c8be9(0x183)))throw CliErrors[_0x2c8be9(0x172)](_0x2c8be9(0x173));if(_0x1cd3e6[_0x2c8be9(0x12d)])throw CliErrors[_0x2c8be9(0x172)](_0x2c8be9(0x15d));const _0x2bd189=await promptSelect(_0x2c8be9(0x16b),[_0x2c8be9(0x165),'after']);_0x673e9d=[_0x2c8be9(0x165),_0x2c8be9(0x143)][_0x2bd189]??_0x2c8be9(0x165);}return{'alias':_0x50aec4,'datasetCode':_0xf4a575,'datasetId':_0x6c9a3a,'operationType':_0x5a1262,'functionNode':_0x673e9d};}async function promptSelect(_0x4d9d03,_0x1acf8c){const _0x1942e8=a29_0x543ed9;if(_0x1acf8c[_0x1942e8(0x14a)]===0x1)return 0x0;for(const [_0x5ec2f2,_0x3f51ee]of _0x1acf8c[_0x1942e8(0x152)]()){process[_0x1942e8(0x17b)][_0x1942e8(0x160)]('\x20\x20'+(_0x5ec2f2+0x1)+'.\x20'+_0x3f51ee+'\x0a');}const _0x407728=createInterface({'input':process[_0x1942e8(0x139)],'output':process['stderr']});while(!![]){const _0x5b5482=await new Promise(_0x1f49ae=>{const _0x1c72a5=_0x1942e8;_0x407728[_0x1c72a5(0x144)](_0x4d9d03+'\x20',_0x1f49ae);}),_0x3748d6=Number[_0x1942e8(0x177)](_0x5b5482[_0x1942e8(0x17c)](),0xa);if(Number[_0x1942e8(0x13a)](_0x3748d6)&&_0x3748d6>=0x1&&_0x3748d6<=_0x1acf8c[_0x1942e8(0x14a)])return _0x407728[_0x1942e8(0x157)](),_0x3748d6-0x1;process['stderr'][_0x1942e8(0x160)](_0x1942e8(0x14d)+_0x1acf8c[_0x1942e8(0x14a)]+'.\x0a');}}function buildFilePath(_0x267ae7,_0xc34f1e,_0x52f494,_0x1f5df3){const _0x10fba0=a29_0x543ed9;if(_0xc34f1e==='HOOK'){if(!_0x1f5df3)throw CliErrors[_0x10fba0(0x172)](_0x10fba0(0x175));const _0x4eed3c=_0x1f5df3[_0x10fba0(0x14c)]??_0x1f5df3[_0x10fba0(0x156)];return join(_0x267ae7[_0x10fba0(0x153)],'HOOK',_0x4eed3c,_0x1f5df3[_0x10fba0(0x133)],_0x1f5df3[_0x10fba0(0x16f)],_0x52f494+_0x10fba0(0x13b));}return join(_0x267ae7['scriptsRootDir'],_0xc34f1e,_0x52f494+_0x10fba0(0x13b));}export function generateTemplate(_0x44c211,_0x30c607,_0x364413,_0x50975b,_0x59ca42){const _0x586cc5=a29_0x543ed9,_0x20806b=_0x50975b?.['trim']()||_0x586cc5(0x17d);if(_0x44c211==='COMMON')return _0x586cc5(0x155)+_0x20806b+_0x586cc5(0x13c)+_0x30c607+_0x586cc5(0x186)+_0x30c607+_0x586cc5(0x16a)+_0x30c607+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x44c211===_0x586cc5(0x181))return _0x586cc5(0x187)+_0x20806b+_0x586cc5(0x12c)+_0x364413+_0x586cc5(0x166)+_0x30c607+_0x586cc5(0x138)+_0x30c607+_0x586cc5(0x188);if(!_0x59ca42)throw CliErrors['validation'](_0x586cc5(0x15c));return _0x586cc5(0x131)+_0x20806b+_0x586cc5(0x12c)+_0x364413+'/'+_0x59ca42[_0x586cc5(0x156)]+'/'+_0x59ca42[_0x586cc5(0x133)]+_0x586cc5(0x167)+_0x59ca42[_0x586cc5(0x16f)]+_0x586cc5(0x13e)+_0x30c607+_0x586cc5(0x188);}
1
+ const a30_0x3f3386=a30_0x14b4;function a30_0x4c84(){const _0x2ee11b=['10ntPWlw','new','No\x20api.ts\x20found.\x20Run\x20`','\x0a\x20*\x20[脚本名称]\x20','99GmZEPY','map','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','functionNode','Available:\x20','4AInEFI','code','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','isInteger','find','function-node','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x20[触发节点]\x20','operation-type','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','14XnQVdC','Dataset\x20not\x20found\x20for\x20code\x20\x22','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','name','string','nonInteractive','parseInt','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x22.\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','write','scriptsRootDir','datasetCode','Alias\x20\x22','File\x20already\x20exists:\x20','No\x20datasets\x20found\x20for\x20this\x20app.','.js','18940801cKnXTK','keys','Operation\x20type\x20(HOOK\x20only)','\x20function:\x20','Trigger\x20node\x20(HOOK\x20only)','COMMON','Available\x20aliases:\x20','5109400NFmVAx','str','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','before','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','bff','appCode','type','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','ENDPOINT','close','Created\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Select\x20operation\x20type:','657656KZwGSD','trim','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','validation','operationType','1008804HhiADY','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','length','alias','Select\x20dataset:','description','tableName','apiDir','Invalid\x20dataset\x20selection.','stderr','includes','\x22\x20not\x20found\x20for\x20dataset\x20','datasetcode','No\x20operation\x20types\x20found\x20for\x20dataset\x20','after','entries','TODO:\x20add\x20script\x20description','2700344NpVfxZ','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','22511tJjYvG','HOOK','\x20api\x20pull`\x20to\x20refresh.','Script\x20type','1074414PKjYYt','question','utf8','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'];a30_0x4c84=function(){return _0x2ee11b;};return a30_0x4c84();}(function(_0x24e351,_0x415936){const _0x2f2536=a30_0x14b4,_0x1b340f=_0x24e351();while(!![]){try{const _0x13be67=-parseInt(_0x2f2536(0xb8))/0x1+parseInt(_0x2f2536(0x6e))/0x2*(parseInt(_0x2f2536(0xbc))/0x3)+-parseInt(_0x2f2536(0xb6))/0x4+parseInt(_0x2f2536(0x92))/0x5+-parseInt(_0x2f2536(0xa5))/0x6*(-parseInt(_0x2f2536(0x79))/0x7)+parseInt(_0x2f2536(0xa0))/0x8*(parseInt(_0x2f2536(0xc4))/0x9)+parseInt(_0x2f2536(0xc0))/0xa*(-parseInt(_0x2f2536(0x8b))/0xb);if(_0x13be67===_0x415936)break;else _0x1b340f['push'](_0x1b340f['shift']());}catch(_0xd6ff84){_0x1b340f['push'](_0x1b340f['shift']());}}}(a30_0x4c84,0x8886d));function a30_0x14b4(_0x4d22a6,_0x5a58fb){_0x4d22a6=_0x4d22a6-0x6e;const _0x4c84a0=a30_0x4c84();let _0x14b400=_0x4c84a0[_0x4d22a6];return _0x14b400;}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a30_0x3f3386(0x97),'command':a30_0x3f3386(0xc1),'description':a30_0x3f3386(0x70),'risk':a30_0x3f3386(0x84),'flags':[{'name':a30_0x3f3386(0x99),'type':'string','required':!![],'enum':[a30_0x3f3386(0x90),a30_0x3f3386(0x9b),a30_0x3f3386(0xb9)],'description':a30_0x3f3386(0xbb)},{'name':a30_0x3f3386(0x7d),'type':'string','required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a30_0x3f3386(0xaa),'type':a30_0x3f3386(0x7e),'description':'Script\x20description'},{'name':a30_0x3f3386(0xa8),'type':a30_0x3f3386(0x7e),'description':a30_0x3f3386(0xa2)},{'name':'datasetcode','type':a30_0x3f3386(0x7e),'description':a30_0x3f3386(0x96)},{'name':a30_0x3f3386(0x77),'type':a30_0x3f3386(0x7e),'description':a30_0x3f3386(0x8d)},{'name':a30_0x3f3386(0x73),'type':'string','description':a30_0x3f3386(0x8f),'enum':[a30_0x3f3386(0x95),'after']}],async 'validate'(_0x26fa24){const _0x97f98a=a30_0x3f3386,_0x3d2658=_0x26fa24[_0x97f98a(0x93)](_0x97f98a(0x7d));if(!isValidBffFunctionName(_0x3d2658))throw CliErrors['validation']('Invalid\x20function\x20name\x20\x22'+_0x3d2658+_0x97f98a(0x7c));},async 'execute'(_0x503ec8){const _0x294233=a30_0x3f3386,_0x2070b7=loadBffProjectConfig(_0x503ec8[_0x294233(0x98)]),_0x3a0aa4=_0x503ec8[_0x294233(0x93)](_0x294233(0x99)),_0x5cdaba=_0x503ec8[_0x294233(0x93)](_0x294233(0x7d)),_0x380623=_0x503ec8[_0x294233(0x93)](_0x294233(0xaa))||undefined,_0x3deb82=_0x3a0aa4===_0x294233(0xb9)?await resolveHookOptions(_0x2070b7,_0x503ec8):undefined,_0x39156b=buildFilePath(_0x2070b7,_0x3a0aa4,_0x5cdaba,_0x3deb82);if(await fileExists(_0x39156b))throw CliErrors['validation'](_0x294233(0x88)+_0x39156b);await mkdir(dirname(_0x39156b),{'recursive':!![]});const _0x9d9ce8=generateTemplate(_0x3a0aa4,_0x5cdaba,_0x503ec8[_0x294233(0x98)],_0x380623,_0x3deb82);await writeFile(_0x39156b,_0x9d9ce8,_0x294233(0xbe));const _0x7cf484={'type':_0x3a0aa4,'name':_0x5cdaba,'path':_0x39156b};if(_0x380623)_0x7cf484[_0x294233(0xaa)]=_0x380623;if(_0x3deb82){if(_0x3deb82['alias'])_0x7cf484[_0x294233(0xa8)]=_0x3deb82['alias'];_0x7cf484['datasetCode']=_0x3deb82[_0x294233(0x86)],_0x7cf484[_0x294233(0xa4)]=_0x3deb82['operationType'],_0x7cf484['functionNode']=_0x3deb82[_0x294233(0xc7)];}return{'ok':!![],'data':_0x7cf484,'message':_0x294233(0x9d)+_0x3a0aa4+_0x294233(0x8e)+_0x5cdaba};}};async function resolveHookOptions(_0x2f63ce,_0x21c238){const _0x1606db=a30_0x3f3386,_0x2b550a=loadAliasMap(_0x21c238['apiDir'],undefined,resolveApiFilePath(_0x21c238[_0x1606db(0xac)],_0x21c238[_0x1606db(0x98)])),_0x451446=_0x2b550a[_0x1606db(0xa7)]>0x0;let _0x45dd22,_0x59f940,_0xbaf0bf;const _0x3388af=_0x21c238['str']('alias'),_0x225855=_0x21c238['str'](_0x1606db(0xb1));if(_0x3388af){const _0x46061f=resolveAlias(_0x21c238[_0x1606db(0xac)],_0x3388af,undefined,resolveApiFilePath(_0x21c238[_0x1606db(0xac)],_0x21c238[_0x1606db(0x98)]));if(!_0x46061f){const _0x14350f=_0x451446?_0x1606db(0x91)+_0x2b550a[_0x1606db(0xc5)](_0x1b86d8=>_0x1b86d8[_0x1606db(0xa8)])['join'](',\x20'):_0x1606db(0xc2)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x87)+_0x3388af+'\x22\x20not\x20found.\x20'+_0x14350f);}_0x45dd22=_0x3388af,_0x59f940=_0x46061f;}else{if(_0x225855){_0x59f940=_0x225855;const _0x259ab0=_0x2b550a[_0x1606db(0x72)](_0x2d3ec9=>_0x2d3ec9[_0x1606db(0x86)]===_0x225855);_0x45dd22=_0x259ab0?.[_0x1606db(0xa8)];}else{if(_0x21c238[_0x1606db(0x7f)])throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x83));else{if(_0x451446){const _0xde7258=_0x2b550a[_0x1606db(0xc5)](_0x4f783f=>_0x4f783f['alias']+'\x20('+_0x4f783f[_0x1606db(0xab)]+')'),_0x4cc6cf=await promptSelect(_0x1606db(0xa9),_0xde7258),_0x4e0bd1=_0x2b550a[_0x4cc6cf];if(!_0x4e0bd1)throw CliErrors['validation'](_0x1606db(0xad));_0x45dd22=_0x4e0bd1[_0x1606db(0xa8)],_0x59f940=_0x4e0bd1[_0x1606db(0x86)];}else{const _0xddbb71=await listDatasets(_0x21c238[_0x1606db(0x98)]);if(_0xddbb71[_0x1606db(0xa7)]===0x0)throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x89));const _0x2bd306=_0xddbb71['map'](_0x168fc9=>_0x168fc9[_0x1606db(0x7d)]+'\x20('+_0x168fc9[_0x1606db(0x6f)]+')'),_0xdede99=await promptSelect(_0x1606db(0xa9),_0x2bd306),_0x2c3185=_0xddbb71[_0xdede99];if(!_0x2c3185)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x59f940=_0x2c3185[_0x1606db(0x6f)],_0x45dd22=undefined;}}}}const _0x2a79a2=await listDatasets(_0x21c238[_0x1606db(0x98)]),_0x54935c=_0x2a79a2['find'](_0x368b1e=>_0x368b1e[_0x1606db(0x6f)]===_0x59f940);if(!_0x54935c)throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x7a)+_0x59f940+_0x1606db(0x82)+(_0x45dd22?_0x1606db(0xbf)+CLI_BIN_NAME+_0x1606db(0xba):''));_0xbaf0bf=_0x54935c['id'];const _0x21c339=_0x45dd22??_0x59f940,_0x168ccd=await listBffDatasetOperations(_0x21c238[_0x1606db(0x98)],_0xbaf0bf),_0x130609=_0x168ccd?Object[_0x1606db(0x8c)](_0x168ccd):[];if(_0x130609[_0x1606db(0xa7)]===0x0)throw CliErrors[_0x1606db(0xa3)](_0x1606db(0xb2)+_0x21c339+'.');let _0x4e6d95;const _0x32f39d=_0x21c238[_0x1606db(0x93)](_0x1606db(0x77));if(_0x32f39d){if(!_0x130609[_0x1606db(0xaf)](_0x32f39d))throw CliErrors[_0x1606db(0xa3)]('Operation\x20type\x20\x22'+_0x32f39d+_0x1606db(0xb0)+_0x21c339+'.\x20'+(_0x1606db(0xc8)+_0x130609['join'](',\x20')));_0x4e6d95=_0x32f39d;}else{if(_0x21c238[_0x1606db(0x7f)])throw CliErrors[_0x1606db(0xa3)](_0x1606db(0xa6));const _0x5f40de=await promptSelect(_0x1606db(0x9f),_0x130609);_0x4e6d95=_0x130609[_0x5f40de]??_0x130609[0x0];}let _0x489f1f=normalizeHookFunctionNode(_0x21c238['str']('function-node'));if(!_0x489f1f){if(_0x21c238[_0x1606db(0x93)]('function-node'))throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x74));if(_0x21c238[_0x1606db(0x7f)])throw CliErrors[_0x1606db(0xa3)](_0x1606db(0x75));const _0x482007=await promptSelect('Select\x20trigger\x20node:',['before',_0x1606db(0xb3)]);_0x489f1f=[_0x1606db(0x95),_0x1606db(0xb3)][_0x482007]??_0x1606db(0x95);}return{'alias':_0x45dd22,'datasetCode':_0x59f940,'datasetId':_0xbaf0bf,'operationType':_0x4e6d95,'functionNode':_0x489f1f};}async function promptSelect(_0x51de10,_0x954568){const _0x59ac9c=a30_0x3f3386;if(_0x954568[_0x59ac9c(0xa7)]===0x1)return 0x0;for(const [_0x49ca90,_0x4204ee]of _0x954568[_0x59ac9c(0xb4)]()){process[_0x59ac9c(0xae)][_0x59ac9c(0x84)]('\x20\x20'+(_0x49ca90+0x1)+'.\x20'+_0x4204ee+'\x0a');}const _0x5419a6=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x57a348=await new Promise(_0x45dbb2=>{const _0x520c4e=_0x59ac9c;_0x5419a6[_0x520c4e(0xbd)](_0x51de10+'\x20',_0x45dbb2);}),_0x5a88b7=Number[_0x59ac9c(0x80)](_0x57a348[_0x59ac9c(0xa1)](),0xa);if(Number[_0x59ac9c(0x71)](_0x5a88b7)&&_0x5a88b7>=0x1&&_0x5a88b7<=_0x954568[_0x59ac9c(0xa7)])return _0x5419a6[_0x59ac9c(0x9c)](),_0x5a88b7-0x1;process[_0x59ac9c(0xae)][_0x59ac9c(0x84)](_0x59ac9c(0x9a)+_0x954568[_0x59ac9c(0xa7)]+'.\x0a');}}function buildFilePath(_0x59a855,_0x3f88f3,_0x43c3fd,_0x2fc4d9){const _0x4ffcf8=a30_0x3f3386;if(_0x3f88f3==='HOOK'){if(!_0x2fc4d9)throw CliErrors['validation']('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x203af4=_0x2fc4d9[_0x4ffcf8(0xa8)]??_0x2fc4d9[_0x4ffcf8(0x86)];return join(_0x59a855['scriptsRootDir'],_0x4ffcf8(0xb9),_0x203af4,_0x2fc4d9[_0x4ffcf8(0xa4)],_0x2fc4d9[_0x4ffcf8(0xc7)],_0x43c3fd+_0x4ffcf8(0x8a));}return join(_0x59a855[_0x4ffcf8(0x85)],_0x3f88f3,_0x43c3fd+'.js');}export function generateTemplate(_0x340136,_0x3c4047,_0x253a9c,_0x2f9664,_0x223029){const _0x555235=a30_0x3f3386,_0x2d3cc9=_0x2f9664?.['trim']()||_0x555235(0xb5);if(_0x340136===_0x555235(0x90))return _0x555235(0xc6)+_0x2d3cc9+_0x555235(0xc3)+_0x3c4047+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x3c4047+_0x555235(0xb7)+_0x3c4047+_0x555235(0x9e);if(_0x340136===_0x555235(0x9b))return'/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x2d3cc9+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x253a9c+'/'+_0x3c4047+'\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x3c4047+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x223029)throw CliErrors['validation'](_0x555235(0x7b));return _0x555235(0x78)+_0x2d3cc9+_0x555235(0x81)+_0x253a9c+'/'+_0x223029['datasetCode']+'/'+_0x223029[_0x555235(0xa4)]+_0x555235(0x76)+_0x223029['functionNode']+_0x555235(0x94)+_0x3c4047+_0x555235(0x9e);}
@@ -1 +1 @@
1
- const a30_0x5604c4=a30_0x2130;(function(_0x7a82ad,_0x4e455e){const _0x4e65ca=a30_0x2130,_0x137583=_0x7a82ad();while(!![]){try{const _0x5a8f00=-parseInt(_0x4e65ca(0x1e2))/0x1*(-parseInt(_0x4e65ca(0x1d4))/0x2)+parseInt(_0x4e65ca(0x1be))/0x3+-parseInt(_0x4e65ca(0x1b3))/0x4*(-parseInt(_0x4e65ca(0x1c4))/0x5)+parseInt(_0x4e65ca(0x1d2))/0x6+parseInt(_0x4e65ca(0x1d6))/0x7*(parseInt(_0x4e65ca(0x1dd))/0x8)+-parseInt(_0x4e65ca(0x1f3))/0x9+-parseInt(_0x4e65ca(0x1e8))/0xa;if(_0x5a8f00===_0x4e455e)break;else _0x137583['push'](_0x137583['shift']());}catch(_0x477573){_0x137583['push'](_0x137583['shift']());}}}(a30_0x5d3b,0x7fa74));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';function a30_0x5d3b(){const _0x19d0a5=['force','Pull\x20only\x20this\x20script\x20type','6092784GqYorc','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x20failed','apiDir','includes','hookLocation','type','utf8','4FjQNmr','scriptsRoot','version','string','\x20pulled,\x20','question','str','skipped','yes','functionName','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','1748049fTlevy','Force\x20overwrite\x20local\x20unsynced\x20changes','validation','\x20skipped,\x20','message','stringify','1715415syrLzO','all','Would\x20inspect\x20','write','nonInteractive','local\x20unsynced\x20changes','ENDPOINT','scriptType','filePath','operationType','GET','COMMON','stderr','scriptContent','998712wVhzHX','HOOK','75902ejjnnI','datasetCode','1029MEgAYs','lockKey','Lock\x20scope\x20for\x20app\x20\x22','functions','trim','close','parse','36944Xqmddq','length','\x20remote\x20BFF\x20script(s)\x20for\x20pull','lockFilePath','bool','7kimuMV','Remote\x20script\x20missing\x20id.','pull','alias','Force\x20pull\x20cancelled.','map','8368770ftMWCX','push','appCode','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','toLowerCase','&type=','/api/management/library/scripts/list?appCode=','Pull\x20complete:\x20','apps'];a30_0x5d3b=function(){return _0x19d0a5;};return a30_0x5d3b();}function a30_0x2130(_0x34df71,_0x4a69ae){_0x34df71=_0x34df71-0x1ad;const _0x5d3bec=a30_0x5d3b();let _0x2130d6=_0x5d3bec[_0x34df71];return _0x2130d6;}export const bffPull={'service':'bff','command':a30_0x5604c4(0x1e4),'description':a30_0x5604c4(0x1eb),'risk':a30_0x5604c4(0x1c7),'flags':[{'name':a30_0x5604c4(0x1b1),'type':a30_0x5604c4(0x1b6),'description':a30_0x5604c4(0x1f2),'enum':[a30_0x5604c4(0x1cf),a30_0x5604c4(0x1ca),a30_0x5604c4(0x1d3)]},{'name':a30_0x5604c4(0x1f1),'type':'boolean','description':a30_0x5604c4(0x1bf)}],async 'dryRun'(_0x166961){const _0x2385a0=a30_0x5604c4,_0x51217c=loadBffProjectConfig(_0x166961['appCode']),_0x241e79=await readBffLockFile(_0x51217c[_0x2385a0(0x1e0)]),{appLock:_0x256edc}=ensureLockScope(_0x241e79??createEmptyBffLock(),_0x166961[_0x2385a0(0x1ea)],_0x51217c[_0x2385a0(0x1b4)],'pull'),_0x4703b5=normalizeBffType(_0x166961[_0x2385a0(0x1b9)](_0x2385a0(0x1b1)))??undefined,_0x1179b2=buildDatasetCodeToAliasMap(_0x166961['apiDir'],_0x166961[_0x2385a0(0x1ea)]),[_0x265e61,_0x3949b4]=await Promise[_0x2385a0(0x1c5)]([listBffScripts(_0x166961[_0x2385a0(0x1ea)],_0x4703b5),getBffScriptStatistics(_0x166961[_0x2385a0(0x1ea)])]),_0x792811=createHookLocationMap(_0x3949b4),_0x43a120=[];for(const _0x3e0bb3 of _0x265e61){const _0x4609da=resolveRemoteScriptTarget(_0x51217c,_0x3e0bb3,_0x792811,_0x256edc[_0x2385a0(0x1d9)],_0x1179b2);if(!_0x4609da){_0x43a120[_0x2385a0(0x1e9)]({'scriptType':_0x3e0bb3[_0x2385a0(0x1cb)],'functionName':_0x3e0bb3['functionName']??'','status':_0x2385a0(0x1ba),'reason':'unresolvable\x20target\x20path'});continue;}const _0x2f0d4b=_0x256edc[_0x2385a0(0x1d9)][_0x4609da[_0x2385a0(0x1d7)]],_0x21198c=_0x3e0bb3[_0x2385a0(0x1d1)]!=null?computeContentHash(_0x3e0bb3['scriptContent']):undefined,_0x5c6f57=await hasUnsyncedLocalChanges(_0x4609da[_0x2385a0(0x1cc)],_0x2f0d4b,_0x21198c);_0x43a120[_0x2385a0(0x1e9)]({'lockKey':_0x4609da['lockKey'],'filePath':_0x4609da[_0x2385a0(0x1cc)],'remoteId':_0x3e0bb3['id']??null,'status':_0x5c6f57?'conflict':'would_pull'});}return{'method':_0x2385a0(0x1ce),'url':_0x2385a0(0x1ee)+_0x166961['appCode']+(_0x4703b5?_0x2385a0(0x1ed)+_0x4703b5:''),'body':{'appCode':_0x166961[_0x2385a0(0x1ea)],'filterType':_0x4703b5??null,'files':_0x43a120},'description':_0x2385a0(0x1c6)+_0x43a120['length']+_0x2385a0(0x1df)};},async 'execute'(_0x3b9117){const _0x58ee12=a30_0x5604c4,_0x1f99d2=loadBffProjectConfig(_0x3b9117[_0x58ee12(0x1ea)]),_0x2e58dc=await readBffLockFile(_0x1f99d2[_0x58ee12(0x1e0)]),{lockData:_0x5be76b,appLock:_0x5ceabb}=ensureLockScope(_0x2e58dc??createEmptyBffLock(),_0x3b9117['appCode'],_0x1f99d2[_0x58ee12(0x1b4)],_0x58ee12(0x1e4)),_0x5e64d6=normalizeBffType(_0x3b9117[_0x58ee12(0x1b9)](_0x58ee12(0x1b1)))??undefined;if(_0x3b9117[_0x58ee12(0x1b9)](_0x58ee12(0x1b1))&&!_0x5e64d6)throw CliErrors[_0x58ee12(0x1c0)](_0x58ee12(0x1bd));const [_0x2d0a39,_0x4897a4]=await Promise['all']([listBffScripts(_0x3b9117[_0x58ee12(0x1ea)],_0x5e64d6),getBffScriptStatistics(_0x3b9117[_0x58ee12(0x1ea)])]);if(_0x2d0a39[_0x58ee12(0x1de)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x2aab84=_0x3b9117[_0x58ee12(0x1e1)](_0x58ee12(0x1f1));if(_0x2aab84&&!_0x3b9117[_0x58ee12(0x1c8)]){const _0x35d6c3=await confirmForce();if(!_0x35d6c3)throw CliErrors['cancelled'](_0x58ee12(0x1e6));}if(_0x2aab84&&_0x3b9117[_0x58ee12(0x1c8)]){}const _0x19bef8=buildDatasetCodeToAliasMap(_0x3b9117[_0x58ee12(0x1ae)],_0x3b9117[_0x58ee12(0x1ea)]),_0x460eea=createHookLocationMap(_0x4897a4),_0x139f6e=JSON[_0x58ee12(0x1dc)](JSON[_0x58ee12(0x1c3)](_0x5be76b)),_0x3f5c6f=_0x3b9117[_0x58ee12(0x1ea)],_0x5135e4=_0x139f6e[_0x58ee12(0x1f0)][_0x3f5c6f];if(!_0x5135e4)throw new Error(_0x58ee12(0x1d8)+_0x3f5c6f+_0x58ee12(0x1f4));const _0xae93a6=[],_0x5816cf=[],_0x5b5fb3=[];for(const _0xc0da7c of _0x2d0a39){const _0x290cc9=resolveRemoteScriptTarget(_0x1f99d2,_0xc0da7c,_0x460eea,_0x5ceabb[_0x58ee12(0x1d9)],_0x19bef8);if(!_0x290cc9){_0x5816cf['push']({'lockKey':_0xc0da7c[_0x58ee12(0x1cb)]+'/'+_0xc0da7c[_0x58ee12(0x1bc)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x465212=_0x5ceabb['functions'][_0x290cc9['lockKey']];try{if(!_0xc0da7c['id'])throw new Error(_0x58ee12(0x1e3));if(_0xc0da7c[_0x58ee12(0x1d1)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x5b5b44=_0xc0da7c['scriptContent'],_0x38f529=computeContentHash(_0x5b5b44);if(!_0x2aab84){const _0x1e51e4=await hasUnsyncedLocalChanges(_0x290cc9[_0x58ee12(0x1cc)],_0x465212,_0x38f529);if(_0x1e51e4){_0x5816cf[_0x58ee12(0x1e9)]({'lockKey':_0x290cc9[_0x58ee12(0x1d7)],'reason':_0x58ee12(0x1c9)});continue;}}await ensureParentDirectory(_0x290cc9[_0x58ee12(0x1cc)]),await writeFile(_0x290cc9[_0x58ee12(0x1cc)],_0x5b5b44,_0x58ee12(0x1b2));const _0x5da18a={'hash':_0x38f529,'remoteId':_0xc0da7c['id'],'version':_0xc0da7c[_0x58ee12(0x1b5)]};_0x290cc9[_0x58ee12(0x1b1)]==='HOOK'&&_0x290cc9[_0x58ee12(0x1b0)]&&(_0x5da18a[_0x58ee12(0x1e5)]=_0x290cc9[_0x58ee12(0x1b0)][_0x58ee12(0x1e5)],_0x5da18a[_0x58ee12(0x1d5)]=_0x290cc9[_0x58ee12(0x1b0)]['datasetCode'],_0x5da18a[_0x58ee12(0x1cd)]=_0x290cc9[_0x58ee12(0x1b0)]['operationType'],_0x5da18a['functionNode']=_0x290cc9['hookLocation']['functionNode']),_0x5135e4[_0x58ee12(0x1d9)][_0x290cc9[_0x58ee12(0x1d7)]]=_0x5da18a,_0xae93a6[_0x58ee12(0x1e9)]({'lockKey':_0x290cc9[_0x58ee12(0x1d7)],'remoteId':_0xc0da7c['id']});}catch(_0x478191){_0x5b5fb3['push']({'lockKey':_0x290cc9[_0x58ee12(0x1d7)],'error':_0x478191 instanceof Error?_0x478191[_0x58ee12(0x1c2)]:String(_0x478191)});}}return _0x5135e4['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x1f99d2['lockFilePath'],_0x139f6e),{'ok':_0x5b5fb3['length']===0x0,'data':{'pulled':_0xae93a6,'skipped':_0x5816cf,'failed':_0x5b5fb3},'message':_0x58ee12(0x1ef)+_0xae93a6[_0x58ee12(0x1de)]+_0x58ee12(0x1b7)+_0x5816cf['length']+_0x58ee12(0x1c1)+_0x5b5fb3[_0x58ee12(0x1de)]+_0x58ee12(0x1ad)};}};async function hasUnsyncedLocalChanges(_0x2465f7,_0x540870,_0x5de23f){if(!await fileExists(_0x2465f7))return![];const _0x2a4eb5=await computeFileHash(_0x2465f7);if(!_0x540870)return _0x5de23f?_0x2a4eb5!==_0x5de23f:!![];return _0x2a4eb5!==_0x540870['hash'];}function buildDatasetCodeToAliasMap(_0x1e945b,_0x552f47){const _0x40facc=a30_0x5604c4,_0x558de4=loadAliasMap(_0x1e945b,undefined,resolveApiFilePath(_0x1e945b,_0x552f47));return new Map(_0x558de4[_0x40facc(0x1e7)](_0x1cb786=>[_0x1cb786[_0x40facc(0x1d5)],_0x1cb786[_0x40facc(0x1e5)]]));}async function confirmForce(){const _0x36a1ee=a30_0x5604c4,_0x616fbe=createInterface({'input':process['stdin'],'output':process[_0x36a1ee(0x1d0)]}),_0x2c5630=await new Promise(_0x3beb7c=>{const _0x2b10f0=_0x36a1ee;_0x616fbe[_0x2b10f0(0x1b8)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x3beb7c);});return _0x616fbe[_0x36a1ee(0x1db)](),['y',_0x36a1ee(0x1bb)][_0x36a1ee(0x1af)](_0x2c5630[_0x36a1ee(0x1da)]()[_0x36a1ee(0x1ec)]());}
1
+ const a31_0x588169=a31_0x30aa;(function(_0x4e628d,_0x3dfe14){const _0x33f88d=a31_0x30aa,_0x451b15=_0x4e628d();while(!![]){try{const _0x30716f=-parseInt(_0x33f88d(0x150))/0x1+-parseInt(_0x33f88d(0x158))/0x2*(-parseInt(_0x33f88d(0x13f))/0x3)+parseInt(_0x33f88d(0x145))/0x4*(-parseInt(_0x33f88d(0x149))/0x5)+-parseInt(_0x33f88d(0x16d))/0x6*(parseInt(_0x33f88d(0x172))/0x7)+parseInt(_0x33f88d(0x162))/0x8*(parseInt(_0x33f88d(0x165))/0x9)+-parseInt(_0x33f88d(0x15b))/0xa+parseInt(_0x33f88d(0x156))/0xb;if(_0x30716f===_0x3dfe14)break;else _0x451b15['push'](_0x451b15['shift']());}catch(_0x544a38){_0x451b15['push'](_0x451b15['shift']());}}}(a31_0x11bb,0xce205));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a31_0x11bb(){const _0x494230=['bool','Force\x20pull\x20cancelled.','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','filePath','skipped','stderr','123ZwWriT','close','datasetCode','lastSync','all','conflict','24eGAqBX','scriptsRoot','message','version','564105DHhHEK','scriptContent','pull','parse','\x22\x20not\x20found\x20after\x20ensureLockScope.','push','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','141329GVJKBt','apiDir','hash','COMMON','lockFilePath','type','4550018TqVfCU','string','75938ZSSboS','force','\x20failed','7215440ITxfkb','includes','lockKey','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','toLowerCase','length','/api/management/library/scripts/list?appCode=','16cNrYZC','would_pull','&type=','4325274JjyREH','No\x20remote\x20BFF\x20scripts\x20found.','operationType','map','\x20remote\x20BFF\x20script(s)\x20for\x20pull','trim','appCode','scriptType','3284682vBXEGB','HOOK','functions','local\x20unsynced\x20changes','str','7PiJsxX','boolean','Remote\x20script\x20missing\x20id.','\x20pulled,\x20','hookLocation','functionNode','functionName','Lock\x20scope\x20for\x20app\x20\x22','Would\x20inspect\x20','alias','yes'];a31_0x11bb=function(){return _0x494230;};return a31_0x11bb();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a31_0x588169(0x14b),'description':a31_0x588169(0x14f),'risk':'write','flags':[{'name':a31_0x588169(0x155),'type':a31_0x588169(0x157),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a31_0x588169(0x153),'ENDPOINT',a31_0x588169(0x16e)]},{'name':'force','type':a31_0x588169(0x173),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4e441d){const _0x55738f=a31_0x588169,_0x57fcaf=loadBffProjectConfig(_0x4e441d[_0x55738f(0x16b)]),_0x58dd51=await readBffLockFile(_0x57fcaf['lockFilePath']),{appLock:_0x228af8}=ensureLockScope(_0x58dd51??createEmptyBffLock(),_0x4e441d[_0x55738f(0x16b)],_0x57fcaf['scriptsRoot'],_0x55738f(0x14b)),_0x3586ec=normalizeBffType(_0x4e441d[_0x55738f(0x171)](_0x55738f(0x155)))??undefined,_0xc40218=buildDatasetCodeToAliasMap(_0x4e441d[_0x55738f(0x151)],_0x4e441d[_0x55738f(0x16b)]),[_0x164fc0,_0x5c1fec]=await Promise['all']([listBffScripts(_0x4e441d['appCode'],_0x3586ec),getBffScriptStatistics(_0x4e441d[_0x55738f(0x16b)])]),_0x4eeace=createHookLocationMap(_0x5c1fec),_0x5d5bc1=[];for(const _0xf55a11 of _0x164fc0){const _0xb9363d=resolveRemoteScriptTarget(_0x57fcaf,_0xf55a11,_0x4eeace,_0x228af8[_0x55738f(0x16f)],_0xc40218);if(!_0xb9363d){_0x5d5bc1['push']({'scriptType':_0xf55a11['scriptType'],'functionName':_0xf55a11[_0x55738f(0x178)]??'','status':_0x55738f(0x13d),'reason':'unresolvable\x20target\x20path'});continue;}const _0x552c42=_0x228af8[_0x55738f(0x16f)][_0xb9363d[_0x55738f(0x15d)]],_0x3d2cff=_0xf55a11[_0x55738f(0x14a)]!=null?computeContentHash(_0xf55a11[_0x55738f(0x14a)]):undefined,_0x539da3=await hasUnsyncedLocalChanges(_0xb9363d[_0x55738f(0x13c)],_0x552c42,_0x3d2cff);_0x5d5bc1[_0x55738f(0x14e)]({'lockKey':_0xb9363d[_0x55738f(0x15d)],'filePath':_0xb9363d['filePath'],'remoteId':_0xf55a11['id']??null,'status':_0x539da3?_0x55738f(0x144):_0x55738f(0x163)});}return{'method':'GET','url':_0x55738f(0x161)+_0x4e441d['appCode']+(_0x3586ec?_0x55738f(0x164)+_0x3586ec:''),'body':{'appCode':_0x4e441d[_0x55738f(0x16b)],'filterType':_0x3586ec??null,'files':_0x5d5bc1},'description':_0x55738f(0x136)+_0x5d5bc1[_0x55738f(0x160)]+_0x55738f(0x169)};},async 'execute'(_0x4b345e){const _0x454c62=a31_0x588169,_0x2ecf4a=loadBffProjectConfig(_0x4b345e[_0x454c62(0x16b)]),_0x141b51=await readBffLockFile(_0x2ecf4a[_0x454c62(0x154)]),{lockData:_0x6e2b11,appLock:_0x14ee8b}=ensureLockScope(_0x141b51??createEmptyBffLock(),_0x4b345e['appCode'],_0x2ecf4a[_0x454c62(0x146)],_0x454c62(0x14b)),_0x3e995c=normalizeBffType(_0x4b345e[_0x454c62(0x171)](_0x454c62(0x155)))??undefined;if(_0x4b345e[_0x454c62(0x171)](_0x454c62(0x155))&&!_0x3e995c)throw CliErrors['validation'](_0x454c62(0x15e));const [_0x530ca5,_0x2e0947]=await Promise[_0x454c62(0x143)]([listBffScripts(_0x4b345e[_0x454c62(0x16b)],_0x3e995c),getBffScriptStatistics(_0x4b345e[_0x454c62(0x16b)])]);if(_0x530ca5[_0x454c62(0x160)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x454c62(0x166)};const _0x2e230c=_0x4b345e[_0x454c62(0x139)](_0x454c62(0x159));if(_0x2e230c&&!_0x4b345e['nonInteractive']){const _0x226895=await confirmForce();if(!_0x226895)throw CliErrors['cancelled'](_0x454c62(0x13a));}if(_0x2e230c&&_0x4b345e['nonInteractive']){}const _0x30b19e=buildDatasetCodeToAliasMap(_0x4b345e[_0x454c62(0x151)],_0x4b345e[_0x454c62(0x16b)]),_0x577445=createHookLocationMap(_0x2e0947),_0x44c897=JSON[_0x454c62(0x14c)](JSON['stringify'](_0x6e2b11)),_0x1bc839=_0x4b345e[_0x454c62(0x16b)],_0x444318=_0x44c897['apps'][_0x1bc839];if(!_0x444318)throw new Error(_0x454c62(0x135)+_0x1bc839+_0x454c62(0x14d));const _0x22e7ea=[],_0xbb90fe=[],_0x7dc2bf=[];for(const _0x20b704 of _0x530ca5){const _0x54c5ab=resolveRemoteScriptTarget(_0x2ecf4a,_0x20b704,_0x577445,_0x14ee8b[_0x454c62(0x16f)],_0x30b19e);if(!_0x54c5ab){_0xbb90fe['push']({'lockKey':_0x20b704[_0x454c62(0x16c)]+'/'+_0x20b704[_0x454c62(0x178)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x2fe894=_0x14ee8b[_0x454c62(0x16f)][_0x54c5ab[_0x454c62(0x15d)]];try{if(!_0x20b704['id'])throw new Error(_0x454c62(0x174));if(_0x20b704[_0x454c62(0x14a)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x33566e=_0x20b704['scriptContent'],_0x388fdf=computeContentHash(_0x33566e);if(!_0x2e230c){const _0x4beaf0=await hasUnsyncedLocalChanges(_0x54c5ab['filePath'],_0x2fe894,_0x388fdf);if(_0x4beaf0){_0xbb90fe[_0x454c62(0x14e)]({'lockKey':_0x54c5ab[_0x454c62(0x15d)],'reason':_0x454c62(0x170)});continue;}}await ensureParentDirectory(_0x54c5ab[_0x454c62(0x13c)]),await writeFile(_0x54c5ab[_0x454c62(0x13c)],_0x33566e,'utf8');const _0x253beb={'hash':_0x388fdf,'remoteId':_0x20b704['id'],'version':_0x20b704[_0x454c62(0x148)]};_0x54c5ab['type']===_0x454c62(0x16e)&&_0x54c5ab[_0x454c62(0x176)]&&(_0x253beb['alias']=_0x54c5ab[_0x454c62(0x176)][_0x454c62(0x137)],_0x253beb[_0x454c62(0x141)]=_0x54c5ab[_0x454c62(0x176)][_0x454c62(0x141)],_0x253beb[_0x454c62(0x167)]=_0x54c5ab[_0x454c62(0x176)]['operationType'],_0x253beb['functionNode']=_0x54c5ab[_0x454c62(0x176)][_0x454c62(0x177)]),_0x444318['functions'][_0x54c5ab['lockKey']]=_0x253beb,_0x22e7ea['push']({'lockKey':_0x54c5ab[_0x454c62(0x15d)],'remoteId':_0x20b704['id']});}catch(_0x4bf79b){_0x7dc2bf[_0x454c62(0x14e)]({'lockKey':_0x54c5ab[_0x454c62(0x15d)],'error':_0x4bf79b instanceof Error?_0x4bf79b[_0x454c62(0x147)]:String(_0x4bf79b)});}}return _0x444318[_0x454c62(0x142)]=new Date()['toISOString'](),await writeBffLockFile(_0x2ecf4a[_0x454c62(0x154)],_0x44c897),{'ok':_0x7dc2bf[_0x454c62(0x160)]===0x0,'data':{'pulled':_0x22e7ea,'skipped':_0xbb90fe,'failed':_0x7dc2bf},'message':'Pull\x20complete:\x20'+_0x22e7ea[_0x454c62(0x160)]+_0x454c62(0x175)+_0xbb90fe[_0x454c62(0x160)]+'\x20skipped,\x20'+_0x7dc2bf[_0x454c62(0x160)]+_0x454c62(0x15a)};}};function a31_0x30aa(_0x4c0d18,_0x5a10dc){_0x4c0d18=_0x4c0d18-0x135;const _0x11bb49=a31_0x11bb();let _0x30aa48=_0x11bb49[_0x4c0d18];return _0x30aa48;}async function hasUnsyncedLocalChanges(_0x3b6751,_0x4d9cb3,_0x3e0638){const _0x7069cb=a31_0x588169;if(!await fileExists(_0x3b6751))return![];const _0x4e7d3d=await computeFileHash(_0x3b6751);if(!_0x4d9cb3)return _0x3e0638?_0x4e7d3d!==_0x3e0638:!![];return _0x4e7d3d!==_0x4d9cb3[_0x7069cb(0x152)];}function buildDatasetCodeToAliasMap(_0x585ea3,_0x5cc32f){const _0x3cd9cc=a31_0x588169,_0x5a91fd=loadAliasMap(_0x585ea3,undefined,resolveApiFilePath(_0x585ea3,_0x5cc32f));return new Map(_0x5a91fd[_0x3cd9cc(0x168)](_0x5f3bd8=>[_0x5f3bd8['datasetCode'],_0x5f3bd8[_0x3cd9cc(0x137)]]));}async function confirmForce(){const _0x24cfc5=a31_0x588169,_0x6919da=createInterface({'input':process['stdin'],'output':process[_0x24cfc5(0x13e)]}),_0x1a0375=await new Promise(_0x5f219c=>{const _0x582d24=_0x24cfc5;_0x6919da['question'](_0x582d24(0x13b),_0x5f219c);});return _0x6919da[_0x24cfc5(0x140)](),['y',_0x24cfc5(0x138)][_0x24cfc5(0x15c)](_0x1a0375[_0x24cfc5(0x16a)]()[_0x24cfc5(0x15f)]());}
@@ -1 +1 @@
1
- const a31_0x1de7b3=a31_0x4baa;(function(_0x1933d4,_0x423cd2){const _0x4de992=a31_0x4baa,_0x4ca482=_0x1933d4();while(!![]){try{const _0x53413f=-parseInt(_0x4de992(0x1c7))/0x1+-parseInt(_0x4de992(0x1b1))/0x2*(parseInt(_0x4de992(0x1d4))/0x3)+-parseInt(_0x4de992(0x1a9))/0x4+-parseInt(_0x4de992(0x1cb))/0x5+-parseInt(_0x4de992(0x1ce))/0x6+-parseInt(_0x4de992(0x1bf))/0x7*(parseInt(_0x4de992(0x1ad))/0x8)+parseInt(_0x4de992(0x1a1))/0x9;if(_0x53413f===_0x423cd2)break;else _0x4ca482['push'](_0x4ca482['shift']());}catch(_0x47b2ea){_0x4ca482['push'](_0x4ca482['shift']());}}}(a31_0x5c33,0x9f389));function a31_0x5c33(){const _0x14c53b=['validation','filePath','alias','2273215nXkZiW','Incomplete\x20HOOK\x20path:\x20','filter','817818ZdAKsv','map','/api/management/library/scripts/save','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','POST','667287PZGtwp','Would\x20inspect\x20','code','aliasToDatasetCode','push','functions','description','remoteId','datasetCode','operationType','would_push','bff','Push\x20complete:\x20','string','values','unchanged','Force\x20push\x20ignoring\x20hash\x20protection','28870785ZAtsyO','name','version','Cannot\x20resolve\x20dataset\x20for\x20\x22','force','Push\x20local\x20BFF\x20scripts\x20to\x20remote','\x20skipped,\x20','datasetId','2747612DXTwAE','high-risk-write','lockKey','\x20failed','23224HMGgUX','appCode','get','\x20uploaded,\x20','6TiaIKt','message','type','HOOK','Local\x20function\x20not\x20found:\x20','\x20local\x20BFF\x20script(s)\x20for\x20push','set','lockFilePath','\x22.\x20','functionNode','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','Run\x20`','str','ENDPOINT','1099EPaFrT','bool','COMMON','toISOString','lastSync','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','datasetCodeToId','length','154789JiibHz'];a31_0x5c33=function(){return _0x14c53b;};return a31_0x5c33();}import{readFile}from'node:fs/promises';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 a31_0x4baa(_0xbb02e7,_0x644bf8){_0xbb02e7=_0xbb02e7-0x193;const _0x5c3341=a31_0x5c33();let _0x4baad3=_0x5c3341[_0xbb02e7];return _0x4baad3;}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':a31_0x1de7b3(0x19b),'command':a31_0x1de7b3(0x194),'description':a31_0x1de7b3(0x1a6),'risk':a31_0x1de7b3(0x1aa),'flags':[{'name':'type','type':a31_0x1de7b3(0x19d),'description':'Push\x20only\x20this\x20script\x20type','enum':[a31_0x1de7b3(0x1c1),a31_0x1de7b3(0x1be),a31_0x1de7b3(0x1b4)]},{'name':a31_0x1de7b3(0x1a2),'type':a31_0x1de7b3(0x19d),'description':a31_0x1de7b3(0x1c4)},{'name':'force','type':'boolean','description':a31_0x1de7b3(0x1a0)}],async 'dryRun'(_0x2697f4){const _0x3da6ad=a31_0x1de7b3,_0x236be6=loadBffProjectConfig(_0x2697f4['appCode']),_0x1793d8=await readBffLockFile(_0x236be6[_0x3da6ad(0x1b8)]),{appLock:_0x419e02}=ensureLockScope(_0x1793d8??createEmptyBffLock(),_0x2697f4[_0x3da6ad(0x1ae)],_0x236be6['scriptsRoot'],'push'),_0x3c1360=await getTargetFunctions(_0x236be6,_0x2697f4),_0x4db68b=_0x2697f4[_0x3da6ad(0x1c0)]('force'),_0x45f541=[];for(const _0x5348a5 of _0x3c1360){const _0x13bb80=await computeFileHash(_0x5348a5[_0x3da6ad(0x1c9)]),_0x44290a=_0x419e02[_0x3da6ad(0x195)][_0x5348a5[_0x3da6ad(0x1ab)]],_0xf865b6=!!_0x44290a&&_0x44290a['hash']===_0x13bb80;_0x45f541[_0x3da6ad(0x194)]({'lockKey':_0x5348a5[_0x3da6ad(0x1ab)],'filePath':_0x5348a5[_0x3da6ad(0x1c9)],'remoteId':_0x44290a?.[_0x3da6ad(0x197)]??null,'mode':_0x44290a?.['remoteId']?'update':'create','status':!_0x4db68b&&_0xf865b6?_0x3da6ad(0x19f):_0x3da6ad(0x19a)});}return{'method':_0x3da6ad(0x1d3),'url':_0x3da6ad(0x1d0),'body':{'appCode':_0x2697f4['appCode'],'force':_0x4db68b,'files':_0x45f541},'description':_0x3da6ad(0x1d5)+_0x45f541[_0x3da6ad(0x1c6)]+_0x3da6ad(0x1b6)};},async 'execute'(_0x4f536e){const _0x47af14=a31_0x1de7b3,_0x319852=loadBffProjectConfig(_0x4f536e[_0x47af14(0x1ae)]),_0x505521=await readBffLockFile(_0x319852['lockFilePath']),{lockData:_0x45b447,appLock:_0x1759fa}=ensureLockScope(_0x505521??createEmptyBffLock(),_0x4f536e[_0x47af14(0x1ae)],_0x319852['scriptsRoot'],_0x47af14(0x194)),_0x135996=await getTargetFunctions(_0x319852,_0x4f536e);if(_0x135996[_0x47af14(0x1c6)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x180574=_0x4f536e['bool'](_0x47af14(0x1a5)),_0x29d0d4=await buildHookMaps(_0x4f536e[_0x47af14(0x1ae)],_0x4f536e['apiDir'],_0x135996,_0x1759fa),_0x1f512e=[],_0x29d2de=[],_0x265edd=[];for(const _0x4b8fe6 of _0x135996){const _0x2f1989=await computeFileHash(_0x4b8fe6[_0x47af14(0x1c9)]),_0x17a53c=_0x1759fa['functions'][_0x4b8fe6['lockKey']];if(!_0x180574&&_0x17a53c&&_0x17a53c['hash']===_0x2f1989){_0x29d2de[_0x47af14(0x194)]({'lockKey':_0x4b8fe6[_0x47af14(0x1ab)],'reason':_0x47af14(0x19f)});continue;}try{await uploadSingleFunction(_0x4f536e[_0x47af14(0x1ae)],_0x4b8fe6,_0x1759fa,_0x29d0d4);const _0x5ee1b1=_0x1759fa[_0x47af14(0x195)][_0x4b8fe6[_0x47af14(0x1ab)]];_0x1f512e['push']({'lockKey':_0x4b8fe6[_0x47af14(0x1ab)],'remoteId':_0x5ee1b1?.[_0x47af14(0x197)]??0x0});}catch(_0x2702b2){_0x265edd['push']({'lockKey':_0x4b8fe6[_0x47af14(0x1ab)],'error':_0x2702b2 instanceof Error?_0x2702b2[_0x47af14(0x1b2)]:String(_0x2702b2)});}}return _0x1759fa[_0x47af14(0x1c3)]=new Date()[_0x47af14(0x1c2)](),await writeBffLockFile(_0x319852[_0x47af14(0x1b8)],_0x45b447),{'ok':_0x265edd[_0x47af14(0x1c6)]===0x0,'data':{'uploaded':_0x1f512e,'skipped':_0x29d2de,'failed':_0x265edd},'message':_0x47af14(0x19c)+_0x1f512e[_0x47af14(0x1c6)]+_0x47af14(0x1b0)+_0x29d2de['length']+_0x47af14(0x1a7)+_0x265edd[_0x47af14(0x1c6)]+_0x47af14(0x1ac)};}};async function getTargetFunctions(_0x3bb8be,_0x27f536){const _0x2b2c62=a31_0x1de7b3,_0x232fdb=_0x27f536[_0x2b2c62(0x1bd)](_0x2b2c62(0x1b3)),_0x2409af=_0x27f536['str'](_0x2b2c62(0x1a2)),_0x2737bc=normalizeBffType(_0x232fdb)??undefined;if(_0x2409af&&!_0x2737bc)throw CliErrors['validation'](_0x2b2c62(0x1bb));const _0x13e7d3=await scanLocalBffFunctions(_0x3bb8be,_0x2737bc);if(_0x2409af){const _0x46eb80=_0x13e7d3[_0x2b2c62(0x1cd)](_0x265492=>_0x265492[_0x2b2c62(0x1a2)]===_0x2409af);if(_0x46eb80[_0x2b2c62(0x1c6)]===0x0)throw CliErrors[_0x2b2c62(0x1c8)](_0x2b2c62(0x1b5)+_0x2737bc+'/'+_0x2409af);return _0x46eb80;}return _0x13e7d3;}async function buildHookMaps(_0x3d1dd4,_0x5039b7,_0x18c100,_0x186610){const _0xc0d745=a31_0x1de7b3,_0x42c709=_0x18c100['some'](_0x250a3d=>_0x250a3d[_0xc0d745(0x1b3)]===_0xc0d745(0x1b4));if(!_0x42c709)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x218f50=loadAliasMap(_0x5039b7,undefined,resolveApiFilePath(_0x5039b7,_0x3d1dd4)),_0x1f4244=new Map(_0x218f50[_0xc0d745(0x1cf)](_0x4ea9b8=>[_0x4ea9b8[_0xc0d745(0x1ca)],_0x4ea9b8['datasetCode']]));for(const _0x2ca216 of Object[_0xc0d745(0x19e)](_0x186610[_0xc0d745(0x195)])){_0x2ca216[_0xc0d745(0x1ca)]&&_0x2ca216[_0xc0d745(0x198)]&&!_0x1f4244['has'](_0x2ca216[_0xc0d745(0x1ca)])&&_0x1f4244[_0xc0d745(0x1b7)](_0x2ca216[_0xc0d745(0x1ca)],_0x2ca216[_0xc0d745(0x198)]);}const _0x424f8d=await listDatasets(_0x3d1dd4),_0x4d04f2=new Map(_0x424f8d['map'](_0x27e87e=>[_0x27e87e[_0xc0d745(0x1d6)],_0x27e87e['id']]));return{'aliasToDatasetCode':_0x1f4244,'datasetCodeToId':_0x4d04f2};}async function uploadSingleFunction(_0x32466b,_0x12dc1c,_0x491d88,_0x4a280d){const _0x118791=a31_0x1de7b3,_0x2f5fb5=await readFile(_0x12dc1c[_0x118791(0x1c9)],'utf8'),_0x1152f8=await computeFileHash(_0x12dc1c[_0x118791(0x1c9)]),_0x48d4d6=_0x491d88[_0x118791(0x195)][_0x12dc1c[_0x118791(0x1ab)]];if(_0x48d4d6?.['remoteId']&&_0x48d4d6[_0x118791(0x1a3)]==null)throw CliErrors['validation'](_0x12dc1c[_0x118791(0x1ab)]+_0x118791(0x1d2));let _0x3dd42d=extractScriptDescription(_0x2f5fb5);if(!_0x3dd42d&&_0x48d4d6?.[_0x118791(0x197)]){const _0x566114=await getBffScriptInfo(_0x48d4d6[_0x118791(0x197)]);_0x3dd42d=_0x566114[_0x118791(0x196)]||undefined;}const _0x524c0a={'appCode':_0x32466b,'functionName':_0x12dc1c[_0x118791(0x1a2)],'scriptType':_0x12dc1c[_0x118791(0x1b3)],'scriptContent':_0x2f5fb5};if(_0x48d4d6?.[_0x118791(0x197)])_0x524c0a['id']=_0x48d4d6['remoteId'];if(_0x48d4d6?.['version']!=null)_0x524c0a[_0x118791(0x1a3)]=_0x48d4d6[_0x118791(0x1a3)];if(_0x3dd42d)_0x524c0a[_0x118791(0x196)]=_0x3dd42d;if(_0x12dc1c[_0x118791(0x1b3)]===_0x118791(0x1b4)){const _0x3643cc=_0x12dc1c[_0x118791(0x1ca)];if(!_0x3643cc||!_0x12dc1c[_0x118791(0x199)]||!_0x12dc1c[_0x118791(0x1ba)])throw CliErrors[_0x118791(0x1c8)](_0x118791(0x1cc)+_0x12dc1c[_0x118791(0x1ab)]);const _0x1c94a4=_0x4a280d[_0x118791(0x193)]['get'](_0x3643cc)??_0x48d4d6?.['datasetCode']??_0x3643cc,_0x4a25f5=_0x4a280d[_0x118791(0x1c5)][_0x118791(0x1af)](_0x1c94a4);if(!_0x4a25f5)throw CliErrors[_0x118791(0x1c8)](_0x118791(0x1a4)+_0x3643cc+_0x118791(0x1b9)+(_0x118791(0x1bc)+CLI_BIN_NAME+_0x118791(0x1d1)));_0x524c0a[_0x118791(0x1a8)]=_0x4a25f5,_0x524c0a['operationType']=_0x12dc1c[_0x118791(0x199)],_0x524c0a[_0x118791(0x1ba)]=_0x12dc1c['functionNode'];}const _0x331d00=await saveBffScript(_0x524c0a),_0x149d57=await getBffScriptInfo(_0x331d00),_0x53c044={'hash':_0x1152f8,'remoteId':_0x331d00,'version':_0x149d57[_0x118791(0x1a3)]};if(_0x12dc1c[_0x118791(0x1b3)]===_0x118791(0x1b4)){const _0x2be654=_0x12dc1c[_0x118791(0x1ca)],_0x517a41=_0x4a280d['aliasToDatasetCode'][_0x118791(0x1af)](_0x2be654)??_0x48d4d6?.[_0x118791(0x198)]??_0x2be654;_0x4a280d[_0x118791(0x193)]['has'](_0x2be654)?_0x53c044[_0x118791(0x1ca)]=_0x2be654:_0x53c044['alias']=_0x48d4d6?.[_0x118791(0x1ca)],_0x53c044['datasetCode']=_0x517a41,_0x53c044['operationType']=_0x12dc1c['operationType'],_0x53c044[_0x118791(0x1ba)]=_0x12dc1c[_0x118791(0x1ba)];}_0x491d88['functions'][_0x12dc1c['lockKey']]=_0x53c044;}
1
+ const a32_0x3f979a=a32_0x3ecb;(function(_0x1cf5cb,_0xb18b99){const _0x3a47eb=a32_0x3ecb,_0x252e1c=_0x1cf5cb();while(!![]){try{const _0x3d67ef=parseInt(_0x3a47eb(0x165))/0x1*(parseInt(_0x3a47eb(0x12d))/0x2)+parseInt(_0x3a47eb(0x14b))/0x3+-parseInt(_0x3a47eb(0x150))/0x4*(parseInt(_0x3a47eb(0x13b))/0x5)+parseInt(_0x3a47eb(0x14f))/0x6*(-parseInt(_0x3a47eb(0x159))/0x7)+-parseInt(_0x3a47eb(0x15b))/0x8+-parseInt(_0x3a47eb(0x126))/0x9*(parseInt(_0x3a47eb(0x15c))/0xa)+-parseInt(_0x3a47eb(0x140))/0xb*(-parseInt(_0x3a47eb(0x134))/0xc);if(_0x3d67ef===_0xb18b99)break;else _0x252e1c['push'](_0x252e1c['shift']());}catch(_0x2ff8aa){_0x252e1c['push'](_0x252e1c['shift']());}}}(a32_0x34a1,0x2b6e7));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';function a32_0x3ecb(_0x7732ec,_0x5abb28){_0x7732ec=_0x7732ec-0x11c;const _0x34a19b=a32_0x34a1();let _0x3ecb7f=_0x34a19b[_0x7732ec];return _0x3ecb7f;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';function a32_0x34a1(){const _0x3f2dfd=['4bOJMii','some','aliasToDatasetCode','datasetCode','update','filter','force','str','COMMON','7yEnWjU','map','286584mAtmre','30DYdQAo','apiDir',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','has','code','Push\x20complete:\x20','lockFilePath','create','operationType','167269cCaRUk','Local\x20function\x20not\x20found:\x20','Push\x20only\x20this\x20script\x20type','Cannot\x20resolve\x20dataset\x20for\x20\x22','string','length','push','description','lastSync','get','remoteId','856332kzcBsk','functions','HOOK','/api/management/library/scripts/save','bool','alias','ENDPOINT','2XSQMAC','toISOString','filePath','high-risk-write','\x20uploaded,\x20','message','Incomplete\x20HOOK\x20path:\x20','278904ulJcGq','bff','set','Push\x20local\x20BFF\x20scripts\x20to\x20remote','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','datasetId','validation','564430DEOsER','functionNode','would_push','version','appCode','220admQNq','\x20local\x20BFF\x20script(s)\x20for\x20push','type','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','unchanged','scriptsRoot','\x20failed','lockKey','POST','hash','boolean','94611MaDaTl','utf8','name','Force\x20push\x20ignoring\x20hash\x20protection','309588qsRpLM'];a32_0x34a1=function(){return _0x3f2dfd;};return a32_0x34a1();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a32_0x3f979a(0x135),'command':'push','description':a32_0x3f979a(0x137),'risk':a32_0x3f979a(0x130),'flags':[{'name':a32_0x3f979a(0x142),'type':a32_0x3f979a(0x11f),'description':a32_0x3f979a(0x11d),'enum':[a32_0x3f979a(0x158),a32_0x3f979a(0x12c),a32_0x3f979a(0x128)]},{'name':a32_0x3f979a(0x14d),'type':a32_0x3f979a(0x11f),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a32_0x3f979a(0x156),'type':a32_0x3f979a(0x14a),'description':a32_0x3f979a(0x14e)}],async 'dryRun'(_0x1b87de){const _0x4932bc=a32_0x3f979a,_0x2ddb73=loadBffProjectConfig(_0x1b87de[_0x4932bc(0x13f)]),_0xbcc0cf=await readBffLockFile(_0x2ddb73[_0x4932bc(0x162)]),{appLock:_0x3a8081}=ensureLockScope(_0xbcc0cf??createEmptyBffLock(),_0x1b87de[_0x4932bc(0x13f)],_0x2ddb73[_0x4932bc(0x145)],_0x4932bc(0x121)),_0x5e570e=await getTargetFunctions(_0x2ddb73,_0x1b87de),_0x146628=_0x1b87de['bool'](_0x4932bc(0x156)),_0x24817c=[];for(const _0x4489b9 of _0x5e570e){const _0x53949c=await computeFileHash(_0x4489b9[_0x4932bc(0x12f)]),_0x2d84c5=_0x3a8081[_0x4932bc(0x127)][_0x4489b9[_0x4932bc(0x147)]],_0x56a115=!!_0x2d84c5&&_0x2d84c5['hash']===_0x53949c;_0x24817c[_0x4932bc(0x121)]({'lockKey':_0x4489b9['lockKey'],'filePath':_0x4489b9['filePath'],'remoteId':_0x2d84c5?.['remoteId']??null,'mode':_0x2d84c5?.[_0x4932bc(0x125)]?_0x4932bc(0x154):_0x4932bc(0x163),'status':!_0x146628&&_0x56a115?_0x4932bc(0x144):_0x4932bc(0x13d)});}return{'method':_0x4932bc(0x148),'url':_0x4932bc(0x129),'body':{'appCode':_0x1b87de[_0x4932bc(0x13f)],'force':_0x146628,'files':_0x24817c},'description':'Would\x20inspect\x20'+_0x24817c['length']+_0x4932bc(0x141)};},async 'execute'(_0x2ab237){const _0x2f1932=a32_0x3f979a,_0x3a5abd=loadBffProjectConfig(_0x2ab237[_0x2f1932(0x13f)]),_0x4348e6=await readBffLockFile(_0x3a5abd['lockFilePath']),{lockData:_0x19b5e9,appLock:_0xa123ad}=ensureLockScope(_0x4348e6??createEmptyBffLock(),_0x2ab237[_0x2f1932(0x13f)],_0x3a5abd[_0x2f1932(0x145)],'push'),_0xe5b2b7=await getTargetFunctions(_0x3a5abd,_0x2ab237);if(_0xe5b2b7[_0x2f1932(0x120)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x3c3c9c=_0x2ab237[_0x2f1932(0x12a)](_0x2f1932(0x156)),_0x1bbed9=await buildHookMaps(_0x2ab237[_0x2f1932(0x13f)],_0x2ab237[_0x2f1932(0x15d)],_0xe5b2b7,_0xa123ad),_0x5ad152=[],_0x176421=[],_0x4e6185=[];for(const _0x5b3d51 of _0xe5b2b7){const _0x26a936=await computeFileHash(_0x5b3d51['filePath']),_0x31f964=_0xa123ad[_0x2f1932(0x127)][_0x5b3d51[_0x2f1932(0x147)]];if(!_0x3c3c9c&&_0x31f964&&_0x31f964[_0x2f1932(0x149)]===_0x26a936){_0x176421[_0x2f1932(0x121)]({'lockKey':_0x5b3d51[_0x2f1932(0x147)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x2ab237[_0x2f1932(0x13f)],_0x5b3d51,_0xa123ad,_0x1bbed9);const _0x8e63bf=_0xa123ad[_0x2f1932(0x127)][_0x5b3d51[_0x2f1932(0x147)]];_0x5ad152[_0x2f1932(0x121)]({'lockKey':_0x5b3d51['lockKey'],'remoteId':_0x8e63bf?.[_0x2f1932(0x125)]??0x0});}catch(_0x26216c){_0x4e6185['push']({'lockKey':_0x5b3d51['lockKey'],'error':_0x26216c instanceof Error?_0x26216c[_0x2f1932(0x132)]:String(_0x26216c)});}}return _0xa123ad[_0x2f1932(0x123)]=new Date()[_0x2f1932(0x12e)](),await writeBffLockFile(_0x3a5abd[_0x2f1932(0x162)],_0x19b5e9),{'ok':_0x4e6185[_0x2f1932(0x120)]===0x0,'data':{'uploaded':_0x5ad152,'skipped':_0x176421,'failed':_0x4e6185},'message':_0x2f1932(0x161)+_0x5ad152[_0x2f1932(0x120)]+_0x2f1932(0x131)+_0x176421[_0x2f1932(0x120)]+'\x20skipped,\x20'+_0x4e6185[_0x2f1932(0x120)]+_0x2f1932(0x146)};}};async function getTargetFunctions(_0x14bb96,_0x4808bd){const _0x3ec63f=a32_0x3f979a,_0x250a17=_0x4808bd[_0x3ec63f(0x157)](_0x3ec63f(0x142)),_0x3b696e=_0x4808bd[_0x3ec63f(0x157)]('name'),_0x48a187=normalizeBffType(_0x250a17)??undefined;if(_0x3b696e&&!_0x48a187)throw CliErrors[_0x3ec63f(0x13a)](_0x3ec63f(0x138));const _0x4cd427=await scanLocalBffFunctions(_0x14bb96,_0x48a187);if(_0x3b696e){const _0x58407c=_0x4cd427[_0x3ec63f(0x155)](_0x2c9fce=>_0x2c9fce['name']===_0x3b696e);if(_0x58407c[_0x3ec63f(0x120)]===0x0)throw CliErrors[_0x3ec63f(0x13a)](_0x3ec63f(0x11c)+_0x48a187+'/'+_0x3b696e);return _0x58407c;}return _0x4cd427;}async function buildHookMaps(_0x2ca5ef,_0xe17aa,_0x4f3a20,_0x517864){const _0x44d422=a32_0x3f979a,_0x46f0e4=_0x4f3a20[_0x44d422(0x151)](_0x50b261=>_0x50b261[_0x44d422(0x142)]==='HOOK');if(!_0x46f0e4)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x50b976=loadAliasMap(_0xe17aa,undefined,resolveApiFilePath(_0xe17aa,_0x2ca5ef)),_0x3b9de6=new Map(_0x50b976[_0x44d422(0x15a)](_0x336fde=>[_0x336fde[_0x44d422(0x12b)],_0x336fde[_0x44d422(0x153)]]));for(const _0x174569 of Object['values'](_0x517864[_0x44d422(0x127)])){_0x174569[_0x44d422(0x12b)]&&_0x174569[_0x44d422(0x153)]&&!_0x3b9de6['has'](_0x174569[_0x44d422(0x12b)])&&_0x3b9de6[_0x44d422(0x136)](_0x174569['alias'],_0x174569['datasetCode']);}const _0x2696d3=await listDatasets(_0x2ca5ef),_0xb20e03=new Map(_0x2696d3[_0x44d422(0x15a)](_0x56bf64=>[_0x56bf64[_0x44d422(0x160)],_0x56bf64['id']]));return{'aliasToDatasetCode':_0x3b9de6,'datasetCodeToId':_0xb20e03};}async function uploadSingleFunction(_0x1f49b0,_0x38a887,_0x1aa0e3,_0x5f270b){const _0x38087d=a32_0x3f979a,_0x4db9f4=await readFile(_0x38a887['filePath'],_0x38087d(0x14c)),_0x5b8cb1=await computeFileHash(_0x38a887[_0x38087d(0x12f)]),_0x516ed1=_0x1aa0e3[_0x38087d(0x127)][_0x38a887[_0x38087d(0x147)]];if(_0x516ed1?.['remoteId']&&_0x516ed1[_0x38087d(0x13e)]==null)throw CliErrors['validation'](_0x38a887[_0x38087d(0x147)]+_0x38087d(0x15e));let _0x2cde62=extractScriptDescription(_0x4db9f4);if(!_0x2cde62&&_0x516ed1?.['remoteId']){const _0x9b5285=await getBffScriptInfo(_0x516ed1[_0x38087d(0x125)]);_0x2cde62=_0x9b5285[_0x38087d(0x122)]||undefined;}const _0x576576={'appCode':_0x1f49b0,'functionName':_0x38a887[_0x38087d(0x14d)],'scriptType':_0x38a887[_0x38087d(0x142)],'scriptContent':_0x4db9f4};if(_0x516ed1?.[_0x38087d(0x125)])_0x576576['id']=_0x516ed1[_0x38087d(0x125)];if(_0x516ed1?.['version']!=null)_0x576576[_0x38087d(0x13e)]=_0x516ed1[_0x38087d(0x13e)];if(_0x2cde62)_0x576576[_0x38087d(0x122)]=_0x2cde62;if(_0x38a887[_0x38087d(0x142)]===_0x38087d(0x128)){const _0x3bdf8d=_0x38a887[_0x38087d(0x12b)];if(!_0x3bdf8d||!_0x38a887[_0x38087d(0x164)]||!_0x38a887[_0x38087d(0x13c)])throw CliErrors[_0x38087d(0x13a)](_0x38087d(0x133)+_0x38a887[_0x38087d(0x147)]);const _0x843a1a=_0x5f270b['aliasToDatasetCode'][_0x38087d(0x124)](_0x3bdf8d)??_0x516ed1?.[_0x38087d(0x153)]??_0x3bdf8d,_0x31200e=_0x5f270b['datasetCodeToId']['get'](_0x843a1a);if(!_0x31200e)throw CliErrors[_0x38087d(0x13a)](_0x38087d(0x11e)+_0x3bdf8d+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x38087d(0x143)));_0x576576[_0x38087d(0x139)]=_0x31200e,_0x576576['operationType']=_0x38a887[_0x38087d(0x164)],_0x576576[_0x38087d(0x13c)]=_0x38a887[_0x38087d(0x13c)];}const _0x1680d1=await saveBffScript(_0x576576),_0x4f8728=await getBffScriptInfo(_0x1680d1),_0x5934e7={'hash':_0x5b8cb1,'remoteId':_0x1680d1,'version':_0x4f8728[_0x38087d(0x13e)]};if(_0x38a887[_0x38087d(0x142)]==='HOOK'){const _0x12a4b4=_0x38a887['alias'],_0x3828d4=_0x5f270b['aliasToDatasetCode'][_0x38087d(0x124)](_0x12a4b4)??_0x516ed1?.[_0x38087d(0x153)]??_0x12a4b4;_0x5f270b[_0x38087d(0x152)][_0x38087d(0x15f)](_0x12a4b4)?_0x5934e7[_0x38087d(0x12b)]=_0x12a4b4:_0x5934e7[_0x38087d(0x12b)]=_0x516ed1?.[_0x38087d(0x12b)],_0x5934e7[_0x38087d(0x153)]=_0x3828d4,_0x5934e7[_0x38087d(0x164)]=_0x38a887[_0x38087d(0x164)],_0x5934e7['functionNode']=_0x38a887['functionNode'];}_0x1aa0e3[_0x38087d(0x127)][_0x38a887['lockKey']]=_0x5934e7;}
@@ -1 +1 @@
1
- const a32_0x55f3ea=a32_0x1dd9;function a32_0x2df8(){const _0x894f60=['length','8zgMEtL','1102064zptDqY','lockKey','814877jYGHdT','read','10rSECWA','all','4842345WMefzu','datasetCode','2150648YTmyMJ','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','appCode','38386898MrDoHQ','12wPnMtD','\x20remote-only','24195NIHqjF','map','has','All\x20BFF\x20scripts\x20are\x20in\x20sync.','push','filePath','functions','lockFilePath','bool','\x20unchanged','status','apiDir','2311893ROOowo','92XCCzAm','\x20modified,\x20','scriptsRoot'];a32_0x2df8=function(){return _0x894f60;};return a32_0x2df8();}(function(_0x28c98d,_0x42402c){const _0x35748f=a32_0x1dd9,_0x8451aa=_0x28c98d();while(!![]){try{const _0x873062=-parseInt(_0x35748f(0x157))/0x1+-parseInt(_0x35748f(0x15f))/0x2+parseInt(_0x35748f(0x165))/0x3*(parseInt(_0x35748f(0x152))/0x4)+-parseInt(_0x35748f(0x15d))/0x5+-parseInt(_0x35748f(0x163))/0x6*(parseInt(_0x35748f(0x159))/0x7)+parseInt(_0x35748f(0x156))/0x8*(parseInt(_0x35748f(0x151))/0x9)+-parseInt(_0x35748f(0x15b))/0xa*(-parseInt(_0x35748f(0x162))/0xb);if(_0x873062===_0x42402c)break;else _0x8451aa['push'](_0x8451aa['shift']());}catch(_0x42f23e){_0x8451aa['push'](_0x8451aa['shift']());}}}(a32_0x2df8,0x871c3));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a32_0x1dd9(_0x478c10,_0x442a74){_0x478c10=_0x478c10-0x146;const _0x2df887=a32_0x2df8();let _0x1dd9f3=_0x2df887[_0x478c10];return _0x1dd9f3;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a32_0x55f3ea(0x14f),'description':'Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','risk':a32_0x55f3ea(0x15a),'flags':[{'name':'remote','type':'boolean','description':a32_0x55f3ea(0x160)}],async 'execute'(_0x3eabd1){const _0x117a1a=a32_0x55f3ea,_0x2ba5b7=loadBffProjectConfig(_0x3eabd1['appCode']),_0x2f8e09=await readBffLockFile(_0x2ba5b7[_0x117a1a(0x14c)]),{appLock:_0x2dd7c7}=ensureLockScope(_0x2f8e09??createEmptyBffLock(),_0x3eabd1['appCode'],_0x2ba5b7[_0x117a1a(0x154)],_0x117a1a(0x14f)),_0x2682ad=await scanLocalBffFunctions(_0x2ba5b7),_0x5ba7f8=[],_0x5d6705=[],_0x4f091f=[];for(const _0x485b5a of _0x2682ad){const _0x27b7aa=await computeFileHash(_0x485b5a[_0x117a1a(0x14a)]),_0x299f86=_0x2dd7c7[_0x117a1a(0x14b)][_0x485b5a[_0x117a1a(0x158)]];if(!_0x299f86)_0x5ba7f8[_0x117a1a(0x149)](_0x485b5a['lockKey']);else _0x299f86['hash']!==_0x27b7aa?_0x5d6705[_0x117a1a(0x149)](_0x485b5a['lockKey']):_0x4f091f['push'](_0x485b5a[_0x117a1a(0x158)]);}const _0x5da9e4=[];if(_0x3eabd1[_0x117a1a(0x14d)]('remote')){const _0xdbe8c1=loadAliasMap(_0x3eabd1['apiDir'],undefined,resolveApiFilePath(_0x3eabd1[_0x117a1a(0x150)],_0x3eabd1['appCode'])),_0x2f3933=new Map(_0xdbe8c1[_0x117a1a(0x146)](_0x4186b3=>[_0x4186b3[_0x117a1a(0x15e)],_0x4186b3['alias']])),[_0x4bf9fb,_0x4fd0c5]=await Promise[_0x117a1a(0x15c)]([listBffScripts(_0x3eabd1[_0x117a1a(0x161)]),getBffScriptStatistics(_0x3eabd1[_0x117a1a(0x161)])]),_0x1a065f=createHookLocationMap(_0x4fd0c5),_0x2e1406=new Set(_0x2682ad[_0x117a1a(0x146)](_0x453368=>_0x453368[_0x117a1a(0x158)]));for(const _0xe00a51 of _0x4bf9fb){const _0x33b3fb=resolveRemoteScriptTarget(_0x2ba5b7,_0xe00a51,_0x1a065f,_0x2dd7c7[_0x117a1a(0x14b)],_0x2f3933);_0x33b3fb&&!_0x2e1406[_0x117a1a(0x147)](_0x33b3fb['lockKey'])&&_0x5da9e4[_0x117a1a(0x149)](_0x33b3fb[_0x117a1a(0x158)]);}}const _0x23c173=_0x5ba7f8['length']===0x0&&_0x5d6705[_0x117a1a(0x155)]===0x0&&_0x5da9e4['length']===0x0;return{'ok':!![],'data':{'added':_0x5ba7f8,'modified':_0x5d6705,'unchanged':_0x4f091f,'remoteOnly':_0x5da9e4},'message':_0x23c173?_0x117a1a(0x148):_0x5ba7f8[_0x117a1a(0x155)]+'\x20added,\x20'+_0x5d6705['length']+_0x117a1a(0x153)+_0x4f091f[_0x117a1a(0x155)]+_0x117a1a(0x14e)+(_0x5da9e4[_0x117a1a(0x155)]>0x0?',\x20'+_0x5da9e4[_0x117a1a(0x155)]+_0x117a1a(0x164):'')};}};
1
+ function a33_0xefcb(_0x629d67,_0x11e51c){_0x629d67=_0x629d67-0x125;const _0x2c855d=a33_0x2c85();let _0xefcbe5=_0x2c855d[_0x629d67];return _0xefcbe5;}function a33_0x2c85(){const _0x3ea5b7=['all','bff','\x20added,\x20','appCode','status','alias','remote','functions','4576ftQPGB','1384806lpCHem','datasetCode','10680sCAknE','hash','length','has','361998hEetXY','4ChFywG','4572152XjFfTQ','3830ihdiKN','apiDir','All\x20BFF\x20scripts\x20are\x20in\x20sync.','\x20modified,\x20','1424910VoyFFI','read','lockKey','\x20unchanged','\x20remote-only','scriptsRoot','bool','1061029AoVvaN','filePath','4206wBMJOR','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','lockFilePath','9HkDTGL','boolean','push','map'];a33_0x2c85=function(){return _0x3ea5b7;};return a33_0x2c85();}const a33_0x45822a=a33_0xefcb;(function(_0x17cde2,_0x117704){const _0x3c5e57=a33_0xefcb,_0x315c1a=_0x17cde2();while(!![]){try{const _0x14614b=parseInt(_0x3c5e57(0x144))/0x1+parseInt(_0x3c5e57(0x13d))/0x2+-parseInt(_0x3c5e57(0x130))/0x3*(parseInt(_0x3c5e57(0x137))/0x4)+-parseInt(_0x3c5e57(0x139))/0x5*(parseInt(_0x3c5e57(0x146))/0x6)+-parseInt(_0x3c5e57(0x136))/0x7+-parseInt(_0x3c5e57(0x138))/0x8*(parseInt(_0x3c5e57(0x149))/0x9)+parseInt(_0x3c5e57(0x132))/0xa*(parseInt(_0x3c5e57(0x12f))/0xb);if(_0x14614b===_0x117704)break;else _0x315c1a['push'](_0x315c1a['shift']());}catch(_0x588cd0){_0x315c1a['push'](_0x315c1a['shift']());}}}(a33_0x2c85,0x91803));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a33_0x45822a(0x128),'command':a33_0x45822a(0x12b),'description':a33_0x45822a(0x147),'risk':a33_0x45822a(0x13e),'flags':[{'name':a33_0x45822a(0x12d),'type':a33_0x45822a(0x14a),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x261c71){const _0x17e179=a33_0x45822a,_0x1df76c=loadBffProjectConfig(_0x261c71[_0x17e179(0x12a)]),_0x1f8fa9=await readBffLockFile(_0x1df76c[_0x17e179(0x148)]),{appLock:_0x2b9fbf}=ensureLockScope(_0x1f8fa9??createEmptyBffLock(),_0x261c71[_0x17e179(0x12a)],_0x1df76c[_0x17e179(0x142)],_0x17e179(0x12b)),_0x3e2100=await scanLocalBffFunctions(_0x1df76c),_0x11ae6a=[],_0x20e6b5=[],_0x2844f6=[];for(const _0x10c287 of _0x3e2100){const _0x5bf63d=await computeFileHash(_0x10c287[_0x17e179(0x145)]),_0x3cdd50=_0x2b9fbf[_0x17e179(0x12e)][_0x10c287['lockKey']];if(!_0x3cdd50)_0x11ae6a[_0x17e179(0x125)](_0x10c287[_0x17e179(0x13f)]);else _0x3cdd50[_0x17e179(0x133)]!==_0x5bf63d?_0x20e6b5[_0x17e179(0x125)](_0x10c287[_0x17e179(0x13f)]):_0x2844f6[_0x17e179(0x125)](_0x10c287[_0x17e179(0x13f)]);}const _0x521461=[];if(_0x261c71[_0x17e179(0x143)](_0x17e179(0x12d))){const _0x82f640=loadAliasMap(_0x261c71[_0x17e179(0x13a)],undefined,resolveApiFilePath(_0x261c71[_0x17e179(0x13a)],_0x261c71['appCode'])),_0x59b26b=new Map(_0x82f640[_0x17e179(0x126)](_0x3dd415=>[_0x3dd415[_0x17e179(0x131)],_0x3dd415[_0x17e179(0x12c)]])),[_0xf128e0,_0x31cb78]=await Promise[_0x17e179(0x127)]([listBffScripts(_0x261c71[_0x17e179(0x12a)]),getBffScriptStatistics(_0x261c71[_0x17e179(0x12a)])]),_0x1971a5=createHookLocationMap(_0x31cb78),_0x3dacf6=new Set(_0x3e2100['map'](_0x5773a2=>_0x5773a2['lockKey']));for(const _0x51d05f of _0xf128e0){const _0x4ec92c=resolveRemoteScriptTarget(_0x1df76c,_0x51d05f,_0x1971a5,_0x2b9fbf[_0x17e179(0x12e)],_0x59b26b);_0x4ec92c&&!_0x3dacf6[_0x17e179(0x135)](_0x4ec92c['lockKey'])&&_0x521461[_0x17e179(0x125)](_0x4ec92c[_0x17e179(0x13f)]);}}const _0x36e454=_0x11ae6a[_0x17e179(0x134)]===0x0&&_0x20e6b5[_0x17e179(0x134)]===0x0&&_0x521461[_0x17e179(0x134)]===0x0;return{'ok':!![],'data':{'added':_0x11ae6a,'modified':_0x20e6b5,'unchanged':_0x2844f6,'remoteOnly':_0x521461},'message':_0x36e454?_0x17e179(0x13b):_0x11ae6a['length']+_0x17e179(0x129)+_0x20e6b5[_0x17e179(0x134)]+_0x17e179(0x13c)+_0x2844f6[_0x17e179(0x134)]+_0x17e179(0x140)+(_0x521461[_0x17e179(0x134)]>0x0?',\x20'+_0x521461[_0x17e179(0x134)]+_0x17e179(0x141):'')};}};