@lovrabet/rabetbase-cli 2.5.9 → 2.5.10-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 (377) hide show
  1. package/README.md +1 -1
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +1 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +1 -1
  21. package/lib/commands/api/generate.js +1 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +1 -1
  24. package/lib/commands/api/pull.js +1 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.js +1 -1
  27. package/lib/commands/app/index.js +1 -1
  28. package/lib/commands/app/list.js +1 -1
  29. package/lib/commands/app/members-list.js +1 -1
  30. package/lib/commands/app/remote-directory.js +1 -1
  31. package/lib/commands/app/shared.js +1 -1
  32. package/lib/commands/app-config/delete.js +1 -1
  33. package/lib/commands/app-config/get.js +1 -1
  34. package/lib/commands/app-config/index.js +1 -1
  35. package/lib/commands/app-config/list.js +1 -1
  36. package/lib/commands/app-config/set.js +1 -1
  37. package/lib/commands/app-config/shared.js +1 -1
  38. package/lib/commands/auth/index.js +1 -1
  39. package/lib/commands/bff/create.js +1 -1
  40. package/lib/commands/bff/delete.js +1 -1
  41. package/lib/commands/bff/detail.js +1 -1
  42. package/lib/commands/bff/index.js +1 -1
  43. package/lib/commands/bff/list.js +1 -1
  44. package/lib/commands/bff/logs.js +1 -1
  45. package/lib/commands/bff/pull.js +1 -1
  46. package/lib/commands/bff/push.js +1 -1
  47. package/lib/commands/bff/status.js +1 -1
  48. package/lib/commands/cli-skill/index.js +1 -1
  49. package/lib/commands/cli-update.js +1 -1
  50. package/lib/commands/codegen/index.js +1 -1
  51. package/lib/commands/codegen/sdk.js +1 -1
  52. package/lib/commands/codegen/sql.js +1 -1
  53. package/lib/commands/common/app-registry.js +1 -1
  54. package/lib/commands/common/app-selector.js +1 -1
  55. package/lib/commands/common/async-task.js +1 -1
  56. package/lib/commands/common/dry-run.js +1 -1
  57. package/lib/commands/common/flags.js +1 -1
  58. package/lib/commands/common/local-file.js +1 -1
  59. package/lib/commands/common/validate.js +1 -1
  60. package/lib/commands/config/delete.js +1 -1
  61. package/lib/commands/config/get.js +1 -1
  62. package/lib/commands/config/index.js +1 -1
  63. package/lib/commands/config/init.js +1 -1
  64. package/lib/commands/config/list.js +1 -1
  65. package/lib/commands/config/set.js +1 -1
  66. package/lib/commands/config/shared.js +1 -1
  67. package/lib/commands/dataset/batch-design.js +1 -1
  68. package/lib/commands/dataset/business-group-update.js +1 -1
  69. package/lib/commands/dataset/business-groups.js +1 -1
  70. package/lib/commands/dataset/capability.js +1 -1
  71. package/lib/commands/dataset/cross-relation-create.js +1 -1
  72. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  73. package/lib/commands/dataset/cross-relation-list.js +1 -1
  74. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  75. package/lib/commands/dataset/cross-relation-update.js +1 -1
  76. package/lib/commands/dataset/delete.js +1 -1
  77. package/lib/commands/dataset/design-context.js +1 -1
  78. package/lib/commands/dataset/design-start.js +1 -1
  79. package/lib/commands/dataset/design-status.js +1 -1
  80. package/lib/commands/dataset/design-sync-retry.js +1 -1
  81. package/lib/commands/dataset/design-sync-status.js +1 -1
  82. package/lib/commands/dataset/design-validate.js +1 -1
  83. package/lib/commands/dataset/detail.js +1 -1
  84. package/lib/commands/dataset/extend-update.js +1 -1
  85. package/lib/commands/dataset/field-restore.js +1 -1
  86. package/lib/commands/dataset/field-update.js +1 -1
  87. package/lib/commands/dataset/generate.js +1 -1
  88. package/lib/commands/dataset/index.js +1 -1
  89. package/lib/commands/dataset/list.js +1 -1
  90. package/lib/commands/dataset/operations.js +1 -1
  91. package/lib/commands/dataset/relation-audit.js +1 -1
  92. package/lib/commands/dataset/relation-create.js +1 -1
  93. package/lib/commands/dataset/relation-delete.js +1 -1
  94. package/lib/commands/dataset/relation-shared.js +1 -1
  95. package/lib/commands/dataset/relation-update.js +1 -1
  96. package/lib/commands/dataset/relations.js +1 -1
  97. package/lib/commands/dataset/rename.js +1 -1
  98. package/lib/commands/dataset/restore.js +1 -1
  99. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  100. package/lib/commands/db/analysis-batching.js +1 -1
  101. package/lib/commands/db/analyze-batch-plan.js +1 -1
  102. package/lib/commands/db/analyze-cancel.js +1 -1
  103. package/lib/commands/db/analyze-start.js +1 -1
  104. package/lib/commands/db/analyze-status.js +1 -1
  105. package/lib/commands/db/create.js +1 -1
  106. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  109. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  110. package/lib/commands/db/delete.js +1 -1
  111. package/lib/commands/db/detail.js +1 -1
  112. package/lib/commands/db/diff-refresh-start.js +1 -1
  113. package/lib/commands/db/diff-refresh-status.js +1 -1
  114. package/lib/commands/db/diff.js +1 -1
  115. package/lib/commands/db/index.js +1 -1
  116. package/lib/commands/db/list.js +1 -1
  117. package/lib/commands/db/shared.js +1 -1
  118. package/lib/commands/db/table-diff-shared.js +1 -1
  119. package/lib/commands/db/tables.js +1 -1
  120. package/lib/commands/db/test.js +1 -1
  121. package/lib/commands/db/update.js +1 -1
  122. package/lib/commands/deployment/index.js +1 -1
  123. package/lib/commands/deployment/sync-all.js +1 -1
  124. package/lib/commands/deployment/sync-jobs.js +1 -1
  125. package/lib/commands/deployment/sync-status.js +1 -1
  126. package/lib/commands/doctor.js +1 -1
  127. package/lib/commands/file/index.js +1 -1
  128. package/lib/commands/flow/create.js +1 -1
  129. package/lib/commands/flow/detail.js +1 -1
  130. package/lib/commands/flow/index.js +1 -1
  131. package/lib/commands/flow/list.js +1 -1
  132. package/lib/commands/flow/page-list.js +1 -1
  133. package/lib/commands/flow/publish.js +1 -1
  134. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  135. package/lib/commands/flow/runtime-role-list.js +1 -1
  136. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  137. package/lib/commands/flow/runtime-user-search.js +1 -1
  138. package/lib/commands/flow/shared.js +1 -1
  139. package/lib/commands/flow/update.js +1 -1
  140. package/lib/commands/flow/validate.js +1 -1
  141. package/lib/commands/instant-api-policy/current.js +1 -1
  142. package/lib/commands/instant-api-policy/index.js +1 -1
  143. package/lib/commands/instant-api-policy/init.js +1 -1
  144. package/lib/commands/instant-api-policy/publish.js +1 -1
  145. package/lib/commands/instant-api-policy/pull.js +1 -1
  146. package/lib/commands/instant-api-policy/revision.js +1 -1
  147. package/lib/commands/instant-api-policy/revisions.js +1 -1
  148. package/lib/commands/instant-api-policy/rollback.js +1 -1
  149. package/lib/commands/instant-api-policy/shared.js +1 -1
  150. package/lib/commands/instant-api-policy/validate.js +1 -1
  151. package/lib/commands/issue/index.js +1 -1
  152. package/lib/commands/issue/nudge.js +1 -1
  153. package/lib/commands/issue/report.js +1 -1
  154. package/lib/commands/issue/shared.js +1 -1
  155. package/lib/commands/kb/create.js +1 -1
  156. package/lib/commands/kb/delete.js +1 -1
  157. package/lib/commands/kb/detail.js +1 -1
  158. package/lib/commands/kb/index.js +1 -1
  159. package/lib/commands/kb/list.js +1 -1
  160. package/lib/commands/kb/search.js +1 -1
  161. package/lib/commands/kb/shared.js +1 -1
  162. package/lib/commands/kb/update.js +1 -1
  163. package/lib/commands/logs/index.js +1 -1
  164. package/lib/commands/menu/asset-update.js +1 -1
  165. package/lib/commands/menu/delete.js +1 -1
  166. package/lib/commands/menu/external-link-create.js +1 -1
  167. package/lib/commands/menu/external-link-update.js +1 -1
  168. package/lib/commands/menu/group-create.js +1 -1
  169. package/lib/commands/menu/group-update.js +1 -1
  170. package/lib/commands/menu/index.js +1 -1
  171. package/lib/commands/menu/list.js +1 -1
  172. package/lib/commands/menu/move.js +1 -1
  173. package/lib/commands/menu/regroup-start.js +1 -1
  174. package/lib/commands/menu/rename.js +1 -1
  175. package/lib/commands/menu/shared/compare-table.js +1 -1
  176. package/lib/commands/menu/shared/delete-plan.js +1 -1
  177. package/lib/commands/menu/shared/facts.js +1 -1
  178. package/lib/commands/menu/shared/index.js +1 -1
  179. package/lib/commands/menu/shared/inquirer.js +1 -1
  180. package/lib/commands/menu/shared/local-pages.js +1 -1
  181. package/lib/commands/menu/shared/logic.js +1 -1
  182. package/lib/commands/menu/shared/mutations.js +1 -1
  183. package/lib/commands/menu/shared/path.js +1 -1
  184. package/lib/commands/menu/shared/service.js +1 -1
  185. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  186. package/lib/commands/menu/shared/sync-core.js +1 -1
  187. package/lib/commands/menu/shared/update-core.js +1 -1
  188. package/lib/commands/menu/shared/valid-url.js +1 -1
  189. package/lib/commands/menu/subapp-assets-status.js +1 -1
  190. package/lib/commands/menu/subapp-assets-update.js +1 -1
  191. package/lib/commands/menu/sync.js +1 -1
  192. package/lib/commands/menu/visibility-update.js +1 -1
  193. package/lib/commands/notification/config-create.js +1 -1
  194. package/lib/commands/notification/config-delete.js +1 -1
  195. package/lib/commands/notification/config-list.js +1 -1
  196. package/lib/commands/notification/config-update.js +1 -1
  197. package/lib/commands/notification/index.js +1 -1
  198. package/lib/commands/notification/shared.js +1 -1
  199. package/lib/commands/ocr/index.js +1 -1
  200. package/lib/commands/page/create.js +1 -1
  201. package/lib/commands/page/custom/detail.js +1 -1
  202. package/lib/commands/page/custom/list.js +1 -1
  203. package/lib/commands/page/custom/publish.js +1 -1
  204. package/lib/commands/page/custom/shared.js +1 -1
  205. package/lib/commands/page/custom/syntax.js +1 -1
  206. package/lib/commands/page/custom/update.js +1 -1
  207. package/lib/commands/page/data-list-status.js +1 -1
  208. package/lib/commands/page/generate-start.js +1 -1
  209. package/lib/commands/page/generate-status.js +1 -1
  210. package/lib/commands/page/index.js +1 -1
  211. package/lib/commands/page/pull.js +1 -1
  212. package/lib/commands/page/push.js +1 -1
  213. package/lib/commands/page/relation-audit.js +1 -1
  214. package/lib/commands/page/restore.js +1 -1
  215. package/lib/commands/page/shared.js +1 -1
  216. package/lib/commands/page/sync.js +1 -1
  217. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  218. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  219. package/lib/commands/project/create/format-elapsed.js +1 -1
  220. package/lib/commands/project/create/main.js +1 -1
  221. package/lib/commands/project/create/materialize-project-template.js +1 -1
  222. package/lib/commands/project/create/project-name.js +1 -1
  223. package/lib/commands/project/create/project-template-archive.js +1 -1
  224. package/lib/commands/project/create/project-template-path.js +1 -1
  225. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  226. package/lib/commands/project/create/use-format-code.js +1 -1
  227. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  228. package/lib/commands/project/domain-routing-sync.js +1 -1
  229. package/lib/commands/project/index.js +1 -1
  230. package/lib/commands/project/upgrade.js +1 -1
  231. package/lib/commands/registry.js +1 -1
  232. package/lib/commands/role/delete.js +1 -1
  233. package/lib/commands/role/detail.js +1 -1
  234. package/lib/commands/role/index.js +1 -1
  235. package/lib/commands/role/list.js +1 -1
  236. package/lib/commands/role/shared.js +1 -1
  237. package/lib/commands/role/update.js +1 -1
  238. package/lib/commands/role/user-add.js +1 -1
  239. package/lib/commands/role/user-remove.js +1 -1
  240. package/lib/commands/role/user-resolve.js +1 -1
  241. package/lib/commands/rule/get.js +1 -1
  242. package/lib/commands/rule/index.js +1 -1
  243. package/lib/commands/rule/list.js +1 -1
  244. package/lib/commands/rule/set.js +1 -1
  245. package/lib/commands/rule/shared.js +1 -1
  246. package/lib/commands/run/index.js +1 -1
  247. package/lib/commands/schema.js +1 -1
  248. package/lib/commands/sql/create.js +1 -1
  249. package/lib/commands/sql/delete.js +1 -1
  250. package/lib/commands/sql/detail.js +1 -1
  251. package/lib/commands/sql/exec.js +1 -1
  252. package/lib/commands/sql/index.js +1 -1
  253. package/lib/commands/sql/list.js +1 -1
  254. package/lib/commands/sql/pull.js +1 -1
  255. package/lib/commands/sql/push.js +1 -1
  256. package/lib/commands/sql/shared.js +1 -1
  257. package/lib/commands/sql/status.js +1 -1
  258. package/lib/commands/sql/validate.js +1 -1
  259. package/lib/commands/task/index.js +1 -1
  260. package/lib/commands/task/status.js +1 -1
  261. package/lib/commands/tenant/index.js +1 -1
  262. package/lib/commands/tenant/members-list.js +1 -1
  263. package/lib/commands/tenant/shared.js +1 -1
  264. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  265. package/lib/commands/user-account/feishu-bind.js +1 -1
  266. package/lib/commands/user-account/index.js +1 -1
  267. package/lib/commands/workspace/add.js +1 -1
  268. package/lib/commands/workspace/index.js +1 -1
  269. package/lib/commands/workspace/remove.js +1 -1
  270. package/lib/config/domain-config.js +1 -1
  271. package/lib/config/project-domain-routing.js +1 -1
  272. package/lib/config/region-config.js +1 -1
  273. package/lib/config/schema.js +1 -1
  274. package/lib/constant/cdn.js +1 -1
  275. package/lib/constant/cli.js +1 -1
  276. package/lib/constant/defaults.js +1 -1
  277. package/lib/constant/domain.js +1 -1
  278. package/lib/constant/env.js +1 -1
  279. package/lib/constant/output.js +1 -1
  280. package/lib/constant/paths.js +1 -1
  281. package/lib/constant/region.js +1 -1
  282. package/lib/constant/risk.js +1 -1
  283. package/lib/constant/routing-profile.js +1 -1
  284. package/lib/context/app-resolver.js +1 -1
  285. package/lib/context/auth-resolver.js +1 -1
  286. package/lib/context/config-loader.js +1 -1
  287. package/lib/context.js +1 -1
  288. package/lib/core/alias-resolver.js +1 -1
  289. package/lib/core/api-client.js +1 -1
  290. package/lib/core/bff/config.js +1 -1
  291. package/lib/core/bff/file-system.js +1 -1
  292. package/lib/core/bff/hash.js +1 -1
  293. package/lib/core/bff/hook-directory.js +1 -1
  294. package/lib/core/bff/lock.js +1 -1
  295. package/lib/core/bff/utils.js +1 -1
  296. package/lib/core/cross-db-analysis.js +1 -1
  297. package/lib/core/cross-db-relation.js +1 -1
  298. package/lib/core/db-resolver.js +1 -1
  299. package/lib/core/flow-config.js +1 -1
  300. package/lib/core/instant-api-policy/config.js +1 -1
  301. package/lib/core/kb-management-client.js +1 -1
  302. package/lib/core/kb-search-client.js +1 -1
  303. package/lib/core/page/file-system.js +1 -1
  304. package/lib/core/page/hash.js +1 -1
  305. package/lib/core/page/lock.js +1 -1
  306. package/lib/core/page/lr-smart-jsx.js +1 -1
  307. package/lib/core/sql-index-auditor.js +1 -1
  308. package/lib/core/sql-sync/config.js +1 -1
  309. package/lib/core/sql-sync/file-system.js +1 -1
  310. package/lib/core/sql-sync/hash.js +1 -1
  311. package/lib/core/sql-sync/lock.js +1 -1
  312. package/lib/core/sql-sync/utils.js +1 -1
  313. package/lib/core/sql-validator.js +1 -1
  314. package/lib/errors.js +1 -1
  315. package/lib/framework/build-all-flags.js +1 -1
  316. package/lib/framework/error-output.js +1 -1
  317. package/lib/framework/explicit-yes.js +1 -1
  318. package/lib/framework/flags.js +1 -1
  319. package/lib/framework/help.js +1 -1
  320. package/lib/framework/index.js +1 -1
  321. package/lib/framework/output.js +1 -1
  322. package/lib/framework/response.js +1 -1
  323. package/lib/framework/runner-alias.js +1 -1
  324. package/lib/framework/runner.js +1 -1
  325. package/lib/framework/schema-export.js +1 -1
  326. package/lib/framework/supported-flags.js +1 -1
  327. package/lib/framework/types.js +1 -1
  328. package/lib/generated/build-info.d.ts +4 -4
  329. package/lib/generated/build-info.js +1 -1
  330. package/lib/generated/official-routing.js +1 -1
  331. package/lib/generated/routing-contract.js +1 -1
  332. package/lib/help.js +1 -1
  333. package/lib/postinstall.js +1 -1
  334. package/lib/runtime/confirmation.js +1 -1
  335. package/lib/runtime/event.js +1 -1
  336. package/lib/runtime/index.js +1 -1
  337. package/lib/runtime/queue.js +1 -1
  338. package/lib/runtime/resolve.js +1 -1
  339. package/lib/services/dataset-design/checkpoint.js +1 -1
  340. package/lib/services/dataset-design/commands.js +1 -1
  341. package/lib/services/dataset-design/contract.js +1 -1
  342. package/lib/skills/builtin-skill.js +1 -1
  343. package/lib/skills/main.js +1 -1
  344. package/lib/skills/npx-skills-add.js +1 -1
  345. package/lib/skills/skill-presence.js +1 -1
  346. package/lib/telemetry/cli-command-trace.js +1 -1
  347. package/lib/telemetry/cli-help-trace.js +1 -1
  348. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  349. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  350. package/lib/telemetry/send-cli-trace-log.js +1 -1
  351. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  352. package/lib/utils/ai_config.js +1 -1
  353. package/lib/utils/apply-jq-filter.js +1 -1
  354. package/lib/utils/cdn-config.js +1 -1
  355. package/lib/utils/check-sdk-version.js +1 -1
  356. package/lib/utils/cli-version-check.js +1 -1
  357. package/lib/utils/cli-version-policy.js +1 -1
  358. package/lib/utils/config.js +1 -1
  359. package/lib/utils/entity-with-id.js +1 -1
  360. package/lib/utils/file-utils.js +1 -1
  361. package/lib/utils/guides-cdn.js +1 -1
  362. package/lib/utils/http-client.js +1 -1
  363. package/lib/utils/is-non-interactive.js +1 -1
  364. package/lib/utils/logger.js +1 -1
  365. package/lib/utils/params.js +1 -1
  366. package/lib/utils/platform.js +1 -1
  367. package/lib/utils/sleep.js +1 -1
  368. package/lib/utils/template-replacer.js +1 -1
  369. package/lib/utils/update-notice.js +1 -1
  370. package/lib/utils/version.js +1 -1
  371. package/lib/utils/with-active-cookie.js +1 -1
  372. package/lib/utils/write-cli-side-channel.js +1 -1
  373. package/package.json +2 -2
  374. package/skills/rabetbase/SKILL.md +2 -2
  375. package/skills/rabetbase-dataset-generation/SKILL.md +2 -2
  376. package/skills/rabetbase-page-generation/SKILL.md +2 -2
  377. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a34_0x41d1c8=a34_0x36c1;function a34_0x303b(){const _0x5a6949=['set','1728846mYHXRP','Read\x20config\x20value\x20from\x20file','Updated','get','/smartapi/app-config/update','84ATwJVy','appCode','number','605257BUqqZu','create','168xqTZtY','27668lNyyRT','44550zsyvbR','20MHPkWY','50967onKrpC',',\x20appCode=','POST','write','App\x20config\x20server\x20id\x20missing\x20for\x20key=','Created','apiError','2305440NwtlIQ','tags','576570uzziIw','12giMUUI','update','string','\x20app\x20config\x20','app-config','/smartapi/app-config/create','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','file'];a34_0x303b=function(){return _0x5a6949;};return a34_0x303b();}(function(_0x3513ea,_0x4ea739){const _0x4cc84a=a34_0x36c1,_0x2ea9b9=_0x3513ea();while(!![]){try{const _0x409fbe=-parseInt(_0x4cc84a(0xa0))/0x1+-parseInt(_0x4cc84a(0xa3))/0x2*(-parseInt(_0x4cc84a(0xbe))/0x3)+parseInt(_0x4cc84a(0xad))/0x4+parseInt(_0x4cc84a(0xaf))/0x5*(-parseInt(_0x4cc84a(0xb0))/0x6)+parseInt(_0x4cc84a(0xa6))/0x7*(-parseInt(_0x4cc84a(0xa2))/0x8)+-parseInt(_0x4cc84a(0xb9))/0x9*(-parseInt(_0x4cc84a(0xa5))/0xa)+-parseInt(_0x4cc84a(0xa4))/0xb;if(_0x409fbe===_0x4ea739)break;else _0x2ea9b9['push'](_0x2ea9b9['shift']());}catch(_0x4f7718){_0x2ea9b9['push'](_0x2ea9b9['shift']());}}}(a34_0x303b,0x56af8));function a34_0x36c1(_0x92d5e9,_0x58ab15){_0x92d5e9=_0x92d5e9-0xa0;const _0x303b39=a34_0x303b();let _0x36c14f=_0x303b39[_0x92d5e9];return _0x36c14f;}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=a34_0x41d1c8(0xb5),UPDATE_PATH=a34_0x41d1c8(0xbd);export const appConfigSet={'service':a34_0x41d1c8(0xb4),'command':a34_0x41d1c8(0xb8),'description':a34_0x41d1c8(0xb6),'risk':a34_0x41d1c8(0xa9),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x41d1c8(0xb7),'type':a34_0x41d1c8(0xb2),'description':a34_0x41d1c8(0xba)}],async 'validate'(_0x3a6ca8){readKeyArg(_0x3a6ca8),readOptionalTags(_0x3a6ca8),assertSingleValueSource(_0x3a6ca8);},async 'dryRun'(_0x3d3bef){const _0x12e064=a34_0x41d1c8,_0x220275=readKeyArg(_0x3d3bef),_0x46f25e=readOptionalTags(_0x3d3bef),_0x16a69f=assertSingleValueSource(_0x3d3bef);await assertValueSourceReadable(_0x16a69f);const _0x18984a=await withAppConfigApiBoundary(_0x12e064(0xbc),{'appCode':_0x3d3bef[_0x12e064(0xbf)],'key':_0x220275},()=>getAppConfigByKey(_0x3d3bef[_0x12e064(0xbf)],_0x220275)),_0x5a335b=_0x18984a?_0x12e064(0xb1):_0x12e064(0xa1),_0xca868=_0x18984a?projectAppConfig(_0x18984a):null,_0x318627=plannedAppConfig({'appCode':_0x3d3bef[_0x12e064(0xbf)],'key':_0x220275,'tags':_0x46f25e??_0x18984a?.[_0x12e064(0xae)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x5a335b,'appCode':_0x3d3bef[_0x12e064(0xbf)],'key':_0x220275,'before':_0xca868,'after':_0x318627,'dryRun':!![]}),{'method':_0x12e064(0xa8),'url':_0x5a335b==='update'?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0xacf481){const _0x1146e3=a34_0x41d1c8,_0x44da8c=readKeyArg(_0xacf481),_0x1f7261=readOptionalTags(_0xacf481),_0x36edcc=await withAppConfigApiBoundary(_0x1146e3(0xbc),{'appCode':_0xacf481[_0x1146e3(0xbf)],'key':_0x44da8c},()=>getAppConfigByKey(_0xacf481[_0x1146e3(0xbf)],_0x44da8c)),_0x3f8629=_0x36edcc?projectAppConfig(_0x36edcc):null,_0xd28489=_0x36edcc?_0x1146e3(0xb1):_0x1146e3(0xa1),{value:_0x21102f,warnings:_0x2fd1fb}=await readAppConfigValue(_0xacf481),_0x3bbae3={'appCode':_0xacf481[_0x1146e3(0xbf)],'key':_0x44da8c,'value':_0x21102f,'tags':_0x1f7261??_0x36edcc?.['tags']??undefined};await withAppConfigApiBoundary(_0xd28489,{'appCode':_0xacf481[_0x1146e3(0xbf)],'key':_0x44da8c},async()=>{const _0x26c874=_0x1146e3;_0x36edcc?await updateAppConfig({..._0x3bbae3,'id':requireAppConfigId(_0x36edcc,_0x44da8c,_0xacf481[_0x26c874(0xbf)])}):await createAppConfig(_0x3bbae3);});const _0xa44135=await withAppConfigApiBoundary(_0x1146e3(0xbc),{'appCode':_0xacf481[_0x1146e3(0xbf)],'key':_0x44da8c},()=>getAppConfigByKey(_0xacf481['appCode'],_0x44da8c)),_0x2cc270=_0xa44135?projectAppConfig(_0xa44135):plannedAppConfig({'appCode':_0xacf481[_0x1146e3(0xbf)],'key':_0x44da8c,'tags':_0x3bbae3[_0x1146e3(0xae)],'hasValue':_0x21102f!==''});return{'ok':!![],'data':buildMutationData({'operation':_0xd28489,'appCode':_0xacf481[_0x1146e3(0xbf)],'key':_0x44da8c,'before':_0x3f8629,'after':_0x2cc270,'dryRun':![],'warnings':_0x2fd1fb}),'message':(_0xd28489===_0x1146e3(0xb1)?_0x1146e3(0xbb):_0x1146e3(0xab))+_0x1146e3(0xb3)+_0x44da8c};}};function requireAppConfigId(_0x2bc81c,_0x5c9440,_0x3425b0){const _0x3a9e93=a34_0x41d1c8;if(typeof _0x2bc81c['id']===_0x3a9e93(0xc0)&&Number['isFinite'](_0x2bc81c['id'])&&_0x2bc81c['id']>0x0)return _0x2bc81c['id'];throw CliErrors[_0x3a9e93(0xac)](_0x3a9e93(0xaa)+_0x5c9440+_0x3a9e93(0xa7)+_0x3425b0);}
1
+ function a34_0x3bb6(){const _0x3b8eb1=['app-config','update','apiError','Updated','3287424IgYQwp','POST','\x20app\x20config\x20',',\x20appCode=','196zMWnlM','App\x20config\x20server\x20id\x20missing\x20for\x20key=','isFinite','string','9422fJNLIc','2880445gPeDNT','65829XOSmKX','create','Created','write','1347378JLIfgm','1650604fnEKtC','tags','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','Read\x20config\x20value\x20from\x20file','19235079oaIEYa','/smartapi/app-config/update','number','get','/smartapi/app-config/create','appCode','5190bZZIqj'];a34_0x3bb6=function(){return _0x3b8eb1;};return a34_0x3bb6();}const a34_0x4416e6=a34_0x4067;(function(_0x29feea,_0x3e4051){const _0xd9d596=a34_0x4067,_0x46bb15=_0x29feea();while(!![]){try{const _0x364e69=-parseInt(_0xd9d596(0x102))/0x1+parseInt(_0xd9d596(0x101))/0x2+-parseInt(_0xd9d596(0xfd))/0x3*(-parseInt(_0xd9d596(0x115))/0x4)+-parseInt(_0xd9d596(0xfc))/0x5+-parseInt(_0xd9d596(0x10c))/0x6*(parseInt(_0xd9d596(0xfb))/0x7)+parseInt(_0xd9d596(0x111))/0x8+parseInt(_0xd9d596(0x106))/0x9;if(_0x364e69===_0x3e4051)break;else _0x46bb15['push'](_0x46bb15['shift']());}catch(_0x1647ef){_0x46bb15['push'](_0x46bb15['shift']());}}}(a34_0x3bb6,0xdd358));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';function a34_0x4067(_0x1f3fc1,_0x2a2e22){_0x1f3fc1=_0x1f3fc1-0xf9;const _0x3bb6fc=a34_0x3bb6();let _0x40676e=_0x3bb6fc[_0x1f3fc1];return _0x40676e;}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a34_0x4416e6(0x10a),UPDATE_PATH=a34_0x4416e6(0x107);export const appConfigSet={'service':a34_0x4416e6(0x10d),'command':'set','description':a34_0x4416e6(0x104),'risk':a34_0x4416e6(0x100),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':'file','type':a34_0x4416e6(0xfa),'description':a34_0x4416e6(0x105)}],async 'validate'(_0x4474b3){readKeyArg(_0x4474b3),readOptionalTags(_0x4474b3),assertSingleValueSource(_0x4474b3);},async 'dryRun'(_0x1b56c6){const _0xd10afb=a34_0x4416e6,_0x450b11=readKeyArg(_0x1b56c6),_0x26ac17=readOptionalTags(_0x1b56c6),_0x2c50ef=assertSingleValueSource(_0x1b56c6);await assertValueSourceReadable(_0x2c50ef);const _0x53bd96=await withAppConfigApiBoundary(_0xd10afb(0x109),{'appCode':_0x1b56c6[_0xd10afb(0x10b)],'key':_0x450b11},()=>getAppConfigByKey(_0x1b56c6[_0xd10afb(0x10b)],_0x450b11)),_0xddb109=_0x53bd96?_0xd10afb(0x10e):_0xd10afb(0xfe),_0x25516f=_0x53bd96?projectAppConfig(_0x53bd96):null,_0x10b519=plannedAppConfig({'appCode':_0x1b56c6[_0xd10afb(0x10b)],'key':_0x450b11,'tags':_0x26ac17??_0x53bd96?.['tags'],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0xddb109,'appCode':_0x1b56c6[_0xd10afb(0x10b)],'key':_0x450b11,'before':_0x25516f,'after':_0x10b519,'dryRun':!![]}),{'method':_0xd10afb(0x112),'url':_0xddb109===_0xd10afb(0x10e)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x1f336a){const _0x3a4204=a34_0x4416e6,_0x3bdba0=readKeyArg(_0x1f336a),_0x586922=readOptionalTags(_0x1f336a),_0x53ccc3=await withAppConfigApiBoundary('get',{'appCode':_0x1f336a[_0x3a4204(0x10b)],'key':_0x3bdba0},()=>getAppConfigByKey(_0x1f336a['appCode'],_0x3bdba0)),_0x1f1b07=_0x53ccc3?projectAppConfig(_0x53ccc3):null,_0x5508d9=_0x53ccc3?_0x3a4204(0x10e):_0x3a4204(0xfe),{value:_0xb06594,warnings:_0x2e8fb7}=await readAppConfigValue(_0x1f336a),_0x30d28a={'appCode':_0x1f336a['appCode'],'key':_0x3bdba0,'value':_0xb06594,'tags':_0x586922??_0x53ccc3?.[_0x3a4204(0x103)]??undefined};await withAppConfigApiBoundary(_0x5508d9,{'appCode':_0x1f336a[_0x3a4204(0x10b)],'key':_0x3bdba0},async()=>{const _0x49de25=_0x3a4204;_0x53ccc3?await updateAppConfig({..._0x30d28a,'id':requireAppConfigId(_0x53ccc3,_0x3bdba0,_0x1f336a[_0x49de25(0x10b)])}):await createAppConfig(_0x30d28a);});const _0x5773fb=await withAppConfigApiBoundary('get',{'appCode':_0x1f336a[_0x3a4204(0x10b)],'key':_0x3bdba0},()=>getAppConfigByKey(_0x1f336a['appCode'],_0x3bdba0)),_0x5486f6=_0x5773fb?projectAppConfig(_0x5773fb):plannedAppConfig({'appCode':_0x1f336a['appCode'],'key':_0x3bdba0,'tags':_0x30d28a[_0x3a4204(0x103)],'hasValue':_0xb06594!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x5508d9,'appCode':_0x1f336a[_0x3a4204(0x10b)],'key':_0x3bdba0,'before':_0x1f1b07,'after':_0x5486f6,'dryRun':![],'warnings':_0x2e8fb7}),'message':(_0x5508d9===_0x3a4204(0x10e)?_0x3a4204(0x110):_0x3a4204(0xff))+_0x3a4204(0x113)+_0x3bdba0};}};function requireAppConfigId(_0x283d0,_0x4c1888,_0x11e631){const _0x2e2982=a34_0x4416e6;if(typeof _0x283d0['id']===_0x2e2982(0x108)&&Number[_0x2e2982(0xf9)](_0x283d0['id'])&&_0x283d0['id']>0x0)return _0x283d0['id'];throw CliErrors[_0x2e2982(0x10f)](_0x2e2982(0x116)+_0x4c1888+_0x2e2982(0x114)+_0x11e631);}
@@ -1 +1 @@
1
- const a35_0x2b7b57=a35_0x539e;(function(_0x1ecaa7,_0x5b4ee9){const _0x144478=a35_0x539e,_0x20120b=_0x1ecaa7();while(!![]){try{const _0x449d0f=-parseInt(_0x144478(0x1d3))/0x1+parseInt(_0x144478(0x1b4))/0x2*(-parseInt(_0x144478(0x1b9))/0x3)+-parseInt(_0x144478(0x19f))/0x4*(parseInt(_0x144478(0x199))/0x5)+-parseInt(_0x144478(0x1a2))/0x6*(-parseInt(_0x144478(0x1ae))/0x7)+-parseInt(_0x144478(0x1b1))/0x8+-parseInt(_0x144478(0x1bc))/0x9*(-parseInt(_0x144478(0x19d))/0xa)+parseInt(_0x144478(0x1a9))/0xb;if(_0x449d0f===_0x5b4ee9)break;else _0x20120b['push'](_0x20120b['shift']());}catch(_0x480651){_0x20120b['push'](_0x20120b['shift']());}}}(a35_0x5cd7,0x9dd8f));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':a35_0x2b7b57(0x1ad),'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':a35_0x2b7b57(0x1c8),'type':a35_0x2b7b57(0x19a),'description':a35_0x2b7b57(0x1c7)};export const STDIN_FLAG={'name':'stdin','type':a35_0x2b7b57(0x1c3),'description':a35_0x2b7b57(0x1b7),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x2b7b57(0x1c9),'type':a35_0x2b7b57(0x19a),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a35_0x2b7b57(0x1ce),'type':a35_0x2b7b57(0x1c3),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x4c1c5a){const _0x42e734=a35_0x2b7b57,_0x11d476=_0x4c1c5a[_0x42e734(0x1d0)][0x0]?.['trim']()??'';return validateKey(_0x11d476),_0x11d476;}export function readOptionalTags(_0x49f4fe){const _0x3d7da7=a35_0x2b7b57,_0x44e6e7=_0x49f4fe[_0x3d7da7(0x1bf)](_0x3d7da7(0x1c8))[_0x3d7da7(0x1c2)]();if(!_0x44e6e7)return undefined;if(_0x44e6e7[_0x3d7da7(0x1b5)]>0x20)throw CliErrors[_0x3d7da7(0x19c)](_0x3d7da7(0x1d5));return _0x44e6e7;}function a35_0x5cd7(){const _0x565842=['reveal','name','args','Failed\x20to\x20','setEncoding','747840CRwbRM','valueRedacted','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','path','Value\x20file\x20is\x20not\x20readable:\x20','error','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','key','Missing\x20app-config\x20key.','3850PxNYIN','string','after','validation','670Iqtjwi','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','6196KjXZlw','defineProperties','stdin','12894YGuorD','Missing\x20app-config\x20value\x20source.','Environment\x20variable\x20is\x20not\x20set:\x20','env','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','before','file','43437372PjVfdA','warnings','App\x20config\x20value\x20source\x20is\x20ambiguous.','operation','Runtime\x20app-config\x20key','574yuOfFo','appCode:\x20','method','6058992PcoIpA','dryRun','hasValue','6FmkOzT','length','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Read\x20config\x20value\x20from\x20stdin','kind','1040811rQRkTZ','appCode','utf8','34956GdyPGJ','bool','argument','str','value','once','trim','boolean','push','key:\x20','join','Config\x20tags\x20for\x20filtering/display\x20metadata','tags','from-env','value\x20is\x20redacted','data','apiError','slice'];a35_0x5cd7=function(){return _0x565842;};return a35_0x5cd7();}export function validateKey(_0x2a7128){const _0x1fd33a=a35_0x2b7b57;if(!_0x2a7128)throw CliErrors[_0x1fd33a(0x19c)](_0x1fd33a(0x198));if(_0x2a7128[_0x1fd33a(0x1b5)]>0x100)throw CliErrors[_0x1fd33a(0x19c)](_0x1fd33a(0x196));}export function projectAppConfig(_0xd65011,_0xc0287f){const _0x437121=a35_0x2b7b57,_0x55550d=_0xd65011['value']!==undefined&&_0xd65011[_0x437121(0x1c0)]!==null&&_0xd65011[_0x437121(0x1c0)]!=='',_0x5efac9={'appCode':_0xd65011[_0x437121(0x1ba)],'key':_0xd65011[_0x437121(0x197)],'tags':_0xd65011['tags']??undefined,'hasValue':_0x55550d,'valueRedacted':_0x55550d&&!_0xc0287f?.['reveal'],'gmtCreate':_0xd65011['gmtCreate'],'gmtModified':_0xd65011['gmtModified']};return _0xc0287f?.[_0x437121(0x1ce)]&&(_0x5efac9[_0x437121(0x1c0)]=_0xd65011[_0x437121(0x1c0)]??'',_0x5efac9[_0x437121(0x1d4)]=![]),_0x5efac9;}export function plannedAppConfig(_0x31bd77){const _0xef248e=a35_0x2b7b57,_0x115886=_0x31bd77[_0xef248e(0x1b3)]??!![];return{'appCode':_0x31bd77[_0xef248e(0x1ba)],'key':_0x31bd77[_0xef248e(0x197)],'tags':_0x31bd77[_0xef248e(0x1c8)]??undefined,'hasValue':_0x115886,'valueRedacted':_0x115886};}export function buildMutationData(_0x9a7d0){const _0x565367=a35_0x2b7b57;return{'operation':_0x9a7d0[_0x565367(0x1ac)],'selector':{'appCode':_0x9a7d0['appCode'],'key':_0x9a7d0['key']},'before':_0x9a7d0[_0x565367(0x1a7)],'after':_0x9a7d0[_0x565367(0x19b)],'dryRun':_0x9a7d0[_0x565367(0x1b2)],'warnings':_0x9a7d0[_0x565367(0x1aa)]??[]};}function a35_0x539e(_0x5387f9,_0x26bdc9){_0x5387f9=_0x5387f9-0x194;const _0x5cd774=a35_0x5cd7();let _0x539e0d=_0x5cd774[_0x5387f9];return _0x539e0d;}export async function withAppConfigApiBoundary(_0x11ade4,_0x249c61,_0x218a34){const _0x2534cb=a35_0x2b7b57;try{return await _0x218a34();}catch{const _0x7ee5c8=[_0x2534cb(0x1af)+_0x249c61[_0x2534cb(0x1ba)]];if(_0x249c61[_0x2534cb(0x197)])_0x7ee5c8[_0x2534cb(0x1c4)](_0x2534cb(0x1c5)+_0x249c61[_0x2534cb(0x197)]);_0x7ee5c8[_0x2534cb(0x1c4)](_0x2534cb(0x1ca));throw CliErrors[_0x2534cb(0x1cc)](_0x2534cb(0x1d1)+_0x11ade4+'\x20app\x20config.',_0x7ee5c8[_0x2534cb(0x1c6)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x4459be,_0x3a8af5){const _0x493cc3=a35_0x2b7b57;return Object[_0x493cc3(0x1a0)](_0x4459be,{'method':{'value':_0x3a8af5[_0x493cc3(0x1b0)],'enumerable':![]},'url':{'value':_0x3a8af5['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x555e15){const _0x458f43=a35_0x2b7b57,_0x586af8=[];_0x555e15['args'][_0x458f43(0x1b5)]>0x1&&_0x586af8[_0x458f43(0x1c4)]({'kind':_0x458f43(0x1be),'value':_0x555e15[_0x458f43(0x1d0)][_0x458f43(0x1cd)](0x1)['join']('\x20')});const _0x369244=_0x555e15['flag'](_0x458f43(0x1c0));_0x369244!==undefined&&_0x369244!==null&&_0x586af8[_0x458f43(0x1c4)]({'kind':'argument','value':String(_0x369244)});_0x555e15[_0x458f43(0x1bd)]('stdin')&&_0x586af8[_0x458f43(0x1c4)]({'kind':_0x458f43(0x1a1)});const _0x4e44d4=_0x555e15[_0x458f43(0x1bf)](_0x458f43(0x1c9))[_0x458f43(0x1c2)]();_0x4e44d4&&_0x586af8[_0x458f43(0x1c4)]({'kind':_0x458f43(0x1a5),'name':_0x4e44d4});const _0x538109=_0x555e15[_0x458f43(0x1bf)]('file')[_0x458f43(0x1c2)]();_0x538109&&_0x586af8[_0x458f43(0x1c4)]({'kind':_0x458f43(0x1a8),'path':_0x538109});if(_0x586af8[_0x458f43(0x1b5)]===0x0)throw CliErrors['validation'](_0x458f43(0x1a3),_0x458f43(0x19e));if(_0x586af8[_0x458f43(0x1b5)]>0x1)throw CliErrors[_0x458f43(0x19c)](_0x458f43(0x1ab),_0x458f43(0x1a6));return _0x586af8[0x0];}export async function assertValueSourceReadable(_0xbbbe48){const _0x1830c8=a35_0x2b7b57;if(_0xbbbe48[_0x1830c8(0x1b8)]===_0x1830c8(0x1a5)&&!(_0xbbbe48[_0x1830c8(0x1cf)]in process.env))throw CliErrors[_0x1830c8(0x19c)](_0x1830c8(0x1a4)+_0xbbbe48['name']);if(_0xbbbe48['kind']===_0x1830c8(0x1a8))try{await access(_0xbbbe48['path']);}catch{throw CliErrors['validation'](_0x1830c8(0x194)+_0xbbbe48[_0x1830c8(0x1d6)]);}}export async function readAppConfigValue(_0x2db352){const _0x1fec3e=a35_0x2b7b57,_0x295e9d=assertSingleValueSource(_0x2db352),_0x2d5355=[];if(_0x295e9d[_0x1fec3e(0x1b8)]==='argument')return _0x2d5355[_0x1fec3e(0x1c4)](_0x1fec3e(0x1b6)),{'value':_0x295e9d['value']??'','source':_0x295e9d[_0x1fec3e(0x1b8)],'warnings':_0x2d5355};if(_0x295e9d[_0x1fec3e(0x1b8)]==='stdin')return{'value':await readStdin(),'source':_0x295e9d[_0x1fec3e(0x1b8)],'warnings':_0x2d5355};if(_0x295e9d[_0x1fec3e(0x1b8)]===_0x1fec3e(0x1a5)){if(!(_0x295e9d[_0x1fec3e(0x1cf)]in process.env))throw CliErrors['validation'](_0x1fec3e(0x1a4)+_0x295e9d[_0x1fec3e(0x1cf)]);return{'value':process.env[_0x295e9d.name]??'','source':_0x295e9d[_0x1fec3e(0x1b8)],'warnings':_0x2d5355};}return{'value':await readFile(_0x295e9d[_0x1fec3e(0x1d6)],_0x1fec3e(0x1bb)),'source':_0x295e9d[_0x1fec3e(0x1b8)],'warnings':_0x2d5355};}function readStdin(){return new Promise((_0x7d12a6,_0x4143e1)=>{const _0x23ec0b=a35_0x539e;let _0x2d152d='';process['stdin'][_0x23ec0b(0x1d2)](_0x23ec0b(0x1bb)),process[_0x23ec0b(0x1a1)]['on'](_0x23ec0b(0x1cb),_0xedd1a7=>{_0x2d152d+=_0xedd1a7;}),process[_0x23ec0b(0x1a1)][_0x23ec0b(0x1c1)]('end',()=>_0x7d12a6(_0x2d152d)),process['stdin']['once'](_0x23ec0b(0x195),_0x4143e1);});}
1
+ const a35_0x22b607=a35_0x2b7b;(function(_0x5bbf97,_0x38ea2e){const _0x36f648=a35_0x2b7b,_0x15db83=_0x5bbf97();while(!![]){try{const _0xcbef62=-parseInt(_0x36f648(0x193))/0x1+parseInt(_0x36f648(0x1a4))/0x2*(-parseInt(_0x36f648(0x1ae))/0x3)+parseInt(_0x36f648(0x1a3))/0x4*(parseInt(_0x36f648(0x1ad))/0x5)+-parseInt(_0x36f648(0x1a2))/0x6*(-parseInt(_0x36f648(0x18c))/0x7)+parseInt(_0x36f648(0x199))/0x8*(-parseInt(_0x36f648(0x183))/0x9)+parseInt(_0x36f648(0x197))/0xa+parseInt(_0x36f648(0x187))/0xb*(parseInt(_0x36f648(0x1ab))/0xc);if(_0xcbef62===_0x38ea2e)break;else _0x15db83['push'](_0x15db83['shift']());}catch(_0x46282b){_0x15db83['push'](_0x15db83['shift']());}}}(a35_0x230e,0xd78af));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x22b607(0x177),'description':a35_0x22b607(0x17d),'required':!![]};export const VALUE_ARG={'name':a35_0x22b607(0x1b3),'description':a35_0x22b607(0x19c),'required':![]};export const TAGS_FLAG={'name':a35_0x22b607(0x192),'type':a35_0x22b607(0x1b1),'description':a35_0x22b607(0x1a0)};function a35_0x2b7b(_0x465e88,_0x4a966c){_0x465e88=_0x465e88-0x176;const _0x230e9e=a35_0x230e();let _0x2b7bfd=_0x230e9e[_0x465e88];return _0x2b7bfd;}export const STDIN_FLAG={'name':a35_0x22b607(0x176),'type':a35_0x22b607(0x1a8),'description':a35_0x22b607(0x1a5),'default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':a35_0x22b607(0x1b1),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a35_0x22b607(0x191),'type':a35_0x22b607(0x1a8),'description':a35_0x22b607(0x1af),'default':![]};export function readKeyArg(_0x2dff58){const _0x5a173a=a35_0x22b607,_0x4524fa=_0x2dff58[_0x5a173a(0x1ba)][0x0]?.[_0x5a173a(0x1ac)]()??'';return validateKey(_0x4524fa),_0x4524fa;}export function readOptionalTags(_0x18b0ef){const _0xc25d83=a35_0x22b607,_0x5671d9=_0x18b0ef[_0xc25d83(0x18b)]('tags')[_0xc25d83(0x1ac)]();if(!_0x5671d9)return undefined;if(_0x5671d9['length']>0x20)throw CliErrors[_0xc25d83(0x17c)](_0xc25d83(0x194));return _0x5671d9;}export function validateKey(_0x23db43){const _0x5622f5=a35_0x22b607;if(!_0x23db43)throw CliErrors[_0x5622f5(0x17c)](_0x5622f5(0x195));if(_0x23db43['length']>0x100)throw CliErrors[_0x5622f5(0x17c)](_0x5622f5(0x182));}export function projectAppConfig(_0x572348,_0x52d394){const _0xdb3da3=a35_0x22b607,_0x1acb6f=_0x572348['value']!==undefined&&_0x572348['value']!==null&&_0x572348[_0xdb3da3(0x1b3)]!=='',_0x1f9428={'appCode':_0x572348[_0xdb3da3(0x1aa)],'key':_0x572348[_0xdb3da3(0x177)],'tags':_0x572348[_0xdb3da3(0x192)]??undefined,'hasValue':_0x1acb6f,'valueRedacted':_0x1acb6f&&!_0x52d394?.['reveal'],'gmtCreate':_0x572348[_0xdb3da3(0x181)],'gmtModified':_0x572348[_0xdb3da3(0x19f)]};return _0x52d394?.[_0xdb3da3(0x191)]&&(_0x1f9428[_0xdb3da3(0x1b3)]=_0x572348[_0xdb3da3(0x1b3)]??'',_0x1f9428[_0xdb3da3(0x1b8)]=![]),_0x1f9428;}export function plannedAppConfig(_0x41e0de){const _0x3c179c=a35_0x22b607,_0x583587=_0x41e0de['hasValue']??!![];return{'appCode':_0x41e0de[_0x3c179c(0x1aa)],'key':_0x41e0de['key'],'tags':_0x41e0de[_0x3c179c(0x192)]??undefined,'hasValue':_0x583587,'valueRedacted':_0x583587};}export function buildMutationData(_0x46aa9f){const _0x1c32a7=a35_0x22b607;return{'operation':_0x46aa9f[_0x1c32a7(0x1b2)],'selector':{'appCode':_0x46aa9f[_0x1c32a7(0x1aa)],'key':_0x46aa9f[_0x1c32a7(0x177)]},'before':_0x46aa9f[_0x1c32a7(0x1b9)],'after':_0x46aa9f[_0x1c32a7(0x18a)],'dryRun':_0x46aa9f['dryRun'],'warnings':_0x46aa9f[_0x1c32a7(0x198)]??[]};}export async function withAppConfigApiBoundary(_0x543867,_0x5a2bac,_0xef3674){const _0x454f58=a35_0x22b607;try{return await _0xef3674();}catch{const _0xab6484=[_0x454f58(0x1b6)+_0x5a2bac['appCode']];if(_0x5a2bac['key'])_0xab6484[_0x454f58(0x186)]('key:\x20'+_0x5a2bac[_0x454f58(0x177)]);_0xab6484[_0x454f58(0x186)](_0x454f58(0x1bc));throw CliErrors[_0x454f58(0x1a7)](_0x454f58(0x1b5)+_0x543867+_0x454f58(0x17f),_0xab6484['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x49dfc7,_0x1fbb9d){const _0x3cb98f=a35_0x22b607;return Object[_0x3cb98f(0x17a)](_0x49dfc7,{'method':{'value':_0x1fbb9d['method'],'enumerable':![]},'url':{'value':_0x1fbb9d[_0x3cb98f(0x1a9)],'enumerable':![]}});}export function assertSingleValueSource(_0x481db7){const _0x6a003b=a35_0x22b607,_0x3abcc6=[];_0x481db7['args'][_0x6a003b(0x18f)]>0x1&&_0x3abcc6[_0x6a003b(0x186)]({'kind':'argument','value':_0x481db7[_0x6a003b(0x1ba)][_0x6a003b(0x178)](0x1)[_0x6a003b(0x1a6)]('\x20')});const _0xbadddc=_0x481db7[_0x6a003b(0x1b4)](_0x6a003b(0x1b3));_0xbadddc!==undefined&&_0xbadddc!==null&&_0x3abcc6['push']({'kind':_0x6a003b(0x19b),'value':String(_0xbadddc)});_0x481db7[_0x6a003b(0x184)](_0x6a003b(0x176))&&_0x3abcc6['push']({'kind':'stdin'});const _0x2385e8=_0x481db7[_0x6a003b(0x18b)]('from-env')[_0x6a003b(0x1ac)]();_0x2385e8&&_0x3abcc6[_0x6a003b(0x186)]({'kind':_0x6a003b(0x180),'name':_0x2385e8});const _0x135654=_0x481db7[_0x6a003b(0x18b)](_0x6a003b(0x185))[_0x6a003b(0x1ac)]();_0x135654&&_0x3abcc6['push']({'kind':_0x6a003b(0x185),'path':_0x135654});if(_0x3abcc6[_0x6a003b(0x18f)]===0x0)throw CliErrors['validation'](_0x6a003b(0x190),_0x6a003b(0x19e));if(_0x3abcc6[_0x6a003b(0x18f)]>0x1)throw CliErrors[_0x6a003b(0x17c)](_0x6a003b(0x18e),_0x6a003b(0x1b7));return _0x3abcc6[0x0];}export async function assertValueSourceReadable(_0x21675a){const _0x2041dc=a35_0x22b607;if(_0x21675a['kind']===_0x2041dc(0x180)&&!(_0x21675a[_0x2041dc(0x17e)]in process.env))throw CliErrors['validation']('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x21675a[_0x2041dc(0x17e)]);if(_0x21675a[_0x2041dc(0x19a)]===_0x2041dc(0x185))try{await access(_0x21675a[_0x2041dc(0x188)]);}catch{throw CliErrors['validation'](_0x2041dc(0x17b)+_0x21675a['path']);}}export async function readAppConfigValue(_0x10e1de){const _0xd8a8d5=a35_0x22b607,_0x56eea3=assertSingleValueSource(_0x10e1de),_0x29a5b6=[];if(_0x56eea3[_0xd8a8d5(0x19a)]==='argument')return _0x29a5b6['push'](_0xd8a8d5(0x1a1)),{'value':_0x56eea3[_0xd8a8d5(0x1b3)]??'','source':_0x56eea3['kind'],'warnings':_0x29a5b6};if(_0x56eea3[_0xd8a8d5(0x19a)]===_0xd8a8d5(0x176))return{'value':await readStdin(),'source':_0x56eea3[_0xd8a8d5(0x19a)],'warnings':_0x29a5b6};if(_0x56eea3[_0xd8a8d5(0x19a)]===_0xd8a8d5(0x180)){if(!(_0x56eea3[_0xd8a8d5(0x17e)]in process.env))throw CliErrors[_0xd8a8d5(0x17c)](_0xd8a8d5(0x1bb)+_0x56eea3['name']);return{'value':process.env[_0x56eea3.name]??'','source':_0x56eea3[_0xd8a8d5(0x19a)],'warnings':_0x29a5b6};}return{'value':await readFile(_0x56eea3[_0xd8a8d5(0x188)],'utf8'),'source':_0x56eea3[_0xd8a8d5(0x19a)],'warnings':_0x29a5b6};}function a35_0x230e(){const _0x435402=['Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','6WElIxC','12DfbiiN','293174xSgoAY','Read\x20config\x20value\x20from\x20stdin','join','apiError','boolean','url','appCode','7459188aGNgbO','trim','2330560MnDJdE','27EuGkms','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','data','string','operation','value','flag','Failed\x20to\x20','appCode:\x20','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','valueRedacted','before','args','Environment\x20variable\x20is\x20not\x20set:\x20','value\x20is\x20redacted','stdin','key','slice','once','defineProperties','Value\x20file\x20is\x20not\x20readable:\x20','validation','Runtime\x20app-config\x20key','name','\x20app\x20config.','env','gmtCreate','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','1693530AipWWe','bool','file','push','22VlRKWW','path','error','after','str','10859422bobPbD','end','App\x20config\x20value\x20source\x20is\x20ambiguous.','length','Missing\x20app-config\x20value\x20source.','reveal','tags','1660998sNiGcI','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','Missing\x20app-config\x20key.','utf8','9874540zqGteA','warnings','56WnJIvg','kind','argument','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','setEncoding','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','gmtModified','Config\x20tags\x20for\x20filtering/display\x20metadata'];a35_0x230e=function(){return _0x435402;};return a35_0x230e();}function readStdin(){return new Promise((_0x53ae69,_0x1f721b)=>{const _0x1aad25=a35_0x2b7b;let _0x27c956='';process[_0x1aad25(0x176)][_0x1aad25(0x19d)](_0x1aad25(0x196)),process[_0x1aad25(0x176)]['on'](_0x1aad25(0x1b0),_0x1b5c2d=>{_0x27c956+=_0x1b5c2d;}),process[_0x1aad25(0x176)][_0x1aad25(0x179)](_0x1aad25(0x18d),()=>_0x53ae69(_0x27c956)),process[_0x1aad25(0x176)]['once'](_0x1aad25(0x189),_0x1f721b);});}
@@ -1 +1 @@
1
- function a36_0x18bb(_0x58af5a,_0x43eece){_0x58af5a=_0x58af5a-0xab;const _0x2ea1ac=a36_0x2ea1();let _0x18bb92=_0x2ea1ac[_0x58af5a];return _0x18bb92;}const a36_0x31ab15=a36_0x18bb;function a36_0x2ea1(){const _0x46de90=['../../auth/auth-server-ui.js','5193yWFcHc','2401854thTcFC','write','8zjHtpl','auth','Clear\x20login\x20session','yes','bool','logout','11040ohJwov','23815VOXnfd','!\x20Not\x20logged\x20in','137223TXwCXJ','4031140rvFClX','boolean','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','4BArUUp','171470OtQDuJ','1502496QlmheG','2930wbUpOB'];a36_0x2ea1=function(){return _0x46de90;};return a36_0x2ea1();}(function(_0x2113fe,_0x23aa57){const _0x1bd4b7=a36_0x18bb,_0x505700=_0x2113fe();while(!![]){try{const _0xa819e6=-parseInt(_0x1bd4b7(0xb2))/0x1*(parseInt(_0x1bd4b7(0xb1))/0x2)+parseInt(_0x1bd4b7(0xad))/0x3*(parseInt(_0x1bd4b7(0xb9))/0x4)+-parseInt(_0x1bd4b7(0xae))/0x5+-parseInt(_0x1bd4b7(0xb3))/0x6+parseInt(_0x1bd4b7(0xb7))/0x7+-parseInt(_0x1bd4b7(0xbf))/0x8*(-parseInt(_0x1bd4b7(0xb6))/0x9)+-parseInt(_0x1bd4b7(0xb4))/0xa*(-parseInt(_0x1bd4b7(0xab))/0xb);if(_0xa819e6===_0x23aa57)break;else _0x505700['push'](_0x505700['shift']());}catch(_0x27e65e){_0x505700['push'](_0x505700['shift']());}}}(a36_0x2ea1,0x71ad9));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':'Login\x20via\x20browser','risk':a36_0x31ab15(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x31ab15(0xbc),'type':a36_0x31ab15(0xaf),'description':a36_0x31ab15(0xb0),'default':![]}],async 'execute'(_0x108c43){const _0x2db976=a36_0x31ab15,{runAuthServer:_0x2ceec0}=await import(_0x2db976(0xb5));return await _0x2ceec0({'autoYes':_0x108c43[_0x2db976(0xbd)](_0x2db976(0xbc)),'nonInteractive':_0x108c43['nonInteractive']}),{'ok':!![]};}},{'service':a36_0x31ab15(0xba),'command':a36_0x31ab15(0xbe),'description':a36_0x31ab15(0xbb),'risk':a36_0x31ab15(0xb8),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4f3414){const _0x51dac3=a36_0x31ab15;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20Logged\x20out')):console['log'](_0x51dac3(0xac)),{'ok':!![]};}}];
1
+ function a36_0x32cd(_0x541207,_0x733a9e){_0x541207=_0x541207-0x160;const _0x34801f=a36_0x3480();let _0x32cdb8=_0x34801f[_0x541207];return _0x32cdb8;}const a36_0x516101=a36_0x32cd;(function(_0x11a821,_0x569dc1){const _0x10499f=a36_0x32cd,_0x3bf0da=_0x11a821();while(!![]){try{const _0x2e296e=parseInt(_0x10499f(0x16c))/0x1+-parseInt(_0x10499f(0x16d))/0x2*(parseInt(_0x10499f(0x164))/0x3)+-parseInt(_0x10499f(0x170))/0x4+parseInt(_0x10499f(0x173))/0x5*(-parseInt(_0x10499f(0x16b))/0x6)+-parseInt(_0x10499f(0x166))/0x7+-parseInt(_0x10499f(0x163))/0x8*(parseInt(_0x10499f(0x16a))/0x9)+parseInt(_0x10499f(0x169))/0xa*(parseInt(_0x10499f(0x171))/0xb);if(_0x2e296e===_0x569dc1)break;else _0x3bf0da['push'](_0x3bf0da['shift']());}catch(_0x487d9a){_0x3bf0da['push'](_0x3bf0da['shift']());}}}(a36_0x3480,0x1a894));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x3480(){const _0x2cfc25=['509668whFKpr','824813JDNncH','logout','569670vXRKyC','login','✓\x20Logged\x20out','log','!\x20Not\x20logged\x20in','bool','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','yes','boolean','392cwIJCr','36WzMgCc','../../auth/auth-server-ui.js','1213282CvSeUO','Clear\x20login\x20session','Login\x20via\x20browser','60LyBzuv','10629Bhjwlr','6XDzZap','142608SYFXBL','1878tfbCbl','auth','nonInteractive'];a36_0x3480=function(){return _0x2cfc25;};return a36_0x3480();}export const authDefinitions=[{'service':'auth','command':a36_0x516101(0x174),'description':a36_0x516101(0x168),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x516101(0x161),'type':a36_0x516101(0x162),'description':a36_0x516101(0x160),'default':![]}],async 'execute'(_0x61c8de){const _0x45c807=a36_0x516101,{runAuthServer:_0x53ceb5}=await import(_0x45c807(0x165));return await _0x53ceb5({'autoYes':_0x61c8de[_0x45c807(0x178)](_0x45c807(0x161)),'nonInteractive':_0x61c8de[_0x45c807(0x16f)]}),{'ok':!![]};}},{'service':a36_0x516101(0x16e),'command':a36_0x516101(0x172),'description':a36_0x516101(0x167),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b8feb){const _0x5f1e53=a36_0x516101;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x5f1e53(0x175))):console[_0x5f1e53(0x176)](_0x5f1e53(0x177)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a37_0x51ef77=a37_0x4867;(function(_0x2eda3b,_0x21a477){const _0x209712=a37_0x4867,_0xe26b1b=_0x2eda3b();while(!![]){try{const _0x41d74d=parseInt(_0x209712(0x228))/0x1+parseInt(_0x209712(0x243))/0x2*(-parseInt(_0x209712(0x222))/0x3)+-parseInt(_0x209712(0x241))/0x4*(-parseInt(_0x209712(0x1f7))/0x5)+-parseInt(_0x209712(0x21e))/0x6+-parseInt(_0x209712(0x200))/0x7+-parseInt(_0x209712(0x24f))/0x8+parseInt(_0x209712(0x202))/0x9*(parseInt(_0x209712(0x21d))/0xa);if(_0x41d74d===_0x21a477)break;else _0xe26b1b['push'](_0xe26b1b['shift']());}catch(_0x23ca65){_0xe26b1b['push'](_0xe26b1b['shift']());}}}(a37_0x1bd0,0x56ee6));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';function a37_0x1bd0(){const _0x31fde0=['369lvUoZY','code','修改后的请求参数','bff','ENDPOINT','COMMON','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Script\x20type','\x0a\x20*\x20[平台配置]\x20','name','operation-type','\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','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','Invalid\x20dataset\x20selection.','.js','join','\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.','function-node','stderr','validation','appCode','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','HOOK\x20requires\x20alias/operation/node\x20options.','apiDir','find','Available:\x20','220090ngzDJq','653238Phtezr','source','nonInteractive','operationType','3TjSaTN','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','No\x20operation\x20types\x20found\x20for\x20dataset\x20','keys','修改后的响应结果','before','693312CjBFvu','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22\x20not\x20found.\x20','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','datasetId','Dataset\x20not\x20found\x20for\x20code\x20\x22','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','close','.js\x0a','profileName','str','/data/dataset/','Operation\x20type\x20(HOOK\x20only)','/COMMON/','.js\x0a\x20*\x20[触发节点]\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','entries','string','Alias\x20\x22','datasetcode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','includes','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','UNKNOWN','1332azlfSs','Operation\x20type\x20\x22','1160262WgthGz','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','type','Script\x20description','alias','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','isInteger','datasetCode','map','write','\x22,\x20params\x20})\x0a','description','3857208zVCafq','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','Select\x20operation\x20type:',']\x20(','functionNode','mergedCli','Select\x20dataset:','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','Available\x20aliases:\x20','File\x20already\x20exists:\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','parseInt','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','trim','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','read','Created\x20','length','/HOOK/','Select\x20trigger\x20node:','1265asgRIM','\x22\x20not\x20found\x20for\x20dataset\x20','/**\x0a\x20*\x20','scriptsRootDir','/ENDPOINT/','\x22.\x20','utf8','HOOK','filePath','1068935erFhrF','after'];a37_0x1bd0=function(){return _0x31fde0;};return a37_0x1bd0();}import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x51ef77(0x205),'command':'create','description':a37_0x51ef77(0x25c),'risk':a37_0x51ef77(0x25f),'flags':[{'name':'type','type':a37_0x51ef77(0x239),'required':!![],'enum':[a37_0x51ef77(0x207),a37_0x51ef77(0x206),a37_0x51ef77(0x1fe)],'description':a37_0x51ef77(0x209)},{'name':a37_0x51ef77(0x20b),'type':a37_0x51ef77(0x239),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a37_0x51ef77(0x24e),'type':a37_0x51ef77(0x239),'description':a37_0x51ef77(0x246)},{'name':a37_0x51ef77(0x247),'type':a37_0x51ef77(0x239),'description':a37_0x51ef77(0x237)},{'name':a37_0x51ef77(0x23b),'type':a37_0x51ef77(0x239),'description':a37_0x51ef77(0x23d)},{'name':a37_0x51ef77(0x20c),'type':'string','description':a37_0x51ef77(0x234)},{'name':'function-node','type':a37_0x51ef77(0x239),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a37_0x51ef77(0x227),a37_0x51ef77(0x201)]}],async 'validate'(_0x327cf1){const _0x12544f=a37_0x51ef77,_0x40f92f=_0x327cf1[_0x12544f(0x232)](_0x12544f(0x20b));if(!isValidBffFunctionName(_0x40f92f))throw CliErrors[_0x12544f(0x216)]('Invalid\x20function\x20name\x20\x22'+_0x40f92f+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x400cb8){const _0x5824d8=a37_0x51ef77,_0x4c8956=loadBffProjectConfig(_0x400cb8['appCode']),_0x29ade7=_0x400cb8[_0x5824d8(0x232)](_0x5824d8(0x245)),_0x127d67=_0x400cb8['str'](_0x5824d8(0x20b)),_0x4f3181=_0x400cb8[_0x5824d8(0x232)](_0x5824d8(0x24e))||undefined,_0x4db091=_0x29ade7===_0x5824d8(0x1fe)?await resolveHookOptions(_0x4c8956,_0x400cb8):undefined,_0x2b8a8e=buildFilePath(_0x4c8956,_0x29ade7,_0x127d67,_0x4db091);if(await fileExists(_0x2b8a8e))throw CliErrors[_0x5824d8(0x216)](_0x5824d8(0x259)+_0x2b8a8e);await mkdir(dirname(_0x2b8a8e),{'recursive':!![]});const _0x28df9c=generateTemplate(_0x29ade7,_0x127d67,_0x400cb8[_0x5824d8(0x217)],_0x4f3181,_0x4db091);await writeFile(_0x2b8a8e,_0x28df9c,_0x5824d8(0x1fd));const _0x3b1272={'type':_0x29ade7,'name':_0x127d67,'path':_0x2b8a8e};if(_0x4f3181)_0x3b1272['description']=_0x4f3181;if(_0x4db091){if(_0x4db091[_0x5824d8(0x247)])_0x3b1272['alias']=_0x4db091['alias'];_0x3b1272[_0x5824d8(0x24a)]=_0x4db091['datasetCode'],_0x3b1272['operationType']=_0x4db091['operationType'],_0x3b1272['functionNode']=_0x4db091[_0x5824d8(0x254)];}return{'ok':!![],'data':_0x3b1272,'message':_0x5824d8(0x260)+_0x29ade7+'\x20function:\x20'+_0x127d67};}};function a37_0x4867(_0x3e9b20,_0x39f308){_0x3e9b20=_0x3e9b20-0x1f4;const _0x1bd052=a37_0x1bd0();let _0x4867ed=_0x1bd052[_0x3e9b20];return _0x4867ed;}async function resolveHookOptions(_0x37d12d,_0x42c1a7){const _0x502e3c=a37_0x51ef77,_0x93f925=resolveApiModelSource(_0x42c1a7['apiDir'],_0x42c1a7[_0x502e3c(0x217)],_0x42c1a7['selectedAppName']||_0x42c1a7[_0x502e3c(0x255)]?.['currentApp']||_0x42c1a7[_0x502e3c(0x255)]?.['defaultApp']),_0x2f84b0=loadAliasMap(_0x42c1a7[_0x502e3c(0x21a)],undefined,_0x93f925[_0x502e3c(0x1ff)],_0x93f925[_0x502e3c(0x231)]),_0x48fe08=_0x2f84b0['length']>0x0;let _0x47f427,_0x10c1d4,_0x40b488;const _0x58e7d5=_0x42c1a7[_0x502e3c(0x232)](_0x502e3c(0x247)),_0xb7e885=_0x42c1a7[_0x502e3c(0x232)](_0x502e3c(0x23b));if(_0x58e7d5){const _0x291495=resolveAlias(_0x42c1a7[_0x502e3c(0x21a)],_0x58e7d5,undefined,_0x93f925['filePath'],_0x93f925[_0x502e3c(0x231)]);if(!_0x291495){const _0xed607c=_0x48fe08?_0x502e3c(0x258)+_0x2f84b0[_0x502e3c(0x24b)](_0x1440a8=>_0x1440a8[_0x502e3c(0x247)])[_0x502e3c(0x211)](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x23a)+_0x58e7d5+_0x502e3c(0x22a)+_0xed607c);}_0x47f427=_0x58e7d5,_0x10c1d4=_0x291495;}else{if(_0xb7e885){_0x10c1d4=_0xb7e885;const _0x5eb882=_0x2f84b0[_0x502e3c(0x21b)](_0x2ed643=>_0x2ed643['datasetCode']===_0xb7e885);_0x47f427=_0x5eb882?.['alias'];}else{if(_0x42c1a7[_0x502e3c(0x220)])throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x229));else{if(_0x48fe08){const _0x4a8c22=_0x2f84b0['map'](_0x5563a8=>_0x5563a8[_0x502e3c(0x247)]+'\x20('+_0x5563a8['tableName']+')'),_0x2b1e42=await promptSelect(_0x502e3c(0x256),_0x4a8c22),_0xd4f407=_0x2f84b0[_0x2b1e42];if(!_0xd4f407)throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x20f));_0x47f427=_0xd4f407['alias'],_0x10c1d4=_0xd4f407['datasetCode'];}else{const _0x2a5522=await listDatasets(_0x42c1a7[_0x502e3c(0x217)]);if(_0x2a5522[_0x502e3c(0x1f4)]===0x0)throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x213));const _0x96273c=_0x2a5522[_0x502e3c(0x24b)](_0x4452a9=>_0x4452a9['name']+'\x20['+(_0x4452a9[_0x502e3c(0x21f)]??_0x502e3c(0x240))+_0x502e3c(0x253)+_0x4452a9[_0x502e3c(0x203)]+')'),_0x5eca0c=await promptSelect(_0x502e3c(0x256),_0x96273c),_0x252ced=_0x2a5522[_0x5eca0c];if(!_0x252ced)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x10c1d4=_0x252ced[_0x502e3c(0x203)],_0x47f427=undefined;}}}}const _0x42b49a=await listDatasets(_0x42c1a7['appCode']),_0xdfde20=_0x42b49a[_0x502e3c(0x21b)](_0x35a598=>_0x35a598[_0x502e3c(0x203)]===_0x10c1d4);if(!_0xdfde20)throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x22d)+_0x10c1d4+_0x502e3c(0x1fc)+(_0x47f427?_0x502e3c(0x218)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x40b488=_0xdfde20['id'];const _0x57945a=_0x47f427??_0x10c1d4,_0x5ded1c=await listBffDatasetOperations(_0x42c1a7[_0x502e3c(0x217)],_0x40b488),_0x4716b4=_0x5ded1c?Object[_0x502e3c(0x225)](_0x5ded1c):[];if(_0x4716b4[_0x502e3c(0x1f4)]===0x0)throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x224)+_0x57945a+'.');let _0x3f6152;const _0x5debc5=_0x42c1a7[_0x502e3c(0x232)]('operation-type');if(_0x5debc5){if(!_0x4716b4[_0x502e3c(0x23e)](_0x5debc5))throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x242)+_0x5debc5+_0x502e3c(0x1f8)+_0x57945a+'.\x20'+(_0x502e3c(0x21c)+_0x4716b4[_0x502e3c(0x211)](',\x20')));_0x3f6152=_0x5debc5;}else{if(_0x42c1a7[_0x502e3c(0x220)])throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x250));const _0x154f94=await promptSelect(_0x502e3c(0x252),_0x4716b4);_0x3f6152=_0x4716b4[_0x154f94]??_0x4716b4[0x0];}let _0x3dd5ed=normalizeHookFunctionNode(_0x42c1a7[_0x502e3c(0x232)](_0x502e3c(0x214)));if(!_0x3dd5ed){if(_0x42c1a7['str']('function-node'))throw CliErrors[_0x502e3c(0x216)](_0x502e3c(0x25e));if(_0x42c1a7[_0x502e3c(0x220)])throw CliErrors[_0x502e3c(0x216)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x5dbc6e=await promptSelect(_0x502e3c(0x1f6),['before',_0x502e3c(0x201)]);_0x3dd5ed=['before',_0x502e3c(0x201)][_0x5dbc6e]??_0x502e3c(0x227);}return{'alias':_0x47f427,'datasetCode':_0x10c1d4,'datasetId':_0x40b488,'operationType':_0x3f6152,'functionNode':_0x3dd5ed};}async function promptSelect(_0x3ffb65,_0xa643b0){const _0x5932bb=a37_0x51ef77;if(_0xa643b0[_0x5932bb(0x1f4)]===0x1)return 0x0;for(const [_0x312852,_0x18e996]of _0xa643b0[_0x5932bb(0x238)]()){process['stderr'][_0x5932bb(0x24c)]('\x20\x20'+(_0x312852+0x1)+'.\x20'+_0x18e996+'\x0a');}const _0x221614=createInterface({'input':process['stdin'],'output':process['stderr']});while(!![]){const _0x3c57f7=await new Promise(_0x42218f=>{_0x221614['question'](_0x3ffb65+'\x20',_0x42218f);}),_0x540bf4=Number[_0x5932bb(0x25b)](_0x3c57f7['trim'](),0xa);if(Number[_0x5932bb(0x249)](_0x540bf4)&&_0x540bf4>=0x1&&_0x540bf4<=_0xa643b0['length'])return _0x221614[_0x5932bb(0x22f)](),_0x540bf4-0x1;process[_0x5932bb(0x215)][_0x5932bb(0x24c)](_0x5932bb(0x20e)+_0xa643b0[_0x5932bb(0x1f4)]+'.\x0a');}}function buildFilePath(_0x43be46,_0xae800d,_0x159f7b,_0x4c74fd){const _0x5db734=a37_0x51ef77;if(_0xae800d==='HOOK'){if(!_0x4c74fd)throw CliErrors['validation'](_0x5db734(0x219));const _0x2a101f=_0x4c74fd[_0x5db734(0x247)]??_0x4c74fd['datasetCode'];return join(_0x43be46[_0x5db734(0x1fa)],_0x5db734(0x1fe),_0x2a101f,_0x4c74fd[_0x5db734(0x221)],_0x4c74fd[_0x5db734(0x254)],_0x159f7b+'.js');}return join(_0x43be46[_0x5db734(0x1fa)],_0xae800d,_0x159f7b+_0x5db734(0x210));}export function generateTemplate(_0x4c1421,_0x428a32,_0x2dae9e,_0xd1b107,_0x1cc737){const _0x3e3e62=a37_0x51ef77,_0x470107=_0xd1b107?.[_0x3e3e62(0x25d)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0xfe6c70=getAppBaseUrl(_0x2dae9e),_0x1a048f='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x4c1421==='COMMON')return _0x3e3e62(0x1f9)+_0x470107+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x428a32+_0x3e3e62(0x20a)+_0xfe6c70+_0x3e3e62(0x257)+_0x2dae9e+_0x3e3e62(0x235)+_0x428a32+_0x3e3e62(0x22e)+_0x428a32+_0x3e3e62(0x24d)+_0x1a048f+'\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'+_0x428a32+_0x3e3e62(0x208);if(_0x4c1421===_0x3e3e62(0x206))return _0x3e3e62(0x1f9)+_0x470107+_0x3e3e62(0x23c)+_0x428a32+_0x3e3e62(0x248)+_0x2dae9e+'/'+_0x428a32+_0x3e3e62(0x20a)+_0xfe6c70+_0x3e3e62(0x257)+_0x2dae9e+_0x3e3e62(0x1fb)+_0x428a32+_0x3e3e62(0x230)+_0x1a048f+_0x3e3e62(0x20d)+_0x428a32+_0x3e3e62(0x208);if(!_0x1cc737)throw CliErrors[_0x3e3e62(0x216)](_0x3e3e62(0x22b));const _0x15178d=_0x1cc737[_0x3e3e62(0x247)]??_0x1cc737[_0x3e3e62(0x24a)],_0x4c821b=_0x1cc737[_0x3e3e62(0x254)]===_0x3e3e62(0x227)?'当前请求参数':'当前响应结果',_0xf3f2f0=_0x1cc737[_0x3e3e62(0x254)]===_0x3e3e62(0x227)?_0x3e3e62(0x204):_0x3e3e62(0x226);return _0x3e3e62(0x1f9)+_0x470107+_0x3e3e62(0x244)+_0x428a32+_0x3e3e62(0x25a)+_0x2dae9e+'/'+_0x1cc737[_0x3e3e62(0x24a)]+'/'+_0x1cc737[_0x3e3e62(0x221)]+'\x0a\x20*\x20[平台配置]\x20'+_0xfe6c70+_0x3e3e62(0x233)+_0x1cc737[_0x3e3e62(0x22c)]+_0x3e3e62(0x251)+_0x2dae9e+_0x3e3e62(0x1f5)+_0x15178d+'/'+_0x1cc737[_0x3e3e62(0x221)]+'/'+_0x1cc737['functionNode']+'/'+_0x428a32+_0x3e3e62(0x236)+_0x1cc737['functionNode']+'\x0a'+_0x1a048f+_0x3e3e62(0x212)+_0x4c821b+_0x3e3e62(0x223)+_0xf3f2f0+_0x3e3e62(0x23f)+_0x428a32+_0x3e3e62(0x208);}
1
+ const a37_0x44a4ac=a37_0x32c0;(function(_0x241629,_0x41441d){const _0x4f126e=a37_0x32c0,_0x517175=_0x241629();while(!![]){try{const _0x5c3e7e=-parseInt(_0x4f126e(0xc0))/0x1+parseInt(_0x4f126e(0xc3))/0x2+-parseInt(_0x4f126e(0xc9))/0x3+-parseInt(_0x4f126e(0x83))/0x4*(parseInt(_0x4f126e(0xc4))/0x5)+parseInt(_0x4f126e(0xa5))/0x6+-parseInt(_0x4f126e(0xba))/0x7*(parseInt(_0x4f126e(0xb7))/0x8)+parseInt(_0x4f126e(0xda))/0x9;if(_0x5c3e7e===_0x41441d)break;else _0x517175['push'](_0x517175['shift']());}catch(_0x87bc61){_0x517175['push'](_0x517175['shift']());}}}(a37_0x287f,0x2fefc));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';function a37_0x287f(){const _0x468f84=['name','nonInteractive','trim','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','read','code','/data/dataset/','Invalid\x20dataset\x20selection.','727812PnQUdv','defaultApp','\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','HOOK','\x22.\x20','description','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','type','Dataset\x20not\x20found\x20for\x20code\x20\x22','selectedAppName','filePath','File\x20already\x20exists:\x20','\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','Select\x20operation\x20type:','function-node','ENDPOINT','tableName','map','232jTyRKv','utf8','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','28903cZtHfd','/COMMON/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','after','HOOK\x20requires\x20alias/operation/node\x20options.','functionNode','7393yAQczj','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','source','286464mWXrVK','335YcnTNR','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Function\x20name\x20(valid\x20JS\x20identifier)','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','/**\x0a\x20*\x20','819618CiFmaa','join','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Created\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','string','write','Available\x20aliases:\x20','Alias\x20\x22','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','keys','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','\x20function:\x20','mergedCli','before','修改后的请求参数','Trigger\x20node\x20(HOOK\x20only)','4586733vbWggt','\x22\x20not\x20found.\x20','/ENDPOINT/','datasetCode','bff','apiDir','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','stderr','parseInt','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','isInteger','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','当前响应结果','.js','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','operationType','/HOOK/','operation-type','\x22\x20not\x20found\x20for\x20dataset\x20','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','当前请求参数','COMMON','10596FwhhAQ','Select\x20trigger\x20node:','Select\x20dataset:','UNKNOWN','validation','currentApp','str','profileName','No\x20datasets\x20found\x20for\x20this\x20app.','datasetId','.js\x0a\x20*\x20[触发节点]\x20','length','.js\x0a','find','Script\x20description','alias','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Invalid\x20function\x20name\x20\x22','\x0a\x20*\x20[平台配置]\x20','create','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','appCode','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'];a37_0x287f=function(){return _0x468f84;};return a37_0x287f();}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_0x32c0(_0x517fa0,_0x182c48){_0x517fa0=_0x517fa0-0x7e;const _0x287fb5=a37_0x287f();let _0x32c04c=_0x287fb5[_0x517fa0];return _0x32c04c;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x44a4ac(0xde),'command':a37_0x44a4ac(0x96),'description':a37_0x44a4ac(0xe4),'risk':a37_0x44a4ac(0xa1),'flags':[{'name':'type','type':a37_0x44a4ac(0xce),'required':!![],'enum':['COMMON',a37_0x44a4ac(0xb4),a37_0x44a4ac(0xa8)],'description':'Script\x20type'},{'name':'name','type':a37_0x44a4ac(0xce),'required':!![],'description':a37_0x44a4ac(0xc6)},{'name':a37_0x44a4ac(0xaa),'type':a37_0x44a4ac(0xce),'description':a37_0x44a4ac(0x91)},{'name':a37_0x44a4ac(0x92),'type':a37_0x44a4ac(0xce),'description':a37_0x44a4ac(0xcb)},{'name':'datasetcode','type':a37_0x44a4ac(0xce),'description':a37_0x44a4ac(0xb9)},{'name':a37_0x44a4ac(0x7e),'type':'string','description':'Operation\x20type\x20(HOOK\x20only)'},{'name':a37_0x44a4ac(0xb3),'type':a37_0x44a4ac(0xce),'description':a37_0x44a4ac(0xd9),'enum':['before',a37_0x44a4ac(0xbd)]}],async 'validate'(_0x548425){const _0x5b3022=a37_0x44a4ac,_0xc2317e=_0x548425['str'](_0x5b3022(0x9c));if(!isValidBffFunctionName(_0xc2317e))throw CliErrors[_0x5b3022(0x87)](_0x5b3022(0x94)+_0xc2317e+_0x5b3022(0x99));},async 'execute'(_0x5aeb0f){const _0x5904e9=a37_0x44a4ac,_0xeab712=loadBffProjectConfig(_0x5aeb0f[_0x5904e9(0x98)]),_0x3befaa=_0x5aeb0f[_0x5904e9(0x89)](_0x5904e9(0xac)),_0x45cdcb=_0x5aeb0f[_0x5904e9(0x89)](_0x5904e9(0x9c)),_0x51c113=_0x5aeb0f[_0x5904e9(0x89)]('description')||undefined,_0x3bb13c=_0x3befaa==='HOOK'?await resolveHookOptions(_0xeab712,_0x5aeb0f):undefined,_0x7b29c9=buildFilePath(_0xeab712,_0x3befaa,_0x45cdcb,_0x3bb13c);if(await fileExists(_0x7b29c9))throw CliErrors['validation'](_0x5904e9(0xb0)+_0x7b29c9);await mkdir(dirname(_0x7b29c9),{'recursive':!![]});const _0x4e68a8=generateTemplate(_0x3befaa,_0x45cdcb,_0x5aeb0f[_0x5904e9(0x98)],_0x51c113,_0x3bb13c);await writeFile(_0x7b29c9,_0x4e68a8,_0x5904e9(0xb8));const _0x5650bf={'type':_0x3befaa,'name':_0x45cdcb,'path':_0x7b29c9};if(_0x51c113)_0x5650bf[_0x5904e9(0xaa)]=_0x51c113;if(_0x3bb13c){if(_0x3bb13c['alias'])_0x5650bf[_0x5904e9(0x92)]=_0x3bb13c[_0x5904e9(0x92)];_0x5650bf[_0x5904e9(0xdd)]=_0x3bb13c[_0x5904e9(0xdd)],_0x5650bf[_0x5904e9(0xea)]=_0x3bb13c[_0x5904e9(0xea)],_0x5650bf[_0x5904e9(0xbf)]=_0x3bb13c['functionNode'];}return{'ok':!![],'data':_0x5650bf,'message':_0x5904e9(0xcc)+_0x3befaa+_0x5904e9(0xd5)+_0x45cdcb};}};async function resolveHookOptions(_0x1035d6,_0x536a58){const _0x39a455=a37_0x44a4ac,_0x5c7e11=resolveApiModelSource(_0x536a58[_0x39a455(0xdf)],_0x536a58[_0x39a455(0x98)],_0x536a58[_0x39a455(0xae)]||_0x536a58['mergedCli']?.[_0x39a455(0x88)]||_0x536a58[_0x39a455(0xd6)]?.[_0x39a455(0xa6)]),_0x4a5a42=loadAliasMap(_0x536a58[_0x39a455(0xdf)],undefined,_0x5c7e11[_0x39a455(0xaf)],_0x5c7e11[_0x39a455(0x8a)]),_0x34ad1d=_0x4a5a42[_0x39a455(0x8e)]>0x0;let _0x47a249,_0x68e445,_0x1d5d1e;const _0x1ca809=_0x536a58[_0x39a455(0x89)](_0x39a455(0x92)),_0x1da800=_0x536a58[_0x39a455(0x89)]('datasetcode');if(_0x1ca809){const _0xde8efa=resolveAlias(_0x536a58[_0x39a455(0xdf)],_0x1ca809,undefined,_0x5c7e11[_0x39a455(0xaf)],_0x5c7e11['profileName']);if(!_0xde8efa){const _0x4f59c0=_0x34ad1d?_0x39a455(0xd0)+_0x4a5a42[_0x39a455(0xb6)](_0x1d0ffc=>_0x1d0ffc['alias'])['join'](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0x39a455(0xd4);throw CliErrors[_0x39a455(0x87)](_0x39a455(0xd1)+_0x1ca809+_0x39a455(0xdb)+_0x4f59c0);}_0x47a249=_0x1ca809,_0x68e445=_0xde8efa;}else{if(_0x1da800){_0x68e445=_0x1da800;const _0x126579=_0x4a5a42['find'](_0x216efb=>_0x216efb['datasetCode']===_0x1da800);_0x47a249=_0x126579?.[_0x39a455(0x92)];}else{if(_0x536a58[_0x39a455(0x9d)])throw CliErrors[_0x39a455(0x87)](_0x39a455(0xcd));else{if(_0x34ad1d){const _0x473cb8=_0x4a5a42[_0x39a455(0xb6)](_0x43a713=>_0x43a713[_0x39a455(0x92)]+'\x20('+_0x43a713[_0x39a455(0xb5)]+')'),_0x5837c6=await promptSelect(_0x39a455(0x85),_0x473cb8),_0x3c6b0f=_0x4a5a42[_0x5837c6];if(!_0x3c6b0f)throw CliErrors[_0x39a455(0x87)](_0x39a455(0xa4));_0x47a249=_0x3c6b0f[_0x39a455(0x92)],_0x68e445=_0x3c6b0f[_0x39a455(0xdd)];}else{const _0x456cc9=await listDatasets(_0x536a58[_0x39a455(0x98)]);if(_0x456cc9['length']===0x0)throw CliErrors[_0x39a455(0x87)](_0x39a455(0x8b));const _0xa989c4=_0x456cc9[_0x39a455(0xb6)](_0xa6f83b=>_0xa6f83b[_0x39a455(0x9c)]+'\x20['+(_0xa6f83b[_0x39a455(0xc2)]??_0x39a455(0x86))+']\x20('+_0xa6f83b[_0x39a455(0xa2)]+')'),_0x25b334=await promptSelect('Select\x20dataset:',_0xa989c4),_0x3a15b5=_0x456cc9[_0x25b334];if(!_0x3a15b5)throw CliErrors[_0x39a455(0x87)]('Invalid\x20dataset\x20selection.');_0x68e445=_0x3a15b5[_0x39a455(0xa2)],_0x47a249=undefined;}}}}const _0x31b751=await listDatasets(_0x536a58[_0x39a455(0x98)]),_0x54c47c=_0x31b751[_0x39a455(0x90)](_0x4542fa=>_0x4542fa[_0x39a455(0xa2)]===_0x68e445);if(!_0x54c47c)throw CliErrors['validation'](_0x39a455(0xad)+_0x68e445+_0x39a455(0xa9)+(_0x47a249?_0x39a455(0x97)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x1d5d1e=_0x54c47c['id'];const _0xcaeb38=_0x47a249??_0x68e445,_0x3d562e=await listBffDatasetOperations(_0x536a58[_0x39a455(0x98)],_0x1d5d1e),_0x203f8c=_0x3d562e?Object[_0x39a455(0xd3)](_0x3d562e):[];if(_0x203f8c[_0x39a455(0x8e)]===0x0)throw CliErrors[_0x39a455(0x87)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0xcaeb38+'.');let _0x12919b;const _0x433715=_0x536a58[_0x39a455(0x89)](_0x39a455(0x7e));if(_0x433715){if(!_0x203f8c['includes'](_0x433715))throw CliErrors[_0x39a455(0x87)]('Operation\x20type\x20\x22'+_0x433715+_0x39a455(0x7f)+_0xcaeb38+'.\x20'+('Available:\x20'+_0x203f8c[_0x39a455(0xca)](',\x20')));_0x12919b=_0x433715;}else{if(_0x536a58[_0x39a455(0x9d)])throw CliErrors[_0x39a455(0x87)](_0x39a455(0xe9));const _0x4a83b3=await promptSelect(_0x39a455(0xb2),_0x203f8c);_0x12919b=_0x203f8c[_0x4a83b3]??_0x203f8c[0x0];}let _0x3a76ff=normalizeHookFunctionNode(_0x536a58[_0x39a455(0x89)](_0x39a455(0xb3)));if(!_0x3a76ff){if(_0x536a58[_0x39a455(0x89)](_0x39a455(0xb3)))throw CliErrors[_0x39a455(0x87)](_0x39a455(0x9a));if(_0x536a58[_0x39a455(0x9d)])throw CliErrors[_0x39a455(0x87)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0xb3d186=await promptSelect(_0x39a455(0x84),[_0x39a455(0xd7),_0x39a455(0xbd)]);_0x3a76ff=[_0x39a455(0xd7),'after'][_0xb3d186]??_0x39a455(0xd7);}return{'alias':_0x47a249,'datasetCode':_0x68e445,'datasetId':_0x1d5d1e,'operationType':_0x12919b,'functionNode':_0x3a76ff};}async function promptSelect(_0xf47174,_0x6957d8){const _0x23cf5a=a37_0x44a4ac;if(_0x6957d8['length']===0x1)return 0x0;for(const [_0x34c8fb,_0x426500]of _0x6957d8['entries']()){process[_0x23cf5a(0xe2)]['write']('\x20\x20'+(_0x34c8fb+0x1)+'.\x20'+_0x426500+'\x0a');}const _0x624d14=createInterface({'input':process['stdin'],'output':process[_0x23cf5a(0xe2)]});while(!![]){const _0x38da57=await new Promise(_0x17df2a=>{_0x624d14['question'](_0xf47174+'\x20',_0x17df2a);}),_0x221d74=Number[_0x23cf5a(0xe3)](_0x38da57[_0x23cf5a(0x9e)](),0xa);if(Number[_0x23cf5a(0xe5)](_0x221d74)&&_0x221d74>=0x1&&_0x221d74<=_0x6957d8[_0x23cf5a(0x8e)])return _0x624d14['close'](),_0x221d74-0x1;process[_0x23cf5a(0xe2)][_0x23cf5a(0xcf)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x6957d8[_0x23cf5a(0x8e)]+'.\x0a');}}function buildFilePath(_0xadc352,_0x9bb2f5,_0x59f53a,_0x1ab191){const _0x10a2a9=a37_0x44a4ac;if(_0x9bb2f5===_0x10a2a9(0xa8)){if(!_0x1ab191)throw CliErrors[_0x10a2a9(0x87)](_0x10a2a9(0xbe));const _0x219058=_0x1ab191[_0x10a2a9(0x92)]??_0x1ab191[_0x10a2a9(0xdd)];return join(_0xadc352['scriptsRootDir'],_0x10a2a9(0xa8),_0x219058,_0x1ab191[_0x10a2a9(0xea)],_0x1ab191[_0x10a2a9(0xbf)],_0x59f53a+_0x10a2a9(0xe8));}return join(_0xadc352['scriptsRootDir'],_0x9bb2f5,_0x59f53a+'.js');}export function generateTemplate(_0x5b14a5,_0x19e21f,_0x15e453,_0x297cc6,_0x2b639d){const _0x5d51dc=a37_0x44a4ac,_0x3e94af=_0x297cc6?.[_0x5d51dc(0x9e)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0xfece74=getAppBaseUrl(_0x15e453),_0x2f4671=_0x5d51dc(0xe0);if(_0x5b14a5===_0x5d51dc(0x82))return _0x5d51dc(0xc8)+_0x3e94af+_0x5d51dc(0x80)+_0x19e21f+_0x5d51dc(0x95)+_0xfece74+_0x5d51dc(0xa0)+_0x15e453+_0x5d51dc(0xbb)+_0x19e21f+_0x5d51dc(0xab)+_0x19e21f+'\x22,\x20params\x20})\x0a'+_0x2f4671+_0x5d51dc(0xb1)+_0x19e21f+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x5b14a5===_0x5d51dc(0xb4))return _0x5d51dc(0xc8)+_0x3e94af+_0x5d51dc(0xbc)+_0x19e21f+_0x5d51dc(0xc7)+_0x15e453+'/'+_0x19e21f+_0x5d51dc(0x95)+_0xfece74+_0x5d51dc(0xa0)+_0x15e453+_0x5d51dc(0xdc)+_0x19e21f+_0x5d51dc(0x8f)+_0x2f4671+_0x5d51dc(0xa7)+_0x19e21f+_0x5d51dc(0x93);if(!_0x2b639d)throw CliErrors[_0x5d51dc(0x87)](_0x5d51dc(0xe1));const _0xb47a81=_0x2b639d[_0x5d51dc(0x92)]??_0x2b639d[_0x5d51dc(0xdd)],_0x3ca059=_0x2b639d['functionNode']===_0x5d51dc(0xd7)?_0x5d51dc(0x81):_0x5d51dc(0xe7),_0x455757=_0x2b639d['functionNode']===_0x5d51dc(0xd7)?_0x5d51dc(0xd8):'修改后的响应结果';return _0x5d51dc(0xc8)+_0x3e94af+_0x5d51dc(0x9f)+_0x19e21f+_0x5d51dc(0xc5)+_0x15e453+'/'+_0x2b639d[_0x5d51dc(0xdd)]+'/'+_0x2b639d[_0x5d51dc(0xea)]+'\x0a\x20*\x20[平台配置]\x20'+_0xfece74+_0x5d51dc(0xa3)+_0x2b639d[_0x5d51dc(0x8c)]+_0x5d51dc(0xd2)+_0x15e453+_0x5d51dc(0xeb)+_0xb47a81+'/'+_0x2b639d[_0x5d51dc(0xea)]+'/'+_0x2b639d['functionNode']+'/'+_0x19e21f+_0x5d51dc(0x8d)+_0x2b639d[_0x5d51dc(0xbf)]+'\x0a'+_0x2f4671+_0x5d51dc(0x9b)+_0x3ca059+_0x5d51dc(0xc1)+_0x455757+_0x5d51dc(0xe6)+_0x19e21f+_0x5d51dc(0x93);}
@@ -1 +1 @@
1
- const a38_0x428c85=a38_0x28ff;(function(_0x5e0f3c,_0x66ad59){const _0x4fc024=a38_0x28ff,_0x32a821=_0x5e0f3c();while(!![]){try{const _0x49126f=-parseInt(_0x4fc024(0x11d))/0x1+parseInt(_0x4fc024(0x117))/0x2+-parseInt(_0x4fc024(0x126))/0x3+parseInt(_0x4fc024(0x12f))/0x4*(-parseInt(_0x4fc024(0x10f))/0x5)+-parseInt(_0x4fc024(0x129))/0x6*(parseInt(_0x4fc024(0x10c))/0x7)+-parseInt(_0x4fc024(0x123))/0x8+parseInt(_0x4fc024(0x137))/0x9;if(_0x49126f===_0x66ad59)break;else _0x32a821['push'](_0x32a821['shift']());}catch(_0xdd3f05){_0x32a821['push'](_0x32a821['shift']());}}}(a38_0xf44d,0xbde7e));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_0x28ff(_0x40e9e4,_0x4b8704){_0x40e9e4=_0x40e9e4-0x10c;const _0xf44dbd=a38_0xf44d();let _0x28ff01=_0xf44dbd[_0x40e9e4];return _0x28ff01;}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a38_0xf44d(){const _0x324b62=['scriptsRootDir','toISOString','10eNvAnD','lockFilePath','lastSync','/api/management/library/scripts/delete','stringify','remoteId','string','includes','325000lUyVmf','parse','POST','Function\x20not\x20found:\x20','Local\x20delete\x20not\x20settled\x20for\x20','startsWith','1169734yHsbZW','validation','trashDir','map','appCode','\x20(local\x20file\x20moved\x20to\x20trash)','7445008uqvXDK','high-risk-write','length','2119659RvBzrL','Backend\x20Function\x20lock\x20file\x20not\x20found.','delete','87096GSRzbb','trashedTo','str','bff','target','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','2161756XRPBRa','\x20\x20-\x20','filter','Would\x20delete\x20','Deleted\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','projectRoot','44708913aPujTW','functions','apps','\x22\x20not\x20found\x20after\x20ensureLockScope.','keys','replace','split','No\x20lock\x20entry\x20found\x20for\x20\x22','224NxnLyI'];a38_0xf44d=function(){return _0x324b62;};return a38_0xf44d();}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x428c85(0x12c),'command':'delete','description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a38_0x428c85(0x124),'flags':[{'name':a38_0x428c85(0x12d),'type':a38_0x428c85(0x115),'required':!![],'description':a38_0x428c85(0x135)}],async 'validate'(_0x3f55ad){const _0x5979d4=a38_0x428c85,_0x5e525b=loadBffProjectConfig(_0x3f55ad[_0x5979d4(0x121)]),_0x4071a1=await readBffLockFile(_0x5e525b['lockFilePath']);if(!_0x4071a1)throw CliErrors[_0x5979d4(0x11e)](_0x5979d4(0x12e));},async 'dryRun'(_0x4686c5){const _0x3ad7d0=a38_0x428c85,_0x4bde0e=loadBffProjectConfig(_0x4686c5[_0x3ad7d0(0x121)]),_0x509aee=await readBffLockFile(_0x4bde0e[_0x3ad7d0(0x110)]);if(!_0x509aee)throw CliErrors['validation'](_0x3ad7d0(0x127));const {appLock:_0x5d932d}=ensureLockScope(_0x509aee,_0x4686c5[_0x3ad7d0(0x121)],_0x4bde0e['scriptsRoot'],_0x3ad7d0(0x128)),_0x1b49b4=_0x4686c5[_0x3ad7d0(0x12b)](_0x3ad7d0(0x12d)),_0x859ab2=Object[_0x3ad7d0(0x13b)](_0x5d932d[_0x3ad7d0(0x138)]),_0x5e73af=resolveDeleteTarget(_0x1b49b4,_0x859ab2),_0x15b338=_0x5d932d[_0x3ad7d0(0x138)][_0x5e73af];if(!_0x15b338)throw CliErrors[_0x3ad7d0(0x11e)](_0x3ad7d0(0x13e)+_0x5e73af+'\x22.');const _0x38557e=resolveLocalFilePathFromLockKey(_0x4bde0e,_0x5e73af),_0x44f722=relative(_0x4bde0e[_0x3ad7d0(0x136)],_0x38557e),_0x305b39=join(_0x4bde0e[_0x3ad7d0(0x11f)],'<timestamp>',_0x44f722);return{'method':_0x3ad7d0(0x119),'url':_0x3ad7d0(0x112),'body':{'appCode':_0x4686c5[_0x3ad7d0(0x121)],'target':_0x5e73af,'remoteId':_0x15b338[_0x3ad7d0(0x114)],'localFilePath':_0x38557e,'trashedPath':_0x305b39},'description':_0x3ad7d0(0x132)+_0x5e73af+_0x3ad7d0(0x134)};},async 'execute'(_0x4b2003){const _0x3bc167=a38_0x428c85,_0x300f13=loadBffProjectConfig(_0x4b2003[_0x3bc167(0x121)]),_0x4b3c68=await readBffLockFile(_0x300f13['lockFilePath']);if(!_0x4b3c68)throw CliErrors[_0x3bc167(0x11e)](_0x3bc167(0x127));const {lockData:_0x547ce9,appLock:_0xea8832}=ensureLockScope(_0x4b3c68,_0x4b2003[_0x3bc167(0x121)],_0x300f13['scriptsRoot'],'delete'),_0x23b558=JSON[_0x3bc167(0x118)](JSON[_0x3bc167(0x113)](_0x547ce9)),_0x5138ef=_0x23b558['apps'][_0x4b2003['appCode']];if(!_0x5138ef)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x4b2003[_0x3bc167(0x121)]+_0x3bc167(0x13a));const _0x2b7c71=_0x4b2003[_0x3bc167(0x12b)](_0x3bc167(0x12d)),_0x35e8f4=Object[_0x3bc167(0x13b)](_0x5138ef[_0x3bc167(0x138)]),_0x55f3da=resolveDeleteTarget(_0x2b7c71,_0x35e8f4),_0x41afbb=_0x5138ef[_0x3bc167(0x138)][_0x55f3da];if(!_0x41afbb)throw CliErrors['validation'](_0x3bc167(0x13e)+_0x55f3da+'\x22.');await deleteBffScript(_0x41afbb[_0x3bc167(0x114)]),delete _0x5138ef[_0x3bc167(0x138)][_0x55f3da],_0x5138ef[_0x3bc167(0x111)]=new Date()[_0x3bc167(0x10e)](),await writeBffLockFile(_0x300f13[_0x3bc167(0x110)],_0x23b558);const _0x54f61d=resolveLocalFilePathFromLockKey(_0x300f13,_0x55f3da);let _0x9f2dd5;await fileExists(_0x54f61d)&&(_0x9f2dd5=await moveToTrash(_0x300f13[_0x3bc167(0x136)],_0x300f13[_0x3bc167(0x11f)],_0x54f61d),await cleanupEmptyDirectories(dirname(_0x54f61d),_0x300f13[_0x3bc167(0x10d)]));await waitForDeleteSettlement(_0x300f13[_0x3bc167(0x110)],_0x4b2003['appCode'],_0x55f3da,_0x54f61d),await sleep(0x96);const _0x5ad007={'deleted':_0x55f3da,'remoteId':_0x41afbb[_0x3bc167(0x114)]};if(_0x9f2dd5)_0x5ad007[_0x3bc167(0x12a)]=_0x9f2dd5;return{'ok':!![],'data':_0x5ad007,'message':_0x3bc167(0x133)+_0x55f3da+(_0x9f2dd5?_0x3bc167(0x122):'')};}};function resolveDeleteTarget(_0x398619,_0x240fe7){const _0x1af9ed=a38_0x428c85;if(_0x398619[_0x1af9ed(0x116)]('/')){const _0x108f36=_0x240fe7['find'](_0x5c4376=>_0x5c4376===_0x398619);if(!_0x108f36)throw CliErrors[_0x1af9ed(0x11e)](_0x1af9ed(0x11a)+_0x398619);return _0x108f36;}const _0xfd8d77=_0x240fe7[_0x1af9ed(0x131)](_0x4ad03f=>_0x4ad03f[_0x1af9ed(0x13d)]('/')['at'](-0x1)===_0x398619);if(_0xfd8d77[_0x1af9ed(0x125)]===0x0)throw CliErrors['validation']('Function\x20not\x20found:\x20'+_0x398619);if(_0xfd8d77['length']>0x1)throw CliErrors[_0x1af9ed(0x11e)]('Multiple\x20functions\x20match\x20\x22'+_0x398619+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0xfd8d77[_0x1af9ed(0x120)](_0x1ebae4=>_0x1af9ed(0x130)+_0x1ebae4)['join']('\x0a'));return _0xfd8d77[0x0];}async function moveToTrash(_0x450b2c,_0x258108,_0x438b97){const _0x21db26=a38_0x428c85,_0x5e14d1=new Date()['toISOString']()[_0x21db26(0x13c)](/[:.]/g,'-'),_0x577c7d=relative(_0x450b2c,_0x438b97),_0x1d4d29=join(_0x258108,_0x5e14d1,_0x577c7d);return await mkdir(dirname(_0x1d4d29),{'recursive':!![]}),await rename(_0x438b97,_0x1d4d29),_0x1d4d29;}async function cleanupEmptyDirectories(_0x45acd7,_0x4cf53b){const _0x5ab808=a38_0x428c85;let _0x5e48ff=resolve(_0x45acd7);const _0x27e62a=resolve(_0x4cf53b);while(_0x5e48ff[_0x5ab808(0x11c)](''+_0x27e62a+sep)||_0x5e48ff===_0x27e62a){if(_0x5e48ff===_0x27e62a)return;try{const _0x46f473=await readdir(_0x5e48ff);if(_0x46f473[_0x5ab808(0x125)]>0x0)return;await rmdir(_0x5e48ff);}catch{return;}_0x5e48ff=dirname(_0x5e48ff);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x3d3d01,_0x4d1edd,_0x2fb9f0,_0x3b2153){const _0x14b86e=a38_0x428c85;for(let _0x9bb7b4=0x0;_0x9bb7b4<DELETE_SETTLE_RETRY_COUNT;_0x9bb7b4+=0x1){const _0x23d428=await readBffLockFile(_0x3d3d01),_0x135afd=!!_0x23d428?.[_0x14b86e(0x139)]?.[_0x4d1edd]?.['functions']?.[_0x2fb9f0],_0xa63968=await fileExists(_0x3b2153);if(!_0x135afd&&!_0xa63968)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x14b86e(0x11b)+_0x2fb9f0+'.');}
1
+ const a38_0x384e6a=a38_0x4e8f;(function(_0x465326,_0x20c4ff){const _0x2ce346=a38_0x4e8f,_0x41e0c6=_0x465326();while(!![]){try{const _0x2ab230=-parseInt(_0x2ce346(0x1bc))/0x1+-parseInt(_0x2ce346(0x1ae))/0x2*(-parseInt(_0x2ce346(0x1aa))/0x3)+parseInt(_0x2ce346(0x1b9))/0x4*(-parseInt(_0x2ce346(0x1cd))/0x5)+-parseInt(_0x2ce346(0x1cf))/0x6*(parseInt(_0x2ce346(0x1c9))/0x7)+-parseInt(_0x2ce346(0x1a5))/0x8+parseInt(_0x2ce346(0x1a8))/0x9+parseInt(_0x2ce346(0x1cc))/0xa*(parseInt(_0x2ce346(0x1a3))/0xb);if(_0x2ab230===_0x20c4ff)break;else _0x41e0c6['push'](_0x41e0c6['shift']());}catch(_0x359177){_0x41e0c6['push'](_0x41e0c6['shift']());}}}(a38_0x1e8f,0xe3994));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';function a38_0x4e8f(_0x5594c2,_0x4fe862){_0x5594c2=_0x5594c2-0x1a1;const _0x1e8f09=a38_0x1e8f();let _0x4e8f97=_0x1e8f09[_0x5594c2];return _0x4e8f97;}import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a38_0x1e8f(){const _0x3622ce=['\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','apps','validation','toISOString','Deleted\x20','remoteId','/api/management/library/scripts/delete','scriptsRootDir','Would\x20delete\x20','startsWith','replace','84ZxpaeQ','projectRoot','lockFilePath','8938890NOVVGd','55VjzWRn','stringify','541038Axyado','scriptsRoot','length','\x20\x20-\x20','22qVzlhF','map','2697928aKKUes','trashDir','target','12450645vcuhWd','delete','339IbduLd','lastSync','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','filter','17206YYdIcr','No\x20lock\x20entry\x20found\x20for\x20\x22','Lock\x20scope\x20for\x20app\x20\x22','str','functions','string','keys','Multiple\x20functions\x20match\x20\x22','find','POST','split','325884SJLfSo','Function\x20not\x20found:\x20','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','895580rjZXgN','appCode'];a38_0x1e8f=function(){return _0x3622ce;};return a38_0x1e8f();}import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':'bff','command':a38_0x384e6a(0x1a9),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':'high-risk-write','flags':[{'name':a38_0x384e6a(0x1a7),'type':a38_0x384e6a(0x1b3),'required':!![],'description':a38_0x384e6a(0x1ac)}],async 'validate'(_0x47e530){const _0x9b7141=a38_0x384e6a,_0x1a5871=loadBffProjectConfig(_0x47e530[_0x9b7141(0x1bd)]),_0x3b9e6e=await readBffLockFile(_0x1a5871[_0x9b7141(0x1cb)]);if(!_0x3b9e6e)throw CliErrors[_0x9b7141(0x1c0)](_0x9b7141(0x1bb));},async 'dryRun'(_0x2d50e9){const _0x5b762f=a38_0x384e6a,_0x4efbe4=loadBffProjectConfig(_0x2d50e9[_0x5b762f(0x1bd)]),_0x5aae0e=await readBffLockFile(_0x4efbe4['lockFilePath']);if(!_0x5aae0e)throw CliErrors[_0x5b762f(0x1c0)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0x3a4d67}=ensureLockScope(_0x5aae0e,_0x2d50e9[_0x5b762f(0x1bd)],_0x4efbe4[_0x5b762f(0x1d0)],'delete'),_0x384f89=_0x2d50e9[_0x5b762f(0x1b1)](_0x5b762f(0x1a7)),_0xcb7f42=Object[_0x5b762f(0x1b4)](_0x3a4d67[_0x5b762f(0x1b2)]),_0x234fc4=resolveDeleteTarget(_0x384f89,_0xcb7f42),_0x1017ee=_0x3a4d67['functions'][_0x234fc4];if(!_0x1017ee)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x234fc4+'\x22.');const _0x5591aa=resolveLocalFilePathFromLockKey(_0x4efbe4,_0x234fc4),_0x1ccb8e=relative(_0x4efbe4[_0x5b762f(0x1ca)],_0x5591aa),_0x49afd9=join(_0x4efbe4[_0x5b762f(0x1a6)],'<timestamp>',_0x1ccb8e);return{'method':_0x5b762f(0x1b7),'url':_0x5b762f(0x1c4),'body':{'appCode':_0x2d50e9[_0x5b762f(0x1bd)],'target':_0x234fc4,'remoteId':_0x1017ee['remoteId'],'localFilePath':_0x5591aa,'trashedPath':_0x49afd9},'description':_0x5b762f(0x1c6)+_0x234fc4+_0x5b762f(0x1be)};},async 'execute'(_0x2cd032){const _0x47d1f0=a38_0x384e6a,_0x41e9a5=loadBffProjectConfig(_0x2cd032[_0x47d1f0(0x1bd)]),_0x63cb89=await readBffLockFile(_0x41e9a5[_0x47d1f0(0x1cb)]);if(!_0x63cb89)throw CliErrors[_0x47d1f0(0x1c0)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {lockData:_0x23e2e6,appLock:_0xfb81a6}=ensureLockScope(_0x63cb89,_0x2cd032[_0x47d1f0(0x1bd)],_0x41e9a5[_0x47d1f0(0x1d0)],'delete'),_0x29f764=JSON['parse'](JSON[_0x47d1f0(0x1ce)](_0x23e2e6)),_0x4e4eb5=_0x29f764[_0x47d1f0(0x1bf)][_0x2cd032[_0x47d1f0(0x1bd)]];if(!_0x4e4eb5)throw new Error(_0x47d1f0(0x1b0)+_0x2cd032[_0x47d1f0(0x1bd)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x48a000=_0x2cd032[_0x47d1f0(0x1b1)]('target'),_0x105c35=Object[_0x47d1f0(0x1b4)](_0x4e4eb5['functions']),_0x5b4115=resolveDeleteTarget(_0x48a000,_0x105c35),_0x470b59=_0x4e4eb5['functions'][_0x5b4115];if(!_0x470b59)throw CliErrors['validation'](_0x47d1f0(0x1af)+_0x5b4115+'\x22.');await deleteBffScript(_0x470b59[_0x47d1f0(0x1c3)]),delete _0x4e4eb5['functions'][_0x5b4115],_0x4e4eb5[_0x47d1f0(0x1ab)]=new Date()[_0x47d1f0(0x1c1)](),await writeBffLockFile(_0x41e9a5[_0x47d1f0(0x1cb)],_0x29f764);const _0x1fcad4=resolveLocalFilePathFromLockKey(_0x41e9a5,_0x5b4115);let _0x401cb7;await fileExists(_0x1fcad4)&&(_0x401cb7=await moveToTrash(_0x41e9a5[_0x47d1f0(0x1ca)],_0x41e9a5['trashDir'],_0x1fcad4),await cleanupEmptyDirectories(dirname(_0x1fcad4),_0x41e9a5[_0x47d1f0(0x1c5)]));await waitForDeleteSettlement(_0x41e9a5[_0x47d1f0(0x1cb)],_0x2cd032[_0x47d1f0(0x1bd)],_0x5b4115,_0x1fcad4),await sleep(0x96);const _0x18ea05={'deleted':_0x5b4115,'remoteId':_0x470b59[_0x47d1f0(0x1c3)]};if(_0x401cb7)_0x18ea05['trashedTo']=_0x401cb7;return{'ok':!![],'data':_0x18ea05,'message':_0x47d1f0(0x1c2)+_0x5b4115+(_0x401cb7?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x298f61,_0x4ab8dc){const _0x61768c=a38_0x384e6a;if(_0x298f61['includes']('/')){const _0x23b87e=_0x4ab8dc[_0x61768c(0x1b6)](_0x1b23d8=>_0x1b23d8===_0x298f61);if(!_0x23b87e)throw CliErrors['validation'](_0x61768c(0x1ba)+_0x298f61);return _0x23b87e;}const _0x374e17=_0x4ab8dc[_0x61768c(0x1ad)](_0xde090e=>_0xde090e[_0x61768c(0x1b8)]('/')['at'](-0x1)===_0x298f61);if(_0x374e17[_0x61768c(0x1a1)]===0x0)throw CliErrors['validation'](_0x61768c(0x1ba)+_0x298f61);if(_0x374e17[_0x61768c(0x1a1)]>0x1)throw CliErrors[_0x61768c(0x1c0)](_0x61768c(0x1b5)+_0x298f61+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x374e17[_0x61768c(0x1a4)](_0x4b1cc0=>_0x61768c(0x1a2)+_0x4b1cc0)['join']('\x0a'));return _0x374e17[0x0];}async function moveToTrash(_0x1604b8,_0x4ea9d7,_0x24900b){const _0x5ecdb1=a38_0x384e6a,_0x69ee22=new Date()[_0x5ecdb1(0x1c1)]()[_0x5ecdb1(0x1c8)](/[:.]/g,'-'),_0x446ac5=relative(_0x1604b8,_0x24900b),_0x1e1379=join(_0x4ea9d7,_0x69ee22,_0x446ac5);return await mkdir(dirname(_0x1e1379),{'recursive':!![]}),await rename(_0x24900b,_0x1e1379),_0x1e1379;}async function cleanupEmptyDirectories(_0x1b14bb,_0x2ed988){const _0x49b7c7=a38_0x384e6a;let _0x447539=resolve(_0x1b14bb);const _0x19e81f=resolve(_0x2ed988);while(_0x447539[_0x49b7c7(0x1c7)](''+_0x19e81f+sep)||_0x447539===_0x19e81f){if(_0x447539===_0x19e81f)return;try{const _0x311cba=await readdir(_0x447539);if(_0x311cba[_0x49b7c7(0x1a1)]>0x0)return;await rmdir(_0x447539);}catch{return;}_0x447539=dirname(_0x447539);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0xf54edc,_0x492072,_0x4400b3,_0x28cab9){const _0x4b86bf=a38_0x384e6a;for(let _0x16768c=0x0;_0x16768c<DELETE_SETTLE_RETRY_COUNT;_0x16768c+=0x1){const _0xeafb8c=await readBffLockFile(_0xf54edc),_0x51c197=!!_0xeafb8c?.['apps']?.[_0x492072]?.[_0x4b86bf(0x1b2)]?.[_0x4400b3],_0x4babbb=await fileExists(_0x28cab9);if(!_0x51c197&&!_0x4babbb)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x4400b3+'.');}
@@ -1 +1 @@
1
- const a39_0x225fa9=a39_0x3b2d;function a39_0x3b2d(_0x914194,_0x536df5){_0x914194=_0x914194-0x1b5;const _0xf7771d=a39_0xf777();let _0x3b2d54=_0xf7771d[_0x914194];return _0x3b2d54;}(function(_0x59c2ef,_0x510fe0){const _0x531af2=a39_0x3b2d,_0x6c41f1=_0x59c2ef();while(!![]){try{const _0x38fbf2=parseInt(_0x531af2(0x1cb))/0x1*(parseInt(_0x531af2(0x1c6))/0x2)+parseInt(_0x531af2(0x1cf))/0x3*(-parseInt(_0x531af2(0x1c9))/0x4)+-parseInt(_0x531af2(0x1c8))/0x5+-parseInt(_0x531af2(0x1ce))/0x6+-parseInt(_0x531af2(0x1c1))/0x7*(-parseInt(_0x531af2(0x1c5))/0x8)+-parseInt(_0x531af2(0x1ca))/0x9+-parseInt(_0x531af2(0x1c0))/0xa*(-parseInt(_0x531af2(0x1c7))/0xb);if(_0x38fbf2===_0x510fe0)break;else _0x6c41f1['push'](_0x6c41f1['shift']());}catch(_0x4809b7){_0x6c41f1['push'](_0x6c41f1['shift']());}}}(a39_0xf777,0xd527e));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x225fa9(0x1bc),'command':a39_0x225fa9(0x1c2),'description':a39_0x225fa9(0x1cc),'risk':a39_0x225fa9(0x1c3),'flags':[{'name':'id','type':a39_0x225fa9(0x1ba),'required':!![],'description':a39_0x225fa9(0x1b7)},{'name':a39_0x225fa9(0x1b6),'type':a39_0x225fa9(0x1bf),'description':a39_0x225fa9(0x1b5)}],async 'execute'(_0x56ec0f){const _0x78146a=a39_0x225fa9,_0x5b51e2=await getBffScriptInfo(_0x56ec0f[_0x78146a(0x1b9)]('id')),_0x492401=_0x56ec0f[_0x78146a(0x1be)](_0x78146a(0x1b6));if(_0x492401)return{'ok':!![],'data':_0x5b51e2};return{'ok':!![],'data':{'id':_0x5b51e2['id'],'functionName':_0x5b51e2['functionName']??'','version':_0x5b51e2['version']??'','updateUserName':_0x5b51e2['updateUserName']??'','appCode':_0x5b51e2[_0x78146a(0x1cd)],'scriptType':_0x5b51e2[_0x78146a(0x1b8)],'description':_0x5b51e2[_0x78146a(0x1c4)]||_0x78146a(0x1bb),'createdTime':_0x5b51e2['createdTime']??'','updatedTime':_0x5b51e2['updatedTime']??'','scriptContent':_0x5b51e2[_0x78146a(0x1bd)]??''}};}};function a39_0xf777(){const _0x1e049a=['Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','appCode','2117922psAJkc','33PqsLZU','Return\x20full\x20raw\x20script\x20object','verbose','Script\x20ID','scriptType','num','number','(none)','bff','scriptContent','bool','boolean','10sQsaPh','1748250IxObXF','detail','read','description','32NRfkwE','924558BcARDm','20485509PQGtms','5700045AboGFs','515132hrJyBM','28638whMVJT','2BXjGCq'];a39_0xf777=function(){return _0x1e049a;};return a39_0xf777();}
1
+ const a39_0x47d7d7=a39_0x5786;(function(_0xe369e3,_0x27c218){const _0x16ff00=a39_0x5786,_0x5acf6c=_0xe369e3();while(!![]){try{const _0x3054b1=-parseInt(_0x16ff00(0x116))/0x1*(parseInt(_0x16ff00(0x11b))/0x2)+parseInt(_0x16ff00(0x10c))/0x3*(parseInt(_0x16ff00(0x11a))/0x4)+parseInt(_0x16ff00(0x101))/0x5+-parseInt(_0x16ff00(0x118))/0x6+parseInt(_0x16ff00(0x11c))/0x7*(parseInt(_0x16ff00(0x115))/0x8)+parseInt(_0x16ff00(0x110))/0x9+parseInt(_0x16ff00(0x119))/0xa*(-parseInt(_0x16ff00(0x104))/0xb);if(_0x3054b1===_0x27c218)break;else _0x5acf6c['push'](_0x5acf6c['shift']());}catch(_0x416289){_0x5acf6c['push'](_0x5acf6c['shift']());}}}(a39_0x3655,0x5e019));function a39_0x3655(){const _0x1dfbf4=['566580XRsrJi','10oIEyTD','13044wOQTaU','2yBhZks','186690KBmvxg','1531550gAqtYr','read','bff','8800231skYtpG','Script\x20ID','createdTime','version','verbose','updateUserName','(none)','description','261WTLGvf','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','functionName','scriptContent','5322492MiNZAi','number','num','scriptType','bool','72Qeamiw','141935lCuOcs','Return\x20full\x20raw\x20script\x20object'];a39_0x3655=function(){return _0x1dfbf4;};return a39_0x3655();}function a39_0x5786(_0x4ed85a,_0xf6c4d1){_0x4ed85a=_0x4ed85a-0x101;const _0x3655db=a39_0x3655();let _0x578664=_0x3655db[_0x4ed85a];return _0x578664;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x47d7d7(0x103),'command':'detail','description':a39_0x47d7d7(0x10d),'risk':a39_0x47d7d7(0x102),'flags':[{'name':'id','type':a39_0x47d7d7(0x111),'required':!![],'description':a39_0x47d7d7(0x105)},{'name':a39_0x47d7d7(0x108),'type':'boolean','description':a39_0x47d7d7(0x117)}],async 'execute'(_0xb5a551){const _0xabf75e=a39_0x47d7d7,_0x2ab724=await getBffScriptInfo(_0xb5a551[_0xabf75e(0x112)]('id')),_0x5db912=_0xb5a551[_0xabf75e(0x114)]('verbose');if(_0x5db912)return{'ok':!![],'data':_0x2ab724};return{'ok':!![],'data':{'id':_0x2ab724['id'],'functionName':_0x2ab724[_0xabf75e(0x10e)]??'','version':_0x2ab724[_0xabf75e(0x107)]??'','updateUserName':_0x2ab724[_0xabf75e(0x109)]??'','appCode':_0x2ab724['appCode'],'scriptType':_0x2ab724[_0xabf75e(0x113)],'description':_0x2ab724[_0xabf75e(0x10b)]||_0xabf75e(0x10a),'createdTime':_0x2ab724[_0xabf75e(0x106)]??'','updatedTime':_0x2ab724['updatedTime']??'','scriptContent':_0x2ab724[_0xabf75e(0x10f)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x48cce5,_0x5bfe1b){const _0x5c3552=a40_0x478f,_0x531ebe=_0x48cce5();while(!![]){try{const _0x4eaca4=parseInt(_0x5c3552(0xf8))/0x1*(parseInt(_0x5c3552(0xf5))/0x2)+parseInt(_0x5c3552(0xfb))/0x3+-parseInt(_0x5c3552(0xf6))/0x4+parseInt(_0x5c3552(0xf7))/0x5*(-parseInt(_0x5c3552(0xf9))/0x6)+parseInt(_0x5c3552(0xfc))/0x7+parseInt(_0x5c3552(0xfd))/0x8+-parseInt(_0x5c3552(0xfe))/0x9*(parseInt(_0x5c3552(0xfa))/0xa);if(_0x4eaca4===_0x5bfe1b)break;else _0x531ebe['push'](_0x531ebe['shift']());}catch(_0x233ef9){_0x531ebe['push'](_0x531ebe['shift']());}}}(a40_0x56d9,0xe2782));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a40_0x478f(_0x5ea425,_0x28e029){_0x5ea425=_0x5ea425-0xf5;const _0x56d95b=a40_0x56d9();let _0x478f50=_0x56d95b[_0x5ea425];return _0x478f50;}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';function a40_0x56d9(){const _0x56fd81=['5582mhbftB','42474xqJZGx','901140jmjztC','109587Vrciya','12443305qpIPSj','10571136QKrvOj','99GwrAtU','232ZGhZCu','4568472DinWtD','510nlozRc'];a40_0x56d9=function(){return _0x56fd81;};return a40_0x56d9();}export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x3d78c1,_0x3e4683){const _0x8758b5=a40_0x34d0,_0x1529f1=_0x3d78c1();while(!![]){try{const _0x2c7e42=parseInt(_0x8758b5(0x1a3))/0x1*(parseInt(_0x8758b5(0x1a1))/0x2)+-parseInt(_0x8758b5(0x19d))/0x3*(-parseInt(_0x8758b5(0x1a7))/0x4)+parseInt(_0x8758b5(0x19f))/0x5*(parseInt(_0x8758b5(0x1a2))/0x6)+-parseInt(_0x8758b5(0x1a0))/0x7*(-parseInt(_0x8758b5(0x1a6))/0x8)+-parseInt(_0x8758b5(0x1a4))/0x9*(parseInt(_0x8758b5(0x19c))/0xa)+parseInt(_0x8758b5(0x19a))/0xb*(parseInt(_0x8758b5(0x19b))/0xc)+-parseInt(_0x8758b5(0x19e))/0xd*(parseInt(_0x8758b5(0x1a5))/0xe);if(_0x2c7e42===_0x3e4683)break;else _0x1529f1['push'](_0x1529f1['shift']());}catch(_0x587b09){_0x1529f1['push'](_0x1529f1['shift']());}}}(a40_0x1e80,0x5724f));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a40_0x1e80(){const _0x5051d7=['404678mSMSHr','13941SbUEDy','42jtHSkg','16568GJtnSY','16076YgbFSP','685267RHkOcw','132LKMypO','1570mBEmxa','3drxSgH','5087407mtRnhS','1050dKupjY','203pWIrYk','2sDNNSl','17718sgJnmv'];a40_0x1e80=function(){return _0x5051d7;};return a40_0x1e80();}import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a40_0x34d0(_0x5de247,_0x23f47a){_0x5de247=_0x5de247-0x19a;const _0x1e808d=a40_0x1e80();let _0x34d076=_0x1e808d[_0x5de247];return _0x34d076;}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_0x562a6c=a41_0x2781;(function(_0x1b3d3a,_0x855260){const _0x53f978=a41_0x2781,_0x46cade=_0x1b3d3a();while(!![]){try{const _0x19912b=-parseInt(_0x53f978(0x1a3))/0x1+parseInt(_0x53f978(0x1ad))/0x2+parseInt(_0x53f978(0x1b4))/0x3*(-parseInt(_0x53f978(0x1a2))/0x4)+parseInt(_0x53f978(0x1a9))/0x5*(-parseInt(_0x53f978(0x1b0))/0x6)+parseInt(_0x53f978(0x1a6))/0x7+-parseInt(_0x53f978(0x1b7))/0x8+-parseInt(_0x53f978(0x1a8))/0x9;if(_0x19912b===_0x855260)break;else _0x46cade['push'](_0x46cade['shift']());}catch(_0x27cf30){_0x46cade['push'](_0x46cade['shift']());}}}(a41_0x28ef,0x35f7d));function a41_0x2781(_0x4ffb92,_0x42f746){_0x4ffb92=_0x4ffb92-0x19d;const _0x28efb0=a41_0x28ef();let _0x2781d9=_0x28efb0[_0x4ffb92];return _0x2781d9;}function a41_0x28ef(){const _0x5e8cd5=['functionName','string','Return\x20full\x20script\x20objects','438452mZdptf','147503Nfjaww','name','verbose','3094378TUYeTO','List\x20Backend\x20Function\x20scripts','97335sXhZYo','5GWuVLq','length','(unnamed)','list','722320wdPGvQ','bool','str','349062yToAhX','read','COMMON','No\x20Backend\x20Function\x20scripts\x20found.','3OcDUoB','ENDPOINT','map','2048424oIxWLD','scriptType','boolean','type'];a41_0x28ef=function(){return _0x5e8cd5;};return a41_0x28ef();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a41_0x562a6c(0x1ac),'description':a41_0x562a6c(0x1a7),'risk':a41_0x562a6c(0x1b1),'flags':[{'name':a41_0x562a6c(0x19e),'type':a41_0x562a6c(0x1a0),'description':'Script\x20type\x20filter','default':a41_0x562a6c(0x1b5),'enum':[a41_0x562a6c(0x1b5),a41_0x562a6c(0x1b2)]},{'name':a41_0x562a6c(0x1a4),'type':a41_0x562a6c(0x1a0),'description':'Filter\x20by\x20script\x20name'},{'name':'verbose','type':a41_0x562a6c(0x19d),'description':a41_0x562a6c(0x1a1)}],async 'execute'(_0x1e333a){const _0x30d08b=a41_0x562a6c,_0x340d86=await listBffScripts(_0x1e333a['appCode'],_0x1e333a[_0x30d08b(0x1af)](_0x30d08b(0x19e)),{'scriptName':_0x1e333a[_0x30d08b(0x1af)]('name')||undefined}),_0x1ce146=_0x1e333a[_0x30d08b(0x1ae)](_0x30d08b(0x1a5));return{'ok':!![],'data':_0x1ce146?_0x340d86:_0x340d86[_0x30d08b(0x1b6)](_0x24c9da=>({'id':_0x24c9da['id'],'functionName':_0x24c9da[_0x30d08b(0x19f)]??'','description':_0x24c9da['description']||_0x30d08b(0x1ab),'scriptType':_0x24c9da[_0x30d08b(0x1b8)]})),'message':_0x340d86[_0x30d08b(0x1aa)]===0x0?_0x30d08b(0x1b3):undefined};}};
1
+ function a41_0x1f31(_0x27ecd6,_0xf44642){_0x27ecd6=_0x27ecd6-0x1d4;const _0x575e5a=a41_0x575e();let _0x1f313e=_0x575e5a[_0x27ecd6];return _0x1f313e;}const a41_0x4a0e11=a41_0x1f31;function a41_0x575e(){const _0x490cbd=['verbose','COMMON','75915KNIzYi','length','read','string','str','type','19976uIYNrp','name','5llGDaC','1341444AXycfx','list','scriptType','1135029PNEFoV','739252wMCjnv','1298972LcHkwO','1808968jVWcwk','List\x20Backend\x20Function\x20scripts','Filter\x20by\x20script\x20name','description','No\x20Backend\x20Function\x20scripts\x20found.','Return\x20full\x20script\x20objects'];a41_0x575e=function(){return _0x490cbd;};return a41_0x575e();}(function(_0x15e666,_0x4efe22){const _0x579eb7=a41_0x1f31,_0x35cb99=_0x15e666();while(!![]){try{const _0x4f1214=-parseInt(_0x579eb7(0x1d5))/0x1+-parseInt(_0x579eb7(0x1e2))/0x2+parseInt(_0x579eb7(0x1e1))/0x3+parseInt(_0x579eb7(0x1e3))/0x4*(parseInt(_0x579eb7(0x1dd))/0x5)+parseInt(_0x579eb7(0x1de))/0x6+-parseInt(_0x579eb7(0x1e4))/0x7+-parseInt(_0x579eb7(0x1db))/0x8;if(_0x4f1214===_0x4efe22)break;else _0x35cb99['push'](_0x35cb99['shift']());}catch(_0x4a7248){_0x35cb99['push'](_0x35cb99['shift']());}}}(a41_0x575e,0x35c26));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a41_0x4a0e11(0x1df),'description':a41_0x4a0e11(0x1e5),'risk':a41_0x4a0e11(0x1d7),'flags':[{'name':a41_0x4a0e11(0x1da),'type':a41_0x4a0e11(0x1d8),'description':'Script\x20type\x20filter','default':'ENDPOINT','enum':['ENDPOINT',a41_0x4a0e11(0x1d4)]},{'name':a41_0x4a0e11(0x1dc),'type':a41_0x4a0e11(0x1d8),'description':a41_0x4a0e11(0x1e6)},{'name':'verbose','type':'boolean','description':a41_0x4a0e11(0x1e9)}],async 'execute'(_0x117a85){const _0x254736=a41_0x4a0e11,_0x1ae8fd=await listBffScripts(_0x117a85['appCode'],_0x117a85[_0x254736(0x1d9)](_0x254736(0x1da)),{'scriptName':_0x117a85[_0x254736(0x1d9)](_0x254736(0x1dc))||undefined}),_0x309a33=_0x117a85['bool'](_0x254736(0x1ea));return{'ok':!![],'data':_0x309a33?_0x1ae8fd:_0x1ae8fd['map'](_0x272710=>({'id':_0x272710['id'],'functionName':_0x272710['functionName']??'','description':_0x272710[_0x254736(0x1e7)]||'(unnamed)','scriptType':_0x272710[_0x254736(0x1e0)]})),'message':_0x1ae8fd[_0x254736(0x1d6)]===0x0?_0x254736(0x1e8):undefined};}};
@@ -1 +1 @@
1
- const a42_0x325f2f=a42_0x5bb4;(function(_0x48c53e,_0x57a908){const _0x4d3d83=a42_0x5bb4,_0xecb8eb=_0x48c53e();while(!![]){try{const _0x202e3b=parseInt(_0x4d3d83(0x1e5))/0x1*(parseInt(_0x4d3d83(0x1f9))/0x2)+-parseInt(_0x4d3d83(0x1f0))/0x3*(parseInt(_0x4d3d83(0x20c))/0x4)+parseInt(_0x4d3d83(0x1e0))/0x5+parseInt(_0x4d3d83(0x1f4))/0x6+parseInt(_0x4d3d83(0x1fd))/0x7*(parseInt(_0x4d3d83(0x206))/0x8)+parseInt(_0x4d3d83(0x1fe))/0x9*(-parseInt(_0x4d3d83(0x1ff))/0xa)+-parseInt(_0x4d3d83(0x1fc))/0xb;if(_0x202e3b===_0x57a908)break;else _0xecb8eb['push'](_0xecb8eb['shift']());}catch(_0x4b674a){_0xecb8eb['push'](_0xecb8eb['shift']());}}}(a42_0x640c,0x2dd3f));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';function a42_0x5bb4(_0x96b632,_0x35581d){_0x96b632=_0x96b632-0x1df;const _0x640c99=a42_0x640c();let _0x5bb405=_0x640c99[_0x96b632];return _0x5bb405;}import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0x325f2f(0x1e3),a42_0x325f2f(0x1df),a42_0x325f2f(0x1f2),a42_0x325f2f(0x208)];export function resolveBffLogQuery(_0x3f4252,_0x29fac9=Date[a42_0x325f2f(0x1f5)]()){const _0x1b01a3=a42_0x325f2f,_0x4664de=_0x3f4252[_0x1b01a3(0x1ed)](_0x1b01a3(0x1f1)),_0xd9459d=_0x3f4252[_0x1b01a3(0x1ed)](_0x1b01a3(0x1ec)),_0x168360=_0x3f4252['flag']('end-time');if(_0x4664de!==undefined&&_0xd9459d!==undefined)throw CliErrors[_0x1b01a3(0x1f8)](_0x1b01a3(0x1e7));const _0x530bb5=_0x168360===undefined?_0x29fac9:readPositiveInteger(_0x3f4252[_0x1b01a3(0x209)](_0x1b01a3(0x1ef)),_0x1b01a3(0x204)),_0x112e87=_0xd9459d===undefined?_0x530bb5-readSinceMinutes(_0x3f4252)*0xea60:readPositiveInteger(_0x3f4252[_0x1b01a3(0x209)](_0x1b01a3(0x1ec)),_0x1b01a3(0x1fb));if(_0x112e87<=0x0)throw CliErrors[_0x1b01a3(0x1f8)](_0x1b01a3(0x201));if(_0x112e87>_0x530bb5)throw CliErrors[_0x1b01a3(0x1f8)]('--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.');const _0x56f753=readPositiveInteger(_0x3f4252[_0x1b01a3(0x209)](_0x1b01a3(0x20d),DEFAULT_LIMIT),_0x1b01a3(0x20f));if(_0x56f753>MAX_LIMIT)throw CliErrors[_0x1b01a3(0x1f8)]('--limit\x20must\x20be\x20between\x201\x20and\x20'+MAX_LIMIT+'.');const _0x11257c=_0x3f4252[_0x1b01a3(0x202)](_0x1b01a3(0x20e))[_0x1b01a3(0x1ee)]()[_0x1b01a3(0x20b)]()||undefined,_0x3eea6b=_0x3f4252[_0x1b01a3(0x202)](_0x1b01a3(0x1e4))[_0x1b01a3(0x1ee)]()||undefined;return{'appCode':_0x3f4252['appCode'],'startTime':_0x112e87,'endTime':_0x530bb5,..._0xd9459d===undefined?{'sinceMinutes':readSinceMinutes(_0x3f4252)}:{},..._0x11257c?{'level':_0x11257c}:{},..._0x3eea6b?{'keyword':_0x3eea6b}:{},'limit':_0x56f753};}function readSinceMinutes(_0x13cd9f){const _0x223feb=a42_0x325f2f;return readPositiveInteger(_0x13cd9f[_0x223feb(0x209)]('since',DEFAULT_SINCE_MINUTES),_0x223feb(0x1e9));}function readPositiveInteger(_0x10e9e1,_0x44c7a3){const _0x37d975=a42_0x325f2f;if(!Number[_0x37d975(0x1e1)](_0x10e9e1)||_0x10e9e1<=0x0)throw CliErrors[_0x37d975(0x1f8)](_0x44c7a3+_0x37d975(0x203));return _0x10e9e1;}export const bffLogs={'service':a42_0x325f2f(0x20a),'command':'logs','description':a42_0x325f2f(0x1e2),'risk':a42_0x325f2f(0x1ea),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x325f2f(0x1f1),'type':'number','description':a42_0x325f2f(0x207)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x325f2f(0x1ec),'type':a42_0x325f2f(0x200),'description':a42_0x325f2f(0x1e8)},{'name':a42_0x325f2f(0x1ef),'type':'number','description':a42_0x325f2f(0x1fa)},{'name':'level','type':a42_0x325f2f(0x205),'description':a42_0x325f2f(0x1e6),'enum':LOG_LEVELS},{'name':'keyword','type':a42_0x325f2f(0x205),'description':a42_0x325f2f(0x1f7)},{'name':a42_0x325f2f(0x20d),'type':a42_0x325f2f(0x200),'description':'Maximum\x20log\x20lines\x20to\x20return\x20(1-'+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x264452){resolveBffLogQuery(_0x264452);},async 'execute'(_0x4c1129){const _0x286375=a42_0x325f2f,_0x1ec9a1=resolveBffLogQuery(_0x4c1129),{sinceMinutes:_0x3e2675,..._0x102aac}=_0x1ec9a1,_0x2d69dd=await searchBffScriptLogs(_0x102aac);return{'ok':!![],'data':{'query':_0x1ec9a1,'count':_0x2d69dd[_0x286375(0x1eb)],'logs':_0x2d69dd},'message':_0x2d69dd[_0x286375(0x1eb)]===0x0?_0x286375(0x1f6):_0x286375(0x1f3)+_0x2d69dd[_0x286375(0x1eb)]+'\x20Backend\x20Function\x20log\x20line(s).'};}};function a42_0x640c(){const _0x354046=['1425738kKTVYw','now','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','validation','9390bvbODb','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','--start-time','1150270zvuCQQ','173873mPHRYR','25443DlIYyA','20HmKnvM','number','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','str','\x20must\x20be\x20a\x20positive\x20integer.','--end-time','string','8XxtlQu','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','ERROR','num','bff','toUpperCase','44cYNPyK','limit','level','--limit','INFO','633565jSGbkl','isSafeInteger','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','DEBUG','keyword','25llOKFo','Filter\x20by\x20log\x20level','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','--since','read','length','start-time','flag','trim','end-time','56895juxFPk','since','WARN','Found\x20'];a42_0x640c=function(){return _0x354046;};return a42_0x640c();}
1
+ function a42_0x3386(_0x170f72,_0x58e9e3){_0x170f72=_0x170f72-0xd4;const _0x2d8748=a42_0x2d87();let _0x338679=_0x2d8748[_0x170f72];return _0x338679;}const a42_0xecfff4=a42_0x3386;(function(_0x13bd04,_0x24dfde){const _0x2c4c92=a42_0x3386,_0xec8937=_0x13bd04();while(!![]){try{const _0x4ccabf=parseInt(_0x2c4c92(0xe5))/0x1*(-parseInt(_0x2c4c92(0xee))/0x2)+-parseInt(_0x2c4c92(0x104))/0x3*(-parseInt(_0x2c4c92(0xf7))/0x4)+-parseInt(_0x2c4c92(0xd8))/0x5*(parseInt(_0x2c4c92(0xfa))/0x6)+-parseInt(_0x2c4c92(0xd4))/0x7*(-parseInt(_0x2c4c92(0xe9))/0x8)+parseInt(_0x2c4c92(0x101))/0x9+parseInt(_0x2c4c92(0xe7))/0xa+-parseInt(_0x2c4c92(0xd7))/0xb;if(_0x4ccabf===_0x24dfde)break;else _0xec8937['push'](_0xec8937['shift']());}catch(_0x40b7de){_0xec8937['push'](_0xec8937['shift']());}}}(a42_0x2d87,0xd25ad));function a42_0x2d87(){const _0xf4f55d=['logs','6KcCQSL','num','6201130PCFxPV','str','232rVtbjH','Filter\x20by\x20log\x20level','bff','ERROR','--since','278184dlUBDh','trim','flag','--start-time','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','string','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','level','now','6801636ztULVm','\x20must\x20be\x20a\x20positive\x20integer.','start-time','5945718VBzOsX','end-time','since','WARN','--limit','toUpperCase','length','3092211rwcuRy','--end-time','keyword','3clxOKl','--limit\x20must\x20be\x20between\x201\x20and\x20','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','77413ignGVD','Maximum\x20log\x20lines\x20to\x20return\x20(1-','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','3274634AJCMhq','5JFRcaD','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','read','INFO','number','\x20Backend\x20Function\x20log\x20line(s).','validation','isSafeInteger','DEBUG','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','Found\x20','limit'];a42_0x2d87=function(){return _0xf4f55d;};return a42_0x2d87();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0xecfff4(0xe0),a42_0xecfff4(0xdb),a42_0xecfff4(0xfd),a42_0xecfff4(0xec)];export function resolveBffLogQuery(_0xc87cd5,_0x2cc44e=Date[a42_0xecfff4(0xf6)]()){const _0x3521f2=a42_0xecfff4,_0x344b1a=_0xc87cd5['flag'](_0x3521f2(0xfc)),_0x20fa74=_0xc87cd5[_0x3521f2(0xf0)](_0x3521f2(0xf9)),_0xec6b87=_0xc87cd5[_0x3521f2(0xf0)](_0x3521f2(0xfb));if(_0x344b1a!==undefined&&_0x20fa74!==undefined)throw CliErrors[_0x3521f2(0xde)](_0x3521f2(0xf2));const _0xe0a0c4=_0xec6b87===undefined?_0x2cc44e:readPositiveInteger(_0xc87cd5[_0x3521f2(0xe6)](_0x3521f2(0xfb)),_0x3521f2(0x102)),_0x1c60df=_0x20fa74===undefined?_0xe0a0c4-readSinceMinutes(_0xc87cd5)*0xea60:readPositiveInteger(_0xc87cd5[_0x3521f2(0xe6)]('start-time'),_0x3521f2(0xf1));if(_0x1c60df<=0x0)throw CliErrors[_0x3521f2(0xde)](_0x3521f2(0xf4));if(_0x1c60df>_0xe0a0c4)throw CliErrors[_0x3521f2(0xde)](_0x3521f2(0xd6));const _0x16b561=readPositiveInteger(_0xc87cd5['num'](_0x3521f2(0xe3),DEFAULT_LIMIT),_0x3521f2(0xfe));if(_0x16b561>MAX_LIMIT)throw CliErrors[_0x3521f2(0xde)](_0x3521f2(0x105)+MAX_LIMIT+'.');const _0x2c689b=_0xc87cd5[_0x3521f2(0xe8)](_0x3521f2(0xf5))['trim']()[_0x3521f2(0xff)]()||undefined,_0x5c5f1e=_0xc87cd5['str'](_0x3521f2(0x103))[_0x3521f2(0xef)]()||undefined;return{'appCode':_0xc87cd5['appCode'],'startTime':_0x1c60df,'endTime':_0xe0a0c4,..._0x20fa74===undefined?{'sinceMinutes':readSinceMinutes(_0xc87cd5)}:{},..._0x2c689b?{'level':_0x2c689b}:{},..._0x5c5f1e?{'keyword':_0x5c5f1e}:{},'limit':_0x16b561};}function readSinceMinutes(_0x28bdcd){const _0x35decc=a42_0xecfff4;return readPositiveInteger(_0x28bdcd[_0x35decc(0xe6)]('since',DEFAULT_SINCE_MINUTES),_0x35decc(0xed));}function readPositiveInteger(_0x2e47d3,_0x94bf4d){const _0x5c0067=a42_0xecfff4;if(!Number[_0x5c0067(0xdf)](_0x2e47d3)||_0x2e47d3<=0x0)throw CliErrors[_0x5c0067(0xde)](_0x94bf4d+_0x5c0067(0xf8));return _0x2e47d3;}export const bffLogs={'service':a42_0xecfff4(0xeb),'command':a42_0xecfff4(0xe4),'description':a42_0xecfff4(0x106),'risk':a42_0xecfff4(0xda),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0xecfff4(0xfc),'type':a42_0xecfff4(0xdc),'description':a42_0xecfff4(0xd9)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0xecfff4(0xf9),'type':'number','description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':a42_0xecfff4(0xfb),'type':a42_0xecfff4(0xdc),'description':'Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)'},{'name':a42_0xecfff4(0xf5),'type':'string','description':a42_0xecfff4(0xea),'enum':LOG_LEVELS},{'name':a42_0xecfff4(0x103),'type':a42_0xecfff4(0xf3),'description':a42_0xecfff4(0xe1)},{'name':'limit','type':a42_0xecfff4(0xdc),'description':a42_0xecfff4(0xd5)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x5d41df){resolveBffLogQuery(_0x5d41df);},async 'execute'(_0x588c9a){const _0x4e5d3a=a42_0xecfff4,_0x33daa3=resolveBffLogQuery(_0x588c9a),{sinceMinutes:_0x4b128f,..._0x5a0b28}=_0x33daa3,_0x205f92=await searchBffScriptLogs(_0x5a0b28);return{'ok':!![],'data':{'query':_0x33daa3,'count':_0x205f92['length'],'logs':_0x205f92},'message':_0x205f92['length']===0x0?_0x4e5d3a(0x107):_0x4e5d3a(0xe2)+_0x205f92[_0x4e5d3a(0x100)]+_0x4e5d3a(0xdd)};}};
@@ -1 +1 @@
1
- const a43_0x204254=a43_0x4228;function a43_0x4228(_0x183d06,_0x300297){_0x183d06=_0x183d06-0x1a6;const _0x3caa27=a43_0x3caa();let _0x42280f=_0x3caa27[_0x183d06];return _0x42280f;}(function(_0x2d2d9e,_0x49a1ba){const _0x77a613=a43_0x4228,_0x10cc75=_0x2d2d9e();while(!![]){try{const _0x498054=-parseInt(_0x77a613(0x21e))/0x1+parseInt(_0x77a613(0x221))/0x2*(-parseInt(_0x77a613(0x1ac))/0x3)+parseInt(_0x77a613(0x239))/0x4*(-parseInt(_0x77a613(0x21b))/0x5)+parseInt(_0x77a613(0x1c8))/0x6*(-parseInt(_0x77a613(0x216))/0x7)+-parseInt(_0x77a613(0x1fb))/0x8*(-parseInt(_0x77a613(0x1ef))/0x9)+parseInt(_0x77a613(0x204))/0xa*(-parseInt(_0x77a613(0x1d8))/0xb)+parseInt(_0x77a613(0x22f))/0xc*(parseInt(_0x77a613(0x227))/0xd);if(_0x498054===_0x49a1ba)break;else _0x10cc75['push'](_0x10cc75['shift']());}catch(_0x52e962){_0x10cc75['push'](_0x10cc75['shift']());}}}(a43_0x3caa,0x74ac0));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_0x204254(0x1c7),'command':a43_0x204254(0x1e1),'description':a43_0x204254(0x1f1),'risk':'read','structuredErrors':!![],'flags':[{'name':a43_0x204254(0x1ff),'type':a43_0x204254(0x1fa),'description':a43_0x204254(0x1f4),'enum':[a43_0x204254(0x21a),a43_0x204254(0x1c6),a43_0x204254(0x1b1)]},{'name':a43_0x204254(0x238),'type':a43_0x204254(0x23a),'description':a43_0x204254(0x209)}],async 'dryRun'(_0x4d6d7e){const _0x3bdf48=a43_0x204254,_0x120ee2=loadBffProjectConfig(_0x4d6d7e[_0x3bdf48(0x200)]),_0x42d87c=await readBffLockFile(_0x120ee2[_0x3bdf48(0x1cb)]),{appLock:_0x5d8472}=ensureLockScope(_0x42d87c??createEmptyBffLock(),_0x4d6d7e[_0x3bdf48(0x200)],_0x120ee2[_0x3bdf48(0x1b5)],'pull'),_0xbc123b=normalizeBffType(_0x4d6d7e[_0x3bdf48(0x1c1)]('type'))??undefined,[_0x1cc26c,_0x15a116]=await Promise['all']([listBffScripts(_0x4d6d7e[_0x3bdf48(0x200)],_0xbc123b),getBffScriptStatistics(_0x4d6d7e['appCode'])]),_0x499b1f=_0x1cc26c[_0x3bdf48(0x23b)](_0x3ddc49=>normalizeBffType(_0x3ddc49[_0x3bdf48(0x1d6)])===_0x3bdf48(0x1b1)),_0x634146=_0x499b1f?buildDatasetCodeToAliasMap(_0x4d6d7e[_0x3bdf48(0x1e8)],_0x4d6d7e['appCode'],_0x4d6d7e[_0x3bdf48(0x1bc)]||_0x4d6d7e[_0x3bdf48(0x1e5)]?.['currentApp']||_0x4d6d7e[_0x3bdf48(0x1e5)]?.[_0x3bdf48(0x20f)]):new Map(),_0x481ab2=_0x499b1f?await planHookDirectoryMigration(_0x120ee2,_0x5d8472,_0x634146,await scanLocalBffFunctions(_0x120ee2,_0x3bdf48(0x1b1))):undefined,_0x40c363=createHookLocationMap(_0x15a116),_0x2002d2=[];for(const _0xb57363 of _0x1cc26c){const _0x14fed7=resolveRemoteScriptTarget(_0x120ee2,_0xb57363,_0x40c363,_0x481ab2?.['projectedFunctions']??_0x5d8472[_0x3bdf48(0x1fc)],_0x634146);if(!_0x14fed7){_0x2002d2[_0x3bdf48(0x23f)]({'scriptType':_0xb57363['scriptType'],'functionName':_0xb57363[_0x3bdf48(0x1ad)]??'','status':_0x3bdf48(0x1db),'reason':_0x3bdf48(0x22a)});continue;}const _0x1ec755=(_0x481ab2?.[_0x3bdf48(0x1dd)]??_0x5d8472[_0x3bdf48(0x1fc)])[_0x14fed7[_0x3bdf48(0x1b2)]],_0x3066d2=_0xb57363['scriptContent']!=null?computeContentHash(_0xb57363[_0x3bdf48(0x223)]):undefined,_0x595466=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x481ab2,_0x14fed7)??_0x14fed7[_0x3bdf48(0x233)],_0x1ec755,_0x3066d2),_0x54490d=_0x595466?localUnsyncedConflict(_0x14fed7,_0xb57363['id']):undefined;_0x2002d2[_0x3bdf48(0x23f)]({'lockKey':_0x14fed7['lockKey'],'filePath':_0x14fed7['filePath'],'remoteId':_0xb57363['id']??null,'status':_0x54490d?_0x3bdf48(0x22e):_0x3bdf48(0x1a9),..._0x54490d?{'conflict':_0x54490d}:{},..._0x14fed7[_0x3bdf48(0x1d2)]?{'alias':_0x14fed7['hookLocation'][_0x3bdf48(0x215)]??null,'datasetCode':_0x14fed7[_0x3bdf48(0x1d2)]['datasetCode'],'operationType':_0x14fed7[_0x3bdf48(0x1d2)][_0x3bdf48(0x1c2)],'functionNode':_0x14fed7[_0x3bdf48(0x1d2)][_0x3bdf48(0x20a)]}:{}});}return{'method':_0x3bdf48(0x1c9),'url':'/api/management/library/scripts/list?appCode='+_0x4d6d7e['appCode']+(_0xbc123b?'&type='+_0xbc123b:'')+_0x3bdf48(0x206)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x4d6d7e['appCode'],'filterType':_0xbc123b??null,..._0x481ab2&&_0x481ab2[_0x3bdf48(0x1b6)][_0x3bdf48(0x1da)]>0x0?{'hookDirectoryMigrations':_0x481ab2[_0x3bdf48(0x1b6)]['map'](_0x50bfc6=>({'from':_0x50bfc6['oldDirectory'],'to':_0x50bfc6[_0x3bdf48(0x1d9)]}))}:{},'files':_0x2002d2},'description':_0x3bdf48(0x20e)+_0x2002d2[_0x3bdf48(0x1da)]+_0x3bdf48(0x1a6)};},async 'execute'(_0x7ffda3){const _0x1ae596=a43_0x204254,_0x43845e=loadBffProjectConfig(_0x7ffda3[_0x1ae596(0x200)]),_0x22d7f6=await readBffLockFile(_0x43845e[_0x1ae596(0x1cb)]),{lockData:_0x37b3a8,appLock:_0x103012}=ensureLockScope(_0x22d7f6??createEmptyBffLock(),_0x7ffda3['appCode'],_0x43845e[_0x1ae596(0x1b5)],_0x1ae596(0x1e1)),_0x4d0040=normalizeBffType(_0x7ffda3['str']('type'))??undefined;if(_0x7ffda3[_0x1ae596(0x1c1)](_0x1ae596(0x1ff))&&!_0x4d0040)throw CliErrors[_0x1ae596(0x1e3)](_0x1ae596(0x1f7));const [_0x21a2db,_0x1d7a52]=await Promise['all']([listBffScripts(_0x7ffda3['appCode'],_0x4d0040),getBffScriptStatistics(_0x7ffda3[_0x1ae596(0x200)])]);if(_0x21a2db['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x1ae596(0x211)};const _0x44cca3=_0x7ffda3[_0x1ae596(0x1ab)]('force');if(_0x44cca3&&!_0x7ffda3[_0x1ae596(0x1ca)]){const _0x591832=await confirmForce();if(!_0x591832)throw CliErrors['cancelled'](_0x1ae596(0x1f5));}if(_0x44cca3&&_0x7ffda3[_0x1ae596(0x1ca)]){}const _0x524c8a=_0x21a2db['some'](_0x424076=>normalizeBffType(_0x424076[_0x1ae596(0x1d6)])===_0x1ae596(0x1b1)),_0x34e870=_0x524c8a?buildDatasetCodeToAliasMap(_0x7ffda3[_0x1ae596(0x1e8)],_0x7ffda3['appCode'],_0x7ffda3[_0x1ae596(0x1bc)]||_0x7ffda3[_0x1ae596(0x1e5)]?.[_0x1ae596(0x225)]||_0x7ffda3[_0x1ae596(0x1e5)]?.[_0x1ae596(0x20f)]):new Map(),_0x3c0d79=createHookLocationMap(_0x1d7a52),_0x130410=JSON[_0x1ae596(0x224)](JSON[_0x1ae596(0x237)](_0x37b3a8)),_0x216043=_0x7ffda3[_0x1ae596(0x200)],_0x403d9f=_0x130410[_0x1ae596(0x219)][_0x216043];if(!_0x403d9f)throw new Error(_0x1ae596(0x208)+_0x216043+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x39df2a=_0x524c8a?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x43845e,_0x403d9f,_0x34e870,await scanLocalBffFunctions(_0x43845e,_0x1ae596(0x1b1))),_0x403d9f):undefined,_0x215af4=createPullFileTransaction(),_0x441f71=[],_0x241b4f=[],_0x34d4d1=[],_0x27fc1d=[];for(const _0x39481a of _0x21a2db){const _0x4039e9=resolveRemoteScriptTarget(_0x43845e,_0x39481a,_0x3c0d79,_0x403d9f['functions'],_0x34e870);if(!_0x4039e9){_0x241b4f[_0x1ae596(0x23f)]({'lockKey':_0x39481a['scriptType']+'/'+_0x39481a[_0x1ae596(0x1ad)],'reason':_0x1ae596(0x22a)});continue;}const _0x57be6f=_0x403d9f[_0x1ae596(0x1fc)][_0x4039e9['lockKey']];try{if(!_0x39481a['id'])throw new Error(_0x1ae596(0x1a8));if(_0x39481a[_0x1ae596(0x223)]==null)throw new Error(_0x1ae596(0x1f6));const _0x1a7e3d=_0x39481a['scriptContent'],_0x1c6631=computeContentHash(_0x1a7e3d);if(!_0x44cca3){const _0x57cfbe=await hasUnsyncedLocalChanges(_0x4039e9['filePath'],_0x57be6f,_0x1c6631);if(_0x57cfbe){_0x34d4d1['push'](localUnsyncedConflict(_0x4039e9,_0x39481a['id']));continue;}}await _0x215af4['write'](_0x4039e9[_0x1ae596(0x233)],_0x1a7e3d);const _0xd165bf={'hash':_0x1c6631,'remoteId':_0x39481a['id'],'version':_0x39481a['version']};_0x4039e9[_0x1ae596(0x1ff)]===_0x1ae596(0x1b1)&&_0x4039e9[_0x1ae596(0x1d2)]&&(_0xd165bf['alias']=_0x4039e9[_0x1ae596(0x1d2)][_0x1ae596(0x215)],_0xd165bf[_0x1ae596(0x202)]=_0x4039e9[_0x1ae596(0x1d2)]['datasetCode'],_0xd165bf[_0x1ae596(0x1c2)]=_0x4039e9[_0x1ae596(0x1d2)][_0x1ae596(0x1c2)],_0xd165bf[_0x1ae596(0x20a)]=_0x4039e9[_0x1ae596(0x1d2)][_0x1ae596(0x20a)]),_0x403d9f[_0x1ae596(0x1fc)][_0x4039e9['lockKey']]=_0xd165bf,_0x441f71[_0x1ae596(0x23f)]({'lockKey':_0x4039e9['lockKey'],'remoteId':_0x39481a['id']});}catch(_0xfc00e3){_0x27fc1d[_0x1ae596(0x23f)]({'lockKey':_0x4039e9[_0x1ae596(0x1b2)],'error':_0xfc00e3 instanceof Error?_0xfc00e3['message']:String(_0xfc00e3)});}}_0x403d9f['lastSync']=new Date()[_0x1ae596(0x1b3)]();try{await writeBffLockFile(_0x43845e['lockFilePath'],_0x130410);}catch(_0xcfcc8c){const _0x7cd6ee=[...await _0x215af4['rollback'](),...await _0x39df2a?.['rollback']()??[]];throw withRollbackErrors(_0xcfcc8c,_0x1ae596(0x1e0),_0x7cd6ee);}return{'ok':_0x27fc1d[_0x1ae596(0x1da)]===0x0,'data':{'pulled':_0x441f71,'skipped':_0x241b4f,'conflicts':_0x34d4d1,'failed':_0x27fc1d},'message':formatPullMessage(_0x441f71[_0x1ae596(0x1da)],_0x241b4f[_0x1ae596(0x1da)],_0x34d4d1['length'],_0x27fc1d[_0x1ae596(0x1da)])};}};function localUnsyncedConflict(_0x3381cd,_0x3fab70){const _0x13cbed=a43_0x204254,_0x59916d=_0x3381cd[_0x13cbed(0x1b2)][_0x13cbed(0x1e4)]('/')['at'](-0x1);return{'code':_0x13cbed(0x1ba),'lockKey':_0x3381cd[_0x13cbed(0x1b2)],'filePath':_0x3381cd[_0x13cbed(0x233)],..._0x3fab70!=null?{'remoteId':_0x3fab70}:{},'message':_0x13cbed(0x235),'nextAction':{'action':_0x13cbed(0x218),'command':CLI_BIN_NAME+'\x20bff\x20push\x20--type\x20'+_0x3381cd[_0x13cbed(0x1ff)]+_0x13cbed(0x201)+_0x59916d+_0x13cbed(0x1fd),'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(_0x562f98,_0x33ba70,_0x36a78c,_0x21c850){const _0x278d16=a43_0x204254,_0x225c56=[_0x278d16(0x1dc)+_0x562f98+_0x278d16(0x23c),_0x33ba70+_0x278d16(0x220)];_0x36a78c>0x0&&_0x225c56[_0x278d16(0x23f)](_0x36a78c+_0x278d16(0x231)+(_0x36a78c===0x1?'':'s')+'\x20'+(_0x36a78c===0x1?_0x278d16(0x1ce):_0x278d16(0x1fe))+_0x278d16(0x1c0));if(_0x21c850>0x0)_0x225c56['push'](_0x21c850+_0x278d16(0x1be));return _0x225c56[_0x278d16(0x207)](',\x20');}async function hasUnsyncedLocalChanges(_0x5b8de6,_0x11d5a3,_0x1089c0){if(!await fileExists(_0x5b8de6))return![];const _0x1e6ba3=await computeFileHash(_0x5b8de6);if(!_0x11d5a3)return _0x1089c0?_0x1e6ba3!==_0x1089c0:!![];return _0x1e6ba3!==_0x11d5a3['hash'];}function createPullFileTransaction(){const _0x2ce6ee=new Map(),_0x3c1206=async(_0x6bd4f4,_0x4ebc52)=>{const _0x3cbb1d=a43_0x4228;try{if(_0x4ebc52[_0x3cbb1d(0x222)])await ensureParentDirectory(_0x6bd4f4),await writeFile(_0x6bd4f4,_0x4ebc52['content']);else try{await unlink(_0x6bd4f4);}catch(_0x1d108c){if(_0x1d108c[_0x3cbb1d(0x1d5)]!==_0x3cbb1d(0x1b4))throw _0x1d108c;}return undefined;}catch(_0x93de0a){return _0x93de0a instanceof Error?_0x93de0a:new Error(String(_0x93de0a));}};return{async 'write'(_0x5b43e8,_0x464c0d){const _0x325067=a43_0x4228;if(!_0x2ce6ee['has'](_0x5b43e8))try{_0x2ce6ee[_0x325067(0x1e7)](_0x5b43e8,{'existed':!![],'content':await readFile(_0x5b43e8)});}catch(_0x16f220){if(_0x16f220[_0x325067(0x1d5)]!==_0x325067(0x1b4))throw _0x16f220;_0x2ce6ee[_0x325067(0x1e7)](_0x5b43e8,{'existed':![]});}try{await ensureParentDirectory(_0x5b43e8),await writeFile(_0x5b43e8,_0x464c0d,_0x325067(0x210));}catch(_0x33154e){const _0xd307c0=await _0x3c1206(_0x5b43e8,_0x2ce6ee['get'](_0x5b43e8));if(!_0xd307c0)_0x2ce6ee[_0x325067(0x1e9)](_0x5b43e8);throw withRollbackErrors(_0x33154e,_0x325067(0x23d)+_0x5b43e8+'\x22.',_0xd307c0?[_0xd307c0]:[]);}},async 'rollback'(){const _0x1ee80f=a43_0x4228,_0x31dfe6=[];for(const [_0x61ba94,_0x82abac]of[..._0x2ce6ee[_0x1ee80f(0x226)]()][_0x1ee80f(0x1af)]()){const _0x4e288c=await _0x3c1206(_0x61ba94,_0x82abac);_0x4e288c&&_0x31dfe6['push'](new Error(_0x1ee80f(0x1ee)+_0x61ba94+'\x22:\x20'+_0x4e288c['message']));}return _0x31dfe6;}};}function withRollbackErrors(_0x12c47a,_0x16d844,_0x74a8e9){const _0x3a9208=a43_0x204254,_0x183c26=_0x12c47a instanceof Error?_0x12c47a:new Error(String(_0x12c47a));if(_0x74a8e9['length']===0x0)return _0x183c26;return new AggregateError([_0x183c26,..._0x74a8e9],_0x16d844+_0x3a9208(0x22b)+_0x74a8e9[_0x3a9208(0x1f2)](_0x28d4cd=>_0x28d4cd['message'])[_0x3a9208(0x207)](';\x20'));}function buildDatasetCodeToAliasMap(_0x167aed,_0x1100be,_0x4c505f){const _0x573b5f=a43_0x204254,_0x524acd=resolveApiModelSource(_0x167aed,_0x1100be,_0x4c505f),_0x299baf=loadAliasMap(_0x167aed,undefined,_0x524acd[_0x573b5f(0x233)],_0x524acd['profileName']);return assertUnambiguousHookAliases(_0x299baf),new Map(_0x299baf[_0x573b5f(0x1f2)](_0x22f57c=>[_0x22f57c['datasetCode'][_0x573b5f(0x1bb)](),_0x22f57c['alias']]));}async function planHookDirectoryMigration(_0x3c77d2,_0x1b4af2,_0xc9ec9e,_0x59c2ba){const _0x1e4252=a43_0x204254,_0x20d739=new Map();for(const [_0x1184c6,_0x25bbdc]of Object[_0x1e4252(0x226)](_0x1b4af2[_0x1e4252(0x1fc)])){const [_0x42be63,_0x409875,_0x226c17,_0x45b237,_0xfbf882,..._0x47c78e]=_0x1184c6[_0x1e4252(0x1e4)]('/');if(_0x42be63!=='HOOK'||!_0x409875||!_0x226c17||!_0x45b237||!_0xfbf882||_0x47c78e[_0x1e4252(0x1da)]>0x0||!_0x25bbdc[_0x1e4252(0x202)])continue;const _0x1dc81b=_0xc9ec9e[_0x1e4252(0x21f)](_0x25bbdc[_0x1e4252(0x202)]['toLowerCase']()),_0xd82668=_0x1dc81b??_0x25bbdc[_0x1e4252(0x202)];if(!isSafeHookDirectorySegment(_0x409875))throw CliErrors[_0x1e4252(0x1e3)](_0x1e4252(0x1d7)+_0x409875+_0x1e4252(0x1d1));if(!isSafeHookDirectorySegment(_0xd82668))throw CliErrors[_0x1e4252(0x1e3)](_0x1e4252(0x217)+_0x409875+_0x1e4252(0x1ec));if(_0x409875===_0xd82668)continue;const _0x473fad=_0x20d739[_0x1e4252(0x21f)](_0x409875)??{'datasetCode':_0x25bbdc[_0x1e4252(0x202)],'alias':_0x1dc81b,'keyChanges':[]};if(_0x473fad['datasetCode']!==_0x25bbdc[_0x1e4252(0x202)])throw CliErrors['validation'](_0x1e4252(0x217)+_0x409875+'\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.');const _0x345a11=_0x1e4252(0x1bf)+_0xd82668+'/'+_0x226c17+'/'+_0x45b237+'/'+_0xfbf882;try{resolveLocalFilePathFromLockKey(_0x3c77d2,_0x1184c6),resolveLocalFilePathFromLockKey(_0x3c77d2,_0x345a11);}catch(_0x293008){throw CliErrors[_0x1e4252(0x1e3)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'+_0x1184c6+_0x1e4252(0x1ea)+(_0x293008 instanceof Error?_0x293008['message']:String(_0x293008)));}_0x473fad[_0x1e4252(0x1a7)]['push']({'oldLockKey':_0x1184c6,'newLockKey':_0x345a11,'entry':_0x25bbdc}),_0x20d739[_0x1e4252(0x1e7)](_0x409875,_0x473fad);}const _0xbd08d1=new Set([..._0x20d739['values']()][_0x1e4252(0x1ed)](_0x12ac85=>_0x12ac85[_0x1e4252(0x1a7)][_0x1e4252(0x1f2)](_0xe07a0b=>_0xe07a0b[_0x1e4252(0x1f9)]))),_0xbb00ba=new Map(),_0x3a689d=new Map();for(const [_0xed7981,_0x30d270]of _0x20d739){const _0x3f1df8=_0x30d270[_0x1e4252(0x215)]??_0x30d270[_0x1e4252(0x202)],_0x2631bb=hookDirectoryIdentity(_0x3f1df8),_0x509fa2=_0xbb00ba[_0x1e4252(0x21f)](_0x2631bb);if(_0x509fa2&&_0x509fa2!==_0xed7981)throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directories\x20\x22'+_0x509fa2+_0x1e4252(0x1ae)+_0xed7981+_0x1e4252(0x1b7)+_0x3f1df8+_0x1e4252(0x20c));_0xbb00ba[_0x1e4252(0x1e7)](_0x2631bb,_0xed7981);for(const _0x32402d of _0x30d270[_0x1e4252(0x1a7)]){const _0x311c66=_0x3a689d[_0x1e4252(0x21f)](_0x32402d['newLockKey']);if(_0x311c66&&_0x311c66!==_0x32402d[_0x1e4252(0x1f9)])throw CliErrors[_0x1e4252(0x1e3)](_0x1e4252(0x20d)+_0x311c66+_0x1e4252(0x1ae)+_0x32402d[_0x1e4252(0x1f9)]+_0x1e4252(0x1b7)+_0x32402d[_0x1e4252(0x1f0)]+'\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');if(_0xbd08d1[_0x1e4252(0x1b9)](_0x32402d[_0x1e4252(0x1f0)]))throw CliErrors[_0x1e4252(0x1e3)]('Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22'+_0x32402d[_0x1e4252(0x1f9)]+_0x1e4252(0x228)+_0x32402d[_0x1e4252(0x1f0)]+_0x1e4252(0x236));_0x3a689d[_0x1e4252(0x1e7)](_0x32402d['newLockKey'],_0x32402d[_0x1e4252(0x1f9)]);}}const _0x53ddb0=new Map();for(const [_0x5389e2,_0xed6fed]of _0xc9ec9e){_0x53ddb0[_0x1e4252(0x1e7)](hookDirectoryIdentity(_0xed6fed),_0x5389e2);}const _0x5ddc7a=[];for(const [_0x112c6e,_0x2f2533]of _0x20d739){const _0x30152e=_0x2f2533[_0x1e4252(0x215)]??_0x2f2533[_0x1e4252(0x202)],_0x1843cf=join(_0x3c77d2[_0x1e4252(0x1cc)],_0x1e4252(0x1b1),_0x112c6e),_0x5bcfaa=join(_0x3c77d2['scriptsRootDir'],_0x1e4252(0x1b1),_0x30152e),_0x3593c1=await directoryExists(_0x1843cf),_0x37af35=await directoryExists(_0x5bcfaa),_0x26937b=_0x3593c1?_0x37af35?await sameDirectory(_0x1843cf,_0x5bcfaa)?_0x1e4252(0x21c):undefined:'move':_0x1e4252(0x230);if(!_0x26937b)throw CliErrors['validation'](_0x1e4252(0x217)+_0x112c6e+'\x22\x20to\x20\x22'+_0x30152e+_0x1e4252(0x1c3));const _0x1d8e83=_0x53ddb0[_0x1e4252(0x21f)](hookDirectoryIdentity(_0x112c6e));if(_0x1d8e83&&_0x1d8e83!==_0x2f2533[_0x1e4252(0x202)]['toLowerCase']()){const _0x3ae6d5=new Set(_0x2f2533[_0x1e4252(0x1a7)][_0x1e4252(0x1f2)](_0x341320=>_0x341320[_0x1e4252(0x1f9)])),_0x39d3f7=_0x59c2ba[_0x1e4252(0x214)](_0x5b9ec9=>_0x5b9ec9[_0x1e4252(0x1ff)]==='HOOK'&&_0x5b9ec9[_0x1e4252(0x215)]!=null&&hookDirectoryIdentity(_0x5b9ec9[_0x1e4252(0x215)])===hookDirectoryIdentity(_0x112c6e)&&!_0x3ae6d5[_0x1e4252(0x1b9)](_0x5b9ec9['lockKey']));if(_0x39d3f7['length']>0x0)throw CliErrors['validation'](_0x1e4252(0x217)+_0x112c6e+_0x1e4252(0x23e));}const _0x22d4cb=_0x53ddb0['get'](hookDirectoryIdentity(_0x30152e));if(_0x22d4cb&&_0x22d4cb!==_0x2f2533[_0x1e4252(0x202)][_0x1e4252(0x1bb)]())throw CliErrors[_0x1e4252(0x1e3)](_0x1e4252(0x217)+_0x112c6e+_0x1e4252(0x20b)+_0x30152e+_0x1e4252(0x1b0));for(const _0x460358 of _0x2f2533[_0x1e4252(0x1a7)]){const _0x4b4832=_0x1b4af2[_0x1e4252(0x1fc)][_0x460358[_0x1e4252(0x1f0)]];if(_0x4b4832&&!_0xbd08d1[_0x1e4252(0x1b9)](_0x460358['newLockKey'])&&!sameHookIdentity(_0x460358['entry'],_0x4b4832))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x112c6e+_0x1e4252(0x20b)+_0x30152e+_0x1e4252(0x1cf));}_0x5ddc7a[_0x1e4252(0x23f)]({'oldDirectory':_0x112c6e,'newDirectory':_0x30152e,'oldDirectoryPath':_0x1843cf,'newDirectoryPath':_0x5bcfaa,'mode':_0x26937b,'alias':_0x2f2533[_0x1e4252(0x215)],'keyChanges':_0x2f2533['keyChanges']});}const _0x1b0125={..._0x1b4af2[_0x1e4252(0x1fc)]},_0x875958=new Map(),_0x1d43e4=new Map();for(const _0xe73612 of _0x5ddc7a){const _0x4c6437=_0xe73612['mode']!==_0x1e4252(0x230);_0x4c6437&&_0x1d43e4[_0x1e4252(0x1e7)](hookDirectoryIdentity(_0xe73612[_0x1e4252(0x1d9)]),_0xe73612['oldDirectoryPath']);for(const _0xc6e0d of _0xe73612['keyChanges']){const _0x4e00d8=_0x1b0125[_0xc6e0d['newLockKey']],_0x7d1bae=_0x4c6437?_0xc6e0d['entry']:_0x4e00d8??_0xc6e0d[_0x1e4252(0x205)];_0x1b0125[_0xc6e0d[_0x1e4252(0x1f0)]]=canonicalizeHookEntry(_0x7d1bae,_0xe73612['alias']),delete _0x1b0125[_0xc6e0d['oldLockKey']],_0x4c6437&&_0x875958[_0x1e4252(0x1e7)](_0xc6e0d[_0x1e4252(0x1f0)],resolveLocalFilePathFromLockKey(_0x3c77d2,_0xc6e0d[_0x1e4252(0x1f9)]));}}return{'migrations':_0x5ddc7a,'projectedFunctions':_0x1b0125,'sourceFilePathByNewLockKey':_0x875958,'sourceDirectoryPathByNewDirectory':_0x1d43e4};}function resolveMigratedSourceFilePath(_0x22ed23,_0x10419d){const _0x442b08=a43_0x204254;if(!_0x22ed23||!_0x10419d)return undefined;const _0x54aba7=_0x22ed23[_0x442b08(0x22d)]['get'](_0x10419d['lockKey']);if(_0x54aba7)return _0x54aba7;if(_0x10419d[_0x442b08(0x1ff)]!=='HOOK')return undefined;const [,_0x20bc03,..._0x1d1934]=_0x10419d[_0x442b08(0x1b2)]['split']('/');if(!_0x20bc03||_0x1d1934['length']===0x0)return undefined;const _0x3de8c6=_0x22ed23[_0x442b08(0x212)][_0x442b08(0x21f)](hookDirectoryIdentity(_0x20bc03));return _0x3de8c6?join(_0x3de8c6,..._0x1d1934)+'.js':undefined;}function sameHookIdentity(_0xab0c85,_0x2877a6){const _0x3f5923=a43_0x204254;return _0xab0c85['remoteId']===_0x2877a6['remoteId']&&_0xab0c85['datasetCode']===_0x2877a6[_0x3f5923(0x202)]&&_0xab0c85[_0x3f5923(0x1c2)]===_0x2877a6[_0x3f5923(0x1c2)]&&_0xab0c85[_0x3f5923(0x20a)]===_0x2877a6[_0x3f5923(0x20a)];}function canonicalizeHookEntry(_0x4cc035,_0x3318b6){const {alias:_0xa2d03b,..._0x4c4143}=_0x4cc035;return _0x3318b6?{..._0x4c4143,'alias':_0x3318b6}:_0x4c4143;}function hookDirectoryIdentity(_0x281d4a){const _0x1bfa52=a43_0x204254;return _0x281d4a[_0x1bfa52(0x232)]('NFC')[_0x1bfa52(0x1bb)]();}function a43_0x3caa(){const _0x15836e=['HOOK','lockKey','toISOString','ENOENT','scriptsRoot','migrations','\x22:\x20both\x20target\x20\x22','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','has','BFF_LOCAL_UNSYNCED','toLowerCase','selectedAppName','includes','\x20failed','HOOK/','\x20resolution','str','operationType','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','.hook-directory-migrate-','stdin','ENDPOINT','bff','278304tbLLYJ','GET','nonInteractive','lockFilePath','scriptsRootDir','move','requires','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','\x22\x20may\x20remain.','\x22\x20from\x20the\x20lock\x20file.','hookLocation','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','oldDirectoryPath','code','scriptType','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','121AFApOQ','newDirectory','length','skipped','Pull\x20complete:\x20','projectedFunctions','question','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','pull','message','validation','split','mergedCli','newDirectoryPath','set','apiDir','delete','\x22:\x20','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','flatMap','Could\x20not\x20restore\x20local\x20script\x20\x22','2061KWzzAZ','newLockKey','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','map','yes','Pull\x20only\x20this\x20script\x20type','Force\x20pull\x20cancelled.','Remote\x20script\x20missing\x20content.','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','ino','oldLockKey','string','10312xdxdmz','functions','\x20--format\x20compress','require','type','appCode','\x20--name\x20','datasetCode','dev','509390gwrPau','entry','&currentPage=1&pageSize=','join','Lock\x20scope\x20for\x20app\x20\x22','Force\x20overwrite\x20local\x20unsynced\x20changes','functionNode','\x22\x20to\x20\x22','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','Would\x20inspect\x20','defaultApp','utf8','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','sourceDirectoryPathByNewDirectory','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','filter','alias','105VLZvIc','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','push_local','apps','COMMON','5lwHPDJ','case-rename','oldDirectory','208046WuImxl','get','\x20skipped','149808erkwps','existed','scriptContent','parse','currentApp','entries','830089TYRNCh','\x22:\x20its\x20target\x20\x22','mode','unresolvable\x20target\x20path','\x20Recovery\x20errors:\x20','\x22;\x20temporary\x20directory\x20\x22','sourceFilePathByNewLockKey','conflict','432OczkKF','rekey','\x20conflict','normalize','filePath','close','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','stringify','force','210536SWukwg','boolean','some','\x20pulled','Failed\x20to\x20write\x20local\x20script\x20\x22','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','push','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','keyChanges','Remote\x20script\x20missing\x20id.','would_pull','\x22\x20from\x20\x22','bool','24qFLTRd','functionName','\x22\x20and\x20\x22','reverse','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.'];a43_0x3caa=function(){return _0x15836e;};return a43_0x3caa();}function isSafeHookDirectorySegment(_0x1a285){return isSafeLockKeySegment(_0x1a285);}async function sameDirectory(_0x3044bc,_0x234572){const _0x472244=a43_0x204254,[_0x4fcea3,_0x4842aa]=await Promise['all']([stat(_0x3044bc),stat(_0x234572)]);return _0x4fcea3[_0x472244(0x203)]===_0x4842aa['dev']&&_0x4fcea3[_0x472244(0x1f8)]===_0x4842aa[_0x472244(0x1f8)];}async function applyHookDirectoryMigration(_0x540d7c,_0x9ade8a){const _0x3a47bb=a43_0x204254,_0x461a8d=_0x9ade8a[_0x3a47bb(0x1fc)],_0xc5a23=_0x9ade8a['lastSync'],_0x3208ad=[],_0x9a2601=async()=>{const _0x4b6b84=_0x3a47bb,_0x136e1e=[];_0x9ade8a[_0x4b6b84(0x1fc)]=_0x461a8d,_0x9ade8a['lastSync']=_0xc5a23;for(const {migration:_0xfae653,temporaryPath:_0x4a7922}of[..._0x3208ad][_0x4b6b84(0x1af)]()){try{_0x4a7922?(await rename(_0xfae653[_0x4b6b84(0x1e6)],_0x4a7922),await rename(_0x4a7922,_0xfae653[_0x4b6b84(0x1d4)])):await rename(_0xfae653[_0x4b6b84(0x1e6)],_0xfae653['oldDirectoryPath']);}catch(_0x3f855d){_0x136e1e[_0x4b6b84(0x23f)](new Error(_0x4b6b84(0x1eb)+_0xfae653['oldDirectory']+_0x4b6b84(0x1aa)+_0xfae653[_0x4b6b84(0x1d9)]+_0x4b6b84(0x1ea)+(_0x3f855d instanceof Error?_0x3f855d['message']:String(_0x3f855d))));}}return _0x136e1e;};try{for(const _0xa764a1 of _0x540d7c[_0x3a47bb(0x1b6)]){if(_0xa764a1[_0x3a47bb(0x229)]===_0x3a47bb(0x1cd))await ensureParentDirectory(_0xa764a1[_0x3a47bb(0x1e6)]),await rename(_0xa764a1['oldDirectoryPath'],_0xa764a1[_0x3a47bb(0x1e6)]),_0x3208ad[_0x3a47bb(0x23f)]({'migration':_0xa764a1});else{if(_0xa764a1[_0x3a47bb(0x229)]===_0x3a47bb(0x21c)){const _0x430c8a=join(dirname(_0xa764a1[_0x3a47bb(0x1d4)]),_0x3a47bb(0x1c4)+randomUUID());await rename(_0xa764a1[_0x3a47bb(0x1d4)],_0x430c8a);try{await rename(_0x430c8a,_0xa764a1['newDirectoryPath']);}catch(_0x151423){try{await rename(_0x430c8a,_0xa764a1[_0x3a47bb(0x1d4)]);}catch(_0x56099d){throw withRollbackErrors(_0x151423,_0x3a47bb(0x1d3)+_0xa764a1[_0x3a47bb(0x21d)]+_0x3a47bb(0x20b)+_0xa764a1[_0x3a47bb(0x1d9)]+_0x3a47bb(0x22c)+_0x430c8a+_0x3a47bb(0x1d0),[new Error(_0x3a47bb(0x1df)+_0x430c8a+'\x22\x20to\x20\x22'+_0xa764a1['oldDirectory']+_0x3a47bb(0x1ea)+(_0x56099d instanceof Error?_0x56099d[_0x3a47bb(0x1e2)]:String(_0x56099d)))]);}throw _0x151423;}_0x3208ad[_0x3a47bb(0x23f)]({'migration':_0xa764a1,'temporaryPath':_0x430c8a});}}}return _0x9ade8a['functions']=_0x540d7c[_0x3a47bb(0x1dd)],{'rollback':_0x9a2601};}catch(_0x3a4ca5){const _0x1ea531=await _0x9a2601();throw withRollbackErrors(_0x3a4ca5,_0x3a47bb(0x1b8),_0x1ea531);}}async function confirmForce(){const _0xddebe8=a43_0x204254,_0x31a321=createInterface({'input':process[_0xddebe8(0x1c5)],'output':process['stderr']}),_0x4f7a7c=await new Promise(_0xd5a641=>{const _0x43c1a0=_0xddebe8;_0x31a321[_0x43c1a0(0x1de)](_0x43c1a0(0x213),_0xd5a641);});return _0x31a321[_0xddebe8(0x234)](),['y',_0xddebe8(0x1f3)][_0xddebe8(0x1bd)](_0x4f7a7c['trim']()[_0xddebe8(0x1bb)]());}
1
+ const a43_0x14c6a4=a43_0x48c4;(function(_0x341a12,_0x3ea205){const _0x1d1f35=a43_0x48c4,_0x8940e8=_0x341a12();while(!![]){try{const _0x1daa5a=parseInt(_0x1d1f35(0xd1))/0x1+-parseInt(_0x1d1f35(0x112))/0x2*(parseInt(_0x1d1f35(0xe0))/0x3)+-parseInt(_0x1d1f35(0x14f))/0x4+parseInt(_0x1d1f35(0x111))/0x5*(-parseInt(_0x1d1f35(0xe5))/0x6)+parseInt(_0x1d1f35(0xf5))/0x7*(-parseInt(_0x1d1f35(0xfd))/0x8)+-parseInt(_0x1d1f35(0x139))/0x9+parseInt(_0x1d1f35(0xe2))/0xa;if(_0x1daa5a===_0x3ea205)break;else _0x8940e8['push'](_0x8940e8['shift']());}catch(_0x22d30c){_0x8940e8['push'](_0x8940e8['shift']());}}}(a43_0x44ad,0x404ed));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_0x14c6a4(0x154),'command':a43_0x14c6a4(0x145),'description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':'read','structuredErrors':!![],'flags':[{'name':'type','type':a43_0x14c6a4(0x128),'description':a43_0x14c6a4(0x10a),'enum':['COMMON',a43_0x14c6a4(0xd0),a43_0x14c6a4(0xf7)]},{'name':a43_0x14c6a4(0x146),'type':a43_0x14c6a4(0x10e),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4a0fa0){const _0x3ae066=a43_0x14c6a4,_0x20f4bb=loadBffProjectConfig(_0x4a0fa0[_0x3ae066(0xed)]),_0x14ba80=await readBffLockFile(_0x20f4bb['lockFilePath']),{appLock:_0x259742}=ensureLockScope(_0x14ba80??createEmptyBffLock(),_0x4a0fa0[_0x3ae066(0xed)],_0x20f4bb[_0x3ae066(0x13d)],_0x3ae066(0x145)),_0x2fbe07=normalizeBffType(_0x4a0fa0['str'](_0x3ae066(0x12b)))??undefined,[_0x340814,_0x3e1020]=await Promise[_0x3ae066(0x132)]([listBffScripts(_0x4a0fa0['appCode'],_0x2fbe07),getBffScriptStatistics(_0x4a0fa0[_0x3ae066(0xed)])]),_0x5f43cd=_0x340814['some'](_0xdda9b6=>normalizeBffType(_0xdda9b6[_0x3ae066(0x14a)])===_0x3ae066(0xf7)),_0x59ba53=_0x5f43cd?buildDatasetCodeToAliasMap(_0x4a0fa0[_0x3ae066(0x120)],_0x4a0fa0[_0x3ae066(0xed)],_0x4a0fa0[_0x3ae066(0x14e)]||_0x4a0fa0[_0x3ae066(0xd7)]?.[_0x3ae066(0x113)]||_0x4a0fa0[_0x3ae066(0xd7)]?.['defaultApp']):new Map(),_0x240ef7=_0x5f43cd?await planHookDirectoryMigration(_0x20f4bb,_0x259742,_0x59ba53,await scanLocalBffFunctions(_0x20f4bb,_0x3ae066(0xf7))):undefined,_0x5f182c=createHookLocationMap(_0x3e1020),_0x558af1=[];for(const _0x269544 of _0x340814){const _0x14c592=resolveRemoteScriptTarget(_0x20f4bb,_0x269544,_0x5f182c,_0x240ef7?.['projectedFunctions']??_0x259742[_0x3ae066(0x15d)],_0x59ba53);if(!_0x14c592){_0x558af1['push']({'scriptType':_0x269544[_0x3ae066(0x14a)],'functionName':_0x269544[_0x3ae066(0xde)]??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x20069d=(_0x240ef7?.[_0x3ae066(0xf2)]??_0x259742[_0x3ae066(0x15d)])[_0x14c592[_0x3ae066(0xff)]],_0x1ee72f=_0x269544[_0x3ae066(0xdd)]!=null?computeContentHash(_0x269544[_0x3ae066(0xdd)]):undefined,_0x1a1671=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x240ef7,_0x14c592)??_0x14c592[_0x3ae066(0xf3)],_0x20069d,_0x1ee72f),_0xa7295e=_0x1a1671?localUnsyncedConflict(_0x14c592,_0x269544['id']):undefined;_0x558af1[_0x3ae066(0xfc)]({'lockKey':_0x14c592[_0x3ae066(0xff)],'filePath':_0x14c592[_0x3ae066(0xf3)],'remoteId':_0x269544['id']??null,'status':_0xa7295e?_0x3ae066(0x10c):_0x3ae066(0x142),..._0xa7295e?{'conflict':_0xa7295e}:{},..._0x14c592[_0x3ae066(0xe1)]?{'alias':_0x14c592[_0x3ae066(0xe1)][_0x3ae066(0x141)]??null,'datasetCode':_0x14c592[_0x3ae066(0xe1)][_0x3ae066(0xeb)],'operationType':_0x14c592['hookLocation'][_0x3ae066(0x103)],'functionNode':_0x14c592[_0x3ae066(0xe1)][_0x3ae066(0x106)]}:{}});}return{'method':_0x3ae066(0x11e),'url':_0x3ae066(0x10f)+_0x4a0fa0[_0x3ae066(0xed)]+(_0x2fbe07?_0x3ae066(0x150)+_0x2fbe07:'')+_0x3ae066(0x14d)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x4a0fa0[_0x3ae066(0xed)],'filterType':_0x2fbe07??null,..._0x240ef7&&_0x240ef7['migrations'][_0x3ae066(0xcb)]>0x0?{'hookDirectoryMigrations':_0x240ef7[_0x3ae066(0xd4)][_0x3ae066(0x131)](_0x3c669a=>({'from':_0x3c669a[_0x3ae066(0x133)],'to':_0x3c669a[_0x3ae066(0x107)]}))}:{},'files':_0x558af1},'description':_0x3ae066(0x10b)+_0x558af1[_0x3ae066(0xcb)]+'\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'};},async 'execute'(_0x4e0c76){const _0x474349=a43_0x14c6a4,_0x517b94=loadBffProjectConfig(_0x4e0c76['appCode']),_0x288df4=await readBffLockFile(_0x517b94[_0x474349(0x110)]),{lockData:_0x34b587,appLock:_0x2e361c}=ensureLockScope(_0x288df4??createEmptyBffLock(),_0x4e0c76['appCode'],_0x517b94[_0x474349(0x13d)],_0x474349(0x145)),_0x4d132b=normalizeBffType(_0x4e0c76[_0x474349(0xe4)]('type'))??undefined;if(_0x4e0c76[_0x474349(0xe4)](_0x474349(0x12b))&&!_0x4d132b)throw CliErrors[_0x474349(0xc9)](_0x474349(0x124));const [_0xb9ec33,_0xf661f]=await Promise[_0x474349(0x132)]([listBffScripts(_0x4e0c76[_0x474349(0xed)],_0x4d132b),getBffScriptStatistics(_0x4e0c76[_0x474349(0xed)])]);if(_0xb9ec33['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0x5ad3ee=_0x4e0c76[_0x474349(0x156)](_0x474349(0x146));if(_0x5ad3ee&&!_0x4e0c76[_0x474349(0x108)]){const _0x9833ec=await confirmForce();if(!_0x9833ec)throw CliErrors[_0x474349(0xf0)](_0x474349(0x11d));}if(_0x5ad3ee&&_0x4e0c76[_0x474349(0x108)]){}const _0x4907dd=_0xb9ec33['some'](_0x2e6a05=>normalizeBffType(_0x2e6a05[_0x474349(0x14a)])===_0x474349(0xf7)),_0x9f7b8a=_0x4907dd?buildDatasetCodeToAliasMap(_0x4e0c76[_0x474349(0x120)],_0x4e0c76['appCode'],_0x4e0c76['selectedAppName']||_0x4e0c76[_0x474349(0xd7)]?.[_0x474349(0x113)]||_0x4e0c76[_0x474349(0xd7)]?.[_0x474349(0x117)]):new Map(),_0x114240=createHookLocationMap(_0xf661f),_0x505025=JSON[_0x474349(0x118)](JSON['stringify'](_0x34b587)),_0x2c8917=_0x4e0c76[_0x474349(0xed)],_0x2131db=_0x505025[_0x474349(0x115)][_0x2c8917];if(!_0x2131db)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x2c8917+_0x474349(0xec));const _0x43bbe9=_0x4907dd?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x517b94,_0x2131db,_0x9f7b8a,await scanLocalBffFunctions(_0x517b94,'HOOK')),_0x2131db):undefined,_0x59434f=createPullFileTransaction(),_0x588551=[],_0x431855=[],_0x3fa2a3=[],_0x315bca=[];for(const _0x194cb7 of _0xb9ec33){const _0xf39705=resolveRemoteScriptTarget(_0x517b94,_0x194cb7,_0x114240,_0x2131db['functions'],_0x9f7b8a);if(!_0xf39705){_0x431855['push']({'lockKey':_0x194cb7['scriptType']+'/'+_0x194cb7['functionName'],'reason':_0x474349(0x116)});continue;}const _0x2975a2=_0x2131db[_0x474349(0x15d)][_0xf39705['lockKey']];try{if(!_0x194cb7['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x194cb7[_0x474349(0xdd)]==null)throw new Error(_0x474349(0x100));const _0x18b34=_0x194cb7[_0x474349(0xdd)],_0x26aa5e=computeContentHash(_0x18b34);if(!_0x5ad3ee){const _0x268b9b=await hasUnsyncedLocalChanges(_0xf39705[_0x474349(0xf3)],_0x2975a2,_0x26aa5e);if(_0x268b9b){_0x3fa2a3['push'](localUnsyncedConflict(_0xf39705,_0x194cb7['id']));continue;}}await _0x59434f[_0x474349(0x12e)](_0xf39705[_0x474349(0xf3)],_0x18b34);const _0x355352={'hash':_0x26aa5e,'remoteId':_0x194cb7['id'],'version':_0x194cb7[_0x474349(0x121)]};_0xf39705[_0x474349(0x12b)]===_0x474349(0xf7)&&_0xf39705[_0x474349(0xe1)]&&(_0x355352[_0x474349(0x141)]=_0xf39705[_0x474349(0xe1)][_0x474349(0x141)],_0x355352[_0x474349(0xeb)]=_0xf39705[_0x474349(0xe1)]['datasetCode'],_0x355352[_0x474349(0x103)]=_0xf39705[_0x474349(0xe1)][_0x474349(0x103)],_0x355352[_0x474349(0x106)]=_0xf39705[_0x474349(0xe1)][_0x474349(0x106)]),_0x2131db['functions'][_0xf39705[_0x474349(0xff)]]=_0x355352,_0x588551[_0x474349(0xfc)]({'lockKey':_0xf39705[_0x474349(0xff)],'remoteId':_0x194cb7['id']});}catch(_0xe5706e){_0x315bca['push']({'lockKey':_0xf39705[_0x474349(0xff)],'error':_0xe5706e instanceof Error?_0xe5706e[_0x474349(0x134)]:String(_0xe5706e)});}}_0x2131db[_0x474349(0xce)]=new Date()[_0x474349(0xe9)]();try{await writeBffLockFile(_0x517b94['lockFilePath'],_0x505025);}catch(_0x2efd58){const _0x5ec9e8=[...await _0x59434f['rollback'](),...await _0x43bbe9?.[_0x474349(0x12a)]()??[]];throw withRollbackErrors(_0x2efd58,_0x474349(0x135),_0x5ec9e8);}return{'ok':_0x315bca[_0x474349(0xcb)]===0x0,'data':{'pulled':_0x588551,'skipped':_0x431855,'conflicts':_0x3fa2a3,'failed':_0x315bca},'message':formatPullMessage(_0x588551[_0x474349(0xcb)],_0x431855['length'],_0x3fa2a3[_0x474349(0xcb)],_0x315bca[_0x474349(0xcb)])};}};function localUnsyncedConflict(_0x2f520d,_0x349a20){const _0x3439bd=a43_0x14c6a4,_0x56ddc2=_0x2f520d[_0x3439bd(0xff)][_0x3439bd(0x11c)]('/')['at'](-0x1);return{'code':_0x3439bd(0x15b),'lockKey':_0x2f520d['lockKey'],'filePath':_0x2f520d[_0x3439bd(0xf3)],..._0x349a20!=null?{'remoteId':_0x349a20}:{},'message':_0x3439bd(0x13e),'nextAction':{'action':_0x3439bd(0x13c),'command':CLI_BIN_NAME+_0x3439bd(0x11a)+_0x2f520d['type']+_0x3439bd(0x155)+_0x56ddc2+_0x3439bd(0x12c),'requiresReview':!![],'message':_0x3439bd(0xfb)}};}function formatPullMessage(_0x403695,_0x3ae79a,_0x10b481,_0x3c0d53){const _0x29eafa=a43_0x14c6a4,_0x20f8ca=[_0x29eafa(0xee)+_0x403695+'\x20pulled',_0x3ae79a+'\x20skipped'];_0x10b481>0x0&&_0x20f8ca[_0x29eafa(0xfc)](_0x10b481+_0x29eafa(0x13a)+(_0x10b481===0x1?'':'s')+'\x20'+(_0x10b481===0x1?_0x29eafa(0x101):_0x29eafa(0x143))+_0x29eafa(0x13f));if(_0x3c0d53>0x0)_0x20f8ca[_0x29eafa(0xfc)](_0x3c0d53+_0x29eafa(0x130));return _0x20f8ca[_0x29eafa(0xdb)](',\x20');}async function hasUnsyncedLocalChanges(_0x1042f3,_0x3273e2,_0x208059){const _0x45e575=a43_0x14c6a4;if(!await fileExists(_0x1042f3))return![];const _0xa183d7=await computeFileHash(_0x1042f3);if(!_0x3273e2)return _0x208059?_0xa183d7!==_0x208059:!![];return _0xa183d7!==_0x3273e2[_0x45e575(0x119)];}function createPullFileTransaction(){const _0x5d5933=new Map(),_0x2617dc=async(_0x26e43a,_0xdc72ab)=>{const _0xa0d116=a43_0x48c4;try{if(_0xdc72ab[_0xa0d116(0xf1)])await ensureParentDirectory(_0x26e43a),await writeFile(_0x26e43a,_0xdc72ab[_0xa0d116(0x104)]);else try{await unlink(_0x26e43a);}catch(_0x14a117){if(_0x14a117[_0xa0d116(0x15c)]!==_0xa0d116(0x11b))throw _0x14a117;}return undefined;}catch(_0x369d69){return _0x369d69 instanceof Error?_0x369d69:new Error(String(_0x369d69));}};return{async 'write'(_0x5a97ef,_0x3a69ef){const _0x3f15f2=a43_0x48c4;if(!_0x5d5933[_0x3f15f2(0xef)](_0x5a97ef))try{_0x5d5933[_0x3f15f2(0x15f)](_0x5a97ef,{'existed':!![],'content':await readFile(_0x5a97ef)});}catch(_0x5472f7){if(_0x5472f7[_0x3f15f2(0x15c)]!==_0x3f15f2(0x11b))throw _0x5472f7;_0x5d5933[_0x3f15f2(0x15f)](_0x5a97ef,{'existed':![]});}try{await ensureParentDirectory(_0x5a97ef),await writeFile(_0x5a97ef,_0x3a69ef,_0x3f15f2(0x109));}catch(_0x508f29){const _0x13f8df=await _0x2617dc(_0x5a97ef,_0x5d5933[_0x3f15f2(0x148)](_0x5a97ef));if(!_0x13f8df)_0x5d5933['delete'](_0x5a97ef);throw withRollbackErrors(_0x508f29,_0x3f15f2(0x122)+_0x5a97ef+'\x22.',_0x13f8df?[_0x13f8df]:[]);}},async 'rollback'(){const _0x589964=a43_0x48c4,_0x5c6a0f=[];for(const [_0x2c7c8f,_0x29ae8f]of[..._0x5d5933[_0x589964(0xe3)]()]['reverse']()){const _0xa71781=await _0x2617dc(_0x2c7c8f,_0x29ae8f);_0xa71781&&_0x5c6a0f[_0x589964(0xfc)](new Error('Could\x20not\x20restore\x20local\x20script\x20\x22'+_0x2c7c8f+'\x22:\x20'+_0xa71781[_0x589964(0x134)]));}return _0x5c6a0f;}};}function a43_0x44ad(){const _0x549806=['selectedAppName','1343980YpKvON','&type=','newLockKey','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','keyChanges','bff','\x20--name\x20','bool','.js','dev','newDirectoryPath','\x22\x20may\x20remain.','BFF_LOCAL_UNSYNCED','code','functions','\x22:\x20both\x20target\x20\x22','set','validation','.hook-directory-migrate-','length','remoteId','mode','lastSync','\x22;\x20temporary\x20directory\x20\x22','ENDPOINT','491475ydBqVf','reverse','HOOK/','migrations','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','mergedCli','trim','\x22:\x20','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','join','\x22\x20to\x20\x22','scriptContent','functionName','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','75MsaITf','hookLocation','10396460pjQXnN','entries','str','1141266YOhdhi','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','sourceDirectoryPathByNewDirectory','question','toISOString','oldDirectoryPath','datasetCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','appCode','Pull\x20complete:\x20','has','cancelled','existed','projectedFunctions','filePath','\x22\x20from\x20\x22','928277zXaWsR','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','HOOK','case-rename','\x20Recovery\x20errors:\x20','scriptsRootDir','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.','push','8bznZHs','flatMap','lockKey','Remote\x20script\x20missing\x20content.','requires','sourceFilePathByNewLockKey','operationType','content','entry','functionNode','newDirectory','nonInteractive','utf8','Pull\x20only\x20this\x20script\x20type','Would\x20inspect\x20','conflict','normalize','boolean','/api/management/library/scripts/list?appCode=','lockFilePath','10OJieFu','15304AjTFqY','currentApp','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','apps','unresolvable\x20target\x20path','defaultApp','parse','hash','\x20bff\x20push\x20--type\x20','ENOENT','split','Force\x20pull\x20cancelled.','GET','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','apiDir','version','Failed\x20to\x20write\x20local\x20script\x20\x22','close','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','includes','\x22\x20and\x20\x22','filter','string','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','rollback','type','\x20--format\x20compress','oldLockKey','write','values','\x20failed','map','all','oldDirectory','message','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','profileName','toLowerCase','2046492dPdRxN','\x20conflict','stderr','push_local','scriptsRoot','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','\x20resolution','yes','alias','would_pull','require','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','pull','force','move','get','stdin','scriptType','\x22:\x20its\x20target\x20\x22','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','&currentPage=1&pageSize='];a43_0x44ad=function(){return _0x549806;};return a43_0x44ad();}function withRollbackErrors(_0x14af7b,_0x1f3d84,_0x2423ff){const _0x485b54=a43_0x14c6a4,_0x51a8e6=_0x14af7b instanceof Error?_0x14af7b:new Error(String(_0x14af7b));if(_0x2423ff[_0x485b54(0xcb)]===0x0)return _0x51a8e6;return new AggregateError([_0x51a8e6,..._0x2423ff],_0x1f3d84+_0x485b54(0xf9)+_0x2423ff[_0x485b54(0x131)](_0x9e1415=>_0x9e1415[_0x485b54(0x134)])[_0x485b54(0xdb)](';\x20'));}function buildDatasetCodeToAliasMap(_0x1452f4,_0x504377,_0x17a6dc){const _0x5d470d=a43_0x14c6a4,_0x4de3fb=resolveApiModelSource(_0x1452f4,_0x504377,_0x17a6dc),_0x1b531e=loadAliasMap(_0x1452f4,undefined,_0x4de3fb['filePath'],_0x4de3fb[_0x5d470d(0x137)]);return assertUnambiguousHookAliases(_0x1b531e),new Map(_0x1b531e[_0x5d470d(0x131)](_0x3c354f=>[_0x3c354f['datasetCode']['toLowerCase'](),_0x3c354f[_0x5d470d(0x141)]]));}async function planHookDirectoryMigration(_0x5e2e9c,_0x5119fe,_0x272f59,_0x50a62f){const _0xe820a7=a43_0x14c6a4,_0x6f154=new Map();for(const [_0x17e187,_0x22d484]of Object['entries'](_0x5119fe['functions'])){const [_0x52ba8d,_0x6c02b7,_0xe79a99,_0x4397ae,_0x56413c,..._0x505806]=_0x17e187['split']('/');if(_0x52ba8d!=='HOOK'||!_0x6c02b7||!_0xe79a99||!_0x4397ae||!_0x56413c||_0x505806[_0xe820a7(0xcb)]>0x0||!_0x22d484['datasetCode'])continue;const _0x18cab2=_0x272f59[_0xe820a7(0x148)](_0x22d484['datasetCode'][_0xe820a7(0x138)]()),_0x3e1d73=_0x18cab2??_0x22d484['datasetCode'];if(!isSafeHookDirectorySegment(_0x6c02b7))throw CliErrors[_0xe820a7(0xc9)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x6c02b7+'\x22\x20from\x20the\x20lock\x20file.');if(!isSafeHookDirectorySegment(_0x3e1d73))throw CliErrors[_0xe820a7(0xc9)](_0xe820a7(0x11f)+_0x6c02b7+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x6c02b7===_0x3e1d73)continue;const _0x551be9=_0x6f154[_0xe820a7(0x148)](_0x6c02b7)??{'datasetCode':_0x22d484[_0xe820a7(0xeb)],'alias':_0x18cab2,'keyChanges':[]};if(_0x551be9[_0xe820a7(0xeb)]!==_0x22d484['datasetCode'])throw CliErrors[_0xe820a7(0xc9)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x6c02b7+_0xe820a7(0xe6));const _0x30c13f=_0xe820a7(0xd3)+_0x3e1d73+'/'+_0xe79a99+'/'+_0x4397ae+'/'+_0x56413c;try{resolveLocalFilePathFromLockKey(_0x5e2e9c,_0x17e187),resolveLocalFilePathFromLockKey(_0x5e2e9c,_0x30c13f);}catch(_0x140dcc){throw CliErrors['validation']('Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'+_0x17e187+_0xe820a7(0xd9)+(_0x140dcc instanceof Error?_0x140dcc['message']:String(_0x140dcc)));}_0x551be9[_0xe820a7(0x153)]['push']({'oldLockKey':_0x17e187,'newLockKey':_0x30c13f,'entry':_0x22d484}),_0x6f154['set'](_0x6c02b7,_0x551be9);}const _0x2be16e=new Set([..._0x6f154[_0xe820a7(0x12f)]()][_0xe820a7(0xfe)](_0x3e7be6=>_0x3e7be6['keyChanges'][_0xe820a7(0x131)](_0x238ecc=>_0x238ecc['oldLockKey']))),_0x435d38=new Map(),_0x3d3632=new Map();for(const [_0x3f7a41,_0x41c671]of _0x6f154){const _0x30fa9d=_0x41c671[_0xe820a7(0x141)]??_0x41c671[_0xe820a7(0xeb)],_0x554eea=hookDirectoryIdentity(_0x30fa9d),_0x36b267=_0x435d38[_0xe820a7(0x148)](_0x554eea);if(_0x36b267&&_0x36b267!==_0x3f7a41)throw CliErrors[_0xe820a7(0xc9)](_0xe820a7(0x129)+_0x36b267+_0xe820a7(0x126)+_0x3f7a41+_0xe820a7(0x15e)+_0x30fa9d+'\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.');_0x435d38[_0xe820a7(0x15f)](_0x554eea,_0x3f7a41);for(const _0x458567 of _0x41c671[_0xe820a7(0x153)]){const _0x1ecefd=_0x3d3632[_0xe820a7(0x148)](_0x458567[_0xe820a7(0x151)]);if(_0x1ecefd&&_0x1ecefd!==_0x458567[_0xe820a7(0x12d)])throw CliErrors[_0xe820a7(0xc9)](_0xe820a7(0xda)+_0x1ecefd+_0xe820a7(0x126)+_0x458567['oldLockKey']+_0xe820a7(0x15e)+_0x458567['newLockKey']+_0xe820a7(0x152));if(_0x2be16e[_0xe820a7(0xef)](_0x458567[_0xe820a7(0x151)]))throw CliErrors[_0xe820a7(0xc9)](_0xe820a7(0x114)+_0x458567[_0xe820a7(0x12d)]+_0xe820a7(0x14b)+_0x458567[_0xe820a7(0x151)]+_0xe820a7(0xdf));_0x3d3632['set'](_0x458567['newLockKey'],_0x458567['oldLockKey']);}}const _0x33e73a=new Map();for(const [_0x3c2a38,_0x589c65]of _0x272f59){_0x33e73a['set'](hookDirectoryIdentity(_0x589c65),_0x3c2a38);}const _0x26380c=[];for(const [_0x4fcebc,_0x249772]of _0x6f154){const _0x39a321=_0x249772['alias']??_0x249772['datasetCode'],_0x463ca8=join(_0x5e2e9c[_0xe820a7(0xfa)],'HOOK',_0x4fcebc),_0x14a929=join(_0x5e2e9c[_0xe820a7(0xfa)],_0xe820a7(0xf7),_0x39a321),_0x14a9ef=await directoryExists(_0x463ca8),_0x21edbc=await directoryExists(_0x14a929),_0x35b4b5=_0x14a9ef?_0x21edbc?await sameDirectory(_0x463ca8,_0x14a929)?_0xe820a7(0xf8):undefined:_0xe820a7(0x147):'rekey';if(!_0x35b4b5)throw CliErrors[_0xe820a7(0xc9)](_0xe820a7(0x11f)+_0x4fcebc+_0xe820a7(0xdc)+_0x39a321+_0xe820a7(0x136));const _0x441b0e=_0x33e73a[_0xe820a7(0x148)](hookDirectoryIdentity(_0x4fcebc));if(_0x441b0e&&_0x441b0e!==_0x249772['datasetCode'][_0xe820a7(0x138)]()){const _0x5d782b=new Set(_0x249772[_0xe820a7(0x153)][_0xe820a7(0x131)](_0xc5e0dd=>_0xc5e0dd['oldLockKey'])),_0x40dec5=_0x50a62f[_0xe820a7(0x127)](_0x43a5c6=>_0x43a5c6[_0xe820a7(0x12b)]===_0xe820a7(0xf7)&&_0x43a5c6[_0xe820a7(0x141)]!=null&&hookDirectoryIdentity(_0x43a5c6[_0xe820a7(0x141)])===hookDirectoryIdentity(_0x4fcebc)&&!_0x5d782b['has'](_0x43a5c6[_0xe820a7(0xff)]));if(_0x40dec5[_0xe820a7(0xcb)]>0x0)throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x4fcebc+'\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');}const _0x332b10=_0x33e73a[_0xe820a7(0x148)](hookDirectoryIdentity(_0x39a321));if(_0x332b10&&_0x332b10!==_0x249772[_0xe820a7(0xeb)][_0xe820a7(0x138)]())throw CliErrors['validation'](_0xe820a7(0x11f)+_0x4fcebc+_0xe820a7(0xdc)+_0x39a321+_0xe820a7(0xd6));for(const _0x1bea0a of _0x249772['keyChanges']){const _0x435968=_0x5119fe['functions'][_0x1bea0a[_0xe820a7(0x151)]];if(_0x435968&&!_0x2be16e['has'](_0x1bea0a[_0xe820a7(0x151)])&&!sameHookIdentity(_0x1bea0a['entry'],_0x435968))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x4fcebc+'\x22\x20to\x20\x22'+_0x39a321+'\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.');}_0x26380c['push']({'oldDirectory':_0x4fcebc,'newDirectory':_0x39a321,'oldDirectoryPath':_0x463ca8,'newDirectoryPath':_0x14a929,'mode':_0x35b4b5,'alias':_0x249772[_0xe820a7(0x141)],'keyChanges':_0x249772[_0xe820a7(0x153)]});}const _0x2b5906={..._0x5119fe[_0xe820a7(0x15d)]},_0x3aaf20=new Map(),_0x54bf2e=new Map();for(const _0x282851 of _0x26380c){const _0x2b4600=_0x282851[_0xe820a7(0xcd)]!=='rekey';_0x2b4600&&_0x54bf2e[_0xe820a7(0x15f)](hookDirectoryIdentity(_0x282851['newDirectory']),_0x282851[_0xe820a7(0xea)]);for(const _0x3a86ee of _0x282851[_0xe820a7(0x153)]){const _0x152152=_0x2b5906[_0x3a86ee['newLockKey']],_0x1d56ba=_0x2b4600?_0x3a86ee[_0xe820a7(0x105)]:_0x152152??_0x3a86ee[_0xe820a7(0x105)];_0x2b5906[_0x3a86ee['newLockKey']]=canonicalizeHookEntry(_0x1d56ba,_0x282851['alias']),delete _0x2b5906[_0x3a86ee[_0xe820a7(0x12d)]],_0x2b4600&&_0x3aaf20[_0xe820a7(0x15f)](_0x3a86ee[_0xe820a7(0x151)],resolveLocalFilePathFromLockKey(_0x5e2e9c,_0x3a86ee[_0xe820a7(0x12d)]));}}return{'migrations':_0x26380c,'projectedFunctions':_0x2b5906,'sourceFilePathByNewLockKey':_0x3aaf20,'sourceDirectoryPathByNewDirectory':_0x54bf2e};}function a43_0x48c4(_0x1f5d5d,_0x2756ed){_0x1f5d5d=_0x1f5d5d-0xc9;const _0x44adb4=a43_0x44ad();let _0x48c4ff=_0x44adb4[_0x1f5d5d];return _0x48c4ff;}function resolveMigratedSourceFilePath(_0x2729f3,_0xbd9e71){const _0x6efa6a=a43_0x14c6a4;if(!_0x2729f3||!_0xbd9e71)return undefined;const _0x2bca6c=_0x2729f3[_0x6efa6a(0x102)][_0x6efa6a(0x148)](_0xbd9e71[_0x6efa6a(0xff)]);if(_0x2bca6c)return _0x2bca6c;if(_0xbd9e71['type']!==_0x6efa6a(0xf7))return undefined;const [,_0x25b176,..._0x42f0bb]=_0xbd9e71[_0x6efa6a(0xff)][_0x6efa6a(0x11c)]('/');if(!_0x25b176||_0x42f0bb[_0x6efa6a(0xcb)]===0x0)return undefined;const _0xdf503f=_0x2729f3[_0x6efa6a(0xe7)][_0x6efa6a(0x148)](hookDirectoryIdentity(_0x25b176));return _0xdf503f?join(_0xdf503f,..._0x42f0bb)+_0x6efa6a(0x157):undefined;}function sameHookIdentity(_0x3adf3f,_0x20ad8e){const _0x191600=a43_0x14c6a4;return _0x3adf3f['remoteId']===_0x20ad8e[_0x191600(0xcc)]&&_0x3adf3f[_0x191600(0xeb)]===_0x20ad8e[_0x191600(0xeb)]&&_0x3adf3f['operationType']===_0x20ad8e['operationType']&&_0x3adf3f[_0x191600(0x106)]===_0x20ad8e[_0x191600(0x106)];}function canonicalizeHookEntry(_0x2da8db,_0x4e0f0d){const {alias:_0x3487a2,..._0x3efe1b}=_0x2da8db;return _0x4e0f0d?{..._0x3efe1b,'alias':_0x4e0f0d}:_0x3efe1b;}function hookDirectoryIdentity(_0x14fb79){const _0x32b39a=a43_0x14c6a4;return _0x14fb79[_0x32b39a(0x10d)]('NFC')[_0x32b39a(0x138)]();}function isSafeHookDirectorySegment(_0x40bf07){return isSafeLockKeySegment(_0x40bf07);}async function sameDirectory(_0x1ad5a3,_0x5b7825){const _0x1bb820=a43_0x14c6a4,[_0x28057c,_0x4d38a3]=await Promise[_0x1bb820(0x132)]([stat(_0x1ad5a3),stat(_0x5b7825)]);return _0x28057c['dev']===_0x4d38a3[_0x1bb820(0x158)]&&_0x28057c['ino']===_0x4d38a3['ino'];}async function applyHookDirectoryMigration(_0xeb3aeb,_0xc0aa68){const _0x1fcf52=a43_0x14c6a4,_0x4b85f6=_0xc0aa68[_0x1fcf52(0x15d)],_0x503c49=_0xc0aa68[_0x1fcf52(0xce)],_0x3027d6=[],_0x24a515=async()=>{const _0x26c115=_0x1fcf52,_0x365c3c=[];_0xc0aa68[_0x26c115(0x15d)]=_0x4b85f6,_0xc0aa68[_0x26c115(0xce)]=_0x503c49;for(const {migration:_0x20b8f3,temporaryPath:_0x5cf14c}of[..._0x3027d6][_0x26c115(0xd2)]()){try{_0x5cf14c?(await rename(_0x20b8f3[_0x26c115(0x159)],_0x5cf14c),await rename(_0x5cf14c,_0x20b8f3[_0x26c115(0xea)])):await rename(_0x20b8f3[_0x26c115(0x159)],_0x20b8f3[_0x26c115(0xea)]);}catch(_0x21b339){_0x365c3c['push'](new Error(_0x26c115(0xf6)+_0x20b8f3[_0x26c115(0x133)]+_0x26c115(0xf4)+_0x20b8f3['newDirectory']+'\x22:\x20'+(_0x21b339 instanceof Error?_0x21b339['message']:String(_0x21b339))));}}return _0x365c3c;};try{for(const _0x544de5 of _0xeb3aeb[_0x1fcf52(0xd4)]){if(_0x544de5['mode']==='move')await ensureParentDirectory(_0x544de5[_0x1fcf52(0x159)]),await rename(_0x544de5[_0x1fcf52(0xea)],_0x544de5[_0x1fcf52(0x159)]),_0x3027d6[_0x1fcf52(0xfc)]({'migration':_0x544de5});else{if(_0x544de5['mode']===_0x1fcf52(0xf8)){const _0x2d8d1b=join(dirname(_0x544de5[_0x1fcf52(0xea)]),_0x1fcf52(0xca)+randomUUID());await rename(_0x544de5['oldDirectoryPath'],_0x2d8d1b);try{await rename(_0x2d8d1b,_0x544de5[_0x1fcf52(0x159)]);}catch(_0x19fa57){try{await rename(_0x2d8d1b,_0x544de5[_0x1fcf52(0xea)]);}catch(_0x4cd2da){throw withRollbackErrors(_0x19fa57,_0x1fcf52(0x14c)+_0x544de5['oldDirectory']+_0x1fcf52(0xdc)+_0x544de5[_0x1fcf52(0x107)]+_0x1fcf52(0xcf)+_0x2d8d1b+_0x1fcf52(0x15a),[new Error(_0x1fcf52(0x144)+_0x2d8d1b+_0x1fcf52(0xdc)+_0x544de5[_0x1fcf52(0x133)]+'\x22:\x20'+(_0x4cd2da instanceof Error?_0x4cd2da[_0x1fcf52(0x134)]:String(_0x4cd2da)))]);}throw _0x19fa57;}_0x3027d6[_0x1fcf52(0xfc)]({'migration':_0x544de5,'temporaryPath':_0x2d8d1b});}}}return _0xc0aa68['functions']=_0xeb3aeb['projectedFunctions'],{'rollback':_0x24a515};}catch(_0x4af532){const _0x1fe5f7=await _0x24a515();throw withRollbackErrors(_0x4af532,'Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x1fe5f7);}}async function confirmForce(){const _0x3cf5f0=a43_0x14c6a4,_0x1ecc14=createInterface({'input':process[_0x3cf5f0(0x149)],'output':process[_0x3cf5f0(0x13b)]}),_0x2ac679=await new Promise(_0x36fe30=>{const _0x49cf49=_0x3cf5f0;_0x1ecc14[_0x49cf49(0xe8)](_0x49cf49(0xd5),_0x36fe30);});return _0x1ecc14[_0x3cf5f0(0x123)](),['y',_0x3cf5f0(0x140)][_0x3cf5f0(0x125)](_0x2ac679[_0x3cf5f0(0xd8)]()['toLowerCase']());}