@lovrabet/rabetbase-cli 2.5.3-beta.1 → 2.5.3-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (374) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/api/generate-sdk-config-file.js +1 -1
  5. package/lib/auth/auth-server-ui.js +1 -1
  6. package/lib/auth/auth-server.js +1 -1
  7. package/lib/auth/constant.js +1 -1
  8. package/lib/auth/get-cookie.js +1 -1
  9. package/lib/auth/get-session-user.js +1 -1
  10. package/lib/auth/is-session-valid.js +1 -1
  11. package/lib/auth/login-success-html.js +1 -1
  12. package/lib/auth/logout.js +1 -1
  13. package/lib/cli-flags.js +1 -1
  14. package/lib/cli.js +1 -1
  15. package/lib/commands/api/generate.js +1 -1
  16. package/lib/commands/api/index.js +1 -1
  17. package/lib/commands/api/list.js +1 -1
  18. package/lib/commands/api/pull.js +1 -1
  19. package/lib/commands/api/shared.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/members-list.js +1 -1
  23. package/lib/commands/app/remote-directory.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/logs.d.ts +7 -0
  38. package/lib/commands/bff/logs.js +1 -0
  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/batch-design.d.ts +21 -0
  62. package/lib/commands/dataset/batch-design.js +1 -0
  63. package/lib/commands/dataset/business-group-update.js +1 -1
  64. package/lib/commands/dataset/business-groups.js +1 -1
  65. package/lib/commands/dataset/capability.js +1 -1
  66. package/lib/commands/dataset/delete.js +1 -1
  67. package/lib/commands/dataset/detail.js +1 -1
  68. package/lib/commands/dataset/extend-update.js +1 -1
  69. package/lib/commands/dataset/field-restore.js +1 -1
  70. package/lib/commands/dataset/field-update.js +1 -1
  71. package/lib/commands/dataset/generate.js +1 -1
  72. package/lib/commands/dataset/index.js +1 -1
  73. package/lib/commands/dataset/list.js +1 -1
  74. package/lib/commands/dataset/operations.js +1 -1
  75. package/lib/commands/dataset/relation-audit.js +1 -1
  76. package/lib/commands/dataset/relation-create.js +1 -1
  77. package/lib/commands/dataset/relation-delete.js +1 -1
  78. package/lib/commands/dataset/relation-shared.js +1 -1
  79. package/lib/commands/dataset/relation-update.js +1 -1
  80. package/lib/commands/dataset/relations.js +1 -1
  81. package/lib/commands/dataset/rename.js +1 -1
  82. package/lib/commands/dataset/restore.js +1 -1
  83. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  84. package/lib/commands/db/analysis-batching.js +1 -1
  85. package/lib/commands/db/analyze-batch-plan.js +1 -1
  86. package/lib/commands/db/analyze-cancel.js +1 -1
  87. package/lib/commands/db/analyze-start.js +1 -1
  88. package/lib/commands/db/analyze-status.js +1 -1
  89. package/lib/commands/db/create.js +1 -1
  90. package/lib/commands/db/delete.js +1 -1
  91. package/lib/commands/db/detail.js +1 -1
  92. package/lib/commands/db/diff-refresh-start.js +1 -1
  93. package/lib/commands/db/diff-refresh-status.js +1 -1
  94. package/lib/commands/db/diff.js +1 -1
  95. package/lib/commands/db/index.js +1 -1
  96. package/lib/commands/db/list.js +1 -1
  97. package/lib/commands/db/shared.js +1 -1
  98. package/lib/commands/db/table-diff-shared.js +1 -1
  99. package/lib/commands/db/tables.js +1 -1
  100. package/lib/commands/db/test.js +1 -1
  101. package/lib/commands/db/update.js +1 -1
  102. package/lib/commands/deployment/index.js +1 -1
  103. package/lib/commands/deployment/sync-all.js +1 -1
  104. package/lib/commands/deployment/sync-jobs.js +1 -1
  105. package/lib/commands/deployment/sync-status.js +1 -1
  106. package/lib/commands/doctor.js +1 -1
  107. package/lib/commands/file/index.js +1 -1
  108. package/lib/commands/flow/create.d.ts +2 -0
  109. package/lib/commands/flow/create.js +1 -0
  110. package/lib/commands/flow/detail.d.ts +2 -0
  111. package/lib/commands/flow/detail.js +1 -0
  112. package/lib/commands/flow/index.d.ts +3 -0
  113. package/lib/commands/flow/index.js +1 -0
  114. package/lib/commands/flow/list.d.ts +2 -0
  115. package/lib/commands/flow/list.js +1 -0
  116. package/lib/commands/flow/publish.d.ts +2 -0
  117. package/lib/commands/flow/publish.js +1 -0
  118. package/lib/commands/flow/runtime-resources-shared.d.ts +40 -0
  119. package/lib/commands/flow/runtime-resources-shared.js +1 -0
  120. package/lib/commands/flow/runtime-role-list.d.ts +2 -0
  121. package/lib/commands/flow/runtime-role-list.js +1 -0
  122. package/lib/commands/flow/runtime-role-user-list.d.ts +2 -0
  123. package/lib/commands/flow/runtime-role-user-list.js +1 -0
  124. package/lib/commands/flow/runtime-user-search.d.ts +2 -0
  125. package/lib/commands/flow/runtime-user-search.js +1 -0
  126. package/lib/commands/flow/shared.d.ts +41 -0
  127. package/lib/commands/flow/shared.js +1 -0
  128. package/lib/commands/flow/update.d.ts +2 -0
  129. package/lib/commands/flow/update.js +1 -0
  130. package/lib/commands/flow/validate.d.ts +3 -0
  131. package/lib/commands/flow/validate.js +1 -0
  132. package/lib/commands/instant-api-policy/current.js +1 -1
  133. package/lib/commands/instant-api-policy/index.js +1 -1
  134. package/lib/commands/instant-api-policy/init.js +1 -1
  135. package/lib/commands/instant-api-policy/publish.js +1 -1
  136. package/lib/commands/instant-api-policy/pull.js +1 -1
  137. package/lib/commands/instant-api-policy/revision.js +1 -1
  138. package/lib/commands/instant-api-policy/revisions.js +1 -1
  139. package/lib/commands/instant-api-policy/rollback.js +1 -1
  140. package/lib/commands/instant-api-policy/shared.js +1 -1
  141. package/lib/commands/instant-api-policy/validate.js +1 -1
  142. package/lib/commands/issue/index.js +1 -1
  143. package/lib/commands/issue/nudge.js +1 -1
  144. package/lib/commands/issue/report.js +1 -1
  145. package/lib/commands/issue/shared.js +1 -1
  146. package/lib/commands/kb/create.js +1 -1
  147. package/lib/commands/kb/delete.js +1 -1
  148. package/lib/commands/kb/detail.js +1 -1
  149. package/lib/commands/kb/index.js +1 -1
  150. package/lib/commands/kb/list.js +1 -1
  151. package/lib/commands/kb/search.js +1 -1
  152. package/lib/commands/kb/shared.js +1 -1
  153. package/lib/commands/kb/update.js +1 -1
  154. package/lib/commands/logs/index.js +1 -1
  155. package/lib/commands/menu/asset-update.js +1 -1
  156. package/lib/commands/menu/delete.js +1 -1
  157. package/lib/commands/menu/external-link-create.js +1 -1
  158. package/lib/commands/menu/external-link-update.js +1 -1
  159. package/lib/commands/menu/group-create.js +1 -1
  160. package/lib/commands/menu/group-update.js +1 -1
  161. package/lib/commands/menu/index.js +1 -1
  162. package/lib/commands/menu/list.js +1 -1
  163. package/lib/commands/menu/move.js +1 -1
  164. package/lib/commands/menu/regroup-start.js +1 -1
  165. package/lib/commands/menu/rename.js +1 -1
  166. package/lib/commands/menu/shared/compare-table.js +1 -1
  167. package/lib/commands/menu/shared/delete-plan.js +1 -1
  168. package/lib/commands/menu/shared/facts.js +1 -1
  169. package/lib/commands/menu/shared/index.js +1 -1
  170. package/lib/commands/menu/shared/inquirer.js +1 -1
  171. package/lib/commands/menu/shared/local-pages.js +1 -1
  172. package/lib/commands/menu/shared/logic.js +1 -1
  173. package/lib/commands/menu/shared/mutations.js +1 -1
  174. package/lib/commands/menu/shared/service.js +1 -1
  175. package/lib/commands/menu/shared/sync-core.js +1 -1
  176. package/lib/commands/menu/shared/update-core.js +1 -1
  177. package/lib/commands/menu/shared/valid-url.js +1 -1
  178. package/lib/commands/menu/sync.js +1 -1
  179. package/lib/commands/menu/visibility-update.js +1 -1
  180. package/lib/commands/notification/config-create.js +1 -1
  181. package/lib/commands/notification/config-delete.js +1 -1
  182. package/lib/commands/notification/config-list.js +1 -1
  183. package/lib/commands/notification/config-update.js +1 -1
  184. package/lib/commands/notification/index.js +1 -1
  185. package/lib/commands/notification/shared.js +1 -1
  186. package/lib/commands/ocr/index.js +1 -1
  187. package/lib/commands/page/create.js +1 -1
  188. package/lib/commands/page/custom/detail.js +1 -1
  189. package/lib/commands/page/custom/list.js +1 -1
  190. package/lib/commands/page/custom/publish.js +1 -1
  191. package/lib/commands/page/custom/shared.js +1 -1
  192. package/lib/commands/page/custom/syntax.js +1 -1
  193. package/lib/commands/page/custom/update.js +1 -1
  194. package/lib/commands/page/data-list-status.js +1 -1
  195. package/lib/commands/page/generate-start.js +1 -1
  196. package/lib/commands/page/generate-status.js +1 -1
  197. package/lib/commands/page/index.js +1 -1
  198. package/lib/commands/page/pull.js +1 -1
  199. package/lib/commands/page/push.js +1 -1
  200. package/lib/commands/page/relation-audit.js +1 -1
  201. package/lib/commands/page/restore.js +1 -1
  202. package/lib/commands/page/shared.js +1 -1
  203. package/lib/commands/page/sync.js +1 -1
  204. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  205. package/lib/commands/project/create/format-elapsed.js +1 -1
  206. package/lib/commands/project/create/main.js +1 -1
  207. package/lib/commands/project/create/materialize-project-template.js +1 -1
  208. package/lib/commands/project/create/project-name.js +1 -1
  209. package/lib/commands/project/create/project-template-archive.js +1 -1
  210. package/lib/commands/project/create/project-template-path.js +1 -1
  211. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  212. package/lib/commands/project/create/use-format-code.js +1 -1
  213. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  214. package/lib/commands/project/domain-routing-sync.js +1 -1
  215. package/lib/commands/project/index.js +1 -1
  216. package/lib/commands/project/upgrade.js +1 -1
  217. package/lib/commands/registry.js +1 -1
  218. package/lib/commands/role/delete.js +1 -1
  219. package/lib/commands/role/detail.js +1 -1
  220. package/lib/commands/role/index.js +1 -1
  221. package/lib/commands/role/list.js +1 -1
  222. package/lib/commands/role/shared.js +1 -1
  223. package/lib/commands/role/update.js +1 -1
  224. package/lib/commands/role/user-add.js +1 -1
  225. package/lib/commands/role/user-remove.js +1 -1
  226. package/lib/commands/role/user-resolve.js +1 -1
  227. package/lib/commands/rule/get.js +1 -1
  228. package/lib/commands/rule/index.js +1 -1
  229. package/lib/commands/rule/list.js +1 -1
  230. package/lib/commands/rule/set.js +1 -1
  231. package/lib/commands/rule/shared.js +1 -1
  232. package/lib/commands/run/index.js +1 -1
  233. package/lib/commands/schema.js +1 -1
  234. package/lib/commands/sql/create.js +1 -1
  235. package/lib/commands/sql/delete.js +1 -1
  236. package/lib/commands/sql/detail.js +1 -1
  237. package/lib/commands/sql/exec.js +1 -1
  238. package/lib/commands/sql/index.js +1 -1
  239. package/lib/commands/sql/list.js +1 -1
  240. package/lib/commands/sql/pull.js +1 -1
  241. package/lib/commands/sql/push.js +1 -1
  242. package/lib/commands/sql/shared.js +1 -1
  243. package/lib/commands/sql/status.js +1 -1
  244. package/lib/commands/sql/validate.js +1 -1
  245. package/lib/commands/task/index.js +1 -1
  246. package/lib/commands/task/status.js +1 -1
  247. package/lib/commands/tenant/index.js +1 -1
  248. package/lib/commands/tenant/members-list.js +1 -1
  249. package/lib/commands/tenant/shared.js +1 -1
  250. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  251. package/lib/commands/user-account/index.js +1 -1
  252. package/lib/commands/workspace/add.js +1 -1
  253. package/lib/commands/workspace/index.js +1 -1
  254. package/lib/commands/workspace/remove.js +1 -1
  255. package/lib/config/domain-config.js +1 -1
  256. package/lib/config/project-domain-routing.js +1 -1
  257. package/lib/config/region-config.js +1 -1
  258. package/lib/config/schema.js +1 -1
  259. package/lib/constant/cdn.js +1 -1
  260. package/lib/constant/cli.js +1 -1
  261. package/lib/constant/defaults.js +1 -1
  262. package/lib/constant/domain.js +1 -1
  263. package/lib/constant/env.js +1 -1
  264. package/lib/constant/output.js +1 -1
  265. package/lib/constant/paths.js +1 -1
  266. package/lib/constant/region.js +1 -1
  267. package/lib/constant/risk.js +1 -1
  268. package/lib/constant/routing-profile.js +1 -1
  269. package/lib/context/app-resolver.js +1 -1
  270. package/lib/context/auth-resolver.js +1 -1
  271. package/lib/context/config-loader.js +1 -1
  272. package/lib/context.js +1 -1
  273. package/lib/core/alias-resolver.js +1 -1
  274. package/lib/core/api-client.d.ts +170 -1
  275. package/lib/core/api-client.js +1 -1
  276. package/lib/core/bff/config.js +1 -1
  277. package/lib/core/bff/file-system.js +1 -1
  278. package/lib/core/bff/hash.js +1 -1
  279. package/lib/core/bff/hook-directory.d.ts +55 -0
  280. package/lib/core/bff/hook-directory.js +1 -0
  281. package/lib/core/bff/lock.js +1 -1
  282. package/lib/core/bff/types.d.ts +15 -0
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/db-resolver.js +1 -1
  285. package/lib/core/flow-config.d.ts +628 -0
  286. package/lib/core/flow-config.js +1 -0
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +1 -1
  357. package/skills/rabetbase/SKILL.md +22 -4
  358. package/skills/rabetbase/guides/approval-flow-development-workflow.md +137 -0
  359. package/skills/rabetbase/guides/backend-function.md +19 -9
  360. package/skills/rabetbase/guides/bff-creation-workflow.md +10 -1
  361. package/skills/rabetbase/guides/conflict-detection.md +2 -0
  362. package/skills/rabetbase/guides/sdk-client-generation.md +1 -0
  363. package/skills/rabetbase/knowledge/approval-flow/config-json-schema.md +290 -0
  364. package/skills/rabetbase/references/rabetbase-bff-create.md +1 -1
  365. package/skills/rabetbase/references/rabetbase-bff-logs.md +47 -0
  366. package/skills/rabetbase/references/rabetbase-bff-pull.md +7 -3
  367. package/skills/rabetbase/references/rabetbase-bff-push.md +10 -2
  368. package/skills/rabetbase/references/rabetbase-dataset-generate.md +52 -2
  369. package/skills/rabetbase/references/rabetbase-flow-commands.md +86 -0
  370. package/skills/rabetbase/references/rabetbase-flow-resources.md +83 -0
  371. package/skills/rabetbase/references/rabetbase-flow-runtime-boundary.md +25 -0
  372. package/skills/rabetbase/references/rabetbase-instant-api-policy.md +103 -11
  373. package/skills/rabetbase/references/rabetbase-notification-config-list.md +17 -0
  374. package/skills/rabetbase.manifest.json +9 -3
@@ -1 +1 @@
1
- const a33_0x4449b2=a33_0x34c9;function a33_0x34c9(_0x1fee83,_0x33d3c5){_0x1fee83=_0x1fee83-0x13d;const _0x182bc5=a33_0x182b();let _0x34c98a=_0x182bc5[_0x1fee83];return _0x34c98a;}(function(_0x36ae91,_0x4b28f9){const _0x3ebff4=a33_0x34c9,_0x1937df=_0x36ae91();while(!![]){try{const _0x341767=-parseInt(_0x3ebff4(0x14a))/0x1+-parseInt(_0x3ebff4(0x14f))/0x2*(-parseInt(_0x3ebff4(0x13e))/0x3)+-parseInt(_0x3ebff4(0x147))/0x4+parseInt(_0x3ebff4(0x143))/0x5+parseInt(_0x3ebff4(0x146))/0x6+parseInt(_0x3ebff4(0x13d))/0x7+parseInt(_0x3ebff4(0x144))/0x8*(-parseInt(_0x3ebff4(0x151))/0x9);if(_0x341767===_0x4b28f9)break;else _0x1937df['push'](_0x1937df['shift']());}catch(_0x120991){_0x1937df['push'](_0x1937df['shift']());}}}(a33_0x182b,0xa213e));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0x4449b2(0x154),'command':a33_0x4449b2(0x14d),'description':a33_0x4449b2(0x149),'risk':'read','flags':[{'name':'id','type':a33_0x4449b2(0x141),'required':!![],'description':a33_0x4449b2(0x14e)},{'name':a33_0x4449b2(0x152),'type':'boolean','description':a33_0x4449b2(0x145)}],async 'execute'(_0x424ee3){const _0x4071d7=a33_0x4449b2,_0x37c2ca=await getBffScriptInfo(_0x424ee3['num']('id')),_0x6a26df=_0x424ee3[_0x4071d7(0x14b)](_0x4071d7(0x152));if(_0x6a26df)return{'ok':!![],'data':_0x37c2ca};return{'ok':!![],'data':{'id':_0x37c2ca['id'],'functionName':_0x37c2ca[_0x4071d7(0x140)]??'','version':_0x37c2ca[_0x4071d7(0x142)]??'','updateUserName':_0x37c2ca[_0x4071d7(0x150)]??'','appCode':_0x37c2ca[_0x4071d7(0x148)],'scriptType':_0x37c2ca[_0x4071d7(0x153)],'description':_0x37c2ca['description']||'(none)','createdTime':_0x37c2ca['createdTime']??'','updatedTime':_0x37c2ca[_0x4071d7(0x13f)]??'','scriptContent':_0x37c2ca[_0x4071d7(0x14c)]??''}};}};function a33_0x182b(){const _0x2534bc=['bool','scriptContent','detail','Script\x20ID','26CryacB','updateUserName','9yXuGTE','verbose','scriptType','bff','5240900bmZUjL','11334jidOQC','updatedTime','functionName','number','version','2874450sKUfoL','2312176tBISlN','Return\x20full\x20raw\x20script\x20object','3810012kkDZjQ','3216148FPfYMp','appCode','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','250777gNaxYr'];a33_0x182b=function(){return _0x2534bc;};return a33_0x182b();}
1
+ function a33_0x280e(_0x5b1cb9,_0x3eee8b){_0x5b1cb9=_0x5b1cb9-0x125;const _0x129664=a33_0x1296();let _0x280eae=_0x129664[_0x5b1cb9];return _0x280eae;}const a33_0x592c54=a33_0x280e;(function(_0x4cda98,_0x194fd8){const _0x309c53=a33_0x280e,_0x14e694=_0x4cda98();while(!![]){try{const _0x2a9bf3=parseInt(_0x309c53(0x12c))/0x1+parseInt(_0x309c53(0x12b))/0x2*(-parseInt(_0x309c53(0x136))/0x3)+-parseInt(_0x309c53(0x132))/0x4+-parseInt(_0x309c53(0x127))/0x5*(-parseInt(_0x309c53(0x13c))/0x6)+parseInt(_0x309c53(0x126))/0x7*(parseInt(_0x309c53(0x125))/0x8)+parseInt(_0x309c53(0x139))/0x9+-parseInt(_0x309c53(0x12a))/0xa;if(_0x2a9bf3===_0x194fd8)break;else _0x14e694['push'](_0x14e694['shift']());}catch(_0x5b57d8){_0x14e694['push'](_0x14e694['shift']());}}}(a33_0x1296,0xde1c4));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0x592c54(0x138),'command':a33_0x592c54(0x128),'description':a33_0x592c54(0x131),'risk':'read','flags':[{'name':'id','type':a33_0x592c54(0x135),'required':!![],'description':a33_0x592c54(0x12e)},{'name':a33_0x592c54(0x133),'type':a33_0x592c54(0x12f),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x3e277e){const _0x185bdf=a33_0x592c54,_0x2e78cf=await getBffScriptInfo(_0x3e277e[_0x185bdf(0x13b)]('id')),_0x20cc97=_0x3e277e['bool'](_0x185bdf(0x133));if(_0x20cc97)return{'ok':!![],'data':_0x2e78cf};return{'ok':!![],'data':{'id':_0x2e78cf['id'],'functionName':_0x2e78cf['functionName']??'','version':_0x2e78cf['version']??'','updateUserName':_0x2e78cf[_0x185bdf(0x137)]??'','appCode':_0x2e78cf[_0x185bdf(0x13d)],'scriptType':_0x2e78cf[_0x185bdf(0x129)],'description':_0x2e78cf[_0x185bdf(0x12d)]||'(none)','createdTime':_0x2e78cf[_0x185bdf(0x134)]??'','updatedTime':_0x2e78cf[_0x185bdf(0x130)]??'','scriptContent':_0x2e78cf[_0x185bdf(0x13a)]??''}};}};function a33_0x1296(){const _0x388c55=['2417760ovzjOR','scriptContent','num','12QZUauD','appCode','53488vRpsAJ','1561dcfcHI','552395QlyLgx','detail','scriptType','6477140WkUlIB','2TNTjaD','628802rukmVO','description','Script\x20ID','boolean','updatedTime','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','2967356naFJdD','verbose','createdTime','number','930183XcVUOm','updateUserName','bff'];a33_0x1296=function(){return _0x388c55;};return a33_0x1296();}
@@ -1 +1 @@
1
- (function(_0x1369da,_0x3568be){const _0x299104=a34_0xeb9e,_0xf12ebb=_0x1369da();while(!![]){try{const _0x5a4bb0=-parseInt(_0x299104(0x1e0))/0x1+parseInt(_0x299104(0x1e8))/0x2*(parseInt(_0x299104(0x1e7))/0x3)+parseInt(_0x299104(0x1e5))/0x4*(parseInt(_0x299104(0x1de))/0x5)+parseInt(_0x299104(0x1df))/0x6+-parseInt(_0x299104(0x1e2))/0x7*(parseInt(_0x299104(0x1e3))/0x8)+parseInt(_0x299104(0x1e1))/0x9*(-parseInt(_0x299104(0x1e4))/0xa)+-parseInt(_0x299104(0x1e6))/0xb;if(_0x5a4bb0===_0x3568be)break;else _0xf12ebb['push'](_0xf12ebb['shift']());}catch(_0x13335f){_0xf12ebb['push'](_0xf12ebb['shift']());}}}(a34_0x251f,0xb493b));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_0xeb9e(_0x242ee3,_0x468ee5){_0x242ee3=_0x242ee3-0x1de;const _0x251f7a=a34_0x251f();let _0xeb9e0b=_0x251f7a[_0x242ee3];return _0xeb9e0b;}function a34_0x251f(){const _0x3667d4=['8FMHbWp','1647250RXQLfX','486wOLaCM','5666EuGUlH','2282815EDzkIS','8439036DwkcMT','35253CiwrVo','36216uZYvNw','102270mTWndA','656lbuFAp','1630SRTQfN'];a34_0x251f=function(){return _0x3667d4;};return a34_0x251f();}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x191737,_0x406fd0){const _0x1e47a2=a34_0x38ac,_0x52fd8e=_0x191737();while(!![]){try{const _0x560eff=-parseInt(_0x1e47a2(0x1c0))/0x1+parseInt(_0x1e47a2(0x1c2))/0x2+-parseInt(_0x1e47a2(0x1bf))/0x3*(-parseInt(_0x1e47a2(0x1c4))/0x4)+parseInt(_0x1e47a2(0x1be))/0x5+-parseInt(_0x1e47a2(0x1bd))/0x6+parseInt(_0x1e47a2(0x1c5))/0x7+parseInt(_0x1e47a2(0x1c1))/0x8*(-parseInt(_0x1e47a2(0x1c3))/0x9);if(_0x560eff===_0x406fd0)break;else _0x52fd8e['push'](_0x52fd8e['shift']());}catch(_0x3372e4){_0x52fd8e['push'](_0x52fd8e['shift']());}}}(a34_0x1fcc,0x9b48a));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a34_0x38ac(_0x7be074,_0x2a1152){_0x7be074=_0x7be074-0x1bd;const _0x1fcc06=a34_0x1fcc();let _0x38ac52=_0x1fcc06[_0x7be074];return _0x38ac52;}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';function a34_0x1fcc(){const _0x428b2d=['4340042bRbdfo','6761778EatROh','4877405ODxGMj','1621026pKYIpA','733112dndmYf','4072ekOFYV','1519706yESZrg','7065VVLAVf','4SKWpwd'];a34_0x1fcc=function(){return _0x428b2d;};return a34_0x1fcc();}import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a35_0x257e14=a35_0x587f;(function(_0x1fba2c,_0x4984fc){const _0x36d227=a35_0x587f,_0x3da103=_0x1fba2c();while(!![]){try{const _0x4806f7=-parseInt(_0x36d227(0x199))/0x1*(-parseInt(_0x36d227(0x19c))/0x2)+-parseInt(_0x36d227(0x1a3))/0x3+parseInt(_0x36d227(0x1a0))/0x4*(parseInt(_0x36d227(0x1a1))/0x5)+-parseInt(_0x36d227(0x195))/0x6*(parseInt(_0x36d227(0x198))/0x7)+parseInt(_0x36d227(0x197))/0x8+parseInt(_0x36d227(0x1a2))/0x9*(-parseInt(_0x36d227(0x1a9))/0xa)+-parseInt(_0x36d227(0x19a))/0xb*(parseInt(_0x36d227(0x1a8))/0xc);if(_0x4806f7===_0x4984fc)break;else _0x3da103['push'](_0x3da103['shift']());}catch(_0x17c8f3){_0x3da103['push'](_0x3da103['shift']());}}}(a35_0x107d,0x50810));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a35_0x257e14(0x194),'description':'List\x20Backend\x20Function\x20scripts','risk':a35_0x257e14(0x191),'flags':[{'name':a35_0x257e14(0x19e),'type':a35_0x257e14(0x1a4),'description':'Script\x20type\x20filter','default':'ENDPOINT','enum':['ENDPOINT',a35_0x257e14(0x1a5)]},{'name':a35_0x257e14(0x190),'type':a35_0x257e14(0x1a4),'description':'Filter\x20by\x20script\x20name'},{'name':a35_0x257e14(0x192),'type':a35_0x257e14(0x19b),'description':a35_0x257e14(0x19f)}],async 'execute'(_0x271046){const _0x5cd743=a35_0x257e14,_0x5e91fd=await listBffScripts(_0x271046[_0x5cd743(0x196)],_0x271046[_0x5cd743(0x18e)]('type'),{'scriptName':_0x271046['str'](_0x5cd743(0x190))||undefined}),_0x104563=_0x271046[_0x5cd743(0x193)](_0x5cd743(0x192));return{'ok':!![],'data':_0x104563?_0x5e91fd:_0x5e91fd['map'](_0xe681b1=>({'id':_0xe681b1['id'],'functionName':_0xe681b1[_0x5cd743(0x18f)]??'','description':_0xe681b1['description']||_0x5cd743(0x1a7),'scriptType':_0xe681b1['scriptType']})),'message':_0x5e91fd[_0x5cd743(0x1a6)]===0x0?_0x5cd743(0x19d):undefined};}};function a35_0x587f(_0x39438b,_0x1ba5f4){_0x39438b=_0x39438b-0x18e;const _0x107de9=a35_0x107d();let _0x587f12=_0x107de9[_0x39438b];return _0x587f12;}function a35_0x107d(){const _0x2a3f61=['verbose','bool','list','27834EOOQRH','appCode','1642912TuAkCV','364KnWUOk','9971dGeFfh','6644LlAgoc','boolean','122DuMGMb','No\x20Backend\x20Function\x20scripts\x20found.','type','Return\x20full\x20script\x20objects','1470252NxCSKb','5kFCbyl','279iNIwtE','43770bWQEsU','string','COMMON','length','(unnamed)','9840Ytxgvn','32360ibNocU','str','functionName','name','read'];a35_0x107d=function(){return _0x2a3f61;};return a35_0x107d();}
1
+ const a35_0x319be2=a35_0x5f4c;function a35_0x3d39(){const _0x53acd9=['COMMON','10YLHuaS','2712GJzKFu','1rwoFMh','name','ENDPOINT','No\x20Backend\x20Function\x20scripts\x20found.','functionName','12zZhAml','4374VNCJNL','length','2060388puvMuK','map','602277FQSnAn','type','bff','28535ddEspw','appCode','Filter\x20by\x20script\x20name','1581362zeuixa','7eHCSVl','verbose','scriptType','str','2637459HZANOj','2460318wCHwKG','read','list','description','Script\x20type\x20filter','string'];a35_0x3d39=function(){return _0x53acd9;};return a35_0x3d39();}(function(_0x1193ef,_0x20ea44){const _0x1c66cb=a35_0x5f4c,_0x49e746=_0x1193ef();while(!![]){try{const _0xf017c4=-parseInt(_0x1c66cb(0x9d))/0x1*(-parseInt(_0x1c66cb(0x8e))/0x2)+parseInt(_0x1c66cb(0x88))/0x3+-parseInt(_0x1c66cb(0x83))/0x4*(parseInt(_0x1c66cb(0x8b))/0x5)+-parseInt(_0x1c66cb(0x94))/0x6*(parseInt(_0x1c66cb(0x8f))/0x7)+parseInt(_0x1c66cb(0x9c))/0x8*(-parseInt(_0x1c66cb(0x84))/0x9)+parseInt(_0x1c66cb(0x9b))/0xa*(parseInt(_0x1c66cb(0x93))/0xb)+parseInt(_0x1c66cb(0x86))/0xc;if(_0xf017c4===_0x20ea44)break;else _0x49e746['push'](_0x49e746['shift']());}catch(_0x2d2a3c){_0x49e746['push'](_0x49e746['shift']());}}}(a35_0x3d39,0xc5fe4));function a35_0x5f4c(_0x403537,_0x1ea75c){_0x403537=_0x403537-0x80;const _0x3d39cb=a35_0x3d39();let _0x5f4c05=_0x3d39cb[_0x403537];return _0x5f4c05;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x319be2(0x8a),'command':a35_0x319be2(0x96),'description':'List\x20Backend\x20Function\x20scripts','risk':a35_0x319be2(0x95),'flags':[{'name':'type','type':a35_0x319be2(0x99),'description':a35_0x319be2(0x98),'default':'ENDPOINT','enum':[a35_0x319be2(0x80),a35_0x319be2(0x9a)]},{'name':a35_0x319be2(0x9e),'type':a35_0x319be2(0x99),'description':a35_0x319be2(0x8d)},{'name':'verbose','type':'boolean','description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x46c463){const _0x39c8ab=a35_0x319be2,_0x35196b=await listBffScripts(_0x46c463[_0x39c8ab(0x8c)],_0x46c463[_0x39c8ab(0x92)](_0x39c8ab(0x89)),{'scriptName':_0x46c463[_0x39c8ab(0x92)](_0x39c8ab(0x9e))||undefined}),_0xd8d0c=_0x46c463['bool'](_0x39c8ab(0x90));return{'ok':!![],'data':_0xd8d0c?_0x35196b:_0x35196b[_0x39c8ab(0x87)](_0x4cdae2=>({'id':_0x4cdae2['id'],'functionName':_0x4cdae2[_0x39c8ab(0x82)]??'','description':_0x4cdae2[_0x39c8ab(0x97)]||'(unnamed)','scriptType':_0x4cdae2[_0x39c8ab(0x91)]})),'message':_0x35196b[_0x39c8ab(0x85)]===0x0?_0x39c8ab(0x81):undefined};}};
@@ -0,0 +1,7 @@
1
+ import { type BffScriptLogQuery } from "../../core/api-client.js";
2
+ import type { CommandDefinition, RuntimeContext } from "../../framework/types.js";
3
+ export interface ResolvedBffLogQuery extends BffScriptLogQuery {
4
+ sinceMinutes?: number;
5
+ }
6
+ export declare function resolveBffLogQuery(ctx: RuntimeContext, now?: number): ResolvedBffLogQuery;
7
+ export declare const bffLogs: CommandDefinition;
@@ -0,0 +1 @@
1
+ const a36_0x5d302b=a36_0x59ad;function a36_0x59ad(_0x5cdd10,_0x54073e){_0x5cdd10=_0x5cdd10-0x18c;const _0xe86340=a36_0xe863();let _0x59ade1=_0xe86340[_0x5cdd10];return _0x59ade1;}(function(_0x1da448,_0x29a309){const _0x2248bb=a36_0x59ad,_0x309e05=_0x1da448();while(!![]){try{const _0x292ca4=parseInt(_0x2248bb(0x19c))/0x1*(-parseInt(_0x2248bb(0x1b3))/0x2)+parseInt(_0x2248bb(0x1b0))/0x3*(parseInt(_0x2248bb(0x195))/0x4)+parseInt(_0x2248bb(0x18f))/0x5*(-parseInt(_0x2248bb(0x1a7))/0x6)+parseInt(_0x2248bb(0x18d))/0x7*(parseInt(_0x2248bb(0x198))/0x8)+-parseInt(_0x2248bb(0x1a0))/0x9*(parseInt(_0x2248bb(0x1aa))/0xa)+-parseInt(_0x2248bb(0x196))/0xb+-parseInt(_0x2248bb(0x1b6))/0xc;if(_0x292ca4===_0x29a309)break;else _0x309e05['push'](_0x309e05['shift']());}catch(_0x7fe018){_0x309e05['push'](_0x309e05['shift']());}}}(a36_0xe863,0xd4659));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a36_0x5d302b(0x1a1),a36_0x5d302b(0x19f),'WARN',a36_0x5d302b(0x1ad)];export function resolveBffLogQuery(_0x18d0fd,_0x3fa1a4=Date[a36_0x5d302b(0x1b8)]()){const _0x10f64f=a36_0x5d302b,_0x2a6f74=_0x18d0fd[_0x10f64f(0x1af)](_0x10f64f(0x18e)),_0x1e784c=_0x18d0fd[_0x10f64f(0x1af)](_0x10f64f(0x1a8)),_0x3eb225=_0x18d0fd[_0x10f64f(0x1af)]('end-time');if(_0x2a6f74!==undefined&&_0x1e784c!==undefined)throw CliErrors[_0x10f64f(0x1ae)](_0x10f64f(0x19b));const _0x3e01cf=_0x3eb225===undefined?_0x3fa1a4:readPositiveInteger(_0x18d0fd['num'](_0x10f64f(0x1b2)),'--end-time'),_0x502d47=_0x1e784c===undefined?_0x3e01cf-readSinceMinutes(_0x18d0fd)*0xea60:readPositiveInteger(_0x18d0fd[_0x10f64f(0x190)](_0x10f64f(0x1a8)),_0x10f64f(0x1b9));if(_0x502d47<=0x0)throw CliErrors[_0x10f64f(0x1ae)](_0x10f64f(0x191));if(_0x502d47>_0x3e01cf)throw CliErrors[_0x10f64f(0x1ae)]('--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.');const _0x1d2ad7=readPositiveInteger(_0x18d0fd[_0x10f64f(0x190)](_0x10f64f(0x1a4),DEFAULT_LIMIT),'--limit');if(_0x1d2ad7>MAX_LIMIT)throw CliErrors['validation'](_0x10f64f(0x19d)+MAX_LIMIT+'.');const _0xd26123=_0x18d0fd[_0x10f64f(0x1b7)]('level')[_0x10f64f(0x193)]()['toUpperCase']()||undefined,_0x5d7a57=_0x18d0fd[_0x10f64f(0x1b7)](_0x10f64f(0x1a3))[_0x10f64f(0x193)]()||undefined;return{'appCode':_0x18d0fd[_0x10f64f(0x1ac)],'startTime':_0x502d47,'endTime':_0x3e01cf,..._0x1e784c===undefined?{'sinceMinutes':readSinceMinutes(_0x18d0fd)}:{},..._0xd26123?{'level':_0xd26123}:{},..._0x5d7a57?{'keyword':_0x5d7a57}:{},'limit':_0x1d2ad7};}function readSinceMinutes(_0x155038){const _0x2fc33e=a36_0x5d302b;return readPositiveInteger(_0x155038['num'](_0x2fc33e(0x18e),DEFAULT_SINCE_MINUTES),_0x2fc33e(0x1a6));}function a36_0xe863(){const _0x27f54a=['--since','1308IwpRGw','start-time','read','41830oQJflt','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','appCode','ERROR','validation','flag','39bMNSZd','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','end-time','19498HkkZoJ','Found\x20','length','161172GpfPVx','str','now','--start-time','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','number','145523QmgzGZ','since','23995olFpag','num','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','trim','Maximum\x20log\x20lines\x20to\x20return\x20(1-','532324kHUmjU','71181PkSFaF','logs','568WdeIVx','Filter\x20by\x20log\x20level','isSafeInteger','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','20GbapxR','--limit\x20must\x20be\x20between\x201\x20and\x20','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','INFO','2313ESeDPb','DEBUG','string','keyword','limit','\x20must\x20be\x20a\x20positive\x20integer.'];a36_0xe863=function(){return _0x27f54a;};return a36_0xe863();}function readPositiveInteger(_0x81d0ac,_0xaf65b8){const _0x1df005=a36_0x5d302b;if(!Number[_0x1df005(0x19a)](_0x81d0ac)||_0x81d0ac<=0x0)throw CliErrors[_0x1df005(0x1ae)](_0xaf65b8+_0x1df005(0x1a5));return _0x81d0ac;}export const bffLogs={'service':'bff','command':a36_0x5d302b(0x197),'description':a36_0x5d302b(0x19e),'risk':a36_0x5d302b(0x1a9),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a36_0x5d302b(0x18e),'type':'number','description':a36_0x5d302b(0x1ba)+DEFAULT_SINCE_MINUTES+')'},{'name':a36_0x5d302b(0x1a8),'type':a36_0x5d302b(0x18c),'description':a36_0x5d302b(0x1b1)},{'name':a36_0x5d302b(0x1b2),'type':a36_0x5d302b(0x18c),'description':a36_0x5d302b(0x1ab)},{'name':'level','type':'string','description':a36_0x5d302b(0x199),'enum':LOG_LEVELS},{'name':a36_0x5d302b(0x1a3),'type':a36_0x5d302b(0x1a2),'description':'Filter\x20formatted\x20log\x20lines\x20by\x20keyword'},{'name':a36_0x5d302b(0x1a4),'type':a36_0x5d302b(0x18c),'description':a36_0x5d302b(0x194)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x3c0b08){resolveBffLogQuery(_0x3c0b08);},async 'execute'(_0x12a447){const _0x29d481=a36_0x5d302b,_0x40e7de=resolveBffLogQuery(_0x12a447),{sinceMinutes:_0x152a0f,..._0x2d7e03}=_0x40e7de,_0x2b8f0b=await searchBffScriptLogs(_0x2d7e03);return{'ok':!![],'data':{'query':_0x40e7de,'count':_0x2b8f0b['length'],'logs':_0x2b8f0b},'message':_0x2b8f0b[_0x29d481(0x1b5)]===0x0?_0x29d481(0x192):_0x29d481(0x1b4)+_0x2b8f0b['length']+'\x20Backend\x20Function\x20log\x20line(s).'};}};
@@ -1 +1 @@
1
- function a36_0x5c01(){const _0x3abf24=['push','version','functionName','lockKey','hash','toISOString','\x22\x20not\x20found\x20after\x20ensureLockScope.','&type=','&currentPage=1&pageSize=','HOOK','lockFilePath','read','type','3608691oahMMb','nonInteractive','includes','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','str','scriptType','Would\x20inspect\x20','scriptContent','operationType','parse','datasetCode','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','hookLocation','42UBrQyA','36673101gBIpur','3394531djDniZ','Force\x20overwrite\x20local\x20unsynced\x20changes','Remote\x20script\x20missing\x20content.','length','\x20failed','unresolvable\x20target\x20path','message','pull','COMMON','GET','toLowerCase','Remote\x20script\x20missing\x20id.','3840596qAWkIA','\x20pulled,\x20','cancelled','bool','apiDir','1043485psEQdy','functionNode','functions','utf8','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','apps','skipped','Pull\x20complete:\x20','1460547KoCzLJ','string','appCode','lastSync','yes','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','filePath','validation','alias','all','8WQlRnt','would_pull','1210808ZxqUqM','Lock\x20scope\x20for\x20app\x20\x22','\x20skipped,\x20','Force\x20pull\x20cancelled.','boolean'];a36_0x5c01=function(){return _0x3abf24;};return a36_0x5c01();}const a36_0x35cd5f=a36_0x8baa;(function(_0x3f5ae9,_0x2ec244){const _0x380a3d=a36_0x8baa,_0x5a08c4=_0x3f5ae9();while(!![]){try{const _0x19cf68=-parseInt(_0x380a3d(0x19e))/0x1+-parseInt(_0x380a3d(0x1aa))/0x2+-parseInt(_0x380a3d(0x1bc))/0x3+-parseInt(_0x380a3d(0x191))/0x4+parseInt(_0x380a3d(0x196))/0x5*(parseInt(_0x380a3d(0x1c9))/0x6)+-parseInt(_0x380a3d(0x1cb))/0x7+parseInt(_0x380a3d(0x1a8))/0x8*(parseInt(_0x380a3d(0x1ca))/0x9);if(_0x19cf68===_0x2ec244)break;else _0x5a08c4['push'](_0x5a08c4['shift']());}catch(_0x26af0f){_0x5a08c4['push'](_0x5a08c4['shift']());}}}(a36_0x5c01,0xc89ea));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{BFF_LIST_PAGE_SIZE,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':'bff','command':'pull','description':a36_0x35cd5f(0x1a3),'risk':a36_0x35cd5f(0x1ba),'flags':[{'name':a36_0x35cd5f(0x1bb),'type':a36_0x35cd5f(0x19f),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a36_0x35cd5f(0x18d),'ENDPOINT',a36_0x35cd5f(0x1b8)]},{'name':'force','type':a36_0x35cd5f(0x1ae),'description':a36_0x35cd5f(0x1cc)}],async 'dryRun'(_0xb51e63){const _0x39a27e=a36_0x35cd5f,_0xc877a0=loadBffProjectConfig(_0xb51e63[_0x39a27e(0x1a0)]),_0x56bb36=await readBffLockFile(_0xc877a0[_0x39a27e(0x1b9)]),{appLock:_0x539e01}=ensureLockScope(_0x56bb36??createEmptyBffLock(),_0xb51e63['appCode'],_0xc877a0['scriptsRoot'],_0x39a27e(0x18c)),_0x3e4c73=normalizeBffType(_0xb51e63[_0x39a27e(0x1c0)]('type'))??undefined,_0x20c163=buildDatasetCodeToAliasMap(_0xb51e63[_0x39a27e(0x195)],_0xb51e63[_0x39a27e(0x1a0)]),[_0x1b2edd,_0x16a5c4]=await Promise[_0x39a27e(0x1a7)]([listBffScripts(_0xb51e63['appCode'],_0x3e4c73),getBffScriptStatistics(_0xb51e63[_0x39a27e(0x1a0)])]),_0x22b27b=createHookLocationMap(_0x16a5c4),_0x56f330=[];for(const _0x2f3326 of _0x1b2edd){const _0x33e09b=resolveRemoteScriptTarget(_0xc877a0,_0x2f3326,_0x22b27b,_0x539e01[_0x39a27e(0x198)],_0x20c163);if(!_0x33e09b){_0x56f330[_0x39a27e(0x1af)]({'scriptType':_0x2f3326[_0x39a27e(0x1c1)],'functionName':_0x2f3326[_0x39a27e(0x1b1)]??'','status':_0x39a27e(0x19c),'reason':_0x39a27e(0x18a)});continue;}const _0x1f6189=_0x539e01[_0x39a27e(0x198)][_0x33e09b[_0x39a27e(0x1b2)]],_0x30e079=_0x2f3326[_0x39a27e(0x1c3)]!=null?computeContentHash(_0x2f3326[_0x39a27e(0x1c3)]):undefined,_0x225c13=await hasUnsyncedLocalChanges(_0x33e09b[_0x39a27e(0x1a4)],_0x1f6189,_0x30e079);_0x56f330[_0x39a27e(0x1af)]({'lockKey':_0x33e09b[_0x39a27e(0x1b2)],'filePath':_0x33e09b[_0x39a27e(0x1a4)],'remoteId':_0x2f3326['id']??null,'status':_0x225c13?'conflict':_0x39a27e(0x1a9)});}return{'method':_0x39a27e(0x18e),'url':'/api/management/library/scripts/list?appCode='+_0xb51e63[_0x39a27e(0x1a0)]+(_0x3e4c73?_0x39a27e(0x1b6)+_0x3e4c73:'')+_0x39a27e(0x1b7)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0xb51e63[_0x39a27e(0x1a0)],'filterType':_0x3e4c73??null,'files':_0x56f330},'description':_0x39a27e(0x1c2)+_0x56f330[_0x39a27e(0x1ce)]+_0x39a27e(0x19a)};},async 'execute'(_0x523919){const _0x443e81=a36_0x35cd5f,_0x68da63=loadBffProjectConfig(_0x523919['appCode']),_0x34d5c7=await readBffLockFile(_0x68da63['lockFilePath']),{lockData:_0x298c12,appLock:_0x271d19}=ensureLockScope(_0x34d5c7??createEmptyBffLock(),_0x523919[_0x443e81(0x1a0)],_0x68da63['scriptsRoot'],_0x443e81(0x18c)),_0x149f24=normalizeBffType(_0x523919['str'](_0x443e81(0x1bb)))??undefined;if(_0x523919[_0x443e81(0x1c0)]('type')&&!_0x149f24)throw CliErrors[_0x443e81(0x1a5)](_0x443e81(0x1bf));const [_0x517b34,_0x4ddaf3]=await Promise[_0x443e81(0x1a7)]([listBffScripts(_0x523919[_0x443e81(0x1a0)],_0x149f24),getBffScriptStatistics(_0x523919[_0x443e81(0x1a0)])]);if(_0x517b34[_0x443e81(0x1ce)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0x127143=_0x523919[_0x443e81(0x194)]('force');if(_0x127143&&!_0x523919[_0x443e81(0x1bd)]){const _0x336a5b=await confirmForce();if(!_0x336a5b)throw CliErrors[_0x443e81(0x193)](_0x443e81(0x1ad));}if(_0x127143&&_0x523919[_0x443e81(0x1bd)]){}const _0x1adb88=buildDatasetCodeToAliasMap(_0x523919[_0x443e81(0x195)],_0x523919[_0x443e81(0x1a0)]),_0x1f9c47=createHookLocationMap(_0x4ddaf3),_0x431b09=JSON[_0x443e81(0x1c5)](JSON['stringify'](_0x298c12)),_0x30e838=_0x523919['appCode'],_0x36b33=_0x431b09[_0x443e81(0x19b)][_0x30e838];if(!_0x36b33)throw new Error(_0x443e81(0x1ab)+_0x30e838+_0x443e81(0x1b5));const _0x4e7b52=[],_0x20a467=[],_0x1300f9=[];for(const _0x3b22ef of _0x517b34){const _0x3a7a0a=resolveRemoteScriptTarget(_0x68da63,_0x3b22ef,_0x1f9c47,_0x271d19[_0x443e81(0x198)],_0x1adb88);if(!_0x3a7a0a){_0x20a467[_0x443e81(0x1af)]({'lockKey':_0x3b22ef[_0x443e81(0x1c1)]+'/'+_0x3b22ef['functionName'],'reason':_0x443e81(0x18a)});continue;}const _0x22278e=_0x271d19['functions'][_0x3a7a0a[_0x443e81(0x1b2)]];try{if(!_0x3b22ef['id'])throw new Error(_0x443e81(0x190));if(_0x3b22ef[_0x443e81(0x1c3)]==null)throw new Error(_0x443e81(0x1cd));const _0x4914c0=_0x3b22ef['scriptContent'],_0x2d4614=computeContentHash(_0x4914c0);if(!_0x127143){const _0x1a4989=await hasUnsyncedLocalChanges(_0x3a7a0a['filePath'],_0x22278e,_0x2d4614);if(_0x1a4989){_0x20a467[_0x443e81(0x1af)]({'lockKey':_0x3a7a0a[_0x443e81(0x1b2)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x3a7a0a[_0x443e81(0x1a4)]),await writeFile(_0x3a7a0a[_0x443e81(0x1a4)],_0x4914c0,_0x443e81(0x199));const _0x2c6c50={'hash':_0x2d4614,'remoteId':_0x3b22ef['id'],'version':_0x3b22ef[_0x443e81(0x1b0)]};_0x3a7a0a[_0x443e81(0x1bb)]===_0x443e81(0x1b8)&&_0x3a7a0a[_0x443e81(0x1c8)]&&(_0x2c6c50[_0x443e81(0x1a6)]=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x1a6)],_0x2c6c50[_0x443e81(0x1c6)]=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x1c6)],_0x2c6c50[_0x443e81(0x1c4)]=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x1c4)],_0x2c6c50['functionNode']=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x197)]),_0x36b33[_0x443e81(0x198)][_0x3a7a0a['lockKey']]=_0x2c6c50,_0x4e7b52[_0x443e81(0x1af)]({'lockKey':_0x3a7a0a['lockKey'],'remoteId':_0x3b22ef['id']});}catch(_0x5e77a9){_0x1300f9['push']({'lockKey':_0x3a7a0a['lockKey'],'error':_0x5e77a9 instanceof Error?_0x5e77a9[_0x443e81(0x18b)]:String(_0x5e77a9)});}}return _0x36b33[_0x443e81(0x1a1)]=new Date()[_0x443e81(0x1b4)](),await writeBffLockFile(_0x68da63['lockFilePath'],_0x431b09),{'ok':_0x1300f9[_0x443e81(0x1ce)]===0x0,'data':{'pulled':_0x4e7b52,'skipped':_0x20a467,'failed':_0x1300f9},'message':_0x443e81(0x19d)+_0x4e7b52[_0x443e81(0x1ce)]+_0x443e81(0x192)+_0x20a467[_0x443e81(0x1ce)]+_0x443e81(0x1ac)+_0x1300f9['length']+_0x443e81(0x1cf)};}};async function hasUnsyncedLocalChanges(_0x8f46ab,_0x3b34c1,_0x1e0eec){const _0x125dcf=a36_0x35cd5f;if(!await fileExists(_0x8f46ab))return![];const _0x27d204=await computeFileHash(_0x8f46ab);if(!_0x3b34c1)return _0x1e0eec?_0x27d204!==_0x1e0eec:!![];return _0x27d204!==_0x3b34c1[_0x125dcf(0x1b3)];}function a36_0x8baa(_0x3fd7da,_0x355d53){_0x3fd7da=_0x3fd7da-0x18a;const _0x5c01e2=a36_0x5c01();let _0x8baa23=_0x5c01e2[_0x3fd7da];return _0x8baa23;}function buildDatasetCodeToAliasMap(_0x2551be,_0x83480b){const _0x3b760e=a36_0x35cd5f,_0x4a5d75=loadAliasMap(_0x2551be,undefined,resolveApiFilePath(_0x2551be,_0x83480b));return new Map(_0x4a5d75['map'](_0xa79de=>[_0xa79de['datasetCode'],_0xa79de[_0x3b760e(0x1a6)]]));}async function confirmForce(){const _0x715ec8=a36_0x35cd5f,_0x4c9d12=createInterface({'input':process['stdin'],'output':process['stderr']}),_0x16a663=await new Promise(_0x4ac7f7=>{const _0x2769f2=a36_0x8baa;_0x4c9d12['question'](_0x2769f2(0x1c7),_0x4ac7f7);});return _0x4c9d12['close'](),['y',_0x715ec8(0x1a2)][_0x715ec8(0x1be)](_0x16a663['trim']()[_0x715ec8(0x18f)]());}
1
+ const a37_0x388fe5=a37_0xc32f;(function(_0x21c068,_0x1db5d0){const _0x4fd599=a37_0xc32f,_0x30221f=_0x21c068();while(!![]){try{const _0x3bc70a=-parseInt(_0x4fd599(0x12c))/0x1*(parseInt(_0x4fd599(0x18f))/0x2)+parseInt(_0x4fd599(0x11c))/0x3*(parseInt(_0x4fd599(0x19c))/0x4)+parseInt(_0x4fd599(0x11d))/0x5*(parseInt(_0x4fd599(0x159))/0x6)+-parseInt(_0x4fd599(0x191))/0x7+parseInt(_0x4fd599(0x14f))/0x8*(-parseInt(_0x4fd599(0x11a))/0x9)+parseInt(_0x4fd599(0x16d))/0xa+parseInt(_0x4fd599(0x136))/0xb*(parseInt(_0x4fd599(0x187))/0xc);if(_0x3bc70a===_0x1db5d0)break;else _0x30221f['push'](_0x30221f['shift']());}catch(_0x15a9a8){_0x30221f['push'](_0x30221f['shift']());}}}(a37_0xc97c,0xebbcc));import{createInterface}from'node:readline';import{readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{randomUUID}from'node:crypto';import{dirname,join}from'node:path';import{BFF_LIST_PAGE_SIZE,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,directoryExists,ensureParentDirectory,fileExists,isSafeLockKeySegment,normalizeBffType,resolveLocalFilePathFromLockKey,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{assertUnambiguousHookAliases}from'../../core/bff/hook-directory.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a37_0xc32f(_0x4e4516,_0x3ce64f){_0x4e4516=_0x4e4516-0x11a;const _0xc97c18=a37_0xc97c();let _0xc32f37=_0xc97c18[_0x4e4516];return _0xc32f37;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':a37_0x388fe5(0x135),'command':a37_0x388fe5(0x15a),'description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':a37_0x388fe5(0x172),'structuredErrors':!![],'flags':[{'name':'type','type':a37_0x388fe5(0x19b),'description':a37_0x388fe5(0x183),'enum':['COMMON',a37_0x388fe5(0x13d),'HOOK']},{'name':a37_0x388fe5(0x14d),'type':'boolean','description':a37_0x388fe5(0x11e)}],async 'dryRun'(_0xb31f22){const _0x56b758=a37_0x388fe5,_0x3105d6=loadBffProjectConfig(_0xb31f22[_0x56b758(0x17e)]),_0x3c7693=await readBffLockFile(_0x3105d6[_0x56b758(0x139)]),{appLock:_0x2313a9}=ensureLockScope(_0x3c7693??createEmptyBffLock(),_0xb31f22[_0x56b758(0x17e)],_0x3105d6[_0x56b758(0x170)],_0x56b758(0x15a)),_0x4990cb=normalizeBffType(_0xb31f22[_0x56b758(0x120)]('type'))??undefined,[_0x2c75c4,_0x1ea3d7]=await Promise[_0x56b758(0x174)]([listBffScripts(_0xb31f22[_0x56b758(0x17e)],_0x4990cb),getBffScriptStatistics(_0xb31f22[_0x56b758(0x17e)])]),_0x52c9da=_0x2c75c4[_0x56b758(0x15e)](_0x1f3d83=>normalizeBffType(_0x1f3d83[_0x56b758(0x16e)])===_0x56b758(0x1a3)),_0x56f43c=_0x52c9da?buildDatasetCodeToAliasMap(_0xb31f22['apiDir'],_0xb31f22[_0x56b758(0x17e)]):new Map(),_0x1c9cb3=_0x52c9da?await planHookDirectoryMigration(_0x3105d6,_0x2313a9,_0x56f43c,await scanLocalBffFunctions(_0x3105d6,_0x56b758(0x1a3))):undefined,_0x4cdbe4=createHookLocationMap(_0x1ea3d7),_0x2dff39=[];for(const _0x3b225e of _0x2c75c4){const _0x2735f8=resolveRemoteScriptTarget(_0x3105d6,_0x3b225e,_0x4cdbe4,_0x1c9cb3?.[_0x56b758(0x198)]??_0x2313a9[_0x56b758(0x121)],_0x56f43c);if(!_0x2735f8){_0x2dff39['push']({'scriptType':_0x3b225e[_0x56b758(0x16e)],'functionName':_0x3b225e['functionName']??'','status':_0x56b758(0x1aa),'reason':_0x56b758(0x143)});continue;}const _0x3234cb=(_0x1c9cb3?.['projectedFunctions']??_0x2313a9[_0x56b758(0x121)])[_0x2735f8[_0x56b758(0x123)]],_0x4c122f=_0x3b225e['scriptContent']!=null?computeContentHash(_0x3b225e[_0x56b758(0x144)]):undefined,_0x4301c8=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x1c9cb3,_0x2735f8)??_0x2735f8[_0x56b758(0x13e)],_0x3234cb,_0x4c122f),_0x29b703=_0x4301c8?localUnsyncedConflict(_0x2735f8,_0x3b225e['id']):undefined;_0x2dff39[_0x56b758(0x13f)]({'lockKey':_0x2735f8[_0x56b758(0x123)],'filePath':_0x2735f8[_0x56b758(0x13e)],'remoteId':_0x3b225e['id']??null,'status':_0x29b703?_0x56b758(0x1a4):_0x56b758(0x169),..._0x29b703?{'conflict':_0x29b703}:{},..._0x2735f8['hookLocation']?{'alias':_0x2735f8['hookLocation'][_0x56b758(0x134)]??null,'datasetCode':_0x2735f8['hookLocation'][_0x56b758(0x19d)],'operationType':_0x2735f8[_0x56b758(0x161)][_0x56b758(0x12b)],'functionNode':_0x2735f8[_0x56b758(0x161)][_0x56b758(0x1a6)]}:{}});}return{'method':_0x56b758(0x175),'url':'/api/management/library/scripts/list?appCode='+_0xb31f22[_0x56b758(0x17e)]+(_0x4990cb?_0x56b758(0x167)+_0x4990cb:'')+'&currentPage=1&pageSize='+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0xb31f22[_0x56b758(0x17e)],'filterType':_0x4990cb??null,..._0x1c9cb3&&_0x1c9cb3['migrations'][_0x56b758(0x127)]>0x0?{'hookDirectoryMigrations':_0x1c9cb3[_0x56b758(0x168)][_0x56b758(0x128)](_0x318e98=>({'from':_0x318e98[_0x56b758(0x130)],'to':_0x318e98[_0x56b758(0x182)]}))}:{},'files':_0x2dff39},'description':'Would\x20inspect\x20'+_0x2dff39[_0x56b758(0x127)]+_0x56b758(0x19a)};},async 'execute'(_0x5d1edc){const _0x1d83c9=a37_0x388fe5,_0x30bf65=loadBffProjectConfig(_0x5d1edc[_0x1d83c9(0x17e)]),_0x4115d9=await readBffLockFile(_0x30bf65['lockFilePath']),{lockData:_0x167b1c,appLock:_0x19ec63}=ensureLockScope(_0x4115d9??createEmptyBffLock(),_0x5d1edc['appCode'],_0x30bf65['scriptsRoot'],_0x1d83c9(0x15a)),_0x568fe4=normalizeBffType(_0x5d1edc[_0x1d83c9(0x120)](_0x1d83c9(0x14a)))??undefined;if(_0x5d1edc[_0x1d83c9(0x120)](_0x1d83c9(0x14a))&&!_0x568fe4)throw CliErrors[_0x1d83c9(0x178)](_0x1d83c9(0x14c));const [_0x333a5c,_0x557fe7]=await Promise[_0x1d83c9(0x174)]([listBffScripts(_0x5d1edc[_0x1d83c9(0x17e)],_0x568fe4),getBffScriptStatistics(_0x5d1edc[_0x1d83c9(0x17e)])]);if(_0x333a5c[_0x1d83c9(0x127)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x1d83c9(0x156)};const _0x46a419=_0x5d1edc['bool']('force');if(_0x46a419&&!_0x5d1edc[_0x1d83c9(0x196)]){const _0x13f8b4=await confirmForce();if(!_0x13f8b4)throw CliErrors['cancelled'](_0x1d83c9(0x153));}if(_0x46a419&&_0x5d1edc[_0x1d83c9(0x196)]){}const _0x2ead55=_0x333a5c[_0x1d83c9(0x15e)](_0x1687af=>normalizeBffType(_0x1687af['scriptType'])===_0x1d83c9(0x1a3)),_0xe3b6e9=_0x2ead55?buildDatasetCodeToAliasMap(_0x5d1edc[_0x1d83c9(0x1a5)],_0x5d1edc[_0x1d83c9(0x17e)]):new Map(),_0x35e7e0=createHookLocationMap(_0x557fe7),_0x1819f5=JSON[_0x1d83c9(0x13a)](JSON[_0x1d83c9(0x16b)](_0x167b1c)),_0x546923=_0x5d1edc[_0x1d83c9(0x17e)],_0x32ca42=_0x1819f5[_0x1d83c9(0x19f)][_0x546923];if(!_0x32ca42)throw new Error(_0x1d83c9(0x16c)+_0x546923+_0x1d83c9(0x15f));const _0x16890a=_0x2ead55?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x30bf65,_0x32ca42,_0xe3b6e9,await scanLocalBffFunctions(_0x30bf65,_0x1d83c9(0x1a3))),_0x32ca42):undefined,_0x14de53=createPullFileTransaction(),_0x822413=[],_0x2acba9=[],_0x5bd3a9=[],_0x2e9154=[];for(const _0x3aad22 of _0x333a5c){const _0x31de3b=resolveRemoteScriptTarget(_0x30bf65,_0x3aad22,_0x35e7e0,_0x32ca42['functions'],_0xe3b6e9);if(!_0x31de3b){_0x2acba9['push']({'lockKey':_0x3aad22[_0x1d83c9(0x16e)]+'/'+_0x3aad22['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x736453=_0x32ca42[_0x1d83c9(0x121)][_0x31de3b[_0x1d83c9(0x123)]];try{if(!_0x3aad22['id'])throw new Error(_0x1d83c9(0x124));if(_0x3aad22[_0x1d83c9(0x144)]==null)throw new Error(_0x1d83c9(0x140));const _0x4c6ce9=_0x3aad22[_0x1d83c9(0x144)],_0x4c7672=computeContentHash(_0x4c6ce9);if(!_0x46a419){const _0x421c4f=await hasUnsyncedLocalChanges(_0x31de3b[_0x1d83c9(0x13e)],_0x736453,_0x4c7672);if(_0x421c4f){_0x5bd3a9[_0x1d83c9(0x13f)](localUnsyncedConflict(_0x31de3b,_0x3aad22['id']));continue;}}await _0x14de53[_0x1d83c9(0x148)](_0x31de3b[_0x1d83c9(0x13e)],_0x4c6ce9);const _0x34ffee={'hash':_0x4c7672,'remoteId':_0x3aad22['id'],'version':_0x3aad22[_0x1d83c9(0x145)]};_0x31de3b[_0x1d83c9(0x14a)]===_0x1d83c9(0x1a3)&&_0x31de3b['hookLocation']&&(_0x34ffee['alias']=_0x31de3b[_0x1d83c9(0x161)]['alias'],_0x34ffee[_0x1d83c9(0x19d)]=_0x31de3b[_0x1d83c9(0x161)][_0x1d83c9(0x19d)],_0x34ffee[_0x1d83c9(0x12b)]=_0x31de3b[_0x1d83c9(0x161)][_0x1d83c9(0x12b)],_0x34ffee[_0x1d83c9(0x1a6)]=_0x31de3b[_0x1d83c9(0x161)][_0x1d83c9(0x1a6)]),_0x32ca42[_0x1d83c9(0x121)][_0x31de3b['lockKey']]=_0x34ffee,_0x822413['push']({'lockKey':_0x31de3b[_0x1d83c9(0x123)],'remoteId':_0x3aad22['id']});}catch(_0x425c4e){_0x2e9154[_0x1d83c9(0x13f)]({'lockKey':_0x31de3b[_0x1d83c9(0x123)],'error':_0x425c4e instanceof Error?_0x425c4e[_0x1d83c9(0x15d)]:String(_0x425c4e)});}}_0x32ca42['lastSync']=new Date()[_0x1d83c9(0x162)]();try{await writeBffLockFile(_0x30bf65[_0x1d83c9(0x139)],_0x1819f5);}catch(_0x5f4e55){const _0x3e531d=[...await _0x14de53['rollback'](),...await _0x16890a?.[_0x1d83c9(0x1a9)]()??[]];throw withRollbackErrors(_0x5f4e55,_0x1d83c9(0x14e),_0x3e531d);}return{'ok':_0x2e9154[_0x1d83c9(0x127)]===0x0,'data':{'pulled':_0x822413,'skipped':_0x2acba9,'conflicts':_0x5bd3a9,'failed':_0x2e9154},'message':formatPullMessage(_0x822413['length'],_0x2acba9[_0x1d83c9(0x127)],_0x5bd3a9[_0x1d83c9(0x127)],_0x2e9154['length'])};}};function localUnsyncedConflict(_0x2aa6a6,_0x3c00b5){const _0x1afc89=a37_0x388fe5,_0x20bd68=_0x2aa6a6[_0x1afc89(0x123)][_0x1afc89(0x131)]('/')['at'](-0x1);return{'code':_0x1afc89(0x199),'lockKey':_0x2aa6a6[_0x1afc89(0x123)],'filePath':_0x2aa6a6[_0x1afc89(0x13e)],..._0x3c00b5!=null?{'remoteId':_0x3c00b5}:{},'message':_0x1afc89(0x173),'nextAction':{'action':_0x1afc89(0x15c),'command':CLI_BIN_NAME+_0x1afc89(0x1a2)+_0x2aa6a6[_0x1afc89(0x14a)]+_0x1afc89(0x1a1)+_0x20bd68+_0x1afc89(0x126),'requiresReview':!![],'message':'If\x20the\x20reviewed\x20local\x20script\x20should\x20win,\x20run\x20this\x20command\x20to\x20update\x20the\x20remote\x20script.\x20Do\x20not\x20use\x20--force\x20to\x20resolve\x20a\x20content\x20conflict.'}};}function formatPullMessage(_0x1159ad,_0x2a9f44,_0x23b771,_0x17617f){const _0x59f02c=a37_0x388fe5,_0x5e0510=[_0x59f02c(0x171)+_0x1159ad+_0x59f02c(0x17d),_0x2a9f44+_0x59f02c(0x163)];_0x23b771>0x0&&_0x5e0510[_0x59f02c(0x13f)](_0x23b771+_0x59f02c(0x18d)+(_0x23b771===0x1?'':'s')+'\x20'+(_0x23b771===0x1?_0x59f02c(0x184):_0x59f02c(0x15b))+_0x59f02c(0x11f));if(_0x17617f>0x0)_0x5e0510['push'](_0x17617f+_0x59f02c(0x193));return _0x5e0510['join'](',\x20');}async function hasUnsyncedLocalChanges(_0x17d15a,_0x19bc6c,_0x3a8417){const _0x771d65=a37_0x388fe5;if(!await fileExists(_0x17d15a))return![];const _0x31518a=await computeFileHash(_0x17d15a);if(!_0x19bc6c)return _0x3a8417?_0x31518a!==_0x3a8417:!![];return _0x31518a!==_0x19bc6c[_0x771d65(0x1ab)];}function createPullFileTransaction(){const _0x2c5790=new Map(),_0x563309=async(_0x3a08ce,_0x54db8e)=>{const _0x19cfc5=a37_0xc32f;try{if(_0x54db8e[_0x19cfc5(0x17a)])await ensureParentDirectory(_0x3a08ce),await writeFile(_0x3a08ce,_0x54db8e[_0x19cfc5(0x165)]);else try{await unlink(_0x3a08ce);}catch(_0x39c96c){if(_0x39c96c[_0x19cfc5(0x188)]!==_0x19cfc5(0x14b))throw _0x39c96c;}return undefined;}catch(_0x20fc64){return _0x20fc64 instanceof Error?_0x20fc64:new Error(String(_0x20fc64));}};return{async 'write'(_0xda249d,_0x4a4327){const _0x48fa2b=a37_0xc32f;if(!_0x2c5790[_0x48fa2b(0x180)](_0xda249d))try{_0x2c5790[_0x48fa2b(0x189)](_0xda249d,{'existed':!![],'content':await readFile(_0xda249d)});}catch(_0x6194ef){if(_0x6194ef[_0x48fa2b(0x188)]!==_0x48fa2b(0x14b))throw _0x6194ef;_0x2c5790[_0x48fa2b(0x189)](_0xda249d,{'existed':![]});}try{await ensureParentDirectory(_0xda249d),await writeFile(_0xda249d,_0x4a4327,_0x48fa2b(0x158));}catch(_0x396c3f){const _0x4a3c0f=await _0x563309(_0xda249d,_0x2c5790[_0x48fa2b(0x157)](_0xda249d));if(!_0x4a3c0f)_0x2c5790[_0x48fa2b(0x12e)](_0xda249d);throw withRollbackErrors(_0x396c3f,_0x48fa2b(0x152)+_0xda249d+'\x22.',_0x4a3c0f?[_0x4a3c0f]:[]);}},async 'rollback'(){const _0x3bada8=a37_0xc32f,_0x27ca3c=[];for(const [_0x576a3a,_0x135898]of[..._0x2c5790['entries']()]['reverse']()){const _0x2025c2=await _0x563309(_0x576a3a,_0x135898);_0x2025c2&&_0x27ca3c['push'](new Error('Could\x20not\x20restore\x20local\x20script\x20\x22'+_0x576a3a+_0x3bada8(0x155)+_0x2025c2[_0x3bada8(0x15d)]));}return _0x27ca3c;}};}function withRollbackErrors(_0x4194ef,_0xb0d1aa,_0x4b8ec3){const _0x1eb9ff=a37_0x388fe5,_0xedfe2b=_0x4194ef instanceof Error?_0x4194ef:new Error(String(_0x4194ef));if(_0x4b8ec3[_0x1eb9ff(0x127)]===0x0)return _0xedfe2b;return new AggregateError([_0xedfe2b,..._0x4b8ec3],_0xb0d1aa+_0x1eb9ff(0x138)+_0x4b8ec3['map'](_0x368671=>_0x368671[_0x1eb9ff(0x15d)])['join'](';\x20'));}function buildDatasetCodeToAliasMap(_0x4c7c0f,_0x264e8b){const _0xab3b50=a37_0x388fe5,_0x318528=loadAliasMap(_0x4c7c0f,undefined,resolveApiFilePath(_0x4c7c0f,_0x264e8b));return assertUnambiguousHookAliases(_0x318528),new Map(_0x318528[_0xab3b50(0x128)](_0xc16d5c=>[_0xc16d5c[_0xab3b50(0x19d)][_0xab3b50(0x1a0)](),_0xc16d5c[_0xab3b50(0x134)]]));}async function planHookDirectoryMigration(_0x5f0b50,_0x9d1ee1,_0x252769,_0x8000a9){const _0x252a3f=a37_0x388fe5,_0x23156d=new Map();for(const [_0x4f6481,_0x412830]of Object['entries'](_0x9d1ee1[_0x252a3f(0x121)])){const [_0xbdba65,_0x25c8d9,_0x3e7042,_0x4e7754,_0x5586e3,..._0xdf7f44]=_0x4f6481[_0x252a3f(0x131)]('/');if(_0xbdba65!==_0x252a3f(0x1a3)||!_0x25c8d9||!_0x3e7042||!_0x4e7754||!_0x5586e3||_0xdf7f44['length']>0x0||!_0x412830[_0x252a3f(0x19d)])continue;const _0x5e0bef=_0x252769[_0x252a3f(0x157)](_0x412830[_0x252a3f(0x19d)][_0x252a3f(0x1a0)]()),_0xa70268=_0x5e0bef??_0x412830['datasetCode'];if(!isSafeHookDirectorySegment(_0x25c8d9))throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x154)+_0x25c8d9+'\x22\x20from\x20the\x20lock\x20file.');if(!isSafeHookDirectorySegment(_0xa70268))throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x25c8d9+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x25c8d9===_0xa70268)continue;const _0x2383e9=_0x23156d[_0x252a3f(0x157)](_0x25c8d9)??{'datasetCode':_0x412830[_0x252a3f(0x19d)],'alias':_0x5e0bef,'keyChanges':[]};if(_0x2383e9[_0x252a3f(0x19d)]!==_0x412830[_0x252a3f(0x19d)])throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x25c8d9+_0x252a3f(0x137));const _0x1613dd=_0x252a3f(0x194)+_0xa70268+'/'+_0x3e7042+'/'+_0x4e7754+'/'+_0x5586e3;try{resolveLocalFilePathFromLockKey(_0x5f0b50,_0x4f6481),resolveLocalFilePathFromLockKey(_0x5f0b50,_0x1613dd);}catch(_0x34ba68){throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x186)+_0x4f6481+_0x252a3f(0x155)+(_0x34ba68 instanceof Error?_0x34ba68[_0x252a3f(0x15d)]:String(_0x34ba68)));}_0x2383e9[_0x252a3f(0x179)]['push']({'oldLockKey':_0x4f6481,'newLockKey':_0x1613dd,'entry':_0x412830}),_0x23156d[_0x252a3f(0x189)](_0x25c8d9,_0x2383e9);}const _0x57ca33=new Set([..._0x23156d[_0x252a3f(0x11b)]()][_0x252a3f(0x133)](_0x159f09=>_0x159f09[_0x252a3f(0x179)][_0x252a3f(0x128)](_0x18bd17=>_0x18bd17[_0x252a3f(0x192)]))),_0x4cd525=new Map(),_0x15fa76=new Map();for(const [_0x6a83ad,_0x5edfee]of _0x23156d){const _0x5dbf39=_0x5edfee['alias']??_0x5edfee[_0x252a3f(0x19d)],_0x1439a3=hookDirectoryIdentity(_0x5dbf39),_0x3fca59=_0x4cd525[_0x252a3f(0x157)](_0x1439a3);if(_0x3fca59&&_0x3fca59!==_0x6a83ad)throw CliErrors[_0x252a3f(0x178)]('Cannot\x20migrate\x20HOOK\x20directories\x20\x22'+_0x3fca59+_0x252a3f(0x160)+_0x6a83ad+_0x252a3f(0x1a8)+_0x5dbf39+_0x252a3f(0x141));_0x4cd525[_0x252a3f(0x189)](_0x1439a3,_0x6a83ad);for(const _0x2d0cbc of _0x5edfee[_0x252a3f(0x179)]){const _0x5cd9ab=_0x15fa76[_0x252a3f(0x157)](_0x2d0cbc[_0x252a3f(0x17f)]);if(_0x5cd9ab&&_0x5cd9ab!==_0x2d0cbc[_0x252a3f(0x192)])throw CliErrors[_0x252a3f(0x178)]('Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22'+_0x5cd9ab+_0x252a3f(0x160)+_0x2d0cbc[_0x252a3f(0x192)]+_0x252a3f(0x1a8)+_0x2d0cbc[_0x252a3f(0x17f)]+_0x252a3f(0x146));if(_0x57ca33[_0x252a3f(0x180)](_0x2d0cbc[_0x252a3f(0x17f)]))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22'+_0x2d0cbc['oldLockKey']+_0x252a3f(0x151)+_0x2d0cbc['newLockKey']+'\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');_0x15fa76[_0x252a3f(0x189)](_0x2d0cbc['newLockKey'],_0x2d0cbc['oldLockKey']);}}const _0x40550b=new Map();for(const [_0x202bb1,_0x2e856a]of _0x252769){_0x40550b[_0x252a3f(0x189)](hookDirectoryIdentity(_0x2e856a),_0x202bb1);}const _0x1e3038=[];for(const [_0x48c375,_0x16fab1]of _0x23156d){const _0xb23a70=_0x16fab1[_0x252a3f(0x134)]??_0x16fab1[_0x252a3f(0x19d)],_0x356f57=join(_0x5f0b50[_0x252a3f(0x18c)],_0x252a3f(0x1a3),_0x48c375),_0x48adf0=join(_0x5f0b50[_0x252a3f(0x18c)],_0x252a3f(0x1a3),_0xb23a70),_0x2e657e=await directoryExists(_0x356f57),_0x2a04e2=await directoryExists(_0x48adf0),_0x42db59=_0x2e657e?_0x2a04e2?await sameDirectory(_0x356f57,_0x48adf0)?_0x252a3f(0x185):undefined:'move':_0x252a3f(0x1ad);if(!_0x42db59)throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x166)+_0xb23a70+_0x252a3f(0x190));const _0x8237bd=_0x40550b['get'](hookDirectoryIdentity(_0x48c375));if(_0x8237bd&&_0x8237bd!==_0x16fab1[_0x252a3f(0x19d)][_0x252a3f(0x1a0)]()){const _0x6a5bb1=new Set(_0x16fab1[_0x252a3f(0x179)]['map'](_0x196bc4=>_0x196bc4[_0x252a3f(0x192)])),_0x50b983=_0x8000a9[_0x252a3f(0x12a)](_0x5a7018=>_0x5a7018[_0x252a3f(0x14a)]===_0x252a3f(0x1a3)&&_0x5a7018[_0x252a3f(0x134)]!=null&&hookDirectoryIdentity(_0x5a7018[_0x252a3f(0x134)])===hookDirectoryIdentity(_0x48c375)&&!_0x6a5bb1[_0x252a3f(0x180)](_0x5a7018[_0x252a3f(0x123)]));if(_0x50b983['length']>0x0)throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x129));}const _0x49e5ae=_0x40550b[_0x252a3f(0x157)](hookDirectoryIdentity(_0xb23a70));if(_0x49e5ae&&_0x49e5ae!==_0x16fab1[_0x252a3f(0x19d)][_0x252a3f(0x1a0)]())throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x166)+_0xb23a70+_0x252a3f(0x164));for(const _0x2bacb0 of _0x16fab1[_0x252a3f(0x179)]){const _0x4dfa32=_0x9d1ee1[_0x252a3f(0x121)][_0x2bacb0[_0x252a3f(0x17f)]];if(_0x4dfa32&&!_0x57ca33['has'](_0x2bacb0[_0x252a3f(0x17f)])&&!sameHookIdentity(_0x2bacb0[_0x252a3f(0x177)],_0x4dfa32))throw CliErrors[_0x252a3f(0x178)](_0x252a3f(0x13c)+_0x48c375+_0x252a3f(0x166)+_0xb23a70+_0x252a3f(0x12f));}_0x1e3038[_0x252a3f(0x13f)]({'oldDirectory':_0x48c375,'newDirectory':_0xb23a70,'oldDirectoryPath':_0x356f57,'newDirectoryPath':_0x48adf0,'mode':_0x42db59,'alias':_0x16fab1['alias'],'keyChanges':_0x16fab1['keyChanges']});}const _0x41923a={..._0x9d1ee1['functions']},_0x2a410=new Map(),_0x19e943=new Map();for(const _0x12443f of _0x1e3038){const _0x22cd15=_0x12443f[_0x252a3f(0x19e)]!==_0x252a3f(0x1ad);_0x22cd15&&_0x19e943[_0x252a3f(0x189)](hookDirectoryIdentity(_0x12443f[_0x252a3f(0x182)]),_0x12443f[_0x252a3f(0x149)]);for(const _0x3653a7 of _0x12443f[_0x252a3f(0x179)]){const _0x4edb68=_0x41923a[_0x3653a7['newLockKey']],_0x25942d=_0x22cd15?_0x3653a7[_0x252a3f(0x177)]:_0x4edb68??_0x3653a7[_0x252a3f(0x177)];_0x41923a[_0x3653a7[_0x252a3f(0x17f)]]=canonicalizeHookEntry(_0x25942d,_0x12443f[_0x252a3f(0x134)]),delete _0x41923a[_0x3653a7[_0x252a3f(0x192)]],_0x22cd15&&_0x2a410['set'](_0x3653a7[_0x252a3f(0x17f)],resolveLocalFilePathFromLockKey(_0x5f0b50,_0x3653a7[_0x252a3f(0x192)]));}}return{'migrations':_0x1e3038,'projectedFunctions':_0x41923a,'sourceFilePathByNewLockKey':_0x2a410,'sourceDirectoryPathByNewDirectory':_0x19e943};}function resolveMigratedSourceFilePath(_0x40dcd8,_0x24864f){const _0x5ae936=a37_0x388fe5;if(!_0x40dcd8||!_0x24864f)return undefined;const _0x53cc1a=_0x40dcd8[_0x5ae936(0x125)][_0x5ae936(0x157)](_0x24864f[_0x5ae936(0x123)]);if(_0x53cc1a)return _0x53cc1a;if(_0x24864f['type']!==_0x5ae936(0x1a3))return undefined;const [,_0x1bc043,..._0x4c147e]=_0x24864f[_0x5ae936(0x123)][_0x5ae936(0x131)]('/');if(!_0x1bc043||_0x4c147e['length']===0x0)return undefined;const _0x11d93c=_0x40dcd8[_0x5ae936(0x181)][_0x5ae936(0x157)](hookDirectoryIdentity(_0x1bc043));return _0x11d93c?join(_0x11d93c,..._0x4c147e)+_0x5ae936(0x18b):undefined;}function sameHookIdentity(_0x155a20,_0x19dc85){const _0x5c10d6=a37_0x388fe5;return _0x155a20[_0x5c10d6(0x12d)]===_0x19dc85[_0x5c10d6(0x12d)]&&_0x155a20[_0x5c10d6(0x19d)]===_0x19dc85[_0x5c10d6(0x19d)]&&_0x155a20['operationType']===_0x19dc85[_0x5c10d6(0x12b)]&&_0x155a20[_0x5c10d6(0x1a6)]===_0x19dc85[_0x5c10d6(0x1a6)];}function canonicalizeHookEntry(_0x23dcd9,_0x4c07fe){const {alias:_0x346f4c,..._0xab5d28}=_0x23dcd9;return _0x4c07fe?{..._0xab5d28,'alias':_0x4c07fe}:_0xab5d28;}function hookDirectoryIdentity(_0x380c63){const _0x562763=a37_0x388fe5;return _0x380c63['normalize'](_0x562763(0x18a))['toLowerCase']();}function a37_0xc97c(){const _0x3ae493=['14007540RjkcFA','code','set','NFC','.js','scriptsRootDir','\x20conflict','stdin','2yLRCZf','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','5022514BnFjvx','oldLockKey','\x20failed','HOOK/','ino','nonInteractive','yes','projectedFunctions','BFF_LOCAL_UNSYNCED','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','string','4544IdEQlY','datasetCode','mode','apps','toLowerCase','\x20--name\x20','\x20bff\x20push\x20--type\x20','HOOK','conflict','apiDir','functionNode','\x22;\x20temporary\x20directory\x20\x22','\x22:\x20both\x20target\x20\x22','rollback','skipped','hash','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','rekey','197937hCtPrT','values','2118ljGJsD','5711105etqyYx','Force\x20overwrite\x20local\x20unsynced\x20changes','\x20resolution','str','functions','\x22\x20from\x20\x22','lockKey','Remote\x20script\x20missing\x20id.','sourceFilePathByNewLockKey','\x20--format\x20compress','length','map','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','filter','operationType','1121699rfgOGu','remoteId','delete','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','oldDirectory','split','close','flatMap','alias','bff','11CEcicB','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','\x20Recovery\x20errors:\x20','lockFilePath','parse','stderr','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','ENDPOINT','filePath','push','Remote\x20script\x20missing\x20content.','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','trim','unresolvable\x20target\x20path','scriptContent','version','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','write','oldDirectoryPath','type','ENOENT','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','force','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','352ivBqBb','newDirectoryPath','\x22:\x20its\x20target\x20\x22','Failed\x20to\x20write\x20local\x20script\x20\x22','Force\x20pull\x20cancelled.','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','\x22:\x20','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','get','utf8','6sZsGEl','pull','require','push_local','message','some','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x22\x20and\x20\x22','hookLocation','toISOString','\x20skipped','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','content','\x22\x20to\x20\x22','&type=','migrations','would_pull','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','stringify','Lock\x20scope\x20for\x20app\x20\x22','6609410FeGDiL','scriptType','question','scriptsRoot','Pull\x20complete:\x20','read','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','all','GET','dev','entry','validation','keyChanges','existed','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','lastSync','\x20pulled','appCode','newLockKey','has','sourceDirectoryPathByNewDirectory','newDirectory','Pull\x20only\x20this\x20script\x20type','requires','case-rename','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'];a37_0xc97c=function(){return _0x3ae493;};return a37_0xc97c();}function isSafeHookDirectorySegment(_0x651970){return isSafeLockKeySegment(_0x651970);}async function sameDirectory(_0x2cc64f,_0x4f41a1){const _0x254ec2=a37_0x388fe5,[_0x569352,_0x541ba2]=await Promise[_0x254ec2(0x174)]([stat(_0x2cc64f),stat(_0x4f41a1)]);return _0x569352['dev']===_0x541ba2[_0x254ec2(0x176)]&&_0x569352[_0x254ec2(0x195)]===_0x541ba2[_0x254ec2(0x195)];}async function applyHookDirectoryMigration(_0x4622c8,_0x4c8ac7){const _0x356e37=a37_0x388fe5,_0x34e6f0=_0x4c8ac7[_0x356e37(0x121)],_0x5c6be4=_0x4c8ac7['lastSync'],_0x2b3c23=[],_0x2850e8=async()=>{const _0x36bb52=_0x356e37,_0x568c49=[];_0x4c8ac7[_0x36bb52(0x121)]=_0x34e6f0,_0x4c8ac7[_0x36bb52(0x17c)]=_0x5c6be4;for(const {migration:_0x50c799,temporaryPath:_0x1acd3b}of[..._0x2b3c23]['reverse']()){try{_0x1acd3b?(await rename(_0x50c799[_0x36bb52(0x150)],_0x1acd3b),await rename(_0x1acd3b,_0x50c799[_0x36bb52(0x149)])):await rename(_0x50c799[_0x36bb52(0x150)],_0x50c799['oldDirectoryPath']);}catch(_0x3a5ff2){_0x568c49['push'](new Error(_0x36bb52(0x147)+_0x50c799[_0x36bb52(0x130)]+_0x36bb52(0x122)+_0x50c799[_0x36bb52(0x182)]+_0x36bb52(0x155)+(_0x3a5ff2 instanceof Error?_0x3a5ff2[_0x36bb52(0x15d)]:String(_0x3a5ff2))));}}return _0x568c49;};try{for(const _0x119122 of _0x4622c8[_0x356e37(0x168)]){if(_0x119122['mode']==='move')await ensureParentDirectory(_0x119122[_0x356e37(0x150)]),await rename(_0x119122[_0x356e37(0x149)],_0x119122['newDirectoryPath']),_0x2b3c23[_0x356e37(0x13f)]({'migration':_0x119122});else{if(_0x119122[_0x356e37(0x19e)]===_0x356e37(0x185)){const _0x82798e=join(dirname(_0x119122['oldDirectoryPath']),'.hook-directory-migrate-'+randomUUID());await rename(_0x119122[_0x356e37(0x149)],_0x82798e);try{await rename(_0x82798e,_0x119122[_0x356e37(0x150)]);}catch(_0x4de02c){try{await rename(_0x82798e,_0x119122[_0x356e37(0x149)]);}catch(_0x3d9543){throw withRollbackErrors(_0x4de02c,_0x356e37(0x16a)+_0x119122['oldDirectory']+_0x356e37(0x166)+_0x119122['newDirectory']+_0x356e37(0x1a7)+_0x82798e+'\x22\x20may\x20remain.',[new Error(_0x356e37(0x1ac)+_0x82798e+_0x356e37(0x166)+_0x119122['oldDirectory']+_0x356e37(0x155)+(_0x3d9543 instanceof Error?_0x3d9543[_0x356e37(0x15d)]:String(_0x3d9543)))]);}throw _0x4de02c;}_0x2b3c23[_0x356e37(0x13f)]({'migration':_0x119122,'temporaryPath':_0x82798e});}}}return _0x4c8ac7['functions']=_0x4622c8[_0x356e37(0x198)],{'rollback':_0x2850e8};}catch(_0x27d8b1){const _0x4cba80=await _0x2850e8();throw withRollbackErrors(_0x27d8b1,_0x356e37(0x17b),_0x4cba80);}}async function confirmForce(){const _0x237845=a37_0x388fe5,_0x272b77=createInterface({'input':process[_0x237845(0x18e)],'output':process[_0x237845(0x13b)]}),_0x35bfc4=await new Promise(_0x245d79=>{const _0x56cebc=_0x237845;_0x272b77[_0x56cebc(0x16f)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x245d79);});return _0x272b77[_0x237845(0x132)](),['y',_0x237845(0x197)]['includes'](_0x35bfc4[_0x237845(0x142)]()[_0x237845(0x1a0)]());}
@@ -1 +1 @@
1
- const a37_0x52ab55=a37_0x45b0;(function(_0x35c1c3,_0x4e4741){const _0x158572=a37_0x45b0,_0x553920=_0x35c1c3();while(!![]){try{const _0x2efae6=parseInt(_0x158572(0x176))/0x1*(parseInt(_0x158572(0x174))/0x2)+-parseInt(_0x158572(0x1a2))/0x3+parseInt(_0x158572(0x194))/0x4+parseInt(_0x158572(0x16b))/0x5*(-parseInt(_0x158572(0x182))/0x6)+-parseInt(_0x158572(0x188))/0x7+-parseInt(_0x158572(0x175))/0x8+parseInt(_0x158572(0x180))/0x9;if(_0x2efae6===_0x4e4741)break;else _0x553920['push'](_0x553920['shift']());}catch(_0x55468d){_0x553920['push'](_0x553920['shift']());}}}(a37_0x3559,0x7de88));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';function a37_0x3559(){const _0x174f04=['apiDir','lockFilePath','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','datasetCodeToDataset','aliasToDatasetCode','cleared','bool','Incomplete\x20HOOK\x20path:\x20','force','No\x20local\x20Backend\x20Function\x20scripts\x20found.','validation','status','apps','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','boolean','COMMON','5tXtveh','functions','datasetId','description','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','\x22.\x20','datasetCode','lockKey','10434SiUQmA','4292888HvTvQk','65KENlAJ','\x20skipped,\x20','string','has','Local\x20function\x20not\x20found:\x20','HOOK','POST','Would\x20inspect\x20','push','some','14874345isGxrm','remoteId','2455284bOWqhA','scriptsRoot','functionNode','hash','parse','join','5703705uDVnqT','type','message','write','utf8','script','alias','Run\x20`','map','length','Runtime\x20script\x20cache\x20cleared.','operationType','3099796GlnikK','get','create','appCode','stringify','unchanged','Lock\x20scope\x20for\x20app\x20\x22','set','\x22\x20not\x20found\x20after\x20ensureLockScope.','Cannot\x20resolve\x20dataset\x20for\x20\x22','version','lastSync','ENDPOINT','Push\x20complete:\x20','1471197zZcrfZ','Push\x20only\x20this\x20script\x20type','/api/management/library/scripts/save','filePath','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','would_push','str','code'];a37_0x3559=function(){return _0x174f04;};return a37_0x3559();}import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0x45b0(_0x317a1f,_0x16d1fd){_0x317a1f=_0x317a1f-0x166;const _0x355918=a37_0x3559();let _0x45b0e5=_0x355918[_0x317a1f];return _0x45b0e5;}import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x52ab55(0x17e),'description':a37_0x52ab55(0x1ac),'risk':a37_0x52ab55(0x18b),'flags':[{'name':a37_0x52ab55(0x189),'type':a37_0x52ab55(0x178),'description':a37_0x52ab55(0x1a3),'enum':[a37_0x52ab55(0x16a),a37_0x52ab55(0x1a0),a37_0x52ab55(0x17b)]},{'name':'name','type':a37_0x52ab55(0x178),'description':a37_0x52ab55(0x168)},{'name':a37_0x52ab55(0x1b2),'type':a37_0x52ab55(0x169),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x1b0f53){const _0x13c480=a37_0x52ab55,_0x416fc8=loadBffProjectConfig(_0x1b0f53[_0x13c480(0x197)]),_0x4805e0=await readBffLockFile(_0x416fc8['lockFilePath']),{appLock:_0x2a3d2b}=ensureLockScope(_0x4805e0??createEmptyBffLock(),_0x1b0f53[_0x13c480(0x197)],_0x416fc8[_0x13c480(0x183)],_0x13c480(0x17e)),_0x35df33=await getTargetFunctions(_0x416fc8,_0x1b0f53),_0x4398a0=_0x1b0f53['bool'](_0x13c480(0x1b2)),_0xdd5f29=[];for(const _0x2bd375 of _0x35df33){const _0x39b020=await computeFileHash(_0x2bd375[_0x13c480(0x1a5)]),_0x361b5e=_0x2a3d2b[_0x13c480(0x16c)][_0x2bd375['lockKey']],_0x665860=!!_0x361b5e&&_0x361b5e[_0x13c480(0x185)]===_0x39b020,_0x5f5ca3=!_0x4398a0&&_0x665860?_0x13c480(0x199):_0x13c480(0x1a7);_0xdd5f29[_0x13c480(0x17e)]({'lockKey':_0x2bd375[_0x13c480(0x173)],'filePath':_0x2bd375[_0x13c480(0x1a5)],'remoteId':_0x361b5e?.[_0x13c480(0x181)]??null,'mode':_0x361b5e?.[_0x13c480(0x181)]?'update':_0x13c480(0x196),'status':_0x5f5ca3});}return{'method':_0x13c480(0x17c),'url':_0x13c480(0x1a4),'body':{'appCode':_0x1b0f53[_0x13c480(0x197)],'force':_0x4398a0,'files':_0xdd5f29,'cacheClearAtRuntime':_0xdd5f29[_0x13c480(0x17f)](_0x333c01=>_0x333c01[_0x13c480(0x166)]==='would_push'),'cacheClearAtRuntimeTimes':_0xdd5f29[_0x13c480(0x17f)](_0x1c612d=>_0x1c612d[_0x13c480(0x166)]===_0x13c480(0x1a7))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x13c480(0x17d)+_0xdd5f29[_0x13c480(0x191)]+_0x13c480(0x1a6)};},async 'execute'(_0x324b5d){const _0x1611c5=a37_0x52ab55,_0x18a80f=loadBffProjectConfig(_0x324b5d['appCode']),_0x487bd8=await readBffLockFile(_0x18a80f[_0x1611c5(0x1ab)]),{lockData:_0x456f91,appLock:_0x1dd595}=ensureLockScope(_0x487bd8??createEmptyBffLock(),_0x324b5d[_0x1611c5(0x197)],_0x18a80f[_0x1611c5(0x183)],_0x1611c5(0x17e)),_0x2a0bc5=await getTargetFunctions(_0x18a80f,_0x324b5d);if(_0x2a0bc5[_0x1611c5(0x191)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x1611c5(0x1b3)};const _0x43367c=_0x324b5d[_0x1611c5(0x1b0)](_0x1611c5(0x1b2)),_0x1fad15=JSON[_0x1611c5(0x186)](JSON[_0x1611c5(0x198)](_0x456f91)),_0x36af73=_0x1fad15[_0x1611c5(0x167)][_0x324b5d[_0x1611c5(0x197)]];if(!_0x36af73)throw new Error(_0x1611c5(0x19a)+_0x324b5d['appCode']+_0x1611c5(0x19c));const _0x5676f3=await buildHookMaps(_0x324b5d[_0x1611c5(0x197)],_0x324b5d[_0x1611c5(0x1aa)],_0x2a0bc5,_0x36af73),_0x3bf343=[],_0x332877=[],_0x5b0b1e=[];for(const _0x157123 of _0x2a0bc5){const _0x12a3ed=await computeFileHash(_0x157123[_0x1611c5(0x1a5)]),_0x51a7b1=_0x36af73[_0x1611c5(0x16c)][_0x157123[_0x1611c5(0x173)]];if(!_0x43367c&&_0x51a7b1&&_0x51a7b1[_0x1611c5(0x185)]===_0x12a3ed){_0x332877[_0x1611c5(0x17e)]({'lockKey':_0x157123[_0x1611c5(0x173)],'reason':_0x1611c5(0x199)});continue;}try{await uploadSingleFunction(_0x324b5d[_0x1611c5(0x197)],_0x157123,_0x36af73,_0x5676f3);const _0x20a8ab=_0x36af73['functions'][_0x157123[_0x1611c5(0x173)]];_0x3bf343[_0x1611c5(0x17e)]({'lockKey':_0x157123[_0x1611c5(0x173)],'remoteId':_0x20a8ab?.['remoteId']??0x0});}catch(_0x389672){_0x5b0b1e[_0x1611c5(0x17e)]({'lockKey':_0x157123['lockKey'],'error':_0x389672 instanceof Error?_0x389672[_0x1611c5(0x18a)]:String(_0x389672)});}}_0x36af73[_0x1611c5(0x19f)]=new Date()['toISOString'](),await writeBffLockFile(_0x18a80f[_0x1611c5(0x1ab)],_0x1fad15),await waitForUploadedLockEntries(_0x18a80f[_0x1611c5(0x1ab)],_0x324b5d[_0x1611c5(0x197)],_0x3bf343['map'](_0x1e18e1=>_0x1e18e1[_0x1611c5(0x173)]));let _0x18f6d3={'attempted':![],'cleared':![]};if(_0x3bf343[_0x1611c5(0x191)]>0x0)try{let _0x165759='';for(let _0xbf72a2=0x0;_0xbf72a2<CACHE_CLEAR_ATTEMPTS;_0xbf72a2+=0x1){_0x165759=await clearBffScriptCache(),_0xbf72a2<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x18f6d3={'attempted':!![],'cleared':!![],'message':_0x165759||_0x1611c5(0x192)};}catch(_0x22cde0){_0x18f6d3={'attempted':!![],'cleared':![],'error':_0x22cde0 instanceof Error?_0x22cde0[_0x1611c5(0x18a)]:String(_0x22cde0)};}const _0x51264e=_0x5b0b1e[_0x1611c5(0x191)]===0x0&&(_0x18f6d3['attempted']?_0x18f6d3[_0x1611c5(0x1af)]:!![]),_0x1b8174=_0x51264e,_0x36bdcf=_0x18f6d3['attempted']?_0x18f6d3[_0x1611c5(0x1af)]?'runtime\x20cache\x20cleared':'runtime\x20cache\x20clear\x20failed':'runtime\x20cache\x20not\x20needed';return{'ok':_0x1b8174,'data':{'uploaded':_0x3bf343,'skipped':_0x332877,'failed':_0x5b0b1e,'cacheClear':_0x18f6d3},'message':_0x1611c5(0x1a1)+_0x3bf343['length']+'\x20uploaded,\x20'+_0x332877['length']+_0x1611c5(0x177)+_0x5b0b1e[_0x1611c5(0x191)]+'\x20failed,\x20'+_0x36bdcf};}};async function getTargetFunctions(_0x1c4d78,_0x573b84){const _0x49509a=a37_0x52ab55,_0x26dd05=_0x573b84['str']('type'),_0x30f37b=_0x573b84[_0x49509a(0x1a8)]('name'),_0xed6ddf=normalizeBffType(_0x26dd05)??undefined;if(_0x30f37b&&!_0xed6ddf)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x5f5a1b=await scanLocalBffFunctions(_0x1c4d78,_0xed6ddf);if(_0x30f37b){const _0x119f6b=_0x5f5a1b['filter'](_0x8352cb=>_0x8352cb['name']===_0x30f37b);if(_0x119f6b[_0x49509a(0x191)]===0x0)throw CliErrors[_0x49509a(0x1b4)](_0x49509a(0x17a)+_0xed6ddf+'/'+_0x30f37b);return _0x119f6b;}return _0x5f5a1b;}async function buildHookMaps(_0x462306,_0x2edbe8,_0xc58140,_0x5d732b){const _0xbf7068=a37_0x52ab55,_0xc23df8=_0xc58140[_0xbf7068(0x17f)](_0x1c7c02=>_0x1c7c02[_0xbf7068(0x189)]==='HOOK');if(!_0xc23df8)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x3c9dbc=loadAliasMap(_0x2edbe8,undefined,resolveApiFilePath(_0x2edbe8,_0x462306)),_0x1887e7=new Map(_0x3c9dbc[_0xbf7068(0x190)](_0x5b81c9=>[_0x5b81c9[_0xbf7068(0x18e)],_0x5b81c9[_0xbf7068(0x172)]]));for(const _0x5e4062 of Object['values'](_0x5d732b['functions'])){_0x5e4062[_0xbf7068(0x18e)]&&_0x5e4062[_0xbf7068(0x172)]&&!_0x1887e7[_0xbf7068(0x179)](_0x5e4062[_0xbf7068(0x18e)])&&_0x1887e7[_0xbf7068(0x19b)](_0x5e4062[_0xbf7068(0x18e)],_0x5e4062[_0xbf7068(0x172)]);}const _0x2ff827=await listDatasets(_0x462306),_0x5dd580=new Map(_0x2ff827[_0xbf7068(0x190)](_0x3a883d=>[_0x3a883d[_0xbf7068(0x1a9)],_0x3a883d]));return{'aliasToDatasetCode':_0x1887e7,'datasetCodeToDataset':_0x5dd580};}async function uploadSingleFunction(_0x346134,_0x501ac2,_0x41c3c2,_0x217f91){const _0x5073b1=a37_0x52ab55,_0x3b56e9=await readFile(_0x501ac2[_0x5073b1(0x1a5)],_0x5073b1(0x18c)),_0x5f0469=await computeFileHash(_0x501ac2['filePath']),_0x411512=_0x41c3c2[_0x5073b1(0x16c)][_0x501ac2[_0x5073b1(0x173)]];if(_0x411512?.[_0x5073b1(0x181)]&&_0x411512[_0x5073b1(0x19e)]==null)throw CliErrors[_0x5073b1(0x1b4)](_0x501ac2[_0x5073b1(0x173)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x3b24fa=extractScriptDescription(_0x3b56e9);if(!_0x3b24fa&&_0x411512?.[_0x5073b1(0x181)]){const _0x4a4830=await getBffScriptInfo(_0x411512['remoteId']);_0x3b24fa=_0x4a4830[_0x5073b1(0x16e)]||undefined;}const _0x3d7a2b={'appCode':_0x346134,'functionName':_0x501ac2['name'],'scriptType':_0x501ac2[_0x5073b1(0x189)],'scriptContent':_0x3b56e9};if(_0x411512?.['remoteId'])_0x3d7a2b['id']=_0x411512['remoteId'];if(_0x411512?.[_0x5073b1(0x19e)]!=null)_0x3d7a2b[_0x5073b1(0x19e)]=_0x411512['version'];if(_0x3b24fa)_0x3d7a2b['description']=_0x3b24fa;if(_0x501ac2[_0x5073b1(0x189)]===_0x5073b1(0x17b)){const _0x324b10=_0x501ac2[_0x5073b1(0x18e)];if(!_0x324b10||!_0x501ac2[_0x5073b1(0x193)]||!_0x501ac2['functionNode'])throw CliErrors[_0x5073b1(0x1b4)](_0x5073b1(0x1b1)+_0x501ac2[_0x5073b1(0x173)]);const _0x3c72c8=_0x217f91[_0x5073b1(0x1ae)]['get'](_0x324b10)??_0x411512?.[_0x5073b1(0x172)]??_0x324b10,_0x45e166=_0x217f91[_0x5073b1(0x1ad)][_0x5073b1(0x195)](_0x3c72c8);if(!_0x45e166)throw CliErrors['validation'](_0x5073b1(0x19d)+_0x324b10+_0x5073b1(0x171)+(_0x5073b1(0x18f)+CLI_BIN_NAME+_0x5073b1(0x16f)));_0x3d7a2b[_0x5073b1(0x16d)]=_0x45e166['id'],_0x3d7a2b[_0x5073b1(0x193)]=_0x501ac2['operationType'],_0x3d7a2b[_0x5073b1(0x184)]=_0x501ac2[_0x5073b1(0x184)];}const _0xab3a80=await saveBffScript(_0x3d7a2b),_0x40be4e=_0xab3a80['id'],_0x312d71=_0xab3a80[_0x5073b1(0x18d)]??await getBffScriptInfo(_0x40be4e),_0x1b520b={'hash':_0x5f0469,'remoteId':_0x40be4e,'version':_0x312d71[_0x5073b1(0x19e)]};if(_0x501ac2[_0x5073b1(0x189)]===_0x5073b1(0x17b)){const _0x5153f0=_0x501ac2[_0x5073b1(0x18e)],_0x390459=_0x217f91[_0x5073b1(0x1ae)]['get'](_0x5153f0)??_0x411512?.[_0x5073b1(0x172)]??_0x5153f0;_0x217f91[_0x5073b1(0x1ae)][_0x5073b1(0x179)](_0x5153f0)?_0x1b520b['alias']=_0x5153f0:_0x1b520b[_0x5073b1(0x18e)]=_0x411512?.[_0x5073b1(0x18e)],_0x1b520b[_0x5073b1(0x172)]=_0x390459,_0x1b520b[_0x5073b1(0x193)]=_0x501ac2[_0x5073b1(0x193)],_0x1b520b[_0x5073b1(0x184)]=_0x501ac2[_0x5073b1(0x184)];}_0x41c3c2[_0x5073b1(0x16c)][_0x501ac2[_0x5073b1(0x173)]]=_0x1b520b;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x157ce0,_0x7ab773,_0x2e00ef){const _0x19c499=a37_0x52ab55;if(_0x2e00ef[_0x19c499(0x191)]===0x0)return;for(let _0x4981be=0x0;_0x4981be<LOCK_SETTLE_RETRY_COUNT;_0x4981be+=0x1){const _0x307461=await readBffLockFile(_0x157ce0),_0x2ce1ba=_0x307461?.['apps']?.[_0x7ab773]?.[_0x19c499(0x16c)]??{},_0x12c19f=_0x2e00ef['every'](_0x32718f=>!!_0x2ce1ba[_0x32718f]?.[_0x19c499(0x181)]);if(_0x12c19f)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x19c499(0x170)+_0x2e00ef[_0x19c499(0x187)](',\x20')+'.');}
1
+ const a38_0x391df8=a38_0x4a08;(function(_0x22d0da,_0x54c554){const _0x4550dd=a38_0x4a08,_0x65cb4f=_0x22d0da();while(!![]){try{const _0x36099e=parseInt(_0x4550dd(0xab))/0x1+parseInt(_0x4550dd(0xbe))/0x2*(parseInt(_0x4550dd(0xb0))/0x3)+parseInt(_0x4550dd(0xc2))/0x4*(parseInt(_0x4550dd(0xa6))/0x5)+parseInt(_0x4550dd(0x8d))/0x6+parseInt(_0x4550dd(0xda))/0x7*(-parseInt(_0x4550dd(0xca))/0x8)+-parseInt(_0x4550dd(0x73))/0x9*(parseInt(_0x4550dd(0x75))/0xa)+parseInt(_0x4550dd(0xb2))/0xb*(-parseInt(_0x4550dd(0xa7))/0xc);if(_0x36099e===_0x54c554)break;else _0x65cb4f['push'](_0x65cb4f['shift']());}catch(_0x1af402){_0x65cb4f['push'](_0x65cb4f['shift']());}}}(a38_0x4ef9,0x8d97a));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,getBffScriptStatistics,getPlatformErrorCode,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{buildHookDirectoryIndexes,assertUnambiguousHookAliases,assertUnambiguousHookDirectoryMappings,preflightPushHookDirectories,trackedHookDirectoryMappings}from'../../core/bff/hook-directory.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription,snakeToCamel}from'../../core/bff/utils.js';function a38_0x4ef9(){const _0x18b57c=['Local\x20function\x20not\x20found:\x20','functions','toISOString','flatMap','runtime\x20cache\x20not\x20needed','117ivvmax','\x20skipped','766430LenQDN','script','str','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','requires','validation',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','string','Force\x20push\x20ignoring\x20hash\x20protection','Review\x20the\x20current\x20remote\x20source,\x20merge\x20it\x20into\x20the\x20local\x20script,\x20then\x20retry\x20push.\x20Do\x20not\x20use\x20--force\x20unless\x20you\x20intentionally\x20discard\x20local\x20changes.','afterScriptId','operationType','runtime\x20cache\x20cleared','apps','write','join','has','attempted','datasetCode','BFF_REMOTE_VERSION_CHANGED','functionNode','Dataset\x20metadata\x20is\x20unavailable;\x20the\x20existing\x20script\x20and\x20binding\x20were\x20verified.\x20Update\x20by\x20script\x20ID\x20without\x20rebinding.','delete','appCode','2136192voIgBo','before','bff','size','apiDir','name','push','type','/api/management/library/scripts/save','lockFilePath','startsWith','HOOK','Multiple\x20HOOK\x20directories\x20reference\x20the\x20same\x20missing\x20Dataset.\x20Resolve\x20duplicate\x20directories\x20before\x20pushing.','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','runtime\x20cache\x20clear\x20failed','every','Push\x20only\x20this\x20script\x20type','ENDPOINT','BFF_REMOTE_VERSION_MISSING','failed','some','bool','beforeScriptId','conflict','remoteId','85ourvEv','9892752voMlLl','version','lockKey','utf8','891496ENMDFr','dataset','alias','Push\x20complete:\x20','\x20conflict','6bPaoQR','scriptsRoot','11LGBWMI','require','\x20failed','HOOK_DATASET_NOT_FOUND:','warnings','scriptType','hash','get','COMMON','values','POST','datasetId','576454iUapdH','cleared','\x20--format\x20compress','filter','219892LiSKAK','description','length','\x22\x20not\x20found\x20after\x20ensureLockScope.','Runtime\x20script\x20cache\x20cleared.','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','message','update','2862448MDZAJh','test','The\x20local\x20sync\x20lock\x20has\x20no\x20remote\x20version\x20for\x20this\x20script.','set','existingHooks','No\x20local\x20Backend\x20Function\x20scripts\x20found.','stringify','would_push','force','map','Cannot\x20verify\x20existing\x20HOOK\x20binding:\x20','resolutions','filePath','failures','parse','status','7daAcAu','create','functionName'];a38_0x4ef9=function(){return _0x18b57c;};return a38_0x4ef9();}import{sleep}from'../../utils/sleep.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a38_0x391df8(0x8f),'command':a38_0x391df8(0x93),'description':a38_0x391df8(0x78),'risk':a38_0x391df8(0x83),'structuredErrors':!![],'flags':[{'name':a38_0x391df8(0x94),'type':a38_0x391df8(0x7c),'description':a38_0x391df8(0x9d),'enum':[a38_0x391df8(0xba),a38_0x391df8(0x9e),a38_0x391df8(0x98)]},{'name':a38_0x391df8(0x92),'type':a38_0x391df8(0x7c),'description':a38_0x391df8(0x9a)},{'name':a38_0x391df8(0xd2),'type':'boolean','description':a38_0x391df8(0x7d)}],async 'dryRun'(_0x387d59){const _0x3be4f8=a38_0x391df8,_0x1507bb=loadBffProjectConfig(_0x387d59[_0x3be4f8(0x8c)]),_0x24e3ff=await readBffLockFile(_0x1507bb[_0x3be4f8(0x96)]),{appLock:_0x1cec24}=ensureLockScope(_0x24e3ff??createEmptyBffLock(),_0x387d59[_0x3be4f8(0x8c)],_0x1507bb[_0x3be4f8(0xb1)],'push'),_0x45f75d=await getTargetFunctions(_0x1507bb,_0x387d59),_0x3ade05=_0x45f75d[_0x3be4f8(0xa1)](_0x4886c9=>_0x4886c9[_0x3be4f8(0x94)]===_0x3be4f8(0x98))?await scanLocalBffFunctions(_0x1507bb,'HOOK'):_0x45f75d,_0x28464e=await buildHookMaps(_0x387d59[_0x3be4f8(0x8c)],_0x387d59['apiDir'],_0x3ade05,_0x1cec24),_0x154941=_0x387d59['bool']('force'),_0x34bd6c=[];for(const _0x4eba69 of _0x45f75d){const _0x42c717=await computeFileHash(_0x4eba69['filePath']),_0x498942=_0x1cec24[_0x3be4f8(0xde)][_0x4eba69['lockKey']],_0x3f7a7e=!!_0x498942&&_0x498942[_0x3be4f8(0xb8)]===_0x42c717,_0x12cae5=_0x28464e[_0x3be4f8(0xd5)][_0x3be4f8(0xb9)](_0x4eba69[_0x3be4f8(0xa9)]),_0x541674=!!_0x498942?.[_0x3be4f8(0xa5)]&&_0x498942['version']==null&&(_0x154941||!_0x3f7a7e),_0x1f5aa2=_0x541674?missingRemoteVersionConflict(_0x4eba69,_0x498942):undefined,_0x3340cc=_0x28464e[_0x3be4f8(0xd7)][_0x3be4f8(0x85)](_0x4eba69[_0x3be4f8(0xa9)])?_0x3be4f8(0xa0):!_0x154941&&_0x3f7a7e?'unchanged':_0x1f5aa2?_0x3be4f8(0xa4):'would_push';_0x34bd6c[_0x3be4f8(0x93)]({'lockKey':_0x4eba69[_0x3be4f8(0xa9)],'filePath':_0x4eba69['filePath'],'remoteId':_0x498942?.[_0x3be4f8(0xa5)]??null,'mode':_0x498942?.[_0x3be4f8(0xa5)]?_0x3be4f8(0xc9):_0x3be4f8(0xdb),'status':_0x3340cc,..._0x28464e[_0x3be4f8(0xd7)][_0x3be4f8(0x85)](_0x4eba69[_0x3be4f8(0xa9)])?{'error':_0x28464e[_0x3be4f8(0xd7)][_0x3be4f8(0xb9)](_0x4eba69[_0x3be4f8(0xa9)])}:{},..._0x1f5aa2?{'conflict':_0x1f5aa2}:{},..._0x28464e[_0x3be4f8(0xce)]['has'](_0x4eba69[_0x3be4f8(0xa9)])?{'datasetCode':_0x498942?.['datasetCode'],'bindingPreserved':!![],'warnings':[existingHookWarning(_0x4eba69[_0x3be4f8(0xa9)])]}:{},..._0x12cae5?{'alias':_0x12cae5[_0x3be4f8(0xad)]??null,'datasetCode':_0x12cae5[_0x3be4f8(0x87)],'operationType':_0x4eba69[_0x3be4f8(0x80)],'functionNode':_0x4eba69[_0x3be4f8(0x89)],'warnings':_0x12cae5[_0x3be4f8(0xb6)]}:{}});}return{'method':_0x3be4f8(0xbc),'url':_0x3be4f8(0x95),'body':{'appCode':_0x387d59[_0x3be4f8(0x8c)],'force':_0x154941,'files':_0x34bd6c,'cacheClearAtRuntime':_0x34bd6c[_0x3be4f8(0xa1)](_0xb97ffb=>_0xb97ffb[_0x3be4f8(0xd9)]===_0x3be4f8(0xd1)),'cacheClearAtRuntimeTimes':_0x34bd6c['some'](_0x55c59e=>_0x55c59e['status']===_0x3be4f8(0xd1))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x34bd6c[_0x3be4f8(0xc4)]+_0x3be4f8(0xc7)};},async 'execute'(_0x1309d3){const _0x3ea39f=a38_0x391df8,_0x16b532=loadBffProjectConfig(_0x1309d3[_0x3ea39f(0x8c)]),_0x387f34=await readBffLockFile(_0x16b532[_0x3ea39f(0x96)]),{lockData:_0x57e95c,appLock:_0x561115}=ensureLockScope(_0x387f34??createEmptyBffLock(),_0x1309d3['appCode'],_0x16b532[_0x3ea39f(0xb1)],_0x3ea39f(0x93)),_0x5c3fad=await getTargetFunctions(_0x16b532,_0x1309d3);if(_0x5c3fad[_0x3ea39f(0xc4)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x3ea39f(0xcf)};const _0x38f18c=_0x1309d3[_0x3ea39f(0xa2)](_0x3ea39f(0xd2)),_0xa700bf=JSON[_0x3ea39f(0xd8)](JSON[_0x3ea39f(0xd0)](_0x57e95c)),_0x53d80d=_0xa700bf['apps'][_0x1309d3[_0x3ea39f(0x8c)]];if(!_0x53d80d)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x1309d3[_0x3ea39f(0x8c)]+_0x3ea39f(0xc5));const _0x3631a7=_0x5c3fad[_0x3ea39f(0xa1)](_0x5757de=>_0x5757de[_0x3ea39f(0x94)]===_0x3ea39f(0x98))?await scanLocalBffFunctions(_0x16b532,'HOOK'):_0x5c3fad,_0x5b47d0=await buildHookMaps(_0x1309d3['appCode'],_0x1309d3[_0x3ea39f(0x91)],_0x3631a7,_0x53d80d),_0x5ec21c=[],_0x451190=[],_0x2065f3=[],_0x3fcc2b=[];for(const _0x69316 of _0x5c3fad){const _0x2ae4d5=_0x5b47d0[_0x3ea39f(0xd7)][_0x3ea39f(0xb9)](_0x69316[_0x3ea39f(0xa9)]);if(_0x2ae4d5){_0x3fcc2b[_0x3ea39f(0x93)]({'lockKey':_0x69316['lockKey'],'error':_0x2ae4d5});continue;}const _0x347cce=await computeFileHash(_0x69316['filePath']),_0x2d519d=_0x53d80d[_0x3ea39f(0xde)][_0x69316['lockKey']];if(!_0x38f18c&&_0x2d519d&&_0x2d519d[_0x3ea39f(0xb8)]===_0x347cce){_0x451190['push']({'lockKey':_0x69316[_0x3ea39f(0xa9)],'reason':'unchanged'});continue;}if(_0x2d519d?.['remoteId']&&_0x2d519d['version']==null){_0x2065f3[_0x3ea39f(0x93)](missingRemoteVersionConflict(_0x69316,_0x2d519d));continue;}try{await uploadSingleFunction(_0x1309d3[_0x3ea39f(0x8c)],_0x69316,_0x53d80d,_0x5b47d0);const _0x33906d=_0x53d80d[_0x3ea39f(0xde)][_0x69316['lockKey']];_0x5ec21c[_0x3ea39f(0x93)]({'lockKey':_0x69316[_0x3ea39f(0xa9)],'remoteId':_0x33906d?.[_0x3ea39f(0xa5)]??0x0});}catch(_0x2a59e1){const _0x25b551=remoteVersionChangedConflict(_0x69316,_0x2d519d,_0x2a59e1);if(_0x25b551){_0x2065f3[_0x3ea39f(0x93)](_0x25b551);continue;}_0x3fcc2b['push']({'lockKey':_0x69316[_0x3ea39f(0xa9)],'error':_0x2a59e1 instanceof Error?_0x2a59e1[_0x3ea39f(0xc8)]:String(_0x2a59e1)});}}_0x53d80d['lastSync']=new Date()[_0x3ea39f(0x70)](),await writeBffLockFile(_0x16b532['lockFilePath'],_0xa700bf),await waitForUploadedLockEntries(_0x16b532['lockFilePath'],_0x1309d3[_0x3ea39f(0x8c)],_0x5ec21c[_0x3ea39f(0xd3)](_0x45d214=>_0x45d214[_0x3ea39f(0xa9)]));let _0x141eb9={'attempted':![],'cleared':![]};if(_0x5ec21c[_0x3ea39f(0xc4)]>0x0)try{let _0x2da719='';for(let _0x3b97cc=0x0;_0x3b97cc<CACHE_CLEAR_ATTEMPTS;_0x3b97cc+=0x1){_0x2da719=await clearBffScriptCache(),_0x3b97cc<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x141eb9={'attempted':!![],'cleared':!![],'message':_0x2da719||_0x3ea39f(0xc6)};}catch(_0x2f43b2){_0x141eb9={'attempted':!![],'cleared':![],'error':_0x2f43b2 instanceof Error?_0x2f43b2[_0x3ea39f(0xc8)]:String(_0x2f43b2)};}const _0x36a592=_0x3fcc2b['length']===0x0&&(_0x141eb9[_0x3ea39f(0x86)]?_0x141eb9[_0x3ea39f(0xbf)]:!![]),_0x484a8b=_0x36a592,_0x4f63e2=_0x141eb9['attempted']?_0x141eb9['cleared']?_0x3ea39f(0x81):_0x3ea39f(0x9b):_0x3ea39f(0x72);return{'ok':_0x484a8b,'data':{'uploaded':_0x5ec21c,'skipped':_0x451190,'conflicts':_0x2065f3,'failed':_0x3fcc2b,'cacheClear':_0x141eb9,'warnings':[...[..._0x5b47d0[_0x3ea39f(0xd5)][_0x3ea39f(0xbb)]()][_0x3ea39f(0x71)](_0x1524ab=>_0x1524ab[_0x3ea39f(0xb6)]),...[..._0x5b47d0[_0x3ea39f(0xce)]][_0x3ea39f(0xd3)](existingHookWarning)]},'message':formatPushMessage(_0x5ec21c['length'],_0x451190['length'],_0x2065f3[_0x3ea39f(0xc4)],_0x3fcc2b[_0x3ea39f(0xc4)],_0x4f63e2)};}};function missingRemoteVersionConflict(_0x1718ac,_0x18f2a7){const _0x3d04c1=a38_0x391df8;return remoteVersionConflict(_0x1718ac,_0x18f2a7,_0x3d04c1(0x9f),_0x3d04c1(0xcc));}function remoteVersionChangedConflict(_0x3069b7,_0x14dbca,_0x4c08de){const _0x159fe8=a38_0x391df8;if(!_0x14dbca?.[_0x159fe8(0xa5)]||_0x14dbca[_0x159fe8(0xa8)]==null||!isRemoteVersionConflict(_0x4c08de))return undefined;return remoteVersionConflict(_0x3069b7,_0x14dbca,_0x159fe8(0x88),'Remote\x20script\x20version\x20changed\x20since\x20the\x20last\x20pull.');}function remoteVersionConflict(_0x39b11b,_0x1dbe18,_0x1cf75a,_0x2445a2){const _0x3acdb0=a38_0x391df8;return{'code':_0x1cf75a,'lockKey':_0x39b11b[_0x3acdb0(0xa9)],'filePath':_0x39b11b[_0x3acdb0(0xd6)],'remoteId':_0x1dbe18['remoteId'],..._0x1dbe18[_0x3acdb0(0xa8)]!=null?{'expectedVersion':_0x1dbe18['version']}:{},'message':_0x2445a2,'nextAction':{'action':'review_remote_and_merge','command':CLI_BIN_NAME+'\x20bff\x20detail\x20--id\x20'+_0x1dbe18[_0x3acdb0(0xa5)]+_0x3acdb0(0xc0),'requiresReview':!![],'message':_0x3acdb0(0x7e)}};}function isRemoteVersionConflict(_0x38dd39){const _0x166f56=a38_0x391df8,_0xcfc6c5=_0x38dd39 instanceof Error?_0x38dd39[_0x166f56(0xc8)]:String(_0x38dd39),_0x47faa3=getPlatformErrorCode(_0x38dd39)??'';return[_0xcfc6c5,_0x47faa3]['some'](_0x22df07=>/(?:version|optimistic)[\s_-]*(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)|(?:conflict|mismatch|changed|stale|out[\s_-]*of[\s_-]*date)[\s_-]*(?:version|optimistic)/i[_0x166f56(0xcb)](_0x22df07));}function a38_0x4a08(_0x252b35,_0x3b8e96){_0x252b35=_0x252b35-0x70;const _0x4ef9b1=a38_0x4ef9();let _0x4a0804=_0x4ef9b1[_0x252b35];return _0x4a0804;}function formatPushMessage(_0x252e95,_0x446291,_0x262129,_0x21a451,_0x27ab6d){const _0x512bfd=a38_0x391df8,_0x1c8e52=[_0x512bfd(0xae)+_0x252e95+'\x20uploaded',_0x446291+_0x512bfd(0x74)];_0x262129>0x0&&_0x1c8e52[_0x512bfd(0x93)](_0x262129+_0x512bfd(0xaf)+(_0x262129===0x1?'':'s')+'\x20'+(_0x262129===0x1?_0x512bfd(0x79):_0x512bfd(0xb3))+'\x20resolution');if(_0x21a451>0x0)_0x1c8e52[_0x512bfd(0x93)](_0x21a451+_0x512bfd(0xb4));return _0x1c8e52[_0x512bfd(0x93)](_0x27ab6d),_0x1c8e52[_0x512bfd(0x84)](',\x20');}async function getTargetFunctions(_0x184dde,_0x178244){const _0x32c976=a38_0x391df8,_0x28da77=_0x178244[_0x32c976(0x77)](_0x32c976(0x94)),_0x2bc9e1=_0x178244[_0x32c976(0x77)](_0x32c976(0x92)),_0x528987=normalizeBffType(_0x28da77)??undefined;if(_0x2bc9e1&&!_0x528987)throw CliErrors[_0x32c976(0x7a)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x4d1498=await scanLocalBffFunctions(_0x184dde,_0x528987);if(_0x2bc9e1){const _0x343f57=_0x4d1498[_0x32c976(0xc1)](_0x4e97f2=>_0x4e97f2[_0x32c976(0x92)]===_0x2bc9e1);if(_0x343f57[_0x32c976(0xc4)]===0x0)throw CliErrors['validation'](_0x32c976(0xdd)+_0x528987+'/'+_0x2bc9e1);return _0x343f57;}return _0x4d1498;}function existingHookWarning(_0xeb4781){const _0xec1948=a38_0x391df8;return{'code':'EXISTING_HOOK_BINDING_PRESERVED','lockKey':_0xeb4781,'message':_0xec1948(0x8a)};}async function buildHookMaps(_0x263cc3,_0x11663c,_0x532461,_0xa09f01){const _0x28a0e0=a38_0x391df8,_0x40e7af=_0x532461['some'](_0x96aaf=>_0x96aaf[_0x28a0e0(0x94)]===_0x28a0e0(0x98));if(!_0x40e7af)return{'resolutions':new Map(),'failures':new Map(),'existingHooks':new Set()};const _0x10ccfe=loadAliasMap(_0x11663c,undefined,resolveApiFilePath(_0x11663c,_0x263cc3));assertUnambiguousHookAliases(_0x10ccfe);const _0x2329a2=[..._0x10ccfe['map'](_0x1b352e=>[_0x1b352e[_0x28a0e0(0xad)],_0x1b352e[_0x28a0e0(0x87)]]),...trackedHookDirectoryMappings(_0xa09f01)['map'](_0x481ea9=>[_0x481ea9['alias'],_0x481ea9[_0x28a0e0(0x87)]])],_0x3b9ab4=await listDatasets(_0x263cc3);assertUnambiguousHookDirectoryMappings(_0x2329a2['map'](([_0x10b308,_0x13c36b])=>({'alias':_0x10b308,'datasetCode':_0x13c36b})));const _0x6633fc=buildHookDirectoryIndexes(_0x3b9ab4,_0x2329a2),_0x4073dd=new Map(),_0x3aca43=preflightPushHookDirectories(_0x532461,_0xa09f01,_0x6633fc,_0x4073dd),_0x21f7aa=new Set(),_0x23a9e8=_0x532461[_0x28a0e0(0xc1)](_0x275450=>_0x4073dd[_0x28a0e0(0xb9)](_0x275450['lockKey'])?.[_0x28a0e0(0x97)](_0x28a0e0(0xb5))&&_0xa09f01[_0x28a0e0(0xde)][_0x275450['lockKey']]?.[_0x28a0e0(0xa5)]&&_0xa09f01[_0x28a0e0(0xde)][_0x275450[_0x28a0e0(0xa9)]]?.[_0x28a0e0(0x87)]);if(_0x23a9e8[_0x28a0e0(0xc4)]>0x0){let _0x2937c1;try{_0x2937c1=await getBffScriptStatistics(_0x263cc3);}catch(_0x634a95){for(const _0x571e00 of _0x23a9e8)_0x4073dd[_0x28a0e0(0xcd)](_0x571e00[_0x28a0e0(0xa9)],_0x28a0e0(0xd4)+(_0x634a95 instanceof Error?_0x634a95[_0x28a0e0(0xc8)]:String(_0x634a95)));return{'resolutions':_0x3aca43,'failures':_0x4073dd,'existingHooks':_0x21f7aa};}for(const _0x3807ff of _0x23a9e8){const _0x8b0854=_0xa09f01['functions'][_0x3807ff[_0x28a0e0(0xa9)]];try{const _0x1fcaa4=new Set(_0x532461['filter'](_0x2ae0b6=>_0x2ae0b6[_0x28a0e0(0x94)]==='HOOK'&&_0xa09f01[_0x28a0e0(0xde)][_0x2ae0b6[_0x28a0e0(0xa9)]]?.['datasetCode']===_0x8b0854[_0x28a0e0(0x87)])[_0x28a0e0(0xd3)](_0x48f940=>_0x48f940[_0x28a0e0(0xad)]));if(_0x1fcaa4[_0x28a0e0(0x90)]>0x1)throw CliErrors[_0x28a0e0(0x7a)](_0x28a0e0(0x99));const _0x3a6da9=_0x2937c1[_0x28a0e0(0x71)](_0x45d75d=>[{'datasetCode':_0x45d75d[_0x28a0e0(0x87)],'operationType':snakeToCamel(_0x45d75d[_0x28a0e0(0x80)]),'functionNode':_0x28a0e0(0x8e),'id':_0x45d75d[_0x28a0e0(0xa3)]},{'datasetCode':_0x45d75d[_0x28a0e0(0x87)],'operationType':snakeToCamel(_0x45d75d['operationType']),'functionNode':'after','id':_0x45d75d[_0x28a0e0(0x7f)]}])[_0x28a0e0(0xc1)](_0x47651c=>_0x47651c['id']===_0x8b0854[_0x28a0e0(0xa5)]),_0x57e1e3=await getBffScriptInfo(_0x8b0854[_0x28a0e0(0xa5)]);if(_0x57e1e3['id']!==_0x8b0854['remoteId']||_0x57e1e3[_0x28a0e0(0x8c)]!==_0x263cc3||_0x57e1e3[_0x28a0e0(0xb7)]!==_0x28a0e0(0x98)||_0x57e1e3[_0x28a0e0(0xdc)]!==_0x3807ff[_0x28a0e0(0x92)]||_0x8b0854['version']==null||_0x57e1e3['version']!==_0x8b0854['version']||_0x3a6da9[_0x28a0e0(0xc4)]!==0x1||_0x3a6da9[0x0][_0x28a0e0(0x87)]!==_0x8b0854[_0x28a0e0(0x87)]||_0x3a6da9[0x0][_0x28a0e0(0x80)]!==_0x3807ff[_0x28a0e0(0x80)]||_0x3a6da9[0x0][_0x28a0e0(0x89)]!==_0x3807ff[_0x28a0e0(0x89)]||_0x8b0854['operationType']!==_0x3807ff[_0x28a0e0(0x80)]||_0x8b0854[_0x28a0e0(0x89)]!==_0x3807ff[_0x28a0e0(0x89)])throw CliErrors[_0x28a0e0(0x7a)]('Existing\x20HOOK\x20identity,\x20version\x20or\x20binding\x20does\x20not\x20match\x20the\x20local\x20lock.\x20Pull\x20and\x20review\x20before\x20pushing.');_0x21f7aa['add'](_0x3807ff[_0x28a0e0(0xa9)]),_0x4073dd[_0x28a0e0(0x8b)](_0x3807ff[_0x28a0e0(0xa9)]);}catch(_0x797f15){_0x4073dd[_0x28a0e0(0xcd)](_0x3807ff[_0x28a0e0(0xa9)],_0x797f15 instanceof Error?_0x797f15[_0x28a0e0(0xc8)]:String(_0x797f15));}}}return{'resolutions':_0x3aca43,'failures':_0x4073dd,'existingHooks':_0x21f7aa};}async function uploadSingleFunction(_0x147fc3,_0x3e6536,_0x157722,_0x2497c9){const _0x2c1f6a=a38_0x391df8,_0x43f884=await readFile(_0x3e6536[_0x2c1f6a(0xd6)],_0x2c1f6a(0xaa)),_0x2720f9=await computeFileHash(_0x3e6536[_0x2c1f6a(0xd6)]),_0x43ecf4=_0x157722[_0x2c1f6a(0xde)][_0x3e6536[_0x2c1f6a(0xa9)]];if(_0x43ecf4?.['remoteId']&&_0x43ecf4[_0x2c1f6a(0xa8)]==null)throw CliErrors[_0x2c1f6a(0x7a)](_0x3e6536[_0x2c1f6a(0xa9)]+_0x2c1f6a(0x7b));let _0x3e02e9=extractScriptDescription(_0x43f884);if(!_0x3e02e9&&_0x43ecf4?.[_0x2c1f6a(0xa5)]){const _0x5aa462=await getBffScriptInfo(_0x43ecf4[_0x2c1f6a(0xa5)]);_0x3e02e9=_0x5aa462[_0x2c1f6a(0xc3)]||undefined;}const _0x28f942={'appCode':_0x147fc3,'functionName':_0x3e6536[_0x2c1f6a(0x92)],'scriptType':_0x3e6536[_0x2c1f6a(0x94)],'scriptContent':_0x43f884};if(_0x43ecf4?.[_0x2c1f6a(0xa5)])_0x28f942['id']=_0x43ecf4[_0x2c1f6a(0xa5)];if(_0x43ecf4?.[_0x2c1f6a(0xa8)]!=null)_0x28f942['version']=_0x43ecf4[_0x2c1f6a(0xa8)];if(_0x3e02e9)_0x28f942[_0x2c1f6a(0xc3)]=_0x3e02e9;if(_0x3e6536['type']===_0x2c1f6a(0x98)){const _0x4b2e02=_0x2497c9[_0x2c1f6a(0xd5)][_0x2c1f6a(0xb9)](_0x3e6536[_0x2c1f6a(0xa9)]);if(!_0x4b2e02&&!_0x2497c9['existingHooks'][_0x2c1f6a(0x85)](_0x3e6536['lockKey'])||!_0x3e6536[_0x2c1f6a(0x80)]||!_0x3e6536[_0x2c1f6a(0x89)])throw CliErrors[_0x2c1f6a(0x7a)]('Incomplete\x20HOOK\x20path:\x20'+_0x3e6536[_0x2c1f6a(0xa9)]);_0x4b2e02&&(_0x28f942[_0x2c1f6a(0xbd)]=_0x4b2e02[_0x2c1f6a(0xac)]['id'],_0x28f942[_0x2c1f6a(0x80)]=_0x3e6536['operationType']),_0x28f942['functionNode']=_0x3e6536[_0x2c1f6a(0x89)];}const _0x52c682=await saveBffScript(_0x28f942),_0x5a964a=_0x52c682['id'],_0x37e130=_0x52c682[_0x2c1f6a(0x76)]??await getBffScriptInfo(_0x5a964a),_0x5aa78f={'hash':_0x2720f9,'remoteId':_0x5a964a,'version':_0x37e130['version']};if(_0x3e6536['type']===_0x2c1f6a(0x98)){const _0x1c992a=_0x2497c9['resolutions'][_0x2c1f6a(0xb9)](_0x3e6536['lockKey']);if(!_0x1c992a){_0x157722[_0x2c1f6a(0xde)][_0x3e6536['lockKey']]={..._0x43ecf4,..._0x5aa78f};return;}_0x5aa78f[_0x2c1f6a(0xad)]=_0x1c992a[_0x2c1f6a(0xad)]??_0x43ecf4?.['alias'],_0x5aa78f[_0x2c1f6a(0x87)]=_0x1c992a['datasetCode'],_0x5aa78f[_0x2c1f6a(0x80)]=_0x3e6536[_0x2c1f6a(0x80)],_0x5aa78f['functionNode']=_0x3e6536[_0x2c1f6a(0x89)];}_0x157722[_0x2c1f6a(0xde)][_0x3e6536[_0x2c1f6a(0xa9)]]=_0x5aa78f;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3c3ec6,_0x57dd67,_0x4f1bca){const _0x509ff4=a38_0x391df8;if(_0x4f1bca[_0x509ff4(0xc4)]===0x0)return;for(let _0x321dfe=0x0;_0x321dfe<LOCK_SETTLE_RETRY_COUNT;_0x321dfe+=0x1){const _0x4c66b8=await readBffLockFile(_0x3c3ec6),_0x2a55c5=_0x4c66b8?.[_0x509ff4(0x82)]?.[_0x57dd67]?.['functions']??{},_0x3d45ea=_0x4f1bca[_0x509ff4(0x9c)](_0x2051b3=>!!_0x2a55c5[_0x2051b3]?.[_0x509ff4(0xa5)]);if(_0x3d45ea)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x4f1bca[_0x509ff4(0x84)](',\x20')+'.');}
@@ -1 +1 @@
1
- const a38_0x5808c3=a38_0x9dec;(function(_0x15a9b8,_0x13758a){const _0x7a043c=a38_0x9dec,_0xcd05fb=_0x15a9b8();while(!![]){try{const _0x2f63fc=parseInt(_0x7a043c(0x182))/0x1*(-parseInt(_0x7a043c(0x16e))/0x2)+parseInt(_0x7a043c(0x16d))/0x3+parseInt(_0x7a043c(0x17f))/0x4+-parseInt(_0x7a043c(0x17e))/0x5*(parseInt(_0x7a043c(0x187))/0x6)+-parseInt(_0x7a043c(0x181))/0x7+-parseInt(_0x7a043c(0x17d))/0x8*(-parseInt(_0x7a043c(0x179))/0x9)+parseInt(_0x7a043c(0x16b))/0xa;if(_0x2f63fc===_0x13758a)break;else _0xcd05fb['push'](_0xcd05fb['shift']());}catch(_0xfe907d){_0xcd05fb['push'](_0xcd05fb['shift']());}}}(a38_0x20c6,0x22898));function a38_0x9dec(_0x1ff10e,_0x465397){_0x1ff10e=_0x1ff10e-0x16b;const _0x20c62e=a38_0x20c6();let _0x9dec3=_0x20c62e[_0x1ff10e];return _0x9dec3;}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a38_0x20c6(){const _0x40c1ad=['apiDir','status','lockKey','8oCOwgT','25225ndaxMf','552600ZaJjAG','\x20unchanged','1723771XqiwtL','81BqDYGG','map','alias','\x20modified,\x20','all','318PkGQYA','push','appCode','lockFilePath','\x20added,\x20','functions','4524970GNJaMl','filePath','240234OzdNBV','1566EWeqpy','length','bff','\x20remote-only','read','has','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','datasetCode','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','remote','bool','430200wkwAkX'];a38_0x20c6=function(){return _0x40c1ad;};return a38_0x20c6();}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x5808c3(0x170),'command':a38_0x5808c3(0x17b),'description':a38_0x5808c3(0x176),'risk':a38_0x5808c3(0x172),'flags':[{'name':a38_0x5808c3(0x177),'type':'boolean','description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x5edd1b){const _0x1aa88a=a38_0x5808c3,_0x208882=loadBffProjectConfig(_0x5edd1b[_0x1aa88a(0x189)]),_0x2bb9c1=await readBffLockFile(_0x208882[_0x1aa88a(0x18a)]),{appLock:_0x2a3943}=ensureLockScope(_0x2bb9c1??createEmptyBffLock(),_0x5edd1b[_0x1aa88a(0x189)],_0x208882['scriptsRoot'],_0x1aa88a(0x17b)),_0x11ea41=await scanLocalBffFunctions(_0x208882),_0x5c7da5=[],_0x30a611=[],_0x104cbc=[];for(const _0x3d26c1 of _0x11ea41){const _0x172700=await computeFileHash(_0x3d26c1[_0x1aa88a(0x16c)]),_0x17f715=_0x2a3943[_0x1aa88a(0x18c)][_0x3d26c1[_0x1aa88a(0x17c)]];if(!_0x17f715)_0x5c7da5[_0x1aa88a(0x188)](_0x3d26c1['lockKey']);else _0x17f715['hash']!==_0x172700?_0x30a611['push'](_0x3d26c1[_0x1aa88a(0x17c)]):_0x104cbc['push'](_0x3d26c1[_0x1aa88a(0x17c)]);}const _0x64c49a=[];if(_0x5edd1b[_0x1aa88a(0x178)](_0x1aa88a(0x177))){const _0x116a16=loadAliasMap(_0x5edd1b[_0x1aa88a(0x17a)],undefined,resolveApiFilePath(_0x5edd1b[_0x1aa88a(0x17a)],_0x5edd1b['appCode'])),_0x471726=new Map(_0x116a16[_0x1aa88a(0x183)](_0x4b323f=>[_0x4b323f[_0x1aa88a(0x175)],_0x4b323f[_0x1aa88a(0x184)]])),[_0x289542,_0x53a7fb]=await Promise[_0x1aa88a(0x186)]([listBffScripts(_0x5edd1b[_0x1aa88a(0x189)]),getBffScriptStatistics(_0x5edd1b['appCode'])]),_0x2e969e=createHookLocationMap(_0x53a7fb),_0x15aab6=new Set(_0x11ea41[_0x1aa88a(0x183)](_0x3cbeac=>_0x3cbeac[_0x1aa88a(0x17c)]));for(const _0x348c53 of _0x289542){const _0x5a8504=resolveRemoteScriptTarget(_0x208882,_0x348c53,_0x2e969e,_0x2a3943['functions'],_0x471726);_0x5a8504&&!_0x15aab6[_0x1aa88a(0x173)](_0x5a8504[_0x1aa88a(0x17c)])&&_0x64c49a['push'](_0x5a8504['lockKey']);}}const _0xca8288=_0x5c7da5[_0x1aa88a(0x16f)]===0x0&&_0x30a611[_0x1aa88a(0x16f)]===0x0&&_0x64c49a[_0x1aa88a(0x16f)]===0x0;return{'ok':!![],'data':{'added':_0x5c7da5,'modified':_0x30a611,'unchanged':_0x104cbc,'remoteOnly':_0x64c49a},'message':_0xca8288?_0x1aa88a(0x174):_0x5c7da5[_0x1aa88a(0x16f)]+_0x1aa88a(0x18b)+_0x30a611[_0x1aa88a(0x16f)]+_0x1aa88a(0x185)+_0x104cbc[_0x1aa88a(0x16f)]+_0x1aa88a(0x180)+(_0x64c49a[_0x1aa88a(0x16f)]>0x0?',\x20'+_0x64c49a['length']+_0x1aa88a(0x171):'')};}};
1
+ const a39_0x216da6=a39_0x5096;(function(_0x1b8e85,_0x35c72c){const _0x23c0ea=a39_0x5096,_0x14bd2f=_0x1b8e85();while(!![]){try{const _0x2e9e0f=-parseInt(_0x23c0ea(0xae))/0x1+parseInt(_0x23c0ea(0xc1))/0x2*(-parseInt(_0x23c0ea(0xb8))/0x3)+parseInt(_0x23c0ea(0xad))/0x4+-parseInt(_0x23c0ea(0xb0))/0x5*(parseInt(_0x23c0ea(0xa6))/0x6)+-parseInt(_0x23c0ea(0xbe))/0x7*(-parseInt(_0x23c0ea(0xc0))/0x8)+parseInt(_0x23c0ea(0xb4))/0x9*(parseInt(_0x23c0ea(0xb7))/0xa)+-parseInt(_0x23c0ea(0xc2))/0xb*(-parseInt(_0x23c0ea(0xb6))/0xc);if(_0x2e9e0f===_0x35c72c)break;else _0x14bd2f['push'](_0x14bd2f['shift']());}catch(_0x2427b6){_0x14bd2f['push'](_0x14bd2f['shift']());}}}(a39_0x4c5d,0xdce47));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 a39_0x5096(_0x2f5df8,_0x4dc258){_0x2f5df8=_0x2f5df8-0xa6;const _0x4c5d58=a39_0x4c5d();let _0x509627=_0x4c5d58[_0x2f5df8];return _0x509627;}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a39_0x216da6(0xb9),'description':a39_0x216da6(0xbd),'risk':'read','flags':[{'name':'remote','type':'boolean','description':a39_0x216da6(0xa8)}],async 'execute'(_0x52faf0){const _0x438496=a39_0x216da6,_0x3e3fc8=loadBffProjectConfig(_0x52faf0['appCode']),_0x27b6c2=await readBffLockFile(_0x3e3fc8['lockFilePath']),{appLock:_0x16ebd3}=ensureLockScope(_0x27b6c2??createEmptyBffLock(),_0x52faf0[_0x438496(0xbf)],_0x3e3fc8[_0x438496(0xab)],_0x438496(0xb9)),_0x2d0e6b=await scanLocalBffFunctions(_0x3e3fc8),_0xa3109=[],_0x54e05b=[],_0x683076=[];for(const _0x4676bd of _0x2d0e6b){const _0x2dd086=await computeFileHash(_0x4676bd[_0x438496(0xb1)]),_0xe12950=_0x16ebd3['functions'][_0x4676bd['lockKey']];if(!_0xe12950)_0xa3109['push'](_0x4676bd[_0x438496(0xaf)]);else _0xe12950['hash']!==_0x2dd086?_0x54e05b[_0x438496(0xa7)](_0x4676bd[_0x438496(0xaf)]):_0x683076['push'](_0x4676bd['lockKey']);}const _0x2272d4=[];if(_0x52faf0['bool']('remote')){const _0x112c84=loadAliasMap(_0x52faf0[_0x438496(0xba)],undefined,resolveApiFilePath(_0x52faf0[_0x438496(0xba)],_0x52faf0[_0x438496(0xbf)])),_0x49f374=new Map(_0x112c84['map'](_0x496d3a=>[_0x496d3a[_0x438496(0xbc)],_0x496d3a[_0x438496(0xbb)]])),[_0x9c1468,_0x2714ca]=await Promise[_0x438496(0xac)]([listBffScripts(_0x52faf0[_0x438496(0xbf)]),getBffScriptStatistics(_0x52faf0[_0x438496(0xbf)])]),_0x208d35=createHookLocationMap(_0x2714ca),_0x504bf9=new Set(_0x2d0e6b['map'](_0x1ed965=>_0x1ed965[_0x438496(0xaf)]));for(const _0x52fe16 of _0x9c1468){const _0x2e0e85=resolveRemoteScriptTarget(_0x3e3fc8,_0x52fe16,_0x208d35,_0x16ebd3['functions'],_0x49f374);_0x2e0e85&&!_0x504bf9[_0x438496(0xaa)](_0x2e0e85['lockKey'])&&_0x2272d4[_0x438496(0xa7)](_0x2e0e85[_0x438496(0xaf)]);}}const _0x2dc4f6=_0xa3109[_0x438496(0xa9)]===0x0&&_0x54e05b[_0x438496(0xa9)]===0x0&&_0x2272d4[_0x438496(0xa9)]===0x0;return{'ok':!![],'data':{'added':_0xa3109,'modified':_0x54e05b,'unchanged':_0x683076,'remoteOnly':_0x2272d4},'message':_0x2dc4f6?_0x438496(0xb5):_0xa3109['length']+_0x438496(0xb2)+_0x54e05b[_0x438496(0xa9)]+'\x20modified,\x20'+_0x683076['length']+'\x20unchanged'+(_0x2272d4['length']>0x0?',\x20'+_0x2272d4[_0x438496(0xa9)]+_0x438496(0xb3):'')};}};function a39_0x4c5d(){const _0x517691=['6337644QplhnO','19182aHZRwQ','lockKey','375385QGQOaP','filePath','\x20added,\x20','\x20remote-only','16299AkCxdY','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','349344lgmmxh','1910lrWJHW','4541559sXpcnH','status','apiDir','alias','datasetCode','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','34041zKAMhE','appCode','56XdNqCz','2XEfdyg','264RLtpvc','18EmDyra','push','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','length','has','scriptsRoot','all'];a39_0x4c5d=function(){return _0x517691;};return a39_0x4c5d();}
@@ -1 +1 @@
1
- const a39_0x2c3dfc=a39_0x1605;(function(_0x5be8af,_0x452c45){const _0x18dc54=a39_0x1605,_0x9b7ec3=_0x5be8af();while(!![]){try{const _0x369dd8=parseInt(_0x18dc54(0x138))/0x1*(parseInt(_0x18dc54(0x149))/0x2)+parseInt(_0x18dc54(0x146))/0x3+-parseInt(_0x18dc54(0x130))/0x4*(parseInt(_0x18dc54(0x134))/0x5)+-parseInt(_0x18dc54(0x151))/0x6*(parseInt(_0x18dc54(0x145))/0x7)+parseInt(_0x18dc54(0x14a))/0x8*(-parseInt(_0x18dc54(0x148))/0x9)+-parseInt(_0x18dc54(0x13b))/0xa+parseInt(_0x18dc54(0x131))/0xb;if(_0x369dd8===_0x452c45)break;else _0x9b7ec3['push'](_0x9b7ec3['shift']());}catch(_0x11026f){_0x9b7ec3['push'](_0x9b7ec3['shift']());}}}(a39_0xe3ec,0x7af59));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a39_0xe3ec(){const _0x2f0738=['\x20is\x20already\x20current','\x20via\x20skills@latest','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','skillVersion','inherit','installedPath','Built-in\x20Skill\x20install\x20failed\x20[','729904fvmLsJ','1516701eRmAIz','CLI\x20Built-in\x20Skill\x20','36459EDSIAG','1338FaDnZg','1792wJBRgC',']:\x20','\x20installed','code','read','cwd','cli-skill','6aqRvYu','info','pipe','error','421964EahqNO','15767763HlUPno','changed','repairCommand','15ACniqa','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','cli-skill-install','setLogPath','1AOadLb','\x20at\x20','apiError','1078590zaQxfs','log','install'];a39_0xe3ec=function(){return _0x2f0738;};return a39_0xe3ec();}function a39_0x1605(_0x979ae,_0x2c8da2){_0x979ae=_0x979ae-0x130;const _0xe3ecc8=a39_0xe3ec();let _0x16055a=_0xe3ecc8[_0x979ae];return _0x16055a;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x2c3dfc(0x150),'command':a39_0x2c3dfc(0x13d),'description':a39_0x2c3dfc(0x135),'risk':a39_0x2c3dfc(0x14e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x13d3ea){const _0x19d782=a39_0x2c3dfc;logger[_0x19d782(0x137)](process[_0x19d782(0x14f)]()),logger[_0x19d782(0x152)](_0x19d782(0x136),'Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.');const _0x57bc60=installBuiltinSkill({'stdio':_0x13d3ea['nonInteractive']?_0x19d782(0x153):_0x19d782(0x142)});if(!_0x57bc60['ok'])throw CliErrors[_0x19d782(0x13a)](_0x19d782(0x144)+_0x57bc60[_0x19d782(0x14d)]+_0x19d782(0x14b)+(_0x57bc60[_0x19d782(0x154)]||'unknown'),_0x19d782(0x140)+_0x57bc60[_0x19d782(0x133)]);return console[_0x19d782(0x13c)](_0x57bc60[_0x19d782(0x132)]?_0x19d782(0x147)+_0x57bc60[_0x19d782(0x141)]+_0x19d782(0x14c)+(_0x57bc60['installedPath']?_0x19d782(0x139)+_0x57bc60[_0x19d782(0x143)]:_0x19d782(0x13f)):_0x19d782(0x147)+_0x57bc60['skillVersion']+_0x19d782(0x13e)+(_0x57bc60[_0x19d782(0x143)]?_0x19d782(0x139)+_0x57bc60[_0x19d782(0x143)]:'')),{'ok':!![]};}}];
1
+ const a40_0xacb3dd=a40_0x252c;function a40_0x2a23(){const _0x95b42f=['191201KEJhuL','4462645hMVKsq','cli-skill-install','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','\x20is\x20already\x20current','inherit','apiError',']:\x20','info','\x20installed','read','3jdDSZm','nonInteractive','1852398kWbwMo','\x20at\x20','175340WMFopE','skillVersion','4559232JOOTvW','Built-in\x20Skill\x20install\x20failed\x20[','CLI\x20Built-in\x20Skill\x20','576nhgAtR','\x20via\x20skills@latest','2366154ISKPNa','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','193779EVPGJu','pipe','installedPath','code','changed'];a40_0x2a23=function(){return _0x95b42f;};return a40_0x2a23();}(function(_0x412e39,_0x25c955){const _0x36d4fe=a40_0x252c,_0x39bf87=_0x412e39();while(!![]){try{const _0x3713e3=parseInt(_0x36d4fe(0x142))/0x1+parseInt(_0x36d4fe(0x132))/0x2+-parseInt(_0x36d4fe(0x130))/0x3*(-parseInt(_0x36d4fe(0x134))/0x4)+-parseInt(_0x36d4fe(0x143))/0x5+-parseInt(_0x36d4fe(0x136))/0x6+-parseInt(_0x36d4fe(0x13b))/0x7+-parseInt(_0x36d4fe(0x139))/0x8*(-parseInt(_0x36d4fe(0x13d))/0x9);if(_0x3713e3===_0x25c955)break;else _0x39bf87['push'](_0x39bf87['shift']());}catch(_0x5b25aa){_0x39bf87['push'](_0x39bf87['shift']());}}}(a40_0x2a23,0xb0094));function a40_0x252c(_0x7b80c7,_0x5601bf){_0x7b80c7=_0x7b80c7-0x12e;const _0x2a236a=a40_0x2a23();let _0x252cd2=_0x2a236a[_0x7b80c7];return _0x252cd2;}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':a40_0xacb3dd(0x145),'risk':a40_0xacb3dd(0x12f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3c1af0){const _0x5dfe05=a40_0xacb3dd;logger['setLogPath'](process['cwd']()),logger[_0x5dfe05(0x14a)](_0x5dfe05(0x144),_0x5dfe05(0x13c));const _0x44f421=installBuiltinSkill({'stdio':_0x3c1af0[_0x5dfe05(0x131)]?_0x5dfe05(0x13e):_0x5dfe05(0x147)});if(!_0x44f421['ok'])throw CliErrors[_0x5dfe05(0x148)](_0x5dfe05(0x137)+_0x44f421[_0x5dfe05(0x140)]+_0x5dfe05(0x149)+(_0x44f421['error']||'unknown'),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x44f421['repairCommand']);return console['log'](_0x44f421[_0x5dfe05(0x141)]?'CLI\x20Built-in\x20Skill\x20'+_0x44f421[_0x5dfe05(0x135)]+_0x5dfe05(0x12e)+(_0x44f421['installedPath']?_0x5dfe05(0x133)+_0x44f421[_0x5dfe05(0x13f)]:_0x5dfe05(0x13a)):_0x5dfe05(0x138)+_0x44f421['skillVersion']+_0x5dfe05(0x146)+(_0x44f421[_0x5dfe05(0x13f)]?'\x20at\x20'+_0x44f421[_0x5dfe05(0x13f)]:'')),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a40_0x1e9577=a40_0x2711;(function(_0x1477fb,_0x4b7555){const _0x1416ac=a40_0x2711,_0x1f3a47=_0x1477fb();while(!![]){try{const _0x55148b=-parseInt(_0x1416ac(0x161))/0x1+parseInt(_0x1416ac(0x197))/0x2+-parseInt(_0x1416ac(0x16a))/0x3*(parseInt(_0x1416ac(0x144))/0x4)+parseInt(_0x1416ac(0x156))/0x5*(parseInt(_0x1416ac(0x184))/0x6)+parseInt(_0x1416ac(0x193))/0x7*(parseInt(_0x1416ac(0x149))/0x8)+-parseInt(_0x1416ac(0x173))/0x9*(-parseInt(_0x1416ac(0x174))/0xa)+-parseInt(_0x1416ac(0x17a))/0xb;if(_0x55148b===_0x4b7555)break;else _0x1f3a47['push'](_0x1f3a47['shift']());}catch(_0x5be69e){_0x1f3a47['push'](_0x1f3a47['shift']());}}}(a40_0x5706,0x4aaf9));import a40_0x5d1c61 from'chalk';import a40_0x43f33d from'ora';import a40_0x2fbb1 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';function a40_0x5706(){const _0x94301f=['trim','\x20install\x20-g\x20','slice','state','latest','Update\x20failed','Updating\x20via\x20','toLowerCase','includes','...','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','beta','valid',',\x20state\x20','78491lFIwDr','str','repairCommand','Checking\x20for\x20updates...','902978NObENE','read',',\x20found\x20','Invalid\x20version:\x20','expected\x20','91792BToHmD','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','map','https://registry.npmjs.org/-/package/','Version\x20comparison\x20failed','184edjbHb','Beta\x20version:\x20','\x20is\x20newer\x20than\x20npm\x20latest\x20v','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20doctor','filter','current','log','version','yellow','update','start','message','335510LTfiAA','CLI\x20updated\x20to\x20v','length','apiError','skillVersion','green',']:\x20','Requested\x20version:\x20','succeed','Run:\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','100472hvpLIE','fail','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20→\x20',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','boolean',',\x20then\x20verify\x20with:\x20','Update\x20available:\x20','69ZZtcbL','\x20\x20CLI\x20Built-in\x20Skill\x20','gray','validation','fromEntries','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Try\x20manually:\x20','run','Current\x20version\x20v','1471905aayyMD','10VfrUMa','red','install','\x20is\x20up\x20to\x20date.','bool','npm','5231160wDikAR','code','source','info','Checking\x20CLI\x20Built-in\x20Skill...','unknown','timeout','string','bun','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','48PTSLoQ'];a40_0x5706=function(){return _0x94301f;};return a40_0x5706();}function a40_0x2711(_0x465e3c,_0xa1986c){_0x465e3c=_0x465e3c-0x142;const _0x57063f=a40_0x5706();let _0x2711ad=_0x57063f[_0x465e3c];return _0x2711ad;}import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x55b942=a40_0x2711;return GIT_COMMIT!==_0x55b942(0x17f)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x55b942(0x187)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0xdc6e58=a40_0x2711,_0x3da5f0=process['execPath'][_0xdc6e58(0x18c)]();if(_0x3da5f0[_0xdc6e58(0x18d)](_0xdc6e58(0x182)))return'bun';return _0xdc6e58(0x179);}const updateFlags=[{'name':a40_0x1e9577(0x190),'type':a40_0x1e9577(0x167),'description':a40_0x1e9577(0x163),'default':![]},{'name':'version','type':a40_0x1e9577(0x181),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0xf03976){const _0x3feda0=a40_0x1e9577;return _0xf03976[_0x3feda0(0x194)]('version')[_0x3feda0(0x185)]();}async function validateUpdateFlags(_0x27a91a){const _0x5b44b9=a40_0x1e9577,_0x23ec3c=_0x27a91a[_0x5b44b9(0x178)](_0x5b44b9(0x190)),_0x318f3d=getRequestedVersion(_0x27a91a);if(_0x23ec3c&&_0x318f3d)throw CliErrors[_0x5b44b9(0x16d)](_0x5b44b9(0x14c),_0x5b44b9(0x145));if(_0x318f3d&&!a40_0x2fbb1[_0x5b44b9(0x191)](_0x318f3d))throw CliErrors[_0x5b44b9(0x16d)](_0x5b44b9(0x142)+_0x318f3d,_0x5b44b9(0x183));}async function fetchNpmDistTags(){const _0x1f96af=a40_0x1e9577;try{const _0x39ad3a=await fetch(_0x1f96af(0x147)+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x1f96af(0x180)](0x2710)});if(!_0x39ad3a['ok'])return null;const _0x103c27=await _0x39ad3a['json']();if(!_0x103c27||typeof _0x103c27!=='object')return null;return Object[_0x1f96af(0x16e)](Object['entries'](_0x103c27)[_0x1f96af(0x14e)](([,_0x55fa2a])=>typeof _0x55fa2a===_0x1f96af(0x181)&&_0x55fa2a[_0x1f96af(0x185)]()[_0x1f96af(0x158)]>0x0)[_0x1f96af(0x146)](([_0x411238,_0xcaf3d3])=>[_0x411238,String(_0xcaf3d3)[_0x1f96af(0x185)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x3d7655){const _0x4e8855=await fetchNpmDistTags();return _0x4e8855?.[_0x3d7655]??null;}async function fetchLatestVersion(){const _0x56d722=a40_0x1e9577;return fetchNpmDistTagVersion(_0x56d722(0x189));}async function resolveTargetVersion(_0x25ec01){const _0x26baab=a40_0x1e9577,_0x5194cc=getRequestedVersion(_0x25ec01);if(_0x5194cc)return{'version':_0x5194cc,'source':_0x26baab(0x151)};if(_0x25ec01[_0x26baab(0x178)](_0x26baab(0x190))){const _0x14b9a6=await fetchNpmDistTagVersion(_0x26baab(0x190));if(!_0x14b9a6)return null;return{'version':_0x14b9a6,'source':'beta'};}const _0x2604cf=await fetchLatestVersion();if(!_0x2604cf)return null;return{'version':_0x2604cf,'source':_0x26baab(0x189)};}function shouldInstallTarget(_0x4eba64,_0x10bd35){const _0x45433a=a40_0x1e9577;if(_0x10bd35[_0x45433a(0x17c)]===_0x45433a(0x151)||_0x10bd35[_0x45433a(0x17c)]==='beta')return!a40_0x2fbb1['eq'](_0x4eba64,_0x10bd35[_0x45433a(0x151)]);return a40_0x2fbb1['lt'](_0x4eba64,_0x10bd35['version']);}function getInstallPlanLabel(_0x13031f,_0x49889e){const _0x3d1a83=a40_0x1e9577;switch(_0x49889e[_0x3d1a83(0x17c)]){case _0x3d1a83(0x190):return _0x3d1a83(0x14a)+a40_0x5d1c61['yellow'](_0x13031f)+'\x20→\x20'+a40_0x5d1c61['green'](_0x49889e['version']);case'version':return _0x3d1a83(0x15d)+a40_0x5d1c61['yellow'](_0x13031f)+'\x20→\x20'+a40_0x5d1c61['green'](_0x49889e[_0x3d1a83(0x151)]);case _0x3d1a83(0x189):default:return _0x3d1a83(0x169)+a40_0x5d1c61[_0x3d1a83(0x152)](_0x13031f)+_0x3d1a83(0x164)+a40_0x5d1c61[_0x3d1a83(0x15b)](_0x49889e[_0x3d1a83(0x151)]);}}function repairCurrentBuiltinSkill(){const _0x4c8235=a40_0x1e9577;console['log'](a40_0x5d1c61['gray'](_0x4c8235(0x17e)));const _0x1a4c19=installBuiltinSkill();if(_0x1a4c19['ok']){console[_0x4c8235(0x150)](a40_0x5d1c61[_0x4c8235(0x16c)](_0x4c8235(0x16b)+_0x1a4c19[_0x4c8235(0x15a)]+'\x20is\x20up\x20to\x20date.'));return;}throw CliErrors[_0x4c8235(0x159)]('CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x1a4c19[_0x4c8235(0x17b)]+_0x4c8235(0x15c)+(_0x1a4c19['error']||_0x4c8235(0x17f)),_0x4c8235(0x15f)+_0x1a4c19[_0x4c8235(0x195)]+_0x4c8235(0x168)+CLI_BIN_NAME+_0x4c8235(0x14d));}function verifyUpdatedBuiltinSkill(_0xeef811){const _0x493699=a40_0x1e9577,_0x5358b0=inspectInstalledBuiltinSkillVersion(_0xeef811);if(_0x5358b0[_0x493699(0x188)]===_0x493699(0x14f)){console[_0x493699(0x150)](a40_0x5d1c61['gray'](_0x493699(0x16b)+_0xeef811+_0x493699(0x177)));return;}const _0x5ee421=_0x5358b0[_0x493699(0x15a)]?'expected\x20'+_0xeef811+_0x493699(0x199)+_0x5358b0['skillVersion']:_0x493699(0x143)+_0xeef811+_0x493699(0x192)+_0x5358b0[_0x493699(0x188)];throw CliErrors[_0x493699(0x159)](_0x493699(0x157)+_0xeef811+_0x493699(0x165)+_0x5ee421,'Run:\x20'+_0x5358b0[_0x493699(0x195)]+_0x493699(0x168)+CLI_BIN_NAME+_0x493699(0x14d));}async function execute(_0x3a7a47){const _0x458e3b=a40_0x1e9577;await validateUpdateFlags(_0x3a7a47);const _0x44d2a0=getCurrentVersion();console[_0x458e3b(0x150)]('Current\x20version:\x20'+_0x44d2a0);const _0x7ae997=a40_0x43f33d(_0x458e3b(0x196))[_0x458e3b(0x154)](),_0x1c3e42=await resolveTargetVersion(_0x3a7a47);if(!_0x1c3e42){const _0x529345=_0x3a7a47[_0x458e3b(0x178)](_0x458e3b(0x190))?_0x458e3b(0x166):_0x458e3b(0x18f);return _0x7ae997[_0x458e3b(0x162)](_0x529345),console[_0x458e3b(0x150)](a40_0x5d1c61['gray'](_0x458e3b(0x16f)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x529345};}const _0x46effb=a40_0x2fbb1[_0x458e3b(0x191)](VERSION),_0x336f26=a40_0x2fbb1['valid'](_0x1c3e42[_0x458e3b(0x151)]);if(!_0x46effb||!_0x336f26)return _0x7ae997['fail']('Version\x20comparison\x20failed'),{'ok':![],'message':_0x458e3b(0x148)};if(!shouldInstallTarget(_0x46effb,_0x1c3e42)){const _0x282bac=_0x1c3e42[_0x458e3b(0x17c)]==='version'?'Already\x20on\x20requested\x20version\x20(v'+_0x1c3e42[_0x458e3b(0x151)]+')':a40_0x2fbb1['gt'](_0x46effb,_0x336f26)?_0x458e3b(0x172)+_0x44d2a0+_0x458e3b(0x14b)+_0x1c3e42[_0x458e3b(0x151)]:'Already\x20up\x20to\x20date\x20(v'+_0x1c3e42['version']+')';return _0x7ae997['succeed'](_0x282bac),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x7ae997[_0x458e3b(0x17d)](getInstallPlanLabel(_0x44d2a0,_0x1c3e42));const _0x3179b0=detectPackageManager(),_0x411ebd=_0x3179b0===_0x458e3b(0x179)?resolveNpmBin(_0x458e3b(0x179)):_0x3179b0,_0x5d0172=a40_0x43f33d(_0x458e3b(0x18b)+_0x3179b0+_0x458e3b(0x18e))[_0x458e3b(0x154)]();try{await execa(_0x411ebd,[_0x458e3b(0x176),'-g',NPM_PACKAGE_NAME+'@'+_0x1c3e42[_0x458e3b(0x151)]],{'stdio':'pipe'}),_0x5d0172[_0x458e3b(0x15e)]('Updated\x20to\x20v'+_0x1c3e42[_0x458e3b(0x151)]),console[_0x458e3b(0x150)](a40_0x5d1c61['gray']('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'));}catch(_0x275b32){return _0x5d0172[_0x458e3b(0x162)](_0x458e3b(0x18a)),console['error'](a40_0x5d1c61[_0x458e3b(0x175)]('\x20\x20'+_0x275b32['message'])),console[_0x458e3b(0x150)](a40_0x5d1c61[_0x458e3b(0x16c)](_0x458e3b(0x170)+_0x3179b0+_0x458e3b(0x186)+NPM_PACKAGE_NAME+'@'+_0x1c3e42[_0x458e3b(0x151)])),{'ok':![],'message':_0x275b32[_0x458e3b(0x155)]};}return verifyUpdatedBuiltinSkill(_0x1c3e42[_0x458e3b(0x151)]),{'ok':!![]};}export const updateDefinition={'service':a40_0x1e9577(0x153),'command':a40_0x1e9577(0x171),'description':a40_0x1e9577(0x160),'risk':a40_0x1e9577(0x198),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
1
+ const a41_0x13f6a6=a41_0x595f;function a41_0x595f(_0x5beb32,_0xd843b7){_0x5beb32=_0x5beb32-0x64;const _0x11147c=a41_0x1114();let _0x595fe9=_0x11147c[_0x5beb32];return _0x595fe9;}(function(_0x4ffcce,_0x4bd1fe){const _0x5b1c73=a41_0x595f,_0x533cd4=_0x4ffcce();while(!![]){try{const _0x2d78b3=-parseInt(_0x5b1c73(0x65))/0x1*(-parseInt(_0x5b1c73(0x90))/0x2)+-parseInt(_0x5b1c73(0x7c))/0x3+-parseInt(_0x5b1c73(0xb3))/0x4+parseInt(_0x5b1c73(0x88))/0x5+parseInt(_0x5b1c73(0x8c))/0x6+-parseInt(_0x5b1c73(0x68))/0x7+-parseInt(_0x5b1c73(0x6d))/0x8*(-parseInt(_0x5b1c73(0x6a))/0x9);if(_0x2d78b3===_0x4bd1fe)break;else _0x533cd4['push'](_0x533cd4['shift']());}catch(_0x461923){_0x533cd4['push'](_0x533cd4['shift']());}}}(a41_0x1114,0xb8f15));import a41_0x38cd94 from'chalk';import a41_0x501352 from'ora';function a41_0x1114(){const _0xe6603a=['yellow','bool','1GXRtMQ','beta','bun','4372830PqURtS','code','9pJQkIG',',\x20then\x20verify\x20with:\x20','Invalid\x20version:\x20','12112312lbyjYV','slice','install','apiError','start','length','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20install\x20-g\x20','Install\x20a\x20specific\x20CLI\x20version','log','\x20doctor','...','Updated\x20to\x20v','validation','3331428HjxSWW','toLowerCase','\x20\x20CLI\x20Built-in\x20Skill\x20','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','execPath','\x20\x20Try\x20manually:\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','update','str','message','current','boolean','237675UYPBDk','object','Already\x20on\x20requested\x20version\x20(v','green','8253360SqRkHX','Current\x20version:\x20','info','Current\x20version\x20v','904746DaDDjG','trim','fail','valid',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','repairCommand','succeed','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','unknown','latest','Run:\x20','timeout','json','Checking\x20CLI\x20Built-in\x20Skill...','skillVersion','Update\x20failed','red','fromEntries','Update\x20available:\x20','version','CLI\x20updated\x20to\x20v','Beta\x20version:\x20','npm','\x20→\x20','map','error','gray','pipe','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','\x20is\x20up\x20to\x20date.','state','source','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','expected\x20','Checking\x20for\x20updates...','3587264QdWiXb','Version\x20comparison\x20failed'];a41_0x1114=function(){return _0xe6603a;};return a41_0x1114();}import a41_0x382b3c from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x4279f9=a41_0x595f;return GIT_COMMIT!==_0x4279f9(0x98)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4279f9(0x6e)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x3a1ce0=a41_0x595f,_0x1d772a=process[_0x3a1ce0(0x80)][_0x3a1ce0(0x7d)]();if(_0x1d772a['includes'](_0x3a1ce0(0x67)))return _0x3a1ce0(0x67);return _0x3a1ce0(0xa6);}const updateFlags=[{'name':'beta','type':a41_0x13f6a6(0x87),'description':a41_0x13f6a6(0x74),'default':![]},{'name':a41_0x13f6a6(0xa3),'type':'string','description':a41_0x13f6a6(0x76)}];function getRequestedVersion(_0x5c27c1){const _0x374f84=a41_0x13f6a6;return _0x5c27c1[_0x374f84(0x84)](_0x374f84(0xa3))[_0x374f84(0x91)]();}async function validateUpdateFlags(_0x4a21ad){const _0x2fa454=a41_0x13f6a6,_0x129a70=_0x4a21ad[_0x2fa454(0x64)]('beta'),_0x4dcd75=getRequestedVersion(_0x4a21ad);if(_0x129a70&&_0x4dcd75)throw CliErrors[_0x2fa454(0x7b)](_0x2fa454(0x7f),_0x2fa454(0x73));if(_0x4dcd75&&!a41_0x382b3c[_0x2fa454(0x93)](_0x4dcd75))throw CliErrors[_0x2fa454(0x7b)](_0x2fa454(0x6c)+_0x4dcd75,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x58de07=a41_0x13f6a6;try{const _0x3e59cf=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x58de07(0x9b)](0x2710)});if(!_0x3e59cf['ok'])return null;const _0x3811b2=await _0x3e59cf[_0x58de07(0x9c)]();if(!_0x3811b2||typeof _0x3811b2!==_0x58de07(0x89))return null;return Object[_0x58de07(0xa1)](Object['entries'](_0x3811b2)['filter'](([,_0x457855])=>typeof _0x457855==='string'&&_0x457855[_0x58de07(0x91)]()[_0x58de07(0x72)]>0x0)[_0x58de07(0xa8)](([_0x5f514c,_0xec8c82])=>[_0x5f514c,String(_0xec8c82)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x35e0dc){const _0x6374f=await fetchNpmDistTags();return _0x6374f?.[_0x35e0dc]??null;}async function fetchLatestVersion(){const _0x21d936=a41_0x13f6a6;return fetchNpmDistTagVersion(_0x21d936(0x99));}async function resolveTargetVersion(_0x2a7385){const _0x105108=a41_0x13f6a6,_0x3585ca=getRequestedVersion(_0x2a7385);if(_0x3585ca)return{'version':_0x3585ca,'source':_0x105108(0xa3)};if(_0x2a7385['bool']('beta')){const _0xd7417b=await fetchNpmDistTagVersion('beta');if(!_0xd7417b)return null;return{'version':_0xd7417b,'source':'beta'};}const _0x3b1369=await fetchLatestVersion();if(!_0x3b1369)return null;return{'version':_0x3b1369,'source':_0x105108(0x99)};}function shouldInstallTarget(_0x3a3868,_0x5e4e7c){const _0x4e6605=a41_0x13f6a6;if(_0x5e4e7c[_0x4e6605(0xaf)]==='version'||_0x5e4e7c[_0x4e6605(0xaf)]===_0x4e6605(0x66))return!a41_0x382b3c['eq'](_0x3a3868,_0x5e4e7c['version']);return a41_0x382b3c['lt'](_0x3a3868,_0x5e4e7c[_0x4e6605(0xa3)]);}function getInstallPlanLabel(_0x3cf037,_0x20c343){const _0x36d350=a41_0x13f6a6;switch(_0x20c343[_0x36d350(0xaf)]){case _0x36d350(0x66):return _0x36d350(0xa5)+a41_0x38cd94[_0x36d350(0xb5)](_0x3cf037)+'\x20→\x20'+a41_0x38cd94['green'](_0x20c343['version']);case'version':return'Requested\x20version:\x20'+a41_0x38cd94[_0x36d350(0xb5)](_0x3cf037)+_0x36d350(0xa7)+a41_0x38cd94[_0x36d350(0x8b)](_0x20c343[_0x36d350(0xa3)]);case _0x36d350(0x99):default:return _0x36d350(0xa2)+a41_0x38cd94[_0x36d350(0xb5)](_0x3cf037)+_0x36d350(0xa7)+a41_0x38cd94[_0x36d350(0x8b)](_0x20c343[_0x36d350(0xa3)]);}}function repairCurrentBuiltinSkill(){const _0xff0499=a41_0x13f6a6;console[_0xff0499(0x77)](a41_0x38cd94[_0xff0499(0xaa)](_0xff0499(0x9d)));const _0x35c217=installBuiltinSkill();if(_0x35c217['ok']){console[_0xff0499(0x77)](a41_0x38cd94['gray'](_0xff0499(0x7e)+_0x35c217[_0xff0499(0x9e)]+_0xff0499(0xad)));return;}throw CliErrors[_0xff0499(0x70)](_0xff0499(0x97)+_0x35c217[_0xff0499(0x69)]+']:\x20'+(_0x35c217[_0xff0499(0xa9)]||_0xff0499(0x98)),_0xff0499(0x9a)+_0x35c217[_0xff0499(0x95)]+_0xff0499(0x6b)+CLI_BIN_NAME+_0xff0499(0x78));}function verifyUpdatedBuiltinSkill(_0x47761e){const _0x2823cd=a41_0x13f6a6,_0x2f6210=inspectInstalledBuiltinSkillVersion(_0x47761e);if(_0x2f6210[_0x2823cd(0xae)]===_0x2823cd(0x86)){console[_0x2823cd(0x77)](a41_0x38cd94[_0x2823cd(0xaa)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x47761e+_0x2823cd(0xad)));return;}const _0x400ce6=_0x2f6210[_0x2823cd(0x9e)]?_0x2823cd(0xb1)+_0x47761e+',\x20found\x20'+_0x2f6210[_0x2823cd(0x9e)]:_0x2823cd(0xb1)+_0x47761e+',\x20state\x20'+_0x2f6210[_0x2823cd(0xae)];throw CliErrors['apiError'](_0x2823cd(0xa4)+_0x47761e+_0x2823cd(0x94)+_0x400ce6,'Run:\x20'+_0x2f6210[_0x2823cd(0x95)]+',\x20then\x20verify\x20with:\x20'+CLI_BIN_NAME+_0x2823cd(0x78));}async function execute(_0x42cb84){const _0x4d5517=a41_0x13f6a6;await validateUpdateFlags(_0x42cb84);const _0x339b4a=getCurrentVersion();console[_0x4d5517(0x77)](_0x4d5517(0x8d)+_0x339b4a);const _0x3fbb7c=a41_0x501352(_0x4d5517(0xb2))[_0x4d5517(0x71)](),_0x3b65d8=await resolveTargetVersion(_0x42cb84);if(!_0x3b65d8){const _0x103083=_0x42cb84['bool'](_0x4d5517(0x66))?_0x4d5517(0xb0):'Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)';return _0x3fbb7c[_0x4d5517(0x92)](_0x103083),console[_0x4d5517(0x77)](a41_0x38cd94[_0x4d5517(0xaa)](_0x4d5517(0x82)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x103083};}const _0x4a2a3a=a41_0x382b3c[_0x4d5517(0x93)](VERSION),_0x415964=a41_0x382b3c[_0x4d5517(0x93)](_0x3b65d8[_0x4d5517(0xa3)]);if(!_0x4a2a3a||!_0x415964)return _0x3fbb7c[_0x4d5517(0x92)](_0x4d5517(0xb4)),{'ok':![],'message':_0x4d5517(0xb4)};if(!shouldInstallTarget(_0x4a2a3a,_0x3b65d8)){const _0x453f69=_0x3b65d8[_0x4d5517(0xaf)]===_0x4d5517(0xa3)?_0x4d5517(0x8a)+_0x3b65d8[_0x4d5517(0xa3)]+')':a41_0x382b3c['gt'](_0x4a2a3a,_0x415964)?_0x4d5517(0x8f)+_0x339b4a+'\x20is\x20newer\x20than\x20npm\x20latest\x20v'+_0x3b65d8[_0x4d5517(0xa3)]:'Already\x20up\x20to\x20date\x20(v'+_0x3b65d8[_0x4d5517(0xa3)]+')';return _0x3fbb7c[_0x4d5517(0x96)](_0x453f69),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x3fbb7c[_0x4d5517(0x8e)](getInstallPlanLabel(_0x339b4a,_0x3b65d8));const _0x45566c=detectPackageManager(),_0x1fbf36=_0x45566c===_0x4d5517(0xa6)?resolveNpmBin(_0x4d5517(0xa6)):_0x45566c,_0x205729=a41_0x501352('Updating\x20via\x20'+_0x45566c+_0x4d5517(0x79))[_0x4d5517(0x71)]();try{await execa(_0x1fbf36,[_0x4d5517(0x6f),'-g',NPM_PACKAGE_NAME+'@'+_0x3b65d8[_0x4d5517(0xa3)]],{'stdio':_0x4d5517(0xab)}),_0x205729['succeed'](_0x4d5517(0x7a)+_0x3b65d8['version']),console[_0x4d5517(0x77)](a41_0x38cd94[_0x4d5517(0xaa)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'));}catch(_0x571a67){return _0x205729['fail'](_0x4d5517(0x9f)),console['error'](a41_0x38cd94[_0x4d5517(0xa0)]('\x20\x20'+_0x571a67[_0x4d5517(0x85)])),console['log'](a41_0x38cd94['gray'](_0x4d5517(0x81)+_0x45566c+_0x4d5517(0x75)+NPM_PACKAGE_NAME+'@'+_0x3b65d8['version'])),{'ok':![],'message':_0x571a67['message']};}return verifyUpdatedBuiltinSkill(_0x3b65d8[_0x4d5517(0xa3)]),{'ok':!![]};}export const updateDefinition={'service':a41_0x13f6a6(0x83),'command':'run','description':a41_0x13f6a6(0xac),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
@@ -1 +1 @@
1
- (function(_0x32dd25,_0x23cf81){const _0x12927e=a41_0x100c,_0x38fcf8=_0x32dd25();while(!![]){try{const _0x34dd4e=parseInt(_0x12927e(0xb3))/0x1+-parseInt(_0x12927e(0xb9))/0x2+parseInt(_0x12927e(0xb8))/0x3*(parseInt(_0x12927e(0xb5))/0x4)+parseInt(_0x12927e(0xba))/0x5*(parseInt(_0x12927e(0xbd))/0x6)+-parseInt(_0x12927e(0xb7))/0x7*(-parseInt(_0x12927e(0xb6))/0x8)+parseInt(_0x12927e(0xbc))/0x9*(-parseInt(_0x12927e(0xb4))/0xa)+-parseInt(_0x12927e(0xbb))/0xb;if(_0x34dd4e===_0x23cf81)break;else _0x38fcf8['push'](_0x38fcf8['shift']());}catch(_0x466751){_0x38fcf8['push'](_0x38fcf8['shift']());}}}(a41_0x1038,0x63507));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x100c(_0x44c055,_0x6c546a){_0x44c055=_0x44c055-0xb3;const _0x1038c9=a41_0x1038();let _0x100cbf=_0x1038c9[_0x44c055];return _0x100cbf;}export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x1038(){const _0x17a0a8=['1137828jpoWNG','8YdESWa','2733899amupBw','3wXbjwu','861408mXhShT','30LgNnaH','1295987JZWGbZ','1881828iLxPAt','323916XRnEAm','165474pAOdlt','10sgikks'];a41_0x1038=function(){return _0x17a0a8;};return a41_0x1038();}
1
+ (function(_0x4305fd,_0x50e119){const _0x36678f=a42_0x3ad1,_0x3f06c3=_0x4305fd();while(!![]){try{const _0xa708d9=parseInt(_0x36678f(0x1d7))/0x1+-parseInt(_0x36678f(0x1d5))/0x2*(-parseInt(_0x36678f(0x1d6))/0x3)+parseInt(_0x36678f(0x1d9))/0x4+-parseInt(_0x36678f(0x1da))/0x5+parseInt(_0x36678f(0x1d8))/0x6+parseInt(_0x36678f(0x1dc))/0x7*(parseInt(_0x36678f(0x1db))/0x8)+-parseInt(_0x36678f(0x1dd))/0x9;if(_0xa708d9===_0x50e119)break;else _0x3f06c3['push'](_0x3f06c3['shift']());}catch(_0x95f2cb){_0x3f06c3['push'](_0x3f06c3['shift']());}}}(a42_0x5471,0xbd048));function a42_0x3ad1(_0x54e108,_0x348f1d){_0x54e108=_0x54e108-0x1d5;const _0x5471e6=a42_0x5471();let _0x3ad1f2=_0x5471e6[_0x54e108];return _0x3ad1f2;}import{codegenSdk}from'../../commands/codegen/sdk.js';function a42_0x5471(){const _0x1c5c08=['21682XttIoR','354JEkEgt','920864Pfuofa','7628880cFZLeK','3766456Qeanzj','2246330Tpnfsr','10359672NypPFb','7kdXdXe','40362057CPlWzz'];a42_0x5471=function(){return _0x1c5c08;};return a42_0x5471();}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
@@ -1 +1 @@
1
- const a42_0x5d685f=a42_0x14e0;(function(_0x54ee2c,_0x3e0973){const _0x934c15=a42_0x14e0,_0x199f05=_0x54ee2c();while(!![]){try{const _0x5db391=parseInt(_0x934c15(0x80))/0x1*(-parseInt(_0x934c15(0x82))/0x2)+parseInt(_0x934c15(0x76))/0x3*(parseInt(_0x934c15(0x83))/0x4)+-parseInt(_0x934c15(0x75))/0x5*(parseInt(_0x934c15(0x77))/0x6)+-parseInt(_0x934c15(0x70))/0x7*(-parseInt(_0x934c15(0x6e))/0x8)+-parseInt(_0x934c15(0x7a))/0x9+-parseInt(_0x934c15(0x81))/0xa*(-parseInt(_0x934c15(0x7f))/0xb)+parseInt(_0x934c15(0x6b))/0xc;if(_0x5db391===_0x3e0973)break;else _0x199f05['push'](_0x199f05['shift']());}catch(_0x8a7974){_0x199f05['push'](_0x199f05['shift']());}}}(a42_0xb238,0x26215));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a42_0x14e0(_0x2d40fc,_0x2141aa){_0x2d40fc=_0x2d40fc-0x6b;const _0xb238e0=a42_0xb238();let _0x14e015=_0xb238e0[_0x2d40fc];return _0x14e015;}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x5d685f(0x7e),'command':'sdk','description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x5d685f(0x79),'type':a42_0x5d685f(0x84),'description':a42_0x5d685f(0x71)},{'name':a42_0x5d685f(0x7c),'type':a42_0x5d685f(0x84),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0x5d685f(0x6f),'type':a42_0x5d685f(0x7d),'description':a42_0x5d685f(0x6c)}],async 'execute'(_0x49f563){const _0x47a0e9=a42_0x5d685f,{dataset:_0x119ed8,operation:_0x181996}=await getOperationDetail(_0x49f563[_0x47a0e9(0x7b)],_0x49f563['str'](_0x47a0e9(0x72)),_0x49f563[_0x47a0e9(0x74)](_0x47a0e9(0x7c))),_0x416f0e=generateSdkCode(_0x119ed8,_0x181996,{'includeImports':!_0x49f563[_0x47a0e9(0x6d)](_0x47a0e9(0x6f))});return{'ok':!![],'data':{'dataset':{'name':_0x119ed8[_0x47a0e9(0x73)],'code':_0x119ed8[_0x47a0e9(0x72)],'tableName':_0x119ed8[_0x47a0e9(0x78)]},'operation':_0x49f563[_0x47a0e9(0x74)]('operation'),'code':_0x416f0e}};}};function a42_0xb238(){const _0x4aa623=['str','75xCpVDN','189555QFnMOn','23442ztFkGE','tableName','alias','2464893QaZnuV','appCode','operation','boolean','codegen','1837ECATbg','168159SaLRSP','16340HdJDDp','2zUFbJm','4VBOJgl','string','2578800gCUPJo','Omit\x20import\x20statements\x20from\x20generated\x20code','bool','846872TGyFli','skip-imports','7cHkwzc','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','code','name'];a42_0xb238=function(){return _0x4aa623;};return a42_0xb238();}
1
+ const a43_0x2e7562=a43_0x3b94;(function(_0xfc7b64,_0x496a9b){const _0x37370a=a43_0x3b94,_0x58b027=_0xfc7b64();while(!![]){try{const _0x1856cc=-parseInt(_0x37370a(0x19c))/0x1+-parseInt(_0x37370a(0x19e))/0x2+parseInt(_0x37370a(0x1a7))/0x3+-parseInt(_0x37370a(0x1a6))/0x4+-parseInt(_0x37370a(0x196))/0x5+-parseInt(_0x37370a(0x1a5))/0x6+parseInt(_0x37370a(0x1a1))/0x7*(parseInt(_0x37370a(0x1a0))/0x8);if(_0x1856cc===_0x496a9b)break;else _0x58b027['push'](_0x58b027['shift']());}catch(_0xcf219c){_0x58b027['push'](_0x58b027['shift']());}}}(a43_0xd8f7,0xb59a2));function a43_0x3b94(_0x43b6bb,_0xabd8c2){_0x43b6bb=_0x43b6bb-0x195;const _0xd8f792=a43_0xd8f7();let _0x3b94e5=_0xd8f792[_0x43b6bb];return _0x3b94e5;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a43_0xd8f7(){const _0x3ddd0e=['alias','bool','6084654cmgHdR','5613156WtBuVl','2518554rXqANC','skip-imports','1663030uppCKA','code','name','Omit\x20import\x20statements\x20from\x20generated\x20code','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','string','1248139PBhCiZ','str','87084zWOLkQ','read','424NirJhZ','521171tWyubk','operation'];a43_0xd8f7=function(){return _0x3ddd0e;};return a43_0xd8f7();}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':'sdk','description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':a43_0x2e7562(0x19f),'flags':[CODE_FLAG_OPTIONAL,{'name':a43_0x2e7562(0x1a3),'type':a43_0x2e7562(0x19b),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a43_0x2e7562(0x1a2),'type':a43_0x2e7562(0x19b),'required':!![],'description':a43_0x2e7562(0x19a)},{'name':a43_0x2e7562(0x195),'type':'boolean','description':a43_0x2e7562(0x199)}],async 'execute'(_0x3e23ed){const _0x5dc275=a43_0x2e7562,{dataset:_0x1f9032,operation:_0x1c81ce}=await getOperationDetail(_0x3e23ed['appCode'],_0x3e23ed['str'](_0x5dc275(0x197)),_0x3e23ed[_0x5dc275(0x19d)]('operation')),_0x341d7c=generateSdkCode(_0x1f9032,_0x1c81ce,{'includeImports':!_0x3e23ed[_0x5dc275(0x1a4)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x1f9032[_0x5dc275(0x198)],'code':_0x1f9032[_0x5dc275(0x197)],'tableName':_0x1f9032['tableName']},'operation':_0x3e23ed[_0x5dc275(0x19d)]('operation'),'code':_0x341d7c}};}};
@@ -1 +1 @@
1
- function a43_0x4b84(){const _0x5a600d=['codegen','3504320VhFoGJ','sdk','sqlCode','1986600rjgQWn','5134776zDFjgu','bool','no-imports','str','boolean','12VZXqxK','198303IFaqni','3223934TYpFrq','5857749YYrycv','target','21TfKsNQ','124694TGxpEY','appCode','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query'];a43_0x4b84=function(){return _0x5a600d;};return a43_0x4b84();}const a43_0x55493e=a43_0x583f;(function(_0xd54b47,_0x213231){const _0x3e9758=a43_0x583f,_0x2ebb6a=_0xd54b47();while(!![]){try{const _0x5cc3a2=parseInt(_0x3e9758(0x103))/0x1+parseInt(_0x3e9758(0x108))/0x2*(-parseInt(_0x3e9758(0x107))/0x3)+parseInt(_0x3e9758(0xfc))/0x4+-parseInt(_0x3e9758(0xf9))/0x5+-parseInt(_0x3e9758(0x102))/0x6*(-parseInt(_0x3e9758(0x104))/0x7)+-parseInt(_0x3e9758(0xfd))/0x8+parseInt(_0x3e9758(0x105))/0x9;if(_0x5cc3a2===_0x213231)break;else _0x2ebb6a['push'](_0x2ebb6a['shift']());}catch(_0x4d89ed){_0x2ebb6a['push'](_0x2ebb6a['shift']());}}}(a43_0x4b84,0x77176));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x583f(_0x51e82c,_0x4f16e3){_0x51e82c=_0x51e82c-0xf7;const _0x4b84ee=a43_0x4b84();let _0x583f6a=_0x4b84ee[_0x51e82c];return _0x583f6a;}export const codegenSql={'service':a43_0x55493e(0xf8),'command':'sql','description':a43_0x55493e(0xf7),'risk':'read','flags':[SQLCODE_FLAG,{'name':a43_0x55493e(0x106),'type':'string','description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x55493e(0xfa),'enum':['sdk','bff']},{'name':a43_0x55493e(0xff),'type':a43_0x55493e(0x101),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x4f96cd){const _0x5b24c7=a43_0x55493e,_0x22bdf9=await getSqlQueryInfo(_0x4f96cd[_0x5b24c7(0x109)],_0x4f96cd[_0x5b24c7(0x100)]('sqlcode')),_0x4535e6=_0x4f96cd[_0x5b24c7(0x100)](_0x5b24c7(0x106))||'sdk',_0x377bc1=generateSqlCodeTemplate(_0x22bdf9,{'target':_0x4535e6,'includeImports':!_0x4f96cd[_0x5b24c7(0xfe)](_0x5b24c7(0xff))});return{'ok':!![],'data':{'sqlCode':_0x22bdf9[_0x5b24c7(0xfb)],'sqlName':_0x22bdf9['sqlName'],'target':_0x4535e6,'code':_0x377bc1}};}};
1
+ const a44_0x162cf9=a44_0x89d6;(function(_0x28a58e,_0x2493f1){const _0x276642=a44_0x89d6,_0x9b0da5=_0x28a58e();while(!![]){try{const _0x26aff8=parseInt(_0x276642(0xc7))/0x1+parseInt(_0x276642(0xbd))/0x2*(-parseInt(_0x276642(0xca))/0x3)+-parseInt(_0x276642(0xce))/0x4*(parseInt(_0x276642(0xbc))/0x5)+-parseInt(_0x276642(0xc3))/0x6+-parseInt(_0x276642(0xcb))/0x7+-parseInt(_0x276642(0xc6))/0x8*(-parseInt(_0x276642(0xcf))/0x9)+parseInt(_0x276642(0xbb))/0xa*(parseInt(_0x276642(0xc8))/0xb);if(_0x26aff8===_0x2493f1)break;else _0x9b0da5['push'](_0x9b0da5['shift']());}catch(_0x59785e){_0x9b0da5['push'](_0x9b0da5['shift']());}}}(a44_0x2a81,0x3204b));function a44_0x89d6(_0x24c1c9,_0xd16101){_0x24c1c9=_0x24c1c9-0xba;const _0x2a8140=a44_0x2a81();let _0x89d604=_0x2a8140[_0x24c1c9];return _0x89d604;}function a44_0x2a81(){const _0x35e14=['target','3590890hZfuxe','30togQYE','129432MqKtIy','no-imports','string','sqlcode','read','sqlName','362898dxyLhn','sql','Omit\x20import\x20statements\x20from\x20generated\x20code','3392MKMALp','352697FRRnDP','11DFFNxF','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','12kFZSIM','2112558qMAwVy','sdk','sqlCode','72812jBuSua','4743nGFAmN','bff','boolean','appCode'];a44_0x2a81=function(){return _0x35e14;};return a44_0x2a81();}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':'codegen','command':a44_0x162cf9(0xc4),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a44_0x162cf9(0xc1),'flags':[SQLCODE_FLAG,{'name':'target','type':a44_0x162cf9(0xbf),'description':a44_0x162cf9(0xc9),'default':a44_0x162cf9(0xcc),'enum':[a44_0x162cf9(0xcc),a44_0x162cf9(0xd0)]},{'name':a44_0x162cf9(0xbe),'type':a44_0x162cf9(0xd1),'description':a44_0x162cf9(0xc5)}],async 'execute'(_0x112948){const _0x36b45f=a44_0x162cf9,_0x245c32=await getSqlQueryInfo(_0x112948[_0x36b45f(0xd2)],_0x112948['str'](_0x36b45f(0xc0))),_0x16041a=_0x112948['str'](_0x36b45f(0xba))||'sdk',_0x5d6731=generateSqlCodeTemplate(_0x245c32,{'target':_0x16041a,'includeImports':!_0x112948['bool']('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x245c32[_0x36b45f(0xcd)],'sqlName':_0x245c32[_0x36b45f(0xc2)],'target':_0x16041a,'code':_0x5d6731}};}};
@@ -1 +1 @@
1
- (function(_0x4bf99c,_0x3c6710){const _0x51a3b9=a44_0x129b,_0x1590c5=_0x4bf99c();while(!![]){try{const _0x30f500=parseInt(_0x51a3b9(0x1dd))/0x1*(-parseInt(_0x51a3b9(0x1f6))/0x2)+-parseInt(_0x51a3b9(0x1e4))/0x3+-parseInt(_0x51a3b9(0x1fe))/0x4*(-parseInt(_0x51a3b9(0x1f4))/0x5)+parseInt(_0x51a3b9(0x1ed))/0x6+parseInt(_0x51a3b9(0x1f7))/0x7*(-parseInt(_0x51a3b9(0x1d9))/0x8)+-parseInt(_0x51a3b9(0x1e3))/0x9*(parseInt(_0x51a3b9(0x1ea))/0xa)+parseInt(_0x51a3b9(0x1eb))/0xb;if(_0x30f500===_0x3c6710)break;else _0x1590c5['push'](_0x1590c5['shift']());}catch(_0x521301){_0x1590c5['push'](_0x1590c5['shift']());}}}(a44_0x453e,0xa72f9));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a44_0x129b(_0x1df281,_0xc04994){_0x1df281=_0x1df281-0x1d8;const _0x453efa=a44_0x453e();let _0x129b90=_0x453efa[_0x1df281];return _0x129b90;}function a44_0x453e(){const _0x348b2e=['Use\x20global\x20config\x20scope','projectConfig','32vesoYs','length','App\x20\x22','keys','Updated','\x20<name>\x20--appcode\x20<code>','global','\x22\x20still\x20defined\x20in\x20','trim','3113768ZIANqc','boolean','args','project','1EUfUOh','Removed\x20app\x20\x22','\x20app\x20\x22','\x20Note:\x20app\x20\x22','\x22\x20(appcode:\x20','validation','9YDQHTK','3176508UzMBzD','\x20Remaining\x20app\x20\x22','\x20<name>','defaultApp','\x20Default\x20app\x20changed\x20to\x20\x22','App\x20code','2771110sIKujD','25281047yorhFO','apps','8026146fzZKnB','Usage:\x20','string','Added','\x20Default\x20app\x20is\x20\x22','object','globalConfig','557565RxvvaA','appcode','2679338HqaIpr','21unoran','flagMissing','str','bool','\x22\x20not\x20found.'];a44_0x453e=function(){return _0x348b2e;};return a44_0x453e();}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 _0x33a84d=a44_0x129b;return[{'name':_0x33a84d(0x1f5),'type':_0x33a84d(0x1ef),'description':_0x33a84d(0x1e9),'required':!![]},{'name':_0x33a84d(0x204),'type':_0x33a84d(0x1da),'description':_0x33a84d(0x1fc),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x25ff47=a44_0x129b;return[{'name':_0x25ff47(0x204),'type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]}];}export async function validateAppName(_0xc57546,_0x461fbf){const _0x398c8a=a44_0x129b,_0x4c067c=_0xc57546[_0x398c8a(0x1db)][0x0]?.[_0x398c8a(0x1d8)]();if(!_0x4c067c)throw CliErrors[_0x398c8a(0x1e2)]('Missing\x20app\x20name.',_0x398c8a(0x1ee)+CLI_BIN_NAME+'\x20'+_0x461fbf+_0x398c8a(0x1e6));}export async function runAppAdd(_0x46f62c,_0x35bd22){const _0x5654a8=a44_0x129b,_0x27d258=_0x46f62c['args'][0x0]?.['trim']();if(!_0x27d258)throw CliErrors['validation']('Missing\x20app\x20name.',_0x5654a8(0x1ee)+CLI_BIN_NAME+'\x20'+_0x35bd22+'\x20<name>\x20--appcode\x20<code>');const _0x44fe7c=_0x46f62c[_0x5654a8(0x1f9)](_0x5654a8(0x1f5));if(!_0x44fe7c)throw CliErrors[_0x5654a8(0x1f8)](_0x5654a8(0x1f5),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x35bd22+_0x5654a8(0x203));const _0x254f80={'global':_0x46f62c[_0x5654a8(0x1fa)](_0x5654a8(0x204))},_0x18dab2=readConfig(_0x254f80);if(!_0x18dab2[_0x5654a8(0x1ec)])_0x18dab2[_0x5654a8(0x1ec)]={};const _0x546efc={'appcode':_0x44fe7c,...collectAppProfileOverrides(_0x59eeaf=>_0x46f62c[_0x5654a8(0x1f9)](_0x59eeaf))},_0x3d490c=_0x18dab2['apps'],_0x789da7=Object[_0x5654a8(0x201)](_0x3d490c),_0x1191f8=typeof _0x18dab2[_0x5654a8(0x1e7)]===_0x5654a8(0x1ef)&&_0x3d490c[_0x18dab2[_0x5654a8(0x1e7)]]?_0x18dab2['defaultApp']:_0x789da7['length']===0x1?_0x789da7[0x0]:undefined,_0x851cc7=!!_0x3d490c[_0x27d258];_0x3d490c[_0x27d258]=_0x546efc;const _0x2fd214=normalizeStoredDefaultApp(_0x18dab2,_0x1191f8);writeConfig(_0x18dab2,_0x254f80);const _0x371b4b=!_0x851cc7&&_0x2fd214?_0x5654a8(0x1f1)+_0x2fd214+'\x22.':'',_0x11b896=(_0x851cc7?_0x5654a8(0x202):_0x5654a8(0x1f0))+_0x5654a8(0x1df)+_0x27d258+_0x5654a8(0x1e1)+_0x44fe7c+')'+scopeLabel(_0x254f80)+'.'+_0x371b4b;return{'ok':!![],'message':_0x11b896};}export async function runAppRemove(_0x1fd18b,_0x49f321){const _0x4f85f1=a44_0x129b,_0x49720b=_0x1fd18b[_0x4f85f1(0x1db)][0x0]?.[_0x4f85f1(0x1d8)]();if(!_0x49720b)throw CliErrors[_0x4f85f1(0x1e2)]('Missing\x20app\x20name.',_0x4f85f1(0x1ee)+CLI_BIN_NAME+'\x20'+_0x49f321+'\x20<name>\x20[--global]');const _0x506eb1=_0x1fd18b[_0x4f85f1(0x1fa)](_0x4f85f1(0x204)),{config:_0xec6a2a,layers:_0xcca454}=readRawConfigWithLayers(),_0x2a8a35=_0xec6a2a['apps']??{};if(!_0x2a8a35[_0x49720b])throw CliErrors['validation'](_0x4f85f1(0x200)+_0x49720b+_0x4f85f1(0x1fb));const _0x3fc4ce=_0xcca454[_0x4f85f1(0x1f3)][_0x4f85f1(0x1ec)]&&typeof _0xcca454['globalConfig']['apps']===_0x4f85f1(0x1f2)?_0xcca454[_0x4f85f1(0x1f3)]['apps']:{},_0xb69bba=_0xcca454[_0x4f85f1(0x1fd)][_0x4f85f1(0x1ec)]&&typeof _0xcca454[_0x4f85f1(0x1fd)][_0x4f85f1(0x1ec)]===_0x4f85f1(0x1f2)?_0xcca454['projectConfig'][_0x4f85f1(0x1ec)]:{},_0x417e80=appDefinedIn(_0x49720b,_0x3fc4ce,_0xb69bba),_0x5dfeb0=resolveAppScopeForWrite(_0x49720b,_0x506eb1,_0xcca454),_0x151efa={'global':_0x5dfeb0==='global'},_0x4426f9=readConfig(_0x151efa),_0x5a801c=_0x4426f9[_0x4f85f1(0x1ec)];if(!_0x5a801c||!_0x5a801c[_0x49720b])throw CliErrors[_0x4f85f1(0x1e2)]('App\x20\x22'+_0x49720b+_0x4f85f1(0x1fb));delete _0x5a801c[_0x49720b];let _0x42e46d='';const _0x487b87=typeof _0x4426f9[_0x4f85f1(0x1e7)]===_0x4f85f1(0x1ef)?_0x4426f9[_0x4f85f1(0x1e7)]:undefined,_0x533e6e=Object[_0x4f85f1(0x201)](_0x5a801c),_0xb18c11=_0x487b87===_0x49720b?_0x533e6e[0x0]:_0x487b87,_0xf19a9a=normalizeStoredDefaultApp(_0x4426f9,_0xb18c11);if(_0x487b87===_0x49720b&&_0x533e6e['length']===0x1)_0x42e46d=_0x4f85f1(0x1e5)+_0x533e6e[0x0]+'\x22\x20is\x20selected\x20automatically.';else _0x487b87===_0x49720b&&_0xf19a9a&&(_0x42e46d=_0x4f85f1(0x1e8)+_0xf19a9a+'\x22.');Object['keys'](_0x5a801c)[_0x4f85f1(0x1ff)]===0x0&&(delete _0x4426f9[_0x4f85f1(0x1ec)],delete _0x4426f9[_0x4f85f1(0x1e7)]);writeConfig(_0x4426f9,_0x151efa);const _0x186e02=_0x417e80==='both'?_0x4f85f1(0x1e0)+_0x49720b+_0x4f85f1(0x205)+(_0x5dfeb0===_0x4f85f1(0x1dc)?_0x4f85f1(0x204):'project')+'\x20config.':'';return{'ok':!![],'message':_0x4f85f1(0x1de)+_0x49720b+'\x22'+scopeLabel(_0x151efa)+'.'+_0x42e46d+_0x186e02};}
1
+ (function(_0x53771f,_0x790a58){const _0x4a5fbb=a45_0x35ce,_0x166210=_0x53771f();while(!![]){try{const _0x4d5651=-parseInt(_0x4a5fbb(0xc4))/0x1*(-parseInt(_0x4a5fbb(0xd3))/0x2)+-parseInt(_0x4a5fbb(0xca))/0x3*(parseInt(_0x4a5fbb(0xb4))/0x4)+-parseInt(_0x4a5fbb(0xcb))/0x5*(-parseInt(_0x4a5fbb(0xbe))/0x6)+parseInt(_0x4a5fbb(0xd8))/0x7*(parseInt(_0x4a5fbb(0xc3))/0x8)+-parseInt(_0x4a5fbb(0xde))/0x9+-parseInt(_0x4a5fbb(0xd2))/0xa+-parseInt(_0x4a5fbb(0xdb))/0xb*(-parseInt(_0x4a5fbb(0xd0))/0xc);if(_0x4d5651===_0x790a58)break;else _0x166210['push'](_0x166210['shift']());}catch(_0x3dc8d7){_0x166210['push'](_0x166210['shift']());}}}(a45_0x332e,0x3ab89));function a45_0x332e(){const _0x1dd23e=['1190EefqXL','projectConfig','App\x20\x22','args','App\x20code','4956bcTXjT','appcode','1635180HlKyEh','2hgFxWs','Updated','\x20<name>\x20[--global]','validation','bool','77MrOWYh','project','Missing\x20app\x20name.','11MvrEHr','keys','defaultApp','3165804CcZSVT','Usage:\x20','global','Use\x20global\x20config\x20scope','\x20Default\x20app\x20is\x20\x22','117164xLybjI','str','Removed\x20app\x20\x22','flagMissing','\x22\x20not\x20found.','\x20<name>','\x20<name>\x20--appcode\x20<code>','globalConfig','\x20Note:\x20app\x20\x22','string','9354eHWjjt','\x20Default\x20app\x20changed\x20to\x20\x22','apps','\x22\x20still\x20defined\x20in\x20','\x20app\x20\x22','124088LRyAHr','448047AxDAZf','boolean','object','length','\x20Remaining\x20app\x20\x22','\x20config.','24hrukJC'];a45_0x332e=function(){return _0x1dd23e;};return a45_0x332e();}import{CliErrors}from'../../errors.js';function a45_0x35ce(_0x278dd1,_0x5361f8){_0x278dd1=_0x278dd1-0xb2;const _0x332e43=a45_0x332e();let _0x35ce71=_0x332e43[_0x278dd1];return _0x35ce71;}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 _0x1c17e1=a45_0x35ce;return[{'name':_0x1c17e1(0xd1),'type':'string','description':_0x1c17e1(0xcf),'required':!![]},{'name':_0x1c17e1(0xe0),'type':_0x1c17e1(0xc5),'description':_0x1c17e1(0xb2),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x1b6c4c=a45_0x35ce;return[{'name':_0x1b6c4c(0xe0),'type':_0x1b6c4c(0xc5),'description':_0x1b6c4c(0xb2),'default':![]}];}export async function validateAppName(_0x13968f,_0x1568e7){const _0xc47396=a45_0x35ce,_0x5dc216=_0x13968f[_0xc47396(0xce)][0x0]?.['trim']();if(!_0x5dc216)throw CliErrors[_0xc47396(0xd6)]('Missing\x20app\x20name.',_0xc47396(0xdf)+CLI_BIN_NAME+'\x20'+_0x1568e7+_0xc47396(0xb9));}export async function runAppAdd(_0x1f5c57,_0x1b317f){const _0x301c92=a45_0x35ce,_0x51f889=_0x1f5c57[_0x301c92(0xce)][0x0]?.['trim']();if(!_0x51f889)throw CliErrors[_0x301c92(0xd6)](_0x301c92(0xda),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x1b317f+_0x301c92(0xba));const _0x20c35a=_0x1f5c57[_0x301c92(0xb5)](_0x301c92(0xd1));if(!_0x20c35a)throw CliErrors[_0x301c92(0xb7)](_0x301c92(0xd1),_0x301c92(0xdf)+CLI_BIN_NAME+'\x20'+_0x1b317f+_0x301c92(0xba));const _0x414a11={'global':_0x1f5c57['bool'](_0x301c92(0xe0))},_0x48ec3e=readConfig(_0x414a11);if(!_0x48ec3e[_0x301c92(0xc0)])_0x48ec3e['apps']={};const _0x5884f9={'appcode':_0x20c35a,...collectAppProfileOverrides(_0x423f81=>_0x1f5c57[_0x301c92(0xb5)](_0x423f81))},_0x5ad4d5=_0x48ec3e[_0x301c92(0xc0)],_0x563ca7=Object['keys'](_0x5ad4d5),_0x5cc39f=typeof _0x48ec3e[_0x301c92(0xdd)]===_0x301c92(0xbd)&&_0x5ad4d5[_0x48ec3e[_0x301c92(0xdd)]]?_0x48ec3e[_0x301c92(0xdd)]:_0x563ca7['length']===0x1?_0x563ca7[0x0]:undefined,_0x20c0c1=!!_0x5ad4d5[_0x51f889];_0x5ad4d5[_0x51f889]=_0x5884f9;const _0x5dbad3=normalizeStoredDefaultApp(_0x48ec3e,_0x5cc39f);writeConfig(_0x48ec3e,_0x414a11);const _0x11f621=!_0x20c0c1&&_0x5dbad3?_0x301c92(0xb3)+_0x5dbad3+'\x22.':'',_0x199908=(_0x20c0c1?_0x301c92(0xd4):'Added')+_0x301c92(0xc2)+_0x51f889+'\x22\x20(appcode:\x20'+_0x20c35a+')'+scopeLabel(_0x414a11)+'.'+_0x11f621;return{'ok':!![],'message':_0x199908};}export async function runAppRemove(_0x4bc887,_0x449427){const _0x5644ed=a45_0x35ce,_0x2ae7e2=_0x4bc887[_0x5644ed(0xce)][0x0]?.['trim']();if(!_0x2ae7e2)throw CliErrors['validation'](_0x5644ed(0xda),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x449427+_0x5644ed(0xd5));const _0x413a5a=_0x4bc887[_0x5644ed(0xd7)](_0x5644ed(0xe0)),{config:_0x98ad35,layers:_0x394db3}=readRawConfigWithLayers(),_0x158947=_0x98ad35[_0x5644ed(0xc0)]??{};if(!_0x158947[_0x2ae7e2])throw CliErrors['validation'](_0x5644ed(0xcd)+_0x2ae7e2+_0x5644ed(0xb8));const _0x427e5f=_0x394db3[_0x5644ed(0xbb)]['apps']&&typeof _0x394db3[_0x5644ed(0xbb)][_0x5644ed(0xc0)]===_0x5644ed(0xc6)?_0x394db3[_0x5644ed(0xbb)][_0x5644ed(0xc0)]:{},_0x2f78cd=_0x394db3[_0x5644ed(0xcc)][_0x5644ed(0xc0)]&&typeof _0x394db3[_0x5644ed(0xcc)]['apps']==='object'?_0x394db3['projectConfig'][_0x5644ed(0xc0)]:{},_0x4b30d2=appDefinedIn(_0x2ae7e2,_0x427e5f,_0x2f78cd),_0x40b2af=resolveAppScopeForWrite(_0x2ae7e2,_0x413a5a,_0x394db3),_0x50d57d={'global':_0x40b2af==='global'},_0x25e108=readConfig(_0x50d57d),_0x180161=_0x25e108[_0x5644ed(0xc0)];if(!_0x180161||!_0x180161[_0x2ae7e2])throw CliErrors[_0x5644ed(0xd6)](_0x5644ed(0xcd)+_0x2ae7e2+_0x5644ed(0xb8));delete _0x180161[_0x2ae7e2];let _0x54a168='';const _0x41505b=typeof _0x25e108[_0x5644ed(0xdd)]===_0x5644ed(0xbd)?_0x25e108[_0x5644ed(0xdd)]:undefined,_0x375692=Object[_0x5644ed(0xdc)](_0x180161),_0x45bd19=_0x41505b===_0x2ae7e2?_0x375692[0x0]:_0x41505b,_0x3982df=normalizeStoredDefaultApp(_0x25e108,_0x45bd19);if(_0x41505b===_0x2ae7e2&&_0x375692[_0x5644ed(0xc7)]===0x1)_0x54a168=_0x5644ed(0xc8)+_0x375692[0x0]+'\x22\x20is\x20selected\x20automatically.';else _0x41505b===_0x2ae7e2&&_0x3982df&&(_0x54a168=_0x5644ed(0xbf)+_0x3982df+'\x22.');Object[_0x5644ed(0xdc)](_0x180161)[_0x5644ed(0xc7)]===0x0&&(delete _0x25e108['apps'],delete _0x25e108[_0x5644ed(0xdd)]);writeConfig(_0x25e108,_0x50d57d);const _0x47ba5d=_0x4b30d2==='both'?_0x5644ed(0xbc)+_0x2ae7e2+_0x5644ed(0xc1)+(_0x40b2af===_0x5644ed(0xd9)?_0x5644ed(0xe0):_0x5644ed(0xd9))+_0x5644ed(0xc9):'';return{'ok':!![],'message':_0x5644ed(0xb6)+_0x2ae7e2+'\x22'+scopeLabel(_0x50d57d)+'.'+_0x54a168+_0x47ba5d};}
@@ -1 +1 @@
1
- (function(_0x42efaa,_0x14903c){const _0x219d55=a45_0x184c,_0x2c2897=_0x42efaa();while(!![]){try{const _0x393d69=-parseInt(_0x219d55(0x197))/0x1*(-parseInt(_0x219d55(0x187))/0x2)+parseInt(_0x219d55(0x19f))/0x3*(parseInt(_0x219d55(0x1a0))/0x4)+parseInt(_0x219d55(0x195))/0x5*(-parseInt(_0x219d55(0x190))/0x6)+parseInt(_0x219d55(0x1a5))/0x7+-parseInt(_0x219d55(0x199))/0x8+parseInt(_0x219d55(0x18e))/0x9+-parseInt(_0x219d55(0x19d))/0xa*(parseInt(_0x219d55(0x1a7))/0xb);if(_0x393d69===_0x14903c)break;else _0x2c2897['push'](_0x2c2897['shift']());}catch(_0x474560){_0x2c2897['push'](_0x2c2897['shift']());}}}(a45_0x317d,0x743ef));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x1a488f 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';function a45_0x317d(){const _0x1b373e=['Invalid\x20App\x20Code','gray','631994dlasBT','message','map','Found\x20','includes','trim','skip','2188179kuZNKe','find','192AkqHZb','appCode','\x20\x20(','✎\x20Enter\x20manually','custom','112730CrILZX','valid','3bShaCW','\x0aNo\x20available\x20apps\x20found.','1292304tNftDR','App\x20Code:','length','yellow','70mtZyjs','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','38277HfqERt','124cWfgOg','(Skip;\x20configure\x20later)','Fetching\x20available\x20apps...','cyan','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','5541816QgKSzc','appName','1601578iRsLks','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','manual','Select\x20the\x20app\x20to\x20bind:'];a45_0x317d=function(){return _0x1b373e;};return a45_0x317d();}export async function promptCustomAppcode(){const _0x11cf2f=a45_0x184c,_0x5bfb36=await input({'message':_0x11cf2f(0x19a),'validate':_0xf03b9c=>{const _0x33890e=_0x11cf2f,_0x273737=validateAppcode(_0xf03b9c[_0x33890e(0x18c)]());return _0x273737[_0x33890e(0x196)]||_0x273737[_0x33890e(0x188)]||_0x33890e(0x185);}});return _0x5bfb36[_0x11cf2f(0x18c)]();}export async function promptAppSelection(_0xe5d604){const _0x34ada6=a45_0x184c,_0x189682=[{'name':a45_0x1a488f['yellow']('✎\x20Enter\x20appcode\x20manually'),'value':-0x1},..._0xe5d604[_0x34ada6(0x189)]((_0x1931b7,_0x84e852)=>({'name':_0x1931b7[_0x34ada6(0x1a6)]+'\x20\x20'+a45_0x1a488f['gray']('('+_0x1931b7[_0x34ada6(0x191)]+')'),'value':_0x84e852}))],_0x4924c2=await checkbox({'message':_0x34ada6(0x18a)+a45_0x1a488f[_0x34ada6(0x1a3)](_0xe5d604[_0x34ada6(0x19b)])+_0x34ada6(0x19e),'choices':_0x189682,'loop':![]});if(_0x4924c2[_0x34ada6(0x18b)](-0x1))return _0x34ada6(0x194);if(_0x4924c2[_0x34ada6(0x19b)]===0x0)return _0x34ada6(0x194);return _0x4924c2[_0x34ada6(0x189)](_0x56f62a=>_0xe5d604[_0x56f62a]);}export async function promptSingleAppSelection(_0x4f8ff6){const _0x1b0574=a45_0x184c,_0x36f5de=[{'name':a45_0x1a488f[_0x1b0574(0x186)](_0x1b0574(0x1a4)),'value':'skip'},{'name':a45_0x1a488f[_0x1b0574(0x19c)]('✎\x20Enter\x20appcode\x20manually'),'value':_0x1b0574(0x194)},..._0x4f8ff6[_0x1b0574(0x189)](_0x5aa0ac=>({'name':_0x5aa0ac[_0x1b0574(0x1a6)]+'\x20\x20'+a45_0x1a488f['gray']('('+_0x5aa0ac[_0x1b0574(0x191)]+')'),'value':_0x5aa0ac[_0x1b0574(0x191)]}))],_0x136186=await select({'message':_0x1b0574(0x184),'choices':_0x36f5de});if(_0x136186==='skip')return _0x1b0574(0x18d);if(_0x136186===_0x1b0574(0x194))return _0x1b0574(0x194);return _0x4f8ff6[_0x1b0574(0x18f)](_0x2d98ac=>_0x2d98ac['appCode']===_0x136186);}export async function selectSingleAppcode(_0x252971){const _0x2cc5be=a45_0x184c;if(!_0x252971)return writeCliSideChannelLine(a45_0x1a488f['gray']('(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)')),_fallbackOrSkip();writeCliSideChannelLine(_0x2cc5be(0x1a2));let _0x22eb2c;try{_0x22eb2c=await withActiveCookie(_0x252971,()=>listRemoteApps());}catch(_0x5e35d0){writeCliSideChannelLine(a45_0x1a488f[_0x2cc5be(0x19c)]('Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'));if(_0x5e35d0 instanceof Error)writeCliSideChannelLine(a45_0x1a488f['gray'](_0x2cc5be(0x192)+_0x5e35d0['message']+')'));return _fallbackOrSkip();}if(_0x22eb2c[_0x2cc5be(0x19b)]===0x0)return writeCliSideChannelLine(a45_0x1a488f[_0x2cc5be(0x19c)]('No\x20available\x20apps\x20found.')),_fallbackOrSkip();const _0x283c79=await promptSingleAppSelection(_0x22eb2c);if(_0x283c79==='skip')return'';if(_0x283c79===_0x2cc5be(0x194))return promptCustomAppcode();return _0x283c79['appCode'];}function a45_0x184c(_0x3565cb,_0x2659cf){_0x3565cb=_0x3565cb-0x184;const _0x317da7=a45_0x317d();let _0x184c3a=_0x317da7[_0x3565cb];return _0x184c3a;}export async function selectMultipleApps(_0x372fd5){const _0x270939=a45_0x184c;writeCliSideChannelLine(_0x270939(0x1a2));let _0x3cb31d;try{_0x3cb31d=await withActiveCookie(_0x372fd5,()=>listRemoteApps());}catch(_0x1e768e){writeCliSideChannelLine(_0x270939(0x1a8));if(_0x1e768e instanceof Error)writeCliSideChannelLine(_0x270939(0x192)+_0x1e768e[_0x270939(0x188)]+')');return'custom';}if(_0x3cb31d[_0x270939(0x19b)]===0x0)return writeCliSideChannelLine(_0x270939(0x198)),_0x270939(0x194);return promptAppSelection(_0x3cb31d);}async function _fallbackOrSkip(){const _0x15e36c=a45_0x184c,_0xfccd0f=await select({'message':_0x15e36c(0x19a),'choices':[{'name':a45_0x1a488f[_0x15e36c(0x186)](_0x15e36c(0x1a1)),'value':_0x15e36c(0x18d)},{'name':a45_0x1a488f[_0x15e36c(0x19c)](_0x15e36c(0x193)),'value':_0x15e36c(0x1a9)}]});if(_0xfccd0f==='skip')return'';return promptCustomAppcode();}
1
+ function a46_0x17d4(){const _0x562beb=['1033227dIkwku','214TeCegn','appCode','Fetching\x20available\x20apps...','App\x20Code:','find','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','custom','77886zGQDDg','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','328MDUBAb','2090hAvdNv','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','map','yellow','gray','1443911xZzOYQ','trim','✎\x20Enter\x20appcode\x20manually','1333dYAfSD','Select\x20the\x20app\x20to\x20bind:','length','48jxtTwW','manual','Found\x20','✎\x20Enter\x20manually','1647440opodTw','skip','Invalid\x20App\x20Code','\x0aNo\x20available\x20apps\x20found.','message','4173AlLJIe','appName','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','908aHtise','11930MkTCEB','6OcLYTG','No\x20available\x20apps\x20found.','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'];a46_0x17d4=function(){return _0x562beb;};return a46_0x17d4();}function a46_0x11a0(_0x209793,_0x199a9f){_0x209793=_0x209793-0xd1;const _0x17d4fb=a46_0x17d4();let _0x11a049=_0x17d4fb[_0x209793];return _0x11a049;}(function(_0x10a411,_0x184126){const _0x11b542=a46_0x11a0,_0x437df6=_0x10a411();while(!![]){try{const _0x49dc44=-parseInt(_0x11b542(0xe3))/0x1*(-parseInt(_0x11b542(0xd1))/0x2)+parseInt(_0x11b542(0xef))/0x3*(parseInt(_0x11b542(0xf2))/0x4)+-parseInt(_0x11b542(0xea))/0x5+-parseInt(_0x11b542(0xf4))/0x6*(parseInt(_0x11b542(0xe0))/0x7)+-parseInt(_0x11b542(0xda))/0x8*(-parseInt(_0x11b542(0xd8))/0x9)+parseInt(_0x11b542(0xf3))/0xa*(parseInt(_0x11b542(0xdb))/0xb)+-parseInt(_0x11b542(0xe6))/0xc*(parseInt(_0x11b542(0xf7))/0xd);if(_0x49dc44===_0x184126)break;else _0x437df6['push'](_0x437df6['shift']());}catch(_0x4c6be7){_0x437df6['push'](_0x437df6['shift']());}}}(a46_0x17d4,0x2d753));import{input,checkbox,select}from'@inquirer/prompts';import a46_0xe9c6f2 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 _0x204450=a46_0x11a0,_0x540173=await input({'message':'App\x20Code:','validate':_0x51674a=>{const _0x2e494a=a46_0x11a0,_0x597b4c=validateAppcode(_0x51674a[_0x2e494a(0xe1)]());return _0x597b4c['valid']||_0x597b4c[_0x2e494a(0xee)]||_0x2e494a(0xec);}});return _0x540173[_0x204450(0xe1)]();}export async function promptAppSelection(_0x405702){const _0x5b613f=a46_0x11a0,_0xb9b482=[{'name':a46_0xe9c6f2['yellow'](_0x5b613f(0xe2)),'value':-0x1},..._0x405702[_0x5b613f(0xdd)]((_0x587331,_0x11fbe4)=>({'name':_0x587331[_0x5b613f(0xf0)]+'\x20\x20'+a46_0xe9c6f2[_0x5b613f(0xdf)]('('+_0x587331['appCode']+')'),'value':_0x11fbe4}))],_0x37c408=await checkbox({'message':_0x5b613f(0xe8)+a46_0xe9c6f2['cyan'](_0x405702[_0x5b613f(0xe5)])+_0x5b613f(0xd9),'choices':_0xb9b482,'loop':![]});if(_0x37c408['includes'](-0x1))return _0x5b613f(0xd7);if(_0x37c408['length']===0x0)return _0x5b613f(0xd7);return _0x37c408[_0x5b613f(0xdd)](_0x2c58a2=>_0x405702[_0x2c58a2]);}export async function promptSingleAppSelection(_0x54c8ce){const _0x37d26e=a46_0x11a0,_0x900b63=[{'name':a46_0xe9c6f2[_0x37d26e(0xdf)](_0x37d26e(0xdc)),'value':_0x37d26e(0xeb)},{'name':a46_0xe9c6f2[_0x37d26e(0xde)](_0x37d26e(0xe2)),'value':_0x37d26e(0xd7)},..._0x54c8ce[_0x37d26e(0xdd)](_0x5c433e=>({'name':_0x5c433e['appName']+'\x20\x20'+a46_0xe9c6f2[_0x37d26e(0xdf)]('('+_0x5c433e[_0x37d26e(0xd2)]+')'),'value':_0x5c433e[_0x37d26e(0xd2)]}))],_0x4cb42a=await select({'message':_0x37d26e(0xe4),'choices':_0x900b63});if(_0x4cb42a===_0x37d26e(0xeb))return _0x37d26e(0xeb);if(_0x4cb42a==='custom')return'custom';return _0x54c8ce[_0x37d26e(0xd5)](_0x2a6639=>_0x2a6639[_0x37d26e(0xd2)]===_0x4cb42a);}export async function selectSingleAppcode(_0x56275e){const _0x326648=a46_0x11a0;if(!_0x56275e)return writeCliSideChannelLine(a46_0xe9c6f2['gray'](_0x326648(0xd6))),_fallbackOrSkip();writeCliSideChannelLine(_0x326648(0xd3));let _0x531efa;try{_0x531efa=await withActiveCookie(_0x56275e,()=>listRemoteApps());}catch(_0x5dd45b){writeCliSideChannelLine(a46_0xe9c6f2[_0x326648(0xde)](_0x326648(0xf6)));if(_0x5dd45b instanceof Error)writeCliSideChannelLine(a46_0xe9c6f2[_0x326648(0xdf)]('\x20\x20('+_0x5dd45b['message']+')'));return _fallbackOrSkip();}if(_0x531efa[_0x326648(0xe5)]===0x0)return writeCliSideChannelLine(a46_0xe9c6f2[_0x326648(0xde)](_0x326648(0xf5))),_fallbackOrSkip();const _0x2da778=await promptSingleAppSelection(_0x531efa);if(_0x2da778===_0x326648(0xeb))return'';if(_0x2da778===_0x326648(0xd7))return promptCustomAppcode();return _0x2da778[_0x326648(0xd2)];}export async function selectMultipleApps(_0x2fcba9){const _0x5deab2=a46_0x11a0;writeCliSideChannelLine(_0x5deab2(0xd3));let _0x12e073;try{_0x12e073=await withActiveCookie(_0x2fcba9,()=>listRemoteApps());}catch(_0x130e3c){writeCliSideChannelLine(_0x5deab2(0xf1));if(_0x130e3c instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x130e3c[_0x5deab2(0xee)]+')');return _0x5deab2(0xd7);}if(_0x12e073[_0x5deab2(0xe5)]===0x0)return writeCliSideChannelLine(_0x5deab2(0xed)),'custom';return promptAppSelection(_0x12e073);}async function _fallbackOrSkip(){const _0x5d0836=a46_0x11a0,_0x5672e5=await select({'message':_0x5d0836(0xd4),'choices':[{'name':a46_0xe9c6f2[_0x5d0836(0xdf)]('(Skip;\x20configure\x20later)'),'value':_0x5d0836(0xeb)},{'name':a46_0xe9c6f2[_0x5d0836(0xde)](_0x5d0836(0xe9)),'value':_0x5d0836(0xe7)}]});if(_0x5672e5===_0x5d0836(0xeb))return'';return promptCustomAppcode();}