@lovrabet/rabetbase-cli 2.5.8-beta.2 → 2.5.9-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/README.md +6 -6
  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.d.ts +8 -5
  162. package/lib/commands/kb/shared.js +1 -1
  163. package/lib/commands/kb/update.js +1 -1
  164. package/lib/commands/logs/index.js +1 -1
  165. package/lib/commands/menu/asset-update.js +1 -1
  166. package/lib/commands/menu/delete.js +1 -1
  167. package/lib/commands/menu/external-link-create.js +1 -1
  168. package/lib/commands/menu/external-link-update.js +1 -1
  169. package/lib/commands/menu/group-create.js +1 -1
  170. package/lib/commands/menu/group-update.js +1 -1
  171. package/lib/commands/menu/index.js +1 -1
  172. package/lib/commands/menu/list.js +1 -1
  173. package/lib/commands/menu/move.js +1 -1
  174. package/lib/commands/menu/regroup-start.js +1 -1
  175. package/lib/commands/menu/rename.js +1 -1
  176. package/lib/commands/menu/shared/compare-table.js +1 -1
  177. package/lib/commands/menu/shared/delete-plan.js +1 -1
  178. package/lib/commands/menu/shared/facts.js +1 -1
  179. package/lib/commands/menu/shared/index.js +1 -1
  180. package/lib/commands/menu/shared/inquirer.js +1 -1
  181. package/lib/commands/menu/shared/local-pages.js +1 -1
  182. package/lib/commands/menu/shared/logic.js +1 -1
  183. package/lib/commands/menu/shared/mutations.js +1 -1
  184. package/lib/commands/menu/shared/path.js +1 -1
  185. package/lib/commands/menu/shared/service.js +1 -1
  186. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  187. package/lib/commands/menu/shared/sync-core.js +1 -1
  188. package/lib/commands/menu/shared/update-core.js +1 -1
  189. package/lib/commands/menu/shared/valid-url.js +1 -1
  190. package/lib/commands/menu/subapp-assets-status.js +1 -1
  191. package/lib/commands/menu/subapp-assets-update.js +1 -1
  192. package/lib/commands/menu/sync.js +1 -1
  193. package/lib/commands/menu/visibility-update.js +1 -1
  194. package/lib/commands/notification/config-create.js +1 -1
  195. package/lib/commands/notification/config-delete.js +1 -1
  196. package/lib/commands/notification/config-list.js +1 -1
  197. package/lib/commands/notification/config-update.js +1 -1
  198. package/lib/commands/notification/index.js +1 -1
  199. package/lib/commands/notification/shared.js +1 -1
  200. package/lib/commands/ocr/index.js +1 -1
  201. package/lib/commands/page/create.js +1 -1
  202. package/lib/commands/page/custom/detail.js +1 -1
  203. package/lib/commands/page/custom/list.js +1 -1
  204. package/lib/commands/page/custom/publish.js +1 -1
  205. package/lib/commands/page/custom/shared.js +1 -1
  206. package/lib/commands/page/custom/syntax.js +1 -1
  207. package/lib/commands/page/custom/update.js +1 -1
  208. package/lib/commands/page/data-list-status.js +1 -1
  209. package/lib/commands/page/generate-start.js +1 -1
  210. package/lib/commands/page/generate-status.js +1 -1
  211. package/lib/commands/page/index.js +1 -1
  212. package/lib/commands/page/pull.js +1 -1
  213. package/lib/commands/page/push.js +1 -1
  214. package/lib/commands/page/relation-audit.js +1 -1
  215. package/lib/commands/page/restore.js +1 -1
  216. package/lib/commands/page/shared.js +1 -1
  217. package/lib/commands/page/sync.js +1 -1
  218. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  219. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  220. package/lib/commands/project/create/format-elapsed.js +1 -1
  221. package/lib/commands/project/create/main.js +1 -1
  222. package/lib/commands/project/create/materialize-project-template.js +1 -1
  223. package/lib/commands/project/create/project-name.js +1 -1
  224. package/lib/commands/project/create/project-template-archive.js +1 -1
  225. package/lib/commands/project/create/project-template-path.js +1 -1
  226. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  227. package/lib/commands/project/create/use-format-code.js +1 -1
  228. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  229. package/lib/commands/project/domain-routing-sync.js +1 -1
  230. package/lib/commands/project/index.js +1 -1
  231. package/lib/commands/project/upgrade.js +1 -1
  232. package/lib/commands/registry.js +1 -1
  233. package/lib/commands/role/delete.js +1 -1
  234. package/lib/commands/role/detail.js +1 -1
  235. package/lib/commands/role/index.js +1 -1
  236. package/lib/commands/role/list.js +1 -1
  237. package/lib/commands/role/shared.js +1 -1
  238. package/lib/commands/role/update.js +1 -1
  239. package/lib/commands/role/user-add.js +1 -1
  240. package/lib/commands/role/user-remove.js +1 -1
  241. package/lib/commands/role/user-resolve.js +1 -1
  242. package/lib/commands/rule/get.js +1 -1
  243. package/lib/commands/rule/index.js +1 -1
  244. package/lib/commands/rule/list.js +1 -1
  245. package/lib/commands/rule/set.js +1 -1
  246. package/lib/commands/rule/shared.d.ts +5 -3
  247. package/lib/commands/rule/shared.js +1 -1
  248. package/lib/commands/run/index.js +1 -1
  249. package/lib/commands/schema.js +1 -1
  250. package/lib/commands/sql/create.js +1 -1
  251. package/lib/commands/sql/delete.js +1 -1
  252. package/lib/commands/sql/detail.js +1 -1
  253. package/lib/commands/sql/exec.js +1 -1
  254. package/lib/commands/sql/index.js +1 -1
  255. package/lib/commands/sql/list.js +1 -1
  256. package/lib/commands/sql/pull.js +1 -1
  257. package/lib/commands/sql/push.js +1 -1
  258. package/lib/commands/sql/shared.js +1 -1
  259. package/lib/commands/sql/status.js +1 -1
  260. package/lib/commands/sql/validate.js +1 -1
  261. package/lib/commands/task/index.js +1 -1
  262. package/lib/commands/task/status.js +1 -1
  263. package/lib/commands/tenant/index.js +1 -1
  264. package/lib/commands/tenant/members-list.js +1 -1
  265. package/lib/commands/tenant/shared.js +1 -1
  266. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  267. package/lib/commands/user-account/feishu-bind.js +1 -1
  268. package/lib/commands/user-account/index.js +1 -1
  269. package/lib/commands/workspace/add.js +1 -1
  270. package/lib/commands/workspace/index.js +1 -1
  271. package/lib/commands/workspace/remove.js +1 -1
  272. package/lib/config/domain-config.js +1 -1
  273. package/lib/config/project-domain-routing.js +1 -1
  274. package/lib/config/region-config.js +1 -1
  275. package/lib/config/schema.js +1 -1
  276. package/lib/constant/cdn.js +1 -1
  277. package/lib/constant/cli.js +1 -1
  278. package/lib/constant/defaults.js +1 -1
  279. package/lib/constant/domain.js +1 -1
  280. package/lib/constant/env.js +1 -1
  281. package/lib/constant/output.js +1 -1
  282. package/lib/constant/paths.js +1 -1
  283. package/lib/constant/region.js +1 -1
  284. package/lib/constant/risk.js +1 -1
  285. package/lib/constant/routing-profile.js +1 -1
  286. package/lib/context/app-resolver.js +1 -1
  287. package/lib/context/auth-resolver.js +1 -1
  288. package/lib/context/config-loader.js +1 -1
  289. package/lib/context.js +1 -1
  290. package/lib/core/alias-resolver.js +1 -1
  291. package/lib/core/api-client.d.ts +14 -11
  292. package/lib/core/api-client.js +1 -1
  293. package/lib/core/bff/config.js +1 -1
  294. package/lib/core/bff/file-system.js +1 -1
  295. package/lib/core/bff/hash.js +1 -1
  296. package/lib/core/bff/hook-directory.js +1 -1
  297. package/lib/core/bff/lock.js +1 -1
  298. package/lib/core/bff/utils.js +1 -1
  299. package/lib/core/cross-db-analysis.js +1 -1
  300. package/lib/core/cross-db-relation.js +1 -1
  301. package/lib/core/db-resolver.js +1 -1
  302. package/lib/core/flow-config.js +1 -1
  303. package/lib/core/instant-api-policy/config.js +1 -1
  304. package/lib/core/kb-management-client.d.ts +2 -2
  305. package/lib/core/kb-management-client.js +1 -1
  306. package/lib/core/kb-search-client.d.ts +3 -1
  307. package/lib/core/kb-search-client.js +1 -1
  308. package/lib/core/page/file-system.js +1 -1
  309. package/lib/core/page/hash.js +1 -1
  310. package/lib/core/page/lock.js +1 -1
  311. package/lib/core/page/lr-smart-jsx.js +1 -1
  312. package/lib/core/sql-index-auditor.js +1 -1
  313. package/lib/core/sql-sync/config.js +1 -1
  314. package/lib/core/sql-sync/file-system.js +1 -1
  315. package/lib/core/sql-sync/hash.js +1 -1
  316. package/lib/core/sql-sync/lock.js +1 -1
  317. package/lib/core/sql-sync/utils.js +1 -1
  318. package/lib/core/sql-validator.js +1 -1
  319. package/lib/errors.js +1 -1
  320. package/lib/framework/build-all-flags.js +1 -1
  321. package/lib/framework/error-output.js +1 -1
  322. package/lib/framework/explicit-yes.js +1 -1
  323. package/lib/framework/flags.js +1 -1
  324. package/lib/framework/help.js +1 -1
  325. package/lib/framework/index.js +1 -1
  326. package/lib/framework/output.js +1 -1
  327. package/lib/framework/response.js +1 -1
  328. package/lib/framework/runner-alias.js +1 -1
  329. package/lib/framework/runner.js +1 -1
  330. package/lib/framework/schema-export.js +1 -1
  331. package/lib/framework/supported-flags.js +1 -1
  332. package/lib/framework/types.js +1 -1
  333. package/lib/generated/build-info.d.ts +4 -4
  334. package/lib/generated/build-info.js +1 -1
  335. package/lib/generated/official-routing.js +1 -1
  336. package/lib/generated/routing-contract.js +1 -1
  337. package/lib/help.js +1 -1
  338. package/lib/postinstall.js +1 -1
  339. package/lib/runtime/confirmation.js +1 -1
  340. package/lib/runtime/event.js +1 -1
  341. package/lib/runtime/index.js +1 -1
  342. package/lib/runtime/queue.js +1 -1
  343. package/lib/runtime/resolve.js +1 -1
  344. package/lib/services/dataset-design/checkpoint.js +1 -1
  345. package/lib/services/dataset-design/commands.js +1 -1
  346. package/lib/services/dataset-design/contract.js +1 -1
  347. package/lib/skills/builtin-skill.js +1 -1
  348. package/lib/skills/main.js +1 -1
  349. package/lib/skills/npx-skills-add.js +1 -1
  350. package/lib/skills/skill-presence.js +1 -1
  351. package/lib/telemetry/cli-command-trace.js +1 -1
  352. package/lib/telemetry/cli-help-trace.js +1 -1
  353. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  354. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  355. package/lib/telemetry/send-cli-trace-log.js +1 -1
  356. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  357. package/lib/utils/ai_config.js +1 -1
  358. package/lib/utils/apply-jq-filter.js +1 -1
  359. package/lib/utils/cdn-config.js +1 -1
  360. package/lib/utils/check-sdk-version.js +1 -1
  361. package/lib/utils/cli-version-check.js +1 -1
  362. package/lib/utils/cli-version-policy.js +1 -1
  363. package/lib/utils/config.js +1 -1
  364. package/lib/utils/entity-with-id.js +1 -1
  365. package/lib/utils/file-utils.js +1 -1
  366. package/lib/utils/guides-cdn.js +1 -1
  367. package/lib/utils/http-client.js +1 -1
  368. package/lib/utils/is-non-interactive.js +1 -1
  369. package/lib/utils/logger.js +1 -1
  370. package/lib/utils/params.js +1 -1
  371. package/lib/utils/platform.js +1 -1
  372. package/lib/utils/sleep.js +1 -1
  373. package/lib/utils/template-replacer.js +1 -1
  374. package/lib/utils/update-notice.js +1 -1
  375. package/lib/utils/version.js +1 -1
  376. package/lib/utils/with-active-cookie.js +1 -1
  377. package/lib/utils/write-cli-side-channel.js +1 -1
  378. package/package.json +1 -1
  379. package/skills/rabetbase/SKILL.md +1 -1
  380. package/skills/rabetbase/references/rabetbase-kb.md +17 -15
  381. package/skills/rabetbase/references/rabetbase-rule.md +8 -6
  382. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  383. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  384. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
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
+ const a34_0x2611c0=a34_0x388d;(function(_0x2456df,_0xa61770){const _0x44926a=a34_0x388d,_0x11d91b=_0x2456df();while(!![]){try{const _0xd2e669=-parseInt(_0x44926a(0xfb))/0x1*(-parseInt(_0x44926a(0xf9))/0x2)+-parseInt(_0x44926a(0xf5))/0x3*(parseInt(_0x44926a(0x102))/0x4)+parseInt(_0x44926a(0xef))/0x5+-parseInt(_0x44926a(0xf6))/0x6+parseInt(_0x44926a(0x101))/0x7*(-parseInt(_0x44926a(0xfc))/0x8)+-parseInt(_0x44926a(0x104))/0x9*(-parseInt(_0x44926a(0xfd))/0xa)+-parseInt(_0x44926a(0xf1))/0xb;if(_0xd2e669===_0xa61770)break;else _0x11d91b['push'](_0x11d91b['shift']());}catch(_0x1d50f0){_0x11d91b['push'](_0x11d91b['shift']());}}}(a34_0x383c,0x83af2));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';function a34_0x383c(){const _0x24d14e=['update','2950461vgbepW','get','apiError','app-config','appCode','isFinite','4891150WUidZk','file','8200225dsbCHk','\x20app\x20config\x20','set','/smartapi/app-config/update','3WjHKkh','1400286tWmPTP','write','App\x20config\x20server\x20id\x20missing\x20for\x20key=','20jGruoh','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','53043lEUuiv','16ZtOPkP','10Nvpmdd','create','tags','/smartapi/app-config/create','812707lKfaes','344212xBMoEY'];a34_0x383c=function(){return _0x24d14e;};return a34_0x383c();}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';function a34_0x388d(_0x284c1f,_0x35cd44){_0x284c1f=_0x284c1f-0xea;const _0x383c2c=a34_0x383c();let _0x388d22=_0x383c2c[_0x284c1f];return _0x388d22;}const CREATE_PATH=a34_0x2611c0(0x100),UPDATE_PATH=a34_0x2611c0(0xf4);export const appConfigSet={'service':a34_0x2611c0(0xec),'command':a34_0x2611c0(0xf3),'description':a34_0x2611c0(0xfa),'risk':a34_0x2611c0(0xf7),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x2611c0(0xf0),'type':'string','description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x69bd5){readKeyArg(_0x69bd5),readOptionalTags(_0x69bd5),assertSingleValueSource(_0x69bd5);},async 'dryRun'(_0x451642){const _0x5bf512=a34_0x2611c0,_0x44889d=readKeyArg(_0x451642),_0x1e233d=readOptionalTags(_0x451642),_0x5a8e14=assertSingleValueSource(_0x451642);await assertValueSourceReadable(_0x5a8e14);const _0x2775ee=await withAppConfigApiBoundary('get',{'appCode':_0x451642[_0x5bf512(0xed)],'key':_0x44889d},()=>getAppConfigByKey(_0x451642[_0x5bf512(0xed)],_0x44889d)),_0x1b3ede=_0x2775ee?'update':'create',_0x42c3b5=_0x2775ee?projectAppConfig(_0x2775ee):null,_0x553ea6=plannedAppConfig({'appCode':_0x451642[_0x5bf512(0xed)],'key':_0x44889d,'tags':_0x1e233d??_0x2775ee?.[_0x5bf512(0xff)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x1b3ede,'appCode':_0x451642[_0x5bf512(0xed)],'key':_0x44889d,'before':_0x42c3b5,'after':_0x553ea6,'dryRun':!![]}),{'method':'POST','url':_0x1b3ede==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x11638b){const _0x33e2ac=a34_0x2611c0,_0x2e155d=readKeyArg(_0x11638b),_0x148645=readOptionalTags(_0x11638b),_0x25d2d8=await withAppConfigApiBoundary(_0x33e2ac(0xea),{'appCode':_0x11638b[_0x33e2ac(0xed)],'key':_0x2e155d},()=>getAppConfigByKey(_0x11638b[_0x33e2ac(0xed)],_0x2e155d)),_0x392ebc=_0x25d2d8?projectAppConfig(_0x25d2d8):null,_0x5eadd9=_0x25d2d8?_0x33e2ac(0x103):_0x33e2ac(0xfe),{value:_0x2a1350,warnings:_0x5d6462}=await readAppConfigValue(_0x11638b),_0x2b7a04={'appCode':_0x11638b[_0x33e2ac(0xed)],'key':_0x2e155d,'value':_0x2a1350,'tags':_0x148645??_0x25d2d8?.[_0x33e2ac(0xff)]??undefined};await withAppConfigApiBoundary(_0x5eadd9,{'appCode':_0x11638b['appCode'],'key':_0x2e155d},async()=>{const _0x4bbaa0=_0x33e2ac;_0x25d2d8?await updateAppConfig({..._0x2b7a04,'id':requireAppConfigId(_0x25d2d8,_0x2e155d,_0x11638b[_0x4bbaa0(0xed)])}):await createAppConfig(_0x2b7a04);});const _0x255d4d=await withAppConfigApiBoundary(_0x33e2ac(0xea),{'appCode':_0x11638b[_0x33e2ac(0xed)],'key':_0x2e155d},()=>getAppConfigByKey(_0x11638b[_0x33e2ac(0xed)],_0x2e155d)),_0x5a887f=_0x255d4d?projectAppConfig(_0x255d4d):plannedAppConfig({'appCode':_0x11638b[_0x33e2ac(0xed)],'key':_0x2e155d,'tags':_0x2b7a04[_0x33e2ac(0xff)],'hasValue':_0x2a1350!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x5eadd9,'appCode':_0x11638b[_0x33e2ac(0xed)],'key':_0x2e155d,'before':_0x392ebc,'after':_0x5a887f,'dryRun':![],'warnings':_0x5d6462}),'message':(_0x5eadd9===_0x33e2ac(0x103)?'Updated':'Created')+_0x33e2ac(0xf2)+_0x2e155d};}};function requireAppConfigId(_0x13c188,_0xee0fe1,_0x2c79bf){const _0x57fbaa=a34_0x2611c0;if(typeof _0x13c188['id']==='number'&&Number[_0x57fbaa(0xee)](_0x13c188['id'])&&_0x13c188['id']>0x0)return _0x13c188['id'];throw CliErrors[_0x57fbaa(0xeb)](_0x57fbaa(0xf8)+_0xee0fe1+',\x20appCode='+_0x2c79bf);}
@@ -1 +1 @@
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
+ const a35_0x24d2ff=a35_0x53f4;function a35_0x5182(){const _0x215ec0=['bool','data','14034Jgfird','before','Value\x20file\x20is\x20not\x20readable:\x20','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','from-env','validation','dryRun','apiError','args','2065ZLsWtg','gmtModified','4ByEqpZ','Failed\x20to\x20','name','tags','slice','path','hasValue','str','Missing\x20app-config\x20key.','\x20app\x20config.','operation','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','once','Environment\x20variable\x20is\x20not\x20set:\x20','stdin','Runtime\x20app-config\x20key','27366270FEeDyE','utf8','kind','join','key','reveal','warnings','boolean','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','end','1241230EpQJCo','gmtCreate','method','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','883857dmmrau','value\x20is\x20redacted','trim','push','Missing\x20app-config\x20value\x20source.','appCode','1AfQLWD','length','App\x20config\x20value\x20source\x20is\x20ambiguous.','env','1875375nvBuGI','6745688MadvtS','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','649585GHHVXx','defineProperties','file','setEncoding','argument','value','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.'];a35_0x5182=function(){return _0x215ec0;};return a35_0x5182();}(function(_0x516f11,_0x545779){const _0x3b30b2=a35_0x53f4,_0x500c4b=_0x516f11();while(!![]){try{const _0x15cca2=-parseInt(_0x3b30b2(0x134))/0x1*(parseInt(_0x3b30b2(0x12a))/0x2)+parseInt(_0x3b30b2(0x12e))/0x3+parseInt(_0x3b30b2(0x14f))/0x4*(-parseInt(_0x3b30b2(0x13b))/0x5)+parseInt(_0x3b30b2(0x144))/0x6*(-parseInt(_0x3b30b2(0x14d))/0x7)+-parseInt(_0x3b30b2(0x139))/0x8+-parseInt(_0x3b30b2(0x138))/0x9+parseInt(_0x3b30b2(0x15f))/0xa;if(_0x15cca2===_0x545779)break;else _0x500c4b['push'](_0x500c4b['shift']());}catch(_0x1cf26b){_0x500c4b['push'](_0x500c4b['shift']());}}}(a35_0x5182,0x839f3));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x24d2ff(0x124),'description':a35_0x24d2ff(0x15e),'required':!![]};export const VALUE_ARG={'name':'value','description':'Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','required':![]};export const TAGS_FLAG={'name':'tags','type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a35_0x24d2ff(0x15d),'type':a35_0x24d2ff(0x127),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a35_0x24d2ff(0x148),'type':'string','description':a35_0x24d2ff(0x12d)};export const REVEAL_FLAG={'name':a35_0x24d2ff(0x125),'type':'boolean','description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x5c1b9a){const _0x4a6878=a35_0x24d2ff,_0x1126f1=_0x5c1b9a[_0x4a6878(0x14c)][0x0]?.[_0x4a6878(0x130)]()??'';return validateKey(_0x1126f1),_0x1126f1;}export function readOptionalTags(_0x70fdda){const _0x39bac8=a35_0x24d2ff,_0x485344=_0x70fdda[_0x39bac8(0x156)](_0x39bac8(0x152))[_0x39bac8(0x130)]();if(!_0x485344)return undefined;if(_0x485344['length']>0x20)throw CliErrors[_0x39bac8(0x149)](_0x39bac8(0x147));return _0x485344;}function a35_0x53f4(_0x96a97,_0x1d29b7){_0x96a97=_0x96a97-0x124;const _0x518254=a35_0x5182();let _0x53f4cb=_0x518254[_0x96a97];return _0x53f4cb;}export function validateKey(_0x4858bf){const _0x13737b=a35_0x24d2ff;if(!_0x4858bf)throw CliErrors[_0x13737b(0x149)](_0x13737b(0x157));if(_0x4858bf[_0x13737b(0x135)]>0x100)throw CliErrors[_0x13737b(0x149)](_0x13737b(0x15a));}export function projectAppConfig(_0x137ed2,_0x5ac34b){const _0x17eaea=a35_0x24d2ff,_0x7f8887=_0x137ed2['value']!==undefined&&_0x137ed2['value']!==null&&_0x137ed2[_0x17eaea(0x140)]!=='',_0x35a865={'appCode':_0x137ed2['appCode'],'key':_0x137ed2['key'],'tags':_0x137ed2[_0x17eaea(0x152)]??undefined,'hasValue':_0x7f8887,'valueRedacted':_0x7f8887&&!_0x5ac34b?.['reveal'],'gmtCreate':_0x137ed2[_0x17eaea(0x12b)],'gmtModified':_0x137ed2[_0x17eaea(0x14e)]};return _0x5ac34b?.[_0x17eaea(0x125)]&&(_0x35a865['value']=_0x137ed2[_0x17eaea(0x140)]??'',_0x35a865['valueRedacted']=![]),_0x35a865;}export function plannedAppConfig(_0x5ca40e){const _0x43efe5=a35_0x24d2ff,_0x2cf8c1=_0x5ca40e[_0x43efe5(0x155)]??!![];return{'appCode':_0x5ca40e[_0x43efe5(0x133)],'key':_0x5ca40e[_0x43efe5(0x124)],'tags':_0x5ca40e[_0x43efe5(0x152)]??undefined,'hasValue':_0x2cf8c1,'valueRedacted':_0x2cf8c1};}export function buildMutationData(_0x24b1d0){const _0x321d8b=a35_0x24d2ff;return{'operation':_0x24b1d0[_0x321d8b(0x159)],'selector':{'appCode':_0x24b1d0[_0x321d8b(0x133)],'key':_0x24b1d0[_0x321d8b(0x124)]},'before':_0x24b1d0[_0x321d8b(0x145)],'after':_0x24b1d0['after'],'dryRun':_0x24b1d0[_0x321d8b(0x14a)],'warnings':_0x24b1d0[_0x321d8b(0x126)]??[]};}export async function withAppConfigApiBoundary(_0x28cc0d,_0x3b37ff,_0x63039d){const _0x22613e=a35_0x24d2ff;try{return await _0x63039d();}catch{const _0x2d31a1=['appCode:\x20'+_0x3b37ff[_0x22613e(0x133)]];if(_0x3b37ff['key'])_0x2d31a1[_0x22613e(0x131)]('key:\x20'+_0x3b37ff[_0x22613e(0x124)]);_0x2d31a1['push'](_0x22613e(0x12f));throw CliErrors[_0x22613e(0x14b)](_0x22613e(0x150)+_0x28cc0d+_0x22613e(0x158),_0x2d31a1['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x1d4ee8,_0x5a185d){const _0x4969fa=a35_0x24d2ff;return Object[_0x4969fa(0x13c)](_0x1d4ee8,{'method':{'value':_0x5a185d[_0x4969fa(0x12c)],'enumerable':![]},'url':{'value':_0x5a185d['url'],'enumerable':![]}});}export function assertSingleValueSource(_0xc5d64a){const _0x4c9db7=a35_0x24d2ff,_0x3046c5=[];_0xc5d64a['args'][_0x4c9db7(0x135)]>0x1&&_0x3046c5[_0x4c9db7(0x131)]({'kind':_0x4c9db7(0x13f),'value':_0xc5d64a[_0x4c9db7(0x14c)][_0x4c9db7(0x153)](0x1)[_0x4c9db7(0x162)]('\x20')});const _0x4ed009=_0xc5d64a['flag'](_0x4c9db7(0x140));_0x4ed009!==undefined&&_0x4ed009!==null&&_0x3046c5[_0x4c9db7(0x131)]({'kind':'argument','value':String(_0x4ed009)});_0xc5d64a[_0x4c9db7(0x142)](_0x4c9db7(0x15d))&&_0x3046c5['push']({'kind':'stdin'});const _0x30c914=_0xc5d64a['str'](_0x4c9db7(0x148))[_0x4c9db7(0x130)]();_0x30c914&&_0x3046c5['push']({'kind':_0x4c9db7(0x137),'name':_0x30c914});const _0x5d70c6=_0xc5d64a[_0x4c9db7(0x156)](_0x4c9db7(0x13d))[_0x4c9db7(0x130)]();_0x5d70c6&&_0x3046c5[_0x4c9db7(0x131)]({'kind':_0x4c9db7(0x13d),'path':_0x5d70c6});if(_0x3046c5[_0x4c9db7(0x135)]===0x0)throw CliErrors['validation'](_0x4c9db7(0x132),_0x4c9db7(0x128));if(_0x3046c5['length']>0x1)throw CliErrors[_0x4c9db7(0x149)](_0x4c9db7(0x136),_0x4c9db7(0x141));return _0x3046c5[0x0];}export async function assertValueSourceReadable(_0xdc37ae){const _0xee3ffc=a35_0x24d2ff;if(_0xdc37ae[_0xee3ffc(0x161)]===_0xee3ffc(0x137)&&!(_0xdc37ae['name']in process.env))throw CliErrors[_0xee3ffc(0x149)](_0xee3ffc(0x15c)+_0xdc37ae[_0xee3ffc(0x151)]);if(_0xdc37ae['kind']===_0xee3ffc(0x13d))try{await access(_0xdc37ae['path']);}catch{throw CliErrors['validation'](_0xee3ffc(0x146)+_0xdc37ae[_0xee3ffc(0x154)]);}}export async function readAppConfigValue(_0x4e1e41){const _0x17fea5=a35_0x24d2ff,_0x800db6=assertSingleValueSource(_0x4e1e41),_0x101072=[];if(_0x800db6[_0x17fea5(0x161)]===_0x17fea5(0x13f))return _0x101072[_0x17fea5(0x131)](_0x17fea5(0x13a)),{'value':_0x800db6['value']??'','source':_0x800db6['kind'],'warnings':_0x101072};if(_0x800db6[_0x17fea5(0x161)]==='stdin')return{'value':await readStdin(),'source':_0x800db6[_0x17fea5(0x161)],'warnings':_0x101072};if(_0x800db6[_0x17fea5(0x161)]===_0x17fea5(0x137)){if(!(_0x800db6[_0x17fea5(0x151)]in process.env))throw CliErrors['validation'](_0x17fea5(0x15c)+_0x800db6[_0x17fea5(0x151)]);return{'value':process.env[_0x800db6.name]??'','source':_0x800db6[_0x17fea5(0x161)],'warnings':_0x101072};}return{'value':await readFile(_0x800db6[_0x17fea5(0x154)],'utf8'),'source':_0x800db6[_0x17fea5(0x161)],'warnings':_0x101072};}function readStdin(){return new Promise((_0x5644ae,_0x1c8627)=>{const _0x3d0969=a35_0x53f4;let _0x85342d='';process['stdin'][_0x3d0969(0x13e)](_0x3d0969(0x160)),process[_0x3d0969(0x15d)]['on'](_0x3d0969(0x143),_0x3e252a=>{_0x85342d+=_0x3e252a;}),process[_0x3d0969(0x15d)][_0x3d0969(0x15b)](_0x3d0969(0x129),()=>_0x5644ae(_0x85342d)),process[_0x3d0969(0x15d)][_0x3d0969(0x15b)]('error',_0x1c8627);});}
@@ -1 +1 @@
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
+ function a36_0x4bab(_0x525533,_0x258cd7){_0x525533=_0x525533-0x191;const _0x37c7b7=a36_0x37c7();let _0x4bab4e=_0x37c7b7[_0x525533];return _0x4bab4e;}const a36_0x48a919=a36_0x4bab;(function(_0x6a44e4,_0x55a832){const _0x4ffa37=a36_0x4bab,_0x398cab=_0x6a44e4();while(!![]){try{const _0x375ade=parseInt(_0x4ffa37(0x1a3))/0x1+-parseInt(_0x4ffa37(0x1a4))/0x2*(-parseInt(_0x4ffa37(0x1a5))/0x3)+-parseInt(_0x4ffa37(0x194))/0x4*(parseInt(_0x4ffa37(0x1a0))/0x5)+-parseInt(_0x4ffa37(0x19e))/0x6+-parseInt(_0x4ffa37(0x1a8))/0x7*(-parseInt(_0x4ffa37(0x19d))/0x8)+-parseInt(_0x4ffa37(0x199))/0x9+parseInt(_0x4ffa37(0x1a1))/0xa*(parseInt(_0x4ffa37(0x197))/0xb);if(_0x375ade===_0x55a832)break;else _0x398cab['push'](_0x398cab['shift']());}catch(_0x2f4dec){_0x398cab['push'](_0x398cab['shift']());}}}(a36_0x37c7,0x36479));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x37c7(){const _0x154ab9=['nonInteractive','367449ioeVbo','2oIodnz','320007GfEkhw','write','bool','7EawMKs','✓\x20Logged\x20out','auth','Login\x20via\x20browser','logout','../../auth/auth-server-ui.js','598540kIXXtI','yes','boolean','33SkOdjL','Clear\x20login\x20session','3401991Bakmaw','login','!\x20Not\x20logged\x20in','log','679264ylEobE','2666364IclCIB','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','5gJylAJ','2117770CJfmAl'];a36_0x37c7=function(){return _0x154ab9;};return a36_0x37c7();}export const authDefinitions=[{'service':'auth','command':a36_0x48a919(0x19a),'description':a36_0x48a919(0x191),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x48a919(0x195),'type':a36_0x48a919(0x196),'description':a36_0x48a919(0x19f),'default':![]}],async 'execute'(_0x2b06a5){const _0x8d0217=a36_0x48a919,{runAuthServer:_0x45aac2}=await import(_0x8d0217(0x193));return await _0x45aac2({'autoYes':_0x2b06a5[_0x8d0217(0x1a7)](_0x8d0217(0x195)),'nonInteractive':_0x2b06a5[_0x8d0217(0x1a2)]}),{'ok':!![]};}},{'service':a36_0x48a919(0x1aa),'command':a36_0x48a919(0x192),'description':a36_0x48a919(0x198),'risk':a36_0x48a919(0x1a6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xa30416){const _0x490268=a36_0x48a919;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x490268(0x19c)](_0x490268(0x1a9))):console[_0x490268(0x19c)](_0x490268(0x19b)),{'ok':!![]};}}];
@@ -1 +1 @@
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
+ const a37_0x324bd7=a37_0x5cd0;(function(_0x485607,_0x217b26){const _0x19c7cd=a37_0x5cd0,_0x2b962a=_0x485607();while(!![]){try{const _0xe57518=parseInt(_0x19c7cd(0x9d))/0x1*(parseInt(_0x19c7cd(0x6d))/0x2)+-parseInt(_0x19c7cd(0x74))/0x3*(-parseInt(_0x19c7cd(0x6f))/0x4)+-parseInt(_0x19c7cd(0x91))/0x5+parseInt(_0x19c7cd(0xc2))/0x6+parseInt(_0x19c7cd(0x68))/0x7*(parseInt(_0x19c7cd(0xb3))/0x8)+-parseInt(_0x19c7cd(0x9f))/0x9+parseInt(_0x19c7cd(0xc5))/0xa*(-parseInt(_0x19c7cd(0x9c))/0xb);if(_0xe57518===_0x217b26)break;else _0x2b962a['push'](_0x2b962a['shift']());}catch(_0x69beca){_0x2b962a['push'](_0x2b962a['shift']());}}}(a37_0xc8ed,0xd4de2));function a37_0x5cd0(_0x30d3c0,_0x454cb7){_0x30d3c0=_0x30d3c0-0x68;const _0xc8ed84=a37_0xc8ed();let _0x5cd0f9=_0xc8ed84[_0x30d3c0];return _0x5cd0f9;}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';function a37_0xc8ed(){const _0x26e4bd=['bff','tableName','entries','Select\x20operation\x20type:','COMMON','\x22,\x20params\x20})\x0a','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','alias','keys','6911920WIlUTA','selectedAppName','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','operationType','currentApp','stderr','.js\x0a','parseInt','name','/data/dataset/','join','4119907ChLHPl','9013cEyxNC','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','4831308ihhhXB','Invalid\x20dataset\x20selection.','str','Script\x20description','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','File\x20already\x20exists:\x20','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','create','apiDir','Select\x20dataset:','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','isInteger','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','No\x20datasets\x20found\x20for\x20this\x20app.','Created\x20','mergedCli','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','profileName','trim','8yjCcKE','appCode','length','.js','当前响应结果','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','ENDPOINT','after','includes','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','nonInteractive','before','code','string','9966516ITbwyZ','source','find','20YMBeLf','type','\x20function:\x20','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','修改后的请求参数','datasetcode','description','\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','修改后的响应结果','\x22\x20not\x20found\x20for\x20dataset\x20','No\x20model\x20aliases\x20found.\x20Run\x20`','functionNode','write','3455221DPvBcG','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','function-node','HOOK','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','74cppZrD','\x22.\x20','2104012fRTred','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','scriptsRootDir','\x20api\x20pull`\x20to\x20refresh.','Operation\x20type\x20(HOOK\x20only)','6pHdwqF','Alias\x20\x22','\x0a\x20*\x20[平台配置]\x20','filePath','/COMMON/','/**\x0a\x20*\x20','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','question','datasetCode','Available:\x20','.js\x0a\x20*\x20[触发节点]\x20','map','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','Dataset\x20not\x20found\x20for\x20code\x20\x22','read','operation-type','validation','\x22\x20not\x20found.\x20','UNKNOWN'];a37_0xc8ed=function(){return _0x26e4bd;};return a37_0xc8ed();}import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x324bd7(0x88),'command':a37_0x324bd7(0xa7),'description':a37_0x324bd7(0x81),'risk':a37_0x324bd7(0x83),'flags':[{'name':a37_0x324bd7(0xc6),'type':a37_0x324bd7(0xc1),'required':!![],'enum':[a37_0x324bd7(0x8c),a37_0x324bd7(0xba),a37_0x324bd7(0x6b)],'description':'Script\x20type'},{'name':a37_0x324bd7(0x99),'type':a37_0x324bd7(0xc1),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':'description','type':a37_0x324bd7(0xc1),'description':a37_0x324bd7(0xa2)},{'name':'alias','type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a37_0x324bd7(0xca),'type':'string','description':a37_0x324bd7(0x93)},{'name':a37_0x324bd7(0x84),'type':a37_0x324bd7(0xc1),'description':a37_0x324bd7(0x73)},{'name':a37_0x324bd7(0x6a),'type':a37_0x324bd7(0xc1),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a37_0x324bd7(0xbf),a37_0x324bd7(0xbb)]}],async 'validate'(_0x11c754){const _0x45d794=a37_0x324bd7,_0x2db2d2=_0x11c754[_0x45d794(0xa1)](_0x45d794(0x99));if(!isValidBffFunctionName(_0x2db2d2))throw CliErrors[_0x45d794(0x85)]('Invalid\x20function\x20name\x20\x22'+_0x2db2d2+_0x45d794(0xaa));},async 'execute'(_0x7ffc04){const _0x275b5e=a37_0x324bd7,_0x5bdd03=loadBffProjectConfig(_0x7ffc04[_0x275b5e(0xb4)]),_0x39296=_0x7ffc04[_0x275b5e(0xa1)]('type'),_0x1dc25d=_0x7ffc04['str'](_0x275b5e(0x99)),_0x2d5961=_0x7ffc04[_0x275b5e(0xa1)]('description')||undefined,_0x4040c3=_0x39296==='HOOK'?await resolveHookOptions(_0x5bdd03,_0x7ffc04):undefined,_0x1c9517=buildFilePath(_0x5bdd03,_0x39296,_0x1dc25d,_0x4040c3);if(await fileExists(_0x1c9517))throw CliErrors[_0x275b5e(0x85)](_0x275b5e(0xa4)+_0x1c9517);await mkdir(dirname(_0x1c9517),{'recursive':!![]});const _0xd5e91f=generateTemplate(_0x39296,_0x1dc25d,_0x7ffc04[_0x275b5e(0xb4)],_0x2d5961,_0x4040c3);await writeFile(_0x1c9517,_0xd5e91f,'utf8');const _0x4f79dc={'type':_0x39296,'name':_0x1dc25d,'path':_0x1c9517};if(_0x2d5961)_0x4f79dc[_0x275b5e(0xcb)]=_0x2d5961;if(_0x4040c3){if(_0x4040c3[_0x275b5e(0x8f)])_0x4f79dc[_0x275b5e(0x8f)]=_0x4040c3[_0x275b5e(0x8f)];_0x4f79dc[_0x275b5e(0x7c)]=_0x4040c3[_0x275b5e(0x7c)],_0x4f79dc['operationType']=_0x4040c3[_0x275b5e(0x94)],_0x4f79dc['functionNode']=_0x4040c3[_0x275b5e(0xd0)];}return{'ok':!![],'data':_0x4f79dc,'message':_0x275b5e(0xae)+_0x39296+_0x275b5e(0xc7)+_0x1dc25d};}};async function resolveHookOptions(_0x3ced97,_0x1b1bf5){const _0x4d868e=a37_0x324bd7,_0x402722=resolveApiModelSource(_0x1b1bf5['apiDir'],_0x1b1bf5[_0x4d868e(0xb4)],_0x1b1bf5[_0x4d868e(0x92)]||_0x1b1bf5['mergedCli']?.[_0x4d868e(0x95)]||_0x1b1bf5[_0x4d868e(0xaf)]?.['defaultApp']),_0x5b507f=loadAliasMap(_0x1b1bf5[_0x4d868e(0xa8)],undefined,_0x402722[_0x4d868e(0x77)],_0x402722[_0x4d868e(0xb1)]),_0x2710ae=_0x5b507f['length']>0x0;let _0x5b2f01,_0x3159d6,_0x1b2886;const _0x210ee0=_0x1b1bf5['str'](_0x4d868e(0x8f)),_0x339acf=_0x1b1bf5[_0x4d868e(0xa1)](_0x4d868e(0xca));if(_0x210ee0){const _0xe59f9=resolveAlias(_0x1b1bf5[_0x4d868e(0xa8)],_0x210ee0,undefined,_0x402722[_0x4d868e(0x77)],_0x402722[_0x4d868e(0xb1)]);if(!_0xe59f9){const _0x7fc131=_0x2710ae?'Available\x20aliases:\x20'+_0x5b507f[_0x4d868e(0x7f)](_0x4875c2=>_0x4875c2[_0x4d868e(0x8f)])[_0x4d868e(0x9b)](',\x20'):_0x4d868e(0xcf)+CLI_BIN_NAME+_0x4d868e(0xa5);throw CliErrors[_0x4d868e(0x85)](_0x4d868e(0x75)+_0x210ee0+_0x4d868e(0x86)+_0x7fc131);}_0x5b2f01=_0x210ee0,_0x3159d6=_0xe59f9;}else{if(_0x339acf){_0x3159d6=_0x339acf;const _0x189ddd=_0x5b507f[_0x4d868e(0xc4)](_0x2a4b1c=>_0x2a4b1c[_0x4d868e(0x7c)]===_0x339acf);_0x5b2f01=_0x189ddd?.['alias'];}else{if(_0x1b1bf5[_0x4d868e(0xbe)])throw CliErrors[_0x4d868e(0x85)](_0x4d868e(0xb9));else{if(_0x2710ae){const _0xc0ee5=_0x5b507f['map'](_0x4ff06c=>_0x4ff06c[_0x4d868e(0x8f)]+'\x20('+_0x4ff06c[_0x4d868e(0x89)]+')'),_0x559ac1=await promptSelect(_0x4d868e(0xa9),_0xc0ee5),_0x70c8fe=_0x5b507f[_0x559ac1];if(!_0x70c8fe)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x5b2f01=_0x70c8fe[_0x4d868e(0x8f)],_0x3159d6=_0x70c8fe[_0x4d868e(0x7c)];}else{const _0x1b600a=await listDatasets(_0x1b1bf5['appCode']);if(_0x1b600a[_0x4d868e(0xb5)]===0x0)throw CliErrors['validation'](_0x4d868e(0xad));const _0x1bd13f=_0x1b600a[_0x4d868e(0x7f)](_0x58b468=>_0x58b468[_0x4d868e(0x99)]+'\x20['+(_0x58b468[_0x4d868e(0xc3)]??_0x4d868e(0x87))+']\x20('+_0x58b468['code']+')'),_0x4d3d8c=await promptSelect(_0x4d868e(0xa9),_0x1bd13f),_0x163737=_0x1b600a[_0x4d3d8c];if(!_0x163737)throw CliErrors[_0x4d868e(0x85)](_0x4d868e(0xa0));_0x3159d6=_0x163737[_0x4d868e(0xc0)],_0x5b2f01=undefined;}}}}const _0x450f64=await listDatasets(_0x1b1bf5['appCode']),_0x44c790=_0x450f64['find'](_0x5c31b7=>_0x5c31b7[_0x4d868e(0xc0)]===_0x3159d6);if(!_0x44c790)throw CliErrors[_0x4d868e(0x85)](_0x4d868e(0x82)+_0x3159d6+_0x4d868e(0x6e)+(_0x5b2f01?'The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x4d868e(0x72):''));_0x1b2886=_0x44c790['id'];const _0x2c65c9=_0x5b2f01??_0x3159d6,_0x1572b8=await listBffDatasetOperations(_0x1b1bf5[_0x4d868e(0xb4)],_0x1b2886),_0x59375e=_0x1572b8?Object[_0x4d868e(0x90)](_0x1572b8):[];if(_0x59375e[_0x4d868e(0xb5)]===0x0)throw CliErrors[_0x4d868e(0x85)](_0x4d868e(0x80)+_0x2c65c9+'.');let _0x178a8a;const _0x44194c=_0x1b1bf5['str'](_0x4d868e(0x84));if(_0x44194c){if(!_0x59375e[_0x4d868e(0xbc)](_0x44194c))throw CliErrors[_0x4d868e(0x85)]('Operation\x20type\x20\x22'+_0x44194c+_0x4d868e(0xce)+_0x2c65c9+'.\x20'+(_0x4d868e(0x7d)+_0x59375e['join'](',\x20')));_0x178a8a=_0x44194c;}else{if(_0x1b1bf5[_0x4d868e(0xbe)])throw CliErrors[_0x4d868e(0x85)](_0x4d868e(0xb8));const _0x2a09dd=await promptSelect(_0x4d868e(0x8b),_0x59375e);_0x178a8a=_0x59375e[_0x2a09dd]??_0x59375e[0x0];}let _0x4d4b9e=normalizeHookFunctionNode(_0x1b1bf5[_0x4d868e(0xa1)]('function-node'));if(!_0x4d4b9e){if(_0x1b1bf5[_0x4d868e(0xa1)](_0x4d868e(0x6a)))throw CliErrors[_0x4d868e(0x85)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x1b1bf5['nonInteractive'])throw CliErrors[_0x4d868e(0x85)](_0x4d868e(0x8e));const _0x2b08c7=await promptSelect('Select\x20trigger\x20node:',['before',_0x4d868e(0xbb)]);_0x4d4b9e=[_0x4d868e(0xbf),'after'][_0x2b08c7]??_0x4d868e(0xbf);}return{'alias':_0x5b2f01,'datasetCode':_0x3159d6,'datasetId':_0x1b2886,'operationType':_0x178a8a,'functionNode':_0x4d4b9e};}async function promptSelect(_0x5f5c74,_0x1118b1){const _0x4898d3=a37_0x324bd7;if(_0x1118b1[_0x4898d3(0xb5)]===0x1)return 0x0;for(const [_0x1c2a87,_0x8e29f3]of _0x1118b1[_0x4898d3(0x8a)]()){process['stderr'][_0x4898d3(0xd1)]('\x20\x20'+(_0x1c2a87+0x1)+'.\x20'+_0x8e29f3+'\x0a');}const _0x53ae33=createInterface({'input':process['stdin'],'output':process[_0x4898d3(0x96)]});while(!![]){const _0x1f1a7=await new Promise(_0x3da185=>{const _0x471141=_0x4898d3;_0x53ae33[_0x471141(0x7b)](_0x5f5c74+'\x20',_0x3da185);}),_0x250075=Number[_0x4898d3(0x98)](_0x1f1a7[_0x4898d3(0xb2)](),0xa);if(Number[_0x4898d3(0xab)](_0x250075)&&_0x250075>=0x1&&_0x250075<=_0x1118b1['length'])return _0x53ae33['close'](),_0x250075-0x1;process['stderr'][_0x4898d3(0xd1)](_0x4898d3(0xc8)+_0x1118b1[_0x4898d3(0xb5)]+'.\x0a');}}function buildFilePath(_0x65fe27,_0x47cebc,_0x3766e5,_0x1ba74b){const _0x85a833=a37_0x324bd7;if(_0x47cebc===_0x85a833(0x6b)){if(!_0x1ba74b)throw CliErrors[_0x85a833(0x85)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x284b1f=_0x1ba74b['alias']??_0x1ba74b[_0x85a833(0x7c)];return join(_0x65fe27[_0x85a833(0x71)],_0x85a833(0x6b),_0x284b1f,_0x1ba74b[_0x85a833(0x94)],_0x1ba74b[_0x85a833(0xd0)],_0x3766e5+'.js');}return join(_0x65fe27[_0x85a833(0x71)],_0x47cebc,_0x3766e5+_0x85a833(0xb6));}export function generateTemplate(_0x3b9e61,_0xee55f,_0x1db0af,_0x4e6f05,_0x157681){const _0x53eb22=a37_0x324bd7,_0x1079f8=_0x4e6f05?.[_0x53eb22(0xb2)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0xb4bd03=getAppBaseUrl(_0x1db0af),_0x1cf2ed=_0x53eb22(0x70);if(_0x3b9e61===_0x53eb22(0x8c))return _0x53eb22(0x79)+_0x1079f8+_0x53eb22(0x9e)+_0xee55f+_0x53eb22(0x76)+_0xb4bd03+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x1db0af+_0x53eb22(0x78)+_0xee55f+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0xee55f+_0x53eb22(0x8d)+_0x1cf2ed+_0x53eb22(0xcc)+_0xee55f+_0x53eb22(0x7a);if(_0x3b9e61===_0x53eb22(0xba))return _0x53eb22(0x79)+_0x1079f8+_0x53eb22(0xa3)+_0xee55f+_0x53eb22(0xb0)+_0x1db0af+'/'+_0xee55f+_0x53eb22(0x76)+_0xb4bd03+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x1db0af+'/ENDPOINT/'+_0xee55f+_0x53eb22(0x97)+_0x1cf2ed+'\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'+_0xee55f+_0x53eb22(0x7a);if(!_0x157681)throw CliErrors['validation'](_0x53eb22(0xbd));const _0x23b199=_0x157681[_0x53eb22(0x8f)]??_0x157681[_0x53eb22(0x7c)],_0x3596f5=_0x157681[_0x53eb22(0xd0)]===_0x53eb22(0xbf)?'当前请求参数':_0x53eb22(0xb7),_0x2fac69=_0x157681[_0x53eb22(0xd0)]===_0x53eb22(0xbf)?_0x53eb22(0xc9):_0x53eb22(0xcd);return _0x53eb22(0x79)+_0x1079f8+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0xee55f+_0x53eb22(0x69)+_0x1db0af+'/'+_0x157681[_0x53eb22(0x7c)]+'/'+_0x157681['operationType']+'\x0a\x20*\x20[平台配置]\x20'+_0xb4bd03+_0x53eb22(0x9a)+_0x157681['datasetId']+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x1db0af+'/HOOK/'+_0x23b199+'/'+_0x157681[_0x53eb22(0x94)]+'/'+_0x157681['functionNode']+'/'+_0xee55f+_0x53eb22(0x7e)+_0x157681[_0x53eb22(0xd0)]+'\x0a'+_0x1cf2ed+_0x53eb22(0xac)+_0x3596f5+_0x53eb22(0x6c)+_0x2fac69+_0x53eb22(0xa6)+_0xee55f+_0x53eb22(0x7a);}
@@ -1 +1 @@
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
+ function a38_0x5bce(_0x47342b,_0x379292){_0x47342b=_0x47342b-0x9c;const _0x4ec0da=a38_0x4ec0();let _0x5bce5f=_0x4ec0da[_0x47342b];return _0x5bce5f;}const a38_0xecce17=a38_0x5bce;(function(_0x7eb291,_0x28d68f){const _0x191056=a38_0x5bce,_0x5804b4=_0x7eb291();while(!![]){try{const _0x438cac=parseInt(_0x191056(0xac))/0x1+-parseInt(_0x191056(0xb8))/0x2*(parseInt(_0x191056(0xc9))/0x3)+-parseInt(_0x191056(0xb6))/0x4*(parseInt(_0x191056(0xb1))/0x5)+-parseInt(_0x191056(0xd0))/0x6*(parseInt(_0x191056(0xc2))/0x7)+-parseInt(_0x191056(0xd1))/0x8+parseInt(_0x191056(0xad))/0x9*(-parseInt(_0x191056(0xa7))/0xa)+parseInt(_0x191056(0xb4))/0xb;if(_0x438cac===_0x28d68f)break;else _0x5804b4['push'](_0x5804b4['shift']());}catch(_0x54b107){_0x5804b4['push'](_0x5804b4['shift']());}}}(a38_0x4ec0,0x6f172));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';function a38_0x4ec0(){const _0x6129eb=['filter','str','Deleted\x20','validation','144179dDOwUg','scriptsRoot','Would\x20delete\x20','high-risk-write','lockFilePath','Local\x20delete\x20not\x20settled\x20for\x20','\x20\x20-\x20','3rhZrGN','No\x20lock\x20entry\x20found\x20for\x20\x22','startsWith','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','POST','remoteId','apps','138DiYitn','3266512svEJAO','lastSync','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','/api/management/library/scripts/delete','bff','map','length','string','includes','Backend\x20Function\x20lock\x20file\x20not\x20found.','trashedTo','<timestamp>','toISOString','1570PvjdjA','keys','delete','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','\x22\x20not\x20found\x20after\x20ensureLockScope.','709248foCJkp','45459ddmdnb','appCode','join','scriptsRootDir','5AqXYcL','projectRoot','Function\x20not\x20found:\x20','31736100RfoBow','trashDir','3391852COrrKS','stringify','1232614UhypMU','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','find','target','replace','functions'];a38_0x4ec0=function(){return _0x6129eb;};return a38_0x4ec0();}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0xecce17(0x9e),'command':a38_0xecce17(0xa9),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a38_0xecce17(0xc5),'flags':[{'name':a38_0xecce17(0xbb),'type':a38_0xecce17(0xa1),'required':!![],'description':a38_0xecce17(0xb9)}],async 'validate'(_0x1f0ecd){const _0x3927fd=a38_0xecce17,_0x416d2a=loadBffProjectConfig(_0x1f0ecd[_0x3927fd(0xae)]),_0x479c71=await readBffLockFile(_0x416d2a[_0x3927fd(0xc6)]);if(!_0x479c71)throw CliErrors[_0x3927fd(0xc1)](_0x3927fd(0x9c));},async 'dryRun'(_0x493cbd){const _0x17f2ea=a38_0xecce17,_0x36a4e5=loadBffProjectConfig(_0x493cbd[_0x17f2ea(0xae)]),_0x2b41e4=await readBffLockFile(_0x36a4e5[_0x17f2ea(0xc6)]);if(!_0x2b41e4)throw CliErrors[_0x17f2ea(0xc1)](_0x17f2ea(0xa3));const {appLock:_0x156d28}=ensureLockScope(_0x2b41e4,_0x493cbd['appCode'],_0x36a4e5[_0x17f2ea(0xc3)],'delete'),_0x3b51e3=_0x493cbd[_0x17f2ea(0xbf)](_0x17f2ea(0xbb)),_0x13be3e=Object[_0x17f2ea(0xa8)](_0x156d28[_0x17f2ea(0xbd)]),_0x18f337=resolveDeleteTarget(_0x3b51e3,_0x13be3e),_0x272446=_0x156d28[_0x17f2ea(0xbd)][_0x18f337];if(!_0x272446)throw CliErrors['validation'](_0x17f2ea(0xca)+_0x18f337+'\x22.');const _0x16c2db=resolveLocalFilePathFromLockKey(_0x36a4e5,_0x18f337),_0x46ea9e=relative(_0x36a4e5[_0x17f2ea(0xb2)],_0x16c2db),_0x2676db=join(_0x36a4e5[_0x17f2ea(0xb5)],_0x17f2ea(0xa5),_0x46ea9e);return{'method':_0x17f2ea(0xcd),'url':_0x17f2ea(0x9d),'body':{'appCode':_0x493cbd[_0x17f2ea(0xae)],'target':_0x18f337,'remoteId':_0x272446[_0x17f2ea(0xce)],'localFilePath':_0x16c2db,'trashedPath':_0x2676db},'description':_0x17f2ea(0xc4)+_0x18f337+_0x17f2ea(0xaa)};},async 'execute'(_0x3082cd){const _0x29bbba=a38_0xecce17,_0x4f5205=loadBffProjectConfig(_0x3082cd['appCode']),_0x546ec1=await readBffLockFile(_0x4f5205[_0x29bbba(0xc6)]);if(!_0x546ec1)throw CliErrors[_0x29bbba(0xc1)](_0x29bbba(0xa3));const {lockData:_0x25ef3d,appLock:_0xf08d35}=ensureLockScope(_0x546ec1,_0x3082cd[_0x29bbba(0xae)],_0x4f5205[_0x29bbba(0xc3)],_0x29bbba(0xa9)),_0x8aaae0=JSON['parse'](JSON[_0x29bbba(0xb7)](_0x25ef3d)),_0x2c2f9a=_0x8aaae0[_0x29bbba(0xcf)][_0x3082cd[_0x29bbba(0xae)]];if(!_0x2c2f9a)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x3082cd[_0x29bbba(0xae)]+_0x29bbba(0xab));const _0x11cf29=_0x3082cd[_0x29bbba(0xbf)](_0x29bbba(0xbb)),_0x4819b8=Object[_0x29bbba(0xa8)](_0x2c2f9a[_0x29bbba(0xbd)]),_0x69c17b=resolveDeleteTarget(_0x11cf29,_0x4819b8),_0x1bde3a=_0x2c2f9a[_0x29bbba(0xbd)][_0x69c17b];if(!_0x1bde3a)throw CliErrors[_0x29bbba(0xc1)](_0x29bbba(0xca)+_0x69c17b+'\x22.');await deleteBffScript(_0x1bde3a[_0x29bbba(0xce)]),delete _0x2c2f9a[_0x29bbba(0xbd)][_0x69c17b],_0x2c2f9a[_0x29bbba(0xd2)]=new Date()['toISOString'](),await writeBffLockFile(_0x4f5205[_0x29bbba(0xc6)],_0x8aaae0);const _0x5535c6=resolveLocalFilePathFromLockKey(_0x4f5205,_0x69c17b);let _0x262923;await fileExists(_0x5535c6)&&(_0x262923=await moveToTrash(_0x4f5205[_0x29bbba(0xb2)],_0x4f5205[_0x29bbba(0xb5)],_0x5535c6),await cleanupEmptyDirectories(dirname(_0x5535c6),_0x4f5205[_0x29bbba(0xb0)]));await waitForDeleteSettlement(_0x4f5205[_0x29bbba(0xc6)],_0x3082cd[_0x29bbba(0xae)],_0x69c17b,_0x5535c6),await sleep(0x96);const _0x2742e4={'deleted':_0x69c17b,'remoteId':_0x1bde3a[_0x29bbba(0xce)]};if(_0x262923)_0x2742e4[_0x29bbba(0xa4)]=_0x262923;return{'ok':!![],'data':_0x2742e4,'message':_0x29bbba(0xc0)+_0x69c17b+(_0x262923?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x1e23cf,_0x1eea49){const _0x18de18=a38_0xecce17;if(_0x1e23cf[_0x18de18(0xa2)]('/')){const _0x1da432=_0x1eea49[_0x18de18(0xba)](_0x378a0f=>_0x378a0f===_0x1e23cf);if(!_0x1da432)throw CliErrors[_0x18de18(0xc1)]('Function\x20not\x20found:\x20'+_0x1e23cf);return _0x1da432;}const _0x37fcd4=_0x1eea49[_0x18de18(0xbe)](_0x2bd9ab=>_0x2bd9ab['split']('/')['at'](-0x1)===_0x1e23cf);if(_0x37fcd4[_0x18de18(0xa0)]===0x0)throw CliErrors[_0x18de18(0xc1)](_0x18de18(0xb3)+_0x1e23cf);if(_0x37fcd4[_0x18de18(0xa0)]>0x1)throw CliErrors[_0x18de18(0xc1)]('Multiple\x20functions\x20match\x20\x22'+_0x1e23cf+_0x18de18(0xcc)+_0x37fcd4[_0x18de18(0x9f)](_0x4567d6=>_0x18de18(0xc8)+_0x4567d6)[_0x18de18(0xaf)]('\x0a'));return _0x37fcd4[0x0];}async function moveToTrash(_0x921059,_0x1a0977,_0x221d8e){const _0x484b39=a38_0xecce17,_0x4584a5=new Date()[_0x484b39(0xa6)]()[_0x484b39(0xbc)](/[:.]/g,'-'),_0x546a27=relative(_0x921059,_0x221d8e),_0x1bef44=join(_0x1a0977,_0x4584a5,_0x546a27);return await mkdir(dirname(_0x1bef44),{'recursive':!![]}),await rename(_0x221d8e,_0x1bef44),_0x1bef44;}async function cleanupEmptyDirectories(_0x4401e4,_0x4e4bf0){const _0x4f3d2e=a38_0xecce17;let _0x38d44f=resolve(_0x4401e4);const _0x27f2e5=resolve(_0x4e4bf0);while(_0x38d44f[_0x4f3d2e(0xcb)](''+_0x27f2e5+sep)||_0x38d44f===_0x27f2e5){if(_0x38d44f===_0x27f2e5)return;try{const _0x23fdf1=await readdir(_0x38d44f);if(_0x23fdf1[_0x4f3d2e(0xa0)]>0x0)return;await rmdir(_0x38d44f);}catch{return;}_0x38d44f=dirname(_0x38d44f);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x259f15,_0x1f6365,_0x38490,_0x2bd754){const _0x4bd248=a38_0xecce17;for(let _0x285d4d=0x0;_0x285d4d<DELETE_SETTLE_RETRY_COUNT;_0x285d4d+=0x1){const _0x116ae0=await readBffLockFile(_0x259f15),_0x106d74=!!_0x116ae0?.[_0x4bd248(0xcf)]?.[_0x1f6365]?.[_0x4bd248(0xbd)]?.[_0x38490],_0x2b04ae=await fileExists(_0x2bd754);if(!_0x106d74&&!_0x2b04ae)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x4bd248(0xc7)+_0x38490+'.');}
@@ -1 +1 @@
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
+ const a39_0x3a7d70=a39_0x45c6;(function(_0x3dd7d3,_0x4910cc){const _0x349ec5=a39_0x45c6,_0x1677a8=_0x3dd7d3();while(!![]){try{const _0x2a42e4=-parseInt(_0x349ec5(0x1c7))/0x1*(-parseInt(_0x349ec5(0x1bf))/0x2)+parseInt(_0x349ec5(0x1bd))/0x3+parseInt(_0x349ec5(0x1ca))/0x4+parseInt(_0x349ec5(0x1c3))/0x5*(-parseInt(_0x349ec5(0x1c1))/0x6)+parseInt(_0x349ec5(0x1b8))/0x7+-parseInt(_0x349ec5(0x1c8))/0x8+-parseInt(_0x349ec5(0x1b5))/0x9;if(_0x2a42e4===_0x4910cc)break;else _0x1677a8['push'](_0x1677a8['shift']());}catch(_0x367599){_0x1677a8['push'](_0x1677a8['shift']());}}}(a39_0x2aee,0x7fa3b));function a39_0x45c6(_0x3d3ff3,_0x1b53e7){_0x3d3ff3=_0x3d3ff3-0x1b5;const _0x2aee06=a39_0x2aee();let _0x45c618=_0x2aee06[_0x3d3ff3];return _0x45c618;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x3a7d70(0x1cd),'command':a39_0x3a7d70(0x1c2),'description':a39_0x3a7d70(0x1c0),'risk':a39_0x3a7d70(0x1c5),'flags':[{'name':'id','type':'number','required':!![],'description':a39_0x3a7d70(0x1cc)},{'name':a39_0x3a7d70(0x1b7),'type':'boolean','description':a39_0x3a7d70(0x1ba)}],async 'execute'(_0x16fc2d){const _0x8a52e2=a39_0x3a7d70,_0x5e171d=await getBffScriptInfo(_0x16fc2d[_0x8a52e2(0x1b6)]('id')),_0x205c3a=_0x16fc2d[_0x8a52e2(0x1cb)](_0x8a52e2(0x1b7));if(_0x205c3a)return{'ok':!![],'data':_0x5e171d};return{'ok':!![],'data':{'id':_0x5e171d['id'],'functionName':_0x5e171d[_0x8a52e2(0x1bc)]??'','version':_0x5e171d['version']??'','updateUserName':_0x5e171d[_0x8a52e2(0x1c6)]??'','appCode':_0x5e171d[_0x8a52e2(0x1b9)],'scriptType':_0x5e171d['scriptType'],'description':_0x5e171d[_0x8a52e2(0x1be)]||'(none)','createdTime':_0x5e171d[_0x8a52e2(0x1bb)]??'','updatedTime':_0x5e171d[_0x8a52e2(0x1c9)]??'','scriptContent':_0x5e171d[_0x8a52e2(0x1c4)]??''}};}};function a39_0x2aee(){const _0x528740=['bff','11817486GXgygn','num','verbose','3038392KgcuXL','appCode','Return\x20full\x20raw\x20script\x20object','createdTime','functionName','2008896hyxHVH','description','14564MhHVuJ','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','6ohVjIs','detail','3785645kWbsdE','scriptContent','read','updateUserName','92HWXgSe','986568eghDhj','updatedTime','3770732qLmCzE','bool','Script\x20ID'];a39_0x2aee=function(){return _0x528740;};return a39_0x2aee();}
@@ -1 +1 @@
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
+ (function(_0x18f738,_0x52daea){const _0x4e20e3=a40_0x3e74,_0x3ce2d6=_0x18f738();while(!![]){try{const _0x5d8da2=-parseInt(_0x4e20e3(0x11b))/0x1+parseInt(_0x4e20e3(0x11a))/0x2+parseInt(_0x4e20e3(0x11c))/0x3+parseInt(_0x4e20e3(0x118))/0x4*(parseInt(_0x4e20e3(0x117))/0x5)+-parseInt(_0x4e20e3(0x115))/0x6+-parseInt(_0x4e20e3(0x116))/0x7+parseInt(_0x4e20e3(0x11d))/0x8*(-parseInt(_0x4e20e3(0x119))/0x9);if(_0x5d8da2===_0x52daea)break;else _0x3ce2d6['push'](_0x3ce2d6['shift']());}catch(_0x473468){_0x3ce2d6['push'](_0x3ce2d6['shift']());}}}(a40_0x50f6,0x7fe36));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a40_0x3e74(_0x4b1ab4,_0x129e4a){_0x4b1ab4=_0x4b1ab4-0x115;const _0x50f654=a40_0x50f6();let _0x3e742d=_0x50f654[_0x4b1ab4];return _0x3e742d;}function a40_0x50f6(){const _0x1604bb=['20JGRmKE','870204AtmTLR','3321405nDmtPJ','2065984GiRjuW','304794qnNeoj','817422zgzXnY','24nrlYWT','812256HdyKqZ','731745giqTXs'];a40_0x50f6=function(){return _0x1604bb;};return a40_0x50f6();}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 +1 @@
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
+ const a41_0x357145=a41_0x2111;function a41_0x5ada(){const _0x36c619=['name','2007126IrblNL','string','List\x20Backend\x20Function\x20scripts','4398952ZBscsQ','verbose','7GCBUaA','(unnamed)','381735yHTmPA','bool','618242mJRmkK','No\x20Backend\x20Function\x20scripts\x20found.','858890WkZXyE','description','184860NDAeNW','str','map','boolean','Script\x20type\x20filter','COMMON','ENDPOINT','455073TDEkJk','appCode','12IYkEOD','3vulJaI','functionName','read','bff','scriptType','type','length'];a41_0x5ada=function(){return _0x36c619;};return a41_0x5ada();}function a41_0x2111(_0x9477bf,_0x147dc4){_0x9477bf=_0x9477bf-0x17c;const _0x5ada0f=a41_0x5ada();let _0x2111aa=_0x5ada0f[_0x9477bf];return _0x2111aa;}(function(_0x163919,_0x401d3f){const _0x5f2b7c=a41_0x2111,_0x1138e9=_0x163919();while(!![]){try{const _0x32b02e=parseInt(_0x5f2b7c(0x194))/0x1+parseInt(_0x5f2b7c(0x189))/0x2*(-parseInt(_0x5f2b7c(0x197))/0x3)+parseInt(_0x5f2b7c(0x196))/0x4*(-parseInt(_0x5f2b7c(0x18b))/0x5)+parseInt(_0x5f2b7c(0x180))/0x6+-parseInt(_0x5f2b7c(0x185))/0x7*(-parseInt(_0x5f2b7c(0x183))/0x8)+-parseInt(_0x5f2b7c(0x187))/0x9+-parseInt(_0x5f2b7c(0x18d))/0xa;if(_0x32b02e===_0x401d3f)break;else _0x1138e9['push'](_0x1138e9['shift']());}catch(_0x47b86e){_0x1138e9['push'](_0x1138e9['shift']());}}}(a41_0x5ada,0x6eddb));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x357145(0x19a),'command':'list','description':a41_0x357145(0x182),'risk':a41_0x357145(0x199),'flags':[{'name':'type','type':a41_0x357145(0x181),'description':a41_0x357145(0x191),'default':a41_0x357145(0x193),'enum':['ENDPOINT',a41_0x357145(0x192)]},{'name':'name','type':a41_0x357145(0x181),'description':'Filter\x20by\x20script\x20name'},{'name':a41_0x357145(0x184),'type':a41_0x357145(0x190),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x539e76){const _0x4fce2f=a41_0x357145,_0x1a1a65=await listBffScripts(_0x539e76[_0x4fce2f(0x195)],_0x539e76[_0x4fce2f(0x18e)](_0x4fce2f(0x17d)),{'scriptName':_0x539e76[_0x4fce2f(0x18e)](_0x4fce2f(0x17f))||undefined}),_0x6eaba8=_0x539e76[_0x4fce2f(0x188)](_0x4fce2f(0x184));return{'ok':!![],'data':_0x6eaba8?_0x1a1a65:_0x1a1a65[_0x4fce2f(0x18f)](_0x3ef48d=>({'id':_0x3ef48d['id'],'functionName':_0x3ef48d[_0x4fce2f(0x198)]??'','description':_0x3ef48d[_0x4fce2f(0x18c)]||_0x4fce2f(0x186),'scriptType':_0x3ef48d[_0x4fce2f(0x17c)]})),'message':_0x1a1a65[_0x4fce2f(0x17e)]===0x0?_0x4fce2f(0x18a):undefined};}};
@@ -1 +1 @@
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
+ const a42_0x441101=a42_0x5474;(function(_0x28dbbd,_0x4ca1cc){const _0x5ac382=a42_0x5474,_0x4dfa57=_0x28dbbd();while(!![]){try{const _0x1a8f46=-parseInt(_0x5ac382(0x10b))/0x1+parseInt(_0x5ac382(0xe4))/0x2+parseInt(_0x5ac382(0xf2))/0x3+-parseInt(_0x5ac382(0xeb))/0x4*(parseInt(_0x5ac382(0xfa))/0x5)+parseInt(_0x5ac382(0x10c))/0x6*(parseInt(_0x5ac382(0xfd))/0x7)+parseInt(_0x5ac382(0xf7))/0x8*(-parseInt(_0x5ac382(0x104))/0x9)+parseInt(_0x5ac382(0xe1))/0xa*(parseInt(_0x5ac382(0xf4))/0xb);if(_0x1a8f46===_0x4ca1cc)break;else _0x4dfa57['push'](_0x4dfa57['shift']());}catch(_0x322fc2){_0x4dfa57['push'](_0x4dfa57['shift']());}}}(a42_0x49b3,0x22df5));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';function a42_0x5474(_0x887889,_0x33dfc4){_0x887889=_0x887889-0xdf;const _0x49b337=a42_0x49b3();let _0x54743d=_0x49b337[_0x887889];return _0x54743d;}import{CliErrors}from'../../errors.js';function a42_0x49b3(){const _0x19e0ec=['\x20must\x20be\x20a\x20positive\x20integer.','14ImdCYt','ERROR','--start-time','start-time','--end-time','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','3573anjrzJ','end-time','WARN','validation','isSafeInteger','--limit','--limit\x20must\x20be\x20between\x201\x20and\x20','118736kIobFt','195828oJamHE','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','Found\x20','2068180lZmlnv','string','num','78926jjsksG','read','appCode','limit','since','--since','str','428gYFbXz','level','flag','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','number','trim','Filter\x20by\x20log\x20level','533538aYxpLF','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','11YdanZc','length','now','2064FKsoMK','toUpperCase','logs','5860ImjdKJ','Maximum\x20log\x20lines\x20to\x20return\x20(1-'];a42_0x49b3=function(){return _0x19e0ec;};return a42_0x49b3();}const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=['DEBUG','INFO',a42_0x441101(0x106),a42_0x441101(0xfe)];export function resolveBffLogQuery(_0xa2118c,_0x5ea7b3=Date[a42_0x441101(0xf6)]()){const _0xdb4df7=a42_0x441101,_0x4d6bf=_0xa2118c['flag'](_0xdb4df7(0xe8)),_0x5d5d23=_0xa2118c['flag'](_0xdb4df7(0x100)),_0x4ecae1=_0xa2118c[_0xdb4df7(0xed)]('end-time');if(_0x4d6bf!==undefined&&_0x5d5d23!==undefined)throw CliErrors[_0xdb4df7(0x107)](_0xdb4df7(0x102));const _0x54dd22=_0x4ecae1===undefined?_0x5ea7b3:readPositiveInteger(_0xa2118c[_0xdb4df7(0xe3)](_0xdb4df7(0x105)),_0xdb4df7(0x101)),_0xdaf653=_0x5d5d23===undefined?_0x54dd22-readSinceMinutes(_0xa2118c)*0xea60:readPositiveInteger(_0xa2118c[_0xdb4df7(0xe3)]('start-time'),_0xdb4df7(0xff));if(_0xdaf653<=0x0)throw CliErrors[_0xdb4df7(0x107)](_0xdb4df7(0x10d));if(_0xdaf653>_0x54dd22)throw CliErrors[_0xdb4df7(0x107)](_0xdb4df7(0xee));const _0x23b539=readPositiveInteger(_0xa2118c[_0xdb4df7(0xe3)](_0xdb4df7(0xe7),DEFAULT_LIMIT),_0xdb4df7(0x109));if(_0x23b539>MAX_LIMIT)throw CliErrors[_0xdb4df7(0x107)](_0xdb4df7(0x10a)+MAX_LIMIT+'.');const _0x20e485=_0xa2118c['str'](_0xdb4df7(0xec))[_0xdb4df7(0xf0)]()[_0xdb4df7(0xf8)]()||undefined,_0x2eaee9=_0xa2118c[_0xdb4df7(0xea)]('keyword')[_0xdb4df7(0xf0)]()||undefined;return{'appCode':_0xa2118c[_0xdb4df7(0xe6)],'startTime':_0xdaf653,'endTime':_0x54dd22,..._0x5d5d23===undefined?{'sinceMinutes':readSinceMinutes(_0xa2118c)}:{},..._0x20e485?{'level':_0x20e485}:{},..._0x2eaee9?{'keyword':_0x2eaee9}:{},'limit':_0x23b539};}function readSinceMinutes(_0x3d014e){const _0x9ffc9=a42_0x441101;return readPositiveInteger(_0x3d014e[_0x9ffc9(0xe3)]('since',DEFAULT_SINCE_MINUTES),_0x9ffc9(0xe9));}function readPositiveInteger(_0x68ec31,_0x255da2){const _0x111ff=a42_0x441101;if(!Number[_0x111ff(0x108)](_0x68ec31)||_0x68ec31<=0x0)throw CliErrors[_0x111ff(0x107)](_0x255da2+_0x111ff(0xfc));return _0x68ec31;}export const bffLogs={'service':'bff','command':a42_0x441101(0xf9),'description':a42_0x441101(0xdf),'risk':a42_0x441101(0xe5),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x441101(0xe8),'type':'number','description':a42_0x441101(0xf3)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x441101(0x100),'type':'number','description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':a42_0x441101(0x105),'type':a42_0x441101(0xef),'description':'Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)'},{'name':a42_0x441101(0xec),'type':a42_0x441101(0xe2),'description':a42_0x441101(0xf1),'enum':LOG_LEVELS},{'name':'keyword','type':a42_0x441101(0xe2),'description':'Filter\x20formatted\x20log\x20lines\x20by\x20keyword'},{'name':a42_0x441101(0xe7),'type':'number','description':a42_0x441101(0xfb)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x4180b3){resolveBffLogQuery(_0x4180b3);},async 'execute'(_0x3ff1ac){const _0x2f7bcd=a42_0x441101,_0x2ec458=resolveBffLogQuery(_0x3ff1ac),{sinceMinutes:_0x39da72,..._0x4ecde0}=_0x2ec458,_0x42d108=await searchBffScriptLogs(_0x4ecde0);return{'ok':!![],'data':{'query':_0x2ec458,'count':_0x42d108[_0x2f7bcd(0xf5)],'logs':_0x42d108},'message':_0x42d108[_0x2f7bcd(0xf5)]===0x0?_0x2f7bcd(0x103):_0x2f7bcd(0xe0)+_0x42d108[_0x2f7bcd(0xf5)]+'\x20Backend\x20Function\x20log\x20line(s).'};}};
@@ -1 +1 @@
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']());}
1
+ const a43_0xe89db0=a43_0x57e6;(function(_0x162101,_0x11682c){const _0x1b574f=a43_0x57e6,_0x421080=_0x162101();while(!![]){try{const _0x5b7c16=parseInt(_0x1b574f(0x1d4))/0x1*(-parseInt(_0x1b574f(0x210))/0x2)+parseInt(_0x1b574f(0x1c4))/0x3+parseInt(_0x1b574f(0x1ee))/0x4+-parseInt(_0x1b574f(0x1b1))/0x5+parseInt(_0x1b574f(0x1e4))/0x6*(-parseInt(_0x1b574f(0x1cb))/0x7)+parseInt(_0x1b574f(0x1af))/0x8+parseInt(_0x1b574f(0x1f6))/0x9;if(_0x5b7c16===_0x11682c)break;else _0x421080['push'](_0x421080['shift']());}catch(_0x44916e){_0x421080['push'](_0x421080['shift']());}}}(a43_0x313f,0x8e8a4));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_0xe89db0(0x1f1),'command':a43_0xe89db0(0x1f4),'description':a43_0xe89db0(0x200),'risk':a43_0xe89db0(0x1c1),'structuredErrors':!![],'flags':[{'name':'type','type':a43_0xe89db0(0x224),'description':a43_0xe89db0(0x19b),'enum':[a43_0xe89db0(0x193),a43_0xe89db0(0x1da),a43_0xe89db0(0x19d)]},{'name':a43_0xe89db0(0x1dc),'type':a43_0xe89db0(0x1b7),'description':a43_0xe89db0(0x1e3)}],async 'dryRun'(_0x42fc99){const _0x332181=a43_0xe89db0,_0x46aba7=loadBffProjectConfig(_0x42fc99[_0x332181(0x1ed)]),_0x15f146=await readBffLockFile(_0x46aba7['lockFilePath']),{appLock:_0x14c1f3}=ensureLockScope(_0x15f146??createEmptyBffLock(),_0x42fc99[_0x332181(0x1ed)],_0x46aba7[_0x332181(0x1fe)],_0x332181(0x1f4)),_0x496931=normalizeBffType(_0x42fc99['str']('type'))??undefined,[_0xb6c698,_0x247f21]=await Promise['all']([listBffScripts(_0x42fc99[_0x332181(0x1ed)],_0x496931),getBffScriptStatistics(_0x42fc99[_0x332181(0x1ed)])]),_0x26581e=_0xb6c698[_0x332181(0x20c)](_0x48dc4b=>normalizeBffType(_0x48dc4b[_0x332181(0x1f8)])===_0x332181(0x19d)),_0x4f86e8=_0x26581e?buildDatasetCodeToAliasMap(_0x42fc99[_0x332181(0x1cc)],_0x42fc99['appCode'],_0x42fc99[_0x332181(0x1bc)]||_0x42fc99[_0x332181(0x221)]?.[_0x332181(0x21d)]||_0x42fc99['mergedCli']?.[_0x332181(0x1db)]):new Map(),_0x55f3e3=_0x26581e?await planHookDirectoryMigration(_0x46aba7,_0x14c1f3,_0x4f86e8,await scanLocalBffFunctions(_0x46aba7,_0x332181(0x19d))):undefined,_0x443dfb=createHookLocationMap(_0x247f21),_0x4ebf1f=[];for(const _0x50aa7f of _0xb6c698){const _0x5ca24e=resolveRemoteScriptTarget(_0x46aba7,_0x50aa7f,_0x443dfb,_0x55f3e3?.[_0x332181(0x1fa)]??_0x14c1f3[_0x332181(0x1bf)],_0x4f86e8);if(!_0x5ca24e){_0x4ebf1f[_0x332181(0x1d6)]({'scriptType':_0x50aa7f[_0x332181(0x1f8)],'functionName':_0x50aa7f[_0x332181(0x1c6)]??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x5ecc10=(_0x55f3e3?.[_0x332181(0x1fa)]??_0x14c1f3[_0x332181(0x1bf)])[_0x5ca24e['lockKey']],_0x30bcfa=_0x50aa7f['scriptContent']!=null?computeContentHash(_0x50aa7f['scriptContent']):undefined,_0x2d2502=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x55f3e3,_0x5ca24e)??_0x5ca24e[_0x332181(0x1d3)],_0x5ecc10,_0x30bcfa),_0x59091b=_0x2d2502?localUnsyncedConflict(_0x5ca24e,_0x50aa7f['id']):undefined;_0x4ebf1f[_0x332181(0x1d6)]({'lockKey':_0x5ca24e[_0x332181(0x202)],'filePath':_0x5ca24e['filePath'],'remoteId':_0x50aa7f['id']??null,'status':_0x59091b?_0x332181(0x209):_0x332181(0x1f5),..._0x59091b?{'conflict':_0x59091b}:{},..._0x5ca24e[_0x332181(0x197)]?{'alias':_0x5ca24e['hookLocation'][_0x332181(0x213)]??null,'datasetCode':_0x5ca24e[_0x332181(0x197)][_0x332181(0x1d1)],'operationType':_0x5ca24e['hookLocation'][_0x332181(0x21e)],'functionNode':_0x5ca24e[_0x332181(0x197)][_0x332181(0x1ba)]}:{}});}return{'method':'GET','url':'/api/management/library/scripts/list?appCode='+_0x42fc99[_0x332181(0x1ed)]+(_0x496931?'&type='+_0x496931:'')+'&currentPage=1&pageSize='+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x42fc99[_0x332181(0x1ed)],'filterType':_0x496931??null,..._0x55f3e3&&_0x55f3e3[_0x332181(0x21a)][_0x332181(0x1d5)]>0x0?{'hookDirectoryMigrations':_0x55f3e3[_0x332181(0x21a)][_0x332181(0x208)](_0x390d89=>({'from':_0x390d89[_0x332181(0x1c5)],'to':_0x390d89[_0x332181(0x201)]}))}:{},'files':_0x4ebf1f},'description':_0x332181(0x1c3)+_0x4ebf1f[_0x332181(0x1d5)]+_0x332181(0x1cf)};},async 'execute'(_0x3f87ee){const _0x2db5f4=a43_0xe89db0,_0x21fadc=loadBffProjectConfig(_0x3f87ee['appCode']),_0x51b4d5=await readBffLockFile(_0x21fadc[_0x2db5f4(0x20d)]),{lockData:_0x1285dc,appLock:_0x317f78}=ensureLockScope(_0x51b4d5??createEmptyBffLock(),_0x3f87ee[_0x2db5f4(0x1ed)],_0x21fadc['scriptsRoot'],'pull'),_0x5b526b=normalizeBffType(_0x3f87ee[_0x2db5f4(0x196)]('type'))??undefined;if(_0x3f87ee['str'](_0x2db5f4(0x1cd))&&!_0x5b526b)throw CliErrors[_0x2db5f4(0x1bb)](_0x2db5f4(0x199));const [_0x3655f0,_0x1c9f88]=await Promise[_0x2db5f4(0x1fc)]([listBffScripts(_0x3f87ee[_0x2db5f4(0x1ed)],_0x5b526b),getBffScriptStatistics(_0x3f87ee[_0x2db5f4(0x1ed)])]);if(_0x3655f0[_0x2db5f4(0x1d5)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0x2f398d=_0x3f87ee[_0x2db5f4(0x1dd)]('force');if(_0x2f398d&&!_0x3f87ee['nonInteractive']){const _0x1b3079=await confirmForce();if(!_0x1b3079)throw CliErrors['cancelled'](_0x2db5f4(0x1a4));}if(_0x2f398d&&_0x3f87ee[_0x2db5f4(0x1a8)]){}const _0xd685d8=_0x3655f0[_0x2db5f4(0x20c)](_0x4b1bf9=>normalizeBffType(_0x4b1bf9[_0x2db5f4(0x1f8)])==='HOOK'),_0x18c4e2=_0xd685d8?buildDatasetCodeToAliasMap(_0x3f87ee[_0x2db5f4(0x1cc)],_0x3f87ee[_0x2db5f4(0x1ed)],_0x3f87ee['selectedAppName']||_0x3f87ee['mergedCli']?.[_0x2db5f4(0x21d)]||_0x3f87ee[_0x2db5f4(0x221)]?.['defaultApp']):new Map(),_0x434405=createHookLocationMap(_0x1c9f88),_0x6c6086=JSON['parse'](JSON[_0x2db5f4(0x223)](_0x1285dc)),_0x4652fa=_0x3f87ee[_0x2db5f4(0x1ed)],_0x397ad=_0x6c6086[_0x2db5f4(0x20e)][_0x4652fa];if(!_0x397ad)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x4652fa+_0x2db5f4(0x20a));const _0x2df8ad=_0xd685d8?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x21fadc,_0x397ad,_0x18c4e2,await scanLocalBffFunctions(_0x21fadc,_0x2db5f4(0x19d))),_0x397ad):undefined,_0x202ea4=createPullFileTransaction(),_0x43d016=[],_0x5f4a67=[],_0xd593b4=[],_0x33a612=[];for(const _0x361345 of _0x3655f0){const _0x46a746=resolveRemoteScriptTarget(_0x21fadc,_0x361345,_0x434405,_0x397ad[_0x2db5f4(0x1bf)],_0x18c4e2);if(!_0x46a746){_0x5f4a67['push']({'lockKey':_0x361345['scriptType']+'/'+_0x361345[_0x2db5f4(0x1c6)],'reason':_0x2db5f4(0x204)});continue;}const _0x56232d=_0x397ad[_0x2db5f4(0x1bf)][_0x46a746[_0x2db5f4(0x202)]];try{if(!_0x361345['id'])throw new Error(_0x2db5f4(0x220));if(_0x361345[_0x2db5f4(0x1d2)]==null)throw new Error(_0x2db5f4(0x1e5));const _0x1d6b9c=_0x361345[_0x2db5f4(0x1d2)],_0x34fcd5=computeContentHash(_0x1d6b9c);if(!_0x2f398d){const _0x510eb5=await hasUnsyncedLocalChanges(_0x46a746[_0x2db5f4(0x1d3)],_0x56232d,_0x34fcd5);if(_0x510eb5){_0xd593b4['push'](localUnsyncedConflict(_0x46a746,_0x361345['id']));continue;}}await _0x202ea4[_0x2db5f4(0x217)](_0x46a746[_0x2db5f4(0x1d3)],_0x1d6b9c);const _0xcbb08={'hash':_0x34fcd5,'remoteId':_0x361345['id'],'version':_0x361345[_0x2db5f4(0x212)]};_0x46a746['type']===_0x2db5f4(0x19d)&&_0x46a746[_0x2db5f4(0x197)]&&(_0xcbb08['alias']=_0x46a746['hookLocation'][_0x2db5f4(0x213)],_0xcbb08[_0x2db5f4(0x1d1)]=_0x46a746['hookLocation'][_0x2db5f4(0x1d1)],_0xcbb08[_0x2db5f4(0x21e)]=_0x46a746['hookLocation']['operationType'],_0xcbb08[_0x2db5f4(0x1ba)]=_0x46a746['hookLocation'][_0x2db5f4(0x1ba)]),_0x397ad['functions'][_0x46a746[_0x2db5f4(0x202)]]=_0xcbb08,_0x43d016[_0x2db5f4(0x1d6)]({'lockKey':_0x46a746[_0x2db5f4(0x202)],'remoteId':_0x361345['id']});}catch(_0x22a121){_0x33a612['push']({'lockKey':_0x46a746[_0x2db5f4(0x202)],'error':_0x22a121 instanceof Error?_0x22a121['message']:String(_0x22a121)});}}_0x397ad['lastSync']=new Date()['toISOString']();try{await writeBffLockFile(_0x21fadc[_0x2db5f4(0x20d)],_0x6c6086);}catch(_0x31e1fc){const _0x59936b=[...await _0x202ea4[_0x2db5f4(0x1ef)](),...await _0x2df8ad?.[_0x2db5f4(0x1ef)]()??[]];throw withRollbackErrors(_0x31e1fc,_0x2db5f4(0x1ae),_0x59936b);}return{'ok':_0x33a612[_0x2db5f4(0x1d5)]===0x0,'data':{'pulled':_0x43d016,'skipped':_0x5f4a67,'conflicts':_0xd593b4,'failed':_0x33a612},'message':formatPullMessage(_0x43d016[_0x2db5f4(0x1d5)],_0x5f4a67[_0x2db5f4(0x1d5)],_0xd593b4[_0x2db5f4(0x1d5)],_0x33a612[_0x2db5f4(0x1d5)])};}};function localUnsyncedConflict(_0x29d0a5,_0x4299a0){const _0x3f7907=a43_0xe89db0,_0x28647c=_0x29d0a5[_0x3f7907(0x202)][_0x3f7907(0x20b)]('/')['at'](-0x1);return{'code':'BFF_LOCAL_UNSYNCED','lockKey':_0x29d0a5[_0x3f7907(0x202)],'filePath':_0x29d0a5[_0x3f7907(0x1d3)],..._0x4299a0!=null?{'remoteId':_0x4299a0}:{},'message':'Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','nextAction':{'action':'push_local','command':CLI_BIN_NAME+_0x3f7907(0x1ca)+_0x29d0a5[_0x3f7907(0x1cd)]+_0x3f7907(0x218)+_0x28647c+_0x3f7907(0x1a1),'requiresReview':!![],'message':'If\x20the\x20reviewed\x20local\x20script\x20should\x20win,\x20run\x20this\x20command\x20to\x20update\x20the\x20remote\x20script.\x20Do\x20not\x20use\x20--force\x20to\x20resolve\x20a\x20content\x20conflict.'}};}function formatPullMessage(_0x579346,_0x11cebc,_0x3caf61,_0x18c5e2){const _0x4130c3=a43_0xe89db0,_0x267c6e=[_0x4130c3(0x1f0)+_0x579346+_0x4130c3(0x1ac),_0x11cebc+'\x20skipped'];_0x3caf61>0x0&&_0x267c6e['push'](_0x3caf61+_0x4130c3(0x205)+(_0x3caf61===0x1?'':'s')+'\x20'+(_0x3caf61===0x1?_0x4130c3(0x222):_0x4130c3(0x1ec))+_0x4130c3(0x1b2));if(_0x18c5e2>0x0)_0x267c6e[_0x4130c3(0x1d6)](_0x18c5e2+_0x4130c3(0x1f3));return _0x267c6e[_0x4130c3(0x1c0)](',\x20');}async function hasUnsyncedLocalChanges(_0x3605b6,_0x8bae78,_0x5b470c){const _0x24f1ea=a43_0xe89db0;if(!await fileExists(_0x3605b6))return![];const _0x30f481=await computeFileHash(_0x3605b6);if(!_0x8bae78)return _0x5b470c?_0x30f481!==_0x5b470c:!![];return _0x30f481!==_0x8bae78[_0x24f1ea(0x19f)];}function a43_0x313f(){const _0x275483=['join','read','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','Would\x20inspect\x20','2024394hYUJeC','oldDirectory','functionName','Failed\x20to\x20write\x20local\x20script\x20\x22','lastSync','entries','\x20bff\x20push\x20--type\x20','175Ccymgq','apiDir','type','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','scriptsRootDir','datasetCode','scriptContent','filePath','26278degfoV','length','push','keyChanges','content','values','ENDPOINT','defaultApp','force','bool','delete','stdin','NFC','\x22:\x20its\x20target\x20\x22','sourceFilePathByNewLockKey','Force\x20overwrite\x20local\x20unsynced\x20changes','207486uoMJmR','Remote\x20script\x20missing\x20content.','message','includes','\x22\x20and\x20\x22','.js','oldDirectoryPath','sourceDirectoryPathByNewDirectory','require','appCode','2159836DAVFtz','rollback','Pull\x20complete:\x20','bff','case-rename','\x20failed','pull','would_pull','10191978jlQOMF','get','scriptType','ENOENT','projectedFunctions','\x22\x20from\x20\x22','all','newDirectoryPath','scriptsRoot','\x22:\x20','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','newDirectory','lockKey','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','unresolvable\x20target\x20path','\x20conflict','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','map','conflict','\x22\x20not\x20found\x20after\x20ensureLockScope.','split','some','lockFilePath','apps','Could\x20not\x20restore\x20local\x20script\x20\x22','18pPvpxc','stderr','version','alias','\x22\x20from\x20the\x20lock\x20file.','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','filter','write','\x20--name\x20','newLockKey','migrations','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','profileName','currentApp','operationType','toLowerCase','Remote\x20script\x20missing\x20id.','mergedCli','requires','stringify','string','dev','COMMON','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','str','hookLocation','question','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','\x22;\x20temporary\x20directory\x20\x22','Pull\x20only\x20this\x20script\x20type','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','HOOK','mode','hash','ino','\x20--format\x20compress','\x22\x20to\x20\x22','\x20Recovery\x20errors:\x20','Force\x20pull\x20cancelled.','has','trim','entry','nonInteractive','\x22:\x20both\x20target\x20\x22','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','set','\x20pulled','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','3175632QdIDOE','move','5296410kooQlN','\x20resolution','yes','oldLockKey','HOOK/','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','boolean','code','close','functionNode','validation','selectedAppName','rekey','remoteId','functions'];a43_0x313f=function(){return _0x275483;};return a43_0x313f();}function createPullFileTransaction(){const _0x4ee0aa=new Map(),_0x529550=async(_0x5c2c31,_0x3cc31e)=>{const _0x4587fe=a43_0x57e6;try{if(_0x3cc31e['existed'])await ensureParentDirectory(_0x5c2c31),await writeFile(_0x5c2c31,_0x3cc31e[_0x4587fe(0x1d8)]);else try{await unlink(_0x5c2c31);}catch(_0x4138d4){if(_0x4138d4[_0x4587fe(0x1b8)]!==_0x4587fe(0x1f9))throw _0x4138d4;}return undefined;}catch(_0xc47037){return _0xc47037 instanceof Error?_0xc47037:new Error(String(_0xc47037));}};return{async 'write'(_0x122f6e,_0x13b0aa){const _0x17c556=a43_0x57e6;if(!_0x4ee0aa[_0x17c556(0x1a5)](_0x122f6e))try{_0x4ee0aa[_0x17c556(0x1ab)](_0x122f6e,{'existed':!![],'content':await readFile(_0x122f6e)});}catch(_0x6563c3){if(_0x6563c3['code']!=='ENOENT')throw _0x6563c3;_0x4ee0aa[_0x17c556(0x1ab)](_0x122f6e,{'existed':![]});}try{await ensureParentDirectory(_0x122f6e),await writeFile(_0x122f6e,_0x13b0aa,'utf8');}catch(_0x4d845e){const _0x4f1ec7=await _0x529550(_0x122f6e,_0x4ee0aa[_0x17c556(0x1f7)](_0x122f6e));if(!_0x4f1ec7)_0x4ee0aa[_0x17c556(0x1de)](_0x122f6e);throw withRollbackErrors(_0x4d845e,_0x17c556(0x1c7)+_0x122f6e+'\x22.',_0x4f1ec7?[_0x4f1ec7]:[]);}},async 'rollback'(){const _0x4bca2c=a43_0x57e6,_0x1f0769=[];for(const [_0x3b3449,_0x31e6e9]of[..._0x4ee0aa['entries']()]['reverse']()){const _0x37afed=await _0x529550(_0x3b3449,_0x31e6e9);_0x37afed&&_0x1f0769['push'](new Error(_0x4bca2c(0x20f)+_0x3b3449+_0x4bca2c(0x1ff)+_0x37afed[_0x4bca2c(0x1e6)]));}return _0x1f0769;}};}function withRollbackErrors(_0x1f7caf,_0x4e3a1b,_0x418d11){const _0x4ce090=a43_0xe89db0,_0x2b7c8f=_0x1f7caf instanceof Error?_0x1f7caf:new Error(String(_0x1f7caf));if(_0x418d11['length']===0x0)return _0x2b7c8f;return new AggregateError([_0x2b7c8f,..._0x418d11],_0x4e3a1b+_0x4ce090(0x1a3)+_0x418d11[_0x4ce090(0x208)](_0x525d66=>_0x525d66[_0x4ce090(0x1e6)])[_0x4ce090(0x1c0)](';\x20'));}function buildDatasetCodeToAliasMap(_0x405f52,_0x3061c1,_0xd34ba3){const _0x20d1aa=a43_0xe89db0,_0x12601c=resolveApiModelSource(_0x405f52,_0x3061c1,_0xd34ba3),_0x40d298=loadAliasMap(_0x405f52,undefined,_0x12601c[_0x20d1aa(0x1d3)],_0x12601c[_0x20d1aa(0x21c)]);return assertUnambiguousHookAliases(_0x40d298),new Map(_0x40d298[_0x20d1aa(0x208)](_0x2ba91b=>[_0x2ba91b[_0x20d1aa(0x1d1)]['toLowerCase'](),_0x2ba91b[_0x20d1aa(0x213)]]));}async function planHookDirectoryMigration(_0x1ac5f5,_0x124cfe,_0x5bfd42,_0x157193){const _0x4190cb=a43_0xe89db0,_0x47516c=new Map();for(const [_0x693cd8,_0x31eaf2]of Object[_0x4190cb(0x1c9)](_0x124cfe[_0x4190cb(0x1bf)])){const [_0x51b1a0,_0x3a77fe,_0x83ec3,_0x6a51c2,_0x32b827,..._0xfe7151]=_0x693cd8[_0x4190cb(0x20b)]('/');if(_0x51b1a0!==_0x4190cb(0x19d)||!_0x3a77fe||!_0x83ec3||!_0x6a51c2||!_0x32b827||_0xfe7151[_0x4190cb(0x1d5)]>0x0||!_0x31eaf2[_0x4190cb(0x1d1)])continue;const _0x93dca=_0x5bfd42[_0x4190cb(0x1f7)](_0x31eaf2[_0x4190cb(0x1d1)][_0x4190cb(0x21f)]()),_0x1df6d6=_0x93dca??_0x31eaf2[_0x4190cb(0x1d1)];if(!isSafeHookDirectorySegment(_0x3a77fe))throw CliErrors['validation'](_0x4190cb(0x19c)+_0x3a77fe+_0x4190cb(0x214));if(!isSafeHookDirectorySegment(_0x1df6d6))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x3a77fe+_0x4190cb(0x1ad));if(_0x3a77fe===_0x1df6d6)continue;const _0x147344=_0x47516c[_0x4190cb(0x1f7)](_0x3a77fe)??{'datasetCode':_0x31eaf2[_0x4190cb(0x1d1)],'alias':_0x93dca,'keyChanges':[]};if(_0x147344[_0x4190cb(0x1d1)]!==_0x31eaf2[_0x4190cb(0x1d1)])throw CliErrors[_0x4190cb(0x1bb)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x3a77fe+_0x4190cb(0x1c2));const _0x4683d8=_0x4190cb(0x1b5)+_0x1df6d6+'/'+_0x83ec3+'/'+_0x6a51c2+'/'+_0x32b827;try{resolveLocalFilePathFromLockKey(_0x1ac5f5,_0x693cd8),resolveLocalFilePathFromLockKey(_0x1ac5f5,_0x4683d8);}catch(_0x49cece){throw CliErrors[_0x4190cb(0x1bb)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'+_0x693cd8+_0x4190cb(0x1ff)+(_0x49cece instanceof Error?_0x49cece['message']:String(_0x49cece)));}_0x147344[_0x4190cb(0x1d7)][_0x4190cb(0x1d6)]({'oldLockKey':_0x693cd8,'newLockKey':_0x4683d8,'entry':_0x31eaf2}),_0x47516c[_0x4190cb(0x1ab)](_0x3a77fe,_0x147344);}const _0x198182=new Set([..._0x47516c[_0x4190cb(0x1d9)]()]['flatMap'](_0x565c33=>_0x565c33[_0x4190cb(0x1d7)][_0x4190cb(0x208)](_0x1286df=>_0x1286df[_0x4190cb(0x1b4)]))),_0x5388fa=new Map(),_0x5e3789=new Map();for(const [_0x4a3198,_0x38d18e]of _0x47516c){const _0x5270ca=_0x38d18e['alias']??_0x38d18e[_0x4190cb(0x1d1)],_0x1fe02c=hookDirectoryIdentity(_0x5270ca),_0x449652=_0x5388fa[_0x4190cb(0x1f7)](_0x1fe02c);if(_0x449652&&_0x449652!==_0x4a3198)throw CliErrors[_0x4190cb(0x1bb)](_0x4190cb(0x194)+_0x449652+'\x22\x20and\x20\x22'+_0x4a3198+'\x22:\x20both\x20target\x20\x22'+_0x5270ca+'\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.');_0x5388fa[_0x4190cb(0x1ab)](_0x1fe02c,_0x4a3198);for(const _0x180282 of _0x38d18e[_0x4190cb(0x1d7)]){const _0x451306=_0x5e3789['get'](_0x180282[_0x4190cb(0x219)]);if(_0x451306&&_0x451306!==_0x180282[_0x4190cb(0x1b4)])throw CliErrors['validation'](_0x4190cb(0x215)+_0x451306+_0x4190cb(0x1e8)+_0x180282['oldLockKey']+_0x4190cb(0x1a9)+_0x180282[_0x4190cb(0x219)]+'\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');if(_0x198182[_0x4190cb(0x1a5)](_0x180282[_0x4190cb(0x219)]))throw CliErrors[_0x4190cb(0x1bb)](_0x4190cb(0x21b)+_0x180282[_0x4190cb(0x1b4)]+_0x4190cb(0x1e1)+_0x180282['newLockKey']+_0x4190cb(0x203));_0x5e3789[_0x4190cb(0x1ab)](_0x180282[_0x4190cb(0x219)],_0x180282['oldLockKey']);}}const _0xca43bb=new Map();for(const [_0x1914ef,_0x48ea14]of _0x5bfd42){_0xca43bb[_0x4190cb(0x1ab)](hookDirectoryIdentity(_0x48ea14),_0x1914ef);}const _0x4621a9=[];for(const [_0x213edb,_0x83b49a]of _0x47516c){const _0xf1e225=_0x83b49a[_0x4190cb(0x213)]??_0x83b49a[_0x4190cb(0x1d1)],_0x5d7f03=join(_0x1ac5f5[_0x4190cb(0x1d0)],_0x4190cb(0x19d),_0x213edb),_0x15ad33=join(_0x1ac5f5[_0x4190cb(0x1d0)],_0x4190cb(0x19d),_0xf1e225),_0x579cc7=await directoryExists(_0x5d7f03),_0x42cf7c=await directoryExists(_0x15ad33),_0x2307a8=_0x579cc7?_0x42cf7c?await sameDirectory(_0x5d7f03,_0x15ad33)?'case-rename':undefined:_0x4190cb(0x1b0):_0x4190cb(0x1bd);if(!_0x2307a8)throw CliErrors[_0x4190cb(0x1bb)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x213edb+_0x4190cb(0x1a2)+_0xf1e225+_0x4190cb(0x1aa));const _0x28c8bc=_0xca43bb['get'](hookDirectoryIdentity(_0x213edb));if(_0x28c8bc&&_0x28c8bc!==_0x83b49a[_0x4190cb(0x1d1)][_0x4190cb(0x21f)]()){const _0x3a6934=new Set(_0x83b49a[_0x4190cb(0x1d7)][_0x4190cb(0x208)](_0x4230ef=>_0x4230ef[_0x4190cb(0x1b4)])),_0x597bc0=_0x157193[_0x4190cb(0x216)](_0x27adad=>_0x27adad[_0x4190cb(0x1cd)]===_0x4190cb(0x19d)&&_0x27adad[_0x4190cb(0x213)]!=null&&hookDirectoryIdentity(_0x27adad['alias'])===hookDirectoryIdentity(_0x213edb)&&!_0x3a6934[_0x4190cb(0x1a5)](_0x27adad[_0x4190cb(0x202)]));if(_0x597bc0['length']>0x0)throw CliErrors[_0x4190cb(0x1bb)](_0x4190cb(0x1b6)+_0x213edb+_0x4190cb(0x195));}const _0x530347=_0xca43bb[_0x4190cb(0x1f7)](hookDirectoryIdentity(_0xf1e225));if(_0x530347&&_0x530347!==_0x83b49a[_0x4190cb(0x1d1)]['toLowerCase']())throw CliErrors[_0x4190cb(0x1bb)](_0x4190cb(0x1b6)+_0x213edb+_0x4190cb(0x1a2)+_0xf1e225+'\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');for(const _0x128e5b of _0x83b49a['keyChanges']){const _0x804e1a=_0x124cfe[_0x4190cb(0x1bf)][_0x128e5b[_0x4190cb(0x219)]];if(_0x804e1a&&!_0x198182[_0x4190cb(0x1a5)](_0x128e5b[_0x4190cb(0x219)])&&!sameHookIdentity(_0x128e5b[_0x4190cb(0x1a7)],_0x804e1a))throw CliErrors[_0x4190cb(0x1bb)](_0x4190cb(0x1b6)+_0x213edb+_0x4190cb(0x1a2)+_0xf1e225+_0x4190cb(0x207));}_0x4621a9[_0x4190cb(0x1d6)]({'oldDirectory':_0x213edb,'newDirectory':_0xf1e225,'oldDirectoryPath':_0x5d7f03,'newDirectoryPath':_0x15ad33,'mode':_0x2307a8,'alias':_0x83b49a[_0x4190cb(0x213)],'keyChanges':_0x83b49a['keyChanges']});}const _0x2c32fc={..._0x124cfe[_0x4190cb(0x1bf)]},_0x480283=new Map(),_0x481cfe=new Map();for(const _0x58e107 of _0x4621a9){const _0x1051ea=_0x58e107[_0x4190cb(0x19e)]!==_0x4190cb(0x1bd);_0x1051ea&&_0x481cfe[_0x4190cb(0x1ab)](hookDirectoryIdentity(_0x58e107['newDirectory']),_0x58e107[_0x4190cb(0x1ea)]);for(const _0xe76d36 of _0x58e107[_0x4190cb(0x1d7)]){const _0x1e29e0=_0x2c32fc[_0xe76d36[_0x4190cb(0x219)]],_0x3b06b5=_0x1051ea?_0xe76d36['entry']:_0x1e29e0??_0xe76d36['entry'];_0x2c32fc[_0xe76d36[_0x4190cb(0x219)]]=canonicalizeHookEntry(_0x3b06b5,_0x58e107[_0x4190cb(0x213)]),delete _0x2c32fc[_0xe76d36[_0x4190cb(0x1b4)]],_0x1051ea&&_0x480283[_0x4190cb(0x1ab)](_0xe76d36['newLockKey'],resolveLocalFilePathFromLockKey(_0x1ac5f5,_0xe76d36[_0x4190cb(0x1b4)]));}}return{'migrations':_0x4621a9,'projectedFunctions':_0x2c32fc,'sourceFilePathByNewLockKey':_0x480283,'sourceDirectoryPathByNewDirectory':_0x481cfe};}function resolveMigratedSourceFilePath(_0x37ef02,_0x291045){const _0x28e360=a43_0xe89db0;if(!_0x37ef02||!_0x291045)return undefined;const _0x2aee1a=_0x37ef02[_0x28e360(0x1e2)]['get'](_0x291045[_0x28e360(0x202)]);if(_0x2aee1a)return _0x2aee1a;if(_0x291045['type']!==_0x28e360(0x19d))return undefined;const [,_0x2ba52a,..._0x15a8df]=_0x291045[_0x28e360(0x202)][_0x28e360(0x20b)]('/');if(!_0x2ba52a||_0x15a8df[_0x28e360(0x1d5)]===0x0)return undefined;const _0x513801=_0x37ef02[_0x28e360(0x1eb)]['get'](hookDirectoryIdentity(_0x2ba52a));return _0x513801?join(_0x513801,..._0x15a8df)+_0x28e360(0x1e9):undefined;}function a43_0x57e6(_0x1fc070,_0x53a652){_0x1fc070=_0x1fc070-0x193;const _0x313f58=a43_0x313f();let _0x57e67f=_0x313f58[_0x1fc070];return _0x57e67f;}function sameHookIdentity(_0x299b91,_0x9106c2){const _0x44eeca=a43_0xe89db0;return _0x299b91[_0x44eeca(0x1be)]===_0x9106c2[_0x44eeca(0x1be)]&&_0x299b91[_0x44eeca(0x1d1)]===_0x9106c2[_0x44eeca(0x1d1)]&&_0x299b91[_0x44eeca(0x21e)]===_0x9106c2[_0x44eeca(0x21e)]&&_0x299b91['functionNode']===_0x9106c2['functionNode'];}function canonicalizeHookEntry(_0x139e2e,_0x1d0b48){const {alias:_0x4a1ff2,..._0x59ec87}=_0x139e2e;return _0x1d0b48?{..._0x59ec87,'alias':_0x1d0b48}:_0x59ec87;}function hookDirectoryIdentity(_0xb80866){const _0xc8c422=a43_0xe89db0;return _0xb80866['normalize'](_0xc8c422(0x1e0))['toLowerCase']();}function isSafeHookDirectorySegment(_0x350359){return isSafeLockKeySegment(_0x350359);}async function sameDirectory(_0x52ab1d,_0x397ddc){const _0xe5cc14=a43_0xe89db0,[_0x33563c,_0x434713]=await Promise[_0xe5cc14(0x1fc)]([stat(_0x52ab1d),stat(_0x397ddc)]);return _0x33563c[_0xe5cc14(0x225)]===_0x434713[_0xe5cc14(0x225)]&&_0x33563c[_0xe5cc14(0x1a0)]===_0x434713['ino'];}async function applyHookDirectoryMigration(_0x3af8af,_0x2061ef){const _0x73a84e=a43_0xe89db0,_0x297429=_0x2061ef[_0x73a84e(0x1bf)],_0x2c5c1a=_0x2061ef[_0x73a84e(0x1c8)],_0x452a2f=[],_0x456b08=async()=>{const _0x3a1463=_0x73a84e,_0x28f92c=[];_0x2061ef[_0x3a1463(0x1bf)]=_0x297429,_0x2061ef[_0x3a1463(0x1c8)]=_0x2c5c1a;for(const {migration:_0x465e5e,temporaryPath:_0x40e768}of[..._0x452a2f]['reverse']()){try{_0x40e768?(await rename(_0x465e5e[_0x3a1463(0x1fd)],_0x40e768),await rename(_0x40e768,_0x465e5e[_0x3a1463(0x1ea)])):await rename(_0x465e5e['newDirectoryPath'],_0x465e5e[_0x3a1463(0x1ea)]);}catch(_0x5a9dec){_0x28f92c['push'](new Error('Could\x20not\x20restore\x20HOOK\x20directory\x20\x22'+_0x465e5e[_0x3a1463(0x1c5)]+_0x3a1463(0x1fb)+_0x465e5e['newDirectory']+_0x3a1463(0x1ff)+(_0x5a9dec instanceof Error?_0x5a9dec[_0x3a1463(0x1e6)]:String(_0x5a9dec))));}}return _0x28f92c;};try{for(const _0x4cc6e0 of _0x3af8af[_0x73a84e(0x21a)]){if(_0x4cc6e0['mode']===_0x73a84e(0x1b0))await ensureParentDirectory(_0x4cc6e0[_0x73a84e(0x1fd)]),await rename(_0x4cc6e0[_0x73a84e(0x1ea)],_0x4cc6e0[_0x73a84e(0x1fd)]),_0x452a2f[_0x73a84e(0x1d6)]({'migration':_0x4cc6e0});else{if(_0x4cc6e0[_0x73a84e(0x19e)]===_0x73a84e(0x1f2)){const _0x28aa94=join(dirname(_0x4cc6e0[_0x73a84e(0x1ea)]),'.hook-directory-migrate-'+randomUUID());await rename(_0x4cc6e0[_0x73a84e(0x1ea)],_0x28aa94);try{await rename(_0x28aa94,_0x4cc6e0[_0x73a84e(0x1fd)]);}catch(_0x427340){try{await rename(_0x28aa94,_0x4cc6e0['oldDirectoryPath']);}catch(_0x486234){throw withRollbackErrors(_0x427340,_0x73a84e(0x206)+_0x4cc6e0['oldDirectory']+_0x73a84e(0x1a2)+_0x4cc6e0[_0x73a84e(0x201)]+_0x73a84e(0x19a)+_0x28aa94+'\x22\x20may\x20remain.',[new Error('Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22'+_0x28aa94+_0x73a84e(0x1a2)+_0x4cc6e0[_0x73a84e(0x1c5)]+_0x73a84e(0x1ff)+(_0x486234 instanceof Error?_0x486234[_0x73a84e(0x1e6)]:String(_0x486234)))]);}throw _0x427340;}_0x452a2f['push']({'migration':_0x4cc6e0,'temporaryPath':_0x28aa94});}}}return _0x2061ef[_0x73a84e(0x1bf)]=_0x3af8af[_0x73a84e(0x1fa)],{'rollback':_0x456b08};}catch(_0x1988d8){const _0x540eb1=await _0x456b08();throw withRollbackErrors(_0x1988d8,_0x73a84e(0x1ce),_0x540eb1);}}async function confirmForce(){const _0x449f25=a43_0xe89db0,_0x2ad204=createInterface({'input':process[_0x449f25(0x1df)],'output':process[_0x449f25(0x211)]}),_0x2418f8=await new Promise(_0xd748bb=>{const _0x314031=_0x449f25;_0x2ad204[_0x314031(0x198)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0xd748bb);});return _0x2ad204[_0x449f25(0x1b9)](),['y',_0x449f25(0x1b3)][_0x449f25(0x1e7)](_0x2418f8[_0x449f25(0x1a6)]()[_0x449f25(0x21f)]());}