@lovrabet/rabetbase-cli 2.5.2-beta.2 → 2.5.2-beta.4

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 (354) hide show
  1. package/README.md +2 -2
  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/api/generate-sdk-config-file.js +1 -1
  6. package/lib/auth/auth-server-ui.js +1 -1
  7. package/lib/auth/auth-server.js +1 -1
  8. package/lib/auth/constant.js +1 -1
  9. package/lib/auth/get-cookie.js +1 -1
  10. package/lib/auth/get-session-user.js +1 -1
  11. package/lib/auth/is-session-valid.js +1 -1
  12. package/lib/auth/login-success-html.js +1 -1
  13. package/lib/auth/logout.js +1 -1
  14. package/lib/cli-flags.js +1 -1
  15. package/lib/cli.js +1 -1
  16. package/lib/commands/api/generate.js +1 -1
  17. package/lib/commands/api/index.js +1 -1
  18. package/lib/commands/api/list.js +1 -1
  19. package/lib/commands/api/pull.js +1 -1
  20. package/lib/commands/api/shared.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/members-list.js +1 -1
  24. package/lib/commands/app/remote-directory.js +1 -1
  25. package/lib/commands/app/shared.d.ts +1 -0
  26. package/lib/commands/app/shared.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 -1
  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-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.js +1 -1
  52. package/lib/commands/common/local-file.js +1 -1
  53. package/lib/commands/common/validate.js +1 -1
  54. package/lib/commands/config/delete.js +1 -1
  55. package/lib/commands/config/get.js +1 -1
  56. package/lib/commands/config/index.js +1 -1
  57. package/lib/commands/config/init.js +1 -1
  58. package/lib/commands/config/list.js +1 -1
  59. package/lib/commands/config/set.js +1 -1
  60. package/lib/commands/config/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/business-groups.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-restore.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  82. package/lib/commands/db/analysis-batching.js +1 -1
  83. package/lib/commands/db/analyze-batch-plan.js +1 -1
  84. package/lib/commands/db/analyze-cancel.js +1 -1
  85. package/lib/commands/db/analyze-start.js +1 -1
  86. package/lib/commands/db/analyze-status.js +1 -1
  87. package/lib/commands/db/create.js +1 -1
  88. package/lib/commands/db/delete.js +1 -1
  89. package/lib/commands/db/detail.js +1 -1
  90. package/lib/commands/db/diff-refresh-start.js +1 -1
  91. package/lib/commands/db/diff-refresh-status.js +1 -1
  92. package/lib/commands/db/diff.js +1 -1
  93. package/lib/commands/db/index.js +1 -1
  94. package/lib/commands/db/list.js +1 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/table-diff-shared.js +1 -1
  97. package/lib/commands/db/tables.js +1 -1
  98. package/lib/commands/db/test.js +1 -1
  99. package/lib/commands/db/update.js +1 -1
  100. package/lib/commands/deployment/auto-sync.js +1 -1
  101. package/lib/commands/deployment/index.js +1 -1
  102. package/lib/commands/deployment/sync-all.js +1 -1
  103. package/lib/commands/deployment/sync-jobs.js +1 -1
  104. package/lib/commands/deployment/sync-status.js +1 -1
  105. package/lib/commands/deployment/sync.js +1 -1
  106. package/lib/commands/doctor.js +1 -1
  107. package/lib/commands/file/index.js +1 -1
  108. package/lib/commands/instant-api-policy/current.js +1 -1
  109. package/lib/commands/instant-api-policy/index.js +1 -1
  110. package/lib/commands/instant-api-policy/init.js +1 -1
  111. package/lib/commands/instant-api-policy/publish.js +1 -1
  112. package/lib/commands/instant-api-policy/pull.js +1 -1
  113. package/lib/commands/instant-api-policy/revision.js +1 -1
  114. package/lib/commands/instant-api-policy/revisions.js +1 -1
  115. package/lib/commands/instant-api-policy/rollback.js +1 -1
  116. package/lib/commands/instant-api-policy/shared.js +1 -1
  117. package/lib/commands/instant-api-policy/validate.js +1 -1
  118. package/lib/commands/issue/index.js +1 -1
  119. package/lib/commands/issue/nudge.js +1 -1
  120. package/lib/commands/issue/report.js +1 -1
  121. package/lib/commands/issue/shared.js +1 -1
  122. package/lib/commands/kb/create.js +1 -1
  123. package/lib/commands/kb/delete.js +1 -1
  124. package/lib/commands/kb/detail.js +1 -1
  125. package/lib/commands/kb/index.js +1 -1
  126. package/lib/commands/kb/list.js +1 -1
  127. package/lib/commands/kb/search.js +1 -1
  128. package/lib/commands/kb/shared.js +1 -1
  129. package/lib/commands/kb/update.js +1 -1
  130. package/lib/commands/logs/index.js +1 -1
  131. package/lib/commands/menu/asset-update.js +1 -1
  132. package/lib/commands/menu/delete.js +1 -1
  133. package/lib/commands/menu/external-link-create.js +1 -1
  134. package/lib/commands/menu/external-link-update.js +1 -1
  135. package/lib/commands/menu/group-create.js +1 -1
  136. package/lib/commands/menu/group-update.js +1 -1
  137. package/lib/commands/menu/index.js +1 -1
  138. package/lib/commands/menu/list.js +1 -1
  139. package/lib/commands/menu/move.js +1 -1
  140. package/lib/commands/menu/regroup-start.js +1 -1
  141. package/lib/commands/menu/rename.js +1 -1
  142. package/lib/commands/menu/shared/compare-table.js +1 -1
  143. package/lib/commands/menu/shared/delete-plan.js +1 -1
  144. package/lib/commands/menu/shared/facts.js +1 -1
  145. package/lib/commands/menu/shared/index.js +1 -1
  146. package/lib/commands/menu/shared/inquirer.js +1 -1
  147. package/lib/commands/menu/shared/local-pages.js +1 -1
  148. package/lib/commands/menu/shared/logic.js +1 -1
  149. package/lib/commands/menu/shared/mutations.js +1 -1
  150. package/lib/commands/menu/shared/service.js +1 -1
  151. package/lib/commands/menu/shared/sync-core.js +1 -1
  152. package/lib/commands/menu/shared/update-core.js +1 -1
  153. package/lib/commands/menu/shared/valid-url.js +1 -1
  154. package/lib/commands/menu/sync.js +1 -1
  155. package/lib/commands/menu/visibility-update.js +1 -1
  156. package/lib/commands/notification/config-create.js +1 -1
  157. package/lib/commands/notification/config-delete.js +1 -1
  158. package/lib/commands/notification/config-list.js +1 -1
  159. package/lib/commands/notification/config-update.js +1 -1
  160. package/lib/commands/notification/index.js +1 -1
  161. package/lib/commands/notification/shared.js +1 -1
  162. package/lib/commands/ocr/index.js +1 -1
  163. package/lib/commands/page/create.js +1 -1
  164. package/lib/commands/page/custom/detail.js +1 -1
  165. package/lib/commands/page/custom/list.js +1 -1
  166. package/lib/commands/page/custom/publish.js +1 -1
  167. package/lib/commands/page/custom/shared.d.ts +0 -8
  168. package/lib/commands/page/custom/shared.js +1 -1
  169. package/lib/commands/page/custom/syntax.js +1 -1
  170. package/lib/commands/page/custom/update.js +1 -1
  171. package/lib/commands/page/data-list-status.js +1 -1
  172. package/lib/commands/page/generate-start.js +1 -1
  173. package/lib/commands/page/generate-status.js +1 -1
  174. package/lib/commands/page/index.js +1 -1
  175. package/lib/commands/page/pull.js +1 -1
  176. package/lib/commands/page/push.js +1 -1
  177. package/lib/commands/page/relation-audit.js +1 -1
  178. package/lib/commands/page/restore.js +1 -1
  179. package/lib/commands/page/shared.js +1 -1
  180. package/lib/commands/page/sync.js +1 -1
  181. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  182. package/lib/commands/project/create/format-elapsed.js +1 -1
  183. package/lib/commands/project/create/main.js +1 -1
  184. package/lib/commands/project/create/materialize-project-template.js +1 -1
  185. package/lib/commands/project/create/project-name.js +1 -1
  186. package/lib/commands/project/create/project-template-archive.js +1 -1
  187. package/lib/commands/project/create/project-template-path.js +1 -1
  188. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  189. package/lib/commands/project/create/use-format-code.js +1 -1
  190. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  191. package/lib/commands/project/domain-routing-sync.js +1 -1
  192. package/lib/commands/project/index.js +1 -1
  193. package/lib/commands/project/upgrade.js +1 -1
  194. package/lib/commands/registry.js +1 -1
  195. package/lib/commands/role/delete.js +1 -1
  196. package/lib/commands/role/detail.js +1 -1
  197. package/lib/commands/role/index.js +1 -1
  198. package/lib/commands/role/list.js +1 -1
  199. package/lib/commands/role/shared.js +1 -1
  200. package/lib/commands/role/update.js +1 -1
  201. package/lib/commands/role/user-add.js +1 -1
  202. package/lib/commands/role/user-remove.js +1 -1
  203. package/lib/commands/role/user-resolve.js +1 -1
  204. package/lib/commands/rule/get.js +1 -1
  205. package/lib/commands/rule/index.js +1 -1
  206. package/lib/commands/rule/list.js +1 -1
  207. package/lib/commands/rule/set.js +1 -1
  208. package/lib/commands/rule/shared.js +1 -1
  209. package/lib/commands/run/index.d.ts +4 -0
  210. package/lib/commands/run/index.js +1 -1
  211. package/lib/commands/schema.js +1 -1
  212. package/lib/commands/sql/create.js +1 -1
  213. package/lib/commands/sql/delete.js +1 -1
  214. package/lib/commands/sql/detail.js +1 -1
  215. package/lib/commands/sql/exec.js +1 -1
  216. package/lib/commands/sql/index.js +1 -1
  217. package/lib/commands/sql/list.js +1 -1
  218. package/lib/commands/sql/pull.js +1 -1
  219. package/lib/commands/sql/push.js +1 -1
  220. package/lib/commands/sql/shared.js +1 -1
  221. package/lib/commands/sql/status.js +1 -1
  222. package/lib/commands/sql/validate.js +1 -1
  223. package/lib/commands/task/index.js +1 -1
  224. package/lib/commands/task/status.js +1 -1
  225. package/lib/commands/tenant/index.js +1 -1
  226. package/lib/commands/tenant/members-list.js +1 -1
  227. package/lib/commands/tenant/shared.js +1 -1
  228. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  229. package/lib/commands/user-account/index.js +1 -1
  230. package/lib/commands/workspace/add.js +1 -1
  231. package/lib/commands/workspace/index.js +1 -1
  232. package/lib/commands/workspace/remove.js +1 -1
  233. package/lib/config/domain-config.d.ts +3 -7
  234. package/lib/config/domain-config.js +1 -1
  235. package/lib/config/project-domain-routing.d.ts +5 -1
  236. package/lib/config/project-domain-routing.js +1 -1
  237. package/lib/config/schema.js +1 -1
  238. package/lib/constant/cdn.js +1 -1
  239. package/lib/constant/cli.js +1 -1
  240. package/lib/constant/defaults.js +1 -1
  241. package/lib/constant/domain.js +1 -1
  242. package/lib/constant/env.js +1 -1
  243. package/lib/constant/output.js +1 -1
  244. package/lib/constant/paths.js +1 -1
  245. package/lib/constant/region.js +1 -1
  246. package/lib/constant/risk.js +1 -1
  247. package/lib/constant/routing-profile.js +1 -1
  248. package/lib/context/app-resolver.js +1 -1
  249. package/lib/context/auth-resolver.js +1 -1
  250. package/lib/context/config-loader.js +1 -1
  251. package/lib/context.js +1 -1
  252. package/lib/core/alias-resolver.js +1 -1
  253. package/lib/core/api-client.d.ts +1 -26
  254. package/lib/core/api-client.js +1 -1
  255. package/lib/core/bff/config.js +1 -1
  256. package/lib/core/bff/file-system.js +1 -1
  257. package/lib/core/bff/hash.js +1 -1
  258. package/lib/core/bff/lock.js +1 -1
  259. package/lib/core/bff/utils.js +1 -1
  260. package/lib/core/db-resolver.js +1 -1
  261. package/lib/core/instant-api-policy/config.js +1 -1
  262. package/lib/core/kb-search-client.js +1 -1
  263. package/lib/core/page/file-system.d.ts +43 -0
  264. package/lib/core/page/file-system.js +1 -1
  265. package/lib/core/page/hash.js +1 -1
  266. package/lib/core/page/lock.js +1 -1
  267. package/lib/core/sql-index-auditor.js +1 -1
  268. package/lib/core/sql-sync/config.js +1 -1
  269. package/lib/core/sql-sync/file-system.js +1 -1
  270. package/lib/core/sql-sync/hash.js +1 -1
  271. package/lib/core/sql-sync/lock.js +1 -1
  272. package/lib/core/sql-sync/utils.js +1 -1
  273. package/lib/core/sql-validator.js +1 -1
  274. package/lib/errors.js +1 -1
  275. package/lib/framework/build-all-flags.js +1 -1
  276. package/lib/framework/error-output.js +1 -1
  277. package/lib/framework/explicit-yes.js +1 -1
  278. package/lib/framework/flags.js +1 -1
  279. package/lib/framework/help.js +1 -1
  280. package/lib/framework/index.js +1 -1
  281. package/lib/framework/output.js +1 -1
  282. package/lib/framework/response.js +1 -1
  283. package/lib/framework/runner-alias.js +1 -1
  284. package/lib/framework/runner.js +1 -1
  285. package/lib/framework/schema-export.js +1 -1
  286. package/lib/framework/supported-flags.js +1 -1
  287. package/lib/framework/types.js +1 -1
  288. package/lib/generated/build-info.d.ts +4 -4
  289. package/lib/generated/build-info.js +1 -1
  290. package/lib/generated/official-routing.d.ts +1 -1
  291. package/lib/generated/official-routing.js +1 -1
  292. package/lib/generated/routing-contract.d.ts +1 -3
  293. package/lib/generated/routing-contract.js +1 -1
  294. package/lib/help.js +1 -1
  295. package/lib/postinstall.js +1 -1
  296. package/lib/runtime/confirmation.js +1 -1
  297. package/lib/runtime/event.js +1 -1
  298. package/lib/runtime/index.js +1 -1
  299. package/lib/runtime/queue.js +1 -1
  300. package/lib/runtime/resolve.js +1 -1
  301. package/lib/skills/builtin-skill.js +1 -1
  302. package/lib/skills/main.js +1 -1
  303. package/lib/skills/npx-skills-add.js +1 -1
  304. package/lib/skills/skill-presence.js +1 -1
  305. package/lib/telemetry/cli-command-trace.js +1 -1
  306. package/lib/telemetry/cli-help-trace.js +1 -1
  307. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  308. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  309. package/lib/telemetry/send-cli-trace-log.js +1 -1
  310. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  311. package/lib/utils/ai_config.js +1 -1
  312. package/lib/utils/apply-jq-filter.js +1 -1
  313. package/lib/utils/cdn-config.js +1 -1
  314. package/lib/utils/check-sdk-version.js +1 -1
  315. package/lib/utils/cli-version-check.js +1 -1
  316. package/lib/utils/cli-version-policy.js +1 -1
  317. package/lib/utils/config.js +1 -1
  318. package/lib/utils/entity-with-id.js +1 -1
  319. package/lib/utils/file-utils.js +1 -1
  320. package/lib/utils/guides-cdn.js +1 -1
  321. package/lib/utils/http-client.js +1 -1
  322. package/lib/utils/is-non-interactive.js +1 -1
  323. package/lib/utils/logger.js +1 -1
  324. package/lib/utils/params.js +1 -1
  325. package/lib/utils/platform.js +1 -1
  326. package/lib/utils/sleep.js +1 -1
  327. package/lib/utils/template-replacer.js +1 -1
  328. package/lib/utils/update-notice.js +1 -1
  329. package/lib/utils/version.js +1 -1
  330. package/lib/utils/with-active-cookie.js +1 -1
  331. package/lib/utils/write-cli-side-channel.js +1 -1
  332. package/package.json +2 -1
  333. package/skills/rabetbase/SKILL.md +6 -6
  334. package/skills/rabetbase/guides/custom-page-workflow.md +35 -17
  335. package/skills/rabetbase/guides/page-development-workflow.md +1 -1
  336. package/skills/rabetbase/knowledge/components.md +292 -0
  337. package/skills/rabetbase/knowledge/custom-page/generation-standards.md +74 -4
  338. package/skills/rabetbase/knowledge/custom-page/page-templates.md +68 -0
  339. package/skills/rabetbase/references/rabetbase-app-members-list.md +2 -0
  340. package/skills/rabetbase/references/rabetbase-page-create.md +21 -9
  341. package/skills/rabetbase/references/rabetbase-page-custom-detail.md +1 -1
  342. package/skills/rabetbase/references/rabetbase-page-custom-update.md +13 -9
  343. package/skills/rabetbase/references/rabetbase-project-create.md +5 -2
  344. package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +2 -2
  345. package/skills/rabetbase/references/rabetbase-run.md +1 -0
  346. package/skills/rabetbase.manifest.json +5 -4
  347. package/templates/README.md +10 -4
  348. package/templates/custom-pages/blank.json +5 -0
  349. package/templates/custom-pages/dashboard.json +5 -0
  350. package/templates/custom-pages/onepage.json +5 -0
  351. package/templates/generate-api/api.ts.tpl +1 -1
  352. package/lib/commands/page/custom/template.d.ts +0 -8
  353. package/lib/commands/page/custom/template.js +0 -1
  354. package/skills/rabetbase/knowledge/custom-page/components.md +0 -225
@@ -1 +1 @@
1
- const a32_0x310b1e=a32_0x1eda;(function(_0x28efe1,_0x524649){const _0x590c1c=a32_0x1eda,_0x2201ea=_0x28efe1();while(!![]){try{const _0x187018=-parseInt(_0x590c1c(0x13b))/0x1*(-parseInt(_0x590c1c(0x149))/0x2)+-parseInt(_0x590c1c(0x13e))/0x3*(-parseInt(_0x590c1c(0x133))/0x4)+parseInt(_0x590c1c(0x134))/0x5+parseInt(_0x590c1c(0x132))/0x6+-parseInt(_0x590c1c(0x145))/0x7+-parseInt(_0x590c1c(0x12c))/0x8+-parseInt(_0x590c1c(0x147))/0x9*(parseInt(_0x590c1c(0x12b))/0xa);if(_0x187018===_0x524649)break;else _0x2201ea['push'](_0x2201ea['shift']());}catch(_0xfd2f44){_0x2201ea['push'](_0x2201ea['shift']());}}}(a32_0x3538,0x83f24));function a32_0x3538(){const _0x545cea=['scriptsRootDir','string','29rOJmUv','/api/management/library/scripts/delete','stringify','3nHonIW','validation','split','Would\x20delete\x20','functions','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','keys','7189679zPsmIO','Deleted\x20','72lQrPVC','apps','65942NvSrUb','length','Backend\x20Function\x20lock\x20file\x20not\x20found.','\x20(local\x20file\x20moved\x20to\x20trash)','target','delete','Local\x20delete\x20not\x20settled\x20for\x20','toISOString','lockFilePath','map','scriptsRoot','\x20\x20-\x20','\x22\x20not\x20found\x20after\x20ensureLockScope.','appCode','find','202690DvIwYk','6356344ZpqsRQ','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','projectRoot','includes','remoteId','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','1627692KfFDol','3191704AaOlXI','2494385RIQHxf','trashDir','<timestamp>','Function\x20not\x20found:\x20','str'];a32_0x3538=function(){return _0x545cea;};return a32_0x3538();}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':'bff','command':a32_0x310b1e(0x14e),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':'high-risk-write','flags':[{'name':'target','type':a32_0x310b1e(0x13a),'required':!![],'description':a32_0x310b1e(0x143)}],async 'validate'(_0x1f8bdc){const _0x402595=a32_0x310b1e,_0xaaef2=loadBffProjectConfig(_0x1f8bdc[_0x402595(0x156)]),_0x326168=await readBffLockFile(_0xaaef2['lockFilePath']);if(!_0x326168)throw CliErrors[_0x402595(0x13f)](_0x402595(0x12d));},async 'dryRun'(_0x4238dd){const _0x2dd9af=a32_0x310b1e,_0x4f0811=loadBffProjectConfig(_0x4238dd[_0x2dd9af(0x156)]),_0x5507cd=await readBffLockFile(_0x4f0811[_0x2dd9af(0x151)]);if(!_0x5507cd)throw CliErrors[_0x2dd9af(0x13f)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0xebdc71}=ensureLockScope(_0x5507cd,_0x4238dd[_0x2dd9af(0x156)],_0x4f0811[_0x2dd9af(0x153)],_0x2dd9af(0x14e)),_0xbb6000=_0x4238dd[_0x2dd9af(0x138)]('target'),_0x45db6c=Object['keys'](_0xebdc71[_0x2dd9af(0x142)]),_0x294284=resolveDeleteTarget(_0xbb6000,_0x45db6c),_0x32b1e1=_0xebdc71[_0x2dd9af(0x142)][_0x294284];if(!_0x32b1e1)throw CliErrors[_0x2dd9af(0x13f)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x294284+'\x22.');const _0x59d939=resolveLocalFilePathFromLockKey(_0x4f0811,_0x294284),_0x191c82=relative(_0x4f0811[_0x2dd9af(0x12e)],_0x59d939),_0x44fa12=join(_0x4f0811['trashDir'],_0x2dd9af(0x136),_0x191c82);return{'method':'POST','url':_0x2dd9af(0x13c),'body':{'appCode':_0x4238dd[_0x2dd9af(0x156)],'target':_0x294284,'remoteId':_0x32b1e1[_0x2dd9af(0x130)],'localFilePath':_0x59d939,'trashedPath':_0x44fa12},'description':_0x2dd9af(0x141)+_0x294284+_0x2dd9af(0x131)};},async 'execute'(_0x2cebd7){const _0x329330=a32_0x310b1e,_0x56429a=loadBffProjectConfig(_0x2cebd7[_0x329330(0x156)]),_0x160e7c=await readBffLockFile(_0x56429a[_0x329330(0x151)]);if(!_0x160e7c)throw CliErrors[_0x329330(0x13f)](_0x329330(0x14b));const {lockData:_0x38dff4,appLock:_0x4ca965}=ensureLockScope(_0x160e7c,_0x2cebd7[_0x329330(0x156)],_0x56429a[_0x329330(0x153)],'delete'),_0xba1308=JSON['parse'](JSON[_0x329330(0x13d)](_0x38dff4)),_0x2d0d8a=_0xba1308[_0x329330(0x148)][_0x2cebd7['appCode']];if(!_0x2d0d8a)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x2cebd7[_0x329330(0x156)]+_0x329330(0x155));const _0xff9048=_0x2cebd7[_0x329330(0x138)](_0x329330(0x14d)),_0x2607c2=Object[_0x329330(0x144)](_0x2d0d8a[_0x329330(0x142)]),_0x508d2e=resolveDeleteTarget(_0xff9048,_0x2607c2),_0xcd046c=_0x2d0d8a[_0x329330(0x142)][_0x508d2e];if(!_0xcd046c)throw CliErrors[_0x329330(0x13f)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x508d2e+'\x22.');await deleteBffScript(_0xcd046c[_0x329330(0x130)]),delete _0x2d0d8a[_0x329330(0x142)][_0x508d2e],_0x2d0d8a['lastSync']=new Date()[_0x329330(0x150)](),await writeBffLockFile(_0x56429a[_0x329330(0x151)],_0xba1308);const _0x51c124=resolveLocalFilePathFromLockKey(_0x56429a,_0x508d2e);let _0x2f26f0;await fileExists(_0x51c124)&&(_0x2f26f0=await moveToTrash(_0x56429a['projectRoot'],_0x56429a[_0x329330(0x135)],_0x51c124),await cleanupEmptyDirectories(dirname(_0x51c124),_0x56429a[_0x329330(0x139)]));await waitForDeleteSettlement(_0x56429a[_0x329330(0x151)],_0x2cebd7[_0x329330(0x156)],_0x508d2e,_0x51c124),await sleep(0x96);const _0x4e5849={'deleted':_0x508d2e,'remoteId':_0xcd046c[_0x329330(0x130)]};if(_0x2f26f0)_0x4e5849['trashedTo']=_0x2f26f0;return{'ok':!![],'data':_0x4e5849,'message':_0x329330(0x146)+_0x508d2e+(_0x2f26f0?_0x329330(0x14c):'')};}};function resolveDeleteTarget(_0x50753d,_0x17290b){const _0x2d382=a32_0x310b1e;if(_0x50753d[_0x2d382(0x12f)]('/')){const _0x51e35c=_0x17290b[_0x2d382(0x157)](_0x2ca431=>_0x2ca431===_0x50753d);if(!_0x51e35c)throw CliErrors['validation'](_0x2d382(0x137)+_0x50753d);return _0x51e35c;}const _0x5de1be=_0x17290b['filter'](_0x217e1d=>_0x217e1d[_0x2d382(0x140)]('/')['at'](-0x1)===_0x50753d);if(_0x5de1be['length']===0x0)throw CliErrors[_0x2d382(0x13f)]('Function\x20not\x20found:\x20'+_0x50753d);if(_0x5de1be[_0x2d382(0x14a)]>0x1)throw CliErrors[_0x2d382(0x13f)]('Multiple\x20functions\x20match\x20\x22'+_0x50753d+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x5de1be[_0x2d382(0x152)](_0x2a7879=>_0x2d382(0x154)+_0x2a7879)['join']('\x0a'));return _0x5de1be[0x0];}async function moveToTrash(_0x49eab7,_0x204232,_0x28b4c9){const _0x562baa=a32_0x310b1e,_0x7482c0=new Date()[_0x562baa(0x150)]()['replace'](/[:.]/g,'-'),_0x5d47ae=relative(_0x49eab7,_0x28b4c9),_0xefb1b7=join(_0x204232,_0x7482c0,_0x5d47ae);return await mkdir(dirname(_0xefb1b7),{'recursive':!![]}),await rename(_0x28b4c9,_0xefb1b7),_0xefb1b7;}function a32_0x1eda(_0x33cf89,_0x3863c6){_0x33cf89=_0x33cf89-0x12b;const _0x3538c2=a32_0x3538();let _0x1eda60=_0x3538c2[_0x33cf89];return _0x1eda60;}async function cleanupEmptyDirectories(_0x161c3b,_0x124396){const _0x3e8427=a32_0x310b1e;let _0x5bcc23=resolve(_0x161c3b);const _0x530b78=resolve(_0x124396);while(_0x5bcc23['startsWith'](''+_0x530b78+sep)||_0x5bcc23===_0x530b78){if(_0x5bcc23===_0x530b78)return;try{const _0x1cfd46=await readdir(_0x5bcc23);if(_0x1cfd46[_0x3e8427(0x14a)]>0x0)return;await rmdir(_0x5bcc23);}catch{return;}_0x5bcc23=dirname(_0x5bcc23);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x1b77d5,_0x21b8fa,_0x2f6064,_0x3986fd){const _0x6aed46=a32_0x310b1e;for(let _0x340291=0x0;_0x340291<DELETE_SETTLE_RETRY_COUNT;_0x340291+=0x1){const _0x50aa73=await readBffLockFile(_0x1b77d5),_0x3c74c7=!!_0x50aa73?.[_0x6aed46(0x148)]?.[_0x21b8fa]?.[_0x6aed46(0x142)]?.[_0x2f6064],_0x380463=await fileExists(_0x3986fd);if(!_0x3c74c7&&!_0x380463)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x6aed46(0x14f)+_0x2f6064+'.');}
1
+ const a32_0x472e4d=a32_0x3706;(function(_0x36da2e,_0x11367f){const _0x20c997=a32_0x3706,_0x22a60a=_0x36da2e();while(!![]){try{const _0x2ac3eb=-parseInt(_0x20c997(0x21f))/0x1*(parseInt(_0x20c997(0x1f9))/0x2)+parseInt(_0x20c997(0x21e))/0x3+-parseInt(_0x20c997(0x20c))/0x4+-parseInt(_0x20c997(0x20e))/0x5+parseInt(_0x20c997(0x223))/0x6*(-parseInt(_0x20c997(0x212))/0x7)+parseInt(_0x20c997(0x205))/0x8*(-parseInt(_0x20c997(0x216))/0x9)+parseInt(_0x20c997(0x201))/0xa;if(_0x2ac3eb===_0x11367f)break;else _0x22a60a['push'](_0x22a60a['shift']());}catch(_0x2d42a3){_0x22a60a['push'](_0x22a60a['shift']());}}}(a32_0x2ac7,0xd8299));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':a32_0x472e4d(0x203),'command':a32_0x472e4d(0x224),'description':a32_0x472e4d(0x21b),'risk':'high-risk-write','flags':[{'name':a32_0x472e4d(0x211),'type':a32_0x472e4d(0x1f6),'required':!![],'description':a32_0x472e4d(0x1fd)}],async 'validate'(_0x188434){const _0x1c6000=a32_0x472e4d,_0x4c00c8=loadBffProjectConfig(_0x188434[_0x1c6000(0x217)]),_0x3828dc=await readBffLockFile(_0x4c00c8[_0x1c6000(0x1fa)]);if(!_0x3828dc)throw CliErrors['validation'](_0x1c6000(0x225));},async 'dryRun'(_0x5a779d){const _0x53d5b2=a32_0x472e4d,_0x27a0c2=loadBffProjectConfig(_0x5a779d[_0x53d5b2(0x217)]),_0x52b9fe=await readBffLockFile(_0x27a0c2[_0x53d5b2(0x1fa)]);if(!_0x52b9fe)throw CliErrors[_0x53d5b2(0x1fe)](_0x53d5b2(0x20f));const {appLock:_0x718819}=ensureLockScope(_0x52b9fe,_0x5a779d['appCode'],_0x27a0c2['scriptsRoot'],_0x53d5b2(0x224)),_0x317a92=_0x5a779d['str']('target'),_0x4ffe7e=Object[_0x53d5b2(0x1f2)](_0x718819['functions']),_0x475053=resolveDeleteTarget(_0x317a92,_0x4ffe7e),_0x189664=_0x718819[_0x53d5b2(0x21a)][_0x475053];if(!_0x189664)throw CliErrors['validation'](_0x53d5b2(0x1f7)+_0x475053+'\x22.');const _0x25634d=resolveLocalFilePathFromLockKey(_0x27a0c2,_0x475053),_0x48efaf=relative(_0x27a0c2[_0x53d5b2(0x202)],_0x25634d),_0x2bcb72=join(_0x27a0c2[_0x53d5b2(0x1fb)],'<timestamp>',_0x48efaf);return{'method':_0x53d5b2(0x208),'url':_0x53d5b2(0x20b),'body':{'appCode':_0x5a779d[_0x53d5b2(0x217)],'target':_0x475053,'remoteId':_0x189664[_0x53d5b2(0x1f8)],'localFilePath':_0x25634d,'trashedPath':_0x2bcb72},'description':_0x53d5b2(0x221)+_0x475053+_0x53d5b2(0x207)};},async 'execute'(_0x354aa0){const _0x29ce25=a32_0x472e4d,_0x577ebb=loadBffProjectConfig(_0x354aa0[_0x29ce25(0x217)]),_0x39d9ac=await readBffLockFile(_0x577ebb[_0x29ce25(0x1fa)]);if(!_0x39d9ac)throw CliErrors['validation']('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {lockData:_0x3f544c,appLock:_0x3fa67f}=ensureLockScope(_0x39d9ac,_0x354aa0[_0x29ce25(0x217)],_0x577ebb[_0x29ce25(0x1ff)],'delete'),_0x8c7bcf=JSON['parse'](JSON[_0x29ce25(0x20d)](_0x3f544c)),_0x3b1c3e=_0x8c7bcf[_0x29ce25(0x1f3)][_0x354aa0[_0x29ce25(0x217)]];if(!_0x3b1c3e)throw new Error(_0x29ce25(0x20a)+_0x354aa0[_0x29ce25(0x217)]+_0x29ce25(0x215));const _0x1a8ceb=_0x354aa0['str'](_0x29ce25(0x211)),_0x5933c7=Object['keys'](_0x3b1c3e[_0x29ce25(0x21a)]),_0x4c32aa=resolveDeleteTarget(_0x1a8ceb,_0x5933c7),_0x486d56=_0x3b1c3e['functions'][_0x4c32aa];if(!_0x486d56)throw CliErrors[_0x29ce25(0x1fe)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x4c32aa+'\x22.');await deleteBffScript(_0x486d56[_0x29ce25(0x1f8)]),delete _0x3b1c3e[_0x29ce25(0x21a)][_0x4c32aa],_0x3b1c3e[_0x29ce25(0x209)]=new Date()[_0x29ce25(0x222)](),await writeBffLockFile(_0x577ebb[_0x29ce25(0x1fa)],_0x8c7bcf);const _0x1a47c7=resolveLocalFilePathFromLockKey(_0x577ebb,_0x4c32aa);let _0x30cef9;await fileExists(_0x1a47c7)&&(_0x30cef9=await moveToTrash(_0x577ebb['projectRoot'],_0x577ebb[_0x29ce25(0x1fb)],_0x1a47c7),await cleanupEmptyDirectories(dirname(_0x1a47c7),_0x577ebb[_0x29ce25(0x213)]));await waitForDeleteSettlement(_0x577ebb[_0x29ce25(0x1fa)],_0x354aa0[_0x29ce25(0x217)],_0x4c32aa,_0x1a47c7),await sleep(0x96);const _0xd696b={'deleted':_0x4c32aa,'remoteId':_0x486d56[_0x29ce25(0x1f8)]};if(_0x30cef9)_0xd696b['trashedTo']=_0x30cef9;return{'ok':!![],'data':_0xd696b,'message':_0x29ce25(0x214)+_0x4c32aa+(_0x30cef9?_0x29ce25(0x204):'')};}};function resolveDeleteTarget(_0x487aec,_0x8a7d19){const _0x2b53f5=a32_0x472e4d;if(_0x487aec[_0x2b53f5(0x1f4)]('/')){const _0x5dd7f6=_0x8a7d19['find'](_0x2971ab=>_0x2971ab===_0x487aec);if(!_0x5dd7f6)throw CliErrors[_0x2b53f5(0x1fe)]('Function\x20not\x20found:\x20'+_0x487aec);return _0x5dd7f6;}const _0x132ff1=_0x8a7d19[_0x2b53f5(0x220)](_0x10c654=>_0x10c654['split']('/')['at'](-0x1)===_0x487aec);if(_0x132ff1['length']===0x0)throw CliErrors['validation'](_0x2b53f5(0x200)+_0x487aec);if(_0x132ff1[_0x2b53f5(0x1fc)]>0x1)throw CliErrors['validation'](_0x2b53f5(0x210)+_0x487aec+_0x2b53f5(0x218)+_0x132ff1[_0x2b53f5(0x21d)](_0x539aae=>_0x2b53f5(0x21c)+_0x539aae)['join']('\x0a'));return _0x132ff1[0x0];}function a32_0x3706(_0x3428cd,_0x4292b5){_0x3428cd=_0x3428cd-0x1f2;const _0x2ac7cc=a32_0x2ac7();let _0x37062d=_0x2ac7cc[_0x3428cd];return _0x37062d;}function a32_0x2ac7(){const _0x585c7e=['\x22\x20not\x20found\x20after\x20ensureLockScope.','8296929LCYUyH','appCode','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','Local\x20delete\x20not\x20settled\x20for\x20','functions','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','\x20\x20-\x20','map','5092089BXgltn','34ZbxSVQ','filter','Would\x20delete\x20','toISOString','51882FYBWsJ','delete','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','keys','apps','includes','replace','string','No\x20lock\x20entry\x20found\x20for\x20\x22','remoteId','51720MGFiHY','lockFilePath','trashDir','length','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','validation','scriptsRoot','Function\x20not\x20found:\x20','40233850FduEBv','projectRoot','bff','\x20(local\x20file\x20moved\x20to\x20trash)','8ssfOdi','startsWith','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','POST','lastSync','Lock\x20scope\x20for\x20app\x20\x22','/api/management/library/scripts/delete','4318312jNrNIS','stringify','8476190fezwgK','Backend\x20Function\x20lock\x20file\x20not\x20found.','Multiple\x20functions\x20match\x20\x22','target','210tVeLPg','scriptsRootDir','Deleted\x20'];a32_0x2ac7=function(){return _0x585c7e;};return a32_0x2ac7();}async function moveToTrash(_0x480407,_0x28b146,_0xb9aadc){const _0x3d9c4b=a32_0x472e4d,_0x99aad2=new Date()[_0x3d9c4b(0x222)]()[_0x3d9c4b(0x1f5)](/[:.]/g,'-'),_0x234da9=relative(_0x480407,_0xb9aadc),_0x35664b=join(_0x28b146,_0x99aad2,_0x234da9);return await mkdir(dirname(_0x35664b),{'recursive':!![]}),await rename(_0xb9aadc,_0x35664b),_0x35664b;}async function cleanupEmptyDirectories(_0x5aa185,_0x3741f7){const _0x1dd61a=a32_0x472e4d;let _0x31b5aa=resolve(_0x5aa185);const _0x519000=resolve(_0x3741f7);while(_0x31b5aa[_0x1dd61a(0x206)](''+_0x519000+sep)||_0x31b5aa===_0x519000){if(_0x31b5aa===_0x519000)return;try{const _0x5e50cb=await readdir(_0x31b5aa);if(_0x5e50cb[_0x1dd61a(0x1fc)]>0x0)return;await rmdir(_0x31b5aa);}catch{return;}_0x31b5aa=dirname(_0x31b5aa);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x414c64,_0x2d7388,_0x20ab40,_0x5eb905){const _0x647981=a32_0x472e4d;for(let _0x25f9b5=0x0;_0x25f9b5<DELETE_SETTLE_RETRY_COUNT;_0x25f9b5+=0x1){const _0x258053=await readBffLockFile(_0x414c64),_0x686d13=!!_0x258053?.[_0x647981(0x1f3)]?.[_0x2d7388]?.['functions']?.[_0x20ab40],_0x90023c=await fileExists(_0x5eb905);if(!_0x686d13&&!_0x90023c)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x647981(0x219)+_0x20ab40+'.');}
@@ -1 +1 @@
1
- const a33_0x35102e=a33_0x33d2;(function(_0xc39c05,_0x2bcf68){const _0x583232=a33_0x33d2,_0x53dc7d=_0xc39c05();while(!![]){try{const _0x1c46df=parseInt(_0x583232(0xde))/0x1+parseInt(_0x583232(0xd0))/0x2*(-parseInt(_0x583232(0xd6))/0x3)+parseInt(_0x583232(0xd5))/0x4*(-parseInt(_0x583232(0xe0))/0x5)+-parseInt(_0x583232(0xda))/0x6+-parseInt(_0x583232(0xcf))/0x7*(parseInt(_0x583232(0xcb))/0x8)+-parseInt(_0x583232(0xdc))/0x9+parseInt(_0x583232(0xdf))/0xa*(parseInt(_0x583232(0xce))/0xb);if(_0x1c46df===_0x2bcf68)break;else _0x53dc7d['push'](_0x53dc7d['shift']());}catch(_0x428ecb){_0x53dc7d['push'](_0x53dc7d['shift']());}}}(a33_0xcc7e,0xf2579));function a33_0x33d2(_0x3459e3,_0x2a314e){_0x3459e3=_0x3459e3-0xca;const _0xcc7e4a=a33_0xcc7e();let _0x33d24f=_0xcc7e4a[_0x3459e3];return _0x33d24f;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a33_0x35102e(0xd1),'description':a33_0x35102e(0xd3),'risk':a33_0x35102e(0xe1),'flags':[{'name':'id','type':'number','required':!![],'description':a33_0x35102e(0xd4)},{'name':a33_0x35102e(0xca),'type':'boolean','description':a33_0x35102e(0xe2)}],async 'execute'(_0x1af080){const _0xf66fbb=a33_0x35102e,_0x1324b4=await getBffScriptInfo(_0x1af080[_0xf66fbb(0xcd)]('id')),_0x5693f7=_0x1af080[_0xf66fbb(0xd2)]('verbose');if(_0x5693f7)return{'ok':!![],'data':_0x1324b4};return{'ok':!![],'data':{'id':_0x1324b4['id'],'functionName':_0x1324b4[_0xf66fbb(0xdb)]??'','version':_0x1324b4[_0xf66fbb(0xd8)]??'','updateUserName':_0x1324b4[_0xf66fbb(0xcc)]??'','appCode':_0x1324b4['appCode'],'scriptType':_0x1324b4[_0xf66fbb(0xd7)],'description':_0x1324b4['description']||_0xf66fbb(0xd9),'createdTime':_0x1324b4['createdTime']??'','updatedTime':_0x1324b4['updatedTime']??'','scriptContent':_0x1324b4[_0xf66fbb(0xdd)]??''}};}};function a33_0xcc7e(){const _0x4fac35=['detail','bool','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','Script\x20ID','4ARDGBx','3261dwWkip','scriptType','version','(none)','1498068AYnBoQ','functionName','8152317UJcUAf','scriptContent','1695273CCGJwI','1660SubTQD','4207115fCIPWj','read','Return\x20full\x20raw\x20script\x20object','verbose','782344JAClNj','updateUserName','num','301389dnOlTC','98mwLbUl','3468VOkepS'];a33_0xcc7e=function(){return _0x4fac35;};return a33_0xcc7e();}
1
+ function a33_0x3849(_0x319dad,_0x1d2bd0){_0x319dad=_0x319dad-0xd9;const _0x12d0c6=a33_0x12d0();let _0x38495c=_0x12d0c6[_0x319dad];return _0x38495c;}const a33_0x58ca3a=a33_0x3849;(function(_0x3cafe3,_0x45264f){const _0x1b553f=a33_0x3849,_0x4157d2=_0x3cafe3();while(!![]){try{const _0x4e3526=parseInt(_0x1b553f(0xe0))/0x1+parseInt(_0x1b553f(0xed))/0x2*(parseInt(_0x1b553f(0xea))/0x3)+parseInt(_0x1b553f(0xe2))/0x4*(parseInt(_0x1b553f(0xdc))/0x5)+-parseInt(_0x1b553f(0xe6))/0x6*(-parseInt(_0x1b553f(0xe5))/0x7)+-parseInt(_0x1b553f(0xdb))/0x8*(parseInt(_0x1b553f(0xec))/0x9)+parseInt(_0x1b553f(0xde))/0xa+-parseInt(_0x1b553f(0xf0))/0xb;if(_0x4e3526===_0x45264f)break;else _0x4157d2['push'](_0x4157d2['shift']());}catch(_0x15cc42){_0x4157d2['push'](_0x4157d2['shift']());}}}(a33_0x12d0,0x18ca7));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a33_0x58ca3a(0xe8),'description':a33_0x58ca3a(0xdf),'risk':a33_0x58ca3a(0xe4),'flags':[{'name':'id','type':'number','required':!![],'description':a33_0x58ca3a(0xee)},{'name':'verbose','type':a33_0x58ca3a(0xef),'description':a33_0x58ca3a(0xdd)}],async 'execute'(_0x546721){const _0xd214b8=a33_0x58ca3a,_0x351abc=await getBffScriptInfo(_0x546721['num']('id')),_0x55eaed=_0x546721['bool'](_0xd214b8(0xe1));if(_0x55eaed)return{'ok':!![],'data':_0x351abc};return{'ok':!![],'data':{'id':_0x351abc['id'],'functionName':_0x351abc[_0xd214b8(0xeb)]??'','version':_0x351abc[_0xd214b8(0xda)]??'','updateUserName':_0x351abc[_0xd214b8(0xe3)]??'','appCode':_0x351abc[_0xd214b8(0xf1)],'scriptType':_0x351abc[_0xd214b8(0xd9)],'description':_0x351abc[_0xd214b8(0xf2)]||_0xd214b8(0xe7),'createdTime':_0x351abc['createdTime']??'','updatedTime':_0x351abc['updatedTime']??'','scriptContent':_0x351abc[_0xd214b8(0xe9)]??''}};}};function a33_0x12d0(){const _0xee78e5=['scriptType','version','1448kaPzcJ','16735zLDFiX','Return\x20full\x20raw\x20script\x20object','1960730mocsWL','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','149186ywllCo','verbose','232xPDWPM','updateUserName','read','536669xcFlxS','6tZxENk','(none)','detail','scriptContent','6APNiqf','functionName','1791sfZTVq','179650BRMsiG','Script\x20ID','boolean','7239540VQqujP','appCode','description'];a33_0x12d0=function(){return _0xee78e5;};return a33_0x12d0();}
@@ -1 +1 @@
1
- function a34_0x25c3(_0x3dbeb2,_0x433274){_0x3dbeb2=_0x3dbeb2-0x1e9;const _0x2ca30a=a34_0x2ca3();let _0x25c338=_0x2ca30a[_0x3dbeb2];return _0x25c338;}(function(_0x8852fb,_0x175383){const _0x798b8c=a34_0x25c3,_0x3a38c0=_0x8852fb();while(!![]){try{const _0x46209e=parseInt(_0x798b8c(0x1eb))/0x1*(-parseInt(_0x798b8c(0x1ea))/0x2)+parseInt(_0x798b8c(0x1f0))/0x3*(-parseInt(_0x798b8c(0x1ee))/0x4)+-parseInt(_0x798b8c(0x1ed))/0x5*(parseInt(_0x798b8c(0x1f1))/0x6)+parseInt(_0x798b8c(0x1e9))/0x7+-parseInt(_0x798b8c(0x1f2))/0x8+-parseInt(_0x798b8c(0x1ec))/0x9+parseInt(_0x798b8c(0x1ef))/0xa;if(_0x46209e===_0x175383)break;else _0x3a38c0['push'](_0x3a38c0['shift']());}catch(_0x199fc5){_0x3a38c0['push'](_0x3a38c0['shift']());}}}(a34_0x2ca3,0x1deed));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a34_0x2ca3(){const _0x52b8e4=['1684956TDnSJk','2OwtCnf','42391zNLZOR','230535gCosCO','1195365HSEbXC','907124mocQka','5029270bSRhKa','3EPqQzC','6uRDcHS','697360bmSnRm'];a34_0x2ca3=function(){return _0x52b8e4;};return a34_0x2ca3();}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x2c2877,_0x115731){const _0xb6dff7=a34_0x110e,_0x505d5a=_0x2c2877();while(!![]){try{const _0x5320ee=-parseInt(_0xb6dff7(0x6c))/0x1+parseInt(_0xb6dff7(0x69))/0x2+-parseInt(_0xb6dff7(0x6e))/0x3+-parseInt(_0xb6dff7(0x66))/0x4+-parseInt(_0xb6dff7(0x6d))/0x5*(parseInt(_0xb6dff7(0x68))/0x6)+-parseInt(_0xb6dff7(0x67))/0x7+parseInt(_0xb6dff7(0x6b))/0x8*(parseInt(_0xb6dff7(0x6a))/0x9);if(_0x5320ee===_0x115731)break;else _0x505d5a['push'](_0x505d5a['shift']());}catch(_0x5ca353){_0x505d5a['push'](_0x505d5a['shift']());}}}(a34_0x15ab,0xa0caf));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a34_0x15ab(){const _0x3069c0=['2873500xDUOMf','735162NzkTEo','602242ubOxoC','1017DWcQno','154944SjMLzb','419791fxJhWW','35uPsSJX','280128jMZDMt','198968nISJvn'];a34_0x15ab=function(){return _0x3069c0;};return a34_0x15ab();}import{bffCreate}from'../../commands/bff/create.js';function a34_0x110e(_0x2ae98e,_0x543d0a){_0x2ae98e=_0x2ae98e-0x66;const _0x15ab0b=a34_0x15ab();let _0x110e4b=_0x15ab0b[_0x2ae98e];return _0x110e4b;}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 a35_0x152a32=a35_0x3c6d;(function(_0xf8dfa0,_0x3be78a){const _0x7684fe=a35_0x3c6d,_0x1f4774=_0xf8dfa0();while(!![]){try{const _0x58249f=-parseInt(_0x7684fe(0x1b3))/0x1*(parseInt(_0x7684fe(0x198))/0x2)+parseInt(_0x7684fe(0x1a4))/0x3*(-parseInt(_0x7684fe(0x1a3))/0x4)+-parseInt(_0x7684fe(0x1b0))/0x5*(parseInt(_0x7684fe(0x1b1))/0x6)+parseInt(_0x7684fe(0x1b6))/0x7+-parseInt(_0x7684fe(0x1af))/0x8+parseInt(_0x7684fe(0x1aa))/0x9+parseInt(_0x7684fe(0x1a7))/0xa*(parseInt(_0x7684fe(0x19c))/0xb);if(_0x58249f===_0x3be78a)break;else _0x1f4774['push'](_0x1f4774['shift']());}catch(_0x49aecc){_0x1f4774['push'](_0x1f4774['shift']());}}}(a35_0x53bf,0x261ff));import{listBffScripts}from'../../core/api-client.js';function a35_0x53bf(){const _0x313254=['type','Return\x20full\x20script\x20objects','99473TShWJM','boolean','functionName','map','verbose','Script\x20type\x20filter','name','60VhgOPI','36048SvMMRK','No\x20Backend\x20Function\x20scripts\x20found.','appCode','400UKzXky','Filter\x20by\x20script\x20name','length','2207025VUEaTz','COMMON','bff','ENDPOINT','bool','478960daxyjU','540195oVVMTM','12CudwIi','str','3eMkght','list','string','969920wPtoRI','88772PMtfDf','(unnamed)'];a35_0x53bf=function(){return _0x313254;};return a35_0x53bf();}function a35_0x3c6d(_0x537868,_0x4f592a){_0x537868=_0x537868-0x198;const _0x53bf45=a35_0x53bf();let _0x3c6dfc=_0x53bf45[_0x537868];return _0x3c6dfc;}export const bffList={'service':a35_0x152a32(0x1ac),'command':a35_0x152a32(0x1b4),'description':'List\x20Backend\x20Function\x20scripts','risk':'read','flags':[{'name':a35_0x152a32(0x19a),'type':a35_0x152a32(0x1b5),'description':a35_0x152a32(0x1a1),'default':a35_0x152a32(0x1ad),'enum':[a35_0x152a32(0x1ad),a35_0x152a32(0x1ab)]},{'name':'name','type':a35_0x152a32(0x1b5),'description':a35_0x152a32(0x1a8)},{'name':a35_0x152a32(0x1a0),'type':a35_0x152a32(0x19d),'description':a35_0x152a32(0x19b)}],async 'execute'(_0x3581e1){const _0x45a147=a35_0x152a32,_0x277ab3=await listBffScripts(_0x3581e1[_0x45a147(0x1a6)],_0x3581e1[_0x45a147(0x1b2)](_0x45a147(0x19a)),{'scriptName':_0x3581e1['str'](_0x45a147(0x1a2))||undefined}),_0x45b2ab=_0x3581e1[_0x45a147(0x1ae)]('verbose');return{'ok':!![],'data':_0x45b2ab?_0x277ab3:_0x277ab3[_0x45a147(0x19f)](_0x15caba=>({'id':_0x15caba['id'],'functionName':_0x15caba[_0x45a147(0x19e)]??'','description':_0x15caba['description']||_0x45a147(0x199),'scriptType':_0x15caba['scriptType']})),'message':_0x277ab3[_0x45a147(0x1a9)]===0x0?_0x45a147(0x1a5):undefined};}};
1
+ function a35_0x3fb8(_0x3d44a5,_0x2e0270){_0x3d44a5=_0x3d44a5-0x134;const _0x166a06=a35_0x166a();let _0x3fb82e=_0x166a06[_0x3d44a5];return _0x3fb82e;}const a35_0x4a91d1=a35_0x3fb8;(function(_0x2d05ce,_0x31b244){const _0x46da42=a35_0x3fb8,_0x5b9297=_0x2d05ce();while(!![]){try{const _0x17cb38=-parseInt(_0x46da42(0x13a))/0x1*(parseInt(_0x46da42(0x13d))/0x2)+-parseInt(_0x46da42(0x143))/0x3*(parseInt(_0x46da42(0x135))/0x4)+parseInt(_0x46da42(0x145))/0x5+-parseInt(_0x46da42(0x14f))/0x6+parseInt(_0x46da42(0x146))/0x7*(parseInt(_0x46da42(0x141))/0x8)+parseInt(_0x46da42(0x14b))/0x9+parseInt(_0x46da42(0x136))/0xa;if(_0x17cb38===_0x31b244)break;else _0x5b9297['push'](_0x5b9297['shift']());}catch(_0x5382b8){_0x5b9297['push'](_0x5b9297['shift']());}}}(a35_0x166a,0x975b5));function a35_0x166a(){const _0x39b513=['7741062miHvoz','string','name','No\x20Backend\x20Function\x20scripts\x20found.','2713890qfRMXR','boolean','(unnamed)','29572xwmRHi','3223790QcIHVO','description','bool','Script\x20type\x20filter','21269BIsyFg','ENDPOINT','List\x20Backend\x20Function\x20scripts','102XbcsCP','verbose','list','functionName','3708728EnvRMD','Filter\x20by\x20script\x20name','321ObNLrt','read','4191815sNfmNI','14KnVKCG','str','type','map','length'];a35_0x166a=function(){return _0x39b513;};return a35_0x166a();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a35_0x4a91d1(0x13f),'description':a35_0x4a91d1(0x13c),'risk':a35_0x4a91d1(0x144),'flags':[{'name':a35_0x4a91d1(0x148),'type':a35_0x4a91d1(0x14c),'description':a35_0x4a91d1(0x139),'default':a35_0x4a91d1(0x13b),'enum':['ENDPOINT','COMMON']},{'name':a35_0x4a91d1(0x14d),'type':'string','description':a35_0x4a91d1(0x142)},{'name':a35_0x4a91d1(0x13e),'type':a35_0x4a91d1(0x150),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x952299){const _0x16a914=a35_0x4a91d1,_0x171970=await listBffScripts(_0x952299['appCode'],_0x952299[_0x16a914(0x147)](_0x16a914(0x148)),{'scriptName':_0x952299[_0x16a914(0x147)](_0x16a914(0x14d))||undefined}),_0x361015=_0x952299[_0x16a914(0x138)](_0x16a914(0x13e));return{'ok':!![],'data':_0x361015?_0x171970:_0x171970[_0x16a914(0x149)](_0x37938c=>({'id':_0x37938c['id'],'functionName':_0x37938c[_0x16a914(0x140)]??'','description':_0x37938c[_0x16a914(0x137)]||_0x16a914(0x134),'scriptType':_0x37938c['scriptType']})),'message':_0x171970[_0x16a914(0x14a)]===0x0?_0x16a914(0x14e):undefined};}};
@@ -1 +1 @@
1
- function a36_0x4de7(_0x525897,_0x1851f3){_0x525897=_0x525897-0x10f;const _0x561ea6=a36_0x561e();let _0x4de761=_0x561ea6[_0x525897];return _0x4de761;}const a36_0x1751b8=a36_0x4de7;(function(_0x5daa39,_0x1b59bc){const _0x3939a8=a36_0x4de7,_0x547fd2=_0x5daa39();while(!![]){try{const _0x4ff4e8=parseInt(_0x3939a8(0x12f))/0x1+-parseInt(_0x3939a8(0x131))/0x2+-parseInt(_0x3939a8(0x150))/0x3+parseInt(_0x3939a8(0x140))/0x4*(parseInt(_0x3939a8(0x121))/0x5)+-parseInt(_0x3939a8(0x134))/0x6*(parseInt(_0x3939a8(0x13f))/0x7)+-parseInt(_0x3939a8(0x155))/0x8*(-parseInt(_0x3939a8(0x133))/0x9)+parseInt(_0x3939a8(0x13a))/0xa*(parseInt(_0x3939a8(0x117))/0xb);if(_0x4ff4e8===_0x1b59bc)break;else _0x547fd2['push'](_0x547fd2['shift']());}catch(_0x5b2567){_0x547fd2['push'](_0x547fd2['shift']());}}}(a36_0x561e,0x69860));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';function a36_0x561e(){const _0x415132=['filePath','54FipIbY','36sHrvsj','functions','boolean','functionName','all','stderr','730AOMiEs','Lock\x20scope\x20for\x20app\x20\x22','\x22\x20not\x20found\x20after\x20ensureLockScope.','toLowerCase','nonInteractive','169827XjvixS','12NxiyEB','/api/management/library/scripts/list?appCode=','ENDPOINT','force','cancelled','apiDir','operationType','utf8','yes','\x20pulled,\x20','toISOString','HOOK','functionNode','appCode','type','lockKey','317985vFolRm','parse','length','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','Would\x20inspect\x20','713384KlXPzq','scriptType','scriptsRoot','would_pull','str','local\x20unsynced\x20changes','push','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','unresolvable\x20target\x20path','41382LcCfto','close','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','Remote\x20script\x20missing\x20id.','apps','stdin','skipped','string','hookLocation','message','128285PptEjr','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','bff','stringify','&type=','Pull\x20complete:\x20','pull','COMMON','datasetCode','lastSync','alias','scriptContent','Pull\x20only\x20this\x20script\x20type','lockFilePath','95733VPqAnn','hash','597166ikmzni'];a36_0x561e=function(){return _0x415132;};return a36_0x561e();}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':a36_0x1751b8(0x123),'command':a36_0x1751b8(0x127),'description':a36_0x1751b8(0x115),'risk':'read','flags':[{'name':'type','type':a36_0x1751b8(0x11e),'description':a36_0x1751b8(0x12d),'enum':[a36_0x1751b8(0x128),a36_0x1751b8(0x142),'HOOK']},{'name':a36_0x1751b8(0x143),'type':a36_0x1751b8(0x136),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x153f95){const _0x5b4e94=a36_0x1751b8,_0x307798=loadBffProjectConfig(_0x153f95[_0x5b4e94(0x14d)]),_0x20fd54=await readBffLockFile(_0x307798['lockFilePath']),{appLock:_0x4c3dc1}=ensureLockScope(_0x20fd54??createEmptyBffLock(),_0x153f95[_0x5b4e94(0x14d)],_0x307798[_0x5b4e94(0x110)],_0x5b4e94(0x127)),_0x8c6f86=normalizeBffType(_0x153f95['str'](_0x5b4e94(0x14e)))??undefined,_0x270529=buildDatasetCodeToAliasMap(_0x153f95[_0x5b4e94(0x145)],_0x153f95[_0x5b4e94(0x14d)]),[_0xd36c3b,_0x2cfffc]=await Promise[_0x5b4e94(0x138)]([listBffScripts(_0x153f95[_0x5b4e94(0x14d)],_0x8c6f86),getBffScriptStatistics(_0x153f95[_0x5b4e94(0x14d)])]),_0x331273=createHookLocationMap(_0x2cfffc),_0x4e76ff=[];for(const _0x575906 of _0xd36c3b){const _0x47f725=resolveRemoteScriptTarget(_0x307798,_0x575906,_0x331273,_0x4c3dc1['functions'],_0x270529);if(!_0x47f725){_0x4e76ff[_0x5b4e94(0x114)]({'scriptType':_0x575906[_0x5b4e94(0x10f)],'functionName':_0x575906[_0x5b4e94(0x137)]??'','status':_0x5b4e94(0x11d),'reason':_0x5b4e94(0x116)});continue;}const _0x54e02c=_0x4c3dc1[_0x5b4e94(0x135)][_0x47f725[_0x5b4e94(0x14f)]],_0x2fe51f=_0x575906[_0x5b4e94(0x12c)]!=null?computeContentHash(_0x575906['scriptContent']):undefined,_0x4a10a0=await hasUnsyncedLocalChanges(_0x47f725['filePath'],_0x54e02c,_0x2fe51f);_0x4e76ff['push']({'lockKey':_0x47f725[_0x5b4e94(0x14f)],'filePath':_0x47f725['filePath'],'remoteId':_0x575906['id']??null,'status':_0x4a10a0?'conflict':_0x5b4e94(0x111)});}return{'method':'GET','url':_0x5b4e94(0x141)+_0x153f95[_0x5b4e94(0x14d)]+(_0x8c6f86?_0x5b4e94(0x125)+_0x8c6f86:''),'body':{'appCode':_0x153f95[_0x5b4e94(0x14d)],'filterType':_0x8c6f86??null,'files':_0x4e76ff},'description':_0x5b4e94(0x154)+_0x4e76ff['length']+_0x5b4e94(0x119)};},async 'execute'(_0x43a22b){const _0x116af3=a36_0x1751b8,_0x2d16bd=loadBffProjectConfig(_0x43a22b['appCode']),_0x331ba6=await readBffLockFile(_0x2d16bd[_0x116af3(0x12e)]),{lockData:_0x447707,appLock:_0x3e2828}=ensureLockScope(_0x331ba6??createEmptyBffLock(),_0x43a22b[_0x116af3(0x14d)],_0x2d16bd[_0x116af3(0x110)],'pull'),_0xc0e25e=normalizeBffType(_0x43a22b['str']('type'))??undefined;if(_0x43a22b[_0x116af3(0x112)](_0x116af3(0x14e))&&!_0xc0e25e)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x4b26f7,_0x27a5b9]=await Promise[_0x116af3(0x138)]([listBffScripts(_0x43a22b[_0x116af3(0x14d)],_0xc0e25e),getBffScriptStatistics(_0x43a22b[_0x116af3(0x14d)])]);if(_0x4b26f7[_0x116af3(0x152)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x116af3(0x122)};const _0x2448fb=_0x43a22b['bool'](_0x116af3(0x143));if(_0x2448fb&&!_0x43a22b[_0x116af3(0x13e)]){const _0x25b5f9=await confirmForce();if(!_0x25b5f9)throw CliErrors[_0x116af3(0x144)]('Force\x20pull\x20cancelled.');}if(_0x2448fb&&_0x43a22b[_0x116af3(0x13e)]){}const _0x2457d0=buildDatasetCodeToAliasMap(_0x43a22b[_0x116af3(0x145)],_0x43a22b[_0x116af3(0x14d)]),_0x739e3a=createHookLocationMap(_0x27a5b9),_0x25641e=JSON[_0x116af3(0x151)](JSON[_0x116af3(0x124)](_0x447707)),_0x1eb045=_0x43a22b[_0x116af3(0x14d)],_0x4acd8c=_0x25641e[_0x116af3(0x11b)][_0x1eb045];if(!_0x4acd8c)throw new Error(_0x116af3(0x13b)+_0x1eb045+_0x116af3(0x13c));const _0x152168=[],_0x41206a=[],_0x3ebad3=[];for(const _0x57a007 of _0x4b26f7){const _0xe7359=resolveRemoteScriptTarget(_0x2d16bd,_0x57a007,_0x739e3a,_0x3e2828[_0x116af3(0x135)],_0x2457d0);if(!_0xe7359){_0x41206a[_0x116af3(0x114)]({'lockKey':_0x57a007[_0x116af3(0x10f)]+'/'+_0x57a007['functionName'],'reason':_0x116af3(0x116)});continue;}const _0x4b5206=_0x3e2828[_0x116af3(0x135)][_0xe7359['lockKey']];try{if(!_0x57a007['id'])throw new Error(_0x116af3(0x11a));if(_0x57a007[_0x116af3(0x12c)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x1ec3a0=_0x57a007[_0x116af3(0x12c)],_0x5acab3=computeContentHash(_0x1ec3a0);if(!_0x2448fb){const _0x327f68=await hasUnsyncedLocalChanges(_0xe7359[_0x116af3(0x132)],_0x4b5206,_0x5acab3);if(_0x327f68){_0x41206a[_0x116af3(0x114)]({'lockKey':_0xe7359[_0x116af3(0x14f)],'reason':_0x116af3(0x113)});continue;}}await ensureParentDirectory(_0xe7359[_0x116af3(0x132)]),await writeFile(_0xe7359[_0x116af3(0x132)],_0x1ec3a0,_0x116af3(0x147));const _0x482adb={'hash':_0x5acab3,'remoteId':_0x57a007['id'],'version':_0x57a007['version']};_0xe7359[_0x116af3(0x14e)]===_0x116af3(0x14b)&&_0xe7359['hookLocation']&&(_0x482adb[_0x116af3(0x12b)]=_0xe7359[_0x116af3(0x11f)][_0x116af3(0x12b)],_0x482adb[_0x116af3(0x129)]=_0xe7359[_0x116af3(0x11f)][_0x116af3(0x129)],_0x482adb[_0x116af3(0x146)]=_0xe7359['hookLocation'][_0x116af3(0x146)],_0x482adb['functionNode']=_0xe7359['hookLocation'][_0x116af3(0x14c)]),_0x4acd8c['functions'][_0xe7359[_0x116af3(0x14f)]]=_0x482adb,_0x152168[_0x116af3(0x114)]({'lockKey':_0xe7359[_0x116af3(0x14f)],'remoteId':_0x57a007['id']});}catch(_0x5c4c88){_0x3ebad3[_0x116af3(0x114)]({'lockKey':_0xe7359['lockKey'],'error':_0x5c4c88 instanceof Error?_0x5c4c88[_0x116af3(0x120)]:String(_0x5c4c88)});}}return _0x4acd8c[_0x116af3(0x12a)]=new Date()[_0x116af3(0x14a)](),await writeBffLockFile(_0x2d16bd[_0x116af3(0x12e)],_0x25641e),{'ok':_0x3ebad3[_0x116af3(0x152)]===0x0,'data':{'pulled':_0x152168,'skipped':_0x41206a,'failed':_0x3ebad3},'message':_0x116af3(0x126)+_0x152168['length']+_0x116af3(0x149)+_0x41206a[_0x116af3(0x152)]+'\x20skipped,\x20'+_0x3ebad3[_0x116af3(0x152)]+'\x20failed'};}};async function hasUnsyncedLocalChanges(_0x12173d,_0x2440d7,_0x4c6a74){const _0x3a0326=a36_0x1751b8;if(!await fileExists(_0x12173d))return![];const _0x13a9d7=await computeFileHash(_0x12173d);if(!_0x2440d7)return _0x4c6a74?_0x13a9d7!==_0x4c6a74:!![];return _0x13a9d7!==_0x2440d7[_0x3a0326(0x130)];}function buildDatasetCodeToAliasMap(_0x297b22,_0x3189c2){const _0x49ad4b=a36_0x1751b8,_0x19bd7d=loadAliasMap(_0x297b22,undefined,resolveApiFilePath(_0x297b22,_0x3189c2));return new Map(_0x19bd7d['map'](_0x16e42b=>[_0x16e42b[_0x49ad4b(0x129)],_0x16e42b[_0x49ad4b(0x12b)]]));}async function confirmForce(){const _0xe211aa=a36_0x1751b8,_0x3cdb04=createInterface({'input':process[_0xe211aa(0x11c)],'output':process[_0xe211aa(0x139)]}),_0x7db4ff=await new Promise(_0x534efa=>{const _0x133c8a=_0xe211aa;_0x3cdb04['question'](_0x133c8a(0x153),_0x534efa);});return _0x3cdb04[_0xe211aa(0x118)](),['y',_0xe211aa(0x148)]['includes'](_0x7db4ff['trim']()[_0xe211aa(0x13d)]());}
1
+ const a36_0x3bcfd7=a36_0x2a94;(function(_0x112c9c,_0x54e6ea){const _0x4ef6cf=a36_0x2a94,_0x8da5fc=_0x112c9c();while(!![]){try{const _0x136e2d=-parseInt(_0x4ef6cf(0x182))/0x1+parseInt(_0x4ef6cf(0x18d))/0x2*(parseInt(_0x4ef6cf(0x17a))/0x3)+-parseInt(_0x4ef6cf(0x16e))/0x4+-parseInt(_0x4ef6cf(0x17c))/0x5*(-parseInt(_0x4ef6cf(0x19a))/0x6)+-parseInt(_0x4ef6cf(0x189))/0x7+-parseInt(_0x4ef6cf(0x188))/0x8+parseInt(_0x4ef6cf(0x199))/0x9;if(_0x136e2d===_0x54e6ea)break;else _0x8da5fc['push'](_0x8da5fc['shift']());}catch(_0xc8542c){_0x8da5fc['push'](_0x8da5fc['shift']());}}}(a36_0x4e48,0xd7d83));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';function a36_0x4e48(){const _0x53c8ee=['Remote\x20script\x20missing\x20id.','1501609zkZqNn','COMMON','functionName','toLowerCase','parse','force','9988032jaELPD','7705327vabZtG','unresolvable\x20target\x20path','filePath','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','544754VxbZxp','scriptContent','\x20pulled,\x20','lockKey','ENDPOINT','local\x20unsynced\x20changes','close','length','Pull\x20complete:\x20','Pull\x20only\x20this\x20script\x20type','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','functions','33295302LTlkTM','6pkqHfm','all','str','datasetCode','lockFilePath','question','appCode','stringify','lastSync','Force\x20pull\x20cancelled.','\x22\x20not\x20found\x20after\x20ensureLockScope.','Lock\x20scope\x20for\x20app\x20\x22','would_pull','nonInteractive','scriptsRoot','push','read','map','conflict','pull','stdin','scriptType','HOOK','apps','&type=','2379888lBbvqg','includes','utf8','cancelled','string','message','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','alias','\x20failed','hash','functionNode','bff','15ijihBu','apiDir','1342910qOSzfQ','type','GET','\x20skipped,\x20','hookLocation'];a36_0x4e48=function(){return _0x53c8ee;};return a36_0x4e48();}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x3bcfd7(0x179),'command':a36_0x3bcfd7(0x1ad),'description':a36_0x3bcfd7(0x18c),'risk':a36_0x3bcfd7(0x1aa),'flags':[{'name':a36_0x3bcfd7(0x17d),'type':a36_0x3bcfd7(0x172),'description':a36_0x3bcfd7(0x196),'enum':[a36_0x3bcfd7(0x183),a36_0x3bcfd7(0x191),'HOOK']},{'name':a36_0x3bcfd7(0x187),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x1bc4fe){const _0x3e7b7f=a36_0x3bcfd7,_0xf064e3=loadBffProjectConfig(_0x1bc4fe[_0x3e7b7f(0x1a0)]),_0x1595ef=await readBffLockFile(_0xf064e3[_0x3e7b7f(0x19e)]),{appLock:_0x403cac}=ensureLockScope(_0x1595ef??createEmptyBffLock(),_0x1bc4fe[_0x3e7b7f(0x1a0)],_0xf064e3[_0x3e7b7f(0x1a8)],_0x3e7b7f(0x1ad)),_0x1120c1=normalizeBffType(_0x1bc4fe[_0x3e7b7f(0x19c)](_0x3e7b7f(0x17d)))??undefined,_0x459e37=buildDatasetCodeToAliasMap(_0x1bc4fe[_0x3e7b7f(0x17b)],_0x1bc4fe[_0x3e7b7f(0x1a0)]),[_0x5601ed,_0x40b255]=await Promise[_0x3e7b7f(0x19b)]([listBffScripts(_0x1bc4fe[_0x3e7b7f(0x1a0)],_0x1120c1),getBffScriptStatistics(_0x1bc4fe[_0x3e7b7f(0x1a0)])]),_0x3b502c=createHookLocationMap(_0x40b255),_0x364bcf=[];for(const _0x1903ac of _0x5601ed){const _0x5667df=resolveRemoteScriptTarget(_0xf064e3,_0x1903ac,_0x3b502c,_0x403cac[_0x3e7b7f(0x198)],_0x459e37);if(!_0x5667df){_0x364bcf['push']({'scriptType':_0x1903ac['scriptType'],'functionName':_0x1903ac['functionName']??'','status':'skipped','reason':_0x3e7b7f(0x18a)});continue;}const _0x5e03c8=_0x403cac[_0x3e7b7f(0x198)][_0x5667df[_0x3e7b7f(0x190)]],_0x3d22d7=_0x1903ac[_0x3e7b7f(0x18e)]!=null?computeContentHash(_0x1903ac[_0x3e7b7f(0x18e)]):undefined,_0x45872e=await hasUnsyncedLocalChanges(_0x5667df[_0x3e7b7f(0x18b)],_0x5e03c8,_0x3d22d7);_0x364bcf['push']({'lockKey':_0x5667df['lockKey'],'filePath':_0x5667df['filePath'],'remoteId':_0x1903ac['id']??null,'status':_0x45872e?_0x3e7b7f(0x1ac):_0x3e7b7f(0x1a6)});}return{'method':_0x3e7b7f(0x17e),'url':'/api/management/library/scripts/list?appCode='+_0x1bc4fe[_0x3e7b7f(0x1a0)]+(_0x1120c1?_0x3e7b7f(0x16d)+_0x1120c1:''),'body':{'appCode':_0x1bc4fe[_0x3e7b7f(0x1a0)],'filterType':_0x1120c1??null,'files':_0x364bcf},'description':'Would\x20inspect\x20'+_0x364bcf[_0x3e7b7f(0x194)]+_0x3e7b7f(0x197)};},async 'execute'(_0x40f536){const _0x522df4=a36_0x3bcfd7,_0x38c0aa=loadBffProjectConfig(_0x40f536[_0x522df4(0x1a0)]),_0xf589b8=await readBffLockFile(_0x38c0aa[_0x522df4(0x19e)]),{lockData:_0x339823,appLock:_0x3b6033}=ensureLockScope(_0xf589b8??createEmptyBffLock(),_0x40f536[_0x522df4(0x1a0)],_0x38c0aa[_0x522df4(0x1a8)],'pull'),_0x2868ec=normalizeBffType(_0x40f536[_0x522df4(0x19c)](_0x522df4(0x17d)))??undefined;if(_0x40f536[_0x522df4(0x19c)](_0x522df4(0x17d))&&!_0x2868ec)throw CliErrors['validation'](_0x522df4(0x174));const [_0x3a9d5f,_0x1789e2]=await Promise[_0x522df4(0x19b)]([listBffScripts(_0x40f536[_0x522df4(0x1a0)],_0x2868ec),getBffScriptStatistics(_0x40f536[_0x522df4(0x1a0)])]);if(_0x3a9d5f[_0x522df4(0x194)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0xbd5ac4=_0x40f536['bool']('force');if(_0xbd5ac4&&!_0x40f536['nonInteractive']){const _0x2bd262=await confirmForce();if(!_0x2bd262)throw CliErrors[_0x522df4(0x171)](_0x522df4(0x1a3));}if(_0xbd5ac4&&_0x40f536[_0x522df4(0x1a7)]){}const _0x46c73e=buildDatasetCodeToAliasMap(_0x40f536[_0x522df4(0x17b)],_0x40f536['appCode']),_0x451905=createHookLocationMap(_0x1789e2),_0x2bc126=JSON[_0x522df4(0x186)](JSON[_0x522df4(0x1a1)](_0x339823)),_0x429f61=_0x40f536['appCode'],_0x18bd4c=_0x2bc126[_0x522df4(0x16c)][_0x429f61];if(!_0x18bd4c)throw new Error(_0x522df4(0x1a5)+_0x429f61+_0x522df4(0x1a4));const _0x15ede4=[],_0x1c3c88=[],_0x5bc9ae=[];for(const _0x61c22a of _0x3a9d5f){const _0xb0d2ef=resolveRemoteScriptTarget(_0x38c0aa,_0x61c22a,_0x451905,_0x3b6033[_0x522df4(0x198)],_0x46c73e);if(!_0xb0d2ef){_0x1c3c88[_0x522df4(0x1a9)]({'lockKey':_0x61c22a[_0x522df4(0x1af)]+'/'+_0x61c22a[_0x522df4(0x184)],'reason':_0x522df4(0x18a)});continue;}const _0x33ff8a=_0x3b6033[_0x522df4(0x198)][_0xb0d2ef[_0x522df4(0x190)]];try{if(!_0x61c22a['id'])throw new Error(_0x522df4(0x181));if(_0x61c22a[_0x522df4(0x18e)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x4ded90=_0x61c22a[_0x522df4(0x18e)],_0xefe192=computeContentHash(_0x4ded90);if(!_0xbd5ac4){const _0x2a6eff=await hasUnsyncedLocalChanges(_0xb0d2ef['filePath'],_0x33ff8a,_0xefe192);if(_0x2a6eff){_0x1c3c88[_0x522df4(0x1a9)]({'lockKey':_0xb0d2ef['lockKey'],'reason':_0x522df4(0x192)});continue;}}await ensureParentDirectory(_0xb0d2ef[_0x522df4(0x18b)]),await writeFile(_0xb0d2ef[_0x522df4(0x18b)],_0x4ded90,_0x522df4(0x170));const _0x1dc574={'hash':_0xefe192,'remoteId':_0x61c22a['id'],'version':_0x61c22a['version']};_0xb0d2ef[_0x522df4(0x17d)]===_0x522df4(0x16b)&&_0xb0d2ef['hookLocation']&&(_0x1dc574[_0x522df4(0x175)]=_0xb0d2ef[_0x522df4(0x180)]['alias'],_0x1dc574[_0x522df4(0x19d)]=_0xb0d2ef[_0x522df4(0x180)][_0x522df4(0x19d)],_0x1dc574['operationType']=_0xb0d2ef[_0x522df4(0x180)]['operationType'],_0x1dc574[_0x522df4(0x178)]=_0xb0d2ef['hookLocation'][_0x522df4(0x178)]),_0x18bd4c['functions'][_0xb0d2ef['lockKey']]=_0x1dc574,_0x15ede4['push']({'lockKey':_0xb0d2ef[_0x522df4(0x190)],'remoteId':_0x61c22a['id']});}catch(_0x3ddd8f){_0x5bc9ae[_0x522df4(0x1a9)]({'lockKey':_0xb0d2ef[_0x522df4(0x190)],'error':_0x3ddd8f instanceof Error?_0x3ddd8f[_0x522df4(0x173)]:String(_0x3ddd8f)});}}return _0x18bd4c[_0x522df4(0x1a2)]=new Date()['toISOString'](),await writeBffLockFile(_0x38c0aa['lockFilePath'],_0x2bc126),{'ok':_0x5bc9ae[_0x522df4(0x194)]===0x0,'data':{'pulled':_0x15ede4,'skipped':_0x1c3c88,'failed':_0x5bc9ae},'message':_0x522df4(0x195)+_0x15ede4[_0x522df4(0x194)]+_0x522df4(0x18f)+_0x1c3c88[_0x522df4(0x194)]+_0x522df4(0x17f)+_0x5bc9ae[_0x522df4(0x194)]+_0x522df4(0x176)};}};async function hasUnsyncedLocalChanges(_0xbbb00f,_0x365025,_0x3b59ce){const _0x2590c8=a36_0x3bcfd7;if(!await fileExists(_0xbbb00f))return![];const _0x2a624a=await computeFileHash(_0xbbb00f);if(!_0x365025)return _0x3b59ce?_0x2a624a!==_0x3b59ce:!![];return _0x2a624a!==_0x365025[_0x2590c8(0x177)];}function buildDatasetCodeToAliasMap(_0x1d2754,_0x18836d){const _0x3ceb17=a36_0x3bcfd7,_0x28df8d=loadAliasMap(_0x1d2754,undefined,resolveApiFilePath(_0x1d2754,_0x18836d));return new Map(_0x28df8d[_0x3ceb17(0x1ab)](_0xcf6e1c=>[_0xcf6e1c['datasetCode'],_0xcf6e1c[_0x3ceb17(0x175)]]));}function a36_0x2a94(_0x4715b0,_0x10e241){_0x4715b0=_0x4715b0-0x16b;const _0x4e488e=a36_0x4e48();let _0x2a9482=_0x4e488e[_0x4715b0];return _0x2a9482;}async function confirmForce(){const _0x521b31=a36_0x3bcfd7,_0x17aa81=createInterface({'input':process[_0x521b31(0x1ae)],'output':process['stderr']}),_0x17f396=await new Promise(_0x265d84=>{const _0x4ec8b7=_0x521b31;_0x17aa81[_0x4ec8b7(0x19f)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x265d84);});return _0x17aa81[_0x521b31(0x193)](),['y','yes'][_0x521b31(0x16f)](_0x17f396['trim']()[_0x521b31(0x185)]());}
@@ -1 +1 @@
1
- const a37_0x479c63=a37_0x3e40;(function(_0x3a8870,_0x1afc65){const _0x3cd1b0=a37_0x3e40,_0x43eee4=_0x3a8870();while(!![]){try{const _0x130f28=parseInt(_0x3cd1b0(0x8d))/0x1+-parseInt(_0x3cd1b0(0xa7))/0x2*(-parseInt(_0x3cd1b0(0xce))/0x3)+-parseInt(_0x3cd1b0(0xd5))/0x4+-parseInt(_0x3cd1b0(0xac))/0x5+-parseInt(_0x3cd1b0(0xa1))/0x6+-parseInt(_0x3cd1b0(0x91))/0x7*(-parseInt(_0x3cd1b0(0xd2))/0x8)+parseInt(_0x3cd1b0(0x88))/0x9*(parseInt(_0x3cd1b0(0xb7))/0xa);if(_0x130f28===_0x1afc65)break;else _0x43eee4['push'](_0x43eee4['shift']());}catch(_0x3303ad){_0x43eee4['push'](_0x43eee4['shift']());}}}(a37_0x5b91,0x90a6a));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';function a37_0x3e40(_0x3ea2d4,_0x57c618){_0x3ea2d4=_0x3ea2d4-0x88;const _0x5b91af=a37_0x5b91();let _0x3e4080=_0x5b91af[_0x3ea2d4];return _0x3e4080;}function a37_0x5b91(){const _0x39fdd5=['filePath','/api/management/library/scripts/save','alias','operationType','1763367sCjAQu','appCode','map','attempted','2473720ZKtFbG','Cannot\x20resolve\x20dataset\x20for\x20\x22',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','3966156OjCKkF','stringify','parse','version','No\x20local\x20Backend\x20Function\x20scripts\x20found.','write','125973ghWjzr','length','runtime\x20cache\x20cleared','code','update','1133575WAYCUr','Run\x20`','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','bool','7rxkbLb','apiDir','bff','description','COMMON','name','Incomplete\x20HOOK\x20path:\x20','every','lockKey','message','lockFilePath','Lock\x20scope\x20for\x20app\x20\x22','some','Would\x20inspect\x20','hash','apps','5065368sHuokD','create','unchanged','aliasToDatasetCode','filter','\x22\x20not\x20found\x20after\x20ensureLockScope.','4tCdTJI','\x20skipped,\x20','validation','ENDPOINT','runtime\x20cache\x20not\x20needed','5569565OYhzTd','values','has','boolean','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','datasetId','functionNode','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','POST','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','\x20failed,\x20','660hWUIRh','remoteId','HOOK','get','scriptsRoot','push','functions','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','lastSync','set','force','str','datasetCode','would_push','cleared','toISOString','Push\x20only\x20this\x20script\x20type','type','status'];a37_0x5b91=function(){return _0x39fdd5;};return a37_0x5b91();}import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x479c63(0x93),'command':a37_0x479c63(0xbc),'description':a37_0x479c63(0xb0),'risk':a37_0x479c63(0xda),'flags':[{'name':'type','type':'string','description':a37_0x479c63(0xc7),'enum':[a37_0x479c63(0x95),a37_0x479c63(0xaa),a37_0x479c63(0xb9)]},{'name':a37_0x479c63(0x96),'type':'string','description':a37_0x479c63(0x8f)},{'name':a37_0x479c63(0xc1),'type':a37_0x479c63(0xaf),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x415aa1){const _0x36ddfd=a37_0x479c63,_0x2651ac=loadBffProjectConfig(_0x415aa1[_0x36ddfd(0xcf)]),_0x199723=await readBffLockFile(_0x2651ac[_0x36ddfd(0x9b)]),{appLock:_0x294742}=ensureLockScope(_0x199723??createEmptyBffLock(),_0x415aa1['appCode'],_0x2651ac[_0x36ddfd(0xbb)],'push'),_0x5168d1=await getTargetFunctions(_0x2651ac,_0x415aa1),_0x3a388c=_0x415aa1[_0x36ddfd(0x90)]('force'),_0x355ac3=[],_0x5ef51c=[];for(const _0x486bdb of _0x5168d1){const _0x249c87=await computeFileHash(_0x486bdb[_0x36ddfd(0xca)]),_0x2b25c7=_0x294742['functions'][_0x486bdb['lockKey']],_0x532dfd=!!_0x2b25c7&&_0x2b25c7[_0x36ddfd(0x9f)]===_0x249c87,_0x5446e2=!_0x3a388c&&_0x532dfd?_0x36ddfd(0xa3):_0x36ddfd(0xc4);_0x355ac3[_0x36ddfd(0xbc)]({'lockKey':_0x486bdb[_0x36ddfd(0x99)],'filePath':_0x486bdb[_0x36ddfd(0xca)],'remoteId':_0x2b25c7?.['remoteId']??null,'mode':_0x2b25c7?.[_0x36ddfd(0xb8)]?_0x36ddfd(0x8c):_0x36ddfd(0xa2),'status':_0x5446e2});if(_0x5446e2===_0x36ddfd(0xc4))_0x5ef51c[_0x36ddfd(0xbc)](_0x486bdb[_0x36ddfd(0x96)]);}return{'method':_0x36ddfd(0xb4),'url':_0x36ddfd(0xcb),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x36ddfd(0x93),_0x5ef51c),'body':{'appCode':_0x415aa1[_0x36ddfd(0xcf)],'force':_0x3a388c,'files':_0x355ac3,'cacheClearAtRuntime':_0x355ac3[_0x36ddfd(0x9d)](_0x5d8ec8=>_0x5d8ec8[_0x36ddfd(0xc9)]==='would_push'),'cacheClearAtRuntimeTimes':_0x355ac3[_0x36ddfd(0x9d)](_0x496ad8=>_0x496ad8[_0x36ddfd(0xc9)]===_0x36ddfd(0xc4))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x36ddfd(0x9e)+_0x355ac3[_0x36ddfd(0x89)]+'\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x543f10){const _0x554e53=a37_0x479c63,_0x8fa122=loadBffProjectConfig(_0x543f10[_0x554e53(0xcf)]),_0x6453c1=await readBffLockFile(_0x8fa122[_0x554e53(0x9b)]),{lockData:_0x59cb50,appLock:_0x59085a}=ensureLockScope(_0x6453c1??createEmptyBffLock(),_0x543f10[_0x554e53(0xcf)],_0x8fa122[_0x554e53(0xbb)],'push'),_0x27bb90=await getTargetFunctions(_0x8fa122,_0x543f10);if(_0x27bb90[_0x554e53(0x89)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x554e53(0xd9)};const _0x4d4afc=_0x543f10['bool'](_0x554e53(0xc1)),_0x4746fd=JSON[_0x554e53(0xd7)](JSON[_0x554e53(0xd6)](_0x59cb50)),_0x942483=_0x4746fd[_0x554e53(0xa0)][_0x543f10[_0x554e53(0xcf)]];if(!_0x942483)throw new Error(_0x554e53(0x9c)+_0x543f10[_0x554e53(0xcf)]+_0x554e53(0xa6));const _0x565f02=await buildHookMaps(_0x543f10[_0x554e53(0xcf)],_0x543f10[_0x554e53(0x92)],_0x27bb90,_0x942483),_0x38dbdb=[],_0x4e590b=[],_0xd9d1eb=[],_0x38276f=[];for(const _0x1abb63 of _0x27bb90){const _0x179e14=await computeFileHash(_0x1abb63['filePath']),_0x4eccdd=_0x942483[_0x554e53(0xbd)][_0x1abb63[_0x554e53(0x99)]];if(!_0x4d4afc&&_0x4eccdd&&_0x4eccdd[_0x554e53(0x9f)]===_0x179e14){_0xd9d1eb[_0x554e53(0xbc)]({'lockKey':_0x1abb63[_0x554e53(0x99)],'reason':_0x554e53(0xa3)});continue;}try{await uploadSingleFunction(_0x543f10['appCode'],_0x1abb63,_0x942483,_0x565f02);const _0x220a67=_0x942483['functions'][_0x1abb63[_0x554e53(0x99)]];_0x38dbdb[_0x554e53(0xbc)]({'lockKey':_0x1abb63[_0x554e53(0x99)],'remoteId':_0x220a67?.[_0x554e53(0xb8)]??0x0}),_0x4e590b[_0x554e53(0xbc)](_0x1abb63[_0x554e53(0x96)]);}catch(_0x1a39ea){_0x38276f[_0x554e53(0xbc)]({'lockKey':_0x1abb63['lockKey'],'error':_0x1a39ea instanceof Error?_0x1a39ea[_0x554e53(0x9a)]:String(_0x1a39ea)});}}_0x942483[_0x554e53(0xbf)]=new Date()[_0x554e53(0xc6)](),await writeBffLockFile(_0x8fa122[_0x554e53(0x9b)],_0x4746fd),await waitForUploadedLockEntries(_0x8fa122[_0x554e53(0x9b)],_0x543f10['appCode'],_0x38dbdb[_0x554e53(0xd0)](_0x367afd=>_0x367afd[_0x554e53(0x99)]));let _0x48908c={'attempted':![],'cleared':![]};if(_0x38dbdb[_0x554e53(0x89)]>0x0)try{let _0x39301e='';for(let _0xbd0084=0x0;_0xbd0084<CACHE_CLEAR_ATTEMPTS;_0xbd0084+=0x1){_0x39301e=await clearBffScriptCache(),_0xbd0084<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x48908c={'attempted':!![],'cleared':!![],'message':_0x39301e||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x551ef2){_0x48908c={'attempted':!![],'cleared':![],'error':_0x551ef2 instanceof Error?_0x551ef2['message']:String(_0x551ef2)};}const _0x3d7f89=_0x38276f['length']===0x0&&(_0x48908c[_0x554e53(0xd1)]?_0x48908c['cleared']:!![]),_0x1060ab=await runAutomaticDeploymentSync(_0x543f10,_0x554e53(0x93),_0x4e590b,_0x3d7f89),_0x4b211f=_0x3d7f89&&automaticDeploymentSyncSucceeded(_0x1060ab),_0x1dd007=_0x48908c[_0x554e53(0xd1)]?_0x48908c[_0x554e53(0xc5)]?_0x554e53(0x8a):'runtime\x20cache\x20clear\x20failed':_0x554e53(0xab),_0x307dc5=',\x20deployment\x20sync\x20'+_0x1060ab[_0x554e53(0xc9)];return{'ok':_0x4b211f,'data':{'uploaded':_0x38dbdb,'skipped':_0xd9d1eb,'failed':_0x38276f,'cacheClear':_0x48908c,'deploymentSync':_0x1060ab},'message':'Push\x20complete:\x20'+_0x38dbdb['length']+'\x20uploaded,\x20'+_0xd9d1eb['length']+_0x554e53(0xa8)+_0x38276f['length']+_0x554e53(0xb6)+_0x1dd007+_0x307dc5};}};async function getTargetFunctions(_0x348554,_0x1535c9){const _0x5ea6ea=a37_0x479c63,_0x34d60b=_0x1535c9['str'](_0x5ea6ea(0xc8)),_0x3a1e7e=_0x1535c9[_0x5ea6ea(0xc2)](_0x5ea6ea(0x96)),_0x3bfe4b=normalizeBffType(_0x34d60b)??undefined;if(_0x3a1e7e&&!_0x3bfe4b)throw CliErrors[_0x5ea6ea(0xa9)](_0x5ea6ea(0xbe));const _0x4eadaf=await scanLocalBffFunctions(_0x348554,_0x3bfe4b);if(_0x3a1e7e){const _0x1caaf5=_0x4eadaf[_0x5ea6ea(0xa5)](_0xc7ed0f=>_0xc7ed0f[_0x5ea6ea(0x96)]===_0x3a1e7e);if(_0x1caaf5['length']===0x0)throw CliErrors[_0x5ea6ea(0xa9)]('Local\x20function\x20not\x20found:\x20'+_0x3bfe4b+'/'+_0x3a1e7e);return _0x1caaf5;}return _0x4eadaf;}async function buildHookMaps(_0x11c0a0,_0x1e6111,_0x2ad770,_0x106652){const _0xcf1aac=a37_0x479c63,_0x38acad=_0x2ad770[_0xcf1aac(0x9d)](_0x51e1d6=>_0x51e1d6[_0xcf1aac(0xc8)]==='HOOK');if(!_0x38acad)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x5de4d3=loadAliasMap(_0x1e6111,undefined,resolveApiFilePath(_0x1e6111,_0x11c0a0)),_0x43d367=new Map(_0x5de4d3[_0xcf1aac(0xd0)](_0x44479e=>[_0x44479e['alias'],_0x44479e['datasetCode']]));for(const _0x4fc664 of Object[_0xcf1aac(0xad)](_0x106652['functions'])){_0x4fc664['alias']&&_0x4fc664['datasetCode']&&!_0x43d367[_0xcf1aac(0xae)](_0x4fc664[_0xcf1aac(0xcc)])&&_0x43d367[_0xcf1aac(0xc0)](_0x4fc664[_0xcf1aac(0xcc)],_0x4fc664[_0xcf1aac(0xc3)]);}const _0x5720bb=await listDatasets(_0x11c0a0),_0x3ca05a=new Map(_0x5720bb[_0xcf1aac(0xd0)](_0x3ec158=>[_0x3ec158[_0xcf1aac(0x8b)],_0x3ec158]));return{'aliasToDatasetCode':_0x43d367,'datasetCodeToDataset':_0x3ca05a};}async function uploadSingleFunction(_0x6c37c1,_0x2ecd19,_0x104d68,_0x5bcaf6){const _0x450ac6=a37_0x479c63,_0x438f83=await readFile(_0x2ecd19[_0x450ac6(0xca)],'utf8'),_0x49c118=await computeFileHash(_0x2ecd19[_0x450ac6(0xca)]),_0x3c6cf9=_0x104d68['functions'][_0x2ecd19[_0x450ac6(0x99)]];if(_0x3c6cf9?.['remoteId']&&_0x3c6cf9[_0x450ac6(0xd8)]==null)throw CliErrors['validation'](_0x2ecd19[_0x450ac6(0x99)]+_0x450ac6(0xd4));let _0x50f306=extractScriptDescription(_0x438f83);if(!_0x50f306&&_0x3c6cf9?.[_0x450ac6(0xb8)]){const _0x57f258=await getBffScriptInfo(_0x3c6cf9[_0x450ac6(0xb8)]);_0x50f306=_0x57f258[_0x450ac6(0x94)]||undefined;}const _0x3a657e={'appCode':_0x6c37c1,'functionName':_0x2ecd19['name'],'scriptType':_0x2ecd19[_0x450ac6(0xc8)],'scriptContent':_0x438f83};if(_0x3c6cf9?.[_0x450ac6(0xb8)])_0x3a657e['id']=_0x3c6cf9[_0x450ac6(0xb8)];if(_0x3c6cf9?.[_0x450ac6(0xd8)]!=null)_0x3a657e[_0x450ac6(0xd8)]=_0x3c6cf9[_0x450ac6(0xd8)];if(_0x50f306)_0x3a657e[_0x450ac6(0x94)]=_0x50f306;if(_0x2ecd19[_0x450ac6(0xc8)]===_0x450ac6(0xb9)){const _0x55b4c3=_0x2ecd19['alias'];if(!_0x55b4c3||!_0x2ecd19[_0x450ac6(0xcd)]||!_0x2ecd19[_0x450ac6(0xb2)])throw CliErrors[_0x450ac6(0xa9)](_0x450ac6(0x97)+_0x2ecd19[_0x450ac6(0x99)]);const _0x5acad4=_0x5bcaf6[_0x450ac6(0xa4)][_0x450ac6(0xba)](_0x55b4c3)??_0x3c6cf9?.['datasetCode']??_0x55b4c3,_0x309eed=_0x5bcaf6['datasetCodeToDataset'][_0x450ac6(0xba)](_0x5acad4);if(!_0x309eed)throw CliErrors['validation'](_0x450ac6(0xd3)+_0x55b4c3+'\x22.\x20'+(_0x450ac6(0x8e)+CLI_BIN_NAME+_0x450ac6(0xb3)));_0x3a657e[_0x450ac6(0xb1)]=_0x309eed['id'],_0x3a657e[_0x450ac6(0xcd)]=_0x2ecd19['operationType'],_0x3a657e[_0x450ac6(0xb2)]=_0x2ecd19[_0x450ac6(0xb2)];}const _0x4e9f4b=await saveBffScript(_0x3a657e),_0x4f246c=_0x4e9f4b['id'],_0x257d4b=_0x4e9f4b['script']??await getBffScriptInfo(_0x4f246c),_0xea4a67={'hash':_0x49c118,'remoteId':_0x4f246c,'version':_0x257d4b[_0x450ac6(0xd8)]};if(_0x2ecd19['type']===_0x450ac6(0xb9)){const _0x34220a=_0x2ecd19[_0x450ac6(0xcc)],_0x10506c=_0x5bcaf6['aliasToDatasetCode'][_0x450ac6(0xba)](_0x34220a)??_0x3c6cf9?.[_0x450ac6(0xc3)]??_0x34220a;_0x5bcaf6[_0x450ac6(0xa4)][_0x450ac6(0xae)](_0x34220a)?_0xea4a67[_0x450ac6(0xcc)]=_0x34220a:_0xea4a67[_0x450ac6(0xcc)]=_0x3c6cf9?.[_0x450ac6(0xcc)],_0xea4a67[_0x450ac6(0xc3)]=_0x10506c,_0xea4a67[_0x450ac6(0xcd)]=_0x2ecd19[_0x450ac6(0xcd)],_0xea4a67['functionNode']=_0x2ecd19['functionNode'];}_0x104d68[_0x450ac6(0xbd)][_0x2ecd19[_0x450ac6(0x99)]]=_0xea4a67;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x428dd7,_0x580812,_0x5064ff){const _0x203004=a37_0x479c63;if(_0x5064ff[_0x203004(0x89)]===0x0)return;for(let _0x502b9c=0x0;_0x502b9c<LOCK_SETTLE_RETRY_COUNT;_0x502b9c+=0x1){const _0x5f33d4=await readBffLockFile(_0x428dd7),_0x54bee2=_0x5f33d4?.[_0x203004(0xa0)]?.[_0x580812]?.[_0x203004(0xbd)]??{},_0x403718=_0x5064ff[_0x203004(0x98)](_0x558514=>!!_0x54bee2[_0x558514]?.[_0x203004(0xb8)]);if(_0x403718)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x203004(0xb5)+_0x5064ff['join'](',\x20')+'.');}
1
+ const a37_0x366196=a37_0x3241;function a37_0x52fb(){const _0x19f1ff=['version','operationType','\x22\x20not\x20found\x20after\x20ensureLockScope.','2437130xCIqMY','Push\x20only\x20this\x20script\x20type','cleared','code','utf8','runtime\x20cache\x20not\x20needed','datasetCode','values','27TepRnX','Local\x20function\x20not\x20found:\x20','functionNode','datasetId','281986MbgrVH',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','validation','create','scriptsRoot','lockKey','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','datasetCodeToDataset','toISOString','/api/management/library/scripts/save','649368VURfNm','would_push','filePath','name','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','map','30ckMsKN','alias','15474FokNJN','HOOK','No\x20local\x20Backend\x20Function\x20scripts\x20found.','Force\x20push\x20ignoring\x20hash\x20protection','POST','unchanged','aliasToDatasetCode','force','Incomplete\x20HOOK\x20path:\x20','script','type','status','Lock\x20scope\x20for\x20app\x20\x22','Push\x20complete:\x20','set','remoteId','boolean','COMMON','Runtime\x20script\x20cache\x20cleared.','204564EFEdDU','\x22.\x20','Would\x20inspect\x20','push','bool','bff','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','description','2338608ukLsBE','length','has','66OsdQGR','130HqJHFv','string','runtime\x20cache\x20clear\x20failed','\x20uploaded,\x20','\x20skipped,\x20','filter','str','update','appCode','apps','runtime\x20cache\x20cleared','stringify','some','1920436ClYiEs','lastSync',',\x20deployment\x20sync\x20','6flNkLX','lockFilePath','get','functions','attempted'];a37_0x52fb=function(){return _0x19f1ff;};return a37_0x52fb();}(function(_0x5bc47e,_0x253cd6){const _0x40a15a=a37_0x3241,_0x1911ce=_0x5bc47e();while(!![]){try{const _0x118b77=-parseInt(_0x40a15a(0x206))/0x1*(-parseInt(_0x40a15a(0x21a))/0x2)+parseInt(_0x40a15a(0x22b))/0x3*(-parseInt(_0x40a15a(0x240))/0x4)+-parseInt(_0x40a15a(0x1f6))/0x5*(parseInt(_0x40a15a(0x22d))/0x6)+-parseInt(_0x40a15a(0x203))/0x7+parseInt(_0x40a15a(0x225))/0x8+parseInt(_0x40a15a(0x216))/0x9*(-parseInt(_0x40a15a(0x20e))/0xa)+parseInt(_0x40a15a(0x1f5))/0xb*(parseInt(_0x40a15a(0x1f2))/0xc);if(_0x118b77===_0x253cd6)break;else _0x1911ce['push'](_0x1911ce['shift']());}catch(_0x3dff0b){_0x1911ce['push'](_0x1911ce['shift']());}}}(a37_0x52fb,0x7d1e2));import{readFile}from'node:fs/promises';function a37_0x3241(_0x3aeac5,_0x309f51){_0x3aeac5=_0x3aeac5-0x1ef;const _0x52fb91=a37_0x52fb();let _0x324107=_0x52fb91[_0x3aeac5];return _0x324107;}import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a37_0x366196(0x1f0),'risk':'write','flags':[{'name':a37_0x366196(0x237),'type':'string','description':a37_0x366196(0x20f),'enum':[a37_0x366196(0x23e),'ENDPOINT','HOOK']},{'name':a37_0x366196(0x228),'type':a37_0x366196(0x1f7),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x366196(0x234),'type':a37_0x366196(0x23d),'description':a37_0x366196(0x230)}],async 'dryRun'(_0x322d9c){const _0x4e7478=a37_0x366196,_0x3525cf=loadBffProjectConfig(_0x322d9c[_0x4e7478(0x1fe)]),_0x313ef9=await readBffLockFile(_0x3525cf[_0x4e7478(0x207)]),{appLock:_0x343627}=ensureLockScope(_0x313ef9??createEmptyBffLock(),_0x322d9c[_0x4e7478(0x1fe)],_0x3525cf[_0x4e7478(0x21e)],_0x4e7478(0x243)),_0x51e99b=await getTargetFunctions(_0x3525cf,_0x322d9c),_0x1a6e48=_0x322d9c['bool'](_0x4e7478(0x234)),_0x153e1a=[],_0x1bcafb=[];for(const _0x349850 of _0x51e99b){const _0x17814e=await computeFileHash(_0x349850[_0x4e7478(0x227)]),_0x3fdff5=_0x343627[_0x4e7478(0x209)][_0x349850[_0x4e7478(0x21f)]],_0x11f36c=!!_0x3fdff5&&_0x3fdff5['hash']===_0x17814e,_0x29c309=!_0x1a6e48&&_0x11f36c?'unchanged':_0x4e7478(0x226);_0x153e1a[_0x4e7478(0x243)]({'lockKey':_0x349850[_0x4e7478(0x21f)],'filePath':_0x349850[_0x4e7478(0x227)],'remoteId':_0x3fdff5?.[_0x4e7478(0x23c)]??null,'mode':_0x3fdff5?.['remoteId']?_0x4e7478(0x1fd):_0x4e7478(0x21d),'status':_0x29c309});if(_0x29c309===_0x4e7478(0x226))_0x1bcafb[_0x4e7478(0x243)](_0x349850[_0x4e7478(0x228)]);}return{'method':_0x4e7478(0x231),'url':_0x4e7478(0x224),'deploymentSync':buildAutomaticDeploymentSyncPreview('bff',_0x1bcafb),'body':{'appCode':_0x322d9c[_0x4e7478(0x1fe)],'force':_0x1a6e48,'files':_0x153e1a,'cacheClearAtRuntime':_0x153e1a[_0x4e7478(0x202)](_0x3f6efe=>_0x3f6efe[_0x4e7478(0x238)]===_0x4e7478(0x226)),'cacheClearAtRuntimeTimes':_0x153e1a[_0x4e7478(0x202)](_0x156650=>_0x156650[_0x4e7478(0x238)]===_0x4e7478(0x226))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x4e7478(0x242)+_0x153e1a[_0x4e7478(0x1f3)]+_0x4e7478(0x221)};},async 'execute'(_0x47a211){const _0x29e298=a37_0x366196,_0x22f732=loadBffProjectConfig(_0x47a211[_0x29e298(0x1fe)]),_0x4033f3=await readBffLockFile(_0x22f732[_0x29e298(0x207)]),{lockData:_0x13f318,appLock:_0x558684}=ensureLockScope(_0x4033f3??createEmptyBffLock(),_0x47a211['appCode'],_0x22f732[_0x29e298(0x21e)],'push'),_0x3722c3=await getTargetFunctions(_0x22f732,_0x47a211);if(_0x3722c3['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x29e298(0x22f)};const _0x4e6989=_0x47a211[_0x29e298(0x244)](_0x29e298(0x234)),_0x48f11c=JSON['parse'](JSON[_0x29e298(0x201)](_0x13f318)),_0x3a79bc=_0x48f11c[_0x29e298(0x1ff)][_0x47a211[_0x29e298(0x1fe)]];if(!_0x3a79bc)throw new Error(_0x29e298(0x239)+_0x47a211['appCode']+_0x29e298(0x20d));const _0x7de08d=await buildHookMaps(_0x47a211['appCode'],_0x47a211['apiDir'],_0x3722c3,_0x3a79bc),_0x2b25ff=[],_0x261425=[],_0x3d9184=[],_0x5ed73e=[];for(const _0x1dc3e9 of _0x3722c3){const _0x119a92=await computeFileHash(_0x1dc3e9[_0x29e298(0x227)]),_0x44ee1c=_0x3a79bc['functions'][_0x1dc3e9[_0x29e298(0x21f)]];if(!_0x4e6989&&_0x44ee1c&&_0x44ee1c['hash']===_0x119a92){_0x3d9184[_0x29e298(0x243)]({'lockKey':_0x1dc3e9[_0x29e298(0x21f)],'reason':_0x29e298(0x232)});continue;}try{await uploadSingleFunction(_0x47a211['appCode'],_0x1dc3e9,_0x3a79bc,_0x7de08d);const _0x43ec8a=_0x3a79bc[_0x29e298(0x209)][_0x1dc3e9[_0x29e298(0x21f)]];_0x2b25ff[_0x29e298(0x243)]({'lockKey':_0x1dc3e9['lockKey'],'remoteId':_0x43ec8a?.[_0x29e298(0x23c)]??0x0}),_0x261425[_0x29e298(0x243)](_0x1dc3e9[_0x29e298(0x228)]);}catch(_0x798947){_0x5ed73e['push']({'lockKey':_0x1dc3e9['lockKey'],'error':_0x798947 instanceof Error?_0x798947['message']:String(_0x798947)});}}_0x3a79bc[_0x29e298(0x204)]=new Date()[_0x29e298(0x223)](),await writeBffLockFile(_0x22f732[_0x29e298(0x207)],_0x48f11c),await waitForUploadedLockEntries(_0x22f732[_0x29e298(0x207)],_0x47a211[_0x29e298(0x1fe)],_0x2b25ff[_0x29e298(0x22a)](_0x3849bd=>_0x3849bd[_0x29e298(0x21f)]));let _0x37816b={'attempted':![],'cleared':![]};if(_0x2b25ff[_0x29e298(0x1f3)]>0x0)try{let _0x49c28b='';for(let _0xf6df56=0x0;_0xf6df56<CACHE_CLEAR_ATTEMPTS;_0xf6df56+=0x1){_0x49c28b=await clearBffScriptCache(),_0xf6df56<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x37816b={'attempted':!![],'cleared':!![],'message':_0x49c28b||_0x29e298(0x23f)};}catch(_0x202980){_0x37816b={'attempted':!![],'cleared':![],'error':_0x202980 instanceof Error?_0x202980['message']:String(_0x202980)};}const _0xdeed78=_0x5ed73e[_0x29e298(0x1f3)]===0x0&&(_0x37816b[_0x29e298(0x20a)]?_0x37816b[_0x29e298(0x210)]:!![]),_0x1c7bfc=await runAutomaticDeploymentSync(_0x47a211,_0x29e298(0x245),_0x261425,_0xdeed78),_0x294f60=_0xdeed78&&automaticDeploymentSyncSucceeded(_0x1c7bfc),_0x4391fb=_0x37816b['attempted']?_0x37816b[_0x29e298(0x210)]?_0x29e298(0x200):_0x29e298(0x1f8):_0x29e298(0x213),_0x842809=_0x29e298(0x205)+_0x1c7bfc['status'];return{'ok':_0x294f60,'data':{'uploaded':_0x2b25ff,'skipped':_0x3d9184,'failed':_0x5ed73e,'cacheClear':_0x37816b,'deploymentSync':_0x1c7bfc},'message':_0x29e298(0x23a)+_0x2b25ff[_0x29e298(0x1f3)]+_0x29e298(0x1f9)+_0x3d9184[_0x29e298(0x1f3)]+_0x29e298(0x1fa)+_0x5ed73e[_0x29e298(0x1f3)]+'\x20failed,\x20'+_0x4391fb+_0x842809};}};async function getTargetFunctions(_0x4f09d5,_0x3a2f2a){const _0x3b3722=a37_0x366196,_0x29d077=_0x3a2f2a['str']('type'),_0x24a7c3=_0x3a2f2a[_0x3b3722(0x1fc)]('name'),_0x3c46ba=normalizeBffType(_0x29d077)??undefined;if(_0x24a7c3&&!_0x3c46ba)throw CliErrors['validation'](_0x3b3722(0x229));const _0x3ca95c=await scanLocalBffFunctions(_0x4f09d5,_0x3c46ba);if(_0x24a7c3){const _0x19f49f=_0x3ca95c[_0x3b3722(0x1fb)](_0xf36f75=>_0xf36f75[_0x3b3722(0x228)]===_0x24a7c3);if(_0x19f49f[_0x3b3722(0x1f3)]===0x0)throw CliErrors['validation'](_0x3b3722(0x217)+_0x3c46ba+'/'+_0x24a7c3);return _0x19f49f;}return _0x3ca95c;}async function buildHookMaps(_0x13020d,_0x3f299d,_0x5613ad,_0x14defc){const _0xa37306=a37_0x366196,_0x536ad0=_0x5613ad[_0xa37306(0x202)](_0x489509=>_0x489509[_0xa37306(0x237)]===_0xa37306(0x22e));if(!_0x536ad0)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x2df0db=loadAliasMap(_0x3f299d,undefined,resolveApiFilePath(_0x3f299d,_0x13020d)),_0x22d8fd=new Map(_0x2df0db[_0xa37306(0x22a)](_0x50f7ca=>[_0x50f7ca[_0xa37306(0x22c)],_0x50f7ca[_0xa37306(0x214)]]));for(const _0x427e73 of Object[_0xa37306(0x215)](_0x14defc['functions'])){_0x427e73[_0xa37306(0x22c)]&&_0x427e73[_0xa37306(0x214)]&&!_0x22d8fd[_0xa37306(0x1f4)](_0x427e73[_0xa37306(0x22c)])&&_0x22d8fd[_0xa37306(0x23b)](_0x427e73[_0xa37306(0x22c)],_0x427e73[_0xa37306(0x214)]);}const _0x3dca3b=await listDatasets(_0x13020d),_0x3e4f86=new Map(_0x3dca3b[_0xa37306(0x22a)](_0x3dd250=>[_0x3dd250[_0xa37306(0x211)],_0x3dd250]));return{'aliasToDatasetCode':_0x22d8fd,'datasetCodeToDataset':_0x3e4f86};}async function uploadSingleFunction(_0x491f94,_0x3cd60f,_0xec32b,_0x406698){const _0x330f5a=a37_0x366196,_0x3392ca=await readFile(_0x3cd60f[_0x330f5a(0x227)],_0x330f5a(0x212)),_0x18633f=await computeFileHash(_0x3cd60f[_0x330f5a(0x227)]),_0x47e9dc=_0xec32b[_0x330f5a(0x209)][_0x3cd60f[_0x330f5a(0x21f)]];if(_0x47e9dc?.[_0x330f5a(0x23c)]&&_0x47e9dc[_0x330f5a(0x20b)]==null)throw CliErrors['validation'](_0x3cd60f['lockKey']+_0x330f5a(0x21b));let _0x413cf3=extractScriptDescription(_0x3392ca);if(!_0x413cf3&&_0x47e9dc?.[_0x330f5a(0x23c)]){const _0x157a3d=await getBffScriptInfo(_0x47e9dc[_0x330f5a(0x23c)]);_0x413cf3=_0x157a3d[_0x330f5a(0x1f1)]||undefined;}const _0x1cfae9={'appCode':_0x491f94,'functionName':_0x3cd60f[_0x330f5a(0x228)],'scriptType':_0x3cd60f['type'],'scriptContent':_0x3392ca};if(_0x47e9dc?.[_0x330f5a(0x23c)])_0x1cfae9['id']=_0x47e9dc[_0x330f5a(0x23c)];if(_0x47e9dc?.[_0x330f5a(0x20b)]!=null)_0x1cfae9[_0x330f5a(0x20b)]=_0x47e9dc[_0x330f5a(0x20b)];if(_0x413cf3)_0x1cfae9[_0x330f5a(0x1f1)]=_0x413cf3;if(_0x3cd60f['type']===_0x330f5a(0x22e)){const _0x53a205=_0x3cd60f[_0x330f5a(0x22c)];if(!_0x53a205||!_0x3cd60f[_0x330f5a(0x20c)]||!_0x3cd60f[_0x330f5a(0x218)])throw CliErrors['validation'](_0x330f5a(0x235)+_0x3cd60f[_0x330f5a(0x21f)]);const _0x347f01=_0x406698['aliasToDatasetCode']['get'](_0x53a205)??_0x47e9dc?.[_0x330f5a(0x214)]??_0x53a205,_0x338d04=_0x406698[_0x330f5a(0x222)][_0x330f5a(0x208)](_0x347f01);if(!_0x338d04)throw CliErrors[_0x330f5a(0x21c)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x53a205+_0x330f5a(0x241)+('Run\x20`'+CLI_BIN_NAME+_0x330f5a(0x220)));_0x1cfae9[_0x330f5a(0x219)]=_0x338d04['id'],_0x1cfae9[_0x330f5a(0x20c)]=_0x3cd60f['operationType'],_0x1cfae9[_0x330f5a(0x218)]=_0x3cd60f[_0x330f5a(0x218)];}const _0x51fa77=await saveBffScript(_0x1cfae9),_0x2c1789=_0x51fa77['id'],_0x33fcf6=_0x51fa77[_0x330f5a(0x236)]??await getBffScriptInfo(_0x2c1789),_0x1cad00={'hash':_0x18633f,'remoteId':_0x2c1789,'version':_0x33fcf6[_0x330f5a(0x20b)]};if(_0x3cd60f[_0x330f5a(0x237)]==='HOOK'){const _0xb0445b=_0x3cd60f[_0x330f5a(0x22c)],_0x10c2ff=_0x406698[_0x330f5a(0x233)][_0x330f5a(0x208)](_0xb0445b)??_0x47e9dc?.['datasetCode']??_0xb0445b;_0x406698[_0x330f5a(0x233)]['has'](_0xb0445b)?_0x1cad00[_0x330f5a(0x22c)]=_0xb0445b:_0x1cad00[_0x330f5a(0x22c)]=_0x47e9dc?.[_0x330f5a(0x22c)],_0x1cad00[_0x330f5a(0x214)]=_0x10c2ff,_0x1cad00[_0x330f5a(0x20c)]=_0x3cd60f[_0x330f5a(0x20c)],_0x1cad00[_0x330f5a(0x218)]=_0x3cd60f[_0x330f5a(0x218)];}_0xec32b[_0x330f5a(0x209)][_0x3cd60f[_0x330f5a(0x21f)]]=_0x1cad00;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x4e44b7,_0x5880a9,_0x15206d){const _0x7a7263=a37_0x366196;if(_0x15206d['length']===0x0)return;for(let _0x33327b=0x0;_0x33327b<LOCK_SETTLE_RETRY_COUNT;_0x33327b+=0x1){const _0xc6ad7b=await readBffLockFile(_0x4e44b7),_0x29c9d9=_0xc6ad7b?.['apps']?.[_0x5880a9]?.[_0x7a7263(0x209)]??{},_0x55a7bf=_0x15206d['every'](_0xc49505=>!!_0x29c9d9[_0xc49505]?.[_0x7a7263(0x23c)]);if(_0x55a7bf)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x7a7263(0x1ef)+_0x15206d['join'](',\x20')+'.');}
@@ -1 +1 @@
1
- function a38_0x4d2a(){const _0x3dc494=['16784790KhOzMD','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','bool','filePath','remote','4571472wNDFHP','16919dIghlb','\x20remote-only','datasetCode','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','1629316kVyNzF','boolean','555813LOGAMV','functions','has','alias','all','\x20added,\x20','lockKey','2352gLvzNB','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','355930ECRRhI','scriptsRoot','lockFilePath','hash','\x20unchanged','\x20modified,\x20','5ZBLkke','3yllLKI','map','length','apiDir','appCode','256569hxJebR','bff','push','status'];a38_0x4d2a=function(){return _0x3dc494;};return a38_0x4d2a();}const a38_0x2edc30=a38_0x45fb;(function(_0xff8e4c,_0x21ac83){const _0x2a5ecb=a38_0x45fb,_0x2fea8e=_0xff8e4c();while(!![]){try{const _0x347733=-parseInt(_0x2a5ecb(0x15c))/0x1+parseInt(_0x2a5ecb(0x150))/0x2*(-parseInt(_0x2a5ecb(0x157))/0x3)+parseInt(_0x2a5ecb(0x145))/0x4*(-parseInt(_0x2a5ecb(0x156))/0x5)+-parseInt(_0x2a5ecb(0x14e))/0x6*(parseInt(_0x2a5ecb(0x141))/0x7)+parseInt(_0x2a5ecb(0x165))/0x8+parseInt(_0x2a5ecb(0x147))/0x9+parseInt(_0x2a5ecb(0x160))/0xa;if(_0x347733===_0x21ac83)break;else _0x2fea8e['push'](_0x2fea8e['shift']());}catch(_0x50927a){_0x2fea8e['push'](_0x2fea8e['shift']());}}}(a38_0x4d2a,0x7f867));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a38_0x45fb(_0x33035e,_0xba0e6d){_0x33035e=_0x33035e-0x141;const _0x4d2a5d=a38_0x4d2a();let _0x45fbe7=_0x4d2a5d[_0x33035e];return _0x45fbe7;}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x2edc30(0x15d),'command':a38_0x2edc30(0x15f),'description':a38_0x2edc30(0x161),'risk':'read','flags':[{'name':a38_0x2edc30(0x164),'type':a38_0x2edc30(0x146),'description':a38_0x2edc30(0x14f)}],async 'execute'(_0x2ca9a5){const _0x8cf390=a38_0x2edc30,_0x3b5bae=loadBffProjectConfig(_0x2ca9a5[_0x8cf390(0x15b)]),_0x217a7d=await readBffLockFile(_0x3b5bae[_0x8cf390(0x152)]),{appLock:_0x24c433}=ensureLockScope(_0x217a7d??createEmptyBffLock(),_0x2ca9a5[_0x8cf390(0x15b)],_0x3b5bae[_0x8cf390(0x151)],_0x8cf390(0x15f)),_0x1b211b=await scanLocalBffFunctions(_0x3b5bae),_0x5aa909=[],_0x435f32=[],_0x29213a=[];for(const _0x23aaf2 of _0x1b211b){const _0x3309c6=await computeFileHash(_0x23aaf2[_0x8cf390(0x163)]),_0x4e9891=_0x24c433[_0x8cf390(0x148)][_0x23aaf2[_0x8cf390(0x14d)]];if(!_0x4e9891)_0x5aa909[_0x8cf390(0x15e)](_0x23aaf2[_0x8cf390(0x14d)]);else _0x4e9891[_0x8cf390(0x153)]!==_0x3309c6?_0x435f32[_0x8cf390(0x15e)](_0x23aaf2['lockKey']):_0x29213a[_0x8cf390(0x15e)](_0x23aaf2[_0x8cf390(0x14d)]);}const _0x3e4a60=[];if(_0x2ca9a5[_0x8cf390(0x162)]('remote')){const _0x26ff99=loadAliasMap(_0x2ca9a5[_0x8cf390(0x15a)],undefined,resolveApiFilePath(_0x2ca9a5['apiDir'],_0x2ca9a5['appCode'])),_0x565e1e=new Map(_0x26ff99[_0x8cf390(0x158)](_0x1385ae=>[_0x1385ae[_0x8cf390(0x143)],_0x1385ae[_0x8cf390(0x14a)]])),[_0x5ba962,_0x521c06]=await Promise[_0x8cf390(0x14b)]([listBffScripts(_0x2ca9a5['appCode']),getBffScriptStatistics(_0x2ca9a5['appCode'])]),_0x7390ba=createHookLocationMap(_0x521c06),_0x1f2103=new Set(_0x1b211b[_0x8cf390(0x158)](_0x473da3=>_0x473da3['lockKey']));for(const _0x450537 of _0x5ba962){const _0x4fbf36=resolveRemoteScriptTarget(_0x3b5bae,_0x450537,_0x7390ba,_0x24c433[_0x8cf390(0x148)],_0x565e1e);_0x4fbf36&&!_0x1f2103[_0x8cf390(0x149)](_0x4fbf36[_0x8cf390(0x14d)])&&_0x3e4a60[_0x8cf390(0x15e)](_0x4fbf36[_0x8cf390(0x14d)]);}}const _0x2001a2=_0x5aa909['length']===0x0&&_0x435f32[_0x8cf390(0x159)]===0x0&&_0x3e4a60['length']===0x0;return{'ok':!![],'data':{'added':_0x5aa909,'modified':_0x435f32,'unchanged':_0x29213a,'remoteOnly':_0x3e4a60},'message':_0x2001a2?_0x8cf390(0x144):_0x5aa909[_0x8cf390(0x159)]+_0x8cf390(0x14c)+_0x435f32[_0x8cf390(0x159)]+_0x8cf390(0x155)+_0x29213a[_0x8cf390(0x159)]+_0x8cf390(0x154)+(_0x3e4a60[_0x8cf390(0x159)]>0x0?',\x20'+_0x3e4a60[_0x8cf390(0x159)]+_0x8cf390(0x142):'')};}};
1
+ const a38_0x4192bf=a38_0x1296;(function(_0x5ebd4c,_0x2e76fc){const _0x4b80b8=a38_0x1296,_0x2ac774=_0x5ebd4c();while(!![]){try{const _0x211fc1=parseInt(_0x4b80b8(0x157))/0x1*(parseInt(_0x4b80b8(0x153))/0x2)+parseInt(_0x4b80b8(0x161))/0x3+parseInt(_0x4b80b8(0x158))/0x4+-parseInt(_0x4b80b8(0x15b))/0x5+-parseInt(_0x4b80b8(0x15f))/0x6*(parseInt(_0x4b80b8(0x163))/0x7)+parseInt(_0x4b80b8(0x154))/0x8+-parseInt(_0x4b80b8(0x155))/0x9;if(_0x211fc1===_0x2e76fc)break;else _0x2ac774['push'](_0x2ac774['shift']());}catch(_0x34af75){_0x2ac774['push'](_0x2ac774['shift']());}}}(a38_0x363c,0xa9d39));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 a38_0x1296(_0x4116e2,_0x36b8ea){_0x4116e2=_0x4116e2-0x146;const _0x363c85=a38_0x363c();let _0x12963c=_0x363c85[_0x4116e2];return _0x12963c;}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a38_0x363c(){const _0x468a2a=['read','length','lockKey','bool','alias','appCode','bff','scriptsRoot','datasetCode','remote','push','status','all','2112722BFJNQe','1301720nKCXQu','10441116uXRWgN','\x20unchanged','1WKXmNG','3909484tdrgcH','functions','filePath','2856570dFadaP','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','lockFilePath','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','5922pwVOvG','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','1748877EMMZEH','map','2499mvzHzr','apiDir'];a38_0x363c=function(){return _0x468a2a;};return a38_0x363c();}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x4192bf(0x14c),'command':'status','description':a38_0x4192bf(0x15c),'risk':a38_0x4192bf(0x146),'flags':[{'name':a38_0x4192bf(0x14f),'type':'boolean','description':a38_0x4192bf(0x160)}],async 'execute'(_0x3478fc){const _0x22b578=a38_0x4192bf,_0x2bc594=loadBffProjectConfig(_0x3478fc[_0x22b578(0x14b)]),_0x2618fb=await readBffLockFile(_0x2bc594[_0x22b578(0x15d)]),{appLock:_0x5869fc}=ensureLockScope(_0x2618fb??createEmptyBffLock(),_0x3478fc[_0x22b578(0x14b)],_0x2bc594[_0x22b578(0x14d)],_0x22b578(0x151)),_0xa9f31c=await scanLocalBffFunctions(_0x2bc594),_0x2bf89c=[],_0x216266=[],_0x255141=[];for(const _0x2d0de0 of _0xa9f31c){const _0x2b0837=await computeFileHash(_0x2d0de0[_0x22b578(0x15a)]),_0x1579cc=_0x5869fc[_0x22b578(0x159)][_0x2d0de0[_0x22b578(0x148)]];if(!_0x1579cc)_0x2bf89c['push'](_0x2d0de0[_0x22b578(0x148)]);else _0x1579cc['hash']!==_0x2b0837?_0x216266[_0x22b578(0x150)](_0x2d0de0[_0x22b578(0x148)]):_0x255141[_0x22b578(0x150)](_0x2d0de0['lockKey']);}const _0x1e4665=[];if(_0x3478fc[_0x22b578(0x149)](_0x22b578(0x14f))){const _0x121f5c=loadAliasMap(_0x3478fc[_0x22b578(0x164)],undefined,resolveApiFilePath(_0x3478fc[_0x22b578(0x164)],_0x3478fc['appCode'])),_0xc12dba=new Map(_0x121f5c[_0x22b578(0x162)](_0x390846=>[_0x390846[_0x22b578(0x14e)],_0x390846[_0x22b578(0x14a)]])),[_0x5d73f8,_0x40ef70]=await Promise[_0x22b578(0x152)]([listBffScripts(_0x3478fc[_0x22b578(0x14b)]),getBffScriptStatistics(_0x3478fc[_0x22b578(0x14b)])]),_0x73b336=createHookLocationMap(_0x40ef70),_0x4c9977=new Set(_0xa9f31c[_0x22b578(0x162)](_0x57b181=>_0x57b181[_0x22b578(0x148)]));for(const _0x49747e of _0x5d73f8){const _0x55f1ab=resolveRemoteScriptTarget(_0x2bc594,_0x49747e,_0x73b336,_0x5869fc[_0x22b578(0x159)],_0xc12dba);_0x55f1ab&&!_0x4c9977['has'](_0x55f1ab[_0x22b578(0x148)])&&_0x1e4665[_0x22b578(0x150)](_0x55f1ab[_0x22b578(0x148)]);}}const _0xd02aa9=_0x2bf89c[_0x22b578(0x147)]===0x0&&_0x216266[_0x22b578(0x147)]===0x0&&_0x1e4665['length']===0x0;return{'ok':!![],'data':{'added':_0x2bf89c,'modified':_0x216266,'unchanged':_0x255141,'remoteOnly':_0x1e4665},'message':_0xd02aa9?_0x22b578(0x15e):_0x2bf89c['length']+'\x20added,\x20'+_0x216266[_0x22b578(0x147)]+'\x20modified,\x20'+_0x255141[_0x22b578(0x147)]+_0x22b578(0x156)+(_0x1e4665[_0x22b578(0x147)]>0x0?',\x20'+_0x1e4665[_0x22b578(0x147)]+'\x20remote-only':'')};}};
@@ -1 +1 @@
1
- function a39_0x2af9(_0x2e33d0,_0x19d515){_0x2e33d0=_0x2e33d0-0x191;const _0x54f608=a39_0x54f6();let _0x2af94b=_0x54f608[_0x2e33d0];return _0x2af94b;}const a39_0x5b0354=a39_0x2af9;(function(_0x301b3a,_0x1ceb58){const _0x4e0c8c=a39_0x2af9,_0x367770=_0x301b3a();while(!![]){try{const _0x110826=-parseInt(_0x4e0c8c(0x193))/0x1+parseInt(_0x4e0c8c(0x1ad))/0x2+parseInt(_0x4e0c8c(0x195))/0x3*(parseInt(_0x4e0c8c(0x19c))/0x4)+-parseInt(_0x4e0c8c(0x1a4))/0x5*(parseInt(_0x4e0c8c(0x1a2))/0x6)+parseInt(_0x4e0c8c(0x19e))/0x7+-parseInt(_0x4e0c8c(0x1a0))/0x8+-parseInt(_0x4e0c8c(0x196))/0x9*(-parseInt(_0x4e0c8c(0x1af))/0xa);if(_0x110826===_0x1ceb58)break;else _0x367770['push'](_0x367770['shift']());}catch(_0x10bdf8){_0x367770['push'](_0x367770['shift']());}}}(a39_0x54f6,0xc3736));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a39_0x54f6(){const _0x305c69=['installedPath','2593106SHTdWC','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','1390pJcWcD','\x20at\x20','\x20installed','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','361558MSlqPG','Built-in\x20Skill\x20install\x20failed\x20[','57gCPoTn','8037BayPyq','nonInteractive','code','cli-skill','\x20is\x20already\x20current','changed','194044wsGJWB','cwd','1934366LbzFBZ','CLI\x20Built-in\x20Skill\x20','9899256sQQLXi','apiError','1315176eOLJJt','log','5SaCIro','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','skillVersion','\x20via\x20skills@latest','error','repairCommand','pipe',']:\x20'];a39_0x54f6=function(){return _0x305c69;};return a39_0x54f6();}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x5b0354(0x199),'command':'install','description':a39_0x5b0354(0x1a5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4a0f56){const _0x1f6504=a39_0x5b0354;logger['setLogPath'](process[_0x1f6504(0x19d)]()),logger['info']('cli-skill-install',_0x1f6504(0x192));const _0x1f365b=installBuiltinSkill({'stdio':_0x4a0f56[_0x1f6504(0x197)]?_0x1f6504(0x1aa):'inherit'});if(!_0x1f365b['ok'])throw CliErrors[_0x1f6504(0x1a1)](_0x1f6504(0x194)+_0x1f365b[_0x1f6504(0x198)]+_0x1f6504(0x1ab)+(_0x1f365b[_0x1f6504(0x1a8)]||'unknown'),_0x1f6504(0x1ae)+_0x1f365b[_0x1f6504(0x1a9)]);return console[_0x1f6504(0x1a3)](_0x1f365b[_0x1f6504(0x19b)]?'CLI\x20Built-in\x20Skill\x20'+_0x1f365b[_0x1f6504(0x1a6)]+_0x1f6504(0x191)+(_0x1f365b[_0x1f6504(0x1ac)]?_0x1f6504(0x1b0)+_0x1f365b['installedPath']:_0x1f6504(0x1a7)):_0x1f6504(0x19f)+_0x1f365b[_0x1f6504(0x1a6)]+_0x1f6504(0x19a)+(_0x1f365b[_0x1f6504(0x1ac)]?_0x1f6504(0x1b0)+_0x1f365b['installedPath']:'')),{'ok':!![]};}}];
1
+ function a39_0x1d96(_0x20362f,_0x4673e1){_0x20362f=_0x20362f-0xe0;const _0x560ab7=a39_0x560a();let _0x1d968f=_0x560ab7[_0x20362f];return _0x1d968f;}const a39_0x185beb=a39_0x1d96;(function(_0x2e5579,_0x4e2404){const _0x3df623=a39_0x1d96,_0x59e2a3=_0x2e5579();while(!![]){try{const _0x4871e5=parseInt(_0x3df623(0xea))/0x1*(-parseInt(_0x3df623(0xf1))/0x2)+-parseInt(_0x3df623(0xe9))/0x3*(parseInt(_0x3df623(0xfb))/0x4)+-parseInt(_0x3df623(0xe8))/0x5+-parseInt(_0x3df623(0xe4))/0x6*(-parseInt(_0x3df623(0xeb))/0x7)+parseInt(_0x3df623(0xf8))/0x8+-parseInt(_0x3df623(0xe1))/0x9+parseInt(_0x3df623(0xfd))/0xa;if(_0x4871e5===_0x4e2404)break;else _0x59e2a3['push'](_0x59e2a3['shift']());}catch(_0xf4d434){_0x59e2a3['push'](_0x59e2a3['shift']());}}}(a39_0x560a,0xa87f8));function a39_0x560a(){const _0x5b22b5=['2667766zmEPCp','nonInteractive','repairCommand','CLI\x20Built-in\x20Skill\x20',']:\x20','setLogPath','cli-skill-install','4976936BrUJKe','\x20at\x20','inherit','115448xnbxCL','apiError','25940170VnnDKY','info','\x20installed','error','cli-skill','10531611zndADT','installedPath','changed','6126LQbyjj','Built-in\x20Skill\x20install\x20failed\x20[','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','\x20is\x20already\x20current','631210DFYiEg','132HkhyhJ','1vTUgKw','9422VwLVLa','read','code','unknown','install','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.'];a39_0x560a=function(){return _0x5b22b5;};return a39_0x560a();}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x185beb(0xe0),'command':a39_0x185beb(0xef),'description':'Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','risk':a39_0x185beb(0xec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xfe541e){const _0x42cd1a=a39_0x185beb;logger[_0x42cd1a(0xf6)](process['cwd']()),logger[_0x42cd1a(0xfe)](_0x42cd1a(0xf7),_0x42cd1a(0xf0));const _0x3c88b2=installBuiltinSkill({'stdio':_0xfe541e[_0x42cd1a(0xf2)]?'pipe':_0x42cd1a(0xfa)});if(!_0x3c88b2['ok'])throw CliErrors[_0x42cd1a(0xfc)](_0x42cd1a(0xe5)+_0x3c88b2[_0x42cd1a(0xed)]+_0x42cd1a(0xf5)+(_0x3c88b2[_0x42cd1a(0x100)]||_0x42cd1a(0xee)),_0x42cd1a(0xe6)+_0x3c88b2[_0x42cd1a(0xf3)]);return console['log'](_0x3c88b2[_0x42cd1a(0xe3)]?_0x42cd1a(0xf4)+_0x3c88b2['skillVersion']+_0x42cd1a(0xff)+(_0x3c88b2[_0x42cd1a(0xe2)]?_0x42cd1a(0xf9)+_0x3c88b2[_0x42cd1a(0xe2)]:'\x20via\x20skills@latest'):_0x42cd1a(0xf4)+_0x3c88b2['skillVersion']+_0x42cd1a(0xe7)+(_0x3c88b2['installedPath']?_0x42cd1a(0xf9)+_0x3c88b2['installedPath']:'')),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a40_0x2b47ad=a40_0x34ed;(function(_0x3448fd,_0x44fec4){const _0x1e7431=a40_0x34ed,_0x2a90e=_0x3448fd();while(!![]){try{const _0x40ad2f=-parseInt(_0x1e7431(0x159))/0x1*(-parseInt(_0x1e7431(0x161))/0x2)+parseInt(_0x1e7431(0x152))/0x3*(-parseInt(_0x1e7431(0x170))/0x4)+parseInt(_0x1e7431(0x168))/0x5*(-parseInt(_0x1e7431(0x140))/0x6)+-parseInt(_0x1e7431(0x150))/0x7*(-parseInt(_0x1e7431(0x160))/0x8)+-parseInt(_0x1e7431(0x163))/0x9+-parseInt(_0x1e7431(0x156))/0xa+parseInt(_0x1e7431(0x12c))/0xb;if(_0x40ad2f===_0x44fec4)break;else _0x2a90e['push'](_0x2a90e['shift']());}catch(_0x4d464a){_0x2a90e['push'](_0x2a90e['shift']());}}}(a40_0x11ce,0xd07dd));import a40_0x30da73 from'chalk';function a40_0x34ed(_0x144df2,_0x42f139){_0x144df2=_0x144df2-0x120;const _0x11ceaa=a40_0x11ce();let _0x34edea=_0x11ceaa[_0x144df2];return _0x34edea;}import a40_0x276e3c from'ora';import a40_0x57785a from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';function a40_0x11ce(){const _0xab3c9a=['error','Current\x20version:\x20','code','entries','log','\x20cli-skill\x20install','149874siHhnE','repairCommand','...','\x20is\x20newer\x20than\x20npm\x20latest\x20v','https://registry.npmjs.org/-/package/','\x20\x20Try\x20manually:\x20','\x20→\x20',']:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','filter','run',',\x20found\x20','Update\x20failed','yellow','Install\x20a\x20specific\x20CLI\x20version','2131493AIylgi','timeout','16509kVvUOF','bun','bool','update','15949230skqrIL','str','toLowerCase','36999LoAkfu','install','boolean','gray','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Invalid\x20version:\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','40iSYqpQ','68GCmNQm','Updating\x20via\x20','10837332YmsaCe','validation','slice','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','\x20is\x20up\x20to\x20date.','290JltdKH','/dist-tags','json','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','beta','message','length','Requested\x20version:\x20','332foAAtU','unknown','Version\x20comparison\x20failed','green','Updated\x20to\x20v','source','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','red','execPath','valid','state','object','fail','version','expected\x20','Already\x20on\x20requested\x20version\x20(v','fromEntries','latest','\x20\x20Run\x20manually:\x20','skillVersion','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20\x20CLI\x20Built-in\x20Skill\x20','30559342JQYTbI','string','warn','Checking\x20for\x20updates...','@latest','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','current','succeed','Current\x20version\x20v','npm','trim','start','info','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'];a40_0x11ce=function(){return _0xab3c9a;};return a40_0x11ce();}import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x1e5557=a40_0x34ed;return GIT_COMMIT!==_0x1e5557(0x171)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x1e5557(0x165)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1e360f=a40_0x34ed,_0x47d71a=process[_0x1e360f(0x178)][_0x1e360f(0x158)]();if(_0x47d71a['includes'](_0x1e360f(0x153)))return _0x1e360f(0x153);return _0x1e360f(0x135);}const updateFlags=[{'name':a40_0x2b47ad(0x16c),'type':a40_0x2b47ad(0x15b),'description':a40_0x2b47ad(0x15d),'default':![]},{'name':a40_0x2b47ad(0x123),'type':a40_0x2b47ad(0x12d),'description':a40_0x2b47ad(0x14f)}];function getRequestedVersion(_0x2fac61){const _0x1d518f=a40_0x2b47ad;return _0x2fac61[_0x1d518f(0x157)](_0x1d518f(0x123))[_0x1d518f(0x136)]();}async function validateUpdateFlags(_0x1a5106){const _0xc1cf9e=a40_0x2b47ad,_0x2b3087=_0x1a5106[_0xc1cf9e(0x154)](_0xc1cf9e(0x16c)),_0x507552=getRequestedVersion(_0x1a5106);if(_0x2b3087&&_0x507552)throw CliErrors[_0xc1cf9e(0x164)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0xc1cf9e(0x166));if(_0x507552&&!a40_0x57785a[_0xc1cf9e(0x179)](_0x507552))throw CliErrors[_0xc1cf9e(0x164)](_0xc1cf9e(0x15e)+_0x507552,_0xc1cf9e(0x15f));}async function fetchNpmDistTags(){const _0x1a1081=a40_0x2b47ad;try{const _0x2037e5=await fetch(_0x1a1081(0x144)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x1a1081(0x169),{'signal':AbortSignal[_0x1a1081(0x151)](0x2710)});if(!_0x2037e5['ok'])return null;const _0xed851d=await _0x2037e5[_0x1a1081(0x16a)]();if(!_0xed851d||typeof _0xed851d!==_0x1a1081(0x121))return null;return Object[_0x1a1081(0x126)](Object[_0x1a1081(0x13d)](_0xed851d)[_0x1a1081(0x14a)](([,_0x527b55])=>typeof _0x527b55==='string'&&_0x527b55[_0x1a1081(0x136)]()[_0x1a1081(0x16e)]>0x0)['map'](([_0x30282f,_0x1b3f42])=>[_0x30282f,String(_0x1b3f42)[_0x1a1081(0x136)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x129586){const _0x5e32af=await fetchNpmDistTags();return _0x5e32af?.[_0x129586]??null;}async function fetchLatestVersion(){const _0x8521d6=a40_0x2b47ad;return fetchNpmDistTagVersion(_0x8521d6(0x127));}async function resolveTargetVersion(_0x3c4cb4){const _0x520cc2=a40_0x2b47ad,_0x11f03d=getRequestedVersion(_0x3c4cb4);if(_0x11f03d)return{'version':_0x11f03d,'source':'version'};if(_0x3c4cb4[_0x520cc2(0x154)](_0x520cc2(0x16c))){const _0x3c436f=await fetchNpmDistTagVersion(_0x520cc2(0x16c));if(!_0x3c436f)return null;return{'version':_0x3c436f,'source':_0x520cc2(0x16c)};}const _0x1af2d8=await fetchLatestVersion();if(!_0x1af2d8)return null;return{'version':_0x1af2d8,'source':'latest'};}function shouldInstallTarget(_0x38cd98,_0x5e0ee2){const _0x47ea31=a40_0x2b47ad;if(_0x5e0ee2[_0x47ea31(0x175)]==='version'||_0x5e0ee2[_0x47ea31(0x175)]==='beta')return!a40_0x57785a['eq'](_0x38cd98,_0x5e0ee2['version']);return a40_0x57785a['lt'](_0x38cd98,_0x5e0ee2['version']);}function getInstallPlanLabel(_0x15bf18,_0x36e240){const _0x3414c0=a40_0x2b47ad;switch(_0x36e240[_0x3414c0(0x175)]){case'beta':return'Beta\x20version:\x20'+a40_0x30da73[_0x3414c0(0x14e)](_0x15bf18)+_0x3414c0(0x146)+a40_0x30da73[_0x3414c0(0x173)](_0x36e240[_0x3414c0(0x123)]);case'version':return _0x3414c0(0x16f)+a40_0x30da73[_0x3414c0(0x14e)](_0x15bf18)+_0x3414c0(0x146)+a40_0x30da73['green'](_0x36e240[_0x3414c0(0x123)]);case _0x3414c0(0x127):default:return'Update\x20available:\x20'+a40_0x30da73[_0x3414c0(0x14e)](_0x15bf18)+'\x20→\x20'+a40_0x30da73['green'](_0x36e240['version']);}}function repairCurrentBuiltinSkill(){const _0x41031c=a40_0x2b47ad;console['log'](a40_0x30da73[_0x41031c(0x15c)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x4a2b22=installBuiltinSkill();if(_0x4a2b22['ok'])return console[_0x41031c(0x13e)](a40_0x30da73[_0x41031c(0x15c)](_0x41031c(0x12b)+_0x4a2b22[_0x41031c(0x129)]+_0x41031c(0x167))),!![];return console['warn'](a40_0x30da73[_0x41031c(0x14e)](_0x41031c(0x148)+_0x4a2b22[_0x41031c(0x13c)]+_0x41031c(0x147)+(_0x4a2b22[_0x41031c(0x13a)]||_0x41031c(0x171)))),console[_0x41031c(0x13e)](a40_0x30da73[_0x41031c(0x15c)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x41031c(0x13f))),![];}function verifyUpdatedBuiltinSkill(_0x2a7979){const _0x4fd660=a40_0x2b47ad,_0x11f9e0=inspectInstalledBuiltinSkillVersion(_0x2a7979);if(_0x11f9e0[_0x4fd660(0x120)]===_0x4fd660(0x132))return console[_0x4fd660(0x13e)](a40_0x30da73[_0x4fd660(0x15c)](_0x4fd660(0x12b)+_0x2a7979+_0x4fd660(0x167))),!![];const _0x54b294=_0x11f9e0['skillVersion']?_0x4fd660(0x124)+_0x2a7979+_0x4fd660(0x14c)+_0x11f9e0[_0x4fd660(0x129)]:'expected\x20'+_0x2a7979+',\x20state\x20'+_0x11f9e0[_0x4fd660(0x120)];return console[_0x4fd660(0x12e)](a40_0x30da73[_0x4fd660(0x14e)](_0x4fd660(0x131)+_0x54b294)),console[_0x4fd660(0x13e)](a40_0x30da73[_0x4fd660(0x15c)](_0x4fd660(0x128)+_0x11f9e0[_0x4fd660(0x141)])),![];}async function execute(_0x308119){const _0x1061d8=a40_0x2b47ad;await validateUpdateFlags(_0x308119);const _0x1b79ab=getCurrentVersion();console[_0x1061d8(0x13e)](_0x1061d8(0x13b)+_0x1b79ab);const _0x451b12=a40_0x276e3c(_0x1061d8(0x12f))['start'](),_0x12f03f=await resolveTargetVersion(_0x308119);if(!_0x12f03f){const _0x36f605=_0x308119[_0x1061d8(0x154)]('beta')?_0x1061d8(0x16b):_0x1061d8(0x176);return _0x451b12[_0x1061d8(0x122)](_0x36f605),console[_0x1061d8(0x13e)](a40_0x30da73[_0x1061d8(0x15c)](_0x1061d8(0x139)+NPM_PACKAGE_NAME+_0x1061d8(0x130))),{'ok':![],'message':_0x36f605};}const _0xd6ee6c=a40_0x57785a[_0x1061d8(0x179)](VERSION),_0x5d2eb9=a40_0x57785a[_0x1061d8(0x179)](_0x12f03f[_0x1061d8(0x123)]);if(!_0xd6ee6c||!_0x5d2eb9)return _0x451b12['fail'](_0x1061d8(0x172)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0xd6ee6c,_0x12f03f)){const _0x346dad=_0x12f03f[_0x1061d8(0x175)]===_0x1061d8(0x123)?_0x1061d8(0x125)+_0x12f03f[_0x1061d8(0x123)]+')':a40_0x57785a['gt'](_0xd6ee6c,_0x5d2eb9)?_0x1061d8(0x134)+_0x1b79ab+_0x1061d8(0x143)+_0x12f03f['version']:'Already\x20up\x20to\x20date\x20(v'+_0x12f03f[_0x1061d8(0x123)]+')';return _0x451b12[_0x1061d8(0x133)](_0x346dad),{'ok':repairCurrentBuiltinSkill()};}_0x451b12[_0x1061d8(0x138)](getInstallPlanLabel(_0x1b79ab,_0x12f03f));const _0x1fbb75=detectPackageManager(),_0xd65d3f=_0x1fbb75===_0x1061d8(0x135)?resolveNpmBin(_0x1061d8(0x135)):_0x1fbb75,_0x1c0e7b=a40_0x276e3c(_0x1061d8(0x162)+_0x1fbb75+_0x1061d8(0x142))[_0x1061d8(0x137)]();try{return await execa(_0xd65d3f,[_0x1061d8(0x15a),'-g',NPM_PACKAGE_NAME+'@'+_0x12f03f['version']],{'stdio':'pipe'}),_0x1c0e7b[_0x1061d8(0x133)](_0x1061d8(0x174)+_0x12f03f[_0x1061d8(0x123)]),console[_0x1061d8(0x13e)](a40_0x30da73[_0x1061d8(0x15c)](_0x1061d8(0x149))),{'ok':verifyUpdatedBuiltinSkill(_0x12f03f[_0x1061d8(0x123)])};}catch(_0xdf8c9c){return _0x1c0e7b[_0x1061d8(0x122)](_0x1061d8(0x14d)),console[_0x1061d8(0x13a)](a40_0x30da73[_0x1061d8(0x177)]('\x20\x20'+_0xdf8c9c[_0x1061d8(0x16d)])),console[_0x1061d8(0x13e)](a40_0x30da73[_0x1061d8(0x15c)](_0x1061d8(0x145)+_0x1fbb75+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x12f03f['version'])),{'ok':![],'message':_0xdf8c9c[_0x1061d8(0x16d)]};}}export const updateDefinition={'service':a40_0x2b47ad(0x155),'command':a40_0x2b47ad(0x14b),'description':a40_0x2b47ad(0x12a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
1
+ const a40_0xe7baf=a40_0x3e54;(function(_0xb9a69b,_0x4fd177){const _0x54d9a3=a40_0x3e54,_0x5ac09f=_0xb9a69b();while(!![]){try{const _0x157dd6=-parseInt(_0x54d9a3(0x164))/0x1+-parseInt(_0x54d9a3(0x188))/0x2+parseInt(_0x54d9a3(0x15a))/0x3*(parseInt(_0x54d9a3(0x174))/0x4)+parseInt(_0x54d9a3(0x149))/0x5+-parseInt(_0x54d9a3(0x151))/0x6+-parseInt(_0x54d9a3(0x15e))/0x7+parseInt(_0x54d9a3(0x18d))/0x8;if(_0x157dd6===_0x4fd177)break;else _0x5ac09f['push'](_0x5ac09f['shift']());}catch(_0x3669a4){_0x5ac09f['push'](_0x5ac09f['shift']());}}}(a40_0x1166,0x99f02));function a40_0x3e54(_0x4996ec,_0x9387be){_0x4996ec=_0x4996ec-0x142;const _0x11660f=a40_0x1166();let _0x3e5469=_0x11660f[_0x4996ec];return _0x3e5469;}import a40_0x62de63 from'chalk';import a40_0x2ead4e from'ora';import a40_0x47df77 from'semver';import{execa}from'execa';function a40_0x1166(){const _0x259ed3=['toLowerCase','Current\x20version:\x20','1938912SPMavA','run','Update\x20available:\x20','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','bun','unknown','warn','json','Already\x20up\x20to\x20date\x20(v','381eBwsUQ','npm','source','Update\x20failed','8095941LNgqem','error','yellow','expected\x20','\x20\x20Run\x20manually:\x20','code','205565VQaXqV','\x20\x20CLI\x20Built-in\x20Skill\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','slice','valid','version','Beta\x20version:\x20','log','@latest','\x20→\x20','boolean','trim','/dist-tags','Current\x20version\x20v','update','30956RQSIGo','\x20cli-skill\x20install','includes','filter','beta','validation','start','Already\x20on\x20requested\x20version\x20(v','Requested\x20version:\x20','latest','red','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Version\x20comparison\x20failed','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','info','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','succeed','\x20is\x20newer\x20than\x20npm\x20latest\x20v','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)',',\x20found\x20','1824112GLFdVY','str','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','execPath','Invalid\x20version:\x20','10256784MdUCNJ','\x20install\x20-g\x20','fail','Checking\x20for\x20updates...','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','current','...','message','string','object','Updating\x20via\x20','https://registry.npmjs.org/-/package/','timeout','green','state','fromEntries','skillVersion','4814575hxLnvi','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','entries','bool','gray','Checking\x20CLI\x20Built-in\x20Skill...'];a40_0x1166=function(){return _0x259ed3;};return a40_0x1166();}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{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x4d8d54=a40_0x3e54;return GIT_COMMIT!==_0x4d8d54(0x156)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4d8d54(0x168)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x337618=a40_0x3e54,_0x59da06=process[_0x337618(0x18b)][_0x337618(0x14f)]();if(_0x59da06[_0x337618(0x176)](_0x337618(0x155)))return _0x337618(0x155);return _0x337618(0x15b);}const updateFlags=[{'name':a40_0xe7baf(0x178),'type':a40_0xe7baf(0x16f),'description':a40_0xe7baf(0x191),'default':![]},{'name':a40_0xe7baf(0x16a),'type':a40_0xe7baf(0x196),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x3f5d38){const _0x3cbc84=a40_0xe7baf;return _0x3f5d38[_0x3cbc84(0x189)](_0x3cbc84(0x16a))[_0x3cbc84(0x170)]();}async function validateUpdateFlags(_0x4bec93){const _0xe85b70=a40_0xe7baf,_0x35df06=_0x4bec93[_0xe85b70(0x14c)](_0xe85b70(0x178)),_0x3c56b0=getRequestedVersion(_0x4bec93);if(_0x35df06&&_0x3c56b0)throw CliErrors['validation'](_0xe85b70(0x192),_0xe85b70(0x154));if(_0x3c56b0&&!a40_0x47df77[_0xe85b70(0x169)](_0x3c56b0))throw CliErrors[_0xe85b70(0x179)](_0xe85b70(0x18c)+_0x3c56b0,_0xe85b70(0x167));}async function fetchNpmDistTags(){const _0x20b561=a40_0xe7baf;try{const _0x206974=await fetch(_0x20b561(0x143)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x20b561(0x171),{'signal':AbortSignal[_0x20b561(0x144)](0x2710)});if(!_0x206974['ok'])return null;const _0x11c008=await _0x206974[_0x20b561(0x158)]();if(!_0x11c008||typeof _0x11c008!==_0x20b561(0x197))return null;return Object[_0x20b561(0x147)](Object[_0x20b561(0x14b)](_0x11c008)[_0x20b561(0x177)](([,_0x3e888d])=>typeof _0x3e888d===_0x20b561(0x196)&&_0x3e888d[_0x20b561(0x170)]()['length']>0x0)['map'](([_0x2fedca,_0x55704e])=>[_0x2fedca,String(_0x55704e)[_0x20b561(0x170)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x8d3449){const _0x1fffcd=await fetchNpmDistTags();return _0x1fffcd?.[_0x8d3449]??null;}async function fetchLatestVersion(){const _0x598dd5=a40_0xe7baf;return fetchNpmDistTagVersion(_0x598dd5(0x17d));}async function resolveTargetVersion(_0x4402aa){const _0x4adb3e=a40_0xe7baf,_0x350dea=getRequestedVersion(_0x4402aa);if(_0x350dea)return{'version':_0x350dea,'source':'version'};if(_0x4402aa[_0x4adb3e(0x14c)](_0x4adb3e(0x178))){const _0x24527d=await fetchNpmDistTagVersion(_0x4adb3e(0x178));if(!_0x24527d)return null;return{'version':_0x24527d,'source':'beta'};}const _0x31dcab=await fetchLatestVersion();if(!_0x31dcab)return null;return{'version':_0x31dcab,'source':_0x4adb3e(0x17d)};}function shouldInstallTarget(_0x43f68d,_0x3dd855){const _0x31f47d=a40_0xe7baf;if(_0x3dd855[_0x31f47d(0x15c)]==='version'||_0x3dd855[_0x31f47d(0x15c)]===_0x31f47d(0x178))return!a40_0x47df77['eq'](_0x43f68d,_0x3dd855[_0x31f47d(0x16a)]);return a40_0x47df77['lt'](_0x43f68d,_0x3dd855[_0x31f47d(0x16a)]);}function getInstallPlanLabel(_0x6ce6c0,_0x2c5792){const _0x328cb8=a40_0xe7baf;switch(_0x2c5792[_0x328cb8(0x15c)]){case _0x328cb8(0x178):return _0x328cb8(0x16b)+a40_0x62de63[_0x328cb8(0x160)](_0x6ce6c0)+_0x328cb8(0x16e)+a40_0x62de63[_0x328cb8(0x145)](_0x2c5792[_0x328cb8(0x16a)]);case _0x328cb8(0x16a):return _0x328cb8(0x17c)+a40_0x62de63[_0x328cb8(0x160)](_0x6ce6c0)+_0x328cb8(0x16e)+a40_0x62de63[_0x328cb8(0x145)](_0x2c5792[_0x328cb8(0x16a)]);case _0x328cb8(0x17d):default:return _0x328cb8(0x153)+a40_0x62de63[_0x328cb8(0x160)](_0x6ce6c0)+_0x328cb8(0x16e)+a40_0x62de63[_0x328cb8(0x145)](_0x2c5792[_0x328cb8(0x16a)]);}}function repairCurrentBuiltinSkill(){const _0x2b7137=a40_0xe7baf;console[_0x2b7137(0x16c)](a40_0x62de63[_0x2b7137(0x14d)](_0x2b7137(0x14e)));const _0x6d7d24=installBuiltinSkill();if(_0x6d7d24['ok'])return console[_0x2b7137(0x16c)](a40_0x62de63[_0x2b7137(0x14d)](_0x2b7137(0x165)+_0x6d7d24[_0x2b7137(0x148)]+'\x20is\x20up\x20to\x20date.')),!![];return console['warn'](a40_0x62de63[_0x2b7137(0x160)](_0x2b7137(0x18a)+_0x6d7d24[_0x2b7137(0x163)]+']:\x20'+(_0x6d7d24[_0x2b7137(0x15f)]||'unknown'))),console[_0x2b7137(0x16c)](a40_0x62de63['gray'](_0x2b7137(0x162)+CLI_BIN_NAME+_0x2b7137(0x175))),![];}function verifyUpdatedBuiltinSkill(_0x71a7e1){const _0x56d775=a40_0xe7baf,_0x2e7951=inspectInstalledBuiltinSkillVersion(_0x71a7e1);if(_0x2e7951[_0x56d775(0x146)]===_0x56d775(0x193))return console['log'](a40_0x62de63[_0x56d775(0x14d)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x71a7e1+'\x20is\x20up\x20to\x20date.')),!![];const _0x57aa52=_0x2e7951[_0x56d775(0x148)]?_0x56d775(0x161)+_0x71a7e1+_0x56d775(0x187)+_0x2e7951[_0x56d775(0x148)]:_0x56d775(0x161)+_0x71a7e1+',\x20state\x20'+_0x2e7951[_0x56d775(0x146)];return console[_0x56d775(0x157)](a40_0x62de63[_0x56d775(0x160)](_0x56d775(0x183)+_0x57aa52)),console[_0x56d775(0x16c)](a40_0x62de63[_0x56d775(0x14d)]('\x20\x20Run\x20manually:\x20'+_0x2e7951['repairCommand'])),![];}async function execute(_0x9db0a0){const _0xe34d64=a40_0xe7baf;await validateUpdateFlags(_0x9db0a0);const _0x1b9b11=getCurrentVersion();console[_0xe34d64(0x16c)](_0xe34d64(0x150)+_0x1b9b11);const _0x8c59c2=a40_0x2ead4e(_0xe34d64(0x190))['start'](),_0x18ecd7=await resolveTargetVersion(_0x9db0a0);if(!_0x18ecd7){const _0x589b95=_0x9db0a0[_0xe34d64(0x14c)]('beta')?_0xe34d64(0x181):_0xe34d64(0x186);return _0x8c59c2[_0xe34d64(0x18f)](_0x589b95),console[_0xe34d64(0x16c)](a40_0x62de63[_0xe34d64(0x14d)](_0xe34d64(0x14a)+NPM_PACKAGE_NAME+_0xe34d64(0x16d))),{'ok':![],'message':_0x589b95};}const _0x24f579=a40_0x47df77[_0xe34d64(0x169)](VERSION),_0x55046b=a40_0x47df77[_0xe34d64(0x169)](_0x18ecd7[_0xe34d64(0x16a)]);if(!_0x24f579||!_0x55046b)return _0x8c59c2[_0xe34d64(0x18f)](_0xe34d64(0x180)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x24f579,_0x18ecd7)){const _0x475927=_0x18ecd7[_0xe34d64(0x15c)]==='version'?_0xe34d64(0x17b)+_0x18ecd7[_0xe34d64(0x16a)]+')':a40_0x47df77['gt'](_0x24f579,_0x55046b)?_0xe34d64(0x172)+_0x1b9b11+_0xe34d64(0x185)+_0x18ecd7[_0xe34d64(0x16a)]:_0xe34d64(0x159)+_0x18ecd7[_0xe34d64(0x16a)]+')';return _0x8c59c2[_0xe34d64(0x184)](_0x475927),{'ok':repairCurrentBuiltinSkill()};}_0x8c59c2[_0xe34d64(0x182)](getInstallPlanLabel(_0x1b9b11,_0x18ecd7));const _0x3c842d=detectPackageManager(),_0x42f4e9=_0x3c842d===_0xe34d64(0x15b)?resolveNpmBin(_0xe34d64(0x15b)):_0x3c842d,_0x10d1c8=a40_0x2ead4e(_0xe34d64(0x142)+_0x3c842d+_0xe34d64(0x194))[_0xe34d64(0x17a)]();try{return await execa(_0x42f4e9,['install','-g',NPM_PACKAGE_NAME+'@'+_0x18ecd7[_0xe34d64(0x16a)]],{'stdio':'pipe'}),_0x10d1c8[_0xe34d64(0x184)]('Updated\x20to\x20v'+_0x18ecd7['version']),console[_0xe34d64(0x16c)](a40_0x62de63[_0xe34d64(0x14d)](_0xe34d64(0x17f))),{'ok':verifyUpdatedBuiltinSkill(_0x18ecd7[_0xe34d64(0x16a)])};}catch(_0x562411){return _0x10d1c8[_0xe34d64(0x18f)](_0xe34d64(0x15d)),console['error'](a40_0x62de63[_0xe34d64(0x17e)]('\x20\x20'+_0x562411[_0xe34d64(0x195)])),console['log'](a40_0x62de63[_0xe34d64(0x14d)]('\x20\x20Try\x20manually:\x20'+_0x3c842d+_0xe34d64(0x18e)+NPM_PACKAGE_NAME+'@'+_0x18ecd7[_0xe34d64(0x16a)])),{'ok':![],'message':_0x562411['message']};}}export const updateDefinition={'service':a40_0xe7baf(0x173),'command':a40_0xe7baf(0x152),'description':a40_0xe7baf(0x166),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
@@ -1 +1 @@
1
- (function(_0x31a7ca,_0x292f9a){const _0x52fd6e=a41_0xbffd,_0x1049d3=_0x31a7ca();while(!![]){try{const _0x52fe3b=-parseInt(_0x52fd6e(0x179))/0x1+parseInt(_0x52fd6e(0x175))/0x2*(-parseInt(_0x52fd6e(0x17b))/0x3)+parseInt(_0x52fd6e(0x17a))/0x4+parseInt(_0x52fd6e(0x174))/0x5*(-parseInt(_0x52fd6e(0x177))/0x6)+-parseInt(_0x52fd6e(0x176))/0x7*(parseInt(_0x52fd6e(0x17c))/0x8)+-parseInt(_0x52fd6e(0x173))/0x9+parseInt(_0x52fd6e(0x178))/0xa;if(_0x52fe3b===_0x292f9a)break;else _0x1049d3['push'](_0x1049d3['shift']());}catch(_0x39f0df){_0x1049d3['push'](_0x1049d3['shift']());}}}(a41_0x2d6a,0x5f702));import{codegenSdk}from'../../commands/codegen/sdk.js';function a41_0x2d6a(){const _0x43a50e=['3380607HKKVpv','905zwFdOM','471738kOvWTL','62041FsnSue','5412qYyIRI','23071980jAhPRF','565380iCDEyU','269668VrWItL','6zVSDBI','368DqgOqo'];a41_0x2d6a=function(){return _0x43a50e;};return a41_0x2d6a();}function a41_0xbffd(_0x3b7221,_0x4b115e){_0x3b7221=_0x3b7221-0x173;const _0x2d6abd=a41_0x2d6a();let _0xbffd72=_0x2d6abd[_0x3b7221];return _0xbffd72;}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
1
+ (function(_0x2903b4,_0x10103f){const _0x3b3e17=a41_0x4da3,_0x5a62d1=_0x2903b4();while(!![]){try{const _0x4372d9=parseInt(_0x3b3e17(0x123))/0x1+parseInt(_0x3b3e17(0x128))/0x2*(-parseInt(_0x3b3e17(0x126))/0x3)+-parseInt(_0x3b3e17(0x12a))/0x4*(-parseInt(_0x3b3e17(0x12c))/0x5)+-parseInt(_0x3b3e17(0x124))/0x6+-parseInt(_0x3b3e17(0x127))/0x7+-parseInt(_0x3b3e17(0x12b))/0x8*(parseInt(_0x3b3e17(0x125))/0x9)+parseInt(_0x3b3e17(0x129))/0xa;if(_0x4372d9===_0x10103f)break;else _0x5a62d1['push'](_0x5a62d1['shift']());}catch(_0x4246dc){_0x5a62d1['push'](_0x5a62d1['shift']());}}}(a41_0x280a,0xd0a42));function a41_0x4da3(_0x45d8d4,_0x4f7584){_0x45d8d4=_0x45d8d4-0x123;const _0x280a2a=a41_0x280a();let _0x4da379=_0x280a2a[_0x45d8d4];return _0x4da379;}function a41_0x280a(){const _0x30b602=['682884cVkshd','8718948bWnHGl','4rlVSjZ','32231040sxFQgs','241996atVIJb','2723944IXsRMN','5jpYiuj','14603JbbyQU','2413794Xucdpq','9hHKgeL'];a41_0x280a=function(){return _0x30b602;};return a41_0x280a();}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
@@ -1 +1 @@
1
- const a42_0x444cc8=a42_0x10ee;function a42_0x10ee(_0x375e31,_0x40deab){_0x375e31=_0x375e31-0xdf;const _0xdb59f4=a42_0xdb59();let _0x10eec6=_0xdb59f4[_0x375e31];return _0x10eec6;}(function(_0x4f91eb,_0x1fb16a){const _0x4e4db1=a42_0x10ee,_0x800333=_0x4f91eb();while(!![]){try{const _0x33f423=-parseInt(_0x4e4db1(0xe7))/0x1*(parseInt(_0x4e4db1(0xe6))/0x2)+parseInt(_0x4e4db1(0xef))/0x3*(-parseInt(_0x4e4db1(0xf2))/0x4)+-parseInt(_0x4e4db1(0xeb))/0x5*(parseInt(_0x4e4db1(0xf4))/0x6)+parseInt(_0x4e4db1(0xed))/0x7+parseInt(_0x4e4db1(0xdf))/0x8+-parseInt(_0x4e4db1(0xe9))/0x9+parseInt(_0x4e4db1(0xea))/0xa;if(_0x33f423===_0x1fb16a)break;else _0x800333['push'](_0x800333['shift']());}catch(_0x257d24){_0x800333['push'](_0x800333['shift']());}}}(a42_0xdb59,0xa2403));function a42_0xdb59(){const _0x4dfe7f=['3893001DVAwIN','skip-imports','48UGsfqQ','Omit\x20import\x20statements\x20from\x20generated\x20code','str','142656XCFSIH','sdk','318gpNFtz','name','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','read','boolean','10077712CnSnrJ','operation','code','codegen','alias','appCode','string','96SSkLRR','16314BKLrOf','tableName','8563185ObHvll','17073620LdCShH','52215OOnzgR','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation'];a42_0xdb59=function(){return _0x4dfe7f;};return a42_0xdb59();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x444cc8(0xe2),'command':a42_0x444cc8(0xf3),'description':a42_0x444cc8(0xec),'risk':a42_0x444cc8(0xf7),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x444cc8(0xe3),'type':a42_0x444cc8(0xe5),'description':a42_0x444cc8(0xf6)},{'name':'operation','type':a42_0x444cc8(0xe5),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0x444cc8(0xee),'type':a42_0x444cc8(0xf8),'description':a42_0x444cc8(0xf0)}],async 'execute'(_0x49e349){const _0xfcc054=a42_0x444cc8,{dataset:_0x5e0301,operation:_0x41fe3e}=await getOperationDetail(_0x49e349[_0xfcc054(0xe4)],_0x49e349[_0xfcc054(0xf1)](_0xfcc054(0xe1)),_0x49e349[_0xfcc054(0xf1)](_0xfcc054(0xe0))),_0x311026=generateSdkCode(_0x5e0301,_0x41fe3e,{'includeImports':!_0x49e349['bool'](_0xfcc054(0xee))});return{'ok':!![],'data':{'dataset':{'name':_0x5e0301[_0xfcc054(0xf5)],'code':_0x5e0301['code'],'tableName':_0x5e0301[_0xfcc054(0xe8)]},'operation':_0x49e349[_0xfcc054(0xf1)](_0xfcc054(0xe0)),'code':_0x311026}};}};
1
+ const a42_0x28f355=a42_0x3dcf;(function(_0x59284d,_0x46426a){const _0x254d0d=a42_0x3dcf,_0x22e14e=_0x59284d();while(!![]){try{const _0x3e8742=parseInt(_0x254d0d(0x19a))/0x1+-parseInt(_0x254d0d(0x18c))/0x2+parseInt(_0x254d0d(0x188))/0x3*(-parseInt(_0x254d0d(0x1a0))/0x4)+-parseInt(_0x254d0d(0x19b))/0x5*(parseInt(_0x254d0d(0x18a))/0x6)+parseInt(_0x254d0d(0x18e))/0x7*(-parseInt(_0x254d0d(0x186))/0x8)+-parseInt(_0x254d0d(0x199))/0x9*(parseInt(_0x254d0d(0x1a1))/0xa)+-parseInt(_0x254d0d(0x193))/0xb*(-parseInt(_0x254d0d(0x187))/0xc);if(_0x3e8742===_0x46426a)break;else _0x22e14e['push'](_0x22e14e['shift']());}catch(_0x3e9795){_0x22e14e['push'](_0x22e14e['shift']());}}}(a42_0x2c41,0xad313));function a42_0x3dcf(_0xc7137d,_0x1fddb1){_0xc7137d=_0xc7137d-0x185;const _0x2c4174=a42_0x2c41();let _0x3dcfec=_0x2c4174[_0xc7137d];return _0x3dcfec;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x2c41(){const _0x2e81de=['codegen','name','120gwnJDm','2785356AsRfGO','305367sEWXjD','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','4310832pmmQYw','skip-imports','236600zDZhwk','str','524111wZUAja','read','tableName','string','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','176jZiyTU','operation','sdk','bool','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','boolean','8027991BDquml','356398pMuxRo','5dyvAmP','code','alias','Omit\x20import\x20statements\x20from\x20generated\x20code','appCode','20KJfztS','10whBmhT'];a42_0x2c41=function(){return _0x2e81de;};return a42_0x2c41();}export const codegenSdk={'service':a42_0x28f355(0x1a2),'command':a42_0x28f355(0x195),'description':a42_0x28f355(0x192),'risk':a42_0x28f355(0x18f),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x28f355(0x19d),'type':a42_0x28f355(0x191),'description':a42_0x28f355(0x189)},{'name':'operation','type':a42_0x28f355(0x191),'required':!![],'description':a42_0x28f355(0x197)},{'name':a42_0x28f355(0x18b),'type':a42_0x28f355(0x198),'description':a42_0x28f355(0x19e)}],async 'execute'(_0x4dddbd){const _0x420f5d=a42_0x28f355,{dataset:_0x87311c,operation:_0x5d71c9}=await getOperationDetail(_0x4dddbd[_0x420f5d(0x19f)],_0x4dddbd[_0x420f5d(0x18d)](_0x420f5d(0x19c)),_0x4dddbd['str'](_0x420f5d(0x194))),_0x126274=generateSdkCode(_0x87311c,_0x5d71c9,{'includeImports':!_0x4dddbd[_0x420f5d(0x196)](_0x420f5d(0x18b))});return{'ok':!![],'data':{'dataset':{'name':_0x87311c[_0x420f5d(0x185)],'code':_0x87311c[_0x420f5d(0x19c)],'tableName':_0x87311c[_0x420f5d(0x190)]},'operation':_0x4dddbd['str']('operation'),'code':_0x126274}};}};
@@ -1 +1 @@
1
- function a43_0x3b3e(_0x3dbbdd,_0x240f49){_0x3dbbdd=_0x3dbbdd-0x16f;const _0x28735f=a43_0x2873();let _0x3b3e42=_0x28735f[_0x3dbbdd];return _0x3b3e42;}const a43_0x29e6d4=a43_0x3b3e;(function(_0x558dd3,_0x538502){const _0x467001=a43_0x3b3e,_0x17a7d4=_0x558dd3();while(!![]){try{const _0x420804=parseInt(_0x467001(0x181))/0x1*(-parseInt(_0x467001(0x177))/0x2)+-parseInt(_0x467001(0x17e))/0x3+-parseInt(_0x467001(0x173))/0x4*(-parseInt(_0x467001(0x184))/0x5)+-parseInt(_0x467001(0x17b))/0x6*(parseInt(_0x467001(0x17c))/0x7)+-parseInt(_0x467001(0x17d))/0x8+parseInt(_0x467001(0x17a))/0x9*(-parseInt(_0x467001(0x171))/0xa)+parseInt(_0x467001(0x178))/0xb;if(_0x420804===_0x538502)break;else _0x17a7d4['push'](_0x17a7d4['shift']());}catch(_0x3b7521){_0x17a7d4['push'](_0x17a7d4['shift']());}}}(a43_0x2873,0x338c0));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x2873(){const _0x5baff7=['sdk','codegen','bool','appCode','no-imports','10lmTnTz','sqlCode','8vXHVVS','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','string','str','118DPcKEP','9785809MdZXjW','boolean','267885GdGCRO','115764tdzNKV','147ZCLgDK','2193280FZyVxW','242052pVYIjW','sqlName','sqlcode','536fPlHZR','bff','target','357310kIdXVy','Omit\x20import\x20statements\x20from\x20generated\x20code'];a43_0x2873=function(){return _0x5baff7;};return a43_0x2873();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x29e6d4(0x187),'command':'sql','description':a43_0x29e6d4(0x174),'risk':'read','flags':[SQLCODE_FLAG,{'name':a43_0x29e6d4(0x183),'type':a43_0x29e6d4(0x175),'description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x29e6d4(0x186),'enum':[a43_0x29e6d4(0x186),a43_0x29e6d4(0x182)]},{'name':a43_0x29e6d4(0x170),'type':a43_0x29e6d4(0x179),'description':a43_0x29e6d4(0x185)}],async 'execute'(_0x595d47){const _0x143df6=a43_0x29e6d4,_0x139b02=await getSqlQueryInfo(_0x595d47[_0x143df6(0x16f)],_0x595d47['str'](_0x143df6(0x180))),_0x1375fe=_0x595d47[_0x143df6(0x176)]('target')||_0x143df6(0x186),_0x427f9a=generateSqlCodeTemplate(_0x139b02,{'target':_0x1375fe,'includeImports':!_0x595d47[_0x143df6(0x188)](_0x143df6(0x170))});return{'ok':!![],'data':{'sqlCode':_0x139b02[_0x143df6(0x172)],'sqlName':_0x139b02[_0x143df6(0x17f)],'target':_0x1375fe,'code':_0x427f9a}};}};
1
+ const a43_0x4d5389=a43_0x21f8;(function(_0x3eccd3,_0x49ba41){const _0x2c3649=a43_0x21f8,_0x32b1bc=_0x3eccd3();while(!![]){try{const _0x167837=-parseInt(_0x2c3649(0xb5))/0x1+-parseInt(_0x2c3649(0xbc))/0x2+-parseInt(_0x2c3649(0xab))/0x3+parseInt(_0x2c3649(0xb2))/0x4+-parseInt(_0x2c3649(0xac))/0x5*(-parseInt(_0x2c3649(0xb0))/0x6)+parseInt(_0x2c3649(0xad))/0x7+parseInt(_0x2c3649(0xb8))/0x8;if(_0x167837===_0x49ba41)break;else _0x32b1bc['push'](_0x32b1bc['shift']());}catch(_0x38e03f){_0x32b1bc['push'](_0x32b1bc['shift']());}}}(a43_0x5eea,0x5db42));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x21f8(_0x151ffb,_0xd5ed29){_0x151ffb=_0x151ffb-0xa9;const _0x5eea0d=a43_0x5eea();let _0x21f80d=_0x5eea0d[_0x151ffb];return _0x21f80d;}function a43_0x5eea(){const _0x2740ef=['821862qXdwOl','5efyPeF','2456587pNAOgw','no-imports','bool','1508958epjYMg','sqlcode','2571960BMtxbd','sqlCode','sdk','531951yDxssT','str','codegen','2187840UumewU','sql','target','Omit\x20import\x20statements\x20from\x20generated\x20code','658378nSWMQu','read','sqlName'];a43_0x5eea=function(){return _0x2740ef;};return a43_0x5eea();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x4d5389(0xb7),'command':a43_0x4d5389(0xb9),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a43_0x4d5389(0xa9),'flags':[SQLCODE_FLAG,{'name':a43_0x4d5389(0xba),'type':'string','description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x4d5389(0xb4),'enum':[a43_0x4d5389(0xb4),'bff']},{'name':a43_0x4d5389(0xae),'type':'boolean','description':a43_0x4d5389(0xbb)}],async 'execute'(_0x5d4a14){const _0x5ddf1=a43_0x4d5389,_0x4bbc12=await getSqlQueryInfo(_0x5d4a14['appCode'],_0x5d4a14[_0x5ddf1(0xb6)](_0x5ddf1(0xb1))),_0x170752=_0x5d4a14[_0x5ddf1(0xb6)]('target')||_0x5ddf1(0xb4),_0x3fef13=generateSqlCodeTemplate(_0x4bbc12,{'target':_0x170752,'includeImports':!_0x5d4a14[_0x5ddf1(0xaf)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x4bbc12[_0x5ddf1(0xb3)],'sqlName':_0x4bbc12[_0x5ddf1(0xaa)],'target':_0x170752,'code':_0x3fef13}};}};
@@ -1 +1 @@
1
- (function(_0x44f4b8,_0x3957aa){const _0x13631c=a44_0x1883,_0x4e3138=_0x44f4b8();while(!![]){try{const _0x5a5bff=parseInt(_0x13631c(0x1a5))/0x1*(parseInt(_0x13631c(0x1ab))/0x2)+parseInt(_0x13631c(0x1b4))/0x3+parseInt(_0x13631c(0x1a3))/0x4*(-parseInt(_0x13631c(0x1a4))/0x5)+parseInt(_0x13631c(0x1ad))/0x6+parseInt(_0x13631c(0x1ba))/0x7*(parseInt(_0x13631c(0x1bb))/0x8)+parseInt(_0x13631c(0x19f))/0x9+-parseInt(_0x13631c(0x1af))/0xa;if(_0x5a5bff===_0x3957aa)break;else _0x4e3138['push'](_0x4e3138['shift']());}catch(_0x357153){_0x4e3138['push'](_0x4e3138['shift']());}}}(a44_0x26e9,0x735d8));import{CliErrors}from'../../errors.js';function a44_0x26e9(){const _0x383d45=['17HBulqZ','object','global','\x20Default\x20app\x20is\x20\x22','apps','Use\x20global\x20config\x20scope','7634cVxRLq','\x20config.','1020936nUsgkf','\x20Default\x20app\x20changed\x20to\x20\x22','7161820nyjFYM','string','keys','projectConfig','project','2322726iAfuSp','Missing\x20app\x20name.','args','\x20Note:\x20app\x20\x22','both','str','28ZAEqVW','1580648AVmMmf','\x20<name>\x20--appcode\x20<code>','length','\x22\x20not\x20found.','Removed\x20app\x20\x22','appcode','defaultApp','\x20Remaining\x20app\x20\x22','globalConfig','\x22\x20is\x20selected\x20automatically.','validation','flagMissing','App\x20\x22','777249vJCNeY','boolean','trim','Usage:\x20','35304LMbtIo','395vKQrHz'];a44_0x26e9=function(){return _0x383d45;};return a44_0x26e9();}function a44_0x1883(_0x1fcddc,_0x3f5e5e){_0x1fcddc=_0x1fcddc-0x195;const _0x26e927=a44_0x26e9();let _0x18835a=_0x26e927[_0x1fcddc];return _0x18835a;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x3d8955=a44_0x1883;return[{'name':_0x3d8955(0x197),'type':_0x3d8955(0x1b0),'description':'App\x20code','required':!![]},{'name':'global','type':_0x3d8955(0x1a0),'description':_0x3d8955(0x1aa),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x4eb8ff=a44_0x1883;return[{'name':_0x4eb8ff(0x1a7),'type':'boolean','description':_0x4eb8ff(0x1aa),'default':![]}];}export async function validateAppName(_0x12569e,_0x2fe59b){const _0x1edbc5=a44_0x1883,_0x2f6ff4=_0x12569e['args'][0x0]?.[_0x1edbc5(0x1a1)]();if(!_0x2f6ff4)throw CliErrors[_0x1edbc5(0x19c)](_0x1edbc5(0x1b5),_0x1edbc5(0x1a2)+CLI_BIN_NAME+'\x20'+_0x2fe59b+'\x20<name>');}export async function runAppAdd(_0x3a06ae,_0x145de9){const _0x5e6320=a44_0x1883,_0xd1f7c8=_0x3a06ae['args'][0x0]?.[_0x5e6320(0x1a1)]();if(!_0xd1f7c8)throw CliErrors[_0x5e6320(0x19c)]('Missing\x20app\x20name.',_0x5e6320(0x1a2)+CLI_BIN_NAME+'\x20'+_0x145de9+_0x5e6320(0x1bc));const _0x399c55=_0x3a06ae[_0x5e6320(0x1b9)]('appcode');if(!_0x399c55)throw CliErrors[_0x5e6320(0x19d)]('appcode',_0x5e6320(0x1a2)+CLI_BIN_NAME+'\x20'+_0x145de9+_0x5e6320(0x1bc));const _0x1c1384={'global':_0x3a06ae['bool'](_0x5e6320(0x1a7))},_0x5959f6=readConfig(_0x1c1384);if(!_0x5959f6[_0x5e6320(0x1a9)])_0x5959f6['apps']={};const _0x3c9424={'appcode':_0x399c55,...collectAppProfileOverrides(_0x5a2d81=>_0x3a06ae[_0x5e6320(0x1b9)](_0x5a2d81))},_0xf4097b=_0x5959f6[_0x5e6320(0x1a9)],_0x5cc6fb=Object[_0x5e6320(0x1b1)](_0xf4097b),_0x26879d=typeof _0x5959f6[_0x5e6320(0x198)]==='string'&&_0xf4097b[_0x5959f6[_0x5e6320(0x198)]]?_0x5959f6['defaultApp']:_0x5cc6fb[_0x5e6320(0x1bd)]===0x1?_0x5cc6fb[0x0]:undefined,_0x37f6fd=!!_0xf4097b[_0xd1f7c8];_0xf4097b[_0xd1f7c8]=_0x3c9424;const _0x4a0db3=normalizeStoredDefaultApp(_0x5959f6,_0x26879d);writeConfig(_0x5959f6,_0x1c1384);const _0x14b617=!_0x37f6fd&&_0x4a0db3?_0x5e6320(0x1a8)+_0x4a0db3+'\x22.':'',_0x2d6551=(_0x37f6fd?'Updated':'Added')+'\x20app\x20\x22'+_0xd1f7c8+'\x22\x20(appcode:\x20'+_0x399c55+')'+scopeLabel(_0x1c1384)+'.'+_0x14b617;return{'ok':!![],'message':_0x2d6551};}export async function runAppRemove(_0x52228f,_0x52c20f){const _0xb12172=a44_0x1883,_0x262a6c=_0x52228f[_0xb12172(0x1b6)][0x0]?.[_0xb12172(0x1a1)]();if(!_0x262a6c)throw CliErrors[_0xb12172(0x19c)](_0xb12172(0x1b5),_0xb12172(0x1a2)+CLI_BIN_NAME+'\x20'+_0x52c20f+'\x20<name>\x20[--global]');const _0x25dccd=_0x52228f['bool']('global'),{config:_0x3a940c,layers:_0xb3480d}=readRawConfigWithLayers(),_0x4850c5=_0x3a940c[_0xb12172(0x1a9)]??{};if(!_0x4850c5[_0x262a6c])throw CliErrors[_0xb12172(0x19c)](_0xb12172(0x19e)+_0x262a6c+_0xb12172(0x195));const _0x1bec60=_0xb3480d['globalConfig']['apps']&&typeof _0xb3480d[_0xb12172(0x19a)][_0xb12172(0x1a9)]==='object'?_0xb3480d[_0xb12172(0x19a)][_0xb12172(0x1a9)]:{},_0x1e36d5=_0xb3480d[_0xb12172(0x1b2)]['apps']&&typeof _0xb3480d[_0xb12172(0x1b2)]['apps']===_0xb12172(0x1a6)?_0xb3480d['projectConfig'][_0xb12172(0x1a9)]:{},_0x3826c2=appDefinedIn(_0x262a6c,_0x1bec60,_0x1e36d5),_0xf72ca6=resolveAppScopeForWrite(_0x262a6c,_0x25dccd,_0xb3480d),_0x407795={'global':_0xf72ca6==='global'},_0x5d4082=readConfig(_0x407795),_0x2168c7=_0x5d4082['apps'];if(!_0x2168c7||!_0x2168c7[_0x262a6c])throw CliErrors[_0xb12172(0x19c)](_0xb12172(0x19e)+_0x262a6c+_0xb12172(0x195));delete _0x2168c7[_0x262a6c];let _0x323f7e='';const _0x49ed07=typeof _0x5d4082[_0xb12172(0x198)]===_0xb12172(0x1b0)?_0x5d4082[_0xb12172(0x198)]:undefined,_0x4afcb8=Object['keys'](_0x2168c7),_0x5972f1=_0x49ed07===_0x262a6c?_0x4afcb8[0x0]:_0x49ed07,_0x18afc9=normalizeStoredDefaultApp(_0x5d4082,_0x5972f1);if(_0x49ed07===_0x262a6c&&_0x4afcb8[_0xb12172(0x1bd)]===0x1)_0x323f7e=_0xb12172(0x199)+_0x4afcb8[0x0]+_0xb12172(0x19b);else _0x49ed07===_0x262a6c&&_0x18afc9&&(_0x323f7e=_0xb12172(0x1ae)+_0x18afc9+'\x22.');Object[_0xb12172(0x1b1)](_0x2168c7)[_0xb12172(0x1bd)]===0x0&&(delete _0x5d4082[_0xb12172(0x1a9)],delete _0x5d4082[_0xb12172(0x198)]);writeConfig(_0x5d4082,_0x407795);const _0x47714f=_0x3826c2===_0xb12172(0x1b8)?_0xb12172(0x1b7)+_0x262a6c+'\x22\x20still\x20defined\x20in\x20'+(_0xf72ca6===_0xb12172(0x1b3)?_0xb12172(0x1a7):'project')+_0xb12172(0x1ac):'';return{'ok':!![],'message':_0xb12172(0x196)+_0x262a6c+'\x22'+scopeLabel(_0x407795)+'.'+_0x323f7e+_0x47714f};}
1
+ function a44_0x3abb(_0x30d9bd,_0x472664){_0x30d9bd=_0x30d9bd-0x1ed;const _0x1bf1f0=a44_0x1bf1();let _0x3abbd6=_0x1bf1f0[_0x30d9bd];return _0x3abbd6;}(function(_0x3b4173,_0x2967fb){const _0x3f13c2=a44_0x3abb,_0x283365=_0x3b4173();while(!![]){try{const _0x28313b=-parseInt(_0x3f13c2(0x215))/0x1+parseInt(_0x3f13c2(0x20d))/0x2+parseInt(_0x3f13c2(0x1ed))/0x3*(parseInt(_0x3f13c2(0x211))/0x4)+-parseInt(_0x3f13c2(0x20f))/0x5+-parseInt(_0x3f13c2(0x1ef))/0x6*(-parseInt(_0x3f13c2(0x213))/0x7)+-parseInt(_0x3f13c2(0x201))/0x8+parseInt(_0x3f13c2(0x208))/0x9;if(_0x28313b===_0x2967fb)break;else _0x283365['push'](_0x283365['shift']());}catch(_0xfec0bd){_0x283365['push'](_0x283365['shift']());}}}(a44_0x1bf1,0x4944e));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x3c0449=a44_0x3abb;return[{'name':_0x3c0449(0x1ff),'type':_0x3c0449(0x20b),'description':_0x3c0449(0x204),'required':!![]},{'name':'global','type':_0x3c0449(0x206),'description':_0x3c0449(0x1f0),'default':![]},...getAppProfileFlagDefs()];}function a44_0x1bf1(){const _0x8cd931=['\x20config.','\x20<name>\x20[--global]','validation','appcode','apps','2204000nfHSDa','Usage:\x20','\x22\x20still\x20defined\x20in\x20','App\x20code','\x20Note:\x20app\x20\x22','boolean','str','8191008oVxwuR','keys','project','string','globalConfig','777324leDSgN','App\x20\x22','2895525xwCKBQ','Updated','4yYEJNk','bool','11494iCESPs','trim','553256CWnZzi','\x20<name>','\x20<name>\x20--appcode\x20<code>','defaultApp','args','153723DEhGpV','Added','1308bhfhMe','Use\x20global\x20config\x20scope','Removed\x20app\x20\x22','\x22\x20not\x20found.','\x22\x20(appcode:\x20','projectConfig','\x20app\x20\x22','global','Missing\x20app\x20name.','\x20Default\x20app\x20changed\x20to\x20\x22','length','object','\x20Default\x20app\x20is\x20\x22'];a44_0x1bf1=function(){return _0x8cd931;};return a44_0x1bf1();}export function buildAppRemoveFlags(){const _0x34a9ed=a44_0x3abb;return[{'name':_0x34a9ed(0x1f6),'type':_0x34a9ed(0x206),'description':_0x34a9ed(0x1f0),'default':![]}];}export async function validateAppName(_0x20456c,_0x1672d7){const _0x438d77=a44_0x3abb,_0x104110=_0x20456c[_0x438d77(0x219)][0x0]?.[_0x438d77(0x214)]();if(!_0x104110)throw CliErrors[_0x438d77(0x1fe)](_0x438d77(0x1f7),_0x438d77(0x202)+CLI_BIN_NAME+'\x20'+_0x1672d7+_0x438d77(0x216));}export async function runAppAdd(_0x4715d4,_0x285d47){const _0x330f98=a44_0x3abb,_0x234963=_0x4715d4[_0x330f98(0x219)][0x0]?.['trim']();if(!_0x234963)throw CliErrors['validation'](_0x330f98(0x1f7),_0x330f98(0x202)+CLI_BIN_NAME+'\x20'+_0x285d47+_0x330f98(0x217));const _0x50e5a3=_0x4715d4[_0x330f98(0x207)](_0x330f98(0x1ff));if(!_0x50e5a3)throw CliErrors['flagMissing']('appcode',_0x330f98(0x202)+CLI_BIN_NAME+'\x20'+_0x285d47+_0x330f98(0x217));const _0x34e38a={'global':_0x4715d4[_0x330f98(0x212)]('global')},_0x57feeb=readConfig(_0x34e38a);if(!_0x57feeb[_0x330f98(0x200)])_0x57feeb[_0x330f98(0x200)]={};const _0x26735c={'appcode':_0x50e5a3,...collectAppProfileOverrides(_0x15e803=>_0x4715d4[_0x330f98(0x207)](_0x15e803))},_0x19fbe0=_0x57feeb[_0x330f98(0x200)],_0x10264c=Object[_0x330f98(0x209)](_0x19fbe0),_0xcd2b12=typeof _0x57feeb[_0x330f98(0x218)]==='string'&&_0x19fbe0[_0x57feeb[_0x330f98(0x218)]]?_0x57feeb[_0x330f98(0x218)]:_0x10264c[_0x330f98(0x1f9)]===0x1?_0x10264c[0x0]:undefined,_0x1b7128=!!_0x19fbe0[_0x234963];_0x19fbe0[_0x234963]=_0x26735c;const _0x258c2a=normalizeStoredDefaultApp(_0x57feeb,_0xcd2b12);writeConfig(_0x57feeb,_0x34e38a);const _0xa0db40=!_0x1b7128&&_0x258c2a?_0x330f98(0x1fb)+_0x258c2a+'\x22.':'',_0x5e68a6=(_0x1b7128?_0x330f98(0x210):_0x330f98(0x1ee))+_0x330f98(0x1f5)+_0x234963+_0x330f98(0x1f3)+_0x50e5a3+')'+scopeLabel(_0x34e38a)+'.'+_0xa0db40;return{'ok':!![],'message':_0x5e68a6};}export async function runAppRemove(_0xaf56b0,_0x173c13){const _0x5d90fa=a44_0x3abb,_0x44fb4f=_0xaf56b0[_0x5d90fa(0x219)][0x0]?.[_0x5d90fa(0x214)]();if(!_0x44fb4f)throw CliErrors[_0x5d90fa(0x1fe)](_0x5d90fa(0x1f7),_0x5d90fa(0x202)+CLI_BIN_NAME+'\x20'+_0x173c13+_0x5d90fa(0x1fd));const _0x319d49=_0xaf56b0[_0x5d90fa(0x212)]('global'),{config:_0x4a1837,layers:_0x3bdba5}=readRawConfigWithLayers(),_0x58eff7=_0x4a1837[_0x5d90fa(0x200)]??{};if(!_0x58eff7[_0x44fb4f])throw CliErrors['validation'](_0x5d90fa(0x20e)+_0x44fb4f+_0x5d90fa(0x1f2));const _0x2d9c04=_0x3bdba5[_0x5d90fa(0x20c)]['apps']&&typeof _0x3bdba5[_0x5d90fa(0x20c)]['apps']==='object'?_0x3bdba5[_0x5d90fa(0x20c)][_0x5d90fa(0x200)]:{},_0x3d3a5e=_0x3bdba5[_0x5d90fa(0x1f4)]['apps']&&typeof _0x3bdba5['projectConfig'][_0x5d90fa(0x200)]===_0x5d90fa(0x1fa)?_0x3bdba5[_0x5d90fa(0x1f4)][_0x5d90fa(0x200)]:{},_0x51ecf9=appDefinedIn(_0x44fb4f,_0x2d9c04,_0x3d3a5e),_0x4cedcf=resolveAppScopeForWrite(_0x44fb4f,_0x319d49,_0x3bdba5),_0x1952dc={'global':_0x4cedcf==='global'},_0x2e18ff=readConfig(_0x1952dc),_0x2fd863=_0x2e18ff[_0x5d90fa(0x200)];if(!_0x2fd863||!_0x2fd863[_0x44fb4f])throw CliErrors[_0x5d90fa(0x1fe)]('App\x20\x22'+_0x44fb4f+_0x5d90fa(0x1f2));delete _0x2fd863[_0x44fb4f];let _0xa3c404='';const _0x85aedc=typeof _0x2e18ff['defaultApp']===_0x5d90fa(0x20b)?_0x2e18ff['defaultApp']:undefined,_0x37af81=Object[_0x5d90fa(0x209)](_0x2fd863),_0x444add=_0x85aedc===_0x44fb4f?_0x37af81[0x0]:_0x85aedc,_0x4739c1=normalizeStoredDefaultApp(_0x2e18ff,_0x444add);if(_0x85aedc===_0x44fb4f&&_0x37af81[_0x5d90fa(0x1f9)]===0x1)_0xa3c404='\x20Remaining\x20app\x20\x22'+_0x37af81[0x0]+'\x22\x20is\x20selected\x20automatically.';else _0x85aedc===_0x44fb4f&&_0x4739c1&&(_0xa3c404=_0x5d90fa(0x1f8)+_0x4739c1+'\x22.');Object[_0x5d90fa(0x209)](_0x2fd863)[_0x5d90fa(0x1f9)]===0x0&&(delete _0x2e18ff['apps'],delete _0x2e18ff[_0x5d90fa(0x218)]);writeConfig(_0x2e18ff,_0x1952dc);const _0xce1d96=_0x51ecf9==='both'?_0x5d90fa(0x205)+_0x44fb4f+_0x5d90fa(0x203)+(_0x4cedcf==='project'?_0x5d90fa(0x1f6):_0x5d90fa(0x20a))+_0x5d90fa(0x1fc):'';return{'ok':!![],'message':_0x5d90fa(0x1f1)+_0x44fb4f+'\x22'+scopeLabel(_0x1952dc)+'.'+_0xa3c404+_0xce1d96};}
@@ -1 +1 @@
1
- (function(_0xc020b0,_0x1e588c){const _0x4bb58f=a45_0x5ded,_0x3dba7e=_0xc020b0();while(!![]){try{const _0x4e7d5b=parseInt(_0x4bb58f(0x9e))/0x1+parseInt(_0x4bb58f(0x98))/0x2*(-parseInt(_0x4bb58f(0x99))/0x3)+parseInt(_0x4bb58f(0x8c))/0x4*(-parseInt(_0x4bb58f(0x96))/0x5)+parseInt(_0x4bb58f(0x87))/0x6+parseInt(_0x4bb58f(0x84))/0x7+parseInt(_0x4bb58f(0x82))/0x8*(parseInt(_0x4bb58f(0x9d))/0x9)+-parseInt(_0x4bb58f(0x9a))/0xa*(parseInt(_0x4bb58f(0x8e))/0xb);if(_0x4e7d5b===_0x1e588c)break;else _0x3dba7e['push'](_0x3dba7e['shift']());}catch(_0x49422c){_0x3dba7e['push'](_0x3dba7e['shift']());}}}(a45_0x44f3,0x4d59d));function a45_0x5ded(_0xf12c6,_0x205af3){_0xf12c6=_0xf12c6-0x7a;const _0x44f304=a45_0x44f3();let _0x5dede0=_0x44f304[_0xf12c6];return _0x5dede0;}import{input,checkbox,select}from'@inquirer/prompts';import a45_0xec6f5c from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';function a45_0x44f3(){const _0x126926=['4077kzAuFT','428864BLpAux','No\x20available\x20apps\x20found.','manual','(Skip;\x20configure\x20later)','App\x20Code:','Found\x20','✎\x20Enter\x20appcode\x20manually','\x0aNo\x20available\x20apps\x20found.','skip','Select\x20the\x20app\x20to\x20bind:','264alfaDG','message','2972879AUyucr','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','\x20\x20(','1131396LQrvQM','cyan','appCode','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','376520FpvcEj','gray','55HMLkFC','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','map','valid','length','appName','find','custom','10NdItVv','yellow','6alWlQR','349332avftLs','405310KCsutg','Fetching\x20available\x20apps...','trim'];a45_0x44f3=function(){return _0x126926;};return a45_0x44f3();}import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x1d2942=a45_0x5ded,_0x56699f=await input({'message':_0x1d2942(0x7c),'validate':_0x47a79f=>{const _0x2c8bb0=_0x1d2942,_0x4cb0fe=validateAppcode(_0x47a79f[_0x2c8bb0(0x9c)]());return _0x4cb0fe[_0x2c8bb0(0x91)]||_0x4cb0fe[_0x2c8bb0(0x83)]||'Invalid\x20App\x20Code';}});return _0x56699f[_0x1d2942(0x9c)]();}export async function promptAppSelection(_0x3d562a){const _0x3448e1=a45_0x5ded,_0x21b3cb=[{'name':a45_0xec6f5c[_0x3448e1(0x97)]('✎\x20Enter\x20appcode\x20manually'),'value':-0x1},..._0x3d562a['map']((_0x2bc006,_0x24582e)=>({'name':_0x2bc006[_0x3448e1(0x93)]+'\x20\x20'+a45_0xec6f5c['gray']('('+_0x2bc006[_0x3448e1(0x89)]+')'),'value':_0x24582e}))],_0x5cb97a=await checkbox({'message':_0x3448e1(0x7d)+a45_0xec6f5c[_0x3448e1(0x88)](_0x3d562a[_0x3448e1(0x92)])+'\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','choices':_0x21b3cb,'loop':![]});if(_0x5cb97a['includes'](-0x1))return _0x3448e1(0x95);if(_0x5cb97a[_0x3448e1(0x92)]===0x0)return _0x3448e1(0x95);return _0x5cb97a[_0x3448e1(0x90)](_0x3ad000=>_0x3d562a[_0x3ad000]);}export async function promptSingleAppSelection(_0x1010f7){const _0x4533bc=a45_0x5ded,_0x38365f=[{'name':a45_0xec6f5c[_0x4533bc(0x8d)](_0x4533bc(0x8b)),'value':'skip'},{'name':a45_0xec6f5c[_0x4533bc(0x97)](_0x4533bc(0x7e)),'value':_0x4533bc(0x95)},..._0x1010f7['map'](_0x18aa2e=>({'name':_0x18aa2e['appName']+'\x20\x20'+a45_0xec6f5c[_0x4533bc(0x8d)]('('+_0x18aa2e['appCode']+')'),'value':_0x18aa2e[_0x4533bc(0x89)]}))],_0x4af13d=await select({'message':_0x4533bc(0x81),'choices':_0x38365f});if(_0x4af13d===_0x4533bc(0x80))return _0x4533bc(0x80);if(_0x4af13d==='custom')return _0x4533bc(0x95);return _0x1010f7[_0x4533bc(0x94)](_0x53f65e=>_0x53f65e[_0x4533bc(0x89)]===_0x4af13d);}export async function selectSingleAppcode(_0x52d0d5){const _0x483463=a45_0x5ded;if(!_0x52d0d5)return writeCliSideChannelLine(a45_0xec6f5c[_0x483463(0x8d)](_0x483463(0x8f))),_fallbackOrSkip();writeCliSideChannelLine(_0x483463(0x9b));let _0x55fd4e;try{_0x55fd4e=await withActiveCookie(_0x52d0d5,()=>listRemoteApps());}catch(_0x426ef7){writeCliSideChannelLine(a45_0xec6f5c['yellow'](_0x483463(0x85)));if(_0x426ef7 instanceof Error)writeCliSideChannelLine(a45_0xec6f5c[_0x483463(0x8d)](_0x483463(0x86)+_0x426ef7[_0x483463(0x83)]+')'));return _fallbackOrSkip();}if(_0x55fd4e[_0x483463(0x92)]===0x0)return writeCliSideChannelLine(a45_0xec6f5c['yellow'](_0x483463(0x9f))),_fallbackOrSkip();const _0x5af22f=await promptSingleAppSelection(_0x55fd4e);if(_0x5af22f===_0x483463(0x80))return'';if(_0x5af22f==='custom')return promptCustomAppcode();return _0x5af22f[_0x483463(0x89)];}export async function selectMultipleApps(_0x35738b){const _0x3ac606=a45_0x5ded;writeCliSideChannelLine(_0x3ac606(0x9b));let _0x2164ad;try{_0x2164ad=await withActiveCookie(_0x35738b,()=>listRemoteApps());}catch(_0x264bc8){writeCliSideChannelLine(_0x3ac606(0x8a));if(_0x264bc8 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x264bc8['message']+')');return _0x3ac606(0x95);}if(_0x2164ad[_0x3ac606(0x92)]===0x0)return writeCliSideChannelLine(_0x3ac606(0x7f)),_0x3ac606(0x95);return promptAppSelection(_0x2164ad);}async function _fallbackOrSkip(){const _0x5d7eb7=a45_0x5ded,_0x1a7ed4=await select({'message':_0x5d7eb7(0x7c),'choices':[{'name':a45_0xec6f5c[_0x5d7eb7(0x8d)](_0x5d7eb7(0x7b)),'value':_0x5d7eb7(0x80)},{'name':a45_0xec6f5c[_0x5d7eb7(0x97)]('✎\x20Enter\x20manually'),'value':_0x5d7eb7(0x7a)}]});if(_0x1a7ed4===_0x5d7eb7(0x80))return'';return promptCustomAppcode();}
1
+ (function(_0x5da7f7,_0x42806e){const _0x1d761d=a45_0x2002,_0x569311=_0x5da7f7();while(!![]){try{const _0xbfacda=parseInt(_0x1d761d(0x76))/0x1*(parseInt(_0x1d761d(0x91))/0x2)+parseInt(_0x1d761d(0x7e))/0x3*(-parseInt(_0x1d761d(0x97))/0x4)+-parseInt(_0x1d761d(0x79))/0x5*(parseInt(_0x1d761d(0x8a))/0x6)+parseInt(_0x1d761d(0x94))/0x7*(-parseInt(_0x1d761d(0x75))/0x8)+-parseInt(_0x1d761d(0x93))/0x9+-parseInt(_0x1d761d(0x7d))/0xa+parseInt(_0x1d761d(0x8c))/0xb*(parseInt(_0x1d761d(0x7c))/0xc);if(_0xbfacda===_0x42806e)break;else _0x569311['push'](_0x569311['shift']());}catch(_0x2949bc){_0x569311['push'](_0x569311['shift']());}}}(a45_0x4a88,0xb9fae));import{input,checkbox,select}from'@inquirer/prompts';function a45_0x2002(_0x442cf2,_0x159e1a){_0x442cf2=_0x442cf2-0x73;const _0x4a8815=a45_0x4a88();let _0x20026f=_0x4a8815[_0x442cf2];return _0x20026f;}function a45_0x4a88(){const _0x2d128f=['trim','21972qpQkGu','318880dfhhZr','15300TMSQgW','App\x20Code:','length','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','Fetching\x20available\x20apps...','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','custom','manual','gray','(Skip;\x20configure\x20later)','yellow','534PkFmGX','appName','17996ouzVRC','✎\x20Enter\x20appcode\x20manually','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','\x20\x20(','cyan','123982YVWLoE','map','1114902dKLQqo','14WpwXzy','message','✎\x20Enter\x20manually','872aoEgKO','appCode','No\x20available\x20apps\x20found.','Select\x20the\x20app\x20to\x20bind:','skip','521064wcYjzw','9GklKeb','includes','Invalid\x20App\x20Code','78305uyFDzK','valid'];a45_0x4a88=function(){return _0x2d128f;};return a45_0x4a88();}import a45_0x4406a5 from'chalk';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 _0x149614=await input({'message':'App\x20Code:','validate':_0x2e313b=>{const _0x5e8f84=a45_0x2002,_0x217ae5=validateAppcode(_0x2e313b[_0x5e8f84(0x7b)]());return _0x217ae5[_0x5e8f84(0x7a)]||_0x217ae5['message']||_0x5e8f84(0x78);}});return _0x149614['trim']();}export async function promptAppSelection(_0x573077){const _0x560873=a45_0x2002,_0x346d24=[{'name':a45_0x4406a5[_0x560873(0x89)](_0x560873(0x8d)),'value':-0x1},..._0x573077[_0x560873(0x92)]((_0x1d52c0,_0x52ef84)=>({'name':_0x1d52c0[_0x560873(0x8b)]+'\x20\x20'+a45_0x4406a5[_0x560873(0x87)]('('+_0x1d52c0[_0x560873(0x98)]+')'),'value':_0x52ef84}))],_0x449356=await checkbox({'message':'Found\x20'+a45_0x4406a5[_0x560873(0x90)](_0x573077[_0x560873(0x80)])+_0x560873(0x8e),'choices':_0x346d24,'loop':![]});if(_0x449356[_0x560873(0x77)](-0x1))return _0x560873(0x85);if(_0x449356[_0x560873(0x80)]===0x0)return _0x560873(0x85);return _0x449356['map'](_0xa11e24=>_0x573077[_0xa11e24]);}export async function promptSingleAppSelection(_0x227e8e){const _0x296eda=a45_0x2002,_0x340db6=[{'name':a45_0x4406a5['gray']('(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)'),'value':_0x296eda(0x74)},{'name':a45_0x4406a5[_0x296eda(0x89)](_0x296eda(0x8d)),'value':_0x296eda(0x85)},..._0x227e8e[_0x296eda(0x92)](_0x4db2e9=>({'name':_0x4db2e9[_0x296eda(0x8b)]+'\x20\x20'+a45_0x4406a5[_0x296eda(0x87)]('('+_0x4db2e9[_0x296eda(0x98)]+')'),'value':_0x4db2e9[_0x296eda(0x98)]}))],_0x1232bf=await select({'message':_0x296eda(0x73),'choices':_0x340db6});if(_0x1232bf===_0x296eda(0x74))return'skip';if(_0x1232bf===_0x296eda(0x85))return _0x296eda(0x85);return _0x227e8e['find'](_0x228348=>_0x228348[_0x296eda(0x98)]===_0x1232bf);}export async function selectSingleAppcode(_0x2965d1){const _0x5312b4=a45_0x2002;if(!_0x2965d1)return writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x87)](_0x5312b4(0x84))),_fallbackOrSkip();writeCliSideChannelLine(_0x5312b4(0x83));let _0x1727b2;try{_0x1727b2=await withActiveCookie(_0x2965d1,()=>listRemoteApps());}catch(_0xd83663){writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x89)](_0x5312b4(0x82)));if(_0xd83663 instanceof Error)writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x87)]('\x20\x20('+_0xd83663[_0x5312b4(0x95)]+')'));return _fallbackOrSkip();}if(_0x1727b2[_0x5312b4(0x80)]===0x0)return writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x89)](_0x5312b4(0x99))),_fallbackOrSkip();const _0x141654=await promptSingleAppSelection(_0x1727b2);if(_0x141654==='skip')return'';if(_0x141654===_0x5312b4(0x85))return promptCustomAppcode();return _0x141654[_0x5312b4(0x98)];}export async function selectMultipleApps(_0xe18a1){const _0xee3acf=a45_0x2002;writeCliSideChannelLine(_0xee3acf(0x83));let _0x5370fa;try{_0x5370fa=await withActiveCookie(_0xe18a1,()=>listRemoteApps());}catch(_0x18144a){writeCliSideChannelLine(_0xee3acf(0x81));if(_0x18144a instanceof Error)writeCliSideChannelLine(_0xee3acf(0x8f)+_0x18144a[_0xee3acf(0x95)]+')');return _0xee3acf(0x85);}if(_0x5370fa['length']===0x0)return writeCliSideChannelLine('\x0aNo\x20available\x20apps\x20found.'),'custom';return promptAppSelection(_0x5370fa);}async function _fallbackOrSkip(){const _0x4338a2=a45_0x2002,_0xe7578b=await select({'message':_0x4338a2(0x7f),'choices':[{'name':a45_0x4406a5['gray'](_0x4338a2(0x88)),'value':_0x4338a2(0x74)},{'name':a45_0x4406a5[_0x4338a2(0x89)](_0x4338a2(0x96)),'value':_0x4338a2(0x86)}]});if(_0xe7578b===_0x4338a2(0x74))return'';return promptCustomAppcode();}