@lovrabet/rabetbase-cli 2.3.1-beta.2 → 2.3.2-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/app-config/delete.js +1 -1
  27. package/lib/commands/app-config/get.js +1 -1
  28. package/lib/commands/app-config/index.js +1 -1
  29. package/lib/commands/app-config/list.js +1 -1
  30. package/lib/commands/app-config/set.js +1 -1
  31. package/lib/commands/app-config/shared.js +1 -1
  32. package/lib/commands/auth/index.js +1 -1
  33. package/lib/commands/bff/create.js +1 -1
  34. package/lib/commands/bff/delete.js +1 -1
  35. package/lib/commands/bff/detail.js +1 -1
  36. package/lib/commands/bff/index.js +1 -1
  37. package/lib/commands/bff/list.js +1 -1
  38. package/lib/commands/bff/pull.js +1 -1
  39. package/lib/commands/bff/push.js +1 -1
  40. package/lib/commands/bff/status.js +1 -1
  41. package/lib/commands/cli-skill/index.js +1 -1
  42. package/lib/commands/cli-update.js +1 -1
  43. package/lib/commands/codegen/index.js +1 -1
  44. package/lib/commands/codegen/sdk.js +1 -1
  45. package/lib/commands/codegen/sql.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/flags.js +1 -1
  48. package/lib/commands/common/validate.js +1 -1
  49. package/lib/commands/config/get.js +1 -1
  50. package/lib/commands/config/index.js +1 -1
  51. package/lib/commands/config/list.js +1 -1
  52. package/lib/commands/config/set.js +1 -1
  53. package/lib/commands/config/shared.js +1 -1
  54. package/lib/commands/data/filter.js +1 -1
  55. package/lib/commands/data/getOne.js +1 -1
  56. package/lib/commands/data/index.js +1 -1
  57. package/lib/commands/data/shared.js +1 -1
  58. package/lib/commands/dataset/business-group-update.js +1 -1
  59. package/lib/commands/dataset/capability.js +1 -1
  60. package/lib/commands/dataset/delete.js +1 -1
  61. package/lib/commands/dataset/detail.js +1 -1
  62. package/lib/commands/dataset/extend-update.js +1 -1
  63. package/lib/commands/dataset/field-update.js +1 -1
  64. package/lib/commands/dataset/index.js +1 -1
  65. package/lib/commands/dataset/list.js +1 -1
  66. package/lib/commands/dataset/operations.js +1 -1
  67. package/lib/commands/dataset/relation-audit.js +1 -0
  68. package/lib/commands/dataset/relation-create.js +1 -1
  69. package/lib/commands/dataset/relation-delete.js +1 -1
  70. package/lib/commands/dataset/relation-shared.js +1 -1
  71. package/lib/commands/dataset/relation-update.js +1 -1
  72. package/lib/commands/dataset/relations.js +1 -1
  73. package/lib/commands/dataset/rename.js +1 -1
  74. package/lib/commands/dataset/restore.js +1 -1
  75. package/lib/commands/db/analyze-cancel.js +1 -1
  76. package/lib/commands/db/analyze-start.js +1 -1
  77. package/lib/commands/db/analyze-status.js +1 -1
  78. package/lib/commands/db/create.js +1 -1
  79. package/lib/commands/db/delete.js +1 -1
  80. package/lib/commands/db/detail.js +1 -1
  81. package/lib/commands/db/diff.js +1 -1
  82. package/lib/commands/db/index.js +1 -1
  83. package/lib/commands/db/list.js +1 -1
  84. package/lib/commands/db/shared.js +1 -1
  85. package/lib/commands/db/tables.js +1 -1
  86. package/lib/commands/db/test.js +1 -1
  87. package/lib/commands/db/update.js +1 -1
  88. package/lib/commands/doctor.js +1 -1
  89. package/lib/commands/init/index.js +1 -1
  90. package/lib/commands/issue/index.js +1 -1
  91. package/lib/commands/issue/nudge.js +1 -1
  92. package/lib/commands/issue/report.js +1 -1
  93. package/lib/commands/issue/shared.js +1 -1
  94. package/lib/commands/logs/index.js +1 -1
  95. package/lib/commands/menu/index.js +1 -1
  96. package/lib/commands/menu/list.js +1 -1
  97. package/lib/commands/menu/shared/compare-table.js +1 -1
  98. package/lib/commands/menu/shared/index.js +1 -1
  99. package/lib/commands/menu/shared/inquirer.js +1 -1
  100. package/lib/commands/menu/shared/local-pages.js +1 -1
  101. package/lib/commands/menu/shared/logic.js +1 -1
  102. package/lib/commands/menu/shared/service.js +1 -1
  103. package/lib/commands/menu/shared/sync-core.js +1 -1
  104. package/lib/commands/menu/shared/update-core.js +1 -1
  105. package/lib/commands/menu/shared/valid-url.js +1 -1
  106. package/lib/commands/menu/sync.js +1 -1
  107. package/lib/commands/menu/update.js +1 -1
  108. package/lib/commands/page/generate-start.js +1 -1
  109. package/lib/commands/page/generate-status.js +1 -1
  110. package/lib/commands/page/index.js +1 -1
  111. package/lib/commands/page/pull.js +1 -1
  112. package/lib/commands/page/push.js +1 -1
  113. package/lib/commands/page/relation-audit.js +1 -1
  114. package/lib/commands/page/shared.js +1 -1
  115. package/lib/commands/page/standard-page-status.js +1 -1
  116. package/lib/commands/page/sync.js +1 -1
  117. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  118. package/lib/commands/project/create/format-elapsed.js +1 -1
  119. package/lib/commands/project/create/main.js +1 -1
  120. package/lib/commands/project/create/non-interactive.js +1 -1
  121. package/lib/commands/project/create/project-template-path.js +1 -1
  122. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  123. package/lib/commands/project/create/use-format-code.js +1 -1
  124. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  125. package/lib/commands/project/index.js +1 -1
  126. package/lib/commands/project/init.js +1 -1
  127. package/lib/commands/project/upgrade.js +1 -1
  128. package/lib/commands/registry.js +1 -1
  129. package/lib/commands/run/index.js +1 -1
  130. package/lib/commands/schema.js +1 -1
  131. package/lib/commands/sql/create.js +1 -1
  132. package/lib/commands/sql/delete.js +1 -1
  133. package/lib/commands/sql/detail.js +1 -1
  134. package/lib/commands/sql/exec.js +1 -1
  135. package/lib/commands/sql/index.js +1 -1
  136. package/lib/commands/sql/list.js +1 -1
  137. package/lib/commands/sql/pull.js +1 -1
  138. package/lib/commands/sql/push.js +1 -1
  139. package/lib/commands/sql/save.js +1 -1
  140. package/lib/commands/sql/shared.js +1 -1
  141. package/lib/commands/sql/status.js +1 -1
  142. package/lib/commands/sql/validate.js +1 -1
  143. package/lib/commands/workspace/index.js +1 -1
  144. package/lib/config/schema.js +1 -1
  145. package/lib/constant/cdn.js +1 -1
  146. package/lib/constant/cli.js +1 -1
  147. package/lib/constant/defaults.js +1 -1
  148. package/lib/constant/domain.js +1 -1
  149. package/lib/constant/env.js +1 -1
  150. package/lib/constant/output.js +1 -1
  151. package/lib/constant/paths.js +1 -1
  152. package/lib/constant/risk.js +1 -1
  153. package/lib/context/app-resolver.js +1 -1
  154. package/lib/context/auth-resolver.js +1 -1
  155. package/lib/context/config-loader.js +1 -1
  156. package/lib/context.js +1 -1
  157. package/lib/core/alias-resolver.js +1 -1
  158. package/lib/core/api-client.js +1 -1
  159. package/lib/core/bff/config.js +1 -1
  160. package/lib/core/bff/file-system.js +1 -1
  161. package/lib/core/bff/hash.js +1 -1
  162. package/lib/core/bff/lock.js +1 -1
  163. package/lib/core/bff/utils.js +1 -1
  164. package/lib/core/db-resolver.js +1 -1
  165. package/lib/core/page/file-system.js +1 -1
  166. package/lib/core/page/hash.js +1 -1
  167. package/lib/core/page/lock.js +1 -1
  168. package/lib/core/sql-sync/config.js +1 -1
  169. package/lib/core/sql-sync/file-system.js +1 -1
  170. package/lib/core/sql-sync/hash.js +1 -1
  171. package/lib/core/sql-sync/lock.js +1 -1
  172. package/lib/core/sql-sync/utils.js +1 -1
  173. package/lib/core/sql-validator.js +1 -1
  174. package/lib/errors.js +1 -1
  175. package/lib/framework/build-all-flags.js +1 -1
  176. package/lib/framework/flags.js +1 -1
  177. package/lib/framework/help.js +1 -1
  178. package/lib/framework/index.js +1 -1
  179. package/lib/framework/output.js +1 -1
  180. package/lib/framework/response.js +1 -1
  181. package/lib/framework/runner-alias.js +1 -1
  182. package/lib/framework/runner.js +1 -1
  183. package/lib/framework/schema-export.js +1 -1
  184. package/lib/framework/types.js +1 -1
  185. package/lib/generated/build-info.js +1 -1
  186. package/lib/help.js +1 -1
  187. package/lib/skills/main.js +1 -1
  188. package/lib/skills/npx-skills-add.js +1 -1
  189. package/lib/telemetry/cli-command-trace.js +1 -1
  190. package/lib/telemetry/cli-help-trace.js +1 -1
  191. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  192. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  193. package/lib/telemetry/send-cli-trace-log.js +1 -1
  194. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  195. package/lib/utils/ai_config.js +1 -1
  196. package/lib/utils/apply-jq-filter.js +1 -1
  197. package/lib/utils/cdn-config.js +1 -1
  198. package/lib/utils/check-sdk-version.js +1 -1
  199. package/lib/utils/cli-version-check.js +1 -1
  200. package/lib/utils/cli-version-policy.js +1 -1
  201. package/lib/utils/config.js +1 -1
  202. package/lib/utils/copy-directory.js +1 -1
  203. package/lib/utils/entity-with-id.js +1 -1
  204. package/lib/utils/file-utils.js +1 -1
  205. package/lib/utils/guides-cdn.js +1 -1
  206. package/lib/utils/http-client.js +1 -1
  207. package/lib/utils/is-non-interactive.js +1 -1
  208. package/lib/utils/logger.js +1 -1
  209. package/lib/utils/params.js +1 -1
  210. package/lib/utils/platform.js +1 -1
  211. package/lib/utils/rules-cdn.js +1 -1
  212. package/lib/utils/sleep.js +1 -1
  213. package/lib/utils/template-replacer.js +1 -1
  214. package/lib/utils/update-notice.js +1 -1
  215. package/lib/utils/version.js +1 -1
  216. package/lib/utils/with-active-cookie.js +1 -1
  217. package/lib/utils/write-cli-side-channel.js +1 -1
  218. package/package.json +1 -1
@@ -1 +1 @@
1
- const a33_0x1b4693=a33_0x331a;(function(_0x286d4a,_0x9cf468){const _0x76754c=a33_0x331a,_0x489d60=_0x286d4a();while(!![]){try{const _0x5ce75f=-parseInt(_0x76754c(0x14f))/0x1*(-parseInt(_0x76754c(0x13d))/0x2)+-parseInt(_0x76754c(0x15b))/0x3*(-parseInt(_0x76754c(0x150))/0x4)+-parseInt(_0x76754c(0x131))/0x5+parseInt(_0x76754c(0x159))/0x6*(-parseInt(_0x76754c(0x124))/0x7)+-parseInt(_0x76754c(0x12d))/0x8+-parseInt(_0x76754c(0x139))/0x9*(parseInt(_0x76754c(0x152))/0xa)+-parseInt(_0x76754c(0x125))/0xb*(-parseInt(_0x76754c(0x133))/0xc);if(_0x5ce75f===_0x9cf468)break;else _0x489d60['push'](_0x489d60['shift']());}catch(_0x429735){_0x489d60['push'](_0x489d60['shift']());}}}(a33_0x39a6,0x22fd5));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';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a33_0x1b4693(0x12f),'command':a33_0x1b4693(0x132),'description':a33_0x1b4693(0x12c),'risk':'high-risk-write','flags':[{'name':a33_0x1b4693(0x129),'type':a33_0x1b4693(0x157),'required':!![],'description':a33_0x1b4693(0x14d)}],async 'validate'(_0x3d7ec7){const _0x2b4222=a33_0x1b4693,_0x520660=loadBffProjectConfig(_0x3d7ec7[_0x2b4222(0x128)]),_0x25e970=await readBffLockFile(_0x520660[_0x2b4222(0x158)]);if(!_0x25e970)throw CliErrors[_0x2b4222(0x130)](_0x2b4222(0x154));},async 'dryRun'(_0x34afd5){const _0x212433=a33_0x1b4693,_0x96391=loadBffProjectConfig(_0x34afd5['appCode']),_0x614865=await readBffLockFile(_0x96391[_0x212433(0x158)]);if(!_0x614865)throw CliErrors[_0x212433(0x130)](_0x212433(0x149));const {appLock:_0x40d996}=ensureLockScope(_0x614865,_0x34afd5[_0x212433(0x128)],_0x96391['scriptsRoot'],_0x212433(0x132)),_0x2e89a7=_0x34afd5[_0x212433(0x13f)](_0x212433(0x129)),_0x342f4f=Object['keys'](_0x40d996[_0x212433(0x148)]),_0x2261fa=resolveDeleteTarget(_0x2e89a7,_0x342f4f),_0x328b54=_0x40d996['functions'][_0x2261fa];if(!_0x328b54)throw CliErrors[_0x212433(0x130)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x2261fa+'\x22.');const _0x2450f5=resolveLocalFilePathFromLockKey(_0x96391,_0x2261fa),_0x5ebdd7=relative(_0x96391[_0x212433(0x142)],_0x2450f5),_0x4a62e2=join(_0x96391['trashDir'],_0x212433(0x12e),_0x5ebdd7);return{'method':'POST','url':_0x212433(0x138),'body':{'appCode':_0x34afd5[_0x212433(0x128)],'target':_0x2261fa,'remoteId':_0x328b54[_0x212433(0x127)],'localFilePath':_0x2450f5,'trashedPath':_0x4a62e2},'description':_0x212433(0x126)+_0x2261fa+_0x212433(0x14b)};},async 'execute'(_0x407b53){const _0x134fea=a33_0x1b4693,_0x5f02c2=loadBffProjectConfig(_0x407b53[_0x134fea(0x128)]),_0x3e0bdb=await readBffLockFile(_0x5f02c2[_0x134fea(0x158)]);if(!_0x3e0bdb)throw CliErrors['validation'](_0x134fea(0x149));const {lockData:_0x31556b,appLock:_0x53a228}=ensureLockScope(_0x3e0bdb,_0x407b53[_0x134fea(0x128)],_0x5f02c2[_0x134fea(0x147)],_0x134fea(0x132)),_0x2faada=JSON[_0x134fea(0x140)](JSON[_0x134fea(0x14c)](_0x31556b)),_0x2835f2=_0x2faada[_0x134fea(0x143)][_0x407b53[_0x134fea(0x128)]];if(!_0x2835f2)throw new Error(_0x134fea(0x12b)+_0x407b53['appCode']+_0x134fea(0x14e));const _0x3fd8b4=_0x407b53['str'](_0x134fea(0x129)),_0x111875=Object[_0x134fea(0x13a)](_0x2835f2[_0x134fea(0x148)]),_0x4bdb54=resolveDeleteTarget(_0x3fd8b4,_0x111875),_0x276275=_0x2835f2[_0x134fea(0x148)][_0x4bdb54];if(!_0x276275)throw CliErrors[_0x134fea(0x130)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x4bdb54+'\x22.');await deleteBffScript(_0x276275[_0x134fea(0x127)]),delete _0x2835f2[_0x134fea(0x148)][_0x4bdb54],_0x2835f2[_0x134fea(0x136)]=new Date()['toISOString'](),await writeBffLockFile(_0x5f02c2['lockFilePath'],_0x2faada);const _0x18bbcb=resolveLocalFilePathFromLockKey(_0x5f02c2,_0x4bdb54);let _0x3e0ca0;await fileExists(_0x18bbcb)&&(_0x3e0ca0=await moveToTrash(_0x5f02c2[_0x134fea(0x142)],_0x5f02c2[_0x134fea(0x135)],_0x18bbcb),await cleanupEmptyDirectories(dirname(_0x18bbcb),_0x5f02c2[_0x134fea(0x155)]));await waitForDeleteSettlement(_0x5f02c2['lockFilePath'],_0x407b53['appCode'],_0x4bdb54,_0x18bbcb),await sleep(0x96);const _0x558705={'deleted':_0x4bdb54,'remoteId':_0x276275[_0x134fea(0x127)]};if(_0x3e0ca0)_0x558705['trashedTo']=_0x3e0ca0;return{'ok':!![],'data':_0x558705,'message':_0x134fea(0x13c)+_0x4bdb54+(_0x3e0ca0?_0x134fea(0x144):'')};}};function resolveDeleteTarget(_0x106bce,_0x150ae8){const _0x5d6b57=a33_0x1b4693;if(_0x106bce[_0x5d6b57(0x141)]('/')){const _0x472152=_0x150ae8['find'](_0xd60035=>_0xd60035===_0x106bce);if(!_0x472152)throw CliErrors['validation'](_0x5d6b57(0x14a)+_0x106bce);return _0x472152;}const _0x2f1891=_0x150ae8[_0x5d6b57(0x13e)](_0x315f0e=>_0x315f0e[_0x5d6b57(0x153)]('/')['at'](-0x1)===_0x106bce);if(_0x2f1891[_0x5d6b57(0x15a)]===0x0)throw CliErrors[_0x5d6b57(0x130)](_0x5d6b57(0x14a)+_0x106bce);if(_0x2f1891[_0x5d6b57(0x15a)]>0x1)throw CliErrors['validation'](_0x5d6b57(0x13b)+_0x106bce+_0x5d6b57(0x145)+_0x2f1891[_0x5d6b57(0x137)](_0x47e103=>_0x5d6b57(0x156)+_0x47e103)[_0x5d6b57(0x134)]('\x0a'));return _0x2f1891[0x0];}async function moveToTrash(_0x1a5f10,_0x1d0617,_0x247753){const _0xe5067b=a33_0x1b4693,_0x350f93=new Date()[_0xe5067b(0x12a)]()['replace'](/[:.]/g,'-'),_0x4b1e57=relative(_0x1a5f10,_0x247753),_0x2ef572=join(_0x1d0617,_0x350f93,_0x4b1e57);return await mkdir(dirname(_0x2ef572),{'recursive':!![]}),await rename(_0x247753,_0x2ef572),_0x2ef572;}async function cleanupEmptyDirectories(_0x216d27,_0x1e1e94){const _0x1d1fb9=a33_0x1b4693;let _0x5989e1=resolve(_0x216d27);const _0x36305d=resolve(_0x1e1e94);while(_0x5989e1[_0x1d1fb9(0x151)](''+_0x36305d+sep)||_0x5989e1===_0x36305d){if(_0x5989e1===_0x36305d)return;try{const _0x4bab11=await readdir(_0x5989e1);if(_0x4bab11[_0x1d1fb9(0x15a)]>0x0)return;await rmdir(_0x5989e1);}catch{return;}_0x5989e1=dirname(_0x5989e1);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;function a33_0x331a(_0x2310a4,_0x2586b8){_0x2310a4=_0x2310a4-0x124;const _0x39a6d4=a33_0x39a6();let _0x331a67=_0x39a6d4[_0x2310a4];return _0x331a67;}function a33_0x39a6(){const _0x5b2b81=['appCode','target','toISOString','Lock\x20scope\x20for\x20app\x20\x22','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','103168HjuHmA','<timestamp>','bff','validation','44180rvoNuw','delete','29076DnGjNN','join','trashDir','lastSync','map','/api/management/library/scripts/delete','9nNmdWP','keys','Multiple\x20functions\x20match\x20\x22','Deleted\x20','8mvJTbb','filter','str','parse','includes','projectRoot','apps','\x20(local\x20file\x20moved\x20to\x20trash)','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','Local\x20delete\x20not\x20settled\x20for\x20','scriptsRoot','functions','BFF\x20lock\x20file\x20not\x20found.','Function\x20not\x20found:\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','stringify','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','\x22\x20not\x20found\x20after\x20ensureLockScope.','32356dDTUhp','508iPoWCf','startsWith','435390acYLNt','split','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','scriptsRootDir','\x20\x20-\x20','string','lockFilePath','18JyDowN','length','1443jDwYxl','336616JRmrLz','737bmxGKO','Would\x20delete\x20','remoteId'];a33_0x39a6=function(){return _0x5b2b81;};return a33_0x39a6();}async function waitForDeleteSettlement(_0x1c4af0,_0x454d51,_0xa08a50,_0x4cc725){const _0x4f5c63=a33_0x1b4693;for(let _0x45762d=0x0;_0x45762d<DELETE_SETTLE_RETRY_COUNT;_0x45762d+=0x1){const _0x117859=await readBffLockFile(_0x1c4af0),_0x26aa53=!!_0x117859?.[_0x4f5c63(0x143)]?.[_0x454d51]?.['functions']?.[_0xa08a50],_0xdf3908=await fileExists(_0x4cc725);if(!_0x26aa53&&!_0xdf3908)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x4f5c63(0x146)+_0xa08a50+'.');}
1
+ const a33_0x117032=a33_0x518d;(function(_0x147c4b,_0x320eb1){const _0x5a1d19=a33_0x518d,_0x1a8aa0=_0x147c4b();while(!![]){try{const _0x31725c=-parseInt(_0x5a1d19(0x1ce))/0x1+-parseInt(_0x5a1d19(0x1b9))/0x2+-parseInt(_0x5a1d19(0x1b2))/0x3*(parseInt(_0x5a1d19(0x1c8))/0x4)+parseInt(_0x5a1d19(0x1b8))/0x5+parseInt(_0x5a1d19(0x1d7))/0x6*(-parseInt(_0x5a1d19(0x1c5))/0x7)+-parseInt(_0x5a1d19(0x1d0))/0x8+parseInt(_0x5a1d19(0x1cb))/0x9*(parseInt(_0x5a1d19(0x1d1))/0xa);if(_0x31725c===_0x320eb1)break;else _0x1a8aa0['push'](_0x1a8aa0['shift']());}catch(_0xc56d78){_0x1a8aa0['push'](_0x1a8aa0['shift']());}}}(a33_0xf8ca,0x1c491));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a33_0x518d(_0x62b52,_0x479517){_0x62b52=_0x62b52-0x1a7;const _0xf8caf6=a33_0xf8ca();let _0x518d05=_0xf8caf6[_0x62b52];return _0x518d05;}function a33_0xf8ca(){const _0x300a75=['POST','105453PiOBTO','lockFilePath','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','remoteId','No\x20lock\x20entry\x20found\x20for\x20\x22','filter','922090wnrGca','133178GexqrR','validation','keys','scriptsRootDir','\x20(local\x20file\x20moved\x20to\x20trash)','split','map','delete','target','parse','high-risk-write','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','1608348DxKngA','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','trashedTo','16XwOqUJ','functions','find','63OKVYrI','appCode','Lock\x20scope\x20for\x20app\x20\x22','101143LPkQDc','stringify','1796032KMsjon','991490yTkvrj','scriptsRoot','Multiple\x20functions\x20match\x20\x22','lastSync','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','replace','6SNNckn','trashDir','bff','apps','Function\x20not\x20found:\x20','projectRoot','str','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','toISOString','Local\x20delete\x20not\x20settled\x20for\x20','join','length','\x22\x20not\x20found\x20after\x20ensureLockScope.','startsWith','<timestamp>','BFF\x20lock\x20file\x20not\x20found.','Deleted\x20'];a33_0xf8ca=function(){return _0x300a75;};return a33_0xf8ca();}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a33_0x117032(0x1d9),'command':a33_0x117032(0x1c0),'description':a33_0x117032(0x1a7),'risk':a33_0x117032(0x1c3),'flags':[{'name':'target','type':'string','required':!![],'description':a33_0x117032(0x1c6)}],async 'validate'(_0x46e23e){const _0x46e8de=a33_0x117032,_0x138b31=loadBffProjectConfig(_0x46e23e['appCode']),_0x7b5a70=await readBffLockFile(_0x138b31[_0x46e8de(0x1b3)]);if(!_0x7b5a70)throw CliErrors[_0x46e8de(0x1ba)](_0x46e8de(0x1c4));},async 'dryRun'(_0x19640c){const _0xbfa92=a33_0x117032,_0x104859=loadBffProjectConfig(_0x19640c[_0xbfa92(0x1cc)]),_0x2178a1=await readBffLockFile(_0x104859[_0xbfa92(0x1b3)]);if(!_0x2178a1)throw CliErrors['validation']('BFF\x20lock\x20file\x20not\x20found.');const {appLock:_0x44b797}=ensureLockScope(_0x2178a1,_0x19640c[_0xbfa92(0x1cc)],_0x104859[_0xbfa92(0x1d2)],_0xbfa92(0x1c0)),_0x495d6f=_0x19640c[_0xbfa92(0x1dd)](_0xbfa92(0x1c1)),_0x1be5cc=Object[_0xbfa92(0x1bb)](_0x44b797[_0xbfa92(0x1c9)]),_0x570d1a=resolveDeleteTarget(_0x495d6f,_0x1be5cc),_0x2d6c1b=_0x44b797[_0xbfa92(0x1c9)][_0x570d1a];if(!_0x2d6c1b)throw CliErrors[_0xbfa92(0x1ba)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x570d1a+'\x22.');const _0x1a2f56=resolveLocalFilePathFromLockKey(_0x104859,_0x570d1a),_0xe1efc0=relative(_0x104859['projectRoot'],_0x1a2f56),_0x59fde6=join(_0x104859[_0xbfa92(0x1d8)],_0xbfa92(0x1ae),_0xe1efc0);return{'method':_0xbfa92(0x1b1),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x19640c[_0xbfa92(0x1cc)],'target':_0x570d1a,'remoteId':_0x2d6c1b[_0xbfa92(0x1b5)],'localFilePath':_0x1a2f56,'trashedPath':_0x59fde6},'description':'Would\x20delete\x20'+_0x570d1a+_0xbfa92(0x1d5)};},async 'execute'(_0x16db37){const _0x3afba1=a33_0x117032,_0x5c47f4=loadBffProjectConfig(_0x16db37[_0x3afba1(0x1cc)]),_0x319288=await readBffLockFile(_0x5c47f4[_0x3afba1(0x1b3)]);if(!_0x319288)throw CliErrors[_0x3afba1(0x1ba)](_0x3afba1(0x1af));const {lockData:_0x104158,appLock:_0x1017fd}=ensureLockScope(_0x319288,_0x16db37[_0x3afba1(0x1cc)],_0x5c47f4[_0x3afba1(0x1d2)],'delete'),_0xca51bf=JSON[_0x3afba1(0x1c2)](JSON[_0x3afba1(0x1cf)](_0x104158)),_0x60ab73=_0xca51bf[_0x3afba1(0x1da)][_0x16db37[_0x3afba1(0x1cc)]];if(!_0x60ab73)throw new Error(_0x3afba1(0x1cd)+_0x16db37[_0x3afba1(0x1cc)]+_0x3afba1(0x1ac));const _0x162058=_0x16db37[_0x3afba1(0x1dd)](_0x3afba1(0x1c1)),_0x2756ae=Object[_0x3afba1(0x1bb)](_0x60ab73[_0x3afba1(0x1c9)]),_0x42f7df=resolveDeleteTarget(_0x162058,_0x2756ae),_0x1c0d62=_0x60ab73[_0x3afba1(0x1c9)][_0x42f7df];if(!_0x1c0d62)throw CliErrors[_0x3afba1(0x1ba)](_0x3afba1(0x1b6)+_0x42f7df+'\x22.');await deleteBffScript(_0x1c0d62[_0x3afba1(0x1b5)]),delete _0x60ab73[_0x3afba1(0x1c9)][_0x42f7df],_0x60ab73[_0x3afba1(0x1d4)]=new Date()[_0x3afba1(0x1a8)](),await writeBffLockFile(_0x5c47f4['lockFilePath'],_0xca51bf);const _0x2b5bb7=resolveLocalFilePathFromLockKey(_0x5c47f4,_0x42f7df);let _0x52f10b;await fileExists(_0x2b5bb7)&&(_0x52f10b=await moveToTrash(_0x5c47f4[_0x3afba1(0x1dc)],_0x5c47f4[_0x3afba1(0x1d8)],_0x2b5bb7),await cleanupEmptyDirectories(dirname(_0x2b5bb7),_0x5c47f4[_0x3afba1(0x1bc)]));await waitForDeleteSettlement(_0x5c47f4[_0x3afba1(0x1b3)],_0x16db37[_0x3afba1(0x1cc)],_0x42f7df,_0x2b5bb7),await sleep(0x96);const _0x3069d3={'deleted':_0x42f7df,'remoteId':_0x1c0d62[_0x3afba1(0x1b5)]};if(_0x52f10b)_0x3069d3[_0x3afba1(0x1c7)]=_0x52f10b;return{'ok':!![],'data':_0x3069d3,'message':_0x3afba1(0x1b0)+_0x42f7df+(_0x52f10b?_0x3afba1(0x1bd):'')};}};function resolveDeleteTarget(_0x2ab57c,_0x294253){const _0xaf9265=a33_0x117032;if(_0x2ab57c['includes']('/')){const _0x4df46e=_0x294253[_0xaf9265(0x1ca)](_0xf08381=>_0xf08381===_0x2ab57c);if(!_0x4df46e)throw CliErrors[_0xaf9265(0x1ba)]('Function\x20not\x20found:\x20'+_0x2ab57c);return _0x4df46e;}const _0x2c6b61=_0x294253[_0xaf9265(0x1b7)](_0x2d2aad=>_0x2d2aad[_0xaf9265(0x1be)]('/')['at'](-0x1)===_0x2ab57c);if(_0x2c6b61[_0xaf9265(0x1ab)]===0x0)throw CliErrors[_0xaf9265(0x1ba)](_0xaf9265(0x1db)+_0x2ab57c);if(_0x2c6b61[_0xaf9265(0x1ab)]>0x1)throw CliErrors[_0xaf9265(0x1ba)](_0xaf9265(0x1d3)+_0x2ab57c+_0xaf9265(0x1b4)+_0x2c6b61[_0xaf9265(0x1bf)](_0x233870=>'\x20\x20-\x20'+_0x233870)[_0xaf9265(0x1aa)]('\x0a'));return _0x2c6b61[0x0];}async function moveToTrash(_0x1f19b2,_0x580625,_0x54c173){const _0x84942a=a33_0x117032,_0x198513=new Date()[_0x84942a(0x1a8)]()[_0x84942a(0x1d6)](/[:.]/g,'-'),_0x2d197b=relative(_0x1f19b2,_0x54c173),_0x4d8e8f=join(_0x580625,_0x198513,_0x2d197b);return await mkdir(dirname(_0x4d8e8f),{'recursive':!![]}),await rename(_0x54c173,_0x4d8e8f),_0x4d8e8f;}async function cleanupEmptyDirectories(_0x10bc36,_0x2f8da8){const _0x1d2db6=a33_0x117032;let _0x1423b4=resolve(_0x10bc36);const _0x2a33c5=resolve(_0x2f8da8);while(_0x1423b4[_0x1d2db6(0x1ad)](''+_0x2a33c5+sep)||_0x1423b4===_0x2a33c5){if(_0x1423b4===_0x2a33c5)return;try{const _0x8de6f8=await readdir(_0x1423b4);if(_0x8de6f8[_0x1d2db6(0x1ab)]>0x0)return;await rmdir(_0x1423b4);}catch{return;}_0x1423b4=dirname(_0x1423b4);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x1de081,_0x581efa,_0x414417,_0x277ee8){const _0x3c094c=a33_0x117032;for(let _0x2c4667=0x0;_0x2c4667<DELETE_SETTLE_RETRY_COUNT;_0x2c4667+=0x1){const _0x1e3710=await readBffLockFile(_0x1de081),_0x44a4bd=!!_0x1e3710?.['apps']?.[_0x581efa]?.[_0x3c094c(0x1c9)]?.[_0x414417],_0x50a0cf=await fileExists(_0x277ee8);if(!_0x44a4bd&&!_0x50a0cf)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x3c094c(0x1a9)+_0x414417+'.');}
@@ -1 +1 @@
1
- const a34_0x38f88a=a34_0x1315;(function(_0x10fd9e,_0x4cf473){const _0x3e8db7=a34_0x1315,_0x5793e0=_0x10fd9e();while(!![]){try{const _0xe4c417=parseInt(_0x3e8db7(0x105))/0x1*(-parseInt(_0x3e8db7(0x110))/0x2)+parseInt(_0x3e8db7(0x10d))/0x3*(parseInt(_0x3e8db7(0x109))/0x4)+-parseInt(_0x3e8db7(0x104))/0x5+parseInt(_0x3e8db7(0x111))/0x6+-parseInt(_0x3e8db7(0x10b))/0x7*(parseInt(_0x3e8db7(0xf9))/0x8)+-parseInt(_0x3e8db7(0x101))/0x9*(parseInt(_0x3e8db7(0x10a))/0xa)+-parseInt(_0x3e8db7(0xfd))/0xb*(-parseInt(_0x3e8db7(0x106))/0xc);if(_0xe4c417===_0x4cf473)break;else _0x5793e0['push'](_0x5793e0['shift']());}catch(_0x22cd9e){_0x5793e0['push'](_0x5793e0['shift']());}}}(a34_0x5542,0xd0b82));import{getBffScriptInfo}from'../../core/api-client.js';function a34_0x1315(_0x48d437,_0x1e5f56){_0x48d437=_0x48d437-0xf9;const _0x5542f6=a34_0x5542();let _0x1315da=_0x5542f6[_0x48d437];return _0x1315da;}function a34_0x5542(){const _0x220ffa=['2971461WTfXOC','read','boolean','922TlSkcy','8815464XVbcbn','updatedTime','description','160scNiLr','detail','Script\x20ID','verbose','3439161QwUBZf','scriptContent','num','appCode','9MsqFKP','(none)','createdTime','6014475MeuOkC','3254RjqQTw','108utPNdV','bool','scriptType','4WGMwzX','11487670VsAFkx','198422xWyLMR','Return\x20full\x20raw\x20script\x20object'];a34_0x5542=function(){return _0x220ffa;};return a34_0x5542();}export const bffDetail={'service':'bff','command':a34_0x38f88a(0xfa),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a34_0x38f88a(0x10e),'flags':[{'name':'id','type':'number','required':!![],'description':a34_0x38f88a(0xfb)},{'name':'verbose','type':a34_0x38f88a(0x10f),'description':a34_0x38f88a(0x10c)}],async 'execute'(_0x80241d){const _0x40d238=a34_0x38f88a,_0x34bf86=await getBffScriptInfo(_0x80241d[_0x40d238(0xff)]('id')),_0x393835=_0x80241d[_0x40d238(0x107)](_0x40d238(0xfc));if(_0x393835)return{'ok':!![],'data':_0x34bf86};return{'ok':!![],'data':{'id':_0x34bf86['id'],'appCode':_0x34bf86[_0x40d238(0x100)],'scriptType':_0x34bf86[_0x40d238(0x108)],'description':_0x34bf86[_0x40d238(0x113)]||_0x40d238(0x102),'createdTime':_0x34bf86[_0x40d238(0x103)]??'','updatedTime':_0x34bf86[_0x40d238(0x112)]??'','scriptContent':_0x34bf86[_0x40d238(0xfe)]??''}};}};
1
+ const a34_0x1a9893=a34_0x2de5;(function(_0x3d0c93,_0x158130){const _0x29cade=a34_0x2de5,_0x529f43=_0x3d0c93();while(!![]){try{const _0x46f7c6=-parseInt(_0x29cade(0x1d9))/0x1+-parseInt(_0x29cade(0x1d8))/0x2*(-parseInt(_0x29cade(0x1d5))/0x3)+parseInt(_0x29cade(0x1d1))/0x4*(parseInt(_0x29cade(0x1d4))/0x5)+-parseInt(_0x29cade(0x1cd))/0x6*(-parseInt(_0x29cade(0x1ca))/0x7)+parseInt(_0x29cade(0x1cf))/0x8*(-parseInt(_0x29cade(0x1d2))/0x9)+parseInt(_0x29cade(0x1d6))/0xa*(-parseInt(_0x29cade(0x1ce))/0xb)+parseInt(_0x29cade(0x1d0))/0xc;if(_0x46f7c6===_0x158130)break;else _0x529f43['push'](_0x529f43['shift']());}catch(_0x467e76){_0x529f43['push'](_0x529f43['shift']());}}}(a34_0x275d,0x63eb9));function a34_0x275d(){const _0x108ea0=['updatedTime','6OYIAwV','7707007DnOgwB','1385504GkekPc','5228652eJiyiJ','4mJRylS','9epEYsz','appCode','3570285dopkHB','699bYkQnG','10sauUmf','number','1370YWqiIz','199538riOypE','verbose','(none)','createdTime','Get\x20BFF\x20script\x20details\x20by\x20ID','read','Return\x20full\x20raw\x20script\x20object','scriptContent','detail','scriptType','1212771SxjQSL','boolean'];a34_0x275d=function(){return _0x108ea0;};return a34_0x275d();}function a34_0x2de5(_0x5346df,_0x42f25a){_0x5346df=_0x5346df-0x1c6;const _0x275d4c=a34_0x275d();let _0x2de570=_0x275d4c[_0x5346df];return _0x2de570;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a34_0x1a9893(0x1c8),'description':a34_0x1a9893(0x1dd),'risk':a34_0x1a9893(0x1de),'flags':[{'name':'id','type':a34_0x1a9893(0x1d7),'required':!![],'description':'Script\x20ID'},{'name':a34_0x1a9893(0x1da),'type':a34_0x1a9893(0x1cb),'description':a34_0x1a9893(0x1c6)}],async 'execute'(_0x58e220){const _0x48e2c5=a34_0x1a9893,_0x3bffd6=await getBffScriptInfo(_0x58e220['num']('id')),_0x1b23ee=_0x58e220['bool'](_0x48e2c5(0x1da));if(_0x1b23ee)return{'ok':!![],'data':_0x3bffd6};return{'ok':!![],'data':{'id':_0x3bffd6['id'],'appCode':_0x3bffd6[_0x48e2c5(0x1d3)],'scriptType':_0x3bffd6[_0x48e2c5(0x1c9)],'description':_0x3bffd6['description']||_0x48e2c5(0x1db),'createdTime':_0x3bffd6[_0x48e2c5(0x1dc)]??'','updatedTime':_0x3bffd6[_0x48e2c5(0x1cc)]??'','scriptContent':_0x3bffd6[_0x48e2c5(0x1c7)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x1952d0,_0x249d39){const _0x2837c2=a35_0xa36f,_0x5a2613=_0x1952d0();while(!![]){try{const _0x22c7f9=-parseInt(_0x2837c2(0x189))/0x1*(-parseInt(_0x2837c2(0x18d))/0x2)+parseInt(_0x2837c2(0x18f))/0x3*(-parseInt(_0x2837c2(0x190))/0x4)+parseInt(_0x2837c2(0x18b))/0x5+parseInt(_0x2837c2(0x18e))/0x6+-parseInt(_0x2837c2(0x187))/0x7*(-parseInt(_0x2837c2(0x18c))/0x8)+parseInt(_0x2837c2(0x18a))/0x9+-parseInt(_0x2837c2(0x188))/0xa;if(_0x22c7f9===_0x249d39)break;else _0x5a2613['push'](_0x5a2613['shift']());}catch(_0x4fee18){_0x5a2613['push'](_0x5a2613['shift']());}}}(a35_0x56d9,0xcb4a9));import{bffList}from'../../commands/bff/list.js';function a35_0xa36f(_0x504fd9,_0x4aad44){_0x504fd9=_0x504fd9-0x187;const _0x56d945=a35_0x56d9();let _0xa36f39=_0x56d945[_0x504fd9];return _0xa36f39;}function a35_0x56d9(){const _0x4303f0=['454240UwssWq','248rPbIEn','10zbaznQ','1570032FIvvZa','213yIscNP','31804EwtJAL','334894MsTLbo','9816830HXrSmW','16927wRBvUd','4127652ehzDxb'];a35_0x56d9=function(){return _0x4303f0;};return a35_0x56d9();}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x37498c,_0x5f5c81){const _0x1871b0=a35_0x40d4,_0x174bea=_0x37498c();while(!![]){try{const _0xd684de=parseInt(_0x1871b0(0xed))/0x1+parseInt(_0x1871b0(0xeb))/0x2*(parseInt(_0x1871b0(0xf4))/0x3)+parseInt(_0x1871b0(0xf5))/0x4*(parseInt(_0x1871b0(0xf3))/0x5)+parseInt(_0x1871b0(0xef))/0x6*(parseInt(_0x1871b0(0xec))/0x7)+parseInt(_0x1871b0(0xee))/0x8*(parseInt(_0x1871b0(0xf1))/0x9)+parseInt(_0x1871b0(0xf0))/0xa+-parseInt(_0x1871b0(0xf2))/0xb;if(_0xd684de===_0x5f5c81)break;else _0x174bea['push'](_0x174bea['shift']());}catch(_0x269c62){_0x174bea['push'](_0x174bea['shift']());}}}(a35_0x16ab,0x83d08));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a35_0x16ab(){const _0x13f314=['54sdQUFa','7752140WCuexy','3754116UuDMHt','27917329UEfReF','2415ceWEsB','873849POnfyX','248jLDCMS','2CjouZS','584038JQQrMO','813378xRBITe','8LugzYF'];a35_0x16ab=function(){return _0x13f314;};return a35_0x16ab();}function a35_0x40d4(_0x2cddcd,_0x4e6537){_0x2cddcd=_0x2cddcd-0xeb;const _0x16ab30=a35_0x16ab();let _0x40d414=_0x16ab30[_0x2cddcd];return _0x40d414;}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a36_0x188de4=a36_0x45b0;(function(_0x42a45d,_0x36052c){const _0x5a5cae=a36_0x45b0,_0x379cf4=_0x42a45d();while(!![]){try{const _0x18feba=-parseInt(_0x5a5cae(0x1ae))/0x1+-parseInt(_0x5a5cae(0x1b3))/0x2+parseInt(_0x5a5cae(0x1b2))/0x3*(-parseInt(_0x5a5cae(0x1ad))/0x4)+parseInt(_0x5a5cae(0x1ac))/0x5*(parseInt(_0x5a5cae(0x1a3))/0x6)+-parseInt(_0x5a5cae(0x1b5))/0x7+-parseInt(_0x5a5cae(0x19c))/0x8+parseInt(_0x5a5cae(0x1a9))/0x9*(parseInt(_0x5a5cae(0x1b4))/0xa);if(_0x18feba===_0x36052c)break;else _0x379cf4['push'](_0x379cf4['shift']());}catch(_0x495980){_0x379cf4['push'](_0x379cf4['shift']());}}}(a36_0x156c,0x52823));function a36_0x45b0(_0xba996f,_0x21483a){_0xba996f=_0xba996f-0x19c;const _0x156c0a=a36_0x156c();let _0x45b0d1=_0x156c0a[_0xba996f];return _0x45b0d1;}function a36_0x156c(){const _0x20613f=['scriptType','COMMON','list','bool','6CjmlnV','bff','Filter\x20by\x20script\x20name','string','length','functionName','27TDunUq','description','name','978785ajWSGZ','68yhGnvh','83396jxLPFr','ENDPOINT','No\x20BFF\x20scripts\x20found.','Script\x20type\x20filter','65640tidTal','1169058eDdApJ','6813390fNXeDc','3633581tRoYgc','appCode','boolean','2742808MnBbrz','type','verbose'];a36_0x156c=function(){return _0x20613f;};return a36_0x156c();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a36_0x188de4(0x1a4),'command':a36_0x188de4(0x1a1),'description':'List\x20BFF\x20scripts','risk':'read','flags':[{'name':a36_0x188de4(0x19d),'type':a36_0x188de4(0x1a6),'description':a36_0x188de4(0x1b1),'default':a36_0x188de4(0x1af),'enum':['ENDPOINT',a36_0x188de4(0x1a0)]},{'name':a36_0x188de4(0x1ab),'type':a36_0x188de4(0x1a6),'description':a36_0x188de4(0x1a5)},{'name':a36_0x188de4(0x19e),'type':a36_0x188de4(0x1b7),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x4b3aa6){const _0x149994=a36_0x188de4,_0x1d683d=await listBffScripts(_0x4b3aa6[_0x149994(0x1b6)],_0x4b3aa6['str'](_0x149994(0x19d)),{'scriptName':_0x4b3aa6['str'](_0x149994(0x1ab))||undefined}),_0x35ccc=_0x4b3aa6[_0x149994(0x1a2)](_0x149994(0x19e));return{'ok':!![],'data':_0x35ccc?_0x1d683d:_0x1d683d['map'](_0x34426a=>({'id':_0x34426a['id'],'functionName':_0x34426a[_0x149994(0x1a8)]??'','description':_0x34426a[_0x149994(0x1aa)]||'(unnamed)','scriptType':_0x34426a[_0x149994(0x19f)]})),'message':_0x1d683d[_0x149994(0x1a7)]===0x0?_0x149994(0x1b0):undefined};}};
1
+ const a36_0x136aac=a36_0xed89;(function(_0x478e0d,_0x2010d3){const _0x27886a=a36_0xed89,_0x2d61c9=_0x478e0d();while(!![]){try{const _0x1b9ad6=-parseInt(_0x27886a(0x186))/0x1*(-parseInt(_0x27886a(0x195))/0x2)+-parseInt(_0x27886a(0x18c))/0x3*(-parseInt(_0x27886a(0x196))/0x4)+-parseInt(_0x27886a(0x1a1))/0x5*(-parseInt(_0x27886a(0x18b))/0x6)+parseInt(_0x27886a(0x183))/0x7+parseInt(_0x27886a(0x184))/0x8*(-parseInt(_0x27886a(0x19f))/0x9)+parseInt(_0x27886a(0x199))/0xa*(parseInt(_0x27886a(0x19e))/0xb)+parseInt(_0x27886a(0x18a))/0xc*(-parseInt(_0x27886a(0x18e))/0xd);if(_0x1b9ad6===_0x2010d3)break;else _0x2d61c9['push'](_0x2d61c9['shift']());}catch(_0x3db091){_0x2d61c9['push'](_0x2d61c9['shift']());}}}(a36_0x4cb6,0xe8a90));import{listBffScripts}from'../../core/api-client.js';function a36_0xed89(_0x5548eb,_0x14db4f){_0x5548eb=_0x5548eb-0x183;const _0x4cb6a4=a36_0x4cb6();let _0xed89d7=_0x4cb6a4[_0x5548eb];return _0xed89d7;}function a36_0x4cb6(){const _0x1f0ad9=['description','6342924dUYfwr','30VWlMSG','3433197besBaw','ENDPOINT','39hxKWGZ','appCode','string','COMMON','Filter\x20by\x20script\x20name','read','name','946696rBHlqo','4ktvLDM','functionName','verbose','1940tTfywq','type','bool','(unnamed)','boolean','38489mSSOzY','1017YrpnJM','bff','1015915yDDKWF','map','Script\x20type\x20filter','1467018VYwUWl','103128UDnDQK','list','2ESxqHM','List\x20BFF\x20scripts','str'];a36_0x4cb6=function(){return _0x1f0ad9;};return a36_0x4cb6();}export const bffList={'service':a36_0x136aac(0x1a0),'command':a36_0x136aac(0x185),'description':a36_0x136aac(0x187),'risk':a36_0x136aac(0x193),'flags':[{'name':a36_0x136aac(0x19a),'type':a36_0x136aac(0x190),'description':a36_0x136aac(0x1a3),'default':a36_0x136aac(0x18d),'enum':['ENDPOINT',a36_0x136aac(0x191)]},{'name':a36_0x136aac(0x194),'type':'string','description':a36_0x136aac(0x192)},{'name':'verbose','type':a36_0x136aac(0x19d),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x1506f0){const _0x3e2058=a36_0x136aac,_0x15c368=await listBffScripts(_0x1506f0[_0x3e2058(0x18f)],_0x1506f0[_0x3e2058(0x188)]('type'),{'scriptName':_0x1506f0[_0x3e2058(0x188)](_0x3e2058(0x194))||undefined}),_0x12468b=_0x1506f0[_0x3e2058(0x19b)](_0x3e2058(0x198));return{'ok':!![],'data':_0x12468b?_0x15c368:_0x15c368[_0x3e2058(0x1a2)](_0x4807f9=>({'id':_0x4807f9['id'],'functionName':_0x4807f9[_0x3e2058(0x197)]??'','description':_0x4807f9[_0x3e2058(0x189)]||_0x3e2058(0x19c),'scriptType':_0x4807f9['scriptType']})),'message':_0x15c368['length']===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
@@ -1 +1 @@
1
- function a37_0x1006(_0x422ac3,_0x158ee7){_0x422ac3=_0x422ac3-0x1cc;const _0x3c412d=a37_0x3c41();let _0x100639=_0x3c412d[_0x422ac3];return _0x100639;}const a37_0x409741=a37_0x1006;(function(_0x33e92c,_0x6f15a9){const _0x227554=a37_0x1006,_0x56e7bb=_0x33e92c();while(!![]){try{const _0x526276=-parseInt(_0x227554(0x200))/0x1+-parseInt(_0x227554(0x1fa))/0x2+-parseInt(_0x227554(0x1fe))/0x3+parseInt(_0x227554(0x1d1))/0x4+parseInt(_0x227554(0x20f))/0x5+parseInt(_0x227554(0x1cd))/0x6*(-parseInt(_0x227554(0x1da))/0x7)+-parseInt(_0x227554(0x1e8))/0x8*(-parseInt(_0x227554(0x1e6))/0x9);if(_0x526276===_0x6f15a9)break;else _0x56e7bb['push'](_0x56e7bb['shift']());}catch(_0x1a6180){_0x56e7bb['push'](_0x56e7bb['shift']());}}}(a37_0x3c41,0x72bb3));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0x3c41(){const _0x1c73ec=['unresolvable\x20target\x20path','functions','bool','map','scriptsRoot','COMMON','close','all','write','str','functionName','1449FwXCYS','filePath','44168TvnWvi','nonInteractive','scriptType','lastSync','bff','local\x20unsynced\x20changes','push','lockKey','functionNode','toLowerCase','stringify','trim','scriptContent','skipped','hash','alias','length','string','1307558LWcxwx','\x22\x20not\x20found\x20after\x20ensureLockScope.','version','appCode','335580XnQMSQ','includes','826175MIfHCV','pull','datasetCode','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','question','Lock\x20scope\x20for\x20app\x20\x22','lockFilePath','hookLocation','GET','Remote\x20script\x20missing\x20id.','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','force','operationType','\x20skipped,\x20','\x20failed','1877925DBrpJx','would_pull','30CyMiSo','Pull\x20complete:\x20','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','HOOK','3608808nlCXHV','\x20pulled,\x20','conflict','/api/management/library/scripts/list?appCode=','apiDir','type','stderr','parse','Would\x20inspect\x20','146881HGvQHs'];a37_0x3c41=function(){return _0x1c73ec;};return a37_0x3c41();}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':a37_0x409741(0x1ec),'command':a37_0x409741(0x201),'description':a37_0x409741(0x20a),'risk':a37_0x409741(0x1e3),'flags':[{'name':'type','type':a37_0x409741(0x1f9),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a37_0x409741(0x1e0),'ENDPOINT',a37_0x409741(0x1d0)]},{'name':a37_0x409741(0x20b),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4c8a2a){const _0x1cf54d=a37_0x409741,_0x4b078d=loadBffProjectConfig(_0x4c8a2a['appCode']),_0x51ed7e=await readBffLockFile(_0x4b078d[_0x1cf54d(0x206)]),{appLock:_0x1879fe}=ensureLockScope(_0x51ed7e??createEmptyBffLock(),_0x4c8a2a['appCode'],_0x4b078d[_0x1cf54d(0x1df)],_0x1cf54d(0x201)),_0x529527=normalizeBffType(_0x4c8a2a['str'](_0x1cf54d(0x1d6)))??undefined,_0x576f38=buildDatasetCodeToAliasMap(_0x4c8a2a['apiDir'],_0x4c8a2a[_0x1cf54d(0x1fd)]),[_0x2b995,_0x46684b]=await Promise[_0x1cf54d(0x1e2)]([listBffScripts(_0x4c8a2a[_0x1cf54d(0x1fd)],_0x529527),getBffScriptStatistics(_0x4c8a2a[_0x1cf54d(0x1fd)])]),_0x15325f=createHookLocationMap(_0x46684b),_0x21be27=[];for(const _0x37aa31 of _0x2b995){const _0x174a5a=resolveRemoteScriptTarget(_0x4b078d,_0x37aa31,_0x15325f,_0x1879fe[_0x1cf54d(0x1dc)],_0x576f38);if(!_0x174a5a){_0x21be27[_0x1cf54d(0x1ee)]({'scriptType':_0x37aa31[_0x1cf54d(0x1ea)],'functionName':_0x37aa31[_0x1cf54d(0x1e5)]??'','status':_0x1cf54d(0x1f5),'reason':_0x1cf54d(0x1db)});continue;}const _0x2cb7dc=_0x1879fe['functions'][_0x174a5a[_0x1cf54d(0x1ef)]],_0x264c31=_0x37aa31[_0x1cf54d(0x1f4)]!=null?computeContentHash(_0x37aa31[_0x1cf54d(0x1f4)]):undefined,_0x398dcd=await hasUnsyncedLocalChanges(_0x174a5a[_0x1cf54d(0x1e7)],_0x2cb7dc,_0x264c31);_0x21be27[_0x1cf54d(0x1ee)]({'lockKey':_0x174a5a[_0x1cf54d(0x1ef)],'filePath':_0x174a5a[_0x1cf54d(0x1e7)],'remoteId':_0x37aa31['id']??null,'status':_0x398dcd?_0x1cf54d(0x1d3):_0x1cf54d(0x1cc)});}return{'method':_0x1cf54d(0x208),'url':_0x1cf54d(0x1d4)+_0x4c8a2a[_0x1cf54d(0x1fd)]+(_0x529527?'&type='+_0x529527:''),'body':{'appCode':_0x4c8a2a[_0x1cf54d(0x1fd)],'filterType':_0x529527??null,'files':_0x21be27},'description':_0x1cf54d(0x1d9)+_0x21be27[_0x1cf54d(0x1f8)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0xe018d2){const _0x2d9755=a37_0x409741,_0x58fc54=loadBffProjectConfig(_0xe018d2[_0x2d9755(0x1fd)]),_0x5e5896=await readBffLockFile(_0x58fc54[_0x2d9755(0x206)]),{lockData:_0x32aaed,appLock:_0x36cb5c}=ensureLockScope(_0x5e5896??createEmptyBffLock(),_0xe018d2[_0x2d9755(0x1fd)],_0x58fc54[_0x2d9755(0x1df)],_0x2d9755(0x201)),_0x3f7db2=normalizeBffType(_0xe018d2[_0x2d9755(0x1e4)]('type'))??undefined;if(_0xe018d2[_0x2d9755(0x1e4)](_0x2d9755(0x1d6))&&!_0x3f7db2)throw CliErrors['validation'](_0x2d9755(0x1cf));const [_0x14ef16,_0x2f5f56]=await Promise[_0x2d9755(0x1e2)]([listBffScripts(_0xe018d2[_0x2d9755(0x1fd)],_0x3f7db2),getBffScriptStatistics(_0xe018d2[_0x2d9755(0x1fd)])]);if(_0x14ef16[_0x2d9755(0x1f8)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x3af99c=_0xe018d2[_0x2d9755(0x1dd)](_0x2d9755(0x20b));if(_0x3af99c&&!_0xe018d2[_0x2d9755(0x1e9)]){const _0x132a48=await confirmForce();if(!_0x132a48)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}if(_0x3af99c&&_0xe018d2['nonInteractive']){}const _0x540077=buildDatasetCodeToAliasMap(_0xe018d2[_0x2d9755(0x1d5)],_0xe018d2[_0x2d9755(0x1fd)]),_0xbddbc5=createHookLocationMap(_0x2f5f56),_0x30a08a=JSON[_0x2d9755(0x1d8)](JSON[_0x2d9755(0x1f2)](_0x32aaed)),_0x5ec3ea=_0xe018d2[_0x2d9755(0x1fd)],_0x1ed36c=_0x30a08a['apps'][_0x5ec3ea];if(!_0x1ed36c)throw new Error(_0x2d9755(0x205)+_0x5ec3ea+_0x2d9755(0x1fb));const _0x2bc9dd=[],_0x1e0c36=[],_0x398c3d=[];for(const _0x513f20 of _0x14ef16){const _0xcf398=resolveRemoteScriptTarget(_0x58fc54,_0x513f20,_0xbddbc5,_0x36cb5c['functions'],_0x540077);if(!_0xcf398){_0x1e0c36[_0x2d9755(0x1ee)]({'lockKey':_0x513f20['scriptType']+'/'+_0x513f20[_0x2d9755(0x1e5)],'reason':_0x2d9755(0x1db)});continue;}const _0x5f44a9=_0x36cb5c[_0x2d9755(0x1dc)][_0xcf398[_0x2d9755(0x1ef)]];try{if(!_0x513f20['id'])throw new Error(_0x2d9755(0x209));if(_0x513f20['scriptContent']==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x41adb3=_0x513f20[_0x2d9755(0x1f4)],_0x78fc9e=computeContentHash(_0x41adb3);if(!_0x3af99c){const _0x29af43=await hasUnsyncedLocalChanges(_0xcf398['filePath'],_0x5f44a9,_0x78fc9e);if(_0x29af43){_0x1e0c36['push']({'lockKey':_0xcf398[_0x2d9755(0x1ef)],'reason':_0x2d9755(0x1ed)});continue;}}await ensureParentDirectory(_0xcf398[_0x2d9755(0x1e7)]),await writeFile(_0xcf398[_0x2d9755(0x1e7)],_0x41adb3,'utf8');const _0x1e7118={'hash':_0x78fc9e,'remoteId':_0x513f20['id'],'version':_0x513f20[_0x2d9755(0x1fc)]};_0xcf398[_0x2d9755(0x1d6)]===_0x2d9755(0x1d0)&&_0xcf398[_0x2d9755(0x207)]&&(_0x1e7118[_0x2d9755(0x1f7)]=_0xcf398[_0x2d9755(0x207)][_0x2d9755(0x1f7)],_0x1e7118[_0x2d9755(0x202)]=_0xcf398['hookLocation'][_0x2d9755(0x202)],_0x1e7118[_0x2d9755(0x20c)]=_0xcf398[_0x2d9755(0x207)][_0x2d9755(0x20c)],_0x1e7118[_0x2d9755(0x1f0)]=_0xcf398[_0x2d9755(0x207)][_0x2d9755(0x1f0)]),_0x1ed36c[_0x2d9755(0x1dc)][_0xcf398[_0x2d9755(0x1ef)]]=_0x1e7118,_0x2bc9dd[_0x2d9755(0x1ee)]({'lockKey':_0xcf398[_0x2d9755(0x1ef)],'remoteId':_0x513f20['id']});}catch(_0x8f460a){_0x398c3d[_0x2d9755(0x1ee)]({'lockKey':_0xcf398[_0x2d9755(0x1ef)],'error':_0x8f460a instanceof Error?_0x8f460a['message']:String(_0x8f460a)});}}return _0x1ed36c[_0x2d9755(0x1eb)]=new Date()['toISOString'](),await writeBffLockFile(_0x58fc54['lockFilePath'],_0x30a08a),{'ok':_0x398c3d[_0x2d9755(0x1f8)]===0x0,'data':{'pulled':_0x2bc9dd,'skipped':_0x1e0c36,'failed':_0x398c3d},'message':_0x2d9755(0x1ce)+_0x2bc9dd[_0x2d9755(0x1f8)]+_0x2d9755(0x1d2)+_0x1e0c36[_0x2d9755(0x1f8)]+_0x2d9755(0x20d)+_0x398c3d[_0x2d9755(0x1f8)]+_0x2d9755(0x20e)};}};async function hasUnsyncedLocalChanges(_0x4f88d7,_0x354109,_0x382a42){const _0x3e9187=a37_0x409741;if(!await fileExists(_0x4f88d7))return![];const _0x3cb2a6=await computeFileHash(_0x4f88d7);if(!_0x354109)return _0x382a42?_0x3cb2a6!==_0x382a42:!![];return _0x3cb2a6!==_0x354109[_0x3e9187(0x1f6)];}function buildDatasetCodeToAliasMap(_0x506965,_0x19c4d5){const _0x4b3d47=a37_0x409741,_0x16f7b0=loadAliasMap(_0x506965,undefined,resolveApiFilePath(_0x506965,_0x19c4d5));return new Map(_0x16f7b0[_0x4b3d47(0x1de)](_0x14d6dc=>[_0x14d6dc['datasetCode'],_0x14d6dc[_0x4b3d47(0x1f7)]]));}async function confirmForce(){const _0x48314e=a37_0x409741,_0x4306dd=createInterface({'input':process['stdin'],'output':process[_0x48314e(0x1d7)]}),_0x5f216e=await new Promise(_0x2d9f74=>{const _0x3ee7a9=_0x48314e;_0x4306dd[_0x3ee7a9(0x204)](_0x3ee7a9(0x203),_0x2d9f74);});return _0x4306dd[_0x48314e(0x1e1)](),['y','yes'][_0x48314e(0x1ff)](_0x5f216e[_0x48314e(0x1f3)]()[_0x48314e(0x1f1)]());}
1
+ const a37_0x3eb7e5=a37_0x213b;(function(_0x1a027f,_0x5cf7ed){const _0xd849fd=a37_0x213b,_0x4aedbc=_0x1a027f();while(!![]){try{const _0x23975b=parseInt(_0xd849fd(0x152))/0x1*(-parseInt(_0xd849fd(0x116))/0x2)+-parseInt(_0xd849fd(0x14b))/0x3*(parseInt(_0xd849fd(0x11e))/0x4)+parseInt(_0xd849fd(0x147))/0x5*(-parseInt(_0xd849fd(0x11d))/0x6)+-parseInt(_0xd849fd(0x149))/0x7+parseInt(_0xd849fd(0x120))/0x8+parseInt(_0xd849fd(0x15b))/0x9*(-parseInt(_0xd849fd(0x122))/0xa)+-parseInt(_0xd849fd(0x14c))/0xb*(-parseInt(_0xd849fd(0x118))/0xc);if(_0x23975b===_0x5cf7ed)break;else _0x4aedbc['push'](_0x4aedbc['shift']());}catch(_0x438b0c){_0x4aedbc['push'](_0x4aedbc['shift']());}}}(a37_0x82fc,0x36240));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0x213b(_0x3bd799,_0x3febd1){_0x3bd799=_0x3bd799-0x116;const _0x82fcb9=a37_0x82fc();let _0x213b44=_0x82fcb9[_0x3bd799];return _0x213b44;}function a37_0x82fc(){const _0x31a722=['hookLocation','16655fzxVta','functionNode','2037063AmaHXO','lockKey','17763pqlyeg','165fbyIoo','unresolvable\x20target\x20path','operationType','trim','string','toISOString','8525bIsemP','HOOK','\x20pulled,\x20','version','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','&type=','includes','functions','28467SqeUYK','all','str','toLowerCase','alias','90LpKQaa','appCode','1223760gvIRJR','Force\x20overwrite\x20local\x20unsynced\x20changes','Would\x20inspect\x20','scriptType','Force\x20pull\x20cancelled.','222NySXfH','176fqlMXG','GET','711248nFFgtx','ENDPOINT','1070gEYdLd','COMMON','pull','filePath','bff','apiDir','Pull\x20only\x20this\x20script\x20type','\x22\x20not\x20found\x20after\x20ensureLockScope.','Pull\x20complete:\x20','parse','validation','stringify','yes','Remote\x20script\x20missing\x20id.','functionName','push','close','Remote\x20script\x20missing\x20content.','scriptsRoot','stderr','Lock\x20scope\x20for\x20app\x20\x22','conflict','length','scriptContent','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','stdin','force','datasetCode','skipped','question','lockFilePath','local\x20unsynced\x20changes','nonInteractive','lastSync','type','would_pull'];a37_0x82fc=function(){return _0x31a722;};return a37_0x82fc();}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':a37_0x3eb7e5(0x126),'command':a37_0x3eb7e5(0x124),'description':a37_0x3eb7e5(0x156),'risk':'write','flags':[{'name':a37_0x3eb7e5(0x144),'type':a37_0x3eb7e5(0x150),'description':a37_0x3eb7e5(0x128),'enum':[a37_0x3eb7e5(0x123),a37_0x3eb7e5(0x121),a37_0x3eb7e5(0x153)]},{'name':a37_0x3eb7e5(0x13c),'type':'boolean','description':a37_0x3eb7e5(0x119)}],async 'dryRun'(_0xd45c8){const _0x3a4506=a37_0x3eb7e5,_0x15451c=loadBffProjectConfig(_0xd45c8[_0x3a4506(0x117)]),_0x221b50=await readBffLockFile(_0x15451c[_0x3a4506(0x140)]),{appLock:_0x187d8e}=ensureLockScope(_0x221b50??createEmptyBffLock(),_0xd45c8[_0x3a4506(0x117)],_0x15451c[_0x3a4506(0x134)],_0x3a4506(0x124)),_0x355c08=normalizeBffType(_0xd45c8['str']('type'))??undefined,_0x549772=buildDatasetCodeToAliasMap(_0xd45c8['apiDir'],_0xd45c8[_0x3a4506(0x117)]),[_0x54818b,_0x57c849]=await Promise[_0x3a4506(0x15c)]([listBffScripts(_0xd45c8['appCode'],_0x355c08),getBffScriptStatistics(_0xd45c8[_0x3a4506(0x117)])]),_0x23750a=createHookLocationMap(_0x57c849),_0x2d2423=[];for(const _0x249ec6 of _0x54818b){const _0x4f1773=resolveRemoteScriptTarget(_0x15451c,_0x249ec6,_0x23750a,_0x187d8e[_0x3a4506(0x15a)],_0x549772);if(!_0x4f1773){_0x2d2423[_0x3a4506(0x131)]({'scriptType':_0x249ec6[_0x3a4506(0x11b)],'functionName':_0x249ec6['functionName']??'','status':_0x3a4506(0x13e),'reason':_0x3a4506(0x14d)});continue;}const _0x2c5bb2=_0x187d8e[_0x3a4506(0x15a)][_0x4f1773['lockKey']],_0x3d6092=_0x249ec6[_0x3a4506(0x139)]!=null?computeContentHash(_0x249ec6['scriptContent']):undefined,_0x4c42f4=await hasUnsyncedLocalChanges(_0x4f1773['filePath'],_0x2c5bb2,_0x3d6092);_0x2d2423[_0x3a4506(0x131)]({'lockKey':_0x4f1773[_0x3a4506(0x14a)],'filePath':_0x4f1773[_0x3a4506(0x125)],'remoteId':_0x249ec6['id']??null,'status':_0x4c42f4?_0x3a4506(0x137):_0x3a4506(0x145)});}return{'method':_0x3a4506(0x11f),'url':'/api/management/library/scripts/list?appCode='+_0xd45c8[_0x3a4506(0x117)]+(_0x355c08?_0x3a4506(0x158)+_0x355c08:''),'body':{'appCode':_0xd45c8[_0x3a4506(0x117)],'filterType':_0x355c08??null,'files':_0x2d2423},'description':_0x3a4506(0x11a)+_0x2d2423[_0x3a4506(0x138)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x26e8b8){const _0x146399=a37_0x3eb7e5,_0x1820f7=loadBffProjectConfig(_0x26e8b8['appCode']),_0x587216=await readBffLockFile(_0x1820f7['lockFilePath']),{lockData:_0xbd6313,appLock:_0x4738bd}=ensureLockScope(_0x587216??createEmptyBffLock(),_0x26e8b8[_0x146399(0x117)],_0x1820f7['scriptsRoot'],_0x146399(0x124)),_0x171860=normalizeBffType(_0x26e8b8[_0x146399(0x15d)](_0x146399(0x144)))??undefined;if(_0x26e8b8[_0x146399(0x15d)](_0x146399(0x144))&&!_0x171860)throw CliErrors[_0x146399(0x12c)](_0x146399(0x157));const [_0x57d4b6,_0x185567]=await Promise[_0x146399(0x15c)]([listBffScripts(_0x26e8b8[_0x146399(0x117)],_0x171860),getBffScriptStatistics(_0x26e8b8[_0x146399(0x117)])]);if(_0x57d4b6[_0x146399(0x138)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20BFF\x20scripts\x20found.'};const _0x59abb8=_0x26e8b8['bool'](_0x146399(0x13c));if(_0x59abb8&&!_0x26e8b8[_0x146399(0x142)]){const _0x2b17e3=await confirmForce();if(!_0x2b17e3)throw CliErrors['cancelled'](_0x146399(0x11c));}if(_0x59abb8&&_0x26e8b8[_0x146399(0x142)]){}const _0x2edc11=buildDatasetCodeToAliasMap(_0x26e8b8[_0x146399(0x127)],_0x26e8b8[_0x146399(0x117)]),_0xd78bba=createHookLocationMap(_0x185567),_0x1a7348=JSON[_0x146399(0x12b)](JSON[_0x146399(0x12d)](_0xbd6313)),_0x396bf4=_0x26e8b8[_0x146399(0x117)],_0x48467d=_0x1a7348['apps'][_0x396bf4];if(!_0x48467d)throw new Error(_0x146399(0x136)+_0x396bf4+_0x146399(0x129));const _0x5af8dc=[],_0x52cb0c=[],_0x515946=[];for(const _0x4f547c of _0x57d4b6){const _0x4020ae=resolveRemoteScriptTarget(_0x1820f7,_0x4f547c,_0xd78bba,_0x4738bd['functions'],_0x2edc11);if(!_0x4020ae){_0x52cb0c['push']({'lockKey':_0x4f547c[_0x146399(0x11b)]+'/'+_0x4f547c[_0x146399(0x130)],'reason':_0x146399(0x14d)});continue;}const _0x265c7c=_0x4738bd[_0x146399(0x15a)][_0x4020ae[_0x146399(0x14a)]];try{if(!_0x4f547c['id'])throw new Error(_0x146399(0x12f));if(_0x4f547c['scriptContent']==null)throw new Error(_0x146399(0x133));const _0x23536f=_0x4f547c[_0x146399(0x139)],_0x43196a=computeContentHash(_0x23536f);if(!_0x59abb8){const _0x2c8b54=await hasUnsyncedLocalChanges(_0x4020ae[_0x146399(0x125)],_0x265c7c,_0x43196a);if(_0x2c8b54){_0x52cb0c[_0x146399(0x131)]({'lockKey':_0x4020ae['lockKey'],'reason':_0x146399(0x141)});continue;}}await ensureParentDirectory(_0x4020ae[_0x146399(0x125)]),await writeFile(_0x4020ae[_0x146399(0x125)],_0x23536f,'utf8');const _0x46e93e={'hash':_0x43196a,'remoteId':_0x4f547c['id'],'version':_0x4f547c[_0x146399(0x155)]};_0x4020ae[_0x146399(0x144)]===_0x146399(0x153)&&_0x4020ae[_0x146399(0x146)]&&(_0x46e93e[_0x146399(0x15f)]=_0x4020ae[_0x146399(0x146)]['alias'],_0x46e93e[_0x146399(0x13d)]=_0x4020ae[_0x146399(0x146)][_0x146399(0x13d)],_0x46e93e[_0x146399(0x14e)]=_0x4020ae[_0x146399(0x146)][_0x146399(0x14e)],_0x46e93e['functionNode']=_0x4020ae[_0x146399(0x146)][_0x146399(0x148)]),_0x48467d[_0x146399(0x15a)][_0x4020ae['lockKey']]=_0x46e93e,_0x5af8dc[_0x146399(0x131)]({'lockKey':_0x4020ae[_0x146399(0x14a)],'remoteId':_0x4f547c['id']});}catch(_0x54f13f){_0x515946['push']({'lockKey':_0x4020ae[_0x146399(0x14a)],'error':_0x54f13f instanceof Error?_0x54f13f['message']:String(_0x54f13f)});}}return _0x48467d[_0x146399(0x143)]=new Date()[_0x146399(0x151)](),await writeBffLockFile(_0x1820f7[_0x146399(0x140)],_0x1a7348),{'ok':_0x515946[_0x146399(0x138)]===0x0,'data':{'pulled':_0x5af8dc,'skipped':_0x52cb0c,'failed':_0x515946},'message':_0x146399(0x12a)+_0x5af8dc[_0x146399(0x138)]+_0x146399(0x154)+_0x52cb0c[_0x146399(0x138)]+'\x20skipped,\x20'+_0x515946[_0x146399(0x138)]+'\x20failed'};}};async function hasUnsyncedLocalChanges(_0x418aa1,_0x5a7b7b,_0x2de6f7){if(!await fileExists(_0x418aa1))return![];const _0x1a586a=await computeFileHash(_0x418aa1);if(!_0x5a7b7b)return _0x2de6f7?_0x1a586a!==_0x2de6f7:!![];return _0x1a586a!==_0x5a7b7b['hash'];}function buildDatasetCodeToAliasMap(_0x2855fb,_0x55a4d1){const _0x579077=a37_0x3eb7e5,_0x127b8b=loadAliasMap(_0x2855fb,undefined,resolveApiFilePath(_0x2855fb,_0x55a4d1));return new Map(_0x127b8b['map'](_0x27d906=>[_0x27d906[_0x579077(0x13d)],_0x27d906[_0x579077(0x15f)]]));}async function confirmForce(){const _0x3cd5ae=a37_0x3eb7e5,_0xdb9fcb=createInterface({'input':process[_0x3cd5ae(0x13b)],'output':process[_0x3cd5ae(0x135)]}),_0x3dc0ce=await new Promise(_0xf07b8a=>{const _0x778fa3=_0x3cd5ae;_0xdb9fcb[_0x778fa3(0x13f)](_0x778fa3(0x13a),_0xf07b8a);});return _0xdb9fcb[_0x3cd5ae(0x132)](),['y',_0x3cd5ae(0x12e)][_0x3cd5ae(0x159)](_0x3dc0ce[_0x3cd5ae(0x14f)]()[_0x3cd5ae(0x15e)]());}
@@ -1 +1 @@
1
- const a38_0x5f374a=a38_0x438f;(function(_0x3a5e2e,_0x585e10){const _0x3b1c32=a38_0x438f,_0x28ffa9=_0x3a5e2e();while(!![]){try{const _0x36cca6=parseInt(_0x3b1c32(0x12b))/0x1*(parseInt(_0x3b1c32(0x15c))/0x2)+parseInt(_0x3b1c32(0x134))/0x3+parseInt(_0x3b1c32(0x14a))/0x4+-parseInt(_0x3b1c32(0x16c))/0x5+parseInt(_0x3b1c32(0x12f))/0x6+-parseInt(_0x3b1c32(0x133))/0x7*(-parseInt(_0x3b1c32(0x15b))/0x8)+-parseInt(_0x3b1c32(0x16d))/0x9;if(_0x36cca6===_0x585e10)break;else _0x28ffa9['push'](_0x28ffa9['shift']());}catch(_0x3cc1d6){_0x28ffa9['push'](_0x28ffa9['shift']());}}}(a38_0x4e7e,0x635d3));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a38_0x4e7e(){const _0x5845e4=['operationType','1747664jMjssn','attempted','utf8','stringify','Runtime\x20script\x20cache\x20cleared.','scriptsRoot','bool','cleared','has','apiDir','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','runtime\x20cache\x20clear\x20failed','string','boolean','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','high-risk-write','lockKey','72656XBcKnM','126PYWblm','\x22\x20not\x20found\x20after\x20ensureLockScope.','map','aliasToDatasetCode','filePath','remoteId','functionNode','Push\x20complete:\x20','appCode','unchanged','Push\x20local\x20BFF\x20scripts\x20to\x20remote','values','lastSync','bff','set','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','1209240KIEAYU','15568092BaPPcG','\x20skipped,\x20','length','POST','message','some','ENDPOINT','status','join','Would\x20inspect\x20','Incomplete\x20HOOK\x20path:\x20','apps','get','\x22.\x20','version','validation','Run\x20`','10549UBuOuK','COMMON','every',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','1031712YVsnvy','type','parse','datasetCodeToDataset','427gbJWBz','1653522aQFqeL','toISOString','functions','str','name','push','/api/management/library/scripts/save','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','lockFilePath','would_push','No\x20local\x20BFF\x20functions\x20found.','hash','alias','Force\x20push\x20ignoring\x20hash\x20protection','datasetCode','\x20uploaded,\x20','force','create','Cannot\x20resolve\x20dataset\x20for\x20\x22','HOOK','Local\x20function\x20not\x20found:\x20'];a38_0x4e7e=function(){return _0x5845e4;};return a38_0x4e7e();}import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a38_0x5f374a(0x169),'command':a38_0x5f374a(0x139),'description':a38_0x5f374a(0x166),'risk':a38_0x5f374a(0x159),'flags':[{'name':a38_0x5f374a(0x130),'type':a38_0x5f374a(0x156),'description':'Push\x20only\x20this\x20script\x20type','enum':[a38_0x5f374a(0x12c),a38_0x5f374a(0x120),a38_0x5f374a(0x147)]},{'name':'name','type':a38_0x5f374a(0x156),'description':a38_0x5f374a(0x158)},{'name':a38_0x5f374a(0x144),'type':a38_0x5f374a(0x157),'description':a38_0x5f374a(0x141)}],async 'dryRun'(_0x3e2b93){const _0x49ba1e=a38_0x5f374a,_0x49fa79=loadBffProjectConfig(_0x3e2b93[_0x49ba1e(0x164)]),_0x482734=await readBffLockFile(_0x49fa79[_0x49ba1e(0x13c)]),{appLock:_0x1b6be3}=ensureLockScope(_0x482734??createEmptyBffLock(),_0x3e2b93[_0x49ba1e(0x164)],_0x49fa79['scriptsRoot'],'push'),_0xed8f6b=await getTargetFunctions(_0x49fa79,_0x3e2b93),_0x3a8c3f=_0x3e2b93[_0x49ba1e(0x150)]('force'),_0x53941a=[];for(const _0x46093a of _0xed8f6b){const _0x52c74f=await computeFileHash(_0x46093a['filePath']),_0x26acf1=_0x1b6be3[_0x49ba1e(0x136)][_0x46093a[_0x49ba1e(0x15a)]],_0x3e7b2d=!!_0x26acf1&&_0x26acf1[_0x49ba1e(0x13f)]===_0x52c74f;_0x53941a[_0x49ba1e(0x139)]({'lockKey':_0x46093a[_0x49ba1e(0x15a)],'filePath':_0x46093a[_0x49ba1e(0x160)],'remoteId':_0x26acf1?.[_0x49ba1e(0x161)]??null,'mode':_0x26acf1?.[_0x49ba1e(0x161)]?'update':_0x49ba1e(0x145),'status':!_0x3a8c3f&&_0x3e7b2d?'unchanged':_0x49ba1e(0x13d)});}return{'method':_0x49ba1e(0x170),'url':_0x49ba1e(0x13a),'body':{'appCode':_0x3e2b93[_0x49ba1e(0x164)],'force':_0x3a8c3f,'files':_0x53941a,'cacheClearAtRuntime':_0x53941a['some'](_0x32e76b=>_0x32e76b[_0x49ba1e(0x121)]==='would_push'),'cacheClearAtRuntimeTimes':_0x53941a[_0x49ba1e(0x172)](_0x408dc5=>_0x408dc5[_0x49ba1e(0x121)]===_0x49ba1e(0x13d))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x49ba1e(0x123)+_0x53941a[_0x49ba1e(0x16f)]+_0x49ba1e(0x154)};},async 'execute'(_0x531dfa){const _0x5bcf96=a38_0x5f374a,_0x23f6af=loadBffProjectConfig(_0x531dfa['appCode']),_0x16a90e=await readBffLockFile(_0x23f6af[_0x5bcf96(0x13c)]),{lockData:_0x2f5829,appLock:_0x594b3f}=ensureLockScope(_0x16a90e??createEmptyBffLock(),_0x531dfa[_0x5bcf96(0x164)],_0x23f6af[_0x5bcf96(0x14f)],_0x5bcf96(0x139)),_0x587904=await getTargetFunctions(_0x23f6af,_0x531dfa);if(_0x587904[_0x5bcf96(0x16f)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x5bcf96(0x13e)};const _0x4c13be=_0x531dfa[_0x5bcf96(0x150)]('force'),_0x56cf41=JSON[_0x5bcf96(0x131)](JSON[_0x5bcf96(0x14d)](_0x2f5829)),_0x3bf00f=_0x56cf41[_0x5bcf96(0x125)][_0x531dfa[_0x5bcf96(0x164)]];if(!_0x3bf00f)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x531dfa['appCode']+_0x5bcf96(0x15d));const _0x25e4de=await buildHookMaps(_0x531dfa[_0x5bcf96(0x164)],_0x531dfa[_0x5bcf96(0x153)],_0x587904,_0x3bf00f),_0x22632d=[],_0x8a49d3=[],_0x38cc15=[];for(const _0x23210d of _0x587904){const _0x5c40e3=await computeFileHash(_0x23210d[_0x5bcf96(0x160)]),_0x2384fd=_0x3bf00f[_0x5bcf96(0x136)][_0x23210d['lockKey']];if(!_0x4c13be&&_0x2384fd&&_0x2384fd[_0x5bcf96(0x13f)]===_0x5c40e3){_0x8a49d3[_0x5bcf96(0x139)]({'lockKey':_0x23210d[_0x5bcf96(0x15a)],'reason':_0x5bcf96(0x165)});continue;}try{await uploadSingleFunction(_0x531dfa[_0x5bcf96(0x164)],_0x23210d,_0x3bf00f,_0x25e4de);const _0x135784=_0x3bf00f[_0x5bcf96(0x136)][_0x23210d[_0x5bcf96(0x15a)]];_0x22632d[_0x5bcf96(0x139)]({'lockKey':_0x23210d[_0x5bcf96(0x15a)],'remoteId':_0x135784?.[_0x5bcf96(0x161)]??0x0});}catch(_0x4cd64a){_0x38cc15[_0x5bcf96(0x139)]({'lockKey':_0x23210d['lockKey'],'error':_0x4cd64a instanceof Error?_0x4cd64a[_0x5bcf96(0x171)]:String(_0x4cd64a)});}}_0x3bf00f[_0x5bcf96(0x168)]=new Date()[_0x5bcf96(0x135)](),await writeBffLockFile(_0x23f6af[_0x5bcf96(0x13c)],_0x56cf41),await waitForUploadedLockEntries(_0x23f6af[_0x5bcf96(0x13c)],_0x531dfa[_0x5bcf96(0x164)],_0x22632d[_0x5bcf96(0x15e)](_0x87b793=>_0x87b793[_0x5bcf96(0x15a)]));let _0x29d9a1={'attempted':![],'cleared':![]};if(_0x22632d[_0x5bcf96(0x16f)]>0x0)try{let _0x3946c6='';for(let _0x4c4549=0x0;_0x4c4549<CACHE_CLEAR_ATTEMPTS;_0x4c4549+=0x1){_0x3946c6=await clearBffScriptCache(),_0x4c4549<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x29d9a1={'attempted':!![],'cleared':!![],'message':_0x3946c6||_0x5bcf96(0x14e)};}catch(_0x51c72a){_0x29d9a1={'attempted':!![],'cleared':![],'error':_0x51c72a instanceof Error?_0x51c72a[_0x5bcf96(0x171)]:String(_0x51c72a)};}const _0x43fe8f=_0x38cc15[_0x5bcf96(0x16f)]===0x0&&(_0x29d9a1[_0x5bcf96(0x14b)]?_0x29d9a1[_0x5bcf96(0x151)]:!![]),_0x2629b3=_0x29d9a1[_0x5bcf96(0x14b)]?_0x29d9a1[_0x5bcf96(0x151)]?'runtime\x20cache\x20cleared':_0x5bcf96(0x155):'runtime\x20cache\x20not\x20needed';return{'ok':_0x43fe8f,'data':{'uploaded':_0x22632d,'skipped':_0x8a49d3,'failed':_0x38cc15,'cacheClear':_0x29d9a1},'message':_0x5bcf96(0x163)+_0x22632d[_0x5bcf96(0x16f)]+_0x5bcf96(0x143)+_0x8a49d3['length']+_0x5bcf96(0x16e)+_0x38cc15['length']+'\x20failed,\x20'+_0x2629b3};}};async function getTargetFunctions(_0x1195f8,_0x10434c){const _0x5615a9=a38_0x5f374a,_0x32722c=_0x10434c[_0x5615a9(0x137)](_0x5615a9(0x130)),_0x46cce4=_0x10434c[_0x5615a9(0x137)](_0x5615a9(0x138)),_0x578046=normalizeBffType(_0x32722c)??undefined;if(_0x46cce4&&!_0x578046)throw CliErrors[_0x5615a9(0x129)](_0x5615a9(0x16b));const _0x29cd38=await scanLocalBffFunctions(_0x1195f8,_0x578046);if(_0x46cce4){const _0xd49fbd=_0x29cd38['filter'](_0x40b750=>_0x40b750['name']===_0x46cce4);if(_0xd49fbd[_0x5615a9(0x16f)]===0x0)throw CliErrors[_0x5615a9(0x129)](_0x5615a9(0x148)+_0x578046+'/'+_0x46cce4);return _0xd49fbd;}return _0x29cd38;}async function buildHookMaps(_0x394118,_0x380182,_0x55c403,_0x4912ab){const _0x1a961d=a38_0x5f374a,_0xa394d3=_0x55c403[_0x1a961d(0x172)](_0x111d06=>_0x111d06[_0x1a961d(0x130)]==='HOOK');if(!_0xa394d3)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x7d26af=loadAliasMap(_0x380182,undefined,resolveApiFilePath(_0x380182,_0x394118)),_0x86b97a=new Map(_0x7d26af[_0x1a961d(0x15e)](_0xbbe82c=>[_0xbbe82c[_0x1a961d(0x140)],_0xbbe82c[_0x1a961d(0x142)]]));for(const _0x5ecd02 of Object[_0x1a961d(0x167)](_0x4912ab[_0x1a961d(0x136)])){_0x5ecd02[_0x1a961d(0x140)]&&_0x5ecd02[_0x1a961d(0x142)]&&!_0x86b97a[_0x1a961d(0x152)](_0x5ecd02[_0x1a961d(0x140)])&&_0x86b97a[_0x1a961d(0x16a)](_0x5ecd02[_0x1a961d(0x140)],_0x5ecd02[_0x1a961d(0x142)]);}const _0x44bbe6=await listDatasets(_0x394118),_0x4f5ff1=new Map(_0x44bbe6[_0x1a961d(0x15e)](_0x284b9d=>[_0x284b9d['code'],_0x284b9d]));return{'aliasToDatasetCode':_0x86b97a,'datasetCodeToDataset':_0x4f5ff1};}function a38_0x438f(_0x3cbf36,_0x3fd5eb){_0x3cbf36=_0x3cbf36-0x120;const _0x4e7e5b=a38_0x4e7e();let _0x438f1c=_0x4e7e5b[_0x3cbf36];return _0x438f1c;}async function uploadSingleFunction(_0x18c9e8,_0x14125e,_0x79e2f0,_0x5c5e6a){const _0x739aad=a38_0x5f374a,_0x187343=await readFile(_0x14125e['filePath'],_0x739aad(0x14c)),_0x2eea30=await computeFileHash(_0x14125e[_0x739aad(0x160)]),_0x4138d1=_0x79e2f0[_0x739aad(0x136)][_0x14125e['lockKey']];if(_0x4138d1?.[_0x739aad(0x161)]&&_0x4138d1[_0x739aad(0x128)]==null)throw CliErrors[_0x739aad(0x129)](_0x14125e[_0x739aad(0x15a)]+_0x739aad(0x12e));let _0xd17231=extractScriptDescription(_0x187343);if(!_0xd17231&&_0x4138d1?.[_0x739aad(0x161)]){const _0x1992fd=await getBffScriptInfo(_0x4138d1[_0x739aad(0x161)]);_0xd17231=_0x1992fd['description']||undefined;}const _0x46d806={'appCode':_0x18c9e8,'functionName':_0x14125e[_0x739aad(0x138)],'scriptType':_0x14125e[_0x739aad(0x130)],'scriptContent':_0x187343};if(_0x4138d1?.[_0x739aad(0x161)])_0x46d806['id']=_0x4138d1[_0x739aad(0x161)];if(_0x4138d1?.[_0x739aad(0x128)]!=null)_0x46d806[_0x739aad(0x128)]=_0x4138d1[_0x739aad(0x128)];if(_0xd17231)_0x46d806['description']=_0xd17231;if(_0x14125e[_0x739aad(0x130)]==='HOOK'){const _0x5d8d3d=_0x14125e[_0x739aad(0x140)];if(!_0x5d8d3d||!_0x14125e[_0x739aad(0x149)]||!_0x14125e[_0x739aad(0x162)])throw CliErrors['validation'](_0x739aad(0x124)+_0x14125e[_0x739aad(0x15a)]);const _0x15c93e=_0x5c5e6a[_0x739aad(0x15f)][_0x739aad(0x126)](_0x5d8d3d)??_0x4138d1?.[_0x739aad(0x142)]??_0x5d8d3d,_0x4e671d=_0x5c5e6a[_0x739aad(0x132)][_0x739aad(0x126)](_0x15c93e);if(!_0x4e671d)throw CliErrors[_0x739aad(0x129)](_0x739aad(0x146)+_0x5d8d3d+_0x739aad(0x127)+(_0x739aad(0x12a)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x46d806['datasetId']=_0x4e671d['id'],_0x46d806[_0x739aad(0x149)]=_0x14125e[_0x739aad(0x149)],_0x46d806[_0x739aad(0x162)]=_0x14125e[_0x739aad(0x162)];}const _0x1c6650=await saveBffScript(_0x46d806),_0x27379d=_0x1c6650['id'],_0x344f99=_0x1c6650['script']??await getBffScriptInfo(_0x27379d),_0x2a4201={'hash':_0x2eea30,'remoteId':_0x27379d,'version':_0x344f99['version']};if(_0x14125e['type']===_0x739aad(0x147)){const _0x59b22c=_0x14125e[_0x739aad(0x140)],_0x1dd012=_0x5c5e6a[_0x739aad(0x15f)][_0x739aad(0x126)](_0x59b22c)??_0x4138d1?.[_0x739aad(0x142)]??_0x59b22c;_0x5c5e6a['aliasToDatasetCode'][_0x739aad(0x152)](_0x59b22c)?_0x2a4201[_0x739aad(0x140)]=_0x59b22c:_0x2a4201[_0x739aad(0x140)]=_0x4138d1?.[_0x739aad(0x140)],_0x2a4201[_0x739aad(0x142)]=_0x1dd012,_0x2a4201[_0x739aad(0x149)]=_0x14125e['operationType'],_0x2a4201[_0x739aad(0x162)]=_0x14125e[_0x739aad(0x162)];}_0x79e2f0['functions'][_0x14125e['lockKey']]=_0x2a4201;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x59e1c6,_0x27b962,_0x21c9c9){const _0x2e8f1b=a38_0x5f374a;if(_0x21c9c9['length']===0x0)return;for(let _0xac6123=0x0;_0xac6123<LOCK_SETTLE_RETRY_COUNT;_0xac6123+=0x1){const _0x4db85b=await readBffLockFile(_0x59e1c6),_0x15aafc=_0x4db85b?.['apps']?.[_0x27b962]?.['functions']??{},_0x3af8e8=_0x21c9c9[_0x2e8f1b(0x12d)](_0x457beb=>!!_0x15aafc[_0x457beb]?.[_0x2e8f1b(0x161)]);if(_0x3af8e8)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x2e8f1b(0x13b)+_0x21c9c9[_0x2e8f1b(0x122)](',\x20')+'.');}
1
+ const a38_0x19262c=a38_0x44da;(function(_0x1790d5,_0x59f97c){const _0x30ddff=a38_0x44da,_0x2301b0=_0x1790d5();while(!![]){try{const _0x47e42c=parseInt(_0x30ddff(0xa6))/0x1*(-parseInt(_0x30ddff(0xc3))/0x2)+parseInt(_0x30ddff(0x85))/0x3*(-parseInt(_0x30ddff(0xab))/0x4)+-parseInt(_0x30ddff(0x8b))/0x5+-parseInt(_0x30ddff(0x9c))/0x6+-parseInt(_0x30ddff(0xce))/0x7+-parseInt(_0x30ddff(0xd2))/0x8+parseInt(_0x30ddff(0xd7))/0x9;if(_0x47e42c===_0x59f97c)break;else _0x2301b0['push'](_0x2301b0['shift']());}catch(_0x26d089){_0x2301b0['push'](_0x2301b0['shift']());}}}(a38_0x4b2c,0x87f26));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a38_0x19262c(0xd5),'risk':a38_0x19262c(0xc0),'flags':[{'name':a38_0x19262c(0x9e),'type':a38_0x19262c(0xca),'description':a38_0x19262c(0xc1),'enum':['COMMON',a38_0x19262c(0x8e),a38_0x19262c(0x87)]},{'name':'name','type':a38_0x19262c(0xca),'description':a38_0x19262c(0xcb)},{'name':a38_0x19262c(0xb9),'type':a38_0x19262c(0xa5),'description':a38_0x19262c(0xbb)}],async 'dryRun'(_0x551cc6){const _0x56f547=a38_0x19262c,_0x3aaa07=loadBffProjectConfig(_0x551cc6[_0x56f547(0x9d)]),_0x5eb237=await readBffLockFile(_0x3aaa07[_0x56f547(0x89)]),{appLock:_0x30850e}=ensureLockScope(_0x5eb237??createEmptyBffLock(),_0x551cc6[_0x56f547(0x9d)],_0x3aaa07[_0x56f547(0xc9)],_0x56f547(0xd3)),_0x143941=await getTargetFunctions(_0x3aaa07,_0x551cc6),_0x15a03b=_0x551cc6[_0x56f547(0x95)](_0x56f547(0xb9)),_0x334a55=[];for(const _0x16d98b of _0x143941){const _0x599612=await computeFileHash(_0x16d98b[_0x56f547(0xd1)]),_0x553927=_0x30850e[_0x56f547(0xaf)][_0x16d98b['lockKey']],_0x1e3caa=!!_0x553927&&_0x553927[_0x56f547(0xd0)]===_0x599612;_0x334a55['push']({'lockKey':_0x16d98b[_0x56f547(0x98)],'filePath':_0x16d98b[_0x56f547(0xd1)],'remoteId':_0x553927?.['remoteId']??null,'mode':_0x553927?.[_0x56f547(0xac)]?_0x56f547(0xcd):_0x56f547(0x88),'status':!_0x15a03b&&_0x1e3caa?_0x56f547(0xae):_0x56f547(0xb3)});}return{'method':'POST','url':_0x56f547(0xbd),'body':{'appCode':_0x551cc6['appCode'],'force':_0x15a03b,'files':_0x334a55,'cacheClearAtRuntime':_0x334a55[_0x56f547(0x90)](_0x45635b=>_0x45635b[_0x56f547(0xc5)]===_0x56f547(0xb3)),'cacheClearAtRuntimeTimes':_0x334a55[_0x56f547(0x90)](_0x4adb66=>_0x4adb66[_0x56f547(0xc5)]===_0x56f547(0xb3))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x56f547(0x8d)+_0x334a55['length']+_0x56f547(0xad)};},async 'execute'(_0x4f9b64){const _0xee2aa4=a38_0x19262c,_0x59cc46=loadBffProjectConfig(_0x4f9b64[_0xee2aa4(0x9d)]),_0x56439b=await readBffLockFile(_0x59cc46[_0xee2aa4(0x89)]),{lockData:_0x411b80,appLock:_0x261e51}=ensureLockScope(_0x56439b??createEmptyBffLock(),_0x4f9b64[_0xee2aa4(0x9d)],_0x59cc46[_0xee2aa4(0xc9)],_0xee2aa4(0xd3)),_0x4ea4b1=await getTargetFunctions(_0x59cc46,_0x4f9b64);if(_0x4ea4b1[_0xee2aa4(0x8a)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xee2aa4(0xa4)};const _0x313466=_0x4f9b64[_0xee2aa4(0x95)](_0xee2aa4(0xb9)),_0x29e6b8=JSON['parse'](JSON['stringify'](_0x411b80)),_0x230e65=_0x29e6b8[_0xee2aa4(0x8c)][_0x4f9b64[_0xee2aa4(0x9d)]];if(!_0x230e65)throw new Error(_0xee2aa4(0x86)+_0x4f9b64[_0xee2aa4(0x9d)]+_0xee2aa4(0xb6));const _0x33773d=await buildHookMaps(_0x4f9b64['appCode'],_0x4f9b64[_0xee2aa4(0xa7)],_0x4ea4b1,_0x230e65),_0x526a8d=[],_0x4de666=[],_0x109f36=[];for(const _0x520a8a of _0x4ea4b1){const _0x318ccf=await computeFileHash(_0x520a8a[_0xee2aa4(0xd1)]),_0x219c08=_0x230e65[_0xee2aa4(0xaf)][_0x520a8a[_0xee2aa4(0x98)]];if(!_0x313466&&_0x219c08&&_0x219c08[_0xee2aa4(0xd0)]===_0x318ccf){_0x4de666[_0xee2aa4(0xd3)]({'lockKey':_0x520a8a[_0xee2aa4(0x98)],'reason':_0xee2aa4(0xae)});continue;}try{await uploadSingleFunction(_0x4f9b64[_0xee2aa4(0x9d)],_0x520a8a,_0x230e65,_0x33773d);const _0xbacb7a=_0x230e65[_0xee2aa4(0xaf)][_0x520a8a[_0xee2aa4(0x98)]];_0x526a8d[_0xee2aa4(0xd3)]({'lockKey':_0x520a8a['lockKey'],'remoteId':_0xbacb7a?.[_0xee2aa4(0xac)]??0x0});}catch(_0x427e4e){_0x109f36[_0xee2aa4(0xd3)]({'lockKey':_0x520a8a[_0xee2aa4(0x98)],'error':_0x427e4e instanceof Error?_0x427e4e[_0xee2aa4(0x99)]:String(_0x427e4e)});}}_0x230e65['lastSync']=new Date()[_0xee2aa4(0x91)](),await writeBffLockFile(_0x59cc46[_0xee2aa4(0x89)],_0x29e6b8),await waitForUploadedLockEntries(_0x59cc46[_0xee2aa4(0x89)],_0x4f9b64[_0xee2aa4(0x9d)],_0x526a8d[_0xee2aa4(0xb4)](_0x594083=>_0x594083[_0xee2aa4(0x98)]));let _0x5c1d38={'attempted':![],'cleared':![]};if(_0x526a8d['length']>0x0)try{let _0x6ce719='';for(let _0x5c2827=0x0;_0x5c2827<CACHE_CLEAR_ATTEMPTS;_0x5c2827+=0x1){_0x6ce719=await clearBffScriptCache(),_0x5c2827<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5c1d38={'attempted':!![],'cleared':!![],'message':_0x6ce719||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0xe43e50){_0x5c1d38={'attempted':!![],'cleared':![],'error':_0xe43e50 instanceof Error?_0xe43e50[_0xee2aa4(0x99)]:String(_0xe43e50)};}const _0x223a12=_0x109f36['length']===0x0&&(_0x5c1d38[_0xee2aa4(0xb1)]?_0x5c1d38['cleared']:!![]),_0xbf743b=_0x5c1d38['attempted']?_0x5c1d38['cleared']?_0xee2aa4(0x93):_0xee2aa4(0xb0):'runtime\x20cache\x20not\x20needed';return{'ok':_0x223a12,'data':{'uploaded':_0x526a8d,'skipped':_0x4de666,'failed':_0x109f36,'cacheClear':_0x5c1d38},'message':_0xee2aa4(0xaa)+_0x526a8d[_0xee2aa4(0x8a)]+_0xee2aa4(0x9b)+_0x4de666[_0xee2aa4(0x8a)]+_0xee2aa4(0xba)+_0x109f36['length']+'\x20failed,\x20'+_0xbf743b};}};function a38_0x44da(_0xf231f3,_0x5c8e72){_0xf231f3=_0xf231f3-0x85;const _0x4b2c96=a38_0x4b2c();let _0x44dac8=_0x4b2c96[_0xf231f3];return _0x44dac8;}async function getTargetFunctions(_0x1067ed,_0x4c1f61){const _0x1f7452=a38_0x19262c,_0x28c5e4=_0x4c1f61[_0x1f7452(0xc2)](_0x1f7452(0x9e)),_0x3db816=_0x4c1f61['str'](_0x1f7452(0xbc)),_0x2d65d5=normalizeBffType(_0x28c5e4)??undefined;if(_0x3db816&&!_0x2d65d5)throw CliErrors['validation'](_0x1f7452(0xa1));const _0x5a759d=await scanLocalBffFunctions(_0x1067ed,_0x2d65d5);if(_0x3db816){const _0x388b04=_0x5a759d[_0x1f7452(0xa0)](_0x21bde8=>_0x21bde8[_0x1f7452(0xbc)]===_0x3db816);if(_0x388b04[_0x1f7452(0x8a)]===0x0)throw CliErrors[_0x1f7452(0xb5)]('Local\x20function\x20not\x20found:\x20'+_0x2d65d5+'/'+_0x3db816);return _0x388b04;}return _0x5a759d;}async function buildHookMaps(_0x17a929,_0x48a83e,_0x3f37b2,_0xb52552){const _0x152b9c=a38_0x19262c,_0x22765a=_0x3f37b2[_0x152b9c(0x90)](_0x258f0c=>_0x258f0c[_0x152b9c(0x9e)]===_0x152b9c(0x87));if(!_0x22765a)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x173fa8=loadAliasMap(_0x48a83e,undefined,resolveApiFilePath(_0x48a83e,_0x17a929)),_0x47f8a7=new Map(_0x173fa8[_0x152b9c(0xb4)](_0x2401af=>[_0x2401af['alias'],_0x2401af['datasetCode']]));for(const _0x24dd19 of Object[_0x152b9c(0xd4)](_0xb52552[_0x152b9c(0xaf)])){_0x24dd19['alias']&&_0x24dd19[_0x152b9c(0x96)]&&!_0x47f8a7[_0x152b9c(0xc7)](_0x24dd19[_0x152b9c(0x9a)])&&_0x47f8a7[_0x152b9c(0xd6)](_0x24dd19[_0x152b9c(0x9a)],_0x24dd19[_0x152b9c(0x96)]);}const _0x581e1a=await listDatasets(_0x17a929),_0x5ee411=new Map(_0x581e1a[_0x152b9c(0xb4)](_0x59ee86=>[_0x59ee86[_0x152b9c(0xc6)],_0x59ee86]));return{'aliasToDatasetCode':_0x47f8a7,'datasetCodeToDataset':_0x5ee411};}function a38_0x4b2c(){const _0x21b31d=['Push\x20complete:\x20','473404lvNqFC','remoteId','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','unchanged','functions','runtime\x20cache\x20clear\x20failed','attempted','utf8','would_push','map','validation','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x22.\x20','Cannot\x20resolve\x20dataset\x20for\x20\x22','force','\x20skipped,\x20','Force\x20push\x20ignoring\x20hash\x20protection','name','/api/management/library/scripts/save','datasetId','version','high-risk-write','Push\x20only\x20this\x20script\x20type','str','2SXBkSV','description','status','code','has','Run\x20`','scriptsRoot','string','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','every','update','815906CZuvVP','aliasToDatasetCode','hash','filePath','3342160Khonsn','push','values','Push\x20local\x20BFF\x20scripts\x20to\x20remote','set','36373086anjNbh','6qYmtij','Lock\x20scope\x20for\x20app\x20\x22','HOOK','create','lockFilePath','length','5371025pGRTAC','apps','Would\x20inspect\x20','ENDPOINT','datasetCodeToDataset','some','toISOString','join','runtime\x20cache\x20cleared','Incomplete\x20HOOK\x20path:\x20','bool','datasetCode','functionNode','lockKey','message','alias','\x20uploaded,\x20','6428424ejnvMd','appCode','type','script','filter','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','No\x20local\x20BFF\x20functions\x20found.','boolean','567977pMhnDV','apiDir','get','operationType'];a38_0x4b2c=function(){return _0x21b31d;};return a38_0x4b2c();}async function uploadSingleFunction(_0x29d7b7,_0x2d302f,_0x2559cd,_0x1134e9){const _0x4bfe03=a38_0x19262c,_0x26f1e5=await readFile(_0x2d302f[_0x4bfe03(0xd1)],_0x4bfe03(0xb2)),_0x538426=await computeFileHash(_0x2d302f[_0x4bfe03(0xd1)]),_0x2b2226=_0x2559cd[_0x4bfe03(0xaf)][_0x2d302f['lockKey']];if(_0x2b2226?.['remoteId']&&_0x2b2226[_0x4bfe03(0xbf)]==null)throw CliErrors['validation'](_0x2d302f[_0x4bfe03(0x98)]+_0x4bfe03(0xa2));let _0x59b277=extractScriptDescription(_0x26f1e5);if(!_0x59b277&&_0x2b2226?.[_0x4bfe03(0xac)]){const _0x1de974=await getBffScriptInfo(_0x2b2226['remoteId']);_0x59b277=_0x1de974[_0x4bfe03(0xc4)]||undefined;}const _0x162663={'appCode':_0x29d7b7,'functionName':_0x2d302f['name'],'scriptType':_0x2d302f['type'],'scriptContent':_0x26f1e5};if(_0x2b2226?.[_0x4bfe03(0xac)])_0x162663['id']=_0x2b2226['remoteId'];if(_0x2b2226?.[_0x4bfe03(0xbf)]!=null)_0x162663[_0x4bfe03(0xbf)]=_0x2b2226[_0x4bfe03(0xbf)];if(_0x59b277)_0x162663[_0x4bfe03(0xc4)]=_0x59b277;if(_0x2d302f[_0x4bfe03(0x9e)]==='HOOK'){const _0x1b974d=_0x2d302f[_0x4bfe03(0x9a)];if(!_0x1b974d||!_0x2d302f[_0x4bfe03(0xa9)]||!_0x2d302f[_0x4bfe03(0x97)])throw CliErrors[_0x4bfe03(0xb5)](_0x4bfe03(0x94)+_0x2d302f[_0x4bfe03(0x98)]);const _0x155014=_0x1134e9[_0x4bfe03(0xcf)][_0x4bfe03(0xa8)](_0x1b974d)??_0x2b2226?.['datasetCode']??_0x1b974d,_0x42fc34=_0x1134e9[_0x4bfe03(0x8f)]['get'](_0x155014);if(!_0x42fc34)throw CliErrors[_0x4bfe03(0xb5)](_0x4bfe03(0xb8)+_0x1b974d+_0x4bfe03(0xb7)+(_0x4bfe03(0xc8)+CLI_BIN_NAME+_0x4bfe03(0xa3)));_0x162663[_0x4bfe03(0xbe)]=_0x42fc34['id'],_0x162663[_0x4bfe03(0xa9)]=_0x2d302f[_0x4bfe03(0xa9)],_0x162663[_0x4bfe03(0x97)]=_0x2d302f[_0x4bfe03(0x97)];}const _0x164a04=await saveBffScript(_0x162663),_0x561585=_0x164a04['id'],_0x3f925a=_0x164a04[_0x4bfe03(0x9f)]??await getBffScriptInfo(_0x561585),_0x33c1da={'hash':_0x538426,'remoteId':_0x561585,'version':_0x3f925a['version']};if(_0x2d302f[_0x4bfe03(0x9e)]==='HOOK'){const _0x15236e=_0x2d302f[_0x4bfe03(0x9a)],_0x448df0=_0x1134e9[_0x4bfe03(0xcf)]['get'](_0x15236e)??_0x2b2226?.[_0x4bfe03(0x96)]??_0x15236e;_0x1134e9[_0x4bfe03(0xcf)][_0x4bfe03(0xc7)](_0x15236e)?_0x33c1da[_0x4bfe03(0x9a)]=_0x15236e:_0x33c1da[_0x4bfe03(0x9a)]=_0x2b2226?.[_0x4bfe03(0x9a)],_0x33c1da[_0x4bfe03(0x96)]=_0x448df0,_0x33c1da[_0x4bfe03(0xa9)]=_0x2d302f[_0x4bfe03(0xa9)],_0x33c1da[_0x4bfe03(0x97)]=_0x2d302f[_0x4bfe03(0x97)];}_0x2559cd[_0x4bfe03(0xaf)][_0x2d302f[_0x4bfe03(0x98)]]=_0x33c1da;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x404a4f,_0x3c062d,_0x8df6ce){const _0x792f5=a38_0x19262c;if(_0x8df6ce['length']===0x0)return;for(let _0x3bce4e=0x0;_0x3bce4e<LOCK_SETTLE_RETRY_COUNT;_0x3bce4e+=0x1){const _0x183151=await readBffLockFile(_0x404a4f),_0x5bda1e=_0x183151?.['apps']?.[_0x3c062d]?.[_0x792f5(0xaf)]??{},_0xcc53c5=_0x8df6ce[_0x792f5(0xcc)](_0x17c0c3=>!!_0x5bda1e[_0x17c0c3]?.[_0x792f5(0xac)]);if(_0xcc53c5)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x8df6ce[_0x792f5(0x92)](',\x20')+'.');}
@@ -1 +1 @@
1
- function a39_0x4f2b(_0x39d069,_0x5ac6a6){_0x39d069=_0x39d069-0x112;const _0x3bec07=a39_0x3bec();let _0x4f2b0f=_0x3bec07[_0x39d069];return _0x4f2b0f;}const a39_0xcf72e=a39_0x4f2b;(function(_0x2a706e,_0x42af9a){const _0xd03602=a39_0x4f2b,_0x48b9f2=_0x2a706e();while(!![]){try{const _0xca6cd9=parseInt(_0xd03602(0x122))/0x1+parseInt(_0xd03602(0x129))/0x2+parseInt(_0xd03602(0x117))/0x3*(parseInt(_0xd03602(0x127))/0x4)+parseInt(_0xd03602(0x123))/0x5+-parseInt(_0xd03602(0x128))/0x6*(-parseInt(_0xd03602(0x124))/0x7)+-parseInt(_0xd03602(0x11e))/0x8+-parseInt(_0xd03602(0x11d))/0x9;if(_0xca6cd9===_0x42af9a)break;else _0x48b9f2['push'](_0x48b9f2['shift']());}catch(_0x2cc23d){_0x48b9f2['push'](_0x48b9f2['shift']());}}}(a39_0x3bec,0x2dec5));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';function a39_0x3bec(){const _0x36bc09=['15969pQQoBA','filePath','appCode','lockKey','alias','remote','4690746QfrufL','576488dPojHE','bool','apiDir','\x20added,\x20','204459eEKsog','689715ercvHR','6958NUXznB','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','push','4bCQlfl','1338wvrZwh','423938yozYzF','datasetCode','map','read','lockFilePath','length','functions','has'];a39_0x3bec=function(){return _0x36bc09;};return a39_0x3bec();}export const bffStatus={'service':'bff','command':'status','description':'Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','risk':a39_0xcf72e(0x112),'flags':[{'name':a39_0xcf72e(0x11c),'type':'boolean','description':a39_0xcf72e(0x125)}],async 'execute'(_0x1a59cc){const _0xda4cff=a39_0xcf72e,_0x3c9291=loadBffProjectConfig(_0x1a59cc[_0xda4cff(0x119)]),_0x45e491=await readBffLockFile(_0x3c9291[_0xda4cff(0x113)]),{appLock:_0x175067}=ensureLockScope(_0x45e491??createEmptyBffLock(),_0x1a59cc[_0xda4cff(0x119)],_0x3c9291['scriptsRoot'],'status'),_0xa77a72=await scanLocalBffFunctions(_0x3c9291),_0x1ce245=[],_0xfb281f=[],_0x504d19=[];for(const _0x489446 of _0xa77a72){const _0x24c921=await computeFileHash(_0x489446[_0xda4cff(0x118)]),_0x125a3b=_0x175067[_0xda4cff(0x115)][_0x489446[_0xda4cff(0x11a)]];if(!_0x125a3b)_0x1ce245[_0xda4cff(0x126)](_0x489446[_0xda4cff(0x11a)]);else _0x125a3b['hash']!==_0x24c921?_0xfb281f[_0xda4cff(0x126)](_0x489446[_0xda4cff(0x11a)]):_0x504d19[_0xda4cff(0x126)](_0x489446[_0xda4cff(0x11a)]);}const _0x4da4a4=[];if(_0x1a59cc[_0xda4cff(0x11f)]('remote')){const _0x2fdebd=loadAliasMap(_0x1a59cc[_0xda4cff(0x120)],undefined,resolveApiFilePath(_0x1a59cc[_0xda4cff(0x120)],_0x1a59cc[_0xda4cff(0x119)])),_0x4386bd=new Map(_0x2fdebd[_0xda4cff(0x12b)](_0x39405b=>[_0x39405b[_0xda4cff(0x12a)],_0x39405b[_0xda4cff(0x11b)]])),[_0x3ec93f,_0x1d067f]=await Promise['all']([listBffScripts(_0x1a59cc[_0xda4cff(0x119)]),getBffScriptStatistics(_0x1a59cc[_0xda4cff(0x119)])]),_0x522151=createHookLocationMap(_0x1d067f),_0x23f67c=new Set(_0xa77a72['map'](_0x2f0d3c=>_0x2f0d3c[_0xda4cff(0x11a)]));for(const _0xfcf4e0 of _0x3ec93f){const _0x781f6f=resolveRemoteScriptTarget(_0x3c9291,_0xfcf4e0,_0x522151,_0x175067[_0xda4cff(0x115)],_0x4386bd);_0x781f6f&&!_0x23f67c[_0xda4cff(0x116)](_0x781f6f[_0xda4cff(0x11a)])&&_0x4da4a4[_0xda4cff(0x126)](_0x781f6f[_0xda4cff(0x11a)]);}}const _0xbd4273=_0x1ce245[_0xda4cff(0x114)]===0x0&&_0xfb281f[_0xda4cff(0x114)]===0x0&&_0x4da4a4[_0xda4cff(0x114)]===0x0;return{'ok':!![],'data':{'added':_0x1ce245,'modified':_0xfb281f,'unchanged':_0x504d19,'remoteOnly':_0x4da4a4},'message':_0xbd4273?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x1ce245[_0xda4cff(0x114)]+_0xda4cff(0x121)+_0xfb281f['length']+'\x20modified,\x20'+_0x504d19['length']+'\x20unchanged'+(_0x4da4a4['length']>0x0?',\x20'+_0x4da4a4[_0xda4cff(0x114)]+'\x20remote-only':'')};}};
1
+ const a39_0x18be55=a39_0x403b;(function(_0x1cb7de,_0x44b857){const _0x5dfaab=a39_0x403b,_0x450d40=_0x1cb7de();while(!![]){try{const _0x1040e2=parseInt(_0x5dfaab(0xbb))/0x1+-parseInt(_0x5dfaab(0xd6))/0x2*(parseInt(_0x5dfaab(0xbf))/0x3)+-parseInt(_0x5dfaab(0xd2))/0x4*(-parseInt(_0x5dfaab(0xd4))/0x5)+-parseInt(_0x5dfaab(0xb8))/0x6*(parseInt(_0x5dfaab(0xc4))/0x7)+parseInt(_0x5dfaab(0xc1))/0x8+-parseInt(_0x5dfaab(0xcb))/0x9*(parseInt(_0x5dfaab(0xd3))/0xa)+parseInt(_0x5dfaab(0xcd))/0xb;if(_0x1040e2===_0x44b857)break;else _0x450d40['push'](_0x450d40['shift']());}catch(_0xac7880){_0x450d40['push'](_0x450d40['shift']());}}}(a39_0x4ee3,0x5686b));function a39_0x403b(_0x4359ed,_0x41a6bc){_0x4359ed=_0x4359ed-0xb4;const _0x4ee317=a39_0x4ee3();let _0x403bdd=_0x4ee317[_0x4359ed];return _0x403bdd;}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';function a39_0x4ee3(){const _0x3605bf=['146345BZuFcP','All\x20BFF\x20scripts\x20are\x20in\x20sync.','32652MUwKEM','status','functions','lockFilePath','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','312JnnpPi','map','datasetCode','243418uQTDXw','remote','length','filePath','75XRWoFA','appCode','1520520wxfqNK','boolean','\x20unchanged','62622TmCzre','bool','\x20remote-only','read','push','alias','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','5151033CNCIcB','hash','14710718zxHtlk','lockKey','apiDir','\x20added,\x20','all','4YZIdPR','10sCxirO'];a39_0x4ee3=function(){return _0x3605bf;};return a39_0x4ee3();}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a39_0x18be55(0xb4),'description':a39_0x18be55(0xca),'risk':a39_0x18be55(0xc7),'flags':[{'name':a39_0x18be55(0xbc),'type':a39_0x18be55(0xc2),'description':a39_0x18be55(0xb7)}],async 'execute'(_0x303a53){const _0x128b85=a39_0x18be55,_0x1a2e7f=loadBffProjectConfig(_0x303a53[_0x128b85(0xc0)]),_0x47fbb5=await readBffLockFile(_0x1a2e7f[_0x128b85(0xb6)]),{appLock:_0x51678e}=ensureLockScope(_0x47fbb5??createEmptyBffLock(),_0x303a53['appCode'],_0x1a2e7f['scriptsRoot'],_0x128b85(0xb4)),_0x397154=await scanLocalBffFunctions(_0x1a2e7f),_0x4ceda6=[],_0x48da0e=[],_0x4e96f8=[];for(const _0x397e08 of _0x397154){const _0x2c44ee=await computeFileHash(_0x397e08[_0x128b85(0xbe)]),_0x329cc3=_0x51678e[_0x128b85(0xb5)][_0x397e08[_0x128b85(0xce)]];if(!_0x329cc3)_0x4ceda6[_0x128b85(0xc8)](_0x397e08[_0x128b85(0xce)]);else _0x329cc3[_0x128b85(0xcc)]!==_0x2c44ee?_0x48da0e[_0x128b85(0xc8)](_0x397e08[_0x128b85(0xce)]):_0x4e96f8[_0x128b85(0xc8)](_0x397e08[_0x128b85(0xce)]);}const _0x3e2f53=[];if(_0x303a53[_0x128b85(0xc5)](_0x128b85(0xbc))){const _0x2a1043=loadAliasMap(_0x303a53[_0x128b85(0xcf)],undefined,resolveApiFilePath(_0x303a53[_0x128b85(0xcf)],_0x303a53['appCode'])),_0x439547=new Map(_0x2a1043[_0x128b85(0xb9)](_0x1d67b6=>[_0x1d67b6[_0x128b85(0xba)],_0x1d67b6[_0x128b85(0xc9)]])),[_0x2ad96c,_0x108e02]=await Promise[_0x128b85(0xd1)]([listBffScripts(_0x303a53['appCode']),getBffScriptStatistics(_0x303a53[_0x128b85(0xc0)])]),_0x22e124=createHookLocationMap(_0x108e02),_0x319e6a=new Set(_0x397154['map'](_0x2970a6=>_0x2970a6['lockKey']));for(const _0x372042 of _0x2ad96c){const _0x4f0be9=resolveRemoteScriptTarget(_0x1a2e7f,_0x372042,_0x22e124,_0x51678e[_0x128b85(0xb5)],_0x439547);_0x4f0be9&&!_0x319e6a['has'](_0x4f0be9[_0x128b85(0xce)])&&_0x3e2f53[_0x128b85(0xc8)](_0x4f0be9['lockKey']);}}const _0x3494e1=_0x4ceda6[_0x128b85(0xbd)]===0x0&&_0x48da0e[_0x128b85(0xbd)]===0x0&&_0x3e2f53[_0x128b85(0xbd)]===0x0;return{'ok':!![],'data':{'added':_0x4ceda6,'modified':_0x48da0e,'unchanged':_0x4e96f8,'remoteOnly':_0x3e2f53},'message':_0x3494e1?_0x128b85(0xd5):_0x4ceda6[_0x128b85(0xbd)]+_0x128b85(0xd0)+_0x48da0e[_0x128b85(0xbd)]+'\x20modified,\x20'+_0x4e96f8[_0x128b85(0xbd)]+_0x128b85(0xc3)+(_0x3e2f53[_0x128b85(0xbd)]>0x0?',\x20'+_0x3e2f53[_0x128b85(0xbd)]+_0x128b85(0xc6):'')};}};
@@ -1 +1 @@
1
- function a40_0x49a8(_0xc76b8a,_0x529fcb){_0xc76b8a=_0xc76b8a-0x92;const _0x1a1529=a40_0x1a15();let _0x49a836=_0x1a1529[_0xc76b8a];return _0x49a836;}const a40_0x130273=a40_0x49a8;(function(_0x73a07c,_0x2b5103){const _0x43a21e=a40_0x49a8,_0x37b0bb=_0x73a07c();while(!![]){try{const _0x5f54bc=parseInt(_0x43a21e(0xaa))/0x1*(parseInt(_0x43a21e(0x9f))/0x2)+-parseInt(_0x43a21e(0x9d))/0x3*(parseInt(_0x43a21e(0x96))/0x4)+parseInt(_0x43a21e(0x93))/0x5+-parseInt(_0x43a21e(0xa9))/0x6+parseInt(_0x43a21e(0xae))/0x7+-parseInt(_0x43a21e(0xab))/0x8+-parseInt(_0x43a21e(0xac))/0x9*(-parseInt(_0x43a21e(0xa3))/0xa);if(_0x5f54bc===_0x2b5103)break;else _0x37b0bb['push'](_0x37b0bb['shift']());}catch(_0x213c4f){_0x37b0bb['push'](_0x37b0bb['shift']());}}}(a40_0x1a15,0x5f6a5));function a40_0x1a15(){const _0x2c516d=['495055CSrzDx','5266888WuWWIw','279ScxiKH','nonInteractive','1524957qyFdNN','log','apiError','274865xJAxEj','inherit','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','872ztoeKb','unknown','npx\x20skills\x20add\x20failed:\x20','../../skills/npx-skills-add.js','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(','info','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','3882qdMbDG','cli-skill','2HNoWUw','cwd','pipe','skipped','282410wrigam','error','install','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.',')...','write','1872456QInrmO'];a40_0x1a15=function(){return _0x2c516d;};return a40_0x1a15();}import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a40_0x130273(0x9e),'command':a40_0x130273(0xa5),'description':a40_0x130273(0x9c),'risk':a40_0x130273(0xa8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1ce6c5){const _0x2f44cb=a40_0x130273;logger['setLogPath'](process[_0x2f44cb(0xa0)]()),logger[_0x2f44cb(0x9b)]('cli-skill-install',_0x2f44cb(0xa6));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x505685,RABETBASE_SKILL_SOURCE:_0x567e96,runNpxSkillsAddGlobal:_0x4d636c}=await import(_0x2f44cb(0x99)),_0x4676e5=_0x1ce6c5[_0x2f44cb(0xad)]?_0x2f44cb(0xa1):_0x2f44cb(0x94);console[_0x2f44cb(0xaf)](_0x2f44cb(0x9a)+_0x505685+_0x2f44cb(0xa7));const _0x36a2b1=_0x4d636c(process['cwd'](),_0x567e96,{'stdio':_0x4676e5});if(_0x36a2b1[_0x2f44cb(0xa2)])console[_0x2f44cb(0xaf)]('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.');else{if(_0x36a2b1['ok'])console[_0x2f44cb(0xaf)]('CLI\x20Built-in\x20Skill\x20installed');else throw CliErrors[_0x2f44cb(0x92)](_0x2f44cb(0x98)+(_0x36a2b1[_0x2f44cb(0xa4)]||_0x2f44cb(0x97)),_0x2f44cb(0x95)+_0x505685);}return{'ok':!![]};}}];
1
+ const a40_0xcaf6e9=a40_0x2ef1;(function(_0x264869,_0x5be2bd){const _0x2752c9=a40_0x2ef1,_0x422935=_0x264869();while(!![]){try{const _0x430c11=parseInt(_0x2752c9(0x1cf))/0x1*(parseInt(_0x2752c9(0x1c9))/0x2)+-parseInt(_0x2752c9(0x1cd))/0x3+parseInt(_0x2752c9(0x1d0))/0x4+-parseInt(_0x2752c9(0x1d1))/0x5*(parseInt(_0x2752c9(0x1d2))/0x6)+parseInt(_0x2752c9(0x1ca))/0x7*(-parseInt(_0x2752c9(0x1d8))/0x8)+parseInt(_0x2752c9(0x1de))/0x9*(parseInt(_0x2752c9(0x1cb))/0xa)+parseInt(_0x2752c9(0x1d4))/0xb;if(_0x430c11===_0x5be2bd)break;else _0x422935['push'](_0x422935['shift']());}catch(_0x274c30){_0x422935['push'](_0x422935['shift']());}}}(a40_0x1491,0x2584e));function a40_0x2ef1(_0x295c53,_0x12e46f){_0x295c53=_0x295c53-0x1c6;const _0x14910a=a40_0x1491();let _0x2ef1b0=_0x14910a[_0x295c53];return _0x2ef1b0;}import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';function a40_0x1491(){const _0x5358b3=['Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','112360ndDHMr','cli-skill','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','../../skills/npx-skills-add.js','error','install','134712GWIAUs','log','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(','inherit','cwd','pipe','177068KTxAVT','21CEEIlx','20LCJQkX','nonInteractive','691230EfgOgH','write','2xyyxoz','640212OjpMbI','5ZlWOWJ','545028RXAthr','info','1650044JFSZMu'];a40_0x1491=function(){return _0x5358b3;};return a40_0x1491();}export const cliSkillDefinitions=[{'service':a40_0xcaf6e9(0x1d9),'command':a40_0xcaf6e9(0x1dd),'description':a40_0xcaf6e9(0x1da),'risk':a40_0xcaf6e9(0x1ce),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xd76922){const _0x174bde=a40_0xcaf6e9;logger['setLogPath'](process[_0x174bde(0x1c7)]()),logger[_0x174bde(0x1d3)]('cli-skill-install',_0x174bde(0x1d7));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x485ea0,RABETBASE_SKILL_SOURCE:_0x1a155e,runNpxSkillsAddGlobal:_0x5e9b0c}=await import(_0x174bde(0x1db)),_0x49ca80=_0xd76922[_0x174bde(0x1cc)]?_0x174bde(0x1c8):_0x174bde(0x1c6);console['log'](_0x174bde(0x1e0)+_0x485ea0+')...');const _0x7bf00d=_0x5e9b0c(process[_0x174bde(0x1c7)](),_0x1a155e,{'stdio':_0x49ca80});if(_0x7bf00d['skipped'])console[_0x174bde(0x1df)](_0x174bde(0x1d6));else{if(_0x7bf00d['ok'])console[_0x174bde(0x1df)]('CLI\x20Built-in\x20Skill\x20installed');else throw CliErrors['apiError']('npx\x20skills\x20add\x20failed:\x20'+(_0x7bf00d[_0x174bde(0x1dc)]||'unknown'),_0x174bde(0x1d5)+_0x485ea0);}return{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a41_0x213f01=a41_0x1169;(function(_0x47669b,_0x2949aa){const _0x594bcb=a41_0x1169,_0x490763=_0x47669b();while(!![]){try{const _0x123513=-parseInt(_0x594bcb(0x161))/0x1*(parseInt(_0x594bcb(0x13e))/0x2)+-parseInt(_0x594bcb(0x142))/0x3*(parseInt(_0x594bcb(0x14b))/0x4)+parseInt(_0x594bcb(0x125))/0x5+-parseInt(_0x594bcb(0x132))/0x6*(parseInt(_0x594bcb(0x128))/0x7)+parseInt(_0x594bcb(0x14e))/0x8*(parseInt(_0x594bcb(0x12e))/0x9)+parseInt(_0x594bcb(0x12b))/0xa+-parseInt(_0x594bcb(0x150))/0xb*(parseInt(_0x594bcb(0x13c))/0xc);if(_0x123513===_0x2949aa)break;else _0x490763['push'](_0x490763['shift']());}catch(_0x5c05a5){_0x490763['push'](_0x490763['shift']());}}}(a41_0x1844,0x3fddb));import a41_0x3ff246 from'chalk';import a41_0xb1f1b4 from'ora';import a41_0x17e20a from'semver';function a41_0x1169(_0x11b31b,_0x349e7d){_0x11b31b=_0x11b31b-0x110;const _0x1844a2=a41_0x1844();let _0x11697a=_0x1844a2[_0x11b31b];return _0x11697a;}import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x50001f=a41_0x1169;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x50001f(0x145)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3cf285=a41_0x1169,_0x42358e=process[_0x3cf285(0x12d)][_0x3cf285(0x140)]();if(_0x42358e[_0x3cf285(0x11b)](_0x3cf285(0x14a)))return'bun';return'npm';}const updateFlags=[{'name':a41_0x213f01(0x126),'type':a41_0x213f01(0x15c),'description':a41_0x213f01(0x116),'default':![]},{'name':a41_0x213f01(0x149),'type':'string','description':a41_0x213f01(0x153)},{'name':'no-skills','type':a41_0x213f01(0x15c),'description':a41_0x213f01(0x119),'default':![]},{'name':a41_0x213f01(0x162),'type':'boolean','description':a41_0x213f01(0x158),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x343e49){const _0x420013=a41_0x213f01;return _0x343e49[_0x420013(0x14f)]('version')['trim']();}function shouldSkipCliSkill(_0x454b4e){const _0x12737f=a41_0x213f01;return _0x454b4e[_0x12737f(0x143)](_0x12737f(0x12a))||_0x454b4e[_0x12737f(0x114)](_0x12737f(0x162))===![];}async function validateUpdateFlags(_0x4042fc){const _0x5d7434=a41_0x213f01,_0x5a6918=_0x4042fc['bool'](_0x5d7434(0x126)),_0x402c61=getRequestedVersion(_0x4042fc);if(_0x5a6918&&_0x402c61)throw CliErrors[_0x5d7434(0x155)](_0x5d7434(0x138),_0x5d7434(0x152));if(_0x402c61&&!a41_0x17e20a[_0x5d7434(0x11e)](_0x402c61))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x402c61,_0x5d7434(0x163));}async function fetchNpmDistTags(){const _0x2c9b93=a41_0x213f01;try{const _0x449267=await fetch(_0x2c9b93(0x157)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x2c9b93(0x141),{'signal':AbortSignal[_0x2c9b93(0x147)](0x2710)});if(!_0x449267['ok'])return null;const _0x223fe4=await _0x449267[_0x2c9b93(0x164)]();if(!_0x223fe4||typeof _0x223fe4!==_0x2c9b93(0x151))return null;return Object['fromEntries'](Object[_0x2c9b93(0x15d)](_0x223fe4)[_0x2c9b93(0x11a)](([,_0x51b5a3])=>typeof _0x51b5a3===_0x2c9b93(0x146)&&_0x51b5a3[_0x2c9b93(0x137)]()['length']>0x0)['map'](([_0xc71bbf,_0x511071])=>[_0xc71bbf,String(_0x511071)[_0x2c9b93(0x137)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x1488f3){const _0xce48d7=await fetchNpmDistTags();return _0xce48d7?.[_0x1488f3]??null;}async function fetchLatestVersion(){const _0x590e86=a41_0x213f01;return fetchNpmDistTagVersion(_0x590e86(0x13b));}function a41_0x1844(){const _0x1edbab=['Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','filter','includes','error','skipped','valid','Requested\x20version:\x20','run','Current\x20version:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','yellow','1082715cHIYXp','beta','cwd','21tufxEQ','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','no-skills','4453960jZXdpl','npm','execPath','36YdbBOY','...','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','log','942078ypvrhv','start','Already\x20on\x20requested\x20version\x20(v','fail','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','trim','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','red','succeed','latest','24XCUBoP','Beta\x20version:\x20','406wKqkAN','warn','toLowerCase','/dist-tags','114378AibseH','bool','green','slice','string','timeout','Checking\x20CLI\x20Built-in\x20Skill...','version','bun','4PluOKk','source','\x20→\x20','914192hNSnEn','str','87802nmJMyi','object','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Install\x20a\x20specific\x20CLI\x20version','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','validation','Update\x20failed','https://registry.npmjs.org/-/package/','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','\x20\x20Try\x20manually:\x20','inherit','gray','boolean','entries','Update\x20available:\x20','pipe','Already\x20up\x20to\x20date\x20(v','1637FeDJux','skills','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','json','Version\x20comparison\x20failed','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','message','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','flag','install','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Updating\x20via\x20','nonInteractive'];a41_0x1844=function(){return _0x1edbab;};return a41_0x1844();}async function resolveTargetVersion(_0x404622){const _0x1253ee=a41_0x213f01,_0x2991d4=getRequestedVersion(_0x404622);if(_0x2991d4)return{'version':_0x2991d4,'source':_0x1253ee(0x149)};if(_0x404622[_0x1253ee(0x143)](_0x1253ee(0x126))){const _0x1d0ba9=await fetchNpmDistTagVersion('beta');if(!_0x1d0ba9)return null;return{'version':_0x1d0ba9,'source':_0x1253ee(0x126)};}const _0x5d371d=await fetchLatestVersion();if(!_0x5d371d)return null;return{'version':_0x5d371d,'source':_0x1253ee(0x13b)};}function shouldInstallTarget(_0x7f3fe4,_0x1aa10c){const _0x55d62d=a41_0x213f01;if(_0x1aa10c[_0x55d62d(0x14c)]===_0x55d62d(0x149)||_0x1aa10c['source']===_0x55d62d(0x126))return!a41_0x17e20a['eq'](_0x7f3fe4,_0x1aa10c['version']);return a41_0x17e20a['lt'](_0x7f3fe4,_0x1aa10c[_0x55d62d(0x149)]);}function getInstallPlanLabel(_0xf60394,_0x454061){const _0x1cd332=a41_0x213f01;switch(_0x454061[_0x1cd332(0x14c)]){case _0x1cd332(0x126):return _0x1cd332(0x13d)+a41_0x3ff246[_0x1cd332(0x124)](_0xf60394)+_0x1cd332(0x14d)+a41_0x3ff246[_0x1cd332(0x144)](_0x454061[_0x1cd332(0x149)]);case'version':return _0x1cd332(0x11f)+a41_0x3ff246[_0x1cd332(0x124)](_0xf60394)+_0x1cd332(0x14d)+a41_0x3ff246[_0x1cd332(0x144)](_0x454061[_0x1cd332(0x149)]);case _0x1cd332(0x13b):default:return _0x1cd332(0x15e)+a41_0x3ff246[_0x1cd332(0x124)](_0xf60394)+_0x1cd332(0x14d)+a41_0x3ff246['green'](_0x454061[_0x1cd332(0x149)]);}}async function installCliSkill(_0x3b9dfd){const _0xe3faad=a41_0x213f01;console['log'](a41_0x3ff246[_0xe3faad(0x15b)](_0xe3faad(0x148)));const _0x31d145=runNpxSkillsAddGlobal(process[_0xe3faad(0x127)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x3b9dfd?_0xe3faad(0x15f):_0xe3faad(0x15a)});if(_0x31d145[_0xe3faad(0x11d)]){console[_0xe3faad(0x131)](a41_0x3ff246[_0xe3faad(0x15b)](_0xe3faad(0x129)));return;}if(_0x31d145['ok']){console[_0xe3faad(0x131)](a41_0x3ff246[_0xe3faad(0x15b)](_0xe3faad(0x130)));return;}console[_0xe3faad(0x13f)](a41_0x3ff246['yellow'](_0xe3faad(0x111)+(_0x31d145[_0xe3faad(0x11c)]||'unknown'))),console[_0xe3faad(0x131)](a41_0x3ff246[_0xe3faad(0x15b)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+'\x20cli-skill\x20install'));}async function execute(_0x165087){const _0xcc923c=a41_0x213f01;await validateUpdateFlags(_0x165087);const _0x3b5b2a=getCurrentVersion();console[_0xcc923c(0x131)](_0xcc923c(0x121)+_0x3b5b2a);const _0x5428b3=a41_0xb1f1b4('Checking\x20for\x20updates...')[_0xcc923c(0x133)](),_0x105f30=await resolveTargetVersion(_0x165087);if(!_0x105f30){const _0x1ce4ca=_0x165087[_0xcc923c(0x143)](_0xcc923c(0x126))?_0xcc923c(0x154):_0xcc923c(0x122);return _0x5428b3[_0xcc923c(0x135)](_0x1ce4ca),console['log'](a41_0x3ff246[_0xcc923c(0x15b)](_0xcc923c(0x113)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x1ce4ca};}const _0x401363=a41_0x17e20a[_0xcc923c(0x11e)](VERSION),_0x1e911a=a41_0x17e20a[_0xcc923c(0x11e)](_0x105f30[_0xcc923c(0x149)]);if(!_0x401363||!_0x1e911a)return _0x5428b3[_0xcc923c(0x135)](_0xcc923c(0x110)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x401363,_0x105f30)){const _0x3f2928=_0x105f30[_0xcc923c(0x14c)]===_0xcc923c(0x149)?_0xcc923c(0x134)+_0x105f30[_0xcc923c(0x149)]+')':_0xcc923c(0x160)+_0x105f30[_0xcc923c(0x149)]+')';return _0x5428b3[_0xcc923c(0x13a)](_0x3f2928),shouldSkipCliSkill(_0x165087)?console[_0xcc923c(0x131)](a41_0x3ff246[_0xcc923c(0x15b)](_0xcc923c(0x136))):await installCliSkill(_0x165087['nonInteractive']),{'ok':!![]};}_0x5428b3['info'](getInstallPlanLabel(_0x3b5b2a,_0x105f30));const _0x181ad6=detectPackageManager(),_0x2dd88e=_0x181ad6===_0xcc923c(0x12c)?resolveNpmBin(_0xcc923c(0x12c)):_0x181ad6,_0x115665=a41_0xb1f1b4(_0xcc923c(0x117)+_0x181ad6+_0xcc923c(0x12f))[_0xcc923c(0x133)]();try{return await execa(_0x2dd88e,[_0xcc923c(0x115),'-g',NPM_PACKAGE_NAME+'@'+_0x105f30[_0xcc923c(0x149)]],{'stdio':_0xcc923c(0x15f)}),_0x115665[_0xcc923c(0x13a)]('Updated\x20to\x20v'+_0x105f30['version']),console[_0xcc923c(0x131)](a41_0x3ff246[_0xcc923c(0x15b)](_0xcc923c(0x123))),shouldSkipCliSkill(_0x165087)?console[_0xcc923c(0x131)](a41_0x3ff246[_0xcc923c(0x15b)](_0xcc923c(0x136))):await installCliSkill(_0x165087[_0xcc923c(0x118)]),{'ok':!![]};}catch(_0x434807){return _0x115665[_0xcc923c(0x135)](_0xcc923c(0x156)),console['error'](a41_0x3ff246[_0xcc923c(0x139)]('\x20\x20'+_0x434807[_0xcc923c(0x112)])),console[_0xcc923c(0x131)](a41_0x3ff246[_0xcc923c(0x15b)](_0xcc923c(0x159)+_0x181ad6+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x105f30[_0xcc923c(0x149)])),{'ok':![],'message':_0x434807[_0xcc923c(0x112)]};}}export const updateDefinition={'service':'update','command':a41_0x213f01(0x120),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
1
+ const a41_0x187115=a41_0x88c4;(function(_0x2328a9,_0x31f205){const _0x189b5e=a41_0x88c4,_0x11fe2c=_0x2328a9();while(!![]){try{const _0x415b3c=parseInt(_0x189b5e(0x185))/0x1*(-parseInt(_0x189b5e(0x13f))/0x2)+-parseInt(_0x189b5e(0x16c))/0x3+parseInt(_0x189b5e(0x17e))/0x4*(parseInt(_0x189b5e(0x187))/0x5)+parseInt(_0x189b5e(0x184))/0x6+-parseInt(_0x189b5e(0x183))/0x7+parseInt(_0x189b5e(0x14c))/0x8*(-parseInt(_0x189b5e(0x143))/0x9)+parseInt(_0x189b5e(0x15a))/0xa;if(_0x415b3c===_0x31f205)break;else _0x11fe2c['push'](_0x11fe2c['shift']());}catch(_0x4c1646){_0x11fe2c['push'](_0x11fe2c['shift']());}}}(a41_0x17d6,0x8631b));import a41_0x4c8403 from'chalk';import a41_0xc9a55e from'ora';function a41_0x88c4(_0x242de8,_0x5ed4bf){_0x242de8=_0x242de8-0x13b;const _0x17d6fc=a41_0x17d6();let _0x88c4fe=_0x17d6fc[_0x242de8];return _0x88c4fe;}import a41_0x2e3c32 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x5a2f42=a41_0x88c4;return GIT_COMMIT!==_0x5a2f42(0x158)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x5a2f42(0x14d)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1ec1a4=a41_0x88c4,_0x52fbb0=process[_0x1ec1a4(0x15f)][_0x1ec1a4(0x166)]();if(_0x52fbb0[_0x1ec1a4(0x180)](_0x1ec1a4(0x172)))return _0x1ec1a4(0x172);return'npm';}const updateFlags=[{'name':a41_0x187115(0x165),'type':a41_0x187115(0x168),'description':a41_0x187115(0x149),'default':![]},{'name':a41_0x187115(0x170),'type':a41_0x187115(0x16a),'description':a41_0x187115(0x13b)},{'name':a41_0x187115(0x16e),'type':'boolean','description':'Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','default':![]},{'name':a41_0x187115(0x160),'type':a41_0x187115(0x168),'description':'Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','default':!![],'hidden':!![]}];function getRequestedVersion(_0x53deca){const _0x5233ec=a41_0x187115;return _0x53deca[_0x5233ec(0x15c)]('version')[_0x5233ec(0x18c)]();}function shouldSkipCliSkill(_0x199b23){const _0x2cd81f=a41_0x187115;return _0x199b23['bool'](_0x2cd81f(0x16e))||_0x199b23[_0x2cd81f(0x161)]('skills')===![];}async function validateUpdateFlags(_0xd477ad){const _0x14a0dd=a41_0x187115,_0x3f50a0=_0xd477ad[_0x14a0dd(0x147)](_0x14a0dd(0x165)),_0x4a439f=getRequestedVersion(_0xd477ad);if(_0x3f50a0&&_0x4a439f)throw CliErrors[_0x14a0dd(0x152)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x14a0dd(0x16d));if(_0x4a439f&&!a41_0x2e3c32[_0x14a0dd(0x13d)](_0x4a439f))throw CliErrors[_0x14a0dd(0x152)](_0x14a0dd(0x156)+_0x4a439f,_0x14a0dd(0x182));}async function fetchNpmDistTags(){const _0xaa2830=a41_0x187115;try{const _0x239cba=await fetch(_0xaa2830(0x169)+encodeURIComponent(NPM_PACKAGE_NAME)+_0xaa2830(0x13c),{'signal':AbortSignal[_0xaa2830(0x17a)](0x2710)});if(!_0x239cba['ok'])return null;const _0x124a6e=await _0x239cba[_0xaa2830(0x174)]();if(!_0x124a6e||typeof _0x124a6e!==_0xaa2830(0x144))return null;return Object[_0xaa2830(0x18a)](Object['entries'](_0x124a6e)[_0xaa2830(0x177)](([,_0x545937])=>typeof _0x545937==='string'&&_0x545937[_0xaa2830(0x18c)]()[_0xaa2830(0x141)]>0x0)[_0xaa2830(0x189)](([_0x410ea0,_0x5a879b])=>[_0x410ea0,String(_0x5a879b)[_0xaa2830(0x18c)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x320ad4){const _0x417bc4=await fetchNpmDistTags();return _0x417bc4?.[_0x320ad4]??null;}function a41_0x17d6(){const _0x3831f7=['\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','json','\x20→\x20','run','filter','\x20\x20Run\x20manually:\x20','red','timeout','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','\x20cli-skill\x20install','Update\x20available:\x20','1164GeHNCB','Version\x20comparison\x20failed','includes','...','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','4991308xsTHrQ','5232450ixrBwr','253877CHFglo','succeed','16535wBlAPn','Current\x20version:\x20','map','fromEntries','Checking\x20CLI\x20Built-in\x20Skill...','trim','yellow','Install\x20a\x20specific\x20CLI\x20version','/dist-tags','valid','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','2YhiAcm','Checking\x20for\x20updates...','length','gray','2865132JOTWeV','object','install','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','bool','error','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Update\x20failed','Requested\x20version:\x20','24vEiatj','slice','log','Already\x20up\x20to\x20date\x20(v','npm','fail','validation','\x20\x20Try\x20manually:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','green','Invalid\x20version:\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','unknown','pipe','11298450xHzTjA','Updated\x20to\x20v','str','warn','@latest','execPath','skills','flag','cwd','source','message','beta','toLowerCase','inherit','boolean','https://registry.npmjs.org/-/package/','string','nonInteractive','1477899OqLrWw','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','no-skills','start','version','latest','bun'];a41_0x17d6=function(){return _0x3831f7;};return a41_0x17d6();}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x566e24){const _0x5644c1=a41_0x187115,_0x5d6317=getRequestedVersion(_0x566e24);if(_0x5d6317)return{'version':_0x5d6317,'source':_0x5644c1(0x170)};if(_0x566e24['bool'](_0x5644c1(0x165))){const _0x3ddbfc=await fetchNpmDistTagVersion(_0x5644c1(0x165));if(!_0x3ddbfc)return null;return{'version':_0x3ddbfc,'source':_0x5644c1(0x165)};}const _0x2dbaf6=await fetchLatestVersion();if(!_0x2dbaf6)return null;return{'version':_0x2dbaf6,'source':_0x5644c1(0x171)};}function shouldInstallTarget(_0xccf231,_0x75e87f){const _0x56fdeb=a41_0x187115;if(_0x75e87f['source']==='version'||_0x75e87f[_0x56fdeb(0x163)]==='beta')return!a41_0x2e3c32['eq'](_0xccf231,_0x75e87f[_0x56fdeb(0x170)]);return a41_0x2e3c32['lt'](_0xccf231,_0x75e87f['version']);}function getInstallPlanLabel(_0xe68484,_0x45dc16){const _0x1a3474=a41_0x187115;switch(_0x45dc16[_0x1a3474(0x163)]){case _0x1a3474(0x165):return'Beta\x20version:\x20'+a41_0x4c8403[_0x1a3474(0x18d)](_0xe68484)+_0x1a3474(0x175)+a41_0x4c8403['green'](_0x45dc16[_0x1a3474(0x170)]);case _0x1a3474(0x170):return _0x1a3474(0x14b)+a41_0x4c8403[_0x1a3474(0x18d)](_0xe68484)+_0x1a3474(0x175)+a41_0x4c8403[_0x1a3474(0x155)](_0x45dc16[_0x1a3474(0x170)]);case _0x1a3474(0x171):default:return _0x1a3474(0x17d)+a41_0x4c8403[_0x1a3474(0x18d)](_0xe68484)+_0x1a3474(0x175)+a41_0x4c8403[_0x1a3474(0x155)](_0x45dc16[_0x1a3474(0x170)]);}}async function installCliSkill(_0x39c526){const _0x191212=a41_0x187115;console[_0x191212(0x14e)](a41_0x4c8403[_0x191212(0x142)](_0x191212(0x18b)));const _0x2648c2=runNpxSkillsAddGlobal(process[_0x191212(0x162)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x39c526?_0x191212(0x159):_0x191212(0x167)});if(_0x2648c2['skipped']){console[_0x191212(0x14e)](a41_0x4c8403['gray'](_0x191212(0x173)));return;}if(_0x2648c2['ok']){console[_0x191212(0x14e)](a41_0x4c8403['gray'](_0x191212(0x146)));return;}console[_0x191212(0x15d)](a41_0x4c8403[_0x191212(0x18d)](_0x191212(0x17b)+(_0x2648c2[_0x191212(0x148)]||_0x191212(0x158)))),console[_0x191212(0x14e)](a41_0x4c8403['gray'](_0x191212(0x178)+CLI_BIN_NAME+_0x191212(0x17c)));}async function execute(_0x5c95ed){const _0x37925c=a41_0x187115;await validateUpdateFlags(_0x5c95ed);const _0x327450=getCurrentVersion();console[_0x37925c(0x14e)](_0x37925c(0x188)+_0x327450);const _0x4c2051=a41_0xc9a55e(_0x37925c(0x140))[_0x37925c(0x16f)](),_0x346766=await resolveTargetVersion(_0x5c95ed);if(!_0x346766){const _0x27592c=_0x5c95ed[_0x37925c(0x147)](_0x37925c(0x165))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x37925c(0x154);return _0x4c2051['fail'](_0x27592c),console[_0x37925c(0x14e)](a41_0x4c8403[_0x37925c(0x142)](_0x37925c(0x13e)+NPM_PACKAGE_NAME+_0x37925c(0x15e))),{'ok':![],'message':_0x27592c};}const _0x3215d8=a41_0x2e3c32['valid'](VERSION),_0x59f87e=a41_0x2e3c32[_0x37925c(0x13d)](_0x346766[_0x37925c(0x170)]);if(!_0x3215d8||!_0x59f87e)return _0x4c2051[_0x37925c(0x151)](_0x37925c(0x17f)),{'ok':![],'message':_0x37925c(0x17f)};if(!shouldInstallTarget(_0x3215d8,_0x346766)){const _0x1f5cd8=_0x346766[_0x37925c(0x163)]==='version'?'Already\x20on\x20requested\x20version\x20(v'+_0x346766[_0x37925c(0x170)]+')':_0x37925c(0x14f)+_0x346766[_0x37925c(0x170)]+')';return _0x4c2051['succeed'](_0x1f5cd8),shouldSkipCliSkill(_0x5c95ed)?console[_0x37925c(0x14e)](a41_0x4c8403['gray']('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).')):await installCliSkill(_0x5c95ed[_0x37925c(0x16b)]),{'ok':!![]};}_0x4c2051['info'](getInstallPlanLabel(_0x327450,_0x346766));const _0x5eaaf3=detectPackageManager(),_0x5450c7=_0x5eaaf3===_0x37925c(0x150)?resolveNpmBin(_0x37925c(0x150)):_0x5eaaf3,_0x1ca9f2=a41_0xc9a55e('Updating\x20via\x20'+_0x5eaaf3+_0x37925c(0x181))[_0x37925c(0x16f)]();try{return await execa(_0x5450c7,[_0x37925c(0x145),'-g',NPM_PACKAGE_NAME+'@'+_0x346766[_0x37925c(0x170)]],{'stdio':_0x37925c(0x159)}),_0x1ca9f2[_0x37925c(0x186)](_0x37925c(0x15b)+_0x346766[_0x37925c(0x170)]),console[_0x37925c(0x14e)](a41_0x4c8403[_0x37925c(0x142)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),shouldSkipCliSkill(_0x5c95ed)?console[_0x37925c(0x14e)](a41_0x4c8403[_0x37925c(0x142)]('Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).')):await installCliSkill(_0x5c95ed[_0x37925c(0x16b)]),{'ok':!![]};}catch(_0x37e87d){return _0x1ca9f2['fail'](_0x37925c(0x14a)),console['error'](a41_0x4c8403[_0x37925c(0x179)]('\x20\x20'+_0x37e87d[_0x37925c(0x164)])),console['log'](a41_0x4c8403[_0x37925c(0x142)](_0x37925c(0x153)+_0x5eaaf3+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x346766[_0x37925c(0x170)])),{'ok':![],'message':_0x37e87d[_0x37925c(0x164)]};}}export const updateDefinition={'service':'update','command':a41_0x187115(0x176),'description':a41_0x187115(0x157),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
@@ -1 +1 @@
1
- function a42_0x2ef9(_0x399e14,_0x1ca40d){_0x399e14=_0x399e14-0x1b3;const _0x15b6f1=a42_0x15b6();let _0x2ef95d=_0x15b6f1[_0x399e14];return _0x2ef95d;}function a42_0x15b6(){const _0x4ba6eb=['5984343dKrisr','1462540Dnnamb','1106550gRQdsX','147983ykVbEf','1906420weLdQR','1462592jCbXRR','10byjLNB','63wJetAX','7622442bFRden'];a42_0x15b6=function(){return _0x4ba6eb;};return a42_0x15b6();}(function(_0x417cfe,_0x2e6a89){const _0x2a63bd=a42_0x2ef9,_0x300de8=_0x417cfe();while(!![]){try{const _0x1d1e6c=-parseInt(_0x2a63bd(0x1b8))/0x1*(parseInt(_0x2a63bd(0x1bb))/0x2)+-parseInt(_0x2a63bd(0x1b7))/0x3+-parseInt(_0x2a63bd(0x1b9))/0x4+parseInt(_0x2a63bd(0x1b6))/0x5+parseInt(_0x2a63bd(0x1b4))/0x6+-parseInt(_0x2a63bd(0x1b3))/0x7*(-parseInt(_0x2a63bd(0x1ba))/0x8)+-parseInt(_0x2a63bd(0x1b5))/0x9;if(_0x1d1e6c===_0x2e6a89)break;else _0x300de8['push'](_0x300de8['shift']());}catch(_0x4c21f5){_0x300de8['push'](_0x300de8['shift']());}}}(a42_0x15b6,0xe9e52));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
1
+ function a42_0x198b(_0x30813a,_0x5f119a){_0x30813a=_0x30813a-0x1c9;const _0x1d2bd9=a42_0x1d2b();let _0x198bec=_0x1d2bd9[_0x30813a];return _0x198bec;}(function(_0x1bb780,_0x495771){const _0x213a18=a42_0x198b,_0xbb53b=_0x1bb780();while(!![]){try{const _0x30570c=parseInt(_0x213a18(0x1d0))/0x1*(parseInt(_0x213a18(0x1cc))/0x2)+-parseInt(_0x213a18(0x1c9))/0x3*(parseInt(_0x213a18(0x1d4))/0x4)+-parseInt(_0x213a18(0x1d2))/0x5*(parseInt(_0x213a18(0x1d3))/0x6)+-parseInt(_0x213a18(0x1cb))/0x7+parseInt(_0x213a18(0x1cf))/0x8*(-parseInt(_0x213a18(0x1ce))/0x9)+parseInt(_0x213a18(0x1cd))/0xa*(-parseInt(_0x213a18(0x1d1))/0xb)+parseInt(_0x213a18(0x1ca))/0xc;if(_0x30570c===_0x495771)break;else _0xbb53b['push'](_0xbb53b['shift']());}catch(_0x6e818a){_0xbb53b['push'](_0xbb53b['shift']());}}}(a42_0x1d2b,0xce159));function a42_0x1d2b(){const _0x2c2702=['11lWbsBI','260bqJIwq','109170TvdKGS','8kdTtCm','1379283FyCjrm','43935480CeDOJp','3353315KjUNlU','2468rwYkBA','11796490sZvvwg','377469argLrB','56IcOYBJ','811AntvwQ'];a42_0x1d2b=function(){return _0x2c2702;};return a42_0x1d2b();}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
@@ -1 +1 @@
1
- function a43_0x4ea0(_0x523ed7,_0x316656){_0x523ed7=_0x523ed7-0xec;const _0x4558cf=a43_0x4558();let _0x4ea023=_0x4558cf[_0x523ed7];return _0x4ea023;}const a43_0x2f8811=a43_0x4ea0;function a43_0x4558(){const _0xd1dfbb=['82287vHIGAN','name','114586RakFnK','890nPeHUg','19707gJdAWU','185921iCbtDf','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','4221024GHWXLC','1480185XpEGBm','operation','code','skip-imports','20qBYOTW','930yWxEMc','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','492sIJzwc','str','codegen','read','bool','string'];a43_0x4558=function(){return _0xd1dfbb;};return a43_0x4558();}(function(_0x34a8a0,_0x156915){const _0x117288=a43_0x4ea0,_0x3c391b=_0x34a8a0();while(!![]){try{const _0x149c05=parseInt(_0x117288(0xee))/0x1+-parseInt(_0x117288(0x101))/0x2+parseInt(_0x117288(0xed))/0x3*(parseInt(_0x117288(0xf5))/0x4)+-parseInt(_0x117288(0xec))/0x5*(-parseInt(_0x117288(0xf9))/0x6)+-parseInt(_0x117288(0xf1))/0x7+-parseInt(_0x117288(0xf0))/0x8+-parseInt(_0x117288(0xff))/0x9*(-parseInt(_0x117288(0xf6))/0xa);if(_0x149c05===_0x156915)break;else _0x3c391b['push'](_0x3c391b['shift']());}catch(_0x4ced3a){_0x3c391b['push'](_0x3c391b['shift']());}}}(a43_0x4558,0x46235));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a43_0x2f8811(0xfb),'command':'sdk','description':a43_0x2f8811(0xf7),'risk':a43_0x2f8811(0xfc),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a43_0x2f8811(0xfe),'description':a43_0x2f8811(0xef)},{'name':a43_0x2f8811(0xf2),'type':'string','required':!![],'description':a43_0x2f8811(0xf8)},{'name':a43_0x2f8811(0xf4),'type':'boolean','description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x11f635){const _0x284fc2=a43_0x2f8811,{dataset:_0x564b8a,operation:_0x1b2893}=await getOperationDetail(_0x11f635['appCode'],_0x11f635[_0x284fc2(0xfa)]('code'),_0x11f635[_0x284fc2(0xfa)]('operation')),_0x436c29=generateSdkCode(_0x564b8a,_0x1b2893,{'includeImports':!_0x11f635[_0x284fc2(0xfd)](_0x284fc2(0xf4))});return{'ok':!![],'data':{'dataset':{'name':_0x564b8a[_0x284fc2(0x100)],'code':_0x564b8a[_0x284fc2(0xf3)],'tableName':_0x564b8a['tableName']},'operation':_0x11f635[_0x284fc2(0xfa)](_0x284fc2(0xf2)),'code':_0x436c29}};}};
1
+ const a43_0x4534f7=a43_0x516a;(function(_0x19b515,_0x320f2f){const _0x310dde=a43_0x516a,_0x576239=_0x19b515();while(!![]){try{const _0x12a300=parseInt(_0x310dde(0x1bd))/0x1+parseInt(_0x310dde(0x1c1))/0x2+parseInt(_0x310dde(0x1b7))/0x3*(parseInt(_0x310dde(0x1ae))/0x4)+-parseInt(_0x310dde(0x1c0))/0x5+parseInt(_0x310dde(0x1b6))/0x6+parseInt(_0x310dde(0x1b3))/0x7*(-parseInt(_0x310dde(0x1bf))/0x8)+-parseInt(_0x310dde(0x1af))/0x9*(parseInt(_0x310dde(0x1bb))/0xa);if(_0x12a300===_0x320f2f)break;else _0x576239['push'](_0x576239['shift']());}catch(_0x206078){_0x576239['push'](_0x576239['shift']());}}}(a43_0x1668,0x52f1a));function a43_0x1668(){const _0x48f2fe=['72YGutWL','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','string','operation','790363Zxuald','alias','code','1112622FBUPCQ','3uCfEJi','bool','str','appCode','471950uwYsbx','codegen','278214LXqeHC','skip-imports','8mQTnsA','1842695qFJIDn','287468pmKoSD','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','read','boolean','Omit\x20import\x20statements\x20from\x20generated\x20code','2365444bGGknz'];a43_0x1668=function(){return _0x48f2fe;};return a43_0x1668();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a43_0x516a(_0x2750a3,_0x5d7b76){_0x2750a3=_0x2750a3-0x1ac;const _0x1668cb=a43_0x1668();let _0x516a62=_0x1668cb[_0x2750a3];return _0x516a62;}export const codegenSdk={'service':a43_0x4534f7(0x1bc),'command':'sdk','description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':a43_0x4534f7(0x1c3),'flags':[CODE_FLAG_OPTIONAL,{'name':a43_0x4534f7(0x1b4),'type':a43_0x4534f7(0x1b1),'description':a43_0x4534f7(0x1c2)},{'name':a43_0x4534f7(0x1b2),'type':a43_0x4534f7(0x1b1),'required':!![],'description':a43_0x4534f7(0x1b0)},{'name':a43_0x4534f7(0x1be),'type':a43_0x4534f7(0x1ac),'description':a43_0x4534f7(0x1ad)}],async 'execute'(_0x43574d){const _0x269b09=a43_0x4534f7,{dataset:_0x3d7a8c,operation:_0x37df46}=await getOperationDetail(_0x43574d[_0x269b09(0x1ba)],_0x43574d[_0x269b09(0x1b9)]('code'),_0x43574d['str']('operation')),_0x12df86=generateSdkCode(_0x3d7a8c,_0x37df46,{'includeImports':!_0x43574d[_0x269b09(0x1b8)](_0x269b09(0x1be))});return{'ok':!![],'data':{'dataset':{'name':_0x3d7a8c['name'],'code':_0x3d7a8c[_0x269b09(0x1b5)],'tableName':_0x3d7a8c['tableName']},'operation':_0x43574d[_0x269b09(0x1b9)](_0x269b09(0x1b2)),'code':_0x12df86}};}};
@@ -1 +1 @@
1
- function a44_0x4fad(){const _0x3c9b20=['68DdgKYo','164576mOiIlz','2878638ldfMQU','sql','23238578KoADBI','sdk','562240UPjqzp','appCode','read','string','2313hBHaoI','35470rqOtHI','boolean','no-imports','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','sqlName','bff','8490DInePl','48XmsZtj','bool','Omit\x20import\x20statements\x20from\x20generated\x20code','sqlcode','str','13391DltSrz','target','918PpfhdB'];a44_0x4fad=function(){return _0x3c9b20;};return a44_0x4fad();}const a44_0x521b83=a44_0x38f8;(function(_0x12a480,_0x345b7d){const _0x1b1dbd=a44_0x38f8,_0x5b7625=_0x12a480();while(!![]){try{const _0x50f1c7=parseInt(_0x1b1dbd(0x1d7))/0x1*(parseInt(_0x1b1dbd(0x1da))/0x2)+parseInt(_0x1b1dbd(0x1c2))/0x3+-parseInt(_0x1b1dbd(0x1c1))/0x4+parseInt(_0x1b1dbd(0x1cb))/0x5*(parseInt(_0x1b1dbd(0x1d9))/0x6)+-parseInt(_0x1b1dbd(0x1c6))/0x7*(-parseInt(_0x1b1dbd(0x1d2))/0x8)+-parseInt(_0x1b1dbd(0x1ca))/0x9*(parseInt(_0x1b1dbd(0x1d1))/0xa)+-parseInt(_0x1b1dbd(0x1c4))/0xb;if(_0x50f1c7===_0x345b7d)break;else _0x5b7625['push'](_0x5b7625['shift']());}catch(_0x297395){_0x5b7625['push'](_0x5b7625['shift']());}}}(a44_0x4fad,0x94f9f));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a44_0x38f8(_0x1cdd27,_0x1aaa0a){_0x1cdd27=_0x1cdd27-0x1c1;const _0x4fad16=a44_0x4fad();let _0x38f867=_0x4fad16[_0x1cdd27];return _0x38f867;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':'codegen','command':a44_0x521b83(0x1c3),'description':a44_0x521b83(0x1ce),'risk':a44_0x521b83(0x1c8),'flags':[SQLCODE_FLAG,{'name':a44_0x521b83(0x1d8),'type':a44_0x521b83(0x1c9),'description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a44_0x521b83(0x1c5),'enum':[a44_0x521b83(0x1c5),a44_0x521b83(0x1d0)]},{'name':a44_0x521b83(0x1cd),'type':a44_0x521b83(0x1cc),'description':a44_0x521b83(0x1d4)}],async 'execute'(_0x1ee82b){const _0x4301b0=a44_0x521b83,_0x51b6d7=await getSqlQueryInfo(_0x1ee82b[_0x4301b0(0x1c7)],_0x1ee82b[_0x4301b0(0x1d6)](_0x4301b0(0x1d5))),_0x1d8122=_0x1ee82b[_0x4301b0(0x1d6)](_0x4301b0(0x1d8))||_0x4301b0(0x1c5),_0x27d99d=generateSqlCodeTemplate(_0x51b6d7,{'target':_0x1d8122,'includeImports':!_0x1ee82b[_0x4301b0(0x1d3)](_0x4301b0(0x1cd))});return{'ok':!![],'data':{'sqlCode':_0x51b6d7['sqlCode'],'sqlName':_0x51b6d7[_0x4301b0(0x1cf)],'target':_0x1d8122,'code':_0x27d99d}};}};
1
+ function a44_0x5975(){const _0xd2c42d=['appCode','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','5019417KPhRYT','sqlcode','no-imports','2298620qQgDnQ','95942xWnFMA','255241NQCTWt','bool','read','sdk','boolean','sqlCode','5290XnLVwt','24cxJYiq','target','351916rgwlgT','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','618NLeSGU','sqlName','sql','string','240cSxCKu','bff','1098444zocIqF','str','codegen'];a44_0x5975=function(){return _0xd2c42d;};return a44_0x5975();}const a44_0x473f14=a44_0x2ca7;function a44_0x2ca7(_0x27557f,_0x4960c9){_0x27557f=_0x27557f-0x158;const _0x59758b=a44_0x5975();let _0x2ca7c8=_0x59758b[_0x27557f];return _0x2ca7c8;}(function(_0x5b1eab,_0x376352){const _0xb9cee0=a44_0x2ca7,_0x3a4586=_0x5b1eab();while(!![]){try{const _0x17f64f=-parseInt(_0xb9cee0(0x16d))/0x1*(parseInt(_0xb9cee0(0x165))/0x2)+parseInt(_0xb9cee0(0x15c))/0x3+-parseInt(_0xb9cee0(0x16f))/0x4+-parseInt(_0xb9cee0(0x16c))/0x5*(parseInt(_0xb9cee0(0x171))/0x6)+parseInt(_0xb9cee0(0x166))/0x7*(parseInt(_0xb9cee0(0x15a))/0x8)+parseInt(_0xb9cee0(0x161))/0x9+parseInt(_0xb9cee0(0x164))/0xa;if(_0x17f64f===_0x376352)break;else _0x3a4586['push'](_0x3a4586['shift']());}catch(_0x1c5e99){_0x3a4586['push'](_0x3a4586['shift']());}}}(a44_0x5975,0xdb91c));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a44_0x473f14(0x15e),'command':a44_0x473f14(0x158),'description':a44_0x473f14(0x170),'risk':a44_0x473f14(0x168),'flags':[SQLCODE_FLAG,{'name':a44_0x473f14(0x16e),'type':a44_0x473f14(0x159),'description':a44_0x473f14(0x160),'default':a44_0x473f14(0x169),'enum':[a44_0x473f14(0x169),a44_0x473f14(0x15b)]},{'name':a44_0x473f14(0x163),'type':a44_0x473f14(0x16a),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x4674ff){const _0x4a60eb=a44_0x473f14,_0x32f9d0=await getSqlQueryInfo(_0x4674ff[_0x4a60eb(0x15f)],_0x4674ff[_0x4a60eb(0x15d)](_0x4a60eb(0x162))),_0x1af6fc=_0x4674ff[_0x4a60eb(0x15d)](_0x4a60eb(0x16e))||_0x4a60eb(0x169),_0x154a6c=generateSqlCodeTemplate(_0x32f9d0,{'target':_0x1af6fc,'includeImports':!_0x4674ff[_0x4a60eb(0x167)](_0x4a60eb(0x163))});return{'ok':!![],'data':{'sqlCode':_0x32f9d0[_0x4a60eb(0x16b)],'sqlName':_0x32f9d0[_0x4a60eb(0x172)],'target':_0x1af6fc,'code':_0x154a6c}};}};
@@ -1 +1 @@
1
- (function(_0x202fee,_0x342c01){const _0x2da56a=a45_0x14c2,_0x5d313e=_0x202fee();while(!![]){try{const _0x463a29=-parseInt(_0x2da56a(0xc6))/0x1*(-parseInt(_0x2da56a(0xe6))/0x2)+parseInt(_0x2da56a(0xe1))/0x3*(parseInt(_0x2da56a(0xe2))/0x4)+-parseInt(_0x2da56a(0xcc))/0x5+parseInt(_0x2da56a(0xd9))/0x6*(parseInt(_0x2da56a(0xd5))/0x7)+parseInt(_0x2da56a(0xc8))/0x8+-parseInt(_0x2da56a(0xce))/0x9*(-parseInt(_0x2da56a(0xd0))/0xa)+-parseInt(_0x2da56a(0xd6))/0xb*(parseInt(_0x2da56a(0xcd))/0xc);if(_0x463a29===_0x342c01)break;else _0x5d313e['push'](_0x5d313e['shift']());}catch(_0xbf63e9){_0x5d313e['push'](_0x5d313e['shift']());}}}(a45_0x3b48,0xa1a01));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x2e6de3 from'chalk';function a45_0x3b48(){const _0x33c458=['✎\x20手动输入','1899616SHOQXa','✎\x20自定义输入\x20appcode','正在获取可用应用列表...','length','2768505cdHktQ','192uuPIyI','10863999pYsMJt','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','10cabbbU','custom','skip','gray','获取到\x20','120659wkfYYS','1726769GbiMCz','message','cyan','132xBpxSX','appCode','includes','\x20\x20(','appName','yellow','manual','\x0a未找到可用应用。','3426657XCJDAy','4PMrZmx','trim','map','find','1522772UhXmFZ','(跳过,稍后配置)','请选择要绑定的应用:','valid','无法获取远程应用列表,请手动输入。','1bqeLfz'];a45_0x3b48=function(){return _0x33c458;};return a45_0x3b48();}import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x41c0c2=await input({'message':'请输入\x20App\x20Code:','validate':_0x2182c3=>{const _0x487e5c=a45_0x14c2,_0x120c5c=validateAppcode(_0x2182c3[_0x487e5c(0xe3)]());return _0x120c5c[_0x487e5c(0xc4)]||_0x120c5c[_0x487e5c(0xd7)]||'Invalid\x20App\x20Code';}});return _0x41c0c2['trim']();}export async function promptAppSelection(_0x39bc5d){const _0x16cae2=a45_0x14c2,_0x3c7ec1=[{'name':a45_0x2e6de3[_0x16cae2(0xde)](_0x16cae2(0xc9)),'value':-0x1},..._0x39bc5d[_0x16cae2(0xe4)]((_0x153ecd,_0x3bd4a4)=>({'name':_0x153ecd[_0x16cae2(0xdd)]+'\x20\x20'+a45_0x2e6de3['gray']('('+_0x153ecd['appCode']+')'),'value':_0x3bd4a4}))],_0x37ebab=await checkbox({'message':_0x16cae2(0xd4)+a45_0x2e6de3[_0x16cae2(0xd8)](_0x39bc5d[_0x16cae2(0xcb)])+'\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','choices':_0x3c7ec1,'loop':![]});if(_0x37ebab[_0x16cae2(0xdb)](-0x1))return _0x16cae2(0xd1);if(_0x37ebab[_0x16cae2(0xcb)]===0x0)return _0x16cae2(0xd1);return _0x37ebab['map'](_0x508e7e=>_0x39bc5d[_0x508e7e]);}function a45_0x14c2(_0x146512,_0x215e6c){_0x146512=_0x146512-0xc4;const _0x3b4847=a45_0x3b48();let _0x14c205=_0x3b4847[_0x146512];return _0x14c205;}export async function promptSingleAppSelection(_0x513982){const _0x548b65=a45_0x14c2,_0x12de91=[{'name':a45_0x2e6de3['gray']('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':_0x548b65(0xd2)},{'name':a45_0x2e6de3[_0x548b65(0xde)](_0x548b65(0xc9)),'value':_0x548b65(0xd1)},..._0x513982['map'](_0x4fb2bc=>({'name':_0x4fb2bc[_0x548b65(0xdd)]+'\x20\x20'+a45_0x2e6de3[_0x548b65(0xd3)]('('+_0x4fb2bc[_0x548b65(0xda)]+')'),'value':_0x4fb2bc[_0x548b65(0xda)]}))],_0x73012b=await select({'message':_0x548b65(0xe8),'choices':_0x12de91});if(_0x73012b===_0x548b65(0xd2))return'skip';if(_0x73012b===_0x548b65(0xd1))return _0x548b65(0xd1);return _0x513982[_0x548b65(0xe5)](_0x1e39f1=>_0x1e39f1[_0x548b65(0xda)]===_0x73012b);}export async function selectSingleAppcode(_0x15b3be){const _0x2b4f83=a45_0x14c2;if(!_0x15b3be)return writeCliSideChannelLine(a45_0x2e6de3[_0x2b4f83(0xd3)](_0x2b4f83(0xcf))),_fallbackOrSkip();writeCliSideChannelLine(_0x2b4f83(0xca));let _0x209fcb;try{_0x209fcb=await withActiveCookie(_0x15b3be,()=>listRemoteApps());}catch(_0x83285e){writeCliSideChannelLine(a45_0x2e6de3[_0x2b4f83(0xde)](_0x2b4f83(0xc5)));if(_0x83285e instanceof Error)writeCliSideChannelLine(a45_0x2e6de3['gray'](_0x2b4f83(0xdc)+_0x83285e[_0x2b4f83(0xd7)]+')'));return _fallbackOrSkip();}if(_0x209fcb[_0x2b4f83(0xcb)]===0x0)return writeCliSideChannelLine(a45_0x2e6de3[_0x2b4f83(0xde)]('未找到可用应用。')),_fallbackOrSkip();const _0xc968a6=await promptSingleAppSelection(_0x209fcb);if(_0xc968a6==='skip')return'';if(_0xc968a6===_0x2b4f83(0xd1))return promptCustomAppcode();return _0xc968a6[_0x2b4f83(0xda)];}export async function selectMultipleApps(_0x40584f){const _0x218270=a45_0x14c2;writeCliSideChannelLine(_0x218270(0xca));let _0xd8c6ee;try{_0xd8c6ee=await withActiveCookie(_0x40584f,()=>listRemoteApps());}catch(_0xb61361){writeCliSideChannelLine('\x0a无法获取远程应用列表,请手动输入。');if(_0xb61361 instanceof Error)writeCliSideChannelLine(_0x218270(0xdc)+_0xb61361['message']+')');return _0x218270(0xd1);}if(_0xd8c6ee[_0x218270(0xcb)]===0x0)return writeCliSideChannelLine(_0x218270(0xe0)),_0x218270(0xd1);return promptAppSelection(_0xd8c6ee);}async function _fallbackOrSkip(){const _0x5b90ce=a45_0x14c2,_0x392dd6=await select({'message':'App\x20Code:','choices':[{'name':a45_0x2e6de3[_0x5b90ce(0xd3)](_0x5b90ce(0xe7)),'value':_0x5b90ce(0xd2)},{'name':a45_0x2e6de3[_0x5b90ce(0xde)](_0x5b90ce(0xc7)),'value':_0x5b90ce(0xdf)}]});if(_0x392dd6===_0x5b90ce(0xd2))return'';return promptCustomAppcode();}
1
+ (function(_0x5a296e,_0x54b042){const _0x4bf625=a45_0x3f46,_0x80260b=_0x5a296e();while(!![]){try{const _0x3526cd=-parseInt(_0x4bf625(0x209))/0x1+parseInt(_0x4bf625(0x204))/0x2+-parseInt(_0x4bf625(0x20f))/0x3*(parseInt(_0x4bf625(0x205))/0x4)+-parseInt(_0x4bf625(0x1f9))/0x5*(-parseInt(_0x4bf625(0x203))/0x6)+parseInt(_0x4bf625(0x1f4))/0x7*(-parseInt(_0x4bf625(0x1ef))/0x8)+-parseInt(_0x4bf625(0x1f2))/0x9+-parseInt(_0x4bf625(0x1ff))/0xa*(-parseInt(_0x4bf625(0x1f3))/0xb);if(_0x3526cd===_0x54b042)break;else _0x80260b['push'](_0x80260b['shift']());}catch(_0x274c6b){_0x80260b['push'](_0x80260b['shift']());}}}(a45_0x4fc5,0xb5baa));import{input,checkbox,select}from'@inquirer/prompts';function a45_0x4fc5(){const _0x533255=['6412Ipfpuh','\x20\x20(','message','App\x20Code:','获取到\x20','638965DxvHKP','custom','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','skip','正在获取可用应用列表...','find','180eXJtJh','yellow','cyan','map','30OJwxjq','2333892OlnMQA','2180056dgCEDJ','Invalid\x20App\x20Code','appCode','valid','355342HXqvWV','includes','trim','length','✎\x20自定义输入\x20appcode','请输入\x20App\x20Code:','3QYbMlq','gray','appName','manual','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','请选择要绑定的应用:','992VWHigM','未找到可用应用。','无法获取远程应用列表,请手动输入。','10866465kHPPYG','708752CMpGtA'];a45_0x4fc5=function(){return _0x533255;};return a45_0x4fc5();}import a45_0x1067de from'chalk';function a45_0x3f46(_0x2e61d9,_0xefac23){_0x2e61d9=_0x2e61d9-0x1ed;const _0x4fc559=a45_0x4fc5();let _0x3f4671=_0x4fc559[_0x2e61d9];return _0x3f4671;}import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x1334c9=a45_0x3f46,_0xa57292=await input({'message':_0x1334c9(0x20e),'validate':_0x544ee2=>{const _0x463588=_0x1334c9,_0x307a4f=validateAppcode(_0x544ee2[_0x463588(0x20b)]());return _0x307a4f[_0x463588(0x208)]||_0x307a4f[_0x463588(0x1f6)]||_0x463588(0x206);}});return _0xa57292[_0x1334c9(0x20b)]();}export async function promptAppSelection(_0x231874){const _0x1a48d9=a45_0x3f46,_0x549d1=[{'name':a45_0x1067de[_0x1a48d9(0x200)]('✎\x20自定义输入\x20appcode'),'value':-0x1},..._0x231874['map']((_0x27330d,_0x2bd9fd)=>({'name':_0x27330d[_0x1a48d9(0x211)]+'\x20\x20'+a45_0x1067de['gray']('('+_0x27330d[_0x1a48d9(0x207)]+')'),'value':_0x2bd9fd}))],_0x3eaa19=await checkbox({'message':_0x1a48d9(0x1f8)+a45_0x1067de[_0x1a48d9(0x201)](_0x231874[_0x1a48d9(0x20c)])+'\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','choices':_0x549d1,'loop':![]});if(_0x3eaa19[_0x1a48d9(0x20a)](-0x1))return _0x1a48d9(0x1fa);if(_0x3eaa19[_0x1a48d9(0x20c)]===0x0)return _0x1a48d9(0x1fa);return _0x3eaa19[_0x1a48d9(0x202)](_0x2aa7e4=>_0x231874[_0x2aa7e4]);}export async function promptSingleAppSelection(_0x19a56f){const _0x46cc61=a45_0x3f46,_0x1dff0b=[{'name':a45_0x1067de[_0x46cc61(0x210)](_0x46cc61(0x1ed)),'value':_0x46cc61(0x1fc)},{'name':a45_0x1067de[_0x46cc61(0x200)](_0x46cc61(0x20d)),'value':_0x46cc61(0x1fa)},..._0x19a56f[_0x46cc61(0x202)](_0x3fb29e=>({'name':_0x3fb29e[_0x46cc61(0x211)]+'\x20\x20'+a45_0x1067de['gray']('('+_0x3fb29e['appCode']+')'),'value':_0x3fb29e[_0x46cc61(0x207)]}))],_0x511e45=await select({'message':_0x46cc61(0x1ee),'choices':_0x1dff0b});if(_0x511e45===_0x46cc61(0x1fc))return _0x46cc61(0x1fc);if(_0x511e45==='custom')return _0x46cc61(0x1fa);return _0x19a56f[_0x46cc61(0x1fe)](_0x11592b=>_0x11592b[_0x46cc61(0x207)]===_0x511e45);}export async function selectSingleAppcode(_0x5c27ec){const _0x466e87=a45_0x3f46;if(!_0x5c27ec)return writeCliSideChannelLine(a45_0x1067de[_0x466e87(0x210)](_0x466e87(0x1fb))),_fallbackOrSkip();writeCliSideChannelLine('正在获取可用应用列表...');let _0x85092e;try{_0x85092e=await withActiveCookie(_0x5c27ec,()=>listRemoteApps());}catch(_0x1d2ba3){writeCliSideChannelLine(a45_0x1067de[_0x466e87(0x200)](_0x466e87(0x1f1)));if(_0x1d2ba3 instanceof Error)writeCliSideChannelLine(a45_0x1067de[_0x466e87(0x210)](_0x466e87(0x1f5)+_0x1d2ba3[_0x466e87(0x1f6)]+')'));return _fallbackOrSkip();}if(_0x85092e[_0x466e87(0x20c)]===0x0)return writeCliSideChannelLine(a45_0x1067de[_0x466e87(0x200)](_0x466e87(0x1f0))),_fallbackOrSkip();const _0x59803d=await promptSingleAppSelection(_0x85092e);if(_0x59803d===_0x466e87(0x1fc))return'';if(_0x59803d===_0x466e87(0x1fa))return promptCustomAppcode();return _0x59803d[_0x466e87(0x207)];}export async function selectMultipleApps(_0xba469f){const _0x5b84b2=a45_0x3f46;writeCliSideChannelLine(_0x5b84b2(0x1fd));let _0x115fa6;try{_0x115fa6=await withActiveCookie(_0xba469f,()=>listRemoteApps());}catch(_0x1c30f0){writeCliSideChannelLine('\x0a无法获取远程应用列表,请手动输入。');if(_0x1c30f0 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x1c30f0[_0x5b84b2(0x1f6)]+')');return _0x5b84b2(0x1fa);}if(_0x115fa6[_0x5b84b2(0x20c)]===0x0)return writeCliSideChannelLine('\x0a未找到可用应用。'),'custom';return promptAppSelection(_0x115fa6);}async function _fallbackOrSkip(){const _0x16361b=a45_0x3f46,_0x57c010=await select({'message':_0x16361b(0x1f7),'choices':[{'name':a45_0x1067de[_0x16361b(0x210)]('(跳过,稍后配置)'),'value':_0x16361b(0x1fc)},{'name':a45_0x1067de['yellow']('✎\x20手动输入'),'value':_0x16361b(0x212)}]});if(_0x57c010===_0x16361b(0x1fc))return'';return promptCustomAppcode();}
@@ -1 +1 @@
1
- function a46_0x50b9(){const _0x165e2f=['9PQtBwE','449421nhOBea','1629064WMehxE','number','130505lwaayR','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','301615vIVZSH','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','string','1878OiTBUH','2875288sKdiSM','dbtype','MYSQL','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','datasetcode','4605399DwXhxm','code','Dataset\x20code\x20(32-char\x20hex\x20UUID)','sqlcode','18KHwgRb','POSTGRESQL'];a46_0x50b9=function(){return _0x165e2f;};return a46_0x50b9();}const a46_0x1eca74=a46_0x5483;(function(_0xb62647,_0x37718c){const _0x55eefa=a46_0x5483,_0x1c69cd=_0xb62647();while(!![]){try{const _0x5acd1a=parseInt(_0x55eefa(0x1ef))/0x1+parseInt(_0x55eefa(0x1dd))/0x2*(-parseInt(_0x55eefa(0x1e9))/0x3)+-parseInt(_0x55eefa(0x1eb))/0x4+-parseInt(_0x55eefa(0x1ed))/0x5+parseInt(_0x55eefa(0x1e7))/0x6*(parseInt(_0x55eefa(0x1ea))/0x7)+-parseInt(_0x55eefa(0x1de))/0x8+parseInt(_0x55eefa(0x1e3))/0x9;if(_0x5acd1a===_0x37718c)break;else _0x1c69cd['push'](_0x1c69cd['shift']());}catch(_0x1b69c2){_0x1c69cd['push'](_0x1c69cd['shift']());}}}(a46_0x50b9,0x335a4));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a46_0x1eca74(0x1ee)};export const CODE_FLAG={'name':a46_0x1eca74(0x1e4),'type':'string','required':!![],'description':a46_0x1eca74(0x1e5),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a46_0x1eca74(0x1e2),'description':a46_0x1eca74(0x1e5)};export const SQLCODE_FLAG={'name':a46_0x1eca74(0x1e6),'type':a46_0x1eca74(0x1dc),'required':!![],'description':a46_0x1eca74(0x1e1),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a46_0x1eca74(0x1db)}};function a46_0x5483(_0x22c19c,_0x4dc305){_0x22c19c=_0x22c19c-0x1db;const _0x50b9ce=a46_0x50b9();let _0x5483b1=_0x50b9ce[_0x22c19c];return _0x5483b1;}export const APPCODE_FLAG_OPTIONAL={'name':'appcode','type':'string','required':![],'description':a46_0x1eca74(0x1f0)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a46_0x1eca74(0x1ec),'required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};export const DB_TYPE_FLAG={'name':a46_0x1eca74(0x1df),'type':a46_0x1eca74(0x1dc),'required':!![],'description':'Database\x20product\x20type','enum':[a46_0x1eca74(0x1e0),a46_0x1eca74(0x1e8)]};
1
+ const a46_0x2010a2=a46_0x234f;function a46_0x66fe(){const _0x49af96=['83484xoZZnk','Database\x20product\x20type','sqlcode','Dataset\x20code\x20(32-char\x20hex\x20UUID)','298550CriZbW','3188vWdNlC','MYSQL','2298ckSMQU','3651208ReyGdd','1111GmsNtJ','24MoQVSl','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','7EDZxjN','87876gQmHgI','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','appcode','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','datasetcode','790Evydfr','code','479028IgnIHR','29642YevMYu','POSTGRESQL','dbtype','string'];a46_0x66fe=function(){return _0x49af96;};return a46_0x66fe();}function a46_0x234f(_0x2e0600,_0x5ea19a){_0x2e0600=_0x2e0600-0x6a;const _0x66fecf=a46_0x66fe();let _0x234f97=_0x66fecf[_0x2e0600];return _0x234f97;}(function(_0x700f14,_0x55f444){const _0x5a2463=a46_0x234f,_0x17f59a=_0x700f14();while(!![]){try{const _0x2fa8ce=parseInt(_0x5a2463(0x6f))/0x1+-parseInt(_0x5a2463(0x70))/0x2+-parseInt(_0x5a2463(0x7b))/0x3*(-parseInt(_0x5a2463(0x79))/0x4)+parseInt(_0x5a2463(0x78))/0x5*(-parseInt(_0x5a2463(0x7e))/0x6)+parseInt(_0x5a2463(0x81))/0x7*(-parseInt(_0x5a2463(0x7c))/0x8)+-parseInt(_0x5a2463(0x74))/0x9*(-parseInt(_0x5a2463(0x6d))/0xa)+parseInt(_0x5a2463(0x7d))/0xb*(-parseInt(_0x5a2463(0x82))/0xc);if(_0x2fa8ce===_0x55f444)break;else _0x17f59a['push'](_0x17f59a['shift']());}catch(_0x172b34){_0x17f59a['push'](_0x17f59a['shift']());}}}(a46_0x66fe,0x5afa9));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':'a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)'};export const CODE_FLAG={'name':a46_0x2010a2(0x6e),'type':a46_0x2010a2(0x73),'required':!![],'description':a46_0x2010a2(0x77),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a46_0x2010a2(0x6c),'description':a46_0x2010a2(0x77)};export const SQLCODE_FLAG={'name':a46_0x2010a2(0x76),'type':a46_0x2010a2(0x73),'required':!![],'description':a46_0x2010a2(0x80),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a46_0x2010a2(0x7f)}};export const APPCODE_FLAG_OPTIONAL={'name':a46_0x2010a2(0x6a),'type':a46_0x2010a2(0x73),'required':![],'description':a46_0x2010a2(0x83)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':'number','required':!![],'description':a46_0x2010a2(0x6b)};export const DB_TYPE_FLAG={'name':a46_0x2010a2(0x72),'type':a46_0x2010a2(0x73),'required':!![],'description':a46_0x2010a2(0x75),'enum':[a46_0x2010a2(0x7a),a46_0x2010a2(0x71)]};
@@ -1 +1 @@
1
- function a47_0x5a25(){const _0x464291=['App\x20Code\x20cannot\x20be\x20empty','test','60MvjIRF','App\x20Code\x20cannot\x20exceed\x20100\x20characters','900Qaciwg','trim','2237998dqcqJr','1606275dWRWZQ','23010FiooxC','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','520482bNxnxI','737LnieBj','3508vAmNYS','143274ReSaUD','7384SazjDW','1hfXHjO'];a47_0x5a25=function(){return _0x464291;};return a47_0x5a25();}function a47_0x4386(_0x25bbd2,_0x3cbb68){_0x25bbd2=_0x25bbd2-0x11a;const _0x5a251f=a47_0x5a25();let _0x438679=_0x5a251f[_0x25bbd2];return _0x438679;}(function(_0x48cc47,_0x1a4ab0){const _0x3bae28=a47_0x4386,_0x29c41f=_0x48cc47();while(!![]){try{const _0x5606f2=parseInt(_0x3bae28(0x11b))/0x1*(parseInt(_0x3bae28(0x129))/0x2)+-parseInt(_0x3bae28(0x11e))/0x3*(parseInt(_0x3bae28(0x128))/0x4)+parseInt(_0x3bae28(0x123))/0x5+parseInt(_0x3bae28(0x126))/0x6+-parseInt(_0x3bae28(0x122))/0x7+-parseInt(_0x3bae28(0x11a))/0x8*(parseInt(_0x3bae28(0x120))/0x9)+-parseInt(_0x3bae28(0x124))/0xa*(-parseInt(_0x3bae28(0x127))/0xb);if(_0x5606f2===_0x1a4ab0)break;else _0x29c41f['push'](_0x29c41f['shift']());}catch(_0x207e4e){_0x29c41f['push'](_0x29c41f['shift']());}}}(a47_0x5a25,0x31ddc));export function validateAppcode(_0x28e39e){const _0x3d73ba=a47_0x4386,_0x3a815d=_0x28e39e[_0x3d73ba(0x121)]();if(!_0x3a815d)return{'valid':![],'message':_0x3d73ba(0x11c)};if(_0x3a815d['length']>0x64)return{'valid':![],'message':_0x3d73ba(0x11f)};if(!/^[A-Za-z0-9_-]+$/[_0x3d73ba(0x11d)](_0x3a815d))return{'valid':![],'message':_0x3d73ba(0x125)};return{'valid':!![]};}
1
+ function a47_0x2b7b(){const _0x3c6e91=['trim','9JOjMuO','750449trjTbv','119OKCriQ','2775635abQlfk','374264FEpqxO','test','3245900lWtHtK','9008058WfkSqd','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','412239aFMMNB','App\x20Code\x20cannot\x20be\x20empty','length','2mvkDzD','11957070ubUozk','App\x20Code\x20cannot\x20exceed\x20100\x20characters'];a47_0x2b7b=function(){return _0x3c6e91;};return a47_0x2b7b();}function a47_0x2164(_0x314af9,_0x5c985c){_0x314af9=_0x314af9-0x183;const _0x2b7b41=a47_0x2b7b();let _0x216473=_0x2b7b41[_0x314af9];return _0x216473;}(function(_0x5b12fe,_0x1a06cc){const _0x462df6=a47_0x2164,_0x599abb=_0x5b12fe();while(!![]){try{const _0x5121d1=-parseInt(_0x462df6(0x189))/0x1*(-parseInt(_0x462df6(0x184))/0x2)+-parseInt(_0x462df6(0x191))/0x3+-parseInt(_0x462df6(0x18e))/0x4+parseInt(_0x462df6(0x18b))/0x5+-parseInt(_0x462df6(0x18f))/0x6+-parseInt(_0x462df6(0x18a))/0x7*(-parseInt(_0x462df6(0x18c))/0x8)+parseInt(_0x462df6(0x188))/0x9*(parseInt(_0x462df6(0x185))/0xa);if(_0x5121d1===_0x1a06cc)break;else _0x599abb['push'](_0x599abb['shift']());}catch(_0x42a3de){_0x599abb['push'](_0x599abb['shift']());}}}(a47_0x2b7b,0xcea1b));export function validateAppcode(_0x4d4b4a){const _0x104777=a47_0x2164,_0x47e276=_0x4d4b4a[_0x104777(0x187)]();if(!_0x47e276)return{'valid':![],'message':_0x104777(0x192)};if(_0x47e276[_0x104777(0x183)]>0x64)return{'valid':![],'message':_0x104777(0x186)};if(!/^[A-Za-z0-9_-]+$/[_0x104777(0x18d)](_0x47e276))return{'valid':![],'message':_0x104777(0x190)};return{'valid':!![]};}
@@ -1 +1 @@
1
- const a48_0x29dd7b=a48_0x309f;(function(_0x261ff7,_0x7b2e7f){const _0x55c1f6=a48_0x309f,_0x507ba8=_0x261ff7();while(!![]){try{const _0x55fffd=parseInt(_0x55c1f6(0xd9))/0x1+-parseInt(_0x55c1f6(0xc6))/0x2*(parseInt(_0x55c1f6(0xce))/0x3)+-parseInt(_0x55c1f6(0xc8))/0x4+parseInt(_0x55c1f6(0xcb))/0x5+-parseInt(_0x55c1f6(0xda))/0x6*(parseInt(_0x55c1f6(0xc9))/0x7)+-parseInt(_0x55c1f6(0xd0))/0x8*(parseInt(_0x55c1f6(0xd2))/0x9)+parseInt(_0x55c1f6(0xca))/0xa;if(_0x55fffd===_0x7b2e7f)break;else _0x507ba8['push'](_0x507ba8['shift']());}catch(_0x20affb){_0x507ba8['push'](_0x507ba8['shift']());}}}(a48_0x41d2,0xe87c3));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x30db25){const _0x32e9e9=a48_0x309f,_0x47e7f1=_0x30db25['str'](_0x32e9e9(0xdb));if(!_0x47e7f1)throw CliErrors[_0x32e9e9(0xd5)](_0x32e9e9(0xd4),_0x32e9e9(0xcf)+CLI_BIN_NAME+_0x32e9e9(0xd7));const _0x2dd378=readConfig(),_0x4ec950=_0x47e7f1==='app'?_0x32e9e9(0xc7):_0x47e7f1,_0xd9c509=_0x2dd378[_0x4ec950];if(_0xd9c509===undefined)throw CliErrors[_0x32e9e9(0xd5)]('Key\x20not\x20found:\x20'+_0x47e7f1);return{'ok':!![],'data':typeof _0xd9c509===_0x32e9e9(0xd1)?_0xd9c509:{[_0x4ec950]:_0xd9c509},'message':typeof _0xd9c509===_0x32e9e9(0xd1)?undefined:String(_0xd9c509)};}function a48_0x309f(_0x27e843,_0x12266f){_0x27e843=_0x27e843-0xc6;const _0x41d280=a48_0x41d2();let _0x309ff0=_0x41d280[_0x27e843];return _0x309ff0;}export const configGetDefinition={'service':a48_0x29dd7b(0xcd),'command':a48_0x29dd7b(0xd3),'description':a48_0x29dd7b(0xd6),'risk':a48_0x29dd7b(0xcc),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a48_0x29dd7b(0xd8),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};function a48_0x41d2(){const _0x5e3955=['Usage:\x20','8gWlCMQ','object','8390178NzYDoQ','get','Missing\x20key.','validation','Get\x20a\x20config\x20value\x20by\x20key','\x20config\x20get\x20--key\x20<key>','string','1368062HomZtN','8780082scieeD','key','10haHgrJ','appcode','2516236dFaKZj','7WJAZQS','24994660QdJnVL','4694620EmvACs','read','config','497727sBQkKb'];a48_0x41d2=function(){return _0x5e3955;};return a48_0x41d2();}
1
+ const a48_0x1051ed=a48_0x2574;(function(_0x58edeb,_0x41bb01){const _0x4e3938=a48_0x2574,_0xd40a60=_0x58edeb();while(!![]){try{const _0x268ee3=parseInt(_0x4e3938(0x151))/0x1*(parseInt(_0x4e3938(0x159))/0x2)+-parseInt(_0x4e3938(0x154))/0x3+-parseInt(_0x4e3938(0x156))/0x4+parseInt(_0x4e3938(0x162))/0x5+parseInt(_0x4e3938(0x14e))/0x6+-parseInt(_0x4e3938(0x152))/0x7*(-parseInt(_0x4e3938(0x158))/0x8)+parseInt(_0x4e3938(0x160))/0x9;if(_0x268ee3===_0x41bb01)break;else _0xd40a60['push'](_0xd40a60['shift']());}catch(_0x4bb0fa){_0xd40a60['push'](_0xd40a60['shift']());}}}(a48_0x55f5,0x1b716));import{CliErrors}from'../../errors.js';function a48_0x55f5(){const _0x677c0d=['object','1016082HjQEda','Key\x20not\x20found:\x20','33845DWlbPa','370098pjOcit','appcode','validation','50967sqXfEz','178773emCdYl','key','104283IDwcLk','read','544912VgVPZX','app','16pElwCR','2hzuAOX','Get\x20a\x20config\x20value\x20by\x20key','get','Missing\x20key.','str','config'];a48_0x55f5=function(){return _0x677c0d;};return a48_0x55f5();}import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';function a48_0x2574(_0x3b0842,_0x1294c0){_0x3b0842=_0x3b0842-0x14e;const _0x55f5b9=a48_0x55f5();let _0x2574a3=_0x55f5b9[_0x3b0842];return _0x2574a3;}async function execute(_0x322f91){const _0xea5da7=a48_0x2574,_0x529208=_0x322f91[_0xea5da7(0x15d)]('key');if(!_0x529208)throw CliErrors[_0xea5da7(0x150)](_0xea5da7(0x15c),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20get\x20--key\x20<key>');const _0x30c5d0=readConfig(),_0x2b8c60=_0x529208===_0xea5da7(0x157)?_0xea5da7(0x14f):_0x529208,_0x56e25d=_0x30c5d0[_0x2b8c60];if(_0x56e25d===undefined)throw CliErrors[_0xea5da7(0x150)](_0xea5da7(0x161)+_0x529208);return{'ok':!![],'data':typeof _0x56e25d===_0xea5da7(0x15f)?_0x56e25d:{[_0x2b8c60]:_0x56e25d},'message':typeof _0x56e25d===_0xea5da7(0x15f)?undefined:String(_0x56e25d)};}export const configGetDefinition={'service':a48_0x1051ed(0x15e),'command':a48_0x1051ed(0x15b),'description':a48_0x1051ed(0x15a),'risk':a48_0x1051ed(0x155),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a48_0x1051ed(0x153),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};