@lovrabet/rabetbase-cli 2.1.2-beta.3 → 2.1.3-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 (187) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -0
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/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/page/generate-start.js +1 -0
  81. package/lib/commands/page/generate-status.js +1 -0
  82. package/lib/commands/page/index.js +1 -0
  83. package/lib/commands/page/pull.js +1 -0
  84. package/lib/commands/page/push.js +1 -0
  85. package/lib/commands/page/shared.js +1 -0
  86. package/lib/commands/page/standard-page-status.js +1 -0
  87. package/lib/commands/page/sync.js +1 -0
  88. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  89. package/lib/commands/project/create/format-elapsed.js +1 -1
  90. package/lib/commands/project/create/main.js +1 -1
  91. package/lib/commands/project/create/non-interactive.js +1 -1
  92. package/lib/commands/project/create/project-template-path.js +1 -1
  93. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  94. package/lib/commands/project/create/use-format-code.js +1 -1
  95. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  96. package/lib/commands/project/index.js +1 -1
  97. package/lib/commands/project/init.js +1 -1
  98. package/lib/commands/project/upgrade.js +1 -1
  99. package/lib/commands/registry.js +1 -1
  100. package/lib/commands/run/index.js +1 -1
  101. package/lib/commands/schema.js +1 -1
  102. package/lib/commands/skill/index.js +1 -1
  103. package/lib/commands/sql/create.js +1 -0
  104. package/lib/commands/sql/delete.js +1 -0
  105. package/lib/commands/sql/detail.js +1 -1
  106. package/lib/commands/sql/exec.js +1 -1
  107. package/lib/commands/sql/index.js +1 -1
  108. package/lib/commands/sql/list.js +1 -1
  109. package/lib/commands/sql/pull.js +1 -1
  110. package/lib/commands/sql/push.js +1 -0
  111. package/lib/commands/sql/save.js +1 -1
  112. package/lib/commands/sql/shared.js +1 -1
  113. package/lib/commands/sql/status.js +1 -0
  114. package/lib/commands/sql/validate.js +1 -1
  115. package/lib/config/schema.js +1 -1
  116. package/lib/constant/cdn.js +1 -0
  117. package/lib/constant/cli.js +1 -1
  118. package/lib/constant/defaults.js +1 -1
  119. package/lib/constant/domain.js +1 -1
  120. package/lib/constant/env.js +1 -1
  121. package/lib/constant/output.js +1 -1
  122. package/lib/constant/paths.js +1 -1
  123. package/lib/constant/risk.js +1 -1
  124. package/lib/context.js +1 -1
  125. package/lib/core/alias-resolver.js +1 -1
  126. package/lib/core/api-client.js +1 -1
  127. package/lib/core/bff/config.js +1 -1
  128. package/lib/core/bff/file-system.js +1 -1
  129. package/lib/core/bff/hash.js +1 -1
  130. package/lib/core/bff/lock.js +1 -1
  131. package/lib/core/bff/utils.js +1 -1
  132. package/lib/core/db-resolver.js +1 -1
  133. package/lib/core/page/file-system.js +1 -0
  134. package/lib/core/page/hash.js +1 -0
  135. package/lib/core/page/lock.js +1 -0
  136. package/lib/core/page/types.js +1 -0
  137. package/lib/core/sql-sync/config.js +1 -0
  138. package/lib/core/sql-sync/file-system.js +1 -0
  139. package/lib/core/sql-sync/hash.js +1 -0
  140. package/lib/core/sql-sync/lock.js +1 -0
  141. package/lib/core/sql-sync/types.js +1 -0
  142. package/lib/core/sql-sync/utils.js +1 -0
  143. package/lib/core/sql-validator.js +1 -1
  144. package/lib/errors.js +1 -1
  145. package/lib/framework/build-all-flags.js +1 -1
  146. package/lib/framework/flags.js +1 -1
  147. package/lib/framework/help.js +1 -1
  148. package/lib/framework/index.js +1 -1
  149. package/lib/framework/output.js +1 -1
  150. package/lib/framework/response.js +1 -1
  151. package/lib/framework/runner-alias.js +1 -1
  152. package/lib/framework/runner.js +1 -1
  153. package/lib/framework/schema-export.js +1 -1
  154. package/lib/framework/types.js +1 -1
  155. package/lib/generated/build-info.js +1 -1
  156. package/lib/help.js +1 -1
  157. package/lib/skills/main.js +1 -1
  158. package/lib/skills/npx-skills-add.js +1 -1
  159. package/lib/telemetry/cli-command-trace.js +1 -1
  160. package/lib/telemetry/cli-help-trace.js +1 -1
  161. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  162. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  163. package/lib/telemetry/send-cli-trace-log.js +1 -1
  164. package/lib/utils/ai_config.js +1 -1
  165. package/lib/utils/apply-jq-filter.js +1 -1
  166. package/lib/utils/cdn-config.js +1 -1
  167. package/lib/utils/check-sdk-version.js +1 -1
  168. package/lib/utils/cli-version-check.js +1 -1
  169. package/lib/utils/cli-version-policy.js +1 -0
  170. package/lib/utils/config.js +1 -1
  171. package/lib/utils/copy-directory.js +1 -1
  172. package/lib/utils/entity-with-id.js +1 -1
  173. package/lib/utils/file-utils.js +1 -1
  174. package/lib/utils/guides-cdn.js +1 -1
  175. package/lib/utils/http-client.js +1 -1
  176. package/lib/utils/is-non-interactive.js +1 -1
  177. package/lib/utils/logger.js +1 -1
  178. package/lib/utils/platform.js +1 -1
  179. package/lib/utils/rules-cdn.js +1 -1
  180. package/lib/utils/sleep.js +1 -1
  181. package/lib/utils/template-replacer.js +1 -1
  182. package/lib/utils/version.js +1 -1
  183. package/lib/utils/with-active-cookie.js +1 -1
  184. package/lib/utils/write-cli-side-channel.js +1 -1
  185. package/package.json +3 -2
  186. package/templates/skill/SKILL.md.tpl +1 -1
  187. package/lib/commands/bff/new.js +0 -1
@@ -1 +1 @@
1
- (function(_0x48df5d,_0x4596c3){const _0x1a6176=a103_0x5498,_0x40c939=_0x48df5d();while(!![]){try{const _0x12b187=parseInt(_0x1a6176(0x1f6))/0x1+parseInt(_0x1a6176(0x1f5))/0x2*(-parseInt(_0x1a6176(0x1f8))/0x3)+parseInt(_0x1a6176(0x1f4))/0x4+-parseInt(_0x1a6176(0x1fb))/0x5*(parseInt(_0x1a6176(0x1f2))/0x6)+-parseInt(_0x1a6176(0x1fc))/0x7+parseInt(_0x1a6176(0x1f3))/0x8*(parseInt(_0x1a6176(0x1f7))/0x9)+parseInt(_0x1a6176(0x1fa))/0xa*(-parseInt(_0x1a6176(0x1f9))/0xb);if(_0x12b187===_0x4596c3)break;else _0x40c939['push'](_0x40c939['shift']());}catch(_0x5cc4a5){_0x40c939['push'](_0x40c939['shift']());}}}(a103_0x28e9,0x56d62));import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';function a103_0x28e9(){const _0x311df6=['196154VMKpKd','12xlvGAx','200368HKJFKg','1887564RxDNuD','2OrLUba','530789rYSoLm','90WodnMu','1206105vcfQLW','12067xsENVD','2770fJXIbs','408830NOQfxj'];a103_0x28e9=function(){return _0x311df6;};return a103_0x28e9();}import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';import{appRemoveDefinition}from'../../commands/app/remove.js';function a103_0x5498(_0x39c324,_0x28f312){_0x39c324=_0x39c324-0x1f2;const _0x28e920=a103_0x28e9();let _0x549836=_0x28e920[_0x39c324];return _0x549836;}export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];
1
+ (function(_0x406471,_0x35608a){const _0x1e6521=a20_0xf4dc,_0x47d28b=_0x406471();while(!![]){try{const _0x474858=parseInt(_0x1e6521(0x1db))/0x1*(-parseInt(_0x1e6521(0x1d8))/0x2)+-parseInt(_0x1e6521(0x1d9))/0x3*(parseInt(_0x1e6521(0x1da))/0x4)+-parseInt(_0x1e6521(0x1d7))/0x5+-parseInt(_0x1e6521(0x1d5))/0x6+parseInt(_0x1e6521(0x1dc))/0x7*(-parseInt(_0x1e6521(0x1d2))/0x8)+parseInt(_0x1e6521(0x1d4))/0x9*(parseInt(_0x1e6521(0x1d6))/0xa)+parseInt(_0x1e6521(0x1d3))/0xb;if(_0x474858===_0x35608a)break;else _0x47d28b['push'](_0x47d28b['shift']());}catch(_0x258bce){_0x47d28b['push'](_0x47d28b['shift']());}}}(a20_0x46a7,0xd6038));function a20_0xf4dc(_0x3c6ac6,_0x289c55){_0x3c6ac6=_0x3c6ac6-0x1d2;const _0x46a794=a20_0x46a7();let _0xf4dca8=_0x46a794[_0x3c6ac6];return _0xf4dca8;}import{appListDefinition}from'../../commands/app/list.js';import{appRemoteDefinition}from'../../commands/app/discover.js';import{appUseDefinition}from'../../commands/app/use.js';import{appAddDefinition}from'../../commands/app/add.js';function a20_0x46a7(){const _0xd81d8=['4475382uBybPT','4oZDBUZ','1yUFxVZ','84LJUptI','529616NGtBub','65151603QfoTRd','414xFVGoX','6074742vGwlTl','61610ilofJW','3326665jGmRka','2731342mikPul'];a20_0x46a7=function(){return _0xd81d8;};return a20_0x46a7();}import{appRemoveDefinition}from'../../commands/app/remove.js';export const appDefinitions=[appListDefinition,appRemoteDefinition,appUseDefinition,appAddDefinition,appRemoveDefinition];
@@ -1 +1 @@
1
- function a102_0x226e(){const _0x468e13=['.\x20Use\x20`','2842390dgexZX','\x20config','entries','6877400LDsFLP','List\x20all\x20configured\x20apps','boolean','appcode','merged','list','length','12941388iezBll','47016710qHFytL','3qfelZs','globalConfig','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','global','project','globalPath','push','1aOijdS','427XkKKou','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','object','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','apps','\x20in\x20','40458HbRTTL','3251432HfcCpQ','5703628bGlqjW','map','find','mergedCli','bool','app','projectPath','projectConfig'];a102_0x226e=function(){return _0x468e13;};return a102_0x226e();}function a102_0x1c9f(_0x2662a5,_0x27c6b3){_0x2662a5=_0x2662a5-0x103;const _0x226e3b=a102_0x226e();let _0x1c9f04=_0x226e3b[_0x2662a5];return _0x1c9f04;}const a102_0x1269ed=a102_0x1c9f;(function(_0x3bd41f,_0x2573fe){const _0x2e176f=a102_0x1c9f,_0xdaf9ac=_0x3bd41f();while(!![]){try{const _0x202d08=parseInt(_0x2e176f(0x124))/0x1*(parseInt(_0x2e176f(0x111))/0x2)+-parseInt(_0x2e176f(0x11d))/0x3*(-parseInt(_0x2e176f(0x108))/0x4)+parseInt(_0x2e176f(0x114))/0x5+-parseInt(_0x2e176f(0x106))/0x6*(parseInt(_0x2e176f(0x125))/0x7)+parseInt(_0x2e176f(0x107))/0x8+parseInt(_0x2e176f(0x11b))/0x9+-parseInt(_0x2e176f(0x11c))/0xa;if(_0x202d08===_0x2573fe)break;else _0xdaf9ac['push'](_0xdaf9ac['shift']());}catch(_0x1cf95c){_0xdaf9ac['push'](_0xdaf9ac['shift']());}}}(a102_0x226e,0xe8e5d));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(_0x106699,_0x22c002){const _0x49e881=a102_0x1c9f,_0x3b7890=[],_0x280193=_0x106699[_0x49e881(0x104)]&&typeof _0x106699[_0x49e881(0x104)]===_0x49e881(0x127)?_0x106699[_0x49e881(0x104)]:{},_0x6fb9b8=_0x106699['defaultApp']||undefined;for(const [_0x2d5f9a,_0x32ffe8]of Object['entries'](_0x280193)){if(!_0x32ffe8||typeof _0x32ffe8!=='object'||!_0x32ffe8[_0x49e881(0x117)])continue;_0x3b7890[_0x49e881(0x123)]({'name':_0x2d5f9a,'appcode':_0x32ffe8[_0x49e881(0x117)],'named':!![],'definedIn':_0x22c002,'isDefault':_0x2d5f9a===_0x6fb9b8,...buildAppProfileListFields(_0x32ffe8)});}return _0x3b7890;}function buildMergedItems(_0x355984,_0x1dd2c2){const _0x29845f=a102_0x1c9f,{apps:apps={},defaultApp:_0x57816e}=_0x355984,_0x5b8b4f=_0x1dd2c2[_0x29845f(0x11e)][_0x29845f(0x104)]&&typeof _0x1dd2c2['globalConfig']['apps']===_0x29845f(0x127)?_0x1dd2c2[_0x29845f(0x11e)][_0x29845f(0x104)]:{},_0x3de65a=_0x1dd2c2['projectConfig'][_0x29845f(0x104)]&&typeof _0x1dd2c2[_0x29845f(0x10f)]['apps']===_0x29845f(0x127)?_0x1dd2c2['projectConfig']['apps']:{},_0xb4722a=_0x1dd2c2[_0x29845f(0x10f)]['inherit']===![],_0x872a4f=Object[_0x29845f(0x113)](apps),_0x10ffbd=_0x872a4f[_0x29845f(0x109)](([_0x391b3f,_0x452331])=>({'name':_0x391b3f,'appcode':_0x452331[_0x29845f(0x117)],'named':!![],'definedIn':appDefinedIn(_0x391b3f,_0x5b8b4f,_0x3de65a,_0xb4722a),'isDefault':_0x391b3f===_0x57816e,...buildAppProfileListFields(_0x452331)}));return _0x10ffbd;}async function execute(_0x3dd666){const _0x4889cc=a102_0x1c9f,_0x3015ae=_0x3dd666[_0x4889cc(0x10c)](_0x4889cc(0x120)),_0x5d7d5f=_0x3dd666[_0x4889cc(0x10c)](_0x4889cc(0x121)),_0x4a4a46=_0x3015ae?'global':_0x5d7d5f?_0x4889cc(0x121):'merged',{config:_0x33d559,layers:_0x5f0d84}=readRawConfigWithLayers(),_0x4d2180=resolveDefaultAppSource(_0x5f0d84),{defaultApp:_0x246230}=_0x33d559;let _0x31bd07,_0xff3bb2;switch(_0x4a4a46){case _0x4889cc(0x120):_0x31bd07=buildItemsFromLayer(_0x5f0d84[_0x4889cc(0x11e)],'global'),_0xff3bb2=_0x5f0d84[_0x4889cc(0x122)];break;case _0x4889cc(0x121):_0x31bd07=buildItemsFromLayer(_0x5f0d84[_0x4889cc(0x10f)],_0x4889cc(0x121)),_0xff3bb2=_0x5f0d84[_0x4889cc(0x10e)];break;default:_0x31bd07=buildMergedItems(_0x33d559,_0x5f0d84);break;}enrichAppListItemsWithMergedSelection(_0x31bd07,_0x3dd666[_0x4889cc(0x10b)]);if(_0x31bd07[_0x4889cc(0x11a)]===0x0){const _0x5c5e98=_0x4a4a46==='merged'?'':_0x4889cc(0x105)+_0x4a4a46+_0x4889cc(0x112);return{'ok':!![],'data':[],'message':'No\x20apps\x20configured'+_0x5c5e98+_0x4889cc(0x110)+CLI_BIN_NAME+_0x4889cc(0x126)};}const _0xcb4d62=_0x31bd07[_0x4889cc(0x10a)](_0x5de835=>_0x5de835['isCurrent']===!![]),_0x463ec1=_0x246230??_0xcb4d62?.[_0x4889cc(0x117)]??null,_0x1e5042=_0x4a4a46===_0x4889cc(0x118)?{'globalPath':_0x5f0d84['globalPath']??null,'projectPath':_0x5f0d84[_0x4889cc(0x10e)]??null,'defaultApp':_0x463ec1,'defaultAppSource':_0x246230!=null?_0x4d2180:null}:{'scope':_0x4a4a46,'configPath':_0xff3bb2??null};return{'ok':!![],'data':{'items':_0x31bd07,'meta':_0x1e5042}};}export const appListDefinition={'service':a102_0x1269ed(0x10d),'command':a102_0x1269ed(0x119),'description':a102_0x1269ed(0x115),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'global','type':a102_0x1269ed(0x116),'description':a102_0x1269ed(0x103),'default':![]},{'name':'project','type':a102_0x1269ed(0x116),'description':a102_0x1269ed(0x11f),'default':![]}],'execute':execute};
1
+ const a21_0x12ea88=a21_0x589f;(function(_0x3def36,_0xeaab6b){const _0x4dcc5b=a21_0x589f,_0x22916b=_0x3def36();while(!![]){try{const _0x312f8f=-parseInt(_0x4dcc5b(0x210))/0x1*(parseInt(_0x4dcc5b(0x20f))/0x2)+parseInt(_0x4dcc5b(0x201))/0x3+parseInt(_0x4dcc5b(0x20e))/0x4+parseInt(_0x4dcc5b(0x216))/0x5+-parseInt(_0x4dcc5b(0x1fe))/0x6*(parseInt(_0x4dcc5b(0x1fb))/0x7)+-parseInt(_0x4dcc5b(0x206))/0x8*(-parseInt(_0x4dcc5b(0x1f8))/0x9)+parseInt(_0x4dcc5b(0x1f2))/0xa*(-parseInt(_0x4dcc5b(0x208))/0xb);if(_0x312f8f===_0xeaab6b)break;else _0x22916b['push'](_0x22916b['shift']());}catch(_0x1e87b9){_0x22916b['push'](_0x22916b['shift']());}}}(a21_0x4ea2,0x8812b));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(_0x1680f1,_0x4ae5ed){const _0x288dcf=a21_0x589f,_0x5cbabe=[],_0x58f1e0=_0x1680f1[_0x288dcf(0x205)]&&typeof _0x1680f1['apps']===_0x288dcf(0x203)?_0x1680f1[_0x288dcf(0x205)]:{},_0x17301d=_0x1680f1[_0x288dcf(0x1fd)]||undefined;for(const [_0x535272,_0x357219]of Object[_0x288dcf(0x1ff)](_0x58f1e0)){if(!_0x357219||typeof _0x357219!==_0x288dcf(0x203)||!_0x357219['appcode'])continue;_0x5cbabe['push']({'name':_0x535272,'appcode':_0x357219[_0x288dcf(0x1f9)],'named':!![],'definedIn':_0x4ae5ed,'isDefault':_0x535272===_0x17301d,...buildAppProfileListFields(_0x357219)});}return _0x5cbabe;}function buildMergedItems(_0x22e5e2,_0x1e48be){const _0x2c9b0e=a21_0x589f,{apps:apps={},defaultApp:_0x3be4d1}=_0x22e5e2,_0x349422=_0x1e48be[_0x2c9b0e(0x20a)][_0x2c9b0e(0x205)]&&typeof _0x1e48be[_0x2c9b0e(0x20a)][_0x2c9b0e(0x205)]===_0x2c9b0e(0x203)?_0x1e48be['globalConfig'][_0x2c9b0e(0x205)]:{},_0x2612c8=_0x1e48be[_0x2c9b0e(0x214)][_0x2c9b0e(0x205)]&&typeof _0x1e48be[_0x2c9b0e(0x214)][_0x2c9b0e(0x205)]==='object'?_0x1e48be['projectConfig']['apps']:{},_0x273ab6=_0x1e48be[_0x2c9b0e(0x214)][_0x2c9b0e(0x1f7)]===![],_0xe4304f=Object['entries'](apps),_0xa8e258=_0xe4304f[_0x2c9b0e(0x204)](([_0x3c60c9,_0xe56918])=>({'name':_0x3c60c9,'appcode':_0xe56918['appcode'],'named':!![],'definedIn':appDefinedIn(_0x3c60c9,_0x349422,_0x2612c8,_0x273ab6),'isDefault':_0x3c60c9===_0x3be4d1,...buildAppProfileListFields(_0xe56918)}));return _0xa8e258;}async function execute(_0x3fb533){const _0x5311dc=a21_0x589f,_0x2cfad8=_0x3fb533[_0x5311dc(0x207)]('global'),_0xae738f=_0x3fb533[_0x5311dc(0x207)](_0x5311dc(0x215)),_0x1071f9=_0x2cfad8?_0x5311dc(0x212):_0xae738f?'project':_0x5311dc(0x213),{config:_0x3f1700,layers:_0x273fdb}=readRawConfigWithLayers(),_0x398512=resolveDefaultAppSource(_0x273fdb),{defaultApp:_0x16382c}=_0x3f1700;let _0x5ca203,_0x2096de;switch(_0x1071f9){case _0x5311dc(0x212):_0x5ca203=buildItemsFromLayer(_0x273fdb[_0x5311dc(0x20a)],_0x5311dc(0x212)),_0x2096de=_0x273fdb['globalPath'];break;case'project':_0x5ca203=buildItemsFromLayer(_0x273fdb[_0x5311dc(0x214)],'project'),_0x2096de=_0x273fdb['projectPath'];break;default:_0x5ca203=buildMergedItems(_0x3f1700,_0x273fdb);break;}enrichAppListItemsWithMergedSelection(_0x5ca203,_0x3fb533[_0x5311dc(0x1f6)]);if(_0x5ca203[_0x5311dc(0x1f5)]===0x0){const _0x49a05c=_0x1071f9===_0x5311dc(0x213)?'':_0x5311dc(0x202)+_0x1071f9+'\x20config';return{'ok':!![],'data':[],'message':_0x5311dc(0x211)+_0x49a05c+_0x5311dc(0x20b)+CLI_BIN_NAME+_0x5311dc(0x200)};}const _0x22c539=_0x5ca203[_0x5311dc(0x1f3)](_0x4b49f2=>_0x4b49f2[_0x5311dc(0x218)]===!![]),_0x5d3c60=_0x16382c??_0x22c539?.['appcode']??null,_0x122b0e=_0x1071f9===_0x5311dc(0x213)?{'globalPath':_0x273fdb[_0x5311dc(0x217)]??null,'projectPath':_0x273fdb[_0x5311dc(0x1fa)]??null,'defaultApp':_0x5d3c60,'defaultAppSource':_0x16382c!=null?_0x398512:null}:{'scope':_0x1071f9,'configPath':_0x2096de??null};return{'ok':!![],'data':{'items':_0x5ca203,'meta':_0x122b0e}};}export const appListDefinition={'service':a21_0x12ea88(0x20c),'command':'list','description':'List\x20all\x20configured\x20apps','risk':a21_0x12ea88(0x20d),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x12ea88(0x212),'type':a21_0x12ea88(0x1fc),'description':a21_0x12ea88(0x1f4),'default':![]},{'name':a21_0x12ea88(0x215),'type':a21_0x12ea88(0x1fc),'description':a21_0x12ea88(0x209),'default':![]}],'execute':execute};function a21_0x589f(_0x143d64,_0x501f0c){_0x143d64=_0x143d64-0x1f2;const _0x4ea278=a21_0x4ea2();let _0x589f5d=_0x4ea278[_0x143d64];return _0x589f5d;}function a21_0x4ea2(){const _0x15c121=['19179ilqRrS','appcode','projectPath','46235BBUiOU','boolean','defaultApp','852RObILC','entries','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','2029659HAFSZP','\x20in\x20','object','map','apps','1208pPTwyf','bool','11MXAnYe','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','globalConfig','.\x20Use\x20`','app','read','2574516oACrYU','6lnCkUv','165105rdBNuz','No\x20apps\x20configured','global','merged','projectConfig','project','4423620NczwfM','globalPath','isCurrent','5361070zRXMdz','find','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','length','mergedCli','inherit'];a21_0x4ea2=function(){return _0x15c121;};return a21_0x4ea2();}
@@ -1 +1 @@
1
- const a101_0x2954f3=a101_0x3e5b;(function(_0x15b8c2,_0x100f82){const _0x42cc47=a101_0x3e5b,_0x46b9aa=_0x15b8c2();while(!![]){try{const _0x5c4e09=parseInt(_0x42cc47(0x149))/0x1*(parseInt(_0x42cc47(0x15c))/0x2)+-parseInt(_0x42cc47(0x155))/0x3*(-parseInt(_0x42cc47(0x13e))/0x4)+parseInt(_0x42cc47(0x14f))/0x5+parseInt(_0x42cc47(0x142))/0x6+parseInt(_0x42cc47(0x14c))/0x7*(parseInt(_0x42cc47(0x14d))/0x8)+-parseInt(_0x42cc47(0x14a))/0x9+parseInt(_0x42cc47(0x147))/0xa*(-parseInt(_0x42cc47(0x159))/0xb);if(_0x5c4e09===_0x100f82)break;else _0x46b9aa['push'](_0x46b9aa['shift']());}catch(_0x415b08){_0x46b9aa['push'](_0x46b9aa['shift']());}}}(a101_0x3719,0x8bf7f));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a101_0x3719(){const _0x5c9770=['\x20Default\x20app\x20changed\x20to\x20\x22','length','Missing\x20app\x20name.','projectConfig','16867470MgomYw','bool','339564FmPAkD','6689007vYoTpN','Removed\x20app\x20\x22','7eMWgQN','8897128flYtHs','validation','1615805KgHqPs','remove','args','global','globalConfig','Use\x20global\x20config\x20scope','58557TiHPrn','Usage:\x20','high-risk-write','object','11DlvHTi','project','defaultApp','6XLueOb','apps','\x22\x20not\x20found.','boolean','both','inherit','keys','\x20Note:\x20app\x20\x22','trim','28xEFPEQ','Remove\x20an\x20app\x20from\x20config','App\x20\x22','\x20config.','2475924jclfWp'];a101_0x3719=function(){return _0x5c9770;};return a101_0x3719();}import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x3efa8d){const _0x32bcaa=a101_0x3e5b,_0x3656b3=_0x3efa8d['args'][0x0]?.[_0x32bcaa(0x164)]();if(!_0x3656b3)throw CliErrors[_0x32bcaa(0x14e)](_0x32bcaa(0x145),_0x32bcaa(0x156)+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');}async function execute(_0x59e1a9){const _0x11b71c=a101_0x3e5b,_0xc08949=_0x59e1a9[_0x11b71c(0x151)][0x0]?.[_0x11b71c(0x164)]();if(!_0xc08949)throw CliErrors[_0x11b71c(0x14e)](_0x11b71c(0x145),_0x11b71c(0x156)+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');const _0x12eee9=_0x59e1a9[_0x11b71c(0x148)](_0x11b71c(0x152)),{config:_0x5ac5f4,layers:_0x474850}=readRawConfigWithLayers(),_0x3c9df3=_0x5ac5f4[_0x11b71c(0x15d)]??{};if(!_0x3c9df3[_0xc08949])throw CliErrors[_0x11b71c(0x14e)]('App\x20\x22'+_0xc08949+_0x11b71c(0x15e));const _0x315c89=_0x474850[_0x11b71c(0x153)][_0x11b71c(0x15d)]&&typeof _0x474850[_0x11b71c(0x153)][_0x11b71c(0x15d)]===_0x11b71c(0x158)?_0x474850[_0x11b71c(0x153)][_0x11b71c(0x15d)]:{},_0x35e6bb=_0x474850['projectConfig'][_0x11b71c(0x15d)]&&typeof _0x474850['projectConfig'][_0x11b71c(0x15d)]===_0x11b71c(0x158)?_0x474850[_0x11b71c(0x146)][_0x11b71c(0x15d)]:{},_0x117168=appDefinedIn(_0xc08949,_0x315c89,_0x35e6bb,_0x474850[_0x11b71c(0x146)][_0x11b71c(0x161)]===![]),_0x4863bb=resolveAppScopeForWrite(_0xc08949,_0x12eee9,_0x474850),_0x179499={'global':_0x4863bb===_0x11b71c(0x152)},_0x53cdc3=readConfig(_0x179499),_0x53feb4=_0x53cdc3[_0x11b71c(0x15d)];if(!_0x53feb4||!_0x53feb4[_0xc08949])throw CliErrors[_0x11b71c(0x14e)](_0x11b71c(0x140)+_0xc08949+_0x11b71c(0x15e));delete _0x53feb4[_0xc08949];let _0x383762='';if(_0x53cdc3['defaultApp']===_0xc08949){const _0x402840=Object[_0x11b71c(0x162)](_0x53feb4);_0x53cdc3[_0x11b71c(0x15b)]=_0x402840[_0x11b71c(0x144)]>0x0?_0x402840[0x0]:undefined,_0x53cdc3[_0x11b71c(0x15b)]?_0x383762=_0x11b71c(0x143)+_0x53cdc3['defaultApp']+'\x22.':delete _0x53cdc3['defaultApp'];}Object[_0x11b71c(0x162)](_0x53feb4)['length']===0x0&&(delete _0x53cdc3['apps'],delete _0x53cdc3[_0x11b71c(0x15b)]);writeConfig(_0x53cdc3,_0x179499);const _0xecdc21=_0x117168===_0x11b71c(0x160)?_0x11b71c(0x163)+_0xc08949+'\x22\x20still\x20defined\x20in\x20'+(_0x4863bb===_0x11b71c(0x15a)?_0x11b71c(0x152):_0x11b71c(0x15a))+_0x11b71c(0x141):'';return{'ok':!![],'message':_0x11b71c(0x14b)+_0xc08949+'\x22'+scopeLabel(_0x179499)+'.'+_0x383762+_0xecdc21};}function a101_0x3e5b(_0x58802b,_0x572725){_0x58802b=_0x58802b-0x13e;const _0x371954=a101_0x3719();let _0x3e5bee=_0x371954[_0x58802b];return _0x3e5bee;}export const appRemoveDefinition={'service':'app','command':a101_0x2954f3(0x150),'description':a101_0x2954f3(0x13f),'risk':a101_0x2954f3(0x157),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':[{'name':a101_0x2954f3(0x152),'type':a101_0x2954f3(0x15f),'description':a101_0x2954f3(0x154),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a22_0x5b16ca=a22_0x4cba;(function(_0x22958b,_0xfb248b){const _0x55090c=a22_0x4cba,_0xd42ab7=_0x22958b();while(!![]){try{const _0x3f8bc3=parseInt(_0x55090c(0x144))/0x1+-parseInt(_0x55090c(0x13a))/0x2*(parseInt(_0x55090c(0x145))/0x3)+parseInt(_0x55090c(0x133))/0x4+parseInt(_0x55090c(0x155))/0x5*(-parseInt(_0x55090c(0x157))/0x6)+-parseInt(_0x55090c(0x14a))/0x7*(-parseInt(_0x55090c(0x136))/0x8)+-parseInt(_0x55090c(0x13e))/0x9+parseInt(_0x55090c(0x143))/0xa;if(_0x3f8bc3===_0xfb248b)break;else _0xd42ab7['push'](_0xd42ab7['shift']());}catch(_0x16e0f5){_0xd42ab7['push'](_0xd42ab7['shift']());}}}(a22_0x268f,0xca805));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a22_0x4cba(_0x1ff76e,_0x5234a7){_0x1ff76e=_0x1ff76e-0x130;const _0x268f23=a22_0x268f();let _0x4cbae1=_0x268f23[_0x1ff76e];return _0x4cbae1;}import{readRawConfigWithLayers}from'../../context.js';function a22_0x268f(){const _0x308cf9=['\x22\x20not\x20found.','App\x20profile\x20name\x20to\x20remove','Use\x20global\x20config\x20scope','defaultApp','7813022HPNrZJ','object','apps','high-risk-write','\x22\x20still\x20defined\x20in\x20','bool','boolean','\x20app\x20remove\x20<name>\x20[--global]','project','Removed\x20app\x20\x22','args','85ggUhQg','\x20Note:\x20app\x20\x22','514986fGguyH','\x20config.','remove','global','1234248DEKoHg','trim','\x20Default\x20app\x20changed\x20to\x20\x22','8QSPDEL','globalConfig','keys','Missing\x20app\x20name.','3007506XXwmnq','app','validation','projectConfig','2823219tqnlTj','Usage:\x20','both','App\x20\x22','length','24043790HPRNQg','276929TVDYjC','3hwjtOO'];a22_0x268f=function(){return _0x308cf9;};return a22_0x268f();}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x4d5077){const _0x542c23=a22_0x4cba,_0x8a9fa=_0x4d5077[_0x542c23(0x154)][0x0]?.[_0x542c23(0x134)]();if(!_0x8a9fa)throw CliErrors['validation'](_0x542c23(0x139),_0x542c23(0x13f)+CLI_BIN_NAME+_0x542c23(0x151));}async function execute(_0xe9a3b7){const _0x3a43ad=a22_0x4cba,_0x5caa7a=_0xe9a3b7['args'][0x0]?.['trim']();if(!_0x5caa7a)throw CliErrors[_0x3a43ad(0x13c)](_0x3a43ad(0x139),'Usage:\x20'+CLI_BIN_NAME+_0x3a43ad(0x151));const _0x43e232=_0xe9a3b7[_0x3a43ad(0x14f)]('global'),{config:_0x3231f5,layers:_0x3c6870}=readRawConfigWithLayers(),_0x230b81=_0x3231f5[_0x3a43ad(0x14c)]??{};if(!_0x230b81[_0x5caa7a])throw CliErrors['validation']('App\x20\x22'+_0x5caa7a+_0x3a43ad(0x146));const _0x4c81e9=_0x3c6870[_0x3a43ad(0x137)]['apps']&&typeof _0x3c6870[_0x3a43ad(0x137)][_0x3a43ad(0x14c)]===_0x3a43ad(0x14b)?_0x3c6870['globalConfig'][_0x3a43ad(0x14c)]:{},_0x35d620=_0x3c6870['projectConfig'][_0x3a43ad(0x14c)]&&typeof _0x3c6870['projectConfig'][_0x3a43ad(0x14c)]===_0x3a43ad(0x14b)?_0x3c6870[_0x3a43ad(0x13d)][_0x3a43ad(0x14c)]:{},_0x5e5519=appDefinedIn(_0x5caa7a,_0x4c81e9,_0x35d620,_0x3c6870[_0x3a43ad(0x13d)]['inherit']===![]),_0x28dae9=resolveAppScopeForWrite(_0x5caa7a,_0x43e232,_0x3c6870),_0x1869a6={'global':_0x28dae9===_0x3a43ad(0x132)},_0x28d027=readConfig(_0x1869a6),_0x14dc7e=_0x28d027[_0x3a43ad(0x14c)];if(!_0x14dc7e||!_0x14dc7e[_0x5caa7a])throw CliErrors[_0x3a43ad(0x13c)](_0x3a43ad(0x141)+_0x5caa7a+_0x3a43ad(0x146));delete _0x14dc7e[_0x5caa7a];let _0x2910ed='';if(_0x28d027[_0x3a43ad(0x149)]===_0x5caa7a){const _0xe33aa4=Object[_0x3a43ad(0x138)](_0x14dc7e);_0x28d027['defaultApp']=_0xe33aa4[_0x3a43ad(0x142)]>0x0?_0xe33aa4[0x0]:undefined,_0x28d027[_0x3a43ad(0x149)]?_0x2910ed=_0x3a43ad(0x135)+_0x28d027[_0x3a43ad(0x149)]+'\x22.':delete _0x28d027[_0x3a43ad(0x149)];}Object['keys'](_0x14dc7e)[_0x3a43ad(0x142)]===0x0&&(delete _0x28d027[_0x3a43ad(0x14c)],delete _0x28d027[_0x3a43ad(0x149)]);writeConfig(_0x28d027,_0x1869a6);const _0x374fe2=_0x5e5519===_0x3a43ad(0x140)?_0x3a43ad(0x156)+_0x5caa7a+_0x3a43ad(0x14e)+(_0x28dae9===_0x3a43ad(0x152)?_0x3a43ad(0x132):_0x3a43ad(0x152))+_0x3a43ad(0x130):'';return{'ok':!![],'message':_0x3a43ad(0x153)+_0x5caa7a+'\x22'+scopeLabel(_0x1869a6)+'.'+_0x2910ed+_0x374fe2};}export const appRemoveDefinition={'service':a22_0x5b16ca(0x13b),'command':a22_0x5b16ca(0x131),'description':'Remove\x20an\x20app\x20from\x20config','risk':a22_0x5b16ca(0x14d),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a22_0x5b16ca(0x147),'required':!![]}],'flags':[{'name':'global','type':a22_0x5b16ca(0x150),'description':a22_0x5b16ca(0x148),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- function a105_0xddff(_0x604d38,_0x5d752e){_0x604d38=_0x604d38-0x142;const _0x42f8d9=a105_0x42f8();let _0xddfffe=_0x42f8d9[_0x604d38];return _0xddfffe;}(function(_0x3f2a30,_0x34a602){const _0x33b914=a105_0xddff,_0x3ca6a6=_0x3f2a30();while(!![]){try{const _0x69484=-parseInt(_0x33b914(0x152))/0x1+parseInt(_0x33b914(0x15a))/0x2+parseInt(_0x33b914(0x158))/0x3+parseInt(_0x33b914(0x157))/0x4+-parseInt(_0x33b914(0x154))/0x5*(parseInt(_0x33b914(0x149))/0x6)+parseInt(_0x33b914(0x155))/0x7+parseInt(_0x33b914(0x14d))/0x8*(-parseInt(_0x33b914(0x14a))/0x9);if(_0x69484===_0x34a602)break;else _0x3ca6a6['push'](_0x3ca6a6['shift']());}catch(_0x255ab2){_0x3ca6a6['push'](_0x3ca6a6['shift']());}}}(a105_0x42f8,0x75b59));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x526ac3,_0x3bf24f){const _0x2d09dc=a105_0xddff;if(!_0x3bf24f)return;const _0x1e8f6e=_0x3bf24f[_0x2d09dc(0x142)]&&typeof _0x3bf24f[_0x2d09dc(0x142)]===_0x2d09dc(0x14c)?_0x3bf24f[_0x2d09dc(0x142)]:{},_0x3b067c=Object['keys'](_0x1e8f6e)['length']>0x0;for(const _0x451c0c of _0x526ac3){_0x451c0c[_0x2d09dc(0x144)]=![];}const _0x21c94e=_0x3bf24f[_0x2d09dc(0x150)]!=null?String(_0x3bf24f[_0x2d09dc(0x150)])[_0x2d09dc(0x14f)]():'';if(_0x3b067c){const _0x35209d=_0x3bf24f[_0x2d09dc(0x14e)]??_0x3bf24f[_0x2d09dc(0x147)];if(_0x35209d)for(const _0x528dab of _0x526ac3){_0x528dab[_0x2d09dc(0x15c)]===!![]&&_0x528dab[_0x2d09dc(0x143)]===_0x35209d&&(_0x528dab['isCurrent']=!![]);}for(const _0x44fa6b of _0x526ac3){if(_0x44fa6b[_0x2d09dc(0x15c)]!==![])continue;if(_0x3bf24f[_0x2d09dc(0x147)])continue;_0x21c94e&&String(_0x44fa6b[_0x2d09dc(0x14b)]??'')['trim']()===_0x21c94e&&(_0x44fa6b[_0x2d09dc(0x144)]=!![]);}return;}if(!_0x21c94e)return;for(const _0x2f431b of _0x526ac3){String(_0x2f431b[_0x2d09dc(0x14b)]??'')[_0x2d09dc(0x14f)]()===_0x21c94e&&(_0x2f431b['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x53841f,_0x22c196,_0x47b2b9){const _0x2c3e1e=a105_0xddff;if(_0x22c196)return _0x2c3e1e(0x159);const _0x1c1bd4=_0x47b2b9[_0x2c3e1e(0x151)]['apps']&&typeof _0x47b2b9['projectConfig']['apps']===_0x2c3e1e(0x14c)?_0x47b2b9['projectConfig'][_0x2c3e1e(0x142)]:{},_0xdb8953=_0x47b2b9['globalConfig'][_0x2c3e1e(0x142)]&&typeof _0x47b2b9[_0x2c3e1e(0x15d)]['apps']===_0x2c3e1e(0x14c)?_0x47b2b9[_0x2c3e1e(0x15d)][_0x2c3e1e(0x142)]:{};if(Object[_0x2c3e1e(0x15b)][_0x2c3e1e(0x145)][_0x2c3e1e(0x148)](_0x1c1bd4,_0x53841f))return _0x2c3e1e(0x146);if(Object[_0x2c3e1e(0x15b)][_0x2c3e1e(0x145)][_0x2c3e1e(0x148)](_0xdb8953,_0x53841f))return _0x2c3e1e(0x159);return _0x2c3e1e(0x146);}export function appDefinedIn(_0x283d46,_0x64262a,_0x46e95e,_0x355b7e){const _0x3b970c=a105_0xddff;if(_0x355b7e)return Object['prototype'][_0x3b970c(0x145)][_0x3b970c(0x148)](_0x46e95e,_0x283d46)?_0x3b970c(0x146):_0x3b970c(0x159);const _0x2f8676=Object[_0x3b970c(0x15b)]['hasOwnProperty'][_0x3b970c(0x148)](_0x64262a,_0x283d46),_0x88fa0d=Object[_0x3b970c(0x15b)][_0x3b970c(0x145)][_0x3b970c(0x148)](_0x46e95e,_0x283d46);if(_0x2f8676&&_0x88fa0d)return _0x3b970c(0x15e);if(_0x88fa0d)return _0x3b970c(0x146);return _0x3b970c(0x159);}export function resolveDefaultAppSource(_0x264260){const _0x3947a0=a105_0xddff,_0x302e10=_0x264260['projectConfig'][_0x3947a0(0x142)]&&typeof _0x264260[_0x3947a0(0x151)][_0x3947a0(0x142)]===_0x3947a0(0x14c)?_0x264260[_0x3947a0(0x151)]['apps']:{};if(_0x3947a0(0x147)in _0x264260[_0x3947a0(0x151)])return _0x3947a0(0x146);if(Object['keys'](_0x302e10)[_0x3947a0(0x156)]>0x0)return'project';if(_0x264260[_0x3947a0(0x151)][_0x3947a0(0x153)]===![])return null;if(_0x264260[_0x3947a0(0x15d)][_0x3947a0(0x147)])return _0x3947a0(0x159);return null;}function a105_0x42f8(){const _0x46bd89=['both','apps','name','isCurrent','hasOwnProperty','project','defaultApp','call','34014gFYkrj','63xBQcSb','appcode','object','824520tIOSUO','currentApp','trim','appCode','projectConfig','268743JgBSMn','inherit','600lEEuYG','1558760XxhnGx','length','2994544HQXFak','1746291CxDMto','global','1198404pbSsRM','prototype','named','globalConfig'];a105_0x42f8=function(){return _0x46bd89;};return a105_0x42f8();}export function getConfigPath(_0x41aada={}){const _0x5429d6=a105_0xddff,_0x1683f6=_0x41aada[_0x5429d6(0x159)]?_0x5429d6(0x159):_0x5429d6(0x146);return resolveWriteConfigPath(_0x1683f6);}export function readConfig(_0x89d5f9={}){return readConfigFile(getConfigPath(_0x89d5f9));}export function writeConfig(_0x3300cc,_0x41a052={}){writeConfigFile(getConfigPath(_0x41a052),_0x3300cc);}export function scopeLabel(_0x1fd998){return _0x1fd998['global']?'\x20(global)':'';}
1
+ (function(_0x1184e4,_0xb1acf3){const _0x39b701=a23_0x1c12,_0x271cde=_0x1184e4();while(!![]){try{const _0x51db89=-parseInt(_0x39b701(0x1b6))/0x1*(-parseInt(_0x39b701(0x1a2))/0x2)+-parseInt(_0x39b701(0x1b8))/0x3*(-parseInt(_0x39b701(0x1a4))/0x4)+parseInt(_0x39b701(0x1a9))/0x5+parseInt(_0x39b701(0x1af))/0x6*(-parseInt(_0x39b701(0x1bf))/0x7)+-parseInt(_0x39b701(0x1bc))/0x8*(parseInt(_0x39b701(0x1ae))/0x9)+-parseInt(_0x39b701(0x1ad))/0xa*(parseInt(_0x39b701(0x1a8))/0xb)+-parseInt(_0x39b701(0x1a7))/0xc*(parseInt(_0x39b701(0x1b1))/0xd);if(_0x51db89===_0xb1acf3)break;else _0x271cde['push'](_0x271cde['shift']());}catch(_0x1e023d){_0x271cde['push'](_0x271cde['shift']());}}}(a23_0x511e,0xe91e3));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x389210,_0x2fdc15){const _0x1e2db6=a23_0x1c12;if(!_0x2fdc15)return;const _0x434f6a=_0x2fdc15[_0x1e2db6(0x1ba)]&&typeof _0x2fdc15['apps']===_0x1e2db6(0x1aa)?_0x2fdc15[_0x1e2db6(0x1ba)]:{},_0x401dfb=Object['keys'](_0x434f6a)[_0x1e2db6(0x1ab)]>0x0;for(const _0x28b7b7 of _0x389210){_0x28b7b7[_0x1e2db6(0x1a1)]=![];}const _0x5f2b38=_0x2fdc15[_0x1e2db6(0x1b5)]!=null?String(_0x2fdc15[_0x1e2db6(0x1b5)])[_0x1e2db6(0x1b7)]():'';if(_0x401dfb){const _0x1d4f4d=_0x2fdc15[_0x1e2db6(0x1a5)]??_0x2fdc15[_0x1e2db6(0x1c1)];if(_0x1d4f4d)for(const _0xbf7e92 of _0x389210){_0xbf7e92[_0x1e2db6(0x1c0)]===!![]&&_0xbf7e92[_0x1e2db6(0x1a0)]===_0x1d4f4d&&(_0xbf7e92[_0x1e2db6(0x1a1)]=!![]);}for(const _0x2204e8 of _0x389210){if(_0x2204e8[_0x1e2db6(0x1c0)]!==![])continue;if(_0x2fdc15[_0x1e2db6(0x1c1)])continue;_0x5f2b38&&String(_0x2204e8[_0x1e2db6(0x1b3)]??'')[_0x1e2db6(0x1b7)]()===_0x5f2b38&&(_0x2204e8['isCurrent']=!![]);}return;}if(!_0x5f2b38)return;for(const _0x4cee55 of _0x389210){String(_0x4cee55[_0x1e2db6(0x1b3)]??'')[_0x1e2db6(0x1b7)]()===_0x5f2b38&&(_0x4cee55['isCurrent']=!![]);}}function a23_0x511e(){const _0x4c67c6=['104ElhrFZ','call','appcode','globalConfig','appCode','332948gmeLzO','trim','5332395fNeMSh','hasOwnProperty','apps','global','1832cvTITx','keys','inherit','28RNmpMW','named','defaultApp','project','name','isCurrent','6VKTYhb','prototype','4OEqjGf','currentApp','projectConfig','786720HAcOsZ','710006IhmQkw','6715285RPGRNH','object','length','\x20(global)','180rcYJmV','41859yZmjtE','619692kWeUmV','both'];a23_0x511e=function(){return _0x4c67c6;};return a23_0x511e();}export function resolveAppScopeForWrite(_0x1ac82d,_0x5bd3db,_0x3a0642){const _0x3c9ded=a23_0x1c12;if(_0x5bd3db)return _0x3c9ded(0x1bb);const _0x4f723c=_0x3a0642[_0x3c9ded(0x1a6)][_0x3c9ded(0x1ba)]&&typeof _0x3a0642[_0x3c9ded(0x1a6)][_0x3c9ded(0x1ba)]===_0x3c9ded(0x1aa)?_0x3a0642['projectConfig'][_0x3c9ded(0x1ba)]:{},_0x1bb3e2=_0x3a0642[_0x3c9ded(0x1b4)][_0x3c9ded(0x1ba)]&&typeof _0x3a0642[_0x3c9ded(0x1b4)][_0x3c9ded(0x1ba)]===_0x3c9ded(0x1aa)?_0x3a0642['globalConfig'][_0x3c9ded(0x1ba)]:{};if(Object[_0x3c9ded(0x1a3)][_0x3c9ded(0x1b9)]['call'](_0x4f723c,_0x1ac82d))return _0x3c9ded(0x1c2);if(Object[_0x3c9ded(0x1a3)]['hasOwnProperty'][_0x3c9ded(0x1b2)](_0x1bb3e2,_0x1ac82d))return _0x3c9ded(0x1bb);return _0x3c9ded(0x1c2);}export function appDefinedIn(_0x186f3f,_0x71fbf6,_0x5c96ec,_0x2587cc){const _0x4cd525=a23_0x1c12;if(_0x2587cc)return Object[_0x4cd525(0x1a3)]['hasOwnProperty'][_0x4cd525(0x1b2)](_0x5c96ec,_0x186f3f)?'project':_0x4cd525(0x1bb);const _0x36cb5a=Object['prototype'][_0x4cd525(0x1b9)][_0x4cd525(0x1b2)](_0x71fbf6,_0x186f3f),_0x1b593e=Object[_0x4cd525(0x1a3)]['hasOwnProperty'][_0x4cd525(0x1b2)](_0x5c96ec,_0x186f3f);if(_0x36cb5a&&_0x1b593e)return _0x4cd525(0x1b0);if(_0x1b593e)return _0x4cd525(0x1c2);return _0x4cd525(0x1bb);}export function resolveDefaultAppSource(_0x5c7b5f){const _0x4aac93=a23_0x1c12,_0xce8b8=_0x5c7b5f[_0x4aac93(0x1a6)]['apps']&&typeof _0x5c7b5f['projectConfig'][_0x4aac93(0x1ba)]===_0x4aac93(0x1aa)?_0x5c7b5f[_0x4aac93(0x1a6)][_0x4aac93(0x1ba)]:{};if(_0x4aac93(0x1c1)in _0x5c7b5f[_0x4aac93(0x1a6)])return _0x4aac93(0x1c2);if(Object[_0x4aac93(0x1bd)](_0xce8b8)['length']>0x0)return'project';if(_0x5c7b5f['projectConfig'][_0x4aac93(0x1be)]===![])return null;if(_0x5c7b5f[_0x4aac93(0x1b4)]['defaultApp'])return _0x4aac93(0x1bb);return null;}function a23_0x1c12(_0x418b0b,_0x1ce13a){_0x418b0b=_0x418b0b-0x1a0;const _0x511ee6=a23_0x511e();let _0x1c12e1=_0x511ee6[_0x418b0b];return _0x1c12e1;}export function getConfigPath(_0x3d8cef={}){const _0x277cbe=a23_0x1c12,_0x3023f4=_0x3d8cef[_0x277cbe(0x1bb)]?_0x277cbe(0x1bb):_0x277cbe(0x1c2);return resolveWriteConfigPath(_0x3023f4);}export function readConfig(_0x20f90a={}){return readConfigFile(getConfigPath(_0x20f90a));}export function writeConfig(_0x3944a7,_0x2de0f4={}){writeConfigFile(getConfigPath(_0x2de0f4),_0x3944a7);}export function scopeLabel(_0x348a31){const _0x459f85=a23_0x1c12;return _0x348a31[_0x459f85(0x1bb)]?_0x459f85(0x1ac):'';}
@@ -1 +1 @@
1
- const a104_0x597b77=a104_0x52b6;(function(_0x6278da,_0x548c0d){const _0x31cac0=a104_0x52b6,_0x4a8c49=_0x6278da();while(!![]){try{const _0x4d9d4e=-parseInt(_0x31cac0(0x183))/0x1+-parseInt(_0x31cac0(0x17e))/0x2+-parseInt(_0x31cac0(0x18e))/0x3*(-parseInt(_0x31cac0(0x16b))/0x4)+-parseInt(_0x31cac0(0x18f))/0x5+-parseInt(_0x31cac0(0x174))/0x6+-parseInt(_0x31cac0(0x173))/0x7+parseInt(_0x31cac0(0x18b))/0x8;if(_0x4d9d4e===_0x548c0d)break;else _0x4a8c49['push'](_0x4a8c49['shift']());}catch(_0x421209){_0x4a8c49['push'](_0x4a8c49['shift']());}}}(a104_0x511b,0xd4304));import{CliErrors}from'../../errors.js';function a104_0x511b(){const _0x27f10c=['703344jqlFnm','Switch\x20the\x20default\x20app','validation','\x20--appcode\x20<code>`\x20first.','Default\x20app\x20set\x20to\x20\x22','object','keys','\x22\x20not\x20found.','28624816fLYnMv','join','write','64179qCcUus','1845430ErbRLc','Usage:\x20','prototype','name','308Ddeehh','Use\x20global\x20config\x20scope','Available:\x20','call','projectPath','use','bool','hasOwnProperty','9528225pcYoyE','8120652XvdkdA','\x0aNote:\x20\x22','length','apps','App\x20\x22','global','trim','\x20app\x20use\x20<name>\x20[--global]','defaultApp','appcode','1138384OmyoNw','App\x20profile\x20name\x20to\x20activate','projectConfig','args','Missing\x20app\x20name.'];a104_0x511b=function(){return _0x27f10c;};return a104_0x511b();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers,isInProject}from'../../context.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x28aafa){const _0x5d5f17=a104_0x52b6,_0x42aa51=_0x28aafa[_0x5d5f17(0x181)][0x0]?.[_0x5d5f17(0x17a)]();if(!_0x42aa51)throw CliErrors[_0x5d5f17(0x185)](_0x5d5f17(0x182),_0x5d5f17(0x190)+CLI_BIN_NAME+_0x5d5f17(0x17b));}function a104_0x52b6(_0x317bb3,_0x48bd18){_0x317bb3=_0x317bb3-0x16a;const _0x511b49=a104_0x511b();let _0x52b600=_0x511b49[_0x317bb3];return _0x52b600;}async function execute(_0x5acb11){const _0x433f4d=a104_0x52b6,_0x54a730=_0x5acb11[_0x433f4d(0x181)][0x0]?.[_0x433f4d(0x17a)]();if(!_0x54a730)throw CliErrors[_0x433f4d(0x185)](_0x433f4d(0x182),_0x433f4d(0x190)+CLI_BIN_NAME+_0x433f4d(0x17b));const _0x39a456=_0x5acb11[_0x433f4d(0x171)](_0x433f4d(0x179)),{config:_0x253ffc,layers:_0x2abfbe}=readRawConfigWithLayers(),_0x5c1059=_0x253ffc[_0x433f4d(0x177)]??{};if(!_0x5c1059[_0x54a730]){const _0x4e0ba8=Object[_0x433f4d(0x189)](_0x5c1059),_0xc52654=_0x4e0ba8[_0x433f4d(0x176)]===0x0?'Use\x20`'+CLI_BIN_NAME+'\x20app\x20add\x20'+_0x54a730+_0x433f4d(0x186):_0x433f4d(0x16d)+_0x4e0ba8[_0x433f4d(0x18c)](',\x20');throw CliErrors['validation'](_0x433f4d(0x178)+_0x54a730+_0x433f4d(0x18a),_0xc52654);}let _0x52efd4,_0x4f1e2c='';if(_0x39a456)_0x52efd4={'global':!![]};else{const _0x154de8=isInProject()&&!!_0x2abfbe[_0x433f4d(0x16f)];_0x52efd4={'global':!_0x154de8};if(_0x154de8){const _0x58f733=_0x2abfbe[_0x433f4d(0x180)][_0x433f4d(0x177)]&&typeof _0x2abfbe[_0x433f4d(0x180)][_0x433f4d(0x177)]===_0x433f4d(0x188)?_0x2abfbe['projectConfig'][_0x433f4d(0x177)]:{};!Object[_0x433f4d(0x191)][_0x433f4d(0x172)][_0x433f4d(0x16e)](_0x58f733,_0x54a730)&&(_0x4f1e2c=_0x433f4d(0x175)+_0x54a730+'\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.');}}const _0x34d109=readConfig(_0x52efd4);return _0x34d109[_0x433f4d(0x17c)]=_0x54a730,writeConfig(_0x34d109,_0x52efd4),{'ok':!![],'message':_0x433f4d(0x187)+_0x54a730+'\x22\x20(appcode:\x20'+_0x5c1059[_0x54a730][_0x433f4d(0x17d)]+')'+scopeLabel(_0x52efd4)+_0x4f1e2c};}export const appUseDefinition={'service':'app','command':a104_0x597b77(0x170),'description':a104_0x597b77(0x184),'risk':a104_0x597b77(0x18d),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a104_0x597b77(0x16a),'description':a104_0x597b77(0x17f),'required':!![]}],'flags':[{'name':a104_0x597b77(0x179),'type':'boolean','description':a104_0x597b77(0x16c),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a24_0xa7c0ec=a24_0x234b;(function(_0x3e1515,_0x78e36){const _0xf18d26=a24_0x234b,_0x54cf1d=_0x3e1515();while(!![]){try{const _0x7894b7=-parseInt(_0xf18d26(0x18a))/0x1*(-parseInt(_0xf18d26(0x193))/0x2)+-parseInt(_0xf18d26(0x16d))/0x3*(parseInt(_0xf18d26(0x16f))/0x4)+-parseInt(_0xf18d26(0x184))/0x5*(parseInt(_0xf18d26(0x175))/0x6)+-parseInt(_0xf18d26(0x18d))/0x7*(parseInt(_0xf18d26(0x182))/0x8)+parseInt(_0xf18d26(0x16a))/0x9*(parseInt(_0xf18d26(0x191))/0xa)+parseInt(_0xf18d26(0x176))/0xb+-parseInt(_0xf18d26(0x179))/0xc;if(_0x7894b7===_0x78e36)break;else _0x54cf1d['push'](_0x54cf1d['shift']());}catch(_0x271ff8){_0x54cf1d['push'](_0x54cf1d['shift']());}}}(a24_0x34e6,0x9f156));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a24_0x34e6(){const _0x2411d4=['Switch\x20the\x20default\x20app','14655YgjmuV','\x20--appcode\x20<code>`\x20first.','\x20app\x20use\x20<name>\x20[--global]','apps','Available:\x20','object','11599jasYOY','\x22\x20(appcode:\x20','Use\x20`','28apDPCr','defaultApp','validation','global','2922200CADwGr','App\x20\x22','204swSohF','args','app','9auRShb','keys','\x20app\x20add\x20','51pPvQBG','name','100668xsTFbl','bool','Use\x20global\x20config\x20scope','Usage:\x20','trim','use','582wXWsEM','6034248bojULD','projectConfig','projectPath','5125560mKrsQi','appcode','\x22\x20not\x20found.','\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.','boolean','Missing\x20app\x20name.','write','\x0aNote:\x20\x22','App\x20profile\x20name\x20to\x20activate','466008OWLxWn'];a24_0x34e6=function(){return _0x2411d4;};return a24_0x34e6();}import{readRawConfigWithLayers,isInProject}from'../../context.js';import{readConfig,writeConfig,scopeLabel}from'../../commands/app/shared.js';async function validateArgs(_0x3b9619){const _0x12d3ea=a24_0x234b,_0x1dcde4=_0x3b9619[_0x12d3ea(0x194)][0x0]?.[_0x12d3ea(0x173)]();if(!_0x1dcde4)throw CliErrors[_0x12d3ea(0x18f)](_0x12d3ea(0x17e),_0x12d3ea(0x172)+CLI_BIN_NAME+_0x12d3ea(0x186));}function a24_0x234b(_0x374c1c,_0x1d56dc){_0x374c1c=_0x374c1c-0x169;const _0x34e669=a24_0x34e6();let _0x234bfe=_0x34e669[_0x374c1c];return _0x234bfe;}async function execute(_0x476b07){const _0x5a62ea=a24_0x234b,_0x109c6b=_0x476b07['args'][0x0]?.[_0x5a62ea(0x173)]();if(!_0x109c6b)throw CliErrors[_0x5a62ea(0x18f)](_0x5a62ea(0x17e),_0x5a62ea(0x172)+CLI_BIN_NAME+_0x5a62ea(0x186));const _0x1f437e=_0x476b07[_0x5a62ea(0x170)](_0x5a62ea(0x190)),{config:_0x4ee839,layers:_0x29bb00}=readRawConfigWithLayers(),_0x4b5211=_0x4ee839['apps']??{};if(!_0x4b5211[_0x109c6b]){const _0x5942f1=Object[_0x5a62ea(0x16b)](_0x4b5211),_0x277af4=_0x5942f1['length']===0x0?_0x5a62ea(0x18c)+CLI_BIN_NAME+_0x5a62ea(0x16c)+_0x109c6b+_0x5a62ea(0x185):_0x5a62ea(0x188)+_0x5942f1['join'](',\x20');throw CliErrors[_0x5a62ea(0x18f)](_0x5a62ea(0x192)+_0x109c6b+_0x5a62ea(0x17b),_0x277af4);}let _0x1b0789,_0x23f43c='';if(_0x1f437e)_0x1b0789={'global':!![]};else{const _0x282e9b=isInProject()&&!!_0x29bb00[_0x5a62ea(0x178)];_0x1b0789={'global':!_0x282e9b};if(_0x282e9b){const _0x5a74a7=_0x29bb00[_0x5a62ea(0x177)][_0x5a62ea(0x187)]&&typeof _0x29bb00[_0x5a62ea(0x177)][_0x5a62ea(0x187)]===_0x5a62ea(0x189)?_0x29bb00[_0x5a62ea(0x177)][_0x5a62ea(0x187)]:{};!Object['prototype']['hasOwnProperty']['call'](_0x5a74a7,_0x109c6b)&&(_0x23f43c=_0x5a62ea(0x180)+_0x109c6b+_0x5a62ea(0x17c));}}const _0x2c8964=readConfig(_0x1b0789);return _0x2c8964[_0x5a62ea(0x18e)]=_0x109c6b,writeConfig(_0x2c8964,_0x1b0789),{'ok':!![],'message':'Default\x20app\x20set\x20to\x20\x22'+_0x109c6b+_0x5a62ea(0x18b)+_0x4b5211[_0x109c6b][_0x5a62ea(0x17a)]+')'+scopeLabel(_0x1b0789)+_0x23f43c};}export const appUseDefinition={'service':a24_0xa7c0ec(0x169),'command':a24_0xa7c0ec(0x174),'description':a24_0xa7c0ec(0x183),'risk':a24_0xa7c0ec(0x17f),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a24_0xa7c0ec(0x16e),'description':a24_0xa7c0ec(0x181),'required':!![]}],'flags':[{'name':a24_0xa7c0ec(0x190),'type':a24_0xa7c0ec(0x17d),'description':a24_0xa7c0ec(0x171),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- const a91_0x572544=a91_0xa5f0;function a91_0xa5f0(_0x1f4403,_0x28c1b6){_0x1f4403=_0x1f4403-0x178;const _0x10060f=a91_0x1006();let _0xa5f0e8=_0x10060f[_0x1f4403];return _0xa5f0e8;}(function(_0x1eb462,_0x2e571a){const _0x161c73=a91_0xa5f0,_0x465974=_0x1eb462();while(!![]){try{const _0x301364=-parseInt(_0x161c73(0x180))/0x1+parseInt(_0x161c73(0x182))/0x2+-parseInt(_0x161c73(0x17d))/0x3*(parseInt(_0x161c73(0x17a))/0x4)+parseInt(_0x161c73(0x186))/0x5*(-parseInt(_0x161c73(0x17e))/0x6)+-parseInt(_0x161c73(0x17c))/0x7+-parseInt(_0x161c73(0x183))/0x8+parseInt(_0x161c73(0x188))/0x9*(parseInt(_0x161c73(0x184))/0xa);if(_0x301364===_0x2e571a)break;else _0x465974['push'](_0x465974['shift']());}catch(_0xa17c18){_0x465974['push'](_0x465974['shift']());}}}(a91_0x1006,0x24bcd));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a91_0x572544(0x187),'description':a91_0x572544(0x179),'risk':a91_0x572544(0x189),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3dd0f0){const {runAuthServer:_0x476eee}=await import('../../auth/auth-server-ui.js');return await _0x476eee(),{'ok':!![]};}},{'service':a91_0x572544(0x181),'command':a91_0x572544(0x178),'description':'Clear\x20login\x20session','risk':a91_0x572544(0x17f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x343b76){const _0x4e504f=a91_0x572544;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x4e504f(0x185)]('✓\x20Logged\x20out')):console[_0x4e504f(0x185)](_0x4e504f(0x17b)),{'ok':!![]};}}];function a91_0x1006(){const _0x35669f=['166164fmlpGD','auth','82656kxlXLc','1933528JyBRYj','160CMauyE','log','214365GCxkrx','login','417726xOtUum','read','logout','Login\x20via\x20browser','44wDPKqB','!\x20Not\x20logged\x20in','98742QXrNFG','45993fGivkv','6sFJWTv','write'];a91_0x1006=function(){return _0x35669f;};return a91_0x1006();}
1
+ const a25_0x2f733c=a25_0x4506;(function(_0x1d3eb4,_0x4ec82e){const _0x709767=a25_0x4506,_0x2dd95f=_0x1d3eb4();while(!![]){try{const _0x2b99a1=parseInt(_0x709767(0xc1))/0x1*(parseInt(_0x709767(0xbd))/0x2)+parseInt(_0x709767(0xc8))/0x3+parseInt(_0x709767(0xc6))/0x4+parseInt(_0x709767(0xc9))/0x5+-parseInt(_0x709767(0xca))/0x6*(parseInt(_0x709767(0xba))/0x7)+-parseInt(_0x709767(0xc7))/0x8*(parseInt(_0x709767(0xc2))/0x9)+parseInt(_0x709767(0xbe))/0xa*(-parseInt(_0x709767(0xcc))/0xb);if(_0x2b99a1===_0x4ec82e)break;else _0x2dd95f['push'](_0x2dd95f['shift']());}catch(_0x3a8e01){_0x2dd95f['push'](_0x2dd95f['shift']());}}}(a25_0x45ae,0x7468a));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a25_0x4506(_0x36129c,_0x4aa280){_0x36129c=_0x36129c-0xb8;const _0x45ae05=a25_0x45ae();let _0x4506bc=_0x45ae05[_0x36129c];return _0x4506bc;}function a25_0x45ae(){const _0x8b3bda=['log','../../auth/auth-server-ui.js','7105gCgumV','write','!\x20Not\x20logged\x20in','1884jEdNRo','84590HVOQcm','auth','read','607sDfGHG','252ZrbJfR','Login\x20via\x20browser','logout','login','1072728ViTmPv','153992BWoSUm','2468118gXXSos','3405715ZYOEDK','1500mMITMl','✓\x20Logged\x20out','1397osnEiY'];a25_0x45ae=function(){return _0x8b3bda;};return a25_0x45ae();}export const authDefinitions=[{'service':a25_0x2f733c(0xbf),'command':a25_0x2f733c(0xc5),'description':a25_0x2f733c(0xc3),'risk':a25_0x2f733c(0xc0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x17d223){const _0x361fa5=a25_0x2f733c,{runAuthServer:_0x52a5e5}=await import(_0x361fa5(0xb9));return await _0x52a5e5(),{'ok':!![]};}},{'service':a25_0x2f733c(0xbf),'command':a25_0x2f733c(0xc4),'description':'Clear\x20login\x20session','risk':a25_0x2f733c(0xbb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5383ce){const _0x41388a=a25_0x2f733c;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x41388a(0xb8)](_0x41388a(0xcb))):console[_0x41388a(0xb8)](_0x41388a(0xbc)),{'ok':!![]};}}];
@@ -0,0 +1 @@
1
+ const a26_0x365278=a26_0x1e7e;(function(_0x3b6389,_0x11f62a){const _0x3f80a3=a26_0x1e7e,_0x56532b=_0x3b6389();while(!![]){try{const _0x28576b=-parseInt(_0x3f80a3(0xbb))/0x1+parseInt(_0x3f80a3(0xba))/0x2+-parseInt(_0x3f80a3(0xa7))/0x3+parseInt(_0x3f80a3(0xeb))/0x4+parseInt(_0x3f80a3(0xf2))/0x5*(parseInt(_0x3f80a3(0xd8))/0x6)+-parseInt(_0x3f80a3(0xc0))/0x7+-parseInt(_0x3f80a3(0xf1))/0x8;if(_0x28576b===_0x11f62a)break;else _0x56532b['push'](_0x56532b['shift']());}catch(_0x8ca819){_0x56532b['push'](_0x56532b['shift']());}}}(a26_0x48f2,0xea6f0));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 bffCreate={'service':a26_0x365278(0xae),'command':a26_0x365278(0xa5),'description':a26_0x365278(0xa1),'risk':a26_0x365278(0xed),'flags':[{'name':a26_0x365278(0xb7),'type':a26_0x365278(0xa9),'required':!![],'enum':[a26_0x365278(0xb1),a26_0x365278(0xe7),a26_0x365278(0xd5)],'description':a26_0x365278(0xaa)},{'name':'name','type':a26_0x365278(0xa9),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':'string','description':'Script\x20description'},{'name':a26_0x365278(0xc4),'type':a26_0x365278(0xa9),'description':a26_0x365278(0xe5)},{'name':a26_0x365278(0xab),'type':a26_0x365278(0xa9),'description':a26_0x365278(0xcf)},{'name':a26_0x365278(0xd3),'type':'string','description':a26_0x365278(0xea)},{'name':a26_0x365278(0xe0),'type':a26_0x365278(0xa9),'description':a26_0x365278(0x9e),'enum':['before','after']}],async 'validate'(_0x3cc66b){const _0x171111=a26_0x365278,_0x544d19=_0x3cc66b[_0x171111(0xf4)](_0x171111(0xdf));if(!isValidBffFunctionName(_0x544d19))throw CliErrors[_0x171111(0xb2)]('Invalid\x20function\x20name\x20\x22'+_0x544d19+_0x171111(0xc7));},async 'execute'(_0x246e93){const _0x4e4fb6=a26_0x365278,_0x17d5f8=loadBffProjectConfig(_0x246e93[_0x4e4fb6(0xbf)]),_0x3496d3=_0x246e93[_0x4e4fb6(0xf4)]('type'),_0xd00f63=_0x246e93[_0x4e4fb6(0xf4)](_0x4e4fb6(0xdf)),_0x438efa=_0x246e93[_0x4e4fb6(0xf4)](_0x4e4fb6(0x9f))||undefined,_0x1b8661=_0x3496d3===_0x4e4fb6(0xd5)?await resolveHookOptions(_0x17d5f8,_0x246e93):undefined,_0x4ff173=buildFilePath(_0x17d5f8,_0x3496d3,_0xd00f63,_0x1b8661);if(await fileExists(_0x4ff173))throw CliErrors['validation'](_0x4e4fb6(0x9d)+_0x4ff173);await mkdir(dirname(_0x4ff173),{'recursive':!![]});const _0x438219=generateTemplate(_0x3496d3,_0xd00f63,_0x246e93[_0x4e4fb6(0xbf)],_0x438efa,_0x1b8661);await writeFile(_0x4ff173,_0x438219,'utf8');const _0x4f0333={'type':_0x3496d3,'name':_0xd00f63,'path':_0x4ff173};if(_0x438efa)_0x4f0333[_0x4e4fb6(0x9f)]=_0x438efa;if(_0x1b8661){if(_0x1b8661[_0x4e4fb6(0xc4)])_0x4f0333[_0x4e4fb6(0xc4)]=_0x1b8661[_0x4e4fb6(0xc4)];_0x4f0333['datasetCode']=_0x1b8661[_0x4e4fb6(0xe1)],_0x4f0333[_0x4e4fb6(0xbc)]=_0x1b8661[_0x4e4fb6(0xbc)],_0x4f0333['functionNode']=_0x1b8661[_0x4e4fb6(0xa4)];}return{'ok':!![],'data':_0x4f0333,'message':_0x4e4fb6(0xdb)+_0x3496d3+_0x4e4fb6(0xa3)+_0xd00f63};}};async function resolveHookOptions(_0x3d3717,_0x23d98a){const _0x513217=a26_0x365278,_0x8d3d2e=loadAliasMap(_0x23d98a[_0x513217(0xd2)],undefined,resolveApiFilePath(_0x23d98a[_0x513217(0xd2)],_0x23d98a[_0x513217(0xbf)])),_0x1146f2=_0x8d3d2e[_0x513217(0xdd)]>0x0;let _0x521df8,_0x3e98ee,_0x583bd1;const _0x51887e=_0x23d98a[_0x513217(0xf4)]('alias'),_0x28d65b=_0x23d98a[_0x513217(0xf4)]('datasetcode');if(_0x51887e){const _0x28fc5d=resolveAlias(_0x23d98a[_0x513217(0xd2)],_0x51887e,undefined,resolveApiFilePath(_0x23d98a[_0x513217(0xd2)],_0x23d98a[_0x513217(0xbf)]));if(!_0x28fc5d){const _0x5af8b5=_0x1146f2?_0x513217(0xe8)+_0x8d3d2e['map'](_0x1ac946=>_0x1ac946['alias'])[_0x513217(0xe4)](',\x20'):_0x513217(0xef)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x513217(0xb2)](_0x513217(0xaf)+_0x51887e+_0x513217(0xe6)+_0x5af8b5);}_0x521df8=_0x51887e,_0x3e98ee=_0x28fc5d;}else{if(_0x28d65b){_0x3e98ee=_0x28d65b;const _0x2c8b29=_0x8d3d2e[_0x513217(0xd6)](_0x38a382=>_0x38a382[_0x513217(0xe1)]===_0x28d65b);_0x521df8=_0x2c8b29?.[_0x513217(0xc4)];}else{if(_0x23d98a['nonInteractive'])throw CliErrors[_0x513217(0xb2)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x1146f2){const _0x49257c=_0x8d3d2e[_0x513217(0xc1)](_0x3c2fc7=>_0x3c2fc7[_0x513217(0xc4)]+'\x20('+_0x3c2fc7[_0x513217(0xcd)]+')'),_0x109e36=await promptSelect(_0x513217(0xca),_0x49257c),_0x13a82c=_0x8d3d2e[_0x109e36];if(!_0x13a82c)throw CliErrors[_0x513217(0xb2)](_0x513217(0xd9));_0x521df8=_0x13a82c[_0x513217(0xc4)],_0x3e98ee=_0x13a82c[_0x513217(0xe1)];}else{const _0x3a8b72=await listDatasets(_0x23d98a[_0x513217(0xbf)]);if(_0x3a8b72[_0x513217(0xdd)]===0x0)throw CliErrors[_0x513217(0xb2)](_0x513217(0xc2));const _0x16814b=_0x3a8b72[_0x513217(0xc1)](_0x56fa93=>_0x56fa93[_0x513217(0xdf)]+'\x20('+_0x56fa93[_0x513217(0xb0)]+')'),_0x37df97=await promptSelect(_0x513217(0xca),_0x16814b),_0x25b090=_0x3a8b72[_0x37df97];if(!_0x25b090)throw CliErrors[_0x513217(0xb2)](_0x513217(0xd9));_0x3e98ee=_0x25b090['code'],_0x521df8=undefined;}}}}const _0x59f5de=await listDatasets(_0x23d98a['appCode']),_0x65293a=_0x59f5de[_0x513217(0xd6)](_0x2549d5=>_0x2549d5[_0x513217(0xb0)]===_0x3e98ee);if(!_0x65293a)throw CliErrors[_0x513217(0xb2)](_0x513217(0xad)+_0x3e98ee+_0x513217(0xb6)+(_0x521df8?_0x513217(0xa8)+CLI_BIN_NAME+_0x513217(0xd7):''));_0x583bd1=_0x65293a['id'];const _0x1dda00=_0x521df8??_0x3e98ee,_0x1dd0be=await listBffDatasetOperations(_0x23d98a['appCode'],_0x583bd1),_0x23831a=_0x1dd0be?Object['keys'](_0x1dd0be):[];if(_0x23831a[_0x513217(0xdd)]===0x0)throw CliErrors[_0x513217(0xb2)](_0x513217(0xc8)+_0x1dda00+'.');let _0x23db59;const _0x231a39=_0x23d98a['str'](_0x513217(0xd3));if(_0x231a39){if(!_0x23831a[_0x513217(0xbe)](_0x231a39))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x231a39+_0x513217(0xc5)+_0x1dda00+'.\x20'+(_0x513217(0xcb)+_0x23831a[_0x513217(0xe4)](',\x20')));_0x23db59=_0x231a39;}else{if(_0x23d98a['nonInteractive'])throw CliErrors['validation'](_0x513217(0xe9));const _0x142312=await promptSelect(_0x513217(0xc3),_0x23831a);_0x23db59=_0x23831a[_0x142312]??_0x23831a[0x0];}let _0x3de050=normalizeHookFunctionNode(_0x23d98a[_0x513217(0xf4)](_0x513217(0xe0)));if(!_0x3de050){if(_0x23d98a[_0x513217(0xf4)](_0x513217(0xe0)))throw CliErrors['validation'](_0x513217(0xc6));if(_0x23d98a['nonInteractive'])throw CliErrors[_0x513217(0xb2)](_0x513217(0xf3));const _0x24b123=await promptSelect(_0x513217(0xb3),['before','after']);_0x3de050=[_0x513217(0xec),'after'][_0x24b123]??'before';}return{'alias':_0x521df8,'datasetCode':_0x3e98ee,'datasetId':_0x583bd1,'operationType':_0x23db59,'functionNode':_0x3de050};}async function promptSelect(_0x1d7389,_0x2a04c5){const _0x574fc0=a26_0x365278;if(_0x2a04c5[_0x574fc0(0xdd)]===0x1)return 0x0;for(const [_0xddff2f,_0x3ef493]of _0x2a04c5[_0x574fc0(0xf6)]()){process['stderr'][_0x574fc0(0xed)]('\x20\x20'+(_0xddff2f+0x1)+'.\x20'+_0x3ef493+'\x0a');}const _0x1e4cae=createInterface({'input':process[_0x574fc0(0xda)],'output':process[_0x574fc0(0xcc)]});while(!![]){const _0x6c035f=await new Promise(_0x56bdbf=>{const _0x28831d=_0x574fc0;_0x1e4cae[_0x28831d(0xb4)](_0x1d7389+'\x20',_0x56bdbf);}),_0xec4d93=Number['parseInt'](_0x6c035f[_0x574fc0(0xce)](),0xa);if(Number[_0x574fc0(0xb8)](_0xec4d93)&&_0xec4d93>=0x1&&_0xec4d93<=_0x2a04c5['length'])return _0x1e4cae[_0x574fc0(0xa0)](),_0xec4d93-0x1;process[_0x574fc0(0xcc)]['write'](_0x574fc0(0xa2)+_0x2a04c5[_0x574fc0(0xdd)]+'.\x0a');}}function buildFilePath(_0x394e95,_0x8e1c2b,_0x28a7e1,_0x5e160e){const _0x34c9a7=a26_0x365278;if(_0x8e1c2b===_0x34c9a7(0xd5)){if(!_0x5e160e)throw CliErrors['validation'](_0x34c9a7(0xf5));const _0x4b3f0f=_0x5e160e[_0x34c9a7(0xc4)]??_0x5e160e[_0x34c9a7(0xe1)];return join(_0x394e95[_0x34c9a7(0xd1)],'HOOK',_0x4b3f0f,_0x5e160e[_0x34c9a7(0xbc)],_0x5e160e[_0x34c9a7(0xa4)],_0x28a7e1+_0x34c9a7(0xe2));}return join(_0x394e95[_0x34c9a7(0xd1)],_0x8e1c2b,_0x28a7e1+_0x34c9a7(0xe2));}export function generateTemplate(_0x3d9880,_0x28e370,_0x1f3748,_0x482c8a,_0x37114a){const _0x26f7e6=a26_0x365278,_0x4a274e=_0x482c8a?.[_0x26f7e6(0xce)]()||_0x26f7e6(0xb9);if(_0x3d9880===_0x26f7e6(0xb1))return _0x26f7e6(0xee)+_0x4a274e+'\x0a\x20*\x20[脚本名称]\x20'+_0x28e370+_0x26f7e6(0xd4)+_0x28e370+_0x26f7e6(0xb5)+_0x28e370+_0x26f7e6(0xe3);if(_0x3d9880===_0x26f7e6(0xe7))return _0x26f7e6(0xdc)+_0x4a274e+_0x26f7e6(0xbd)+_0x1f3748+'/'+_0x28e370+_0x26f7e6(0xf0)+_0x28e370+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x37114a)throw CliErrors[_0x26f7e6(0xb2)](_0x26f7e6(0xac));return _0x26f7e6(0xc9)+_0x4a274e+_0x26f7e6(0xa6)+_0x1f3748+'/'+_0x37114a[_0x26f7e6(0xe1)]+'/'+_0x37114a[_0x26f7e6(0xbc)]+_0x26f7e6(0xd0)+_0x37114a['functionNode']+_0x26f7e6(0xde)+_0x28e370+_0x26f7e6(0xe3);}function a26_0x1e7e(_0x3d993d,_0x589939){_0x3d993d=_0x3d993d-0x9d;const _0x48f2fa=a26_0x48f2();let _0x1e7e3c=_0x48f2fa[_0x3d993d];return _0x1e7e3c;}function a26_0x48f2(){const _0x48df9a=['Dataset\x20not\x20found\x20for\x20code\x20\x22','bff','Alias\x20\x22','code','COMMON','validation','Select\x20trigger\x20node:','question','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x22.\x20','type','isInteger','TODO:\x20add\x20script\x20description','2702792czkjWU','673329TqIVQk','operationType','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','includes','appCode','13078653JuVsfN','map','No\x20datasets\x20found\x20for\x20this\x20app.','Select\x20operation\x20type:','alias','\x22\x20not\x20found\x20for\x20dataset\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','No\x20operation\x20types\x20found\x20for\x20dataset\x20','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Select\x20dataset:','Available:\x20','stderr','tableName','trim','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x0a\x20*\x20[触发节点]\x20','scriptsRootDir','apiDir','operation-type','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','HOOK','find','\x20api\x20pull`\x20to\x20refresh.','3171222kJUHcw','Invalid\x20dataset\x20selection.','stdin','Created\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','length','\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','name','function-node','datasetCode','.js','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','join','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x22\x20not\x20found.\x20','ENDPOINT','Available\x20aliases:\x20','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Operation\x20type\x20(HOOK\x20only)','4275360VkFjmJ','before','write','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','No\x20api.ts\x20found.\x20Run\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','109976SAgNiH','15qbDjmN','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','str','HOOK\x20requires\x20alias/operation/node\x20options.','entries','File\x20already\x20exists:\x20','Trigger\x20node\x20(HOOK\x20only)','description','close','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','\x20function:\x20','functionNode','create','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','1470456qVdEMg','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','string','Script\x20type','datasetcode','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.'];a26_0x48f2=function(){return _0x48df9a;};return a26_0x48f2();}
@@ -1 +1 @@
1
- const a69_0x1ba279=a69_0x20cc;(function(_0x407c2f,_0x5aeefa){const _0x3a1deb=a69_0x20cc,_0xb24cfb=_0x407c2f();while(!![]){try{const _0x2ae57e=-parseInt(_0x3a1deb(0x1f4))/0x1*(parseInt(_0x3a1deb(0x1d4))/0x2)+parseInt(_0x3a1deb(0x1f8))/0x3*(-parseInt(_0x3a1deb(0x1dd))/0x4)+parseInt(_0x3a1deb(0x1d6))/0x5+-parseInt(_0x3a1deb(0x1f1))/0x6+parseInt(_0x3a1deb(0x1d5))/0x7*(parseInt(_0x3a1deb(0x1f9))/0x8)+parseInt(_0x3a1deb(0x1ec))/0x9+-parseInt(_0x3a1deb(0x1db))/0xa*(-parseInt(_0x3a1deb(0x1d8))/0xb);if(_0x2ae57e===_0x5aeefa)break;else _0xb24cfb['push'](_0xb24cfb['shift']());}catch(_0xd01a0d){_0xb24cfb['push'](_0xb24cfb['shift']());}}}(a69_0x16e5,0xe4b7f));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':a69_0x1ba279(0x1ce),'command':a69_0x1ba279(0x1e7),'description':a69_0x1ba279(0x1ef),'risk':a69_0x1ba279(0x1fb),'flags':[{'name':'target','type':a69_0x1ba279(0x1e2),'required':!![],'description':a69_0x1ba279(0x1f7)}],async 'validate'(_0x13cd6e){const _0x2cfab3=a69_0x1ba279,_0x1ff319=loadBffProjectConfig(_0x13cd6e['appCode']),_0x41b748=await readBffLockFile(_0x1ff319[_0x2cfab3(0x1fa)]);if(!_0x41b748)throw CliErrors[_0x2cfab3(0x1f3)](_0x2cfab3(0x1e3));},async 'dryRun'(_0x129fca){const _0x397c5f=a69_0x1ba279,_0x3cc9b3=loadBffProjectConfig(_0x129fca[_0x397c5f(0x1da)]),_0x108133=await readBffLockFile(_0x3cc9b3[_0x397c5f(0x1fa)]);if(!_0x108133)throw CliErrors[_0x397c5f(0x1f3)](_0x397c5f(0x1e9));const {appLock:_0xc49e82}=ensureLockScope(_0x108133,_0x129fca[_0x397c5f(0x1da)],_0x3cc9b3[_0x397c5f(0x1cc)],_0x397c5f(0x1e7)),_0x3e893a=_0x129fca[_0x397c5f(0x1f6)](_0x397c5f(0x1d3)),_0x271786=Object[_0x397c5f(0x1ee)](_0xc49e82['functions']),_0x301e5e=resolveDeleteTarget(_0x3e893a,_0x271786),_0x9dff6d=_0xc49e82['functions'][_0x301e5e];if(!_0x9dff6d)throw CliErrors[_0x397c5f(0x1f3)](_0x397c5f(0x1e8)+_0x301e5e+'\x22.');const _0x23f68e=resolveLocalFilePathFromLockKey(_0x3cc9b3,_0x301e5e),_0x32f00c=relative(_0x3cc9b3[_0x397c5f(0x1e4)],_0x23f68e),_0x2e7911=join(_0x3cc9b3['trashDir'],_0x397c5f(0x1f2),_0x32f00c);return{'method':_0x397c5f(0x1d2),'url':_0x397c5f(0x1d0),'body':{'appCode':_0x129fca[_0x397c5f(0x1da)],'target':_0x301e5e,'remoteId':_0x9dff6d[_0x397c5f(0x1e5)],'localFilePath':_0x23f68e,'trashedPath':_0x2e7911},'description':_0x397c5f(0x1dc)+_0x301e5e+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x2096b5){const _0x982951=a69_0x1ba279,_0x4103ac=loadBffProjectConfig(_0x2096b5[_0x982951(0x1da)]),_0x2d6bed=await readBffLockFile(_0x4103ac[_0x982951(0x1fa)]);if(!_0x2d6bed)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x3b7faa,appLock:_0x78220a}=ensureLockScope(_0x2d6bed,_0x2096b5[_0x982951(0x1da)],_0x4103ac[_0x982951(0x1cc)],_0x982951(0x1e7)),_0x43f2e7=_0x2096b5[_0x982951(0x1f6)](_0x982951(0x1d3)),_0x37b644=Object[_0x982951(0x1ee)](_0x78220a[_0x982951(0x1e6)]),_0x4cc8e9=resolveDeleteTarget(_0x43f2e7,_0x37b644),_0x1d73b6=_0x78220a[_0x982951(0x1e6)][_0x4cc8e9];if(!_0x1d73b6)throw CliErrors[_0x982951(0x1f3)](_0x982951(0x1e8)+_0x4cc8e9+'\x22.');await deleteBffScript(_0x1d73b6[_0x982951(0x1e5)]),delete _0x78220a[_0x982951(0x1e6)][_0x4cc8e9],_0x78220a[_0x982951(0x1f0)]=new Date()[_0x982951(0x1ea)](),await writeBffLockFile(_0x4103ac['lockFilePath'],_0x3b7faa);const _0x3b0559=resolveLocalFilePathFromLockKey(_0x4103ac,_0x4cc8e9);let _0x4618b3;await fileExists(_0x3b0559)&&(_0x4618b3=await moveToTrash(_0x4103ac[_0x982951(0x1e4)],_0x4103ac['trashDir'],_0x3b0559),await cleanupEmptyDirectories(dirname(_0x3b0559),_0x4103ac['scriptsRootDir']));const _0x3947d1={'deleted':_0x4cc8e9,'remoteId':_0x1d73b6[_0x982951(0x1e5)]};if(_0x4618b3)_0x3947d1[_0x982951(0x1d1)]=_0x4618b3;return{'ok':!![],'data':_0x3947d1,'message':_0x982951(0x1eb)+_0x4cc8e9+(_0x4618b3?_0x982951(0x1ed):'')};}};function resolveDeleteTarget(_0x108268,_0x391459){const _0x579fde=a69_0x1ba279;if(_0x108268['includes']('/')){const _0x17a408=_0x391459['find'](_0x2faff9=>_0x2faff9===_0x108268);if(!_0x17a408)throw CliErrors['validation'](_0x579fde(0x1cf)+_0x108268);return _0x17a408;}const _0x2723ae=_0x391459[_0x579fde(0x1e1)](_0xda46b2=>_0xda46b2[_0x579fde(0x1de)]('/')['at'](-0x1)===_0x108268);if(_0x2723ae[_0x579fde(0x1d9)]===0x0)throw CliErrors['validation'](_0x579fde(0x1cf)+_0x108268);if(_0x2723ae[_0x579fde(0x1d9)]>0x1)throw CliErrors[_0x579fde(0x1f3)](_0x579fde(0x1e0)+_0x108268+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x2723ae[_0x579fde(0x1f5)](_0xf52072=>_0x579fde(0x1df)+_0xf52072)[_0x579fde(0x1cd)]('\x0a'));return _0x2723ae[0x0];}function a69_0x16e5(){const _0x6270bb=['1732DfJHkm','split','\x20\x20-\x20','Multiple\x20functions\x20match\x20\x22','filter','string','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','projectRoot','remoteId','functions','delete','No\x20lock\x20entry\x20found\x20for\x20\x22','BFF\x20lock\x20file\x20not\x20found.','toISOString','Deleted\x20','8376336CYNlYy','\x20(local\x20file\x20moved\x20to\x20trash)','keys','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','lastSync','5645526iYcEkV','<timestamp>','validation','404765myDPLT','map','str','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','4788mgYsWf','483688EDjzRu','lockFilePath','high-risk-write','scriptsRoot','join','bff','Function\x20not\x20found:\x20','/api/management/library/scripts/delete','trashedTo','POST','target','2IUwzRH','7GWNQcn','1507055voFrjE','replace','18491099DQdYMr','length','appCode','10VtYckS','Would\x20delete\x20'];a69_0x16e5=function(){return _0x6270bb;};return a69_0x16e5();}async function moveToTrash(_0x2b57c4,_0x452ab9,_0x512a2d){const _0x18dfb6=a69_0x1ba279,_0x1281a6=new Date()[_0x18dfb6(0x1ea)]()[_0x18dfb6(0x1d7)](/[:.]/g,'-'),_0x555743=relative(_0x2b57c4,_0x512a2d),_0x19ddda=join(_0x452ab9,_0x1281a6,_0x555743);return await mkdir(dirname(_0x19ddda),{'recursive':!![]}),await rename(_0x512a2d,_0x19ddda),_0x19ddda;}function a69_0x20cc(_0x165b88,_0xa99584){_0x165b88=_0x165b88-0x1cc;const _0x16e5b4=a69_0x16e5();let _0x20cc1e=_0x16e5b4[_0x165b88];return _0x20cc1e;}async function cleanupEmptyDirectories(_0x5f4d57,_0x2bb0b4){const _0x51b574=a69_0x1ba279;let _0x1973c7=resolve(_0x5f4d57);const _0x1afa1c=resolve(_0x2bb0b4);while(_0x1973c7['startsWith'](''+_0x1afa1c+sep)||_0x1973c7===_0x1afa1c){if(_0x1973c7===_0x1afa1c)return;try{const _0x82a4da=await readdir(_0x1973c7);if(_0x82a4da[_0x51b574(0x1d9)]>0x0)return;await rmdir(_0x1973c7);}catch{return;}_0x1973c7=dirname(_0x1973c7);}}
1
+ const a27_0x474e2f=a27_0x1e12;(function(_0x264817,_0x5d19f2){const _0x581838=a27_0x1e12,_0x3f4cd8=_0x264817();while(!![]){try{const _0x1d587c=-parseInt(_0x581838(0x119))/0x1*(-parseInt(_0x581838(0x124))/0x2)+-parseInt(_0x581838(0x112))/0x3+-parseInt(_0x581838(0x12c))/0x4*(-parseInt(_0x581838(0x10d))/0x5)+parseInt(_0x581838(0x12b))/0x6+parseInt(_0x581838(0x10b))/0x7*(-parseInt(_0x581838(0x12f))/0x8)+-parseInt(_0x581838(0x123))/0x9*(parseInt(_0x581838(0x12e))/0xa)+parseInt(_0x581838(0x135))/0xb;if(_0x1d587c===_0x5d19f2)break;else _0x3f4cd8['push'](_0x3f4cd8['shift']());}catch(_0x18545e){_0x3f4cd8['push'](_0x3f4cd8['shift']());}}}(a27_0x1e9e,0x76631));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a27_0x1e12(_0x4398c5,_0x34de6c){_0x4398c5=_0x4398c5-0x107;const _0x1e9e96=a27_0x1e9e();let _0x1e12c7=_0x1e9e96[_0x4398c5];return _0x1e12c7;}import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a27_0x1e9e(){const _0x5ab070=['includes','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','101958XiMdit','toISOString','projectRoot','find','scriptsRoot','join','string','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','length','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','47871Wvjuwo','14FLnQfn','trashDir','delete','POST','target','<timestamp>','BFF\x20lock\x20file\x20not\x20found.','5716632ThypvD','8aajUuj','bff','1390jlmKVo','48JQTCaz','startsWith','appCode','/api/management/library/scripts/delete','scriptsRootDir','lockFilePath','1022098FHXmrz','functions','validation','str','Function\x20not\x20found:\x20','460229gvQvjk','\x20(local\x20file\x20moved\x20to\x20trash)','2036035PsqUYx','lastSync','filter','remoteId','split','2865222qAISVs','map','No\x20lock\x20entry\x20found\x20for\x20\x22','\x20\x20-\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'];a27_0x1e9e=function(){return _0x5ab070;};return a27_0x1e9e();}import{CliErrors}from'../../errors.js';export const bffDelete={'service':a27_0x474e2f(0x12d),'command':'delete','description':a27_0x474e2f(0x118),'risk':'high-risk-write','flags':[{'name':a27_0x474e2f(0x128),'type':a27_0x474e2f(0x11f),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x50af0b){const _0x58e3b7=a27_0x474e2f,_0x23eb9c=loadBffProjectConfig(_0x50af0b[_0x58e3b7(0x131)]),_0x205765=await readBffLockFile(_0x23eb9c[_0x58e3b7(0x134)]);if(!_0x205765)throw CliErrors[_0x58e3b7(0x108)](_0x58e3b7(0x120));},async 'dryRun'(_0x4cdd0a){const _0x49dc2f=a27_0x474e2f,_0x131493=loadBffProjectConfig(_0x4cdd0a[_0x49dc2f(0x131)]),_0x55c612=await readBffLockFile(_0x131493['lockFilePath']);if(!_0x55c612)throw CliErrors[_0x49dc2f(0x108)](_0x49dc2f(0x12a));const {appLock:_0x3087da}=ensureLockScope(_0x55c612,_0x4cdd0a[_0x49dc2f(0x131)],_0x131493['scriptsRoot'],_0x49dc2f(0x126)),_0x1dd51e=_0x4cdd0a[_0x49dc2f(0x109)](_0x49dc2f(0x128)),_0x23ee18=Object['keys'](_0x3087da['functions']),_0x55c0c9=resolveDeleteTarget(_0x1dd51e,_0x23ee18),_0x443b6e=_0x3087da[_0x49dc2f(0x107)][_0x55c0c9];if(!_0x443b6e)throw CliErrors[_0x49dc2f(0x108)](_0x49dc2f(0x114)+_0x55c0c9+'\x22.');const _0x332e1d=resolveLocalFilePathFromLockKey(_0x131493,_0x55c0c9),_0x4427eb=relative(_0x131493[_0x49dc2f(0x11b)],_0x332e1d),_0x553091=join(_0x131493[_0x49dc2f(0x125)],_0x49dc2f(0x129),_0x4427eb);return{'method':_0x49dc2f(0x127),'url':_0x49dc2f(0x132),'body':{'appCode':_0x4cdd0a[_0x49dc2f(0x131)],'target':_0x55c0c9,'remoteId':_0x443b6e[_0x49dc2f(0x110)],'localFilePath':_0x332e1d,'trashedPath':_0x553091},'description':'Would\x20delete\x20'+_0x55c0c9+_0x49dc2f(0x116)};},async 'execute'(_0x3b3862){const _0x449c16=a27_0x474e2f,_0x5ded36=loadBffProjectConfig(_0x3b3862[_0x449c16(0x131)]),_0x34b3c2=await readBffLockFile(_0x5ded36[_0x449c16(0x134)]);if(!_0x34b3c2)throw CliErrors[_0x449c16(0x108)](_0x449c16(0x12a));const {lockData:_0x1bfd66,appLock:_0x129881}=ensureLockScope(_0x34b3c2,_0x3b3862[_0x449c16(0x131)],_0x5ded36[_0x449c16(0x11d)],_0x449c16(0x126)),_0x1d97d8=_0x3b3862['str']('target'),_0x43487c=Object['keys'](_0x129881[_0x449c16(0x107)]),_0x376569=resolveDeleteTarget(_0x1d97d8,_0x43487c),_0x1520e8=_0x129881['functions'][_0x376569];if(!_0x1520e8)throw CliErrors[_0x449c16(0x108)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x376569+'\x22.');await deleteBffScript(_0x1520e8[_0x449c16(0x110)]),delete _0x129881[_0x449c16(0x107)][_0x376569],_0x129881[_0x449c16(0x10e)]=new Date()[_0x449c16(0x11a)](),await writeBffLockFile(_0x5ded36[_0x449c16(0x134)],_0x1bfd66);const _0x84bbae=resolveLocalFilePathFromLockKey(_0x5ded36,_0x376569);let _0xae282f;await fileExists(_0x84bbae)&&(_0xae282f=await moveToTrash(_0x5ded36[_0x449c16(0x11b)],_0x5ded36[_0x449c16(0x125)],_0x84bbae),await cleanupEmptyDirectories(dirname(_0x84bbae),_0x5ded36[_0x449c16(0x133)]));const _0x438b1f={'deleted':_0x376569,'remoteId':_0x1520e8[_0x449c16(0x110)]};if(_0xae282f)_0x438b1f['trashedTo']=_0xae282f;return{'ok':!![],'data':_0x438b1f,'message':'Deleted\x20'+_0x376569+(_0xae282f?_0x449c16(0x10c):'')};}};function resolveDeleteTarget(_0x217e4a,_0x5f0e19){const _0x2044e7=a27_0x474e2f;if(_0x217e4a[_0x2044e7(0x117)]('/')){const _0x53a872=_0x5f0e19[_0x2044e7(0x11c)](_0x45945b=>_0x45945b===_0x217e4a);if(!_0x53a872)throw CliErrors[_0x2044e7(0x108)]('Function\x20not\x20found:\x20'+_0x217e4a);return _0x53a872;}const _0x33b140=_0x5f0e19[_0x2044e7(0x10f)](_0x1afc14=>_0x1afc14[_0x2044e7(0x111)]('/')['at'](-0x1)===_0x217e4a);if(_0x33b140[_0x2044e7(0x121)]===0x0)throw CliErrors[_0x2044e7(0x108)](_0x2044e7(0x10a)+_0x217e4a);if(_0x33b140[_0x2044e7(0x121)]>0x1)throw CliErrors[_0x2044e7(0x108)]('Multiple\x20functions\x20match\x20\x22'+_0x217e4a+_0x2044e7(0x122)+_0x33b140[_0x2044e7(0x113)](_0x4b4184=>_0x2044e7(0x115)+_0x4b4184)[_0x2044e7(0x11e)]('\x0a'));return _0x33b140[0x0];}async function moveToTrash(_0x2d764b,_0x143c3c,_0x4304cf){const _0x5625b5=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x2154e2=relative(_0x2d764b,_0x4304cf),_0x4c0d08=join(_0x143c3c,_0x5625b5,_0x2154e2);return await mkdir(dirname(_0x4c0d08),{'recursive':!![]}),await rename(_0x4304cf,_0x4c0d08),_0x4c0d08;}async function cleanupEmptyDirectories(_0x1c437b,_0x14e6d0){const _0x56ab23=a27_0x474e2f;let _0xb5a98b=resolve(_0x1c437b);const _0x209077=resolve(_0x14e6d0);while(_0xb5a98b[_0x56ab23(0x130)](''+_0x209077+sep)||_0xb5a98b===_0x209077){if(_0xb5a98b===_0x209077)return;try{const _0x3206d3=await readdir(_0xb5a98b);if(_0x3206d3[_0x56ab23(0x121)]>0x0)return;await rmdir(_0xb5a98b);}catch{return;}_0xb5a98b=dirname(_0xb5a98b);}}
@@ -1 +1 @@
1
- function a74_0x29b9(_0x5553ce,_0x250d7a){_0x5553ce=_0x5553ce-0x1e0;const _0x53af38=a74_0x53af();let _0x29b934=_0x53af38[_0x5553ce];return _0x29b934;}const a74_0x3309ce=a74_0x29b9;function a74_0x53af(){const _0x5a9f08=['1642384EPousd','description','number','121330npiEwg','17wmRBum','verbose','1713980pifGuh','78EtVnYK','num','(none)','1266156EUNLoT','bff','16466670vaoKYp','Get\x20BFF\x20script\x20details\x20by\x20ID','boolean','appCode','createdTime','updatedTime','9sCaixo','read','3754ixMING','897918nSEIMP','scriptContent','8PwowZb'];a74_0x53af=function(){return _0x5a9f08;};return a74_0x53af();}(function(_0x435ba0,_0x5a2fdc){const _0x35b0a3=a74_0x29b9,_0x2d9be4=_0x435ba0();while(!![]){try{const _0x332a51=parseInt(_0x35b0a3(0x1f5))/0x1*(-parseInt(_0x35b0a3(0x1ed))/0x2)+-parseInt(_0x35b0a3(0x1e3))/0x3+-parseInt(_0x35b0a3(0x1f1))/0x4+parseInt(_0x35b0a3(0x1f4))/0x5*(-parseInt(_0x35b0a3(0x1e0))/0x6)+-parseInt(_0x35b0a3(0x1ee))/0x7*(-parseInt(_0x35b0a3(0x1f0))/0x8)+-parseInt(_0x35b0a3(0x1eb))/0x9*(parseInt(_0x35b0a3(0x1f7))/0xa)+parseInt(_0x35b0a3(0x1e5))/0xb;if(_0x332a51===_0x5a2fdc)break;else _0x2d9be4['push'](_0x2d9be4['shift']());}catch(_0x7ba83b){_0x2d9be4['push'](_0x2d9be4['shift']());}}}(a74_0x53af,0x42da7));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a74_0x3309ce(0x1e4),'command':'detail','description':a74_0x3309ce(0x1e6),'risk':a74_0x3309ce(0x1ec),'flags':[{'name':'id','type':a74_0x3309ce(0x1f3),'required':!![],'description':'Script\x20ID'},{'name':a74_0x3309ce(0x1f6),'type':a74_0x3309ce(0x1e7),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x5c2c6a){const _0xb80899=a74_0x3309ce,_0x442097=await getBffScriptInfo(_0x5c2c6a[_0xb80899(0x1e1)]('id')),_0x4abb12=_0x5c2c6a['bool'](_0xb80899(0x1f6));if(_0x4abb12)return{'ok':!![],'data':_0x442097};return{'ok':!![],'data':{'id':_0x442097['id'],'appCode':_0x442097[_0xb80899(0x1e8)],'scriptType':_0x442097['scriptType'],'description':_0x442097[_0xb80899(0x1f2)]||_0xb80899(0x1e2),'createdTime':_0x442097[_0xb80899(0x1e9)]??'','updatedTime':_0x442097[_0xb80899(0x1ea)]??'','scriptContent':_0x442097[_0xb80899(0x1ef)]??''}};}};
1
+ function a28_0x5c71(){const _0xe0c4fa=['detail','bff','1565315ixZmKx','scriptType','1737432gRVxAk','652SLsZSR','Return\x20full\x20raw\x20script\x20object','read','Script\x20ID','1339653PalAbI','48rFZWka','bool','979834cYwzGN','boolean','1439458MUzrgi','9170810ZsVJsn','updatedTime','1707pylOsn','verbose','18KZLUWz','num','scriptContent','(none)'];a28_0x5c71=function(){return _0xe0c4fa;};return a28_0x5c71();}function a28_0x6ecc(_0x409945,_0x1cc842){_0x409945=_0x409945-0x9b;const _0x5c7139=a28_0x5c71();let _0x6ecc62=_0x5c7139[_0x409945];return _0x6ecc62;}const a28_0xaa1e0d=a28_0x6ecc;(function(_0x4c811a,_0x43dc72){const _0x226658=a28_0x6ecc,_0x2d171e=_0x4c811a();while(!![]){try{const _0x825d36=-parseInt(_0x226658(0xac))/0x1+parseInt(_0x226658(0xae))/0x2+parseInt(_0x226658(0xb1))/0x3*(-parseInt(_0x226658(0xa5))/0x4)+parseInt(_0x226658(0xa2))/0x5*(parseInt(_0x226658(0x9c))/0x6)+parseInt(_0x226658(0xa9))/0x7*(parseInt(_0x226658(0xaa))/0x8)+-parseInt(_0x226658(0xa4))/0x9+-parseInt(_0x226658(0xaf))/0xa;if(_0x825d36===_0x43dc72)break;else _0x2d171e['push'](_0x2d171e['shift']());}catch(_0x3890c2){_0x2d171e['push'](_0x2d171e['shift']());}}}(a28_0x5c71,0x98762));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a28_0xaa1e0d(0xa1),'command':a28_0xaa1e0d(0xa0),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a28_0xaa1e0d(0xa7),'flags':[{'name':'id','type':'number','required':!![],'description':a28_0xaa1e0d(0xa8)},{'name':a28_0xaa1e0d(0x9b),'type':a28_0xaa1e0d(0xad),'description':a28_0xaa1e0d(0xa6)}],async 'execute'(_0x48b695){const _0x13016a=a28_0xaa1e0d,_0x3fecb2=await getBffScriptInfo(_0x48b695[_0x13016a(0x9d)]('id')),_0x1fc7e7=_0x48b695[_0x13016a(0xab)](_0x13016a(0x9b));if(_0x1fc7e7)return{'ok':!![],'data':_0x3fecb2};return{'ok':!![],'data':{'id':_0x3fecb2['id'],'appCode':_0x3fecb2['appCode'],'scriptType':_0x3fecb2[_0x13016a(0xa3)],'description':_0x3fecb2['description']||_0x13016a(0x9f),'createdTime':_0x3fecb2['createdTime']??'','updatedTime':_0x3fecb2[_0x13016a(0xb0)]??'','scriptContent':_0x3fecb2[_0x13016a(0x9e)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x1eb697,_0x56d8e6){const _0x5e7bc4=a73_0x193c,_0x16dd5d=_0x1eb697();while(!![]){try{const _0x381e5b=-parseInt(_0x5e7bc4(0xc9))/0x1*(parseInt(_0x5e7bc4(0xbf))/0x2)+parseInt(_0x5e7bc4(0xc1))/0x3+parseInt(_0x5e7bc4(0xc7))/0x4*(parseInt(_0x5e7bc4(0xc8))/0x5)+-parseInt(_0x5e7bc4(0xc2))/0x6*(parseInt(_0x5e7bc4(0xcb))/0x7)+parseInt(_0x5e7bc4(0xc5))/0x8*(-parseInt(_0x5e7bc4(0xc0))/0x9)+parseInt(_0x5e7bc4(0xca))/0xa*(-parseInt(_0x5e7bc4(0xc6))/0xb)+parseInt(_0x5e7bc4(0xc3))/0xc*(parseInt(_0x5e7bc4(0xc4))/0xd);if(_0x381e5b===_0x56d8e6)break;else _0x16dd5d['push'](_0x16dd5d['shift']());}catch(_0x33f227){_0x16dd5d['push'](_0x16dd5d['shift']());}}}(a73_0x1540,0xc7f22));function a73_0x1540(){const _0xc4bd64=['715Rmlsog','83856wSkfKk','25388nyDgTp','323344ljoOqn','85XbWilo','307701FfIgkt','6830FXVTNh','1041229HyuhCe','6LWlcoS','243UwJvPY','4067547pYAOrT','66JZFXOJ','547116jxVsVc'];a73_0x1540=function(){return _0xc4bd64;};return a73_0x1540();}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';function a73_0x193c(_0x4045de,_0x553800){_0x4045de=_0x4045de-0xbf;const _0x154045=a73_0x1540();let _0x193c75=_0x154045[_0x4045de];return _0x193c75;}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
1
+ (function(_0x4e7af6,_0x2ccb61){const _0x2087b4=a29_0x413c,_0x1df9b5=_0x4e7af6();while(!![]){try{const _0x51c1ef=parseInt(_0x2087b4(0x163))/0x1*(parseInt(_0x2087b4(0x164))/0x2)+parseInt(_0x2087b4(0x165))/0x3+parseInt(_0x2087b4(0x15c))/0x4+-parseInt(_0x2087b4(0x15f))/0x5+-parseInt(_0x2087b4(0x15d))/0x6+parseInt(_0x2087b4(0x161))/0x7*(-parseInt(_0x2087b4(0x162))/0x8)+parseInt(_0x2087b4(0x15e))/0x9*(-parseInt(_0x2087b4(0x160))/0xa);if(_0x51c1ef===_0x2ccb61)break;else _0x1df9b5['push'](_0x1df9b5['shift']());}catch(_0x288107){_0x1df9b5['push'](_0x1df9b5['shift']());}}}(a29_0x3d8e,0x9cefd));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a29_0x413c(_0x5a6056,_0xa093a3){_0x5a6056=_0x5a6056-0x15c;const _0x3d8e32=a29_0x3d8e();let _0x413c5c=_0x3d8e32[_0x5a6056];return _0x413c5c;}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a29_0x3d8e(){const _0x445004=['517554VUfKju','5700810aDzxXr','10kdLMSl','602917vDlUwk','32erCJPB','2UdEClE','671290MCGxqX','2343456sCEuwS','4306244nBKdSK','2063988qtecsq'];a29_0x3d8e=function(){return _0x445004;};return a29_0x3d8e();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- function a72_0x2aed(){const _0x2b36fd=['90xzuEsh','description','(unnamed)','14426KXcKAi','bool','length','31JNyACx','functionName','398670SbJrEU','Filter\x20by\x20script\x20name','map','name','scriptType','list','type','Return\x20full\x20script\x20objects','5533416dmVHnL','15tFUKKM','boolean','No\x20BFF\x20scripts\x20found.','13669720rhrTSu','3985744zcOlDq','appCode','str','bff','verbose','522704eBHjOl','ENDPOINT','80596YABWMY','List\x20BFF\x20scripts','11UhxdYB'];a72_0x2aed=function(){return _0x2b36fd;};return a72_0x2aed();}const a72_0x4b6613=a72_0x2b47;(function(_0xad29b0,_0x22c466){const _0x46431f=a72_0x2b47,_0x12a883=_0xad29b0();while(!![]){try{const _0x6257fa=parseInt(_0x46431f(0x15d))/0x1*(-parseInt(_0x46431f(0x179))/0x2)+parseInt(_0x46431f(0x176))/0x3*(parseInt(_0x46431f(0x173))/0x4)+-parseInt(_0x46431f(0x168))/0x5*(parseInt(_0x46431f(0x15f))/0x6)+-parseInt(_0x46431f(0x171))/0x7+-parseInt(_0x46431f(0x16c))/0x8+-parseInt(_0x46431f(0x167))/0x9+parseInt(_0x46431f(0x16b))/0xa*(parseInt(_0x46431f(0x175))/0xb);if(_0x6257fa===_0x22c466)break;else _0x12a883['push'](_0x12a883['shift']());}catch(_0x4df0d8){_0x12a883['push'](_0x12a883['shift']());}}}(a72_0x2aed,0x58156));import{listBffScripts}from'../../core/api-client.js';function a72_0x2b47(_0x2f72a0,_0x1e7241){_0x2f72a0=_0x2f72a0-0x15d;const _0x2aedc2=a72_0x2aed();let _0x2b47d5=_0x2aedc2[_0x2f72a0];return _0x2b47d5;}export const bffList={'service':a72_0x4b6613(0x16f),'command':a72_0x4b6613(0x164),'description':a72_0x4b6613(0x174),'risk':'read','flags':[{'name':'type','type':'string','description':'Script\x20type\x20filter','default':a72_0x4b6613(0x172),'enum':['ENDPOINT','COMMON']},{'name':a72_0x4b6613(0x162),'type':'string','description':a72_0x4b6613(0x160)},{'name':a72_0x4b6613(0x170),'type':a72_0x4b6613(0x169),'description':a72_0x4b6613(0x166)}],async 'execute'(_0x2ba56d){const _0x281f6a=a72_0x4b6613,_0x2222de=await listBffScripts(_0x2ba56d[_0x281f6a(0x16d)],_0x2ba56d[_0x281f6a(0x16e)](_0x281f6a(0x165)),{'scriptName':_0x2ba56d[_0x281f6a(0x16e)](_0x281f6a(0x162))||undefined}),_0x1b72a4=_0x2ba56d[_0x281f6a(0x17a)](_0x281f6a(0x170));return{'ok':!![],'data':_0x1b72a4?_0x2222de:_0x2222de[_0x281f6a(0x161)](_0x29f801=>({'id':_0x29f801['id'],'functionName':_0x29f801[_0x281f6a(0x15e)]??'','description':_0x29f801[_0x281f6a(0x177)]||_0x281f6a(0x178),'scriptType':_0x29f801[_0x281f6a(0x163)]})),'message':_0x2222de[_0x281f6a(0x17b)]===0x0?_0x281f6a(0x16a):undefined};}};
1
+ const a30_0x25a4a6=a30_0x1f4b;function a30_0x29ea(){const _0x287cb2=['length','functionName','(unnamed)','6569125GbrGCJ','56MkIIHL','Filter\x20by\x20script\x20name','238782wOjRZb','bff','155370YiUluX','list','appCode','map','name','Return\x20full\x20script\x20objects','ENDPOINT','3423296Ijbqjq','421000wGQJLp','No\x20BFF\x20scripts\x20found.','string','List\x20BFF\x20scripts','type','15003230fItGvc','COMMON','read','bool','81JMECLm','164571xjmScv','description','str','verbose','126tgnYUj'];a30_0x29ea=function(){return _0x287cb2;};return a30_0x29ea();}(function(_0x54f2cc,_0x5c506a){const _0x43a69c=a30_0x1f4b,_0x2b139d=_0x54f2cc();while(!![]){try{const _0x2240c8=parseInt(_0x43a69c(0x166))/0x1+-parseInt(_0x43a69c(0x16f))/0x2*(-parseInt(_0x43a69c(0x154))/0x3)+-parseInt(_0x43a69c(0x15b))/0x4+parseInt(_0x43a69c(0x16e))/0x5+parseInt(_0x43a69c(0x171))/0x6*(parseInt(_0x43a69c(0x16a))/0x7)+-parseInt(_0x43a69c(0x15c))/0x8*(parseInt(_0x43a69c(0x165))/0x9)+-parseInt(_0x43a69c(0x161))/0xa;if(_0x2240c8===_0x5c506a)break;else _0x2b139d['push'](_0x2b139d['shift']());}catch(_0x32ccc9){_0x2b139d['push'](_0x2b139d['shift']());}}}(a30_0x29ea,0xc6ff2));import{listBffScripts}from'../../core/api-client.js';function a30_0x1f4b(_0x1c95ff,_0x5d36e8){_0x1c95ff=_0x1c95ff-0x154;const _0x29ea69=a30_0x29ea();let _0x1f4b58=_0x29ea69[_0x1c95ff];return _0x1f4b58;}export const bffList={'service':a30_0x25a4a6(0x172),'command':a30_0x25a4a6(0x155),'description':a30_0x25a4a6(0x15f),'risk':a30_0x25a4a6(0x163),'flags':[{'name':a30_0x25a4a6(0x160),'type':a30_0x25a4a6(0x15e),'description':'Script\x20type\x20filter','default':a30_0x25a4a6(0x15a),'enum':['ENDPOINT',a30_0x25a4a6(0x162)]},{'name':a30_0x25a4a6(0x158),'type':a30_0x25a4a6(0x15e),'description':a30_0x25a4a6(0x170)},{'name':a30_0x25a4a6(0x169),'type':'boolean','description':a30_0x25a4a6(0x159)}],async 'execute'(_0x4ce0d8){const _0x4662c6=a30_0x25a4a6,_0x146b24=await listBffScripts(_0x4ce0d8[_0x4662c6(0x156)],_0x4ce0d8[_0x4662c6(0x168)]('type'),{'scriptName':_0x4ce0d8[_0x4662c6(0x168)](_0x4662c6(0x158))||undefined}),_0xc5ae31=_0x4ce0d8[_0x4662c6(0x164)](_0x4662c6(0x169));return{'ok':!![],'data':_0xc5ae31?_0x146b24:_0x146b24[_0x4662c6(0x157)](_0x2c2fc2=>({'id':_0x2c2fc2['id'],'functionName':_0x2c2fc2[_0x4662c6(0x16c)]??'','description':_0x2c2fc2[_0x4662c6(0x167)]||_0x4662c6(0x16d),'scriptType':_0x2c2fc2['scriptType']})),'message':_0x146b24[_0x4662c6(0x16b)]===0x0?_0x4662c6(0x15d):undefined};}};
@@ -1 +1 @@
1
- function a70_0x3c03(_0x2d1890,_0x2de44b){_0x2d1890=_0x2d1890-0x66;const _0x1963ad=a70_0x1963();let _0x3c0387=_0x1963ad[_0x2d1890];return _0x3c0387;}const a70_0x21f4f8=a70_0x3c03;(function(_0x2b4fb2,_0x4d3bfe){const _0x5619e5=a70_0x3c03,_0x594040=_0x2b4fb2();while(!![]){try{const _0x11cc14=parseInt(_0x5619e5(0x9b))/0x1*(-parseInt(_0x5619e5(0x93))/0x2)+parseInt(_0x5619e5(0xa0))/0x3+-parseInt(_0x5619e5(0x77))/0x4*(parseInt(_0x5619e5(0x7a))/0x5)+-parseInt(_0x5619e5(0x87))/0x6*(parseInt(_0x5619e5(0xa8))/0x7)+-parseInt(_0x5619e5(0x85))/0x8*(-parseInt(_0x5619e5(0x79))/0x9)+parseInt(_0x5619e5(0xa5))/0xa*(-parseInt(_0x5619e5(0xae))/0xb)+parseInt(_0x5619e5(0xa7))/0xc;if(_0x11cc14===_0x4d3bfe)break;else _0x594040['push'](_0x594040['shift']());}catch(_0x26c353){_0x594040['push'](_0x594040['shift']());}}}(a70_0x1963,0x4eee4));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';function a70_0x1963(){const _0x19cfae=['8jdsJbI','&type=','local\x20unsynced\x20changes','filePath','toISOString','version','validation','alias','153077ucSCiP','nonInteractive','force','HOOK','message','724377PrMhLI','operationType','\x22\x20not\x20found\x20after\x20ensureLockScope.','str','stderr','10sNnHBJ','length','19682496uulcDZ','11928stBwiW','hookLocation','conflict','toLowerCase','scriptType','close','6892589LkttQL','Remote\x20script\x20missing\x20id.','\x20skipped,\x20','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','Lock\x20scope\x20for\x20app\x20\x22','stringify','\x20failed','push','functionNode','write','datasetCode','ENDPOINT','includes','all','unresolvable\x20target\x20path','\x20pulled,\x20','GET','functions','functionName','would_pull','1084788MCSLbD','yes','207423rNFCau','5DbQEpl','bff','Pull\x20only\x20this\x20script\x20type','Would\x20inspect\x20','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','pull','type','No\x20remote\x20BFF\x20scripts\x20found.','string','map','lockFilePath','56BurLUJ','apiDir','738dXWATu','Pull\x20complete:\x20','scriptContent','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','scriptsRoot','lockKey','\x20remote\x20BFF\x20script(s)\x20for\x20pull','cancelled','appCode','Force\x20overwrite\x20local\x20unsynced\x20changes','bool','boolean'];a70_0x1963=function(){return _0x19cfae;};return a70_0x1963();}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':a70_0x21f4f8(0x7b),'command':'pull','description':a70_0x21f4f8(0x8a),'risk':a70_0x21f4f8(0x6c),'flags':[{'name':a70_0x21f4f8(0x80),'type':a70_0x21f4f8(0x82),'description':a70_0x21f4f8(0x7c),'enum':['COMMON',a70_0x21f4f8(0x6e),'HOOK']},{'name':'force','type':a70_0x21f4f8(0x92),'description':a70_0x21f4f8(0x90)}],async 'dryRun'(_0x2fd42f){const _0x151720=a70_0x21f4f8,_0x3b7cef=loadBffProjectConfig(_0x2fd42f[_0x151720(0x8f)]),_0x3edfda=await readBffLockFile(_0x3b7cef['lockFilePath']),{appLock:_0x1b7378}=ensureLockScope(_0x3edfda??createEmptyBffLock(),_0x2fd42f[_0x151720(0x8f)],_0x3b7cef[_0x151720(0x8b)],_0x151720(0x7f)),_0x4cf5de=normalizeBffType(_0x2fd42f[_0x151720(0xa3)]('type'))??undefined,_0x6ef943=buildDatasetCodeToAliasMap(_0x2fd42f[_0x151720(0x86)],_0x2fd42f[_0x151720(0x8f)]),[_0x93e8b1,_0x1c830f]=await Promise['all']([listBffScripts(_0x2fd42f[_0x151720(0x8f)],_0x4cf5de),getBffScriptStatistics(_0x2fd42f[_0x151720(0x8f)])]),_0x376bd6=createHookLocationMap(_0x1c830f),_0x51e743=[];for(const _0x26b36c of _0x93e8b1){const _0x18b160=resolveRemoteScriptTarget(_0x3b7cef,_0x26b36c,_0x376bd6,_0x1b7378[_0x151720(0x74)],_0x6ef943);if(!_0x18b160){_0x51e743['push']({'scriptType':_0x26b36c[_0x151720(0xac)],'functionName':_0x26b36c[_0x151720(0x75)]??'','status':'skipped','reason':_0x151720(0x71)});continue;}const _0x49c96f=_0x1b7378[_0x151720(0x74)][_0x18b160[_0x151720(0x8c)]],_0x53e90f=_0x26b36c[_0x151720(0x89)]!=null?computeContentHash(_0x26b36c[_0x151720(0x89)]):undefined,_0x52429c=await hasUnsyncedLocalChanges(_0x18b160['filePath'],_0x49c96f,_0x53e90f);_0x51e743[_0x151720(0x6a)]({'lockKey':_0x18b160[_0x151720(0x8c)],'filePath':_0x18b160[_0x151720(0x96)],'remoteId':_0x26b36c['id']??null,'status':_0x52429c?_0x151720(0xaa):_0x151720(0x76)});}return{'method':_0x151720(0x73),'url':'/api/management/library/scripts/list?appCode='+_0x2fd42f[_0x151720(0x8f)]+(_0x4cf5de?_0x151720(0x94)+_0x4cf5de:''),'body':{'appCode':_0x2fd42f['appCode'],'filterType':_0x4cf5de??null,'files':_0x51e743},'description':_0x151720(0x7d)+_0x51e743[_0x151720(0xa6)]+_0x151720(0x8d)};},async 'execute'(_0x59c532){const _0x1f31fd=a70_0x21f4f8,_0xc286f9=loadBffProjectConfig(_0x59c532[_0x1f31fd(0x8f)]),_0x27db98=await readBffLockFile(_0xc286f9[_0x1f31fd(0x84)]),{lockData:_0x3825ad,appLock:_0x5aefb6}=ensureLockScope(_0x27db98??createEmptyBffLock(),_0x59c532[_0x1f31fd(0x8f)],_0xc286f9[_0x1f31fd(0x8b)],'pull'),_0xe30619=normalizeBffType(_0x59c532[_0x1f31fd(0xa3)]('type'))??undefined;if(_0x59c532[_0x1f31fd(0xa3)]('type')&&!_0xe30619)throw CliErrors[_0x1f31fd(0x99)](_0x1f31fd(0x7e));const [_0x702513,_0x26a7ab]=await Promise[_0x1f31fd(0x70)]([listBffScripts(_0x59c532['appCode'],_0xe30619),getBffScriptStatistics(_0x59c532[_0x1f31fd(0x8f)])]);if(_0x702513[_0x1f31fd(0xa6)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x1f31fd(0x81)};const _0x1a74bf=_0x59c532[_0x1f31fd(0x91)](_0x1f31fd(0x9d));if(_0x1a74bf&&!_0x59c532[_0x1f31fd(0x9c)]){const _0x3e9658=await confirmForce();if(!_0x3e9658)throw CliErrors[_0x1f31fd(0x8e)]('Force\x20pull\x20cancelled.');}if(_0x1a74bf&&_0x59c532['nonInteractive']){}const _0x39432f=buildDatasetCodeToAliasMap(_0x59c532[_0x1f31fd(0x86)],_0x59c532['appCode']),_0x36f882=createHookLocationMap(_0x26a7ab),_0x37f062=JSON['parse'](JSON[_0x1f31fd(0x68)](_0x3825ad)),_0x270e48=_0x59c532[_0x1f31fd(0x8f)],_0x42236a=_0x37f062['apps'][_0x270e48];if(!_0x42236a)throw new Error(_0x1f31fd(0x67)+_0x270e48+_0x1f31fd(0xa2));const _0x4b5cbe=[],_0x11e021=[],_0x520116=[];for(const _0x4f02ae of _0x702513){const _0x420088=resolveRemoteScriptTarget(_0xc286f9,_0x4f02ae,_0x36f882,_0x5aefb6[_0x1f31fd(0x74)],_0x39432f);if(!_0x420088){_0x11e021[_0x1f31fd(0x6a)]({'lockKey':_0x4f02ae['scriptType']+'/'+_0x4f02ae['functionName'],'reason':_0x1f31fd(0x71)});continue;}const _0x485029=_0x5aefb6[_0x1f31fd(0x74)][_0x420088[_0x1f31fd(0x8c)]];try{if(!_0x4f02ae['id'])throw new Error(_0x1f31fd(0xaf));if(_0x4f02ae[_0x1f31fd(0x89)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x5e8842=_0x4f02ae[_0x1f31fd(0x89)],_0x4ed7ff=computeContentHash(_0x5e8842);if(!_0x1a74bf){const _0x1efdbf=await hasUnsyncedLocalChanges(_0x420088[_0x1f31fd(0x96)],_0x485029,_0x4ed7ff);if(_0x1efdbf){_0x11e021[_0x1f31fd(0x6a)]({'lockKey':_0x420088[_0x1f31fd(0x8c)],'reason':_0x1f31fd(0x95)});continue;}}await ensureParentDirectory(_0x420088[_0x1f31fd(0x96)]),await writeFile(_0x420088['filePath'],_0x5e8842,'utf8');const _0x4198a4={'hash':_0x4ed7ff,'remoteId':_0x4f02ae['id'],'version':_0x4f02ae[_0x1f31fd(0x98)]};_0x420088[_0x1f31fd(0x80)]===_0x1f31fd(0x9e)&&_0x420088[_0x1f31fd(0xa9)]&&(_0x4198a4['alias']=_0x420088[_0x1f31fd(0xa9)][_0x1f31fd(0x9a)],_0x4198a4[_0x1f31fd(0x6d)]=_0x420088[_0x1f31fd(0xa9)][_0x1f31fd(0x6d)],_0x4198a4[_0x1f31fd(0xa1)]=_0x420088[_0x1f31fd(0xa9)][_0x1f31fd(0xa1)],_0x4198a4[_0x1f31fd(0x6b)]=_0x420088[_0x1f31fd(0xa9)][_0x1f31fd(0x6b)]),_0x42236a[_0x1f31fd(0x74)][_0x420088[_0x1f31fd(0x8c)]]=_0x4198a4,_0x4b5cbe[_0x1f31fd(0x6a)]({'lockKey':_0x420088[_0x1f31fd(0x8c)],'remoteId':_0x4f02ae['id']});}catch(_0x46d172){_0x520116[_0x1f31fd(0x6a)]({'lockKey':_0x420088[_0x1f31fd(0x8c)],'error':_0x46d172 instanceof Error?_0x46d172[_0x1f31fd(0x9f)]:String(_0x46d172)});}}return _0x42236a['lastSync']=new Date()[_0x1f31fd(0x97)](),await writeBffLockFile(_0xc286f9[_0x1f31fd(0x84)],_0x37f062),{'ok':_0x520116[_0x1f31fd(0xa6)]===0x0,'data':{'pulled':_0x4b5cbe,'skipped':_0x11e021,'failed':_0x520116},'message':_0x1f31fd(0x88)+_0x4b5cbe[_0x1f31fd(0xa6)]+_0x1f31fd(0x72)+_0x11e021[_0x1f31fd(0xa6)]+_0x1f31fd(0xb0)+_0x520116[_0x1f31fd(0xa6)]+_0x1f31fd(0x69)};}};async function hasUnsyncedLocalChanges(_0x4c168d,_0x55f498,_0x98a343){if(!await fileExists(_0x4c168d))return![];const _0xe58190=await computeFileHash(_0x4c168d);if(!_0x55f498)return _0x98a343?_0xe58190!==_0x98a343:!![];return _0xe58190!==_0x55f498['hash'];}function buildDatasetCodeToAliasMap(_0x17169a,_0x3b4dfa){const _0x208854=a70_0x21f4f8,_0x12511c=loadAliasMap(_0x17169a,undefined,resolveApiFilePath(_0x17169a,_0x3b4dfa));return new Map(_0x12511c[_0x208854(0x83)](_0x3934a1=>[_0x3934a1['datasetCode'],_0x3934a1[_0x208854(0x9a)]]));}async function confirmForce(){const _0x2ed4fc=a70_0x21f4f8,_0x454f30=createInterface({'input':process['stdin'],'output':process[_0x2ed4fc(0xa4)]}),_0x190bbd=await new Promise(_0x80cef4=>{const _0x3e1886=_0x2ed4fc;_0x454f30['question'](_0x3e1886(0x66),_0x80cef4);});return _0x454f30[_0x2ed4fc(0xad)](),['y',_0x2ed4fc(0x78)][_0x2ed4fc(0x6f)](_0x190bbd['trim']()[_0x2ed4fc(0xab)]());}
1
+ const a31_0x1ec5be=a31_0x13cf;(function(_0x306e8a,_0x17da9f){const _0x33e00e=a31_0x13cf,_0xc0fa4c=_0x306e8a();while(!![]){try{const _0x199670=parseInt(_0x33e00e(0x166))/0x1+-parseInt(_0x33e00e(0x154))/0x2+parseInt(_0x33e00e(0x15a))/0x3*(-parseInt(_0x33e00e(0x131))/0x4)+parseInt(_0x33e00e(0x144))/0x5+parseInt(_0x33e00e(0x170))/0x6+parseInt(_0x33e00e(0x14c))/0x7+parseInt(_0x33e00e(0x12b))/0x8*(-parseInt(_0x33e00e(0x156))/0x9);if(_0x199670===_0x17da9f)break;else _0xc0fa4c['push'](_0xc0fa4c['shift']());}catch(_0x5b87b4){_0xc0fa4c['push'](_0xc0fa4c['shift']());}}}(a31_0x10e6,0x80714));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';function a31_0x10e6(){const _0x38a3cb=['validation','Pull\x20complete:\x20','COMMON','force','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','functions','2953110mzDfZV','toLowerCase','\x20remote\x20BFF\x20script(s)\x20for\x20pull','582480BULhvL','utf8','type','lockFilePath','GET','skipped','3012VrtOTJ','message','version','stdin','Remote\x20script\x20missing\x20id.','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','all','scriptContent','Remote\x20script\x20missing\x20content.','datasetCode','map','question','stderr','length','nonInteractive','\x20failed','local\x20unsynced\x20changes','\x20pulled,\x20','scriptType','1454100seHZDb','pull','toISOString','str','apps','appCode','stringify','apiDir','3280886tNPGsG','hookLocation','lockKey','close','Pull\x20only\x20this\x20script\x20type','conflict','lastSync','functionNode','1976336JGsMfm','\x20skipped,\x20','9IHBkWh','trim','push','scriptsRoot','2631xklzpH','alias','HOOK','unresolvable\x20target\x20path','Lock\x20scope\x20for\x20app\x20\x22','filePath','yes','functionName','would_pull','Force\x20pull\x20cancelled.','/api/management/library/scripts/list?appCode=','operationType','995756uCCloX','\x22\x20not\x20found\x20after\x20ensureLockScope.','Force\x20overwrite\x20local\x20unsynced\x20changes','bff'];a31_0x10e6=function(){return _0x38a3cb;};return a31_0x10e6();}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 a31_0x13cf(_0x16db10,_0x5961e0){_0x16db10=_0x16db10-0x12b;const _0x10e6d5=a31_0x10e6();let _0x13cf56=_0x10e6d5[_0x16db10];return _0x13cf56;}export const bffPull={'service':a31_0x1ec5be(0x169),'command':a31_0x1ec5be(0x145),'description':a31_0x1ec5be(0x136),'risk':'write','flags':[{'name':a31_0x1ec5be(0x12d),'type':'string','description':a31_0x1ec5be(0x150),'enum':[a31_0x1ec5be(0x16c),'ENDPOINT',a31_0x1ec5be(0x15c)]},{'name':a31_0x1ec5be(0x16d),'type':'boolean','description':a31_0x1ec5be(0x168)}],async 'dryRun'(_0x944d4){const _0x242714=a31_0x1ec5be,_0x5e0075=loadBffProjectConfig(_0x944d4[_0x242714(0x149)]),_0x4af55=await readBffLockFile(_0x5e0075[_0x242714(0x12e)]),{appLock:_0x4ae379}=ensureLockScope(_0x4af55??createEmptyBffLock(),_0x944d4[_0x242714(0x149)],_0x5e0075[_0x242714(0x159)],'pull'),_0x4cb960=normalizeBffType(_0x944d4[_0x242714(0x147)]('type'))??undefined,_0xa1091a=buildDatasetCodeToAliasMap(_0x944d4[_0x242714(0x14b)],_0x944d4[_0x242714(0x149)]),[_0x5ef09e,_0x45fd76]=await Promise[_0x242714(0x137)]([listBffScripts(_0x944d4[_0x242714(0x149)],_0x4cb960),getBffScriptStatistics(_0x944d4['appCode'])]),_0x35eb4b=createHookLocationMap(_0x45fd76),_0x3e4e8d=[];for(const _0x5f2666 of _0x5ef09e){const _0x37de07=resolveRemoteScriptTarget(_0x5e0075,_0x5f2666,_0x35eb4b,_0x4ae379[_0x242714(0x16f)],_0xa1091a);if(!_0x37de07){_0x3e4e8d[_0x242714(0x158)]({'scriptType':_0x5f2666[_0x242714(0x143)],'functionName':_0x5f2666[_0x242714(0x161)]??'','status':_0x242714(0x130),'reason':_0x242714(0x15d)});continue;}const _0x379bc5=_0x4ae379[_0x242714(0x16f)][_0x37de07[_0x242714(0x14e)]],_0x327fb5=_0x5f2666['scriptContent']!=null?computeContentHash(_0x5f2666[_0x242714(0x138)]):undefined,_0x53f630=await hasUnsyncedLocalChanges(_0x37de07[_0x242714(0x15f)],_0x379bc5,_0x327fb5);_0x3e4e8d[_0x242714(0x158)]({'lockKey':_0x37de07['lockKey'],'filePath':_0x37de07[_0x242714(0x15f)],'remoteId':_0x5f2666['id']??null,'status':_0x53f630?_0x242714(0x151):_0x242714(0x162)});}return{'method':_0x242714(0x12f),'url':_0x242714(0x164)+_0x944d4[_0x242714(0x149)]+(_0x4cb960?'&type='+_0x4cb960:''),'body':{'appCode':_0x944d4[_0x242714(0x149)],'filterType':_0x4cb960??null,'files':_0x3e4e8d},'description':'Would\x20inspect\x20'+_0x3e4e8d[_0x242714(0x13e)]+_0x242714(0x172)};},async 'execute'(_0x32df42){const _0x206c66=a31_0x1ec5be,_0x47a3fa=loadBffProjectConfig(_0x32df42['appCode']),_0x362608=await readBffLockFile(_0x47a3fa[_0x206c66(0x12e)]),{lockData:_0x1890c2,appLock:_0x1fbc9a}=ensureLockScope(_0x362608??createEmptyBffLock(),_0x32df42[_0x206c66(0x149)],_0x47a3fa[_0x206c66(0x159)],'pull'),_0x33db2b=normalizeBffType(_0x32df42['str']('type'))??undefined;if(_0x32df42[_0x206c66(0x147)](_0x206c66(0x12d))&&!_0x33db2b)throw CliErrors[_0x206c66(0x16a)](_0x206c66(0x16e));const [_0x1f47b4,_0x58a602]=await Promise[_0x206c66(0x137)]([listBffScripts(_0x32df42[_0x206c66(0x149)],_0x33db2b),getBffScriptStatistics(_0x32df42[_0x206c66(0x149)])]);if(_0x1f47b4[_0x206c66(0x13e)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x59767b=_0x32df42['bool'](_0x206c66(0x16d));if(_0x59767b&&!_0x32df42[_0x206c66(0x13f)]){const _0x11b9eb=await confirmForce();if(!_0x11b9eb)throw CliErrors['cancelled'](_0x206c66(0x163));}if(_0x59767b&&_0x32df42['nonInteractive']){}const _0x5a3b0c=buildDatasetCodeToAliasMap(_0x32df42[_0x206c66(0x14b)],_0x32df42[_0x206c66(0x149)]),_0x5c2c2e=createHookLocationMap(_0x58a602),_0x538d49=JSON['parse'](JSON[_0x206c66(0x14a)](_0x1890c2)),_0x34780d=_0x32df42[_0x206c66(0x149)],_0x269bb8=_0x538d49[_0x206c66(0x148)][_0x34780d];if(!_0x269bb8)throw new Error(_0x206c66(0x15e)+_0x34780d+_0x206c66(0x167));const _0x290e8c=[],_0x57b198=[],_0x18d5eb=[];for(const _0x545bbe of _0x1f47b4){const _0x1018e6=resolveRemoteScriptTarget(_0x47a3fa,_0x545bbe,_0x5c2c2e,_0x1fbc9a[_0x206c66(0x16f)],_0x5a3b0c);if(!_0x1018e6){_0x57b198[_0x206c66(0x158)]({'lockKey':_0x545bbe['scriptType']+'/'+_0x545bbe[_0x206c66(0x161)],'reason':_0x206c66(0x15d)});continue;}const _0x276563=_0x1fbc9a['functions'][_0x1018e6[_0x206c66(0x14e)]];try{if(!_0x545bbe['id'])throw new Error(_0x206c66(0x135));if(_0x545bbe[_0x206c66(0x138)]==null)throw new Error(_0x206c66(0x139));const _0x4f130a=_0x545bbe[_0x206c66(0x138)],_0x44389c=computeContentHash(_0x4f130a);if(!_0x59767b){const _0x276eee=await hasUnsyncedLocalChanges(_0x1018e6['filePath'],_0x276563,_0x44389c);if(_0x276eee){_0x57b198[_0x206c66(0x158)]({'lockKey':_0x1018e6[_0x206c66(0x14e)],'reason':_0x206c66(0x141)});continue;}}await ensureParentDirectory(_0x1018e6[_0x206c66(0x15f)]),await writeFile(_0x1018e6[_0x206c66(0x15f)],_0x4f130a,_0x206c66(0x12c));const _0x58664b={'hash':_0x44389c,'remoteId':_0x545bbe['id'],'version':_0x545bbe[_0x206c66(0x133)]};_0x1018e6[_0x206c66(0x12d)]===_0x206c66(0x15c)&&_0x1018e6[_0x206c66(0x14d)]&&(_0x58664b['alias']=_0x1018e6[_0x206c66(0x14d)][_0x206c66(0x15b)],_0x58664b[_0x206c66(0x13a)]=_0x1018e6['hookLocation'][_0x206c66(0x13a)],_0x58664b['operationType']=_0x1018e6[_0x206c66(0x14d)][_0x206c66(0x165)],_0x58664b[_0x206c66(0x153)]=_0x1018e6[_0x206c66(0x14d)][_0x206c66(0x153)]),_0x269bb8['functions'][_0x1018e6[_0x206c66(0x14e)]]=_0x58664b,_0x290e8c[_0x206c66(0x158)]({'lockKey':_0x1018e6['lockKey'],'remoteId':_0x545bbe['id']});}catch(_0x50e725){_0x18d5eb[_0x206c66(0x158)]({'lockKey':_0x1018e6[_0x206c66(0x14e)],'error':_0x50e725 instanceof Error?_0x50e725[_0x206c66(0x132)]:String(_0x50e725)});}}return _0x269bb8[_0x206c66(0x152)]=new Date()[_0x206c66(0x146)](),await writeBffLockFile(_0x47a3fa['lockFilePath'],_0x538d49),{'ok':_0x18d5eb[_0x206c66(0x13e)]===0x0,'data':{'pulled':_0x290e8c,'skipped':_0x57b198,'failed':_0x18d5eb},'message':_0x206c66(0x16b)+_0x290e8c[_0x206c66(0x13e)]+_0x206c66(0x142)+_0x57b198['length']+_0x206c66(0x155)+_0x18d5eb[_0x206c66(0x13e)]+_0x206c66(0x140)};}};async function hasUnsyncedLocalChanges(_0x1e9fd2,_0x4175fc,_0x50b159){if(!await fileExists(_0x1e9fd2))return![];const _0x24e2e9=await computeFileHash(_0x1e9fd2);if(!_0x4175fc)return _0x50b159?_0x24e2e9!==_0x50b159:!![];return _0x24e2e9!==_0x4175fc['hash'];}function buildDatasetCodeToAliasMap(_0x47dfbb,_0x231daa){const _0x488291=a31_0x1ec5be,_0x9f16bd=loadAliasMap(_0x47dfbb,undefined,resolveApiFilePath(_0x47dfbb,_0x231daa));return new Map(_0x9f16bd[_0x488291(0x13b)](_0x52a085=>[_0x52a085['datasetCode'],_0x52a085['alias']]));}async function confirmForce(){const _0x41256c=a31_0x1ec5be,_0xb60c80=createInterface({'input':process[_0x41256c(0x134)],'output':process[_0x41256c(0x13d)]}),_0x39de81=await new Promise(_0x15bf40=>{const _0x3098f4=_0x41256c;_0xb60c80[_0x3098f4(0x13c)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x15bf40);});return _0xb60c80[_0x41256c(0x14f)](),['y',_0x41256c(0x160)]['includes'](_0x39de81[_0x41256c(0x157)]()[_0x41256c(0x171)]());}
@@ -1 +1 @@
1
- const a75_0x3a8dd9=a75_0x2246;(function(_0x28c14b,_0x5c95d9){const _0x1ef778=a75_0x2246,_0x15583b=_0x28c14b();while(!![]){try{const _0x240001=-parseInt(_0x1ef778(0xc5))/0x1+parseInt(_0x1ef778(0xc0))/0x2*(parseInt(_0x1ef778(0xcf))/0x3)+-parseInt(_0x1ef778(0xff))/0x4+-parseInt(_0x1ef778(0xd7))/0x5*(-parseInt(_0x1ef778(0xc6))/0x6)+parseInt(_0x1ef778(0xe6))/0x7+-parseInt(_0x1ef778(0xde))/0x8*(-parseInt(_0x1ef778(0xe3))/0x9)+parseInt(_0x1ef778(0xdf))/0xa*(parseInt(_0x1ef778(0xea))/0xb);if(_0x240001===_0x5c95d9)break;else _0x15583b['push'](_0x15583b['shift']());}catch(_0x1ab119){_0x15583b['push'](_0x15583b['shift']());}}}(a75_0x433a,0x5c59a));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';function a75_0x2246(_0x5c59c1,_0x64bfc4){_0x5c59c1=_0x5c59c1-0xbc;const _0x433a9f=a75_0x433a();let _0x224688=_0x433a9f[_0x5c59c1];return _0x224688;}import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';function a75_0x433a(){const _0x4b3686=['version','has',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','bool','15FqeboZ','boolean','COMMON','length','unchanged','filePath','string','87336yEJGUS','22520GMvYWr','get','POST','operationType','405NPDSRU','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','alias','2480828FPjGVU','code','update','appCode','737NxrZfZ','map','Run\x20`','filter','set','lockKey','\x20skipped,\x20','Push\x20local\x20BFF\x20scripts\x20to\x20remote','some','force','datasetCodeToId','lockFilePath','Push\x20complete:\x20','Local\x20function\x20not\x20found:\x20','utf8','Force\x20push\x20ignoring\x20hash\x20protection','toISOString','values','functions','ENDPOINT','hash','2926444IpQtzk','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','push','functionNode','str','4aWLFlG','create','aliasToDatasetCode','remoteId','Would\x20inspect\x20','469233HeOaaP','136950qENXBF','HOOK','validation','type','scriptsRoot','lastSync','description','/api/management/library/scripts/save','name','771123uDPdEX','datasetCode','message','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'];a75_0x433a=function(){return _0x4b3686;};return a75_0x433a();}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':'bff','command':a75_0x3a8dd9(0xbd),'description':a75_0x3a8dd9(0xf1),'risk':'high-risk-write','flags':[{'name':a75_0x3a8dd9(0xc9),'type':a75_0x3a8dd9(0xdd),'description':'Push\x20only\x20this\x20script\x20type','enum':[a75_0x3a8dd9(0xd9),a75_0x3a8dd9(0xfd),a75_0x3a8dd9(0xc7)]},{'name':a75_0x3a8dd9(0xce),'type':a75_0x3a8dd9(0xdd),'description':a75_0x3a8dd9(0xbc)},{'name':'force','type':a75_0x3a8dd9(0xd8),'description':a75_0x3a8dd9(0xf9)}],async 'dryRun'(_0x42b79b){const _0x467fe9=a75_0x3a8dd9,_0x2942f2=loadBffProjectConfig(_0x42b79b[_0x467fe9(0xe9)]),_0xf94951=await readBffLockFile(_0x2942f2[_0x467fe9(0xf5)]),{appLock:_0x304542}=ensureLockScope(_0xf94951??createEmptyBffLock(),_0x42b79b[_0x467fe9(0xe9)],_0x2942f2[_0x467fe9(0xca)],_0x467fe9(0xbd)),_0x5a7f2b=await getTargetFunctions(_0x2942f2,_0x42b79b),_0x24b149=_0x42b79b['bool'](_0x467fe9(0xf3)),_0x4a1761=[];for(const _0x59c0db of _0x5a7f2b){const _0x2ce773=await computeFileHash(_0x59c0db['filePath']),_0xb13723=_0x304542['functions'][_0x59c0db[_0x467fe9(0xef)]],_0x365907=!!_0xb13723&&_0xb13723[_0x467fe9(0xfe)]===_0x2ce773;_0x4a1761[_0x467fe9(0xbd)]({'lockKey':_0x59c0db[_0x467fe9(0xef)],'filePath':_0x59c0db[_0x467fe9(0xdc)],'remoteId':_0xb13723?.[_0x467fe9(0xc3)]??null,'mode':_0xb13723?.[_0x467fe9(0xc3)]?_0x467fe9(0xe8):_0x467fe9(0xc1),'status':!_0x24b149&&_0x365907?'unchanged':'would_push'});}return{'method':_0x467fe9(0xe1),'url':_0x467fe9(0xcd),'body':{'appCode':_0x42b79b[_0x467fe9(0xe9)],'force':_0x24b149,'files':_0x4a1761},'description':_0x467fe9(0xc4)+_0x4a1761['length']+'\x20local\x20BFF\x20script(s)\x20for\x20push'};},async 'execute'(_0x3780d4){const _0x1f3347=a75_0x3a8dd9,_0x13be73=loadBffProjectConfig(_0x3780d4[_0x1f3347(0xe9)]),_0x363460=await readBffLockFile(_0x13be73[_0x1f3347(0xf5)]),{lockData:_0x2ced98,appLock:_0x2387b3}=ensureLockScope(_0x363460??createEmptyBffLock(),_0x3780d4[_0x1f3347(0xe9)],_0x13be73['scriptsRoot'],_0x1f3347(0xbd)),_0x2de4a1=await getTargetFunctions(_0x13be73,_0x3780d4);if(_0x2de4a1[_0x1f3347(0xda)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x14d9e6=_0x3780d4[_0x1f3347(0xd6)](_0x1f3347(0xf3)),_0x4b00f8=await buildHookMaps(_0x3780d4[_0x1f3347(0xe9)],_0x3780d4['apiDir'],_0x2de4a1,_0x2387b3),_0x4259f7=[],_0x15f01d=[],_0x516c74=[];for(const _0x3d3fb4 of _0x2de4a1){const _0x1d3c7b=await computeFileHash(_0x3d3fb4[_0x1f3347(0xdc)]),_0x344af8=_0x2387b3['functions'][_0x3d3fb4[_0x1f3347(0xef)]];if(!_0x14d9e6&&_0x344af8&&_0x344af8[_0x1f3347(0xfe)]===_0x1d3c7b){_0x15f01d['push']({'lockKey':_0x3d3fb4[_0x1f3347(0xef)],'reason':_0x1f3347(0xdb)});continue;}try{await uploadSingleFunction(_0x3780d4[_0x1f3347(0xe9)],_0x3d3fb4,_0x2387b3,_0x4b00f8);const _0x194cd1=_0x2387b3[_0x1f3347(0xfc)][_0x3d3fb4[_0x1f3347(0xef)]];_0x4259f7[_0x1f3347(0xbd)]({'lockKey':_0x3d3fb4[_0x1f3347(0xef)],'remoteId':_0x194cd1?.[_0x1f3347(0xc3)]??0x0});}catch(_0x4601f8){_0x516c74[_0x1f3347(0xbd)]({'lockKey':_0x3d3fb4[_0x1f3347(0xef)],'error':_0x4601f8 instanceof Error?_0x4601f8[_0x1f3347(0xd1)]:String(_0x4601f8)});}}return _0x2387b3[_0x1f3347(0xcb)]=new Date()[_0x1f3347(0xfa)](),await writeBffLockFile(_0x13be73['lockFilePath'],_0x2ced98),{'ok':_0x516c74[_0x1f3347(0xda)]===0x0,'data':{'uploaded':_0x4259f7,'skipped':_0x15f01d,'failed':_0x516c74},'message':_0x1f3347(0xf6)+_0x4259f7['length']+'\x20uploaded,\x20'+_0x15f01d[_0x1f3347(0xda)]+_0x1f3347(0xf0)+_0x516c74[_0x1f3347(0xda)]+'\x20failed'};}};async function getTargetFunctions(_0x2f5dcb,_0x570836){const _0xa1f7ed=a75_0x3a8dd9,_0x33b119=_0x570836['str']('type'),_0x2ce9cc=_0x570836[_0xa1f7ed(0xbf)](_0xa1f7ed(0xce)),_0x418d02=normalizeBffType(_0x33b119)??undefined;if(_0x2ce9cc&&!_0x418d02)throw CliErrors[_0xa1f7ed(0xc8)](_0xa1f7ed(0xe4));const _0x9f0375=await scanLocalBffFunctions(_0x2f5dcb,_0x418d02);if(_0x2ce9cc){const _0x2bd08e=_0x9f0375[_0xa1f7ed(0xed)](_0x27b43a=>_0x27b43a['name']===_0x2ce9cc);if(_0x2bd08e[_0xa1f7ed(0xda)]===0x0)throw CliErrors['validation'](_0xa1f7ed(0xf7)+_0x418d02+'/'+_0x2ce9cc);return _0x2bd08e;}return _0x9f0375;}async function buildHookMaps(_0x5a6637,_0x15838e,_0x239c3c,_0x2f45a2){const _0x279c56=a75_0x3a8dd9,_0x39405b=_0x239c3c[_0x279c56(0xf2)](_0x130c82=>_0x130c82[_0x279c56(0xc9)]==='HOOK');if(!_0x39405b)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0xb648db=loadAliasMap(_0x15838e,undefined,resolveApiFilePath(_0x15838e,_0x5a6637)),_0xc19bbc=new Map(_0xb648db[_0x279c56(0xeb)](_0x240d06=>[_0x240d06[_0x279c56(0xe5)],_0x240d06[_0x279c56(0xd0)]]));for(const _0x46ceca of Object[_0x279c56(0xfb)](_0x2f45a2[_0x279c56(0xfc)])){_0x46ceca['alias']&&_0x46ceca[_0x279c56(0xd0)]&&!_0xc19bbc[_0x279c56(0xd4)](_0x46ceca['alias'])&&_0xc19bbc[_0x279c56(0xee)](_0x46ceca[_0x279c56(0xe5)],_0x46ceca[_0x279c56(0xd0)]);}const _0x52891f=await listDatasets(_0x5a6637),_0x5e077f=new Map(_0x52891f[_0x279c56(0xeb)](_0x27bb66=>[_0x27bb66[_0x279c56(0xe7)],_0x27bb66['id']]));return{'aliasToDatasetCode':_0xc19bbc,'datasetCodeToId':_0x5e077f};}async function uploadSingleFunction(_0x2d971b,_0x1516df,_0x4b731f,_0x2702cf){const _0x27c2d0=a75_0x3a8dd9,_0x495f5c=await readFile(_0x1516df[_0x27c2d0(0xdc)],_0x27c2d0(0xf8)),_0x3d0390=await computeFileHash(_0x1516df[_0x27c2d0(0xdc)]),_0x8bf734=_0x4b731f['functions'][_0x1516df['lockKey']];if(_0x8bf734?.[_0x27c2d0(0xc3)]&&_0x8bf734[_0x27c2d0(0xd3)]==null)throw CliErrors[_0x27c2d0(0xc8)](_0x1516df[_0x27c2d0(0xef)]+_0x27c2d0(0xd5));let _0x29003c=extractScriptDescription(_0x495f5c);if(!_0x29003c&&_0x8bf734?.['remoteId']){const _0x3c3b66=await getBffScriptInfo(_0x8bf734[_0x27c2d0(0xc3)]);_0x29003c=_0x3c3b66[_0x27c2d0(0xcc)]||undefined;}const _0x15ab7b={'appCode':_0x2d971b,'functionName':_0x1516df[_0x27c2d0(0xce)],'scriptType':_0x1516df[_0x27c2d0(0xc9)],'scriptContent':_0x495f5c};if(_0x8bf734?.[_0x27c2d0(0xc3)])_0x15ab7b['id']=_0x8bf734[_0x27c2d0(0xc3)];if(_0x8bf734?.[_0x27c2d0(0xd3)]!=null)_0x15ab7b[_0x27c2d0(0xd3)]=_0x8bf734[_0x27c2d0(0xd3)];if(_0x29003c)_0x15ab7b['description']=_0x29003c;if(_0x1516df['type']==='HOOK'){const _0x3c0d4e=_0x1516df[_0x27c2d0(0xe5)];if(!_0x3c0d4e||!_0x1516df['operationType']||!_0x1516df['functionNode'])throw CliErrors[_0x27c2d0(0xc8)]('Incomplete\x20HOOK\x20path:\x20'+_0x1516df[_0x27c2d0(0xef)]);const _0x23bed4=_0x2702cf[_0x27c2d0(0xc2)][_0x27c2d0(0xe0)](_0x3c0d4e)??_0x8bf734?.['datasetCode']??_0x3c0d4e,_0xf0c9c4=_0x2702cf[_0x27c2d0(0xf4)]['get'](_0x23bed4);if(!_0xf0c9c4)throw CliErrors[_0x27c2d0(0xc8)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x3c0d4e+'\x22.\x20'+(_0x27c2d0(0xec)+CLI_BIN_NAME+_0x27c2d0(0xd2)));_0x15ab7b['datasetId']=_0xf0c9c4,_0x15ab7b['operationType']=_0x1516df[_0x27c2d0(0xe2)],_0x15ab7b[_0x27c2d0(0xbe)]=_0x1516df['functionNode'];}const _0x3ec271=await saveBffScript(_0x15ab7b),_0x166665=await getBffScriptInfo(_0x3ec271),_0x28ca10={'hash':_0x3d0390,'remoteId':_0x3ec271,'version':_0x166665[_0x27c2d0(0xd3)]};if(_0x1516df[_0x27c2d0(0xc9)]==='HOOK'){const _0x4078b7=_0x1516df[_0x27c2d0(0xe5)],_0x5c75e5=_0x2702cf[_0x27c2d0(0xc2)][_0x27c2d0(0xe0)](_0x4078b7)??_0x8bf734?.['datasetCode']??_0x4078b7;_0x2702cf[_0x27c2d0(0xc2)]['has'](_0x4078b7)?_0x28ca10[_0x27c2d0(0xe5)]=_0x4078b7:_0x28ca10[_0x27c2d0(0xe5)]=_0x8bf734?.[_0x27c2d0(0xe5)],_0x28ca10[_0x27c2d0(0xd0)]=_0x5c75e5,_0x28ca10[_0x27c2d0(0xe2)]=_0x1516df[_0x27c2d0(0xe2)],_0x28ca10[_0x27c2d0(0xbe)]=_0x1516df[_0x27c2d0(0xbe)];}_0x4b731f[_0x27c2d0(0xfc)][_0x1516df[_0x27c2d0(0xef)]]=_0x28ca10;}
1
+ const a32_0x1b1272=a32_0x14a5;(function(_0x43fc2e,_0xb5099){const _0x58c5a2=a32_0x14a5,_0x35ba28=_0x43fc2e();while(!![]){try{const _0x233182=parseInt(_0x58c5a2(0x12c))/0x1*(-parseInt(_0x58c5a2(0x160))/0x2)+-parseInt(_0x58c5a2(0x166))/0x3+-parseInt(_0x58c5a2(0x164))/0x4*(parseInt(_0x58c5a2(0x132))/0x5)+parseInt(_0x58c5a2(0x13a))/0x6*(parseInt(_0x58c5a2(0x12d))/0x7)+parseInt(_0x58c5a2(0x13c))/0x8*(parseInt(_0x58c5a2(0x159))/0x9)+parseInt(_0x58c5a2(0x15a))/0xa*(parseInt(_0x58c5a2(0x127))/0xb)+-parseInt(_0x58c5a2(0x155))/0xc*(-parseInt(_0x58c5a2(0x140))/0xd);if(_0x233182===_0xb5099)break;else _0x35ba28['push'](_0x35ba28['shift']());}catch(_0x42a465){_0x35ba28['push'](_0x35ba28['shift']());}}}(a32_0x2c88,0x63692));function a32_0x2c88(){const _0x45b205=['name','filePath','53844tNWzPU','message','\x20local\x20BFF\x20script(s)\x20for\x20push','HOOK','37143XgMiIB','10SLPrec','\x22.\x20','/api/management/library/scripts/save','\x20skipped,\x20','utf8',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','6458jRrzYM','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','str','COMMON','190888HXcVEa','appCode','623448ydJapH','length','would_push','Push\x20only\x20this\x20script\x20type','operationType','create','validation','datasetId','\x20failed','apiDir','alias','aliasToDatasetCode','datasetCodeToId','Cannot\x20resolve\x20dataset\x20for\x20\x22','Incomplete\x20HOOK\x20path:\x20','unchanged','map','push','154209dCFqSf','description','high-risk-write','force','update','97yldfcy','497RWJtQH','has','scriptsRoot','POST','Push\x20complete:\x20','85DaclJh','Would\x20inspect\x20','ENDPOINT','hash','some','\x20uploaded,\x20','remoteId','script','846eoSngC','get','1464LmlHhG','datasetCode','type','Run\x20`','2782zVEtrx','toISOString','Force\x20push\x20ignoring\x20hash\x20protection','Local\x20function\x20not\x20found:\x20','lockFilePath','Push\x20local\x20BFF\x20scripts\x20to\x20remote','lastSync','filter','functionNode','string','boolean','functions','bff','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','version','bool','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','No\x20local\x20BFF\x20functions\x20found.','lockKey'];a32_0x2c88=function(){return _0x45b205;};return a32_0x2c88();}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';function a32_0x14a5(_0x49b89c,_0x4c0d6c){_0x49b89c=_0x49b89c-0x122;const _0x2c88b8=a32_0x2c88();let _0x14a5a0=_0x2c88b8[_0x49b89c];return _0x14a5a0;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a32_0x1b1272(0x14c),'command':a32_0x1b1272(0x126),'description':a32_0x1b1272(0x145),'risk':a32_0x1b1272(0x129),'flags':[{'name':'type','type':a32_0x1b1272(0x149),'description':a32_0x1b1272(0x169),'enum':[a32_0x1b1272(0x163),a32_0x1b1272(0x134),'HOOK']},{'name':a32_0x1b1272(0x153),'type':'string','description':a32_0x1b1272(0x150)},{'name':a32_0x1b1272(0x12a),'type':a32_0x1b1272(0x14a),'description':a32_0x1b1272(0x142)}],async 'dryRun'(_0x4b6556){const _0x4b4a8d=a32_0x1b1272,_0x4861a3=loadBffProjectConfig(_0x4b6556[_0x4b4a8d(0x165)]),_0x2392e3=await readBffLockFile(_0x4861a3['lockFilePath']),{appLock:_0x390a44}=ensureLockScope(_0x2392e3??createEmptyBffLock(),_0x4b6556[_0x4b4a8d(0x165)],_0x4861a3[_0x4b4a8d(0x12f)],_0x4b4a8d(0x126)),_0x20cb64=await getTargetFunctions(_0x4861a3,_0x4b6556),_0xe36547=_0x4b6556[_0x4b4a8d(0x14f)](_0x4b4a8d(0x12a)),_0x403e13=[];for(const _0xb26c04 of _0x20cb64){const _0x2af744=await computeFileHash(_0xb26c04[_0x4b4a8d(0x154)]),_0x196b98=_0x390a44[_0x4b4a8d(0x14b)][_0xb26c04[_0x4b4a8d(0x152)]],_0x646d70=!!_0x196b98&&_0x196b98[_0x4b4a8d(0x135)]===_0x2af744;_0x403e13[_0x4b4a8d(0x126)]({'lockKey':_0xb26c04['lockKey'],'filePath':_0xb26c04[_0x4b4a8d(0x154)],'remoteId':_0x196b98?.[_0x4b4a8d(0x138)]??null,'mode':_0x196b98?.[_0x4b4a8d(0x138)]?_0x4b4a8d(0x12b):_0x4b4a8d(0x16b),'status':!_0xe36547&&_0x646d70?'unchanged':_0x4b4a8d(0x168)});}return{'method':_0x4b4a8d(0x130),'url':_0x4b4a8d(0x15c),'body':{'appCode':_0x4b6556[_0x4b4a8d(0x165)],'force':_0xe36547,'files':_0x403e13},'description':_0x4b4a8d(0x133)+_0x403e13[_0x4b4a8d(0x167)]+_0x4b4a8d(0x157)};},async 'execute'(_0xd80877){const _0xd2bf2f=a32_0x1b1272,_0x4b0934=loadBffProjectConfig(_0xd80877[_0xd2bf2f(0x165)]),_0x1dca40=await readBffLockFile(_0x4b0934[_0xd2bf2f(0x144)]),{lockData:_0x1ab8f3,appLock:_0x52db5b}=ensureLockScope(_0x1dca40??createEmptyBffLock(),_0xd80877[_0xd2bf2f(0x165)],_0x4b0934[_0xd2bf2f(0x12f)],_0xd2bf2f(0x126)),_0xdd2110=await getTargetFunctions(_0x4b0934,_0xd80877);if(_0xdd2110[_0xd2bf2f(0x167)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xd2bf2f(0x151)};const _0x295773=_0xd80877[_0xd2bf2f(0x14f)](_0xd2bf2f(0x12a)),_0x1b662e=await buildHookMaps(_0xd80877[_0xd2bf2f(0x165)],_0xd80877[_0xd2bf2f(0x16f)],_0xdd2110,_0x52db5b),_0x1de19b=[],_0x4cb4c6=[],_0x273afe=[];for(const _0x5962d3 of _0xdd2110){const _0x722fd=await computeFileHash(_0x5962d3[_0xd2bf2f(0x154)]),_0x482802=_0x52db5b['functions'][_0x5962d3['lockKey']];if(!_0x295773&&_0x482802&&_0x482802[_0xd2bf2f(0x135)]===_0x722fd){_0x4cb4c6['push']({'lockKey':_0x5962d3[_0xd2bf2f(0x152)],'reason':_0xd2bf2f(0x124)});continue;}try{await uploadSingleFunction(_0xd80877['appCode'],_0x5962d3,_0x52db5b,_0x1b662e);const _0x2f2c35=_0x52db5b['functions'][_0x5962d3[_0xd2bf2f(0x152)]];_0x1de19b[_0xd2bf2f(0x126)]({'lockKey':_0x5962d3['lockKey'],'remoteId':_0x2f2c35?.[_0xd2bf2f(0x138)]??0x0});}catch(_0x8c3f90){_0x273afe[_0xd2bf2f(0x126)]({'lockKey':_0x5962d3[_0xd2bf2f(0x152)],'error':_0x8c3f90 instanceof Error?_0x8c3f90[_0xd2bf2f(0x156)]:String(_0x8c3f90)});}}return _0x52db5b[_0xd2bf2f(0x146)]=new Date()[_0xd2bf2f(0x141)](),await writeBffLockFile(_0x4b0934[_0xd2bf2f(0x144)],_0x1ab8f3),{'ok':_0x273afe['length']===0x0,'data':{'uploaded':_0x1de19b,'skipped':_0x4cb4c6,'failed':_0x273afe},'message':_0xd2bf2f(0x131)+_0x1de19b[_0xd2bf2f(0x167)]+_0xd2bf2f(0x137)+_0x4cb4c6[_0xd2bf2f(0x167)]+_0xd2bf2f(0x15d)+_0x273afe[_0xd2bf2f(0x167)]+_0xd2bf2f(0x16e)};}};async function getTargetFunctions(_0x36f8ff,_0x5dc42b){const _0x426a66=a32_0x1b1272,_0x18e0f2=_0x5dc42b[_0x426a66(0x162)]('type'),_0x14e3fc=_0x5dc42b[_0x426a66(0x162)]('name'),_0x2793a1=normalizeBffType(_0x18e0f2)??undefined;if(_0x14e3fc&&!_0x2793a1)throw CliErrors['validation'](_0x426a66(0x14d));const _0x790a76=await scanLocalBffFunctions(_0x36f8ff,_0x2793a1);if(_0x14e3fc){const _0x1803cb=_0x790a76[_0x426a66(0x147)](_0x3d59d9=>_0x3d59d9[_0x426a66(0x153)]===_0x14e3fc);if(_0x1803cb[_0x426a66(0x167)]===0x0)throw CliErrors[_0x426a66(0x16c)](_0x426a66(0x143)+_0x2793a1+'/'+_0x14e3fc);return _0x1803cb;}return _0x790a76;}async function buildHookMaps(_0x4676cc,_0x14bdd4,_0x3d64f4,_0x5d532e){const _0x535a7f=a32_0x1b1272,_0x4f33e7=_0x3d64f4[_0x535a7f(0x136)](_0x22b3b1=>_0x22b3b1['type']===_0x535a7f(0x158));if(!_0x4f33e7)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x5d5107=loadAliasMap(_0x14bdd4,undefined,resolveApiFilePath(_0x14bdd4,_0x4676cc)),_0x2c0289=new Map(_0x5d5107['map'](_0x3560c0=>[_0x3560c0[_0x535a7f(0x170)],_0x3560c0[_0x535a7f(0x13d)]]));for(const _0x24fbc6 of Object['values'](_0x5d532e['functions'])){_0x24fbc6['alias']&&_0x24fbc6[_0x535a7f(0x13d)]&&!_0x2c0289[_0x535a7f(0x12e)](_0x24fbc6[_0x535a7f(0x170)])&&_0x2c0289['set'](_0x24fbc6['alias'],_0x24fbc6[_0x535a7f(0x13d)]);}const _0x16901=await listDatasets(_0x4676cc),_0x10bd1a=new Map(_0x16901[_0x535a7f(0x125)](_0x50112c=>[_0x50112c['code'],_0x50112c['id']]));return{'aliasToDatasetCode':_0x2c0289,'datasetCodeToId':_0x10bd1a};}async function uploadSingleFunction(_0x2af525,_0x150027,_0x5ee787,_0x5c8210){const _0x28834a=a32_0x1b1272,_0x22d485=await readFile(_0x150027[_0x28834a(0x154)],_0x28834a(0x15e)),_0xbd104e=await computeFileHash(_0x150027['filePath']),_0x225b5d=_0x5ee787[_0x28834a(0x14b)][_0x150027[_0x28834a(0x152)]];if(_0x225b5d?.[_0x28834a(0x138)]&&_0x225b5d[_0x28834a(0x14e)]==null)throw CliErrors[_0x28834a(0x16c)](_0x150027[_0x28834a(0x152)]+_0x28834a(0x15f));let _0xa9004=extractScriptDescription(_0x22d485);if(!_0xa9004&&_0x225b5d?.[_0x28834a(0x138)]){const _0x2a2ef9=await getBffScriptInfo(_0x225b5d['remoteId']);_0xa9004=_0x2a2ef9['description']||undefined;}const _0x49a286={'appCode':_0x2af525,'functionName':_0x150027[_0x28834a(0x153)],'scriptType':_0x150027[_0x28834a(0x13e)],'scriptContent':_0x22d485};if(_0x225b5d?.[_0x28834a(0x138)])_0x49a286['id']=_0x225b5d[_0x28834a(0x138)];if(_0x225b5d?.[_0x28834a(0x14e)]!=null)_0x49a286[_0x28834a(0x14e)]=_0x225b5d[_0x28834a(0x14e)];if(_0xa9004)_0x49a286[_0x28834a(0x128)]=_0xa9004;if(_0x150027[_0x28834a(0x13e)]===_0x28834a(0x158)){const _0x4a2510=_0x150027[_0x28834a(0x170)];if(!_0x4a2510||!_0x150027['operationType']||!_0x150027[_0x28834a(0x148)])throw CliErrors[_0x28834a(0x16c)](_0x28834a(0x123)+_0x150027[_0x28834a(0x152)]);const _0x6d4559=_0x5c8210[_0x28834a(0x171)][_0x28834a(0x13b)](_0x4a2510)??_0x225b5d?.[_0x28834a(0x13d)]??_0x4a2510,_0x1314b7=_0x5c8210[_0x28834a(0x172)][_0x28834a(0x13b)](_0x6d4559);if(!_0x1314b7)throw CliErrors['validation'](_0x28834a(0x122)+_0x4a2510+_0x28834a(0x15b)+(_0x28834a(0x13f)+CLI_BIN_NAME+_0x28834a(0x161)));_0x49a286[_0x28834a(0x16d)]=_0x1314b7,_0x49a286[_0x28834a(0x16a)]=_0x150027['operationType'],_0x49a286[_0x28834a(0x148)]=_0x150027[_0x28834a(0x148)];}const _0x58c696=await saveBffScript(_0x49a286),_0x2190c7=_0x58c696['id'],_0x5cab0a=_0x58c696[_0x28834a(0x139)]??await getBffScriptInfo(_0x2190c7),_0x1f658c={'hash':_0xbd104e,'remoteId':_0x2190c7,'version':_0x5cab0a[_0x28834a(0x14e)]};if(_0x150027[_0x28834a(0x13e)]==='HOOK'){const _0x2de843=_0x150027[_0x28834a(0x170)],_0x534f52=_0x5c8210[_0x28834a(0x171)]['get'](_0x2de843)??_0x225b5d?.['datasetCode']??_0x2de843;_0x5c8210[_0x28834a(0x171)][_0x28834a(0x12e)](_0x2de843)?_0x1f658c[_0x28834a(0x170)]=_0x2de843:_0x1f658c[_0x28834a(0x170)]=_0x225b5d?.[_0x28834a(0x170)],_0x1f658c['datasetCode']=_0x534f52,_0x1f658c[_0x28834a(0x16a)]=_0x150027[_0x28834a(0x16a)],_0x1f658c[_0x28834a(0x148)]=_0x150027[_0x28834a(0x148)];}_0x5ee787['functions'][_0x150027[_0x28834a(0x152)]]=_0x1f658c;}
@@ -1 +1 @@
1
- function a71_0x31d9(_0x2d681f,_0x599d44){_0x2d681f=_0x2d681f-0x146;const _0x18001d=a71_0x1800();let _0x31d9ac=_0x18001d[_0x2d681f];return _0x31d9ac;}const a71_0x56b853=a71_0x31d9;(function(_0x534182,_0x59dc90){const _0x112814=a71_0x31d9,_0x5b746a=_0x534182();while(!![]){try{const _0x163115=-parseInt(_0x112814(0x14d))/0x1*(-parseInt(_0x112814(0x14b))/0x2)+parseInt(_0x112814(0x162))/0x3*(-parseInt(_0x112814(0x163))/0x4)+-parseInt(_0x112814(0x147))/0x5*(-parseInt(_0x112814(0x156))/0x6)+-parseInt(_0x112814(0x152))/0x7+-parseInt(_0x112814(0x153))/0x8+-parseInt(_0x112814(0x14e))/0x9+parseInt(_0x112814(0x148))/0xa;if(_0x163115===_0x59dc90)break;else _0x5b746a['push'](_0x5b746a['shift']());}catch(_0x161715){_0x5b746a['push'](_0x5b746a['shift']());}}}(a71_0x1800,0x6730c));function a71_0x1800(){const _0x816597=['filePath','\x20modified,\x20','all','map','\x20unchanged','141594ITrixj','64DaGPlg','has','190EhfdYq','21069580aqlDke','appCode','bff','2cmcwTS','boolean','444423gLxjXt','5724963fMbsxa','All\x20BFF\x20scripts\x20are\x20in\x20sync.','alias','apiDir','1710891znnFPe','4199256vpmZCe','scriptsRoot','length','5034wnDiTt','remote','status','bool','lockKey','datasetCode','push'];a71_0x1800=function(){return _0x816597;};return a71_0x1800();}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':a71_0x56b853(0x14a),'command':a71_0x56b853(0x158),'description':'Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':a71_0x56b853(0x157),'type':a71_0x56b853(0x14c),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x43c845){const _0x227668=a71_0x56b853,_0x4360fb=loadBffProjectConfig(_0x43c845[_0x227668(0x149)]),_0x4a96c1=await readBffLockFile(_0x4360fb['lockFilePath']),{appLock:_0x20af55}=ensureLockScope(_0x4a96c1??createEmptyBffLock(),_0x43c845[_0x227668(0x149)],_0x4360fb[_0x227668(0x154)],_0x227668(0x158)),_0x2ee643=await scanLocalBffFunctions(_0x4360fb),_0x239ca0=[],_0x2cf39b=[],_0x33737b=[];for(const _0x31db4e of _0x2ee643){const _0x7506ca=await computeFileHash(_0x31db4e[_0x227668(0x15d)]),_0xcba59a=_0x20af55['functions'][_0x31db4e['lockKey']];if(!_0xcba59a)_0x239ca0[_0x227668(0x15c)](_0x31db4e[_0x227668(0x15a)]);else _0xcba59a['hash']!==_0x7506ca?_0x2cf39b[_0x227668(0x15c)](_0x31db4e[_0x227668(0x15a)]):_0x33737b[_0x227668(0x15c)](_0x31db4e[_0x227668(0x15a)]);}const _0x1b5849=[];if(_0x43c845[_0x227668(0x159)](_0x227668(0x157))){const _0x1b8a1c=loadAliasMap(_0x43c845[_0x227668(0x151)],undefined,resolveApiFilePath(_0x43c845['apiDir'],_0x43c845[_0x227668(0x149)])),_0x416f69=new Map(_0x1b8a1c['map'](_0x74fdf5=>[_0x74fdf5[_0x227668(0x15b)],_0x74fdf5[_0x227668(0x150)]])),[_0x33a6e9,_0x590eef]=await Promise[_0x227668(0x15f)]([listBffScripts(_0x43c845[_0x227668(0x149)]),getBffScriptStatistics(_0x43c845['appCode'])]),_0x1a2aa0=createHookLocationMap(_0x590eef),_0x29143b=new Set(_0x2ee643[_0x227668(0x160)](_0x1402dc=>_0x1402dc['lockKey']));for(const _0x424be0 of _0x33a6e9){const _0x2fb178=resolveRemoteScriptTarget(_0x4360fb,_0x424be0,_0x1a2aa0,_0x20af55['functions'],_0x416f69);_0x2fb178&&!_0x29143b[_0x227668(0x146)](_0x2fb178[_0x227668(0x15a)])&&_0x1b5849[_0x227668(0x15c)](_0x2fb178[_0x227668(0x15a)]);}}const _0x586161=_0x239ca0[_0x227668(0x155)]===0x0&&_0x2cf39b[_0x227668(0x155)]===0x0&&_0x1b5849[_0x227668(0x155)]===0x0;return{'ok':!![],'data':{'added':_0x239ca0,'modified':_0x2cf39b,'unchanged':_0x33737b,'remoteOnly':_0x1b5849},'message':_0x586161?_0x227668(0x14f):_0x239ca0[_0x227668(0x155)]+'\x20added,\x20'+_0x2cf39b[_0x227668(0x155)]+_0x227668(0x15e)+_0x33737b[_0x227668(0x155)]+_0x227668(0x161)+(_0x1b5849[_0x227668(0x155)]>0x0?',\x20'+_0x1b5849[_0x227668(0x155)]+'\x20remote-only':'')};}};
1
+ const a33_0x83cd94=a33_0x3e30;(function(_0x6607e3,_0x2b70ca){const _0x1d624b=a33_0x3e30,_0x155d90=_0x6607e3();while(!![]){try{const _0x3e2175=-parseInt(_0x1d624b(0x14e))/0x1+-parseInt(_0x1d624b(0x162))/0x2+parseInt(_0x1d624b(0x154))/0x3*(-parseInt(_0x1d624b(0x14f))/0x4)+parseInt(_0x1d624b(0x148))/0x5+parseInt(_0x1d624b(0x160))/0x6+-parseInt(_0x1d624b(0x158))/0x7+parseInt(_0x1d624b(0x156))/0x8;if(_0x3e2175===_0x2b70ca)break;else _0x155d90['push'](_0x155d90['shift']());}catch(_0xc1b09f){_0x155d90['push'](_0x155d90['shift']());}}}(a33_0x3efe,0x8f45e));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';function a33_0x3efe(){const _0x57a6d4=['scriptsRoot','1996650PAcDpy','\x20modified,\x20','push','All\x20BFF\x20scripts\x20are\x20in\x20sync.','lockFilePath','has','750166pjbUTE','74492rAzprl','filePath','alias','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','all','63FbwkxN','length','12014856ihFaHU','boolean','1348011bWZZlU','hash','apiDir','functions','appCode','remote','status','bff','733572EBCGCG','\x20unchanged','205562NfgFsQ','read','lockKey'];a33_0x3efe=function(){return _0x57a6d4;};return a33_0x3efe();}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';function a33_0x3e30(_0x2ba8ec,_0x2ee793){_0x2ba8ec=_0x2ba8ec-0x147;const _0x3efe67=a33_0x3efe();let _0x3e30cd=_0x3efe67[_0x2ba8ec];return _0x3e30cd;}export const bffStatus={'service':a33_0x83cd94(0x15f),'command':'status','description':a33_0x83cd94(0x152),'risk':a33_0x83cd94(0x163),'flags':[{'name':'remote','type':a33_0x83cd94(0x157),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x4b5445){const _0x570637=a33_0x83cd94,_0x494e2c=loadBffProjectConfig(_0x4b5445[_0x570637(0x15c)]),_0x8a49a=await readBffLockFile(_0x494e2c[_0x570637(0x14c)]),{appLock:_0x2c9304}=ensureLockScope(_0x8a49a??createEmptyBffLock(),_0x4b5445['appCode'],_0x494e2c[_0x570637(0x147)],_0x570637(0x15e)),_0x5a7ef6=await scanLocalBffFunctions(_0x494e2c),_0x285b9c=[],_0x38a8f5=[],_0x2e70fd=[];for(const _0x4a9303 of _0x5a7ef6){const _0x5c5aa5=await computeFileHash(_0x4a9303[_0x570637(0x150)]),_0xdb70dc=_0x2c9304[_0x570637(0x15b)][_0x4a9303[_0x570637(0x164)]];if(!_0xdb70dc)_0x285b9c[_0x570637(0x14a)](_0x4a9303[_0x570637(0x164)]);else _0xdb70dc[_0x570637(0x159)]!==_0x5c5aa5?_0x38a8f5[_0x570637(0x14a)](_0x4a9303['lockKey']):_0x2e70fd[_0x570637(0x14a)](_0x4a9303['lockKey']);}const _0x2030dd=[];if(_0x4b5445['bool'](_0x570637(0x15d))){const _0x3857f6=loadAliasMap(_0x4b5445[_0x570637(0x15a)],undefined,resolveApiFilePath(_0x4b5445['apiDir'],_0x4b5445[_0x570637(0x15c)])),_0x346ef0=new Map(_0x3857f6['map'](_0x4f1ae4=>[_0x4f1ae4['datasetCode'],_0x4f1ae4[_0x570637(0x151)]])),[_0x4c0979,_0x46b758]=await Promise[_0x570637(0x153)]([listBffScripts(_0x4b5445[_0x570637(0x15c)]),getBffScriptStatistics(_0x4b5445['appCode'])]),_0x581e59=createHookLocationMap(_0x46b758),_0x34a60=new Set(_0x5a7ef6['map'](_0x53137e=>_0x53137e[_0x570637(0x164)]));for(const _0x40b009 of _0x4c0979){const _0x57bddc=resolveRemoteScriptTarget(_0x494e2c,_0x40b009,_0x581e59,_0x2c9304[_0x570637(0x15b)],_0x346ef0);_0x57bddc&&!_0x34a60[_0x570637(0x14d)](_0x57bddc[_0x570637(0x164)])&&_0x2030dd[_0x570637(0x14a)](_0x57bddc['lockKey']);}}const _0x4f7bc6=_0x285b9c['length']===0x0&&_0x38a8f5[_0x570637(0x155)]===0x0&&_0x2030dd[_0x570637(0x155)]===0x0;return{'ok':!![],'data':{'added':_0x285b9c,'modified':_0x38a8f5,'unchanged':_0x2e70fd,'remoteOnly':_0x2030dd},'message':_0x4f7bc6?_0x570637(0x14b):_0x285b9c['length']+'\x20added,\x20'+_0x38a8f5['length']+_0x570637(0x149)+_0x2e70fd['length']+_0x570637(0x161)+(_0x2030dd[_0x570637(0x155)]>0x0?',\x20'+_0x2030dd[_0x570637(0x155)]+'\x20remote-only':'')};}};