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

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 (241) hide show
  1. package/README.md +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/add.js +1 -1
  21. package/lib/commands/app/discover.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/remove.js +1 -1
  25. package/lib/commands/app/shared.js +1 -1
  26. package/lib/commands/app/use.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -0
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-selector.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/validate.js +1 -1
  50. package/lib/commands/config/get.js +1 -1
  51. package/lib/commands/config/index.js +1 -1
  52. package/lib/commands/config/list.js +1 -1
  53. package/lib/commands/config/set.js +1 -1
  54. package/lib/commands/config/shared.js +1 -1
  55. package/lib/commands/data/filter.js +1 -1
  56. package/lib/commands/data/getOne.js +1 -1
  57. package/lib/commands/data/index.js +1 -1
  58. package/lib/commands/data/shared.js +1 -1
  59. package/lib/commands/dataset/business-group-update.js +1 -1
  60. package/lib/commands/dataset/capability.js +1 -1
  61. package/lib/commands/dataset/delete.js +1 -1
  62. package/lib/commands/dataset/detail.js +1 -1
  63. package/lib/commands/dataset/extend-update.js +1 -1
  64. package/lib/commands/dataset/field-update.js +1 -1
  65. package/lib/commands/dataset/index.js +1 -1
  66. package/lib/commands/dataset/list.js +1 -1
  67. package/lib/commands/dataset/operations.js +1 -1
  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 -0
  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
  219. package/templates/README.md +15 -25
  220. package/templates/generate-api/api.ts.tpl +2 -2
  221. package/templates/generate-api/client.ts.tpl +2 -2
  222. package/templates/projects/sub-app-react-demo/CHANGELOG.md +15 -1
  223. package/templates/projects/sub-app-react-demo/README.md +159 -231
  224. package/templates/projects/sub-app-react-demo/docs/quick-start.md +145 -426
  225. package/templates/projects/sub-app-react-demo/src/api/api.ts +8 -65
  226. package/templates/projects/sub-app-react-demo/src/api/client.ts +10 -42
  227. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.module.css +28 -0
  228. package/templates/projects/sub-app-react-demo/src/components/demo-page-container/DemoPageContainer.tsx +55 -0
  229. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +6 -9
  230. package/templates/projects/sub-app-react-demo/src/main.tsx +10 -6
  231. package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +3 -5
  232. package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +153 -148
  233. package/templates/projects/sub-app-react-demo/src/pages/index.module.css +500 -0
  234. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +517 -343
  235. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +325 -242
  236. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.module.css +8 -6
  237. package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +174 -87
  238. package/templates/projects/sub-app-react-demo/src/style.css +19 -3
  239. package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +1 -1
  240. package/lib/commands/skill/index.js +0 -1
  241. package/templates/projects/sub-app-react-demo/docs/API_RULE_CHANGE.md +0 -212
@@ -1 +1 @@
1
- const a33_0x1639e8=a33_0x1e87;(function(_0x197327,_0xc1a27c){const _0x12b06c=a33_0x1e87,_0x43ea49=_0x197327();while(!![]){try{const _0x3a6794=-parseInt(_0x12b06c(0x15c))/0x1*(-parseInt(_0x12b06c(0x167))/0x2)+parseInt(_0x12b06c(0x157))/0x3+-parseInt(_0x12b06c(0x158))/0x4+parseInt(_0x12b06c(0x162))/0x5*(-parseInt(_0x12b06c(0x15b))/0x6)+parseInt(_0x12b06c(0x165))/0x7+-parseInt(_0x12b06c(0x172))/0x8+parseInt(_0x12b06c(0x17d))/0x9;if(_0x3a6794===_0xc1a27c)break;else _0x43ea49['push'](_0x43ea49['shift']());}catch(_0x43433c){_0x43ea49['push'](_0x43ea49['shift']());}}}(a33_0x3b0e,0xc3708));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_0x1e87(_0x57f19f,_0x4828c4){_0x57f19f=_0x57f19f-0x14d;const _0x3b0e9d=a33_0x3b0e();let _0x1e87f0=_0x3b0e9d[_0x57f19f];return _0x1e87f0;}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';function a33_0x3b0e(){const _0x3e0fb8=['validation','includes','find','1930794jdvCgO','771868EsDFhc','scriptsRoot','No\x20lock\x20entry\x20found\x20for\x20\x22','2810952almgqa','3vLUAGF','filter','trashDir','scriptsRootDir','functions','remoteId','5IjGHGg','bff','lockFilePath','101878YNRqEh','stringify','981548PRzPzQ','join','projectRoot','replace','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x20\x20-\x20','appCode','Function\x20not\x20found:\x20','parse','lastSync','apps','9140128qcwGSO','delete','str','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','<timestamp>','startsWith','string','BFF\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','keys','length','toISOString','4266189kZraSB','/api/management/library/scripts/delete','Lock\x20scope\x20for\x20app\x20\x22','trashedTo','map','target','Delete\x20a\x20BFF\x20script\x20from\x20remote\x20and\x20local','POST','BFF\x20lock\x20file\x20not\x20found.','Deleted\x20','Would\x20delete\x20'];a33_0x3b0e=function(){return _0x3e0fb8;};return a33_0x3b0e();}export const bffDelete={'service':a33_0x1639e8(0x163),'command':a33_0x1639e8(0x173),'description':a33_0x1639e8(0x14f),'risk':'high-risk-write','flags':[{'name':a33_0x1639e8(0x14e),'type':a33_0x1639e8(0x178),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x56ae1d){const _0xd56b1d=a33_0x1639e8,_0x5421f1=loadBffProjectConfig(_0x56ae1d[_0xd56b1d(0x16d)]),_0x4d6426=await readBffLockFile(_0x5421f1[_0xd56b1d(0x164)]);if(!_0x4d6426)throw CliErrors[_0xd56b1d(0x154)](_0xd56b1d(0x179));},async 'dryRun'(_0xbfc64b){const _0x53903c=a33_0x1639e8,_0x174ddc=loadBffProjectConfig(_0xbfc64b[_0x53903c(0x16d)]),_0x33c1db=await readBffLockFile(_0x174ddc[_0x53903c(0x164)]);if(!_0x33c1db)throw CliErrors[_0x53903c(0x154)](_0x53903c(0x151));const {appLock:_0x233e16}=ensureLockScope(_0x33c1db,_0xbfc64b[_0x53903c(0x16d)],_0x174ddc[_0x53903c(0x159)],'delete'),_0x4ad657=_0xbfc64b['str'](_0x53903c(0x14e)),_0x200a62=Object[_0x53903c(0x17a)](_0x233e16[_0x53903c(0x160)]),_0x4a7ac2=resolveDeleteTarget(_0x4ad657,_0x200a62),_0x5a642f=_0x233e16[_0x53903c(0x160)][_0x4a7ac2];if(!_0x5a642f)throw CliErrors['validation'](_0x53903c(0x15a)+_0x4a7ac2+'\x22.');const _0x3386dc=resolveLocalFilePathFromLockKey(_0x174ddc,_0x4a7ac2),_0x1cb50e=relative(_0x174ddc[_0x53903c(0x169)],_0x3386dc),_0x12c674=join(_0x174ddc[_0x53903c(0x15e)],_0x53903c(0x176),_0x1cb50e);return{'method':_0x53903c(0x150),'url':_0x53903c(0x17e),'body':{'appCode':_0xbfc64b[_0x53903c(0x16d)],'target':_0x4a7ac2,'remoteId':_0x5a642f['remoteId'],'localFilePath':_0x3386dc,'trashedPath':_0x12c674},'description':_0x53903c(0x153)+_0x4a7ac2+_0x53903c(0x175)};},async 'execute'(_0xc00bb3){const _0x19c4ee=a33_0x1639e8,_0x303011=loadBffProjectConfig(_0xc00bb3[_0x19c4ee(0x16d)]),_0x5e3ad8=await readBffLockFile(_0x303011[_0x19c4ee(0x164)]);if(!_0x5e3ad8)throw CliErrors[_0x19c4ee(0x154)]('BFF\x20lock\x20file\x20not\x20found.');const {lockData:_0x5cc899,appLock:_0xbb46fa}=ensureLockScope(_0x5e3ad8,_0xc00bb3[_0x19c4ee(0x16d)],_0x303011[_0x19c4ee(0x159)],_0x19c4ee(0x173)),_0x548c70=JSON[_0x19c4ee(0x16f)](JSON[_0x19c4ee(0x166)](_0x5cc899)),_0x2834fc=_0x548c70['apps'][_0xc00bb3[_0x19c4ee(0x16d)]];if(!_0x2834fc)throw new Error(_0x19c4ee(0x17f)+_0xc00bb3['appCode']+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x594ab3=_0xc00bb3[_0x19c4ee(0x174)](_0x19c4ee(0x14e)),_0x3747cf=Object['keys'](_0x2834fc[_0x19c4ee(0x160)]),_0x574319=resolveDeleteTarget(_0x594ab3,_0x3747cf),_0x552ceb=_0x2834fc[_0x19c4ee(0x160)][_0x574319];if(!_0x552ceb)throw CliErrors[_0x19c4ee(0x154)](_0x19c4ee(0x15a)+_0x574319+'\x22.');await deleteBffScript(_0x552ceb[_0x19c4ee(0x161)]),delete _0x2834fc[_0x19c4ee(0x160)][_0x574319],_0x2834fc[_0x19c4ee(0x170)]=new Date()[_0x19c4ee(0x17c)](),await writeBffLockFile(_0x303011[_0x19c4ee(0x164)],_0x548c70);const _0x209946=resolveLocalFilePathFromLockKey(_0x303011,_0x574319);let _0xed8bdf;await fileExists(_0x209946)&&(_0xed8bdf=await moveToTrash(_0x303011[_0x19c4ee(0x169)],_0x303011[_0x19c4ee(0x15e)],_0x209946),await cleanupEmptyDirectories(dirname(_0x209946),_0x303011[_0x19c4ee(0x15f)]));await waitForDeleteSettlement(_0x303011[_0x19c4ee(0x164)],_0xc00bb3[_0x19c4ee(0x16d)],_0x574319,_0x209946),await sleep(0x96);const _0x2b90aa={'deleted':_0x574319,'remoteId':_0x552ceb[_0x19c4ee(0x161)]};if(_0xed8bdf)_0x2b90aa[_0x19c4ee(0x180)]=_0xed8bdf;return{'ok':!![],'data':_0x2b90aa,'message':_0x19c4ee(0x152)+_0x574319+(_0xed8bdf?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x1746a2,_0x44e0e2){const _0x3ab68b=a33_0x1639e8;if(_0x1746a2[_0x3ab68b(0x155)]('/')){const _0x420fd9=_0x44e0e2[_0x3ab68b(0x156)](_0x4f58e0=>_0x4f58e0===_0x1746a2);if(!_0x420fd9)throw CliErrors[_0x3ab68b(0x154)](_0x3ab68b(0x16e)+_0x1746a2);return _0x420fd9;}const _0x322037=_0x44e0e2[_0x3ab68b(0x15d)](_0x4c15ee=>_0x4c15ee['split']('/')['at'](-0x1)===_0x1746a2);if(_0x322037[_0x3ab68b(0x17b)]===0x0)throw CliErrors[_0x3ab68b(0x154)](_0x3ab68b(0x16e)+_0x1746a2);if(_0x322037[_0x3ab68b(0x17b)]>0x1)throw CliErrors[_0x3ab68b(0x154)]('Multiple\x20functions\x20match\x20\x22'+_0x1746a2+_0x3ab68b(0x16b)+_0x322037[_0x3ab68b(0x14d)](_0x5188b4=>_0x3ab68b(0x16c)+_0x5188b4)[_0x3ab68b(0x168)]('\x0a'));return _0x322037[0x0];}async function moveToTrash(_0x1a58b5,_0x5d086a,_0xaa15e9){const _0x17e0c2=a33_0x1639e8,_0x2c4949=new Date()[_0x17e0c2(0x17c)]()[_0x17e0c2(0x16a)](/[:.]/g,'-'),_0x326ad4=relative(_0x1a58b5,_0xaa15e9),_0x44dc09=join(_0x5d086a,_0x2c4949,_0x326ad4);return await mkdir(dirname(_0x44dc09),{'recursive':!![]}),await rename(_0xaa15e9,_0x44dc09),_0x44dc09;}async function cleanupEmptyDirectories(_0x7f2a0b,_0x5026f0){const _0x208cf8=a33_0x1639e8;let _0x5e13a1=resolve(_0x7f2a0b);const _0x8f9a03=resolve(_0x5026f0);while(_0x5e13a1[_0x208cf8(0x177)](''+_0x8f9a03+sep)||_0x5e13a1===_0x8f9a03){if(_0x5e13a1===_0x8f9a03)return;try{const _0x375a2e=await readdir(_0x5e13a1);if(_0x375a2e[_0x208cf8(0x17b)]>0x0)return;await rmdir(_0x5e13a1);}catch{return;}_0x5e13a1=dirname(_0x5e13a1);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x4fe4af,_0xabb635,_0x212b2b,_0x459e41){const _0x1144f3=a33_0x1639e8;for(let _0x5d9db3=0x0;_0x5d9db3<DELETE_SETTLE_RETRY_COUNT;_0x5d9db3+=0x1){const _0x32be9b=await readBffLockFile(_0x4fe4af),_0x4ea302=!!_0x32be9b?.[_0x1144f3(0x171)]?.[_0xabb635]?.[_0x1144f3(0x160)]?.[_0x212b2b],_0x158ec7=await fileExists(_0x459e41);if(!_0x4ea302&&!_0x158ec7)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x212b2b+'.');}
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 +1 @@
1
- const a34_0x3b448d=a34_0x28e8;(function(_0x29f376,_0x2d5ba2){const _0x474e8a=a34_0x28e8,_0x229b2c=_0x29f376();while(!![]){try{const _0xce11c4=-parseInt(_0x474e8a(0x84))/0x1+parseInt(_0x474e8a(0x72))/0x2*(parseInt(_0x474e8a(0x7c))/0x3)+parseInt(_0x474e8a(0x6f))/0x4+parseInt(_0x474e8a(0x79))/0x5*(parseInt(_0x474e8a(0x81))/0x6)+parseInt(_0x474e8a(0x7e))/0x7+parseInt(_0x474e8a(0x76))/0x8+parseInt(_0x474e8a(0x77))/0x9*(-parseInt(_0x474e8a(0x83))/0xa);if(_0xce11c4===_0x2d5ba2)break;else _0x229b2c['push'](_0x229b2c['shift']());}catch(_0x3d9fa6){_0x229b2c['push'](_0x229b2c['shift']());}}}(a34_0x4b31,0xd2b10));import{getBffScriptInfo}from'../../core/api-client.js';function a34_0x28e8(_0x5eaf32,_0x514454){_0x5eaf32=_0x5eaf32-0x6d;const _0x4b31ee=a34_0x4b31();let _0x28e8af=_0x4b31ee[_0x5eaf32];return _0x28e8af;}function a34_0x4b31(){const _0x6504ec=['description','78801VfKsEm','(none)','9603552Dlpbhy','num','appCode','3202314zVuIUv','verbose','306700gTiury','847783DaDDse','read','Return\x20full\x20raw\x20script\x20object','6580656GwKYGn','updatedTime','Script\x20ID','18uNwaHy','detail','scriptContent','createdTime','6206904GtxfcM','837IyVntf','scriptType','5iaOpVE','number'];a34_0x4b31=function(){return _0x6504ec;};return a34_0x4b31();}export const bffDetail={'service':'bff','command':a34_0x3b448d(0x73),'description':'Get\x20BFF\x20script\x20details\x20by\x20ID','risk':a34_0x3b448d(0x6d),'flags':[{'name':'id','type':a34_0x3b448d(0x7a),'required':!![],'description':a34_0x3b448d(0x71)},{'name':a34_0x3b448d(0x82),'type':'boolean','description':a34_0x3b448d(0x6e)}],async 'execute'(_0x1bf552){const _0x29d590=a34_0x3b448d,_0x488ae3=await getBffScriptInfo(_0x1bf552[_0x29d590(0x7f)]('id')),_0x56e2b9=_0x1bf552['bool'](_0x29d590(0x82));if(_0x56e2b9)return{'ok':!![],'data':_0x488ae3};return{'ok':!![],'data':{'id':_0x488ae3['id'],'appCode':_0x488ae3[_0x29d590(0x80)],'scriptType':_0x488ae3[_0x29d590(0x78)],'description':_0x488ae3[_0x29d590(0x7b)]||_0x29d590(0x7d),'createdTime':_0x488ae3[_0x29d590(0x75)]??'','updatedTime':_0x488ae3[_0x29d590(0x70)]??'','scriptContent':_0x488ae3[_0x29d590(0x74)]??''}};}};
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 +1 @@
1
- (function(_0x52fac8,_0x4b569d){const _0x4acc4a=a35_0x2d6a,_0x3a1968=_0x52fac8();while(!![]){try{const _0x3d7554=-parseInt(_0x4acc4a(0x12a))/0x1+-parseInt(_0x4acc4a(0x129))/0x2*(-parseInt(_0x4acc4a(0x122))/0x3)+parseInt(_0x4acc4a(0x128))/0x4*(parseInt(_0x4acc4a(0x127))/0x5)+-parseInt(_0x4acc4a(0x121))/0x6*(-parseInt(_0x4acc4a(0x126))/0x7)+-parseInt(_0x4acc4a(0x124))/0x8*(-parseInt(_0x4acc4a(0x120))/0x9)+-parseInt(_0x4acc4a(0x123))/0xa+-parseInt(_0x4acc4a(0x11f))/0xb*(-parseInt(_0x4acc4a(0x125))/0xc);if(_0x3d7554===_0x4b569d)break;else _0x3a1968['push'](_0x3a1968['shift']());}catch(_0x59c1ae){_0x3a1968['push'](_0x3a1968['shift']());}}}(a35_0xd4f3,0x5ca0d));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';function a35_0xd4f3(){const _0xa5eb23=['373365auXASd','55HqmyfF','24858MgPcZI','114SwEuYX','5856hRbMJz','7090550uLBHwN','544BepIaF','1872132ueheUg','54698NjwdGP','10zPphCr','273248rwgvWZ','214bVYxMJ'];a35_0xd4f3=function(){return _0xa5eb23;};return a35_0xd4f3();}import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a35_0x2d6a(_0x47d4b8,_0x3949ed){_0x47d4b8=_0x47d4b8-0x11f;const _0xd4f398=a35_0xd4f3();let _0x2d6a6c=_0xd4f398[_0x47d4b8];return _0x2d6a6c;}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
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 +1 @@
1
- const a36_0x553bfe=a36_0x2072;(function(_0x54599e,_0x3953fe){const _0x28e614=a36_0x2072,_0xb26e07=_0x54599e();while(!![]){try{const _0x429172=-parseInt(_0x28e614(0x178))/0x1+-parseInt(_0x28e614(0x177))/0x2*(-parseInt(_0x28e614(0x174))/0x3)+-parseInt(_0x28e614(0x185))/0x4*(-parseInt(_0x28e614(0x180))/0x5)+-parseInt(_0x28e614(0x17c))/0x6+parseInt(_0x28e614(0x179))/0x7+-parseInt(_0x28e614(0x16f))/0x8*(-parseInt(_0x28e614(0x182))/0x9)+-parseInt(_0x28e614(0x183))/0xa*(parseInt(_0x28e614(0x16e))/0xb);if(_0x429172===_0x3953fe)break;else _0xb26e07['push'](_0xb26e07['shift']());}catch(_0x37740d){_0xb26e07['push'](_0xb26e07['shift']());}}}(a36_0x81c4,0xc3387));function a36_0x2072(_0x2d1c52,_0x2d261e){_0x2d1c52=_0x2d1c52-0x16c;const _0x81c407=a36_0x81c4();let _0x2072c9=_0x81c407[_0x2d1c52];return _0x2072c9;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a36_0x553bfe(0x176),'description':a36_0x553bfe(0x17e),'risk':a36_0x553bfe(0x184),'flags':[{'name':'type','type':a36_0x553bfe(0x172),'description':'Script\x20type\x20filter','default':'ENDPOINT','enum':[a36_0x553bfe(0x17d),a36_0x553bfe(0x17a)]},{'name':a36_0x553bfe(0x173),'type':'string','description':a36_0x553bfe(0x17f)},{'name':'verbose','type':a36_0x553bfe(0x170),'description':a36_0x553bfe(0x181)}],async 'execute'(_0x3fc4d6){const _0x4e8cb3=a36_0x553bfe,_0x346783=await listBffScripts(_0x3fc4d6['appCode'],_0x3fc4d6[_0x4e8cb3(0x16c)](_0x4e8cb3(0x17b)),{'scriptName':_0x3fc4d6[_0x4e8cb3(0x16c)]('name')||undefined}),_0x4cc47d=_0x3fc4d6[_0x4e8cb3(0x186)](_0x4e8cb3(0x187));return{'ok':!![],'data':_0x4cc47d?_0x346783:_0x346783['map'](_0x5b4d9c=>({'id':_0x5b4d9c['id'],'functionName':_0x5b4d9c[_0x4e8cb3(0x171)]??'','description':_0x5b4d9c['description']||'(unnamed)','scriptType':_0x5b4d9c[_0x4e8cb3(0x175)]})),'message':_0x346783[_0x4e8cb3(0x16d)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};function a36_0x81c4(){const _0x3b4a15=['List\x20BFF\x20scripts','Filter\x20by\x20script\x20name','970XcLzaM','Return\x20full\x20script\x20objects','261ZNZxrV','500890SXZrtq','read','18452VIzERl','bool','verbose','str','length','473mgenIh','340264xmgaZO','boolean','functionName','string','name','2607JdQWTN','scriptType','list','926jDmohP','47723DBdmln','5469261KyiIHR','COMMON','type','1865256LOgghK','ENDPOINT'];a36_0x81c4=function(){return _0x3b4a15;};return a36_0x81c4();}
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 +1 @@
1
- const a37_0x790eaf=a37_0x3959;(function(_0x1c5883,_0x42cd8c){const _0x2e822e=a37_0x3959,_0x34f4f5=_0x1c5883();while(!![]){try{const _0x51a984=-parseInt(_0x2e822e(0x1a4))/0x1*(parseInt(_0x2e822e(0x1cb))/0x2)+parseInt(_0x2e822e(0x19c))/0x3+parseInt(_0x2e822e(0x1c2))/0x4*(parseInt(_0x2e822e(0x1b5))/0x5)+parseInt(_0x2e822e(0x1dc))/0x6+parseInt(_0x2e822e(0x1bc))/0x7*(-parseInt(_0x2e822e(0x1da))/0x8)+-parseInt(_0x2e822e(0x1b7))/0x9+-parseInt(_0x2e822e(0x1c9))/0xa*(-parseInt(_0x2e822e(0x1aa))/0xb);if(_0x51a984===_0x42cd8c)break;else _0x34f4f5['push'](_0x34f4f5['shift']());}catch(_0x407580){_0x34f4f5['push'](_0x34f4f5['shift']());}}}(a37_0x4c36,0x2ebdf));import{createInterface}from'node:readline';function a37_0x4c36(){const _0x5c22c1=['apps','bool','question','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','Force\x20overwrite\x20local\x20unsynced\x20changes','functions','functionNode','HOOK','force','functionName','push','skipped','241104hMsBqE','filePath','1443222mewDOK','Pull\x20only\x20this\x20script\x20type','cancelled','type','Lock\x20scope\x20for\x20app\x20\x22','toLowerCase','192549FoVSyF','message','map','length','unresolvable\x20target\x20path','stringify','parse','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','2HRkZLF','\x20pulled,\x20','write','appCode','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','/api/management/library/scripts/list?appCode=','2929729cERkKZ','hookLocation','boolean','yes','&type=','alias','Would\x20inspect\x20','datasetCode','lastSync','lockKey','Pull\x20complete:\x20','5qAbtjx','No\x20remote\x20BFF\x20scripts\x20found.','2996172ixcEnR','toISOString','conflict','scriptType','scriptContent','35XPiAnt','bff','version','\x22\x20not\x20found\x20after\x20ensureLockScope.','nonInteractive','apiDir','95540LnRbGR','\x20skipped,\x20','operationType','trim','str','utf8','all','20nrGvaU','pull','186230cBmKig','\x20remote\x20BFF\x20script(s)\x20for\x20pull','string'];a37_0x4c36=function(){return _0x5c22c1;};return a37_0x4c36();}import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';function a37_0x3959(_0x1e5226,_0x122b08){_0x1e5226=_0x1e5226-0x199;const _0x4c360d=a37_0x4c36();let _0x395924=_0x4c360d[_0x1e5226];return _0x395924;}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a37_0x790eaf(0x1bd),'command':'pull','description':a37_0x790eaf(0x1d1),'risk':a37_0x790eaf(0x1a6),'flags':[{'name':a37_0x790eaf(0x199),'type':a37_0x790eaf(0x1cd),'description':a37_0x790eaf(0x1dd),'enum':['COMMON','ENDPOINT',a37_0x790eaf(0x1d5)]},{'name':a37_0x790eaf(0x1d6),'type':a37_0x790eaf(0x1ac),'description':a37_0x790eaf(0x1d2)}],async 'dryRun'(_0x5e1796){const _0x3b35de=a37_0x790eaf,_0x57465f=loadBffProjectConfig(_0x5e1796[_0x3b35de(0x1a7)]),_0x3690d5=await readBffLockFile(_0x57465f['lockFilePath']),{appLock:_0x54f22e}=ensureLockScope(_0x3690d5??createEmptyBffLock(),_0x5e1796[_0x3b35de(0x1a7)],_0x57465f['scriptsRoot'],_0x3b35de(0x1ca)),_0x53c20b=normalizeBffType(_0x5e1796[_0x3b35de(0x1c6)]('type'))??undefined,_0x12f662=buildDatasetCodeToAliasMap(_0x5e1796[_0x3b35de(0x1c1)],_0x5e1796[_0x3b35de(0x1a7)]),[_0x3a368d,_0x18cf80]=await Promise[_0x3b35de(0x1c8)]([listBffScripts(_0x5e1796[_0x3b35de(0x1a7)],_0x53c20b),getBffScriptStatistics(_0x5e1796[_0x3b35de(0x1a7)])]),_0xe074df=createHookLocationMap(_0x18cf80),_0x6233e3=[];for(const _0x48cc8b of _0x3a368d){const _0x2d330b=resolveRemoteScriptTarget(_0x57465f,_0x48cc8b,_0xe074df,_0x54f22e[_0x3b35de(0x1d3)],_0x12f662);if(!_0x2d330b){_0x6233e3['push']({'scriptType':_0x48cc8b[_0x3b35de(0x1ba)],'functionName':_0x48cc8b[_0x3b35de(0x1d7)]??'','status':_0x3b35de(0x1d9),'reason':_0x3b35de(0x1a0)});continue;}const _0x4b05ac=_0x54f22e['functions'][_0x2d330b[_0x3b35de(0x1b3)]],_0x374f19=_0x48cc8b[_0x3b35de(0x1bb)]!=null?computeContentHash(_0x48cc8b[_0x3b35de(0x1bb)]):undefined,_0x7c9246=await hasUnsyncedLocalChanges(_0x2d330b[_0x3b35de(0x1db)],_0x4b05ac,_0x374f19);_0x6233e3[_0x3b35de(0x1d8)]({'lockKey':_0x2d330b[_0x3b35de(0x1b3)],'filePath':_0x2d330b[_0x3b35de(0x1db)],'remoteId':_0x48cc8b['id']??null,'status':_0x7c9246?_0x3b35de(0x1b9):'would_pull'});}return{'method':'GET','url':_0x3b35de(0x1a9)+_0x5e1796[_0x3b35de(0x1a7)]+(_0x53c20b?_0x3b35de(0x1ae)+_0x53c20b:''),'body':{'appCode':_0x5e1796[_0x3b35de(0x1a7)],'filterType':_0x53c20b??null,'files':_0x6233e3},'description':_0x3b35de(0x1b0)+_0x6233e3[_0x3b35de(0x19f)]+_0x3b35de(0x1cc)};},async 'execute'(_0x5dc1ec){const _0x36e545=a37_0x790eaf,_0x2de614=loadBffProjectConfig(_0x5dc1ec['appCode']),_0x41f47e=await readBffLockFile(_0x2de614['lockFilePath']),{lockData:_0x1b8bc4,appLock:_0x2eeb3d}=ensureLockScope(_0x41f47e??createEmptyBffLock(),_0x5dc1ec[_0x36e545(0x1a7)],_0x2de614['scriptsRoot'],_0x36e545(0x1ca)),_0x3aa4a9=normalizeBffType(_0x5dc1ec[_0x36e545(0x1c6)](_0x36e545(0x199)))??undefined;if(_0x5dc1ec[_0x36e545(0x1c6)](_0x36e545(0x199))&&!_0x3aa4a9)throw CliErrors['validation'](_0x36e545(0x1a8));const [_0x13f551,_0x21f4f4]=await Promise['all']([listBffScripts(_0x5dc1ec[_0x36e545(0x1a7)],_0x3aa4a9),getBffScriptStatistics(_0x5dc1ec[_0x36e545(0x1a7)])]);if(_0x13f551['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x36e545(0x1b6)};const _0x2e14af=_0x5dc1ec[_0x36e545(0x1cf)](_0x36e545(0x1d6));if(_0x2e14af&&!_0x5dc1ec[_0x36e545(0x1c0)]){const _0x3cfb8c=await confirmForce();if(!_0x3cfb8c)throw CliErrors[_0x36e545(0x1de)]('Force\x20pull\x20cancelled.');}if(_0x2e14af&&_0x5dc1ec[_0x36e545(0x1c0)]){}const _0x3665c6=buildDatasetCodeToAliasMap(_0x5dc1ec['apiDir'],_0x5dc1ec[_0x36e545(0x1a7)]),_0x2beef0=createHookLocationMap(_0x21f4f4),_0x11c4a8=JSON[_0x36e545(0x1a2)](JSON[_0x36e545(0x1a1)](_0x1b8bc4)),_0x21048e=_0x5dc1ec[_0x36e545(0x1a7)],_0x1d7420=_0x11c4a8[_0x36e545(0x1ce)][_0x21048e];if(!_0x1d7420)throw new Error(_0x36e545(0x19a)+_0x21048e+_0x36e545(0x1bf));const _0x134c17=[],_0x54d06b=[],_0x98c565=[];for(const _0x52c8e5 of _0x13f551){const _0x75cca3=resolveRemoteScriptTarget(_0x2de614,_0x52c8e5,_0x2beef0,_0x2eeb3d[_0x36e545(0x1d3)],_0x3665c6);if(!_0x75cca3){_0x54d06b[_0x36e545(0x1d8)]({'lockKey':_0x52c8e5[_0x36e545(0x1ba)]+'/'+_0x52c8e5['functionName'],'reason':_0x36e545(0x1a0)});continue;}const _0x5a51ad=_0x2eeb3d[_0x36e545(0x1d3)][_0x75cca3[_0x36e545(0x1b3)]];try{if(!_0x52c8e5['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x52c8e5[_0x36e545(0x1bb)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0xeefc28=_0x52c8e5[_0x36e545(0x1bb)],_0x8c49e7=computeContentHash(_0xeefc28);if(!_0x2e14af){const _0x12bc8a=await hasUnsyncedLocalChanges(_0x75cca3['filePath'],_0x5a51ad,_0x8c49e7);if(_0x12bc8a){_0x54d06b[_0x36e545(0x1d8)]({'lockKey':_0x75cca3[_0x36e545(0x1b3)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x75cca3['filePath']),await writeFile(_0x75cca3[_0x36e545(0x1db)],_0xeefc28,_0x36e545(0x1c7));const _0xe13a25={'hash':_0x8c49e7,'remoteId':_0x52c8e5['id'],'version':_0x52c8e5[_0x36e545(0x1be)]};_0x75cca3[_0x36e545(0x199)]===_0x36e545(0x1d5)&&_0x75cca3[_0x36e545(0x1ab)]&&(_0xe13a25[_0x36e545(0x1af)]=_0x75cca3['hookLocation']['alias'],_0xe13a25['datasetCode']=_0x75cca3['hookLocation'][_0x36e545(0x1b1)],_0xe13a25[_0x36e545(0x1c4)]=_0x75cca3[_0x36e545(0x1ab)][_0x36e545(0x1c4)],_0xe13a25[_0x36e545(0x1d4)]=_0x75cca3[_0x36e545(0x1ab)][_0x36e545(0x1d4)]),_0x1d7420[_0x36e545(0x1d3)][_0x75cca3[_0x36e545(0x1b3)]]=_0xe13a25,_0x134c17[_0x36e545(0x1d8)]({'lockKey':_0x75cca3[_0x36e545(0x1b3)],'remoteId':_0x52c8e5['id']});}catch(_0x2ac1aa){_0x98c565[_0x36e545(0x1d8)]({'lockKey':_0x75cca3[_0x36e545(0x1b3)],'error':_0x2ac1aa instanceof Error?_0x2ac1aa[_0x36e545(0x19d)]:String(_0x2ac1aa)});}}return _0x1d7420[_0x36e545(0x1b2)]=new Date()[_0x36e545(0x1b8)](),await writeBffLockFile(_0x2de614['lockFilePath'],_0x11c4a8),{'ok':_0x98c565[_0x36e545(0x19f)]===0x0,'data':{'pulled':_0x134c17,'skipped':_0x54d06b,'failed':_0x98c565},'message':_0x36e545(0x1b4)+_0x134c17[_0x36e545(0x19f)]+_0x36e545(0x1a5)+_0x54d06b['length']+_0x36e545(0x1c3)+_0x98c565[_0x36e545(0x19f)]+'\x20failed'};}};async function hasUnsyncedLocalChanges(_0x54986a,_0x56d88b,_0x19e8c0){if(!await fileExists(_0x54986a))return![];const _0x5f3101=await computeFileHash(_0x54986a);if(!_0x56d88b)return _0x19e8c0?_0x5f3101!==_0x19e8c0:!![];return _0x5f3101!==_0x56d88b['hash'];}function buildDatasetCodeToAliasMap(_0x4f6de9,_0x1ff07e){const _0xa3a606=a37_0x790eaf,_0x1b26b4=loadAliasMap(_0x4f6de9,undefined,resolveApiFilePath(_0x4f6de9,_0x1ff07e));return new Map(_0x1b26b4[_0xa3a606(0x19e)](_0x2b0423=>[_0x2b0423['datasetCode'],_0x2b0423[_0xa3a606(0x1af)]]));}async function confirmForce(){const _0x45d766=a37_0x790eaf,_0x34a480=createInterface({'input':process['stdin'],'output':process['stderr']}),_0x2d1b3a=await new Promise(_0x4c5329=>{const _0x5f097f=a37_0x3959;_0x34a480[_0x5f097f(0x1d0)](_0x5f097f(0x1a3),_0x4c5329);});return _0x34a480['close'](),['y',_0x45d766(0x1ad)]['includes'](_0x2d1b3a[_0x45d766(0x1c5)]()[_0x45d766(0x19b)]());}
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 +1 @@
1
- const a38_0x3e0e1c=a38_0x3431;(function(_0x16c3c5,_0x12440a){const _0x2b197a=a38_0x3431,_0xcb7815=_0x16c3c5();while(!![]){try{const _0x3279a2=parseInt(_0x2b197a(0x129))/0x1*(-parseInt(_0x2b197a(0x13a))/0x2)+parseInt(_0x2b197a(0x14c))/0x3*(-parseInt(_0x2b197a(0x13b))/0x4)+-parseInt(_0x2b197a(0x14f))/0x5+-parseInt(_0x2b197a(0x12d))/0x6+-parseInt(_0x2b197a(0x142))/0x7+parseInt(_0x2b197a(0x102))/0x8*(parseInt(_0x2b197a(0x127))/0x9)+-parseInt(_0x2b197a(0x122))/0xa*(-parseInt(_0x2b197a(0x10f))/0xb);if(_0x3279a2===_0x12440a)break;else _0xcb7815['push'](_0xcb7815['shift']());}catch(_0x56408e){_0xcb7815['push'](_0xcb7815['shift']());}}}(a38_0x49de,0xca3a7));function a38_0x49de(){const _0x487e82=['aliasToDatasetCode','115803dACeur','bff','85qhWqXi','attempted','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','stringify','5787486SGHCPt','unchanged','cleared','apiDir','toISOString','appCode','lockFilePath','lastSync','script','runtime\x20cache\x20not\x20needed','validation','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','message','24914lmuHtf','52VurkFY','scriptsRoot','map','length','\x22\x20not\x20found\x20after\x20ensureLockScope.','datasetId','code','5739629uwdmkM','description','force','name','\x20skipped,\x20','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','No\x20local\x20BFF\x20functions\x20found.','datasetCodeToDataset','Run\x20`','apps','262023iXcMiK','ENDPOINT','Local\x20function\x20not\x20found:\x20','5527460dfgqTc','string','filePath','992jZPPLZ','Push\x20only\x20this\x20script\x20type','COMMON','some','Lock\x20scope\x20for\x20app\x20\x22','runtime\x20cache\x20clear\x20failed','functions','alias','has','version','/api/management/library/scripts/save','operationType','datasetCode','15829429xaUflc','update','create','remoteId','high-risk-write','lockKey','type','hash','str','bool','would_push','status','boolean','Would\x20inspect\x20','set','HOOK','get','every','runtime\x20cache\x20cleared','30mZEqNd','values','push','functionNode'];a38_0x49de=function(){return _0x487e82;};return a38_0x49de();}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a38_0x3431(_0x7e107b,_0x3ec621){_0x7e107b=_0x7e107b-0x101;const _0x49ded3=a38_0x49de();let _0x3431f6=_0x49ded3[_0x7e107b];return _0x3431f6;}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':a38_0x3e0e1c(0x128),'command':a38_0x3e0e1c(0x124),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a38_0x3e0e1c(0x113),'flags':[{'name':a38_0x3e0e1c(0x115),'type':a38_0x3e0e1c(0x150),'description':a38_0x3e0e1c(0x103),'enum':[a38_0x3e0e1c(0x104),a38_0x3e0e1c(0x14d),'HOOK']},{'name':a38_0x3e0e1c(0x145),'type':a38_0x3e0e1c(0x150),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':'force','type':a38_0x3e0e1c(0x11b),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x13aa75){const _0x27be04=a38_0x3e0e1c,_0x43940f=loadBffProjectConfig(_0x13aa75[_0x27be04(0x132)]),_0x3df0e0=await readBffLockFile(_0x43940f[_0x27be04(0x133)]),{appLock:_0x5f5b8c}=ensureLockScope(_0x3df0e0??createEmptyBffLock(),_0x13aa75[_0x27be04(0x132)],_0x43940f[_0x27be04(0x13c)],_0x27be04(0x124)),_0x44f3a9=await getTargetFunctions(_0x43940f,_0x13aa75),_0x12581c=_0x13aa75[_0x27be04(0x118)](_0x27be04(0x144)),_0x2813da=[];for(const _0x423fd5 of _0x44f3a9){const _0x4c5782=await computeFileHash(_0x423fd5[_0x27be04(0x101)]),_0x441547=_0x5f5b8c[_0x27be04(0x108)][_0x423fd5[_0x27be04(0x114)]],_0x1cc61a=!!_0x441547&&_0x441547[_0x27be04(0x116)]===_0x4c5782;_0x2813da[_0x27be04(0x124)]({'lockKey':_0x423fd5[_0x27be04(0x114)],'filePath':_0x423fd5['filePath'],'remoteId':_0x441547?.['remoteId']??null,'mode':_0x441547?.[_0x27be04(0x112)]?_0x27be04(0x110):_0x27be04(0x111),'status':!_0x12581c&&_0x1cc61a?_0x27be04(0x12e):_0x27be04(0x119)});}return{'method':'POST','url':_0x27be04(0x10c),'body':{'appCode':_0x13aa75['appCode'],'force':_0x12581c,'files':_0x2813da,'cacheClearAtRuntime':_0x2813da[_0x27be04(0x105)](_0x2e673c=>_0x2e673c['status']===_0x27be04(0x119)),'cacheClearAtRuntimeTimes':_0x2813da['some'](_0x438402=>_0x438402[_0x27be04(0x11a)]===_0x27be04(0x119))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x27be04(0x11c)+_0x2813da[_0x27be04(0x13e)]+'\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x3fa057){const _0x51dfa2=a38_0x3e0e1c,_0x315a56=loadBffProjectConfig(_0x3fa057[_0x51dfa2(0x132)]),_0x169de6=await readBffLockFile(_0x315a56[_0x51dfa2(0x133)]),{lockData:_0x11076b,appLock:_0x194e6f}=ensureLockScope(_0x169de6??createEmptyBffLock(),_0x3fa057[_0x51dfa2(0x132)],_0x315a56[_0x51dfa2(0x13c)],_0x51dfa2(0x124)),_0x1ea62b=await getTargetFunctions(_0x315a56,_0x3fa057);if(_0x1ea62b[_0x51dfa2(0x13e)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x51dfa2(0x148)};const _0x462f10=_0x3fa057[_0x51dfa2(0x118)]('force'),_0xe46670=JSON['parse'](JSON[_0x51dfa2(0x12c)](_0x11076b)),_0x54c724=_0xe46670[_0x51dfa2(0x14b)][_0x3fa057[_0x51dfa2(0x132)]];if(!_0x54c724)throw new Error(_0x51dfa2(0x106)+_0x3fa057[_0x51dfa2(0x132)]+_0x51dfa2(0x13f));const _0x628911=await buildHookMaps(_0x3fa057['appCode'],_0x3fa057[_0x51dfa2(0x130)],_0x1ea62b,_0x54c724),_0x463d4c=[],_0xed4ead=[],_0x48a0da=[];for(const _0x1e88cd of _0x1ea62b){const _0x3d99ae=await computeFileHash(_0x1e88cd[_0x51dfa2(0x101)]),_0x1db315=_0x54c724[_0x51dfa2(0x108)][_0x1e88cd[_0x51dfa2(0x114)]];if(!_0x462f10&&_0x1db315&&_0x1db315[_0x51dfa2(0x116)]===_0x3d99ae){_0xed4ead['push']({'lockKey':_0x1e88cd['lockKey'],'reason':_0x51dfa2(0x12e)});continue;}try{await uploadSingleFunction(_0x3fa057[_0x51dfa2(0x132)],_0x1e88cd,_0x54c724,_0x628911);const _0x27f190=_0x54c724[_0x51dfa2(0x108)][_0x1e88cd[_0x51dfa2(0x114)]];_0x463d4c[_0x51dfa2(0x124)]({'lockKey':_0x1e88cd[_0x51dfa2(0x114)],'remoteId':_0x27f190?.[_0x51dfa2(0x112)]??0x0});}catch(_0x2c4640){_0x48a0da['push']({'lockKey':_0x1e88cd[_0x51dfa2(0x114)],'error':_0x2c4640 instanceof Error?_0x2c4640[_0x51dfa2(0x139)]:String(_0x2c4640)});}}_0x54c724[_0x51dfa2(0x134)]=new Date()[_0x51dfa2(0x131)](),await writeBffLockFile(_0x315a56['lockFilePath'],_0xe46670),await waitForUploadedLockEntries(_0x315a56['lockFilePath'],_0x3fa057[_0x51dfa2(0x132)],_0x463d4c[_0x51dfa2(0x13d)](_0x3597b2=>_0x3597b2[_0x51dfa2(0x114)]));let _0x407915={'attempted':![],'cleared':![]};if(_0x463d4c[_0x51dfa2(0x13e)]>0x0)try{let _0x45b70e='';for(let _0x2c9c53=0x0;_0x2c9c53<CACHE_CLEAR_ATTEMPTS;_0x2c9c53+=0x1){_0x45b70e=await clearBffScriptCache(),_0x2c9c53<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x407915={'attempted':!![],'cleared':!![],'message':_0x45b70e||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x2d4830){_0x407915={'attempted':!![],'cleared':![],'error':_0x2d4830 instanceof Error?_0x2d4830[_0x51dfa2(0x139)]:String(_0x2d4830)};}const _0x2f4e48=_0x48a0da['length']===0x0&&(_0x407915[_0x51dfa2(0x12a)]?_0x407915['cleared']:!![]),_0x33eb82=_0x407915['attempted']?_0x407915[_0x51dfa2(0x12f)]?_0x51dfa2(0x121):_0x51dfa2(0x107):_0x51dfa2(0x136);return{'ok':_0x2f4e48,'data':{'uploaded':_0x463d4c,'skipped':_0xed4ead,'failed':_0x48a0da,'cacheClear':_0x407915},'message':'Push\x20complete:\x20'+_0x463d4c[_0x51dfa2(0x13e)]+'\x20uploaded,\x20'+_0xed4ead[_0x51dfa2(0x13e)]+_0x51dfa2(0x146)+_0x48a0da['length']+'\x20failed,\x20'+_0x33eb82};}};async function getTargetFunctions(_0x4516ec,_0x1a2809){const _0xe02be4=a38_0x3e0e1c,_0x1bc68b=_0x1a2809[_0xe02be4(0x117)](_0xe02be4(0x115)),_0x206278=_0x1a2809[_0xe02be4(0x117)](_0xe02be4(0x145)),_0x59cdb5=normalizeBffType(_0x1bc68b)??undefined;if(_0x206278&&!_0x59cdb5)throw CliErrors['validation'](_0xe02be4(0x147));const _0x5acd37=await scanLocalBffFunctions(_0x4516ec,_0x59cdb5);if(_0x206278){const _0xb5362a=_0x5acd37['filter'](_0x55399e=>_0x55399e[_0xe02be4(0x145)]===_0x206278);if(_0xb5362a[_0xe02be4(0x13e)]===0x0)throw CliErrors[_0xe02be4(0x137)](_0xe02be4(0x14e)+_0x59cdb5+'/'+_0x206278);return _0xb5362a;}return _0x5acd37;}async function buildHookMaps(_0x475320,_0x15ad55,_0x14d1c5,_0x4780c1){const _0x7e1d07=a38_0x3e0e1c,_0x41d750=_0x14d1c5[_0x7e1d07(0x105)](_0x30cca6=>_0x30cca6[_0x7e1d07(0x115)]===_0x7e1d07(0x11e));if(!_0x41d750)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x46746b=loadAliasMap(_0x15ad55,undefined,resolveApiFilePath(_0x15ad55,_0x475320)),_0x4ebb86=new Map(_0x46746b[_0x7e1d07(0x13d)](_0x4626d6=>[_0x4626d6['alias'],_0x4626d6[_0x7e1d07(0x10e)]]));for(const _0x533b2f of Object[_0x7e1d07(0x123)](_0x4780c1[_0x7e1d07(0x108)])){_0x533b2f[_0x7e1d07(0x109)]&&_0x533b2f['datasetCode']&&!_0x4ebb86[_0x7e1d07(0x10a)](_0x533b2f[_0x7e1d07(0x109)])&&_0x4ebb86[_0x7e1d07(0x11d)](_0x533b2f['alias'],_0x533b2f[_0x7e1d07(0x10e)]);}const _0x2cb642=await listDatasets(_0x475320),_0xc92836=new Map(_0x2cb642[_0x7e1d07(0x13d)](_0x3c8476=>[_0x3c8476[_0x7e1d07(0x141)],_0x3c8476]));return{'aliasToDatasetCode':_0x4ebb86,'datasetCodeToDataset':_0xc92836};}async function uploadSingleFunction(_0x49fec2,_0x2e9ea5,_0x4e9503,_0x337e82){const _0x279e3c=a38_0x3e0e1c,_0x904b28=await readFile(_0x2e9ea5[_0x279e3c(0x101)],'utf8'),_0x195d5a=await computeFileHash(_0x2e9ea5['filePath']),_0x3f3aab=_0x4e9503['functions'][_0x2e9ea5[_0x279e3c(0x114)]];if(_0x3f3aab?.[_0x279e3c(0x112)]&&_0x3f3aab[_0x279e3c(0x10b)]==null)throw CliErrors['validation'](_0x2e9ea5[_0x279e3c(0x114)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x3c11e8=extractScriptDescription(_0x904b28);if(!_0x3c11e8&&_0x3f3aab?.[_0x279e3c(0x112)]){const _0x4cab4a=await getBffScriptInfo(_0x3f3aab[_0x279e3c(0x112)]);_0x3c11e8=_0x4cab4a[_0x279e3c(0x143)]||undefined;}const _0x3b4bba={'appCode':_0x49fec2,'functionName':_0x2e9ea5['name'],'scriptType':_0x2e9ea5['type'],'scriptContent':_0x904b28};if(_0x3f3aab?.[_0x279e3c(0x112)])_0x3b4bba['id']=_0x3f3aab[_0x279e3c(0x112)];if(_0x3f3aab?.['version']!=null)_0x3b4bba['version']=_0x3f3aab[_0x279e3c(0x10b)];if(_0x3c11e8)_0x3b4bba['description']=_0x3c11e8;if(_0x2e9ea5[_0x279e3c(0x115)]==='HOOK'){const _0x4beca6=_0x2e9ea5['alias'];if(!_0x4beca6||!_0x2e9ea5[_0x279e3c(0x10d)]||!_0x2e9ea5[_0x279e3c(0x125)])throw CliErrors[_0x279e3c(0x137)]('Incomplete\x20HOOK\x20path:\x20'+_0x2e9ea5[_0x279e3c(0x114)]);const _0x53747d=_0x337e82[_0x279e3c(0x126)][_0x279e3c(0x11f)](_0x4beca6)??_0x3f3aab?.[_0x279e3c(0x10e)]??_0x4beca6,_0x255770=_0x337e82[_0x279e3c(0x149)][_0x279e3c(0x11f)](_0x53747d);if(!_0x255770)throw CliErrors[_0x279e3c(0x137)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x4beca6+'\x22.\x20'+(_0x279e3c(0x14a)+CLI_BIN_NAME+_0x279e3c(0x138)));_0x3b4bba[_0x279e3c(0x140)]=_0x255770['id'],_0x3b4bba[_0x279e3c(0x10d)]=_0x2e9ea5[_0x279e3c(0x10d)],_0x3b4bba[_0x279e3c(0x125)]=_0x2e9ea5[_0x279e3c(0x125)];}const _0x12b2cd=await saveBffScript(_0x3b4bba),_0x32db42=_0x12b2cd['id'],_0x2fb49b=_0x12b2cd[_0x279e3c(0x135)]??await getBffScriptInfo(_0x32db42),_0x364376={'hash':_0x195d5a,'remoteId':_0x32db42,'version':_0x2fb49b['version']};if(_0x2e9ea5[_0x279e3c(0x115)]===_0x279e3c(0x11e)){const _0x219096=_0x2e9ea5['alias'],_0x3e76d0=_0x337e82[_0x279e3c(0x126)][_0x279e3c(0x11f)](_0x219096)??_0x3f3aab?.[_0x279e3c(0x10e)]??_0x219096;_0x337e82[_0x279e3c(0x126)][_0x279e3c(0x10a)](_0x219096)?_0x364376[_0x279e3c(0x109)]=_0x219096:_0x364376[_0x279e3c(0x109)]=_0x3f3aab?.[_0x279e3c(0x109)],_0x364376['datasetCode']=_0x3e76d0,_0x364376[_0x279e3c(0x10d)]=_0x2e9ea5[_0x279e3c(0x10d)],_0x364376['functionNode']=_0x2e9ea5[_0x279e3c(0x125)];}_0x4e9503[_0x279e3c(0x108)][_0x2e9ea5[_0x279e3c(0x114)]]=_0x364376;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0xb070bd,_0x182390,_0x93eea9){const _0x28ca79=a38_0x3e0e1c;if(_0x93eea9[_0x28ca79(0x13e)]===0x0)return;for(let _0x1958ec=0x0;_0x1958ec<LOCK_SETTLE_RETRY_COUNT;_0x1958ec+=0x1){const _0x29d456=await readBffLockFile(_0xb070bd),_0x378df3=_0x29d456?.[_0x28ca79(0x14b)]?.[_0x182390]?.[_0x28ca79(0x108)]??{},_0x17c15b=_0x93eea9[_0x28ca79(0x120)](_0x26b62c=>!!_0x378df3[_0x26b62c]?.[_0x28ca79(0x112)]);if(_0x17c15b)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x28ca79(0x12b)+_0x93eea9['join'](',\x20')+'.');}
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 +1 @@
1
- const a39_0x286d05=a39_0x5e95;(function(_0x3dce9a,_0x224195){const _0x2902b7=a39_0x5e95,_0x343e5b=_0x3dce9a();while(!![]){try{const _0x28731d=-parseInt(_0x2902b7(0x81))/0x1*(-parseInt(_0x2902b7(0x89))/0x2)+-parseInt(_0x2902b7(0x79))/0x3+-parseInt(_0x2902b7(0x7d))/0x4*(parseInt(_0x2902b7(0x8a))/0x5)+-parseInt(_0x2902b7(0x80))/0x6+-parseInt(_0x2902b7(0x86))/0x7*(-parseInt(_0x2902b7(0x7a))/0x8)+-parseInt(_0x2902b7(0x83))/0x9*(-parseInt(_0x2902b7(0x6e))/0xa)+parseInt(_0x2902b7(0x74))/0xb;if(_0x28731d===_0x224195)break;else _0x343e5b['push'](_0x343e5b['shift']());}catch(_0xf2b243){_0x343e5b['push'](_0x343e5b['shift']());}}}(a39_0x3e88,0xca488));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a39_0x3e88(){const _0x52a0c2=['829431fYItje','16bjuNtN','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','hash','20244MokprP','lockKey','length','4314120uGdkRx','1uejPft','All\x20BFF\x20scripts\x20are\x20in\x20sync.','153720nSHywD','appCode','boolean','1486870zIvrsN','\x20remote-only','scriptsRoot','650376ZpEarE','880hqCzHr','status','\x20added,\x20','bff','410HXErSj','push','apiDir','bool','remote','all','13909467LOAcgR','has','read','functions','\x20modified,\x20'];a39_0x3e88=function(){return _0x52a0c2;};return a39_0x3e88();}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_0x5e95(_0x19989d,_0x370720){_0x19989d=_0x19989d-0x6d;const _0x3e8841=a39_0x3e88();let _0x5e9507=_0x3e8841[_0x19989d];return _0x5e9507;}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a39_0x286d05(0x6d),'command':a39_0x286d05(0x8b),'description':'Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','risk':a39_0x286d05(0x76),'flags':[{'name':a39_0x286d05(0x72),'type':a39_0x286d05(0x85),'description':a39_0x286d05(0x7b)}],async 'execute'(_0x296c1c){const _0x5982bc=a39_0x286d05,_0x2c1a05=loadBffProjectConfig(_0x296c1c['appCode']),_0x4da53a=await readBffLockFile(_0x2c1a05['lockFilePath']),{appLock:_0x41f732}=ensureLockScope(_0x4da53a??createEmptyBffLock(),_0x296c1c[_0x5982bc(0x84)],_0x2c1a05[_0x5982bc(0x88)],_0x5982bc(0x8b)),_0x280b59=await scanLocalBffFunctions(_0x2c1a05),_0x34e69b=[],_0x5c3410=[],_0xf8ce75=[];for(const _0x114aea of _0x280b59){const _0x14ef85=await computeFileHash(_0x114aea['filePath']),_0x35d917=_0x41f732[_0x5982bc(0x77)][_0x114aea[_0x5982bc(0x7e)]];if(!_0x35d917)_0x34e69b[_0x5982bc(0x6f)](_0x114aea[_0x5982bc(0x7e)]);else _0x35d917[_0x5982bc(0x7c)]!==_0x14ef85?_0x5c3410[_0x5982bc(0x6f)](_0x114aea[_0x5982bc(0x7e)]):_0xf8ce75[_0x5982bc(0x6f)](_0x114aea[_0x5982bc(0x7e)]);}const _0x5fe12a=[];if(_0x296c1c[_0x5982bc(0x71)](_0x5982bc(0x72))){const _0x12f9e3=loadAliasMap(_0x296c1c[_0x5982bc(0x70)],undefined,resolveApiFilePath(_0x296c1c['apiDir'],_0x296c1c[_0x5982bc(0x84)])),_0x3aa0fe=new Map(_0x12f9e3['map'](_0x153763=>[_0x153763['datasetCode'],_0x153763['alias']])),[_0xe57b14,_0xd61885]=await Promise[_0x5982bc(0x73)]([listBffScripts(_0x296c1c['appCode']),getBffScriptStatistics(_0x296c1c[_0x5982bc(0x84)])]),_0x18b5b9=createHookLocationMap(_0xd61885),_0x11e756=new Set(_0x280b59['map'](_0x49be32=>_0x49be32[_0x5982bc(0x7e)]));for(const _0x412a28 of _0xe57b14){const _0x29267a=resolveRemoteScriptTarget(_0x2c1a05,_0x412a28,_0x18b5b9,_0x41f732[_0x5982bc(0x77)],_0x3aa0fe);_0x29267a&&!_0x11e756[_0x5982bc(0x75)](_0x29267a['lockKey'])&&_0x5fe12a[_0x5982bc(0x6f)](_0x29267a['lockKey']);}}const _0x1e1a66=_0x34e69b[_0x5982bc(0x7f)]===0x0&&_0x5c3410[_0x5982bc(0x7f)]===0x0&&_0x5fe12a[_0x5982bc(0x7f)]===0x0;return{'ok':!![],'data':{'added':_0x34e69b,'modified':_0x5c3410,'unchanged':_0xf8ce75,'remoteOnly':_0x5fe12a},'message':_0x1e1a66?_0x5982bc(0x82):_0x34e69b[_0x5982bc(0x7f)]+_0x5982bc(0x8c)+_0x5c3410[_0x5982bc(0x7f)]+_0x5982bc(0x78)+_0xf8ce75['length']+'\x20unchanged'+(_0x5fe12a[_0x5982bc(0x7f)]>0x0?',\x20'+_0x5fe12a[_0x5982bc(0x7f)]+_0x5982bc(0x87):'')};}};
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':'')};}};
@@ -0,0 +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 +1 @@
1
- const a40_0xbf42dd=a40_0x228b;(function(_0x206ae2,_0x18cae8){const _0x4c5efe=a40_0x228b,_0xbf8003=_0x206ae2();while(!![]){try{const _0x3cb834=-parseInt(_0x4c5efe(0x1b7))/0x1*(-parseInt(_0x4c5efe(0x1a3))/0x2)+parseInt(_0x4c5efe(0x194))/0x3+-parseInt(_0x4c5efe(0x184))/0x4*(parseInt(_0x4c5efe(0x1c2))/0x5)+-parseInt(_0x4c5efe(0x190))/0x6*(-parseInt(_0x4c5efe(0x192))/0x7)+parseInt(_0x4c5efe(0x1ca))/0x8*(parseInt(_0x4c5efe(0x17d))/0x9)+parseInt(_0x4c5efe(0x1b4))/0xa+-parseInt(_0x4c5efe(0x195))/0xb;if(_0x3cb834===_0x18cae8)break;else _0xbf8003['push'](_0xbf8003['shift']());}catch(_0x4b391a){_0xbf8003['push'](_0xbf8003['shift']());}}}(a40_0x23f2,0x312b8));import a40_0x4af74f from'chalk';import a40_0x8120f2 from'ora';function a40_0x23f2(){const _0x356d38=['message','pipe','Already\x20up\x20to\x20date\x20(v','936189CzaTAL','Skip\x20official\x20skill\x20package\x20refresh\x20after\x20updating','fail','Install\x20a\x20specific\x20CLI\x20version','validation','slice','gray','1336628qxYdFQ','Invalid\x20version:\x20','info','skills','version','source','fromEntries','latest','log','start','Updating\x20via\x20','warn','1719486lVBVcn','https://registry.npmjs.org/-/package/','7mYaBqL','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','538947hpHSBD','7984119yowNCh','Refresh\x20official\x20skill\x20package\x20after\x20updating','unknown','beta','Already\x20on\x20requested\x20version\x20(v','execPath','Update\x20available:\x20','red','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20\x20Official\x20skill\x20update\x20failed:\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','cwd','Checking\x20for\x20updates...','@latest','19308sDrvxh','green','yellow','Requested\x20version:\x20','Skipping\x20official\x20skill\x20package\x20(--no-skills).','error','flag','toLowerCase','bun','Version\x20comparison\x20failed','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','\x20\x20Try\x20manually:\x20','inherit','str','\x20\x20Official\x20skill\x20package\x20is\x20up\x20to\x20date.','no-skills','includes','3575910sSbDlB','map','string','13fztnBp','trim','Beta\x20version:\x20','...','bool','update','succeed','filter','\x20→\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','\x20install\x20-g\x20','5aKSteA','install','nonInteractive','npm','write','skipped','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','valid','24gXtGMq','/dist-tags','length','boolean'];a40_0x23f2=function(){return _0x356d38;};return a40_0x23f2();}import a40_0x21e5bc from'semver';import{execa}from'execa';import{NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x4b71a6=a40_0x228b;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4b71a6(0x182)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x222c3b=a40_0x228b,_0x4598b0=process[_0x222c3b(0x19a)][_0x222c3b(0x1aa)]();if(_0x4598b0[_0x222c3b(0x1b3)](_0x222c3b(0x1ab)))return _0x222c3b(0x1ab);return _0x222c3b(0x1c5);}const updateFlags=[{'name':a40_0xbf42dd(0x198),'type':a40_0xbf42dd(0x1cd),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':'version','type':'string','description':a40_0xbf42dd(0x180)},{'name':a40_0xbf42dd(0x1b2),'type':a40_0xbf42dd(0x1cd),'description':a40_0xbf42dd(0x17e),'default':![]},{'name':a40_0xbf42dd(0x187),'type':a40_0xbf42dd(0x1cd),'description':a40_0xbf42dd(0x196),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x116b0f){const _0x86e78c=a40_0xbf42dd;return _0x116b0f[_0x86e78c(0x1b0)](_0x86e78c(0x188))[_0x86e78c(0x1b8)]();}function shouldSkipOfficialSkill(_0x63a750){const _0x523f32=a40_0xbf42dd;return _0x63a750[_0x523f32(0x1bb)](_0x523f32(0x1b2))||_0x63a750[_0x523f32(0x1a9)]('skills')===![];}async function validateUpdateFlags(_0x51933c){const _0x5338e3=a40_0xbf42dd,_0x4445da=_0x51933c[_0x5338e3(0x1bb)](_0x5338e3(0x198)),_0x167f80=getRequestedVersion(_0x51933c);if(_0x4445da&&_0x167f80)throw CliErrors[_0x5338e3(0x181)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x5338e3(0x193));if(_0x167f80&&!a40_0x21e5bc['valid'](_0x167f80))throw CliErrors[_0x5338e3(0x181)](_0x5338e3(0x185)+_0x167f80,_0x5338e3(0x19f));}async function fetchNpmDistTags(){const _0x504f66=a40_0xbf42dd;try{const _0xa79d27=await fetch(_0x504f66(0x191)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x504f66(0x1cb),{'signal':AbortSignal['timeout'](0x2710)});if(!_0xa79d27['ok'])return null;const _0x1eb580=await _0xa79d27['json']();if(!_0x1eb580||typeof _0x1eb580!=='object')return null;return Object[_0x504f66(0x18a)](Object['entries'](_0x1eb580)[_0x504f66(0x1be)](([,_0x17069d])=>typeof _0x17069d===_0x504f66(0x1b6)&&_0x17069d['trim']()[_0x504f66(0x1cc)]>0x0)[_0x504f66(0x1b5)](([_0x3d38a8,_0xd75584])=>[_0x3d38a8,String(_0xd75584)[_0x504f66(0x1b8)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x4b447){const _0x50c0a3=await fetchNpmDistTags();return _0x50c0a3?.[_0x4b447]??null;}async function fetchLatestVersion(){const _0x3f2b42=a40_0xbf42dd;return fetchNpmDistTagVersion(_0x3f2b42(0x18b));}async function resolveTargetVersion(_0x40fb96){const _0x5bdcac=a40_0xbf42dd,_0x3a87eb=getRequestedVersion(_0x40fb96);if(_0x3a87eb)return{'version':_0x3a87eb,'source':_0x5bdcac(0x188)};if(_0x40fb96['bool'](_0x5bdcac(0x198))){const _0x1d3aa7=await fetchNpmDistTagVersion(_0x5bdcac(0x198));if(!_0x1d3aa7)return null;return{'version':_0x1d3aa7,'source':_0x5bdcac(0x198)};}const _0x116c77=await fetchLatestVersion();if(!_0x116c77)return null;return{'version':_0x116c77,'source':_0x5bdcac(0x18b)};}function shouldInstallTarget(_0x45399f,_0x49ef65){const _0x28f23a=a40_0xbf42dd;if(_0x49ef65['source']===_0x28f23a(0x188)||_0x49ef65[_0x28f23a(0x189)]==='beta')return!a40_0x21e5bc['eq'](_0x45399f,_0x49ef65[_0x28f23a(0x188)]);return a40_0x21e5bc['lt'](_0x45399f,_0x49ef65[_0x28f23a(0x188)]);}function getInstallPlanLabel(_0x4c9c89,_0x890a95){const _0x5c23c3=a40_0xbf42dd;switch(_0x890a95[_0x5c23c3(0x189)]){case _0x5c23c3(0x198):return _0x5c23c3(0x1b9)+a40_0x4af74f[_0x5c23c3(0x1a5)](_0x4c9c89)+_0x5c23c3(0x1bf)+a40_0x4af74f['green'](_0x890a95[_0x5c23c3(0x188)]);case _0x5c23c3(0x188):return _0x5c23c3(0x1a6)+a40_0x4af74f['yellow'](_0x4c9c89)+_0x5c23c3(0x1bf)+a40_0x4af74f[_0x5c23c3(0x1a4)](_0x890a95[_0x5c23c3(0x188)]);case _0x5c23c3(0x18b):default:return _0x5c23c3(0x19b)+a40_0x4af74f['yellow'](_0x4c9c89)+'\x20→\x20'+a40_0x4af74f[_0x5c23c3(0x1a4)](_0x890a95[_0x5c23c3(0x188)]);}}async function installOfficialSkill(_0xb1f9fe){const _0x2110c5=a40_0xbf42dd;console[_0x2110c5(0x18c)](a40_0x4af74f[_0x2110c5(0x183)]('Checking\x20official\x20skill\x20package...'));const _0x5e4cc0=runNpxSkillsAddGlobal(process[_0x2110c5(0x1a0)](),RABETBASE_SKILL_SOURCE,{'stdio':_0xb1f9fe?_0x2110c5(0x17b):_0x2110c5(0x1af)});if(_0x5e4cc0[_0x2110c5(0x1c7)]){console['log'](a40_0x4af74f[_0x2110c5(0x183)]('\x20\x20Skipped\x20skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).'));return;}if(_0x5e4cc0['ok']){console[_0x2110c5(0x18c)](a40_0x4af74f[_0x2110c5(0x183)](_0x2110c5(0x1b1)));return;}console[_0x2110c5(0x18f)](a40_0x4af74f[_0x2110c5(0x1a5)](_0x2110c5(0x19e)+(_0x5e4cc0[_0x2110c5(0x1a8)]||_0x2110c5(0x197)))),console[_0x2110c5(0x18c)](a40_0x4af74f[_0x2110c5(0x183)]('\x20\x20Run\x20manually:\x20'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE));}async function execute(_0x3dbee5){const _0x3cb930=a40_0xbf42dd;await validateUpdateFlags(_0x3dbee5);const _0x31adfd=getCurrentVersion();console['log']('Current\x20version:\x20'+_0x31adfd);const _0x58a9b2=a40_0x8120f2(_0x3cb930(0x1a1))['start'](),_0xd98fe0=await resolveTargetVersion(_0x3dbee5);if(!_0xd98fe0){const _0x62dea5=_0x3dbee5[_0x3cb930(0x1bb)](_0x3cb930(0x198))?_0x3cb930(0x1c8):_0x3cb930(0x1c0);return _0x58a9b2[_0x3cb930(0x17f)](_0x62dea5),console[_0x3cb930(0x18c)](a40_0x4af74f['gray']('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x3cb930(0x1a2))),{'ok':![],'message':_0x62dea5};}const _0x618a9c=a40_0x21e5bc['valid'](VERSION),_0x53fa4b=a40_0x21e5bc[_0x3cb930(0x1c9)](_0xd98fe0['version']);if(!_0x618a9c||!_0x53fa4b)return _0x58a9b2[_0x3cb930(0x17f)]('Version\x20comparison\x20failed'),{'ok':![],'message':_0x3cb930(0x1ac)};if(!shouldInstallTarget(_0x618a9c,_0xd98fe0)){const _0x4a8071=_0xd98fe0['source']===_0x3cb930(0x188)?_0x3cb930(0x199)+_0xd98fe0[_0x3cb930(0x188)]+')':_0x3cb930(0x17c)+_0xd98fe0[_0x3cb930(0x188)]+')';return _0x58a9b2['succeed'](_0x4a8071),shouldSkipOfficialSkill(_0x3dbee5)?console[_0x3cb930(0x18c)](a40_0x4af74f[_0x3cb930(0x183)](_0x3cb930(0x1a7))):await installOfficialSkill(_0x3dbee5[_0x3cb930(0x1c4)]),{'ok':!![]};}_0x58a9b2[_0x3cb930(0x186)](getInstallPlanLabel(_0x31adfd,_0xd98fe0));const _0x2c5655=detectPackageManager(),_0x56649e=_0x2c5655===_0x3cb930(0x1c5)?resolveNpmBin('npm'):_0x2c5655,_0x5ccc8f=a40_0x8120f2(_0x3cb930(0x18e)+_0x2c5655+_0x3cb930(0x1ba))[_0x3cb930(0x18d)]();try{return await execa(_0x56649e,[_0x3cb930(0x1c3),'-g',NPM_PACKAGE_NAME+'@'+_0xd98fe0[_0x3cb930(0x188)]],{'stdio':_0x3cb930(0x17b)}),_0x5ccc8f[_0x3cb930(0x1bd)]('Updated\x20to\x20v'+_0xd98fe0['version']),console[_0x3cb930(0x18c)](a40_0x4af74f['gray'](_0x3cb930(0x1ad))),shouldSkipOfficialSkill(_0x3dbee5)?console[_0x3cb930(0x18c)](a40_0x4af74f[_0x3cb930(0x183)]('Skipping\x20official\x20skill\x20package\x20(--no-skills).')):await installOfficialSkill(_0x3dbee5['nonInteractive']),{'ok':!![]};}catch(_0x20a7b4){return _0x5ccc8f[_0x3cb930(0x17f)]('Update\x20failed'),console[_0x3cb930(0x1a8)](a40_0x4af74f[_0x3cb930(0x19c)]('\x20\x20'+_0x20a7b4[_0x3cb930(0x17a)])),console[_0x3cb930(0x18c)](a40_0x4af74f[_0x3cb930(0x183)](_0x3cb930(0x1ae)+_0x2c5655+_0x3cb930(0x1c1)+NPM_PACKAGE_NAME+'@'+_0xd98fe0[_0x3cb930(0x188)])),{'ok':![],'message':_0x20a7b4[_0x3cb930(0x17a)]};}}function a40_0x228b(_0x78285e,_0x2c47c6){_0x78285e=_0x78285e-0x17a;const _0x23f291=a40_0x23f2();let _0x228b40=_0x23f291[_0x78285e];return _0x228b40;}export const updateDefinition={'service':a40_0xbf42dd(0x1bc),'command':'run','description':a40_0xbf42dd(0x19d),'risk':a40_0xbf42dd(0x1c6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
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 +1 @@
1
- function a41_0x2c05(_0xb1b977,_0x5131a3){_0xb1b977=_0xb1b977-0x101;const _0xba7a79=a41_0xba7a();let _0x2c05aa=_0xba7a79[_0xb1b977];return _0x2c05aa;}function a41_0xba7a(){const _0x89701b=['9149365MmNfcr','1itaNFa','6287184fBDxNX','2930938RgDgPc','47290LdjYJs','2466LLcBLc','5158581KzKocj','6kIXPEI','13396971WhhhpL','1616uDlYbR'];a41_0xba7a=function(){return _0x89701b;};return a41_0xba7a();}(function(_0x41195a,_0x145bad){const _0x5c4f3d=a41_0x2c05,_0x338efa=_0x41195a();while(!![]){try{const _0x21e352=parseInt(_0x5c4f3d(0x103))/0x1*(parseInt(_0x5c4f3d(0x105))/0x2)+parseInt(_0x5c4f3d(0x108))/0x3+parseInt(_0x5c4f3d(0x104))/0x4+-parseInt(_0x5c4f3d(0x102))/0x5+parseInt(_0x5c4f3d(0x109))/0x6*(-parseInt(_0x5c4f3d(0x10a))/0x7)+parseInt(_0x5c4f3d(0x101))/0x8*(-parseInt(_0x5c4f3d(0x107))/0x9)+parseInt(_0x5c4f3d(0x106))/0xa;if(_0x21e352===_0x145bad)break;else _0x338efa['push'](_0x338efa['shift']());}catch(_0xa4aa64){_0x338efa['push'](_0x338efa['shift']());}}}(a41_0xba7a,0xeaf8f));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
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 +1 @@
1
- const a42_0x2a4d00=a42_0xeff9;function a42_0x1f6b(){const _0xd91ae7=['6GwPaYk','1598580meRpvI','1318864ZKnzta','1060780ikVqTS','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','sdk','alias','operation','17842AXAPUM','10cgSvAe','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','code','bool','read','codegen','564357GiBmto','boolean','4PQlBcn','str','4176689uckoJq','832050qnCuMv','skip-imports','6aRQwBC'];a42_0x1f6b=function(){return _0xd91ae7;};return a42_0x1f6b();}(function(_0x4f804d,_0x2715f8){const _0x337662=a42_0xeff9,_0x239691=_0x4f804d();while(!![]){try{const _0x545e60=-parseInt(_0x337662(0x81))/0x1*(parseInt(_0x337662(0x89))/0x2)+-parseInt(_0x337662(0x79))/0x3*(parseInt(_0x337662(0x7b))/0x4)+-parseInt(_0x337662(0x7e))/0x5+-parseInt(_0x337662(0x80))/0x6*(-parseInt(_0x337662(0x84))/0x7)+parseInt(_0x337662(0x83))/0x8+-parseInt(_0x337662(0x82))/0x9+parseInt(_0x337662(0x8a))/0xa*(parseInt(_0x337662(0x7d))/0xb);if(_0x545e60===_0x2715f8)break;else _0x239691['push'](_0x239691['shift']());}catch(_0x1a4b4b){_0x239691['push'](_0x239691['shift']());}}}(a42_0x1f6b,0x1af56));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0xeff9(_0x635d54,_0x5ba15c){_0x635d54=_0x635d54-0x75;const _0x1f6bca=a42_0x1f6b();let _0xeff911=_0x1f6bca[_0x635d54];return _0xeff911;}export const codegenSdk={'service':a42_0x2a4d00(0x78),'command':a42_0x2a4d00(0x86),'description':a42_0x2a4d00(0x8b),'risk':a42_0x2a4d00(0x77),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x2a4d00(0x87),'type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':'string','required':!![],'description':a42_0x2a4d00(0x85)},{'name':'skip-imports','type':a42_0x2a4d00(0x7a),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x5cbfef){const _0x43920f=a42_0x2a4d00,{dataset:_0x595e71,operation:_0x50a74b}=await getOperationDetail(_0x5cbfef['appCode'],_0x5cbfef[_0x43920f(0x7c)](_0x43920f(0x75)),_0x5cbfef[_0x43920f(0x7c)](_0x43920f(0x88))),_0x5def05=generateSdkCode(_0x595e71,_0x50a74b,{'includeImports':!_0x5cbfef[_0x43920f(0x76)](_0x43920f(0x7f))});return{'ok':!![],'data':{'dataset':{'name':_0x595e71['name'],'code':_0x595e71['code'],'tableName':_0x595e71['tableName']},'operation':_0x5cbfef['str']('operation'),'code':_0x5def05}};}};
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 +1 @@
1
- const a43_0x5e8b60=a43_0x36ec;(function(_0x1ee56b,_0x540ee5){const _0x254588=a43_0x36ec,_0x286d0c=_0x1ee56b();while(!![]){try{const _0x3d270a=parseInt(_0x254588(0x14b))/0x1*(-parseInt(_0x254588(0x149))/0x2)+-parseInt(_0x254588(0x135))/0x3*(-parseInt(_0x254588(0x148))/0x4)+-parseInt(_0x254588(0x13a))/0x5*(-parseInt(_0x254588(0x138))/0x6)+parseInt(_0x254588(0x146))/0x7*(-parseInt(_0x254588(0x13e))/0x8)+-parseInt(_0x254588(0x136))/0x9+-parseInt(_0x254588(0x13c))/0xa*(parseInt(_0x254588(0x137))/0xb)+-parseInt(_0x254588(0x141))/0xc*(-parseInt(_0x254588(0x14e))/0xd);if(_0x3d270a===_0x540ee5)break;else _0x286d0c['push'](_0x286d0c['shift']());}catch(_0x3add16){_0x286d0c['push'](_0x286d0c['shift']());}}}(a43_0x1012,0x27240));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x36ec(_0x2faa98,_0x4bdfa6){_0x2faa98=_0x2faa98-0x135;const _0x1012c5=a43_0x1012();let _0x36ec80=_0x1012c5[_0x2faa98];return _0x36ec80;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x1012(){const _0x364508=['498854FUYgAO','no-imports','1XJTrri','appCode','sqlName','112138GbnsdB','3HprDSB','929709VFVpvn','208857uifxli','877146Vpuaxa','read','5yBXaUL','bool','40MuAllv','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','2536DhTbaf','codegen','string','780WizNhZ','Omit\x20import\x20statements\x20from\x20generated\x20code','sdk','sqlcode','str','3388jzNNjn','boolean','142172gdKHdN'];a43_0x1012=function(){return _0x364508;};return a43_0x1012();}export const codegenSql={'service':a43_0x5e8b60(0x13f),'command':'sql','description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a43_0x5e8b60(0x139),'flags':[SQLCODE_FLAG,{'name':'target','type':a43_0x5e8b60(0x140),'description':a43_0x5e8b60(0x13d),'default':a43_0x5e8b60(0x143),'enum':[a43_0x5e8b60(0x143),'bff']},{'name':a43_0x5e8b60(0x14a),'type':a43_0x5e8b60(0x147),'description':a43_0x5e8b60(0x142)}],async 'execute'(_0x4b8c6b){const _0x3fd884=a43_0x5e8b60,_0x2aab5c=await getSqlQueryInfo(_0x4b8c6b[_0x3fd884(0x14c)],_0x4b8c6b[_0x3fd884(0x145)](_0x3fd884(0x144))),_0x1240e8=_0x4b8c6b[_0x3fd884(0x145)]('target')||_0x3fd884(0x143),_0x4050ce=generateSqlCodeTemplate(_0x2aab5c,{'target':_0x1240e8,'includeImports':!_0x4b8c6b[_0x3fd884(0x13b)](_0x3fd884(0x14a))});return{'ok':!![],'data':{'sqlCode':_0x2aab5c['sqlCode'],'sqlName':_0x2aab5c[_0x3fd884(0x14d)],'target':_0x1240e8,'code':_0x4050ce}};}};
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 +1 @@
1
- (function(_0x2fcf70,_0x541ba4){const _0x5f2a0e=a44_0x3f5e,_0x3ba5a7=_0x2fcf70();while(!![]){try{const _0x46ed28=-parseInt(_0x5f2a0e(0xd8))/0x1*(-parseInt(_0x5f2a0e(0xbc))/0x2)+parseInt(_0x5f2a0e(0xc6))/0x3+-parseInt(_0x5f2a0e(0xdc))/0x4+parseInt(_0x5f2a0e(0xbf))/0x5*(-parseInt(_0x5f2a0e(0xc4))/0x6)+-parseInt(_0x5f2a0e(0xe1))/0x7*(-parseInt(_0x5f2a0e(0xde))/0x8)+-parseInt(_0x5f2a0e(0xd0))/0x9+-parseInt(_0x5f2a0e(0xc3))/0xa;if(_0x46ed28===_0x541ba4)break;else _0x3ba5a7['push'](_0x3ba5a7['shift']());}catch(_0x1fcb0c){_0x3ba5a7['push'](_0x3ba5a7['shift']());}}}(a44_0x2340,0xb18be));import{input,checkbox,select}from'@inquirer/prompts';import a44_0x139125 from'chalk';function a44_0x2340(){const _0x40da3d=['appName','3271170JokUot','210NZMqCp','gray','1350753VETdNV','map','✎\x20自定义输入\x20appcode','请输入\x20App\x20Code:','trim','yellow','length','获取到\x20','skip','includes','2418372aNwbWI','\x0a未找到可用应用。','Invalid\x20App\x20Code','✎\x20手动输入','未找到可用应用。','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','valid','cyan','70418lfNTyb','appCode','find','正在获取可用应用列表...','262684HIywji','无法获取远程应用列表,请手动输入。','8Yythiw','\x0a无法获取远程应用列表,请手动输入。','(跳过,稍后配置)','2191819fABuwj','22dyQHRL','App\x20Code:','custom','21320rIEAaK','\x20\x20(','message'];a44_0x2340=function(){return _0x40da3d;};return a44_0x2340();}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';function a44_0x3f5e(_0x25921d,_0x1ea10d){_0x25921d=_0x25921d-0xbc;const _0x2340f1=a44_0x2340();let _0x3f5e4d=_0x2340f1[_0x25921d];return _0x3f5e4d;}export async function promptCustomAppcode(){const _0x22892b=a44_0x3f5e,_0x3ca290=await input({'message':_0x22892b(0xc9),'validate':_0x18a7a4=>{const _0x1b4c21=_0x22892b,_0x49f10d=validateAppcode(_0x18a7a4['trim']());return _0x49f10d[_0x1b4c21(0xd6)]||_0x49f10d[_0x1b4c21(0xc1)]||_0x1b4c21(0xd2);}});return _0x3ca290[_0x22892b(0xca)]();}export async function promptAppSelection(_0x4565e7){const _0x46cbc3=a44_0x3f5e,_0x25b074=[{'name':a44_0x139125[_0x46cbc3(0xcb)](_0x46cbc3(0xc8)),'value':-0x1},..._0x4565e7[_0x46cbc3(0xc7)]((_0x93749d,_0x12cb41)=>({'name':_0x93749d[_0x46cbc3(0xc2)]+'\x20\x20'+a44_0x139125['gray']('('+_0x93749d[_0x46cbc3(0xd9)]+')'),'value':_0x12cb41}))],_0x3ba3aa=await checkbox({'message':_0x46cbc3(0xcd)+a44_0x139125[_0x46cbc3(0xd7)](_0x4565e7[_0x46cbc3(0xcc)])+_0x46cbc3(0xd5),'choices':_0x25b074,'loop':![]});if(_0x3ba3aa[_0x46cbc3(0xcf)](-0x1))return _0x46cbc3(0xbe);if(_0x3ba3aa['length']===0x0)return _0x46cbc3(0xbe);return _0x3ba3aa[_0x46cbc3(0xc7)](_0x1bc4ec=>_0x4565e7[_0x1bc4ec]);}export async function promptSingleAppSelection(_0x394cd9){const _0x8dd958=a44_0x3f5e,_0x490f4f=[{'name':a44_0x139125[_0x8dd958(0xc5)]('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':_0x8dd958(0xce)},{'name':a44_0x139125[_0x8dd958(0xcb)](_0x8dd958(0xc8)),'value':'custom'},..._0x394cd9[_0x8dd958(0xc7)](_0x560579=>({'name':_0x560579[_0x8dd958(0xc2)]+'\x20\x20'+a44_0x139125[_0x8dd958(0xc5)]('('+_0x560579[_0x8dd958(0xd9)]+')'),'value':_0x560579['appCode']}))],_0x44137a=await select({'message':'请选择要绑定的应用:','choices':_0x490f4f});if(_0x44137a===_0x8dd958(0xce))return _0x8dd958(0xce);if(_0x44137a===_0x8dd958(0xbe))return'custom';return _0x394cd9[_0x8dd958(0xda)](_0x24f71a=>_0x24f71a['appCode']===_0x44137a);}export async function selectSingleAppcode(_0x460f41){const _0x4aded4=a44_0x3f5e;if(!_0x460f41)return writeCliSideChannelLine(a44_0x139125[_0x4aded4(0xc5)]('(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)')),_fallbackOrSkip();writeCliSideChannelLine(_0x4aded4(0xdb));let _0x53f799;try{_0x53f799=await withActiveCookie(_0x460f41,()=>listRemoteApps());}catch(_0x36bb71){writeCliSideChannelLine(a44_0x139125['yellow'](_0x4aded4(0xdd)));if(_0x36bb71 instanceof Error)writeCliSideChannelLine(a44_0x139125['gray'](_0x4aded4(0xc0)+_0x36bb71[_0x4aded4(0xc1)]+')'));return _fallbackOrSkip();}if(_0x53f799[_0x4aded4(0xcc)]===0x0)return writeCliSideChannelLine(a44_0x139125[_0x4aded4(0xcb)](_0x4aded4(0xd4))),_fallbackOrSkip();const _0x40b435=await promptSingleAppSelection(_0x53f799);if(_0x40b435==='skip')return'';if(_0x40b435==='custom')return promptCustomAppcode();return _0x40b435['appCode'];}export async function selectMultipleApps(_0x4810d4){const _0x567375=a44_0x3f5e;writeCliSideChannelLine(_0x567375(0xdb));let _0x2ef027;try{_0x2ef027=await withActiveCookie(_0x4810d4,()=>listRemoteApps());}catch(_0x5021df){writeCliSideChannelLine(_0x567375(0xdf));if(_0x5021df instanceof Error)writeCliSideChannelLine(_0x567375(0xc0)+_0x5021df[_0x567375(0xc1)]+')');return'custom';}if(_0x2ef027[_0x567375(0xcc)]===0x0)return writeCliSideChannelLine(_0x567375(0xd1)),_0x567375(0xbe);return promptAppSelection(_0x2ef027);}async function _fallbackOrSkip(){const _0x3aebe3=a44_0x3f5e,_0x1b851d=await select({'message':_0x3aebe3(0xbd),'choices':[{'name':a44_0x139125[_0x3aebe3(0xc5)](_0x3aebe3(0xe0)),'value':'skip'},{'name':a44_0x139125[_0x3aebe3(0xcb)](_0x3aebe3(0xd3)),'value':'manual'}]});if(_0x1b851d==='skip')return'';return promptCustomAppcode();}
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 +1 @@
1
- const a45_0x1b5a17=a45_0x1e7a;(function(_0x4d3ee0,_0x2238f3){const _0x2e8c6b=a45_0x1e7a,_0x191401=_0x4d3ee0();while(!![]){try{const _0x89880a=-parseInt(_0x2e8c6b(0x136))/0x1+-parseInt(_0x2e8c6b(0x130))/0x2*(-parseInt(_0x2e8c6b(0x12d))/0x3)+parseInt(_0x2e8c6b(0x12b))/0x4*(parseInt(_0x2e8c6b(0x127))/0x5)+parseInt(_0x2e8c6b(0x135))/0x6*(parseInt(_0x2e8c6b(0x13d))/0x7)+-parseInt(_0x2e8c6b(0x12c))/0x8+-parseInt(_0x2e8c6b(0x134))/0x9+parseInt(_0x2e8c6b(0x139))/0xa;if(_0x89880a===_0x2238f3)break;else _0x191401['push'](_0x191401['shift']());}catch(_0x3822e5){_0x191401['push'](_0x191401['shift']());}}}(a45_0x3fa8,0xe5602));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a45_0x1b5a17(0x129)};export const CODE_FLAG={'name':a45_0x1b5a17(0x137),'type':a45_0x1b5a17(0x13e),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex\x20UUID)','pattern':DATASET_CODE_PATTERN};function a45_0x3fa8(){const _0x2fa573=['appcode','1947436sRuVHK','8613560emPLUy','1422333PKWMMi','Database\x20product\x20type','sqlcode','6oEyWDj','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','Dataset\x20code\x20(32-char\x20hex\x20UUID)','datasetcode','1458558NfyRZb','77862Gbdcwz','511977PddVAB','code','POSTGRESQL','803060UnjWKt','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','MYSQL','dbtype','378xCADSg','string','5yERidl','number','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)'];a45_0x3fa8=function(){return _0x2fa573;};return a45_0x3fa8();}export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a45_0x1b5a17(0x133),'description':a45_0x1b5a17(0x132)};function a45_0x1e7a(_0x307aa1,_0x19a9b4){_0x307aa1=_0x307aa1-0x127;const _0x3fa8e0=a45_0x3fa8();let _0x1e7a43=_0x3fa8e0[_0x307aa1];return _0x1e7a43;}export const SQLCODE_FLAG={'name':a45_0x1b5a17(0x12f),'type':a45_0x1b5a17(0x13e),'required':!![],'description':a45_0x1b5a17(0x131),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':'SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'}};export const APPCODE_FLAG_OPTIONAL={'name':a45_0x1b5a17(0x12a),'type':a45_0x1b5a17(0x13e),'required':![],'description':a45_0x1b5a17(0x13a)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a45_0x1b5a17(0x128),'required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};export const DB_TYPE_FLAG={'name':a45_0x1b5a17(0x13c),'type':a45_0x1b5a17(0x13e),'required':!![],'description':a45_0x1b5a17(0x12e),'enum':[a45_0x1b5a17(0x13b),a45_0x1b5a17(0x138)]};
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 +1 @@
1
- function a46_0xb372(){const _0x4d68fe=['test','2230672DTKvak','335342PgNUsQ','18QUoGHn','App\x20Code\x20cannot\x20be\x20empty','App\x20Code\x20cannot\x20exceed\x20100\x20characters','15SVKzWr','length','trim','2766654RlvFna','42052elhxwF','707470Qqjjpf','392014enMKxP','122894ipLEwl','35KHuahh'];a46_0xb372=function(){return _0x4d68fe;};return a46_0xb372();}function a46_0x5208(_0x2914b0,_0x1a610a){_0x2914b0=_0x2914b0-0x7e;const _0xb3729d=a46_0xb372();let _0x52088a=_0xb3729d[_0x2914b0];return _0x52088a;}(function(_0x2a21a4,_0x7132dc){const _0xda2345=a46_0x5208,_0xc432f8=_0x2a21a4();while(!![]){try{const _0x1d6d5e=parseInt(_0xda2345(0x8a))/0x1+parseInt(_0xda2345(0x86))/0x2*(-parseInt(_0xda2345(0x7f))/0x3)+-parseInt(_0xda2345(0x83))/0x4*(-parseInt(_0xda2345(0x87))/0x5)+-parseInt(_0xda2345(0x8b))/0x6*(-parseInt(_0xda2345(0x85))/0x7)+parseInt(_0xda2345(0x89))/0x8+-parseInt(_0xda2345(0x82))/0x9+-parseInt(_0xda2345(0x84))/0xa;if(_0x1d6d5e===_0x7132dc)break;else _0xc432f8['push'](_0xc432f8['shift']());}catch(_0x2dafe0){_0xc432f8['push'](_0xc432f8['shift']());}}}(a46_0xb372,0x29991));export function validateAppcode(_0x126e5d){const _0x2b8eae=a46_0x5208,_0x4d61ae=_0x126e5d[_0x2b8eae(0x81)]();if(!_0x4d61ae)return{'valid':![],'message':_0x2b8eae(0x8c)};if(_0x4d61ae[_0x2b8eae(0x80)]>0x64)return{'valid':![],'message':_0x2b8eae(0x7e)};if(!/^[A-Za-z0-9_-]+$/[_0x2b8eae(0x88)](_0x4d61ae))return{'valid':![],'message':'Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed'};return{'valid':!![]};}
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 +1 @@
1
- function a47_0x42b1(_0x4d601f,_0xf8c88f){_0x4d601f=_0x4d601f-0xf6;const _0x32af3c=a47_0x32af();let _0x42b138=_0x32af3c[_0x4d601f];return _0x42b138;}const a47_0x328c4f=a47_0x42b1;(function(_0x15d508,_0x821544){const _0x9c7b1a=a47_0x42b1,_0x15135b=_0x15d508();while(!![]){try{const _0x3dee30=-parseInt(_0x9c7b1a(0x10b))/0x1+parseInt(_0x9c7b1a(0xfc))/0x2+parseInt(_0x9c7b1a(0x10c))/0x3*(-parseInt(_0x9c7b1a(0xfe))/0x4)+-parseInt(_0x9c7b1a(0xfb))/0x5*(parseInt(_0x9c7b1a(0xf8))/0x6)+-parseInt(_0x9c7b1a(0x102))/0x7+-parseInt(_0x9c7b1a(0x106))/0x8*(-parseInt(_0x9c7b1a(0x100))/0x9)+parseInt(_0x9c7b1a(0x108))/0xa;if(_0x3dee30===_0x821544)break;else _0x15135b['push'](_0x15135b['shift']());}catch(_0x616b09){_0x15135b['push'](_0x15135b['shift']());}}}(a47_0x32af,0xd9caf));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(_0xb1be53){const _0x373b52=a47_0x42b1,_0x2976ff=_0xb1be53[_0x373b52(0xfd)](_0x373b52(0x107));if(!_0x2976ff)throw CliErrors[_0x373b52(0x10a)](_0x373b52(0xf7),_0x373b52(0x105)+CLI_BIN_NAME+_0x373b52(0xff));const _0x532ba0=readConfig(),_0x21a5e9=_0x2976ff===_0x373b52(0x103)?_0x373b52(0xfa):_0x2976ff,_0x2efc3e=_0x532ba0[_0x21a5e9];if(_0x2efc3e===undefined)throw CliErrors[_0x373b52(0x10a)](_0x373b52(0x109)+_0x2976ff);return{'ok':!![],'data':typeof _0x2efc3e===_0x373b52(0xf6)?_0x2efc3e:{[_0x21a5e9]:_0x2efc3e},'message':typeof _0x2efc3e==='object'?undefined:String(_0x2efc3e)};}export const configGetDefinition={'service':a47_0x328c4f(0x104),'command':'get','description':a47_0x328c4f(0x10d),'risk':a47_0x328c4f(0x101),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a47_0x328c4f(0x107),'type':a47_0x328c4f(0xf9),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};function a47_0x32af(){const _0x394ca7=['key','16316140EDcMeD','Key\x20not\x20found:\x20','validation','235361ftGEFd','3KFUcwu','Get\x20a\x20config\x20value\x20by\x20key','object','Missing\x20key.','6rqoULM','string','appcode','7457370pbvtXU','1888480LOnoKZ','str','338356Njwltd','\x20config\x20get\x20--key\x20<key>','9AlIdkw','read','2436798XgyLKH','app','config','Usage:\x20','3806104TYAatZ'];a47_0x32af=function(){return _0x394ca7;};return a47_0x32af();}
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 +1 @@
1
- (function(_0x5bfcde,_0x4b266b){const _0x426459=a48_0x200e,_0x1d34a9=_0x5bfcde();while(!![]){try{const _0x5bfe8d=parseInt(_0x426459(0xeb))/0x1+parseInt(_0x426459(0xe8))/0x2*(-parseInt(_0x426459(0xee))/0x3)+parseInt(_0x426459(0xe6))/0x4+parseInt(_0x426459(0xe9))/0x5+parseInt(_0x426459(0xe7))/0x6*(-parseInt(_0x426459(0xe5))/0x7)+-parseInt(_0x426459(0xed))/0x8+-parseInt(_0x426459(0xea))/0x9*(-parseInt(_0x426459(0xec))/0xa);if(_0x5bfe8d===_0x4b266b)break;else _0x1d34a9['push'](_0x1d34a9['shift']());}catch(_0x422644){_0x1d34a9['push'](_0x1d34a9['shift']());}}}(a48_0x41ed,0xdb289));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';function a48_0x41ed(){const _0x32895c=['14060ynHwDI','1541128QsgwdC','30mkCqox','21jNlCSB','1146800pNxceA','1500186OIjIXk','59210cmzewc','2086265nMlhec','8388nWCQyU','122112sPGCQY'];a48_0x41ed=function(){return _0x32895c;};return a48_0x41ed();}function a48_0x200e(_0x3197bf,_0x4375af){_0x3197bf=_0x3197bf-0xe5;const _0x41edfd=a48_0x41ed();let _0x200e17=_0x41edfd[_0x3197bf];return _0x200e17;}export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];
1
+ function a49_0x2ec0(_0x501893,_0x335c24){_0x501893=_0x501893-0x19e;const _0x2f049e=a49_0x2f04();let _0x2ec06d=_0x2f049e[_0x501893];return _0x2ec06d;}(function(_0x4ddbfe,_0x2c136c){const _0x3f2919=a49_0x2ec0,_0x3a7c60=_0x4ddbfe();while(!![]){try{const _0xaaec42=-parseInt(_0x3f2919(0x1a2))/0x1+-parseInt(_0x3f2919(0x19f))/0x2+parseInt(_0x3f2919(0x1a3))/0x3*(-parseInt(_0x3f2919(0x1a6))/0x4)+parseInt(_0x3f2919(0x1a4))/0x5+parseInt(_0x3f2919(0x19e))/0x6+-parseInt(_0x3f2919(0x1a1))/0x7*(parseInt(_0x3f2919(0x1a5))/0x8)+parseInt(_0x3f2919(0x1a0))/0x9;if(_0xaaec42===_0x2c136c)break;else _0x3a7c60['push'](_0x3a7c60['shift']());}catch(_0x4f84c0){_0x3a7c60['push'](_0x3a7c60['shift']());}}}(a49_0x2f04,0x6cda0));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';function a49_0x2f04(){const _0x2f5400=['2853CHoWWE','278915hLZlHn','422808YvlWJr','3748SANbPb','3175074aYMxoS','1482212RtzQQb','21264444nXzFnv','21mAvqLb','711076oajgIW'];a49_0x2f04=function(){return _0x2f5400;};return a49_0x2f04();}import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];