@lovrabet/rabetbase-cli 2.0.9 → 2.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) 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/logout.js +1 -1
  11. package/lib/cli-flags.js +1 -1
  12. package/lib/cli.js +1 -1
  13. package/lib/commands/api/doc.js +1 -1
  14. package/lib/commands/api/index.js +1 -1
  15. package/lib/commands/api/list.js +1 -1
  16. package/lib/commands/api/pull.js +1 -1
  17. package/lib/commands/api/shared.js +1 -1
  18. package/lib/commands/app/add.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/remote.js +1 -1
  22. package/lib/commands/app/remove.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app/use.js +1 -1
  25. package/lib/commands/auth/index.js +1 -1
  26. package/lib/commands/bff/delete.js +1 -1
  27. package/lib/commands/bff/detail.js +1 -1
  28. package/lib/commands/bff/index.js +1 -1
  29. package/lib/commands/bff/list.js +1 -1
  30. package/lib/commands/bff/new.js +1 -1
  31. package/lib/commands/bff/pull.js +1 -1
  32. package/lib/commands/bff/push.js +1 -1
  33. package/lib/commands/bff/status.js +1 -1
  34. package/lib/commands/cli-update.js +1 -1
  35. package/lib/commands/codegen/index.js +1 -1
  36. package/lib/commands/codegen/sdk.js +1 -1
  37. package/lib/commands/codegen/sql.js +1 -1
  38. package/lib/commands/common/app-selector.js +1 -1
  39. package/lib/commands/common/flags.js +1 -1
  40. package/lib/commands/common/validate.js +1 -1
  41. package/lib/commands/config/get.js +1 -1
  42. package/lib/commands/config/index.js +1 -1
  43. package/lib/commands/config/list.js +1 -1
  44. package/lib/commands/config/set.js +1 -1
  45. package/lib/commands/config/shared.js +1 -1
  46. package/lib/commands/dataset/detail.js +1 -1
  47. package/lib/commands/dataset/index.js +1 -1
  48. package/lib/commands/dataset/links.js +1 -1
  49. package/lib/commands/dataset/list.js +1 -1
  50. package/lib/commands/dataset/operations.js +1 -1
  51. package/lib/commands/doctor.js +1 -1
  52. package/lib/commands/init/index.js +1 -1
  53. package/lib/commands/logs/index.js +1 -1
  54. package/lib/commands/menu/index.js +1 -1
  55. package/lib/commands/menu/shared/compare-table.js +1 -1
  56. package/lib/commands/menu/shared/index.js +1 -1
  57. package/lib/commands/menu/shared/inquirer.js +1 -1
  58. package/lib/commands/menu/shared/local-pages.js +1 -1
  59. package/lib/commands/menu/shared/logic.js +1 -1
  60. package/lib/commands/menu/shared/service.js +1 -1
  61. package/lib/commands/menu/shared/sync-core.js +1 -1
  62. package/lib/commands/menu/shared/update-core.js +1 -1
  63. package/lib/commands/menu/shared/valid-url.js +1 -1
  64. package/lib/commands/menu/sync.js +1 -1
  65. package/lib/commands/menu/update.js +1 -1
  66. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  67. package/lib/commands/project/create/format-elapsed.js +1 -1
  68. package/lib/commands/project/create/main.js +1 -1
  69. package/lib/commands/project/create/non-interactive.js +1 -1
  70. package/lib/commands/project/create/project-template-path.js +1 -1
  71. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  72. package/lib/commands/project/create/use-format-code.js +1 -1
  73. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  74. package/lib/commands/project/index.js +1 -1
  75. package/lib/commands/project/init.js +1 -1
  76. package/lib/commands/project/upgrade.js +1 -1
  77. package/lib/commands/registry.js +1 -1
  78. package/lib/commands/run/index.js +1 -1
  79. package/lib/commands/schema.js +1 -1
  80. package/lib/commands/skill/index.js +1 -1
  81. package/lib/commands/sql/detail.js +1 -1
  82. package/lib/commands/sql/exec.js +1 -1
  83. package/lib/commands/sql/index.js +1 -1
  84. package/lib/commands/sql/list.js +1 -1
  85. package/lib/commands/sql/save.js +1 -1
  86. package/lib/commands/sql/validate.js +1 -1
  87. package/lib/constant/cli.js +1 -1
  88. package/lib/constant/domain.js +1 -1
  89. package/lib/constant/env.js +1 -1
  90. package/lib/constant/paths.js +1 -0
  91. package/lib/context.js +1 -1
  92. package/lib/core/alias-resolver.js +1 -1
  93. package/lib/core/api-client.js +1 -1
  94. package/lib/core/bff/config.js +1 -1
  95. package/lib/core/bff/file-system.js +1 -1
  96. package/lib/core/bff/hash.js +1 -1
  97. package/lib/core/bff/lock.js +1 -1
  98. package/lib/core/bff/utils.js +1 -1
  99. package/lib/core/db-resolver.js +1 -1
  100. package/lib/core/sql-validator.js +1 -1
  101. package/lib/errors.js +1 -1
  102. package/lib/framework/build-all-flags.js +1 -1
  103. package/lib/framework/flags.js +1 -1
  104. package/lib/framework/help.js +1 -1
  105. package/lib/framework/index.js +1 -1
  106. package/lib/framework/output.js +1 -1
  107. package/lib/framework/response.js +1 -1
  108. package/lib/framework/runner.js +1 -1
  109. package/lib/framework/schema-export.js +1 -1
  110. package/lib/framework/types.js +1 -1
  111. package/lib/generated/build-info.js +1 -1
  112. package/lib/help.js +1 -1
  113. package/lib/skills/main.js +1 -1
  114. package/lib/skills/npx-skills-add.js +1 -1
  115. package/lib/telemetry/cli-command-trace.js +1 -1
  116. package/lib/telemetry/cli-help-trace.js +1 -1
  117. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  118. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  119. package/lib/telemetry/send-cli-trace-log.js +1 -1
  120. package/lib/utils/ai_config.js +1 -1
  121. package/lib/utils/apply-jq-filter.js +1 -1
  122. package/lib/utils/cdn-config.js +1 -1
  123. package/lib/utils/check-sdk-version.js +1 -1
  124. package/lib/utils/cli-version-check.js +1 -1
  125. package/lib/utils/config.js +1 -1
  126. package/lib/utils/copy-directory.js +1 -1
  127. package/lib/utils/file-utils.js +1 -1
  128. package/lib/utils/guides-cdn.js +1 -1
  129. package/lib/utils/http-client.js +1 -1
  130. package/lib/utils/is-non-interactive.js +1 -1
  131. package/lib/utils/logger.js +1 -1
  132. package/lib/utils/platform.js +1 -1
  133. package/lib/utils/rules-cdn.js +1 -1
  134. package/lib/utils/sleep.js +1 -1
  135. package/lib/utils/template-replacer.js +1 -1
  136. package/lib/utils/version.js +1 -1
  137. package/lib/utils/with-active-cookie.js +1 -1
  138. package/package.json +2 -2
@@ -1 +1 @@
1
- const a19_0xc492c8=a19_0x3d04;function a19_0x3d04(_0x4fd2e6,_0x2a8b4f){_0x4fd2e6=_0x4fd2e6-0xf4;const _0x17e0d1=a19_0x17e0();let _0x3d0488=_0x17e0d1[_0x4fd2e6];return _0x3d0488;}(function(_0x403b1b,_0x321055){const _0x4ead3c=a19_0x3d04,_0x34bdb0=_0x403b1b();while(!![]){try{const _0x4f4f38=parseInt(_0x4ead3c(0x108))/0x1*(parseInt(_0x4ead3c(0xf5))/0x2)+-parseInt(_0x4ead3c(0xf4))/0x3*(-parseInt(_0x4ead3c(0x10c))/0x4)+-parseInt(_0x4ead3c(0x10a))/0x5+-parseInt(_0x4ead3c(0xf9))/0x6*(-parseInt(_0x4ead3c(0xfe))/0x7)+-parseInt(_0x4ead3c(0x102))/0x8*(-parseInt(_0x4ead3c(0x10e))/0x9)+parseInt(_0x4ead3c(0xf7))/0xa*(-parseInt(_0x4ead3c(0x104))/0xb)+-parseInt(_0x4ead3c(0xf8))/0xc;if(_0x4f4f38===_0x321055)break;else _0x34bdb0['push'](_0x34bdb0['shift']());}catch(_0x52348d){_0x34bdb0['push'](_0x34bdb0['shift']());}}}(a19_0x17e0,0x4ba23));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x17e0(){const _0x3eb858=['list','entries','1464526rUMuMQ','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.','map','format','172016meyphv','apps','6599989CzoGWt','No\x20apps\x20configured.\x20Use\x20`','List\x20all\x20configured\x20apps','projectConfig','772jImpSw','length','1615055YYYNJQ','accessKey','21856dQUWwe','single-app','126ZMOdGN','globalConfig','cookie','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','appcode','globalPath','291DgENLh','1172zMPicW','pageSize','10mlMebQ','3118092sGnlbl','6goCCip','riskLevel','object'];a19_0x17e0=function(){return _0x3eb858;};return a19_0x17e0();}import{appDefinedIn,resolveDefaultAppSource}from'../../commands/app/shared.js';async function execute(_0x125c45){const _0x2aa2f0=a19_0x3d04,{config:_0x7b0840,layers:_0x4a108a}=readRawConfigWithLayers(),{apps:apps={},defaultApp:_0x411b32,currentApp:_0x5c2bd7}=_0x7b0840,_0x3dd85d=Object[_0x2aa2f0(0xfd)](apps),_0x5764a8=_0x4a108a['globalConfig'][_0x2aa2f0(0x103)]&&typeof _0x4a108a[_0x2aa2f0(0x10f)][_0x2aa2f0(0x103)]===_0x2aa2f0(0xfb)?_0x4a108a['globalConfig']['apps']:{},_0x35ae1f=_0x4a108a[_0x2aa2f0(0x107)][_0x2aa2f0(0x103)]&&typeof _0x4a108a[_0x2aa2f0(0x107)]['apps']===_0x2aa2f0(0xfb)?_0x4a108a['projectConfig'][_0x2aa2f0(0x103)]:{};if(_0x3dd85d[_0x2aa2f0(0x109)]===0x0){const _0x3d76f1=_0x7b0840[_0x2aa2f0(0x112)];if(_0x3d76f1)return{'ok':!![],'data':{'mode':_0x2aa2f0(0x10d),'appcode':_0x3d76f1,'env':_0x7b0840['env']},'message':'Single-app\x20mode.\x20Use\x20`'+CLI_BIN_NAME+_0x2aa2f0(0xff)};return{'ok':!![],'data':[],'message':_0x2aa2f0(0x105)+CLI_BIN_NAME+_0x2aa2f0(0x111)};}const _0x53a1ca=resolveDefaultAppSource(_0x4a108a),_0xa337ad=_0x3dd85d[_0x2aa2f0(0x100)](([_0x1ac37e,_0x25eb09])=>({'name':_0x1ac37e,'appcode':_0x25eb09['appcode'],'definedIn':appDefinedIn(_0x1ac37e,_0x5764a8,_0x35ae1f),'isDefault':_0x1ac37e===_0x411b32,'isCurrent':_0x1ac37e===(_0x5c2bd7??_0x411b32),'env':_0x25eb09['env']??null,'apiDir':_0x25eb09['apiDir']??null,'hasCookie':!!_0x25eb09[_0x2aa2f0(0x110)],'hasAccessKey':!!_0x25eb09[_0x2aa2f0(0x10b)],'format':_0x25eb09[_0x2aa2f0(0x101)]??null,'pageSize':_0x25eb09[_0x2aa2f0(0xf6)]??null,'riskLevel':_0x25eb09[_0x2aa2f0(0xfa)]??null,'locale':_0x25eb09['locale']??null}));return{'ok':!![],'data':{'items':_0xa337ad,'meta':{'globalPath':_0x4a108a[_0x2aa2f0(0x113)]??null,'projectPath':_0x4a108a['projectPath']??null,'defaultApp':_0x411b32??null,'defaultAppSource':_0x411b32!=null?_0x53a1ca:null}}};}export const appListDefinition={'service':'app','command':a19_0xc492c8(0xfc),'description':a19_0xc492c8(0x106),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],'execute':execute};
1
+ const a19_0x2e6231=a19_0x2613;(function(_0x263a2c,_0x4332a6){const _0x25e592=a19_0x2613,_0x1cf984=_0x263a2c();while(!![]){try{const _0x5289cf=-parseInt(_0x25e592(0x1df))/0x1*(parseInt(_0x25e592(0x1e5))/0x2)+parseInt(_0x25e592(0x1e1))/0x3*(-parseInt(_0x25e592(0x1da))/0x4)+parseInt(_0x25e592(0x1cc))/0x5+parseInt(_0x25e592(0x1d1))/0x6*(parseInt(_0x25e592(0x1c4))/0x7)+-parseInt(_0x25e592(0x1e4))/0x8*(-parseInt(_0x25e592(0x1d4))/0x9)+parseInt(_0x25e592(0x1d3))/0xa+parseInt(_0x25e592(0x1d9))/0xb*(-parseInt(_0x25e592(0x1c3))/0xc);if(_0x5289cf===_0x4332a6)break;else _0x1cf984['push'](_0x1cf984['shift']());}catch(_0x35dc61){_0x1cf984['push'](_0x1cf984['shift']());}}}(a19_0x42e6,0x94861));import{readRawConfigWithLayers}from'../../context.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a19_0x42e6(){const _0xb3f4b4=['projectPath','apps','entries','Single-app\x20mode.\x20Use\x20`','225555wkUIHP','44dqGOvC','single-app','appcode','pageSize','List\x20all\x20configured\x20apps','2vqGYpF','No\x20apps\x20configured.\x20Use\x20`','60441Htjgre','\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20add\x20one.','projectConfig','8rQZmsz','793916JZZHIV','804hiFCWp','7pfpFoj','accessKey','read','object','list','app','map','env','4925060llzPrz','length','format','globalConfig','globalPath','2094084jYoCFx','apiDir','7340430oCwUNS','8366868gQmsdi'];a19_0x42e6=function(){return _0xb3f4b4;};return a19_0x42e6();}import{appDefinedIn,resolveDefaultAppSource}from'../../commands/app/shared.js';function a19_0x2613(_0x30847d,_0x268902){_0x30847d=_0x30847d-0x1c3;const _0x42e672=a19_0x42e6();let _0x26134a=_0x42e672[_0x30847d];return _0x26134a;}async function execute(_0x20fb96){const _0x554586=a19_0x2613,{config:_0x85ef8c,layers:_0x13a6a0}=readRawConfigWithLayers(),{apps:apps={},defaultApp:_0x105927,currentApp:_0x3d7ec2}=_0x85ef8c,_0x63dde9=Object[_0x554586(0x1d7)](apps),_0x29bb6c=_0x13a6a0[_0x554586(0x1cf)][_0x554586(0x1d6)]&&typeof _0x13a6a0[_0x554586(0x1cf)][_0x554586(0x1d6)]===_0x554586(0x1c7)?_0x13a6a0['globalConfig']['apps']:{},_0x1be64e=_0x13a6a0[_0x554586(0x1e3)][_0x554586(0x1d6)]&&typeof _0x13a6a0['projectConfig'][_0x554586(0x1d6)]===_0x554586(0x1c7)?_0x13a6a0[_0x554586(0x1e3)][_0x554586(0x1d6)]:{};if(_0x63dde9[_0x554586(0x1cd)]===0x0){const _0x1e5d7e=_0x85ef8c[_0x554586(0x1dc)];if(_0x1e5d7e)return{'ok':!![],'data':{'mode':_0x554586(0x1db),'appcode':_0x1e5d7e,'env':_0x85ef8c[_0x554586(0x1cb)]},'message':_0x554586(0x1d8)+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20<code>`\x20to\x20enable\x20multi-app\x20mode.'};return{'ok':!![],'data':[],'message':_0x554586(0x1e0)+CLI_BIN_NAME+_0x554586(0x1e2)};}const _0x420eda=resolveDefaultAppSource(_0x13a6a0),_0x240a79=_0x63dde9[_0x554586(0x1ca)](([_0x44e45f,_0x118407])=>({'name':_0x44e45f,'appcode':_0x118407['appcode'],'definedIn':appDefinedIn(_0x44e45f,_0x29bb6c,_0x1be64e),'isDefault':_0x44e45f===_0x105927,'isCurrent':_0x44e45f===(_0x3d7ec2??_0x105927),'env':_0x118407[_0x554586(0x1cb)]??null,'apiDir':_0x118407[_0x554586(0x1d2)]??null,'hasCookie':!!_0x118407['cookie'],'hasAccessKey':!!_0x118407[_0x554586(0x1c5)],'format':_0x118407[_0x554586(0x1ce)]??null,'pageSize':_0x118407[_0x554586(0x1dd)]??null,'riskLevel':_0x118407['riskLevel']??null,'locale':_0x118407['locale']??null}));return{'ok':!![],'data':{'items':_0x240a79,'meta':{'globalPath':_0x13a6a0[_0x554586(0x1d0)]??null,'projectPath':_0x13a6a0[_0x554586(0x1d5)]??null,'defaultApp':_0x105927??null,'defaultAppSource':_0x105927!=null?_0x420eda:null}}};}export const appListDefinition={'service':a19_0x2e6231(0x1c9),'command':a19_0x2e6231(0x1c8),'description':a19_0x2e6231(0x1de),'risk':a19_0x2e6231(0x1c6),'requiresAuth':![],'requiresAppCode':![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a20_0xd2da43=a20_0x459b;(function(_0x153c32,_0x1c60b4){const _0x278dcd=a20_0x459b,_0x365a75=_0x153c32();while(!![]){try{const _0x514c2e=parseInt(_0x278dcd(0x143))/0x1*(parseInt(_0x278dcd(0x13f))/0x2)+parseInt(_0x278dcd(0x139))/0x3*(parseInt(_0x278dcd(0x13b))/0x4)+parseInt(_0x278dcd(0x134))/0x5+parseInt(_0x278dcd(0x13e))/0x6+-parseInt(_0x278dcd(0x135))/0x7*(-parseInt(_0x278dcd(0x140))/0x8)+parseInt(_0x278dcd(0x13a))/0x9+parseInt(_0x278dcd(0x133))/0xa*(-parseInt(_0x278dcd(0x137))/0xb);if(_0x514c2e===_0x1c60b4)break;else _0x365a75['push'](_0x365a75['shift']());}catch(_0x17f361){_0x365a75['push'](_0x365a75['shift']());}}}(a20_0x2a43,0x3a052));import{listRemoteApps}from'../../core/api-client.js';async function execute(_0x4c36d3){const _0x59a49a=a20_0x459b,{setActiveCookie:_0x4db840}=await import(_0x59a49a(0x138));_0x4db840(_0x4c36d3[_0x59a49a(0x13c)]);const _0x3191f8=await listRemoteApps(),_0x58c770=_0x3191f8['map'](_0x242fb1=>({..._0x242fb1['id']!=null?{'id':_0x242fb1['id']}:{},'appCode':_0x242fb1[_0x59a49a(0x13d)],'appName':_0x242fb1[_0x59a49a(0x132)],..._0x242fb1[_0x59a49a(0x136)]!=null?{'appDesc':_0x242fb1[_0x59a49a(0x136)]}:{}}));return{'ok':!![],'data':_0x58c770};}function a20_0x2a43(){const _0x58b6ee=['23770DciabF','78545KzTZwr','178171UBZiUR','appDesc','4213yFriEn','../../core/api-client.js','200127qVbEeN','909441LnHPvl','16EKpqUb','cookie','appCode','2428098mNtxyl','464998VVURnD','40zTADjt','read','List\x20apps\x20available\x20on\x20the\x20platform','1qvAYIw','app','appName'];a20_0x2a43=function(){return _0x58b6ee;};return a20_0x2a43();}function a20_0x459b(_0x47f12d,_0x4357cc){_0x47f12d=_0x47f12d-0x131;const _0x2a435b=a20_0x2a43();let _0x459b63=_0x2a435b[_0x47f12d];return _0x459b63;}export const appRemoteDefinition={'service':a20_0xd2da43(0x131),'command':'remote','description':a20_0xd2da43(0x142),'risk':a20_0xd2da43(0x141),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
1
+ function a20_0x308f(){const _0x498de8=['549eqbWBE','16tiIfDC','710241EomYCy','1736296ceSDYg','../../core/api-client.js','appDesc','appName','1730814ocrqDq','List\x20apps\x20available\x20on\x20the\x20platform','4620nOriHm','map','remote','7724304FzpjOG','14870CppyZQ','1569070lmGgbN','read','app'];a20_0x308f=function(){return _0x498de8;};return a20_0x308f();}const a20_0x354a9c=a20_0x1061;function a20_0x1061(_0xcf247b,_0x3807a3){_0xcf247b=_0xcf247b-0x15b;const _0x308f73=a20_0x308f();let _0x106139=_0x308f73[_0xcf247b];return _0x106139;}(function(_0x3032b1,_0x1e0262){const _0x416532=a20_0x1061,_0x2b222e=_0x3032b1();while(!![]){try{const _0x2506e4=parseInt(_0x416532(0x16a))/0x1*(parseInt(_0x416532(0x165))/0x2)+-parseInt(_0x416532(0x169))/0x3*(-parseInt(_0x416532(0x161))/0x4)+parseInt(_0x416532(0x166))/0x5+parseInt(_0x416532(0x15f))/0x6+-parseInt(_0x416532(0x16b))/0x7+parseInt(_0x416532(0x15b))/0x8+-parseInt(_0x416532(0x164))/0x9;if(_0x2506e4===_0x1e0262)break;else _0x2b222e['push'](_0x2b222e['shift']());}catch(_0x596290){_0x2b222e['push'](_0x2b222e['shift']());}}}(a20_0x308f,0x2e5e6));import{listRemoteApps}from'../../core/api-client.js';async function execute(_0x35a519){const _0xa7eac8=a20_0x1061,{setActiveCookie:_0x1972ee}=await import(_0xa7eac8(0x15c));_0x1972ee(_0x35a519['cookie']);const _0x5d3817=await listRemoteApps(),_0x598522=_0x5d3817[_0xa7eac8(0x162)](_0x36e08d=>({..._0x36e08d['id']!=null?{'id':_0x36e08d['id']}:{},'appCode':_0x36e08d['appCode'],'appName':_0x36e08d[_0xa7eac8(0x15e)],..._0x36e08d[_0xa7eac8(0x15d)]!=null?{'appDesc':_0x36e08d[_0xa7eac8(0x15d)]}:{}}));return{'ok':!![],'data':_0x598522};}export const appRemoteDefinition={'service':a20_0x354a9c(0x168),'command':a20_0x354a9c(0x163),'description':a20_0x354a9c(0x160),'risk':a20_0x354a9c(0x167),'requiresAuth':!![],'requiresAppCode':![],'flags':[],'execute':execute};
@@ -1 +1 @@
1
- const a21_0x58a76e=a21_0x5bd3;(function(_0x53a439,_0x84fe47){const _0x23b698=a21_0x5bd3,_0x13365b=_0x53a439();while(!![]){try{const _0x27833b=parseInt(_0x23b698(0x178))/0x1+parseInt(_0x23b698(0x18d))/0x2+-parseInt(_0x23b698(0x16a))/0x3*(parseInt(_0x23b698(0x16e))/0x4)+parseInt(_0x23b698(0x189))/0x5+parseInt(_0x23b698(0x169))/0x6+parseInt(_0x23b698(0x18c))/0x7*(parseInt(_0x23b698(0x185))/0x8)+-parseInt(_0x23b698(0x183))/0x9;if(_0x27833b===_0x84fe47)break;else _0x13365b['push'](_0x13365b['shift']());}catch(_0x421093){_0x13365b['push'](_0x13365b['shift']());}}}(a21_0x2d67,0xb9b51));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a21_0x5bd3(_0x3f5273,_0x2ca7fa){_0x3f5273=_0x3f5273-0x169;const _0x2d67f2=a21_0x2d67();let _0x5bd3d9=_0x2d67f2[_0x3f5273];return _0x5bd3d9;}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';async function validateArgs(_0x645298){const _0x23e056=a21_0x5bd3,_0x51e42a=_0x645298[_0x23e056(0x182)][0x0]?.['trim']();if(!_0x51e42a)throw CliErrors[_0x23e056(0x187)]('Missing\x20app\x20name.',_0x23e056(0x186)+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');}async function execute(_0x2cc59d){const _0x282bd5=a21_0x5bd3,_0x1eda90=_0x2cc59d[_0x282bd5(0x182)][0x0]?.[_0x282bd5(0x181)]();if(!_0x1eda90)throw CliErrors[_0x282bd5(0x187)](_0x282bd5(0x18a),_0x282bd5(0x186)+CLI_BIN_NAME+_0x282bd5(0x16c));const _0x1a625d=_0x2cc59d[_0x282bd5(0x173)](_0x282bd5(0x17a)),{config:_0x5188c6,layers:_0x312588}=readRawConfigWithLayers(),_0x70c9f1=_0x5188c6[_0x282bd5(0x17b)]??{};if(!_0x70c9f1[_0x1eda90])throw CliErrors['validation'](_0x282bd5(0x18b)+_0x1eda90+'\x22\x20not\x20found.');const _0x113ece=_0x312588['globalConfig'][_0x282bd5(0x17b)]&&typeof _0x312588[_0x282bd5(0x17f)][_0x282bd5(0x17b)]===_0x282bd5(0x180)?_0x312588[_0x282bd5(0x17f)]['apps']:{},_0x3699b2=_0x312588[_0x282bd5(0x171)][_0x282bd5(0x17b)]&&typeof _0x312588[_0x282bd5(0x171)][_0x282bd5(0x17b)]===_0x282bd5(0x180)?_0x312588[_0x282bd5(0x171)][_0x282bd5(0x17b)]:{},_0x10e38f=appDefinedIn(_0x1eda90,_0x113ece,_0x3699b2),_0x1b575a=resolveAppScopeForWrite(_0x1eda90,_0x1a625d,_0x312588),_0x3ac02b={'global':_0x1b575a===_0x282bd5(0x17a)},_0x5adca6=readConfig(_0x3ac02b),_0x3cb4c6=_0x5adca6[_0x282bd5(0x17b)];if(!_0x3cb4c6||!_0x3cb4c6[_0x1eda90])throw CliErrors[_0x282bd5(0x187)](_0x282bd5(0x18b)+_0x1eda90+_0x282bd5(0x184));delete _0x3cb4c6[_0x1eda90];let _0x463a25='';if(_0x5adca6[_0x282bd5(0x17e)]===_0x1eda90){const _0xa5e4ba=Object[_0x282bd5(0x188)](_0x3cb4c6);_0x5adca6[_0x282bd5(0x17e)]=_0xa5e4ba['length']>0x0?_0xa5e4ba[0x0]:undefined,_0x5adca6[_0x282bd5(0x17e)]?_0x463a25=_0x282bd5(0x170)+_0x5adca6[_0x282bd5(0x17e)]+'\x22.':delete _0x5adca6[_0x282bd5(0x17e)];}Object[_0x282bd5(0x188)](_0x3cb4c6)[_0x282bd5(0x16d)]===0x0&&(delete _0x5adca6[_0x282bd5(0x17b)],delete _0x5adca6['defaultApp']);writeConfig(_0x5adca6,_0x3ac02b);const _0x52ac75=_0x10e38f===_0x282bd5(0x16f)?_0x282bd5(0x176)+_0x1eda90+_0x282bd5(0x179)+(_0x1b575a==='project'?_0x282bd5(0x17a):_0x282bd5(0x177))+_0x282bd5(0x16b):'';return{'ok':!![],'message':_0x282bd5(0x175)+_0x1eda90+'\x22'+scopeLabel(_0x3ac02b)+'.'+_0x463a25+_0x52ac75};}export const appRemoveDefinition={'service':'app','command':a21_0x58a76e(0x174),'description':a21_0x58a76e(0x172),'risk':a21_0x58a76e(0x17c),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a21_0x58a76e(0x18e),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':[{'name':a21_0x58a76e(0x17a),'type':'boolean','description':a21_0x58a76e(0x17d),'default':![]}],'validate':validateArgs,'execute':execute};function a21_0x2d67(){const _0x2b4c25=['3QPkPns','\x20config.','\x20app\x20remove\x20<name>\x20[--global]','length','5741528MptVld','both','\x20Default\x20app\x20changed\x20to\x20\x22','projectConfig','Remove\x20an\x20app\x20from\x20config','bool','remove','Removed\x20app\x20\x22','\x20Note:\x20app\x20\x22','project','108680hvjGKs','\x22\x20still\x20defined\x20in\x20','global','apps','high-risk-write','Use\x20global\x20config\x20scope','defaultApp','globalConfig','object','trim','args','3871071tfHQLD','\x22\x20not\x20found.','6505624UyHadY','Usage:\x20','validation','keys','180105cTcZyO','Missing\x20app\x20name.','App\x20\x22','7EJZYlV','1155966WWVtFu','name','6541626mSHjUb'];a21_0x2d67=function(){return _0x2b4c25;};return a21_0x2d67();}
1
+ function a21_0x50c0(){const _0x95cecc=['defaultApp','\x20config.','8642960OpiSXC','both','validation','30663446bGRrzY','boolean','\x20app\x20remove\x20<name>\x20[--global]','\x22\x20not\x20found.','78yrTmxZ','Usage:\x20','name','Missing\x20app\x20name.','bool','App\x20\x22','apps','global','39ZISsGn','app','\x20Default\x20app\x20changed\x20to\x20\x22','13828OGCrEc','149258CNlfkF','\x22\x20still\x20defined\x20in\x20','globalConfig','Removed\x20app\x20\x22','project','\x20Note:\x20app\x20\x22','keys','40gnsBqC','object','9lRDDnw','6762790AAljZM','1023817hAUdzA','77756JSybGS','Remove\x20an\x20app\x20from\x20config','trim','length','projectConfig','args'];a21_0x50c0=function(){return _0x95cecc;};return a21_0x50c0();}function a21_0x4ece(_0x5c52b8,_0x53e2e1){_0x5c52b8=_0x5c52b8-0x164;const _0x50c0e1=a21_0x50c0();let _0x4ecee0=_0x50c0e1[_0x5c52b8];return _0x4ecee0;}const a21_0x43dd68=a21_0x4ece;(function(_0x85c398,_0x1d53aa){const _0xdb1483=a21_0x4ece,_0x21308d=_0x85c398();while(!![]){try{const _0x30f99e=-parseInt(_0xdb1483(0x177))/0x1+-parseInt(_0xdb1483(0x16c))/0x2*(parseInt(_0xdb1483(0x168))/0x3)+parseInt(_0xdb1483(0x16b))/0x4*(parseInt(_0xdb1483(0x173))/0x5)+parseInt(_0xdb1483(0x187))/0x6*(parseInt(_0xdb1483(0x178))/0x7)+-parseInt(_0xdb1483(0x180))/0x8+parseInt(_0xdb1483(0x175))/0x9*(parseInt(_0xdb1483(0x176))/0xa)+parseInt(_0xdb1483(0x183))/0xb;if(_0x30f99e===_0x1d53aa)break;else _0x21308d['push'](_0x21308d['shift']());}catch(_0x4b79bf){_0x21308d['push'](_0x21308d['shift']());}}}(a21_0x50c0,0x89199));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(_0x5acbf2){const _0x3abae1=a21_0x4ece,_0x14ea44=_0x5acbf2[_0x3abae1(0x17d)][0x0]?.['trim']();if(!_0x14ea44)throw CliErrors[_0x3abae1(0x182)](_0x3abae1(0x18a),_0x3abae1(0x188)+CLI_BIN_NAME+_0x3abae1(0x185));}async function execute(_0x4147c4){const _0x170ece=a21_0x4ece,_0x1f1938=_0x4147c4[_0x170ece(0x17d)][0x0]?.[_0x170ece(0x17a)]();if(!_0x1f1938)throw CliErrors[_0x170ece(0x182)](_0x170ece(0x18a),_0x170ece(0x188)+CLI_BIN_NAME+'\x20app\x20remove\x20<name>\x20[--global]');const _0x10e155=_0x4147c4[_0x170ece(0x164)](_0x170ece(0x167)),{config:_0x4a0b62,layers:_0x374018}=readRawConfigWithLayers(),_0x2c34e0=_0x4a0b62[_0x170ece(0x166)]??{};if(!_0x2c34e0[_0x1f1938])throw CliErrors[_0x170ece(0x182)](_0x170ece(0x165)+_0x1f1938+_0x170ece(0x186));const _0x114399=_0x374018[_0x170ece(0x16e)][_0x170ece(0x166)]&&typeof _0x374018[_0x170ece(0x16e)][_0x170ece(0x166)]===_0x170ece(0x174)?_0x374018['globalConfig'][_0x170ece(0x166)]:{},_0x4278fa=_0x374018['projectConfig']['apps']&&typeof _0x374018[_0x170ece(0x17c)]['apps']===_0x170ece(0x174)?_0x374018[_0x170ece(0x17c)][_0x170ece(0x166)]:{},_0x485f14=appDefinedIn(_0x1f1938,_0x114399,_0x4278fa),_0x14b311=resolveAppScopeForWrite(_0x1f1938,_0x10e155,_0x374018),_0x283cc6={'global':_0x14b311===_0x170ece(0x167)},_0x575b8b=readConfig(_0x283cc6),_0x13e033=_0x575b8b['apps'];if(!_0x13e033||!_0x13e033[_0x1f1938])throw CliErrors[_0x170ece(0x182)]('App\x20\x22'+_0x1f1938+_0x170ece(0x186));delete _0x13e033[_0x1f1938];let _0xdc5c56='';if(_0x575b8b[_0x170ece(0x17e)]===_0x1f1938){const _0x2834c3=Object[_0x170ece(0x172)](_0x13e033);_0x575b8b[_0x170ece(0x17e)]=_0x2834c3[_0x170ece(0x17b)]>0x0?_0x2834c3[0x0]:undefined,_0x575b8b[_0x170ece(0x17e)]?_0xdc5c56=_0x170ece(0x16a)+_0x575b8b['defaultApp']+'\x22.':delete _0x575b8b['defaultApp'];}Object['keys'](_0x13e033)[_0x170ece(0x17b)]===0x0&&(delete _0x575b8b[_0x170ece(0x166)],delete _0x575b8b[_0x170ece(0x17e)]);writeConfig(_0x575b8b,_0x283cc6);const _0x5de7d5=_0x485f14===_0x170ece(0x181)?_0x170ece(0x171)+_0x1f1938+_0x170ece(0x16d)+(_0x14b311===_0x170ece(0x170)?'global':'project')+_0x170ece(0x17f):'';return{'ok':!![],'message':_0x170ece(0x16f)+_0x1f1938+'\x22'+scopeLabel(_0x283cc6)+'.'+_0xdc5c56+_0x5de7d5};}export const appRemoveDefinition={'service':a21_0x43dd68(0x169),'command':'remove','description':a21_0x43dd68(0x179),'risk':'high-risk-write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a21_0x43dd68(0x189),'description':'App\x20profile\x20name\x20to\x20remove','required':!![]}],'flags':[{'name':a21_0x43dd68(0x167),'type':a21_0x43dd68(0x184),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- function a22_0x23dd(){const _0xdb2007=['apps','13699raEfSl','1499988SrpsAA','cookie','length','locale','2651fqsEYm','pageSize','Migrated\x20existing\x20app\x20\x22','keys','projectConfig','1eRVeoK','accessKey','20439fxqkiy','defaultApp','globalConfig','1151230xHanNu','90Tnzjry','688YkQSKY','format','appcode','project','hasOwnProperty','7050hyJHZD','both','call','11433JAJDOL','app','271270pQzZat','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','riskLevel','100eUMbKM','prototype','global','object'];a22_0x23dd=function(){return _0xdb2007;};return a22_0x23dd();}(function(_0x3693ea,_0xde6d81){const _0x15df5a=a22_0x64e3,_0x5c5703=_0x3693ea();while(!![]){try{const _0x3dc164=parseInt(_0x15df5a(0xa0))/0x1*(parseInt(_0x15df5a(0x8e))/0x2)+parseInt(_0x15df5a(0x8c))/0x3*(parseInt(_0x15df5a(0x91))/0x4)+-parseInt(_0x15df5a(0x82))/0x5+-parseInt(_0x15df5a(0x83))/0x6*(-parseInt(_0x15df5a(0x96))/0x7)+parseInt(_0x15df5a(0x84))/0x8*(parseInt(_0x15df5a(0x7f))/0x9)+parseInt(_0x15df5a(0x89))/0xa*(-parseInt(_0x15df5a(0x9b))/0xb)+parseInt(_0x15df5a(0x97))/0xc;if(_0x3dc164===_0xde6d81)break;else _0x5c5703['push'](_0x5c5703['shift']());}catch(_0x21493b){_0x5c5703['push'](_0x5c5703['shift']());}}}(a22_0x23dd,0x2c0c3));import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function resolveAppScopeForWrite(_0x2853fc,_0x2f3ca5,_0x5966ef){const _0x12a238=a22_0x64e3;if(_0x2f3ca5)return'global';const _0xbf0167=_0x5966ef[_0x12a238(0x9f)][_0x12a238(0x95)]&&typeof _0x5966ef[_0x12a238(0x9f)][_0x12a238(0x95)]===_0x12a238(0x94)?_0x5966ef['projectConfig'][_0x12a238(0x95)]:{},_0x1b7935=_0x5966ef['globalConfig'][_0x12a238(0x95)]&&typeof _0x5966ef[_0x12a238(0x81)][_0x12a238(0x95)]===_0x12a238(0x94)?_0x5966ef[_0x12a238(0x81)]['apps']:{};if(Object['prototype'][_0x12a238(0x88)][_0x12a238(0x8b)](_0xbf0167,_0x2853fc))return'project';if(Object[_0x12a238(0x92)]['hasOwnProperty'][_0x12a238(0x8b)](_0x1b7935,_0x2853fc))return _0x12a238(0x93);return _0x12a238(0x87);}export function appDefinedIn(_0x56eb78,_0x31dc41,_0x2fe96c){const _0x12975d=a22_0x64e3,_0xaa3177=Object[_0x12975d(0x92)][_0x12975d(0x88)][_0x12975d(0x8b)](_0x31dc41,_0x56eb78),_0x233f95=Object[_0x12975d(0x92)][_0x12975d(0x88)]['call'](_0x2fe96c,_0x56eb78);if(_0xaa3177&&_0x233f95)return _0x12975d(0x8a);if(_0x233f95)return'project';return _0x12975d(0x93);}function a22_0x64e3(_0x46381a,_0x5d0563){_0x46381a=_0x46381a-0x7e;const _0x23dda0=a22_0x23dd();let _0x64e32b=_0x23dda0[_0x46381a];return _0x64e32b;}export function resolveDefaultAppSource(_0x5cf57d){const _0x173090=a22_0x64e3,_0x6ab2b8=_0x5cf57d[_0x173090(0x9f)]['apps']&&typeof _0x5cf57d[_0x173090(0x9f)][_0x173090(0x95)]==='object'?_0x5cf57d[_0x173090(0x9f)]['apps']:{};if(_0x173090(0x80)in _0x5cf57d[_0x173090(0x9f)])return'project';if(Object[_0x173090(0x9e)](_0x6ab2b8)[_0x173090(0x99)]>0x0)return _0x173090(0x87);if(_0x5cf57d[_0x173090(0x81)][_0x173090(0x80)])return _0x173090(0x93);return null;}export function getConfigPath(_0x2f5eda={}){const _0x3b8d36=a22_0x64e3,_0x1ed0b3=_0x2f5eda[_0x3b8d36(0x93)]?_0x3b8d36(0x93):_0x3b8d36(0x87);return resolveWriteConfigPath(_0x1ed0b3);}export function readConfig(_0x537c29={}){return readConfigFile(getConfigPath(_0x537c29));}export function writeConfig(_0x2ef89d,_0x297da3={}){writeConfigFile(getConfigPath(_0x297da3),_0x2ef89d);}export function scopeLabel(_0x3b099f){const _0x26968c=a22_0x64e3;return _0x3b099f[_0x26968c(0x93)]?'\x20(global)':'';}export function migrateLegacySingleApp(_0xb5a1fb,_0x3f992f){const _0x2ac23e=a22_0x64e3,_0x17090f=_0xb5a1fb[_0x2ac23e(0x86)]||_0xb5a1fb[_0x2ac23e(0x8d)];if(!_0x17090f)return;const _0x502f4a=String(_0x17090f);if(_0x502f4a===_0x3f992f)return;const _0x128fdf=['env','apiDir',_0x2ac23e(0x98),_0x2ac23e(0x7e),_0x2ac23e(0x85),_0x2ac23e(0x9c),_0x2ac23e(0x90),_0x2ac23e(0x9a)],_0x20984f={'appcode':_0x17090f};for(const _0x5ee655 of _0x128fdf){if(_0xb5a1fb[_0x5ee655]!=null)_0x20984f[_0x5ee655]=_0xb5a1fb[_0x5ee655];}_0xb5a1fb[_0x2ac23e(0x95)][_0x502f4a]=_0x20984f,_0xb5a1fb[_0x2ac23e(0x80)]=_0x502f4a,delete _0xb5a1fb[_0x2ac23e(0x86)],delete _0xb5a1fb[_0x2ac23e(0x8d)],console['log'](_0x2ac23e(0x9d)+_0x502f4a+_0x2ac23e(0x8f));}
1
+ (function(_0x4d309b,_0x244a67){const _0x26384b=a22_0xb871,_0x11a61b=_0x4d309b();while(!![]){try{const _0x104227=-parseInt(_0x26384b(0x1a9))/0x1+-parseInt(_0x26384b(0x1a4))/0x2*(-parseInt(_0x26384b(0x1ba))/0x3)+parseInt(_0x26384b(0x1b3))/0x4*(-parseInt(_0x26384b(0x1b9))/0x5)+-parseInt(_0x26384b(0x1a5))/0x6+parseInt(_0x26384b(0x1b8))/0x7*(-parseInt(_0x26384b(0x1c2))/0x8)+-parseInt(_0x26384b(0x1ac))/0x9*(parseInt(_0x26384b(0x1ae))/0xa)+parseInt(_0x26384b(0x1af))/0xb*(parseInt(_0x26384b(0x1b0))/0xc);if(_0x104227===_0x244a67)break;else _0x11a61b['push'](_0x11a61b['shift']());}catch(_0x1b6fae){_0x11a61b['push'](_0x11a61b['shift']());}}}(a22_0x4405,0x50b55));function a22_0x4405(){const _0x4b1d6f=['appcode','keys','apiDir','call','313232qFaems','riskLevel','globalConfig','defaultApp','projectConfig','4YoJazh','204492fcdBEB','\x22\x20to\x20multi-app\x20config\x20(set\x20as\x20default).','hasOwnProperty','pageSize','57273ByVpow','prototype','format','90jIqRfb','accessKey','525970JqntZo','12925vFNiiG','9924KfACum','global','\x20(global)','14764bFadcW','app','object','project','locale','7sAuwZO','745JcJCni','847941RihXsH','env','length','apps'];a22_0x4405=function(){return _0x4b1d6f;};return a22_0x4405();}import{resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';export function resolveAppScopeForWrite(_0x427fce,_0x2887c0,_0x2890b1){const _0x567c9f=a22_0xb871;if(_0x2887c0)return'global';const _0x3f1495=_0x2890b1['projectConfig'][_0x567c9f(0x1bd)]&&typeof _0x2890b1['projectConfig'][_0x567c9f(0x1bd)]===_0x567c9f(0x1b5)?_0x2890b1[_0x567c9f(0x1a3)][_0x567c9f(0x1bd)]:{},_0x1e25c6=_0x2890b1[_0x567c9f(0x1a1)][_0x567c9f(0x1bd)]&&typeof _0x2890b1[_0x567c9f(0x1a1)][_0x567c9f(0x1bd)]===_0x567c9f(0x1b5)?_0x2890b1['globalConfig'][_0x567c9f(0x1bd)]:{};if(Object[_0x567c9f(0x1aa)][_0x567c9f(0x1a7)][_0x567c9f(0x1c1)](_0x3f1495,_0x427fce))return'project';if(Object[_0x567c9f(0x1aa)][_0x567c9f(0x1a7)][_0x567c9f(0x1c1)](_0x1e25c6,_0x427fce))return'global';return _0x567c9f(0x1b6);}export function appDefinedIn(_0x30c6a5,_0x233e66,_0x5456c2){const _0x51c8d6=a22_0xb871,_0x5351d7=Object[_0x51c8d6(0x1aa)][_0x51c8d6(0x1a7)][_0x51c8d6(0x1c1)](_0x233e66,_0x30c6a5),_0x1e4afd=Object[_0x51c8d6(0x1aa)][_0x51c8d6(0x1a7)][_0x51c8d6(0x1c1)](_0x5456c2,_0x30c6a5);if(_0x5351d7&&_0x1e4afd)return'both';if(_0x1e4afd)return _0x51c8d6(0x1b6);return _0x51c8d6(0x1b1);}export function resolveDefaultAppSource(_0x49633e){const _0x14ec27=a22_0xb871,_0x23c9ae=_0x49633e[_0x14ec27(0x1a3)][_0x14ec27(0x1bd)]&&typeof _0x49633e[_0x14ec27(0x1a3)][_0x14ec27(0x1bd)]==='object'?_0x49633e['projectConfig']['apps']:{};if('defaultApp'in _0x49633e[_0x14ec27(0x1a3)])return _0x14ec27(0x1b6);if(Object[_0x14ec27(0x1bf)](_0x23c9ae)[_0x14ec27(0x1bc)]>0x0)return _0x14ec27(0x1b6);if(_0x49633e['globalConfig']['defaultApp'])return'global';return null;}export function getConfigPath(_0x1af4d8={}){const _0x3e5fe0=a22_0xb871,_0x8b986a=_0x1af4d8['global']?_0x3e5fe0(0x1b1):_0x3e5fe0(0x1b6);return resolveWriteConfigPath(_0x8b986a);}export function readConfig(_0x4839a3={}){return readConfigFile(getConfigPath(_0x4839a3));}export function writeConfig(_0x39996e,_0x288eee={}){writeConfigFile(getConfigPath(_0x288eee),_0x39996e);}export function scopeLabel(_0x2c15bf){const _0x5064a5=a22_0xb871;return _0x2c15bf[_0x5064a5(0x1b1)]?_0x5064a5(0x1b2):'';}function a22_0xb871(_0x1d250c,_0x53f71e){_0x1d250c=_0x1d250c-0x1a1;const _0x44056a=a22_0x4405();let _0xb8712c=_0x44056a[_0x1d250c];return _0xb8712c;}export function migrateLegacySingleApp(_0x3f20,_0x1973b0){const _0x2990c5=a22_0xb871,_0x1156df=_0x3f20[_0x2990c5(0x1be)]||_0x3f20[_0x2990c5(0x1b4)];if(!_0x1156df)return;const _0x5dd99f=String(_0x1156df);if(_0x5dd99f===_0x1973b0)return;const _0x56026e=[_0x2990c5(0x1bb),_0x2990c5(0x1c0),'cookie',_0x2990c5(0x1ad),_0x2990c5(0x1ab),_0x2990c5(0x1a8),_0x2990c5(0x1c3),_0x2990c5(0x1b7)],_0x155bea={'appcode':_0x1156df};for(const _0x276ead of _0x56026e){if(_0x3f20[_0x276ead]!=null)_0x155bea[_0x276ead]=_0x3f20[_0x276ead];}_0x3f20[_0x2990c5(0x1bd)][_0x5dd99f]=_0x155bea,_0x3f20[_0x2990c5(0x1a2)]=_0x5dd99f,delete _0x3f20[_0x2990c5(0x1be)],delete _0x3f20['app'],console['log']('Migrated\x20existing\x20app\x20\x22'+_0x5dd99f+_0x2990c5(0x1a6));}
@@ -1 +1 @@
1
- const a23_0x54ca62=a23_0x3df7;(function(_0x34ecd4,_0xb4951a){const _0x4f2596=a23_0x3df7,_0x20d8ef=_0x34ecd4();while(!![]){try{const _0x13b6fb=-parseInt(_0x4f2596(0xca))/0x1*(parseInt(_0x4f2596(0xd3))/0x2)+-parseInt(_0x4f2596(0xd0))/0x3*(parseInt(_0x4f2596(0xcf))/0x4)+-parseInt(_0x4f2596(0xe1))/0x5*(parseInt(_0x4f2596(0xe2))/0x6)+-parseInt(_0x4f2596(0xc5))/0x7+-parseInt(_0x4f2596(0xd5))/0x8+-parseInt(_0x4f2596(0xde))/0x9+parseInt(_0x4f2596(0xdc))/0xa;if(_0x13b6fb===_0xb4951a)break;else _0x20d8ef['push'](_0x20d8ef['shift']());}catch(_0x1217e2){_0x20d8ef['push'](_0x20d8ef['shift']());}}}(a23_0x4ad8,0xbc578));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite}from'../../commands/app/shared.js';async function validateArgs(_0x3f864c){const _0x3a05f8=a23_0x3df7,_0xd0a347=_0x3f864c[_0x3a05f8(0xda)][0x0]?.[_0x3a05f8(0xc3)]();if(!_0xd0a347)throw CliErrors[_0x3a05f8(0xd1)](_0x3a05f8(0xd9),_0x3a05f8(0xce)+CLI_BIN_NAME+_0x3a05f8(0xc9));}function a23_0x4ad8(){const _0x322705=['103204jogcFs','3TnqnIU','validation','bool','14uKKkSk','\x22\x20(appcode:\x20','5352640UKfJYS','Switch\x20the\x20default\x20app','boolean','\x20app\x20add\x20','Missing\x20app\x20name.','args','length','45679870UDOfhm','write','1447920glznwu','\x20--appcode\x20<code>`\x20first.','Default\x20app\x20set\x20to\x20\x22','1495100kGNdGY','30ncZvzP','\x22\x20not\x20found.','Use\x20global\x20config\x20scope','App\x20\x22','trim','Use\x20`','4808734RffYmI','Available:\x20','apps','app','\x20app\x20use\x20<name>\x20[--global]','108388LATMTg','name','global','defaultApp','Usage:\x20'];a23_0x4ad8=function(){return _0x322705;};return a23_0x4ad8();}function a23_0x3df7(_0x42a0cc,_0x30228b){_0x42a0cc=_0x42a0cc-0xc3;const _0x4ad8ff=a23_0x4ad8();let _0x3df714=_0x4ad8ff[_0x42a0cc];return _0x3df714;}async function execute(_0xdde101){const _0x1022c7=a23_0x3df7,_0x2f8f89=_0xdde101['args'][0x0]?.[_0x1022c7(0xc3)]();if(!_0x2f8f89)throw CliErrors[_0x1022c7(0xd1)](_0x1022c7(0xd9),'Usage:\x20'+CLI_BIN_NAME+_0x1022c7(0xc9));const _0x1d3104=_0xdde101[_0x1022c7(0xd2)](_0x1022c7(0xcc)),{config:_0x26b87c,layers:_0x45d32c}=readRawConfigWithLayers(),_0xa9084=_0x26b87c[_0x1022c7(0xc7)]??{};if(!_0xa9084[_0x2f8f89]){const _0xfa5093=Object['keys'](_0xa9084),_0x59eaf0=_0xfa5093[_0x1022c7(0xdb)]===0x0?_0x1022c7(0xc4)+CLI_BIN_NAME+_0x1022c7(0xd8)+_0x2f8f89+_0x1022c7(0xdf):_0x1022c7(0xc6)+_0xfa5093['join'](',\x20');throw CliErrors[_0x1022c7(0xd1)](_0x1022c7(0xe5)+_0x2f8f89+_0x1022c7(0xe3),_0x59eaf0);}const _0x3e51fa=resolveAppScopeForWrite(_0x2f8f89,_0x1d3104,_0x45d32c),_0x37d8cd={'global':_0x3e51fa===_0x1022c7(0xcc)},_0x180116=readConfig(_0x37d8cd);return _0x180116[_0x1022c7(0xcd)]=_0x2f8f89,writeConfig(_0x180116,_0x37d8cd),{'ok':!![],'message':_0x1022c7(0xe0)+_0x2f8f89+_0x1022c7(0xd4)+_0xa9084[_0x2f8f89]['appcode']+')'+scopeLabel(_0x37d8cd)};}export const appUseDefinition={'service':a23_0x54ca62(0xc8),'command':'use','description':a23_0x54ca62(0xd6),'risk':a23_0x54ca62(0xdd),'requiresAuth':![],'requiresAppCode':![],'args':[{'name':a23_0x54ca62(0xcb),'description':'App\x20profile\x20name\x20to\x20activate','required':!![]}],'flags':[{'name':'global','type':a23_0x54ca62(0xd7),'description':a23_0x54ca62(0xe4),'default':![]}],'validate':validateArgs,'execute':execute};
1
+ const a23_0x5b8c44=a23_0x1fe7;(function(_0x32d14b,_0x2533c2){const _0x2636bf=a23_0x1fe7,_0x2c1f91=_0x32d14b();while(!![]){try{const _0x208de4=-parseInt(_0x2636bf(0xd3))/0x1*(parseInt(_0x2636bf(0xf4))/0x2)+parseInt(_0x2636bf(0xe7))/0x3+-parseInt(_0x2636bf(0xf0))/0x4*(parseInt(_0x2636bf(0xd4))/0x5)+-parseInt(_0x2636bf(0xe2))/0x6*(-parseInt(_0x2636bf(0xe5))/0x7)+-parseInt(_0x2636bf(0xf3))/0x8*(parseInt(_0x2636bf(0xf2))/0x9)+parseInt(_0x2636bf(0xe0))/0xa+parseInt(_0x2636bf(0xd5))/0xb*(parseInt(_0x2636bf(0xea))/0xc);if(_0x208de4===_0x2533c2)break;else _0x2c1f91['push'](_0x2c1f91['shift']());}catch(_0xcf6f47){_0x2c1f91['push'](_0x2c1f91['shift']());}}}(a23_0x5479,0xb9108));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{readRawConfigWithLayers}from'../../context.js';function a23_0x5479(){const _0x440255=['\x22\x20(appcode:\x20','defaultApp','973LDCvEb','App\x20\x22','174837oWrFqb','name','bool','96oDfMHK','\x22\x20not\x20found.','app','Default\x20app\x20set\x20to\x20\x22','Usage:\x20','join','132868iEKpzq','Use\x20`','939447PAHkXs','64ETuAig','1040696kOKSJH','Switch\x20the\x20default\x20app','appcode','\x20--appcode\x20<code>`\x20first.','1RHSpLT','175hclfwN','2122054LYvbGA','trim','validation','Missing\x20app\x20name.','apps','boolean','args','global','App\x20profile\x20name\x20to\x20activate','\x20app\x20use\x20<name>\x20[--global]','keys','12179640ZhOzPt','\x20app\x20add\x20','19704jasAEo'];a23_0x5479=function(){return _0x440255;};return a23_0x5479();}function a23_0x1fe7(_0x41c0b2,_0x413961){_0x41c0b2=_0x41c0b2-0xd0;const _0x54799c=a23_0x5479();let _0x1fe79c=_0x54799c[_0x41c0b2];return _0x1fe79c;}import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite}from'../../commands/app/shared.js';async function validateArgs(_0x29d14f){const _0x32b8c2=a23_0x1fe7,_0xcd34f2=_0x29d14f[_0x32b8c2(0xdb)][0x0]?.[_0x32b8c2(0xd6)]();if(!_0xcd34f2)throw CliErrors[_0x32b8c2(0xd7)](_0x32b8c2(0xd8),_0x32b8c2(0xee)+CLI_BIN_NAME+_0x32b8c2(0xde));}async function execute(_0x3441af){const _0x40df33=a23_0x1fe7,_0x50174e=_0x3441af[_0x40df33(0xdb)][0x0]?.[_0x40df33(0xd6)]();if(!_0x50174e)throw CliErrors['validation'](_0x40df33(0xd8),_0x40df33(0xee)+CLI_BIN_NAME+_0x40df33(0xde));const _0x5d7bb3=_0x3441af[_0x40df33(0xe9)](_0x40df33(0xdc)),{config:_0x1f8869,layers:_0x2813c9}=readRawConfigWithLayers(),_0x2023a3=_0x1f8869[_0x40df33(0xd9)]??{};if(!_0x2023a3[_0x50174e]){const _0x294296=Object[_0x40df33(0xdf)](_0x2023a3),_0x175085=_0x294296['length']===0x0?_0x40df33(0xf1)+CLI_BIN_NAME+_0x40df33(0xe1)+_0x50174e+_0x40df33(0xd2):'Available:\x20'+_0x294296[_0x40df33(0xef)](',\x20');throw CliErrors['validation'](_0x40df33(0xe6)+_0x50174e+_0x40df33(0xeb),_0x175085);}const _0x128a14=resolveAppScopeForWrite(_0x50174e,_0x5d7bb3,_0x2813c9),_0x156907={'global':_0x128a14===_0x40df33(0xdc)},_0x3857fb=readConfig(_0x156907);return _0x3857fb[_0x40df33(0xe4)]=_0x50174e,writeConfig(_0x3857fb,_0x156907),{'ok':!![],'message':_0x40df33(0xed)+_0x50174e+_0x40df33(0xe3)+_0x2023a3[_0x50174e][_0x40df33(0xd1)]+')'+scopeLabel(_0x156907)};}export const appUseDefinition={'service':a23_0x5b8c44(0xec),'command':'use','description':a23_0x5b8c44(0xd0),'risk':'write','requiresAuth':![],'requiresAppCode':![],'args':[{'name':a23_0x5b8c44(0xe8),'description':a23_0x5b8c44(0xdd),'required':!![]}],'flags':[{'name':a23_0x5b8c44(0xdc),'type':a23_0x5b8c44(0xda),'description':'Use\x20global\x20config\x20scope','default':![]}],'validate':validateArgs,'execute':execute};
@@ -1 +1 @@
1
- const a24_0x3979ce=a24_0x1236;function a24_0x17eb(){const _0x1d8c80=['write','61565FLnjYa','10iObdzY','652357YjbqUb','log','logout','!\x20Not\x20logged\x20in','../../auth/auth-server-ui.js','Clear\x20login\x20session','198CWSFch','auth','19462176JtZSwv','2564900igjKpE','3480970ayddJw','1205152LrwbRZ','447063asJmIK','login'];a24_0x17eb=function(){return _0x1d8c80;};return a24_0x17eb();}(function(_0x58f3cb,_0x5adf4f){const _0x2a836d=a24_0x1236,_0x122ea4=_0x58f3cb();while(!![]){try{const _0x918e86=-parseInt(_0x2a836d(0xc0))/0x1+-parseInt(_0x2a836d(0xbf))/0x2*(-parseInt(_0x2a836d(0xbb))/0x3)+-parseInt(_0x2a836d(0xb8))/0x4+-parseInt(_0x2a836d(0xb9))/0x5+-parseInt(_0x2a836d(0xc6))/0x6*(parseInt(_0x2a836d(0xbe))/0x7)+-parseInt(_0x2a836d(0xba))/0x8+parseInt(_0x2a836d(0xc8))/0x9;if(_0x918e86===_0x5adf4f)break;else _0x122ea4['push'](_0x122ea4['shift']());}catch(_0x85d8c5){_0x122ea4['push'](_0x122ea4['shift']());}}}(a24_0x17eb,0x746f2));function a24_0x1236(_0x406f13,_0x5b7f4b){_0x406f13=_0x406f13-0xb8;const _0x17ebf4=a24_0x17eb();let _0x12360e=_0x17ebf4[_0x406f13];return _0x12360e;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a24_0x3979ce(0xc7),'command':a24_0x3979ce(0xbc),'description':'Login\x20via\x20browser','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x33a0b2){const _0xc8b440=a24_0x3979ce,{runAuthServer:_0x4c903a}=await import(_0xc8b440(0xc4));return await _0x4c903a(),{'ok':!![]};}},{'service':'auth','command':a24_0x3979ce(0xc2),'description':a24_0x3979ce(0xc5),'risk':a24_0x3979ce(0xbd),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3969b7){const _0x524a74=a24_0x3979ce;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console[_0x524a74(0xc1)](_0x524a74(0xc3)),{'ok':!![]};}}];
1
+ const a24_0x291576=a24_0x2c60;(function(_0x409ae4,_0x420f3a){const _0x45b3da=a24_0x2c60,_0x27e540=_0x409ae4();while(!![]){try{const _0x59887c=-parseInt(_0x45b3da(0x1e3))/0x1*(parseInt(_0x45b3da(0x1e5))/0x2)+parseInt(_0x45b3da(0x1df))/0x3+-parseInt(_0x45b3da(0x1ea))/0x4*(-parseInt(_0x45b3da(0x1e8))/0x5)+parseInt(_0x45b3da(0x1e1))/0x6+parseInt(_0x45b3da(0x1eb))/0x7+parseInt(_0x45b3da(0x1dd))/0x8*(-parseInt(_0x45b3da(0x1e7))/0x9)+-parseInt(_0x45b3da(0x1de))/0xa;if(_0x59887c===_0x420f3a)break;else _0x27e540['push'](_0x27e540['shift']());}catch(_0xa3a49b){_0x27e540['push'](_0x27e540['shift']());}}}(a24_0x5359,0xe155b));function a24_0x2c60(_0x1a4850,_0x1957b3){_0x1a4850=_0x1a4850-0x1dc;const _0x535942=a24_0x5359();let _0x2c607a=_0x535942[_0x1a4850];return _0x2c607a;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a24_0x5359(){const _0x125032=['log','57258JXZYpP','5UKBsQc','Login\x20via\x20browser','2597884yadkIW','4656463IwBCsp','../../auth/auth-server-ui.js','login','768BSLyZd','2462520quVsBi','149283tKSScR','Clear\x20login\x20session','4532196fdjuDi','write','1588ailoQd','auth','428MwtutA'];a24_0x5359=function(){return _0x125032;};return a24_0x5359();}export const authDefinitions=[{'service':a24_0x291576(0x1e4),'command':a24_0x291576(0x1dc),'description':a24_0x291576(0x1e9),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1afd06){const _0x593670=a24_0x291576,{runAuthServer:_0x521846}=await import(_0x593670(0x1ec));return await _0x521846(),{'ok':!![]};}},{'service':a24_0x291576(0x1e4),'command':'logout','description':a24_0x291576(0x1e0),'risk':a24_0x291576(0x1e2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3071fe){const _0x3d0319=a24_0x291576;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console[_0x3d0319(0x1e6)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a25_0x3e615c=a25_0x5bca;(function(_0x27a502,_0x3eb53a){const _0x1779ae=a25_0x5bca,_0x199fb6=_0x27a502();while(!![]){try{const _0xf96325=parseInt(_0x1779ae(0x1d6))/0x1+parseInt(_0x1779ae(0x1ba))/0x2+parseInt(_0x1779ae(0x1d8))/0x3*(-parseInt(_0x1779ae(0x1dd))/0x4)+parseInt(_0x1779ae(0x1df))/0x5*(parseInt(_0x1779ae(0x1e8))/0x6)+parseInt(_0x1779ae(0x1d4))/0x7*(-parseInt(_0x1779ae(0x1be))/0x8)+-parseInt(_0x1779ae(0x1bc))/0x9*(parseInt(_0x1779ae(0x1e2))/0xa)+-parseInt(_0x1779ae(0x1db))/0xb*(-parseInt(_0x1779ae(0x1d1))/0xc);if(_0xf96325===_0x3eb53a)break;else _0x199fb6['push'](_0x199fb6['shift']());}catch(_0x5836f5){_0x199fb6['push'](_0x199fb6['shift']());}}}(a25_0x472e,0xa05cd));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a25_0x5bca(_0x29cf79,_0x3c368c){_0x29cf79=_0x29cf79-0x1b8;const _0x472e8d=a25_0x472e();let _0x5bca96=_0x472e8d[_0x29cf79];return _0x5bca96;}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a25_0x472e(){const _0x4b64cf=['bff','193523aLGyQz','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','2580956KuVHvT','target','145445hkIcXG','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','\x20(local\x20file\x20moved\x20to\x20trash)','10uUYUeE','projectRoot','filter','includes','lockFilePath','replace','48fYNKIk','delete','trashDir','211386AnjfKC','BFF\x20lock\x20file\x20not\x20found.','2998233bznBLz','Multiple\x20functions\x20match\x20\x22','24UHnrsV','trashedTo','scriptsRoot','appCode','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','string','<timestamp>','str','remoteId','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','validation','POST','length','map','keys','/api/management/library/scripts/delete','No\x20lock\x20entry\x20found\x20for\x20\x22','toISOString','\x20\x20-\x20','552zzmpgP','Function\x20not\x20found:\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','1652945VdJvrb','find','1195943afrnHZ','functions','3EodQqu','startsWith'];a25_0x472e=function(){return _0x4b64cf;};return a25_0x472e();}import{CliErrors}from'../../errors.js';export const bffDelete={'service':a25_0x3e615c(0x1da),'command':a25_0x3e615c(0x1b8),'description':a25_0x3e615c(0x1c2),'risk':'high-risk-write','flags':[{'name':a25_0x3e615c(0x1de),'type':a25_0x3e615c(0x1c3),'required':!![],'description':a25_0x3e615c(0x1e0)}],async 'validate'(_0x58263c){const _0x1b812b=a25_0x3e615c,_0x731341=loadBffProjectConfig(_0x58263c[_0x1b812b(0x1c1)]),_0x21d2d8=await readBffLockFile(_0x731341[_0x1b812b(0x1e6)]);if(!_0x21d2d8)throw CliErrors[_0x1b812b(0x1c8)](_0x1b812b(0x1c7));},async 'dryRun'(_0x4b487d){const _0x55d5f0=a25_0x3e615c,_0x35f76e=loadBffProjectConfig(_0x4b487d[_0x55d5f0(0x1c1)]),_0x26254e=await readBffLockFile(_0x35f76e['lockFilePath']);if(!_0x26254e)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x1ad8ac}=ensureLockScope(_0x26254e,_0x4b487d['appCode'],_0x35f76e['scriptsRoot'],_0x55d5f0(0x1b8)),_0x73da4e=_0x4b487d[_0x55d5f0(0x1c5)](_0x55d5f0(0x1de)),_0x32bef4=Object[_0x55d5f0(0x1cc)](_0x1ad8ac[_0x55d5f0(0x1d7)]),_0x2dfd6d=resolveDeleteTarget(_0x73da4e,_0x32bef4),_0x502615=_0x1ad8ac[_0x55d5f0(0x1d7)][_0x2dfd6d];if(!_0x502615)throw CliErrors[_0x55d5f0(0x1c8)](_0x55d5f0(0x1ce)+_0x2dfd6d+'\x22.');const _0x478faf=resolveLocalFilePathFromLockKey(_0x35f76e,_0x2dfd6d),_0xbb5449=relative(_0x35f76e['projectRoot'],_0x478faf),_0x377b34=join(_0x35f76e[_0x55d5f0(0x1b9)],_0x55d5f0(0x1c4),_0xbb5449);return{'method':_0x55d5f0(0x1c9),'url':_0x55d5f0(0x1cd),'body':{'appCode':_0x4b487d[_0x55d5f0(0x1c1)],'target':_0x2dfd6d,'remoteId':_0x502615[_0x55d5f0(0x1c6)],'localFilePath':_0x478faf,'trashedPath':_0x377b34},'description':'Would\x20delete\x20'+_0x2dfd6d+_0x55d5f0(0x1d3)};},async 'execute'(_0x5a569c){const _0x5a7934=a25_0x3e615c,_0x4ee372=loadBffProjectConfig(_0x5a569c[_0x5a7934(0x1c1)]),_0x32d822=await readBffLockFile(_0x4ee372[_0x5a7934(0x1e6)]);if(!_0x32d822)throw CliErrors[_0x5a7934(0x1c8)](_0x5a7934(0x1bb));const {lockData:_0x5a67cf,appLock:_0x1a6212}=ensureLockScope(_0x32d822,_0x5a569c[_0x5a7934(0x1c1)],_0x4ee372[_0x5a7934(0x1c0)],'delete'),_0x127d15=_0x5a569c[_0x5a7934(0x1c5)]('target'),_0x33985b=Object[_0x5a7934(0x1cc)](_0x1a6212[_0x5a7934(0x1d7)]),_0x113a87=resolveDeleteTarget(_0x127d15,_0x33985b),_0x256867=_0x1a6212[_0x5a7934(0x1d7)][_0x113a87];if(!_0x256867)throw CliErrors[_0x5a7934(0x1c8)](_0x5a7934(0x1ce)+_0x113a87+'\x22.');await deleteBffScript(_0x256867[_0x5a7934(0x1c6)]),delete _0x1a6212[_0x5a7934(0x1d7)][_0x113a87],_0x1a6212['lastSync']=new Date()[_0x5a7934(0x1cf)](),await writeBffLockFile(_0x4ee372['lockFilePath'],_0x5a67cf);const _0x26bfc8=resolveLocalFilePathFromLockKey(_0x4ee372,_0x113a87);let _0x4085fc;await fileExists(_0x26bfc8)&&(_0x4085fc=await moveToTrash(_0x4ee372[_0x5a7934(0x1e3)],_0x4ee372[_0x5a7934(0x1b9)],_0x26bfc8),await cleanupEmptyDirectories(dirname(_0x26bfc8),_0x4ee372['scriptsRootDir']));const _0x5848aa={'deleted':_0x113a87,'remoteId':_0x256867['remoteId']};if(_0x4085fc)_0x5848aa[_0x5a7934(0x1bf)]=_0x4085fc;return{'ok':!![],'data':_0x5848aa,'message':'Deleted\x20'+_0x113a87+(_0x4085fc?_0x5a7934(0x1e1):'')};}};function resolveDeleteTarget(_0x42a216,_0x36a672){const _0x26b787=a25_0x3e615c;if(_0x42a216[_0x26b787(0x1e5)]('/')){const _0x1eb9ae=_0x36a672[_0x26b787(0x1d5)](_0x1a3e5c=>_0x1a3e5c===_0x42a216);if(!_0x1eb9ae)throw CliErrors[_0x26b787(0x1c8)](_0x26b787(0x1d2)+_0x42a216);return _0x1eb9ae;}const _0x1666f2=_0x36a672[_0x26b787(0x1e4)](_0x4c0045=>_0x4c0045['split']('/')['at'](-0x1)===_0x42a216);if(_0x1666f2[_0x26b787(0x1ca)]===0x0)throw CliErrors[_0x26b787(0x1c8)](_0x26b787(0x1d2)+_0x42a216);if(_0x1666f2[_0x26b787(0x1ca)]>0x1)throw CliErrors[_0x26b787(0x1c8)](_0x26b787(0x1bd)+_0x42a216+_0x26b787(0x1dc)+_0x1666f2[_0x26b787(0x1cb)](_0x30ef94=>_0x26b787(0x1d0)+_0x30ef94)['join']('\x0a'));return _0x1666f2[0x0];}async function moveToTrash(_0x20be2b,_0x55168d,_0x23a50d){const _0x5b6663=a25_0x3e615c,_0x1f4527=new Date()[_0x5b6663(0x1cf)]()[_0x5b6663(0x1e7)](/[:.]/g,'-'),_0x282072=relative(_0x20be2b,_0x23a50d),_0x259e76=join(_0x55168d,_0x1f4527,_0x282072);return await mkdir(dirname(_0x259e76),{'recursive':!![]}),await rename(_0x23a50d,_0x259e76),_0x259e76;}async function cleanupEmptyDirectories(_0x215078,_0x4d436c){const _0x374763=a25_0x3e615c;let _0x770e=resolve(_0x215078);const _0x1da553=resolve(_0x4d436c);while(_0x770e[_0x374763(0x1d9)](''+_0x1da553+sep)||_0x770e===_0x1da553){if(_0x770e===_0x1da553)return;try{const _0x4e7bee=await readdir(_0x770e);if(_0x4e7bee[_0x374763(0x1ca)]>0x0)return;await rmdir(_0x770e);}catch{return;}_0x770e=dirname(_0x770e);}}
1
+ const a25_0x538797=a25_0x59fc;(function(_0x5b37de,_0x25922a){const _0x5c7eb0=a25_0x59fc,_0x3f0a59=_0x5b37de();while(!![]){try{const _0xf44a26=parseInt(_0x5c7eb0(0x1f1))/0x1+parseInt(_0x5c7eb0(0x1e2))/0x2*(-parseInt(_0x5c7eb0(0x1d6))/0x3)+parseInt(_0x5c7eb0(0x1d4))/0x4*(parseInt(_0x5c7eb0(0x1e3))/0x5)+parseInt(_0x5c7eb0(0x1eb))/0x6+-parseInt(_0x5c7eb0(0x1dc))/0x7+parseInt(_0x5c7eb0(0x1e9))/0x8+-parseInt(_0x5c7eb0(0x1de))/0x9;if(_0xf44a26===_0x25922a)break;else _0x3f0a59['push'](_0x3f0a59['shift']());}catch(_0x524d39){_0x3f0a59['push'](_0x3f0a59['shift']());}}}(a25_0x5da7,0x70714));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffDelete={'service':a25_0x538797(0x1f8),'command':a25_0x538797(0x1dd),'description':a25_0x538797(0x1f6),'risk':a25_0x538797(0x1e6),'flags':[{'name':a25_0x538797(0x1fa),'type':a25_0x538797(0x1f9),'required':!![],'description':a25_0x538797(0x1cf)}],async 'validate'(_0x399f17){const _0x39ab31=a25_0x538797,_0x113758=loadBffProjectConfig(_0x399f17[_0x39ab31(0x1d7)]),_0x1f85ef=await readBffLockFile(_0x113758[_0x39ab31(0x1d1)]);if(!_0x1f85ef)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x173106){const _0x4a6135=a25_0x538797,_0x5dfc16=loadBffProjectConfig(_0x173106['appCode']),_0x3f85a2=await readBffLockFile(_0x5dfc16[_0x4a6135(0x1d1)]);if(!_0x3f85a2)throw CliErrors[_0x4a6135(0x1f3)](_0x4a6135(0x1ee));const {appLock:_0x5a0a4b}=ensureLockScope(_0x3f85a2,_0x173106[_0x4a6135(0x1d7)],_0x5dfc16[_0x4a6135(0x1ed)],_0x4a6135(0x1dd)),_0x335d77=_0x173106[_0x4a6135(0x1fb)](_0x4a6135(0x1fa)),_0x5aa1b2=Object['keys'](_0x5a0a4b['functions']),_0x343f2f=resolveDeleteTarget(_0x335d77,_0x5aa1b2),_0x5d6434=_0x5a0a4b[_0x4a6135(0x1d8)][_0x343f2f];if(!_0x5d6434)throw CliErrors[_0x4a6135(0x1f3)](_0x4a6135(0x1e5)+_0x343f2f+'\x22.');const _0x4c868d=resolveLocalFilePathFromLockKey(_0x5dfc16,_0x343f2f),_0x182b0e=relative(_0x5dfc16[_0x4a6135(0x1da)],_0x4c868d),_0x2bb78e=join(_0x5dfc16['trashDir'],_0x4a6135(0x1e4),_0x182b0e);return{'method':'POST','url':'/api/management/library/scripts/delete','body':{'appCode':_0x173106[_0x4a6135(0x1d7)],'target':_0x343f2f,'remoteId':_0x5d6434[_0x4a6135(0x1d0)],'localFilePath':_0x4c868d,'trashedPath':_0x2bb78e},'description':_0x4a6135(0x1d5)+_0x343f2f+_0x4a6135(0x1e1)};},async 'execute'(_0xc9ec14){const _0x4a204a=a25_0x538797,_0x2fd664=loadBffProjectConfig(_0xc9ec14[_0x4a204a(0x1d7)]),_0x3436a0=await readBffLockFile(_0x2fd664[_0x4a204a(0x1d1)]);if(!_0x3436a0)throw CliErrors[_0x4a204a(0x1f3)](_0x4a204a(0x1ee));const {lockData:_0x2579c5,appLock:_0x3cc635}=ensureLockScope(_0x3436a0,_0xc9ec14[_0x4a204a(0x1d7)],_0x2fd664[_0x4a204a(0x1ed)],_0x4a204a(0x1dd)),_0x5bb829=_0xc9ec14['str'](_0x4a204a(0x1fa)),_0x5c23e5=Object[_0x4a204a(0x1cc)](_0x3cc635[_0x4a204a(0x1d8)]),_0x1c5d0e=resolveDeleteTarget(_0x5bb829,_0x5c23e5),_0x30b1b7=_0x3cc635[_0x4a204a(0x1d8)][_0x1c5d0e];if(!_0x30b1b7)throw CliErrors['validation'](_0x4a204a(0x1e5)+_0x1c5d0e+'\x22.');await deleteBffScript(_0x30b1b7['remoteId']),delete _0x3cc635[_0x4a204a(0x1d8)][_0x1c5d0e],_0x3cc635[_0x4a204a(0x1d2)]=new Date()[_0x4a204a(0x1e0)](),await writeBffLockFile(_0x2fd664[_0x4a204a(0x1d1)],_0x2579c5);const _0x233858=resolveLocalFilePathFromLockKey(_0x2fd664,_0x1c5d0e);let _0x2e565e;await fileExists(_0x233858)&&(_0x2e565e=await moveToTrash(_0x2fd664[_0x4a204a(0x1da)],_0x2fd664[_0x4a204a(0x1e8)],_0x233858),await cleanupEmptyDirectories(dirname(_0x233858),_0x2fd664['scriptsRootDir']));const _0x5c758a={'deleted':_0x1c5d0e,'remoteId':_0x30b1b7[_0x4a204a(0x1d0)]};if(_0x2e565e)_0x5c758a[_0x4a204a(0x1ec)]=_0x2e565e;return{'ok':!![],'data':_0x5c758a,'message':_0x4a204a(0x1f0)+_0x1c5d0e+(_0x2e565e?_0x4a204a(0x1e7):'')};}};function resolveDeleteTarget(_0x219b2e,_0x24bd89){const _0x468a1b=a25_0x538797;if(_0x219b2e['includes']('/')){const _0x21ed03=_0x24bd89[_0x468a1b(0x1f2)](_0x50e2e6=>_0x50e2e6===_0x219b2e);if(!_0x21ed03)throw CliErrors[_0x468a1b(0x1f3)](_0x468a1b(0x1ce)+_0x219b2e);return _0x21ed03;}const _0x4d6e4e=_0x24bd89[_0x468a1b(0x1d9)](_0x3554d0=>_0x3554d0[_0x468a1b(0x1f7)]('/')['at'](-0x1)===_0x219b2e);if(_0x4d6e4e[_0x468a1b(0x1f4)]===0x0)throw CliErrors[_0x468a1b(0x1f3)](_0x468a1b(0x1ce)+_0x219b2e);if(_0x4d6e4e['length']>0x1)throw CliErrors[_0x468a1b(0x1f3)](_0x468a1b(0x1df)+_0x219b2e+_0x468a1b(0x1cd)+_0x4d6e4e[_0x468a1b(0x1ea)](_0x165272=>_0x468a1b(0x1d3)+_0x165272)[_0x468a1b(0x1ef)]('\x0a'));return _0x4d6e4e[0x0];}function a25_0x5da7(){const _0x1129db=['high-risk-write','\x20(local\x20file\x20moved\x20to\x20trash)','trashDir','3286448NvKDWg','map','3368412tnvTNE','trashedTo','scriptsRoot','BFF\x20lock\x20file\x20not\x20found.','join','Deleted\x20','883397ITQqlX','find','validation','length','startsWith','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','split','bff','string','target','str','keys','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','Function\x20not\x20found:\x20','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','remoteId','lockFilePath','lastSync','\x20\x20-\x20','350340CPVZVC','Would\x20delete\x20','105018fIfXGS','appCode','functions','filter','projectRoot','replace','861945tSlaMV','delete','8927982gUDclO','Multiple\x20functions\x20match\x20\x22','toISOString','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','26WhlZwY','10EDHcVw','<timestamp>','No\x20lock\x20entry\x20found\x20for\x20\x22'];a25_0x5da7=function(){return _0x1129db;};return a25_0x5da7();}async function moveToTrash(_0x552239,_0x37859a,_0x53b802){const _0x5109e8=a25_0x538797,_0x2ed6fe=new Date()[_0x5109e8(0x1e0)]()[_0x5109e8(0x1db)](/[:.]/g,'-'),_0x160db5=relative(_0x552239,_0x53b802),_0x1055bd=join(_0x37859a,_0x2ed6fe,_0x160db5);return await mkdir(dirname(_0x1055bd),{'recursive':!![]}),await rename(_0x53b802,_0x1055bd),_0x1055bd;}function a25_0x59fc(_0x4ef307,_0x742021){_0x4ef307=_0x4ef307-0x1cc;const _0x5da784=a25_0x5da7();let _0x59fc6b=_0x5da784[_0x4ef307];return _0x59fc6b;}async function cleanupEmptyDirectories(_0x369501,_0xaa9b8){const _0xe0f4c4=a25_0x538797;let _0x47cbb5=resolve(_0x369501);const _0x2fdb0e=resolve(_0xaa9b8);while(_0x47cbb5[_0xe0f4c4(0x1f5)](''+_0x2fdb0e+sep)||_0x47cbb5===_0x2fdb0e){if(_0x47cbb5===_0x2fdb0e)return;try{const _0x1af1d1=await readdir(_0x47cbb5);if(_0x1af1d1[_0xe0f4c4(0x1f4)]>0x0)return;await rmdir(_0x47cbb5);}catch{return;}_0x47cbb5=dirname(_0x47cbb5);}}
@@ -1 +1 @@
1
- function a26_0x432a(_0x1f3f6c,_0x195410){_0x1f3f6c=_0x1f3f6c-0x1da;const _0x41e69a=a26_0x41e6();let _0x432a5d=_0x41e69a[_0x1f3f6c];return _0x432a5d;}const a26_0x314796=a26_0x432a;function a26_0x41e6(){const _0x47a4da=['scriptContent','read','scriptType','4344812yCorKc','340038Oyingf','2853641gGuAxX','appCode','num','4697490UQJDkV','verbose','1313825pAZTqZ','number','30312PGMmnV','Get\x20BFF\x20script\x20details\x20by\x20ID','1310130oLdcCh','12608Gpkptw','bool','description','Script\x20ID','createdTime','detail','5IhTQdD'];a26_0x41e6=function(){return _0x47a4da;};return a26_0x41e6();}(function(_0x5529ed,_0x199a6a){const _0x545910=a26_0x432a,_0x5aedf6=_0x5529ed();while(!![]){try{const _0x3d15c3=-parseInt(_0x545910(0x1ef))/0x1+parseInt(_0x545910(0x1e9))/0x2+-parseInt(_0x545910(0x1ed))/0x3+parseInt(_0x545910(0x1e8))/0x4*(-parseInt(_0x545910(0x1e4))/0x5)+-parseInt(_0x545910(0x1dd))/0x6+-parseInt(_0x545910(0x1ea))/0x7+-parseInt(_0x545910(0x1de))/0x8*(-parseInt(_0x545910(0x1db))/0x9);if(_0x3d15c3===_0x199a6a)break;else _0x5aedf6['push'](_0x5aedf6['shift']());}catch(_0x64b55d){_0x5aedf6['push'](_0x5aedf6['shift']());}}}(a26_0x41e6,0xd855f));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a26_0x314796(0x1e3),'description':a26_0x314796(0x1dc),'risk':a26_0x314796(0x1e6),'flags':[{'name':'id','type':a26_0x314796(0x1da),'required':!![],'description':a26_0x314796(0x1e1)},{'name':a26_0x314796(0x1ee),'type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x52005d){const _0x148b6b=a26_0x314796,_0x165934=await getBffScriptInfo(_0x52005d[_0x148b6b(0x1ec)]('id')),_0x534f7f=_0x52005d[_0x148b6b(0x1df)](_0x148b6b(0x1ee));if(_0x534f7f)return{'ok':!![],'data':_0x165934};return{'ok':!![],'data':{'id':_0x165934['id'],'appCode':_0x165934[_0x148b6b(0x1eb)],'scriptType':_0x165934[_0x148b6b(0x1e7)],'description':_0x165934[_0x148b6b(0x1e0)]||'(none)','createdTime':_0x165934[_0x148b6b(0x1e2)]??'','updatedTime':_0x165934['updatedTime']??'','scriptContent':_0x165934[_0x148b6b(0x1e5)]??''}};}};
1
+ const a26_0x5d67f7=a26_0x18d3;function a26_0x18d3(_0x4014f3,_0x58c3ba){_0x4014f3=_0x4014f3-0x119;const _0x11dac5=a26_0x11da();let _0x18d3e3=_0x11dac5[_0x4014f3];return _0x18d3e3;}function a26_0x11da(){const _0x23eece=['boolean','description','2826usEqQU','detail','scriptType','Return\x20full\x20raw\x20script\x20object','number','2387ykxUdI','updatedTime','1895584SHBINA','4UlhrwJ','(none)','1486aZIauU','createdTime','bff','2016180uoHCRE','scriptContent','1852635UGpwBb','Get\x20BFF\x20script\x20details\x20by\x20ID','673NdIqCt','5800050qDmwbF','verbose','read','appCode','bool','Script\x20ID','1652694buvxUN'];a26_0x11da=function(){return _0x23eece;};return a26_0x11da();}(function(_0x4684e3,_0x48306e){const _0x3d61de=a26_0x18d3,_0x2bb0d8=_0x4684e3();while(!![]){try{const _0x436bbc=-parseInt(_0x3d61de(0x129))/0x1*(-parseInt(_0x3d61de(0x122))/0x2)+-parseInt(_0x3d61de(0x130))/0x3*(parseInt(_0x3d61de(0x120))/0x4)+-parseInt(_0x3d61de(0x127))/0x5+-parseInt(_0x3d61de(0x133))/0x6*(-parseInt(_0x3d61de(0x11d))/0x7)+-parseInt(_0x3d61de(0x11f))/0x8+parseInt(_0x3d61de(0x125))/0x9+parseInt(_0x3d61de(0x12a))/0xa;if(_0x436bbc===_0x48306e)break;else _0x2bb0d8['push'](_0x2bb0d8['shift']());}catch(_0xb22fae){_0x2bb0d8['push'](_0x2bb0d8['shift']());}}}(a26_0x11da,0x4ac7e));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a26_0x5d67f7(0x124),'command':a26_0x5d67f7(0x119),'description':a26_0x5d67f7(0x128),'risk':a26_0x5d67f7(0x12c),'flags':[{'name':'id','type':a26_0x5d67f7(0x11c),'required':!![],'description':a26_0x5d67f7(0x12f)},{'name':a26_0x5d67f7(0x12b),'type':a26_0x5d67f7(0x131),'description':a26_0x5d67f7(0x11b)}],async 'execute'(_0x33b9e1){const _0x2eb5e4=a26_0x5d67f7,_0x27cb39=await getBffScriptInfo(_0x33b9e1['num']('id')),_0x426a3d=_0x33b9e1[_0x2eb5e4(0x12e)](_0x2eb5e4(0x12b));if(_0x426a3d)return{'ok':!![],'data':_0x27cb39};return{'ok':!![],'data':{'id':_0x27cb39['id'],'appCode':_0x27cb39[_0x2eb5e4(0x12d)],'scriptType':_0x27cb39[_0x2eb5e4(0x11a)],'description':_0x27cb39[_0x2eb5e4(0x132)]||_0x2eb5e4(0x121),'createdTime':_0x27cb39[_0x2eb5e4(0x123)]??'','updatedTime':_0x27cb39[_0x2eb5e4(0x11e)]??'','scriptContent':_0x27cb39[_0x2eb5e4(0x126)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x46930a,_0x23eb37){const _0x5a3113=a27_0x4cae,_0x11427b=_0x46930a();while(!![]){try{const _0x381f58=parseInt(_0x5a3113(0x13f))/0x1*(parseInt(_0x5a3113(0x138))/0x2)+-parseInt(_0x5a3113(0x13c))/0x3*(parseInt(_0x5a3113(0x13e))/0x4)+-parseInt(_0x5a3113(0x141))/0x5*(-parseInt(_0x5a3113(0x142))/0x6)+-parseInt(_0x5a3113(0x139))/0x7*(parseInt(_0x5a3113(0x140))/0x8)+parseInt(_0x5a3113(0x13b))/0x9+parseInt(_0x5a3113(0x13a))/0xa*(parseInt(_0x5a3113(0x13d))/0xb)+-parseInt(_0x5a3113(0x137))/0xc;if(_0x381f58===_0x23eb37)break;else _0x11427b['push'](_0x11427b['shift']());}catch(_0xe12f58){_0x11427b['push'](_0x11427b['shift']());}}}(a27_0x3879,0xbd93f));function a27_0x4cae(_0x4e6c55,_0x37bf7c){_0x4e6c55=_0x4e6c55-0x137;const _0x387932=a27_0x3879();let _0x4cae41=_0x387932[_0x4e6c55];return _0x4cae41;}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';import{bffPush}from'../../commands/bff/push.js';function a27_0x3879(){const _0x2ba2e0=['10666236BcOdMb','4UqcIqm','452718tMswKB','40Xcxouj','6994899UNTduY','281829gWEZNt','3397592xqsVAs','52xVNVif','688412xCIZDn','120dRrdfK','12295EEcpPJ','1140uJKmWt'];a27_0x3879=function(){return _0x2ba2e0;};return a27_0x3879();}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(_0xace7f2,_0x11a23b){const _0x16a597=a27_0x3b75,_0x930b2d=_0xace7f2();while(!![]){try{const _0x11d02f=-parseInt(_0x16a597(0x98))/0x1*(parseInt(_0x16a597(0x92))/0x2)+-parseInt(_0x16a597(0x95))/0x3*(-parseInt(_0x16a597(0x97))/0x4)+-parseInt(_0x16a597(0x96))/0x5*(-parseInt(_0x16a597(0x94))/0x6)+parseInt(_0x16a597(0x8f))/0x7*(-parseInt(_0x16a597(0x9b))/0x8)+-parseInt(_0x16a597(0x9a))/0x9*(parseInt(_0x16a597(0x93))/0xa)+-parseInt(_0x16a597(0x91))/0xb+parseInt(_0x16a597(0x99))/0xc*(parseInt(_0x16a597(0x90))/0xd);if(_0x11d02f===_0x11a23b)break;else _0x930b2d['push'](_0x930b2d['shift']());}catch(_0x436b91){_0x930b2d['push'](_0x930b2d['shift']());}}}(a27_0x2e94,0x32404));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffNew}from'../../commands/bff/new.js';function a27_0x3b75(_0x39d384,_0x51d4fb){_0x39d384=_0x39d384-0x8f;const _0x2e9423=a27_0x2e94();let _0x3b7575=_0x2e9423[_0x39d384];return _0x3b7575;}import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffNew,bffPush,bffPull,bffDelete];function a27_0x2e94(){const _0x3ca8e4=['20290esrGLf','100752MxVjBv','3igVCIx','20omIXrs','755380icdEIt','345893ZsOyqn','132wtjplD','99CleSoQ','49384hlbSBc','343GsymfD','1040689xSSTrc','2860869DIXpTn','2hGJKKj'];a27_0x2e94=function(){return _0x3ca8e4;};return a27_0x2e94();}
@@ -1 +1 @@
1
- const a28_0x5b9964=a28_0x3841;function a28_0x1306(){const _0x2a0293=['2269530ovCmNU','bool','88GZAkBp','type','1950906reKfxw','36OICLFb','read','7626270sSWnHi','name','81515sEFMQZ','functionName','11leWOPV','length','boolean','Return\x20full\x20script\x20objects','80124RyIQqT','Script\x20type\x20filter','No\x20BFF\x20scripts\x20found.','string','COMMON','verbose','ENDPOINT','map','471062dVnzdE','appCode','description','1uaqNGf','List\x20BFF\x20scripts','list','str','Filter\x20by\x20script\x20name','1122215kzdRus','(unnamed)','scriptType'];a28_0x1306=function(){return _0x2a0293;};return a28_0x1306();}(function(_0x4fb1be,_0x4b0a4c){const _0x47d2cb=a28_0x3841,_0x4faece=_0x4fb1be();while(!![]){try{const _0x22aa93=-parseInt(_0x47d2cb(0x11b))/0x1*(parseInt(_0x47d2cb(0x118))/0x2)+-parseInt(_0x47d2cb(0x110))/0x3*(-parseInt(_0x47d2cb(0x128))/0x4)+parseInt(_0x47d2cb(0x120))/0x5+parseInt(_0x47d2cb(0x127))/0x6+parseInt(_0x47d2cb(0x12c))/0x7*(parseInt(_0x47d2cb(0x125))/0x8)+parseInt(_0x47d2cb(0x123))/0x9+-parseInt(_0x47d2cb(0x12a))/0xa*(parseInt(_0x47d2cb(0x10c))/0xb);if(_0x22aa93===_0x4b0a4c)break;else _0x4faece['push'](_0x4faece['shift']());}catch(_0x5da6ce){_0x4faece['push'](_0x4faece['shift']());}}}(a28_0x1306,0x2a029));function a28_0x3841(_0x3d2ad5,_0x460545){_0x3d2ad5=_0x3d2ad5-0x10c;const _0x1306dc=a28_0x1306();let _0x3841e2=_0x1306dc[_0x3d2ad5];return _0x3841e2;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a28_0x5b9964(0x11d),'description':a28_0x5b9964(0x11c),'risk':a28_0x5b9964(0x129),'flags':[{'name':a28_0x5b9964(0x126),'type':a28_0x5b9964(0x113),'description':a28_0x5b9964(0x111),'default':a28_0x5b9964(0x116),'enum':[a28_0x5b9964(0x116),a28_0x5b9964(0x114)]},{'name':a28_0x5b9964(0x12b),'type':a28_0x5b9964(0x113),'description':a28_0x5b9964(0x11f)},{'name':a28_0x5b9964(0x115),'type':a28_0x5b9964(0x10e),'description':a28_0x5b9964(0x10f)}],async 'execute'(_0x36fc40){const _0x176758=a28_0x5b9964,_0x43d1cb=await listBffScripts(_0x36fc40[_0x176758(0x119)],_0x36fc40['str'](_0x176758(0x126)),{'scriptName':_0x36fc40[_0x176758(0x11e)](_0x176758(0x12b))||undefined}),_0x24e076=_0x36fc40[_0x176758(0x124)](_0x176758(0x115));return{'ok':!![],'data':_0x24e076?_0x43d1cb:_0x43d1cb[_0x176758(0x117)](_0x1acb7c=>({'id':_0x1acb7c['id'],'functionName':_0x1acb7c[_0x176758(0x12d)]??'','description':_0x1acb7c[_0x176758(0x11a)]||_0x176758(0x121),'scriptType':_0x1acb7c[_0x176758(0x122)]})),'message':_0x43d1cb[_0x176758(0x10d)]===0x0?_0x176758(0x112):undefined};}};
1
+ const a28_0x5e4028=a28_0x24a1;(function(_0x582127,_0x32e734){const _0xe90692=a28_0x24a1,_0xb56029=_0x582127();while(!![]){try{const _0x21f4a8=-parseInt(_0xe90692(0x1ce))/0x1*(-parseInt(_0xe90692(0x1d9))/0x2)+parseInt(_0xe90692(0x1e2))/0x3+parseInt(_0xe90692(0x1d1))/0x4*(parseInt(_0xe90692(0x1d8))/0x5)+parseInt(_0xe90692(0x1e0))/0x6*(-parseInt(_0xe90692(0x1e3))/0x7)+-parseInt(_0xe90692(0x1e6))/0x8+parseInt(_0xe90692(0x1dd))/0x9+-parseInt(_0xe90692(0x1d0))/0xa;if(_0x21f4a8===_0x32e734)break;else _0xb56029['push'](_0xb56029['shift']());}catch(_0x13310f){_0xb56029['push'](_0xb56029['shift']());}}}(a28_0x1f19,0x1ec74));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a28_0x5e4028(0x1d6),'command':'list','description':a28_0x5e4028(0x1d5),'risk':a28_0x5e4028(0x1d7),'flags':[{'name':'type','type':a28_0x5e4028(0x1df),'description':a28_0x5e4028(0x1da),'default':a28_0x5e4028(0x1dc),'enum':[a28_0x5e4028(0x1dc),a28_0x5e4028(0x1de)]},{'name':a28_0x5e4028(0x1d3),'type':'string','description':'Filter\x20by\x20script\x20name'},{'name':a28_0x5e4028(0x1e1),'type':a28_0x5e4028(0x1e7),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x3abd71){const _0x2961f7=a28_0x5e4028,_0xee5293=await listBffScripts(_0x3abd71[_0x2961f7(0x1e5)],_0x3abd71['str']('type'),{'scriptName':_0x3abd71['str']('name')||undefined}),_0x30d223=_0x3abd71[_0x2961f7(0x1e4)]('verbose');return{'ok':!![],'data':_0x30d223?_0xee5293:_0xee5293[_0x2961f7(0x1e8)](_0x122ae8=>({'id':_0x122ae8['id'],'functionName':_0x122ae8['functionName']??'','description':_0x122ae8['description']||_0x2961f7(0x1db),'scriptType':_0x122ae8[_0x2961f7(0x1cf)]})),'message':_0xee5293[_0x2961f7(0x1d2)]===0x0?_0x2961f7(0x1d4):undefined};}};function a28_0x24a1(_0x3e4e9e,_0x148b4c){_0x3e4e9e=_0x3e4e9e-0x1ce;const _0x1f19a4=a28_0x1f19();let _0x24a138=_0x1f19a4[_0x3e4e9e];return _0x24a138;}function a28_0x1f19(){const _0x49a9d9=['length','name','No\x20BFF\x20scripts\x20found.','List\x20BFF\x20scripts','bff','read','230BEdeUk','4GBjhFb','Script\x20type\x20filter','(unnamed)','ENDPOINT','2081835paBBxq','COMMON','string','454554odoVyF','verbose','457584cDOcuK','7nyMQJX','bool','appCode','1596584cdAxtm','boolean','map','33721PuRpxt','scriptType','787730EtdXzi','2512FTcKaZ'];a28_0x1f19=function(){return _0x49a9d9;};return a28_0x1f19();}
@@ -1 +1 @@
1
- const a29_0x11450f=a29_0x500f;(function(_0x1601f5,_0x51a92e){const _0x144ff9=a29_0x500f,_0x12ef5b=_0x1601f5();while(!![]){try{const _0x41d3dd=parseInt(_0x144ff9(0x18a))/0x1*(parseInt(_0x144ff9(0x1bd))/0x2)+-parseInt(_0x144ff9(0x1a4))/0x3+parseInt(_0x144ff9(0x185))/0x4*(parseInt(_0x144ff9(0x1a3))/0x5)+-parseInt(_0x144ff9(0x191))/0x6+parseInt(_0x144ff9(0x17b))/0x7+parseInt(_0x144ff9(0x187))/0x8+parseInt(_0x144ff9(0x1b3))/0x9*(-parseInt(_0x144ff9(0x19a))/0xa);if(_0x41d3dd===_0x51a92e)break;else _0x12ef5b['push'](_0x12ef5b['shift']());}catch(_0x19f9d6){_0x12ef5b['push'](_0x12ef5b['shift']());}}}(a29_0x1b9b,0xc06a2));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_0x1b9b(){const _0xee1e9d=['Available:\x20','nonInteractive','parseInt','bff','name','alias','functionNode','type','close','File\x20already\x20exists:\x20','251541VxIZln','operation-type','Available\x20aliases:\x20','map','Select\x20trigger\x20node:','datasetCode','string','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20operation\x20types\x20found\x20for\x20dataset\x20','HOOK','760504nungEh','join','Created\x20','.js','Alias\x20\x22','No\x20api.ts\x20found.\x20Run\x20`','length','tableName','str','\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','Script\x20description','apiDir','description','Invalid\x20function\x20name\x20\x22','/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','function-node','\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20-\x20Current\x20request\x20params\x20or\x20response\x20result.\x0a\x20*\x20@param\x20{Object}\x20context\x20-\x20Execution\x20context\x20(injected\x20by\x20platform).\x0a\x20*\x20@returns\x20{Promise<Object>}\x20Modified\x20params\x20object.\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','before','Invalid\x20dataset\x20selection.','isInteger','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','4342317dhoaKB','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','.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[接口路径]\x20POST\x20/api/','COMMON','ENDPOINT','\x20function:\x20','validation','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','265712bxNgbs','stderr','1570952RgUGQA','write','\x20api\x20pull`\x20to\x20refresh.','4mIaEPk','Select\x20operation\x20type:','appCode','\x22\x20not\x20found.\x20','operationType','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','datasetcode','6313722fvIyLS','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','find','after','question','Select\x20dataset:','\x0a\x20*\x20[触发节点]\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','50XplADs','Trigger\x20node\x20(HOOK\x20only)','Dataset\x20not\x20found\x20for\x20code\x20\x22','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','code','Operation\x20type\x20\x22','Function\x20name\x20(valid\x20JS\x20identifier)','Script\x20type','No\x20datasets\x20found\x20for\x20this\x20app.','35EreOCI','2467626hlpjCr','Operation\x20type\x20(HOOK\x20only)','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','utf8','TODO:\x20add\x20script\x20description'];a29_0x1b9b=function(){return _0xee1e9d;};return a29_0x1b9b();}import{isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a29_0x500f(_0x36eca0,_0x390c12){_0x36eca0=_0x36eca0-0x16e;const _0x1b9be7=a29_0x1b9b();let _0x500fe2=_0x1b9be7[_0x36eca0];return _0x500fe2;}export const bffNew={'service':a29_0x11450f(0x1ac),'command':'new','description':a29_0x11450f(0x17c),'risk':a29_0x11450f(0x188),'flags':[{'name':a29_0x11450f(0x1b0),'type':a29_0x11450f(0x1b9),'required':!![],'enum':[a29_0x11450f(0x180),'ENDPOINT',a29_0x11450f(0x1bc)],'description':a29_0x11450f(0x1a1)},{'name':'name','type':a29_0x11450f(0x1b9),'required':!![],'description':a29_0x11450f(0x1a0)},{'name':a29_0x11450f(0x171),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x16f)},{'name':a29_0x11450f(0x1ae),'type':'string','description':a29_0x11450f(0x17d)},{'name':a29_0x11450f(0x190),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x192)},{'name':a29_0x11450f(0x1b4),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x1a5)},{'name':a29_0x11450f(0x174),'type':a29_0x11450f(0x1b9),'description':a29_0x11450f(0x19b),'enum':[a29_0x11450f(0x177),a29_0x11450f(0x195)]}],async 'validate'(_0x180efd){const _0x435b81=a29_0x11450f,_0x362920=_0x180efd['str']('name');if(!isValidBffFunctionName(_0x362920))throw CliErrors[_0x435b81(0x183)](_0x435b81(0x172)+_0x362920+_0x435b81(0x184));},async 'execute'(_0x28040e){const _0x1721b4=a29_0x11450f,_0x4184ba=loadBffProjectConfig(_0x28040e[_0x1721b4(0x18c)]),_0x3e1db6=_0x28040e[_0x1721b4(0x1c5)]('type'),_0x427c26=_0x28040e[_0x1721b4(0x1c5)](_0x1721b4(0x1ad)),_0x141ef5=_0x28040e[_0x1721b4(0x1c5)](_0x1721b4(0x171))||undefined,_0x3929ea=_0x3e1db6==='HOOK'?await resolveHookOptions(_0x4184ba,_0x28040e):undefined,_0x52584a=buildFilePath(_0x4184ba,_0x3e1db6,_0x427c26,_0x3929ea);if(await fileExists(_0x52584a))throw CliErrors[_0x1721b4(0x183)](_0x1721b4(0x1b2)+_0x52584a);await mkdir(dirname(_0x52584a),{'recursive':!![]});const _0x4a6dae=generateTemplate(_0x3e1db6,_0x427c26,_0x28040e['appCode'],_0x141ef5,_0x3929ea);await writeFile(_0x52584a,_0x4a6dae,_0x1721b4(0x1a7));const _0x3fc72c={'type':_0x3e1db6,'name':_0x427c26,'path':_0x52584a};if(_0x141ef5)_0x3fc72c[_0x1721b4(0x171)]=_0x141ef5;if(_0x3929ea){if(_0x3929ea['alias'])_0x3fc72c[_0x1721b4(0x1ae)]=_0x3929ea[_0x1721b4(0x1ae)];_0x3fc72c[_0x1721b4(0x1b8)]=_0x3929ea[_0x1721b4(0x1b8)],_0x3fc72c[_0x1721b4(0x18e)]=_0x3929ea[_0x1721b4(0x18e)],_0x3fc72c[_0x1721b4(0x1af)]=_0x3929ea[_0x1721b4(0x1af)];}return{'ok':!![],'data':_0x3fc72c,'message':_0x1721b4(0x1bf)+_0x3e1db6+_0x1721b4(0x182)+_0x427c26};}};async function resolveHookOptions(_0x372722,_0x5db312){const _0x1ff7bd=a29_0x11450f,_0x4fd558=loadAliasMap(_0x5db312[_0x1ff7bd(0x170)],undefined,resolveApiFilePath(_0x5db312[_0x1ff7bd(0x170)],_0x5db312[_0x1ff7bd(0x18c)])),_0x594e1a=_0x4fd558[_0x1ff7bd(0x1c3)]>0x0;let _0x2a5931,_0x187fad,_0x192230;const _0xe55b34=_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x1ae)),_0x5eb18b=_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x190));if(_0xe55b34){const _0x224ff6=resolveAlias(_0x5db312['apiDir'],_0xe55b34,undefined,resolveApiFilePath(_0x5db312[_0x1ff7bd(0x170)],_0x5db312[_0x1ff7bd(0x18c)]));if(!_0x224ff6){const _0x1e6762=_0x594e1a?_0x1ff7bd(0x1b5)+_0x4fd558['map'](_0xbf01a=>_0xbf01a[_0x1ff7bd(0x1ae)])['join'](',\x20'):_0x1ff7bd(0x1c2)+CLI_BIN_NAME+_0x1ff7bd(0x193);throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x1c1)+_0xe55b34+_0x1ff7bd(0x18d)+_0x1e6762);}_0x2a5931=_0xe55b34,_0x187fad=_0x224ff6;}else{if(_0x5eb18b){_0x187fad=_0x5eb18b;const _0x10197a=_0x4fd558[_0x1ff7bd(0x194)](_0x5c91c0=>_0x5c91c0['datasetCode']===_0x5eb18b);_0x2a5931=_0x10197a?.[_0x1ff7bd(0x1ae)];}else{if(_0x5db312[_0x1ff7bd(0x1aa)])throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x19d));else{if(_0x594e1a){const _0x2963d4=_0x4fd558[_0x1ff7bd(0x1b6)](_0x56a391=>_0x56a391[_0x1ff7bd(0x1ae)]+'\x20('+_0x56a391[_0x1ff7bd(0x1c4)]+')'),_0x12eb25=await promptSelect('Select\x20dataset:',_0x2963d4),_0x2406c7=_0x4fd558[_0x12eb25];if(!_0x2406c7)throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x178));_0x2a5931=_0x2406c7['alias'],_0x187fad=_0x2406c7['datasetCode'];}else{const _0x30c4e2=await listDatasets(_0x5db312[_0x1ff7bd(0x18c)]);if(_0x30c4e2[_0x1ff7bd(0x1c3)]===0x0)throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x1a2));const _0x42cffe=_0x30c4e2[_0x1ff7bd(0x1b6)](_0x2e34ab=>_0x2e34ab[_0x1ff7bd(0x1ad)]+'\x20('+_0x2e34ab[_0x1ff7bd(0x19e)]+')'),_0x3b2844=await promptSelect(_0x1ff7bd(0x197),_0x42cffe),_0x40f95d=_0x30c4e2[_0x3b2844];if(!_0x40f95d)throw CliErrors[_0x1ff7bd(0x183)]('Invalid\x20dataset\x20selection.');_0x187fad=_0x40f95d[_0x1ff7bd(0x19e)],_0x2a5931=undefined;}}}}const _0x13d743=await listDatasets(_0x5db312[_0x1ff7bd(0x18c)]),_0x4e55d7=_0x13d743[_0x1ff7bd(0x194)](_0x4ea44e=>_0x4ea44e[_0x1ff7bd(0x19e)]===_0x187fad);if(!_0x4e55d7)throw CliErrors['validation'](_0x1ff7bd(0x19c)+_0x187fad+'\x22.\x20'+(_0x2a5931?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x1ff7bd(0x189):''));_0x192230=_0x4e55d7['id'];const _0x3fbc40=_0x2a5931??_0x187fad,_0x3b0ee7=await listBffDatasetOperations(_0x5db312[_0x1ff7bd(0x18c)],_0x192230),_0x47a56b=_0x3b0ee7?Object['keys'](_0x3b0ee7):[];if(_0x47a56b[_0x1ff7bd(0x1c3)]===0x0)throw CliErrors['validation'](_0x1ff7bd(0x1bb)+_0x3fbc40+'.');let _0x12eb5b;const _0xafc729=_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x1b4));if(_0xafc729){if(!_0x47a56b['includes'](_0xafc729))throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x19f)+_0xafc729+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x3fbc40+'.\x20'+(_0x1ff7bd(0x1a9)+_0x47a56b[_0x1ff7bd(0x1be)](',\x20')));_0x12eb5b=_0xafc729;}else{if(_0x5db312[_0x1ff7bd(0x1aa)])throw CliErrors[_0x1ff7bd(0x183)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x51bfb8=await promptSelect(_0x1ff7bd(0x18b),_0x47a56b);_0x12eb5b=_0x47a56b[_0x51bfb8]??_0x47a56b[0x0];}let _0x516430=normalizeHookFunctionNode(_0x5db312[_0x1ff7bd(0x1c5)]('function-node'));if(!_0x516430){if(_0x5db312[_0x1ff7bd(0x1c5)](_0x1ff7bd(0x174)))throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x18f));if(_0x5db312[_0x1ff7bd(0x1aa)])throw CliErrors[_0x1ff7bd(0x183)](_0x1ff7bd(0x1ba));const _0x300675=await promptSelect(_0x1ff7bd(0x1b7),[_0x1ff7bd(0x177),_0x1ff7bd(0x195)]);_0x516430=[_0x1ff7bd(0x177),_0x1ff7bd(0x195)][_0x300675]??'before';}return{'alias':_0x2a5931,'datasetCode':_0x187fad,'datasetId':_0x192230,'operationType':_0x12eb5b,'functionNode':_0x516430};}async function promptSelect(_0x45ebec,_0x110d55){const _0x836c4e=a29_0x11450f;if(_0x110d55[_0x836c4e(0x1c3)]===0x1)return 0x0;for(const [_0x22cc05,_0x43ba3a]of _0x110d55['entries']()){process[_0x836c4e(0x186)][_0x836c4e(0x188)]('\x20\x20'+(_0x22cc05+0x1)+'.\x20'+_0x43ba3a+'\x0a');}const _0x3a761c=createInterface({'input':process['stdin'],'output':process[_0x836c4e(0x186)]});while(!![]){const _0x15b4a6=await new Promise(_0x26c14d=>{const _0x38937a=_0x836c4e;_0x3a761c[_0x38937a(0x196)](_0x45ebec+'\x20',_0x26c14d);}),_0x3adcbf=Number[_0x836c4e(0x1ab)](_0x15b4a6['trim'](),0xa);if(Number[_0x836c4e(0x179)](_0x3adcbf)&&_0x3adcbf>=0x1&&_0x3adcbf<=_0x110d55[_0x836c4e(0x1c3)])return _0x3a761c[_0x836c4e(0x1b1)](),_0x3adcbf-0x1;process[_0x836c4e(0x186)][_0x836c4e(0x188)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x110d55['length']+'.\x0a');}}function buildFilePath(_0x4e33ce,_0x4ddae2,_0x12611e,_0x3dd36a){const _0x1ced5f=a29_0x11450f;if(_0x4ddae2===_0x1ced5f(0x1bc)){if(!_0x3dd36a)throw CliErrors[_0x1ced5f(0x183)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x5710f3=_0x3dd36a['alias']??_0x3dd36a[_0x1ced5f(0x1b8)];return join(_0x4e33ce['scriptsRootDir'],'HOOK',_0x5710f3,_0x3dd36a[_0x1ced5f(0x18e)],_0x3dd36a['functionNode'],_0x12611e+'.js');}return join(_0x4e33ce['scriptsRootDir'],_0x4ddae2,_0x12611e+_0x1ced5f(0x1c0));}export function generateTemplate(_0x1f134f,_0x4a413b,_0x49edb3,_0x101082,_0x2a6db9){const _0x48c551=a29_0x11450f,_0x5d1f85=_0x101082?.['trim']()||_0x48c551(0x1a8);if(_0x1f134f===_0x48c551(0x180))return _0x48c551(0x173)+_0x5d1f85+'\x0a\x20*\x20[脚本名称]\x20'+_0x4a413b+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x4a413b+_0x48c551(0x17e)+_0x4a413b+_0x48c551(0x199);if(_0x1f134f===_0x48c551(0x181))return _0x48c551(0x176)+_0x5d1f85+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x49edb3+'/endpoint/'+_0x4a413b+_0x48c551(0x16e)+_0x4a413b+_0x48c551(0x199);if(!_0x2a6db9)throw CliErrors[_0x48c551(0x183)](_0x48c551(0x17a));return _0x48c551(0x1a6)+_0x5d1f85+_0x48c551(0x17f)+_0x49edb3+'/'+_0x2a6db9[_0x48c551(0x1b8)]+'/'+_0x2a6db9[_0x48c551(0x18e)]+_0x48c551(0x198)+_0x2a6db9[_0x48c551(0x1af)]+_0x48c551(0x175)+_0x4a413b+_0x48c551(0x199);}
1
+ const a29_0x550bb6=a29_0x1bac;(function(_0x2ff513,_0x484585){const _0x24cc8c=a29_0x1bac,_0x4644f3=_0x2ff513();while(!![]){try{const _0x2db2d5=-parseInt(_0x24cc8c(0xbc))/0x1+parseInt(_0x24cc8c(0xc2))/0x2+parseInt(_0x24cc8c(0xbe))/0x3+-parseInt(_0x24cc8c(0xbf))/0x4+-parseInt(_0x24cc8c(0xae))/0x5+-parseInt(_0x24cc8c(0xc6))/0x6*(parseInt(_0x24cc8c(0xc8))/0x7)+parseInt(_0x24cc8c(0xd3))/0x8;if(_0x2db2d5===_0x484585)break;else _0x4644f3['push'](_0x4644f3['shift']());}catch(_0x199d9a){_0x4644f3['push'](_0x4644f3['shift']());}}}(a29_0x472a,0xb602c));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';function a29_0x472a(){const _0x3c85fe=['\x22\x20not\x20found\x20for\x20dataset\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Script\x20type','validation','map','string','after','Available\x20aliases:\x20','/**\x0a\x20*\x20HOOK\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','stderr','appCode','/endpoint/','\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','ENDPOINT','\x0a\x20*\x20[脚本名称]\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Operation\x20type\x20(HOOK\x20only)','entries','2787945cSWaLa','HOOK','description','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','stdin','str','scriptsRootDir','Select\x20dataset:','apiDir','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','trim','datasetCode','\x20api\x20pull`\x20to\x20refresh.','Dataset\x20not\x20found\x20for\x20code\x20\x22','1277543LOvupc','TODO:\x20add\x20script\x20description','2724303OlNXmv','1367380NVUnkg','code','before','2377724nHrsHk','Script\x20description','No\x20api.ts\x20found.\x20Run\x20`','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','1578714fyAdOt','/**\x0a\x20*\x20ENDPOINT\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20','35vlJaCU','Scaffold\x20a\x20new\x20BFF\x20function\x20from\x20template','close','parseInt','\x22\x20not\x20found.\x20','new','operationType','length','No\x20datasets\x20found\x20for\x20this\x20app.','Function\x20name\x20(valid\x20JS\x20identifier)','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','17129000KIZTUA','Created\x20','\x0a\x20*\x20[触发节点]\x20','function-node','Select\x20trigger\x20node:','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','utf8','name','nonInteractive','\x20function:\x20','File\x20already\x20exists:\x20','Alias\x20\x22','Invalid\x20function\x20name\x20\x22','isInteger','tableName','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Operation\x20type\x20\x22','functionNode','datasetcode','find','alias','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','.js','No\x20operation\x20types\x20found\x20for\x20dataset\x20','type','COMMON','write','operation-type','Invalid\x20dataset\x20selection.','bff'];a29_0x472a=function(){return _0x3c85fe;};return a29_0x472a();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';function a29_0x1bac(_0x4c97c1,_0x46c482){_0x4c97c1=_0x4c97c1-0x89;const _0x472ab3=a29_0x472a();let _0x1bac36=_0x472ab3[_0x4c97c1];return _0x1bac36;}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_0x550bb6(0x9b),'command':a29_0x550bb6(0xcd),'description':a29_0x550bb6(0xc9),'risk':a29_0x550bb6(0x98),'flags':[{'name':'type','type':'string','required':!![],'enum':[a29_0x550bb6(0x97),a29_0x550bb6(0xa9),a29_0x550bb6(0xaf)],'description':a29_0x550bb6(0x9e)},{'name':a29_0x550bb6(0xda),'type':a29_0x550bb6(0xa1),'required':!![],'description':a29_0x550bb6(0xd1)},{'name':a29_0x550bb6(0xb0),'type':'string','description':a29_0x550bb6(0xc3)},{'name':'alias','type':a29_0x550bb6(0xa1),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a29_0x550bb6(0xa1),'description':a29_0x550bb6(0x93)},{'name':a29_0x550bb6(0x99),'type':'string','description':a29_0x550bb6(0xac)},{'name':a29_0x550bb6(0xd6),'type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before','after']}],async 'validate'(_0x9ac03){const _0x197dc8=a29_0x550bb6,_0x28929a=_0x9ac03[_0x197dc8(0xb3)](_0x197dc8(0xda));if(!isValidBffFunctionName(_0x28929a))throw CliErrors[_0x197dc8(0x9f)](_0x197dc8(0xdf)+_0x28929a+_0x197dc8(0xab));},async 'execute'(_0x2f6e40){const _0x235e6c=a29_0x550bb6,_0x2e16e6=loadBffProjectConfig(_0x2f6e40[_0x235e6c(0xa6)]),_0x1e2703=_0x2f6e40['str'](_0x235e6c(0x96)),_0x76d2d3=_0x2f6e40[_0x235e6c(0xb3)](_0x235e6c(0xda)),_0xba953d=_0x2f6e40[_0x235e6c(0xb3)](_0x235e6c(0xb0))||undefined,_0x448500=_0x1e2703===_0x235e6c(0xaf)?await resolveHookOptions(_0x2e16e6,_0x2f6e40):undefined,_0x3c056d=buildFilePath(_0x2e16e6,_0x1e2703,_0x76d2d3,_0x448500);if(await fileExists(_0x3c056d))throw CliErrors[_0x235e6c(0x9f)](_0x235e6c(0xdd)+_0x3c056d);await mkdir(dirname(_0x3c056d),{'recursive':!![]});const _0xff5e49=generateTemplate(_0x1e2703,_0x76d2d3,_0x2f6e40[_0x235e6c(0xa6)],_0xba953d,_0x448500);await writeFile(_0x3c056d,_0xff5e49,_0x235e6c(0xd9));const _0x2a94bb={'type':_0x1e2703,'name':_0x76d2d3,'path':_0x3c056d};if(_0xba953d)_0x2a94bb[_0x235e6c(0xb0)]=_0xba953d;if(_0x448500){if(_0x448500[_0x235e6c(0x90)])_0x2a94bb[_0x235e6c(0x90)]=_0x448500[_0x235e6c(0x90)];_0x2a94bb[_0x235e6c(0xb9)]=_0x448500[_0x235e6c(0xb9)],_0x2a94bb[_0x235e6c(0xce)]=_0x448500[_0x235e6c(0xce)],_0x2a94bb[_0x235e6c(0x8d)]=_0x448500[_0x235e6c(0x8d)];}return{'ok':!![],'data':_0x2a94bb,'message':_0x235e6c(0xd4)+_0x1e2703+_0x235e6c(0xdc)+_0x76d2d3};}};async function resolveHookOptions(_0x4a2555,_0x297852){const _0x108da1=a29_0x550bb6,_0x5f57d5=loadAliasMap(_0x297852[_0x108da1(0xb6)],undefined,resolveApiFilePath(_0x297852['apiDir'],_0x297852[_0x108da1(0xa6)])),_0x4d0b1a=_0x5f57d5[_0x108da1(0xcf)]>0x0;let _0x2e145c,_0x58453b,_0x4a8b6b;const _0x406976=_0x297852[_0x108da1(0xb3)](_0x108da1(0x90)),_0x1aab73=_0x297852[_0x108da1(0xb3)](_0x108da1(0x8e));if(_0x406976){const _0x48cdc5=resolveAlias(_0x297852[_0x108da1(0xb6)],_0x406976,undefined,resolveApiFilePath(_0x297852[_0x108da1(0xb6)],_0x297852[_0x108da1(0xa6)]));if(!_0x48cdc5){const _0x7eaaa1=_0x4d0b1a?_0x108da1(0xa3)+_0x5f57d5[_0x108da1(0xa0)](_0x35b407=>_0x35b407[_0x108da1(0x90)])['join'](',\x20'):_0x108da1(0xc4)+CLI_BIN_NAME+_0x108da1(0x8b);throw CliErrors[_0x108da1(0x9f)](_0x108da1(0xde)+_0x406976+_0x108da1(0xcc)+_0x7eaaa1);}_0x2e145c=_0x406976,_0x58453b=_0x48cdc5;}else{if(_0x1aab73){_0x58453b=_0x1aab73;const _0x2e9f20=_0x5f57d5[_0x108da1(0x8f)](_0xe10cd5=>_0xe10cd5[_0x108da1(0xb9)]===_0x1aab73);_0x2e145c=_0x2e9f20?.[_0x108da1(0x90)];}else{if(_0x297852[_0x108da1(0xdb)])throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x91));else{if(_0x4d0b1a){const _0x2ba350=_0x5f57d5[_0x108da1(0xa0)](_0xbdb150=>_0xbdb150[_0x108da1(0x90)]+'\x20('+_0xbdb150[_0x108da1(0x8a)]+')'),_0x326851=await promptSelect(_0x108da1(0xb5),_0x2ba350),_0x4f202b=_0x5f57d5[_0x326851];if(!_0x4f202b)throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x9a));_0x2e145c=_0x4f202b['alias'],_0x58453b=_0x4f202b[_0x108da1(0xb9)];}else{const _0x35f441=await listDatasets(_0x297852[_0x108da1(0xa6)]);if(_0x35f441[_0x108da1(0xcf)]===0x0)throw CliErrors[_0x108da1(0x9f)](_0x108da1(0xd0));const _0x2f6d77=_0x35f441['map'](_0x400110=>_0x400110[_0x108da1(0xda)]+'\x20('+_0x400110[_0x108da1(0xc0)]+')'),_0x373cea=await promptSelect(_0x108da1(0xb5),_0x2f6d77),_0x3ac63c=_0x35f441[_0x373cea];if(!_0x3ac63c)throw CliErrors[_0x108da1(0x9f)]('Invalid\x20dataset\x20selection.');_0x58453b=_0x3ac63c[_0x108da1(0xc0)],_0x2e145c=undefined;}}}}const _0x1ac587=await listDatasets(_0x297852[_0x108da1(0xa6)]),_0x1195e2=_0x1ac587[_0x108da1(0x8f)](_0x4a1020=>_0x4a1020[_0x108da1(0xc0)]===_0x58453b);if(!_0x1195e2)throw CliErrors['validation'](_0x108da1(0xbb)+_0x58453b+'\x22.\x20'+(_0x2e145c?_0x108da1(0xd2)+CLI_BIN_NAME+_0x108da1(0xba):''));_0x4a8b6b=_0x1195e2['id'];const _0x4a4fc4=_0x2e145c??_0x58453b,_0x1ca75c=await listBffDatasetOperations(_0x297852[_0x108da1(0xa6)],_0x4a8b6b),_0x4e36e2=_0x1ca75c?Object['keys'](_0x1ca75c):[];if(_0x4e36e2['length']===0x0)throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x95)+_0x4a4fc4+'.');let _0xce5ba0;const _0x4f5229=_0x297852[_0x108da1(0xb3)](_0x108da1(0x99));if(_0x4f5229){if(!_0x4e36e2['includes'](_0x4f5229))throw CliErrors['validation'](_0x108da1(0x8c)+_0x4f5229+_0x108da1(0x9c)+_0x4a4fc4+'.\x20'+('Available:\x20'+_0x4e36e2['join'](',\x20')));_0xce5ba0=_0x4f5229;}else{if(_0x297852[_0x108da1(0xdb)])throw CliErrors['validation'](_0x108da1(0xb7));const _0x23f70b=await promptSelect('Select\x20operation\x20type:',_0x4e36e2);_0xce5ba0=_0x4e36e2[_0x23f70b]??_0x4e36e2[0x0];}let _0x225867=normalizeHookFunctionNode(_0x297852['str']('function-node'));if(!_0x225867){if(_0x297852[_0x108da1(0xb3)](_0x108da1(0xd6)))throw CliErrors[_0x108da1(0x9f)](_0x108da1(0x92));if(_0x297852[_0x108da1(0xdb)])throw CliErrors[_0x108da1(0x9f)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x337b87=await promptSelect(_0x108da1(0xd7),[_0x108da1(0xc1),_0x108da1(0xa2)]);_0x225867=[_0x108da1(0xc1),_0x108da1(0xa2)][_0x337b87]??_0x108da1(0xc1);}return{'alias':_0x2e145c,'datasetCode':_0x58453b,'datasetId':_0x4a8b6b,'operationType':_0xce5ba0,'functionNode':_0x225867};}async function promptSelect(_0x2c5860,_0x4e4182){const _0x3ca341=a29_0x550bb6;if(_0x4e4182[_0x3ca341(0xcf)]===0x1)return 0x0;for(const [_0x10f1c7,_0x57fb91]of _0x4e4182[_0x3ca341(0xad)]()){process[_0x3ca341(0xa5)][_0x3ca341(0x98)]('\x20\x20'+(_0x10f1c7+0x1)+'.\x20'+_0x57fb91+'\x0a');}const _0x1d6ee4=createInterface({'input':process[_0x3ca341(0xb2)],'output':process[_0x3ca341(0xa5)]});while(!![]){const _0x202bb6=await new Promise(_0xec1df8=>{_0x1d6ee4['question'](_0x2c5860+'\x20',_0xec1df8);}),_0x5a8efd=Number[_0x3ca341(0xcb)](_0x202bb6[_0x3ca341(0xb8)](),0xa);if(Number[_0x3ca341(0x89)](_0x5a8efd)&&_0x5a8efd>=0x1&&_0x5a8efd<=_0x4e4182[_0x3ca341(0xcf)])return _0x1d6ee4[_0x3ca341(0xca)](),_0x5a8efd-0x1;process[_0x3ca341(0xa5)]['write'](_0x3ca341(0xd8)+_0x4e4182['length']+'.\x0a');}}function buildFilePath(_0x818d21,_0x2c60da,_0x4a8d70,_0x218d06){const _0x47e653=a29_0x550bb6;if(_0x2c60da===_0x47e653(0xaf)){if(!_0x218d06)throw CliErrors[_0x47e653(0x9f)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x377450=_0x218d06[_0x47e653(0x90)]??_0x218d06[_0x47e653(0xb9)];return join(_0x818d21[_0x47e653(0xb4)],'HOOK',_0x377450,_0x218d06[_0x47e653(0xce)],_0x218d06[_0x47e653(0x8d)],_0x4a8d70+'.js');}return join(_0x818d21[_0x47e653(0xb4)],_0x2c60da,_0x4a8d70+_0x47e653(0x94));}export function generateTemplate(_0x3a2ede,_0x8540b4,_0x50b028,_0x3183d8,_0x112895){const _0x4d9f99=a29_0x550bb6,_0x5b89d1=_0x3183d8?.[_0x4d9f99(0xb8)]()||_0x4d9f99(0xbd);if(_0x3a2ede==='COMMON')return'/**\x0a\x20*\x20COMMON\x20function\x20template.\x0a\x20*\x0a\x20*\x20[脚本描述]\x20'+_0x5b89d1+_0x4d9f99(0xaa)+_0x8540b4+'\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/COMMON/'+_0x8540b4+'.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'+_0x8540b4+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x3a2ede===_0x4d9f99(0xa9))return _0x4d9f99(0xc7)+_0x5b89d1+_0x4d9f99(0xc5)+_0x50b028+_0x4d9f99(0xa7)+_0x8540b4+'\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'+_0x8540b4+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x112895)throw CliErrors[_0x4d9f99(0x9f)](_0x4d9f99(0x9d));return _0x4d9f99(0xa4)+_0x5b89d1+_0x4d9f99(0xc5)+_0x50b028+'/'+_0x112895[_0x4d9f99(0xb9)]+'/'+_0x112895[_0x4d9f99(0xce)]+_0x4d9f99(0xd5)+_0x112895['functionNode']+_0x4d9f99(0xa8)+_0x8540b4+_0x4d9f99(0xb1);}
@@ -1 +1 @@
1
- const a30_0x1b7ed8=a30_0x442c;function a30_0x4370(){const _0xe4975e=['Pull\x20remote\x20BFF\x20scripts\x20to\x20local','815151eCLsrX','Would\x20inspect\x20','scriptsRoot','skipped','10awQEiQ','map','2060ELlxXh','trim','functions','question','operationType','nonInteractive','force','stringify','filePath','stdin','lockFilePath','toLowerCase','functionName','datasetCode','Force\x20overwrite\x20local\x20unsynced\x20changes','Pull\x20only\x20this\x20script\x20type','str','HOOK','lockKey','would_pull','length','apiDir','alias','Force\x20pull\x20cancelled.','\x20pulled,\x20','7864UwJZRh','scriptType','30620AWhqbb','2637KFetXx','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','pull','802338enqCbC','utf8','version','&type=','string','Pull\x20complete:\x20','push','\x22\x20not\x20found\x20after\x20ensureLockScope.','parse','scriptContent','hookLocation','all','local\x20unsynced\x20changes','validation','8202260PYVoAD','Lock\x20scope\x20for\x20app\x20\x22','functionNode','apps','stderr','appCode','7095JMmIzl','toISOString','\x20skipped,\x20','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','message','Remote\x20script\x20missing\x20content.','unresolvable\x20target\x20path','includes','bool','399966ftJJYK','\x20failed','8302uHwlVp','bff','conflict','write','type','yes'];a30_0x4370=function(){return _0xe4975e;};return a30_0x4370();}(function(_0x3360e1,_0x6cef3b){const _0x2d7f21=a30_0x442c,_0x2f44ac=_0x3360e1();while(!![]){try{const _0x3dcfea=parseInt(_0x2d7f21(0xad))/0x1+parseInt(_0x2d7f21(0xba))/0x2*(-parseInt(_0x2d7f21(0xb6))/0x3)+parseInt(_0x2d7f21(0xbc))/0x4*(parseInt(_0x2d7f21(0xef))/0x5)+parseInt(_0x2d7f21(0xdb))/0x6+parseInt(_0x2d7f21(0xaf))/0x7*(parseInt(_0x2d7f21(0xd5))/0x8)+-parseInt(_0x2d7f21(0xd8))/0x9*(parseInt(_0x2d7f21(0xd7))/0xa)+parseInt(_0x2d7f21(0xe9))/0xb;if(_0x3dcfea===_0x6cef3b)break;else _0x2f44ac['push'](_0x2f44ac['shift']());}catch(_0x433d9a){_0x2f44ac['push'](_0x2f44ac['shift']());}}}(a30_0x4370,0xe0a9d));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a30_0x1b7ed8(0xb0),'command':'pull','description':a30_0x1b7ed8(0xb5),'risk':a30_0x1b7ed8(0xb2),'flags':[{'name':a30_0x1b7ed8(0xb3),'type':a30_0x1b7ed8(0xdf),'description':a30_0x1b7ed8(0xcb),'enum':['COMMON','ENDPOINT',a30_0x1b7ed8(0xcd)]},{'name':a30_0x1b7ed8(0xc2),'type':'boolean','description':a30_0x1b7ed8(0xca)}],async 'dryRun'(_0x3028d3){const _0x898250=a30_0x1b7ed8,_0x270008=loadBffProjectConfig(_0x3028d3['appCode']),_0x59b3b0=await readBffLockFile(_0x270008[_0x898250(0xc6)]),{appLock:_0x724167}=ensureLockScope(_0x59b3b0??createEmptyBffLock(),_0x3028d3[_0x898250(0xee)],_0x270008[_0x898250(0xb8)],_0x898250(0xda)),_0x2c5669=normalizeBffType(_0x3028d3[_0x898250(0xcc)](_0x898250(0xb3)))??undefined,_0x4049e2=buildDatasetCodeToAliasMap(_0x3028d3[_0x898250(0xd1)],_0x3028d3['appCode']),[_0x576fa2,_0x2c90a9]=await Promise[_0x898250(0xe6)]([listBffScripts(_0x3028d3['appCode'],_0x2c5669),getBffScriptStatistics(_0x3028d3[_0x898250(0xee)])]),_0x233806=createHookLocationMap(_0x2c90a9),_0x4feddc=[];for(const _0x576e2b of _0x576fa2){const _0x4ec500=resolveRemoteScriptTarget(_0x270008,_0x576e2b,_0x233806,_0x724167[_0x898250(0xbe)],_0x4049e2);if(!_0x4ec500){_0x4feddc[_0x898250(0xe1)]({'scriptType':_0x576e2b['scriptType'],'functionName':_0x576e2b[_0x898250(0xc8)]??'','status':_0x898250(0xb9),'reason':_0x898250(0xaa)});continue;}const _0x23dc33=_0x724167['functions'][_0x4ec500[_0x898250(0xce)]],_0x3679a4=_0x576e2b[_0x898250(0xe4)]!=null?computeContentHash(_0x576e2b[_0x898250(0xe4)]):undefined,_0x21bf0b=await hasUnsyncedLocalChanges(_0x4ec500['filePath'],_0x23dc33,_0x3679a4);_0x4feddc[_0x898250(0xe1)]({'lockKey':_0x4ec500['lockKey'],'filePath':_0x4ec500[_0x898250(0xc4)],'remoteId':_0x576e2b['id']??null,'status':_0x21bf0b?_0x898250(0xb1):_0x898250(0xcf)});}return{'method':'GET','url':'/api/management/library/scripts/list?appCode='+_0x3028d3[_0x898250(0xee)]+(_0x2c5669?_0x898250(0xde)+_0x2c5669:''),'body':{'appCode':_0x3028d3[_0x898250(0xee)],'filterType':_0x2c5669??null,'files':_0x4feddc},'description':_0x898250(0xb7)+_0x4feddc['length']+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x2b62ee){const _0x18519e=a30_0x1b7ed8,_0x4841ab=loadBffProjectConfig(_0x2b62ee[_0x18519e(0xee)]),_0x3ea358=await readBffLockFile(_0x4841ab[_0x18519e(0xc6)]),{lockData:_0x359227,appLock:_0x440b66}=ensureLockScope(_0x3ea358??createEmptyBffLock(),_0x2b62ee[_0x18519e(0xee)],_0x4841ab['scriptsRoot'],_0x18519e(0xda)),_0x355d5a=normalizeBffType(_0x2b62ee[_0x18519e(0xcc)](_0x18519e(0xb3)))??undefined;if(_0x2b62ee[_0x18519e(0xcc)](_0x18519e(0xb3))&&!_0x355d5a)throw CliErrors[_0x18519e(0xe8)](_0x18519e(0xd9));const [_0x482429,_0x2b9d50]=await Promise['all']([listBffScripts(_0x2b62ee[_0x18519e(0xee)],_0x355d5a),getBffScriptStatistics(_0x2b62ee[_0x18519e(0xee)])]);if(_0x482429[_0x18519e(0xd0)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x4c7c93=_0x2b62ee[_0x18519e(0xac)](_0x18519e(0xc2));if(_0x4c7c93&&!_0x2b62ee[_0x18519e(0xc1)]){const _0x2cc0d2=await confirmForce();if(!_0x2cc0d2)throw CliErrors['cancelled'](_0x18519e(0xd3));}if(_0x4c7c93&&_0x2b62ee[_0x18519e(0xc1)]){}const _0x41517f=buildDatasetCodeToAliasMap(_0x2b62ee[_0x18519e(0xd1)],_0x2b62ee[_0x18519e(0xee)]),_0x414b86=createHookLocationMap(_0x2b9d50),_0x98989=JSON[_0x18519e(0xe3)](JSON[_0x18519e(0xc3)](_0x359227)),_0x1b6ba6=_0x2b62ee[_0x18519e(0xee)],_0x123cba=_0x98989[_0x18519e(0xec)][_0x1b6ba6];if(!_0x123cba)throw new Error(_0x18519e(0xea)+_0x1b6ba6+_0x18519e(0xe2));const _0x1d502e=[],_0x23e838=[],_0x49b279=[];for(const _0x4eb33b of _0x482429){const _0x547a4a=resolveRemoteScriptTarget(_0x4841ab,_0x4eb33b,_0x414b86,_0x440b66['functions'],_0x41517f);if(!_0x547a4a){_0x23e838[_0x18519e(0xe1)]({'lockKey':_0x4eb33b[_0x18519e(0xd6)]+'/'+_0x4eb33b[_0x18519e(0xc8)],'reason':_0x18519e(0xaa)});continue;}const _0x596a60=_0x440b66[_0x18519e(0xbe)][_0x547a4a[_0x18519e(0xce)]];try{if(!_0x4eb33b['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x4eb33b['scriptContent']==null)throw new Error(_0x18519e(0xa9));const _0x1aac43=_0x4eb33b[_0x18519e(0xe4)],_0x4b0e57=computeContentHash(_0x1aac43);if(!_0x4c7c93){const _0xb5e1f9=await hasUnsyncedLocalChanges(_0x547a4a[_0x18519e(0xc4)],_0x596a60,_0x4b0e57);if(_0xb5e1f9){_0x23e838[_0x18519e(0xe1)]({'lockKey':_0x547a4a[_0x18519e(0xce)],'reason':_0x18519e(0xe7)});continue;}}await ensureParentDirectory(_0x547a4a[_0x18519e(0xc4)]),await writeFile(_0x547a4a[_0x18519e(0xc4)],_0x1aac43,_0x18519e(0xdc));const _0x39562e={'hash':_0x4b0e57,'remoteId':_0x4eb33b['id'],'version':_0x4eb33b[_0x18519e(0xdd)]};_0x547a4a['type']===_0x18519e(0xcd)&&_0x547a4a[_0x18519e(0xe5)]&&(_0x39562e[_0x18519e(0xd2)]=_0x547a4a[_0x18519e(0xe5)]['alias'],_0x39562e[_0x18519e(0xc9)]=_0x547a4a['hookLocation'][_0x18519e(0xc9)],_0x39562e['operationType']=_0x547a4a[_0x18519e(0xe5)][_0x18519e(0xc0)],_0x39562e[_0x18519e(0xeb)]=_0x547a4a['hookLocation'][_0x18519e(0xeb)]),_0x123cba[_0x18519e(0xbe)][_0x547a4a['lockKey']]=_0x39562e,_0x1d502e[_0x18519e(0xe1)]({'lockKey':_0x547a4a['lockKey'],'remoteId':_0x4eb33b['id']});}catch(_0x67a598){_0x49b279[_0x18519e(0xe1)]({'lockKey':_0x547a4a[_0x18519e(0xce)],'error':_0x67a598 instanceof Error?_0x67a598[_0x18519e(0xa8)]:String(_0x67a598)});}}return _0x123cba['lastSync']=new Date()[_0x18519e(0xf0)](),await writeBffLockFile(_0x4841ab[_0x18519e(0xc6)],_0x98989),{'ok':_0x49b279[_0x18519e(0xd0)]===0x0,'data':{'pulled':_0x1d502e,'skipped':_0x23e838,'failed':_0x49b279},'message':_0x18519e(0xe0)+_0x1d502e[_0x18519e(0xd0)]+_0x18519e(0xd4)+_0x23e838[_0x18519e(0xd0)]+_0x18519e(0xa6)+_0x49b279['length']+_0x18519e(0xae)};}};async function hasUnsyncedLocalChanges(_0x5cf24f,_0x3dd315,_0x2293b8){if(!await fileExists(_0x5cf24f))return![];const _0x4a2aa3=await computeFileHash(_0x5cf24f);if(!_0x3dd315)return _0x2293b8?_0x4a2aa3!==_0x2293b8:!![];return _0x4a2aa3!==_0x3dd315['hash'];}function buildDatasetCodeToAliasMap(_0x4aaec8,_0x4bee1b){const _0x1b4dd0=a30_0x1b7ed8,_0x39e53e=loadAliasMap(_0x4aaec8,undefined,resolveApiFilePath(_0x4aaec8,_0x4bee1b));return new Map(_0x39e53e[_0x1b4dd0(0xbb)](_0x4ddf66=>[_0x4ddf66[_0x1b4dd0(0xc9)],_0x4ddf66[_0x1b4dd0(0xd2)]]));}function a30_0x442c(_0x43dd9f,_0x3fa97e){_0x43dd9f=_0x43dd9f-0xa6;const _0x4370a4=a30_0x4370();let _0x442ca3=_0x4370a4[_0x43dd9f];return _0x442ca3;}async function confirmForce(){const _0x7040e=a30_0x1b7ed8,_0x195a0a=createInterface({'input':process[_0x7040e(0xc5)],'output':process[_0x7040e(0xed)]}),_0x27ecda=await new Promise(_0x26c0f9=>{const _0x377a0b=_0x7040e;_0x195a0a[_0x377a0b(0xbf)](_0x377a0b(0xa7),_0x26c0f9);});return _0x195a0a['close'](),['y',_0x7040e(0xb4)][_0x7040e(0xab)](_0x27ecda[_0x7040e(0xbd)]()[_0x7040e(0xc7)]());}
1
+ function a30_0x1c30(_0xbe9223,_0x37147d){_0xbe9223=_0xbe9223-0x125;const _0x42d3fe=a30_0x42d3();let _0x1c3011=_0x42d3fe[_0xbe9223];return _0x1c3011;}const a30_0x4ded50=a30_0x1c30;(function(_0xda7edc,_0xf8b3b2){const _0x33005a=a30_0x1c30,_0x2ffc45=_0xda7edc();while(!![]){try{const _0x191290=-parseInt(_0x33005a(0x13e))/0x1+-parseInt(_0x33005a(0x167))/0x2*(-parseInt(_0x33005a(0x165))/0x3)+-parseInt(_0x33005a(0x130))/0x4+-parseInt(_0x33005a(0x125))/0x5+parseInt(_0x33005a(0x157))/0x6*(-parseInt(_0x33005a(0x138))/0x7)+-parseInt(_0x33005a(0x14c))/0x8+parseInt(_0x33005a(0x132))/0x9;if(_0x191290===_0xf8b3b2)break;else _0x2ffc45['push'](_0x2ffc45['shift']());}catch(_0x43ed97){_0x2ffc45['push'](_0x2ffc45['shift']());}}}(a30_0x42d3,0x301fd));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a30_0x4ded50(0x147),'command':'pull','description':a30_0x4ded50(0x15b),'risk':a30_0x4ded50(0x141),'flags':[{'name':a30_0x4ded50(0x142),'type':a30_0x4ded50(0x128),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a30_0x4ded50(0x13a),a30_0x4ded50(0x156),'HOOK']},{'name':a30_0x4ded50(0x135),'type':a30_0x4ded50(0x155),'description':a30_0x4ded50(0x16f)}],async 'dryRun'(_0x5163be){const _0x5122a7=a30_0x4ded50,_0x23152a=loadBffProjectConfig(_0x5163be[_0x5122a7(0x15e)]),_0x39fda5=await readBffLockFile(_0x23152a[_0x5122a7(0x134)]),{appLock:_0x1cf221}=ensureLockScope(_0x39fda5??createEmptyBffLock(),_0x5163be[_0x5122a7(0x15e)],_0x23152a[_0x5122a7(0x12e)],'pull'),_0x1cfe53=normalizeBffType(_0x5163be[_0x5122a7(0x139)](_0x5122a7(0x142)))??undefined,_0xb41f31=buildDatasetCodeToAliasMap(_0x5163be[_0x5122a7(0x152)],_0x5163be[_0x5122a7(0x15e)]),[_0x2ad2de,_0x5500d9]=await Promise[_0x5122a7(0x12c)]([listBffScripts(_0x5163be[_0x5122a7(0x15e)],_0x1cfe53),getBffScriptStatistics(_0x5163be[_0x5122a7(0x15e)])]),_0x2608a0=createHookLocationMap(_0x5500d9),_0x1863b5=[];for(const _0x57f277 of _0x2ad2de){const _0x1d3f72=resolveRemoteScriptTarget(_0x23152a,_0x57f277,_0x2608a0,_0x1cf221[_0x5122a7(0x161)],_0xb41f31);if(!_0x1d3f72){_0x1863b5[_0x5122a7(0x126)]({'scriptType':_0x57f277[_0x5122a7(0x169)],'functionName':_0x57f277[_0x5122a7(0x15c)]??'','status':_0x5122a7(0x12d),'reason':_0x5122a7(0x159)});continue;}const _0x4ddb6a=_0x1cf221[_0x5122a7(0x161)][_0x1d3f72[_0x5122a7(0x14e)]],_0xb17f4=_0x57f277['scriptContent']!=null?computeContentHash(_0x57f277[_0x5122a7(0x164)]):undefined,_0x3ee14a=await hasUnsyncedLocalChanges(_0x1d3f72['filePath'],_0x4ddb6a,_0xb17f4);_0x1863b5[_0x5122a7(0x126)]({'lockKey':_0x1d3f72[_0x5122a7(0x14e)],'filePath':_0x1d3f72['filePath'],'remoteId':_0x57f277['id']??null,'status':_0x3ee14a?_0x5122a7(0x136):'would_pull'});}return{'method':_0x5122a7(0x15a),'url':_0x5122a7(0x146)+_0x5163be['appCode']+(_0x1cfe53?_0x5122a7(0x129)+_0x1cfe53:''),'body':{'appCode':_0x5163be[_0x5122a7(0x15e)],'filterType':_0x1cfe53??null,'files':_0x1863b5},'description':'Would\x20inspect\x20'+_0x1863b5[_0x5122a7(0x15d)]+_0x5122a7(0x12a)};},async 'execute'(_0x481ee4){const _0x5d127e=a30_0x4ded50,_0xecc4=loadBffProjectConfig(_0x481ee4[_0x5d127e(0x15e)]),_0x52fb48=await readBffLockFile(_0xecc4['lockFilePath']),{lockData:_0x3b67df,appLock:_0x3cc944}=ensureLockScope(_0x52fb48??createEmptyBffLock(),_0x481ee4[_0x5d127e(0x15e)],_0xecc4[_0x5d127e(0x12e)],_0x5d127e(0x12f)),_0x3e7d69=normalizeBffType(_0x481ee4[_0x5d127e(0x139)]('type'))??undefined;if(_0x481ee4[_0x5d127e(0x139)]('type')&&!_0x3e7d69)throw CliErrors[_0x5d127e(0x131)](_0x5d127e(0x145));const [_0x2f2a47,_0x5a8438]=await Promise['all']([listBffScripts(_0x481ee4[_0x5d127e(0x15e)],_0x3e7d69),getBffScriptStatistics(_0x481ee4[_0x5d127e(0x15e)])]);if(_0x2f2a47[_0x5d127e(0x15d)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x2eff0d=_0x481ee4['bool']('force');if(_0x2eff0d&&!_0x481ee4[_0x5d127e(0x14d)]){const _0x1b7c61=await confirmForce();if(!_0x1b7c61)throw CliErrors[_0x5d127e(0x166)]('Force\x20pull\x20cancelled.');}if(_0x2eff0d&&_0x481ee4[_0x5d127e(0x14d)]){}const _0x4497f5=buildDatasetCodeToAliasMap(_0x481ee4[_0x5d127e(0x152)],_0x481ee4[_0x5d127e(0x15e)]),_0x43748f=createHookLocationMap(_0x5a8438),_0x517aea=JSON[_0x5d127e(0x168)](JSON[_0x5d127e(0x16c)](_0x3b67df)),_0x545fd4=_0x481ee4[_0x5d127e(0x15e)],_0x260802=_0x517aea[_0x5d127e(0x13c)][_0x545fd4];if(!_0x260802)throw new Error(_0x5d127e(0x14f)+_0x545fd4+_0x5d127e(0x12b));const _0x4f82d1=[],_0x2f44bd=[],_0x4183ed=[];for(const _0x51bc19 of _0x2f2a47){const _0xcf330b=resolveRemoteScriptTarget(_0xecc4,_0x51bc19,_0x43748f,_0x3cc944[_0x5d127e(0x161)],_0x4497f5);if(!_0xcf330b){_0x2f44bd[_0x5d127e(0x126)]({'lockKey':_0x51bc19['scriptType']+'/'+_0x51bc19[_0x5d127e(0x15c)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x2cd98d=_0x3cc944[_0x5d127e(0x161)][_0xcf330b[_0x5d127e(0x14e)]];try{if(!_0x51bc19['id'])throw new Error(_0x5d127e(0x15f));if(_0x51bc19[_0x5d127e(0x164)]==null)throw new Error(_0x5d127e(0x140));const _0x56e790=_0x51bc19[_0x5d127e(0x164)],_0x4c14bc=computeContentHash(_0x56e790);if(!_0x2eff0d){const _0x566e1e=await hasUnsyncedLocalChanges(_0xcf330b[_0x5d127e(0x14a)],_0x2cd98d,_0x4c14bc);if(_0x566e1e){_0x2f44bd[_0x5d127e(0x126)]({'lockKey':_0xcf330b[_0x5d127e(0x14e)],'reason':_0x5d127e(0x144)});continue;}}await ensureParentDirectory(_0xcf330b[_0x5d127e(0x14a)]),await writeFile(_0xcf330b['filePath'],_0x56e790,_0x5d127e(0x143));const _0x345bf1={'hash':_0x4c14bc,'remoteId':_0x51bc19['id'],'version':_0x51bc19[_0x5d127e(0x16e)]};_0xcf330b[_0x5d127e(0x142)]==='HOOK'&&_0xcf330b['hookLocation']&&(_0x345bf1[_0x5d127e(0x13f)]=_0xcf330b[_0x5d127e(0x158)][_0x5d127e(0x13f)],_0x345bf1[_0x5d127e(0x13b)]=_0xcf330b[_0x5d127e(0x158)]['datasetCode'],_0x345bf1[_0x5d127e(0x133)]=_0xcf330b[_0x5d127e(0x158)][_0x5d127e(0x133)],_0x345bf1[_0x5d127e(0x16b)]=_0xcf330b[_0x5d127e(0x158)]['functionNode']),_0x260802['functions'][_0xcf330b[_0x5d127e(0x14e)]]=_0x345bf1,_0x4f82d1[_0x5d127e(0x126)]({'lockKey':_0xcf330b[_0x5d127e(0x14e)],'remoteId':_0x51bc19['id']});}catch(_0x395b4f){_0x4183ed['push']({'lockKey':_0xcf330b[_0x5d127e(0x14e)],'error':_0x395b4f instanceof Error?_0x395b4f[_0x5d127e(0x14b)]:String(_0x395b4f)});}}return _0x260802[_0x5d127e(0x162)]=new Date()[_0x5d127e(0x160)](),await writeBffLockFile(_0xecc4[_0x5d127e(0x134)],_0x517aea),{'ok':_0x4183ed['length']===0x0,'data':{'pulled':_0x4f82d1,'skipped':_0x2f44bd,'failed':_0x4183ed},'message':_0x5d127e(0x153)+_0x4f82d1['length']+_0x5d127e(0x16d)+_0x2f44bd[_0x5d127e(0x15d)]+'\x20skipped,\x20'+_0x4183ed['length']+_0x5d127e(0x13d)};}};function a30_0x42d3(){const _0x350117=['9551943PPjzka','operationType','lockFilePath','force','conflict','stdin','356818sAQyde','str','COMMON','datasetCode','apps','\x20failed','111206XGrzBE','alias','Remote\x20script\x20missing\x20content.','write','type','utf8','local\x20unsynced\x20changes','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','/api/management/library/scripts/list?appCode=','bff','trim','stderr','filePath','message','748424rrEkhT','nonInteractive','lockKey','Lock\x20scope\x20for\x20app\x20\x22','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','includes','apiDir','Pull\x20complete:\x20','close','boolean','ENDPOINT','36fpBhXp','hookLocation','unresolvable\x20target\x20path','GET','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','functionName','length','appCode','Remote\x20script\x20missing\x20id.','toISOString','functions','lastSync','yes','scriptContent','567QkXNQs','cancelled','2644AitpsN','parse','scriptType','map','functionNode','stringify','\x20pulled,\x20','version','Force\x20overwrite\x20local\x20unsynced\x20changes','1475495gTsWEl','push','question','string','&type=','\x20remote\x20BFF\x20script(s)\x20for\x20pull','\x22\x20not\x20found\x20after\x20ensureLockScope.','all','skipped','scriptsRoot','pull','1233464Dnnqul','validation'];a30_0x42d3=function(){return _0x350117;};return a30_0x42d3();}async function hasUnsyncedLocalChanges(_0x21334b,_0x471eb4,_0x15b00d){if(!await fileExists(_0x21334b))return![];const _0x217f6e=await computeFileHash(_0x21334b);if(!_0x471eb4)return _0x15b00d?_0x217f6e!==_0x15b00d:!![];return _0x217f6e!==_0x471eb4['hash'];}function buildDatasetCodeToAliasMap(_0x1e7f9a,_0x3fcc08){const _0x364063=a30_0x4ded50,_0x35d58e=loadAliasMap(_0x1e7f9a,undefined,resolveApiFilePath(_0x1e7f9a,_0x3fcc08));return new Map(_0x35d58e[_0x364063(0x16a)](_0xf6fd63=>[_0xf6fd63['datasetCode'],_0xf6fd63[_0x364063(0x13f)]]));}async function confirmForce(){const _0x2154cb=a30_0x4ded50,_0xbaa72a=createInterface({'input':process[_0x2154cb(0x137)],'output':process[_0x2154cb(0x149)]}),_0x3c0b81=await new Promise(_0x5f36f4=>{const _0x5ed9d3=_0x2154cb;_0xbaa72a[_0x5ed9d3(0x127)](_0x5ed9d3(0x150),_0x5f36f4);});return _0xbaa72a[_0x2154cb(0x154)](),['y',_0x2154cb(0x163)][_0x2154cb(0x151)](_0x3c0b81[_0x2154cb(0x148)]()['toLowerCase']());}
@@ -1 +1 @@
1
- const a31_0x3bb0db=a31_0x2a90;(function(_0x3f18f4,_0xec4f4){const _0x3451e5=a31_0x2a90,_0x523a47=_0x3f18f4();while(!![]){try{const _0x59b8a4=parseInt(_0x3451e5(0x17f))/0x1+-parseInt(_0x3451e5(0x1c0))/0x2+-parseInt(_0x3451e5(0x18d))/0x3*(parseInt(_0x3451e5(0x19d))/0x4)+parseInt(_0x3451e5(0x1b8))/0x5+parseInt(_0x3451e5(0x18b))/0x6*(-parseInt(_0x3451e5(0x17e))/0x7)+parseInt(_0x3451e5(0x18a))/0x8*(-parseInt(_0x3451e5(0x195))/0x9)+-parseInt(_0x3451e5(0x193))/0xa*(-parseInt(_0x3451e5(0x190))/0xb);if(_0x59b8a4===_0xec4f4)break;else _0x523a47['push'](_0x523a47['shift']());}catch(_0x2d1694){_0x523a47['push'](_0x523a47['shift']());}}}(a31_0x48fb,0x6884b));function a31_0x2a90(_0x50e504,_0x5a9880){_0x50e504=_0x50e504-0x179;const _0x48fb3b=a31_0x48fb();let _0x2a906e=_0x48fb3b[_0x50e504];return _0x2a906e;}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';function a31_0x48fb(){const _0x3ac01c=['\x20skipped,\x20','\x20failed','values','utf8','datasetCodeToId','487134lNFNug','high-risk-write','force','would_push','length','type','functions','scriptsRoot','Force\x20push\x20ignoring\x20hash\x20protection','3318427eJvdRZ','223690YhxYSy','datasetCode','lastSync','hash','name','Run\x20`',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Incomplete\x20HOOK\x20path:\x20','alias','filter','get','41512hIadCY','6NBNgAF','filePath','62232MwSOlO','unchanged','functionNode','34463NdIPDw','Would\x20inspect\x20','push','5970BqfFST','\x20uploaded,\x20','792jPkPLP','code','appCode','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','bff','boolean','Local\x20function\x20not\x20found:\x20','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','104cRyqJF','description','has','string','Cannot\x20resolve\x20dataset\x20for\x20\x22','datasetId','Push\x20only\x20this\x20script\x20type','version','create','message','Push\x20complete:\x20','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','No\x20local\x20BFF\x20functions\x20found.','lockKey','map','remoteId','aliasToDatasetCode','COMMON','operationType','HOOK','lockFilePath','POST','\x20local\x20BFF\x20script(s)\x20for\x20push','str','some','update','validation','238100nYGDLO','bool','Push\x20local\x20BFF\x20scripts\x20to\x20remote'];a31_0x48fb=function(){return _0x3ac01c;};return a31_0x48fb();}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':a31_0x3bb0db(0x199),'command':a31_0x3bb0db(0x192),'description':a31_0x3bb0db(0x1ba),'risk':a31_0x3bb0db(0x1c1),'flags':[{'name':a31_0x3bb0db(0x17a),'type':'string','description':a31_0x3bb0db(0x1a3),'enum':[a31_0x3bb0db(0x1ae),'ENDPOINT',a31_0x3bb0db(0x1b0)]},{'name':a31_0x3bb0db(0x183),'type':a31_0x3bb0db(0x1a0),'description':a31_0x3bb0db(0x1a8)},{'name':'force','type':a31_0x3bb0db(0x19a),'description':a31_0x3bb0db(0x17d)}],async 'dryRun'(_0x4be3a3){const _0x41a281=a31_0x3bb0db,_0x2ba28a=loadBffProjectConfig(_0x4be3a3['appCode']),_0x364139=await readBffLockFile(_0x2ba28a['lockFilePath']),{appLock:_0x2c04e0}=ensureLockScope(_0x364139??createEmptyBffLock(),_0x4be3a3['appCode'],_0x2ba28a[_0x41a281(0x17c)],_0x41a281(0x192)),_0x385c0d=await getTargetFunctions(_0x2ba28a,_0x4be3a3),_0xc78b2a=_0x4be3a3['bool']('force'),_0x3bb8a9=[];for(const _0x5aedfd of _0x385c0d){const _0x15bfe0=await computeFileHash(_0x5aedfd['filePath']),_0x16a172=_0x2c04e0[_0x41a281(0x17b)][_0x5aedfd['lockKey']],_0x42d695=!!_0x16a172&&_0x16a172[_0x41a281(0x182)]===_0x15bfe0;_0x3bb8a9[_0x41a281(0x192)]({'lockKey':_0x5aedfd['lockKey'],'filePath':_0x5aedfd['filePath'],'remoteId':_0x16a172?.['remoteId']??null,'mode':_0x16a172?.[_0x41a281(0x1ac)]?_0x41a281(0x1b6):_0x41a281(0x1a5),'status':!_0xc78b2a&&_0x42d695?_0x41a281(0x18e):_0x41a281(0x1c3)});}return{'method':_0x41a281(0x1b2),'url':'/api/management/library/scripts/save','body':{'appCode':_0x4be3a3[_0x41a281(0x197)],'force':_0xc78b2a,'files':_0x3bb8a9},'description':_0x41a281(0x191)+_0x3bb8a9[_0x41a281(0x179)]+_0x41a281(0x1b3)};},async 'execute'(_0x52604a){const _0xe2598c=a31_0x3bb0db,_0x43b4bc=loadBffProjectConfig(_0x52604a[_0xe2598c(0x197)]),_0x2003d8=await readBffLockFile(_0x43b4bc[_0xe2598c(0x1b1)]),{lockData:_0x252842,appLock:_0x340c96}=ensureLockScope(_0x2003d8??createEmptyBffLock(),_0x52604a['appCode'],_0x43b4bc[_0xe2598c(0x17c)],_0xe2598c(0x192)),_0x12d344=await getTargetFunctions(_0x43b4bc,_0x52604a);if(_0x12d344[_0xe2598c(0x179)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xe2598c(0x1a9)};const _0x2a4d9b=_0x52604a[_0xe2598c(0x1b9)](_0xe2598c(0x1c2)),_0x4c25eb=await buildHookMaps(_0x52604a[_0xe2598c(0x197)],_0x52604a['apiDir'],_0x12d344,_0x340c96),_0x5c1f04=[],_0x4bcc44=[],_0x175119=[];for(const _0x1fe9cb of _0x12d344){const _0x34ff74=await computeFileHash(_0x1fe9cb[_0xe2598c(0x18c)]),_0x2ec89b=_0x340c96[_0xe2598c(0x17b)][_0x1fe9cb['lockKey']];if(!_0x2a4d9b&&_0x2ec89b&&_0x2ec89b[_0xe2598c(0x182)]===_0x34ff74){_0x4bcc44[_0xe2598c(0x192)]({'lockKey':_0x1fe9cb[_0xe2598c(0x1aa)],'reason':_0xe2598c(0x18e)});continue;}try{await uploadSingleFunction(_0x52604a[_0xe2598c(0x197)],_0x1fe9cb,_0x340c96,_0x4c25eb);const _0xb839bf=_0x340c96['functions'][_0x1fe9cb[_0xe2598c(0x1aa)]];_0x5c1f04[_0xe2598c(0x192)]({'lockKey':_0x1fe9cb[_0xe2598c(0x1aa)],'remoteId':_0xb839bf?.[_0xe2598c(0x1ac)]??0x0});}catch(_0x2f694a){_0x175119['push']({'lockKey':_0x1fe9cb[_0xe2598c(0x1aa)],'error':_0x2f694a instanceof Error?_0x2f694a[_0xe2598c(0x1a6)]:String(_0x2f694a)});}}return _0x340c96[_0xe2598c(0x181)]=new Date()['toISOString'](),await writeBffLockFile(_0x43b4bc[_0xe2598c(0x1b1)],_0x252842),{'ok':_0x175119[_0xe2598c(0x179)]===0x0,'data':{'uploaded':_0x5c1f04,'skipped':_0x4bcc44,'failed':_0x175119},'message':_0xe2598c(0x1a7)+_0x5c1f04[_0xe2598c(0x179)]+_0xe2598c(0x194)+_0x4bcc44[_0xe2598c(0x179)]+_0xe2598c(0x1bb)+_0x175119[_0xe2598c(0x179)]+_0xe2598c(0x1bc)};}};async function getTargetFunctions(_0x545955,_0x283667){const _0x146087=a31_0x3bb0db,_0x1942c8=_0x283667[_0x146087(0x1b4)]('type'),_0x46e8c7=_0x283667[_0x146087(0x1b4)](_0x146087(0x183)),_0x44e62c=normalizeBffType(_0x1942c8)??undefined;if(_0x46e8c7&&!_0x44e62c)throw CliErrors[_0x146087(0x1b7)](_0x146087(0x19c));const _0x1fc88b=await scanLocalBffFunctions(_0x545955,_0x44e62c);if(_0x46e8c7){const _0x38aabe=_0x1fc88b[_0x146087(0x188)](_0x32d795=>_0x32d795[_0x146087(0x183)]===_0x46e8c7);if(_0x38aabe[_0x146087(0x179)]===0x0)throw CliErrors[_0x146087(0x1b7)](_0x146087(0x19b)+_0x44e62c+'/'+_0x46e8c7);return _0x38aabe;}return _0x1fc88b;}async function buildHookMaps(_0x37ebfa,_0x5b54b2,_0x4f92aa,_0x56f30e){const _0x5850d5=a31_0x3bb0db,_0x3103cd=_0x4f92aa[_0x5850d5(0x1b5)](_0x40b9fc=>_0x40b9fc[_0x5850d5(0x17a)]===_0x5850d5(0x1b0));if(!_0x3103cd)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x4a0714=loadAliasMap(_0x5b54b2,undefined,resolveApiFilePath(_0x5b54b2,_0x37ebfa)),_0x19b9ac=new Map(_0x4a0714['map'](_0x4e7189=>[_0x4e7189[_0x5850d5(0x187)],_0x4e7189['datasetCode']]));for(const _0x27251c of Object[_0x5850d5(0x1bd)](_0x56f30e[_0x5850d5(0x17b)])){_0x27251c[_0x5850d5(0x187)]&&_0x27251c[_0x5850d5(0x180)]&&!_0x19b9ac[_0x5850d5(0x19f)](_0x27251c['alias'])&&_0x19b9ac['set'](_0x27251c[_0x5850d5(0x187)],_0x27251c[_0x5850d5(0x180)]);}const _0x3e8eb5=await listDatasets(_0x37ebfa),_0x3b705c=new Map(_0x3e8eb5[_0x5850d5(0x1ab)](_0x3aacc4=>[_0x3aacc4[_0x5850d5(0x196)],_0x3aacc4['id']]));return{'aliasToDatasetCode':_0x19b9ac,'datasetCodeToId':_0x3b705c};}async function uploadSingleFunction(_0x322166,_0x15c356,_0x4fe739,_0x4e8908){const _0x1f008c=a31_0x3bb0db,_0x310c74=await readFile(_0x15c356[_0x1f008c(0x18c)],_0x1f008c(0x1be)),_0x12edbe=await computeFileHash(_0x15c356['filePath']),_0x2689c9=_0x4fe739['functions'][_0x15c356[_0x1f008c(0x1aa)]];if(_0x2689c9?.['remoteId']&&_0x2689c9[_0x1f008c(0x1a4)]==null)throw CliErrors[_0x1f008c(0x1b7)](_0x15c356[_0x1f008c(0x1aa)]+_0x1f008c(0x185));let _0xa03458=extractScriptDescription(_0x310c74);if(!_0xa03458&&_0x2689c9?.[_0x1f008c(0x1ac)]){const _0x4fffc4=await getBffScriptInfo(_0x2689c9[_0x1f008c(0x1ac)]);_0xa03458=_0x4fffc4['description']||undefined;}const _0x5432c9={'appCode':_0x322166,'functionName':_0x15c356[_0x1f008c(0x183)],'scriptType':_0x15c356[_0x1f008c(0x17a)],'scriptContent':_0x310c74};if(_0x2689c9?.[_0x1f008c(0x1ac)])_0x5432c9['id']=_0x2689c9[_0x1f008c(0x1ac)];if(_0x2689c9?.[_0x1f008c(0x1a4)]!=null)_0x5432c9[_0x1f008c(0x1a4)]=_0x2689c9[_0x1f008c(0x1a4)];if(_0xa03458)_0x5432c9[_0x1f008c(0x19e)]=_0xa03458;if(_0x15c356[_0x1f008c(0x17a)]===_0x1f008c(0x1b0)){const _0x3c885e=_0x15c356[_0x1f008c(0x187)];if(!_0x3c885e||!_0x15c356[_0x1f008c(0x1af)]||!_0x15c356[_0x1f008c(0x18f)])throw CliErrors[_0x1f008c(0x1b7)](_0x1f008c(0x186)+_0x15c356[_0x1f008c(0x1aa)]);const _0x468862=_0x4e8908[_0x1f008c(0x1ad)][_0x1f008c(0x189)](_0x3c885e)??_0x2689c9?.[_0x1f008c(0x180)]??_0x3c885e,_0x564534=_0x4e8908[_0x1f008c(0x1bf)][_0x1f008c(0x189)](_0x468862);if(!_0x564534)throw CliErrors[_0x1f008c(0x1b7)](_0x1f008c(0x1a1)+_0x3c885e+'\x22.\x20'+(_0x1f008c(0x184)+CLI_BIN_NAME+_0x1f008c(0x198)));_0x5432c9[_0x1f008c(0x1a2)]=_0x564534,_0x5432c9['operationType']=_0x15c356['operationType'],_0x5432c9['functionNode']=_0x15c356[_0x1f008c(0x18f)];}const _0x1436f2=await saveBffScript(_0x5432c9),_0x206fba=await getBffScriptInfo(_0x1436f2),_0x18e495={'hash':_0x12edbe,'remoteId':_0x1436f2,'version':_0x206fba[_0x1f008c(0x1a4)]};if(_0x15c356['type']===_0x1f008c(0x1b0)){const _0x289a05=_0x15c356['alias'],_0x144a05=_0x4e8908[_0x1f008c(0x1ad)]['get'](_0x289a05)??_0x2689c9?.[_0x1f008c(0x180)]??_0x289a05;_0x4e8908['aliasToDatasetCode']['has'](_0x289a05)?_0x18e495[_0x1f008c(0x187)]=_0x289a05:_0x18e495[_0x1f008c(0x187)]=_0x2689c9?.['alias'],_0x18e495[_0x1f008c(0x180)]=_0x144a05,_0x18e495[_0x1f008c(0x1af)]=_0x15c356['operationType'],_0x18e495['functionNode']=_0x15c356[_0x1f008c(0x18f)];}_0x4fe739[_0x1f008c(0x17b)][_0x15c356[_0x1f008c(0x1aa)]]=_0x18e495;}
1
+ const a31_0x3c1ad5=a31_0x51ef;(function(_0x21651d,_0x3f8702){const _0x19d0e4=a31_0x51ef,_0x4be762=_0x21651d();while(!![]){try{const _0x12d9f0=parseInt(_0x19d0e4(0x114))/0x1*(parseInt(_0x19d0e4(0x102))/0x2)+parseInt(_0x19d0e4(0xff))/0x3*(parseInt(_0x19d0e4(0xf0))/0x4)+-parseInt(_0x19d0e4(0xf8))/0x5*(parseInt(_0x19d0e4(0x11c))/0x6)+-parseInt(_0x19d0e4(0x119))/0x7*(-parseInt(_0x19d0e4(0xec))/0x8)+parseInt(_0x19d0e4(0x115))/0x9*(parseInt(_0x19d0e4(0x11f))/0xa)+-parseInt(_0x19d0e4(0x117))/0xb*(parseInt(_0x19d0e4(0xe7))/0xc)+parseInt(_0x19d0e4(0x109))/0xd*(-parseInt(_0x19d0e4(0x103))/0xe);if(_0x12d9f0===_0x3f8702)break;else _0x4be762['push'](_0x4be762['shift']());}catch(_0x4c829d){_0x4be762['push'](_0x4be762['shift']());}}}(a31_0x240c,0x5b00e));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a31_0x51ef(_0x5aaf7b,_0x3960eb){_0x5aaf7b=_0x5aaf7b-0xdf;const _0x240c2a=a31_0x240c();let _0x51ef72=_0x240c2a[_0x5aaf7b];return _0x51ef72;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPush={'service':'bff','command':a31_0x3c1ad5(0x10b),'description':a31_0x3c1ad5(0x11b),'risk':a31_0x3c1ad5(0xf9),'flags':[{'name':a31_0x3c1ad5(0xe8),'type':a31_0x3c1ad5(0x10c),'description':a31_0x3c1ad5(0xf6),'enum':['COMMON',a31_0x3c1ad5(0x122),a31_0x3c1ad5(0xfc)]},{'name':'name','type':a31_0x3c1ad5(0x10c),'description':a31_0x3c1ad5(0x101)},{'name':a31_0x3c1ad5(0x10a),'type':a31_0x3c1ad5(0xdf),'description':a31_0x3c1ad5(0xee)}],async 'dryRun'(_0x147806){const _0x2b07c7=a31_0x3c1ad5,_0x5aa99f=loadBffProjectConfig(_0x147806[_0x2b07c7(0xe2)]),_0x41b161=await readBffLockFile(_0x5aa99f[_0x2b07c7(0x107)]),{appLock:_0x2f3d69}=ensureLockScope(_0x41b161??createEmptyBffLock(),_0x147806[_0x2b07c7(0xe2)],_0x5aa99f['scriptsRoot'],_0x2b07c7(0x10b)),_0x51cb17=await getTargetFunctions(_0x5aa99f,_0x147806),_0x11362b=_0x147806[_0x2b07c7(0x112)](_0x2b07c7(0x10a)),_0x306fc2=[];for(const _0x25a20c of _0x51cb17){const _0x41b681=await computeFileHash(_0x25a20c[_0x2b07c7(0x100)]),_0xb35a23=_0x2f3d69['functions'][_0x25a20c[_0x2b07c7(0x10e)]],_0x219872=!!_0xb35a23&&_0xb35a23[_0x2b07c7(0xf4)]===_0x41b681;_0x306fc2[_0x2b07c7(0x10b)]({'lockKey':_0x25a20c['lockKey'],'filePath':_0x25a20c[_0x2b07c7(0x100)],'remoteId':_0xb35a23?.[_0x2b07c7(0x104)]??null,'mode':_0xb35a23?.[_0x2b07c7(0x104)]?_0x2b07c7(0xf7):_0x2b07c7(0xe9),'status':!_0x11362b&&_0x219872?_0x2b07c7(0xea):_0x2b07c7(0xe1)});}return{'method':_0x2b07c7(0x118),'url':_0x2b07c7(0xeb),'body':{'appCode':_0x147806[_0x2b07c7(0xe2)],'force':_0x11362b,'files':_0x306fc2},'description':_0x2b07c7(0xed)+_0x306fc2[_0x2b07c7(0xf2)]+_0x2b07c7(0xe6)};},async 'execute'(_0x3f6ada){const _0x405229=a31_0x3c1ad5,_0x43f2bd=loadBffProjectConfig(_0x3f6ada['appCode']),_0x4f186a=await readBffLockFile(_0x43f2bd['lockFilePath']),{lockData:_0x2f57cb,appLock:_0x417d63}=ensureLockScope(_0x4f186a??createEmptyBffLock(),_0x3f6ada[_0x405229(0xe2)],_0x43f2bd[_0x405229(0x113)],_0x405229(0x10b)),_0x59e082=await getTargetFunctions(_0x43f2bd,_0x3f6ada);if(_0x59e082[_0x405229(0xf2)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0xb928f4=_0x3f6ada[_0x405229(0x112)](_0x405229(0x10a)),_0x1bdb68=await buildHookMaps(_0x3f6ada[_0x405229(0xe2)],_0x3f6ada['apiDir'],_0x59e082,_0x417d63),_0x84a83b=[],_0x35ef85=[],_0x1d455b=[];for(const _0x3f98ea of _0x59e082){const _0x7d957f=await computeFileHash(_0x3f98ea[_0x405229(0x100)]),_0x4154da=_0x417d63[_0x405229(0x105)][_0x3f98ea[_0x405229(0x10e)]];if(!_0xb928f4&&_0x4154da&&_0x4154da[_0x405229(0xf4)]===_0x7d957f){_0x35ef85[_0x405229(0x10b)]({'lockKey':_0x3f98ea[_0x405229(0x10e)],'reason':_0x405229(0xea)});continue;}try{await uploadSingleFunction(_0x3f6ada[_0x405229(0xe2)],_0x3f98ea,_0x417d63,_0x1bdb68);const _0x1f3645=_0x417d63[_0x405229(0x105)][_0x3f98ea[_0x405229(0x10e)]];_0x84a83b[_0x405229(0x10b)]({'lockKey':_0x3f98ea[_0x405229(0x10e)],'remoteId':_0x1f3645?.[_0x405229(0x104)]??0x0});}catch(_0x5a7f81){_0x1d455b[_0x405229(0x10b)]({'lockKey':_0x3f98ea[_0x405229(0x10e)],'error':_0x5a7f81 instanceof Error?_0x5a7f81[_0x405229(0x123)]:String(_0x5a7f81)});}}return _0x417d63['lastSync']=new Date()[_0x405229(0xe3)](),await writeBffLockFile(_0x43f2bd[_0x405229(0x107)],_0x2f57cb),{'ok':_0x1d455b[_0x405229(0xf2)]===0x0,'data':{'uploaded':_0x84a83b,'skipped':_0x35ef85,'failed':_0x1d455b},'message':_0x405229(0xf1)+_0x84a83b['length']+'\x20uploaded,\x20'+_0x35ef85[_0x405229(0xf2)]+_0x405229(0x111)+_0x1d455b[_0x405229(0xf2)]+'\x20failed'};}};function a31_0x240c(){const _0x316745=['Would\x20inspect\x20','Force\x20push\x20ignoring\x20hash\x20protection','filter','968548ACHjby','Push\x20complete:\x20','length','has','hash','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','Push\x20only\x20this\x20script\x20type','update','325YkQAPV','high-risk-write','some','datasetCode','HOOK','Cannot\x20resolve\x20dataset\x20for\x20\x22',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','3xywcYG','filePath','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','204814sCZgmK','28RZpbpE','remoteId','functions','name','lockFilePath','map','2853097rdcASN','force','push','string','functionNode','lockKey','get','Incomplete\x20HOOK\x20path:\x20','\x20skipped,\x20','bool','scriptsRoot','5QnFxrl','90uKOFrR','values','11cdHNUX','POST','4039BknNMz','datasetId','Push\x20local\x20BFF\x20scripts\x20to\x20remote','22578qydBOu','alias','version','262610KyfBoE','datasetCodeToId','Local\x20function\x20not\x20found:\x20','ENDPOINT','message','validation','boolean','str','would_push','appCode','toISOString','description','operationType','\x20local\x20BFF\x20script(s)\x20for\x20push','6186876SeoRuF','type','create','unchanged','/api/management/library/scripts/save','7696bqpwSi'];a31_0x240c=function(){return _0x316745;};return a31_0x240c();}async function getTargetFunctions(_0x401497,_0x9e9b6b){const _0x2f0405=a31_0x3c1ad5,_0x48d6b3=_0x9e9b6b['str']('type'),_0x1dfad7=_0x9e9b6b[_0x2f0405(0xe0)](_0x2f0405(0x106)),_0x3198d4=normalizeBffType(_0x48d6b3)??undefined;if(_0x1dfad7&&!_0x3198d4)throw CliErrors[_0x2f0405(0x124)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x42f8b7=await scanLocalBffFunctions(_0x401497,_0x3198d4);if(_0x1dfad7){const _0x1fc39f=_0x42f8b7[_0x2f0405(0xef)](_0x40c60b=>_0x40c60b[_0x2f0405(0x106)]===_0x1dfad7);if(_0x1fc39f['length']===0x0)throw CliErrors[_0x2f0405(0x124)](_0x2f0405(0x121)+_0x3198d4+'/'+_0x1dfad7);return _0x1fc39f;}return _0x42f8b7;}async function buildHookMaps(_0xaa01c7,_0x17fe5c,_0x14cae2,_0x17f2e9){const _0x3b81b3=a31_0x3c1ad5,_0x3a0f42=_0x14cae2[_0x3b81b3(0xfa)](_0x1d2034=>_0x1d2034['type']===_0x3b81b3(0xfc));if(!_0x3a0f42)return{'aliasToDatasetCode':new Map(),'datasetCodeToId':new Map()};const _0x321ec5=loadAliasMap(_0x17fe5c,undefined,resolveApiFilePath(_0x17fe5c,_0xaa01c7)),_0x29372c=new Map(_0x321ec5[_0x3b81b3(0x108)](_0x2ce165=>[_0x2ce165[_0x3b81b3(0x11d)],_0x2ce165[_0x3b81b3(0xfb)]]));for(const _0x431ff8 of Object[_0x3b81b3(0x116)](_0x17f2e9['functions'])){_0x431ff8[_0x3b81b3(0x11d)]&&_0x431ff8[_0x3b81b3(0xfb)]&&!_0x29372c[_0x3b81b3(0xf3)](_0x431ff8[_0x3b81b3(0x11d)])&&_0x29372c['set'](_0x431ff8[_0x3b81b3(0x11d)],_0x431ff8[_0x3b81b3(0xfb)]);}const _0x49ca9f=await listDatasets(_0xaa01c7),_0x58e534=new Map(_0x49ca9f[_0x3b81b3(0x108)](_0x2ea7cf=>[_0x2ea7cf['code'],_0x2ea7cf['id']]));return{'aliasToDatasetCode':_0x29372c,'datasetCodeToId':_0x58e534};}async function uploadSingleFunction(_0x1e4a03,_0x409134,_0x415508,_0x739c38){const _0x3a54a7=a31_0x3c1ad5,_0x40d428=await readFile(_0x409134[_0x3a54a7(0x100)],'utf8'),_0xcbcd5c=await computeFileHash(_0x409134[_0x3a54a7(0x100)]),_0x4ec386=_0x415508['functions'][_0x409134[_0x3a54a7(0x10e)]];if(_0x4ec386?.[_0x3a54a7(0x104)]&&_0x4ec386[_0x3a54a7(0x11e)]==null)throw CliErrors[_0x3a54a7(0x124)](_0x409134[_0x3a54a7(0x10e)]+_0x3a54a7(0xfe));let _0x5b70d7=extractScriptDescription(_0x40d428);if(!_0x5b70d7&&_0x4ec386?.['remoteId']){const _0x570240=await getBffScriptInfo(_0x4ec386[_0x3a54a7(0x104)]);_0x5b70d7=_0x570240[_0x3a54a7(0xe4)]||undefined;}const _0x18a507={'appCode':_0x1e4a03,'functionName':_0x409134[_0x3a54a7(0x106)],'scriptType':_0x409134[_0x3a54a7(0xe8)],'scriptContent':_0x40d428};if(_0x4ec386?.[_0x3a54a7(0x104)])_0x18a507['id']=_0x4ec386[_0x3a54a7(0x104)];if(_0x4ec386?.[_0x3a54a7(0x11e)]!=null)_0x18a507[_0x3a54a7(0x11e)]=_0x4ec386[_0x3a54a7(0x11e)];if(_0x5b70d7)_0x18a507['description']=_0x5b70d7;if(_0x409134['type']==='HOOK'){const _0x1d042a=_0x409134['alias'];if(!_0x1d042a||!_0x409134['operationType']||!_0x409134['functionNode'])throw CliErrors['validation'](_0x3a54a7(0x110)+_0x409134[_0x3a54a7(0x10e)]);const _0x303652=_0x739c38['aliasToDatasetCode']['get'](_0x1d042a)??_0x4ec386?.[_0x3a54a7(0xfb)]??_0x1d042a,_0xf4c3d3=_0x739c38[_0x3a54a7(0x120)][_0x3a54a7(0x10f)](_0x303652);if(!_0xf4c3d3)throw CliErrors[_0x3a54a7(0x124)](_0x3a54a7(0xfd)+_0x1d042a+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x3a54a7(0xf5)));_0x18a507[_0x3a54a7(0x11a)]=_0xf4c3d3,_0x18a507[_0x3a54a7(0xe5)]=_0x409134[_0x3a54a7(0xe5)],_0x18a507[_0x3a54a7(0x10d)]=_0x409134['functionNode'];}const _0x2af3d3=await saveBffScript(_0x18a507),_0x2ec014=await getBffScriptInfo(_0x2af3d3),_0x4df43f={'hash':_0xcbcd5c,'remoteId':_0x2af3d3,'version':_0x2ec014[_0x3a54a7(0x11e)]};if(_0x409134[_0x3a54a7(0xe8)]===_0x3a54a7(0xfc)){const _0x3bf89a=_0x409134[_0x3a54a7(0x11d)],_0x20a8c3=_0x739c38['aliasToDatasetCode'][_0x3a54a7(0x10f)](_0x3bf89a)??_0x4ec386?.[_0x3a54a7(0xfb)]??_0x3bf89a;_0x739c38['aliasToDatasetCode'][_0x3a54a7(0xf3)](_0x3bf89a)?_0x4df43f['alias']=_0x3bf89a:_0x4df43f[_0x3a54a7(0x11d)]=_0x4ec386?.[_0x3a54a7(0x11d)],_0x4df43f['datasetCode']=_0x20a8c3,_0x4df43f[_0x3a54a7(0xe5)]=_0x409134[_0x3a54a7(0xe5)],_0x4df43f[_0x3a54a7(0x10d)]=_0x409134[_0x3a54a7(0x10d)];}_0x415508[_0x3a54a7(0x105)][_0x409134[_0x3a54a7(0x10e)]]=_0x4df43f;}
@@ -1 +1 @@
1
- const a32_0x1ebc9d=a32_0xe806;function a32_0xca31(){const _0x5156e7=['584580WftJqm','filePath','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','has','all','apiDir','appCode','status','\x20modified,\x20','1054368MDCdNL','128312jDwzVq','lockKey','All\x20BFF\x20scripts\x20are\x20in\x20sync.','767841AsDOAW','push','1358532IZrvMX','\x20added,\x20','map','14CWykQh','scriptsRoot','remote','alias','434944VZqbFj','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','functions','length','4fDFTuY','\x20remote-only','172705GaElEy'];a32_0xca31=function(){return _0x5156e7;};return a32_0xca31();}(function(_0x547370,_0x4e73b5){const _0x4824fb=a32_0xe806,_0x34f9d4=_0x547370();while(!![]){try{const _0xfb559c=-parseInt(_0x4824fb(0x7b))/0x1+-parseInt(_0x4824fb(0x69))/0x2+parseInt(_0x4824fb(0x6c))/0x3+-parseInt(_0x4824fb(0x79))/0x4*(parseInt(_0x4824fb(0x7c))/0x5)+parseInt(_0x4824fb(0x6e))/0x6+parseInt(_0x4824fb(0x71))/0x7*(-parseInt(_0x4824fb(0x75))/0x8)+parseInt(_0x4824fb(0x68))/0x9;if(_0xfb559c===_0x4e73b5)break;else _0x34f9d4['push'](_0x34f9d4['shift']());}catch(_0x53b2ca){_0x34f9d4['push'](_0x34f9d4['shift']());}}}(a32_0xca31,0x21730));function a32_0xe806(_0x40ecf7,_0x214033){_0x40ecf7=_0x40ecf7-0x67;const _0xca31a5=a32_0xca31();let _0xe80613=_0xca31a5[_0x40ecf7];return _0xe80613;}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a32_0x1ebc9d(0x83),'description':a32_0x1ebc9d(0x7e),'risk':'read','flags':[{'name':'remote','type':'boolean','description':a32_0x1ebc9d(0x76)}],async 'execute'(_0x52ed28){const _0x2eb0eb=a32_0x1ebc9d,_0x8b556d=loadBffProjectConfig(_0x52ed28[_0x2eb0eb(0x82)]),_0x593e3d=await readBffLockFile(_0x8b556d['lockFilePath']),{appLock:_0x1df075}=ensureLockScope(_0x593e3d??createEmptyBffLock(),_0x52ed28[_0x2eb0eb(0x82)],_0x8b556d[_0x2eb0eb(0x72)],_0x2eb0eb(0x83)),_0x38a2fa=await scanLocalBffFunctions(_0x8b556d),_0x2b3120=[],_0x5beb80=[],_0x31708d=[];for(const _0x3808fa of _0x38a2fa){const _0x4f4c69=await computeFileHash(_0x3808fa[_0x2eb0eb(0x7d)]),_0x257993=_0x1df075[_0x2eb0eb(0x77)][_0x3808fa[_0x2eb0eb(0x6a)]];if(!_0x257993)_0x2b3120[_0x2eb0eb(0x6d)](_0x3808fa[_0x2eb0eb(0x6a)]);else _0x257993['hash']!==_0x4f4c69?_0x5beb80['push'](_0x3808fa[_0x2eb0eb(0x6a)]):_0x31708d[_0x2eb0eb(0x6d)](_0x3808fa['lockKey']);}const _0x5c3858=[];if(_0x52ed28['bool'](_0x2eb0eb(0x73))){const _0x585066=loadAliasMap(_0x52ed28[_0x2eb0eb(0x81)],undefined,resolveApiFilePath(_0x52ed28[_0x2eb0eb(0x81)],_0x52ed28[_0x2eb0eb(0x82)])),_0x553703=new Map(_0x585066[_0x2eb0eb(0x70)](_0x4aab09=>[_0x4aab09['datasetCode'],_0x4aab09[_0x2eb0eb(0x74)]])),[_0xb85c34,_0x174c58]=await Promise[_0x2eb0eb(0x80)]([listBffScripts(_0x52ed28['appCode']),getBffScriptStatistics(_0x52ed28[_0x2eb0eb(0x82)])]),_0x24957c=createHookLocationMap(_0x174c58),_0x20e748=new Set(_0x38a2fa[_0x2eb0eb(0x70)](_0x4a4635=>_0x4a4635[_0x2eb0eb(0x6a)]));for(const _0x128545 of _0xb85c34){const _0x5dfec1=resolveRemoteScriptTarget(_0x8b556d,_0x128545,_0x24957c,_0x1df075[_0x2eb0eb(0x77)],_0x553703);_0x5dfec1&&!_0x20e748[_0x2eb0eb(0x7f)](_0x5dfec1[_0x2eb0eb(0x6a)])&&_0x5c3858[_0x2eb0eb(0x6d)](_0x5dfec1['lockKey']);}}const _0x501b6a=_0x2b3120[_0x2eb0eb(0x78)]===0x0&&_0x5beb80['length']===0x0&&_0x5c3858[_0x2eb0eb(0x78)]===0x0;return{'ok':!![],'data':{'added':_0x2b3120,'modified':_0x5beb80,'unchanged':_0x31708d,'remoteOnly':_0x5c3858},'message':_0x501b6a?_0x2eb0eb(0x6b):_0x2b3120[_0x2eb0eb(0x78)]+_0x2eb0eb(0x6f)+_0x5beb80[_0x2eb0eb(0x78)]+_0x2eb0eb(0x67)+_0x31708d[_0x2eb0eb(0x78)]+'\x20unchanged'+(_0x5c3858[_0x2eb0eb(0x78)]>0x0?',\x20'+_0x5c3858[_0x2eb0eb(0x78)]+_0x2eb0eb(0x7a):'')};}};
1
+ function a32_0x4e6e(_0x19c7fc,_0x64a983){_0x19c7fc=_0x19c7fc-0x70;const _0x45a092=a32_0x45a0();let _0x4e6e68=_0x45a092[_0x19c7fc];return _0x4e6e68;}const a32_0x186083=a32_0x4e6e;(function(_0x297cb4,_0x4baf0c){const _0x5f4cc3=a32_0x4e6e,_0x143463=_0x297cb4();while(!![]){try{const _0x49ee23=parseInt(_0x5f4cc3(0x84))/0x1*(parseInt(_0x5f4cc3(0x86))/0x2)+-parseInt(_0x5f4cc3(0x87))/0x3*(-parseInt(_0x5f4cc3(0x7e))/0x4)+parseInt(_0x5f4cc3(0x7c))/0x5+parseInt(_0x5f4cc3(0x73))/0x6+parseInt(_0x5f4cc3(0x74))/0x7*(parseInt(_0x5f4cc3(0x8e))/0x8)+-parseInt(_0x5f4cc3(0x72))/0x9+-parseInt(_0x5f4cc3(0x7d))/0xa;if(_0x49ee23===_0x4baf0c)break;else _0x143463['push'](_0x143463['shift']());}catch(_0x4e70ae){_0x143463['push'](_0x143463['shift']());}}}(a32_0x45a0,0xd8a99));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a32_0x186083(0x8f),'command':a32_0x186083(0x7a),'description':'Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','risk':a32_0x186083(0x79),'flags':[{'name':a32_0x186083(0x7f),'type':a32_0x186083(0x83),'description':a32_0x186083(0x77)}],async 'execute'(_0x2f3c9e){const _0x31281d=a32_0x186083,_0x5e97a0=loadBffProjectConfig(_0x2f3c9e['appCode']),_0x52dc4a=await readBffLockFile(_0x5e97a0['lockFilePath']),{appLock:_0x1b187c}=ensureLockScope(_0x52dc4a??createEmptyBffLock(),_0x2f3c9e[_0x31281d(0x89)],_0x5e97a0['scriptsRoot'],_0x31281d(0x7a)),_0x5e43bf=await scanLocalBffFunctions(_0x5e97a0),_0x1fa877=[],_0x2c7cb3=[],_0x15cc9f=[];for(const _0x4cc0c4 of _0x5e43bf){const _0x20af27=await computeFileHash(_0x4cc0c4[_0x31281d(0x81)]),_0x479db0=_0x1b187c[_0x31281d(0x8a)][_0x4cc0c4['lockKey']];if(!_0x479db0)_0x1fa877[_0x31281d(0x75)](_0x4cc0c4[_0x31281d(0x76)]);else _0x479db0['hash']!==_0x20af27?_0x2c7cb3['push'](_0x4cc0c4[_0x31281d(0x76)]):_0x15cc9f[_0x31281d(0x75)](_0x4cc0c4[_0x31281d(0x76)]);}const _0x119c85=[];if(_0x2f3c9e[_0x31281d(0x78)]('remote')){const _0x42dc16=loadAliasMap(_0x2f3c9e[_0x31281d(0x88)],undefined,resolveApiFilePath(_0x2f3c9e[_0x31281d(0x88)],_0x2f3c9e['appCode'])),_0xaa52c0=new Map(_0x42dc16[_0x31281d(0x8b)](_0x14f5ea=>[_0x14f5ea[_0x31281d(0x85)],_0x14f5ea[_0x31281d(0x70)]])),[_0x4fd2c5,_0x41ae1a]=await Promise['all']([listBffScripts(_0x2f3c9e[_0x31281d(0x89)]),getBffScriptStatistics(_0x2f3c9e[_0x31281d(0x89)])]),_0x1bc8ef=createHookLocationMap(_0x41ae1a),_0x364425=new Set(_0x5e43bf[_0x31281d(0x8b)](_0x2b93b3=>_0x2b93b3[_0x31281d(0x76)]));for(const _0x46da20 of _0x4fd2c5){const _0x3d683d=resolveRemoteScriptTarget(_0x5e97a0,_0x46da20,_0x1bc8ef,_0x1b187c[_0x31281d(0x8a)],_0xaa52c0);_0x3d683d&&!_0x364425[_0x31281d(0x80)](_0x3d683d[_0x31281d(0x76)])&&_0x119c85[_0x31281d(0x75)](_0x3d683d[_0x31281d(0x76)]);}}const _0x565db8=_0x1fa877[_0x31281d(0x8d)]===0x0&&_0x2c7cb3[_0x31281d(0x8d)]===0x0&&_0x119c85[_0x31281d(0x8d)]===0x0;return{'ok':!![],'data':{'added':_0x1fa877,'modified':_0x2c7cb3,'unchanged':_0x15cc9f,'remoteOnly':_0x119c85},'message':_0x565db8?_0x31281d(0x82):_0x1fa877['length']+_0x31281d(0x8c)+_0x2c7cb3[_0x31281d(0x8d)]+_0x31281d(0x71)+_0x15cc9f[_0x31281d(0x8d)]+_0x31281d(0x7b)+(_0x119c85['length']>0x0?',\x20'+_0x119c85['length']+'\x20remote-only':'')};}};function a32_0x45a0(){const _0x81160f=['map','\x20added,\x20','length','154136IQWDWL','bff','alias','\x20modified,\x20','13391730KuAais','3188484IHSWKR','14jXIdgE','push','lockKey','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','bool','read','status','\x20unchanged','5756765jIVUXL','22044270cWKbVa','5115836fGKckT','remote','has','filePath','All\x20BFF\x20scripts\x20are\x20in\x20sync.','boolean','789793erwlnI','datasetCode','4KNZvAi','3lwGpPx','apiDir','appCode','functions'];a32_0x45a0=function(){return _0x81160f;};return a32_0x45a0();}