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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -0
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -0
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -0
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/delete.js +1 -1
  28. package/lib/commands/bff/detail.js +1 -1
  29. package/lib/commands/bff/index.js +1 -1
  30. package/lib/commands/bff/list.js +1 -1
  31. package/lib/commands/bff/new.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -1
  53. package/lib/commands/db/analyze-start.js +1 -1
  54. package/lib/commands/db/analyze-status.js +1 -1
  55. package/lib/commands/db/create.js +1 -1
  56. package/lib/commands/db/delete.js +1 -1
  57. package/lib/commands/db/detail.js +1 -1
  58. package/lib/commands/db/diff.js +1 -1
  59. package/lib/commands/db/index.js +1 -1
  60. package/lib/commands/db/list.js +1 -1
  61. package/lib/commands/db/shared.js +1 -1
  62. package/lib/commands/db/tables.js +1 -1
  63. package/lib/commands/db/test.js +1 -1
  64. package/lib/commands/db/update.js +1 -1
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  81. package/lib/commands/project/create/format-elapsed.js +1 -1
  82. package/lib/commands/project/create/main.js +1 -1
  83. package/lib/commands/project/create/non-interactive.js +1 -1
  84. package/lib/commands/project/create/project-template-path.js +1 -1
  85. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  86. package/lib/commands/project/create/use-format-code.js +1 -1
  87. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  88. package/lib/commands/project/index.js +1 -1
  89. package/lib/commands/project/init.js +1 -1
  90. package/lib/commands/project/upgrade.js +1 -1
  91. package/lib/commands/registry.js +1 -1
  92. package/lib/commands/run/index.js +1 -1
  93. package/lib/commands/schema.js +1 -1
  94. package/lib/commands/skill/index.js +1 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +1 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/sql/list.js +1 -1
  99. package/lib/commands/sql/pull.js +1 -1
  100. package/lib/commands/sql/save.js +1 -1
  101. package/lib/commands/sql/shared.js +1 -1
  102. package/lib/commands/sql/validate.js +1 -1
  103. package/lib/config/schema.js +1 -0
  104. package/lib/constant/cli.js +1 -1
  105. package/lib/constant/defaults.js +1 -0
  106. package/lib/constant/domain.js +1 -1
  107. package/lib/constant/env.js +1 -1
  108. package/lib/constant/output.js +1 -0
  109. package/lib/constant/paths.js +1 -1
  110. package/lib/constant/risk.js +1 -0
  111. package/lib/context.js +1 -1
  112. package/lib/core/alias-resolver.js +1 -1
  113. package/lib/core/api-client.js +1 -1
  114. package/lib/core/bff/config.js +1 -1
  115. package/lib/core/bff/file-system.js +1 -1
  116. package/lib/core/bff/hash.js +1 -1
  117. package/lib/core/bff/lock.js +1 -1
  118. package/lib/core/bff/utils.js +1 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/sql-validator.js +1 -1
  121. package/lib/errors.js +1 -1
  122. package/lib/framework/build-all-flags.js +1 -1
  123. package/lib/framework/flags.js +1 -1
  124. package/lib/framework/help.js +1 -1
  125. package/lib/framework/index.js +1 -1
  126. package/lib/framework/output.js +1 -1
  127. package/lib/framework/response.js +1 -1
  128. package/lib/framework/runner-alias.js +1 -0
  129. package/lib/framework/runner.js +1 -1
  130. package/lib/framework/schema-export.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/skills/main.js +1 -1
  135. package/lib/skills/npx-skills-add.js +1 -1
  136. package/lib/telemetry/cli-command-trace.js +1 -1
  137. package/lib/telemetry/cli-help-trace.js +1 -1
  138. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  139. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  140. package/lib/telemetry/send-cli-trace-log.js +1 -1
  141. package/lib/utils/ai_config.js +1 -1
  142. package/lib/utils/apply-jq-filter.js +1 -1
  143. package/lib/utils/cdn-config.js +1 -1
  144. package/lib/utils/check-sdk-version.js +1 -1
  145. package/lib/utils/cli-version-check.js +1 -1
  146. package/lib/utils/config.js +1 -1
  147. package/lib/utils/copy-directory.js +1 -1
  148. package/lib/utils/file-utils.js +1 -1
  149. package/lib/utils/guides-cdn.js +1 -1
  150. package/lib/utils/http-client.js +1 -1
  151. package/lib/utils/is-non-interactive.js +1 -1
  152. package/lib/utils/logger.js +1 -1
  153. package/lib/utils/platform.js +1 -1
  154. package/lib/utils/rules-cdn.js +1 -1
  155. package/lib/utils/sleep.js +1 -1
  156. package/lib/utils/template-replacer.js +1 -1
  157. package/lib/utils/version.js +1 -1
  158. package/lib/utils/with-active-cookie.js +1 -1
  159. package/lib/utils/write-cli-side-channel.js +1 -1
  160. package/package.json +3 -2
  161. package/lib/commands/api/doc.js +0 -1
  162. package/lib/commands/app/remote.js +0 -1
@@ -1 +1 @@
1
- const a19_0x249733=a19_0x2d22;(function(_0x1252e5,_0x24540b){const _0x467396=a19_0x2d22,_0x4227b3=_0x1252e5();while(!![]){try{const _0x26b431=-parseInt(_0x467396(0x135))/0x1*(parseInt(_0x467396(0x10d))/0x2)+parseInt(_0x467396(0x115))/0x3*(parseInt(_0x467396(0x109))/0x4)+parseInt(_0x467396(0x10f))/0x5*(-parseInt(_0x467396(0x125))/0x6)+-parseInt(_0x467396(0x11a))/0x7+-parseInt(_0x467396(0x112))/0x8*(parseInt(_0x467396(0x111))/0x9)+parseInt(_0x467396(0x122))/0xa+parseInt(_0x467396(0x134))/0xb;if(_0x26b431===_0x24540b)break;else _0x4227b3['push'](_0x4227b3['shift']());}catch(_0x5a6b78){_0x4227b3['push'](_0x4227b3['shift']());}}}(a19_0x3794,0x74851));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x3794(){const _0x485bb9=['\x20config','merged','riskLevel','18130464XNttjW','14383vdkloL','length','read','8936nyLmXS','No\x20apps\x20configured','map','pageSize','22PAWggi','find','305EuwIZA','bool','5760yXHzjv','11896rNyBJp','globalConfig','boolean','24LBbVbg','push','cookie','apiDir','format','22680yvUNkH','globalPath','entries','inherit','appcode','\x20in\x20','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','project','7193150piTcyT','accessKey','apps','78198dFkQvu','list','env','isCurrent','object','projectPath','global','keys','app','locale','projectConfig','defaultApp'];a19_0x3794=function(){return _0x485bb9;};return a19_0x3794();}import{appDefinedIn,resolveDefaultAppSource}from'../../commands/app/shared.js';function buildItemsFromLayer(_0x2e9386,_0x1943ff){const _0x519c7b=a19_0x2d22,_0xf536d5=[],_0x13b9ba=_0x2e9386[_0x519c7b(0x124)]&&typeof _0x2e9386['apps']===_0x519c7b(0x129)?_0x2e9386[_0x519c7b(0x124)]:{},_0x319329=_0x2e9386[_0x519c7b(0x130)]||undefined;for(const [_0x5b9198,_0x309893]of Object[_0x519c7b(0x11c)](_0x13b9ba)){if(!_0x309893||typeof _0x309893!=='object'||!_0x309893[_0x519c7b(0x11e)])continue;_0xf536d5[_0x519c7b(0x116)]({'name':_0x5b9198,'appcode':_0x309893[_0x519c7b(0x11e)],'named':!![],'definedIn':_0x1943ff,'isDefault':_0x5b9198===_0x319329,'env':_0x309893[_0x519c7b(0x127)]??null,'apiDir':_0x309893['apiDir']??null,'hasCookie':!!_0x309893[_0x519c7b(0x117)],'hasAccessKey':!!_0x309893[_0x519c7b(0x123)],'format':_0x309893[_0x519c7b(0x119)]??null,'pageSize':_0x309893[_0x519c7b(0x10c)]??null,'riskLevel':_0x309893[_0x519c7b(0x133)]??null,'locale':_0x309893['locale']??null});}const _0x36bc78=Object[_0x519c7b(0x12c)](_0x13b9ba)[_0x519c7b(0x136)]>0x0,_0x2c2485=_0x2e9386[_0x519c7b(0x11e)]||_0x2e9386[_0x519c7b(0x12d)];return _0x2c2485&&!_0x36bc78&&_0xf536d5[_0x519c7b(0x116)]({'name':null,'appcode':String(_0x2c2485),'named':![],'definedIn':_0x1943ff,'isDefault':![],'env':_0x2e9386[_0x519c7b(0x127)]??null,'apiDir':_0x2e9386['apiDir']??null,'hasCookie':!!_0x2e9386[_0x519c7b(0x117)],'hasAccessKey':!!_0x2e9386[_0x519c7b(0x123)],'format':_0x2e9386['format']??null,'pageSize':_0x2e9386[_0x519c7b(0x10c)]??null,'riskLevel':_0x2e9386[_0x519c7b(0x133)]??null,'locale':_0x2e9386[_0x519c7b(0x12e)]??null}),_0xf536d5;}function a19_0x2d22(_0x1c658b,_0x267690){_0x1c658b=_0x1c658b-0x108;const _0x379437=a19_0x3794();let _0x2d229a=_0x379437[_0x1c658b];return _0x2d229a;}function buildMergedItems(_0x3487f0,_0x1b5cff){const _0x373705=a19_0x2d22,{apps:apps={},defaultApp:_0x2db2fc,currentApp:_0x7d91f9}=_0x3487f0,_0x582bf1=_0x1b5cff[_0x373705(0x113)][_0x373705(0x124)]&&typeof _0x1b5cff[_0x373705(0x113)]['apps']==='object'?_0x1b5cff[_0x373705(0x113)][_0x373705(0x124)]:{},_0x59dd3b=_0x1b5cff[_0x373705(0x12f)][_0x373705(0x124)]&&typeof _0x1b5cff[_0x373705(0x12f)]['apps']===_0x373705(0x129)?_0x1b5cff[_0x373705(0x12f)][_0x373705(0x124)]:{},_0xb72e79=_0x1b5cff[_0x373705(0x12f)][_0x373705(0x11d)]===![],_0x498dbe=Object[_0x373705(0x11c)](apps),_0x148cc9=_0x498dbe[_0x373705(0x10b)](([_0x25177e,_0x46920f])=>({'name':_0x25177e,'appcode':_0x46920f[_0x373705(0x11e)],'named':!![],'definedIn':appDefinedIn(_0x25177e,_0x582bf1,_0x59dd3b,_0xb72e79),'isDefault':_0x25177e===_0x2db2fc,'isCurrent':_0x25177e===(_0x7d91f9??_0x2db2fc),'env':_0x46920f[_0x373705(0x127)]??null,'apiDir':_0x46920f['apiDir']??null,'hasCookie':!!_0x46920f[_0x373705(0x117)],'hasAccessKey':!!_0x46920f['accessKey'],'format':_0x46920f[_0x373705(0x119)]??null,'pageSize':_0x46920f[_0x373705(0x10c)]??null,'riskLevel':_0x46920f[_0x373705(0x133)]??null,'locale':_0x46920f[_0x373705(0x12e)]??null})),_0x29396c=(_0x1b5cff[_0x373705(0x12f)]['appcode']||_0x1b5cff[_0x373705(0x12f)][_0x373705(0x12d)])&&(!_0x1b5cff[_0x373705(0x12f)]['apps']||Object['keys'](_0x1b5cff[_0x373705(0x12f)][_0x373705(0x124)])[_0x373705(0x136)]===0x0)?String(_0x1b5cff[_0x373705(0x12f)][_0x373705(0x11e)]||_0x1b5cff[_0x373705(0x12f)][_0x373705(0x12d)]):undefined,_0x1a17fc=(_0x1b5cff[_0x373705(0x113)]['appcode']||_0x1b5cff['globalConfig'][_0x373705(0x12d)])&&(!_0x1b5cff[_0x373705(0x113)][_0x373705(0x124)]||Object['keys'](_0x1b5cff['globalConfig'][_0x373705(0x124)])[_0x373705(0x136)]===0x0)?String(_0x1b5cff[_0x373705(0x113)][_0x373705(0x11e)]||_0x1b5cff[_0x373705(0x113)][_0x373705(0x12d)]):undefined;if(_0x29396c)_0x148cc9[_0x373705(0x116)]({'name':null,'appcode':_0x29396c,'named':![],'definedIn':_0x373705(0x121),'isDefault':![],'isCurrent':!_0x2db2fc,'env':_0x1b5cff[_0x373705(0x12f)][_0x373705(0x127)]??null,'apiDir':_0x1b5cff[_0x373705(0x12f)]['apiDir']??null,'hasCookie':!!_0x1b5cff[_0x373705(0x12f)][_0x373705(0x117)],'hasAccessKey':!!_0x1b5cff[_0x373705(0x12f)][_0x373705(0x123)],'format':_0x1b5cff[_0x373705(0x12f)]['format']??null,'pageSize':_0x1b5cff['projectConfig'][_0x373705(0x10c)]??null,'riskLevel':_0x1b5cff[_0x373705(0x12f)]['riskLevel']??null,'locale':_0x1b5cff[_0x373705(0x12f)]['locale']??null});else _0x1a17fc&&_0x498dbe['length']===0x0&&_0x148cc9[_0x373705(0x116)]({'name':null,'appcode':_0x1a17fc,'named':![],'definedIn':_0x373705(0x12b),'isDefault':![],'isCurrent':!_0x2db2fc,'env':_0x1b5cff[_0x373705(0x113)][_0x373705(0x127)]??null,'apiDir':_0x1b5cff[_0x373705(0x113)][_0x373705(0x118)]??null,'hasCookie':!!_0x1b5cff[_0x373705(0x113)][_0x373705(0x117)],'hasAccessKey':!!_0x1b5cff[_0x373705(0x113)]['accessKey'],'format':_0x1b5cff[_0x373705(0x113)][_0x373705(0x119)]??null,'pageSize':_0x1b5cff['globalConfig'][_0x373705(0x10c)]??null,'riskLevel':_0x1b5cff[_0x373705(0x113)]['riskLevel']??null,'locale':_0x1b5cff['globalConfig'][_0x373705(0x12e)]??null});return _0x148cc9;}async function execute(_0x5add31){const _0x466987=a19_0x2d22,_0x22d2ba=_0x5add31[_0x466987(0x110)](_0x466987(0x12b)),_0x1e4446=_0x5add31[_0x466987(0x110)](_0x466987(0x121)),_0x190b8a=_0x22d2ba?_0x466987(0x12b):_0x1e4446?_0x466987(0x121):_0x466987(0x132),{config:_0x16d330,layers:_0x367b7a}=readRawConfigWithLayers(),_0x1323d9=resolveDefaultAppSource(_0x367b7a),{defaultApp:_0x5ef876}=_0x16d330;let _0x47a0fd,_0x315c38;switch(_0x190b8a){case _0x466987(0x12b):_0x47a0fd=buildItemsFromLayer(_0x367b7a[_0x466987(0x113)],'global'),_0x315c38=_0x367b7a[_0x466987(0x11b)];break;case _0x466987(0x121):_0x47a0fd=buildItemsFromLayer(_0x367b7a[_0x466987(0x12f)],_0x466987(0x121)),_0x315c38=_0x367b7a['projectPath'];break;default:_0x47a0fd=buildMergedItems(_0x16d330,_0x367b7a);break;}if(_0x47a0fd[_0x466987(0x136)]===0x0){const _0x106fe0=_0x190b8a===_0x466987(0x132)?'':_0x466987(0x11f)+_0x190b8a+_0x466987(0x131);return{'ok':!![],'data':[],'message':_0x466987(0x10a)+_0x106fe0+'.\x20Use\x20`'+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'};}const _0x347497=_0x47a0fd[_0x466987(0x10e)](_0x3da525=>_0x3da525[_0x466987(0x128)]===!![]),_0x4ca278=_0x5ef876??_0x347497?.[_0x466987(0x11e)]??null,_0x4c762b=_0x190b8a===_0x466987(0x132)?{'globalPath':_0x367b7a['globalPath']??null,'projectPath':_0x367b7a[_0x466987(0x12a)]??null,'defaultApp':_0x4ca278,'defaultAppSource':_0x5ef876!=null?_0x1323d9:null}:{'scope':_0x190b8a,'configPath':_0x315c38??null};return{'ok':!![],'data':{'items':_0x47a0fd,'meta':_0x4c762b}};}export const appListDefinition={'service':a19_0x249733(0x12d),'command':a19_0x249733(0x126),'description':'List\x20all\x20configured\x20apps','risk':a19_0x249733(0x108),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a19_0x249733(0x12b),'type':a19_0x249733(0x114),'description':'Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','default':![]},{'name':a19_0x249733(0x121),'type':a19_0x249733(0x114),'description':a19_0x249733(0x120),'default':![]}],'execute':execute};
1
+ const a21_0x301409=a21_0x3825;(function(_0x4841e9,_0x1321e8){const _0x371f51=a21_0x3825,_0x2ceeec=_0x4841e9();while(!![]){try{const _0x7ecdff=parseInt(_0x371f51(0x89))/0x1+-parseInt(_0x371f51(0x88))/0x2+parseInt(_0x371f51(0x78))/0x3+parseInt(_0x371f51(0x94))/0x4*(-parseInt(_0x371f51(0x80))/0x5)+parseInt(_0x371f51(0x83))/0x6+-parseInt(_0x371f51(0x8e))/0x7+-parseInt(_0x371f51(0x9a))/0x8;if(_0x7ecdff===_0x1321e8)break;else _0x2ceeec['push'](_0x2ceeec['shift']());}catch(_0x346a2){_0x2ceeec['push'](_0x2ceeec['shift']());}}}(a21_0xb4f3,0x9f587));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{buildAppProfileListFields}from'../../config/schema.js';function a21_0xb4f3(){const _0x3a2e80=['3575505vbQxRi','globalConfig','bool','project','read','push','No\x20apps\x20configured','boolean','235AwNxQu','isCurrent','\x20config','2916882gicIVr','list','mergedCli','appcode','find','1084824lxenkj','524055GrojXy','inherit','Show\x20only\x20apps\x20from\x20project\x20.rabetbase.json','globalPath','List\x20all\x20configured\x20apps','3839689AajlGJ','projectPath','global','length','.\x20Use\x20`','Show\x20only\x20apps\x20from\x20global\x20~/.rabetbase.json','38008CQYdyh','merged','defaultApp','object','projectConfig','apps','94600KTkOMW','entries','app','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.'];a21_0xb4f3=function(){return _0x3a2e80;};return a21_0xb4f3();}import{appDefinedIn,enrichAppListItemsWithMergedSelection,resolveDefaultAppSource}from'../../commands/app/shared.js';function buildItemsFromLayer(_0x4b3909,_0x4cef2b){const _0x14c4dd=a21_0x3825,_0x490d6e=[],_0x569492=_0x4b3909[_0x14c4dd(0x99)]&&typeof _0x4b3909['apps']===_0x14c4dd(0x97)?_0x4b3909['apps']:{},_0x5c9ba9=_0x4b3909[_0x14c4dd(0x96)]||undefined;for(const [_0x59dce8,_0x4fd5ed]of Object[_0x14c4dd(0x75)](_0x569492)){if(!_0x4fd5ed||typeof _0x4fd5ed!=='object'||!_0x4fd5ed[_0x14c4dd(0x86)])continue;_0x490d6e[_0x14c4dd(0x7d)]({'name':_0x59dce8,'appcode':_0x4fd5ed[_0x14c4dd(0x86)],'named':!![],'definedIn':_0x4cef2b,'isDefault':_0x59dce8===_0x5c9ba9,...buildAppProfileListFields(_0x4fd5ed)});}return _0x490d6e;}function a21_0x3825(_0x5b2632,_0x5ed6e7){_0x5b2632=_0x5b2632-0x75;const _0xb4f31c=a21_0xb4f3();let _0x3825c1=_0xb4f31c[_0x5b2632];return _0x3825c1;}function buildMergedItems(_0x11a14f,_0x5b311a){const _0x45daa0=a21_0x3825,{apps:apps={},defaultApp:_0x4c18c4}=_0x11a14f,_0x32ba91=_0x5b311a[_0x45daa0(0x79)][_0x45daa0(0x99)]&&typeof _0x5b311a[_0x45daa0(0x79)][_0x45daa0(0x99)]===_0x45daa0(0x97)?_0x5b311a[_0x45daa0(0x79)][_0x45daa0(0x99)]:{},_0x373436=_0x5b311a[_0x45daa0(0x98)][_0x45daa0(0x99)]&&typeof _0x5b311a['projectConfig'][_0x45daa0(0x99)]===_0x45daa0(0x97)?_0x5b311a[_0x45daa0(0x98)][_0x45daa0(0x99)]:{},_0x3d8eef=_0x5b311a[_0x45daa0(0x98)][_0x45daa0(0x8a)]===![],_0x53c1d4=Object[_0x45daa0(0x75)](apps),_0x5ed8cd=_0x53c1d4['map'](([_0x4e0e94,_0x3ff387])=>({'name':_0x4e0e94,'appcode':_0x3ff387[_0x45daa0(0x86)],'named':!![],'definedIn':appDefinedIn(_0x4e0e94,_0x32ba91,_0x373436,_0x3d8eef),'isDefault':_0x4e0e94===_0x4c18c4,...buildAppProfileListFields(_0x3ff387)}));return _0x5ed8cd;}async function execute(_0x3fc9d7){const _0x4151d0=a21_0x3825,_0x19fe2f=_0x3fc9d7[_0x4151d0(0x7a)](_0x4151d0(0x90)),_0x1c3055=_0x3fc9d7[_0x4151d0(0x7a)](_0x4151d0(0x7b)),_0x264ce8=_0x19fe2f?'global':_0x1c3055?'project':_0x4151d0(0x95),{config:_0x4ede41,layers:_0xcb5814}=readRawConfigWithLayers(),_0x30495a=resolveDefaultAppSource(_0xcb5814),{defaultApp:_0x30f50c}=_0x4ede41;let _0x28ac75,_0x558f45;switch(_0x264ce8){case _0x4151d0(0x90):_0x28ac75=buildItemsFromLayer(_0xcb5814['globalConfig'],_0x4151d0(0x90)),_0x558f45=_0xcb5814[_0x4151d0(0x8c)];break;case'project':_0x28ac75=buildItemsFromLayer(_0xcb5814[_0x4151d0(0x98)],_0x4151d0(0x7b)),_0x558f45=_0xcb5814[_0x4151d0(0x8f)];break;default:_0x28ac75=buildMergedItems(_0x4ede41,_0xcb5814);break;}enrichAppListItemsWithMergedSelection(_0x28ac75,_0x3fc9d7[_0x4151d0(0x85)]);if(_0x28ac75[_0x4151d0(0x91)]===0x0){const _0x22a632=_0x264ce8===_0x4151d0(0x95)?'':'\x20in\x20'+_0x264ce8+_0x4151d0(0x82);return{'ok':!![],'data':[],'message':_0x4151d0(0x7e)+_0x22a632+_0x4151d0(0x92)+CLI_BIN_NAME+_0x4151d0(0x77)};}const _0xb18d3=_0x28ac75[_0x4151d0(0x87)](_0x2d389e=>_0x2d389e[_0x4151d0(0x81)]===!![]),_0x30994d=_0x30f50c??_0xb18d3?.['appcode']??null,_0x26c47f=_0x264ce8===_0x4151d0(0x95)?{'globalPath':_0xcb5814[_0x4151d0(0x8c)]??null,'projectPath':_0xcb5814[_0x4151d0(0x8f)]??null,'defaultApp':_0x30994d,'defaultAppSource':_0x30f50c!=null?_0x30495a:null}:{'scope':_0x264ce8,'configPath':_0x558f45??null};return{'ok':!![],'data':{'items':_0x28ac75,'meta':_0x26c47f}};}export const appListDefinition={'service':a21_0x301409(0x76),'command':a21_0x301409(0x84),'description':a21_0x301409(0x8d),'risk':a21_0x301409(0x7c),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a21_0x301409(0x90),'type':'boolean','description':a21_0x301409(0x93),'default':![]},{'name':'project','type':a21_0x301409(0x7f),'description':a21_0x301409(0x8b),'default':![]}],'execute':execute};
@@ -1 +1 @@
1
- const a21_0x151656=a21_0x23c6;(function(_0x3b2c8b,_0x3480ba){const _0x232397=a21_0x23c6,_0x17e7bf=_0x3b2c8b();while(!![]){try{const _0x53741a=parseInt(_0x232397(0x1ef))/0x1*(parseInt(_0x232397(0x1fa))/0x2)+parseInt(_0x232397(0x200))/0x3+-parseInt(_0x232397(0x1eb))/0x4*(parseInt(_0x232397(0x206))/0x5)+-parseInt(_0x232397(0x1e9))/0x6*(parseInt(_0x232397(0x209))/0x7)+parseInt(_0x232397(0x1f9))/0x8*(parseInt(_0x232397(0x1fc))/0x9)+-parseInt(_0x232397(0x1f4))/0xa*(parseInt(_0x232397(0x1fb))/0xb)+-parseInt(_0x232397(0x1f5))/0xc;if(_0x53741a===_0x3480ba)break;else _0x17e7bf['push'](_0x17e7bf['shift']());}catch(_0x50713c){_0x17e7bf['push'](_0x17e7bf['shift']());}}}(a21_0x180f,0xe964a));function a21_0x23c6(_0x347eeb,_0x28bea4){_0x347eeb=_0x347eeb-0x1e3;const _0x180f36=a21_0x180f();let _0x23c67d=_0x180f36[_0x347eeb];return _0x23c67d;}import{CliErrors}from'../../errors.js';function a21_0x180f(){const _0x234dce=['projectConfig','app','Remove\x20an\x20app\x20from\x20config','18ZZsjcn','App\x20profile\x20name\x20to\x20remove','128eNQnSv','\x22\x20still\x20defined\x20in\x20','globalConfig','\x20config.','1POpPgp','global','keys','high-risk-write','validation','170GdsGKM','7075320bwcHeF','inherit','trim','Removed\x20app\x20\x22','162288ojoHEV','2771746xoHUiC','822481QzdmeK','801OGisgE','\x20Note:\x20app\x20\x22','name','\x20app\x20remove\x20<name>\x20[--global]','2213433KCAsPV','args','App\x20\x22','\x20Default\x20app\x20changed\x20to\x20\x22','object','remove','154315ylQqvg','apps','boolean','291263ZnughM','\x22\x20not\x20found.','project','length','defaultApp','Missing\x20app\x20name.'];a21_0x180f=function(){return _0x234dce;};return a21_0x180f();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x25b072){const _0x1e5a49=a21_0x23c6,_0x5dc392=_0x25b072[_0x1e5a49(0x201)][0x0]?.['trim']();if(!_0x5dc392)throw CliErrors['validation']('Missing\x20app\x20name.','Usage:\x20'+CLI_BIN_NAME+_0x1e5a49(0x1ff));}async function execute(_0x275474){const _0xa89401=a21_0x23c6,_0x6e4e2a=_0x275474[_0xa89401(0x201)][0x0]?.[_0xa89401(0x1f7)]();if(!_0x6e4e2a)throw CliErrors[_0xa89401(0x1f3)](_0xa89401(0x1e5),'Usage:\x20'+CLI_BIN_NAME+_0xa89401(0x1ff));const _0x3d94f8=_0x275474['bool'](_0xa89401(0x1f0)),{config:_0x12f6b4,layers:_0x21ad25}=readRawConfigWithLayers(),_0x86ed42=_0x12f6b4[_0xa89401(0x207)]??{};if(!_0x86ed42[_0x6e4e2a])throw CliErrors['validation'](_0xa89401(0x202)+_0x6e4e2a+_0xa89401(0x20a));const _0x307ce4=_0x21ad25[_0xa89401(0x1ed)][_0xa89401(0x207)]&&typeof _0x21ad25['globalConfig'][_0xa89401(0x207)]===_0xa89401(0x204)?_0x21ad25[_0xa89401(0x1ed)][_0xa89401(0x207)]:{},_0x2b72be=_0x21ad25['projectConfig'][_0xa89401(0x207)]&&typeof _0x21ad25['projectConfig'][_0xa89401(0x207)]==='object'?_0x21ad25[_0xa89401(0x1e6)]['apps']:{},_0x415e8=appDefinedIn(_0x6e4e2a,_0x307ce4,_0x2b72be,_0x21ad25[_0xa89401(0x1e6)][_0xa89401(0x1f6)]===![]),_0x391d31=resolveAppScopeForWrite(_0x6e4e2a,_0x3d94f8,_0x21ad25),_0x19ed0e={'global':_0x391d31===_0xa89401(0x1f0)},_0x378275=readConfig(_0x19ed0e),_0x18c2b3=_0x378275['apps'];if(!_0x18c2b3||!_0x18c2b3[_0x6e4e2a])throw CliErrors['validation'](_0xa89401(0x202)+_0x6e4e2a+_0xa89401(0x20a));delete _0x18c2b3[_0x6e4e2a];let _0x2c4f0e='';if(_0x378275[_0xa89401(0x1e4)]===_0x6e4e2a){const _0x596274=Object[_0xa89401(0x1f1)](_0x18c2b3);_0x378275[_0xa89401(0x1e4)]=_0x596274[_0xa89401(0x1e3)]>0x0?_0x596274[0x0]:undefined,_0x378275[_0xa89401(0x1e4)]?_0x2c4f0e=_0xa89401(0x203)+_0x378275[_0xa89401(0x1e4)]+'\x22.':delete _0x378275[_0xa89401(0x1e4)];}Object['keys'](_0x18c2b3)[_0xa89401(0x1e3)]===0x0&&(delete _0x378275[_0xa89401(0x207)],delete _0x378275['defaultApp']);writeConfig(_0x378275,_0x19ed0e);const _0xd708db=_0x415e8==='both'?_0xa89401(0x1fd)+_0x6e4e2a+_0xa89401(0x1ec)+(_0x391d31==='project'?_0xa89401(0x1f0):_0xa89401(0x20b))+_0xa89401(0x1ee):'';return{'ok':!![],'message':_0xa89401(0x1f8)+_0x6e4e2a+'\x22'+scopeLabel(_0x19ed0e)+'.'+_0x2c4f0e+_0xd708db};}export const appRemoveDefinition={'service':a21_0x151656(0x1e7),'command':a21_0x151656(0x205),'description':a21_0x151656(0x1e8),'risk':a21_0x151656(0x1f2),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a21_0x151656(0x1fe),'description':a21_0x151656(0x1ea),'required':!![]}],'flags':[{'name':a21_0x151656(0x1f0),'type':a21_0x151656(0x208),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a22_0x5a872b=a22_0x59fe;(function(_0x4e30fd,_0x380798){const _0x5aa125=a22_0x59fe,_0x3bdb6a=_0x4e30fd();while(!![]){try{const _0x4c6005=-parseInt(_0x5aa125(0x17d))/0x1*(-parseInt(_0x5aa125(0x16d))/0x2)+-parseInt(_0x5aa125(0x16b))/0x3*(-parseInt(_0x5aa125(0x188))/0x4)+parseInt(_0x5aa125(0x173))/0x5+parseInt(_0x5aa125(0x180))/0x6*(parseInt(_0x5aa125(0x17f))/0x7)+parseInt(_0x5aa125(0x16c))/0x8*(parseInt(_0x5aa125(0x181))/0x9)+parseInt(_0x5aa125(0x185))/0xa+parseInt(_0x5aa125(0x191))/0xb*(-parseInt(_0x5aa125(0x184))/0xc);if(_0x4c6005===_0x380798)break;else _0x3bdb6a['push'](_0x3bdb6a['shift']());}catch(_0x43fcd5){_0x3bdb6a['push'](_0x3bdb6a['shift']());}}}(a22_0x2809,0x4b185));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x572147){const _0x53f276=a22_0x59fe,_0x20d03e=_0x572147[_0x53f276(0x178)][0x0]?.[_0x53f276(0x17a)]();if(!_0x20d03e)throw CliErrors[_0x53f276(0x17c)](_0x53f276(0x18a),_0x53f276(0x16e)+CLI_BIN_NAME+_0x53f276(0x18f));}function a22_0x2809(){const _0xf9f07b=['7ldzIgi','62286oQoYRb','54pmJTmA','name','projectConfig','102156uzwWcw','5456630VFjEAa','boolean','defaultApp','381976ZyIDnJ','keys','Missing\x20app\x20name.','\x22\x20not\x20found.','\x20Note:\x20app\x20\x22','inherit','both','\x20app\x20remove\x20<name>\x20[--global]','bool','1199xSncfw','length','6JBZKLO','17128FcbkWe','78uoFJaD','Usage:\x20','global','Remove\x20an\x20app\x20from\x20config','\x20Default\x20app\x20changed\x20to\x20\x22','App\x20\x22','1103035GGnjiQ','project','globalConfig','remove','apps','args','App\x20profile\x20name\x20to\x20remove','trim','high-risk-write','validation','6539jYSZvQ','object'];a22_0x2809=function(){return _0xf9f07b;};return a22_0x2809();}function a22_0x59fe(_0x17c23d,_0x2cd75b){_0x17c23d=_0x17c23d-0x16b;const _0x2809ae=a22_0x2809();let _0x59fe13=_0x2809ae[_0x17c23d];return _0x59fe13;}async function execute(_0x1ef2d){const _0xb9fb79=a22_0x59fe,_0x60e8d3=_0x1ef2d[_0xb9fb79(0x178)][0x0]?.[_0xb9fb79(0x17a)]();if(!_0x60e8d3)throw CliErrors['validation']('Missing\x20app\x20name.',_0xb9fb79(0x16e)+CLI_BIN_NAME+_0xb9fb79(0x18f));const _0x277884=_0x1ef2d[_0xb9fb79(0x190)]('global'),{config:_0x2a5a7c,layers:_0x217086}=readRawConfigWithLayers(),_0x214335=_0x2a5a7c['apps']??{};if(!_0x214335[_0x60e8d3])throw CliErrors[_0xb9fb79(0x17c)](_0xb9fb79(0x172)+_0x60e8d3+_0xb9fb79(0x18b));const _0x2951b1=_0x217086[_0xb9fb79(0x175)][_0xb9fb79(0x177)]&&typeof _0x217086[_0xb9fb79(0x175)][_0xb9fb79(0x177)]===_0xb9fb79(0x17e)?_0x217086[_0xb9fb79(0x175)][_0xb9fb79(0x177)]:{},_0x67fe1c=_0x217086[_0xb9fb79(0x183)]['apps']&&typeof _0x217086[_0xb9fb79(0x183)][_0xb9fb79(0x177)]===_0xb9fb79(0x17e)?_0x217086['projectConfig']['apps']:{},_0x3e82a9=appDefinedIn(_0x60e8d3,_0x2951b1,_0x67fe1c,_0x217086[_0xb9fb79(0x183)][_0xb9fb79(0x18d)]===![]),_0xacdd4a=resolveAppScopeForWrite(_0x60e8d3,_0x277884,_0x217086),_0x3fec64={'global':_0xacdd4a===_0xb9fb79(0x16f)},_0xd39a56=readConfig(_0x3fec64),_0x3119d6=_0xd39a56['apps'];if(!_0x3119d6||!_0x3119d6[_0x60e8d3])throw CliErrors[_0xb9fb79(0x17c)]('App\x20\x22'+_0x60e8d3+_0xb9fb79(0x18b));delete _0x3119d6[_0x60e8d3];let _0x22a684='';if(_0xd39a56[_0xb9fb79(0x187)]===_0x60e8d3){const _0x3e9a5c=Object[_0xb9fb79(0x189)](_0x3119d6);_0xd39a56[_0xb9fb79(0x187)]=_0x3e9a5c[_0xb9fb79(0x192)]>0x0?_0x3e9a5c[0x0]:undefined,_0xd39a56[_0xb9fb79(0x187)]?_0x22a684=_0xb9fb79(0x171)+_0xd39a56[_0xb9fb79(0x187)]+'\x22.':delete _0xd39a56[_0xb9fb79(0x187)];}Object['keys'](_0x3119d6)[_0xb9fb79(0x192)]===0x0&&(delete _0xd39a56['apps'],delete _0xd39a56['defaultApp']);writeConfig(_0xd39a56,_0x3fec64);const _0x13dd26=_0x3e82a9===_0xb9fb79(0x18e)?_0xb9fb79(0x18c)+_0x60e8d3+'\x22\x20still\x20defined\x20in\x20'+(_0xacdd4a===_0xb9fb79(0x174)?'global':_0xb9fb79(0x174))+'\x20config.':'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x60e8d3+'\x22'+scopeLabel(_0x3fec64)+'.'+_0x22a684+_0x13dd26};}export const appRemoveDefinition={'service':'app','command':a22_0x5a872b(0x176),'description':a22_0x5a872b(0x170),'risk':a22_0x5a872b(0x17b),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a22_0x5a872b(0x182),'description':a22_0x5a872b(0x179),'required':!![]}],'flags':[{'name':a22_0x5a872b(0x16f),'type':a22_0x5a872b(0x186),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- (function(_0x32c13a,_0x1ad7ee){const _0x8ffb15=a22_0x15e9,_0x4cec90=_0x32c13a();while(!![]){try{const _0x1253ba=-parseInt(_0x8ffb15(0x17d))/0x1*(-parseInt(_0x8ffb15(0x197))/0x2)+parseInt(_0x8ffb15(0x188))/0x3+-parseInt(_0x8ffb15(0x192))/0x4*(parseInt(_0x8ffb15(0x181))/0x5)+-parseInt(_0x8ffb15(0x18c))/0x6*(parseInt(_0x8ffb15(0x175))/0x7)+parseInt(_0x8ffb15(0x18d))/0x8*(parseInt(_0x8ffb15(0x17b))/0x9)+-parseInt(_0x8ffb15(0x17f))/0xa*(-parseInt(_0x8ffb15(0x193))/0xb)+-parseInt(_0x8ffb15(0x18e))/0xc;if(_0x1253ba===_0x1ad7ee)break;else _0x4cec90['push'](_0x4cec90['shift']());}catch(_0xd32a9e){_0x4cec90['push'](_0x4cec90['shift']());}}}(a22_0x482a,0xb4958));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function resolveAppScopeForWrite(_0x4ecc2b,_0x5845ba,_0x508938){const _0x4461ad=a22_0x15e9;if(_0x5845ba)return _0x4461ad(0x194);const _0x3c9381=_0x508938[_0x4461ad(0x177)]['apps']&&typeof _0x508938[_0x4461ad(0x177)][_0x4461ad(0x184)]===_0x4461ad(0x182)?_0x508938['projectConfig'][_0x4461ad(0x184)]:{},_0x38915e=_0x508938['globalConfig'][_0x4461ad(0x184)]&&typeof _0x508938[_0x4461ad(0x190)][_0x4461ad(0x184)]===_0x4461ad(0x182)?_0x508938[_0x4461ad(0x190)][_0x4461ad(0x184)]:{};if(Object[_0x4461ad(0x191)][_0x4461ad(0x180)]['call'](_0x3c9381,_0x4ecc2b))return'project';if(Object[_0x4461ad(0x191)][_0x4461ad(0x180)][_0x4461ad(0x17a)](_0x38915e,_0x4ecc2b))return'global';return _0x4461ad(0x186);}function a22_0x482a(){const _0x4357a5=['\x20(global)','8xFizbt','cookie','7VixjQn','accessKey','projectConfig','apiDir','appcode','call','4379283LIMFXo','riskLevel','152736tiLtZA','inherit','4389890kSxMFQ','hasOwnProperty','25660tsiAzE','object','both','apps','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','project','env','1105062TIHwHq','Migrated\x20existing\x20app\x20\x22','app','format','6367692UmdDJP','8nZRehX','9812088YpfHMt','length','globalConfig','prototype','128FJqULf','33KsMbEA','global','defaultApp'];a22_0x482a=function(){return _0x4357a5;};return a22_0x482a();}export function appDefinedIn(_0x22facc,_0x293b5e,_0x51d9ad,_0x4994a9){const _0x2beb2a=a22_0x15e9;if(_0x4994a9)return Object[_0x2beb2a(0x191)][_0x2beb2a(0x180)][_0x2beb2a(0x17a)](_0x51d9ad,_0x22facc)?_0x2beb2a(0x186):_0x2beb2a(0x194);const _0x2f506f=Object[_0x2beb2a(0x191)][_0x2beb2a(0x180)][_0x2beb2a(0x17a)](_0x293b5e,_0x22facc),_0x5aff0b=Object[_0x2beb2a(0x191)][_0x2beb2a(0x180)][_0x2beb2a(0x17a)](_0x51d9ad,_0x22facc);if(_0x2f506f&&_0x5aff0b)return _0x2beb2a(0x183);if(_0x5aff0b)return _0x2beb2a(0x186);return _0x2beb2a(0x194);}function a22_0x15e9(_0x434883,_0x538205){_0x434883=_0x434883-0x175;const _0x482a57=a22_0x482a();let _0x15e906=_0x482a57[_0x434883];return _0x15e906;}export function resolveDefaultAppSource(_0x12d3ec){const _0x730ff6=a22_0x15e9,_0x357911=_0x12d3ec[_0x730ff6(0x177)][_0x730ff6(0x184)]&&typeof _0x12d3ec[_0x730ff6(0x177)][_0x730ff6(0x184)]==='object'?_0x12d3ec[_0x730ff6(0x177)][_0x730ff6(0x184)]:{};if(_0x730ff6(0x195)in _0x12d3ec[_0x730ff6(0x177)])return'project';if(Object['keys'](_0x357911)[_0x730ff6(0x18f)]>0x0)return'project';if(_0x12d3ec[_0x730ff6(0x177)][_0x730ff6(0x17e)]===![])return null;if(_0x12d3ec[_0x730ff6(0x190)][_0x730ff6(0x195)])return'global';return null;}export function getConfigPath(_0x5d12bf={}){const _0x594be6=a22_0x15e9,_0x5e6ffd=_0x5d12bf[_0x594be6(0x194)]?_0x594be6(0x194):_0x594be6(0x186);return resolveWriteConfigPath(_0x5e6ffd);}export function readConfig(_0x35a014={}){return readConfigFile(getConfigPath(_0x35a014));}export function writeConfig(_0x24ac75,_0x1a8d94={}){writeConfigFile(getConfigPath(_0x1a8d94),_0x24ac75);}export function scopeLabel(_0x28ec21){const _0x3faf37=a22_0x15e9;return _0x28ec21['global']?_0x3faf37(0x196):'';}export function migrateLegacySingleApp(_0x1ef686,_0x4ae705){const _0x343a2e=a22_0x15e9,_0x20bfb5=_0x1ef686[_0x343a2e(0x179)]||_0x1ef686[_0x343a2e(0x18a)];if(!_0x20bfb5)return undefined;const _0x276cdb=String(_0x20bfb5);if(_0x276cdb===_0x4ae705)return undefined;const _0x526bff=[_0x343a2e(0x187),_0x343a2e(0x178),_0x343a2e(0x198),_0x343a2e(0x176),_0x343a2e(0x18b),'pageSize',_0x343a2e(0x17c),'locale'],_0xc724e3={'appcode':_0x20bfb5};for(const _0xfc68a4 of _0x526bff){if(_0x1ef686[_0xfc68a4]!=null)_0xc724e3[_0xfc68a4]=_0x1ef686[_0xfc68a4];}return _0x1ef686[_0x343a2e(0x184)][_0x276cdb]=_0xc724e3,_0x1ef686['defaultApp']=_0x276cdb,delete _0x1ef686[_0x343a2e(0x179)],delete _0x1ef686['app'],_0x343a2e(0x189)+_0x276cdb+_0x343a2e(0x185);}
1
+ function a23_0x193a(_0x1c59b0,_0x4b19bb){_0x1c59b0=_0x1c59b0-0x189;const _0x143770=a23_0x1437();let _0x193ab7=_0x143770[_0x1c59b0];return _0x193ab7;}(function(_0x108921,_0x3790ec){const _0x350aac=a23_0x193a,_0x356155=_0x108921();while(!![]){try{const _0x8fbee5=parseInt(_0x350aac(0x18c))/0x1*(-parseInt(_0x350aac(0x1a3))/0x2)+parseInt(_0x350aac(0x193))/0x3*(-parseInt(_0x350aac(0x196))/0x4)+parseInt(_0x350aac(0x19b))/0x5+-parseInt(_0x350aac(0x192))/0x6+parseInt(_0x350aac(0x1a6))/0x7+-parseInt(_0x350aac(0x18b))/0x8+-parseInt(_0x350aac(0x194))/0x9*(-parseInt(_0x350aac(0x189))/0xa);if(_0x8fbee5===_0x3790ec)break;else _0x356155['push'](_0x356155['shift']());}catch(_0x257d6d){_0x356155['push'](_0x356155['shift']());}}}(a23_0x1437,0xb49d9));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function enrichAppListItemsWithMergedSelection(_0x251a44,_0x2a6992){const _0x877485=a23_0x193a;if(!_0x2a6992)return;const _0x334b0c=_0x2a6992['apps']&&typeof _0x2a6992['apps']===_0x877485(0x1a1)?_0x2a6992[_0x877485(0x18d)]:{},_0x13ca53=Object[_0x877485(0x19e)](_0x334b0c)[_0x877485(0x19d)]>0x0;for(const _0x4a38e7 of _0x251a44){_0x4a38e7[_0x877485(0x18e)]=![];}const _0x4a6a60=_0x2a6992[_0x877485(0x19c)]!=null?String(_0x2a6992['appCode'])['trim']():'';if(_0x13ca53){const _0x1d1cb2=_0x2a6992[_0x877485(0x1a4)]??_0x2a6992[_0x877485(0x199)];if(_0x1d1cb2)for(const _0x263691 of _0x251a44){_0x263691['named']===!![]&&_0x263691[_0x877485(0x195)]===_0x1d1cb2&&(_0x263691[_0x877485(0x18e)]=!![]);}for(const _0x531973 of _0x251a44){if(_0x531973[_0x877485(0x19f)]!==![])continue;if(_0x2a6992[_0x877485(0x199)])continue;_0x4a6a60&&String(_0x531973['appcode']??'')[_0x877485(0x197)]()===_0x4a6a60&&(_0x531973[_0x877485(0x18e)]=!![]);}return;}if(!_0x4a6a60)return;for(const _0x4a7668 of _0x251a44){String(_0x4a7668['appcode']??'')['trim']()===_0x4a6a60&&(_0x4a7668['isCurrent']=!![]);}}export function resolveAppScopeForWrite(_0x1880eb,_0x1972cf,_0x17a881){const _0x406f24=a23_0x193a;if(_0x1972cf)return _0x406f24(0x191);const _0x49090c=_0x17a881[_0x406f24(0x18f)][_0x406f24(0x18d)]&&typeof _0x17a881[_0x406f24(0x18f)][_0x406f24(0x18d)]===_0x406f24(0x1a1)?_0x17a881[_0x406f24(0x18f)]['apps']:{},_0x4976f9=_0x17a881[_0x406f24(0x1a5)]['apps']&&typeof _0x17a881[_0x406f24(0x1a5)][_0x406f24(0x18d)]===_0x406f24(0x1a1)?_0x17a881[_0x406f24(0x1a5)][_0x406f24(0x18d)]:{};if(Object[_0x406f24(0x190)][_0x406f24(0x1a2)][_0x406f24(0x19a)](_0x49090c,_0x1880eb))return _0x406f24(0x18a);if(Object[_0x406f24(0x190)][_0x406f24(0x1a2)]['call'](_0x4976f9,_0x1880eb))return _0x406f24(0x191);return _0x406f24(0x18a);}export function appDefinedIn(_0x424b55,_0x1ee72f,_0x1d4e17,_0x19ed68){const _0x56b486=a23_0x193a;if(_0x19ed68)return Object[_0x56b486(0x190)]['hasOwnProperty'][_0x56b486(0x19a)](_0x1d4e17,_0x424b55)?_0x56b486(0x18a):_0x56b486(0x191);const _0x2facf7=Object[_0x56b486(0x190)][_0x56b486(0x1a2)][_0x56b486(0x19a)](_0x1ee72f,_0x424b55),_0x3b6f7a=Object[_0x56b486(0x190)][_0x56b486(0x1a2)][_0x56b486(0x19a)](_0x1d4e17,_0x424b55);if(_0x2facf7&&_0x3b6f7a)return _0x56b486(0x198);if(_0x3b6f7a)return'project';return _0x56b486(0x191);}export function resolveDefaultAppSource(_0x73622f){const _0x402b65=a23_0x193a,_0x2fc62f=_0x73622f[_0x402b65(0x18f)][_0x402b65(0x18d)]&&typeof _0x73622f[_0x402b65(0x18f)][_0x402b65(0x18d)]===_0x402b65(0x1a1)?_0x73622f[_0x402b65(0x18f)][_0x402b65(0x18d)]:{};if(_0x402b65(0x199)in _0x73622f[_0x402b65(0x18f)])return _0x402b65(0x18a);if(Object[_0x402b65(0x19e)](_0x2fc62f)['length']>0x0)return _0x402b65(0x18a);if(_0x73622f['projectConfig']['inherit']===![])return null;if(_0x73622f[_0x402b65(0x1a5)][_0x402b65(0x199)])return _0x402b65(0x191);return null;}export function getConfigPath(_0xaba55={}){const _0x2c07ba=a23_0x193a,_0x21dd11=_0xaba55[_0x2c07ba(0x191)]?_0x2c07ba(0x191):'project';return resolveWriteConfigPath(_0x21dd11);}function a23_0x1437(){const _0x52e750=['object','hasOwnProperty','2HfoFHN','currentApp','globalConfig','5510064YhotkR','8671550KlhauC','project','5835560EGlgOq','469438SMGeVi','apps','isCurrent','projectConfig','prototype','global','1301100mdDAXY','9borVXw','9ORrDCF','name','329716anhDOw','trim','both','defaultApp','call','3742570hCnOjv','appCode','length','keys','named','\x20(global)'];a23_0x1437=function(){return _0x52e750;};return a23_0x1437();}export function readConfig(_0x3f390f={}){return readConfigFile(getConfigPath(_0x3f390f));}export function writeConfig(_0x53c923,_0x15bc8f={}){writeConfigFile(getConfigPath(_0x15bc8f),_0x53c923);}export function scopeLabel(_0x252395){const _0x36041f=a23_0x193a;return _0x252395[_0x36041f(0x191)]?_0x36041f(0x1a0):'';}
@@ -1 +1 @@
1
- const a23_0x43f764=a23_0x35cf;(function(_0x191b6a,_0x1ce3ce){const _0x5105e9=a23_0x35cf,_0x48e9a7=_0x191b6a();while(!![]){try{const _0x56718e=parseInt(_0x5105e9(0x20f))/0x1+-parseInt(_0x5105e9(0x200))/0x2+-parseInt(_0x5105e9(0x1fa))/0x3*(parseInt(_0x5105e9(0x204))/0x4)+parseInt(_0x5105e9(0x203))/0x5*(parseInt(_0x5105e9(0x1fe))/0x6)+-parseInt(_0x5105e9(0x208))/0x7+parseInt(_0x5105e9(0x20a))/0x8*(parseInt(_0x5105e9(0x1fb))/0x9)+parseInt(_0x5105e9(0x1f2))/0xa;if(_0x56718e===_0x1ce3ce)break;else _0x48e9a7['push'](_0x48e9a7['shift']());}catch(_0x1c1ace){_0x48e9a7['push'](_0x48e9a7['shift']());}}}(a23_0x5453,0x74223));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a23_0x35cf(_0x3fe31c,_0x510aa2){_0x3fe31c=_0x3fe31c-0x1f2;const _0x5453c7=a23_0x5453();let _0x35cff6=_0x5453c7[_0x3fe31c];return _0x35cff6;}function a23_0x5453(){const _0x5b4bd1=['join','Use\x20`','Available:\x20','3597DfVIsp','459sSawcz','args','keys','4776mwTCnW','\x22\x20(appcode:\x20','864784oUIJUd','global','\x20app\x20use\x20<name>\x20[--global]','765JgsDdp','2028FqttwT','\x20app\x20add\x20','use','Default\x20app\x20set\x20to\x20\x22','764540ZntyZc','App\x20profile\x20name\x20to\x20activate','23728SaNbMU','App\x20\x22','Usage:\x20','appcode','Missing\x20app\x20name.','470988AnrNNa','\x20--appcode\x20<code>`\x20first.','validation','apps','8811460zvpNCy','bool','trim','\x22\x20not\x20found.','write'];a23_0x5453=function(){return _0x5b4bd1;};return a23_0x5453();}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite}from'../../commands/app/shared.js';async function validateArgs(_0x59dd68){const _0xf44ad3=a23_0x35cf,_0x4e5be1=_0x59dd68['args'][0x0]?.[_0xf44ad3(0x1f4)]();if(!_0x4e5be1)throw CliErrors[_0xf44ad3(0x211)](_0xf44ad3(0x20e),_0xf44ad3(0x20c)+CLI_BIN_NAME+_0xf44ad3(0x202));}async function execute(_0x45b753){const _0xa54ec6=a23_0x35cf,_0x3114e0=_0x45b753[_0xa54ec6(0x1fc)][0x0]?.[_0xa54ec6(0x1f4)]();if(!_0x3114e0)throw CliErrors[_0xa54ec6(0x211)](_0xa54ec6(0x20e),_0xa54ec6(0x20c)+CLI_BIN_NAME+_0xa54ec6(0x202));const _0x2732a0=_0x45b753[_0xa54ec6(0x1f3)](_0xa54ec6(0x201)),{config:_0x418ac,layers:_0x30458f}=readRawConfigWithLayers(),_0x46da88=_0x418ac[_0xa54ec6(0x212)]??{};if(!_0x46da88[_0x3114e0]){const _0x286a32=Object[_0xa54ec6(0x1fd)](_0x46da88),_0x2592ee=_0x286a32['length']===0x0?_0xa54ec6(0x1f8)+CLI_BIN_NAME+_0xa54ec6(0x205)+_0x3114e0+_0xa54ec6(0x210):_0xa54ec6(0x1f9)+_0x286a32[_0xa54ec6(0x1f7)](',\x20');throw CliErrors['validation'](_0xa54ec6(0x20b)+_0x3114e0+_0xa54ec6(0x1f5),_0x2592ee);}const _0x487694=resolveAppScopeForWrite(_0x3114e0,_0x2732a0,_0x30458f),_0x3c1ab6={'global':_0x487694==='global'},_0x1fe2dd=readConfig(_0x3c1ab6);return _0x1fe2dd['defaultApp']=_0x3114e0,writeConfig(_0x1fe2dd,_0x3c1ab6),{'ok':!![],'message':_0xa54ec6(0x207)+_0x3114e0+_0xa54ec6(0x1ff)+_0x46da88[_0x3114e0][_0xa54ec6(0x20d)]+')'+scopeLabel(_0x3c1ab6)};}export const appUseDefinition={'service':'app','command':a23_0x43f764(0x206),'description':'Switch\x20the\x20default\x20app','risk':a23_0x43f764(0x1f6),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':'name','description':a23_0x43f764(0x209),'required':!![]}],'flags':[{'name':a23_0x43f764(0x201),'type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a24_0x35568d=a24_0x3df8;function a24_0xb088(){const _0x2e0bfb=['bool','join','trim','Use\x20global\x20config\x20scope','Missing\x20app\x20name.','\x22\x20not\x20found.','760ksxneA','204QrhfMN','2SkmdnN','21644130DbklMZ','call','6783609GqIbmX','Default\x20app\x20set\x20to\x20\x22','3793311nPFQrE','boolean','global','\x22\x20(appcode:\x20','1485097nNjMaI','64215hKurVd','\x20--appcode\x20<code>`\x20first.','app','apps','Usage:\x20','name','140823lONLgm','11bbhhTY','\x20app\x20add\x20','9456570BIyPnV','App\x20\x22','object','args','validation','hasOwnProperty','Switch\x20the\x20default\x20app','\x20app\x20use\x20<name>\x20[--global]','defaultApp','projectPath','projectConfig'];a24_0xb088=function(){return _0x2e0bfb;};return a24_0xb088();}(function(_0x48203c,_0x488fb3){const _0x4f5140=a24_0x3df8,_0x1d80b8=_0x48203c();while(!![]){try{const _0x13754a=-parseInt(_0x4f5140(0x1a8))/0x1*(-parseInt(_0x4f5140(0x1c5))/0x2)+parseInt(_0x4f5140(0x1a4))/0x3+parseInt(_0x4f5140(0x1c4))/0x4*(-parseInt(_0x4f5140(0x1a9))/0x5)+-parseInt(_0x4f5140(0x1b2))/0x6+parseInt(_0x4f5140(0x1a2))/0x7+-parseInt(_0x4f5140(0x1c3))/0x8*(-parseInt(_0x4f5140(0x1af))/0x9)+-parseInt(_0x4f5140(0x1c6))/0xa*(parseInt(_0x4f5140(0x1b0))/0xb);if(_0x13754a===_0x488fb3)break;else _0x1d80b8['push'](_0x1d80b8['shift']());}catch(_0x1ca6c2){_0x1d80b8['push'](_0x1d80b8['shift']());}}}(a24_0xb088,0xc5a71));import{CliErrors}from'../../errors.js';function a24_0x3df8(_0x11c775,_0x4a5403){_0x11c775=_0x11c775-0x1a1;const _0xb0881e=a24_0xb088();let _0x3df8dc=_0xb0881e[_0x11c775];return _0x3df8dc;}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(_0x330095){const _0x5b033f=a24_0x3df8,_0x3ed12d=_0x330095[_0x5b033f(0x1b5)][0x0]?.[_0x5b033f(0x1bf)]();if(!_0x3ed12d)throw CliErrors[_0x5b033f(0x1b6)]('Missing\x20app\x20name.',_0x5b033f(0x1ad)+CLI_BIN_NAME+'\x20app\x20use\x20<name>\x20[--global]');}async function execute(_0x2c30a4){const _0x334024=a24_0x3df8,_0x13c804=_0x2c30a4['args'][0x0]?.[_0x334024(0x1bf)]();if(!_0x13c804)throw CliErrors['validation'](_0x334024(0x1c1),_0x334024(0x1ad)+CLI_BIN_NAME+_0x334024(0x1b9));const _0x43d566=_0x2c30a4[_0x334024(0x1bd)]('global'),{config:_0x4ea56c,layers:_0x12207a}=readRawConfigWithLayers(),_0x77582f=_0x4ea56c[_0x334024(0x1ac)]??{};if(!_0x77582f[_0x13c804]){const _0x4952f6=Object['keys'](_0x77582f),_0x93aa2e=_0x4952f6['length']===0x0?'Use\x20`'+CLI_BIN_NAME+_0x334024(0x1b1)+_0x13c804+_0x334024(0x1aa):'Available:\x20'+_0x4952f6[_0x334024(0x1be)](',\x20');throw CliErrors[_0x334024(0x1b6)](_0x334024(0x1b3)+_0x13c804+_0x334024(0x1c2),_0x93aa2e);}let _0x113792,_0x43443c='';if(_0x43d566)_0x113792={'global':!![]};else{const _0x46689b=isInProject()&&!!_0x12207a[_0x334024(0x1bb)];_0x113792={'global':!_0x46689b};if(_0x46689b){const _0x55f0b2=_0x12207a[_0x334024(0x1bc)][_0x334024(0x1ac)]&&typeof _0x12207a[_0x334024(0x1bc)][_0x334024(0x1ac)]===_0x334024(0x1b4)?_0x12207a[_0x334024(0x1bc)][_0x334024(0x1ac)]:{};!Object['prototype'][_0x334024(0x1b7)][_0x334024(0x1a1)](_0x55f0b2,_0x13c804)&&(_0x43443c='\x0aNote:\x20\x22'+_0x13c804+'\x22\x20is\x20defined\x20in\x20global\x20config;\x20defaultApp\x20written\x20to\x20project\x20to\x20take\x20effect\x20in\x20merged\x20view.');}}const _0x4dd108=readConfig(_0x113792);return _0x4dd108[_0x334024(0x1ba)]=_0x13c804,writeConfig(_0x4dd108,_0x113792),{'ok':!![],'message':_0x334024(0x1a3)+_0x13c804+_0x334024(0x1a7)+_0x77582f[_0x13c804]['appcode']+')'+scopeLabel(_0x113792)+_0x43443c};}export const appUseDefinition={'service':a24_0x35568d(0x1ab),'command':'use','description':a24_0x35568d(0x1b8),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a24_0x35568d(0x1ae),'description':'App\x20profile\x20name\x20to\x20activate','required':!![]}],'flags':[{'name':a24_0x35568d(0x1a6),'type':a24_0x35568d(0x1a5),'description':a24_0x35568d(0x1c0),'default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- function a24_0x28b2(){const _0x335a78=['logout','78AUnOWs','Login\x20via\x20browser','5882984RoPpfN','1287453LSkVXM','login','!\x20Not\x20logged\x20in','auth','7494710KmxlCD','log','7479351OGTRRz','14ssbBgv','read','✓\x20Logged\x20out','154555UDMVsc','3731eOmKje','Clear\x20login\x20session','9YzQZZX','690132spJPrF','4ENOKLq','write'];a24_0x28b2=function(){return _0x335a78;};return a24_0x28b2();}const a24_0x3e945b=a24_0x3413;function a24_0x3413(_0x418536,_0xfb9bd5){_0x418536=_0x418536-0x149;const _0x28b2ae=a24_0x28b2();let _0x3413da=_0x28b2ae[_0x418536];return _0x3413da;}(function(_0x3649df,_0x3870f9){const _0x380e53=a24_0x3413,_0x4646dd=_0x3649df();while(!![]){try{const _0x29790b=parseInt(_0x380e53(0x15a))/0x1*(-parseInt(_0x380e53(0x14c))/0x2)+-parseInt(_0x380e53(0x14f))/0x3+-parseInt(_0x380e53(0x149))/0x4*(-parseInt(_0x380e53(0x159))/0x5)+-parseInt(_0x380e53(0x15d))/0x6*(-parseInt(_0x380e53(0x156))/0x7)+-parseInt(_0x380e53(0x14e))/0x8+parseInt(_0x380e53(0x15c))/0x9*(parseInt(_0x380e53(0x153))/0xa)+parseInt(_0x380e53(0x155))/0xb;if(_0x29790b===_0x3870f9)break;else _0x4646dd['push'](_0x4646dd['shift']());}catch(_0x5b5301){_0x4646dd['push'](_0x4646dd['shift']());}}}(a24_0x28b2,0x5cdae));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a24_0x3e945b(0x152),'command':a24_0x3e945b(0x150),'description':a24_0x3e945b(0x14d),'risk':a24_0x3e945b(0x157),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1c91d8){const {runAuthServer:_0x4284cf}=await import('../../auth/auth-server-ui.js');return await _0x4284cf(),{'ok':!![]};}},{'service':'auth','command':a24_0x3e945b(0x14b),'description':a24_0x3e945b(0x15b),'risk':a24_0x3e945b(0x14a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4b5395){const _0x29031b=a24_0x3e945b;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x29031b(0x154)](_0x29031b(0x158))):console[_0x29031b(0x154)](_0x29031b(0x151)),{'ok':!![]};}}];
1
+ function a25_0x3a29(_0x30549a,_0x2509b8){_0x30549a=_0x30549a-0x1c7;const _0x52c1f0=a25_0x52c1();let _0x3a2976=_0x52c1f0[_0x30549a];return _0x3a2976;}const a25_0x4e1ae2=a25_0x3a29;function a25_0x52c1(){const _0x502c71=['Clear\x20login\x20session','../../auth/auth-server-ui.js','10814376dNsOTA','auth','6686870UQGyCT','login','18JNZGPN','597651QkXSNA','2321235yjwMJm','385076zQfdLm','25dzxEyB','308694YpQHXx','logout','7563000KPGPhs','write','Login\x20via\x20browser','4wjNAlP'];a25_0x52c1=function(){return _0x502c71;};return a25_0x52c1();}(function(_0x456f05,_0x1b351a){const _0x1a83db=a25_0x3a29,_0x49e64b=_0x456f05();while(!![]){try{const _0x3134bd=-parseInt(_0x1a83db(0x1c8))/0x1+-parseInt(_0x1a83db(0x1d1))/0x2*(-parseInt(_0x1a83db(0x1cc))/0x3)+parseInt(_0x1a83db(0x1ca))/0x4*(-parseInt(_0x1a83db(0x1cb))/0x5)+parseInt(_0x1a83db(0x1ce))/0x6+parseInt(_0x1a83db(0x1c9))/0x7+-parseInt(_0x1a83db(0x1d4))/0x8+-parseInt(_0x1a83db(0x1c7))/0x9*(-parseInt(_0x1a83db(0x1d6))/0xa);if(_0x3134bd===_0x1b351a)break;else _0x49e64b['push'](_0x49e64b['shift']());}catch(_0x1bf466){_0x49e64b['push'](_0x49e64b['shift']());}}}(a25_0x52c1,0xabfe2));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a25_0x4e1ae2(0x1d5),'command':a25_0x4e1ae2(0x1d7),'description':a25_0x4e1ae2(0x1d0),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x157a15){const _0x6e393=a25_0x4e1ae2,{runAuthServer:_0x24fd6b}=await import(_0x6e393(0x1d3));return await _0x24fd6b(),{'ok':!![]};}},{'service':a25_0x4e1ae2(0x1d5),'command':a25_0x4e1ae2(0x1cd),'description':a25_0x4e1ae2(0x1d2),'risk':a25_0x4e1ae2(0x1cf),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4f3b3d){return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console['log']('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a25_0xe182f1=a25_0x5056;(function(_0xb829fd,_0x1fc9e3){const _0x778623=a25_0x5056,_0xd83d84=_0xb829fd();while(!![]){try{const _0x254ac6=parseInt(_0x778623(0x1c4))/0x1*(-parseInt(_0x778623(0x1b9))/0x2)+-parseInt(_0x778623(0x1a9))/0x3*(parseInt(_0x778623(0x1ca))/0x4)+parseInt(_0x778623(0x1d6))/0x5*(-parseInt(_0x778623(0x1b2))/0x6)+parseInt(_0x778623(0x1ad))/0x7*(parseInt(_0x778623(0x1b0))/0x8)+parseInt(_0x778623(0x1d5))/0x9+parseInt(_0x778623(0x1be))/0xa+parseInt(_0x778623(0x1c0))/0xb*(parseInt(_0x778623(0x1bb))/0xc);if(_0x254ac6===_0x1fc9e3)break;else _0xd83d84['push'](_0xd83d84['shift']());}catch(_0xecc97b){_0xd83d84['push'](_0xd83d84['shift']());}}}(a25_0x3258,0xb1eaf));function a25_0x5056(_0x2fd54a,_0x971c3d){_0x2fd54a=_0x2fd54a-0x1a4;const _0x32583b=a25_0x3258();let _0x505631=_0x32583b[_0x2fd54a];return _0x505631;}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a25_0x3258(){const _0x39aa48=['functions','12UsOeWY','delete','lastSync','7592880SWHnnY','projectRoot','14107643PPOgKK','join','remoteId','str','2qIFTEj','map','Function\x20not\x20found:\x20','lockFilePath','keys','POST','4csrSBa','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','Deleted\x20','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','filter','/api/management/library/scripts/delete','No\x20lock\x20entry\x20found\x20for\x20\x22','<timestamp>','\x20\x20-\x20','string','\x20(local\x20file\x20moved\x20to\x20trash)','9497754nzPiSW','3045aMARMw','scriptsRoot','toISOString','validation','target','BFF\x20lock\x20file\x20not\x20found.','3092682UpCQKS','Multiple\x20functions\x20match\x20\x22','high-risk-write','startsWith','663901prNTuy','appCode','length','72VNraek','scriptsRootDir','11658nCRnVf','includes','bff','find','trashDir','split','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','1007762IfvskI'];a25_0x3258=function(){return _0x39aa48;};return a25_0x3258();}import{CliErrors}from'../../errors.js';export const bffDelete={'service':a25_0xe182f1(0x1b4),'command':a25_0xe182f1(0x1bc),'description':'Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','risk':a25_0xe182f1(0x1ab),'flags':[{'name':'target','type':a25_0xe182f1(0x1d3),'required':!![],'description':a25_0xe182f1(0x1cd)}],async 'validate'(_0x50ef96){const _0x3d26ab=a25_0xe182f1,_0x102372=loadBffProjectConfig(_0x50ef96['appCode']),_0x363c0f=await readBffLockFile(_0x102372[_0x3d26ab(0x1c7)]);if(!_0x363c0f)throw CliErrors[_0x3d26ab(0x1a6)]('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x50af1e){const _0x466779=a25_0xe182f1,_0x2f8670=loadBffProjectConfig(_0x50af1e['appCode']),_0x22121d=await readBffLockFile(_0x2f8670[_0x466779(0x1c7)]);if(!_0x22121d)throw CliErrors['validation'](_0x466779(0x1a8));const {appLock:_0x3be8b3}=ensureLockScope(_0x22121d,_0x50af1e[_0x466779(0x1ae)],_0x2f8670[_0x466779(0x1a4)],'delete'),_0x74dd91=_0x50af1e[_0x466779(0x1c3)](_0x466779(0x1a7)),_0x34b4ae=Object[_0x466779(0x1c8)](_0x3be8b3[_0x466779(0x1ba)]),_0x36e9e2=resolveDeleteTarget(_0x74dd91,_0x34b4ae),_0x401677=_0x3be8b3[_0x466779(0x1ba)][_0x36e9e2];if(!_0x401677)throw CliErrors[_0x466779(0x1a6)](_0x466779(0x1d0)+_0x36e9e2+'\x22.');const _0x447560=resolveLocalFilePathFromLockKey(_0x2f8670,_0x36e9e2),_0xae037f=relative(_0x2f8670[_0x466779(0x1bf)],_0x447560),_0xbaaad3=join(_0x2f8670[_0x466779(0x1b6)],_0x466779(0x1d1),_0xae037f);return{'method':_0x466779(0x1c9),'url':_0x466779(0x1cf),'body':{'appCode':_0x50af1e[_0x466779(0x1ae)],'target':_0x36e9e2,'remoteId':_0x401677[_0x466779(0x1c2)],'localFilePath':_0x447560,'trashedPath':_0xbaaad3},'description':'Would\x20delete\x20'+_0x36e9e2+_0x466779(0x1b8)};},async 'execute'(_0x52cb98){const _0x1e340b=a25_0xe182f1,_0x34bc94=loadBffProjectConfig(_0x52cb98[_0x1e340b(0x1ae)]),_0x4b5ded=await readBffLockFile(_0x34bc94[_0x1e340b(0x1c7)]);if(!_0x4b5ded)throw CliErrors[_0x1e340b(0x1a6)](_0x1e340b(0x1a8));const {lockData:_0x4c8b22,appLock:_0x4eb797}=ensureLockScope(_0x4b5ded,_0x52cb98[_0x1e340b(0x1ae)],_0x34bc94[_0x1e340b(0x1a4)],'delete'),_0x10c599=_0x52cb98[_0x1e340b(0x1c3)](_0x1e340b(0x1a7)),_0x88b7e1=Object['keys'](_0x4eb797['functions']),_0x565469=resolveDeleteTarget(_0x10c599,_0x88b7e1),_0x4bdda6=_0x4eb797[_0x1e340b(0x1ba)][_0x565469];if(!_0x4bdda6)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x565469+'\x22.');await deleteBffScript(_0x4bdda6[_0x1e340b(0x1c2)]),delete _0x4eb797[_0x1e340b(0x1ba)][_0x565469],_0x4eb797[_0x1e340b(0x1bd)]=new Date()[_0x1e340b(0x1a5)](),await writeBffLockFile(_0x34bc94[_0x1e340b(0x1c7)],_0x4c8b22);const _0x126c1f=resolveLocalFilePathFromLockKey(_0x34bc94,_0x565469);let _0x30bff4;await fileExists(_0x126c1f)&&(_0x30bff4=await moveToTrash(_0x34bc94[_0x1e340b(0x1bf)],_0x34bc94['trashDir'],_0x126c1f),await cleanupEmptyDirectories(dirname(_0x126c1f),_0x34bc94[_0x1e340b(0x1b1)]));const _0x38e567={'deleted':_0x565469,'remoteId':_0x4bdda6['remoteId']};if(_0x30bff4)_0x38e567['trashedTo']=_0x30bff4;return{'ok':!![],'data':_0x38e567,'message':_0x1e340b(0x1cc)+_0x565469+(_0x30bff4?_0x1e340b(0x1d4):'')};}};function resolveDeleteTarget(_0x2a175b,_0x3e0352){const _0x30bfdf=a25_0xe182f1;if(_0x2a175b[_0x30bfdf(0x1b3)]('/')){const _0x1e0475=_0x3e0352[_0x30bfdf(0x1b5)](_0x41f44e=>_0x41f44e===_0x2a175b);if(!_0x1e0475)throw CliErrors[_0x30bfdf(0x1a6)](_0x30bfdf(0x1c6)+_0x2a175b);return _0x1e0475;}const _0x3c4fc2=_0x3e0352[_0x30bfdf(0x1ce)](_0x306b1a=>_0x306b1a[_0x30bfdf(0x1b7)]('/')['at'](-0x1)===_0x2a175b);if(_0x3c4fc2[_0x30bfdf(0x1af)]===0x0)throw CliErrors['validation'](_0x30bfdf(0x1c6)+_0x2a175b);if(_0x3c4fc2[_0x30bfdf(0x1af)]>0x1)throw CliErrors[_0x30bfdf(0x1a6)](_0x30bfdf(0x1aa)+_0x2a175b+_0x30bfdf(0x1cb)+_0x3c4fc2[_0x30bfdf(0x1c5)](_0x52ad0d=>_0x30bfdf(0x1d2)+_0x52ad0d)[_0x30bfdf(0x1c1)]('\x0a'));return _0x3c4fc2[0x0];}async function moveToTrash(_0x38eb65,_0x1f782c,_0x9bc530){const _0x4461e4=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x1f1008=relative(_0x38eb65,_0x9bc530),_0x50685a=join(_0x1f782c,_0x4461e4,_0x1f1008);return await mkdir(dirname(_0x50685a),{'recursive':!![]}),await rename(_0x9bc530,_0x50685a),_0x50685a;}async function cleanupEmptyDirectories(_0x580d72,_0x58dc02){const _0x17fcf9=a25_0xe182f1;let _0x19f901=resolve(_0x580d72);const _0x58ce6e=resolve(_0x58dc02);while(_0x19f901[_0x17fcf9(0x1ac)](''+_0x58ce6e+sep)||_0x19f901===_0x58ce6e){if(_0x19f901===_0x58ce6e)return;try{const _0x8a0531=await readdir(_0x19f901);if(_0x8a0531[_0x17fcf9(0x1af)]>0x0)return;await rmdir(_0x19f901);}catch{return;}_0x19f901=dirname(_0x19f901);}}
1
+ const a26_0x1d1005=a26_0x471a;(function(_0x4c766d,_0x4bfb4a){const _0x467c5f=a26_0x471a,_0x3f3c9e=_0x4c766d();while(!![]){try{const _0x51aa70=parseInt(_0x467c5f(0x1b2))/0x1+parseInt(_0x467c5f(0x1b0))/0x2+-parseInt(_0x467c5f(0x1c2))/0x3+parseInt(_0x467c5f(0x1c6))/0x4+parseInt(_0x467c5f(0x1d1))/0x5+-parseInt(_0x467c5f(0x1c3))/0x6*(-parseInt(_0x467c5f(0x1c4))/0x7)+parseInt(_0x467c5f(0x1b8))/0x8*(-parseInt(_0x467c5f(0x1da))/0x9);if(_0x51aa70===_0x4bfb4a)break;else _0x3f3c9e['push'](_0x3f3c9e['shift']());}catch(_0x1872b6){_0x3f3c9e['push'](_0x3f3c9e['shift']());}}}(a26_0x43de,0xd3eb3));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a26_0x471a(_0x5783f2,_0x23836c){_0x5783f2=_0x5783f2-0x1b0;const _0x43de2b=a26_0x43de();let _0x471a54=_0x43de2b[_0x5783f2];return _0x471a54;}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a26_0x1d1005(0x1be),'command':a26_0x1d1005(0x1cb),'description':a26_0x1d1005(0x1d9),'risk':a26_0x1d1005(0x1cd),'flags':[{'name':a26_0x1d1005(0x1c0),'type':a26_0x1d1005(0x1d7),'required':!![],'description':a26_0x1d1005(0x1d6)}],async 'validate'(_0x5c0162){const _0x3cb665=a26_0x1d1005,_0x531214=loadBffProjectConfig(_0x5c0162[_0x3cb665(0x1dc)]),_0x10ab42=await readBffLockFile(_0x531214[_0x3cb665(0x1bf)]);if(!_0x10ab42)throw CliErrors[_0x3cb665(0x1ca)](_0x3cb665(0x1d0));},async 'dryRun'(_0x2c38a7){const _0x177e24=a26_0x1d1005,_0x59fa86=loadBffProjectConfig(_0x2c38a7[_0x177e24(0x1dc)]),_0x278d75=await readBffLockFile(_0x59fa86[_0x177e24(0x1bf)]);if(!_0x278d75)throw CliErrors[_0x177e24(0x1ca)](_0x177e24(0x1c9));const {appLock:_0x527753}=ensureLockScope(_0x278d75,_0x2c38a7[_0x177e24(0x1dc)],_0x59fa86['scriptsRoot'],'delete'),_0x2f7c97=_0x2c38a7['str'](_0x177e24(0x1c0)),_0x4dfa0a=Object[_0x177e24(0x1ba)](_0x527753[_0x177e24(0x1bd)]),_0x3ac36b=resolveDeleteTarget(_0x2f7c97,_0x4dfa0a),_0x355362=_0x527753[_0x177e24(0x1bd)][_0x3ac36b];if(!_0x355362)throw CliErrors[_0x177e24(0x1ca)](_0x177e24(0x1b4)+_0x3ac36b+'\x22.');const _0xf543e7=resolveLocalFilePathFromLockKey(_0x59fa86,_0x3ac36b),_0x51f44b=relative(_0x59fa86[_0x177e24(0x1d8)],_0xf543e7),_0x4bdcfa=join(_0x59fa86[_0x177e24(0x1c8)],_0x177e24(0x1b5),_0x51f44b);return{'method':_0x177e24(0x1b6),'url':_0x177e24(0x1b3),'body':{'appCode':_0x2c38a7[_0x177e24(0x1dc)],'target':_0x3ac36b,'remoteId':_0x355362[_0x177e24(0x1bc)],'localFilePath':_0xf543e7,'trashedPath':_0x4bdcfa},'description':_0x177e24(0x1bb)+_0x3ac36b+_0x177e24(0x1d2)};},async 'execute'(_0x573f3d){const _0x465069=a26_0x1d1005,_0x2a1aa6=loadBffProjectConfig(_0x573f3d[_0x465069(0x1dc)]),_0x165a44=await readBffLockFile(_0x2a1aa6[_0x465069(0x1bf)]);if(!_0x165a44)throw CliErrors[_0x465069(0x1ca)](_0x465069(0x1c9));const {lockData:_0x10a626,appLock:_0x515dc6}=ensureLockScope(_0x165a44,_0x573f3d[_0x465069(0x1dc)],_0x2a1aa6['scriptsRoot'],_0x465069(0x1cb)),_0x28df03=_0x573f3d[_0x465069(0x1cf)](_0x465069(0x1c0)),_0x45357d=Object['keys'](_0x515dc6[_0x465069(0x1bd)]),_0x2d126c=resolveDeleteTarget(_0x28df03,_0x45357d),_0x3c613f=_0x515dc6[_0x465069(0x1bd)][_0x2d126c];if(!_0x3c613f)throw CliErrors[_0x465069(0x1ca)](_0x465069(0x1b4)+_0x2d126c+'\x22.');await deleteBffScript(_0x3c613f[_0x465069(0x1bc)]),delete _0x515dc6[_0x465069(0x1bd)][_0x2d126c],_0x515dc6[_0x465069(0x1b9)]=new Date()[_0x465069(0x1d4)](),await writeBffLockFile(_0x2a1aa6[_0x465069(0x1bf)],_0x10a626);const _0x50681c=resolveLocalFilePathFromLockKey(_0x2a1aa6,_0x2d126c);let _0x5e60d0;await fileExists(_0x50681c)&&(_0x5e60d0=await moveToTrash(_0x2a1aa6[_0x465069(0x1d8)],_0x2a1aa6[_0x465069(0x1c8)],_0x50681c),await cleanupEmptyDirectories(dirname(_0x50681c),_0x2a1aa6[_0x465069(0x1d3)]));const _0x476702={'deleted':_0x2d126c,'remoteId':_0x3c613f['remoteId']};if(_0x5e60d0)_0x476702[_0x465069(0x1ce)]=_0x5e60d0;return{'ok':!![],'data':_0x476702,'message':'Deleted\x20'+_0x2d126c+(_0x5e60d0?_0x465069(0x1d5):'')};}};function resolveDeleteTarget(_0x54fe26,_0x1e9fd2){const _0x4c3050=a26_0x1d1005;if(_0x54fe26[_0x4c3050(0x1cc)]('/')){const _0x1775e6=_0x1e9fd2[_0x4c3050(0x1b7)](_0x32f76d=>_0x32f76d===_0x54fe26);if(!_0x1775e6)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x54fe26);return _0x1775e6;}const _0xe68347=_0x1e9fd2[_0x4c3050(0x1b1)](_0x58c8b6=>_0x58c8b6[_0x4c3050(0x1c5)]('/')['at'](-0x1)===_0x54fe26);if(_0xe68347[_0x4c3050(0x1c1)]===0x0)throw CliErrors[_0x4c3050(0x1ca)]('Function\x20not\x20found:\x20'+_0x54fe26);if(_0xe68347['length']>0x1)throw CliErrors['validation'](_0x4c3050(0x1db)+_0x54fe26+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0xe68347['map'](_0x401417=>_0x4c3050(0x1c7)+_0x401417)['join']('\x0a'));return _0xe68347[0x0];}function a26_0x43de(){const _0x3e27ca=['Multiple\x20functions\x20match\x20\x22','appCode','3033250RRGppS','filter','1291276iKivKa','/api/management/library/scripts/delete','No\x20lock\x20entry\x20found\x20for\x20\x22','<timestamp>','POST','find','20358456nqVZts','lastSync','keys','Would\x20delete\x20','remoteId','functions','bff','lockFilePath','target','length','2964297kzGQHB','3497838SnIntX','7wmdQWq','split','247872vIyLJz','\x20\x20-\x20','trashDir','BFF\x20lock\x20file\x20not\x20found.','validation','delete','includes','high-risk-write','trashedTo','str','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','4740415mdAEqt','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','scriptsRootDir','toISOString','\x20(local\x20file\x20moved\x20to\x20trash)','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','string','projectRoot','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','9Uirjrr'];a26_0x43de=function(){return _0x3e27ca;};return a26_0x43de();}async function moveToTrash(_0x2d4546,_0x10d5f3,_0xd6d0ea){const _0x468fb4=a26_0x1d1005,_0x45abce=new Date()[_0x468fb4(0x1d4)]()['replace'](/[:.]/g,'-'),_0x5843a3=relative(_0x2d4546,_0xd6d0ea),_0x571a3b=join(_0x10d5f3,_0x45abce,_0x5843a3);return await mkdir(dirname(_0x571a3b),{'recursive':!![]}),await rename(_0xd6d0ea,_0x571a3b),_0x571a3b;}async function cleanupEmptyDirectories(_0x49c459,_0x3c11d3){const _0xf5a21d=a26_0x1d1005;let _0x4d911b=resolve(_0x49c459);const _0xf646b1=resolve(_0x3c11d3);while(_0x4d911b['startsWith'](''+_0xf646b1+sep)||_0x4d911b===_0xf646b1){if(_0x4d911b===_0xf646b1)return;try{const _0x332e9d=await readdir(_0x4d911b);if(_0x332e9d[_0xf5a21d(0x1c1)]>0x0)return;await rmdir(_0x4d911b);}catch{return;}_0x4d911b=dirname(_0x4d911b);}}
@@ -1 +1 @@
1
- const a26_0x2ccd32=a26_0x54ed;(function(_0x11caae,_0x5e23a6){const _0x5e9cf2=a26_0x54ed,_0x797497=_0x11caae();while(!![]){try{const _0x4c196a=-parseInt(_0x5e9cf2(0x12e))/0x1*(parseInt(_0x5e9cf2(0x129))/0x2)+parseInt(_0x5e9cf2(0x12a))/0x3*(-parseInt(_0x5e9cf2(0x130))/0x4)+-parseInt(_0x5e9cf2(0x126))/0x5*(-parseInt(_0x5e9cf2(0x121))/0x6)+-parseInt(_0x5e9cf2(0x11c))/0x7+-parseInt(_0x5e9cf2(0x127))/0x8+-parseInt(_0x5e9cf2(0x11a))/0x9*(parseInt(_0x5e9cf2(0x11b))/0xa)+parseInt(_0x5e9cf2(0x117))/0xb*(parseInt(_0x5e9cf2(0x128))/0xc);if(_0x4c196a===_0x5e23a6)break;else _0x797497['push'](_0x797497['shift']());}catch(_0x779a3a){_0x797497['push'](_0x797497['shift']());}}}(a26_0x45d0,0xbe24a));function a26_0x54ed(_0x14807e,_0x5c35ef){_0x14807e=_0x14807e-0x117;const _0x45d0a9=a26_0x45d0();let _0x54eda6=_0x45d0a9[_0x14807e];return _0x54eda6;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a26_0x2ccd32(0x12d),'command':'detail','description':a26_0x2ccd32(0x118),'risk':a26_0x2ccd32(0x125),'flags':[{'name':'id','type':a26_0x2ccd32(0x123),'required':!![],'description':a26_0x2ccd32(0x12c)},{'name':a26_0x2ccd32(0x11d),'type':'boolean','description':a26_0x2ccd32(0x124)}],async 'execute'(_0x42a572){const _0x4c3461=a26_0x2ccd32,_0x5e4e15=await getBffScriptInfo(_0x42a572['num']('id')),_0x158a7c=_0x42a572[_0x4c3461(0x11e)](_0x4c3461(0x11d));if(_0x158a7c)return{'ok':!![],'data':_0x5e4e15};return{'ok':!![],'data':{'id':_0x5e4e15['id'],'appCode':_0x5e4e15[_0x4c3461(0x122)],'scriptType':_0x5e4e15[_0x4c3461(0x119)],'description':_0x5e4e15[_0x4c3461(0x120)]||_0x4c3461(0x12f),'createdTime':_0x5e4e15[_0x4c3461(0x12b)]??'','updatedTime':_0x5e4e15['updatedTime']??'','scriptContent':_0x5e4e15[_0x4c3461(0x11f)]??''}};}};function a26_0x45d0(){const _0x723469=['2778bUKqOB','appCode','number','Return\x20full\x20raw\x20script\x20object','read','11555lUYJRE','1064400nUchjX','11438292IGOHkI','28ZTxYmw','3UoJtyz','createdTime','Script\x20ID','bff','56437MokvHc','(none)','2979404CGvwxL','22OABmIl','Get\x20BFF\x20script\x20details\x20by\x20ID','scriptType','89109UGnqdI','470Xprqhb','449281sPwnsn','verbose','bool','scriptContent','description'];a26_0x45d0=function(){return _0x723469;};return a26_0x45d0();}
1
+ function a27_0x4577(){const _0x2f28b3=['10MIrPgY','scriptContent','(none)','bool','num','description','3aKJtmz','163373SZXeXU','573148HfFQhL','102hIMnjd','bff','5938273RLZovF','115407ZXuVEq','40OCcdSc','Get\x20BFF\x20script\x20details\x20by\x20ID','scriptType','48485QWxVjy','Script\x20ID','361310RplCEI','detail','createdTime','read','verbose','5948buvVCv'];a27_0x4577=function(){return _0x2f28b3;};return a27_0x4577();}const a27_0x5d9a83=a27_0xc6a2;(function(_0x4adeda,_0x49193d){const _0x172eac=a27_0xc6a2,_0x51ba24=_0x4adeda();while(!![]){try{const _0x56ae20=parseInt(_0x172eac(0x19f))/0x1+-parseInt(_0x172eac(0x1ad))/0x2*(parseInt(_0x172eac(0x1ab))/0x3)+parseInt(_0x172eac(0x1a4))/0x4+parseInt(_0x172eac(0x19d))/0x5+parseInt(_0x172eac(0x1ae))/0x6*(-parseInt(_0x172eac(0x1ac))/0x7)+parseInt(_0x172eac(0x1b2))/0x8*(parseInt(_0x172eac(0x1b1))/0x9)+-parseInt(_0x172eac(0x1a5))/0xa*(-parseInt(_0x172eac(0x1b0))/0xb);if(_0x56ae20===_0x49193d)break;else _0x51ba24['push'](_0x51ba24['shift']());}catch(_0x8c7eb9){_0x51ba24['push'](_0x51ba24['shift']());}}}(a27_0x4577,0x478fb));function a27_0xc6a2(_0x2f8f64,_0x2ee860){_0x2f8f64=_0x2f8f64-0x19d;const _0x457736=a27_0x4577();let _0xc6a2c1=_0x457736[_0x2f8f64];return _0xc6a2c1;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a27_0x5d9a83(0x1af),'command':a27_0x5d9a83(0x1a0),'description':a27_0x5d9a83(0x1b3),'risk':a27_0x5d9a83(0x1a2),'flags':[{'name':'id','type':'number','required':!![],'description':a27_0x5d9a83(0x19e)},{'name':a27_0x5d9a83(0x1a3),'type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x5c1de0){const _0x126dca=a27_0x5d9a83,_0x1b80b3=await getBffScriptInfo(_0x5c1de0[_0x126dca(0x1a9)]('id')),_0x64c8a9=_0x5c1de0[_0x126dca(0x1a8)](_0x126dca(0x1a3));if(_0x64c8a9)return{'ok':!![],'data':_0x1b80b3};return{'ok':!![],'data':{'id':_0x1b80b3['id'],'appCode':_0x1b80b3['appCode'],'scriptType':_0x1b80b3[_0x126dca(0x1b4)],'description':_0x1b80b3[_0x126dca(0x1aa)]||_0x126dca(0x1a7),'createdTime':_0x1b80b3[_0x126dca(0x1a1)]??'','updatedTime':_0x1b80b3['updatedTime']??'','scriptContent':_0x1b80b3[_0x126dca(0x1a6)]??''}};}};
@@ -1 +1 @@
1
- function a27_0x535c(){const _0x251dac=['822HvylNt','5203247UOmNSj','11LqCvUo','5084325WoTkCE','8TQSNrn','82230UhJIyz','148RDbQzg','438195amsswO','7396722vKCoOR','7461710xzsssD','1412DkavLa'];a27_0x535c=function(){return _0x251dac;};return a27_0x535c();}(function(_0x43afe2,_0x29636e){const _0x1757bc=a27_0x4652,_0x3bfd00=_0x43afe2();while(!![]){try{const _0x1cfc6c=parseInt(_0x1757bc(0x1ea))/0x1+-parseInt(_0x1757bc(0x1ed))/0x2*(-parseInt(_0x1757bc(0x1ee))/0x3)+-parseInt(_0x1757bc(0x1e9))/0x4*(parseInt(_0x1757bc(0x1e8))/0x5)+parseInt(_0x1757bc(0x1eb))/0x6+-parseInt(_0x1757bc(0x1ef))/0x7*(-parseInt(_0x1757bc(0x1e7))/0x8)+-parseInt(_0x1757bc(0x1e6))/0x9+parseInt(_0x1757bc(0x1ec))/0xa*(-parseInt(_0x1757bc(0x1f0))/0xb);if(_0x1cfc6c===_0x29636e)break;else _0x3bfd00['push'](_0x3bfd00['shift']());}catch(_0x4aa28a){_0x3bfd00['push'](_0x3bfd00['shift']());}}}(a27_0x535c,0xa8015));import{bffList}from'../../commands/bff/list.js';function a27_0x4652(_0x2fbced,_0x251b48){_0x2fbced=_0x2fbced-0x1e6;const _0x535cdd=a27_0x535c();let _0x465218=_0x535cdd[_0x2fbced];return _0x465218;}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
1
+ (function(_0x5ea8cc,_0xcb80de){const _0x1e71c6=a28_0xd1ec,_0x5a8d83=_0x5ea8cc();while(!![]){try{const _0x1688bd=-parseInt(_0x1e71c6(0x135))/0x1+parseInt(_0x1e71c6(0x134))/0x2*(-parseInt(_0x1e71c6(0x137))/0x3)+-parseInt(_0x1e71c6(0x13d))/0x4+-parseInt(_0x1e71c6(0x138))/0x5*(parseInt(_0x1e71c6(0x13c))/0x6)+parseInt(_0x1e71c6(0x133))/0x7*(-parseInt(_0x1e71c6(0x13a))/0x8)+parseInt(_0x1e71c6(0x13e))/0x9*(parseInt(_0x1e71c6(0x139))/0xa)+-parseInt(_0x1e71c6(0x13b))/0xb*(-parseInt(_0x1e71c6(0x136))/0xc);if(_0x1688bd===_0xcb80de)break;else _0x5a8d83['push'](_0x5a8d83['shift']());}catch(_0x5f579d){_0x5a8d83['push'](_0x5a8d83['shift']());}}}(a28_0x1376,0x7f134));import{bffList}from'../../commands/bff/list.js';function a28_0x1376(){const _0x20ce14=['1152612jFJPPY','65133oTwxVT','1224845MEeUpZ','8419070GRXmRA','88048CEbAMe','264lLthgE','6IbfuKT','2381916ZGPBOP','9xBdGGs','322IvwYpG','50bRwNUt','737132LOOLac'];a28_0x1376=function(){return _0x20ce14;};return a28_0x1376();}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a28_0xd1ec(_0x37e4dc,_0x973d6e){_0x37e4dc=_0x37e4dc-0x133;const _0x137672=a28_0x1376();let _0xd1ec3c=_0x137672[_0x37e4dc];return _0xd1ec3c;}import{bffNew}from'../../commands/bff/new.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- function a28_0x8203(){const _0x2c6af0=['appCode','bool','ENDPOINT','boolean','9694650ImESlZ','list','verbose','bff','str','4PCGpGB','26794581WFDwYZ','186vXfLRU','description','Script\x20type\x20filter','215236UBehTE','functionName','152DsMZMo','name','type','Filter\x20by\x20script\x20name','string','21654HtHIrq','394070yUyIYO','1319400Zzrjdp','315486IvtvGc','scriptType','length','112VAqWjS'];a28_0x8203=function(){return _0x2c6af0;};return a28_0x8203();}const a28_0x3cad6f=a28_0x4749;(function(_0x1dd1c5,_0x19c54e){const _0x717eb=a28_0x4749,_0x313401=_0x1dd1c5();while(!![]){try{const _0x29e691=-parseInt(_0x717eb(0x70))/0x1*(parseInt(_0x717eb(0x7f))/0x2)+-parseInt(_0x717eb(0x6f))/0x3*(parseInt(_0x717eb(0x6a))/0x4)+-parseInt(_0x717eb(0x71))/0x5+-parseInt(_0x717eb(0x65))/0x6*(parseInt(_0x717eb(0x68))/0x7)+-parseInt(_0x717eb(0x75))/0x8*(parseInt(_0x717eb(0x72))/0x9)+parseInt(_0x717eb(0x7a))/0xa+parseInt(_0x717eb(0x80))/0xb;if(_0x29e691===_0x19c54e)break;else _0x313401['push'](_0x313401['shift']());}catch(_0x55c4c2){_0x313401['push'](_0x313401['shift']());}}}(a28_0x8203,0x9b0d0));import{listBffScripts}from'../../core/api-client.js';function a28_0x4749(_0x50da26,_0x40c617){_0x50da26=_0x50da26-0x65;const _0x82030e=a28_0x8203();let _0x47491d=_0x82030e[_0x50da26];return _0x47491d;}export const bffList={'service':a28_0x3cad6f(0x7d),'command':a28_0x3cad6f(0x7b),'description':'List\x20BFF\x20scripts','risk':'read','flags':[{'name':a28_0x3cad6f(0x6c),'type':a28_0x3cad6f(0x6e),'description':a28_0x3cad6f(0x67),'default':a28_0x3cad6f(0x78),'enum':[a28_0x3cad6f(0x78),'COMMON']},{'name':'name','type':a28_0x3cad6f(0x6e),'description':a28_0x3cad6f(0x6d)},{'name':'verbose','type':a28_0x3cad6f(0x79),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0xeca713){const _0x460d03=a28_0x3cad6f,_0x2b158e=await listBffScripts(_0xeca713[_0x460d03(0x76)],_0xeca713['str'](_0x460d03(0x6c)),{'scriptName':_0xeca713[_0x460d03(0x7e)](_0x460d03(0x6b))||undefined}),_0x37cd27=_0xeca713[_0x460d03(0x77)](_0x460d03(0x7c));return{'ok':!![],'data':_0x37cd27?_0x2b158e:_0x2b158e['map'](_0x2fb0ab=>({'id':_0x2fb0ab['id'],'functionName':_0x2fb0ab[_0x460d03(0x69)]??'','description':_0x2fb0ab[_0x460d03(0x66)]||'(unnamed)','scriptType':_0x2fb0ab[_0x460d03(0x73)]})),'message':_0x2b158e[_0x460d03(0x74)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
1
+ function a29_0x3a5b(){const _0x3f77f2=['type','str','Return\x20full\x20script\x20objects','boolean','list','COMMON','No\x20BFF\x20scripts\x20found.','180714USubHO','Script\x20type\x20filter','List\x20BFF\x20scripts','6700740jDivjc','string','read','length','6024005CHYCuY','functionName','scriptType','ENDPOINT','6DUIopT','name','297963AAbQDp','345854ObaLjD','verbose','76ecWyiC','104WPYqta','220382sKVWSt','858431ldUmxD'];a29_0x3a5b=function(){return _0x3f77f2;};return a29_0x3a5b();}function a29_0x86e0(_0x254301,_0xbcdf3b){_0x254301=_0x254301-0x1c5;const _0x3a5b3f=a29_0x3a5b();let _0x86e04e=_0x3a5b3f[_0x254301];return _0x86e04e;}const a29_0xfaddca=a29_0x86e0;(function(_0x5f3773,_0x259dea){const _0x33be3f=a29_0x86e0,_0x3358f4=_0x5f3773();while(!![]){try{const _0x5404b8=parseInt(_0x33be3f(0x1d1))/0x1+-parseInt(_0x33be3f(0x1cd))/0x2+parseInt(_0x33be3f(0x1da))/0x3*(parseInt(_0x33be3f(0x1cf))/0x4)+-parseInt(_0x33be3f(0x1c6))/0x5*(parseInt(_0x33be3f(0x1ca))/0x6)+parseInt(_0x33be3f(0x1d2))/0x7*(parseInt(_0x33be3f(0x1d0))/0x8)+-parseInt(_0x33be3f(0x1cc))/0x9+-parseInt(_0x33be3f(0x1dd))/0xa;if(_0x5404b8===_0x259dea)break;else _0x3358f4['push'](_0x3358f4['shift']());}catch(_0x940234){_0x3358f4['push'](_0x3358f4['shift']());}}}(a29_0x3a5b,0xd6690));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a29_0xfaddca(0x1d7),'description':a29_0xfaddca(0x1dc),'risk':a29_0xfaddca(0x1df),'flags':[{'name':a29_0xfaddca(0x1d3),'type':a29_0xfaddca(0x1de),'description':a29_0xfaddca(0x1db),'default':a29_0xfaddca(0x1c9),'enum':[a29_0xfaddca(0x1c9),a29_0xfaddca(0x1d8)]},{'name':a29_0xfaddca(0x1cb),'type':a29_0xfaddca(0x1de),'description':'Filter\x20by\x20script\x20name'},{'name':a29_0xfaddca(0x1ce),'type':a29_0xfaddca(0x1d6),'description':a29_0xfaddca(0x1d5)}],async 'execute'(_0x5d242e){const _0x2ba192=a29_0xfaddca,_0x413660=await listBffScripts(_0x5d242e['appCode'],_0x5d242e['str']('type'),{'scriptName':_0x5d242e[_0x2ba192(0x1d4)](_0x2ba192(0x1cb))||undefined}),_0x67ff5=_0x5d242e['bool'](_0x2ba192(0x1ce));return{'ok':!![],'data':_0x67ff5?_0x413660:_0x413660['map'](_0x46a667=>({'id':_0x46a667['id'],'functionName':_0x46a667[_0x2ba192(0x1c7)]??'','description':_0x46a667['description']||'(unnamed)','scriptType':_0x46a667[_0x2ba192(0x1c8)]})),'message':_0x413660[_0x2ba192(0x1c5)]===0x0?_0x2ba192(0x1d9):undefined};}};
@@ -1 +1 @@
1
- const a29_0x4ed9cd=a29_0x3268;(function(_0x4529fa,_0x28e2af){const _0x1ab88b=a29_0x3268,_0x2d6a77=_0x4529fa();while(!![]){try{const _0x3cb990=parseInt(_0x1ab88b(0xe6))/0x1*(-parseInt(_0x1ab88b(0xd5))/0x2)+-parseInt(_0x1ab88b(0xb3))/0x3+-parseInt(_0x1ab88b(0xe9))/0x4*(parseInt(_0x1ab88b(0xd3))/0x5)+-parseInt(_0x1ab88b(0xce))/0x6*(parseInt(_0x1ab88b(0xa7))/0x7)+parseInt(_0x1ab88b(0xa2))/0x8*(parseInt(_0x1ab88b(0xdb))/0x9)+parseInt(_0x1ab88b(0x9f))/0xa*(-parseInt(_0x1ab88b(0xea))/0xb)+-parseInt(_0x1ab88b(0x9b))/0xc*(-parseInt(_0x1ab88b(0xbe))/0xd);if(_0x3cb990===_0x28e2af)break;else _0x2d6a77['push'](_0x2d6a77['shift']());}catch(_0x311df1){_0x2d6a77['push'](_0x2d6a77['shift']());}}}(a29_0x2227,0x7c3e7));function a29_0x2227(){const _0x158447=['\x0a\x20*\x20[触发节点]\x20','operation-type','utf8','stdin','validation','after','parseInt','No\x20api.ts\x20found.\x20Run\x20`','apiDir','\x22\x20not\x20found\x20for\x20dataset\x20','Script\x20type','1798896xeogSC','appCode','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Invalid\x20function\x20name\x20\x22','6590crcQXE','\x22.\x20','No\x20operation\x20types\x20found\x20for\x20dataset\x20','536Yrnkes','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','name','description','1222886sdvTPH','write','Select\x20dataset:','datasetcode','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','keys','Dataset\x20not\x20found\x20for\x20code\x20\x22','Alias\x20\x22','Select\x20trigger\x20node:','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','question','1134000cyhMqJ','Available\x20aliases:\x20','find','str','nonInteractive','Operation\x20type\x20(HOOK\x20only)','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','string','alias','entries','221QNJtHx','bff','No\x20datasets\x20found\x20for\x20this\x20app.','Invalid\x20dataset\x20selection.','type','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','operationType','before','datasetCode','stderr','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22\x20not\x20found.\x20','code','File\x20already\x20exists:\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','12bVEnys','.js','HOOK\x20requires\x20alias/operation/node\x20options.','map','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Request\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Business\x20result\x20(wrapped\x20in\x20response.data).\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','40ebPKgt','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','18QTzubF','length','new','ENDPOINT','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','close','119772dVeyYs','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','includes','HOOK','function-node','COMMON','scriptsRootDir','join','Available:\x20','trim','TODO:\x20add\x20script\x20description','37181sJNSbP','Script\x20description','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','496996nPgrdY','14608dvwKJz','tableName','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'];a29_0x2227=function(){return _0x158447;};return a29_0x2227();}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';function a29_0x3268(_0x3cbf0e,_0x4b992b){_0x3cbf0e=_0x3cbf0e-0x9b;const _0x2227f3=a29_0x2227();let _0x3268b9=_0x2227f3[_0x3cbf0e];return _0x3268b9;}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a29_0x4ed9cd(0xbf),'command':a29_0x4ed9cd(0xd7),'description':a29_0x4ed9cd(0xd4),'risk':a29_0x4ed9cd(0xa8),'flags':[{'name':a29_0x4ed9cd(0xc2),'type':a29_0x4ed9cd(0xbb),'required':!![],'enum':[a29_0x4ed9cd(0xe0),'ENDPOINT',a29_0x4ed9cd(0xde)],'description':a29_0x4ed9cd(0xf8)},{'name':a29_0x4ed9cd(0xa5),'type':a29_0x4ed9cd(0xbb),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a29_0x4ed9cd(0xbb),'description':a29_0x4ed9cd(0xe7)},{'name':a29_0x4ed9cd(0xbc),'type':a29_0x4ed9cd(0xbb),'description':a29_0x4ed9cd(0xa3)},{'name':'datasetcode','type':'string','description':a29_0x4ed9cd(0xb9)},{'name':a29_0x4ed9cd(0xef),'type':a29_0x4ed9cd(0xbb),'description':a29_0x4ed9cd(0xb8)},{'name':'function-node','type':a29_0x4ed9cd(0xbb),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before',a29_0x4ed9cd(0xf3)]}],async 'validate'(_0x22c12d){const _0x576281=a29_0x4ed9cd,_0x1b3138=_0x22c12d[_0x576281(0xb6)](_0x576281(0xa5));if(!isValidBffFunctionName(_0x1b3138))throw CliErrors['validation'](_0x576281(0x9e)+_0x1b3138+_0x576281(0xb1));},async 'execute'(_0xd36a5){const _0x8051df=a29_0x4ed9cd,_0x574d74=loadBffProjectConfig(_0xd36a5[_0x8051df(0x9c)]),_0x188111=_0xd36a5['str']('type'),_0x4a5b1e=_0xd36a5['str']('name'),_0x4eb9a7=_0xd36a5['str'](_0x8051df(0xa6))||undefined,_0x2af6cd=_0x188111===_0x8051df(0xde)?await resolveHookOptions(_0x574d74,_0xd36a5):undefined,_0x183fb5=buildFilePath(_0x574d74,_0x188111,_0x4a5b1e,_0x2af6cd);if(await fileExists(_0x183fb5))throw CliErrors[_0x8051df(0xf2)](_0x8051df(0xcc)+_0x183fb5);await mkdir(dirname(_0x183fb5),{'recursive':!![]});const _0x3b60b7=generateTemplate(_0x188111,_0x4a5b1e,_0xd36a5[_0x8051df(0x9c)],_0x4eb9a7,_0x2af6cd);await writeFile(_0x183fb5,_0x3b60b7,_0x8051df(0xf0));const _0x28219d={'type':_0x188111,'name':_0x4a5b1e,'path':_0x183fb5};if(_0x4eb9a7)_0x28219d[_0x8051df(0xa6)]=_0x4eb9a7;if(_0x2af6cd){if(_0x2af6cd[_0x8051df(0xbc)])_0x28219d[_0x8051df(0xbc)]=_0x2af6cd['alias'];_0x28219d[_0x8051df(0xc7)]=_0x2af6cd[_0x8051df(0xc7)],_0x28219d['operationType']=_0x2af6cd[_0x8051df(0xc5)],_0x28219d['functionNode']=_0x2af6cd['functionNode'];}return{'ok':!![],'data':_0x28219d,'message':'Created\x20'+_0x188111+'\x20function:\x20'+_0x4a5b1e};}};async function resolveHookOptions(_0x50e374,_0x1284c5){const _0x19b02e=a29_0x4ed9cd,_0x4c57ac=loadAliasMap(_0x1284c5['apiDir'],undefined,resolveApiFilePath(_0x1284c5[_0x19b02e(0xf6)],_0x1284c5[_0x19b02e(0x9c)])),_0x343934=_0x4c57ac[_0x19b02e(0xd6)]>0x0;let _0x3363ae,_0x43bfcb,_0x2f62fd;const _0x22fa28=_0x1284c5['str']('alias'),_0x235e8e=_0x1284c5[_0x19b02e(0xb6)](_0x19b02e(0xaa));if(_0x22fa28){const _0x38d3de=resolveAlias(_0x1284c5[_0x19b02e(0xf6)],_0x22fa28,undefined,resolveApiFilePath(_0x1284c5[_0x19b02e(0xf6)],_0x1284c5['appCode']));if(!_0x38d3de){const _0x173a65=_0x343934?_0x19b02e(0xb4)+_0x4c57ac[_0x19b02e(0xd1)](_0x4e899c=>_0x4e899c['alias'])[_0x19b02e(0xe2)](',\x20'):_0x19b02e(0xf5)+CLI_BIN_NAME+_0x19b02e(0xe8);throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xaf)+_0x22fa28+_0x19b02e(0xca)+_0x173a65);}_0x3363ae=_0x22fa28,_0x43bfcb=_0x38d3de;}else{if(_0x235e8e){_0x43bfcb=_0x235e8e;const _0x5a6703=_0x4c57ac[_0x19b02e(0xb5)](_0x3d6ea3=>_0x3d6ea3[_0x19b02e(0xc7)]===_0x235e8e);_0x3363ae=_0x5a6703?.[_0x19b02e(0xbc)];}else{if(_0x1284c5['nonInteractive'])throw CliErrors['validation'](_0x19b02e(0xa4));else{if(_0x343934){const _0x385ec2=_0x4c57ac[_0x19b02e(0xd1)](_0x1e5e58=>_0x1e5e58[_0x19b02e(0xbc)]+'\x20('+_0x1e5e58[_0x19b02e(0xeb)]+')'),_0x1d437f=await promptSelect(_0x19b02e(0xa9),_0x385ec2),_0x4b180=_0x4c57ac[_0x1d437f];if(!_0x4b180)throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xc1));_0x3363ae=_0x4b180['alias'],_0x43bfcb=_0x4b180[_0x19b02e(0xc7)];}else{const _0x11241e=await listDatasets(_0x1284c5[_0x19b02e(0x9c)]);if(_0x11241e[_0x19b02e(0xd6)]===0x0)throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xc0));const _0x3055e5=_0x11241e[_0x19b02e(0xd1)](_0x36df9b=>_0x36df9b[_0x19b02e(0xa5)]+'\x20('+_0x36df9b['code']+')'),_0x310fa5=await promptSelect('Select\x20dataset:',_0x3055e5),_0x1f7732=_0x11241e[_0x310fa5];if(!_0x1f7732)throw CliErrors[_0x19b02e(0xf2)]('Invalid\x20dataset\x20selection.');_0x43bfcb=_0x1f7732[_0x19b02e(0xcb)],_0x3363ae=undefined;}}}}const _0x347be5=await listDatasets(_0x1284c5[_0x19b02e(0x9c)]),_0x4ade1f=_0x347be5[_0x19b02e(0xb5)](_0x51c1dd=>_0x51c1dd['code']===_0x43bfcb);if(!_0x4ade1f)throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xae)+_0x43bfcb+_0x19b02e(0xa0)+(_0x3363ae?_0x19b02e(0xc4)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x2f62fd=_0x4ade1f['id'];const _0x41646b=_0x3363ae??_0x43bfcb,_0x15e0ca=await listBffDatasetOperations(_0x1284c5[_0x19b02e(0x9c)],_0x2f62fd),_0x458db2=_0x15e0ca?Object[_0x19b02e(0xad)](_0x15e0ca):[];if(_0x458db2[_0x19b02e(0xd6)]===0x0)throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xa1)+_0x41646b+'.');let _0x4c96b5;const _0x30a80d=_0x1284c5[_0x19b02e(0xb6)]('operation-type');if(_0x30a80d){if(!_0x458db2[_0x19b02e(0xdd)](_0x30a80d))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x30a80d+_0x19b02e(0xf7)+_0x41646b+'.\x20'+(_0x19b02e(0xe3)+_0x458db2[_0x19b02e(0xe2)](',\x20')));_0x4c96b5=_0x30a80d;}else{if(_0x1284c5[_0x19b02e(0xb7)])throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xc9));const _0x16d5a8=await promptSelect('Select\x20operation\x20type:',_0x458db2);_0x4c96b5=_0x458db2[_0x16d5a8]??_0x458db2[0x0];}let _0x4a089a=normalizeHookFunctionNode(_0x1284c5[_0x19b02e(0xb6)](_0x19b02e(0xdf)));if(!_0x4a089a){if(_0x1284c5['str'](_0x19b02e(0xdf)))throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xcd));if(_0x1284c5[_0x19b02e(0xb7)])throw CliErrors[_0x19b02e(0xf2)](_0x19b02e(0xd9));const _0x20aa48=await promptSelect(_0x19b02e(0xb0),[_0x19b02e(0xc6),_0x19b02e(0xf3)]);_0x4a089a=[_0x19b02e(0xc6),_0x19b02e(0xf3)][_0x20aa48]??'before';}return{'alias':_0x3363ae,'datasetCode':_0x43bfcb,'datasetId':_0x2f62fd,'operationType':_0x4c96b5,'functionNode':_0x4a089a};}async function promptSelect(_0x58510e,_0x4969bf){const _0x55b434=a29_0x4ed9cd;if(_0x4969bf[_0x55b434(0xd6)]===0x1)return 0x0;for(const [_0x235827,_0x29c650]of _0x4969bf[_0x55b434(0xbd)]()){process[_0x55b434(0xc8)][_0x55b434(0xa8)]('\x20\x20'+(_0x235827+0x1)+'.\x20'+_0x29c650+'\x0a');}const _0x175a38=createInterface({'input':process[_0x55b434(0xf1)],'output':process[_0x55b434(0xc8)]});while(!![]){const _0x55c776=await new Promise(_0x48911b=>{const _0xc81db2=_0x55b434;_0x175a38[_0xc81db2(0xb2)](_0x58510e+'\x20',_0x48911b);}),_0x5d892d=Number[_0x55b434(0xf4)](_0x55c776['trim'](),0xa);if(Number['isInteger'](_0x5d892d)&&_0x5d892d>=0x1&&_0x5d892d<=_0x4969bf[_0x55b434(0xd6)])return _0x175a38[_0x55b434(0xda)](),_0x5d892d-0x1;process['stderr'][_0x55b434(0xa8)](_0x55b434(0xed)+_0x4969bf[_0x55b434(0xd6)]+'.\x0a');}}function buildFilePath(_0x147ad4,_0x5f1b03,_0x37f7e8,_0x3f75e1){const _0xa555af=a29_0x4ed9cd;if(_0x5f1b03===_0xa555af(0xde)){if(!_0x3f75e1)throw CliErrors['validation'](_0xa555af(0xd0));const _0x1cd0a6=_0x3f75e1[_0xa555af(0xbc)]??_0x3f75e1[_0xa555af(0xc7)];return join(_0x147ad4[_0xa555af(0xe1)],_0xa555af(0xde),_0x1cd0a6,_0x3f75e1[_0xa555af(0xc5)],_0x3f75e1['functionNode'],_0x37f7e8+_0xa555af(0xcf));}return join(_0x147ad4['scriptsRootDir'],_0x5f1b03,_0x37f7e8+_0xa555af(0xcf));}export function generateTemplate(_0x1abec7,_0xf81635,_0x43c3f1,_0x597c26,_0x4c1e0d){const _0x294772=a29_0x4ed9cd,_0x2526a0=_0x597c26?.[_0x294772(0xe4)]()||_0x294772(0xe5);if(_0x1abec7===_0x294772(0xe0))return _0x294772(0xec)+_0x2526a0+'\x0a\x20*\x20[脚本名称]\x20'+_0xf81635+_0x294772(0xdc)+_0xf81635+'.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'+_0xf81635+_0x294772(0x9d);if(_0x1abec7===_0x294772(0xd8))return _0x294772(0xab)+_0x2526a0+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/'+_0x43c3f1+'/'+_0xf81635+_0x294772(0xd2)+_0xf81635+_0x294772(0x9d);if(!_0x4c1e0d)throw CliErrors[_0x294772(0xf2)](_0x294772(0xba));return _0x294772(0xac)+_0x2526a0+_0x294772(0xc3)+_0x43c3f1+'/'+_0x4c1e0d[_0x294772(0xc7)]+'/'+_0x4c1e0d[_0x294772(0xc5)]+_0x294772(0xee)+_0x4c1e0d['functionNode']+'\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'+_0xf81635+_0x294772(0x9d);}
1
+ const a30_0xa62f8d=a30_0xe4c8;(function(_0x2c77a9,_0x19ad9e){const _0x45a418=a30_0xe4c8,_0x55621b=_0x2c77a9();while(!![]){try{const _0x547151=parseInt(_0x45a418(0x18b))/0x1+-parseInt(_0x45a418(0x1bf))/0x2*(parseInt(_0x45a418(0x1c5))/0x3)+-parseInt(_0x45a418(0x1a1))/0x4+-parseInt(_0x45a418(0x1b6))/0x5*(-parseInt(_0x45a418(0x1b9))/0x6)+-parseInt(_0x45a418(0x17a))/0x7*(parseInt(_0x45a418(0x1c7))/0x8)+-parseInt(_0x45a418(0x1a3))/0x9+-parseInt(_0x45a418(0x186))/0xa*(-parseInt(_0x45a418(0x189))/0xb);if(_0x547151===_0x19ad9e)break;else _0x55621b['push'](_0x55621b['shift']());}catch(_0x2538cf){_0x55621b['push'](_0x55621b['shift']());}}}(a30_0x5364,0x4a688));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a30_0x5364(){const _0x4c74bc=['\x22.\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','string','function-node','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','keys','str','Invalid\x20function\x20name\x20\x22','operationType','Select\x20dataset:','TODO:\x20add\x20script\x20description','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','description','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','operation-type','ENDPOINT','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/{appCode}/{scriptName}\x0a\x20*\x20[当前示例]\x20POST\x20/api/endpoint/','1877428oeBcWw','HOOK','242136IXfqas','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','stdin','.js\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Input\x20parameters.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Processing\x20result.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\x20[脚本名称]\x20','.js','Select\x20operation\x20type:','length','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20to\x20refresh.','\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/','join','write','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','parseInt','name','Trigger\x20node\x20(HOOK\x20only)','apiDir','Operation\x20type\x20\x22','10uPCrov','utf8','code','1014240QNcivx','close','datasetCode','\x20function:\x20','includes','Script\x20type','226YJuNls','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','validation','question','entries','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','5154qqPNMH','alias','833192sTZCYz','Created\x20','tableName','appCode','stderr','\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','map','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','before','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','datasetcode','7uSbHyp','bff','Invalid\x20dataset\x20selection.','after','\x22\x20not\x20found.\x20','nonInteractive','Select\x20trigger\x20node:','functionNode','trim','\x0a\x20*\x20[触发节点]\x20','Script\x20description','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','228050PCbxgL','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','Operation\x20type\x20(HOOK\x20only)','187UNMDWB','isInteger','373555OwDemT','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','scriptsRootDir','find'];a30_0x5364=function(){return _0x4c74bc;};return a30_0x5364();}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';function a30_0xe4c8(_0x4ea15c,_0x3bd490){_0x4ea15c=_0x4ea15c-0x171;const _0x536488=a30_0x5364();let _0xe4c800=_0x536488[_0x4ea15c];return _0xe4c800;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffNew={'service':a30_0xa62f8d(0x17b),'command':'new','description':a30_0xa62f8d(0x185),'risk':a30_0xa62f8d(0x1af),'flags':[{'name':'type','type':a30_0xa62f8d(0x191),'required':!![],'enum':['COMMON',a30_0xa62f8d(0x19f),a30_0xa62f8d(0x1a2)],'description':a30_0xa62f8d(0x1be)},{'name':a30_0xa62f8d(0x1b2),'type':a30_0xa62f8d(0x191),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a30_0xa62f8d(0x191),'description':a30_0xa62f8d(0x184)},{'name':a30_0xa62f8d(0x1c6),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a30_0xa62f8d(0x179),'type':'string','description':a30_0xa62f8d(0x1ab)},{'name':'operation-type','type':a30_0xa62f8d(0x191),'description':a30_0xa62f8d(0x188)},{'name':a30_0xa62f8d(0x192),'type':'string','description':a30_0xa62f8d(0x1b3),'enum':[a30_0xa62f8d(0x177),a30_0xa62f8d(0x17d)]}],async 'validate'(_0x1e3eff){const _0x1e5e49=a30_0xa62f8d,_0x453a46=_0x1e3eff[_0x1e5e49(0x195)](_0x1e5e49(0x1b2));if(!isValidBffFunctionName(_0x453a46))throw CliErrors[_0x1e5e49(0x1c1)](_0x1e5e49(0x196)+_0x453a46+_0x1e5e49(0x1a4));},async 'execute'(_0x2bbd0e){const _0x11732e=a30_0xa62f8d,_0x1a8b00=loadBffProjectConfig(_0x2bbd0e['appCode']),_0x15633d=_0x2bbd0e[_0x11732e(0x195)]('type'),_0x16c4ff=_0x2bbd0e[_0x11732e(0x195)](_0x11732e(0x1b2)),_0x383a6d=_0x2bbd0e[_0x11732e(0x195)](_0x11732e(0x19b))||undefined,_0x4b8022=_0x15633d===_0x11732e(0x1a2)?await resolveHookOptions(_0x1a8b00,_0x2bbd0e):undefined,_0x5c0d6b=buildFilePath(_0x1a8b00,_0x15633d,_0x16c4ff,_0x4b8022);if(await fileExists(_0x5c0d6b))throw CliErrors['validation']('File\x20already\x20exists:\x20'+_0x5c0d6b);await mkdir(dirname(_0x5c0d6b),{'recursive':!![]});const _0xf2b27e=generateTemplate(_0x15633d,_0x16c4ff,_0x2bbd0e[_0x11732e(0x172)],_0x383a6d,_0x4b8022);await writeFile(_0x5c0d6b,_0xf2b27e,_0x11732e(0x1b7));const _0x49efb3={'type':_0x15633d,'name':_0x16c4ff,'path':_0x5c0d6b};if(_0x383a6d)_0x49efb3[_0x11732e(0x19b)]=_0x383a6d;if(_0x4b8022){if(_0x4b8022[_0x11732e(0x1c6)])_0x49efb3['alias']=_0x4b8022[_0x11732e(0x1c6)];_0x49efb3[_0x11732e(0x1bb)]=_0x4b8022[_0x11732e(0x1bb)],_0x49efb3['operationType']=_0x4b8022[_0x11732e(0x197)],_0x49efb3[_0x11732e(0x181)]=_0x4b8022[_0x11732e(0x181)];}return{'ok':!![],'data':_0x49efb3,'message':_0x11732e(0x1c8)+_0x15633d+_0x11732e(0x1bc)+_0x16c4ff};}};async function resolveHookOptions(_0x2f9eae,_0x1d3852){const _0x194bf2=a30_0xa62f8d,_0xbc28a4=loadAliasMap(_0x1d3852['apiDir'],undefined,resolveApiFilePath(_0x1d3852[_0x194bf2(0x1b4)],_0x1d3852[_0x194bf2(0x172)])),_0x4c918a=_0xbc28a4[_0x194bf2(0x1aa)]>0x0;let _0x11ad1e,_0x5ab368,_0xcf9123;const _0x5e7f2f=_0x1d3852[_0x194bf2(0x195)]('alias'),_0x280d85=_0x1d3852[_0x194bf2(0x195)](_0x194bf2(0x179));if(_0x5e7f2f){const _0x5446ff=resolveAlias(_0x1d3852['apiDir'],_0x5e7f2f,undefined,resolveApiFilePath(_0x1d3852[_0x194bf2(0x1b4)],_0x1d3852[_0x194bf2(0x172)]));if(!_0x5446ff){const _0x56efe9=_0x4c918a?'Available\x20aliases:\x20'+_0xbc28a4['map'](_0x2d7b9e=>_0x2d7b9e[_0x194bf2(0x1c6)])[_0x194bf2(0x1ae)](',\x20'):'No\x20api.ts\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x194bf2(0x1c0);throw CliErrors[_0x194bf2(0x1c1)]('Alias\x20\x22'+_0x5e7f2f+_0x194bf2(0x17e)+_0x56efe9);}_0x11ad1e=_0x5e7f2f,_0x5ab368=_0x5446ff;}else{if(_0x280d85){_0x5ab368=_0x280d85;const _0x4a2658=_0xbc28a4[_0x194bf2(0x18e)](_0x18a07c=>_0x18a07c[_0x194bf2(0x1bb)]===_0x280d85);_0x11ad1e=_0x4a2658?.[_0x194bf2(0x1c6)];}else{if(_0x1d3852['nonInteractive'])throw CliErrors['validation'](_0x194bf2(0x19d));else{if(_0x4c918a){const _0x337763=_0xbc28a4['map'](_0x43d3d8=>_0x43d3d8['alias']+'\x20('+_0x43d3d8[_0x194bf2(0x171)]+')'),_0x5d1585=await promptSelect('Select\x20dataset:',_0x337763),_0x5aeb08=_0xbc28a4[_0x5d1585];if(!_0x5aeb08)throw CliErrors[_0x194bf2(0x1c1)](_0x194bf2(0x17c));_0x11ad1e=_0x5aeb08['alias'],_0x5ab368=_0x5aeb08[_0x194bf2(0x1bb)];}else{const _0x2fab5b=await listDatasets(_0x1d3852[_0x194bf2(0x172)]);if(_0x2fab5b[_0x194bf2(0x1aa)]===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x26595e=_0x2fab5b[_0x194bf2(0x175)](_0x55f93c=>_0x55f93c[_0x194bf2(0x1b2)]+'\x20('+_0x55f93c[_0x194bf2(0x1b8)]+')'),_0x582acd=await promptSelect(_0x194bf2(0x198),_0x26595e),_0x3a33a9=_0x2fab5b[_0x582acd];if(!_0x3a33a9)throw CliErrors['validation'](_0x194bf2(0x17c));_0x5ab368=_0x3a33a9[_0x194bf2(0x1b8)],_0x11ad1e=undefined;}}}}const _0x502a88=await listDatasets(_0x1d3852[_0x194bf2(0x172)]),_0x22fd49=_0x502a88['find'](_0x4b624e=>_0x4b624e[_0x194bf2(0x1b8)]===_0x5ab368);if(!_0x22fd49)throw CliErrors[_0x194bf2(0x1c1)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x5ab368+_0x194bf2(0x18f)+(_0x11ad1e?_0x194bf2(0x18c)+CLI_BIN_NAME+_0x194bf2(0x1ac):''));_0xcf9123=_0x22fd49['id'];const _0x1eb0d1=_0x11ad1e??_0x5ab368,_0x456164=await listBffDatasetOperations(_0x1d3852[_0x194bf2(0x172)],_0xcf9123),_0x21bb04=_0x456164?Object[_0x194bf2(0x194)](_0x456164):[];if(_0x21bb04[_0x194bf2(0x1aa)]===0x0)throw CliErrors['validation']('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x1eb0d1+'.');let _0x487b8e;const _0xda05ee=_0x1d3852[_0x194bf2(0x195)](_0x194bf2(0x19e));if(_0xda05ee){if(!_0x21bb04[_0x194bf2(0x1bd)](_0xda05ee))throw CliErrors[_0x194bf2(0x1c1)](_0x194bf2(0x1b5)+_0xda05ee+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x1eb0d1+'.\x20'+('Available:\x20'+_0x21bb04[_0x194bf2(0x1ae)](',\x20')));_0x487b8e=_0xda05ee;}else{if(_0x1d3852[_0x194bf2(0x17f)])throw CliErrors[_0x194bf2(0x1c1)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x133772=await promptSelect(_0x194bf2(0x1a9),_0x21bb04);_0x487b8e=_0x21bb04[_0x133772]??_0x21bb04[0x0];}let _0x5ebb02=normalizeHookFunctionNode(_0x1d3852[_0x194bf2(0x195)]('function-node'));if(!_0x5ebb02){if(_0x1d3852[_0x194bf2(0x195)](_0x194bf2(0x192)))throw CliErrors[_0x194bf2(0x1c1)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x1d3852['nonInteractive'])throw CliErrors['validation'](_0x194bf2(0x178));const _0x2f5401=await promptSelect(_0x194bf2(0x180),[_0x194bf2(0x177),'after']);_0x5ebb02=[_0x194bf2(0x177),_0x194bf2(0x17d)][_0x2f5401]??_0x194bf2(0x177);}return{'alias':_0x11ad1e,'datasetCode':_0x5ab368,'datasetId':_0xcf9123,'operationType':_0x487b8e,'functionNode':_0x5ebb02};}async function promptSelect(_0x15ac0b,_0x5cd1eb){const _0x554b03=a30_0xa62f8d;if(_0x5cd1eb[_0x554b03(0x1aa)]===0x1)return 0x0;for(const [_0x485be2,_0x14da09]of _0x5cd1eb[_0x554b03(0x1c3)]()){process[_0x554b03(0x173)][_0x554b03(0x1af)]('\x20\x20'+(_0x485be2+0x1)+'.\x20'+_0x14da09+'\x0a');}const _0x1e62c4=createInterface({'input':process[_0x554b03(0x1a5)],'output':process[_0x554b03(0x173)]});while(!![]){const _0x2e2463=await new Promise(_0x41bc19=>{const _0x11ce27=_0x554b03;_0x1e62c4[_0x11ce27(0x1c2)](_0x15ac0b+'\x20',_0x41bc19);}),_0x36697a=Number[_0x554b03(0x1b1)](_0x2e2463[_0x554b03(0x182)](),0xa);if(Number[_0x554b03(0x18a)](_0x36697a)&&_0x36697a>=0x1&&_0x36697a<=_0x5cd1eb[_0x554b03(0x1aa)])return _0x1e62c4[_0x554b03(0x1ba)](),_0x36697a-0x1;process[_0x554b03(0x173)][_0x554b03(0x1af)](_0x554b03(0x193)+_0x5cd1eb[_0x554b03(0x1aa)]+'.\x0a');}}function buildFilePath(_0x16c9b1,_0xdfa81d,_0x15dbee,_0x4d40ae){const _0xf7a49e=a30_0xa62f8d;if(_0xdfa81d===_0xf7a49e(0x1a2)){if(!_0x4d40ae)throw CliErrors[_0xf7a49e(0x1c1)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x177a38=_0x4d40ae[_0xf7a49e(0x1c6)]??_0x4d40ae['datasetCode'];return join(_0x16c9b1[_0xf7a49e(0x18d)],'HOOK',_0x177a38,_0x4d40ae[_0xf7a49e(0x197)],_0x4d40ae[_0xf7a49e(0x181)],_0x15dbee+_0xf7a49e(0x1a8));}return join(_0x16c9b1[_0xf7a49e(0x18d)],_0xdfa81d,_0x15dbee+_0xf7a49e(0x1a8));}export function generateTemplate(_0x3e5459,_0x5f1fba,_0x5ce0d7,_0x378029,_0x27ea2d){const _0x38f331=a30_0xa62f8d,_0x3a9ce9=_0x378029?.[_0x38f331(0x182)]()||_0x38f331(0x199);if(_0x3e5459==='COMMON')return _0x38f331(0x1b0)+_0x3a9ce9+_0x38f331(0x1a7)+_0x5f1fba+_0x38f331(0x1ad)+_0x5f1fba+_0x38f331(0x1a6)+_0x5f1fba+_0x38f331(0x19c);if(_0x3e5459===_0x38f331(0x19f))return _0x38f331(0x187)+_0x3a9ce9+_0x38f331(0x1a0)+_0x5ce0d7+'/'+_0x5f1fba+_0x38f331(0x190)+_0x5f1fba+_0x38f331(0x19c);if(!_0x27ea2d)throw CliErrors['validation'](_0x38f331(0x1c4));return _0x38f331(0x19a)+_0x3a9ce9+_0x38f331(0x176)+_0x5ce0d7+'/'+_0x27ea2d[_0x38f331(0x1bb)]+'/'+_0x27ea2d[_0x38f331(0x197)]+_0x38f331(0x183)+_0x27ea2d[_0x38f331(0x181)]+_0x38f331(0x174)+_0x5f1fba+_0x38f331(0x19c);}
@@ -1 +1 @@
1
- const a30_0x1227c1=a30_0x51fb;(function(_0x2a24cc,_0x2b496e){const _0x1bc683=a30_0x51fb,_0x5afca5=_0x2a24cc();while(!![]){try{const _0x5a34f2=-parseInt(_0x1bc683(0x200))/0x1*(parseInt(_0x1bc683(0x1f1))/0x2)+parseInt(_0x1bc683(0x201))/0x3*(parseInt(_0x1bc683(0x1f5))/0x4)+-parseInt(_0x1bc683(0x1fe))/0x5+-parseInt(_0x1bc683(0x1f8))/0x6+parseInt(_0x1bc683(0x1fd))/0x7*(-parseInt(_0x1bc683(0x216))/0x8)+-parseInt(_0x1bc683(0x1eb))/0x9+parseInt(_0x1bc683(0x1fb))/0xa*(parseInt(_0x1bc683(0x211))/0xb);if(_0x5a34f2===_0x2b496e)break;else _0x5afca5['push'](_0x5afca5['shift']());}catch(_0x49a516){_0x5afca5['push'](_0x5afca5['shift']());}}}(a30_0x1f1d,0x5219c));function a30_0x1f1d(){const _0x3d4baf=['21TpjLij','2079cTjlLo','datasetCode','stderr','operationType','validation','Remote\x20script\x20missing\x20content.','No\x20remote\x20BFF\x20scripts\x20found.','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','hookLocation','write','str','bff','yes','skipped','question','filePath','11OXDIdg','apiDir','hash','stringify','COMMON','114280cedSTC','Force\x20overwrite\x20local\x20unsynced\x20changes','scriptType','conflict','lockKey','Force\x20pull\x20cancelled.','local\x20unsynced\x20changes','functionName','push','Pull\x20complete:\x20','scriptContent','GET','map','\x22\x20not\x20found\x20after\x20ensureLockScope.','bool','close','alias','parse','string','length','all','lockFilePath','includes','force','message','scriptsRoot','pull','nonInteractive','\x20failed','appCode','would_pull','3415383OwAqkP','functionNode','ENDPOINT','Pull\x20only\x20this\x20script\x20type','apps','Lock\x20scope\x20for\x20app\x20\x22','19954pfgkNs','type','functions','cancelled','3020hNuWtm','version','toISOString','1420890KRpGeO','\x20pulled,\x20','lastSync','17621960uhUToV','\x20remote\x20BFF\x20script(s)\x20for\x20pull','238OldMYX','3188090assWAI','stdin'];a30_0x1f1d=function(){return _0x3d4baf;};return a30_0x1f1d();}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';function a30_0x51fb(_0x47a872,_0x2a610d){_0x47a872=_0x47a872-0x1ea;const _0x1f1df1=a30_0x1f1d();let _0x51fbfb=_0x1f1df1[_0x47a872];return _0x51fbfb;}import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a30_0x1227c1(0x20c),'command':'pull','description':a30_0x1227c1(0x208),'risk':a30_0x1227c1(0x20a),'flags':[{'name':a30_0x1227c1(0x1f2),'type':a30_0x1227c1(0x228),'description':a30_0x1227c1(0x1ee),'enum':[a30_0x1227c1(0x215),a30_0x1227c1(0x1ed),'HOOK']},{'name':a30_0x1227c1(0x22d),'type':'boolean','description':a30_0x1227c1(0x217)}],async 'dryRun'(_0x485e94){const _0x1b0404=a30_0x1227c1,_0x5aafad=loadBffProjectConfig(_0x485e94['appCode']),_0x3854fb=await readBffLockFile(_0x5aafad[_0x1b0404(0x22b)]),{appLock:_0x101e65}=ensureLockScope(_0x3854fb??createEmptyBffLock(),_0x485e94['appCode'],_0x5aafad[_0x1b0404(0x22f)],_0x1b0404(0x230)),_0x4e1c73=normalizeBffType(_0x485e94[_0x1b0404(0x20b)]('type'))??undefined,_0x4de593=buildDatasetCodeToAliasMap(_0x485e94[_0x1b0404(0x212)],_0x485e94[_0x1b0404(0x233)]),[_0xd06a8c,_0x42385d]=await Promise[_0x1b0404(0x22a)]([listBffScripts(_0x485e94[_0x1b0404(0x233)],_0x4e1c73),getBffScriptStatistics(_0x485e94['appCode'])]),_0x5eca0a=createHookLocationMap(_0x42385d),_0x3a95a8=[];for(const _0x18fa4e of _0xd06a8c){const _0x1cbc3c=resolveRemoteScriptTarget(_0x5aafad,_0x18fa4e,_0x5eca0a,_0x101e65[_0x1b0404(0x1f3)],_0x4de593);if(!_0x1cbc3c){_0x3a95a8[_0x1b0404(0x21e)]({'scriptType':_0x18fa4e[_0x1b0404(0x218)],'functionName':_0x18fa4e[_0x1b0404(0x21d)]??'','status':_0x1b0404(0x20e),'reason':'unresolvable\x20target\x20path'});continue;}const _0x559997=_0x101e65[_0x1b0404(0x1f3)][_0x1cbc3c['lockKey']],_0x595265=_0x18fa4e['scriptContent']!=null?computeContentHash(_0x18fa4e['scriptContent']):undefined,_0xe31f88=await hasUnsyncedLocalChanges(_0x1cbc3c[_0x1b0404(0x210)],_0x559997,_0x595265);_0x3a95a8[_0x1b0404(0x21e)]({'lockKey':_0x1cbc3c[_0x1b0404(0x21a)],'filePath':_0x1cbc3c[_0x1b0404(0x210)],'remoteId':_0x18fa4e['id']??null,'status':_0xe31f88?_0x1b0404(0x219):_0x1b0404(0x1ea)});}return{'method':_0x1b0404(0x221),'url':'/api/management/library/scripts/list?appCode='+_0x485e94[_0x1b0404(0x233)]+(_0x4e1c73?'&type='+_0x4e1c73:''),'body':{'appCode':_0x485e94[_0x1b0404(0x233)],'filterType':_0x4e1c73??null,'files':_0x3a95a8},'description':'Would\x20inspect\x20'+_0x3a95a8[_0x1b0404(0x229)]+_0x1b0404(0x1fc)};},async 'execute'(_0x1a5c12){const _0x110823=a30_0x1227c1,_0x24b5f2=loadBffProjectConfig(_0x1a5c12[_0x110823(0x233)]),_0x51527c=await readBffLockFile(_0x24b5f2[_0x110823(0x22b)]),{lockData:_0x549f37,appLock:_0x48ed2e}=ensureLockScope(_0x51527c??createEmptyBffLock(),_0x1a5c12['appCode'],_0x24b5f2[_0x110823(0x22f)],'pull'),_0x4daa99=normalizeBffType(_0x1a5c12[_0x110823(0x20b)]('type'))??undefined;if(_0x1a5c12[_0x110823(0x20b)]('type')&&!_0x4daa99)throw CliErrors[_0x110823(0x205)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0xf03967,_0x131185]=await Promise[_0x110823(0x22a)]([listBffScripts(_0x1a5c12[_0x110823(0x233)],_0x4daa99),getBffScriptStatistics(_0x1a5c12[_0x110823(0x233)])]);if(_0xf03967[_0x110823(0x229)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x110823(0x207)};const _0x5d57b8=_0x1a5c12[_0x110823(0x224)]('force');if(_0x5d57b8&&!_0x1a5c12[_0x110823(0x231)]){const _0x45f146=await confirmForce();if(!_0x45f146)throw CliErrors[_0x110823(0x1f4)](_0x110823(0x21b));}if(_0x5d57b8&&_0x1a5c12[_0x110823(0x231)]){}const _0x36401c=buildDatasetCodeToAliasMap(_0x1a5c12['apiDir'],_0x1a5c12['appCode']),_0x4df1de=createHookLocationMap(_0x131185),_0x47a2b0=JSON[_0x110823(0x227)](JSON[_0x110823(0x214)](_0x549f37)),_0x3c2b7b=_0x1a5c12[_0x110823(0x233)],_0x522fb7=_0x47a2b0[_0x110823(0x1ef)][_0x3c2b7b];if(!_0x522fb7)throw new Error(_0x110823(0x1f0)+_0x3c2b7b+_0x110823(0x223));const _0x1d32c2=[],_0xf82deb=[],_0x596474=[];for(const _0x2d564e of _0xf03967){const _0x355b9b=resolveRemoteScriptTarget(_0x24b5f2,_0x2d564e,_0x4df1de,_0x48ed2e['functions'],_0x36401c);if(!_0x355b9b){_0xf82deb[_0x110823(0x21e)]({'lockKey':_0x2d564e['scriptType']+'/'+_0x2d564e[_0x110823(0x21d)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x6a300e=_0x48ed2e[_0x110823(0x1f3)][_0x355b9b[_0x110823(0x21a)]];try{if(!_0x2d564e['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x2d564e['scriptContent']==null)throw new Error(_0x110823(0x206));const _0x2b4a08=_0x2d564e[_0x110823(0x220)],_0x1f47f5=computeContentHash(_0x2b4a08);if(!_0x5d57b8){const _0x25f3aa=await hasUnsyncedLocalChanges(_0x355b9b[_0x110823(0x210)],_0x6a300e,_0x1f47f5);if(_0x25f3aa){_0xf82deb[_0x110823(0x21e)]({'lockKey':_0x355b9b['lockKey'],'reason':_0x110823(0x21c)});continue;}}await ensureParentDirectory(_0x355b9b[_0x110823(0x210)]),await writeFile(_0x355b9b['filePath'],_0x2b4a08,'utf8');const _0xdd0d={'hash':_0x1f47f5,'remoteId':_0x2d564e['id'],'version':_0x2d564e[_0x110823(0x1f6)]};_0x355b9b['type']==='HOOK'&&_0x355b9b['hookLocation']&&(_0xdd0d[_0x110823(0x226)]=_0x355b9b[_0x110823(0x209)][_0x110823(0x226)],_0xdd0d['datasetCode']=_0x355b9b[_0x110823(0x209)][_0x110823(0x202)],_0xdd0d[_0x110823(0x204)]=_0x355b9b['hookLocation'][_0x110823(0x204)],_0xdd0d[_0x110823(0x1ec)]=_0x355b9b[_0x110823(0x209)][_0x110823(0x1ec)]),_0x522fb7['functions'][_0x355b9b[_0x110823(0x21a)]]=_0xdd0d,_0x1d32c2[_0x110823(0x21e)]({'lockKey':_0x355b9b[_0x110823(0x21a)],'remoteId':_0x2d564e['id']});}catch(_0x51dc2c){_0x596474[_0x110823(0x21e)]({'lockKey':_0x355b9b['lockKey'],'error':_0x51dc2c instanceof Error?_0x51dc2c[_0x110823(0x22e)]:String(_0x51dc2c)});}}return _0x522fb7[_0x110823(0x1fa)]=new Date()[_0x110823(0x1f7)](),await writeBffLockFile(_0x24b5f2[_0x110823(0x22b)],_0x47a2b0),{'ok':_0x596474[_0x110823(0x229)]===0x0,'data':{'pulled':_0x1d32c2,'skipped':_0xf82deb,'failed':_0x596474},'message':_0x110823(0x21f)+_0x1d32c2['length']+_0x110823(0x1f9)+_0xf82deb['length']+'\x20skipped,\x20'+_0x596474[_0x110823(0x229)]+_0x110823(0x232)};}};async function hasUnsyncedLocalChanges(_0x3c9110,_0x59e9d0,_0xedfdaf){const _0x4110a1=a30_0x1227c1;if(!await fileExists(_0x3c9110))return![];const _0x201897=await computeFileHash(_0x3c9110);if(!_0x59e9d0)return _0xedfdaf?_0x201897!==_0xedfdaf:!![];return _0x201897!==_0x59e9d0[_0x4110a1(0x213)];}function buildDatasetCodeToAliasMap(_0x1ef936,_0x306ab4){const _0x1c1382=a30_0x1227c1,_0x2e6321=loadAliasMap(_0x1ef936,undefined,resolveApiFilePath(_0x1ef936,_0x306ab4));return new Map(_0x2e6321[_0x1c1382(0x222)](_0x20bcf7=>[_0x20bcf7[_0x1c1382(0x202)],_0x20bcf7[_0x1c1382(0x226)]]));}async function confirmForce(){const _0x48744c=a30_0x1227c1,_0x10dc4e=createInterface({'input':process[_0x48744c(0x1ff)],'output':process[_0x48744c(0x203)]}),_0x2a7399=await new Promise(_0x290f97=>{const _0x5bf377=_0x48744c;_0x10dc4e[_0x5bf377(0x20f)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x290f97);});return _0x10dc4e[_0x48744c(0x225)](),['y',_0x48744c(0x20d)][_0x48744c(0x22c)](_0x2a7399['trim']()['toLowerCase']());}
1
+ const a31_0x28add1=a31_0xfb00;(function(_0x18573e,_0x54f16d){const _0x4ecd7d=a31_0xfb00,_0x3ab76d=_0x18573e();while(!![]){try{const _0x3a305f=parseInt(_0x4ecd7d(0x16c))/0x1+-parseInt(_0x4ecd7d(0x18e))/0x2+-parseInt(_0x4ecd7d(0x185))/0x3*(parseInt(_0x4ecd7d(0x172))/0x4)+parseInt(_0x4ecd7d(0x154))/0x5+-parseInt(_0x4ecd7d(0x161))/0x6+-parseInt(_0x4ecd7d(0x18d))/0x7*(-parseInt(_0x4ecd7d(0x15e))/0x8)+parseInt(_0x4ecd7d(0x17c))/0x9;if(_0x3a305f===_0x54f16d)break;else _0x3ab76d['push'](_0x3ab76d['shift']());}catch(_0x131459){_0x3ab76d['push'](_0x3ab76d['shift']());}}}(a31_0x200b,0x58203));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a31_0xfb00(_0x5b91b,_0x560c94){_0x5b91b=_0x5b91b-0x147;const _0x200b81=a31_0x200b();let _0xfb0048=_0x200b81[_0x5b91b];return _0xfb0048;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a31_0x28add1(0x177),'description':a31_0x28add1(0x174),'risk':a31_0x28add1(0x148),'flags':[{'name':'type','type':a31_0x28add1(0x156),'description':a31_0x28add1(0x15f),'enum':[a31_0x28add1(0x17f),a31_0x28add1(0x163),a31_0x28add1(0x16f)]},{'name':a31_0x28add1(0x187),'type':a31_0x28add1(0x14e),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x417b6b){const _0x4ef370=a31_0x28add1,_0x5d3538=loadBffProjectConfig(_0x417b6b[_0x4ef370(0x17d)]),_0x2bc2df=await readBffLockFile(_0x5d3538[_0x4ef370(0x158)]),{appLock:_0x162e24}=ensureLockScope(_0x2bc2df??createEmptyBffLock(),_0x417b6b[_0x4ef370(0x17d)],_0x5d3538[_0x4ef370(0x166)],'pull'),_0x14e5bc=normalizeBffType(_0x417b6b[_0x4ef370(0x17a)]('type'))??undefined,_0x584c6d=buildDatasetCodeToAliasMap(_0x417b6b['apiDir'],_0x417b6b[_0x4ef370(0x17d)]),[_0x4e9862,_0x2d2e4f]=await Promise[_0x4ef370(0x184)]([listBffScripts(_0x417b6b['appCode'],_0x14e5bc),getBffScriptStatistics(_0x417b6b[_0x4ef370(0x17d)])]),_0x3c97f9=createHookLocationMap(_0x2d2e4f),_0x3a2c6c=[];for(const _0xd6c6ef of _0x4e9862){const _0x1c41ea=resolveRemoteScriptTarget(_0x5d3538,_0xd6c6ef,_0x3c97f9,_0x162e24[_0x4ef370(0x14c)],_0x584c6d);if(!_0x1c41ea){_0x3a2c6c[_0x4ef370(0x18a)]({'scriptType':_0xd6c6ef['scriptType'],'functionName':_0xd6c6ef[_0x4ef370(0x169)]??'','status':'skipped','reason':_0x4ef370(0x18c)});continue;}const _0x41c0b3=_0x162e24[_0x4ef370(0x14c)][_0x1c41ea['lockKey']],_0x1a870e=_0xd6c6ef[_0x4ef370(0x188)]!=null?computeContentHash(_0xd6c6ef[_0x4ef370(0x188)]):undefined,_0xa4d3b2=await hasUnsyncedLocalChanges(_0x1c41ea['filePath'],_0x41c0b3,_0x1a870e);_0x3a2c6c[_0x4ef370(0x18a)]({'lockKey':_0x1c41ea[_0x4ef370(0x16b)],'filePath':_0x1c41ea[_0x4ef370(0x16d)],'remoteId':_0xd6c6ef['id']??null,'status':_0xa4d3b2?_0x4ef370(0x151):_0x4ef370(0x15c)});}return{'method':'GET','url':_0x4ef370(0x15d)+_0x417b6b[_0x4ef370(0x17d)]+(_0x14e5bc?'&type='+_0x14e5bc:''),'body':{'appCode':_0x417b6b[_0x4ef370(0x17d)],'filterType':_0x14e5bc??null,'files':_0x3a2c6c},'description':'Would\x20inspect\x20'+_0x3a2c6c['length']+_0x4ef370(0x15a)};},async 'execute'(_0x404c35){const _0x29dd09=a31_0x28add1,_0x544338=loadBffProjectConfig(_0x404c35[_0x29dd09(0x17d)]),_0x44e9ae=await readBffLockFile(_0x544338['lockFilePath']),{lockData:_0xa4e89e,appLock:_0x1dbf2d}=ensureLockScope(_0x44e9ae??createEmptyBffLock(),_0x404c35[_0x29dd09(0x17d)],_0x544338['scriptsRoot'],_0x29dd09(0x177)),_0x3893f8=normalizeBffType(_0x404c35[_0x29dd09(0x17a)](_0x29dd09(0x153)))??undefined;if(_0x404c35['str'](_0x29dd09(0x153))&&!_0x3893f8)throw CliErrors['validation'](_0x29dd09(0x14f));const [_0xf7d8f6,_0x43faad]=await Promise[_0x29dd09(0x184)]([listBffScripts(_0x404c35[_0x29dd09(0x17d)],_0x3893f8),getBffScriptStatistics(_0x404c35[_0x29dd09(0x17d)])]);if(_0xf7d8f6[_0x29dd09(0x160)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x29dd09(0x171)};const _0x7b7bd1=_0x404c35['bool'](_0x29dd09(0x187));if(_0x7b7bd1&&!_0x404c35[_0x29dd09(0x17e)]){const _0xa9a8f3=await confirmForce();if(!_0xa9a8f3)throw CliErrors[_0x29dd09(0x170)](_0x29dd09(0x14a));}if(_0x7b7bd1&&_0x404c35['nonInteractive']){}const _0x120a8f=buildDatasetCodeToAliasMap(_0x404c35[_0x29dd09(0x159)],_0x404c35['appCode']),_0x2829a2=createHookLocationMap(_0x43faad),_0x453503=JSON[_0x29dd09(0x175)](JSON[_0x29dd09(0x181)](_0xa4e89e)),_0xda05cf=_0x404c35[_0x29dd09(0x17d)],_0x7833a9=_0x453503[_0x29dd09(0x15b)][_0xda05cf];if(!_0x7833a9)throw new Error(_0x29dd09(0x179)+_0xda05cf+_0x29dd09(0x14d));const _0x1def1f=[],_0x319bbb=[],_0x34c94f=[];for(const _0xe509f6 of _0xf7d8f6){const _0x57f02d=resolveRemoteScriptTarget(_0x544338,_0xe509f6,_0x2829a2,_0x1dbf2d['functions'],_0x120a8f);if(!_0x57f02d){_0x319bbb[_0x29dd09(0x18a)]({'lockKey':_0xe509f6[_0x29dd09(0x14b)]+'/'+_0xe509f6['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x167625=_0x1dbf2d['functions'][_0x57f02d[_0x29dd09(0x16b)]];try{if(!_0xe509f6['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0xe509f6[_0x29dd09(0x188)]==null)throw new Error(_0x29dd09(0x168));const _0x14613f=_0xe509f6[_0x29dd09(0x188)],_0x3e4e02=computeContentHash(_0x14613f);if(!_0x7b7bd1){const _0x549339=await hasUnsyncedLocalChanges(_0x57f02d[_0x29dd09(0x16d)],_0x167625,_0x3e4e02);if(_0x549339){_0x319bbb[_0x29dd09(0x18a)]({'lockKey':_0x57f02d[_0x29dd09(0x16b)],'reason':_0x29dd09(0x165)});continue;}}await ensureParentDirectory(_0x57f02d[_0x29dd09(0x16d)]),await writeFile(_0x57f02d[_0x29dd09(0x16d)],_0x14613f,_0x29dd09(0x182));const _0x3c10e9={'hash':_0x3e4e02,'remoteId':_0xe509f6['id'],'version':_0xe509f6[_0x29dd09(0x162)]};_0x57f02d[_0x29dd09(0x153)]===_0x29dd09(0x16f)&&_0x57f02d[_0x29dd09(0x149)]&&(_0x3c10e9[_0x29dd09(0x178)]=_0x57f02d[_0x29dd09(0x149)][_0x29dd09(0x178)],_0x3c10e9[_0x29dd09(0x186)]=_0x57f02d[_0x29dd09(0x149)][_0x29dd09(0x186)],_0x3c10e9[_0x29dd09(0x180)]=_0x57f02d[_0x29dd09(0x149)]['operationType'],_0x3c10e9[_0x29dd09(0x150)]=_0x57f02d[_0x29dd09(0x149)][_0x29dd09(0x150)]),_0x7833a9[_0x29dd09(0x14c)][_0x57f02d[_0x29dd09(0x16b)]]=_0x3c10e9,_0x1def1f['push']({'lockKey':_0x57f02d['lockKey'],'remoteId':_0xe509f6['id']});}catch(_0x214dce){_0x34c94f[_0x29dd09(0x18a)]({'lockKey':_0x57f02d[_0x29dd09(0x16b)],'error':_0x214dce instanceof Error?_0x214dce[_0x29dd09(0x157)]:String(_0x214dce)});}}return _0x7833a9[_0x29dd09(0x176)]=new Date()[_0x29dd09(0x173)](),await writeBffLockFile(_0x544338[_0x29dd09(0x158)],_0x453503),{'ok':_0x34c94f[_0x29dd09(0x160)]===0x0,'data':{'pulled':_0x1def1f,'skipped':_0x319bbb,'failed':_0x34c94f},'message':'Pull\x20complete:\x20'+_0x1def1f['length']+'\x20pulled,\x20'+_0x319bbb[_0x29dd09(0x160)]+_0x29dd09(0x147)+_0x34c94f[_0x29dd09(0x160)]+_0x29dd09(0x16e)};}};function a31_0x200b(){const _0xf581ff=['apps','would_pull','/api/management/library/scripts/list?appCode=','2555352mDqhWM','Pull\x20only\x20this\x20script\x20type','length','2904624NqGkKc','version','ENDPOINT','close','local\x20unsynced\x20changes','scriptsRoot','map','Remote\x20script\x20missing\x20content.','functionName','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','lockKey','643930cJAzPE','filePath','\x20failed','HOOK','cancelled','No\x20remote\x20BFF\x20scripts\x20found.','772TSsUyi','toISOString','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','parse','lastSync','pull','alias','Lock\x20scope\x20for\x20app\x20\x22','str','question','3716136Ekxjga','appCode','nonInteractive','COMMON','operationType','stringify','utf8','includes','all','10536xuXriu','datasetCode','force','scriptContent','yes','push','trim','unresolvable\x20target\x20path','7QUEYoY','570578ZCOfLp','\x20skipped,\x20','write','hookLocation','Force\x20pull\x20cancelled.','scriptType','functions','\x22\x20not\x20found\x20after\x20ensureLockScope.','boolean','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','functionNode','conflict','stdin','type','2159595OqefTx','toLowerCase','string','message','lockFilePath','apiDir','\x20remote\x20BFF\x20script(s)\x20for\x20pull'];a31_0x200b=function(){return _0xf581ff;};return a31_0x200b();}async function hasUnsyncedLocalChanges(_0x57b236,_0x2661fe,_0x1eb714){if(!await fileExists(_0x57b236))return![];const _0x472372=await computeFileHash(_0x57b236);if(!_0x2661fe)return _0x1eb714?_0x472372!==_0x1eb714:!![];return _0x472372!==_0x2661fe['hash'];}function buildDatasetCodeToAliasMap(_0x627385,_0x4d7a50){const _0x388f1f=a31_0x28add1,_0x4613f7=loadAliasMap(_0x627385,undefined,resolveApiFilePath(_0x627385,_0x4d7a50));return new Map(_0x4613f7[_0x388f1f(0x167)](_0x3deea0=>[_0x3deea0[_0x388f1f(0x186)],_0x3deea0[_0x388f1f(0x178)]]));}async function confirmForce(){const _0x131fe0=a31_0x28add1,_0x52aab9=createInterface({'input':process[_0x131fe0(0x152)],'output':process['stderr']}),_0xe17dac=await new Promise(_0x2b5ed2=>{const _0x4c34e7=_0x131fe0;_0x52aab9[_0x4c34e7(0x17b)](_0x4c34e7(0x16a),_0x2b5ed2);});return _0x52aab9[_0x131fe0(0x164)](),['y',_0x131fe0(0x189)][_0x131fe0(0x183)](_0xe17dac[_0x131fe0(0x18b)]()[_0x131fe0(0x155)]());}
@@ -1 +1 @@
1
- function a31_0x1d99(){const _0x3d3e21=['Push\x20complete:\x20','would_push','Run\x20`','2mqdJcP','aliasToDatasetCode','/api/management/library/scripts/save','9bvCFTt','HOOK','functionNode','Cannot\x20resolve\x20dataset\x20for\x20\x22','\x22.\x20','set','version','filePath','apiDir','lastSync','appCode','hash','scriptsRoot','boolean','code','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','1769647TVaXUV','type','5931336oTagff','map','\x20local\x20BFF\x20script(s)\x20for\x20push','values','No\x20local\x20BFF\x20functions\x20found.','unchanged','Force\x20push\x20ignoring\x20hash\x20protection','bool','high-risk-write','622861YRRKyq','string','length','toISOString','datasetId','operationType','filter','lockFilePath','180SRVfmu','Local\x20function\x20not\x20found:\x20','4llVrPB','\x20skipped,\x20','datasetCodeToId','update','message',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','create','push','Incomplete\x20HOOK\x20path:\x20','POST','remoteId','5371452GYUirB','lockKey','1861027fouBoJ','str','name','get','validation','datasetCode','functions','3246535JFyELW','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','Push\x20local\x20BFF\x20scripts\x20to\x20remote','utf8','bff','has','alias','description','force','1373103asqYjq'];a31_0x1d99=function(){return _0x3d3e21;};return a31_0x1d99();}const a31_0x3e9e83=a31_0x2084;(function(_0x307df7,_0xa511de){const _0x2d5eb2=a31_0x2084,_0x34d17a=_0x307df7();while(!![]){try{const _0x504298=-parseInt(_0x2d5eb2(0x1da))/0x1*(-parseInt(_0x2d5eb2(0x205))/0x2)+parseInt(_0x2d5eb2(0x201))/0x3*(-parseInt(_0x2d5eb2(0x1e4))/0x4)+-parseInt(_0x2d5eb2(0x1f8))/0x5+-parseInt(_0x2d5eb2(0x1ef))/0x6+-parseInt(_0x2d5eb2(0x1f1))/0x7+-parseInt(_0x2d5eb2(0x1d1))/0x8*(parseInt(_0x2d5eb2(0x208))/0x9)+parseInt(_0x2d5eb2(0x1e2))/0xa*(parseInt(_0x2d5eb2(0x1cf))/0xb);if(_0x504298===_0xa511de)break;else _0x34d17a['push'](_0x34d17a['shift']());}catch(_0x3874c6){_0x34d17a['push'](_0x34d17a['shift']());}}}(a31_0x1d99,0x7c4bf));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a31_0x2084(_0x4fcbc,_0x7bc853){_0x4fcbc=_0x4fcbc-0x1c2;const _0x1d99b3=a31_0x1d99();let _0x208470=_0x1d99b3[_0x4fcbc];return _0x208470;}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a31_0x3e9e83(0x1fc),'command':a31_0x3e9e83(0x1eb),'description':a31_0x3e9e83(0x1fa),'risk':a31_0x3e9e83(0x1d9),'flags':[{'name':a31_0x3e9e83(0x1d0),'type':a31_0x3e9e83(0x1db),'description':'Push\x20only\x20this\x20script\x20type','enum':['COMMON','ENDPOINT','HOOK']},{'name':a31_0x3e9e83(0x1f3),'type':a31_0x3e9e83(0x1db),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a31_0x3e9e83(0x200),'type':a31_0x3e9e83(0x1cc),'description':a31_0x3e9e83(0x1d7)}],async 'dryRun'(_0x55608e){const _0x48f06b=a31_0x3e9e83,_0x320a3d=loadBffProjectConfig(_0x55608e[_0x48f06b(0x1c9)]),_0x30397e=await readBffLockFile(_0x320a3d[_0x48f06b(0x1e1)]),{appLock:_0x59f1da}=ensureLockScope(_0x30397e??createEmptyBffLock(),_0x55608e[_0x48f06b(0x1c9)],_0x320a3d[_0x48f06b(0x1cb)],_0x48f06b(0x1eb)),_0x327a5c=await getTargetFunctions(_0x320a3d,_0x55608e),_0x3c59f8=_0x55608e['bool'](_0x48f06b(0x200)),_0x391c54=[];for(const _0x1409f5 of _0x327a5c){const _0x4ec2cb=await computeFileHash(_0x1409f5[_0x48f06b(0x1c6)]),_0x2aa559=_0x59f1da[_0x48f06b(0x1f7)][_0x1409f5[_0x48f06b(0x1f0)]],_0x377b2c=!!_0x2aa559&&_0x2aa559['hash']===_0x4ec2cb;_0x391c54['push']({'lockKey':_0x1409f5['lockKey'],'filePath':_0x1409f5[_0x48f06b(0x1c6)],'remoteId':_0x2aa559?.[_0x48f06b(0x1ee)]??null,'mode':_0x2aa559?.[_0x48f06b(0x1ee)]?_0x48f06b(0x1e7):_0x48f06b(0x1ea),'status':!_0x3c59f8&&_0x377b2c?'unchanged':_0x48f06b(0x203)});}return{'method':_0x48f06b(0x1ed),'url':_0x48f06b(0x207),'body':{'appCode':_0x55608e[_0x48f06b(0x1c9)],'force':_0x3c59f8,'files':_0x391c54},'description':'Would\x20inspect\x20'+_0x391c54['length']+_0x48f06b(0x1d3)};},async 'execute'(_0x15b7cd){const _0x391697=a31_0x3e9e83,_0x42607c=loadBffProjectConfig(_0x15b7cd[_0x391697(0x1c9)]),_0x5de5d5=await readBffLockFile(_0x42607c[_0x391697(0x1e1)]),{lockData:_0x4f56fc,appLock:_0x36534c}=ensureLockScope(_0x5de5d5??createEmptyBffLock(),_0x15b7cd[_0x391697(0x1c9)],_0x42607c[_0x391697(0x1cb)],'push'),_0x487ecd=await getTargetFunctions(_0x42607c,_0x15b7cd);if(_0x487ecd[_0x391697(0x1dc)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x391697(0x1d5)};const _0x312b21=_0x15b7cd[_0x391697(0x1d8)](_0x391697(0x200)),_0x470450=await buildHookMaps(_0x15b7cd[_0x391697(0x1c9)],_0x15b7cd[_0x391697(0x1c7)],_0x487ecd,_0x36534c),_0x48125b=[],_0x2dff97=[],_0x409908=[];for(const _0x217e68 of _0x487ecd){const _0x20f991=await computeFileHash(_0x217e68[_0x391697(0x1c6)]),_0x49458f=_0x36534c['functions'][_0x217e68[_0x391697(0x1f0)]];if(!_0x312b21&&_0x49458f&&_0x49458f[_0x391697(0x1ca)]===_0x20f991){_0x2dff97[_0x391697(0x1eb)]({'lockKey':_0x217e68[_0x391697(0x1f0)],'reason':_0x391697(0x1d6)});continue;}try{await uploadSingleFunction(_0x15b7cd[_0x391697(0x1c9)],_0x217e68,_0x36534c,_0x470450);const _0x29b2a6=_0x36534c[_0x391697(0x1f7)][_0x217e68[_0x391697(0x1f0)]];_0x48125b[_0x391697(0x1eb)]({'lockKey':_0x217e68['lockKey'],'remoteId':_0x29b2a6?.[_0x391697(0x1ee)]??0x0});}catch(_0x2203cd){_0x409908[_0x391697(0x1eb)]({'lockKey':_0x217e68['lockKey'],'error':_0x2203cd instanceof Error?_0x2203cd[_0x391697(0x1e8)]:String(_0x2203cd)});}}return _0x36534c[_0x391697(0x1c8)]=new Date()[_0x391697(0x1dd)](),await writeBffLockFile(_0x42607c[_0x391697(0x1e1)],_0x4f56fc),{'ok':_0x409908[_0x391697(0x1dc)]===0x0,'data':{'uploaded':_0x48125b,'skipped':_0x2dff97,'failed':_0x409908},'message':_0x391697(0x202)+_0x48125b[_0x391697(0x1dc)]+'\x20uploaded,\x20'+_0x2dff97[_0x391697(0x1dc)]+_0x391697(0x1e5)+_0x409908[_0x391697(0x1dc)]+'\x20failed'};}};async function getTargetFunctions(_0x58038d,_0xc8a3bf){const _0x13145c=a31_0x3e9e83,_0x46df58=_0xc8a3bf['str'](_0x13145c(0x1d0)),_0x455eb8=_0xc8a3bf[_0x13145c(0x1f2)](_0x13145c(0x1f3)),_0x40c267=normalizeBffType(_0x46df58)??undefined;if(_0x455eb8&&!_0x40c267)throw CliErrors[_0x13145c(0x1f5)](_0x13145c(0x1ce));const _0x56923b=await scanLocalBffFunctions(_0x58038d,_0x40c267);if(_0x455eb8){const _0x3b673d=_0x56923b[_0x13145c(0x1e0)](_0x317a4b=>_0x317a4b[_0x13145c(0x1f3)]===_0x455eb8);if(_0x3b673d[_0x13145c(0x1dc)]===0x0)throw CliErrors[_0x13145c(0x1f5)](_0x13145c(0x1e3)+_0x40c267+'/'+_0x455eb8);return _0x3b673d;}return _0x56923b;}async function buildHookMaps(_0x123ef3,_0xe0cbd7,_0x250a5a,_0x89c682){const _0x5e5fc6=a31_0x3e9e83,_0x444370=_0x250a5a['some'](_0x925b05=>_0x925b05[_0x5e5fc6(0x1d0)]==='HOOK');if(!_0x444370)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x185aad=loadAliasMap(_0xe0cbd7,undefined,resolveApiFilePath(_0xe0cbd7,_0x123ef3)),_0x2bb43e=new Map(_0x185aad[_0x5e5fc6(0x1d2)](_0x13445d=>[_0x13445d['alias'],_0x13445d[_0x5e5fc6(0x1f6)]]));for(const _0x181510 of Object[_0x5e5fc6(0x1d4)](_0x89c682['functions'])){_0x181510[_0x5e5fc6(0x1fe)]&&_0x181510[_0x5e5fc6(0x1f6)]&&!_0x2bb43e['has'](_0x181510[_0x5e5fc6(0x1fe)])&&_0x2bb43e[_0x5e5fc6(0x1c4)](_0x181510[_0x5e5fc6(0x1fe)],_0x181510[_0x5e5fc6(0x1f6)]);}const _0x1b021d=await listDatasets(_0x123ef3),_0x242f06=new Map(_0x1b021d['map'](_0x5041dc=>[_0x5041dc[_0x5e5fc6(0x1cd)],_0x5041dc['id']]));return{'aliasToDatasetCode':_0x2bb43e,'datasetCodeToId':_0x242f06};}async function uploadSingleFunction(_0x4fa96e,_0x41e75e,_0x48a90e,_0x3470e6){const _0x41e06b=a31_0x3e9e83,_0x17e747=await readFile(_0x41e75e[_0x41e06b(0x1c6)],_0x41e06b(0x1fb)),_0x4a428b=await computeFileHash(_0x41e75e[_0x41e06b(0x1c6)]),_0x56f2eb=_0x48a90e['functions'][_0x41e75e[_0x41e06b(0x1f0)]];if(_0x56f2eb?.['remoteId']&&_0x56f2eb[_0x41e06b(0x1c5)]==null)throw CliErrors[_0x41e06b(0x1f5)](_0x41e75e[_0x41e06b(0x1f0)]+_0x41e06b(0x1e9));let _0x283bc2=extractScriptDescription(_0x17e747);if(!_0x283bc2&&_0x56f2eb?.[_0x41e06b(0x1ee)]){const _0x3c502b=await getBffScriptInfo(_0x56f2eb[_0x41e06b(0x1ee)]);_0x283bc2=_0x3c502b[_0x41e06b(0x1ff)]||undefined;}const _0x18c40d={'appCode':_0x4fa96e,'functionName':_0x41e75e[_0x41e06b(0x1f3)],'scriptType':_0x41e75e[_0x41e06b(0x1d0)],'scriptContent':_0x17e747};if(_0x56f2eb?.['remoteId'])_0x18c40d['id']=_0x56f2eb[_0x41e06b(0x1ee)];if(_0x56f2eb?.[_0x41e06b(0x1c5)]!=null)_0x18c40d[_0x41e06b(0x1c5)]=_0x56f2eb[_0x41e06b(0x1c5)];if(_0x283bc2)_0x18c40d['description']=_0x283bc2;if(_0x41e75e[_0x41e06b(0x1d0)]===_0x41e06b(0x209)){const _0x250c02=_0x41e75e[_0x41e06b(0x1fe)];if(!_0x250c02||!_0x41e75e[_0x41e06b(0x1df)]||!_0x41e75e['functionNode'])throw CliErrors[_0x41e06b(0x1f5)](_0x41e06b(0x1ec)+_0x41e75e[_0x41e06b(0x1f0)]);const _0x2a3385=_0x3470e6['aliasToDatasetCode']['get'](_0x250c02)??_0x56f2eb?.[_0x41e06b(0x1f6)]??_0x250c02,_0x50f459=_0x3470e6[_0x41e06b(0x1e6)]['get'](_0x2a3385);if(!_0x50f459)throw CliErrors[_0x41e06b(0x1f5)](_0x41e06b(0x1c2)+_0x250c02+_0x41e06b(0x1c3)+(_0x41e06b(0x204)+CLI_BIN_NAME+_0x41e06b(0x1f9)));_0x18c40d[_0x41e06b(0x1de)]=_0x50f459,_0x18c40d[_0x41e06b(0x1df)]=_0x41e75e[_0x41e06b(0x1df)],_0x18c40d['functionNode']=_0x41e75e['functionNode'];}const _0x357c74=await saveBffScript(_0x18c40d),_0x48428e=await getBffScriptInfo(_0x357c74),_0x4eb957={'hash':_0x4a428b,'remoteId':_0x357c74,'version':_0x48428e[_0x41e06b(0x1c5)]};if(_0x41e75e[_0x41e06b(0x1d0)]===_0x41e06b(0x209)){const _0x3b5ecf=_0x41e75e[_0x41e06b(0x1fe)],_0x21e43d=_0x3470e6[_0x41e06b(0x206)][_0x41e06b(0x1f4)](_0x3b5ecf)??_0x56f2eb?.[_0x41e06b(0x1f6)]??_0x3b5ecf;_0x3470e6[_0x41e06b(0x206)][_0x41e06b(0x1fd)](_0x3b5ecf)?_0x4eb957[_0x41e06b(0x1fe)]=_0x3b5ecf:_0x4eb957[_0x41e06b(0x1fe)]=_0x56f2eb?.[_0x41e06b(0x1fe)],_0x4eb957[_0x41e06b(0x1f6)]=_0x21e43d,_0x4eb957[_0x41e06b(0x1df)]=_0x41e75e[_0x41e06b(0x1df)],_0x4eb957['functionNode']=_0x41e75e[_0x41e06b(0x20a)];}_0x48a90e['functions'][_0x41e75e[_0x41e06b(0x1f0)]]=_0x4eb957;}
1
+ const a32_0x1566bc=a32_0x1e75;function a32_0x1e75(_0x926775,_0x4f5113){_0x926775=_0x926775-0xfb;const _0x1e1f92=a32_0x1e1f();let _0x1e7504=_0x1e1f92[_0x926775];return _0x1e7504;}(function(_0x7e3e8a,_0x596417){const _0xa2ba17=a32_0x1e75,_0x3ae0a2=_0x7e3e8a();while(!![]){try{const _0x111dab=-parseInt(_0xa2ba17(0x12d))/0x1*(-parseInt(_0xa2ba17(0x103))/0x2)+parseInt(_0xa2ba17(0x13c))/0x3+-parseInt(_0xa2ba17(0x129))/0x4*(-parseInt(_0xa2ba17(0x116))/0x5)+parseInt(_0xa2ba17(0x131))/0x6*(-parseInt(_0xa2ba17(0x112))/0x7)+parseInt(_0xa2ba17(0x110))/0x8*(parseInt(_0xa2ba17(0x130))/0x9)+-parseInt(_0xa2ba17(0x104))/0xa*(parseInt(_0xa2ba17(0x101))/0xb)+-parseInt(_0xa2ba17(0x121))/0xc*(parseInt(_0xa2ba17(0xfd))/0xd);if(_0x111dab===_0x596417)break;else _0x3ae0a2['push'](_0x3ae0a2['shift']());}catch(_0x419e34){_0x3ae0a2['push'](_0x3ae0a2['shift']());}}}(a32_0x1e1f,0x90af2));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 a32_0x1e1f(){const _0x2e4fe4=['datasetCodeToId','some','version','ENDPOINT','name','alias','map','datasetId','24483212koLgWs','\x20local\x20BFF\x20script(s)\x20for\x20push','force','values','6721ZYYvNR','bool','2lUldgQ','13630BDHPHF','Push\x20complete:\x20','unchanged','POST','get','remoteId','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','push','HOOK','lockFilePath','\x20uploaded,\x20','Would\x20inspect\x20','64MeiGJR','has','21LtwHPM','\x20failed','No\x20local\x20BFF\x20functions\x20found.','datasetCode','15honIHe','str','string','type','COMMON','operationType',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','appCode','set','filePath','functions','12iskFqt','aliasToDatasetCode','Push\x20only\x20this\x20script\x20type','Local\x20function\x20not\x20found:\x20','scriptsRoot','filter','update','/api/management/library/scripts/save','1300108fVntqQ','code','bff','create','1184184oIMMuS','length','apiDir','209862iPaHcz','149238sJThld','description','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','message','validation','functionNode','\x20skipped,\x20','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','hash','lockKey','\x22.\x20','3112659tlsvMQ'];a32_0x1e1f=function(){return _0x2e4fe4;};return a32_0x1e1f();}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_0x1566bc(0x12b),'command':a32_0x1566bc(0x10b),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':'high-risk-write','flags':[{'name':'type','type':a32_0x1566bc(0x118),'description':a32_0x1566bc(0x123),'enum':[a32_0x1566bc(0x11a),a32_0x1566bc(0x140),'HOOK']},{'name':a32_0x1566bc(0x141),'type':'string','description':a32_0x1566bc(0x133)},{'name':'force','type':'boolean','description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x3e5acc){const _0x1b1690=a32_0x1566bc,_0x1a4d2c=loadBffProjectConfig(_0x3e5acc[_0x1b1690(0x11d)]),_0xa8ba60=await readBffLockFile(_0x1a4d2c[_0x1b1690(0x10d)]),{appLock:_0x1336af}=ensureLockScope(_0xa8ba60??createEmptyBffLock(),_0x3e5acc['appCode'],_0x1a4d2c[_0x1b1690(0x125)],'push'),_0x4dc4d2=await getTargetFunctions(_0x1a4d2c,_0x3e5acc),_0x1b96a4=_0x3e5acc['bool'](_0x1b1690(0xff)),_0x1fb296=[];for(const _0x541006 of _0x4dc4d2){const _0x5ec346=await computeFileHash(_0x541006[_0x1b1690(0x11f)]),_0x4bb063=_0x1336af[_0x1b1690(0x120)][_0x541006[_0x1b1690(0x13a)]],_0xd02f86=!!_0x4bb063&&_0x4bb063[_0x1b1690(0x139)]===_0x5ec346;_0x1fb296['push']({'lockKey':_0x541006[_0x1b1690(0x13a)],'filePath':_0x541006['filePath'],'remoteId':_0x4bb063?.[_0x1b1690(0x109)]??null,'mode':_0x4bb063?.[_0x1b1690(0x109)]?_0x1b1690(0x127):_0x1b1690(0x12c),'status':!_0x1b96a4&&_0xd02f86?_0x1b1690(0x106):'would_push'});}return{'method':_0x1b1690(0x107),'url':_0x1b1690(0x128),'body':{'appCode':_0x3e5acc[_0x1b1690(0x11d)],'force':_0x1b96a4,'files':_0x1fb296},'description':_0x1b1690(0x10f)+_0x1fb296['length']+_0x1b1690(0xfe)};},async 'execute'(_0x15c84f){const _0x36ee30=a32_0x1566bc,_0x36296e=loadBffProjectConfig(_0x15c84f[_0x36ee30(0x11d)]),_0x17fd66=await readBffLockFile(_0x36296e[_0x36ee30(0x10d)]),{lockData:_0x1501c3,appLock:_0x2baa8f}=ensureLockScope(_0x17fd66??createEmptyBffLock(),_0x15c84f['appCode'],_0x36296e['scriptsRoot'],_0x36ee30(0x10b)),_0x387247=await getTargetFunctions(_0x36296e,_0x15c84f);if(_0x387247[_0x36ee30(0x12e)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x36ee30(0x114)};const _0x2b977a=_0x15c84f[_0x36ee30(0x102)](_0x36ee30(0xff)),_0x1007cf=await buildHookMaps(_0x15c84f[_0x36ee30(0x11d)],_0x15c84f[_0x36ee30(0x12f)],_0x387247,_0x2baa8f),_0x5de7d5=[],_0xe27845=[],_0x1d12ef=[];for(const _0x1662b4 of _0x387247){const _0x5be225=await computeFileHash(_0x1662b4[_0x36ee30(0x11f)]),_0x2c24ec=_0x2baa8f[_0x36ee30(0x120)][_0x1662b4['lockKey']];if(!_0x2b977a&&_0x2c24ec&&_0x2c24ec['hash']===_0x5be225){_0xe27845[_0x36ee30(0x10b)]({'lockKey':_0x1662b4[_0x36ee30(0x13a)],'reason':_0x36ee30(0x106)});continue;}try{await uploadSingleFunction(_0x15c84f[_0x36ee30(0x11d)],_0x1662b4,_0x2baa8f,_0x1007cf);const _0x11d2ed=_0x2baa8f[_0x36ee30(0x120)][_0x1662b4[_0x36ee30(0x13a)]];_0x5de7d5[_0x36ee30(0x10b)]({'lockKey':_0x1662b4[_0x36ee30(0x13a)],'remoteId':_0x11d2ed?.[_0x36ee30(0x109)]??0x0});}catch(_0x11db0c){_0x1d12ef['push']({'lockKey':_0x1662b4[_0x36ee30(0x13a)],'error':_0x11db0c instanceof Error?_0x11db0c[_0x36ee30(0x134)]:String(_0x11db0c)});}}return _0x2baa8f['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x36296e['lockFilePath'],_0x1501c3),{'ok':_0x1d12ef['length']===0x0,'data':{'uploaded':_0x5de7d5,'skipped':_0xe27845,'failed':_0x1d12ef},'message':_0x36ee30(0x105)+_0x5de7d5[_0x36ee30(0x12e)]+_0x36ee30(0x10e)+_0xe27845[_0x36ee30(0x12e)]+_0x36ee30(0x137)+_0x1d12ef[_0x36ee30(0x12e)]+_0x36ee30(0x113)};}};async function getTargetFunctions(_0x11c2cb,_0x4a250c){const _0x35ec2d=a32_0x1566bc,_0x53dcac=_0x4a250c[_0x35ec2d(0x117)](_0x35ec2d(0x119)),_0xee0315=_0x4a250c['str'](_0x35ec2d(0x141)),_0x179a5b=normalizeBffType(_0x53dcac)??undefined;if(_0xee0315&&!_0x179a5b)throw CliErrors[_0x35ec2d(0x135)](_0x35ec2d(0x138));const _0x42bcaa=await scanLocalBffFunctions(_0x11c2cb,_0x179a5b);if(_0xee0315){const _0x343c8e=_0x42bcaa[_0x35ec2d(0x126)](_0x42c827=>_0x42c827[_0x35ec2d(0x141)]===_0xee0315);if(_0x343c8e[_0x35ec2d(0x12e)]===0x0)throw CliErrors['validation'](_0x35ec2d(0x124)+_0x179a5b+'/'+_0xee0315);return _0x343c8e;}return _0x42bcaa;}async function buildHookMaps(_0x1892a4,_0x355754,_0xa2aa20,_0x47ccaa){const _0x27bad5=a32_0x1566bc,_0x16483d=_0xa2aa20[_0x27bad5(0x13e)](_0x4ecfaa=>_0x4ecfaa[_0x27bad5(0x119)]===_0x27bad5(0x10c));if(!_0x16483d)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x5e1390=loadAliasMap(_0x355754,undefined,resolveApiFilePath(_0x355754,_0x1892a4)),_0x40b09a=new Map(_0x5e1390['map'](_0x2170b2=>[_0x2170b2[_0x27bad5(0x142)],_0x2170b2['datasetCode']]));for(const _0xc7e3e of Object[_0x27bad5(0x100)](_0x47ccaa[_0x27bad5(0x120)])){_0xc7e3e['alias']&&_0xc7e3e[_0x27bad5(0x115)]&&!_0x40b09a[_0x27bad5(0x111)](_0xc7e3e[_0x27bad5(0x142)])&&_0x40b09a[_0x27bad5(0x11e)](_0xc7e3e[_0x27bad5(0x142)],_0xc7e3e[_0x27bad5(0x115)]);}const _0xfb7cee=await listDatasets(_0x1892a4),_0x3771f2=new Map(_0xfb7cee[_0x27bad5(0xfb)](_0x38570d=>[_0x38570d[_0x27bad5(0x12a)],_0x38570d['id']]));return{'aliasToDatasetCode':_0x40b09a,'datasetCodeToId':_0x3771f2};}async function uploadSingleFunction(_0x4b4c41,_0x415f8a,_0x5293af,_0x5b7b45){const _0x1b6bd9=a32_0x1566bc,_0x409f62=await readFile(_0x415f8a['filePath'],'utf8'),_0x267984=await computeFileHash(_0x415f8a[_0x1b6bd9(0x11f)]),_0x43a208=_0x5293af[_0x1b6bd9(0x120)][_0x415f8a[_0x1b6bd9(0x13a)]];if(_0x43a208?.[_0x1b6bd9(0x109)]&&_0x43a208[_0x1b6bd9(0x13f)]==null)throw CliErrors['validation'](_0x415f8a['lockKey']+_0x1b6bd9(0x11c));let _0x5ab93f=extractScriptDescription(_0x409f62);if(!_0x5ab93f&&_0x43a208?.['remoteId']){const _0x40ef2c=await getBffScriptInfo(_0x43a208['remoteId']);_0x5ab93f=_0x40ef2c[_0x1b6bd9(0x132)]||undefined;}const _0x5a2414={'appCode':_0x4b4c41,'functionName':_0x415f8a[_0x1b6bd9(0x141)],'scriptType':_0x415f8a['type'],'scriptContent':_0x409f62};if(_0x43a208?.[_0x1b6bd9(0x109)])_0x5a2414['id']=_0x43a208['remoteId'];if(_0x43a208?.[_0x1b6bd9(0x13f)]!=null)_0x5a2414[_0x1b6bd9(0x13f)]=_0x43a208[_0x1b6bd9(0x13f)];if(_0x5ab93f)_0x5a2414[_0x1b6bd9(0x132)]=_0x5ab93f;if(_0x415f8a['type']===_0x1b6bd9(0x10c)){const _0x4752a4=_0x415f8a[_0x1b6bd9(0x142)];if(!_0x4752a4||!_0x415f8a[_0x1b6bd9(0x11b)]||!_0x415f8a[_0x1b6bd9(0x136)])throw CliErrors[_0x1b6bd9(0x135)]('Incomplete\x20HOOK\x20path:\x20'+_0x415f8a[_0x1b6bd9(0x13a)]);const _0x16850d=_0x5b7b45['aliasToDatasetCode'][_0x1b6bd9(0x108)](_0x4752a4)??_0x43a208?.[_0x1b6bd9(0x115)]??_0x4752a4,_0xd1a4db=_0x5b7b45[_0x1b6bd9(0x13d)][_0x1b6bd9(0x108)](_0x16850d);if(!_0xd1a4db)throw CliErrors['validation']('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x4752a4+_0x1b6bd9(0x13b)+('Run\x20`'+CLI_BIN_NAME+_0x1b6bd9(0x10a)));_0x5a2414[_0x1b6bd9(0xfc)]=_0xd1a4db,_0x5a2414[_0x1b6bd9(0x11b)]=_0x415f8a[_0x1b6bd9(0x11b)],_0x5a2414[_0x1b6bd9(0x136)]=_0x415f8a['functionNode'];}const _0x3efae7=await saveBffScript(_0x5a2414),_0x17f54a=await getBffScriptInfo(_0x3efae7),_0xe673ec={'hash':_0x267984,'remoteId':_0x3efae7,'version':_0x17f54a[_0x1b6bd9(0x13f)]};if(_0x415f8a[_0x1b6bd9(0x119)]==='HOOK'){const _0x467ed3=_0x415f8a[_0x1b6bd9(0x142)],_0x182ebf=_0x5b7b45['aliasToDatasetCode']['get'](_0x467ed3)??_0x43a208?.[_0x1b6bd9(0x115)]??_0x467ed3;_0x5b7b45[_0x1b6bd9(0x122)][_0x1b6bd9(0x111)](_0x467ed3)?_0xe673ec[_0x1b6bd9(0x142)]=_0x467ed3:_0xe673ec[_0x1b6bd9(0x142)]=_0x43a208?.[_0x1b6bd9(0x142)],_0xe673ec[_0x1b6bd9(0x115)]=_0x182ebf,_0xe673ec[_0x1b6bd9(0x11b)]=_0x415f8a[_0x1b6bd9(0x11b)],_0xe673ec[_0x1b6bd9(0x136)]=_0x415f8a[_0x1b6bd9(0x136)];}_0x5293af[_0x1b6bd9(0x120)][_0x415f8a[_0x1b6bd9(0x13a)]]=_0xe673ec;}
@@ -1 +1 @@
1
- const a32_0x31212c=a32_0xa125;(function(_0x1d69a3,_0x17ade6){const _0x1e2801=a32_0xa125,_0x130786=_0x1d69a3();while(!![]){try{const _0x53ba49=-parseInt(_0x1e2801(0x19a))/0x1*(parseInt(_0x1e2801(0x196))/0x2)+parseInt(_0x1e2801(0x1ad))/0x3*(parseInt(_0x1e2801(0x1aa))/0x4)+-parseInt(_0x1e2801(0x1b1))/0x5*(-parseInt(_0x1e2801(0x195))/0x6)+parseInt(_0x1e2801(0x1a7))/0x7*(parseInt(_0x1e2801(0x199))/0x8)+-parseInt(_0x1e2801(0x1a9))/0x9*(-parseInt(_0x1e2801(0x1ae))/0xa)+-parseInt(_0x1e2801(0x1a4))/0xb*(-parseInt(_0x1e2801(0x1a1))/0xc)+-parseInt(_0x1e2801(0x193))/0xd;if(_0x53ba49===_0x17ade6)break;else _0x130786['push'](_0x130786['shift']());}catch(_0x25b45f){_0x130786['push'](_0x130786['shift']());}}}(a32_0x4195,0x857c9));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a32_0xa125(_0x32db1d,_0x14dfaf){_0x32db1d=_0x32db1d-0x191;const _0x4195aa=a32_0x4195();let _0xa125e7=_0x4195aa[_0x32db1d];return _0xa125e7;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';function a32_0x4195(){const _0x575223=['remote','810444HaAUAu','204178SCZbky','functions','\x20added,\x20','4285160DwKoWa','3MWbmgd','all','lockFilePath','length','read','filePath','datasetCode','12bvzJuu','appCode','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','7681861XeiNST','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','push','7JuPDXZ','\x20remote-only','60579UGWLAd','52dOlNUy','status','\x20unchanged','145395vvCVHT','240HrNUVe','map','scriptsRoot','35rjGeiL','lockKey','apiDir','bff','hash','boolean','27534975GsVRmK'];a32_0x4195=function(){return _0x575223;};return a32_0x4195();}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a32_0x31212c(0x1b4),'command':a32_0x31212c(0x1ab),'description':a32_0x31212c(0x1a3),'risk':a32_0x31212c(0x19e),'flags':[{'name':a32_0x31212c(0x194),'type':a32_0x31212c(0x192),'description':a32_0x31212c(0x1a5)}],async 'execute'(_0x2f6acb){const _0x1c5a79=a32_0x31212c,_0x3b032=loadBffProjectConfig(_0x2f6acb[_0x1c5a79(0x1a2)]),_0x42c9e2=await readBffLockFile(_0x3b032[_0x1c5a79(0x19c)]),{appLock:_0x1b8e14}=ensureLockScope(_0x42c9e2??createEmptyBffLock(),_0x2f6acb[_0x1c5a79(0x1a2)],_0x3b032[_0x1c5a79(0x1b0)],'status'),_0x3cd71f=await scanLocalBffFunctions(_0x3b032),_0x2b971a=[],_0x21b601=[],_0x454b96=[];for(const _0x55a676 of _0x3cd71f){const _0x209082=await computeFileHash(_0x55a676[_0x1c5a79(0x19f)]),_0x4a03ab=_0x1b8e14['functions'][_0x55a676[_0x1c5a79(0x1b2)]];if(!_0x4a03ab)_0x2b971a['push'](_0x55a676[_0x1c5a79(0x1b2)]);else _0x4a03ab[_0x1c5a79(0x191)]!==_0x209082?_0x21b601[_0x1c5a79(0x1a6)](_0x55a676[_0x1c5a79(0x1b2)]):_0x454b96['push'](_0x55a676[_0x1c5a79(0x1b2)]);}const _0x57c8c0=[];if(_0x2f6acb['bool'](_0x1c5a79(0x194))){const _0x7c4733=loadAliasMap(_0x2f6acb[_0x1c5a79(0x1b3)],undefined,resolveApiFilePath(_0x2f6acb[_0x1c5a79(0x1b3)],_0x2f6acb[_0x1c5a79(0x1a2)])),_0x1b4ea8=new Map(_0x7c4733[_0x1c5a79(0x1af)](_0x187588=>[_0x187588[_0x1c5a79(0x1a0)],_0x187588['alias']])),[_0x341c7e,_0x13843f]=await Promise[_0x1c5a79(0x19b)]([listBffScripts(_0x2f6acb[_0x1c5a79(0x1a2)]),getBffScriptStatistics(_0x2f6acb[_0x1c5a79(0x1a2)])]),_0x5c5b56=createHookLocationMap(_0x13843f),_0x3ad886=new Set(_0x3cd71f[_0x1c5a79(0x1af)](_0xcdeeec=>_0xcdeeec[_0x1c5a79(0x1b2)]));for(const _0x2fa409 of _0x341c7e){const _0x530db6=resolveRemoteScriptTarget(_0x3b032,_0x2fa409,_0x5c5b56,_0x1b8e14[_0x1c5a79(0x197)],_0x1b4ea8);_0x530db6&&!_0x3ad886['has'](_0x530db6[_0x1c5a79(0x1b2)])&&_0x57c8c0[_0x1c5a79(0x1a6)](_0x530db6[_0x1c5a79(0x1b2)]);}}const _0x49e8ac=_0x2b971a['length']===0x0&&_0x21b601['length']===0x0&&_0x57c8c0[_0x1c5a79(0x19d)]===0x0;return{'ok':!![],'data':{'added':_0x2b971a,'modified':_0x21b601,'unchanged':_0x454b96,'remoteOnly':_0x57c8c0},'message':_0x49e8ac?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x2b971a['length']+_0x1c5a79(0x198)+_0x21b601['length']+'\x20modified,\x20'+_0x454b96[_0x1c5a79(0x19d)]+_0x1c5a79(0x1ac)+(_0x57c8c0['length']>0x0?',\x20'+_0x57c8c0[_0x1c5a79(0x19d)]+_0x1c5a79(0x1a8):'')};}};
1
+ function a33_0x57e8(_0x33513a,_0xb5b0b9){_0x33513a=_0x33513a-0xe0;const _0x360c51=a33_0x360c();let _0x57e89b=_0x360c51[_0x33513a];return _0x57e89b;}const a33_0x5abc81=a33_0x57e8;(function(_0x4e8268,_0x4cec85){const _0x1ef7a6=a33_0x57e8,_0x3ee9f7=_0x4e8268();while(!![]){try{const _0x328391=parseInt(_0x1ef7a6(0xe1))/0x1+parseInt(_0x1ef7a6(0xe7))/0x2*(-parseInt(_0x1ef7a6(0xe3))/0x3)+-parseInt(_0x1ef7a6(0xed))/0x4+parseInt(_0x1ef7a6(0xff))/0x5+parseInt(_0x1ef7a6(0xe4))/0x6+parseInt(_0x1ef7a6(0xe0))/0x7+-parseInt(_0x1ef7a6(0xfd))/0x8;if(_0x328391===_0x4cec85)break;else _0x3ee9f7['push'](_0x3ee9f7['shift']());}catch(_0x5b5d00){_0x3ee9f7['push'](_0x3ee9f7['shift']());}}}(a33_0x360c,0x990ac));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a33_0x360c(){const _0x2ddf43=['all','boolean','lockKey','remote','appCode','alias','lockFilePath','status','\x20added,\x20','12176360jpLVkm','\x20remote-only','6021645EPukHr','8191295ocSUbP','698501odJivj','scriptsRoot','3ctZwLy','703044XOpyQv','datasetCode','apiDir','1002202ittcSe','length','functions','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','hash','push','2160732BiNvhu','map','bool','read','\x20modified,\x20','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','has'];a33_0x360c=function(){return _0x2ddf43;};return a33_0x360c();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a33_0x5abc81(0xfb),'description':a33_0x5abc81(0xea),'risk':a33_0x5abc81(0xf0),'flags':[{'name':a33_0x5abc81(0xf7),'type':a33_0x5abc81(0xf5),'description':a33_0x5abc81(0xf2)}],async 'execute'(_0x130856){const _0x2fdba5=a33_0x5abc81,_0x51a4b8=loadBffProjectConfig(_0x130856[_0x2fdba5(0xf8)]),_0x4fa15a=await readBffLockFile(_0x51a4b8[_0x2fdba5(0xfa)]),{appLock:_0x65fa46}=ensureLockScope(_0x4fa15a??createEmptyBffLock(),_0x130856[_0x2fdba5(0xf8)],_0x51a4b8[_0x2fdba5(0xe2)],'status'),_0x23fc6a=await scanLocalBffFunctions(_0x51a4b8),_0x50bddd=[],_0x5a962c=[],_0x327d79=[];for(const _0x3b9626 of _0x23fc6a){const _0x5a66b6=await computeFileHash(_0x3b9626['filePath']),_0x2d6e08=_0x65fa46[_0x2fdba5(0xe9)][_0x3b9626[_0x2fdba5(0xf6)]];if(!_0x2d6e08)_0x50bddd[_0x2fdba5(0xec)](_0x3b9626[_0x2fdba5(0xf6)]);else _0x2d6e08[_0x2fdba5(0xeb)]!==_0x5a66b6?_0x5a962c[_0x2fdba5(0xec)](_0x3b9626[_0x2fdba5(0xf6)]):_0x327d79['push'](_0x3b9626[_0x2fdba5(0xf6)]);}const _0x51a606=[];if(_0x130856[_0x2fdba5(0xef)]('remote')){const _0x5d6511=loadAliasMap(_0x130856[_0x2fdba5(0xe6)],undefined,resolveApiFilePath(_0x130856[_0x2fdba5(0xe6)],_0x130856[_0x2fdba5(0xf8)])),_0x4fb87c=new Map(_0x5d6511['map'](_0x5819cd=>[_0x5819cd[_0x2fdba5(0xe5)],_0x5819cd[_0x2fdba5(0xf9)]])),[_0x3402c0,_0x46fa12]=await Promise[_0x2fdba5(0xf4)]([listBffScripts(_0x130856[_0x2fdba5(0xf8)]),getBffScriptStatistics(_0x130856[_0x2fdba5(0xf8)])]),_0x1786a2=createHookLocationMap(_0x46fa12),_0x30d8be=new Set(_0x23fc6a[_0x2fdba5(0xee)](_0x29cd67=>_0x29cd67['lockKey']));for(const _0x48e8ca of _0x3402c0){const _0x76442d=resolveRemoteScriptTarget(_0x51a4b8,_0x48e8ca,_0x1786a2,_0x65fa46[_0x2fdba5(0xe9)],_0x4fb87c);_0x76442d&&!_0x30d8be[_0x2fdba5(0xf3)](_0x76442d['lockKey'])&&_0x51a606[_0x2fdba5(0xec)](_0x76442d[_0x2fdba5(0xf6)]);}}const _0xd4537=_0x50bddd[_0x2fdba5(0xe8)]===0x0&&_0x5a962c[_0x2fdba5(0xe8)]===0x0&&_0x51a606[_0x2fdba5(0xe8)]===0x0;return{'ok':!![],'data':{'added':_0x50bddd,'modified':_0x5a962c,'unchanged':_0x327d79,'remoteOnly':_0x51a606},'message':_0xd4537?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x50bddd[_0x2fdba5(0xe8)]+_0x2fdba5(0xfc)+_0x5a962c[_0x2fdba5(0xe8)]+_0x2fdba5(0xf1)+_0x327d79['length']+'\x20unchanged'+(_0x51a606[_0x2fdba5(0xe8)]>0x0?',\x20'+_0x51a606[_0x2fdba5(0xe8)]+_0x2fdba5(0xfe):'')};}};