@lovrabet/rabetbase-cli 2.5.8-beta.1 → 2.5.8-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 (381) hide show
  1. package/README.md +7 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +1 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +1 -1
  21. package/lib/commands/api/generate.js +1 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +1 -1
  24. package/lib/commands/api/pull.js +1 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.js +1 -1
  27. package/lib/commands/app/index.js +1 -1
  28. package/lib/commands/app/list.js +1 -1
  29. package/lib/commands/app/members-list.js +1 -1
  30. package/lib/commands/app/remote-directory.js +1 -1
  31. package/lib/commands/app/shared.js +1 -1
  32. package/lib/commands/app-config/delete.js +1 -1
  33. package/lib/commands/app-config/get.js +1 -1
  34. package/lib/commands/app-config/index.js +1 -1
  35. package/lib/commands/app-config/list.js +1 -1
  36. package/lib/commands/app-config/set.js +1 -1
  37. package/lib/commands/app-config/shared.js +1 -1
  38. package/lib/commands/auth/index.js +1 -1
  39. package/lib/commands/bff/create.js +1 -1
  40. package/lib/commands/bff/delete.js +1 -1
  41. package/lib/commands/bff/detail.js +1 -1
  42. package/lib/commands/bff/index.js +1 -1
  43. package/lib/commands/bff/list.js +1 -1
  44. package/lib/commands/bff/logs.js +1 -1
  45. package/lib/commands/bff/pull.js +1 -1
  46. package/lib/commands/bff/push.js +1 -1
  47. package/lib/commands/bff/status.js +1 -1
  48. package/lib/commands/cli-skill/index.js +1 -1
  49. package/lib/commands/cli-update.js +1 -1
  50. package/lib/commands/codegen/index.js +1 -1
  51. package/lib/commands/codegen/sdk.js +1 -1
  52. package/lib/commands/codegen/sql.js +1 -1
  53. package/lib/commands/common/app-registry.js +1 -1
  54. package/lib/commands/common/app-selector.js +1 -1
  55. package/lib/commands/common/async-task.js +1 -1
  56. package/lib/commands/common/dry-run.js +1 -1
  57. package/lib/commands/common/flags.js +1 -1
  58. package/lib/commands/common/local-file.js +1 -1
  59. package/lib/commands/common/validate.js +1 -1
  60. package/lib/commands/config/delete.js +1 -1
  61. package/lib/commands/config/get.js +1 -1
  62. package/lib/commands/config/index.js +1 -1
  63. package/lib/commands/config/init.js +1 -1
  64. package/lib/commands/config/list.js +1 -1
  65. package/lib/commands/config/set.js +1 -1
  66. package/lib/commands/config/shared.js +1 -1
  67. package/lib/commands/dataset/batch-design.js +1 -1
  68. package/lib/commands/dataset/business-group-update.js +1 -1
  69. package/lib/commands/dataset/business-groups.js +1 -1
  70. package/lib/commands/dataset/capability.js +1 -1
  71. package/lib/commands/dataset/cross-relation-create.js +1 -1
  72. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  73. package/lib/commands/dataset/cross-relation-list.js +1 -1
  74. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  75. package/lib/commands/dataset/cross-relation-update.js +1 -1
  76. package/lib/commands/dataset/delete.js +1 -1
  77. package/lib/commands/dataset/design-context.js +1 -1
  78. package/lib/commands/dataset/design-start.js +1 -1
  79. package/lib/commands/dataset/design-status.js +1 -1
  80. package/lib/commands/dataset/design-sync-retry.js +1 -1
  81. package/lib/commands/dataset/design-sync-status.js +1 -1
  82. package/lib/commands/dataset/design-validate.js +1 -1
  83. package/lib/commands/dataset/detail.js +1 -1
  84. package/lib/commands/dataset/extend-update.js +1 -1
  85. package/lib/commands/dataset/field-restore.js +1 -1
  86. package/lib/commands/dataset/field-update.js +1 -1
  87. package/lib/commands/dataset/generate.js +1 -1
  88. package/lib/commands/dataset/index.js +1 -1
  89. package/lib/commands/dataset/list.js +1 -1
  90. package/lib/commands/dataset/operations.js +1 -1
  91. package/lib/commands/dataset/relation-audit.js +1 -1
  92. package/lib/commands/dataset/relation-create.js +1 -1
  93. package/lib/commands/dataset/relation-delete.js +1 -1
  94. package/lib/commands/dataset/relation-shared.js +1 -1
  95. package/lib/commands/dataset/relation-update.js +1 -1
  96. package/lib/commands/dataset/relations.js +1 -1
  97. package/lib/commands/dataset/rename.js +1 -1
  98. package/lib/commands/dataset/restore.js +1 -1
  99. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  100. package/lib/commands/db/analysis-batching.js +1 -1
  101. package/lib/commands/db/analyze-batch-plan.js +1 -1
  102. package/lib/commands/db/analyze-cancel.js +1 -1
  103. package/lib/commands/db/analyze-start.js +1 -1
  104. package/lib/commands/db/analyze-status.js +1 -1
  105. package/lib/commands/db/create.js +1 -1
  106. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  110. package/lib/commands/db/delete.js +1 -1
  111. package/lib/commands/db/detail.js +1 -1
  112. package/lib/commands/db/diff-refresh-start.js +1 -1
  113. package/lib/commands/db/diff-refresh-status.js +1 -1
  114. package/lib/commands/db/diff.js +1 -1
  115. package/lib/commands/db/index.js +1 -1
  116. package/lib/commands/db/list.js +1 -1
  117. package/lib/commands/db/shared.js +1 -1
  118. package/lib/commands/db/table-diff-shared.js +1 -1
  119. package/lib/commands/db/tables.js +1 -1
  120. package/lib/commands/db/test.js +1 -1
  121. package/lib/commands/db/update.js +1 -1
  122. package/lib/commands/deployment/index.js +1 -1
  123. package/lib/commands/deployment/sync-all.js +1 -1
  124. package/lib/commands/deployment/sync-jobs.js +1 -1
  125. package/lib/commands/deployment/sync-status.js +1 -1
  126. package/lib/commands/doctor.js +1 -1
  127. package/lib/commands/file/index.js +1 -1
  128. package/lib/commands/flow/create.js +1 -1
  129. package/lib/commands/flow/detail.js +1 -1
  130. package/lib/commands/flow/index.js +1 -1
  131. package/lib/commands/flow/list.js +1 -1
  132. package/lib/commands/flow/page-list.js +1 -1
  133. package/lib/commands/flow/publish.js +1 -1
  134. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  135. package/lib/commands/flow/runtime-role-list.js +1 -1
  136. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  137. package/lib/commands/flow/runtime-user-search.js +1 -1
  138. package/lib/commands/flow/shared.js +1 -1
  139. package/lib/commands/flow/update.js +1 -1
  140. package/lib/commands/flow/validate.js +1 -1
  141. package/lib/commands/instant-api-policy/current.js +1 -1
  142. package/lib/commands/instant-api-policy/index.js +1 -1
  143. package/lib/commands/instant-api-policy/init.js +1 -1
  144. package/lib/commands/instant-api-policy/publish.js +1 -1
  145. package/lib/commands/instant-api-policy/pull.js +1 -1
  146. package/lib/commands/instant-api-policy/revision.js +1 -1
  147. package/lib/commands/instant-api-policy/revisions.js +1 -1
  148. package/lib/commands/instant-api-policy/rollback.js +1 -1
  149. package/lib/commands/instant-api-policy/shared.js +1 -1
  150. package/lib/commands/instant-api-policy/validate.js +1 -1
  151. package/lib/commands/issue/index.js +1 -1
  152. package/lib/commands/issue/nudge.js +1 -1
  153. package/lib/commands/issue/report.js +1 -1
  154. package/lib/commands/issue/shared.js +1 -1
  155. package/lib/commands/kb/create.js +1 -1
  156. package/lib/commands/kb/delete.js +1 -1
  157. package/lib/commands/kb/detail.js +1 -1
  158. package/lib/commands/kb/index.js +1 -1
  159. package/lib/commands/kb/list.js +1 -1
  160. package/lib/commands/kb/search.js +1 -1
  161. package/lib/commands/kb/shared.js +1 -1
  162. package/lib/commands/kb/update.js +1 -1
  163. package/lib/commands/logs/index.js +1 -1
  164. package/lib/commands/menu/asset-update.js +1 -1
  165. package/lib/commands/menu/delete.js +1 -1
  166. package/lib/commands/menu/external-link-create.js +1 -1
  167. package/lib/commands/menu/external-link-update.js +1 -1
  168. package/lib/commands/menu/group-create.js +1 -1
  169. package/lib/commands/menu/group-update.js +1 -1
  170. package/lib/commands/menu/index.js +1 -1
  171. package/lib/commands/menu/list.js +1 -1
  172. package/lib/commands/menu/move.js +1 -1
  173. package/lib/commands/menu/regroup-start.js +1 -1
  174. package/lib/commands/menu/rename.js +1 -1
  175. package/lib/commands/menu/shared/compare-table.js +1 -1
  176. package/lib/commands/menu/shared/delete-plan.js +1 -1
  177. package/lib/commands/menu/shared/facts.js +1 -1
  178. package/lib/commands/menu/shared/index.js +1 -1
  179. package/lib/commands/menu/shared/inquirer.js +1 -1
  180. package/lib/commands/menu/shared/local-pages.js +1 -1
  181. package/lib/commands/menu/shared/logic.js +1 -1
  182. package/lib/commands/menu/shared/mutations.js +1 -1
  183. package/lib/commands/menu/shared/path.js +1 -1
  184. package/lib/commands/menu/shared/service.js +1 -1
  185. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  186. package/lib/commands/menu/shared/sync-core.js +1 -1
  187. package/lib/commands/menu/shared/update-core.js +1 -1
  188. package/lib/commands/menu/shared/valid-url.js +1 -1
  189. package/lib/commands/menu/subapp-assets-status.js +1 -1
  190. package/lib/commands/menu/subapp-assets-update.js +1 -1
  191. package/lib/commands/menu/sync.js +1 -1
  192. package/lib/commands/menu/visibility-update.js +1 -1
  193. package/lib/commands/notification/config-create.js +1 -1
  194. package/lib/commands/notification/config-delete.js +1 -1
  195. package/lib/commands/notification/config-list.js +1 -1
  196. package/lib/commands/notification/config-update.js +1 -1
  197. package/lib/commands/notification/index.js +1 -1
  198. package/lib/commands/notification/shared.js +1 -1
  199. package/lib/commands/ocr/index.js +1 -1
  200. package/lib/commands/page/create.js +1 -1
  201. package/lib/commands/page/custom/detail.js +1 -1
  202. package/lib/commands/page/custom/list.js +1 -1
  203. package/lib/commands/page/custom/publish.js +1 -1
  204. package/lib/commands/page/custom/shared.js +1 -1
  205. package/lib/commands/page/custom/syntax.js +1 -1
  206. package/lib/commands/page/custom/update.js +1 -1
  207. package/lib/commands/page/data-list-status.js +1 -1
  208. package/lib/commands/page/generate-start.js +1 -1
  209. package/lib/commands/page/generate-status.js +1 -1
  210. package/lib/commands/page/index.js +1 -1
  211. package/lib/commands/page/pull.js +1 -1
  212. package/lib/commands/page/push.js +1 -1
  213. package/lib/commands/page/relation-audit.js +1 -1
  214. package/lib/commands/page/restore.js +1 -1
  215. package/lib/commands/page/shared.js +1 -1
  216. package/lib/commands/page/sync.js +1 -1
  217. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  218. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  219. package/lib/commands/project/create/format-elapsed.js +1 -1
  220. package/lib/commands/project/create/main.js +1 -1
  221. package/lib/commands/project/create/materialize-project-template.js +1 -1
  222. package/lib/commands/project/create/project-name.js +1 -1
  223. package/lib/commands/project/create/project-template-archive.js +1 -1
  224. package/lib/commands/project/create/project-template-path.js +1 -1
  225. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  226. package/lib/commands/project/create/use-format-code.js +1 -1
  227. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  228. package/lib/commands/project/domain-routing-sync.js +1 -1
  229. package/lib/commands/project/index.js +1 -1
  230. package/lib/commands/project/upgrade.js +1 -1
  231. package/lib/commands/registry.js +1 -1
  232. package/lib/commands/role/delete.js +1 -1
  233. package/lib/commands/role/detail.js +1 -1
  234. package/lib/commands/role/index.js +1 -1
  235. package/lib/commands/role/list.js +1 -1
  236. package/lib/commands/role/shared.js +1 -1
  237. package/lib/commands/role/update.js +1 -1
  238. package/lib/commands/role/user-add.js +1 -1
  239. package/lib/commands/role/user-remove.js +1 -1
  240. package/lib/commands/role/user-resolve.js +1 -1
  241. package/lib/commands/rule/get.js +1 -1
  242. package/lib/commands/rule/index.js +1 -1
  243. package/lib/commands/rule/list.js +1 -1
  244. package/lib/commands/rule/set.js +1 -1
  245. package/lib/commands/rule/shared.js +1 -1
  246. package/lib/commands/run/index.js +1 -1
  247. package/lib/commands/schema.js +1 -1
  248. package/lib/commands/sql/create.js +1 -1
  249. package/lib/commands/sql/delete.js +1 -1
  250. package/lib/commands/sql/detail.js +1 -1
  251. package/lib/commands/sql/exec.js +1 -1
  252. package/lib/commands/sql/index.js +1 -1
  253. package/lib/commands/sql/list.js +1 -1
  254. package/lib/commands/sql/pull.js +1 -1
  255. package/lib/commands/sql/push.js +1 -1
  256. package/lib/commands/sql/shared.js +1 -1
  257. package/lib/commands/sql/status.js +1 -1
  258. package/lib/commands/sql/validate.js +1 -1
  259. package/lib/commands/task/index.js +1 -1
  260. package/lib/commands/task/status.js +1 -1
  261. package/lib/commands/tenant/index.js +1 -1
  262. package/lib/commands/tenant/members-list.js +1 -1
  263. package/lib/commands/tenant/shared.js +1 -1
  264. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  265. package/lib/commands/user-account/feishu-bind.js +1 -1
  266. package/lib/commands/user-account/index.js +1 -1
  267. package/lib/commands/workspace/add.js +1 -1
  268. package/lib/commands/workspace/index.js +1 -1
  269. package/lib/commands/workspace/remove.js +1 -1
  270. package/lib/config/domain-config.js +1 -1
  271. package/lib/config/project-domain-routing.js +1 -1
  272. package/lib/config/region-config.js +1 -1
  273. package/lib/config/schema.js +1 -1
  274. package/lib/constant/cdn.js +1 -1
  275. package/lib/constant/cli.js +1 -1
  276. package/lib/constant/defaults.js +1 -1
  277. package/lib/constant/domain.d.ts +1 -1
  278. package/lib/constant/domain.js +1 -1
  279. package/lib/constant/env.js +1 -1
  280. package/lib/constant/output.js +1 -1
  281. package/lib/constant/paths.js +1 -1
  282. package/lib/constant/region.js +1 -1
  283. package/lib/constant/risk.js +1 -1
  284. package/lib/constant/routing-profile.js +1 -1
  285. package/lib/context/app-resolver.js +1 -1
  286. package/lib/context/auth-resolver.js +1 -1
  287. package/lib/context/config-loader.js +1 -1
  288. package/lib/context.js +1 -1
  289. package/lib/core/alias-resolver.js +1 -1
  290. package/lib/core/api-client.d.ts +2 -2
  291. package/lib/core/api-client.js +1 -1
  292. package/lib/core/bff/config.js +1 -1
  293. package/lib/core/bff/file-system.js +1 -1
  294. package/lib/core/bff/hash.js +1 -1
  295. package/lib/core/bff/hook-directory.js +1 -1
  296. package/lib/core/bff/lock.js +1 -1
  297. package/lib/core/bff/utils.js +1 -1
  298. package/lib/core/cross-db-analysis.js +1 -1
  299. package/lib/core/cross-db-relation.js +1 -1
  300. package/lib/core/db-resolver.js +1 -1
  301. package/lib/core/flow-config.js +1 -1
  302. package/lib/core/instant-api-policy/config.js +1 -1
  303. package/lib/core/kb-management-client.d.ts +19 -0
  304. package/lib/core/kb-management-client.js +1 -0
  305. package/lib/core/kb-search-client.js +1 -1
  306. package/lib/core/page/file-system.js +1 -1
  307. package/lib/core/page/hash.js +1 -1
  308. package/lib/core/page/lock.js +1 -1
  309. package/lib/core/page/lr-smart-jsx.js +1 -1
  310. package/lib/core/sql-index-auditor.js +1 -1
  311. package/lib/core/sql-sync/config.js +1 -1
  312. package/lib/core/sql-sync/file-system.js +1 -1
  313. package/lib/core/sql-sync/hash.js +1 -1
  314. package/lib/core/sql-sync/lock.js +1 -1
  315. package/lib/core/sql-sync/utils.js +1 -1
  316. package/lib/core/sql-validator.js +1 -1
  317. package/lib/errors.js +1 -1
  318. package/lib/framework/build-all-flags.js +1 -1
  319. package/lib/framework/error-output.js +1 -1
  320. package/lib/framework/explicit-yes.js +1 -1
  321. package/lib/framework/flags.js +1 -1
  322. package/lib/framework/help.js +1 -1
  323. package/lib/framework/index.js +1 -1
  324. package/lib/framework/output.js +1 -1
  325. package/lib/framework/response.js +1 -1
  326. package/lib/framework/runner-alias.js +1 -1
  327. package/lib/framework/runner.js +1 -1
  328. package/lib/framework/schema-export.js +1 -1
  329. package/lib/framework/supported-flags.js +1 -1
  330. package/lib/framework/types.js +1 -1
  331. package/lib/generated/build-info.d.ts +4 -4
  332. package/lib/generated/build-info.js +1 -1
  333. package/lib/generated/official-routing.js +1 -1
  334. package/lib/generated/routing-contract.js +1 -1
  335. package/lib/help.js +1 -1
  336. package/lib/postinstall.js +1 -1
  337. package/lib/runtime/confirmation.js +1 -1
  338. package/lib/runtime/event.js +1 -1
  339. package/lib/runtime/index.js +1 -1
  340. package/lib/runtime/queue.js +1 -1
  341. package/lib/runtime/resolve.js +1 -1
  342. package/lib/services/dataset-design/checkpoint.js +1 -1
  343. package/lib/services/dataset-design/commands.js +1 -1
  344. package/lib/services/dataset-design/contract.js +1 -1
  345. package/lib/skills/builtin-skill.js +1 -1
  346. package/lib/skills/main.js +1 -1
  347. package/lib/skills/npx-skills-add.js +1 -1
  348. package/lib/skills/skill-presence.js +1 -1
  349. package/lib/telemetry/cli-command-trace.js +1 -1
  350. package/lib/telemetry/cli-help-trace.js +1 -1
  351. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  352. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  353. package/lib/telemetry/send-cli-trace-log.js +1 -1
  354. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  355. package/lib/utils/ai_config.js +1 -1
  356. package/lib/utils/apply-jq-filter.js +1 -1
  357. package/lib/utils/cdn-config.js +1 -1
  358. package/lib/utils/check-sdk-version.js +1 -1
  359. package/lib/utils/cli-version-check.js +1 -1
  360. package/lib/utils/cli-version-policy.js +1 -1
  361. package/lib/utils/config.js +1 -1
  362. package/lib/utils/entity-with-id.js +1 -1
  363. package/lib/utils/file-utils.js +1 -1
  364. package/lib/utils/guides-cdn.js +1 -1
  365. package/lib/utils/http-client.js +1 -1
  366. package/lib/utils/is-non-interactive.js +1 -1
  367. package/lib/utils/logger.js +1 -1
  368. package/lib/utils/params.js +1 -1
  369. package/lib/utils/platform.js +1 -1
  370. package/lib/utils/sleep.js +1 -1
  371. package/lib/utils/template-replacer.js +1 -1
  372. package/lib/utils/update-notice.js +1 -1
  373. package/lib/utils/version.js +1 -1
  374. package/lib/utils/with-active-cookie.js +1 -1
  375. package/lib/utils/write-cli-side-channel.js +1 -1
  376. package/package.json +1 -1
  377. package/skills/rabetbase/SKILL.md +2 -2
  378. package/skills/rabetbase/references/rabetbase-kb.md +7 -6
  379. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  380. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  381. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a34_0x2c188d=a34_0x4082;function a34_0x4082(_0x35af37,_0x16989f){_0x35af37=_0x35af37-0x108;const _0x522a82=a34_0x522a();let _0x4082c2=_0x522a82[_0x35af37];return _0x4082c2;}(function(_0x4cba03,_0x402e49){const _0x3fa0a2=a34_0x4082,_0x1b8525=_0x4cba03();while(!![]){try{const _0x3265c5=-parseInt(_0x3fa0a2(0x113))/0x1*(parseInt(_0x3fa0a2(0x128))/0x2)+-parseInt(_0x3fa0a2(0x117))/0x3*(parseInt(_0x3fa0a2(0x10f))/0x4)+-parseInt(_0x3fa0a2(0x11e))/0x5*(parseInt(_0x3fa0a2(0x124))/0x6)+-parseInt(_0x3fa0a2(0x109))/0x7*(parseInt(_0x3fa0a2(0x127))/0x8)+-parseInt(_0x3fa0a2(0x108))/0x9+parseInt(_0x3fa0a2(0x125))/0xa*(parseInt(_0x3fa0a2(0x11a))/0xb)+parseInt(_0x3fa0a2(0x10b))/0xc;if(_0x3265c5===_0x402e49)break;else _0x1b8525['push'](_0x1b8525['shift']());}catch(_0x1d1096){_0x1b8525['push'](_0x1b8525['shift']());}}}(a34_0x522a,0x5cc67));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';function a34_0x522a(){const _0x405ea6=['1400110VXtnPb','4021515nJFgYk','4068281pxsdLD','update','29722308yIcLdw','get','Read\x20config\x20value\x20from\x20file','POST','168iivuPJ','set','App\x20config\x20server\x20id\x20missing\x20for\x20key=','tags','1BmaWoF','number','\x20app\x20config\x20','write','49116Xlpbyt','appCode','apiError','1293974tPEARM','/smartapi/app-config/create','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','isFinite','170285DmJMpo','string','/smartapi/app-config/update','Updated',',\x20appCode=','file','6tlOPPN','30SNJbzV','create','8IedjFU'];a34_0x522a=function(){return _0x405ea6;};return a34_0x522a();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a34_0x2c188d(0x11b),UPDATE_PATH=a34_0x2c188d(0x120);export const appConfigSet={'service':'app-config','command':a34_0x2c188d(0x110),'description':a34_0x2c188d(0x11c),'risk':a34_0x2c188d(0x116),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x2c188d(0x123),'type':a34_0x2c188d(0x11f),'description':a34_0x2c188d(0x10d)}],async 'validate'(_0x45982d){readKeyArg(_0x45982d),readOptionalTags(_0x45982d),assertSingleValueSource(_0x45982d);},async 'dryRun'(_0x57558b){const _0x4740fb=a34_0x2c188d,_0x23b95c=readKeyArg(_0x57558b),_0xc6b568=readOptionalTags(_0x57558b),_0x19c440=assertSingleValueSource(_0x57558b);await assertValueSourceReadable(_0x19c440);const _0x2d3a9b=await withAppConfigApiBoundary(_0x4740fb(0x10c),{'appCode':_0x57558b[_0x4740fb(0x118)],'key':_0x23b95c},()=>getAppConfigByKey(_0x57558b[_0x4740fb(0x118)],_0x23b95c)),_0xc77556=_0x2d3a9b?'update':_0x4740fb(0x126),_0x2e9db2=_0x2d3a9b?projectAppConfig(_0x2d3a9b):null,_0x14eb1d=plannedAppConfig({'appCode':_0x57558b[_0x4740fb(0x118)],'key':_0x23b95c,'tags':_0xc6b568??_0x2d3a9b?.['tags'],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0xc77556,'appCode':_0x57558b[_0x4740fb(0x118)],'key':_0x23b95c,'before':_0x2e9db2,'after':_0x14eb1d,'dryRun':!![]}),{'method':_0x4740fb(0x10e),'url':_0xc77556===_0x4740fb(0x10a)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x58d86d){const _0x27240f=a34_0x2c188d,_0x1bdeef=readKeyArg(_0x58d86d),_0x38b80c=readOptionalTags(_0x58d86d),_0x1c212b=await withAppConfigApiBoundary(_0x27240f(0x10c),{'appCode':_0x58d86d[_0x27240f(0x118)],'key':_0x1bdeef},()=>getAppConfigByKey(_0x58d86d[_0x27240f(0x118)],_0x1bdeef)),_0xd4d102=_0x1c212b?projectAppConfig(_0x1c212b):null,_0x22fcb5=_0x1c212b?'update':'create',{value:_0x1dfe21,warnings:_0x13d80c}=await readAppConfigValue(_0x58d86d),_0xdb0082={'appCode':_0x58d86d[_0x27240f(0x118)],'key':_0x1bdeef,'value':_0x1dfe21,'tags':_0x38b80c??_0x1c212b?.['tags']??undefined};await withAppConfigApiBoundary(_0x22fcb5,{'appCode':_0x58d86d[_0x27240f(0x118)],'key':_0x1bdeef},async()=>{const _0x23c996=_0x27240f;_0x1c212b?await updateAppConfig({..._0xdb0082,'id':requireAppConfigId(_0x1c212b,_0x1bdeef,_0x58d86d[_0x23c996(0x118)])}):await createAppConfig(_0xdb0082);});const _0x4fc294=await withAppConfigApiBoundary(_0x27240f(0x10c),{'appCode':_0x58d86d[_0x27240f(0x118)],'key':_0x1bdeef},()=>getAppConfigByKey(_0x58d86d[_0x27240f(0x118)],_0x1bdeef)),_0x470ca9=_0x4fc294?projectAppConfig(_0x4fc294):plannedAppConfig({'appCode':_0x58d86d[_0x27240f(0x118)],'key':_0x1bdeef,'tags':_0xdb0082[_0x27240f(0x112)],'hasValue':_0x1dfe21!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x22fcb5,'appCode':_0x58d86d['appCode'],'key':_0x1bdeef,'before':_0xd4d102,'after':_0x470ca9,'dryRun':![],'warnings':_0x13d80c}),'message':(_0x22fcb5===_0x27240f(0x10a)?_0x27240f(0x121):'Created')+_0x27240f(0x115)+_0x1bdeef};}};function requireAppConfigId(_0x3ef2b4,_0x2bc7ad,_0x34cd88){const _0x52c984=a34_0x2c188d;if(typeof _0x3ef2b4['id']===_0x52c984(0x114)&&Number[_0x52c984(0x11d)](_0x3ef2b4['id'])&&_0x3ef2b4['id']>0x0)return _0x3ef2b4['id'];throw CliErrors[_0x52c984(0x119)](_0x52c984(0x111)+_0x2bc7ad+_0x52c984(0x122)+_0x34cd88);}
1
+ const a34_0x5d18a4=a34_0x4dd7;(function(_0x1251f5,_0x3b050d){const _0xb99934=a34_0x4dd7,_0x2f12f9=_0x1251f5();while(!![]){try{const _0x452ba8=parseInt(_0xb99934(0x70))/0x1+parseInt(_0xb99934(0x81))/0x2*(parseInt(_0xb99934(0x7b))/0x3)+parseInt(_0xb99934(0x6d))/0x4+parseInt(_0xb99934(0x6f))/0x5+-parseInt(_0xb99934(0x67))/0x6+parseInt(_0xb99934(0x73))/0x7+-parseInt(_0xb99934(0x78))/0x8;if(_0x452ba8===_0x3b050d)break;else _0x2f12f9['push'](_0x2f12f9['shift']());}catch(_0x3126d8){_0x2f12f9['push'](_0x2f12f9['shift']());}}}(a34_0x5ccc,0x83ac0));function a34_0x4dd7(_0x3cc480,_0x4f61b9){_0x3cc480=_0x3cc480-0x67;const _0x5ccc4c=a34_0x5ccc();let _0x4dd7b2=_0x5ccc4c[_0x3cc480];return _0x4dd7b2;}import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH='/smartapi/app-config/create',UPDATE_PATH=a34_0x5d18a4(0x6e);export const appConfigSet={'service':'app-config','command':a34_0x5d18a4(0x6b),'description':a34_0x5d18a4(0x7f),'risk':a34_0x5d18a4(0x7d),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x5d18a4(0x69),'type':a34_0x5d18a4(0x7a),'description':a34_0x5d18a4(0x76)}],async 'validate'(_0x59e3e0){readKeyArg(_0x59e3e0),readOptionalTags(_0x59e3e0),assertSingleValueSource(_0x59e3e0);},async 'dryRun'(_0x5037d7){const _0x183f72=a34_0x5d18a4,_0x31b3ca=readKeyArg(_0x5037d7),_0x51eb87=readOptionalTags(_0x5037d7),_0x180a99=assertSingleValueSource(_0x5037d7);await assertValueSourceReadable(_0x180a99);const _0x5bad52=await withAppConfigApiBoundary(_0x183f72(0x74),{'appCode':_0x5037d7[_0x183f72(0x77)],'key':_0x31b3ca},()=>getAppConfigByKey(_0x5037d7[_0x183f72(0x77)],_0x31b3ca)),_0x167fc0=_0x5bad52?_0x183f72(0x80):_0x183f72(0x72),_0x39f0da=_0x5bad52?projectAppConfig(_0x5bad52):null,_0x43a52e=plannedAppConfig({'appCode':_0x5037d7[_0x183f72(0x77)],'key':_0x31b3ca,'tags':_0x51eb87??_0x5bad52?.[_0x183f72(0x71)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x167fc0,'appCode':_0x5037d7[_0x183f72(0x77)],'key':_0x31b3ca,'before':_0x39f0da,'after':_0x43a52e,'dryRun':!![]}),{'method':_0x183f72(0x68),'url':_0x167fc0===_0x183f72(0x80)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0xd47e18){const _0x4ecf7c=a34_0x5d18a4,_0xed3f17=readKeyArg(_0xd47e18),_0x436baa=readOptionalTags(_0xd47e18),_0xe03dc7=await withAppConfigApiBoundary(_0x4ecf7c(0x74),{'appCode':_0xd47e18[_0x4ecf7c(0x77)],'key':_0xed3f17},()=>getAppConfigByKey(_0xd47e18[_0x4ecf7c(0x77)],_0xed3f17)),_0x249202=_0xe03dc7?projectAppConfig(_0xe03dc7):null,_0x24fb2a=_0xe03dc7?'update':_0x4ecf7c(0x72),{value:_0x458b4c,warnings:_0x25feb0}=await readAppConfigValue(_0xd47e18),_0x12c5cc={'appCode':_0xd47e18[_0x4ecf7c(0x77)],'key':_0xed3f17,'value':_0x458b4c,'tags':_0x436baa??_0xe03dc7?.[_0x4ecf7c(0x71)]??undefined};await withAppConfigApiBoundary(_0x24fb2a,{'appCode':_0xd47e18[_0x4ecf7c(0x77)],'key':_0xed3f17},async()=>{_0xe03dc7?await updateAppConfig({..._0x12c5cc,'id':requireAppConfigId(_0xe03dc7,_0xed3f17,_0xd47e18['appCode'])}):await createAppConfig(_0x12c5cc);});const _0x47dd23=await withAppConfigApiBoundary(_0x4ecf7c(0x74),{'appCode':_0xd47e18[_0x4ecf7c(0x77)],'key':_0xed3f17},()=>getAppConfigByKey(_0xd47e18[_0x4ecf7c(0x77)],_0xed3f17)),_0x4d11fb=_0x47dd23?projectAppConfig(_0x47dd23):plannedAppConfig({'appCode':_0xd47e18[_0x4ecf7c(0x77)],'key':_0xed3f17,'tags':_0x12c5cc[_0x4ecf7c(0x71)],'hasValue':_0x458b4c!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x24fb2a,'appCode':_0xd47e18[_0x4ecf7c(0x77)],'key':_0xed3f17,'before':_0x249202,'after':_0x4d11fb,'dryRun':![],'warnings':_0x25feb0}),'message':(_0x24fb2a==='update'?_0x4ecf7c(0x79):_0x4ecf7c(0x75))+_0x4ecf7c(0x6a)+_0xed3f17};}};function a34_0x5ccc(){const _0x4187ef=['update','40310opkvLK','App\x20config\x20server\x20id\x20missing\x20for\x20key=','5581188oSJBos','POST','file','\x20app\x20config\x20','set','number','3834596UnjpnD','/smartapi/app-config/update','2294665cUwQua','375209YWdxRn','tags','create','3247699yMZiXM','get','Created','Read\x20config\x20value\x20from\x20file','appCode','13069856anhYCS','Updated','string','126AYgQGz','apiError','write',',\x20appCode=','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key'];a34_0x5ccc=function(){return _0x4187ef;};return a34_0x5ccc();}function requireAppConfigId(_0x46b96c,_0x3ebec1,_0x467ef3){const _0x2507d6=a34_0x5d18a4;if(typeof _0x46b96c['id']===_0x2507d6(0x6c)&&Number['isFinite'](_0x46b96c['id'])&&_0x46b96c['id']>0x0)return _0x46b96c['id'];throw CliErrors[_0x2507d6(0x7c)](_0x2507d6(0x82)+_0x3ebec1+_0x2507d6(0x7e)+_0x467ef3);}
@@ -1 +1 @@
1
- const a35_0x194e8b=a35_0x157e;(function(_0x24e95f,_0x43ba95){const _0x40710d=a35_0x157e,_0x13417b=_0x24e95f();while(!![]){try{const _0xc493c5=parseInt(_0x40710d(0xbf))/0x1+-parseInt(_0x40710d(0x9a))/0x2+-parseInt(_0x40710d(0x94))/0x3*(-parseInt(_0x40710d(0xbb))/0x4)+-parseInt(_0x40710d(0x87))/0x5*(-parseInt(_0x40710d(0x93))/0x6)+-parseInt(_0x40710d(0x8b))/0x7*(-parseInt(_0x40710d(0xc2))/0x8)+parseInt(_0x40710d(0xb4))/0x9+-parseInt(_0x40710d(0xc5))/0xa*(parseInt(_0x40710d(0x86))/0xb);if(_0xc493c5===_0x43ba95)break;else _0x13417b['push'](_0x13417b['shift']());}catch(_0x135076){_0x13417b['push'](_0x13417b['shift']());}}}(a35_0x58dd,0x1e3d2));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x194e8b(0xa7),'description':a35_0x194e8b(0xb3),'required':!![]};export const VALUE_ARG={'name':a35_0x194e8b(0xba),'description':a35_0x194e8b(0xaa),'required':![]};export const TAGS_FLAG={'name':a35_0x194e8b(0xc1),'type':a35_0x194e8b(0xb7),'description':a35_0x194e8b(0xb8)};export const STDIN_FLAG={'name':'stdin','type':'boolean','description':a35_0x194e8b(0xa9),'default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':a35_0x194e8b(0xb7),'description':a35_0x194e8b(0xa6)};export const REVEAL_FLAG={'name':a35_0x194e8b(0xc3),'type':'boolean','description':a35_0x194e8b(0xb6),'default':![]};export function readKeyArg(_0x420b92){const _0x41afb8=a35_0x194e8b,_0x5ae676=_0x420b92[_0x41afb8(0x9d)][0x0]?.[_0x41afb8(0xb0)]()??'';return validateKey(_0x5ae676),_0x5ae676;}export function readOptionalTags(_0x1d976e){const _0x4f0b9b=a35_0x194e8b,_0x2d50be=_0x1d976e[_0x4f0b9b(0xab)](_0x4f0b9b(0xc1))[_0x4f0b9b(0xb0)]();if(!_0x2d50be)return undefined;if(_0x2d50be[_0x4f0b9b(0x99)]>0x20)throw CliErrors[_0x4f0b9b(0xa8)](_0x4f0b9b(0x92));return _0x2d50be;}export function validateKey(_0x2833ea){const _0x48fe16=a35_0x194e8b;if(!_0x2833ea)throw CliErrors[_0x48fe16(0xa8)]('Missing\x20app-config\x20key.');if(_0x2833ea[_0x48fe16(0x99)]>0x100)throw CliErrors[_0x48fe16(0xa8)](_0x48fe16(0xb9));}export function projectAppConfig(_0xef0a24,_0xa26767){const _0x2d2845=a35_0x194e8b,_0x3899fd=_0xef0a24[_0x2d2845(0xba)]!==undefined&&_0xef0a24['value']!==null&&_0xef0a24['value']!=='',_0x22454c={'appCode':_0xef0a24[_0x2d2845(0xa1)],'key':_0xef0a24[_0x2d2845(0xa7)],'tags':_0xef0a24[_0x2d2845(0xc1)]??undefined,'hasValue':_0x3899fd,'valueRedacted':_0x3899fd&&!_0xa26767?.['reveal'],'gmtCreate':_0xef0a24[_0x2d2845(0xc0)],'gmtModified':_0xef0a24[_0x2d2845(0x9e)]};return _0xa26767?.[_0x2d2845(0xc3)]&&(_0x22454c[_0x2d2845(0xba)]=_0xef0a24[_0x2d2845(0xba)]??'',_0x22454c[_0x2d2845(0x90)]=![]),_0x22454c;}export function plannedAppConfig(_0x1abde4){const _0x2338c9=a35_0x194e8b,_0x4e3b50=_0x1abde4[_0x2338c9(0xbe)]??!![];return{'appCode':_0x1abde4[_0x2338c9(0xa1)],'key':_0x1abde4[_0x2338c9(0xa7)],'tags':_0x1abde4[_0x2338c9(0xc1)]??undefined,'hasValue':_0x4e3b50,'valueRedacted':_0x4e3b50};}function a35_0x157e(_0x1fa74e,_0x3ce81d){_0x1fa74e=_0x1fa74e-0x82;const _0x58dd64=a35_0x58dd();let _0x157eb4=_0x58dd64[_0x1fa74e];return _0x157eb4;}export function buildMutationData(_0x400ca2){const _0x4e5f47=a35_0x194e8b;return{'operation':_0x400ca2['operation'],'selector':{'appCode':_0x400ca2[_0x4e5f47(0xa1)],'key':_0x400ca2[_0x4e5f47(0xa7)]},'before':_0x400ca2[_0x4e5f47(0xc6)],'after':_0x400ca2[_0x4e5f47(0xb2)],'dryRun':_0x400ca2[_0x4e5f47(0x9b)],'warnings':_0x400ca2[_0x4e5f47(0xa2)]??[]};}export async function withAppConfigApiBoundary(_0x22e511,_0x3c163e,_0x4f39bd){const _0x20ef0c=a35_0x194e8b;try{return await _0x4f39bd();}catch{const _0x2632f2=[_0x20ef0c(0xae)+_0x3c163e[_0x20ef0c(0xa1)]];if(_0x3c163e[_0x20ef0c(0xa7)])_0x2632f2[_0x20ef0c(0x96)](_0x20ef0c(0x9c)+_0x3c163e['key']);_0x2632f2[_0x20ef0c(0x96)](_0x20ef0c(0x8f));throw CliErrors[_0x20ef0c(0x91)](_0x20ef0c(0x85)+_0x22e511+_0x20ef0c(0x88),_0x2632f2[_0x20ef0c(0xad)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x185572,_0x1ca533){const _0x27bb6d=a35_0x194e8b;return Object['defineProperties'](_0x185572,{'method':{'value':_0x1ca533[_0x27bb6d(0xaf)],'enumerable':![]},'url':{'value':_0x1ca533[_0x27bb6d(0x8c)],'enumerable':![]}});}export function assertSingleValueSource(_0x1d9740){const _0x33697f=a35_0x194e8b,_0x4b4982=[];_0x1d9740[_0x33697f(0x9d)]['length']>0x1&&_0x4b4982['push']({'kind':_0x33697f(0xa3),'value':_0x1d9740[_0x33697f(0x9d)]['slice'](0x1)['join']('\x20')});const _0x131d7c=_0x1d9740[_0x33697f(0x9f)](_0x33697f(0xba));_0x131d7c!==undefined&&_0x131d7c!==null&&_0x4b4982[_0x33697f(0x96)]({'kind':_0x33697f(0xa3),'value':String(_0x131d7c)});_0x1d9740[_0x33697f(0xb1)](_0x33697f(0x82))&&_0x4b4982[_0x33697f(0x96)]({'kind':_0x33697f(0x82)});const _0x203b1e=_0x1d9740[_0x33697f(0xab)]('from-env')[_0x33697f(0xb0)]();_0x203b1e&&_0x4b4982[_0x33697f(0x96)]({'kind':'env','name':_0x203b1e});const _0x153961=_0x1d9740[_0x33697f(0xab)](_0x33697f(0xc4))[_0x33697f(0xb0)]();_0x153961&&_0x4b4982['push']({'kind':'file','path':_0x153961});if(_0x4b4982[_0x33697f(0x99)]===0x0)throw CliErrors[_0x33697f(0xa8)](_0x33697f(0xa0),_0x33697f(0xac));if(_0x4b4982[_0x33697f(0x99)]>0x1)throw CliErrors['validation']('App\x20config\x20value\x20source\x20is\x20ambiguous.',_0x33697f(0xbc));return _0x4b4982[0x0];}function a35_0x58dd(){const _0x236ef3=['Read\x20config\x20value\x20from\x20stdin','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','str','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','join','appCode:\x20','method','trim','bool','after','Runtime\x20app-config\x20key','2097999hRviNT','kind','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','string','Config\x20tags\x20for\x20filtering/display\x20metadata','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','value','4176BLnxuX','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','error','hasValue','35646PXmuzg','gmtCreate','tags','113448HrUETo','reveal','file','3490fBgRTu','before','stdin','path','data','Failed\x20to\x20','17006DgwCsl','956795DJgVTU','\x20app\x20config.','end','Value\x20file\x20is\x20not\x20readable:\x20','77BsrVLO','url','setEncoding','Environment\x20variable\x20is\x20not\x20set:\x20','value\x20is\x20redacted','valueRedacted','apiError','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','6hiPlSh','498zyBXGR','utf8','push','env','once','length','251998BbnnRY','dryRun','key:\x20','args','gmtModified','flag','Missing\x20app-config\x20value\x20source.','appCode','warnings','argument','name','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','key','validation'];a35_0x58dd=function(){return _0x236ef3;};return a35_0x58dd();}export async function assertValueSourceReadable(_0x28cc8b){const _0x15d1b4=a35_0x194e8b;if(_0x28cc8b['kind']===_0x15d1b4(0x97)&&!(_0x28cc8b[_0x15d1b4(0xa4)]in process.env))throw CliErrors['validation'](_0x15d1b4(0x8e)+_0x28cc8b[_0x15d1b4(0xa4)]);if(_0x28cc8b[_0x15d1b4(0xb5)]===_0x15d1b4(0xc4))try{await access(_0x28cc8b[_0x15d1b4(0x83)]);}catch{throw CliErrors[_0x15d1b4(0xa8)](_0x15d1b4(0x8a)+_0x28cc8b[_0x15d1b4(0x83)]);}}export async function readAppConfigValue(_0x4a9d2d){const _0x202df4=a35_0x194e8b,_0x4b57c9=assertSingleValueSource(_0x4a9d2d),_0x5ded6d=[];if(_0x4b57c9[_0x202df4(0xb5)]===_0x202df4(0xa3))return _0x5ded6d[_0x202df4(0x96)](_0x202df4(0xa5)),{'value':_0x4b57c9[_0x202df4(0xba)]??'','source':_0x4b57c9[_0x202df4(0xb5)],'warnings':_0x5ded6d};if(_0x4b57c9[_0x202df4(0xb5)]===_0x202df4(0x82))return{'value':await readStdin(),'source':_0x4b57c9[_0x202df4(0xb5)],'warnings':_0x5ded6d};if(_0x4b57c9[_0x202df4(0xb5)]===_0x202df4(0x97)){if(!(_0x4b57c9[_0x202df4(0xa4)]in process.env))throw CliErrors['validation'](_0x202df4(0x8e)+_0x4b57c9[_0x202df4(0xa4)]);return{'value':process.env[_0x4b57c9.name]??'','source':_0x4b57c9['kind'],'warnings':_0x5ded6d};}return{'value':await readFile(_0x4b57c9[_0x202df4(0x83)],_0x202df4(0x95)),'source':_0x4b57c9['kind'],'warnings':_0x5ded6d};}function readStdin(){return new Promise((_0x19e134,_0x1ba4f1)=>{const _0x38594c=a35_0x157e;let _0x5e42c6='';process['stdin'][_0x38594c(0x8d)](_0x38594c(0x95)),process[_0x38594c(0x82)]['on'](_0x38594c(0x84),_0x2b9d04=>{_0x5e42c6+=_0x2b9d04;}),process['stdin'][_0x38594c(0x98)](_0x38594c(0x89),()=>_0x19e134(_0x5e42c6)),process['stdin'][_0x38594c(0x98)](_0x38594c(0xbd),_0x1ba4f1);});}
1
+ const a35_0x80c0bb=a35_0xa21c;(function(_0x3001ec,_0x50bf1d){const _0x4c3436=a35_0xa21c,_0x4bb3b7=_0x3001ec();while(!![]){try{const _0x1f1993=parseInt(_0x4c3436(0x101))/0x1+parseInt(_0x4c3436(0xf6))/0x2+parseInt(_0x4c3436(0xef))/0x3*(parseInt(_0x4c3436(0xd5))/0x4)+-parseInt(_0x4c3436(0xe6))/0x5+-parseInt(_0x4c3436(0xf2))/0x6+-parseInt(_0x4c3436(0xd0))/0x7*(-parseInt(_0x4c3436(0xfe))/0x8)+parseInt(_0x4c3436(0xca))/0x9*(-parseInt(_0x4c3436(0xd3))/0xa);if(_0x1f1993===_0x50bf1d)break;else _0x4bb3b7['push'](_0x4bb3b7['shift']());}catch(_0x11cb53){_0x4bb3b7['push'](_0x4bb3b7['shift']());}}}(a35_0x3abd,0x4f5d7));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x80c0bb(0xcf),'description':'Runtime\x20app-config\x20key','required':!![]};export const VALUE_ARG={'name':a35_0x80c0bb(0xea),'description':'Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','required':![]};export const TAGS_FLAG={'name':a35_0x80c0bb(0xfd),'type':a35_0x80c0bb(0xc8),'description':a35_0x80c0bb(0xf9)};export const STDIN_FLAG={'name':a35_0x80c0bb(0xf0),'type':a35_0x80c0bb(0xf3),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a35_0x80c0bb(0xde),'type':a35_0x80c0bb(0xc8),'description':a35_0x80c0bb(0xd9)};export const REVEAL_FLAG={'name':a35_0x80c0bb(0xe4),'type':'boolean','description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x1beea6){const _0xfc9dfa=a35_0x80c0bb,_0x4dc8fe=_0x1beea6['args'][0x0]?.[_0xfc9dfa(0xce)]()??'';return validateKey(_0x4dc8fe),_0x4dc8fe;}export function readOptionalTags(_0x189ad4){const _0x24df74=a35_0x80c0bb,_0x52a0c1=_0x189ad4[_0x24df74(0xe1)](_0x24df74(0xfd))['trim']();if(!_0x52a0c1)return undefined;if(_0x52a0c1[_0x24df74(0xe9)]>0x20)throw CliErrors[_0x24df74(0xf8)]('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x52a0c1;}export function validateKey(_0x1533c6){const _0x45ffb0=a35_0x80c0bb;if(!_0x1533c6)throw CliErrors['validation']('Missing\x20app-config\x20key.');if(_0x1533c6[_0x45ffb0(0xe9)]>0x100)throw CliErrors[_0x45ffb0(0xf8)](_0x45ffb0(0xe0));}export function projectAppConfig(_0xe929d0,_0x4616fd){const _0x3bd107=a35_0x80c0bb,_0x1c60c9=_0xe929d0[_0x3bd107(0xea)]!==undefined&&_0xe929d0[_0x3bd107(0xea)]!==null&&_0xe929d0[_0x3bd107(0xea)]!=='',_0x4f0fd1={'appCode':_0xe929d0[_0x3bd107(0xd2)],'key':_0xe929d0[_0x3bd107(0xcf)],'tags':_0xe929d0[_0x3bd107(0xfd)]??undefined,'hasValue':_0x1c60c9,'valueRedacted':_0x1c60c9&&!_0x4616fd?.['reveal'],'gmtCreate':_0xe929d0[_0x3bd107(0xfa)],'gmtModified':_0xe929d0[_0x3bd107(0xdd)]};return _0x4616fd?.['reveal']&&(_0x4f0fd1[_0x3bd107(0xea)]=_0xe929d0[_0x3bd107(0xea)]??'',_0x4f0fd1[_0x3bd107(0xec)]=![]),_0x4f0fd1;}function a35_0x3abd(){const _0x5c2c2d=['1201606znRPGT','args','validation','Config\x20tags\x20for\x20filtering/display\x20metadata','gmtCreate','push','appCode:\x20','tags','568440bCMABp','slice','end','528176DFTFTh','value\x20is\x20redacted','url','string','after','335754CRSzrl','file','argument','method','trim','key','21UVkger','setEncoding','appCode','150binPSg','data','44pgNSRR','join','error','Environment\x20variable\x20is\x20not\x20set:\x20','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','operation','kind','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','gmtModified','from-env','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','str','\x20app\x20config.','once','reveal','utf8','1054560ESogVD','key:\x20','env','length','value','dryRun','valueRedacted','name','hasValue','9732ENVfPI','stdin','path','1693482MmvDOK','boolean','App\x20config\x20value\x20source\x20is\x20ambiguous.','Failed\x20to\x20'];a35_0x3abd=function(){return _0x5c2c2d;};return a35_0x3abd();}export function plannedAppConfig(_0x6eb5fe){const _0xc26d9c=a35_0x80c0bb,_0x337c9c=_0x6eb5fe[_0xc26d9c(0xee)]??!![];return{'appCode':_0x6eb5fe[_0xc26d9c(0xd2)],'key':_0x6eb5fe[_0xc26d9c(0xcf)],'tags':_0x6eb5fe['tags']??undefined,'hasValue':_0x337c9c,'valueRedacted':_0x337c9c};}function a35_0xa21c(_0x463851,_0x13f77d){_0x463851=_0x463851-0xc7;const _0x3abd18=a35_0x3abd();let _0xa21cb4=_0x3abd18[_0x463851];return _0xa21cb4;}export function buildMutationData(_0x33db1a){const _0x2a67c4=a35_0x80c0bb;return{'operation':_0x33db1a[_0x2a67c4(0xda)],'selector':{'appCode':_0x33db1a[_0x2a67c4(0xd2)],'key':_0x33db1a['key']},'before':_0x33db1a['before'],'after':_0x33db1a[_0x2a67c4(0xc9)],'dryRun':_0x33db1a[_0x2a67c4(0xeb)],'warnings':_0x33db1a['warnings']??[]};}export async function withAppConfigApiBoundary(_0x5a5845,_0x32b826,_0x5e9d56){const _0x20c5ef=a35_0x80c0bb;try{return await _0x5e9d56();}catch{const _0x2d5c89=[_0x20c5ef(0xfc)+_0x32b826['appCode']];if(_0x32b826[_0x20c5ef(0xcf)])_0x2d5c89[_0x20c5ef(0xfb)](_0x20c5ef(0xe7)+_0x32b826[_0x20c5ef(0xcf)]);_0x2d5c89[_0x20c5ef(0xfb)](_0x20c5ef(0x102));throw CliErrors['apiError'](_0x20c5ef(0xf5)+_0x5a5845+_0x20c5ef(0xe2),_0x2d5c89[_0x20c5ef(0xd6)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0xf31e25,_0x21f907){const _0x3d715c=a35_0x80c0bb;return Object['defineProperties'](_0xf31e25,{'method':{'value':_0x21f907[_0x3d715c(0xcd)],'enumerable':![]},'url':{'value':_0x21f907[_0x3d715c(0xc7)],'enumerable':![]}});}export function assertSingleValueSource(_0x54929f){const _0x3f2f12=a35_0x80c0bb,_0x8ffaa5=[];_0x54929f[_0x3f2f12(0xf7)][_0x3f2f12(0xe9)]>0x1&&_0x8ffaa5['push']({'kind':_0x3f2f12(0xcc),'value':_0x54929f[_0x3f2f12(0xf7)][_0x3f2f12(0xff)](0x1)[_0x3f2f12(0xd6)]('\x20')});const _0x16ce29=_0x54929f['flag'](_0x3f2f12(0xea));_0x16ce29!==undefined&&_0x16ce29!==null&&_0x8ffaa5[_0x3f2f12(0xfb)]({'kind':'argument','value':String(_0x16ce29)});_0x54929f['bool']('stdin')&&_0x8ffaa5['push']({'kind':_0x3f2f12(0xf0)});const _0x5a7e6f=_0x54929f['str'](_0x3f2f12(0xde))[_0x3f2f12(0xce)]();_0x5a7e6f&&_0x8ffaa5[_0x3f2f12(0xfb)]({'kind':_0x3f2f12(0xe8),'name':_0x5a7e6f});const _0x231165=_0x54929f[_0x3f2f12(0xe1)](_0x3f2f12(0xcb))[_0x3f2f12(0xce)]();_0x231165&&_0x8ffaa5[_0x3f2f12(0xfb)]({'kind':_0x3f2f12(0xcb),'path':_0x231165});if(_0x8ffaa5[_0x3f2f12(0xe9)]===0x0)throw CliErrors[_0x3f2f12(0xf8)]('Missing\x20app-config\x20value\x20source.',_0x3f2f12(0xdf));if(_0x8ffaa5[_0x3f2f12(0xe9)]>0x1)throw CliErrors[_0x3f2f12(0xf8)](_0x3f2f12(0xf4),_0x3f2f12(0xdc));return _0x8ffaa5[0x0];}export async function assertValueSourceReadable(_0x357288){const _0x2b11a4=a35_0x80c0bb;if(_0x357288[_0x2b11a4(0xdb)]===_0x2b11a4(0xe8)&&!(_0x357288[_0x2b11a4(0xed)]in process.env))throw CliErrors[_0x2b11a4(0xf8)](_0x2b11a4(0xd8)+_0x357288[_0x2b11a4(0xed)]);if(_0x357288[_0x2b11a4(0xdb)]===_0x2b11a4(0xcb))try{await access(_0x357288[_0x2b11a4(0xf1)]);}catch{throw CliErrors[_0x2b11a4(0xf8)]('Value\x20file\x20is\x20not\x20readable:\x20'+_0x357288[_0x2b11a4(0xf1)]);}}export async function readAppConfigValue(_0x4d187f){const _0x293483=a35_0x80c0bb,_0x22cb80=assertSingleValueSource(_0x4d187f),_0x12a411=[];if(_0x22cb80[_0x293483(0xdb)]===_0x293483(0xcc))return _0x12a411['push']('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x22cb80[_0x293483(0xea)]??'','source':_0x22cb80[_0x293483(0xdb)],'warnings':_0x12a411};if(_0x22cb80[_0x293483(0xdb)]===_0x293483(0xf0))return{'value':await readStdin(),'source':_0x22cb80[_0x293483(0xdb)],'warnings':_0x12a411};if(_0x22cb80['kind']===_0x293483(0xe8)){if(!(_0x22cb80[_0x293483(0xed)]in process.env))throw CliErrors[_0x293483(0xf8)](_0x293483(0xd8)+_0x22cb80[_0x293483(0xed)]);return{'value':process.env[_0x22cb80.name]??'','source':_0x22cb80[_0x293483(0xdb)],'warnings':_0x12a411};}return{'value':await readFile(_0x22cb80[_0x293483(0xf1)],_0x293483(0xe5)),'source':_0x22cb80[_0x293483(0xdb)],'warnings':_0x12a411};}function readStdin(){return new Promise((_0x382eab,_0x42c42a)=>{const _0x10e272=a35_0xa21c;let _0x214083='';process['stdin'][_0x10e272(0xd1)](_0x10e272(0xe5)),process['stdin']['on'](_0x10e272(0xd4),_0x58367e=>{_0x214083+=_0x58367e;}),process[_0x10e272(0xf0)][_0x10e272(0xe3)](_0x10e272(0x100),()=>_0x382eab(_0x214083)),process[_0x10e272(0xf0)]['once'](_0x10e272(0xd7),_0x42c42a);});}
@@ -1 +1 @@
1
- const a36_0x55c6e9=a36_0xa775;function a36_0xa775(_0x15455e,_0xa044d){_0x15455e=_0x15455e-0x74;const _0x4641a0=a36_0x4641();let _0xa77503=_0x4641a0[_0x15455e];return _0xa77503;}function a36_0x4641(){const _0x47e44c=['!\x20Not\x20logged\x20in','login','logout','177mrnrst','274671lHxBMX','bool','565TlpWXk','714zTjUOp','yes','1964760RFtmGb','auth','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','820064kGKDri','Clear\x20login\x20session','boolean','../../auth/auth-server-ui.js','log','✓\x20Logged\x20out','5744veEilK','175443mxCKtt','1680903KaFSYd'];a36_0x4641=function(){return _0x47e44c;};return a36_0x4641();}(function(_0x2814fd,_0x36a34e){const _0x5927f6=a36_0xa775,_0x317eaf=_0x2814fd();while(!![]){try{const _0x200ca4=parseInt(_0x5927f6(0x7d))/0x1+parseInt(_0x5927f6(0x76))/0x2+parseInt(_0x5927f6(0x82))/0x3*(parseInt(_0x5927f6(0x7c))/0x4)+parseInt(_0x5927f6(0x85))/0x5*(parseInt(_0x5927f6(0x86))/0x6)+-parseInt(_0x5927f6(0x7e))/0x7+-parseInt(_0x5927f6(0x88))/0x8+parseInt(_0x5927f6(0x83))/0x9;if(_0x200ca4===_0x36a34e)break;else _0x317eaf['push'](_0x317eaf['shift']());}catch(_0x4dd510){_0x317eaf['push'](_0x317eaf['shift']());}}}(a36_0x4641,0x37c59));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':a36_0x55c6e9(0x80),'description':'Login\x20via\x20browser','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x55c6e9(0x87),'type':a36_0x55c6e9(0x78),'description':a36_0x55c6e9(0x75),'default':![]}],async 'execute'(_0x3556f3){const _0x197bf7=a36_0x55c6e9,{runAuthServer:_0x480f16}=await import(_0x197bf7(0x79));return await _0x480f16({'autoYes':_0x3556f3[_0x197bf7(0x84)](_0x197bf7(0x87)),'nonInteractive':_0x3556f3['nonInteractive']}),{'ok':!![]};}},{'service':a36_0x55c6e9(0x74),'command':a36_0x55c6e9(0x81),'description':a36_0x55c6e9(0x77),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4ad22d){const _0x37ad3b=a36_0x55c6e9;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x37ad3b(0x7a)](_0x37ad3b(0x7b))):console[_0x37ad3b(0x7a)](_0x37ad3b(0x7f)),{'ok':!![]};}}];
1
+ const a36_0x1d6bf7=a36_0x4bbe;function a36_0x4bbe(_0x300072,_0x12f6c1){_0x300072=_0x300072-0x1ed;const _0x2ef286=a36_0x2ef2();let _0x4bbe10=_0x2ef286[_0x300072];return _0x4bbe10;}(function(_0x5e81a5,_0x35ec96){const _0x2a80e5=a36_0x4bbe,_0x22a476=_0x5e81a5();while(!![]){try{const _0x573d5b=-parseInt(_0x2a80e5(0x1ff))/0x1*(-parseInt(_0x2a80e5(0x1fd))/0x2)+-parseInt(_0x2a80e5(0x1fb))/0x3+parseInt(_0x2a80e5(0x1fe))/0x4+parseInt(_0x2a80e5(0x1f2))/0x5*(parseInt(_0x2a80e5(0x1f1))/0x6)+parseInt(_0x2a80e5(0x1ee))/0x7*(parseInt(_0x2a80e5(0x1f5))/0x8)+parseInt(_0x2a80e5(0x1f4))/0x9*(parseInt(_0x2a80e5(0x1f7))/0xa)+-parseInt(_0x2a80e5(0x1f8))/0xb*(parseInt(_0x2a80e5(0x201))/0xc);if(_0x573d5b===_0x35ec96)break;else _0x22a476['push'](_0x22a476['shift']());}catch(_0x166dd8){_0x22a476['push'](_0x22a476['shift']());}}}(a36_0x2ef2,0x3d7b2));import{unlinkSync,existsSync}from'node:fs';function a36_0x2ef2(){const _0x8c9654=['auth','nonInteractive','151739uTyqxT','write','✓\x20Logged\x20out','654HkPLdt','14785WoNjpM','boolean','27xwGSpU','104xNKuZf','../../auth/auth-server-ui.js','1525870WYCoWK','415316ODtejn','login','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','1265997JgpvkV','yes','5462rSRaqn','188260dRpEnt','131OhdjrY','bool','252GVZXjx','Login\x20via\x20browser','logout'];a36_0x2ef2=function(){return _0x8c9654;};return a36_0x2ef2();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a36_0x1d6bf7(0x204),'command':a36_0x1d6bf7(0x1f9),'description':a36_0x1d6bf7(0x202),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x1d6bf7(0x1fc),'type':a36_0x1d6bf7(0x1f3),'description':a36_0x1d6bf7(0x1fa),'default':![]}],async 'execute'(_0x11aa38){const _0x4b07a4=a36_0x1d6bf7,{runAuthServer:_0xe7cc0d}=await import(_0x4b07a4(0x1f6));return await _0xe7cc0d({'autoYes':_0x11aa38[_0x4b07a4(0x200)](_0x4b07a4(0x1fc)),'nonInteractive':_0x11aa38[_0x4b07a4(0x1ed)]}),{'ok':!![]};}},{'service':'auth','command':a36_0x1d6bf7(0x203),'description':'Clear\x20login\x20session','risk':a36_0x1d6bf7(0x1ef),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x198642){const _0x1966cb=a36_0x1d6bf7;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x1966cb(0x1f0))):console['log']('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
@@ -1 +1 @@
1
- function a37_0xe783(){const _0x23ef07=['No\x20operation\x20types\x20found\x20for\x20dataset\x20','datasetcode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','\x22.\x20','profileName','operationType','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','question','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Invalid\x20dataset\x20selection.','currentApp','function-node','filePath','4wIlyzI','Available:\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','includes','1146pxiocV','before','mergedCli','Operation\x20type\x20(HOOK\x20only)','Invalid\x20function\x20name\x20\x22','selectedAppName','str','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','description','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','parseInt','HOOK\x20requires\x20alias/operation/node\x20options.','alias','nonInteractive','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','/ENDPOINT/','utf8','No\x20datasets\x20found\x20for\x20this\x20app.','39659rkaimC','name','\x0a\x20*\x20[平台配置]\x20','2465UkpkAc','/HOOK/','Operation\x20type\x20\x22','修改后的响应结果','\x22\x20not\x20found.\x20','Script\x20type','File\x20already\x20exists:\x20','10lQorvP','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','find','627603bfVeQB','type','1887743QhblbB','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','datasetCode','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','defaultApp','220806nofsVx','Select\x20operation\x20type:','bff','stderr','trim','8BzaQdD',']\x20(','functionNode','Alias\x20\x22','source','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','string','\x22,\x20params\x20})\x0a','UNKNOWN','apiDir','Select\x20dataset:','No\x20model\x20aliases\x20found.\x20Run\x20`','ENDPOINT','Select\x20trigger\x20node:','length','\x20api\x20pull`\x20to\x20refresh.','COMMON','.js\x0a','write','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','.js\x0a\x20*\x20[触发节点]\x20','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','after','HOOK','/**\x0a\x20*\x20','operation-type','stdin','isInteger','1700930aOCSKI','Trigger\x20node\x20(HOOK\x20only)','join','code','scriptsRootDir','当前请求参数','validation','datasetId','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','/data/dataset/','appCode','map','418800DsnYJg','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a'];a37_0xe783=function(){return _0x23ef07;};return a37_0xe783();}const a37_0x5761c5=a37_0x57a4;(function(_0x558a0e,_0x515c60){const _0x2a7d71=a37_0x57a4,_0x47aade=_0x558a0e();while(!![]){try{const _0x14be57=-parseInt(_0x2a7d71(0x174))/0x1*(parseInt(_0x2a7d71(0x18f))/0x2)+parseInt(_0x2a7d71(0x181))/0x3*(-parseInt(_0x2a7d71(0x15e))/0x4)+parseInt(_0x2a7d71(0x177))/0x5*(parseInt(_0x2a7d71(0x162))/0x6)+parseInt(_0x2a7d71(0x142))/0x7+parseInt(_0x2a7d71(0x14f))/0x8+-parseInt(_0x2a7d71(0x18a))/0x9+-parseInt(_0x2a7d71(0x17e))/0xa*(-parseInt(_0x2a7d71(0x183))/0xb);if(_0x14be57===_0x515c60)break;else _0x47aade['push'](_0x47aade['shift']());}catch(_0x238516){_0x47aade['push'](_0x47aade['shift']());}}}(a37_0xe783,0x29329));function a37_0x57a4(_0x5e805d,_0x3a946a){_0x5e805d=_0x5e805d-0x138;const _0xe7831a=a37_0xe783();let _0x57a43d=_0xe7831a[_0x5e805d];return _0x57a43d;}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x5761c5(0x18c),'command':'create','description':a37_0x5761c5(0x14b),'risk':'read','flags':[{'name':'type','type':a37_0x5761c5(0x195),'required':!![],'enum':[a37_0x5761c5(0x19f),a37_0x5761c5(0x19b),a37_0x5761c5(0x13d)],'description':a37_0x5761c5(0x17c)},{'name':a37_0x5761c5(0x175),'type':a37_0x5761c5(0x195),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a37_0x5761c5(0x16a),'type':a37_0x5761c5(0x195),'description':'Script\x20description'},{'name':a37_0x5761c5(0x16e),'type':a37_0x5761c5(0x195),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a37_0x5761c5(0x195),'description':a37_0x5761c5(0x16b)},{'name':a37_0x5761c5(0x13f),'type':a37_0x5761c5(0x195),'description':a37_0x5761c5(0x165)},{'name':'function-node','type':a37_0x5761c5(0x195),'description':a37_0x5761c5(0x143),'enum':[a37_0x5761c5(0x163),a37_0x5761c5(0x13c)]}],async 'validate'(_0x425807){const _0x31b17a=a37_0x5761c5,_0x1a070f=_0x425807[_0x31b17a(0x168)](_0x31b17a(0x175));if(!isValidBffFunctionName(_0x1a070f))throw CliErrors['validation'](_0x31b17a(0x166)+_0x1a070f+_0x31b17a(0x160));},async 'execute'(_0x48d37a){const _0x38386e=a37_0x5761c5,_0x251312=loadBffProjectConfig(_0x48d37a[_0x38386e(0x14d)]),_0x306a3e=_0x48d37a[_0x38386e(0x168)](_0x38386e(0x182)),_0x379d63=_0x48d37a[_0x38386e(0x168)]('name'),_0x2832b3=_0x48d37a[_0x38386e(0x168)](_0x38386e(0x16a))||undefined,_0x3686cd=_0x306a3e==='HOOK'?await resolveHookOptions(_0x251312,_0x48d37a):undefined,_0x168870=buildFilePath(_0x251312,_0x306a3e,_0x379d63,_0x3686cd);if(await fileExists(_0x168870))throw CliErrors[_0x38386e(0x148)](_0x38386e(0x17d)+_0x168870);await mkdir(dirname(_0x168870),{'recursive':!![]});const _0x40844b=generateTemplate(_0x306a3e,_0x379d63,_0x48d37a[_0x38386e(0x14d)],_0x2832b3,_0x3686cd);await writeFile(_0x168870,_0x40844b,_0x38386e(0x172));const _0x367fdd={'type':_0x306a3e,'name':_0x379d63,'path':_0x168870};if(_0x2832b3)_0x367fdd[_0x38386e(0x16a)]=_0x2832b3;if(_0x3686cd){if(_0x3686cd[_0x38386e(0x16e)])_0x367fdd[_0x38386e(0x16e)]=_0x3686cd[_0x38386e(0x16e)];_0x367fdd[_0x38386e(0x186)]=_0x3686cd[_0x38386e(0x186)],_0x367fdd['operationType']=_0x3686cd['operationType'],_0x367fdd[_0x38386e(0x191)]=_0x3686cd[_0x38386e(0x191)];}return{'ok':!![],'data':_0x367fdd,'message':'Created\x20'+_0x306a3e+'\x20function:\x20'+_0x379d63};}};async function resolveHookOptions(_0xcbe232,_0x24538b){const _0xd4bbcc=a37_0x5761c5,_0x59b50f=resolveApiModelSource(_0x24538b[_0xd4bbcc(0x198)],_0x24538b['appCode'],_0x24538b[_0xd4bbcc(0x167)]||_0x24538b[_0xd4bbcc(0x164)]?.[_0xd4bbcc(0x15b)]||_0x24538b[_0xd4bbcc(0x164)]?.[_0xd4bbcc(0x189)]),_0x17da86=loadAliasMap(_0x24538b[_0xd4bbcc(0x198)],undefined,_0x59b50f[_0xd4bbcc(0x15d)],_0x59b50f[_0xd4bbcc(0x155)]),_0x30e3c9=_0x17da86[_0xd4bbcc(0x19d)]>0x0;let _0x475e6f,_0x1616bd,_0x56510e;const _0x1c2f6b=_0x24538b[_0xd4bbcc(0x168)](_0xd4bbcc(0x16e)),_0x52f049=_0x24538b['str'](_0xd4bbcc(0x152));if(_0x1c2f6b){const _0x59d9d4=resolveAlias(_0x24538b['apiDir'],_0x1c2f6b,undefined,_0x59b50f[_0xd4bbcc(0x15d)],_0x59b50f['profileName']);if(!_0x59d9d4){const _0x496b06=_0x30e3c9?'Available\x20aliases:\x20'+_0x17da86[_0xd4bbcc(0x14e)](_0x8b0558=>_0x8b0558['alias'])[_0xd4bbcc(0x144)](',\x20'):_0xd4bbcc(0x19a)+CLI_BIN_NAME+_0xd4bbcc(0x138);throw CliErrors['validation'](_0xd4bbcc(0x192)+_0x1c2f6b+_0xd4bbcc(0x17b)+_0x496b06);}_0x475e6f=_0x1c2f6b,_0x1616bd=_0x59d9d4;}else{if(_0x52f049){_0x1616bd=_0x52f049;const _0x43551b=_0x17da86[_0xd4bbcc(0x180)](_0x25ef1b=>_0x25ef1b['datasetCode']===_0x52f049);_0x475e6f=_0x43551b?.['alias'];}else{if(_0x24538b['nonInteractive'])throw CliErrors[_0xd4bbcc(0x148)](_0xd4bbcc(0x194));else{if(_0x30e3c9){const _0x4fae2a=_0x17da86['map'](_0x453429=>_0x453429[_0xd4bbcc(0x16e)]+'\x20('+_0x453429['tableName']+')'),_0x113064=await promptSelect(_0xd4bbcc(0x199),_0x4fae2a),_0x1bf2ab=_0x17da86[_0x113064];if(!_0x1bf2ab)throw CliErrors[_0xd4bbcc(0x148)](_0xd4bbcc(0x15a));_0x475e6f=_0x1bf2ab['alias'],_0x1616bd=_0x1bf2ab[_0xd4bbcc(0x186)];}else{const _0x3e4ed3=await listDatasets(_0x24538b[_0xd4bbcc(0x14d)]);if(_0x3e4ed3[_0xd4bbcc(0x19d)]===0x0)throw CliErrors[_0xd4bbcc(0x148)](_0xd4bbcc(0x173));const _0x4a90e6=_0x3e4ed3[_0xd4bbcc(0x14e)](_0x38b43e=>_0x38b43e[_0xd4bbcc(0x175)]+'\x20['+(_0x38b43e[_0xd4bbcc(0x193)]??_0xd4bbcc(0x197))+_0xd4bbcc(0x190)+_0x38b43e['code']+')'),_0x25cc83=await promptSelect(_0xd4bbcc(0x199),_0x4a90e6),_0x59b202=_0x3e4ed3[_0x25cc83];if(!_0x59b202)throw CliErrors[_0xd4bbcc(0x148)](_0xd4bbcc(0x15a));_0x1616bd=_0x59b202[_0xd4bbcc(0x145)],_0x475e6f=undefined;}}}}const _0x28b735=await listDatasets(_0x24538b[_0xd4bbcc(0x14d)]),_0x3d315f=_0x28b735['find'](_0x22b01c=>_0x22b01c[_0xd4bbcc(0x145)]===_0x1616bd);if(!_0x3d315f)throw CliErrors[_0xd4bbcc(0x148)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x1616bd+_0xd4bbcc(0x154)+(_0x475e6f?_0xd4bbcc(0x188)+CLI_BIN_NAME+_0xd4bbcc(0x19e):''));_0x56510e=_0x3d315f['id'];const _0xb1755=_0x475e6f??_0x1616bd,_0x59dc90=await listBffDatasetOperations(_0x24538b[_0xd4bbcc(0x14d)],_0x56510e),_0x1adeec=_0x59dc90?Object['keys'](_0x59dc90):[];if(_0x1adeec['length']===0x0)throw CliErrors[_0xd4bbcc(0x148)](_0xd4bbcc(0x151)+_0xb1755+'.');let _0xd4da77;const _0x34eefc=_0x24538b[_0xd4bbcc(0x168)](_0xd4bbcc(0x13f));if(_0x34eefc){if(!_0x1adeec[_0xd4bbcc(0x161)](_0x34eefc))throw CliErrors['validation'](_0xd4bbcc(0x179)+_0x34eefc+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0xb1755+'.\x20'+(_0xd4bbcc(0x15f)+_0x1adeec['join'](',\x20')));_0xd4da77=_0x34eefc;}else{if(_0x24538b[_0xd4bbcc(0x16f)])throw CliErrors[_0xd4bbcc(0x148)]('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x441082=await promptSelect(_0xd4bbcc(0x18b),_0x1adeec);_0xd4da77=_0x1adeec[_0x441082]??_0x1adeec[0x0];}let _0x21f08d=normalizeHookFunctionNode(_0x24538b[_0xd4bbcc(0x168)]('function-node'));if(!_0x21f08d){if(_0x24538b[_0xd4bbcc(0x168)](_0xd4bbcc(0x15c)))throw CliErrors['validation']('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x24538b['nonInteractive'])throw CliErrors[_0xd4bbcc(0x148)](_0xd4bbcc(0x184));const _0xb723e8=await promptSelect(_0xd4bbcc(0x19c),[_0xd4bbcc(0x163),_0xd4bbcc(0x13c)]);_0x21f08d=[_0xd4bbcc(0x163),_0xd4bbcc(0x13c)][_0xb723e8]??_0xd4bbcc(0x163);}return{'alias':_0x475e6f,'datasetCode':_0x1616bd,'datasetId':_0x56510e,'operationType':_0xd4da77,'functionNode':_0x21f08d};}async function promptSelect(_0xb3a7ae,_0x1af447){const _0x220ae9=a37_0x5761c5;if(_0x1af447[_0x220ae9(0x19d)]===0x1)return 0x0;for(const [_0x3a2db3,_0x28838a]of _0x1af447['entries']()){process[_0x220ae9(0x18d)][_0x220ae9(0x1a1)]('\x20\x20'+(_0x3a2db3+0x1)+'.\x20'+_0x28838a+'\x0a');}const _0x3ae477=createInterface({'input':process[_0x220ae9(0x140)],'output':process[_0x220ae9(0x18d)]});while(!![]){const _0x37b8ee=await new Promise(_0x26a2a6=>{const _0x5eea6a=_0x220ae9;_0x3ae477[_0x5eea6a(0x158)](_0xb3a7ae+'\x20',_0x26a2a6);}),_0x238136=Number[_0x220ae9(0x16c)](_0x37b8ee['trim'](),0xa);if(Number[_0x220ae9(0x141)](_0x238136)&&_0x238136>=0x1&&_0x238136<=_0x1af447[_0x220ae9(0x19d)])return _0x3ae477['close'](),_0x238136-0x1;process[_0x220ae9(0x18d)][_0x220ae9(0x1a1)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x1af447[_0x220ae9(0x19d)]+'.\x0a');}}function buildFilePath(_0xd7824e,_0xd36f64,_0x39ec36,_0x413527){const _0x11594a=a37_0x5761c5;if(_0xd36f64===_0x11594a(0x13d)){if(!_0x413527)throw CliErrors[_0x11594a(0x148)](_0x11594a(0x16d));const _0x430672=_0x413527[_0x11594a(0x16e)]??_0x413527[_0x11594a(0x186)];return join(_0xd7824e['scriptsRootDir'],_0x11594a(0x13d),_0x430672,_0x413527['operationType'],_0x413527[_0x11594a(0x191)],_0x39ec36+'.js');}return join(_0xd7824e[_0x11594a(0x146)],_0xd36f64,_0x39ec36+'.js');}export function generateTemplate(_0xd09403,_0x4a6c12,_0x1ad523,_0x428bba,_0x138290){const _0x514767=a37_0x5761c5,_0x54e04d=_0x428bba?.[_0x514767(0x18e)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x3260c2=getAppBaseUrl(_0x1ad523),_0x5bf9dc=_0x514767(0x170);if(_0xd09403===_0x514767(0x19f))return'/**\x0a\x20*\x20'+_0x54e04d+_0x514767(0x17f)+_0x4a6c12+_0x514767(0x176)+_0x3260c2+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x1ad523+'/COMMON/'+_0x4a6c12+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x4a6c12+_0x514767(0x196)+_0x5bf9dc+_0x514767(0x157)+_0x4a6c12+_0x514767(0x150);if(_0xd09403==='ENDPOINT')return _0x514767(0x13e)+_0x54e04d+_0x514767(0x13b)+_0x4a6c12+_0x514767(0x14a)+_0x1ad523+'/'+_0x4a6c12+_0x514767(0x176)+_0x3260c2+_0x514767(0x169)+_0x1ad523+_0x514767(0x171)+_0x4a6c12+_0x514767(0x1a0)+_0x5bf9dc+_0x514767(0x159)+_0x4a6c12+_0x514767(0x150);if(!_0x138290)throw CliErrors[_0x514767(0x148)](_0x514767(0x185));const _0x350b6b=_0x138290[_0x514767(0x16e)]??_0x138290[_0x514767(0x186)],_0x514742=_0x138290[_0x514767(0x191)]===_0x514767(0x163)?_0x514767(0x147):'当前响应结果',_0x2f5f0e=_0x138290[_0x514767(0x191)]==='before'?'修改后的请求参数':_0x514767(0x17a);return _0x514767(0x13e)+_0x54e04d+_0x514767(0x153)+_0x4a6c12+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x1ad523+'/'+_0x138290[_0x514767(0x186)]+'/'+_0x138290['operationType']+_0x514767(0x176)+_0x3260c2+_0x514767(0x14c)+_0x138290[_0x514767(0x149)]+_0x514767(0x139)+_0x1ad523+_0x514767(0x178)+_0x350b6b+'/'+_0x138290[_0x514767(0x156)]+'/'+_0x138290['functionNode']+'/'+_0x4a6c12+_0x514767(0x13a)+_0x138290['functionNode']+'\x0a'+_0x5bf9dc+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x514742+_0x514767(0x187)+_0x2f5f0e+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x4a6c12+_0x514767(0x150);}
1
+ const a37_0x502755=a37_0x562d;(function(_0x5148a0,_0x299638){const _0x5e6378=a37_0x562d,_0x1a5b64=_0x5148a0();while(!![]){try{const _0x45c2c7=parseInt(_0x5e6378(0x188))/0x1*(-parseInt(_0x5e6378(0x181))/0x2)+-parseInt(_0x5e6378(0x1d3))/0x3*(parseInt(_0x5e6378(0x182))/0x4)+-parseInt(_0x5e6378(0x1e9))/0x5+-parseInt(_0x5e6378(0x1c2))/0x6*(-parseInt(_0x5e6378(0x1ba))/0x7)+parseInt(_0x5e6378(0x186))/0x8+parseInt(_0x5e6378(0x1e0))/0x9+parseInt(_0x5e6378(0x1df))/0xa;if(_0x45c2c7===_0x299638)break;else _0x1a5b64['push'](_0x1a5b64['shift']());}catch(_0x25c54){_0x1a5b64['push'](_0x1a5b64['shift']());}}}(a37_0x28ac,0x543e6));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a37_0x28ac(){const _0x42ba92=['Invalid\x20function\x20name\x20\x22','当前请求参数','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','4309470Xulqba','5427099inObNj','HOOK\x20requires\x20alias/operation/node\x20options.','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','datasetcode','filePath','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','UNKNOWN','2093535nnctrd','join','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','/COMMON/','修改后的响应结果','\x22\x20not\x20found.\x20','18CEzlTt','29408ZhBqvC','当前响应结果','write','selectedAppName','3311656RbNmCs','\x22\x20not\x20found\x20for\x20dataset\x20','59498fidQbo','code','stdin','source','appCode','tableName','\x0a\x20*\x20[平台配置]\x20','before','map','No\x20operation\x20types\x20found\x20for\x20dataset\x20','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','Script\x20description','defaultApp','Available:\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','No\x20model\x20aliases\x20found.\x20Run\x20`','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','/ENDPOINT/','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','length','utf8','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','currentApp','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','keys','mergedCli','find','nonInteractive','alias','stderr','Operation\x20type\x20\x22','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','description','validation','File\x20already\x20exists:\x20','operation-type','Select\x20operation\x20type:','Script\x20type','\x0a\x20*\x20[参数字段]\x20按实际请求体为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20HTTP\x20请求体参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充业务返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','includes','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','create','HOOK','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x20api\x20pull`\x20to\x20refresh.','entries','.js','112fhxVGH','scriptsRootDir','function-node','/data/dataset/','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','str','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','/**\x0a\x20*\x20','18690HHXHDK','string','read','parseInt','datasetId','修改后的请求参数','functionNode','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Created\x20','apiDir','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','.js\x0a','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','name','Select\x20dataset:','Select\x20trigger\x20node:','Operation\x20type\x20(HOOK\x20only)','81UrOhUe','profileName','/HOOK/','COMMON','close','datasetCode','trim','operationType','after'];a37_0x28ac=function(){return _0x42ba92;};return a37_0x28ac();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a37_0x562d(_0x5c35c7,_0x4169fe){_0x5c35c7=_0x5c35c7-0x17d;const _0x28ac3d=a37_0x28ac();let _0x562d73=_0x28ac3d[_0x5c35c7];return _0x562d73;}import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':'bff','command':a37_0x502755(0x1b3),'description':a37_0x502755(0x1e7),'risk':a37_0x502755(0x1c4),'flags':[{'name':'type','type':a37_0x502755(0x1c3),'required':!![],'enum':[a37_0x502755(0x1d6),'ENDPOINT',a37_0x502755(0x1b4)],'description':a37_0x502755(0x1af)},{'name':a37_0x502755(0x1cf),'type':a37_0x502755(0x1c3),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a37_0x502755(0x1aa),'type':a37_0x502755(0x1c3),'description':a37_0x502755(0x194)},{'name':a37_0x502755(0x1a6),'type':'string','description':a37_0x502755(0x1ce)},{'name':a37_0x502755(0x1e5),'type':a37_0x502755(0x1c3),'description':a37_0x502755(0x1b5)},{'name':a37_0x502755(0x1ad),'type':a37_0x502755(0x1c3),'description':a37_0x502755(0x1d2)},{'name':a37_0x502755(0x1bc),'type':a37_0x502755(0x1c3),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a37_0x502755(0x18f),a37_0x502755(0x1db)]}],async 'validate'(_0x4331be){const _0x5728b3=a37_0x502755,_0x1b5f9e=_0x4331be[_0x5728b3(0x1bf)](_0x5728b3(0x1cf));if(!isValidBffFunctionName(_0x1b5f9e))throw CliErrors[_0x5728b3(0x1ab)](_0x5728b3(0x1dc)+_0x1b5f9e+_0x5728b3(0x1b6));},async 'execute'(_0x2bda03){const _0x5b389f=a37_0x502755,_0x10a668=loadBffProjectConfig(_0x2bda03[_0x5b389f(0x18c)]),_0x3beca5=_0x2bda03[_0x5b389f(0x1bf)]('type'),_0xeff969=_0x2bda03['str']('name'),_0x2ddc07=_0x2bda03[_0x5b389f(0x1bf)](_0x5b389f(0x1aa))||undefined,_0x49d44b=_0x3beca5==='HOOK'?await resolveHookOptions(_0x10a668,_0x2bda03):undefined,_0x5b8738=buildFilePath(_0x10a668,_0x3beca5,_0xeff969,_0x49d44b);if(await fileExists(_0x5b8738))throw CliErrors['validation'](_0x5b389f(0x1ac)+_0x5b8738);await mkdir(dirname(_0x5b8738),{'recursive':!![]});const _0x1dcf30=generateTemplate(_0x3beca5,_0xeff969,_0x2bda03['appCode'],_0x2ddc07,_0x49d44b);await writeFile(_0x5b8738,_0x1dcf30,_0x5b389f(0x19d));const _0x20d024={'type':_0x3beca5,'name':_0xeff969,'path':_0x5b8738};if(_0x2ddc07)_0x20d024[_0x5b389f(0x1aa)]=_0x2ddc07;if(_0x49d44b){if(_0x49d44b[_0x5b389f(0x1a6)])_0x20d024['alias']=_0x49d44b['alias'];_0x20d024['datasetCode']=_0x49d44b['datasetCode'],_0x20d024[_0x5b389f(0x1da)]=_0x49d44b[_0x5b389f(0x1da)],_0x20d024[_0x5b389f(0x1c8)]=_0x49d44b[_0x5b389f(0x1c8)];}return{'ok':!![],'data':_0x20d024,'message':_0x5b389f(0x1ca)+_0x3beca5+'\x20function:\x20'+_0xeff969};}};async function resolveHookOptions(_0x168b85,_0x375bcf){const _0x45706d=a37_0x502755,_0x4ac109=resolveApiModelSource(_0x375bcf[_0x45706d(0x1cb)],_0x375bcf[_0x45706d(0x18c)],_0x375bcf[_0x45706d(0x185)]||_0x375bcf[_0x45706d(0x1a3)]?.[_0x45706d(0x1a0)]||_0x375bcf[_0x45706d(0x1a3)]?.[_0x45706d(0x195)]),_0x5a86b8=loadAliasMap(_0x375bcf[_0x45706d(0x1cb)],undefined,_0x4ac109[_0x45706d(0x1e6)],_0x4ac109[_0x45706d(0x1d4)]),_0x2bb3f7=_0x5a86b8[_0x45706d(0x19c)]>0x0;let _0x1941aa,_0x19bd73,_0x119777;const _0x8bfe1e=_0x375bcf[_0x45706d(0x1bf)](_0x45706d(0x1a6)),_0x775bd8=_0x375bcf[_0x45706d(0x1bf)]('datasetcode');if(_0x8bfe1e){const _0x2fd3cf=resolveAlias(_0x375bcf['apiDir'],_0x8bfe1e,undefined,_0x4ac109['filePath'],_0x4ac109[_0x45706d(0x1d4)]);if(!_0x2fd3cf){const _0x23e4d7=_0x2bb3f7?'Available\x20aliases:\x20'+_0x5a86b8['map'](_0x3144e6=>_0x3144e6[_0x45706d(0x1a6)])[_0x45706d(0x1ea)](',\x20'):_0x45706d(0x198)+CLI_BIN_NAME+_0x45706d(0x192);throw CliErrors[_0x45706d(0x1ab)]('Alias\x20\x22'+_0x8bfe1e+_0x45706d(0x180)+_0x23e4d7);}_0x1941aa=_0x8bfe1e,_0x19bd73=_0x2fd3cf;}else{if(_0x775bd8){_0x19bd73=_0x775bd8;const _0xa9493d=_0x5a86b8['find'](_0x2f066b=>_0x2f066b[_0x45706d(0x1d8)]===_0x775bd8);_0x1941aa=_0xa9493d?.[_0x45706d(0x1a6)];}else{if(_0x375bcf[_0x45706d(0x1a5)])throw CliErrors[_0x45706d(0x1ab)](_0x45706d(0x1a1));else{if(_0x2bb3f7){const _0x3fbd64=_0x5a86b8[_0x45706d(0x190)](_0x140cb5=>_0x140cb5[_0x45706d(0x1a6)]+'\x20('+_0x140cb5[_0x45706d(0x18d)]+')'),_0x2c6cdb=await promptSelect('Select\x20dataset:',_0x3fbd64),_0x27cae4=_0x5a86b8[_0x2c6cdb];if(!_0x27cae4)throw CliErrors[_0x45706d(0x1ab)]('Invalid\x20dataset\x20selection.');_0x1941aa=_0x27cae4[_0x45706d(0x1a6)],_0x19bd73=_0x27cae4['datasetCode'];}else{const _0x3a8ba8=await listDatasets(_0x375bcf[_0x45706d(0x18c)]);if(_0x3a8ba8[_0x45706d(0x19c)]===0x0)throw CliErrors[_0x45706d(0x1ab)]('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x14380c=_0x3a8ba8[_0x45706d(0x190)](_0x1659bd=>_0x1659bd[_0x45706d(0x1cf)]+'\x20['+(_0x1659bd[_0x45706d(0x18b)]??_0x45706d(0x1e8))+']\x20('+_0x1659bd[_0x45706d(0x189)]+')'),_0x2cacba=await promptSelect(_0x45706d(0x1d0),_0x14380c),_0x2822b5=_0x3a8ba8[_0x2cacba];if(!_0x2822b5)throw CliErrors[_0x45706d(0x1ab)]('Invalid\x20dataset\x20selection.');_0x19bd73=_0x2822b5[_0x45706d(0x189)],_0x1941aa=undefined;}}}}const _0x4ee9c7=await listDatasets(_0x375bcf['appCode']),_0x53d88f=_0x4ee9c7[_0x45706d(0x1a4)](_0x4772fd=>_0x4772fd['code']===_0x19bd73);if(!_0x53d88f)throw CliErrors[_0x45706d(0x1ab)](_0x45706d(0x1e3)+_0x19bd73+'\x22.\x20'+(_0x1941aa?_0x45706d(0x193)+CLI_BIN_NAME+_0x45706d(0x1b7):''));_0x119777=_0x53d88f['id'];const _0x2c1625=_0x1941aa??_0x19bd73,_0x5ebf90=await listBffDatasetOperations(_0x375bcf['appCode'],_0x119777),_0xc8d19f=_0x5ebf90?Object[_0x45706d(0x1a2)](_0x5ebf90):[];if(_0xc8d19f[_0x45706d(0x19c)]===0x0)throw CliErrors[_0x45706d(0x1ab)](_0x45706d(0x191)+_0x2c1625+'.');let _0x2929e3;const _0x45c9cc=_0x375bcf[_0x45706d(0x1bf)](_0x45706d(0x1ad));if(_0x45c9cc){if(!_0xc8d19f[_0x45706d(0x1b1)](_0x45c9cc))throw CliErrors[_0x45706d(0x1ab)](_0x45706d(0x1a8)+_0x45c9cc+_0x45706d(0x187)+_0x2c1625+'.\x20'+(_0x45706d(0x196)+_0xc8d19f[_0x45706d(0x1ea)](',\x20')));_0x2929e3=_0x45c9cc;}else{if(_0x375bcf[_0x45706d(0x1a5)])throw CliErrors[_0x45706d(0x1ab)](_0x45706d(0x17d));const _0x519025=await promptSelect(_0x45706d(0x1ae),_0xc8d19f);_0x2929e3=_0xc8d19f[_0x519025]??_0xc8d19f[0x0];}let _0x5ad76c=normalizeHookFunctionNode(_0x375bcf[_0x45706d(0x1bf)]('function-node'));if(!_0x5ad76c){if(_0x375bcf['str'](_0x45706d(0x1bc)))throw CliErrors[_0x45706d(0x1ab)](_0x45706d(0x197));if(_0x375bcf['nonInteractive'])throw CliErrors[_0x45706d(0x1ab)](_0x45706d(0x1c9));const _0x4953ff=await promptSelect(_0x45706d(0x1d1),[_0x45706d(0x18f),'after']);_0x5ad76c=['before',_0x45706d(0x1db)][_0x4953ff]??_0x45706d(0x18f);}return{'alias':_0x1941aa,'datasetCode':_0x19bd73,'datasetId':_0x119777,'operationType':_0x2929e3,'functionNode':_0x5ad76c};}async function promptSelect(_0x49035f,_0x3b95fa){const _0x3fcb80=a37_0x502755;if(_0x3b95fa[_0x3fcb80(0x19c)]===0x1)return 0x0;for(const [_0x2ff909,_0x12c61e]of _0x3b95fa[_0x3fcb80(0x1b8)]()){process[_0x3fcb80(0x1a7)][_0x3fcb80(0x184)]('\x20\x20'+(_0x2ff909+0x1)+'.\x20'+_0x12c61e+'\x0a');}const _0x3ddbde=createInterface({'input':process[_0x3fcb80(0x18a)],'output':process[_0x3fcb80(0x1a7)]});while(!![]){const _0x3d079c=await new Promise(_0x1d7a16=>{_0x3ddbde['question'](_0x49035f+'\x20',_0x1d7a16);}),_0x346315=Number[_0x3fcb80(0x1c5)](_0x3d079c[_0x3fcb80(0x1d9)](),0xa);if(Number['isInteger'](_0x346315)&&_0x346315>=0x1&&_0x346315<=_0x3b95fa[_0x3fcb80(0x19c)])return _0x3ddbde[_0x3fcb80(0x1d7)](),_0x346315-0x1;process[_0x3fcb80(0x1a7)]['write'](_0x3fcb80(0x1cc)+_0x3b95fa[_0x3fcb80(0x19c)]+'.\x0a');}}function buildFilePath(_0x5d65cd,_0x3028d1,_0x382073,_0xcce540){const _0x465ddd=a37_0x502755;if(_0x3028d1===_0x465ddd(0x1b4)){if(!_0xcce540)throw CliErrors[_0x465ddd(0x1ab)](_0x465ddd(0x1e1));const _0x5eaf02=_0xcce540[_0x465ddd(0x1a6)]??_0xcce540['datasetCode'];return join(_0x5d65cd['scriptsRootDir'],'HOOK',_0x5eaf02,_0xcce540[_0x465ddd(0x1da)],_0xcce540[_0x465ddd(0x1c8)],_0x382073+_0x465ddd(0x1b9));}return join(_0x5d65cd[_0x465ddd(0x1bb)],_0x3028d1,_0x382073+'.js');}export function generateTemplate(_0x934b2d,_0x34aab0,_0x38a2ae,_0x2922ca,_0x30cab8){const _0x2b25b6=a37_0x502755,_0x345e44=_0x2922ca?.[_0x2b25b6(0x1d9)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x4c4cfc=getAppBaseUrl(_0x38a2ae),_0x3b986a=_0x2b25b6(0x19b);if(_0x934b2d===_0x2b25b6(0x1d6))return'/**\x0a\x20*\x20'+_0x345e44+_0x2b25b6(0x19e)+_0x34aab0+_0x2b25b6(0x18e)+_0x4c4cfc+_0x2b25b6(0x19f)+_0x38a2ae+_0x2b25b6(0x17e)+_0x34aab0+_0x2b25b6(0x1be)+_0x34aab0+'\x22,\x20params\x20})\x0a'+_0x3b986a+_0x2b25b6(0x1e4)+_0x34aab0+_0x2b25b6(0x1b2);if(_0x934b2d==='ENDPOINT')return'/**\x0a\x20*\x20'+_0x345e44+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x34aab0+_0x2b25b6(0x1a9)+_0x38a2ae+'/'+_0x34aab0+_0x2b25b6(0x18e)+_0x4c4cfc+_0x2b25b6(0x19f)+_0x38a2ae+_0x2b25b6(0x19a)+_0x34aab0+_0x2b25b6(0x1cd)+_0x3b986a+_0x2b25b6(0x1b0)+_0x34aab0+_0x2b25b6(0x1b2);if(!_0x30cab8)throw CliErrors[_0x2b25b6(0x1ab)](_0x2b25b6(0x1e2));const _0x508e72=_0x30cab8[_0x2b25b6(0x1a6)]??_0x30cab8[_0x2b25b6(0x1d8)],_0x3a12f6=_0x30cab8[_0x2b25b6(0x1c8)]===_0x2b25b6(0x18f)?_0x2b25b6(0x1dd):_0x2b25b6(0x183),_0x312b8d=_0x30cab8[_0x2b25b6(0x1c8)]==='before'?_0x2b25b6(0x1c7):_0x2b25b6(0x17f);return _0x2b25b6(0x1c1)+_0x345e44+_0x2b25b6(0x1de)+_0x34aab0+_0x2b25b6(0x1c0)+_0x38a2ae+'/'+_0x30cab8[_0x2b25b6(0x1d8)]+'/'+_0x30cab8['operationType']+'\x0a\x20*\x20[平台配置]\x20'+_0x4c4cfc+_0x2b25b6(0x1bd)+_0x30cab8[_0x2b25b6(0x1c6)]+_0x2b25b6(0x1eb)+_0x38a2ae+_0x2b25b6(0x1d5)+_0x508e72+'/'+_0x30cab8[_0x2b25b6(0x1da)]+'/'+_0x30cab8[_0x2b25b6(0x1c8)]+'/'+_0x34aab0+'.js\x0a\x20*\x20[触发节点]\x20'+_0x30cab8['functionNode']+'\x0a'+_0x3b986a+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x3a12f6+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x312b8d+_0x2b25b6(0x199)+_0x34aab0+_0x2b25b6(0x1b2);}
@@ -1 +1 @@
1
- const a38_0x10416a=a38_0x388c;(function(_0x3f3b29,_0x39e7f7){const _0x4fdd08=a38_0x388c,_0x47511e=_0x3f3b29();while(!![]){try{const _0x46194b=-parseInt(_0x4fdd08(0x1c5))/0x1*(parseInt(_0x4fdd08(0x1e4))/0x2)+parseInt(_0x4fdd08(0x1c7))/0x3+parseInt(_0x4fdd08(0x1af))/0x4*(parseInt(_0x4fdd08(0x1cd))/0x5)+-parseInt(_0x4fdd08(0x1bc))/0x6*(parseInt(_0x4fdd08(0x1db))/0x7)+parseInt(_0x4fdd08(0x1d0))/0x8+parseInt(_0x4fdd08(0x1e1))/0x9*(parseInt(_0x4fdd08(0x1ca))/0xa)+parseInt(_0x4fdd08(0x1d1))/0xb;if(_0x46194b===_0x39e7f7)break;else _0x47511e['push'](_0x47511e['shift']());}catch(_0x220220){_0x47511e['push'](_0x47511e['shift']());}}}(a38_0x2647,0xc4583));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';function a38_0x388c(_0x4c9cb4,_0x3024cd){_0x4c9cb4=_0x4c9cb4-0x1ac;const _0x2647b8=a38_0x2647();let _0x388c1c=_0x2647b8[_0x4c9cb4];return _0x388c1c;}function a38_0x2647(){const _0x10b75a=['includes','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','<timestamp>','find','replace','1ZwyJfL','POST','4521168OOFHCx','Multiple\x20functions\x20match\x20\x22','No\x20lock\x20entry\x20found\x20for\x20\x22','3690fhkLIE','functions','toISOString','2180DJrpWR','scriptsRoot','str','6170936bzbOyQ','4673339RPuuAV','validation','scriptsRootDir','target','stringify','length','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','/api/management/library/scripts/delete','projectRoot','startsWith','157367jnLhPd','delete','appCode','\x20\x20-\x20','lastSync','map','9063QkOaaQ','remoteId','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','2717870vuLtbQ','lockFilePath','apps','Backend\x20Function\x20lock\x20file\x20not\x20found.','92kwLjju','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','high-risk-write','\x20(local\x20file\x20moved\x20to\x20trash)','filter','\x22\x20not\x20found\x20after\x20ensureLockScope.','join','Would\x20delete\x20','trashDir','Function\x20not\x20found:\x20','Lock\x20scope\x20for\x20app\x20\x22','keys','string','246TxaeMW','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','Deleted\x20','bff'];a38_0x2647=function(){return _0x10b75a;};return a38_0x2647();}export const bffDelete={'service':a38_0x10416a(0x1bf),'command':a38_0x10416a(0x1dc),'description':a38_0x10416a(0x1e3),'risk':a38_0x10416a(0x1b1),'flags':[{'name':a38_0x10416a(0x1d4),'type':a38_0x10416a(0x1bb),'required':!![],'description':a38_0x10416a(0x1d7)}],async 'validate'(_0x45455b){const _0x2e1e4d=a38_0x10416a,_0x6a7b6f=loadBffProjectConfig(_0x45455b[_0x2e1e4d(0x1dd)]),_0x47c89d=await readBffLockFile(_0x6a7b6f[_0x2e1e4d(0x1ac)]);if(!_0x47c89d)throw CliErrors[_0x2e1e4d(0x1d2)](_0x2e1e4d(0x1c1));},async 'dryRun'(_0x1c72b1){const _0x3057db=a38_0x10416a,_0x41da75=loadBffProjectConfig(_0x1c72b1[_0x3057db(0x1dd)]),_0x1a7a34=await readBffLockFile(_0x41da75[_0x3057db(0x1ac)]);if(!_0x1a7a34)throw CliErrors['validation'](_0x3057db(0x1ae));const {appLock:_0x171290}=ensureLockScope(_0x1a7a34,_0x1c72b1[_0x3057db(0x1dd)],_0x41da75['scriptsRoot'],_0x3057db(0x1dc)),_0x4f0968=_0x1c72b1[_0x3057db(0x1cf)](_0x3057db(0x1d4)),_0x413713=Object[_0x3057db(0x1ba)](_0x171290['functions']),_0x30aad1=resolveDeleteTarget(_0x4f0968,_0x413713),_0x19ed48=_0x171290[_0x3057db(0x1cb)][_0x30aad1];if(!_0x19ed48)throw CliErrors['validation'](_0x3057db(0x1c9)+_0x30aad1+'\x22.');const _0x3efe92=resolveLocalFilePathFromLockKey(_0x41da75,_0x30aad1),_0x5230ce=relative(_0x41da75[_0x3057db(0x1d9)],_0x3efe92),_0x54d02e=join(_0x41da75['trashDir'],_0x3057db(0x1c2),_0x5230ce);return{'method':_0x3057db(0x1c6),'url':_0x3057db(0x1d8),'body':{'appCode':_0x1c72b1[_0x3057db(0x1dd)],'target':_0x30aad1,'remoteId':_0x19ed48['remoteId'],'localFilePath':_0x3efe92,'trashedPath':_0x54d02e},'description':_0x3057db(0x1b6)+_0x30aad1+_0x3057db(0x1b0)};},async 'execute'(_0x1c0853){const _0x4dcf56=a38_0x10416a,_0x516e7f=loadBffProjectConfig(_0x1c0853[_0x4dcf56(0x1dd)]),_0x9b812a=await readBffLockFile(_0x516e7f['lockFilePath']);if(!_0x9b812a)throw CliErrors[_0x4dcf56(0x1d2)](_0x4dcf56(0x1ae));const {lockData:_0x924f69,appLock:_0x2d56dc}=ensureLockScope(_0x9b812a,_0x1c0853[_0x4dcf56(0x1dd)],_0x516e7f[_0x4dcf56(0x1ce)],'delete'),_0x5a6d4c=JSON['parse'](JSON[_0x4dcf56(0x1d5)](_0x924f69)),_0x4579a1=_0x5a6d4c[_0x4dcf56(0x1ad)][_0x1c0853[_0x4dcf56(0x1dd)]];if(!_0x4579a1)throw new Error(_0x4dcf56(0x1b9)+_0x1c0853[_0x4dcf56(0x1dd)]+_0x4dcf56(0x1b4));const _0x14e39d=_0x1c0853[_0x4dcf56(0x1cf)](_0x4dcf56(0x1d4)),_0x144336=Object['keys'](_0x4579a1[_0x4dcf56(0x1cb)]),_0x4c4db6=resolveDeleteTarget(_0x14e39d,_0x144336),_0x5ef44e=_0x4579a1[_0x4dcf56(0x1cb)][_0x4c4db6];if(!_0x5ef44e)throw CliErrors[_0x4dcf56(0x1d2)](_0x4dcf56(0x1c9)+_0x4c4db6+'\x22.');await deleteBffScript(_0x5ef44e[_0x4dcf56(0x1e2)]),delete _0x4579a1[_0x4dcf56(0x1cb)][_0x4c4db6],_0x4579a1[_0x4dcf56(0x1df)]=new Date()[_0x4dcf56(0x1cc)](),await writeBffLockFile(_0x516e7f[_0x4dcf56(0x1ac)],_0x5a6d4c);const _0x116048=resolveLocalFilePathFromLockKey(_0x516e7f,_0x4c4db6);let _0x4aeeed;await fileExists(_0x116048)&&(_0x4aeeed=await moveToTrash(_0x516e7f[_0x4dcf56(0x1d9)],_0x516e7f[_0x4dcf56(0x1b7)],_0x116048),await cleanupEmptyDirectories(dirname(_0x116048),_0x516e7f[_0x4dcf56(0x1d3)]));await waitForDeleteSettlement(_0x516e7f[_0x4dcf56(0x1ac)],_0x1c0853[_0x4dcf56(0x1dd)],_0x4c4db6,_0x116048),await sleep(0x96);const _0x2d91b7={'deleted':_0x4c4db6,'remoteId':_0x5ef44e[_0x4dcf56(0x1e2)]};if(_0x4aeeed)_0x2d91b7['trashedTo']=_0x4aeeed;return{'ok':!![],'data':_0x2d91b7,'message':_0x4dcf56(0x1be)+_0x4c4db6+(_0x4aeeed?_0x4dcf56(0x1b2):'')};}};function resolveDeleteTarget(_0x129f1d,_0x4a68c5){const _0xeb44ee=a38_0x10416a;if(_0x129f1d[_0xeb44ee(0x1c0)]('/')){const _0x5bd4cf=_0x4a68c5[_0xeb44ee(0x1c3)](_0x3c6a3d=>_0x3c6a3d===_0x129f1d);if(!_0x5bd4cf)throw CliErrors[_0xeb44ee(0x1d2)](_0xeb44ee(0x1b8)+_0x129f1d);return _0x5bd4cf;}const _0x49694e=_0x4a68c5[_0xeb44ee(0x1b3)](_0x320e31=>_0x320e31['split']('/')['at'](-0x1)===_0x129f1d);if(_0x49694e[_0xeb44ee(0x1d6)]===0x0)throw CliErrors[_0xeb44ee(0x1d2)](_0xeb44ee(0x1b8)+_0x129f1d);if(_0x49694e[_0xeb44ee(0x1d6)]>0x1)throw CliErrors['validation'](_0xeb44ee(0x1c8)+_0x129f1d+_0xeb44ee(0x1bd)+_0x49694e[_0xeb44ee(0x1e0)](_0x40efd2=>_0xeb44ee(0x1de)+_0x40efd2)[_0xeb44ee(0x1b5)]('\x0a'));return _0x49694e[0x0];}async function moveToTrash(_0x1a2a03,_0x18ce88,_0x44be61){const _0x571050=a38_0x10416a,_0x31910e=new Date()[_0x571050(0x1cc)]()[_0x571050(0x1c4)](/[:.]/g,'-'),_0x486335=relative(_0x1a2a03,_0x44be61),_0x28d609=join(_0x18ce88,_0x31910e,_0x486335);return await mkdir(dirname(_0x28d609),{'recursive':!![]}),await rename(_0x44be61,_0x28d609),_0x28d609;}async function cleanupEmptyDirectories(_0x43cc2e,_0x5b2af9){const _0xc08403=a38_0x10416a;let _0x49363d=resolve(_0x43cc2e);const _0x5c65bf=resolve(_0x5b2af9);while(_0x49363d[_0xc08403(0x1da)](''+_0x5c65bf+sep)||_0x49363d===_0x5c65bf){if(_0x49363d===_0x5c65bf)return;try{const _0x2efaa2=await readdir(_0x49363d);if(_0x2efaa2['length']>0x0)return;await rmdir(_0x49363d);}catch{return;}_0x49363d=dirname(_0x49363d);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0xede9fd,_0x4befed,_0xbf4c91,_0x5e5959){const _0x1f417e=a38_0x10416a;for(let _0x25df4e=0x0;_0x25df4e<DELETE_SETTLE_RETRY_COUNT;_0x25df4e+=0x1){const _0xbbabf6=await readBffLockFile(_0xede9fd),_0x19dde7=!!_0xbbabf6?.[_0x1f417e(0x1ad)]?.[_0x4befed]?.[_0x1f417e(0x1cb)]?.[_0xbf4c91],_0x4a933f=await fileExists(_0x5e5959);if(!_0x19dde7&&!_0x4a933f)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0xbf4c91+'.');}
1
+ function a38_0x44a9(_0x2150d4,_0x3c0c85){_0x2150d4=_0x2150d4-0x17e;const _0x274662=a38_0x2746();let _0x44a96e=_0x274662[_0x2150d4];return _0x44a96e;}const a38_0x5ed038=a38_0x44a9;(function(_0x200587,_0xf8fcfa){const _0x53fe49=a38_0x44a9,_0x84d95a=_0x200587();while(!![]){try{const _0x4862f3=-parseInt(_0x53fe49(0x191))/0x1+-parseInt(_0x53fe49(0x1a5))/0x2+parseInt(_0x53fe49(0x1a7))/0x3+-parseInt(_0x53fe49(0x194))/0x4+-parseInt(_0x53fe49(0x181))/0x5+-parseInt(_0x53fe49(0x183))/0x6+-parseInt(_0x53fe49(0x18a))/0x7*(-parseInt(_0x53fe49(0x189))/0x8);if(_0x4862f3===_0xf8fcfa)break;else _0x84d95a['push'](_0x84d95a['shift']());}catch(_0x3dbbe2){_0x84d95a['push'](_0x84d95a['shift']());}}}(a38_0x2746,0x297fb));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';function a38_0x2746(){const _0x2d4b5b=['projectRoot','appCode','split','Deleted\x20','1422880iQfnOh','Function\x20not\x20found:\x20','429366AMOKnB','/api/management/library/scripts/delete','apps','includes','map','length','248xwrvIe','182861SuNPIe','Local\x20delete\x20not\x20settled\x20for\x20','Would\x20delete\x20','remoteId','join','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','lockFilePath','138182vAZowu','\x20\x20-\x20','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','977500nuDhSj','Backend\x20Function\x20lock\x20file\x20not\x20found.','find','str','high-risk-write','parse','<timestamp>','string','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','replace','stringify','Multiple\x20functions\x20match\x20\x22','Lock\x20scope\x20for\x20app\x20\x22','toISOString','trashDir','validation','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','93666RcwoIz','keys','437079YoPclF','functions','trashedTo','delete','scriptsRootDir','POST','scriptsRoot','target','No\x20lock\x20entry\x20found\x20for\x20\x22'];a38_0x2746=function(){return _0x2d4b5b;};return a38_0x2746();}export const bffDelete={'service':'bff','command':'delete','description':a38_0x5ed038(0x193),'risk':a38_0x5ed038(0x198),'flags':[{'name':a38_0x5ed038(0x1ae),'type':a38_0x5ed038(0x19b),'required':!![],'description':a38_0x5ed038(0x1a4)}],async 'validate'(_0x47aedc){const _0x20802d=a38_0x5ed038,_0xf4188a=loadBffProjectConfig(_0x47aedc[_0x20802d(0x17e)]),_0x22e6a6=await readBffLockFile(_0xf4188a[_0x20802d(0x190)]);if(!_0x22e6a6)throw CliErrors[_0x20802d(0x1a3)]('Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x2eeb0e){const _0x78aac4=a38_0x5ed038,_0x4ac444=loadBffProjectConfig(_0x2eeb0e[_0x78aac4(0x17e)]),_0x36fbb5=await readBffLockFile(_0x4ac444[_0x78aac4(0x190)]);if(!_0x36fbb5)throw CliErrors[_0x78aac4(0x1a3)](_0x78aac4(0x195));const {appLock:_0x2f8d35}=ensureLockScope(_0x36fbb5,_0x2eeb0e['appCode'],_0x4ac444[_0x78aac4(0x1ad)],_0x78aac4(0x1aa)),_0x318f00=_0x2eeb0e['str'](_0x78aac4(0x1ae)),_0x3c0254=Object[_0x78aac4(0x1a6)](_0x2f8d35['functions']),_0x2d71d5=resolveDeleteTarget(_0x318f00,_0x3c0254),_0x5713f1=_0x2f8d35[_0x78aac4(0x1a8)][_0x2d71d5];if(!_0x5713f1)throw CliErrors['validation'](_0x78aac4(0x1af)+_0x2d71d5+'\x22.');const _0xf778f5=resolveLocalFilePathFromLockKey(_0x4ac444,_0x2d71d5),_0x3b562c=relative(_0x4ac444[_0x78aac4(0x1b0)],_0xf778f5),_0x15b222=join(_0x4ac444['trashDir'],_0x78aac4(0x19a),_0x3b562c);return{'method':_0x78aac4(0x1ac),'url':_0x78aac4(0x184),'body':{'appCode':_0x2eeb0e[_0x78aac4(0x17e)],'target':_0x2d71d5,'remoteId':_0x5713f1[_0x78aac4(0x18d)],'localFilePath':_0xf778f5,'trashedPath':_0x15b222},'description':_0x78aac4(0x18c)+_0x2d71d5+_0x78aac4(0x18f)};},async 'execute'(_0x291523){const _0x5c8ff1=a38_0x5ed038,_0x47198e=loadBffProjectConfig(_0x291523[_0x5c8ff1(0x17e)]),_0x2364e3=await readBffLockFile(_0x47198e[_0x5c8ff1(0x190)]);if(!_0x2364e3)throw CliErrors['validation'](_0x5c8ff1(0x195));const {lockData:_0xb15af4,appLock:_0x1cb2dd}=ensureLockScope(_0x2364e3,_0x291523[_0x5c8ff1(0x17e)],_0x47198e[_0x5c8ff1(0x1ad)],_0x5c8ff1(0x1aa)),_0x140f22=JSON[_0x5c8ff1(0x199)](JSON[_0x5c8ff1(0x19e)](_0xb15af4)),_0x355815=_0x140f22[_0x5c8ff1(0x185)][_0x291523['appCode']];if(!_0x355815)throw new Error(_0x5c8ff1(0x1a0)+_0x291523[_0x5c8ff1(0x17e)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x36c6b0=_0x291523[_0x5c8ff1(0x197)](_0x5c8ff1(0x1ae)),_0x12f766=Object[_0x5c8ff1(0x1a6)](_0x355815[_0x5c8ff1(0x1a8)]),_0x59ab65=resolveDeleteTarget(_0x36c6b0,_0x12f766),_0xa7596=_0x355815['functions'][_0x59ab65];if(!_0xa7596)throw CliErrors['validation'](_0x5c8ff1(0x1af)+_0x59ab65+'\x22.');await deleteBffScript(_0xa7596[_0x5c8ff1(0x18d)]),delete _0x355815[_0x5c8ff1(0x1a8)][_0x59ab65],_0x355815['lastSync']=new Date()[_0x5c8ff1(0x1a1)](),await writeBffLockFile(_0x47198e[_0x5c8ff1(0x190)],_0x140f22);const _0x11fa03=resolveLocalFilePathFromLockKey(_0x47198e,_0x59ab65);let _0x222de4;await fileExists(_0x11fa03)&&(_0x222de4=await moveToTrash(_0x47198e[_0x5c8ff1(0x1b0)],_0x47198e[_0x5c8ff1(0x1a2)],_0x11fa03),await cleanupEmptyDirectories(dirname(_0x11fa03),_0x47198e[_0x5c8ff1(0x1ab)]));await waitForDeleteSettlement(_0x47198e[_0x5c8ff1(0x190)],_0x291523[_0x5c8ff1(0x17e)],_0x59ab65,_0x11fa03),await sleep(0x96);const _0x15a0bc={'deleted':_0x59ab65,'remoteId':_0xa7596[_0x5c8ff1(0x18d)]};if(_0x222de4)_0x15a0bc[_0x5c8ff1(0x1a9)]=_0x222de4;return{'ok':!![],'data':_0x15a0bc,'message':_0x5c8ff1(0x180)+_0x59ab65+(_0x222de4?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x9b6f75,_0x37ae98){const _0x3b4346=a38_0x5ed038;if(_0x9b6f75[_0x3b4346(0x186)]('/')){const _0x726711=_0x37ae98[_0x3b4346(0x196)](_0x3778c4=>_0x3778c4===_0x9b6f75);if(!_0x726711)throw CliErrors[_0x3b4346(0x1a3)](_0x3b4346(0x182)+_0x9b6f75);return _0x726711;}const _0x4404c5=_0x37ae98['filter'](_0x9f617f=>_0x9f617f[_0x3b4346(0x17f)]('/')['at'](-0x1)===_0x9b6f75);if(_0x4404c5['length']===0x0)throw CliErrors[_0x3b4346(0x1a3)]('Function\x20not\x20found:\x20'+_0x9b6f75);if(_0x4404c5[_0x3b4346(0x188)]>0x1)throw CliErrors[_0x3b4346(0x1a3)](_0x3b4346(0x19f)+_0x9b6f75+_0x3b4346(0x19c)+_0x4404c5[_0x3b4346(0x187)](_0x39f589=>_0x3b4346(0x192)+_0x39f589)[_0x3b4346(0x18e)]('\x0a'));return _0x4404c5[0x0];}async function moveToTrash(_0x8674d5,_0xd7f326,_0x43d116){const _0x17ffe6=a38_0x5ed038,_0x531406=new Date()[_0x17ffe6(0x1a1)]()[_0x17ffe6(0x19d)](/[:.]/g,'-'),_0x5deeff=relative(_0x8674d5,_0x43d116),_0x4841d5=join(_0xd7f326,_0x531406,_0x5deeff);return await mkdir(dirname(_0x4841d5),{'recursive':!![]}),await rename(_0x43d116,_0x4841d5),_0x4841d5;}async function cleanupEmptyDirectories(_0x1437f0,_0x5f738){const _0x2a5187=a38_0x5ed038;let _0x184774=resolve(_0x1437f0);const _0x5371e7=resolve(_0x5f738);while(_0x184774['startsWith'](''+_0x5371e7+sep)||_0x184774===_0x5371e7){if(_0x184774===_0x5371e7)return;try{const _0x1466e9=await readdir(_0x184774);if(_0x1466e9[_0x2a5187(0x188)]>0x0)return;await rmdir(_0x184774);}catch{return;}_0x184774=dirname(_0x184774);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x6e4ddd,_0x50f434,_0x340c5c,_0x54aaf4){const _0x170fad=a38_0x5ed038;for(let _0x19694f=0x0;_0x19694f<DELETE_SETTLE_RETRY_COUNT;_0x19694f+=0x1){const _0x3ec082=await readBffLockFile(_0x6e4ddd),_0x5ee74a=!!_0x3ec082?.[_0x170fad(0x185)]?.[_0x50f434]?.[_0x170fad(0x1a8)]?.[_0x340c5c],_0x4887e2=await fileExists(_0x54aaf4);if(!_0x5ee74a&&!_0x4887e2)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x170fad(0x18b)+_0x340c5c+'.');}
@@ -1 +1 @@
1
- const a39_0x309626=a39_0x1e62;function a39_0x1b78(){const _0x15f5e8=['8708985ezlqmJ','appCode','detail','bff','277854vLGrcX','createdTime','scriptType','20mlKtug','12197383nIGkLf','1514229SJEIhU','description','num','68iOvYqb','(none)','boolean','36srGYnk','read','verbose','version','11578qYeGrp','Script\x20ID','8728320sGDEmT','8bUxHsu','updatedTime','203bxSqXg','54305qQwZGk','functionName'];a39_0x1b78=function(){return _0x15f5e8;};return a39_0x1b78();}(function(_0xcb69f9,_0x2ccea5){const _0x3e849b=a39_0x1e62,_0x2f5049=_0xcb69f9();while(!![]){try{const _0x545e44=-parseInt(_0x3e849b(0x1fb))/0x1*(parseInt(_0x3e849b(0x202))/0x2)+-parseInt(_0x3e849b(0x1f8))/0x3+-parseInt(_0x3e849b(0x1f6))/0x4*(parseInt(_0x3e849b(0x208))/0x5)+-parseInt(_0x3e849b(0x1f3))/0x6*(parseInt(_0x3e849b(0x207))/0x7)+parseInt(_0x3e849b(0x205))/0x8*(-parseInt(_0x3e849b(0x20a))/0x9)+parseInt(_0x3e849b(0x204))/0xa+-parseInt(_0x3e849b(0x1f7))/0xb*(-parseInt(_0x3e849b(0x1fe))/0xc);if(_0x545e44===_0x2ccea5)break;else _0x2f5049['push'](_0x2f5049['shift']());}catch(_0x5ce4d9){_0x2f5049['push'](_0x2f5049['shift']());}}}(a39_0x1b78,0xe4881));import{getBffScriptInfo}from'../../core/api-client.js';function a39_0x1e62(_0x12b9a2,_0x22b0e4){_0x12b9a2=_0x12b9a2-0x1f0;const _0x1b784a=a39_0x1b78();let _0x1e62d9=_0x1b784a[_0x12b9a2];return _0x1e62d9;}export const bffDetail={'service':a39_0x309626(0x1f2),'command':a39_0x309626(0x1f1),'description':'Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','risk':a39_0x309626(0x1ff),'flags':[{'name':'id','type':'number','required':!![],'description':a39_0x309626(0x203)},{'name':a39_0x309626(0x200),'type':a39_0x309626(0x1fd),'description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x2ddd28){const _0xf53d99=a39_0x309626,_0xd87b80=await getBffScriptInfo(_0x2ddd28[_0xf53d99(0x1fa)]('id')),_0x116dbe=_0x2ddd28['bool'](_0xf53d99(0x200));if(_0x116dbe)return{'ok':!![],'data':_0xd87b80};return{'ok':!![],'data':{'id':_0xd87b80['id'],'functionName':_0xd87b80[_0xf53d99(0x209)]??'','version':_0xd87b80[_0xf53d99(0x201)]??'','updateUserName':_0xd87b80['updateUserName']??'','appCode':_0xd87b80[_0xf53d99(0x1f0)],'scriptType':_0xd87b80[_0xf53d99(0x1f5)],'description':_0xd87b80[_0xf53d99(0x1f9)]||_0xf53d99(0x1fc),'createdTime':_0xd87b80[_0xf53d99(0x1f4)]??'','updatedTime':_0xd87b80[_0xf53d99(0x206)]??'','scriptContent':_0xd87b80['scriptContent']??''}};}};
1
+ const a39_0x49c111=a39_0x1d32;function a39_0x2159(){const _0x30a1d3=['2289528VJNUQG','description','num','scriptType','(none)','appCode','20Eqpdds','detail','50dBkpef','verbose','101559zXfkCE','8038112CEbrQW','553578SsoyKN','version','functionName','createdTime','bool','954673uOqVdY','bff','4250064lJyKMa','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','Script\x20ID','number','updatedTime','257236gpQBEr','scriptContent'];a39_0x2159=function(){return _0x30a1d3;};return a39_0x2159();}(function(_0x54bfd5,_0x76f7f9){const _0x1c6c82=a39_0x1d32,_0x494046=_0x54bfd5();while(!![]){try{const _0x60e39f=parseInt(_0x1c6c82(0x1f0))/0x1+-parseInt(_0x1c6c82(0x1f7))/0x2+parseInt(_0x1c6c82(0x1e9))/0x3*(parseInt(_0x1c6c82(0x1e5))/0x4)+-parseInt(_0x1c6c82(0x1e7))/0x5*(-parseInt(_0x1c6c82(0x1eb))/0x6)+-parseInt(_0x1c6c82(0x1f2))/0x7+-parseInt(_0x1c6c82(0x1ea))/0x8+parseInt(_0x1c6c82(0x1f9))/0x9;if(_0x60e39f===_0x76f7f9)break;else _0x494046['push'](_0x494046['shift']());}catch(_0x52f15c){_0x494046['push'](_0x494046['shift']());}}}(a39_0x2159,0x88d2a));function a39_0x1d32(_0x38765e,_0x36dc2c){_0x38765e=_0x38765e-0x1e2;const _0x21592f=a39_0x2159();let _0x1d3250=_0x21592f[_0x38765e];return _0x1d3250;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x49c111(0x1f1),'command':a39_0x49c111(0x1e6),'description':a39_0x49c111(0x1f3),'risk':'read','flags':[{'name':'id','type':a39_0x49c111(0x1f5),'required':!![],'description':a39_0x49c111(0x1f4)},{'name':a39_0x49c111(0x1e8),'type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x3ab758){const _0xd1bb9b=a39_0x49c111,_0x38a199=await getBffScriptInfo(_0x3ab758[_0xd1bb9b(0x1fb)]('id')),_0x30dd0d=_0x3ab758[_0xd1bb9b(0x1ef)]('verbose');if(_0x30dd0d)return{'ok':!![],'data':_0x38a199};return{'ok':!![],'data':{'id':_0x38a199['id'],'functionName':_0x38a199[_0xd1bb9b(0x1ed)]??'','version':_0x38a199[_0xd1bb9b(0x1ec)]??'','updateUserName':_0x38a199['updateUserName']??'','appCode':_0x38a199[_0xd1bb9b(0x1e4)],'scriptType':_0x38a199[_0xd1bb9b(0x1e2)],'description':_0x38a199[_0xd1bb9b(0x1fa)]||_0xd1bb9b(0x1e3),'createdTime':_0x38a199[_0xd1bb9b(0x1ee)]??'','updatedTime':_0x38a199[_0xd1bb9b(0x1f6)]??'','scriptContent':_0x38a199[_0xd1bb9b(0x1f8)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x59816a,_0x454e63){const _0x552e72=a40_0x275c,_0x2bc0ef=_0x59816a();while(!![]){try{const _0x1f09e3=-parseInt(_0x552e72(0x1d4))/0x1+-parseInt(_0x552e72(0x1d8))/0x2+-parseInt(_0x552e72(0x1d5))/0x3*(parseInt(_0x552e72(0x1d3))/0x4)+parseInt(_0x552e72(0x1d9))/0x5+parseInt(_0x552e72(0x1d2))/0x6+parseInt(_0x552e72(0x1d6))/0x7+-parseInt(_0x552e72(0x1da))/0x8*(-parseInt(_0x552e72(0x1d7))/0x9);if(_0x1f09e3===_0x454e63)break;else _0x2bc0ef['push'](_0x2bc0ef['shift']());}catch(_0x21279b){_0x2bc0ef['push'](_0x2bc0ef['shift']());}}}(a40_0x2fc3,0x9b96b));function a40_0x275c(_0xbe7a7c,_0x597c75){_0xbe7a7c=_0xbe7a7c-0x1d2;const _0x2fc3f6=a40_0x2fc3();let _0x275c60=_0x2fc3f6[_0xbe7a7c];return _0x275c60;}function a40_0x2fc3(){const _0x4d2fa4=['54552jQFJqQ','4081296cvHryU','2552792PfWtJm','885265cwVhNy','3oswbBU','1182426DXaFVf','2682UvVLfw','1556960HSLfuZ','290190rUeBKw'];a40_0x2fc3=function(){return _0x4d2fa4;};return a40_0x2fc3();}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';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0xd826,_0x4faa9b){const _0xfdcec3=a40_0x1738,_0x5a5d20=_0xd826();while(!![]){try{const _0x40e84e=-parseInt(_0xfdcec3(0x17a))/0x1+-parseInt(_0xfdcec3(0x178))/0x2+-parseInt(_0xfdcec3(0x172))/0x3*(parseInt(_0xfdcec3(0x177))/0x4)+parseInt(_0xfdcec3(0x179))/0x5+parseInt(_0xfdcec3(0x175))/0x6*(-parseInt(_0xfdcec3(0x171))/0x7)+parseInt(_0xfdcec3(0x173))/0x8*(-parseInt(_0xfdcec3(0x176))/0x9)+parseInt(_0xfdcec3(0x174))/0xa;if(_0x40e84e===_0x4faa9b)break;else _0x5a5d20['push'](_0x5a5d20['shift']());}catch(_0x423b0d){_0x5a5d20['push'](_0x5a5d20['shift']());}}}(a40_0x286b,0x9e005));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a40_0x286b(){const _0x2f6c5f=['2699022OxJBFR','33471bfYZKu','1756lVwQno','746520DlnIxJ','2542830TZjzQD','10596PFMIzZ','14FYLjLU','843iUeKUC','184GwsebH','16310330YMecOu'];a40_0x286b=function(){return _0x2f6c5f;};return a40_0x286b();}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';function a40_0x1738(_0x3b202b,_0x1d3047){_0x3b202b=_0x3b202b-0x171;const _0x286b9b=a40_0x286b();let _0x173816=_0x286b9b[_0x3b202b];return _0x173816;}import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a41_0x3e38af=a41_0x5d81;function a41_0x5d81(_0x4ec5af,_0x31e03f){_0x4ec5af=_0x4ec5af-0x13c;const _0x157dd5=a41_0x157d();let _0x5d8191=_0x157dd5[_0x4ec5af];return _0x5d8191;}(function(_0x287487,_0x131555){const _0x4b7d72=a41_0x5d81,_0x3ed365=_0x287487();while(!![]){try{const _0x453219=parseInt(_0x4b7d72(0x157))/0x1*(-parseInt(_0x4b7d72(0x144))/0x2)+parseInt(_0x4b7d72(0x13f))/0x3+-parseInt(_0x4b7d72(0x155))/0x4*(parseInt(_0x4b7d72(0x152))/0x5)+-parseInt(_0x4b7d72(0x147))/0x6+-parseInt(_0x4b7d72(0x13d))/0x7+-parseInt(_0x4b7d72(0x13e))/0x8+-parseInt(_0x4b7d72(0x14d))/0x9*(-parseInt(_0x4b7d72(0x154))/0xa);if(_0x453219===_0x131555)break;else _0x3ed365['push'](_0x3ed365['shift']());}catch(_0x5edf47){_0x3ed365['push'](_0x3ed365['shift']());}}}(a41_0x157d,0xab2f8));function a41_0x157d(){const _0x487bab=['9649496lJIEUm','4027509ZpaYLy','List\x20Backend\x20Function\x20scripts','read','appCode','verbose','680698LNuFKY','bff','COMMON','908178jLIXmT','boolean','Filter\x20by\x20script\x20name','string','bool','(unnamed)','34022799oxeJIM','str','description','length','ENDPOINT','6324940AAwTJO','list','10KRUCrq','4AmBPFy','type','2delrwU','Return\x20full\x20script\x20objects','name','functionName','map','Script\x20type\x20filter','7828814ItfZcW'];a41_0x157d=function(){return _0x487bab;};return a41_0x157d();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x3e38af(0x145),'command':a41_0x3e38af(0x153),'description':a41_0x3e38af(0x140),'risk':a41_0x3e38af(0x141),'flags':[{'name':a41_0x3e38af(0x156),'type':a41_0x3e38af(0x14a),'description':a41_0x3e38af(0x13c),'default':'ENDPOINT','enum':[a41_0x3e38af(0x151),a41_0x3e38af(0x146)]},{'name':a41_0x3e38af(0x159),'type':a41_0x3e38af(0x14a),'description':a41_0x3e38af(0x149)},{'name':a41_0x3e38af(0x143),'type':a41_0x3e38af(0x148),'description':a41_0x3e38af(0x158)}],async 'execute'(_0x2ca714){const _0x4f630b=a41_0x3e38af,_0x1233f9=await listBffScripts(_0x2ca714[_0x4f630b(0x142)],_0x2ca714[_0x4f630b(0x14e)](_0x4f630b(0x156)),{'scriptName':_0x2ca714[_0x4f630b(0x14e)](_0x4f630b(0x159))||undefined}),_0x21fc97=_0x2ca714[_0x4f630b(0x14b)](_0x4f630b(0x143));return{'ok':!![],'data':_0x21fc97?_0x1233f9:_0x1233f9[_0x4f630b(0x15b)](_0x2d2428=>({'id':_0x2d2428['id'],'functionName':_0x2d2428[_0x4f630b(0x15a)]??'','description':_0x2d2428[_0x4f630b(0x14f)]||_0x4f630b(0x14c),'scriptType':_0x2d2428['scriptType']})),'message':_0x1233f9[_0x4f630b(0x150)]===0x0?'No\x20Backend\x20Function\x20scripts\x20found.':undefined};}};
1
+ const a41_0x8f9ec0=a41_0x39a0;(function(_0x58fa82,_0x54cba3){const _0x351707=a41_0x39a0,_0x3f060c=_0x58fa82();while(!![]){try{const _0x390353=parseInt(_0x351707(0xaa))/0x1*(-parseInt(_0x351707(0xab))/0x2)+-parseInt(_0x351707(0xac))/0x3+-parseInt(_0x351707(0xad))/0x4+-parseInt(_0x351707(0xc2))/0x5*(-parseInt(_0x351707(0xb1))/0x6)+-parseInt(_0x351707(0xbf))/0x7+parseInt(_0x351707(0xae))/0x8*(-parseInt(_0x351707(0xb9))/0x9)+parseInt(_0x351707(0xc6))/0xa*(parseInt(_0x351707(0xc4))/0xb);if(_0x390353===_0x54cba3)break;else _0x3f060c['push'](_0x3f060c['shift']());}catch(_0xeb0e0a){_0x3f060c['push'](_0x3f060c['shift']());}}}(a41_0x3fe4,0xcc50b));function a41_0x39a0(_0xe2412,_0x30ff05){_0xe2412=_0xe2412-0xaa;const _0x3fe4a9=a41_0x3fe4();let _0x39a097=_0x3fe4a9[_0xe2412];return _0x39a097;}function a41_0x3fe4(){const _0x35ecd0=['str','11mQWWBJ','appCode','35371180cTvtET','Filter\x20by\x20script\x20name','bool','75963HhNNBD','32DySJkZ','811113ghUpyD','622932PTUfXc','8HUqFiN','length','verbose','16602yUPDeu','Script\x20type\x20filter','List\x20Backend\x20Function\x20scripts','Return\x20full\x20script\x20objects','boolean','COMMON','string','read','9867618xsJuza','bff','ENDPOINT','description','No\x20Backend\x20Function\x20scripts\x20found.','name','8064973poqhZH','type','scriptType','2150gJYmwt'];a41_0x3fe4=function(){return _0x35ecd0;};return a41_0x3fe4();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x8f9ec0(0xba),'command':'list','description':a41_0x8f9ec0(0xb3),'risk':a41_0x8f9ec0(0xb8),'flags':[{'name':a41_0x8f9ec0(0xc0),'type':'string','description':a41_0x8f9ec0(0xb2),'default':a41_0x8f9ec0(0xbb),'enum':['ENDPOINT',a41_0x8f9ec0(0xb6)]},{'name':a41_0x8f9ec0(0xbe),'type':a41_0x8f9ec0(0xb7),'description':a41_0x8f9ec0(0xc7)},{'name':a41_0x8f9ec0(0xb0),'type':a41_0x8f9ec0(0xb5),'description':a41_0x8f9ec0(0xb4)}],async 'execute'(_0x46c4f8){const _0x5a40f8=a41_0x8f9ec0,_0x2f4f22=await listBffScripts(_0x46c4f8[_0x5a40f8(0xc5)],_0x46c4f8[_0x5a40f8(0xc3)](_0x5a40f8(0xc0)),{'scriptName':_0x46c4f8[_0x5a40f8(0xc3)](_0x5a40f8(0xbe))||undefined}),_0x3fcbb5=_0x46c4f8[_0x5a40f8(0xc8)](_0x5a40f8(0xb0));return{'ok':!![],'data':_0x3fcbb5?_0x2f4f22:_0x2f4f22['map'](_0x2b74cc=>({'id':_0x2b74cc['id'],'functionName':_0x2b74cc['functionName']??'','description':_0x2b74cc[_0x5a40f8(0xbc)]||'(unnamed)','scriptType':_0x2b74cc[_0x5a40f8(0xc1)]})),'message':_0x2f4f22[_0x5a40f8(0xaf)]===0x0?_0x5a40f8(0xbd):undefined};}};
@@ -1 +1 @@
1
- const a42_0x476b2a=a42_0x7baf;function a42_0xe791(){const _0x2a14ef=['length','5439712fldoCn','toUpperCase','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','INFO','--end-time','\x20Backend\x20Function\x20log\x20line(s).','validation','7wLOGeq','Maximum\x20log\x20lines\x20to\x20return\x20(1-','6641239AhmPsy','104226zhJwOB','since','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','--limit\x20must\x20be\x20between\x201\x20and\x20','--since','10NrtZDb','ERROR','WARN','number','flag','3446536Dwbihj','trim','end-time','3950352lWPPCP','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','33XlJSaz','\x20must\x20be\x20a\x20positive\x20integer.','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','str','start-time','713166DAjtRO','Found\x20','keyword','limit','num','logs','10eAFPcu','2022102nBLfCe','now','read','bff','string','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','level','Filter\x20by\x20log\x20level'];a42_0xe791=function(){return _0x2a14ef;};return a42_0xe791();}(function(_0x4e0a41,_0x3adeb4){const _0x1fddab=a42_0x7baf,_0x546b27=_0x4e0a41();while(!![]){try{const _0x4453a4=parseInt(_0x1fddab(0x8f))/0x1+-parseInt(_0x1fddab(0xab))/0x2*(-parseInt(_0x1fddab(0x8a))/0x3)+-parseInt(_0x1fddab(0xb5))/0x4+parseInt(_0x1fddab(0xb0))/0x5*(parseInt(_0x1fddab(0x96))/0x6)+-parseInt(_0x1fddab(0xa8))/0x7*(parseInt(_0x1fddab(0x9f))/0x8)+-parseInt(_0x1fddab(0xb8))/0x9+-parseInt(_0x1fddab(0x95))/0xa*(-parseInt(_0x1fddab(0xaa))/0xb);if(_0x4453a4===_0x3adeb4)break;else _0x546b27['push'](_0x546b27['shift']());}catch(_0x26457f){_0x546b27['push'](_0x546b27['shift']());}}}(a42_0xe791,0x8e7f2));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=['DEBUG',a42_0x476b2a(0xa4),a42_0x476b2a(0xb2),a42_0x476b2a(0xb1)];export function resolveBffLogQuery(_0x2bdb15,_0x5b0a34=Date[a42_0x476b2a(0x97)]()){const _0x1de6ff=a42_0x476b2a,_0x1ae85f=_0x2bdb15[_0x1de6ff(0xb4)]('since'),_0x2122e6=_0x2bdb15[_0x1de6ff(0xb4)]('start-time'),_0x5cfacf=_0x2bdb15[_0x1de6ff(0xb4)](_0x1de6ff(0xb7));if(_0x1ae85f!==undefined&&_0x2122e6!==undefined)throw CliErrors[_0x1de6ff(0xa7)](_0x1de6ff(0x89));const _0x2ad5bd=_0x5cfacf===undefined?_0x5b0a34:readPositiveInteger(_0x2bdb15[_0x1de6ff(0x93)]('end-time'),_0x1de6ff(0xa5)),_0x1ef527=_0x2122e6===undefined?_0x2ad5bd-readSinceMinutes(_0x2bdb15)*0xea60:readPositiveInteger(_0x2bdb15['num'](_0x1de6ff(0x8e)),'--start-time');if(_0x1ef527<=0x0)throw CliErrors[_0x1de6ff(0xa7)](_0x1de6ff(0x9b));if(_0x1ef527>_0x2ad5bd)throw CliErrors[_0x1de6ff(0xa7)](_0x1de6ff(0x8c));const _0x3cb119=readPositiveInteger(_0x2bdb15[_0x1de6ff(0x93)](_0x1de6ff(0x92),DEFAULT_LIMIT),'--limit');if(_0x3cb119>MAX_LIMIT)throw CliErrors[_0x1de6ff(0xa7)](_0x1de6ff(0xae)+MAX_LIMIT+'.');const _0x49a070=_0x2bdb15[_0x1de6ff(0x8d)](_0x1de6ff(0x9c))['trim']()[_0x1de6ff(0xa0)]()||undefined,_0x4b3924=_0x2bdb15[_0x1de6ff(0x8d)]('keyword')[_0x1de6ff(0xb6)]()||undefined;return{'appCode':_0x2bdb15['appCode'],'startTime':_0x1ef527,'endTime':_0x2ad5bd,..._0x2122e6===undefined?{'sinceMinutes':readSinceMinutes(_0x2bdb15)}:{},..._0x49a070?{'level':_0x49a070}:{},..._0x4b3924?{'keyword':_0x4b3924}:{},'limit':_0x3cb119};}function a42_0x7baf(_0x4b5b48,_0x5848e6){_0x4b5b48=_0x4b5b48-0x89;const _0xe791a0=a42_0xe791();let _0x7baf72=_0xe791a0[_0x4b5b48];return _0x7baf72;}function readSinceMinutes(_0x16da3c){const _0x256b14=a42_0x476b2a;return readPositiveInteger(_0x16da3c['num'](_0x256b14(0xac),DEFAULT_SINCE_MINUTES),_0x256b14(0xaf));}function readPositiveInteger(_0x1a1687,_0x29ba72){const _0x347433=a42_0x476b2a;if(!Number['isSafeInteger'](_0x1a1687)||_0x1a1687<=0x0)throw CliErrors[_0x347433(0xa7)](_0x29ba72+_0x347433(0x8b));return _0x1a1687;}export const bffLogs={'service':a42_0x476b2a(0x99),'command':a42_0x476b2a(0x94),'description':a42_0x476b2a(0xa3),'risk':a42_0x476b2a(0x98),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x476b2a(0xac),'type':a42_0x476b2a(0xb3),'description':'Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20'+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x476b2a(0x8e),'type':a42_0x476b2a(0xb3),'description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':a42_0x476b2a(0xb7),'type':a42_0x476b2a(0xb3),'description':a42_0x476b2a(0xa2)},{'name':a42_0x476b2a(0x9c),'type':a42_0x476b2a(0x9a),'description':a42_0x476b2a(0x9d),'enum':LOG_LEVELS},{'name':a42_0x476b2a(0x91),'type':a42_0x476b2a(0x9a),'description':a42_0x476b2a(0xa1)},{'name':a42_0x476b2a(0x92),'type':a42_0x476b2a(0xb3),'description':a42_0x476b2a(0xa9)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x226767){resolveBffLogQuery(_0x226767);},async 'execute'(_0x3aac03){const _0x33d2d9=a42_0x476b2a,_0x2b4a4a=resolveBffLogQuery(_0x3aac03),{sinceMinutes:_0x2afa39,..._0x2327ab}=_0x2b4a4a,_0x2dda68=await searchBffScriptLogs(_0x2327ab);return{'ok':!![],'data':{'query':_0x2b4a4a,'count':_0x2dda68[_0x33d2d9(0x9e)],'logs':_0x2dda68},'message':_0x2dda68[_0x33d2d9(0x9e)]===0x0?_0x33d2d9(0xad):_0x33d2d9(0x90)+_0x2dda68[_0x33d2d9(0x9e)]+_0x33d2d9(0xa6)};}};
1
+ const a42_0x1ff863=a42_0x3e8e;(function(_0x3b785c,_0x597812){const _0x22add7=a42_0x3e8e,_0x18bd96=_0x3b785c();while(!![]){try{const _0x41ab6a=-parseInt(_0x22add7(0x107))/0x1*(parseInt(_0x22add7(0xdb))/0x2)+-parseInt(_0x22add7(0xef))/0x3+parseInt(_0x22add7(0x104))/0x4+-parseInt(_0x22add7(0xdd))/0x5*(-parseInt(_0x22add7(0xea))/0x6)+parseInt(_0x22add7(0xe2))/0x7*(-parseInt(_0x22add7(0xfd))/0x8)+parseInt(_0x22add7(0xfc))/0x9*(parseInt(_0x22add7(0xf8))/0xa)+parseInt(_0x22add7(0xf4))/0xb;if(_0x41ab6a===_0x597812)break;else _0x18bd96['push'](_0x18bd96['shift']());}catch(_0x518889){_0x18bd96['push'](_0x18bd96['shift']());}}}(a42_0x4e94,0x3429b));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';function a42_0x3e8e(_0x59baf6,_0x5b6b95){_0x59baf6=_0x59baf6-0xda;const _0x4e94ce=a42_0x4e94();let _0x3e8ee6=_0x4e94ce[_0x59baf6];return _0x3e8ee6;}import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0x1ff863(0xe5),a42_0x1ff863(0xff),'WARN',a42_0x1ff863(0xf3)];export function resolveBffLogQuery(_0x20cf5f,_0x5f48fa=Date['now']()){const _0x573d24=a42_0x1ff863,_0x5bf648=_0x20cf5f[_0x573d24(0xe4)]('since'),_0x262b51=_0x20cf5f[_0x573d24(0xe4)](_0x573d24(0xec)),_0xa8bfa=_0x20cf5f['flag'](_0x573d24(0xde));if(_0x5bf648!==undefined&&_0x262b51!==undefined)throw CliErrors[_0x573d24(0xf6)](_0x573d24(0xe1));const _0x4b1386=_0xa8bfa===undefined?_0x5f48fa:readPositiveInteger(_0x20cf5f[_0x573d24(0xf0)]('end-time'),_0x573d24(0xe0)),_0x4a0a4f=_0x262b51===undefined?_0x4b1386-readSinceMinutes(_0x20cf5f)*0xea60:readPositiveInteger(_0x20cf5f[_0x573d24(0xf0)]('start-time'),_0x573d24(0xe3));if(_0x4a0a4f<=0x0)throw CliErrors[_0x573d24(0xf6)](_0x573d24(0xda));if(_0x4a0a4f>_0x4b1386)throw CliErrors[_0x573d24(0xf6)](_0x573d24(0xed));const _0x1f9d63=readPositiveInteger(_0x20cf5f[_0x573d24(0xf0)](_0x573d24(0xfa),DEFAULT_LIMIT),_0x573d24(0xee));if(_0x1f9d63>MAX_LIMIT)throw CliErrors['validation'](_0x573d24(0x102)+MAX_LIMIT+'.');const _0x1454d5=_0x20cf5f['str'](_0x573d24(0x101))['trim']()[_0x573d24(0xe6)]()||undefined,_0x3ee090=_0x20cf5f[_0x573d24(0xdf)](_0x573d24(0xeb))['trim']()||undefined;return{'appCode':_0x20cf5f[_0x573d24(0xfb)],'startTime':_0x4a0a4f,'endTime':_0x4b1386,..._0x262b51===undefined?{'sinceMinutes':readSinceMinutes(_0x20cf5f)}:{},..._0x1454d5?{'level':_0x1454d5}:{},..._0x3ee090?{'keyword':_0x3ee090}:{},'limit':_0x1f9d63};}function readSinceMinutes(_0x5c8f0c){const _0x3e2154=a42_0x1ff863;return readPositiveInteger(_0x5c8f0c['num']('since',DEFAULT_SINCE_MINUTES),_0x3e2154(0x106));}function a42_0x4e94(){const _0x21f78f=['string','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','165956bCzmeb','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','1865vpNnNe','end-time','str','--end-time','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','114163dqKzyX','--start-time','flag','DEBUG','toUpperCase','logs','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','length','6168QLJPdT','keyword','start-time','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','--limit','549783IfbEBr','num','number','Filter\x20by\x20log\x20level','ERROR','2760230qEsPdA','\x20Backend\x20Function\x20log\x20line(s).','validation','\x20must\x20be\x20a\x20positive\x20integer.','10ngcJTT','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','limit','appCode','394029ksJteL','136kWUIPc','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','INFO','read','level','--limit\x20must\x20be\x20between\x201\x20and\x20','since','315984BRvsjz','bff','--since','1GfKLSg'];a42_0x4e94=function(){return _0x21f78f;};return a42_0x4e94();}function readPositiveInteger(_0x5d41b3,_0x28c9bb){const _0x189bb5=a42_0x1ff863;if(!Number['isSafeInteger'](_0x5d41b3)||_0x5d41b3<=0x0)throw CliErrors['validation'](_0x28c9bb+_0x189bb5(0xf7));return _0x5d41b3;}export const bffLogs={'service':a42_0x1ff863(0x105),'command':a42_0x1ff863(0xe7),'description':a42_0x1ff863(0xf9),'risk':a42_0x1ff863(0x100),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x1ff863(0x103),'type':a42_0x1ff863(0xf1),'description':a42_0x1ff863(0xfe)+DEFAULT_SINCE_MINUTES+')'},{'name':'start-time','type':a42_0x1ff863(0xf1),'description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':a42_0x1ff863(0xde),'type':'number','description':a42_0x1ff863(0xdc)},{'name':a42_0x1ff863(0x101),'type':a42_0x1ff863(0x108),'description':a42_0x1ff863(0xf2),'enum':LOG_LEVELS},{'name':a42_0x1ff863(0xeb),'type':a42_0x1ff863(0x108),'description':a42_0x1ff863(0xe8)},{'name':a42_0x1ff863(0xfa),'type':a42_0x1ff863(0xf1),'description':'Maximum\x20log\x20lines\x20to\x20return\x20(1-'+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x225833){resolveBffLogQuery(_0x225833);},async 'execute'(_0xf4413c){const _0xf9f31b=a42_0x1ff863,_0x2d4db8=resolveBffLogQuery(_0xf4413c),{sinceMinutes:_0x16ddff,..._0xe0ab71}=_0x2d4db8,_0x166c63=await searchBffScriptLogs(_0xe0ab71);return{'ok':!![],'data':{'query':_0x2d4db8,'count':_0x166c63[_0xf9f31b(0xe9)],'logs':_0x166c63},'message':_0x166c63['length']===0x0?'No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.':'Found\x20'+_0x166c63[_0xf9f31b(0xe9)]+_0xf9f31b(0xf5)};}};
@@ -1 +1 @@
1
- const a43_0x266076=a43_0xf235;function a43_0xf235(_0x1179ab,_0x56705d){_0x1179ab=_0x1179ab-0x135;const _0x16a575=a43_0x16a5();let _0xf23596=_0x16a575[_0x1179ab];return _0xf23596;}(function(_0x17a63e,_0x541776){const _0x3edbfc=a43_0xf235,_0x5c22c9=_0x17a63e();while(!![]){try{const _0x9ccb54=-parseInt(_0x3edbfc(0x1c1))/0x1+-parseInt(_0x3edbfc(0x17a))/0x2*(parseInt(_0x3edbfc(0x16a))/0x3)+parseInt(_0x3edbfc(0x15f))/0x4+parseInt(_0x3edbfc(0x13a))/0x5+-parseInt(_0x3edbfc(0x1be))/0x6*(parseInt(_0x3edbfc(0x19e))/0x7)+parseInt(_0x3edbfc(0x14f))/0x8+parseInt(_0x3edbfc(0x192))/0x9*(parseInt(_0x3edbfc(0x1c2))/0xa);if(_0x9ccb54===_0x541776)break;else _0x5c22c9['push'](_0x5c22c9['shift']());}catch(_0x44cf78){_0x5c22c9['push'](_0x5c22c9['shift']());}}}(a43_0x16a5,0xa4943));import{createInterface}from'node:readline';function a43_0x16a5(){const _0x33b164=['newDirectory','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','existed','hookLocation','1718135QFhyqO','Pull\x20only\x20this\x20script\x20type','filter','normalize','\x22:\x20','functions','length','\x20bff\x20push\x20--type\x20','scriptsRootDir','join','\x20conflict','selectedAppName','ino','COMMON','scriptContent','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','force','oldDirectoryPath','reverse','all','values','10309320tWUOUU','defaultApp','rekey','dev','question','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','lastSync','\x20resolution','get','set','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','\x22\x20and\x20\x22','unresolvable\x20target\x20path','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','\x22:\x20both\x20target\x20\x22','keyChanges','1684068SsgdLX','\x20pulled','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','push_local','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','Could\x20not\x20restore\x20local\x20script\x20\x22','validation','ENOENT','scriptsRoot','\x20Recovery\x20errors:\x20','message','10341ptCZJJ','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','skipped','Failed\x20to\x20write\x20local\x20script\x20\x22','yes','boolean','mode','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','.js','stderr','currentApp','alias','\x20failed','newLockKey','require','map','552suLCmW','includes','case-rename','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','functionNode','sourceFilePathByNewLockKey','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.','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','datasetCode','\x22\x20from\x20the\x20lock\x20file.','would_pull','apps','HOOK','migrations','some','entries','requires','functionName','\x22\x20may\x20remain.','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','type','\x22:\x20its\x20target\x20\x22','\x22\x20not\x20found\x20after\x20ensureLockScope.','63387DIiJlq','Force\x20overwrite\x20local\x20unsynced\x20changes','Remote\x20script\x20missing\x20id.','scriptType','read','utf8','remoteId','\x20--name\x20','toISOString','&currentPage=1&pageSize=','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','write','87549TevGCT','parse','move','Force\x20pull\x20cancelled.','Remote\x20script\x20missing\x20content.','has','bool','mergedCli','lockKey','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','split','entry','version','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','delete','oldDirectory','\x22;\x20temporary\x20directory\x20\x22','toLowerCase','newDirectoryPath','Pull\x20complete:\x20','operationType','flatMap','push','BFF_LOCAL_UNSYNCED','appCode','pull','lockFilePath','string','\x22\x20to\x20\x22','\x22\x20from\x20\x22','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','conflict','6sCAPvR','projectedFunctions','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','992841ZaJtsc','820LSTyWF','str','.hook-directory-migrate-','oldLockKey','stringify','filePath'];a43_0x16a5=function(){return _0x33b164;};return a43_0x16a5();}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{resolveApiModelSource}from'../../api/model-source.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';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':'bff','command':a43_0x266076(0x1b7),'description':a43_0x266076(0x154),'risk':a43_0x266076(0x196),'structuredErrors':!![],'flags':[{'name':a43_0x266076(0x18f),'type':a43_0x266076(0x1b9),'description':a43_0x266076(0x13b),'enum':[a43_0x266076(0x147),'ENDPOINT',a43_0x266076(0x186)]},{'name':'force','type':a43_0x266076(0x16f),'description':a43_0x266076(0x193)}],async 'dryRun'(_0x139678){const _0x439cbb=a43_0x266076,_0x41c0c5=loadBffProjectConfig(_0x139678[_0x439cbb(0x1b6)]),_0x362f3b=await readBffLockFile(_0x41c0c5[_0x439cbb(0x1b8)]),{appLock:_0x11b348}=ensureLockScope(_0x362f3b??createEmptyBffLock(),_0x139678[_0x439cbb(0x1b6)],_0x41c0c5['scriptsRoot'],'pull'),_0x32c2ba=normalizeBffType(_0x139678[_0x439cbb(0x1c3)](_0x439cbb(0x18f)))??undefined,[_0x5f463b,_0x53530c]=await Promise[_0x439cbb(0x14d)]([listBffScripts(_0x139678['appCode'],_0x32c2ba),getBffScriptStatistics(_0x139678['appCode'])]),_0x53ff6e=_0x5f463b[_0x439cbb(0x188)](_0x28d8c9=>normalizeBffType(_0x28d8c9[_0x439cbb(0x195)])===_0x439cbb(0x186)),_0xe88eea=_0x53ff6e?buildDatasetCodeToAliasMap(_0x139678['apiDir'],_0x139678[_0x439cbb(0x1b6)],_0x139678['selectedAppName']||_0x139678[_0x439cbb(0x1a5)]?.[_0x439cbb(0x174)]||_0x139678[_0x439cbb(0x1a5)]?.['defaultApp']):new Map(),_0x2081ab=_0x53ff6e?await planHookDirectoryMigration(_0x41c0c5,_0x11b348,_0xe88eea,await scanLocalBffFunctions(_0x41c0c5,_0x439cbb(0x186))):undefined,_0x2dd1c1=createHookLocationMap(_0x53530c),_0x44d650=[];for(const _0x395268 of _0x5f463b){const _0x472372=resolveRemoteScriptTarget(_0x41c0c5,_0x395268,_0x2dd1c1,_0x2081ab?.['projectedFunctions']??_0x11b348['functions'],_0xe88eea);if(!_0x472372){_0x44d650[_0x439cbb(0x1b4)]({'scriptType':_0x395268[_0x439cbb(0x195)],'functionName':_0x395268[_0x439cbb(0x18b)]??'','status':_0x439cbb(0x16c),'reason':_0x439cbb(0x15b)});continue;}const _0x498960=(_0x2081ab?.[_0x439cbb(0x1bf)]??_0x11b348[_0x439cbb(0x13f)])[_0x472372[_0x439cbb(0x1a6)]],_0x10d20c=_0x395268['scriptContent']!=null?computeContentHash(_0x395268[_0x439cbb(0x148)]):undefined,_0x484633=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x2081ab,_0x472372)??_0x472372['filePath'],_0x498960,_0x10d20c),_0x58c755=_0x484633?localUnsyncedConflict(_0x472372,_0x395268['id']):undefined;_0x44d650[_0x439cbb(0x1b4)]({'lockKey':_0x472372['lockKey'],'filePath':_0x472372[_0x439cbb(0x135)],'remoteId':_0x395268['id']??null,'status':_0x58c755?_0x439cbb(0x1bd):_0x439cbb(0x184),..._0x58c755?{'conflict':_0x58c755}:{},..._0x472372['hookLocation']?{'alias':_0x472372[_0x439cbb(0x139)][_0x439cbb(0x175)]??null,'datasetCode':_0x472372[_0x439cbb(0x139)][_0x439cbb(0x182)],'operationType':_0x472372[_0x439cbb(0x139)][_0x439cbb(0x1b2)],'functionNode':_0x472372[_0x439cbb(0x139)][_0x439cbb(0x17e)]}:{}});}return{'method':'GET','url':'/api/management/library/scripts/list?appCode='+_0x139678[_0x439cbb(0x1b6)]+(_0x32c2ba?'&type='+_0x32c2ba:'')+_0x439cbb(0x19b)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x139678[_0x439cbb(0x1b6)],'filterType':_0x32c2ba??null,..._0x2081ab&&_0x2081ab[_0x439cbb(0x187)][_0x439cbb(0x140)]>0x0?{'hookDirectoryMigrations':_0x2081ab[_0x439cbb(0x187)][_0x439cbb(0x179)](_0x54bdca=>({'from':_0x54bdca['oldDirectory'],'to':_0x54bdca[_0x439cbb(0x136)]}))}:{},'files':_0x44d650},'description':'Would\x20inspect\x20'+_0x44d650['length']+_0x439cbb(0x18e)};},async 'execute'(_0xfa87eb){const _0x144be7=a43_0x266076,_0x4c486d=loadBffProjectConfig(_0xfa87eb['appCode']),_0x521e00=await readBffLockFile(_0x4c486d[_0x144be7(0x1b8)]),{lockData:_0x146dc5,appLock:_0x4a1457}=ensureLockScope(_0x521e00??createEmptyBffLock(),_0xfa87eb[_0x144be7(0x1b6)],_0x4c486d[_0x144be7(0x167)],_0x144be7(0x1b7)),_0x4cce0b=normalizeBffType(_0xfa87eb[_0x144be7(0x1c3)](_0x144be7(0x18f)))??undefined;if(_0xfa87eb[_0x144be7(0x1c3)](_0x144be7(0x18f))&&!_0x4cce0b)throw CliErrors[_0x144be7(0x165)](_0x144be7(0x18d));const [_0x57eac1,_0x495ab5]=await Promise[_0x144be7(0x14d)]([listBffScripts(_0xfa87eb[_0x144be7(0x1b6)],_0x4cce0b),getBffScriptStatistics(_0xfa87eb[_0x144be7(0x1b6)])]);if(_0x57eac1[_0x144be7(0x140)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0x199e24=_0xfa87eb[_0x144be7(0x1a4)](_0x144be7(0x14a));if(_0x199e24&&!_0xfa87eb['nonInteractive']){const _0x386f3e=await confirmForce();if(!_0x386f3e)throw CliErrors['cancelled'](_0x144be7(0x1a1));}if(_0x199e24&&_0xfa87eb['nonInteractive']){}const _0x3d05cd=_0x57eac1['some'](_0x161f45=>normalizeBffType(_0x161f45[_0x144be7(0x195)])===_0x144be7(0x186)),_0x58ed42=_0x3d05cd?buildDatasetCodeToAliasMap(_0xfa87eb['apiDir'],_0xfa87eb[_0x144be7(0x1b6)],_0xfa87eb[_0x144be7(0x145)]||_0xfa87eb[_0x144be7(0x1a5)]?.['currentApp']||_0xfa87eb['mergedCli']?.[_0x144be7(0x150)]):new Map(),_0x404146=createHookLocationMap(_0x495ab5),_0x29ec7a=JSON[_0x144be7(0x19f)](JSON[_0x144be7(0x1c6)](_0x146dc5)),_0x20f8ef=_0xfa87eb[_0x144be7(0x1b6)],_0x58792b=_0x29ec7a[_0x144be7(0x185)][_0x20f8ef];if(!_0x58792b)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x20f8ef+_0x144be7(0x191));const _0xde2b0d=_0x3d05cd?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x4c486d,_0x58792b,_0x58ed42,await scanLocalBffFunctions(_0x4c486d,_0x144be7(0x186))),_0x58792b):undefined,_0x54454c=createPullFileTransaction(),_0x558be4=[],_0x29a935=[],_0x8b29c=[],_0x2548fe=[];for(const _0xe2b42d of _0x57eac1){const _0x562d42=resolveRemoteScriptTarget(_0x4c486d,_0xe2b42d,_0x404146,_0x58792b['functions'],_0x58ed42);if(!_0x562d42){_0x29a935[_0x144be7(0x1b4)]({'lockKey':_0xe2b42d[_0x144be7(0x195)]+'/'+_0xe2b42d['functionName'],'reason':_0x144be7(0x15b)});continue;}const _0x63b960=_0x58792b[_0x144be7(0x13f)][_0x562d42['lockKey']];try{if(!_0xe2b42d['id'])throw new Error(_0x144be7(0x194));if(_0xe2b42d[_0x144be7(0x148)]==null)throw new Error(_0x144be7(0x1a2));const _0x415040=_0xe2b42d[_0x144be7(0x148)],_0x1abaa1=computeContentHash(_0x415040);if(!_0x199e24){const _0xcda110=await hasUnsyncedLocalChanges(_0x562d42[_0x144be7(0x135)],_0x63b960,_0x1abaa1);if(_0xcda110){_0x8b29c['push'](localUnsyncedConflict(_0x562d42,_0xe2b42d['id']));continue;}}await _0x54454c[_0x144be7(0x19d)](_0x562d42[_0x144be7(0x135)],_0x415040);const _0x3dff44={'hash':_0x1abaa1,'remoteId':_0xe2b42d['id'],'version':_0xe2b42d[_0x144be7(0x1aa)]};_0x562d42['type']===_0x144be7(0x186)&&_0x562d42[_0x144be7(0x139)]&&(_0x3dff44['alias']=_0x562d42[_0x144be7(0x139)][_0x144be7(0x175)],_0x3dff44['datasetCode']=_0x562d42[_0x144be7(0x139)][_0x144be7(0x182)],_0x3dff44[_0x144be7(0x1b2)]=_0x562d42['hookLocation'][_0x144be7(0x1b2)],_0x3dff44[_0x144be7(0x17e)]=_0x562d42['hookLocation']['functionNode']),_0x58792b['functions'][_0x562d42[_0x144be7(0x1a6)]]=_0x3dff44,_0x558be4['push']({'lockKey':_0x562d42[_0x144be7(0x1a6)],'remoteId':_0xe2b42d['id']});}catch(_0x1933aa){_0x2548fe[_0x144be7(0x1b4)]({'lockKey':_0x562d42[_0x144be7(0x1a6)],'error':_0x1933aa instanceof Error?_0x1933aa[_0x144be7(0x169)]:String(_0x1933aa)});}}_0x58792b['lastSync']=new Date()[_0x144be7(0x19a)]();try{await writeBffLockFile(_0x4c486d[_0x144be7(0x1b8)],_0x29ec7a);}catch(_0x247ac1){const _0x127ae4=[...await _0x54454c['rollback'](),...await _0xde2b0d?.['rollback']()??[]];throw withRollbackErrors(_0x247ac1,'Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x127ae4);}return{'ok':_0x2548fe['length']===0x0,'data':{'pulled':_0x558be4,'skipped':_0x29a935,'conflicts':_0x8b29c,'failed':_0x2548fe},'message':formatPullMessage(_0x558be4['length'],_0x29a935[_0x144be7(0x140)],_0x8b29c[_0x144be7(0x140)],_0x2548fe['length'])};}};function localUnsyncedConflict(_0x411f16,_0x1d73d3){const _0x1df9dd=a43_0x266076,_0x340188=_0x411f16[_0x1df9dd(0x1a6)][_0x1df9dd(0x1a8)]('/')['at'](-0x1);return{'code':_0x1df9dd(0x1b5),'lockKey':_0x411f16[_0x1df9dd(0x1a6)],'filePath':_0x411f16['filePath'],..._0x1d73d3!=null?{'remoteId':_0x1d73d3}:{},'message':'Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','nextAction':{'action':_0x1df9dd(0x162),'command':CLI_BIN_NAME+_0x1df9dd(0x141)+_0x411f16[_0x1df9dd(0x18f)]+_0x1df9dd(0x199)+_0x340188+'\x20--format\x20compress','requiresReview':!![],'message':_0x1df9dd(0x180)}};}function formatPullMessage(_0x333e84,_0x28b445,_0x1ccc7f,_0x2a65a8){const _0x32bfeb=a43_0x266076,_0x2ba3e3=[_0x32bfeb(0x1b1)+_0x333e84+_0x32bfeb(0x160),_0x28b445+'\x20skipped'];_0x1ccc7f>0x0&&_0x2ba3e3[_0x32bfeb(0x1b4)](_0x1ccc7f+_0x32bfeb(0x144)+(_0x1ccc7f===0x1?'':'s')+'\x20'+(_0x1ccc7f===0x1?_0x32bfeb(0x18a):_0x32bfeb(0x178))+_0x32bfeb(0x156));if(_0x2a65a8>0x0)_0x2ba3e3['push'](_0x2a65a8+_0x32bfeb(0x176));return _0x2ba3e3[_0x32bfeb(0x143)](',\x20');}async function hasUnsyncedLocalChanges(_0x321842,_0x4826b4,_0x522b4d){if(!await fileExists(_0x321842))return![];const _0x53873a=await computeFileHash(_0x321842);if(!_0x4826b4)return _0x522b4d?_0x53873a!==_0x522b4d:!![];return _0x53873a!==_0x4826b4['hash'];}function createPullFileTransaction(){const _0x2ab9e8=new Map(),_0x4dfa6a=async(_0x385927,_0x2c3836)=>{const _0x2c4f22=a43_0xf235;try{if(_0x2c3836[_0x2c4f22(0x138)])await ensureParentDirectory(_0x385927),await writeFile(_0x385927,_0x2c3836['content']);else try{await unlink(_0x385927);}catch(_0x5be6fd){if(_0x5be6fd['code']!=='ENOENT')throw _0x5be6fd;}return undefined;}catch(_0x3ce978){return _0x3ce978 instanceof Error?_0x3ce978:new Error(String(_0x3ce978));}};return{async 'write'(_0x1ca019,_0xe6e19e){const _0x45dfc4=a43_0xf235;if(!_0x2ab9e8[_0x45dfc4(0x1a3)](_0x1ca019))try{_0x2ab9e8['set'](_0x1ca019,{'existed':!![],'content':await readFile(_0x1ca019)});}catch(_0x37b525){if(_0x37b525['code']!==_0x45dfc4(0x166))throw _0x37b525;_0x2ab9e8[_0x45dfc4(0x158)](_0x1ca019,{'existed':![]});}try{await ensureParentDirectory(_0x1ca019),await writeFile(_0x1ca019,_0xe6e19e,_0x45dfc4(0x197));}catch(_0x4628c4){const _0x39bacb=await _0x4dfa6a(_0x1ca019,_0x2ab9e8[_0x45dfc4(0x157)](_0x1ca019));if(!_0x39bacb)_0x2ab9e8[_0x45dfc4(0x1ac)](_0x1ca019);throw withRollbackErrors(_0x4628c4,_0x45dfc4(0x16d)+_0x1ca019+'\x22.',_0x39bacb?[_0x39bacb]:[]);}},async 'rollback'(){const _0x353af4=a43_0xf235,_0x45e30c=[];for(const [_0x328855,_0x355bd5]of[..._0x2ab9e8[_0x353af4(0x189)]()][_0x353af4(0x14c)]()){const _0x326327=await _0x4dfa6a(_0x328855,_0x355bd5);_0x326327&&_0x45e30c['push'](new Error(_0x353af4(0x164)+_0x328855+_0x353af4(0x13e)+_0x326327['message']));}return _0x45e30c;}};}function withRollbackErrors(_0x5ee3dc,_0x917cca,_0x553cb4){const _0x77edfc=a43_0x266076,_0x276969=_0x5ee3dc instanceof Error?_0x5ee3dc:new Error(String(_0x5ee3dc));if(_0x553cb4[_0x77edfc(0x140)]===0x0)return _0x276969;return new AggregateError([_0x276969,..._0x553cb4],_0x917cca+_0x77edfc(0x168)+_0x553cb4[_0x77edfc(0x179)](_0x363dd3=>_0x363dd3[_0x77edfc(0x169)])[_0x77edfc(0x143)](';\x20'));}function buildDatasetCodeToAliasMap(_0x1598c7,_0x32cc92,_0x4bcd65){const _0x2aaa4f=a43_0x266076,_0x366607=resolveApiModelSource(_0x1598c7,_0x32cc92,_0x4bcd65),_0x32e06c=loadAliasMap(_0x1598c7,undefined,_0x366607[_0x2aaa4f(0x135)],_0x366607['profileName']);return assertUnambiguousHookAliases(_0x32e06c),new Map(_0x32e06c[_0x2aaa4f(0x179)](_0x34d3a5=>[_0x34d3a5['datasetCode'][_0x2aaa4f(0x1af)](),_0x34d3a5['alias']]));}async function planHookDirectoryMigration(_0xa0c703,_0x1a70e9,_0x524dec,_0x541a91){const _0x83bf84=a43_0x266076,_0x467496=new Map();for(const [_0x8fb239,_0x4bdeaf]of Object[_0x83bf84(0x189)](_0x1a70e9['functions'])){const [_0x356000,_0x388d93,_0x50aa32,_0x5eb673,_0x71bb1e,..._0x2477dc]=_0x8fb239['split']('/');if(_0x356000!=='HOOK'||!_0x388d93||!_0x50aa32||!_0x5eb673||!_0x71bb1e||_0x2477dc[_0x83bf84(0x140)]>0x0||!_0x4bdeaf[_0x83bf84(0x182)])continue;const _0x159882=_0x524dec['get'](_0x4bdeaf['datasetCode'][_0x83bf84(0x1af)]()),_0x2493cb=_0x159882??_0x4bdeaf[_0x83bf84(0x182)];if(!isSafeHookDirectorySegment(_0x388d93))throw CliErrors[_0x83bf84(0x165)](_0x83bf84(0x161)+_0x388d93+_0x83bf84(0x183));if(!isSafeHookDirectorySegment(_0x2493cb))throw CliErrors[_0x83bf84(0x165)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x388d93+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x388d93===_0x2493cb)continue;const _0x7e4ea2=_0x467496[_0x83bf84(0x157)](_0x388d93)??{'datasetCode':_0x4bdeaf[_0x83bf84(0x182)],'alias':_0x159882,'keyChanges':[]};if(_0x7e4ea2[_0x83bf84(0x182)]!==_0x4bdeaf[_0x83bf84(0x182)])throw CliErrors[_0x83bf84(0x165)](_0x83bf84(0x163)+_0x388d93+_0x83bf84(0x171));const _0x32aeb9='HOOK/'+_0x2493cb+'/'+_0x50aa32+'/'+_0x5eb673+'/'+_0x71bb1e;try{resolveLocalFilePathFromLockKey(_0xa0c703,_0x8fb239),resolveLocalFilePathFromLockKey(_0xa0c703,_0x32aeb9);}catch(_0x5a1d67){throw CliErrors[_0x83bf84(0x165)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'+_0x8fb239+_0x83bf84(0x13e)+(_0x5a1d67 instanceof Error?_0x5a1d67[_0x83bf84(0x169)]:String(_0x5a1d67)));}_0x7e4ea2[_0x83bf84(0x15e)][_0x83bf84(0x1b4)]({'oldLockKey':_0x8fb239,'newLockKey':_0x32aeb9,'entry':_0x4bdeaf}),_0x467496[_0x83bf84(0x158)](_0x388d93,_0x7e4ea2);}const _0x2b2e9c=new Set([..._0x467496[_0x83bf84(0x14e)]()][_0x83bf84(0x1b3)](_0x2b0520=>_0x2b0520[_0x83bf84(0x15e)][_0x83bf84(0x179)](_0x48432e=>_0x48432e[_0x83bf84(0x1c5)]))),_0xa6f16d=new Map(),_0x1eeb89=new Map();for(const [_0x441f7c,_0x377664]of _0x467496){const _0x5410b3=_0x377664['alias']??_0x377664[_0x83bf84(0x182)],_0x56d786=hookDirectoryIdentity(_0x5410b3),_0x31de39=_0xa6f16d['get'](_0x56d786);if(_0x31de39&&_0x31de39!==_0x441f7c)throw CliErrors['validation'](_0x83bf84(0x159)+_0x31de39+_0x83bf84(0x15a)+_0x441f7c+_0x83bf84(0x15d)+_0x5410b3+_0x83bf84(0x181));_0xa6f16d[_0x83bf84(0x158)](_0x56d786,_0x441f7c);for(const _0x3e352a of _0x377664[_0x83bf84(0x15e)]){const _0x352849=_0x1eeb89['get'](_0x3e352a[_0x83bf84(0x177)]);if(_0x352849&&_0x352849!==_0x3e352a[_0x83bf84(0x1c5)])throw CliErrors[_0x83bf84(0x165)](_0x83bf84(0x1ab)+_0x352849+_0x83bf84(0x15a)+_0x3e352a[_0x83bf84(0x1c5)]+_0x83bf84(0x15d)+_0x3e352a[_0x83bf84(0x177)]+'\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');if(_0x2b2e9c[_0x83bf84(0x1a3)](_0x3e352a[_0x83bf84(0x177)]))throw CliErrors[_0x83bf84(0x165)](_0x83bf84(0x1bc)+_0x3e352a[_0x83bf84(0x1c5)]+_0x83bf84(0x190)+_0x3e352a[_0x83bf84(0x177)]+_0x83bf84(0x17d));_0x1eeb89['set'](_0x3e352a[_0x83bf84(0x177)],_0x3e352a[_0x83bf84(0x1c5)]);}}const _0x22a774=new Map();for(const [_0x5386a2,_0x2b4ab4]of _0x524dec){_0x22a774['set'](hookDirectoryIdentity(_0x2b4ab4),_0x5386a2);}const _0x31534e=[];for(const [_0x5f0c0c,_0x1e5ee0]of _0x467496){const _0x4c1e2a=_0x1e5ee0[_0x83bf84(0x175)]??_0x1e5ee0['datasetCode'],_0x5be30f=join(_0xa0c703[_0x83bf84(0x142)],_0x83bf84(0x186),_0x5f0c0c),_0x5ac8b8=join(_0xa0c703[_0x83bf84(0x142)],_0x83bf84(0x186),_0x4c1e2a),_0x492f63=await directoryExists(_0x5be30f),_0x283b84=await directoryExists(_0x5ac8b8),_0x1053d8=_0x492f63?_0x283b84?await sameDirectory(_0x5be30f,_0x5ac8b8)?_0x83bf84(0x17c):undefined:_0x83bf84(0x1a0):_0x83bf84(0x151);if(!_0x1053d8)throw CliErrors[_0x83bf84(0x165)](_0x83bf84(0x163)+_0x5f0c0c+_0x83bf84(0x1ba)+_0x4c1e2a+_0x83bf84(0x137));const _0xa26411=_0x22a774[_0x83bf84(0x157)](hookDirectoryIdentity(_0x5f0c0c));if(_0xa26411&&_0xa26411!==_0x1e5ee0[_0x83bf84(0x182)][_0x83bf84(0x1af)]()){const _0x68c942=new Set(_0x1e5ee0[_0x83bf84(0x15e)][_0x83bf84(0x179)](_0x372ea2=>_0x372ea2['oldLockKey'])),_0x12ed01=_0x541a91[_0x83bf84(0x13c)](_0x4e2e6f=>_0x4e2e6f[_0x83bf84(0x18f)]===_0x83bf84(0x186)&&_0x4e2e6f[_0x83bf84(0x175)]!=null&&hookDirectoryIdentity(_0x4e2e6f[_0x83bf84(0x175)])===hookDirectoryIdentity(_0x5f0c0c)&&!_0x68c942[_0x83bf84(0x1a3)](_0x4e2e6f['lockKey']));if(_0x12ed01[_0x83bf84(0x140)]>0x0)throw CliErrors[_0x83bf84(0x165)](_0x83bf84(0x163)+_0x5f0c0c+_0x83bf84(0x1a7));}const _0x1401cc=_0x22a774[_0x83bf84(0x157)](hookDirectoryIdentity(_0x4c1e2a));if(_0x1401cc&&_0x1401cc!==_0x1e5ee0['datasetCode'][_0x83bf84(0x1af)]())throw CliErrors[_0x83bf84(0x165)](_0x83bf84(0x163)+_0x5f0c0c+_0x83bf84(0x1ba)+_0x4c1e2a+'\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');for(const _0x14503e of _0x1e5ee0['keyChanges']){const _0x370aaa=_0x1a70e9[_0x83bf84(0x13f)][_0x14503e['newLockKey']];if(_0x370aaa&&!_0x2b2e9c['has'](_0x14503e[_0x83bf84(0x177)])&&!sameHookIdentity(_0x14503e[_0x83bf84(0x1a9)],_0x370aaa))throw CliErrors['validation'](_0x83bf84(0x163)+_0x5f0c0c+_0x83bf84(0x1ba)+_0x4c1e2a+_0x83bf84(0x16b));}_0x31534e['push']({'oldDirectory':_0x5f0c0c,'newDirectory':_0x4c1e2a,'oldDirectoryPath':_0x5be30f,'newDirectoryPath':_0x5ac8b8,'mode':_0x1053d8,'alias':_0x1e5ee0[_0x83bf84(0x175)],'keyChanges':_0x1e5ee0[_0x83bf84(0x15e)]});}const _0x3f3b03={..._0x1a70e9[_0x83bf84(0x13f)]},_0x24d851=new Map(),_0x1e48dc=new Map();for(const _0x2081b5 of _0x31534e){const _0x54dfaa=_0x2081b5[_0x83bf84(0x170)]!==_0x83bf84(0x151);_0x54dfaa&&_0x1e48dc[_0x83bf84(0x158)](hookDirectoryIdentity(_0x2081b5['newDirectory']),_0x2081b5[_0x83bf84(0x14b)]);for(const _0x5eb360 of _0x2081b5[_0x83bf84(0x15e)]){const _0xe1cc6b=_0x3f3b03[_0x5eb360[_0x83bf84(0x177)]],_0x16a7ef=_0x54dfaa?_0x5eb360[_0x83bf84(0x1a9)]:_0xe1cc6b??_0x5eb360[_0x83bf84(0x1a9)];_0x3f3b03[_0x5eb360[_0x83bf84(0x177)]]=canonicalizeHookEntry(_0x16a7ef,_0x2081b5[_0x83bf84(0x175)]),delete _0x3f3b03[_0x5eb360['oldLockKey']],_0x54dfaa&&_0x24d851[_0x83bf84(0x158)](_0x5eb360[_0x83bf84(0x177)],resolveLocalFilePathFromLockKey(_0xa0c703,_0x5eb360[_0x83bf84(0x1c5)]));}}return{'migrations':_0x31534e,'projectedFunctions':_0x3f3b03,'sourceFilePathByNewLockKey':_0x24d851,'sourceDirectoryPathByNewDirectory':_0x1e48dc};}function resolveMigratedSourceFilePath(_0x1facfb,_0x37ebdd){const _0x2b6af1=a43_0x266076;if(!_0x1facfb||!_0x37ebdd)return undefined;const _0x3b9b37=_0x1facfb[_0x2b6af1(0x17f)][_0x2b6af1(0x157)](_0x37ebdd[_0x2b6af1(0x1a6)]);if(_0x3b9b37)return _0x3b9b37;if(_0x37ebdd[_0x2b6af1(0x18f)]!==_0x2b6af1(0x186))return undefined;const [,_0x306ce6,..._0x29c891]=_0x37ebdd['lockKey'][_0x2b6af1(0x1a8)]('/');if(!_0x306ce6||_0x29c891['length']===0x0)return undefined;const _0x55259e=_0x1facfb['sourceDirectoryPathByNewDirectory'][_0x2b6af1(0x157)](hookDirectoryIdentity(_0x306ce6));return _0x55259e?join(_0x55259e,..._0x29c891)+_0x2b6af1(0x172):undefined;}function sameHookIdentity(_0x23b7ee,_0x330604){const _0x3fd20e=a43_0x266076;return _0x23b7ee[_0x3fd20e(0x198)]===_0x330604[_0x3fd20e(0x198)]&&_0x23b7ee['datasetCode']===_0x330604[_0x3fd20e(0x182)]&&_0x23b7ee[_0x3fd20e(0x1b2)]===_0x330604[_0x3fd20e(0x1b2)]&&_0x23b7ee[_0x3fd20e(0x17e)]===_0x330604['functionNode'];}function canonicalizeHookEntry(_0x540b61,_0x38f81f){const {alias:_0x4dd760,..._0x5f4af6}=_0x540b61;return _0x38f81f?{..._0x5f4af6,'alias':_0x38f81f}:_0x5f4af6;}function hookDirectoryIdentity(_0x63eab3){const _0x175013=a43_0x266076;return _0x63eab3[_0x175013(0x13d)]('NFC')['toLowerCase']();}function isSafeHookDirectorySegment(_0x3561e4){return isSafeLockKeySegment(_0x3561e4);}async function sameDirectory(_0x463db2,_0x544dfe){const _0x41041b=a43_0x266076,[_0x1a8732,_0x45f9f4]=await Promise[_0x41041b(0x14d)]([stat(_0x463db2),stat(_0x544dfe)]);return _0x1a8732['dev']===_0x45f9f4[_0x41041b(0x152)]&&_0x1a8732[_0x41041b(0x146)]===_0x45f9f4[_0x41041b(0x146)];}async function applyHookDirectoryMigration(_0x37720e,_0x33a997){const _0x52ae3e=a43_0x266076,_0x53bcb7=_0x33a997['functions'],_0x3c8bb4=_0x33a997[_0x52ae3e(0x155)],_0x2820ec=[],_0x5765fe=async()=>{const _0x5ed4fe=_0x52ae3e,_0x56e1b5=[];_0x33a997[_0x5ed4fe(0x13f)]=_0x53bcb7,_0x33a997['lastSync']=_0x3c8bb4;for(const {migration:_0x3144e9,temporaryPath:_0x388610}of[..._0x2820ec][_0x5ed4fe(0x14c)]()){try{_0x388610?(await rename(_0x3144e9[_0x5ed4fe(0x1b0)],_0x388610),await rename(_0x388610,_0x3144e9[_0x5ed4fe(0x14b)])):await rename(_0x3144e9[_0x5ed4fe(0x1b0)],_0x3144e9['oldDirectoryPath']);}catch(_0x9da5e9){_0x56e1b5['push'](new Error(_0x5ed4fe(0x15c)+_0x3144e9[_0x5ed4fe(0x1ad)]+_0x5ed4fe(0x1bb)+_0x3144e9[_0x5ed4fe(0x136)]+_0x5ed4fe(0x13e)+(_0x9da5e9 instanceof Error?_0x9da5e9[_0x5ed4fe(0x169)]:String(_0x9da5e9))));}}return _0x56e1b5;};try{for(const _0x5664ae of _0x37720e[_0x52ae3e(0x187)]){if(_0x5664ae[_0x52ae3e(0x170)]===_0x52ae3e(0x1a0))await ensureParentDirectory(_0x5664ae[_0x52ae3e(0x1b0)]),await rename(_0x5664ae['oldDirectoryPath'],_0x5664ae[_0x52ae3e(0x1b0)]),_0x2820ec['push']({'migration':_0x5664ae});else{if(_0x5664ae['mode']===_0x52ae3e(0x17c)){const _0x6c0b31=join(dirname(_0x5664ae[_0x52ae3e(0x14b)]),_0x52ae3e(0x1c4)+randomUUID());await rename(_0x5664ae[_0x52ae3e(0x14b)],_0x6c0b31);try{await rename(_0x6c0b31,_0x5664ae[_0x52ae3e(0x1b0)]);}catch(_0x59e6b2){try{await rename(_0x6c0b31,_0x5664ae['oldDirectoryPath']);}catch(_0x1bb182){throw withRollbackErrors(_0x59e6b2,_0x52ae3e(0x149)+_0x5664ae[_0x52ae3e(0x1ad)]+_0x52ae3e(0x1ba)+_0x5664ae['newDirectory']+_0x52ae3e(0x1ae)+_0x6c0b31+_0x52ae3e(0x18c),[new Error(_0x52ae3e(0x1c0)+_0x6c0b31+_0x52ae3e(0x1ba)+_0x5664ae['oldDirectory']+_0x52ae3e(0x13e)+(_0x1bb182 instanceof Error?_0x1bb182['message']:String(_0x1bb182)))]);}throw _0x59e6b2;}_0x2820ec[_0x52ae3e(0x1b4)]({'migration':_0x5664ae,'temporaryPath':_0x6c0b31});}}}return _0x33a997['functions']=_0x37720e[_0x52ae3e(0x1bf)],{'rollback':_0x5765fe};}catch(_0x5c6808){const _0x343ec8=await _0x5765fe();throw withRollbackErrors(_0x5c6808,_0x52ae3e(0x19c),_0x343ec8);}}async function confirmForce(){const _0x31f6c8=a43_0x266076,_0x4a7cb0=createInterface({'input':process['stdin'],'output':process[_0x31f6c8(0x173)]}),_0x1d7cf5=await new Promise(_0x2d909f=>{const _0x4e9a63=_0x31f6c8;_0x4a7cb0[_0x4e9a63(0x153)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x2d909f);});return _0x4a7cb0['close'](),['y',_0x31f6c8(0x16e)][_0x31f6c8(0x17b)](_0x1d7cf5['trim']()[_0x31f6c8(0x1af)]());}
1
+ const a43_0x39c143=a43_0x220a;(function(_0x207299,_0xb183c3){const _0x5d71e3=a43_0x220a,_0x37d4f3=_0x207299();while(!![]){try{const _0x430f87=parseInt(_0x5d71e3(0x1ae))/0x1+parseInt(_0x5d71e3(0x138))/0x2+-parseInt(_0x5d71e3(0x18b))/0x3+parseInt(_0x5d71e3(0x196))/0x4+parseInt(_0x5d71e3(0x14f))/0x5+-parseInt(_0x5d71e3(0x12a))/0x6*(parseInt(_0x5d71e3(0x162))/0x7)+-parseInt(_0x5d71e3(0x121))/0x8;if(_0x430f87===_0xb183c3)break;else _0x37d4f3['push'](_0x37d4f3['shift']());}catch(_0x5a45f2){_0x37d4f3['push'](_0x37d4f3['shift']());}}}(a43_0x4124,0x952de));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{resolveApiModelSource}from'../../api/model-source.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';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':a43_0x39c143(0x1a0),'command':a43_0x39c143(0x12b),'description':a43_0x39c143(0x123),'risk':a43_0x39c143(0x13b),'structuredErrors':!![],'flags':[{'name':a43_0x39c143(0x15c),'type':'string','description':'Pull\x20only\x20this\x20script\x20type','enum':[a43_0x39c143(0x18d),a43_0x39c143(0x18f),a43_0x39c143(0x14e)]},{'name':a43_0x39c143(0x16c),'type':'boolean','description':a43_0x39c143(0x197)}],async 'dryRun'(_0x18a95c){const _0x487645=a43_0x39c143,_0x317e00=loadBffProjectConfig(_0x18a95c[_0x487645(0x173)]),_0x4588f4=await readBffLockFile(_0x317e00['lockFilePath']),{appLock:_0x584ec1}=ensureLockScope(_0x4588f4??createEmptyBffLock(),_0x18a95c[_0x487645(0x173)],_0x317e00[_0x487645(0x181)],_0x487645(0x12b)),_0x1d6ff2=normalizeBffType(_0x18a95c['str'](_0x487645(0x15c)))??undefined,[_0x3cc2d8,_0x19eb32]=await Promise[_0x487645(0x187)]([listBffScripts(_0x18a95c[_0x487645(0x173)],_0x1d6ff2),getBffScriptStatistics(_0x18a95c[_0x487645(0x173)])]),_0x3c0c09=_0x3cc2d8['some'](_0x12ee4c=>normalizeBffType(_0x12ee4c['scriptType'])===_0x487645(0x14e)),_0x59126d=_0x3c0c09?buildDatasetCodeToAliasMap(_0x18a95c[_0x487645(0x167)],_0x18a95c[_0x487645(0x173)],_0x18a95c['selectedAppName']||_0x18a95c[_0x487645(0x1ac)]?.[_0x487645(0x13a)]||_0x18a95c['mergedCli']?.[_0x487645(0x11c)]):new Map(),_0xac021=_0x3c0c09?await planHookDirectoryMigration(_0x317e00,_0x584ec1,_0x59126d,await scanLocalBffFunctions(_0x317e00,_0x487645(0x14e))):undefined,_0xd0a002=createHookLocationMap(_0x19eb32),_0x1cfac5=[];for(const _0x4d9001 of _0x3cc2d8){const _0x269634=resolveRemoteScriptTarget(_0x317e00,_0x4d9001,_0xd0a002,_0xac021?.[_0x487645(0x133)]??_0x584ec1[_0x487645(0x17c)],_0x59126d);if(!_0x269634){_0x1cfac5['push']({'scriptType':_0x4d9001[_0x487645(0x120)],'functionName':_0x4d9001['functionName']??'','status':_0x487645(0x189),'reason':_0x487645(0x160)});continue;}const _0xc50c87=(_0xac021?.['projectedFunctions']??_0x584ec1[_0x487645(0x17c)])[_0x269634[_0x487645(0x180)]],_0x4f0ee3=_0x4d9001[_0x487645(0x182)]!=null?computeContentHash(_0x4d9001['scriptContent']):undefined,_0x36ad51=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0xac021,_0x269634)??_0x269634[_0x487645(0x19b)],_0xc50c87,_0x4f0ee3),_0x410eb4=_0x36ad51?localUnsyncedConflict(_0x269634,_0x4d9001['id']):undefined;_0x1cfac5[_0x487645(0x198)]({'lockKey':_0x269634[_0x487645(0x180)],'filePath':_0x269634[_0x487645(0x19b)],'remoteId':_0x4d9001['id']??null,'status':_0x410eb4?_0x487645(0x136):_0x487645(0x175),..._0x410eb4?{'conflict':_0x410eb4}:{},..._0x269634[_0x487645(0x150)]?{'alias':_0x269634[_0x487645(0x150)][_0x487645(0x143)]??null,'datasetCode':_0x269634[_0x487645(0x150)]['datasetCode'],'operationType':_0x269634[_0x487645(0x150)][_0x487645(0x16b)],'functionNode':_0x269634[_0x487645(0x150)][_0x487645(0x1a4)]}:{}});}return{'method':_0x487645(0x147),'url':_0x487645(0x151)+_0x18a95c[_0x487645(0x173)]+(_0x1d6ff2?_0x487645(0x1a9)+_0x1d6ff2:'')+_0x487645(0x134)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x18a95c[_0x487645(0x173)],'filterType':_0x1d6ff2??null,..._0xac021&&_0xac021[_0x487645(0x15d)][_0x487645(0x163)]>0x0?{'hookDirectoryMigrations':_0xac021['migrations'][_0x487645(0x1a3)](_0x42972b=>({'from':_0x42972b[_0x487645(0x174)],'to':_0x42972b[_0x487645(0x11a)]}))}:{},'files':_0x1cfac5},'description':_0x487645(0x170)+_0x1cfac5[_0x487645(0x163)]+_0x487645(0x172)};},async 'execute'(_0x287969){const _0x916454=a43_0x39c143,_0x281974=loadBffProjectConfig(_0x287969['appCode']),_0x2e781b=await readBffLockFile(_0x281974['lockFilePath']),{lockData:_0x1101d3,appLock:_0x11605f}=ensureLockScope(_0x2e781b??createEmptyBffLock(),_0x287969[_0x916454(0x173)],_0x281974['scriptsRoot'],_0x916454(0x12b)),_0x17a5f5=normalizeBffType(_0x287969[_0x916454(0x185)](_0x916454(0x15c)))??undefined;if(_0x287969['str'](_0x916454(0x15c))&&!_0x17a5f5)throw CliErrors[_0x916454(0x186)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x47aff5,_0x232777]=await Promise['all']([listBffScripts(_0x287969[_0x916454(0x173)],_0x17a5f5),getBffScriptStatistics(_0x287969[_0x916454(0x173)])]);if(_0x47aff5[_0x916454(0x163)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x916454(0x15a)};const _0x37fe58=_0x287969[_0x916454(0x1aa)](_0x916454(0x16c));if(_0x37fe58&&!_0x287969['nonInteractive']){const _0x550e27=await confirmForce();if(!_0x550e27)throw CliErrors[_0x916454(0x11f)](_0x916454(0x178));}if(_0x37fe58&&_0x287969['nonInteractive']){}const _0x42f0b6=_0x47aff5['some'](_0x2e1d28=>normalizeBffType(_0x2e1d28[_0x916454(0x120)])===_0x916454(0x14e)),_0x508555=_0x42f0b6?buildDatasetCodeToAliasMap(_0x287969['apiDir'],_0x287969[_0x916454(0x173)],_0x287969[_0x916454(0x18c)]||_0x287969[_0x916454(0x1ac)]?.['currentApp']||_0x287969[_0x916454(0x1ac)]?.[_0x916454(0x11c)]):new Map(),_0x1b0257=createHookLocationMap(_0x232777),_0xb32364=JSON[_0x916454(0x135)](JSON[_0x916454(0x12d)](_0x1101d3)),_0x5697dc=_0x287969[_0x916454(0x173)],_0x5b6b82=_0xb32364['apps'][_0x5697dc];if(!_0x5b6b82)throw new Error(_0x916454(0x1a1)+_0x5697dc+_0x916454(0x146));const _0x49c412=_0x42f0b6?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x281974,_0x5b6b82,_0x508555,await scanLocalBffFunctions(_0x281974,_0x916454(0x14e))),_0x5b6b82):undefined,_0x3600e8=createPullFileTransaction(),_0x2584c7=[],_0x7f6b5b=[],_0x580e0a=[],_0x52fe3c=[];for(const _0x1c224e of _0x47aff5){const _0x1542c0=resolveRemoteScriptTarget(_0x281974,_0x1c224e,_0x1b0257,_0x5b6b82[_0x916454(0x17c)],_0x508555);if(!_0x1542c0){_0x7f6b5b['push']({'lockKey':_0x1c224e[_0x916454(0x120)]+'/'+_0x1c224e[_0x916454(0x158)],'reason':_0x916454(0x160)});continue;}const _0x1f3893=_0x5b6b82['functions'][_0x1542c0[_0x916454(0x180)]];try{if(!_0x1c224e['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x1c224e['scriptContent']==null)throw new Error(_0x916454(0x14a));const _0x4e9113=_0x1c224e[_0x916454(0x182)],_0xdb989f=computeContentHash(_0x4e9113);if(!_0x37fe58){const _0x1dccf2=await hasUnsyncedLocalChanges(_0x1542c0['filePath'],_0x1f3893,_0xdb989f);if(_0x1dccf2){_0x580e0a[_0x916454(0x198)](localUnsyncedConflict(_0x1542c0,_0x1c224e['id']));continue;}}await _0x3600e8[_0x916454(0x12c)](_0x1542c0[_0x916454(0x19b)],_0x4e9113);const _0x4d5fd2={'hash':_0xdb989f,'remoteId':_0x1c224e['id'],'version':_0x1c224e[_0x916454(0x16e)]};_0x1542c0[_0x916454(0x15c)]==='HOOK'&&_0x1542c0['hookLocation']&&(_0x4d5fd2[_0x916454(0x143)]=_0x1542c0[_0x916454(0x150)]['alias'],_0x4d5fd2[_0x916454(0x1ad)]=_0x1542c0[_0x916454(0x150)][_0x916454(0x1ad)],_0x4d5fd2[_0x916454(0x16b)]=_0x1542c0[_0x916454(0x150)]['operationType'],_0x4d5fd2[_0x916454(0x1a4)]=_0x1542c0['hookLocation'][_0x916454(0x1a4)]),_0x5b6b82[_0x916454(0x17c)][_0x1542c0['lockKey']]=_0x4d5fd2,_0x2584c7[_0x916454(0x198)]({'lockKey':_0x1542c0[_0x916454(0x180)],'remoteId':_0x1c224e['id']});}catch(_0x241958){_0x52fe3c[_0x916454(0x198)]({'lockKey':_0x1542c0['lockKey'],'error':_0x241958 instanceof Error?_0x241958[_0x916454(0x125)]:String(_0x241958)});}}_0x5b6b82[_0x916454(0x1a6)]=new Date()[_0x916454(0x128)]();try{await writeBffLockFile(_0x281974[_0x916454(0x177)],_0xb32364);}catch(_0x30e4ba){const _0xc5b081=[...await _0x3600e8[_0x916454(0x17b)](),...await _0x49c412?.[_0x916454(0x17b)]()??[]];throw withRollbackErrors(_0x30e4ba,_0x916454(0x190),_0xc5b081);}return{'ok':_0x52fe3c[_0x916454(0x163)]===0x0,'data':{'pulled':_0x2584c7,'skipped':_0x7f6b5b,'conflicts':_0x580e0a,'failed':_0x52fe3c},'message':formatPullMessage(_0x2584c7[_0x916454(0x163)],_0x7f6b5b[_0x916454(0x163)],_0x580e0a['length'],_0x52fe3c[_0x916454(0x163)])};}};function localUnsyncedConflict(_0x24d22f,_0x11a7b5){const _0x1a461a=a43_0x39c143,_0x1975b7=_0x24d22f[_0x1a461a(0x180)]['split']('/')['at'](-0x1);return{'code':_0x1a461a(0x11e),'lockKey':_0x24d22f[_0x1a461a(0x180)],'filePath':_0x24d22f['filePath'],..._0x11a7b5!=null?{'remoteId':_0x11a7b5}:{},'message':_0x1a461a(0x188),'nextAction':{'action':'push_local','command':CLI_BIN_NAME+_0x1a461a(0x19a)+_0x24d22f['type']+_0x1a461a(0x157)+_0x1975b7+_0x1a461a(0x164),'requiresReview':!![],'message':_0x1a461a(0x127)}};}function formatPullMessage(_0xc44cd5,_0x1e5aef,_0x3fe688,_0x3319a7){const _0x408b87=a43_0x39c143,_0x372cb9=[_0x408b87(0x126)+_0xc44cd5+_0x408b87(0x15b),_0x1e5aef+_0x408b87(0x169)];_0x3fe688>0x0&&_0x372cb9[_0x408b87(0x198)](_0x3fe688+_0x408b87(0x155)+(_0x3fe688===0x1?'':'s')+'\x20'+(_0x3fe688===0x1?'requires':'require')+_0x408b87(0x19e));if(_0x3319a7>0x0)_0x372cb9[_0x408b87(0x198)](_0x3319a7+'\x20failed');return _0x372cb9['join'](',\x20');}function a43_0x220a(_0x953e5d,_0x103554){_0x953e5d=_0x953e5d-0x11a;const _0x412484=a43_0x4124();let _0x220a5e=_0x412484[_0x953e5d];return _0x220a5e;}async function hasUnsyncedLocalChanges(_0x4be9f4,_0x2edeca,_0x5920f8){const _0x221437=a43_0x39c143;if(!await fileExists(_0x4be9f4))return![];const _0x4663a7=await computeFileHash(_0x4be9f4);if(!_0x2edeca)return _0x5920f8?_0x4663a7!==_0x5920f8:!![];return _0x4663a7!==_0x2edeca[_0x221437(0x124)];}function a43_0x4124(){const _0x5a4f97=['flatMap','\x20skipped','rekey','operationType','force','reverse','version','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','Would\x20inspect\x20','question','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','appCode','oldDirectory','would_pull','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','lockFilePath','Force\x20pull\x20cancelled.','toLowerCase','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','rollback','functions','oldLockKey','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','split','lockKey','scriptsRoot','scriptContent','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','has','str','validation','all','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','skipped','oldDirectoryPath','2281851hsDYww','selectedAppName','COMMON','\x22\x20and\x20\x22','ENDPOINT','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','remoteId','\x22\x20to\x20\x22','\x22\x20from\x20\x22','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','move','1927016sIqoZE','Force\x20overwrite\x20local\x20unsynced\x20changes','push','.js','\x20bff\x20push\x20--type\x20','filePath','stderr','sourceFilePathByNewLockKey','\x20resolution','utf8','bff','Lock\x20scope\x20for\x20app\x20\x22','profileName','map','functionNode','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','lastSync','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','newDirectoryPath','&type=','bool','trim','mergedCli','datasetCode','785925FEvNBC','entry','newDirectory','\x22;\x20temporary\x20directory\x20\x22','defaultApp','\x22:\x20its\x20target\x20\x22','BFF_LOCAL_UNSYNCED','cancelled','scriptType','1664760jXRgsv','dev','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','hash','message','Pull\x20complete:\x20','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.','toISOString','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','24IUpRwG','pull','write','stringify','code','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','\x22\x20may\x20remain.','Could\x20not\x20restore\x20local\x20script\x20\x22','projectedFunctions','&currentPage=1&pageSize=','parse','conflict','existed','1951432qEvBfO','mode','currentApp','read','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','case-rename','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','\x20Recovery\x20errors:\x20','\x22:\x20both\x20target\x20\x22','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','stdin','alias','newLockKey','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','\x22\x20not\x20found\x20after\x20ensureLockScope.','GET','\x22\x20from\x20the\x20lock\x20file.','keyChanges','Remote\x20script\x20missing\x20content.','delete','scriptsRootDir','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','HOOK','87395Nxhinc','hookLocation','/api/management/library/scripts/list?appCode=','ino','filter','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','\x20conflict','HOOK/','\x20--name\x20','functionName','set','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','\x20pulled','type','migrations','get','Failed\x20to\x20write\x20local\x20script\x20\x22','unresolvable\x20target\x20path','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','1191967DkTUXV','length','\x20--format\x20compress','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','apiDir'];a43_0x4124=function(){return _0x5a4f97;};return a43_0x4124();}function createPullFileTransaction(){const _0x365fd9=new Map(),_0x74f87b=async(_0x251adf,_0x4d7662)=>{const _0x4922b6=a43_0x220a;try{if(_0x4d7662[_0x4922b6(0x137)])await ensureParentDirectory(_0x251adf),await writeFile(_0x251adf,_0x4d7662['content']);else try{await unlink(_0x251adf);}catch(_0x2a64d4){if(_0x2a64d4[_0x4922b6(0x12e)]!=='ENOENT')throw _0x2a64d4;}return undefined;}catch(_0x45c448){return _0x45c448 instanceof Error?_0x45c448:new Error(String(_0x45c448));}};return{async 'write'(_0x463ae1,_0x384d7d){const _0xaa5408=a43_0x220a;if(!_0x365fd9['has'](_0x463ae1))try{_0x365fd9[_0xaa5408(0x159)](_0x463ae1,{'existed':!![],'content':await readFile(_0x463ae1)});}catch(_0x4bd33c){if(_0x4bd33c[_0xaa5408(0x12e)]!=='ENOENT')throw _0x4bd33c;_0x365fd9[_0xaa5408(0x159)](_0x463ae1,{'existed':![]});}try{await ensureParentDirectory(_0x463ae1),await writeFile(_0x463ae1,_0x384d7d,_0xaa5408(0x19f));}catch(_0x2b74de){const _0x2d1b4c=await _0x74f87b(_0x463ae1,_0x365fd9[_0xaa5408(0x15e)](_0x463ae1));if(!_0x2d1b4c)_0x365fd9[_0xaa5408(0x14b)](_0x463ae1);throw withRollbackErrors(_0x2b74de,_0xaa5408(0x15f)+_0x463ae1+'\x22.',_0x2d1b4c?[_0x2d1b4c]:[]);}},async 'rollback'(){const _0x2e1946=a43_0x220a,_0xae06e2=[];for(const [_0x364408,_0x586c87]of[..._0x365fd9['entries']()][_0x2e1946(0x16d)]()){const _0x3938f2=await _0x74f87b(_0x364408,_0x586c87);_0x3938f2&&_0xae06e2[_0x2e1946(0x198)](new Error(_0x2e1946(0x132)+_0x364408+'\x22:\x20'+_0x3938f2[_0x2e1946(0x125)]));}return _0xae06e2;}};}function withRollbackErrors(_0x578021,_0x1a20ca,_0x4c8659){const _0x5ebf3a=a43_0x39c143,_0x57d91a=_0x578021 instanceof Error?_0x578021:new Error(String(_0x578021));if(_0x4c8659[_0x5ebf3a(0x163)]===0x0)return _0x57d91a;return new AggregateError([_0x57d91a,..._0x4c8659],_0x1a20ca+_0x5ebf3a(0x13f)+_0x4c8659[_0x5ebf3a(0x1a3)](_0x548077=>_0x548077[_0x5ebf3a(0x125)])['join'](';\x20'));}function buildDatasetCodeToAliasMap(_0x31e8b3,_0xb0c9fb,_0x62cf26){const _0x520ae8=a43_0x39c143,_0x1a3713=resolveApiModelSource(_0x31e8b3,_0xb0c9fb,_0x62cf26),_0xa399e3=loadAliasMap(_0x31e8b3,undefined,_0x1a3713['filePath'],_0x1a3713[_0x520ae8(0x1a2)]);return assertUnambiguousHookAliases(_0xa399e3),new Map(_0xa399e3[_0x520ae8(0x1a3)](_0x5e2b1d=>[_0x5e2b1d['datasetCode']['toLowerCase'](),_0x5e2b1d[_0x520ae8(0x143)]]));}async function planHookDirectoryMigration(_0x5a0503,_0x1a5360,_0x4f950d,_0x514f1c){const _0x5613c3=a43_0x39c143,_0x554b2b=new Map();for(const [_0x1849db,_0x19e1a5]of Object['entries'](_0x1a5360[_0x5613c3(0x17c)])){const [_0x6df3d5,_0x5df896,_0x30fa77,_0x3e35f6,_0x1c5013,..._0x15faf6]=_0x1849db[_0x5613c3(0x17f)]('/');if(_0x6df3d5!==_0x5613c3(0x14e)||!_0x5df896||!_0x30fa77||!_0x3e35f6||!_0x1c5013||_0x15faf6['length']>0x0||!_0x19e1a5[_0x5613c3(0x1ad)])continue;const _0x4ce180=_0x4f950d['get'](_0x19e1a5[_0x5613c3(0x1ad)]['toLowerCase']()),_0x2fea53=_0x4ce180??_0x19e1a5[_0x5613c3(0x1ad)];if(!isSafeHookDirectorySegment(_0x5df896))throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x17e)+_0x5df896+_0x5613c3(0x148));if(!isSafeHookDirectorySegment(_0x2fea53))throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x166)+_0x5df896+_0x5613c3(0x12f));if(_0x5df896===_0x2fea53)continue;const _0x10cf9b=_0x554b2b[_0x5613c3(0x15e)](_0x5df896)??{'datasetCode':_0x19e1a5[_0x5613c3(0x1ad)],'alias':_0x4ce180,'keyChanges':[]};if(_0x10cf9b['datasetCode']!==_0x19e1a5[_0x5613c3(0x1ad)])throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x166)+_0x5df896+_0x5613c3(0x16f));const _0x17b19c=_0x5613c3(0x156)+_0x2fea53+'/'+_0x30fa77+'/'+_0x3e35f6+'/'+_0x1c5013;try{resolveLocalFilePathFromLockKey(_0x5a0503,_0x1849db),resolveLocalFilePathFromLockKey(_0x5a0503,_0x17b19c);}catch(_0xbe3797){throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x1a5)+_0x1849db+'\x22:\x20'+(_0xbe3797 instanceof Error?_0xbe3797[_0x5613c3(0x125)]:String(_0xbe3797)));}_0x10cf9b['keyChanges'][_0x5613c3(0x198)]({'oldLockKey':_0x1849db,'newLockKey':_0x17b19c,'entry':_0x19e1a5}),_0x554b2b[_0x5613c3(0x159)](_0x5df896,_0x10cf9b);}const _0x46b74d=new Set([..._0x554b2b['values']()][_0x5613c3(0x168)](_0x24919c=>_0x24919c['keyChanges'][_0x5613c3(0x1a3)](_0x23cd6e=>_0x23cd6e['oldLockKey']))),_0x2a2322=new Map(),_0x28da3=new Map();for(const [_0x7ccf08,_0x183b26]of _0x554b2b){const _0x24882f=_0x183b26[_0x5613c3(0x143)]??_0x183b26['datasetCode'],_0x348ef4=hookDirectoryIdentity(_0x24882f),_0x92bb3f=_0x2a2322['get'](_0x348ef4);if(_0x92bb3f&&_0x92bb3f!==_0x7ccf08)throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x176)+_0x92bb3f+_0x5613c3(0x18e)+_0x7ccf08+_0x5613c3(0x140)+_0x24882f+_0x5613c3(0x17a));_0x2a2322['set'](_0x348ef4,_0x7ccf08);for(const _0x5b95c3 of _0x183b26['keyChanges']){const _0x9a8a89=_0x28da3[_0x5613c3(0x15e)](_0x5b95c3[_0x5613c3(0x144)]);if(_0x9a8a89&&_0x9a8a89!==_0x5b95c3[_0x5613c3(0x17d)])throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x130)+_0x9a8a89+_0x5613c3(0x18e)+_0x5b95c3[_0x5613c3(0x17d)]+'\x22:\x20both\x20target\x20\x22'+_0x5b95c3[_0x5613c3(0x144)]+_0x5613c3(0x141));if(_0x46b74d[_0x5613c3(0x184)](_0x5b95c3[_0x5613c3(0x144)]))throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x14d)+_0x5b95c3[_0x5613c3(0x17d)]+_0x5613c3(0x11d)+_0x5b95c3[_0x5613c3(0x144)]+_0x5613c3(0x161));_0x28da3[_0x5613c3(0x159)](_0x5b95c3[_0x5613c3(0x144)],_0x5b95c3[_0x5613c3(0x17d)]);}}const _0x4f8ca8=new Map();for(const [_0x56e44b,_0x2a4926]of _0x4f950d){_0x4f8ca8[_0x5613c3(0x159)](hookDirectoryIdentity(_0x2a4926),_0x56e44b);}const _0x38b7dc=[];for(const [_0x4eff6b,_0x4f7a55]of _0x554b2b){const _0x1dc2d2=_0x4f7a55['alias']??_0x4f7a55['datasetCode'],_0x7bbe59=join(_0x5a0503['scriptsRootDir'],_0x5613c3(0x14e),_0x4eff6b),_0x56da17=join(_0x5a0503[_0x5613c3(0x14c)],_0x5613c3(0x14e),_0x1dc2d2),_0x4c61d=await directoryExists(_0x7bbe59),_0x4aff2a=await directoryExists(_0x56da17),_0x343097=_0x4c61d?_0x4aff2a?await sameDirectory(_0x7bbe59,_0x56da17)?_0x5613c3(0x13d):undefined:'move':_0x5613c3(0x16a);if(!_0x343097)throw CliErrors['validation'](_0x5613c3(0x166)+_0x4eff6b+_0x5613c3(0x192)+_0x1dc2d2+_0x5613c3(0x13e));const _0x5c6b22=_0x4f8ca8[_0x5613c3(0x15e)](hookDirectoryIdentity(_0x4eff6b));if(_0x5c6b22&&_0x5c6b22!==_0x4f7a55[_0x5613c3(0x1ad)][_0x5613c3(0x179)]()){const _0x313e27=new Set(_0x4f7a55[_0x5613c3(0x149)][_0x5613c3(0x1a3)](_0x2a7540=>_0x2a7540[_0x5613c3(0x17d)])),_0xcf4dc6=_0x514f1c[_0x5613c3(0x153)](_0x14c373=>_0x14c373['type']==='HOOK'&&_0x14c373[_0x5613c3(0x143)]!=null&&hookDirectoryIdentity(_0x14c373[_0x5613c3(0x143)])===hookDirectoryIdentity(_0x4eff6b)&&!_0x313e27[_0x5613c3(0x184)](_0x14c373[_0x5613c3(0x180)]));if(_0xcf4dc6[_0x5613c3(0x163)]>0x0)throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x166)+_0x4eff6b+_0x5613c3(0x183));}const _0x3fb02d=_0x4f8ca8['get'](hookDirectoryIdentity(_0x1dc2d2));if(_0x3fb02d&&_0x3fb02d!==_0x4f7a55[_0x5613c3(0x1ad)][_0x5613c3(0x179)]())throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x166)+_0x4eff6b+_0x5613c3(0x192)+_0x1dc2d2+_0x5613c3(0x129));for(const _0x50b89a of _0x4f7a55[_0x5613c3(0x149)]){const _0x4f40fb=_0x1a5360[_0x5613c3(0x17c)][_0x50b89a[_0x5613c3(0x144)]];if(_0x4f40fb&&!_0x46b74d['has'](_0x50b89a[_0x5613c3(0x144)])&&!sameHookIdentity(_0x50b89a[_0x5613c3(0x1af)],_0x4f40fb))throw CliErrors[_0x5613c3(0x186)](_0x5613c3(0x166)+_0x4eff6b+_0x5613c3(0x192)+_0x1dc2d2+_0x5613c3(0x154));}_0x38b7dc[_0x5613c3(0x198)]({'oldDirectory':_0x4eff6b,'newDirectory':_0x1dc2d2,'oldDirectoryPath':_0x7bbe59,'newDirectoryPath':_0x56da17,'mode':_0x343097,'alias':_0x4f7a55[_0x5613c3(0x143)],'keyChanges':_0x4f7a55[_0x5613c3(0x149)]});}const _0x3d2c8b={..._0x1a5360['functions']},_0x15a2e5=new Map(),_0xf5438c=new Map();for(const _0x100727 of _0x38b7dc){const _0x594280=_0x100727['mode']!=='rekey';_0x594280&&_0xf5438c[_0x5613c3(0x159)](hookDirectoryIdentity(_0x100727[_0x5613c3(0x11a)]),_0x100727[_0x5613c3(0x18a)]);for(const _0x551105 of _0x100727[_0x5613c3(0x149)]){const _0x1d5800=_0x3d2c8b[_0x551105[_0x5613c3(0x144)]],_0x3e7bf2=_0x594280?_0x551105[_0x5613c3(0x1af)]:_0x1d5800??_0x551105['entry'];_0x3d2c8b[_0x551105[_0x5613c3(0x144)]]=canonicalizeHookEntry(_0x3e7bf2,_0x100727[_0x5613c3(0x143)]),delete _0x3d2c8b[_0x551105[_0x5613c3(0x17d)]],_0x594280&&_0x15a2e5[_0x5613c3(0x159)](_0x551105[_0x5613c3(0x144)],resolveLocalFilePathFromLockKey(_0x5a0503,_0x551105['oldLockKey']));}}return{'migrations':_0x38b7dc,'projectedFunctions':_0x3d2c8b,'sourceFilePathByNewLockKey':_0x15a2e5,'sourceDirectoryPathByNewDirectory':_0xf5438c};}function resolveMigratedSourceFilePath(_0x47c175,_0x4a7f4f){const _0x283d23=a43_0x39c143;if(!_0x47c175||!_0x4a7f4f)return undefined;const _0x3e4f9a=_0x47c175[_0x283d23(0x19d)][_0x283d23(0x15e)](_0x4a7f4f[_0x283d23(0x180)]);if(_0x3e4f9a)return _0x3e4f9a;if(_0x4a7f4f['type']!==_0x283d23(0x14e))return undefined;const [,_0xef5c6c,..._0x40db01]=_0x4a7f4f[_0x283d23(0x180)]['split']('/');if(!_0xef5c6c||_0x40db01[_0x283d23(0x163)]===0x0)return undefined;const _0x1c8e54=_0x47c175['sourceDirectoryPathByNewDirectory'][_0x283d23(0x15e)](hookDirectoryIdentity(_0xef5c6c));return _0x1c8e54?join(_0x1c8e54,..._0x40db01)+_0x283d23(0x199):undefined;}function sameHookIdentity(_0xb81684,_0x4f0d3d){const _0xf2d236=a43_0x39c143;return _0xb81684[_0xf2d236(0x191)]===_0x4f0d3d[_0xf2d236(0x191)]&&_0xb81684['datasetCode']===_0x4f0d3d[_0xf2d236(0x1ad)]&&_0xb81684[_0xf2d236(0x16b)]===_0x4f0d3d[_0xf2d236(0x16b)]&&_0xb81684[_0xf2d236(0x1a4)]===_0x4f0d3d['functionNode'];}function canonicalizeHookEntry(_0x509fbf,_0x14c2c7){const {alias:_0x12d37f,..._0x4c77ff}=_0x509fbf;return _0x14c2c7?{..._0x4c77ff,'alias':_0x14c2c7}:_0x4c77ff;}function hookDirectoryIdentity(_0x458255){const _0x75b125=a43_0x39c143;return _0x458255['normalize']('NFC')[_0x75b125(0x179)]();}function isSafeHookDirectorySegment(_0x1b9dcf){return isSafeLockKeySegment(_0x1b9dcf);}async function sameDirectory(_0x4ba62a,_0x1f4d13){const _0x292111=a43_0x39c143,[_0x1f5d45,_0x988180]=await Promise[_0x292111(0x187)]([stat(_0x4ba62a),stat(_0x1f4d13)]);return _0x1f5d45[_0x292111(0x122)]===_0x988180[_0x292111(0x122)]&&_0x1f5d45[_0x292111(0x152)]===_0x988180[_0x292111(0x152)];}async function applyHookDirectoryMigration(_0x1b7a03,_0x5e02ce){const _0x4392ea=a43_0x39c143,_0x58e5a2=_0x5e02ce[_0x4392ea(0x17c)],_0x1bf617=_0x5e02ce[_0x4392ea(0x1a6)],_0x20d68a=[],_0x3c4d23=async()=>{const _0x5063d5=_0x4392ea,_0xf83419=[];_0x5e02ce['functions']=_0x58e5a2,_0x5e02ce[_0x5063d5(0x1a6)]=_0x1bf617;for(const {migration:_0x50e179,temporaryPath:_0x57153f}of[..._0x20d68a]['reverse']()){try{_0x57153f?(await rename(_0x50e179['newDirectoryPath'],_0x57153f),await rename(_0x57153f,_0x50e179['oldDirectoryPath'])):await rename(_0x50e179[_0x5063d5(0x1a8)],_0x50e179[_0x5063d5(0x18a)]);}catch(_0x55244f){_0xf83419[_0x5063d5(0x198)](new Error(_0x5063d5(0x1a7)+_0x50e179[_0x5063d5(0x174)]+_0x5063d5(0x193)+_0x50e179[_0x5063d5(0x11a)]+'\x22:\x20'+(_0x55244f instanceof Error?_0x55244f['message']:String(_0x55244f))));}}return _0xf83419;};try{for(const _0x5a439f of _0x1b7a03[_0x4392ea(0x15d)]){if(_0x5a439f[_0x4392ea(0x139)]===_0x4392ea(0x195))await ensureParentDirectory(_0x5a439f[_0x4392ea(0x1a8)]),await rename(_0x5a439f[_0x4392ea(0x18a)],_0x5a439f['newDirectoryPath']),_0x20d68a[_0x4392ea(0x198)]({'migration':_0x5a439f});else{if(_0x5a439f[_0x4392ea(0x139)]===_0x4392ea(0x13d)){const _0x2aca31=join(dirname(_0x5a439f['oldDirectoryPath']),'.hook-directory-migrate-'+randomUUID());await rename(_0x5a439f['oldDirectoryPath'],_0x2aca31);try{await rename(_0x2aca31,_0x5a439f['newDirectoryPath']);}catch(_0x64e464){try{await rename(_0x2aca31,_0x5a439f[_0x4392ea(0x18a)]);}catch(_0x49cee5){throw withRollbackErrors(_0x64e464,_0x4392ea(0x145)+_0x5a439f['oldDirectory']+_0x4392ea(0x192)+_0x5a439f['newDirectory']+_0x4392ea(0x11b)+_0x2aca31+_0x4392ea(0x131),[new Error(_0x4392ea(0x13c)+_0x2aca31+_0x4392ea(0x192)+_0x5a439f[_0x4392ea(0x174)]+'\x22:\x20'+(_0x49cee5 instanceof Error?_0x49cee5[_0x4392ea(0x125)]:String(_0x49cee5)))]);}throw _0x64e464;}_0x20d68a[_0x4392ea(0x198)]({'migration':_0x5a439f,'temporaryPath':_0x2aca31});}}}return _0x5e02ce[_0x4392ea(0x17c)]=_0x1b7a03[_0x4392ea(0x133)],{'rollback':_0x3c4d23};}catch(_0xd503af){const _0x37984b=await _0x3c4d23();throw withRollbackErrors(_0xd503af,_0x4392ea(0x165),_0x37984b);}}async function confirmForce(){const _0x2e80fa=a43_0x39c143,_0xd9044c=createInterface({'input':process[_0x2e80fa(0x142)],'output':process[_0x2e80fa(0x19c)]}),_0x271e08=await new Promise(_0x13fcf6=>{const _0x7e8c09=_0x2e80fa;_0xd9044c[_0x7e8c09(0x171)](_0x7e8c09(0x194),_0x13fcf6);});return _0xd9044c['close'](),['y','yes']['includes'](_0x271e08[_0x2e80fa(0x1ab)]()['toLowerCase']());}