@lovrabet/rabetbase-cli 2.5.13-beta.1 → 2.5.13

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 (376) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/detail.js +1 -1
  26. package/lib/commands/app/index.js +1 -1
  27. package/lib/commands/app/list.js +1 -1
  28. package/lib/commands/app/members-list.js +1 -1
  29. package/lib/commands/app/remote-directory.js +1 -1
  30. package/lib/commands/app/shared.js +1 -1
  31. package/lib/commands/app-config/delete.js +1 -1
  32. package/lib/commands/app-config/get.js +1 -1
  33. package/lib/commands/app-config/index.js +1 -1
  34. package/lib/commands/app-config/list.js +1 -1
  35. package/lib/commands/app-config/set.js +1 -1
  36. package/lib/commands/app-config/shared.js +1 -1
  37. package/lib/commands/auth/index.js +1 -1
  38. package/lib/commands/bff/create.js +1 -1
  39. package/lib/commands/bff/delete.js +1 -1
  40. package/lib/commands/bff/detail.js +1 -1
  41. package/lib/commands/bff/index.js +1 -1
  42. package/lib/commands/bff/list.js +1 -1
  43. package/lib/commands/bff/logs.js +1 -1
  44. package/lib/commands/bff/pull.js +1 -1
  45. package/lib/commands/bff/push.js +1 -1
  46. package/lib/commands/bff/status.js +1 -1
  47. package/lib/commands/cli-skill/index.js +1 -1
  48. package/lib/commands/cli-update.js +1 -1
  49. package/lib/commands/codegen/index.js +1 -1
  50. package/lib/commands/codegen/sdk.js +1 -1
  51. package/lib/commands/codegen/sql.js +1 -1
  52. package/lib/commands/common/app-registry.js +1 -1
  53. package/lib/commands/common/app-selector.js +1 -1
  54. package/lib/commands/common/async-task.js +1 -1
  55. package/lib/commands/common/dry-run.js +1 -1
  56. package/lib/commands/common/flags.js +1 -1
  57. package/lib/commands/common/local-file.js +1 -1
  58. package/lib/commands/common/validate.js +1 -1
  59. package/lib/commands/config/delete.js +1 -1
  60. package/lib/commands/config/get.js +1 -1
  61. package/lib/commands/config/index.js +1 -1
  62. package/lib/commands/config/init.js +1 -1
  63. package/lib/commands/config/list.js +1 -1
  64. package/lib/commands/config/set.js +1 -1
  65. package/lib/commands/config/shared.js +1 -1
  66. package/lib/commands/dataset/batch-design.js +1 -1
  67. package/lib/commands/dataset/business-group-update.js +1 -1
  68. package/lib/commands/dataset/business-groups.js +1 -1
  69. package/lib/commands/dataset/capability.js +1 -1
  70. package/lib/commands/dataset/cross-relation-create.js +1 -1
  71. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  72. package/lib/commands/dataset/cross-relation-list.js +1 -1
  73. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  74. package/lib/commands/dataset/cross-relation-update.js +1 -1
  75. package/lib/commands/dataset/delete.js +1 -1
  76. package/lib/commands/dataset/design-context.js +1 -1
  77. package/lib/commands/dataset/design-start.js +1 -1
  78. package/lib/commands/dataset/design-status.js +1 -1
  79. package/lib/commands/dataset/design-sync-retry.js +1 -1
  80. package/lib/commands/dataset/design-sync-status.js +1 -1
  81. package/lib/commands/dataset/design-validate.js +1 -1
  82. package/lib/commands/dataset/detail.js +1 -1
  83. package/lib/commands/dataset/extend-update.js +1 -1
  84. package/lib/commands/dataset/field-restore.js +1 -1
  85. package/lib/commands/dataset/field-update.js +1 -1
  86. package/lib/commands/dataset/generate.js +1 -1
  87. package/lib/commands/dataset/index.js +1 -1
  88. package/lib/commands/dataset/list.js +1 -1
  89. package/lib/commands/dataset/operations.js +1 -1
  90. package/lib/commands/dataset/relation-audit.js +1 -1
  91. package/lib/commands/dataset/relation-create.js +1 -1
  92. package/lib/commands/dataset/relation-delete.js +1 -1
  93. package/lib/commands/dataset/relation-shared.js +1 -1
  94. package/lib/commands/dataset/relation-update.js +1 -1
  95. package/lib/commands/dataset/relations.js +1 -1
  96. package/lib/commands/dataset/rename.js +1 -1
  97. package/lib/commands/dataset/restore.js +1 -1
  98. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  99. package/lib/commands/db/analysis-batching.js +1 -1
  100. package/lib/commands/db/analyze-batch-plan.js +1 -1
  101. package/lib/commands/db/analyze-cancel.js +1 -1
  102. package/lib/commands/db/analyze-start.js +1 -1
  103. package/lib/commands/db/analyze-status.js +1 -1
  104. package/lib/commands/db/create.js +1 -1
  105. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  106. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  109. package/lib/commands/db/delete.js +1 -1
  110. package/lib/commands/db/detail.js +1 -1
  111. package/lib/commands/db/diff-refresh-start.js +1 -1
  112. package/lib/commands/db/diff-refresh-status.js +1 -1
  113. package/lib/commands/db/diff.js +1 -1
  114. package/lib/commands/db/index.js +1 -1
  115. package/lib/commands/db/list.js +1 -1
  116. package/lib/commands/db/shared.js +1 -1
  117. package/lib/commands/db/table-diff-shared.js +1 -1
  118. package/lib/commands/db/tables.js +1 -1
  119. package/lib/commands/db/test.js +1 -1
  120. package/lib/commands/db/update.js +1 -1
  121. package/lib/commands/deployment/index.js +1 -1
  122. package/lib/commands/deployment/sync-all.js +1 -1
  123. package/lib/commands/deployment/sync-jobs.js +1 -1
  124. package/lib/commands/deployment/sync-status.js +1 -1
  125. package/lib/commands/doctor.js +1 -1
  126. package/lib/commands/file/index.js +1 -1
  127. package/lib/commands/flow/create.js +1 -1
  128. package/lib/commands/flow/detail.js +1 -1
  129. package/lib/commands/flow/index.js +1 -1
  130. package/lib/commands/flow/list.js +1 -1
  131. package/lib/commands/flow/page-list.js +1 -1
  132. package/lib/commands/flow/publish.js +1 -1
  133. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  134. package/lib/commands/flow/runtime-role-list.js +1 -1
  135. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  136. package/lib/commands/flow/runtime-user-search.js +1 -1
  137. package/lib/commands/flow/shared.js +1 -1
  138. package/lib/commands/flow/update.js +1 -1
  139. package/lib/commands/flow/validate.js +1 -1
  140. package/lib/commands/instant-api-policy/current.js +1 -1
  141. package/lib/commands/instant-api-policy/index.js +1 -1
  142. package/lib/commands/instant-api-policy/init.js +1 -1
  143. package/lib/commands/instant-api-policy/publish.js +1 -1
  144. package/lib/commands/instant-api-policy/pull.js +1 -1
  145. package/lib/commands/instant-api-policy/revision.js +1 -1
  146. package/lib/commands/instant-api-policy/revisions.js +1 -1
  147. package/lib/commands/instant-api-policy/rollback.js +1 -1
  148. package/lib/commands/instant-api-policy/shared.js +1 -1
  149. package/lib/commands/instant-api-policy/validate.js +1 -1
  150. package/lib/commands/issue/context.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/kb/create.js +1 -1
  155. package/lib/commands/kb/delete.js +1 -1
  156. package/lib/commands/kb/detail.js +1 -1
  157. package/lib/commands/kb/index.js +1 -1
  158. package/lib/commands/kb/list.js +1 -1
  159. package/lib/commands/kb/search.js +1 -1
  160. package/lib/commands/kb/shared.js +1 -1
  161. package/lib/commands/kb/update.js +1 -1
  162. package/lib/commands/logs/index.js +1 -1
  163. package/lib/commands/menu/asset-update.js +1 -1
  164. package/lib/commands/menu/delete.js +1 -1
  165. package/lib/commands/menu/external-link-create.js +1 -1
  166. package/lib/commands/menu/external-link-update.js +1 -1
  167. package/lib/commands/menu/group-create.js +1 -1
  168. package/lib/commands/menu/group-update.js +1 -1
  169. package/lib/commands/menu/index.js +1 -1
  170. package/lib/commands/menu/list.js +1 -1
  171. package/lib/commands/menu/move.js +1 -1
  172. package/lib/commands/menu/regroup-start.js +1 -1
  173. package/lib/commands/menu/rename.js +1 -1
  174. package/lib/commands/menu/shared/compare-table.js +1 -1
  175. package/lib/commands/menu/shared/delete-plan.js +1 -1
  176. package/lib/commands/menu/shared/facts.js +1 -1
  177. package/lib/commands/menu/shared/index.js +1 -1
  178. package/lib/commands/menu/shared/inquirer.js +1 -1
  179. package/lib/commands/menu/shared/local-pages.js +1 -1
  180. package/lib/commands/menu/shared/logic.js +1 -1
  181. package/lib/commands/menu/shared/mutations.js +1 -1
  182. package/lib/commands/menu/shared/path.js +1 -1
  183. package/lib/commands/menu/shared/service.js +1 -1
  184. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  185. package/lib/commands/menu/shared/sync-core.js +1 -1
  186. package/lib/commands/menu/shared/update-core.js +1 -1
  187. package/lib/commands/menu/shared/valid-url.js +1 -1
  188. package/lib/commands/menu/subapp-assets-status.js +1 -1
  189. package/lib/commands/menu/subapp-assets-update.js +1 -1
  190. package/lib/commands/menu/sync.js +1 -1
  191. package/lib/commands/menu/visibility-update.js +1 -1
  192. package/lib/commands/notification/config-create.js +1 -1
  193. package/lib/commands/notification/config-delete.js +1 -1
  194. package/lib/commands/notification/config-list.js +1 -1
  195. package/lib/commands/notification/config-update.js +1 -1
  196. package/lib/commands/notification/index.js +1 -1
  197. package/lib/commands/notification/shared.js +1 -1
  198. package/lib/commands/ocr/index.js +1 -1
  199. package/lib/commands/page/create.js +1 -1
  200. package/lib/commands/page/custom/detail.js +1 -1
  201. package/lib/commands/page/custom/list.js +1 -1
  202. package/lib/commands/page/custom/publish.js +1 -1
  203. package/lib/commands/page/custom/shared.js +1 -1
  204. package/lib/commands/page/custom/syntax.js +1 -1
  205. package/lib/commands/page/custom/update.js +1 -1
  206. package/lib/commands/page/data-list-status.js +1 -1
  207. package/lib/commands/page/generate-start.js +1 -1
  208. package/lib/commands/page/generate-status.js +1 -1
  209. package/lib/commands/page/index.js +1 -1
  210. package/lib/commands/page/pull.js +1 -1
  211. package/lib/commands/page/push.js +1 -1
  212. package/lib/commands/page/relation-audit.js +1 -1
  213. package/lib/commands/page/restore.js +1 -1
  214. package/lib/commands/page/shared.js +1 -1
  215. package/lib/commands/page/sync.js +1 -1
  216. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  217. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  218. package/lib/commands/project/create/format-elapsed.js +1 -1
  219. package/lib/commands/project/create/main.js +1 -1
  220. package/lib/commands/project/create/materialize-project-template.js +1 -1
  221. package/lib/commands/project/create/project-name.js +1 -1
  222. package/lib/commands/project/create/project-template-archive.js +1 -1
  223. package/lib/commands/project/create/project-template-path.js +1 -1
  224. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  225. package/lib/commands/project/create/use-format-code.js +1 -1
  226. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  227. package/lib/commands/project/domain-routing-sync.js +1 -1
  228. package/lib/commands/project/index.js +1 -1
  229. package/lib/commands/project/upgrade.js +1 -1
  230. package/lib/commands/registry.js +1 -1
  231. package/lib/commands/role/delete.js +1 -1
  232. package/lib/commands/role/detail.js +1 -1
  233. package/lib/commands/role/index.js +1 -1
  234. package/lib/commands/role/list.js +1 -1
  235. package/lib/commands/role/shared.js +1 -1
  236. package/lib/commands/role/update.js +1 -1
  237. package/lib/commands/role/user-add.js +1 -1
  238. package/lib/commands/role/user-remove.js +1 -1
  239. package/lib/commands/role/user-resolve.js +1 -1
  240. package/lib/commands/rule/get.js +1 -1
  241. package/lib/commands/rule/index.js +1 -1
  242. package/lib/commands/rule/list.js +1 -1
  243. package/lib/commands/rule/set.js +1 -1
  244. package/lib/commands/rule/shared.js +1 -1
  245. package/lib/commands/run/index.js +1 -1
  246. package/lib/commands/schema.js +1 -1
  247. package/lib/commands/sql/create.js +1 -1
  248. package/lib/commands/sql/delete.js +1 -1
  249. package/lib/commands/sql/detail.js +1 -1
  250. package/lib/commands/sql/exec.js +1 -1
  251. package/lib/commands/sql/index.js +1 -1
  252. package/lib/commands/sql/list.js +1 -1
  253. package/lib/commands/sql/pull.js +1 -1
  254. package/lib/commands/sql/push.js +1 -1
  255. package/lib/commands/sql/shared.js +1 -1
  256. package/lib/commands/sql/status.js +1 -1
  257. package/lib/commands/sql/validate.js +1 -1
  258. package/lib/commands/task/index.js +1 -1
  259. package/lib/commands/task/status.js +1 -1
  260. package/lib/commands/tenant/index.js +1 -1
  261. package/lib/commands/tenant/members-list.js +1 -1
  262. package/lib/commands/tenant/shared.js +1 -1
  263. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  264. package/lib/commands/user-account/feishu-bind.js +1 -1
  265. package/lib/commands/user-account/index.js +1 -1
  266. package/lib/commands/workspace/add.js +1 -1
  267. package/lib/commands/workspace/index.js +1 -1
  268. package/lib/commands/workspace/remove.js +1 -1
  269. package/lib/config/domain-config.js +1 -1
  270. package/lib/config/project-domain-routing.js +1 -1
  271. package/lib/config/region-config.js +1 -1
  272. package/lib/config/schema.js +1 -1
  273. package/lib/constant/cdn.js +1 -1
  274. package/lib/constant/cli.js +1 -1
  275. package/lib/constant/defaults.js +1 -1
  276. package/lib/constant/domain.js +1 -1
  277. package/lib/constant/env.js +1 -1
  278. package/lib/constant/output.js +1 -1
  279. package/lib/constant/paths.js +1 -1
  280. package/lib/constant/region.js +1 -1
  281. package/lib/constant/risk.js +1 -1
  282. package/lib/constant/routing-profile.js +1 -1
  283. package/lib/context/app-resolver.js +1 -1
  284. package/lib/context/auth-resolver.js +1 -1
  285. package/lib/context/config-loader.js +1 -1
  286. package/lib/context.js +1 -1
  287. package/lib/core/alias-resolver.js +1 -1
  288. package/lib/core/api-client.js +1 -1
  289. package/lib/core/bff/config.js +1 -1
  290. package/lib/core/bff/file-system.js +1 -1
  291. package/lib/core/bff/hash.js +1 -1
  292. package/lib/core/bff/hook-directory.js +1 -1
  293. package/lib/core/bff/lock.js +1 -1
  294. package/lib/core/bff/utils.js +1 -1
  295. package/lib/core/cross-db-analysis.js +1 -1
  296. package/lib/core/cross-db-relation.js +1 -1
  297. package/lib/core/db-resolver.js +1 -1
  298. package/lib/core/flow-config.js +1 -1
  299. package/lib/core/instant-api-policy/config.js +1 -1
  300. package/lib/core/instant-api-policy/endpoints.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/utils/ai_config.js +1 -1
  352. package/lib/utils/apply-jq-filter.js +1 -1
  353. package/lib/utils/cdn-config.js +1 -1
  354. package/lib/utils/check-sdk-version.js +1 -1
  355. package/lib/utils/cli-version-check.js +1 -1
  356. package/lib/utils/cli-version-policy.js +1 -1
  357. package/lib/utils/config.js +1 -1
  358. package/lib/utils/entity-with-id.js +1 -1
  359. package/lib/utils/file-utils.js +1 -1
  360. package/lib/utils/guides-cdn.js +1 -1
  361. package/lib/utils/http-client.js +1 -1
  362. package/lib/utils/is-non-interactive.js +1 -1
  363. package/lib/utils/logger.js +1 -1
  364. package/lib/utils/params.js +1 -1
  365. package/lib/utils/platform.js +1 -1
  366. package/lib/utils/sleep.js +1 -1
  367. package/lib/utils/template-replacer.js +1 -1
  368. package/lib/utils/update-notice.js +1 -1
  369. package/lib/utils/version.js +1 -1
  370. package/lib/utils/with-active-cookie.js +1 -1
  371. package/lib/utils/write-cli-side-channel.js +1 -1
  372. package/package.json +1 -1
  373. package/skills/rabetbase/SKILL.md +1 -1
  374. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  375. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  376. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a34_0x24cfe3=a34_0x492c;(function(_0xe1397b,_0x7cbdb0){const _0x264e85=a34_0x492c,_0x426768=_0xe1397b();while(!![]){try{const _0x1b15f0=parseInt(_0x264e85(0x198))/0x1*(parseInt(_0x264e85(0x181))/0x2)+parseInt(_0x264e85(0x196))/0x3*(parseInt(_0x264e85(0x18d))/0x4)+-parseInt(_0x264e85(0x19a))/0x5+parseInt(_0x264e85(0x19d))/0x6*(parseInt(_0x264e85(0x19e))/0x7)+parseInt(_0x264e85(0x188))/0x8*(-parseInt(_0x264e85(0x185))/0x9)+-parseInt(_0x264e85(0x19f))/0xa+-parseInt(_0x264e85(0x191))/0xb*(-parseInt(_0x264e85(0x18c))/0xc);if(_0x1b15f0===_0x7cbdb0)break;else _0x426768['push'](_0x426768['shift']());}catch(_0x36df6f){_0x426768['push'](_0x426768['shift']());}}}(a34_0x50c8,0x2dd0a));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x492c(_0x564af0,_0x223817){_0x564af0=_0x564af0-0x181;const _0x50c870=a34_0x50c8();let _0x492c65=_0x50c870[_0x564af0];return _0x492c65;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';function a34_0x50c8(){const _0x9c3603=['get','1165043EbTxkF','app-config','Updated','\x20app\x20config\x20','/smartapi/app-config/create','6705uSlFYs','string','2311RzsCpx','create','1369935IiELiU','update','file','962022mpXBVO','7CEhByp','3334520WBILHe','Read\x20config\x20value\x20from\x20file','62cUDHtE',',\x20appCode=','/smartapi/app-config/update','appCode','396zdbIXm','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','apiError','65080VooIDt','write','tags','isFinite','96GHcRjN','132iyEyVd','POST','App\x20config\x20server\x20id\x20missing\x20for\x20key='];a34_0x50c8=function(){return _0x9c3603;};return a34_0x50c8();}const CREATE_PATH=a34_0x24cfe3(0x195),UPDATE_PATH=a34_0x24cfe3(0x183);export const appConfigSet={'service':a34_0x24cfe3(0x192),'command':'set','description':a34_0x24cfe3(0x186),'risk':a34_0x24cfe3(0x189),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x24cfe3(0x19c),'type':a34_0x24cfe3(0x197),'description':a34_0x24cfe3(0x1a0)}],async 'validate'(_0x3f9f3a){readKeyArg(_0x3f9f3a),readOptionalTags(_0x3f9f3a),assertSingleValueSource(_0x3f9f3a);},async 'dryRun'(_0x33da74){const _0x18df1a=a34_0x24cfe3,_0x35df70=readKeyArg(_0x33da74),_0x302afd=readOptionalTags(_0x33da74),_0x3bc054=assertSingleValueSource(_0x33da74);await assertValueSourceReadable(_0x3bc054);const _0x3f8015=await withAppConfigApiBoundary(_0x18df1a(0x190),{'appCode':_0x33da74['appCode'],'key':_0x35df70},()=>getAppConfigByKey(_0x33da74[_0x18df1a(0x184)],_0x35df70)),_0x36e3e2=_0x3f8015?_0x18df1a(0x19b):_0x18df1a(0x199),_0x27e8a7=_0x3f8015?projectAppConfig(_0x3f8015):null,_0xbf6432=plannedAppConfig({'appCode':_0x33da74[_0x18df1a(0x184)],'key':_0x35df70,'tags':_0x302afd??_0x3f8015?.[_0x18df1a(0x18a)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x36e3e2,'appCode':_0x33da74[_0x18df1a(0x184)],'key':_0x35df70,'before':_0x27e8a7,'after':_0xbf6432,'dryRun':!![]}),{'method':_0x18df1a(0x18e),'url':_0x36e3e2===_0x18df1a(0x19b)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x52db16){const _0x5da8a2=a34_0x24cfe3,_0xa72ad4=readKeyArg(_0x52db16),_0xb53840=readOptionalTags(_0x52db16),_0x1c6288=await withAppConfigApiBoundary(_0x5da8a2(0x190),{'appCode':_0x52db16['appCode'],'key':_0xa72ad4},()=>getAppConfigByKey(_0x52db16[_0x5da8a2(0x184)],_0xa72ad4)),_0x2412c7=_0x1c6288?projectAppConfig(_0x1c6288):null,_0x165096=_0x1c6288?_0x5da8a2(0x19b):_0x5da8a2(0x199),{value:_0x55d373,warnings:_0x57a586}=await readAppConfigValue(_0x52db16),_0xca3450={'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4,'value':_0x55d373,'tags':_0xb53840??_0x1c6288?.[_0x5da8a2(0x18a)]??undefined};await withAppConfigApiBoundary(_0x165096,{'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4},async()=>{const _0x1f6882=_0x5da8a2;_0x1c6288?await updateAppConfig({..._0xca3450,'id':requireAppConfigId(_0x1c6288,_0xa72ad4,_0x52db16[_0x1f6882(0x184)])}):await createAppConfig(_0xca3450);});const _0x7271fd=await withAppConfigApiBoundary(_0x5da8a2(0x190),{'appCode':_0x52db16['appCode'],'key':_0xa72ad4},()=>getAppConfigByKey(_0x52db16['appCode'],_0xa72ad4)),_0x552a45=_0x7271fd?projectAppConfig(_0x7271fd):plannedAppConfig({'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4,'tags':_0xca3450[_0x5da8a2(0x18a)],'hasValue':_0x55d373!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x165096,'appCode':_0x52db16[_0x5da8a2(0x184)],'key':_0xa72ad4,'before':_0x2412c7,'after':_0x552a45,'dryRun':![],'warnings':_0x57a586}),'message':(_0x165096===_0x5da8a2(0x19b)?_0x5da8a2(0x193):'Created')+_0x5da8a2(0x194)+_0xa72ad4};}};function requireAppConfigId(_0x4d47d2,_0x2257b7,_0x479ad3){const _0x583d6a=a34_0x24cfe3;if(typeof _0x4d47d2['id']==='number'&&Number[_0x583d6a(0x18b)](_0x4d47d2['id'])&&_0x4d47d2['id']>0x0)return _0x4d47d2['id'];throw CliErrors[_0x583d6a(0x187)](_0x583d6a(0x18f)+_0x2257b7+_0x583d6a(0x182)+_0x479ad3);}
1
+ const a34_0x1dd3b4=a34_0x5be1;(function(_0x81e607,_0x1b24fc){const _0x42ca16=a34_0x5be1,_0x1bd83a=_0x81e607();while(!![]){try{const _0x11d027=parseInt(_0x42ca16(0x14a))/0x1*(parseInt(_0x42ca16(0x15f))/0x2)+parseInt(_0x42ca16(0x15a))/0x3+parseInt(_0x42ca16(0x156))/0x4+parseInt(_0x42ca16(0x15d))/0x5*(parseInt(_0x42ca16(0x161))/0x6)+-parseInt(_0x42ca16(0x157))/0x7+parseInt(_0x42ca16(0x165))/0x8*(parseInt(_0x42ca16(0x14e))/0x9)+parseInt(_0x42ca16(0x155))/0xa*(-parseInt(_0x42ca16(0x153))/0xb);if(_0x11d027===_0x1b24fc)break;else _0x1bd83a['push'](_0x1bd83a['shift']());}catch(_0xbd69af){_0x1bd83a['push'](_0x1bd83a['shift']());}}}(a34_0x10b5,0xc0ced));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_0x1dd3b4(0x163),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a34_0x1dd3b4(0x14d),'command':a34_0x1dd3b4(0x158),'description':a34_0x1dd3b4(0x15c),'risk':'write','args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x1dd3b4(0x149),'type':a34_0x1dd3b4(0x150),'description':a34_0x1dd3b4(0x154)}],async 'validate'(_0x1c3637){readKeyArg(_0x1c3637),readOptionalTags(_0x1c3637),assertSingleValueSource(_0x1c3637);},async 'dryRun'(_0x57a9b4){const _0xb7f527=a34_0x1dd3b4,_0x10c1e0=readKeyArg(_0x57a9b4),_0x11f9e5=readOptionalTags(_0x57a9b4),_0x3fcf98=assertSingleValueSource(_0x57a9b4);await assertValueSourceReadable(_0x3fcf98);const _0x5c8889=await withAppConfigApiBoundary(_0xb7f527(0x14c),{'appCode':_0x57a9b4[_0xb7f527(0x151)],'key':_0x10c1e0},()=>getAppConfigByKey(_0x57a9b4[_0xb7f527(0x151)],_0x10c1e0)),_0x353a70=_0x5c8889?_0xb7f527(0x164):'create',_0x583a03=_0x5c8889?projectAppConfig(_0x5c8889):null,_0x3bf860=plannedAppConfig({'appCode':_0x57a9b4[_0xb7f527(0x151)],'key':_0x10c1e0,'tags':_0x11f9e5??_0x5c8889?.[_0xb7f527(0x15e)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x353a70,'appCode':_0x57a9b4[_0xb7f527(0x151)],'key':_0x10c1e0,'before':_0x583a03,'after':_0x3bf860,'dryRun':!![]}),{'method':_0xb7f527(0x152),'url':_0x353a70===_0xb7f527(0x164)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x44d598){const _0x184116=a34_0x1dd3b4,_0x1c39b2=readKeyArg(_0x44d598),_0x59eb0e=readOptionalTags(_0x44d598),_0x2bd417=await withAppConfigApiBoundary(_0x184116(0x14c),{'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2},()=>getAppConfigByKey(_0x44d598['appCode'],_0x1c39b2)),_0x416e96=_0x2bd417?projectAppConfig(_0x2bd417):null,_0x674983=_0x2bd417?_0x184116(0x164):_0x184116(0x14b),{value:_0x173ff7,warnings:_0x402862}=await readAppConfigValue(_0x44d598),_0x2c96d7={'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2,'value':_0x173ff7,'tags':_0x59eb0e??_0x2bd417?.[_0x184116(0x15e)]??undefined};await withAppConfigApiBoundary(_0x674983,{'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2},async()=>{const _0xa2dfac=_0x184116;_0x2bd417?await updateAppConfig({..._0x2c96d7,'id':requireAppConfigId(_0x2bd417,_0x1c39b2,_0x44d598[_0xa2dfac(0x151)])}):await createAppConfig(_0x2c96d7);});const _0x10e935=await withAppConfigApiBoundary('get',{'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2},()=>getAppConfigByKey(_0x44d598[_0x184116(0x151)],_0x1c39b2)),_0x472cac=_0x10e935?projectAppConfig(_0x10e935):plannedAppConfig({'appCode':_0x44d598[_0x184116(0x151)],'key':_0x1c39b2,'tags':_0x2c96d7['tags'],'hasValue':_0x173ff7!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x674983,'appCode':_0x44d598['appCode'],'key':_0x1c39b2,'before':_0x416e96,'after':_0x472cac,'dryRun':![],'warnings':_0x402862}),'message':(_0x674983==='update'?_0x184116(0x160):_0x184116(0x162))+_0x184116(0x159)+_0x1c39b2};}};function requireAppConfigId(_0x3ddbaa,_0x497b08,_0x106e4c){const _0x28698f=a34_0x1dd3b4;if(typeof _0x3ddbaa['id']==='number'&&Number['isFinite'](_0x3ddbaa['id'])&&_0x3ddbaa['id']>0x0)return _0x3ddbaa['id'];throw CliErrors[_0x28698f(0x15b)](_0x28698f(0x14f)+_0x497b08+_0x28698f(0x148)+_0x106e4c);}function a34_0x5be1(_0x12c8d0,_0x3647fb){_0x12c8d0=_0x12c8d0-0x148;const _0x10b5e5=a34_0x10b5();let _0x5be1e8=_0x10b5e5[_0x12c8d0];return _0x5be1e8;}function a34_0x10b5(){const _0x2a2e86=['/smartapi/app-config/create','update','1632208bXXKLU',',\x20appCode=','file','2RCWdHn','create','get','app-config','36nJyBCa','App\x20config\x20server\x20id\x20missing\x20for\x20key=','string','appCode','POST','14696BQRlMC','Read\x20config\x20value\x20from\x20file','16840mxNmdf','1571112geLNJk','2474486sxFnaA','set','\x20app\x20config\x20','2119449RdLVyJ','apiError','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','190uIHfzw','tags','592564jTYXkC','Updated','139758fyytpC','Created'];a34_0x10b5=function(){return _0x2a2e86;};return a34_0x10b5();}
@@ -1 +1 @@
1
- const a35_0x584b32=a35_0x5057;function a35_0x1132(){const _0x122fce=['setEncoding','298142rhSnil','dryRun','value','Value\x20file\x20is\x20not\x20readable:\x20','str','Runtime\x20app-config\x20key','287022nRhvMT','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','validation','tags','env','4dZgHCl','gmtModified','1044LAwyMt','push','before','utf8','Read\x20config\x20value\x20from\x20stdin','key','name','198165WfTRRi','bool','558vmAlJl','end','operation','args','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','hasValue','method','string','kind','\x20app\x20config.','from-env','1005770DyjkLe','Missing\x20app-config\x20key.','url','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','240PbkrXg','stdin','6KQtygd','file','6392505yqFmvK','error','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','apiError','length','once','239546SRjCNT','after','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','argument','appCode:\x20','63736HWmAAz','App\x20config\x20value\x20source\x20is\x20ambiguous.','slice','reveal','boolean','Environment\x20variable\x20is\x20not\x20set:\x20','trim','valueRedacted','2tBaHnP','appCode','Failed\x20to\x20','path'];a35_0x1132=function(){return _0x122fce;};return a35_0x1132();}(function(_0x5aba80,_0x590429){const _0x255105=a35_0x5057,_0x5ca852=_0x5aba80();while(!![]){try{const _0x5e11fd=-parseInt(_0x255105(0xc3))/0x1*(parseInt(_0x255105(0xb6))/0x2)+-parseInt(_0x255105(0xce))/0x3*(parseInt(_0x255105(0xd3))/0x4)+parseInt(_0x255105(0xe9))/0x5*(-parseInt(_0x255105(0xae))/0x6)+-parseInt(_0x255105(0xb0))/0x7+-parseInt(_0x255105(0xbb))/0x8*(parseInt(_0x255105(0xde))/0x9)+-parseInt(_0x255105(0xed))/0xa*(-parseInt(_0x255105(0xdc))/0xb)+parseInt(_0x255105(0xd5))/0xc*(parseInt(_0x255105(0xc8))/0xd);if(_0x5e11fd===_0x590429)break;else _0x5ca852['push'](_0x5ca852['shift']());}catch(_0x26b1ef){_0x5ca852['push'](_0x5ca852['shift']());}}}(a35_0x1132,0x762eb));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x584b32(0xda),'description':a35_0x584b32(0xcd),'required':!![]};export const VALUE_ARG={'name':a35_0x584b32(0xca),'description':a35_0x584b32(0xb2),'required':![]};export const TAGS_FLAG={'name':a35_0x584b32(0xd1),'type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a35_0x584b32(0xad),'type':a35_0x584b32(0xbf),'description':a35_0x584b32(0xd9),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x584b32(0xe8),'type':a35_0x584b32(0xe5),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a35_0x584b32(0xbe),'type':a35_0x584b32(0xbf),'description':a35_0x584b32(0xec),'default':![]};export function readKeyArg(_0x36677f){const _0x2817df=a35_0x584b32,_0x339163=_0x36677f[_0x2817df(0xe1)][0x0]?.[_0x2817df(0xc1)]()??'';return validateKey(_0x339163),_0x339163;}function a35_0x5057(_0x46d35d,_0x5c571f){_0x46d35d=_0x46d35d-0xad;const _0x1132cc=a35_0x1132();let _0x505725=_0x1132cc[_0x46d35d];return _0x505725;}export function readOptionalTags(_0x298f47){const _0xfdc294=a35_0x584b32,_0x388c6a=_0x298f47[_0xfdc294(0xcc)]('tags')[_0xfdc294(0xc1)]();if(!_0x388c6a)return undefined;if(_0x388c6a[_0xfdc294(0xb4)]>0x20)throw CliErrors['validation'](_0xfdc294(0xe2));return _0x388c6a;}export function validateKey(_0x3b269d){const _0x31a0a5=a35_0x584b32;if(!_0x3b269d)throw CliErrors[_0x31a0a5(0xd0)](_0x31a0a5(0xea));if(_0x3b269d['length']>0x100)throw CliErrors[_0x31a0a5(0xd0)]('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}export function projectAppConfig(_0x3f49de,_0x1ed513){const _0x21e643=a35_0x584b32,_0x58a76c=_0x3f49de['value']!==undefined&&_0x3f49de['value']!==null&&_0x3f49de[_0x21e643(0xca)]!=='',_0x560ffc={'appCode':_0x3f49de[_0x21e643(0xc4)],'key':_0x3f49de['key'],'tags':_0x3f49de[_0x21e643(0xd1)]??undefined,'hasValue':_0x58a76c,'valueRedacted':_0x58a76c&&!_0x1ed513?.['reveal'],'gmtCreate':_0x3f49de['gmtCreate'],'gmtModified':_0x3f49de[_0x21e643(0xd4)]};return _0x1ed513?.['reveal']&&(_0x560ffc['value']=_0x3f49de[_0x21e643(0xca)]??'',_0x560ffc[_0x21e643(0xc2)]=![]),_0x560ffc;}export function plannedAppConfig(_0x9fdca2){const _0x127155=a35_0x584b32,_0x1c948c=_0x9fdca2[_0x127155(0xe3)]??!![];return{'appCode':_0x9fdca2[_0x127155(0xc4)],'key':_0x9fdca2['key'],'tags':_0x9fdca2['tags']??undefined,'hasValue':_0x1c948c,'valueRedacted':_0x1c948c};}export function buildMutationData(_0x1ae564){const _0x32eaa6=a35_0x584b32;return{'operation':_0x1ae564[_0x32eaa6(0xe0)],'selector':{'appCode':_0x1ae564[_0x32eaa6(0xc4)],'key':_0x1ae564[_0x32eaa6(0xda)]},'before':_0x1ae564[_0x32eaa6(0xd7)],'after':_0x1ae564[_0x32eaa6(0xb7)],'dryRun':_0x1ae564[_0x32eaa6(0xc9)],'warnings':_0x1ae564['warnings']??[]};}export async function withAppConfigApiBoundary(_0x324ec8,_0x5c99bb,_0x263da1){const _0x8f8998=a35_0x584b32;try{return await _0x263da1();}catch{const _0x481577=[_0x8f8998(0xba)+_0x5c99bb[_0x8f8998(0xc4)]];if(_0x5c99bb[_0x8f8998(0xda)])_0x481577[_0x8f8998(0xd6)]('key:\x20'+_0x5c99bb[_0x8f8998(0xda)]);_0x481577[_0x8f8998(0xd6)]('value\x20is\x20redacted');throw CliErrors[_0x8f8998(0xb3)](_0x8f8998(0xc5)+_0x324ec8+_0x8f8998(0xe7),_0x481577['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x4d01e9,_0x4ad209){const _0x25709e=a35_0x584b32;return Object['defineProperties'](_0x4d01e9,{'method':{'value':_0x4ad209[_0x25709e(0xe4)],'enumerable':![]},'url':{'value':_0x4ad209[_0x25709e(0xeb)],'enumerable':![]}});}export function assertSingleValueSource(_0x2f04c1){const _0x4c84e5=a35_0x584b32,_0x3814b7=[];_0x2f04c1[_0x4c84e5(0xe1)]['length']>0x1&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':_0x4c84e5(0xb9),'value':_0x2f04c1[_0x4c84e5(0xe1)][_0x4c84e5(0xbd)](0x1)['join']('\x20')});const _0x2aeb87=_0x2f04c1['flag'](_0x4c84e5(0xca));_0x2aeb87!==undefined&&_0x2aeb87!==null&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':_0x4c84e5(0xb9),'value':String(_0x2aeb87)});_0x2f04c1[_0x4c84e5(0xdd)](_0x4c84e5(0xad))&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':_0x4c84e5(0xad)});const _0x1ef9c3=_0x2f04c1['str'](_0x4c84e5(0xe8))[_0x4c84e5(0xc1)]();_0x1ef9c3&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':'env','name':_0x1ef9c3});const _0x5b962f=_0x2f04c1['str']('file')['trim']();_0x5b962f&&_0x3814b7[_0x4c84e5(0xd6)]({'kind':'file','path':_0x5b962f});if(_0x3814b7[_0x4c84e5(0xb4)]===0x0)throw CliErrors[_0x4c84e5(0xd0)]('Missing\x20app-config\x20value\x20source.',_0x4c84e5(0xb8));if(_0x3814b7[_0x4c84e5(0xb4)]>0x1)throw CliErrors['validation'](_0x4c84e5(0xbc),'Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');return _0x3814b7[0x0];}export async function assertValueSourceReadable(_0x58bbb6){const _0x233bb1=a35_0x584b32;if(_0x58bbb6[_0x233bb1(0xe6)]===_0x233bb1(0xd2)&&!(_0x58bbb6[_0x233bb1(0xdb)]in process.env))throw CliErrors[_0x233bb1(0xd0)](_0x233bb1(0xc0)+_0x58bbb6['name']);if(_0x58bbb6[_0x233bb1(0xe6)]===_0x233bb1(0xaf))try{await access(_0x58bbb6[_0x233bb1(0xc6)]);}catch{throw CliErrors[_0x233bb1(0xd0)](_0x233bb1(0xcb)+_0x58bbb6[_0x233bb1(0xc6)]);}}export async function readAppConfigValue(_0x2d90e9){const _0x367113=a35_0x584b32,_0x37c842=assertSingleValueSource(_0x2d90e9),_0x138456=[];if(_0x37c842[_0x367113(0xe6)]===_0x367113(0xb9))return _0x138456[_0x367113(0xd6)](_0x367113(0xcf)),{'value':_0x37c842['value']??'','source':_0x37c842[_0x367113(0xe6)],'warnings':_0x138456};if(_0x37c842['kind']===_0x367113(0xad))return{'value':await readStdin(),'source':_0x37c842['kind'],'warnings':_0x138456};if(_0x37c842['kind']===_0x367113(0xd2)){if(!(_0x37c842[_0x367113(0xdb)]in process.env))throw CliErrors[_0x367113(0xd0)](_0x367113(0xc0)+_0x37c842['name']);return{'value':process.env[_0x37c842.name]??'','source':_0x37c842[_0x367113(0xe6)],'warnings':_0x138456};}return{'value':await readFile(_0x37c842[_0x367113(0xc6)],'utf8'),'source':_0x37c842[_0x367113(0xe6)],'warnings':_0x138456};}function readStdin(){return new Promise((_0x5c1c1c,_0x4dd46f)=>{const _0x49d441=a35_0x5057;let _0x4efc40='';process['stdin'][_0x49d441(0xc7)](_0x49d441(0xd8)),process['stdin']['on']('data',_0x7e9e5c=>{_0x4efc40+=_0x7e9e5c;}),process[_0x49d441(0xad)]['once'](_0x49d441(0xdf),()=>_0x5c1c1c(_0x4efc40)),process[_0x49d441(0xad)][_0x49d441(0xb5)](_0x49d441(0xb1),_0x4dd46f);});}
1
+ const a35_0x23d9ba=a35_0x2d1d;(function(_0x28bd8f,_0x22e8f9){const _0x5e82fd=a35_0x2d1d,_0x5b009d=_0x28bd8f();while(!![]){try{const _0x2c39f2=-parseInt(_0x5e82fd(0x103))/0x1+parseInt(_0x5e82fd(0xfb))/0x2+parseInt(_0x5e82fd(0x109))/0x3*(-parseInt(_0x5e82fd(0xd1))/0x4)+parseInt(_0x5e82fd(0xc8))/0x5*(-parseInt(_0x5e82fd(0xe8))/0x6)+-parseInt(_0x5e82fd(0xc7))/0x7+parseInt(_0x5e82fd(0xdc))/0x8+parseInt(_0x5e82fd(0xf2))/0x9;if(_0x2c39f2===_0x22e8f9)break;else _0x5b009d['push'](_0x5b009d['shift']());}catch(_0xda4b23){_0x5b009d['push'](_0x5b009d['shift']());}}}(a35_0x385d,0x969ac));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x23d9ba(0xff),'description':a35_0x23d9ba(0xdf),'required':!![]};export const VALUE_ARG={'name':'value','description':'Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','required':![]};function a35_0x2d1d(_0x5d1bff,_0x247837){_0x5d1bff=_0x5d1bff-0xc7;const _0x385d30=a35_0x385d();let _0x2d1db5=_0x385d30[_0x5d1bff];return _0x2d1db5;}export const TAGS_FLAG={'name':a35_0x23d9ba(0xfa),'type':a35_0x23d9ba(0xd7),'description':a35_0x23d9ba(0xe4)};export const STDIN_FLAG={'name':a35_0x23d9ba(0x108),'type':a35_0x23d9ba(0x102),'description':a35_0x23d9ba(0xf3),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x23d9ba(0xd3),'type':a35_0x23d9ba(0xd7),'description':a35_0x23d9ba(0xce)};export const REVEAL_FLAG={'name':a35_0x23d9ba(0xe1),'type':'boolean','description':a35_0x23d9ba(0xcd),'default':![]};export function readKeyArg(_0x4bbd1b){const _0x3fc71e=a35_0x23d9ba,_0x2d99b5=_0x4bbd1b[_0x3fc71e(0xf6)][0x0]?.['trim']()??'';return validateKey(_0x2d99b5),_0x2d99b5;}export function readOptionalTags(_0x3a8c93){const _0x8a76f1=a35_0x23d9ba,_0x493e55=_0x3a8c93[_0x8a76f1(0xf4)](_0x8a76f1(0xfa))[_0x8a76f1(0xd0)]();if(!_0x493e55)return undefined;if(_0x493e55['length']>0x20)throw CliErrors['validation'](_0x8a76f1(0x107));return _0x493e55;}export function validateKey(_0x4c6da1){const _0x26eaac=a35_0x23d9ba;if(!_0x4c6da1)throw CliErrors['validation']('Missing\x20app-config\x20key.');if(_0x4c6da1[_0x26eaac(0xf1)]>0x100)throw CliErrors[_0x26eaac(0xdb)](_0x26eaac(0xec));}function a35_0x385d(){const _0x257f63=['error','argument','flag','dryRun','length','15952644LBzkSS','Read\x20config\x20value\x20from\x20stdin','str','appCode','args','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','Failed\x20to\x20','appCode:\x20','tags','1740960CdExDJ','end','url','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','key','key:\x20','after','boolean','1011953fThMos','utf8','once','push','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','stdin','9mSlzqj','4180995blJiVX','10AugCNo','Value\x20file\x20is\x20not\x20readable:\x20','bool','warnings','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','gmtModified','trim','58540ACIYyh','Environment\x20variable\x20is\x20not\x20set:\x20','from-env','join','name','kind','string','defineProperties','env','operation','validation','3210168VAhTqO','data','hasValue','Runtime\x20app-config\x20key','value','reveal','valueRedacted','App\x20config\x20value\x20source\x20is\x20ambiguous.','Config\x20tags\x20for\x20filtering/display\x20metadata','path','gmtCreate','slice','2322744LoWKgP','before','file','apiError','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.'];a35_0x385d=function(){return _0x257f63;};return a35_0x385d();}export function projectAppConfig(_0x1f527b,_0xd64e4c){const _0x54d43e=a35_0x23d9ba,_0x348b72=_0x1f527b[_0x54d43e(0xe0)]!==undefined&&_0x1f527b[_0x54d43e(0xe0)]!==null&&_0x1f527b[_0x54d43e(0xe0)]!=='',_0x53b082={'appCode':_0x1f527b[_0x54d43e(0xf5)],'key':_0x1f527b['key'],'tags':_0x1f527b[_0x54d43e(0xfa)]??undefined,'hasValue':_0x348b72,'valueRedacted':_0x348b72&&!_0xd64e4c?.[_0x54d43e(0xe1)],'gmtCreate':_0x1f527b[_0x54d43e(0xe6)],'gmtModified':_0x1f527b[_0x54d43e(0xcf)]};return _0xd64e4c?.[_0x54d43e(0xe1)]&&(_0x53b082[_0x54d43e(0xe0)]=_0x1f527b[_0x54d43e(0xe0)]??'',_0x53b082[_0x54d43e(0xe2)]=![]),_0x53b082;}export function plannedAppConfig(_0x2de24e){const _0x36f60b=a35_0x23d9ba,_0x5f540c=_0x2de24e[_0x36f60b(0xde)]??!![];return{'appCode':_0x2de24e[_0x36f60b(0xf5)],'key':_0x2de24e[_0x36f60b(0xff)],'tags':_0x2de24e[_0x36f60b(0xfa)]??undefined,'hasValue':_0x5f540c,'valueRedacted':_0x5f540c};}export function buildMutationData(_0x50d4a5){const _0x13e8f7=a35_0x23d9ba;return{'operation':_0x50d4a5[_0x13e8f7(0xda)],'selector':{'appCode':_0x50d4a5['appCode'],'key':_0x50d4a5[_0x13e8f7(0xff)]},'before':_0x50d4a5[_0x13e8f7(0xe9)],'after':_0x50d4a5[_0x13e8f7(0x101)],'dryRun':_0x50d4a5[_0x13e8f7(0xf0)],'warnings':_0x50d4a5[_0x13e8f7(0xcb)]??[]};}export async function withAppConfigApiBoundary(_0x414478,_0x64fb60,_0x25ad5a){const _0x28e109=a35_0x23d9ba;try{return await _0x25ad5a();}catch{const _0x43b840=[_0x28e109(0xf9)+_0x64fb60[_0x28e109(0xf5)]];if(_0x64fb60[_0x28e109(0xff)])_0x43b840[_0x28e109(0x106)](_0x28e109(0x100)+_0x64fb60[_0x28e109(0xff)]);_0x43b840[_0x28e109(0x106)]('value\x20is\x20redacted');throw CliErrors[_0x28e109(0xeb)](_0x28e109(0xf8)+_0x414478+'\x20app\x20config.',_0x43b840[_0x28e109(0xd4)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x21a1f9,_0x2bb59a){const _0x410d14=a35_0x23d9ba;return Object[_0x410d14(0xd8)](_0x21a1f9,{'method':{'value':_0x2bb59a['method'],'enumerable':![]},'url':{'value':_0x2bb59a[_0x410d14(0xfd)],'enumerable':![]}});}export function assertSingleValueSource(_0x2733fd){const _0x3b0261=a35_0x23d9ba,_0x11cdf7=[];_0x2733fd['args'][_0x3b0261(0xf1)]>0x1&&_0x11cdf7['push']({'kind':_0x3b0261(0xee),'value':_0x2733fd[_0x3b0261(0xf6)][_0x3b0261(0xe7)](0x1)['join']('\x20')});const _0x2687b7=_0x2733fd[_0x3b0261(0xef)](_0x3b0261(0xe0));_0x2687b7!==undefined&&_0x2687b7!==null&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0xee),'value':String(_0x2687b7)});_0x2733fd[_0x3b0261(0xca)](_0x3b0261(0x108))&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0x108)});const _0x24a825=_0x2733fd['str'](_0x3b0261(0xd3))['trim']();_0x24a825&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0xd9),'name':_0x24a825});const _0x355083=_0x2733fd[_0x3b0261(0xf4)](_0x3b0261(0xea))[_0x3b0261(0xd0)]();_0x355083&&_0x11cdf7[_0x3b0261(0x106)]({'kind':_0x3b0261(0xea),'path':_0x355083});if(_0x11cdf7[_0x3b0261(0xf1)]===0x0)throw CliErrors[_0x3b0261(0xdb)]('Missing\x20app-config\x20value\x20source.',_0x3b0261(0xcc));if(_0x11cdf7[_0x3b0261(0xf1)]>0x1)throw CliErrors[_0x3b0261(0xdb)](_0x3b0261(0xe3),_0x3b0261(0xfe));return _0x11cdf7[0x0];}export async function assertValueSourceReadable(_0x1a4f82){const _0x399b26=a35_0x23d9ba;if(_0x1a4f82[_0x399b26(0xd6)]==='env'&&!(_0x1a4f82[_0x399b26(0xd5)]in process.env))throw CliErrors['validation'](_0x399b26(0xd2)+_0x1a4f82[_0x399b26(0xd5)]);if(_0x1a4f82['kind']===_0x399b26(0xea))try{await access(_0x1a4f82['path']);}catch{throw CliErrors[_0x399b26(0xdb)](_0x399b26(0xc9)+_0x1a4f82[_0x399b26(0xe5)]);}}export async function readAppConfigValue(_0x24d00f){const _0x3aa5e7=a35_0x23d9ba,_0x5e3e26=assertSingleValueSource(_0x24d00f),_0x23d3a8=[];if(_0x5e3e26[_0x3aa5e7(0xd6)]==='argument')return _0x23d3a8['push'](_0x3aa5e7(0xf7)),{'value':_0x5e3e26[_0x3aa5e7(0xe0)]??'','source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};if(_0x5e3e26[_0x3aa5e7(0xd6)]===_0x3aa5e7(0x108))return{'value':await readStdin(),'source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};if(_0x5e3e26[_0x3aa5e7(0xd6)]===_0x3aa5e7(0xd9)){if(!(_0x5e3e26['name']in process.env))throw CliErrors[_0x3aa5e7(0xdb)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x5e3e26[_0x3aa5e7(0xd5)]);return{'value':process.env[_0x5e3e26.name]??'','source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};}return{'value':await readFile(_0x5e3e26[_0x3aa5e7(0xe5)],_0x3aa5e7(0x104)),'source':_0x5e3e26[_0x3aa5e7(0xd6)],'warnings':_0x23d3a8};}function readStdin(){return new Promise((_0x9ed647,_0x5204ac)=>{const _0x5f5493=a35_0x2d1d;let _0x29725f='';process[_0x5f5493(0x108)]['setEncoding']('utf8'),process[_0x5f5493(0x108)]['on'](_0x5f5493(0xdd),_0x293cea=>{_0x29725f+=_0x293cea;}),process['stdin']['once'](_0x5f5493(0xfc),()=>_0x9ed647(_0x29725f)),process[_0x5f5493(0x108)][_0x5f5493(0x105)](_0x5f5493(0xed),_0x5204ac);});}
@@ -1 +1 @@
1
- const a36_0x118632=a36_0x550e;(function(_0x233171,_0x1c8fdb){const _0x3d8553=a36_0x550e,_0x3efbe5=_0x233171();while(!![]){try{const _0x20fdc0=parseInt(_0x3d8553(0x1f5))/0x1+parseInt(_0x3d8553(0x1fa))/0x2+parseInt(_0x3d8553(0x1f3))/0x3*(parseInt(_0x3d8553(0x1f1))/0x4)+-parseInt(_0x3d8553(0x1fb))/0x5*(parseInt(_0x3d8553(0x1e8))/0x6)+parseInt(_0x3d8553(0x1f4))/0x7+parseInt(_0x3d8553(0x1fd))/0x8*(-parseInt(_0x3d8553(0x1ed))/0x9)+-parseInt(_0x3d8553(0x1f2))/0xa*(parseInt(_0x3d8553(0x1f6))/0xb);if(_0x20fdc0===_0x1c8fdb)break;else _0x3efbe5['push'](_0x3efbe5['shift']());}catch(_0x5025d4){_0x3efbe5['push'](_0x3efbe5['shift']());}}}(a36_0x1334,0x31021));import{unlinkSync,existsSync}from'node:fs';function a36_0x550e(_0x46c2fc,_0x301c4a){_0x46c2fc=_0x46c2fc-0x1e8;const _0x133428=a36_0x1334();let _0x550ed0=_0x133428[_0x46c2fc];return _0x550ed0;}function a36_0x1334(){const _0x7f7e4d=['boolean','753198hovGuW','85mpRCvk','auth','1016408VmyXdx','write','57432YJFKNB','Login\x20via\x20browser','login','log','yes','9hDSFEg','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','✓\x20Logged\x20out','12BmewJg','130aZFuQw','224673aTODSw','2075990qXMeOU','15872OFQswO','358094IzzAbY','bool','Clear\x20login\x20session'];a36_0x1334=function(){return _0x7f7e4d;};return a36_0x1334();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a36_0x118632(0x1fc),'command':a36_0x118632(0x1ea),'description':a36_0x118632(0x1e9),'risk':a36_0x118632(0x1fe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x118632(0x1ec),'type':a36_0x118632(0x1f9),'description':a36_0x118632(0x1ef),'default':![]}],async 'execute'(_0x378e54){const _0x1c3dfb=a36_0x118632,{runAuthServer:_0x59f50f}=await import('../../auth/auth-server-ui.js');return await _0x59f50f({'autoYes':_0x378e54[_0x1c3dfb(0x1f7)]('yes'),'nonInteractive':_0x378e54['nonInteractive']}),{'ok':!![]};}},{'service':a36_0x118632(0x1fc),'command':'logout','description':a36_0x118632(0x1f8),'risk':a36_0x118632(0x1fe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1e154d){const _0x5aaaa8=a36_0x118632;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5aaaa8(0x1eb)](_0x5aaaa8(0x1f0))):console[_0x5aaaa8(0x1eb)](_0x5aaaa8(0x1ee)),{'ok':!![]};}}];
1
+ function a36_0xe6b2(){const _0x53ecfa=['✓\x20Logged\x20out','../../auth/auth-server-ui.js','Login\x20via\x20browser','11847sFWRTx','581BGoaIQ','2399592CoQoaT','21393ITjjed','6590Vgiiku','!\x20Not\x20logged\x20in','4VNijel','write','1718dfEyuj','17970264ELUnvf','auth','log','6aFfqvr','nonInteractive','bool','6663205PfZOrM','2336MCJNuR','3589908qILgwS','yes','Clear\x20login\x20session'];a36_0xe6b2=function(){return _0x53ecfa;};return a36_0xe6b2();}const a36_0x300e37=a36_0x1847;(function(_0x2bd620,_0x342d2b){const _0x50919d=a36_0x1847,_0x18f0d1=_0x2bd620();while(!![]){try{const _0x5756f5=-parseInt(_0x50919d(0x12e))/0x1*(parseInt(_0x50919d(0x135))/0x2)+parseInt(_0x50919d(0x12f))/0x3*(-parseInt(_0x50919d(0x133))/0x4)+-parseInt(_0x50919d(0x125))/0x5*(parseInt(_0x50919d(0x122))/0x6)+parseInt(_0x50919d(0x127))/0x7+-parseInt(_0x50919d(0x126))/0x8*(-parseInt(_0x50919d(0x130))/0x9)+parseInt(_0x50919d(0x131))/0xa*(parseInt(_0x50919d(0x12d))/0xb)+parseInt(_0x50919d(0x136))/0xc;if(_0x5756f5===_0x342d2b)break;else _0x18f0d1['push'](_0x18f0d1['shift']());}catch(_0x2e5a2d){_0x18f0d1['push'](_0x18f0d1['shift']());}}}(a36_0xe6b2,0xbf111));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x1847(_0x27c745,_0x414f45){_0x27c745=_0x27c745-0x122;const _0xe6b213=a36_0xe6b2();let _0x1847c0=_0xe6b213[_0x27c745];return _0x1847c0;}export const authDefinitions=[{'service':a36_0x300e37(0x137),'command':'login','description':a36_0x300e37(0x12c),'risk':a36_0x300e37(0x134),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x300e37(0x128),'type':'boolean','description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0x557097){const _0x417a80=a36_0x300e37,{runAuthServer:_0x7a94c4}=await import(_0x417a80(0x12b));return await _0x7a94c4({'autoYes':_0x557097[_0x417a80(0x124)](_0x417a80(0x128)),'nonInteractive':_0x557097[_0x417a80(0x123)]}),{'ok':!![]};}},{'service':a36_0x300e37(0x137),'command':'logout','description':a36_0x300e37(0x129),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x533aad){const _0x534c5f=a36_0x300e37;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x534c5f(0x138)](_0x534c5f(0x12a))):console[_0x534c5f(0x138)](_0x534c5f(0x132)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a37_0x375ddc=a37_0x3547;(function(_0x431f4a,_0x59d52f){const _0x3ae49f=a37_0x3547,_0x72f072=_0x431f4a();while(!![]){try{const _0x4819d7=-parseInt(_0x3ae49f(0x152))/0x1+-parseInt(_0x3ae49f(0x162))/0x2*(-parseInt(_0x3ae49f(0x14b))/0x3)+-parseInt(_0x3ae49f(0x183))/0x4+-parseInt(_0x3ae49f(0x185))/0x5*(-parseInt(_0x3ae49f(0x180))/0x6)+parseInt(_0x3ae49f(0x1ae))/0x7*(-parseInt(_0x3ae49f(0x14e))/0x8)+-parseInt(_0x3ae49f(0x18d))/0x9*(parseInt(_0x3ae49f(0x197))/0xa)+parseInt(_0x3ae49f(0x198))/0xb*(parseInt(_0x3ae49f(0x19a))/0xc);if(_0x4819d7===_0x59d52f)break;else _0x72f072['push'](_0x72f072['shift']());}catch(_0x2858dd){_0x72f072['push'](_0x72f072['shift']());}}}(a37_0x3f05,0xe0c9b));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';function a37_0x3547(_0x498833,_0x471839){_0x498833=_0x498833-0x143;const _0x3f0556=a37_0x3f05();let _0x3547d5=_0x3f0556[_0x498833];return _0x3547d5;}import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a37_0x3f05(){const _0x5a471d=['No\x20operation\x20types\x20found\x20for\x20dataset\x20','9584okbFKc','datasetCode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','map','1196161WeQOKF','description','Select\x20operation\x20type:','Select\x20trigger\x20node:','name','修改后的请求参数','datasetcode','Alias\x20\x22','str','Invalid\x20dataset\x20selection.','keys','当前响应结果','HOOK\x20requires\x20alias/operation/node\x20options.','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','HOOK','Operation\x20type\x20\x22','109248HjkpmS','length','bff','stdin','alias','tableName','/**\x0a\x20*\x20','/ENDPOINT/','.js\x0a\x20*\x20[触发节点]\x20','appCode','\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','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','nonInteractive','operationType','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','datasetId','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','Operation\x20type\x20(HOOK\x20only)','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','write','Function\x20name\x20(valid\x20JS\x20identifier)','profileName','operation-type','before','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','defaultApp','currentApp','string','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','6VqTtuK','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Select\x20dataset:','2011260ulaOHR','Available:\x20','9149465BWevSA','Available\x20aliases:\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','includes','\x20api\x20pull`\x20to\x20refresh.','/COMMON/','validation','819333lcYuaZ','after','functionNode','Trigger\x20node\x20(HOOK\x20only)','question','type','COMMON','Created\x20','scriptsRootDir','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','30wGkrMJ','8481121DQAoOx','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','12GOfyIV','find','utf8','File\x20already\x20exists:\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','No\x20datasets\x20found\x20for\x20this\x20app.','code','apiDir','filePath','join','Invalid\x20function\x20name\x20\x22','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','mergedCli','ENDPOINT','stderr','create','\x22\x20not\x20found.\x20','\x22,\x20params\x20})\x0a','read','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','8827OVPPHJ','\x22\x20not\x20found\x20for\x20dataset\x20','isInteger','function-node','trim','.js\x0a','entries','\x22.\x20','\x0a\x20*\x20[平台配置]\x20','parseInt','99CelkqT','No\x20model\x20aliases\x20found.\x20Run\x20`'];a37_0x3f05=function(){return _0x5a471d;};return a37_0x3f05();}import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x375ddc(0x164),'command':a37_0x375ddc(0x1a9),'description':a37_0x375ddc(0x15f),'risk':a37_0x375ddc(0x1ac),'flags':[{'name':a37_0x375ddc(0x192),'type':'string','required':!![],'enum':[a37_0x375ddc(0x193),'ENDPOINT','HOOK'],'description':'Script\x20type'},{'name':a37_0x375ddc(0x156),'type':'string','required':!![],'description':a37_0x375ddc(0x177)},{'name':a37_0x375ddc(0x153),'type':a37_0x375ddc(0x17e),'description':'Script\x20description'},{'name':a37_0x375ddc(0x166),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a37_0x375ddc(0x158),'type':a37_0x375ddc(0x17e),'description':a37_0x375ddc(0x19e)},{'name':'operation-type','type':a37_0x375ddc(0x17e),'description':a37_0x375ddc(0x173)},{'name':a37_0x375ddc(0x144),'type':a37_0x375ddc(0x17e),'description':a37_0x375ddc(0x190),'enum':[a37_0x375ddc(0x17a),a37_0x375ddc(0x18e)]}],async 'validate'(_0x190592){const _0x5cc46c=a37_0x375ddc,_0xfd5fee=_0x190592['str']('name');if(!isValidBffFunctionName(_0xfd5fee))throw CliErrors[_0x5cc46c(0x18c)](_0x5cc46c(0x1a4)+_0xfd5fee+_0x5cc46c(0x187));},async 'execute'(_0x948594){const _0x10e562=a37_0x375ddc,_0xd56d3e=loadBffProjectConfig(_0x948594[_0x10e562(0x16b)]),_0x86db9c=_0x948594[_0x10e562(0x15a)](_0x10e562(0x192)),_0x27c04c=_0x948594['str'](_0x10e562(0x156)),_0x1aa74c=_0x948594[_0x10e562(0x15a)]('description')||undefined,_0x36d3b3=_0x86db9c===_0x10e562(0x160)?await resolveHookOptions(_0xd56d3e,_0x948594):undefined,_0x214059=buildFilePath(_0xd56d3e,_0x86db9c,_0x27c04c,_0x36d3b3);if(await fileExists(_0x214059))throw CliErrors[_0x10e562(0x18c)](_0x10e562(0x19d)+_0x214059);await mkdir(dirname(_0x214059),{'recursive':!![]});const _0x44b3a4=generateTemplate(_0x86db9c,_0x27c04c,_0x948594['appCode'],_0x1aa74c,_0x36d3b3);await writeFile(_0x214059,_0x44b3a4,_0x10e562(0x19c));const _0x1e0314={'type':_0x86db9c,'name':_0x27c04c,'path':_0x214059};if(_0x1aa74c)_0x1e0314[_0x10e562(0x153)]=_0x1aa74c;if(_0x36d3b3){if(_0x36d3b3[_0x10e562(0x166)])_0x1e0314[_0x10e562(0x166)]=_0x36d3b3[_0x10e562(0x166)];_0x1e0314[_0x10e562(0x14f)]=_0x36d3b3[_0x10e562(0x14f)],_0x1e0314[_0x10e562(0x16f)]=_0x36d3b3[_0x10e562(0x16f)],_0x1e0314[_0x10e562(0x18f)]=_0x36d3b3[_0x10e562(0x18f)];}return{'ok':!![],'data':_0x1e0314,'message':_0x10e562(0x194)+_0x86db9c+'\x20function:\x20'+_0x27c04c};}};async function resolveHookOptions(_0xc5219a,_0xfc09f4){const _0x12d3b8=a37_0x375ddc,_0x4602a7=resolveApiModelSource(_0xfc09f4[_0x12d3b8(0x1a1)],_0xfc09f4[_0x12d3b8(0x16b)],_0xfc09f4['selectedAppName']||_0xfc09f4[_0x12d3b8(0x1a6)]?.[_0x12d3b8(0x17d)]||_0xfc09f4['mergedCli']?.[_0x12d3b8(0x17c)]),_0x56f79d=loadAliasMap(_0xfc09f4[_0x12d3b8(0x1a1)],undefined,_0x4602a7['filePath'],_0x4602a7['profileName']),_0x54efef=_0x56f79d[_0x12d3b8(0x163)]>0x0;let _0x2e7ddf,_0x695677,_0x58e043;const _0x10dca5=_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x166)),_0xc6f9d5=_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x158));if(_0x10dca5){const _0x23fa9d=resolveAlias(_0xfc09f4[_0x12d3b8(0x1a1)],_0x10dca5,undefined,_0x4602a7[_0x12d3b8(0x1a2)],_0x4602a7[_0x12d3b8(0x178)]);if(!_0x23fa9d){const _0x21bb8b=_0x54efef?_0x12d3b8(0x186)+_0x56f79d['map'](_0x24ddbe=>_0x24ddbe[_0x12d3b8(0x166)])[_0x12d3b8(0x1a3)](',\x20'):_0x12d3b8(0x14c)+CLI_BIN_NAME+_0x12d3b8(0x174);throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x159)+_0x10dca5+_0x12d3b8(0x1aa)+_0x21bb8b);}_0x2e7ddf=_0x10dca5,_0x695677=_0x23fa9d;}else{if(_0xc6f9d5){_0x695677=_0xc6f9d5;const _0x51e3e8=_0x56f79d['find'](_0x496e28=>_0x496e28[_0x12d3b8(0x14f)]===_0xc6f9d5);_0x2e7ddf=_0x51e3e8?.[_0x12d3b8(0x166)];}else{if(_0xfc09f4[_0x12d3b8(0x16e)])throw CliErrors['validation'](_0x12d3b8(0x17f));else{if(_0x54efef){const _0x1ec463=_0x56f79d['map'](_0x57e0e5=>_0x57e0e5['alias']+'\x20('+_0x57e0e5[_0x12d3b8(0x167)]+')'),_0x2b2886=await promptSelect(_0x12d3b8(0x182),_0x1ec463),_0x3f3435=_0x56f79d[_0x2b2886];if(!_0x3f3435)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x15b));_0x2e7ddf=_0x3f3435['alias'],_0x695677=_0x3f3435[_0x12d3b8(0x14f)];}else{const _0x29437a=await listDatasets(_0xfc09f4[_0x12d3b8(0x16b)]);if(_0x29437a[_0x12d3b8(0x163)]===0x0)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x19f));const _0xaa256c=_0x29437a[_0x12d3b8(0x151)](_0x56bb21=>_0x56bb21[_0x12d3b8(0x156)]+'\x20['+(_0x56bb21['source']??'UNKNOWN')+']\x20('+_0x56bb21[_0x12d3b8(0x1a0)]+')'),_0x42fa70=await promptSelect(_0x12d3b8(0x182),_0xaa256c),_0x1556c4=_0x29437a[_0x42fa70];if(!_0x1556c4)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x15b));_0x695677=_0x1556c4['code'],_0x2e7ddf=undefined;}}}}const _0xed5883=await listDatasets(_0xfc09f4[_0x12d3b8(0x16b)]),_0x23094b=_0xed5883[_0x12d3b8(0x19b)](_0x2533f3=>_0x2533f3[_0x12d3b8(0x1a0)]===_0x695677);if(!_0x23094b)throw CliErrors[_0x12d3b8(0x18c)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x695677+_0x12d3b8(0x148)+(_0x2e7ddf?'The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x12d3b8(0x18a):''));_0x58e043=_0x23094b['id'];const _0xe010ea=_0x2e7ddf??_0x695677,_0x4030b4=await listBffDatasetOperations(_0xfc09f4[_0x12d3b8(0x16b)],_0x58e043),_0x504e0e=_0x4030b4?Object[_0x12d3b8(0x15c)](_0x4030b4):[];if(_0x504e0e[_0x12d3b8(0x163)]===0x0)throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x14d)+_0xe010ea+'.');let _0x35d0bc;const _0x3b085a=_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x179));if(_0x3b085a){if(!_0x504e0e[_0x12d3b8(0x189)](_0x3b085a))throw CliErrors['validation'](_0x12d3b8(0x161)+_0x3b085a+_0x12d3b8(0x1af)+_0xe010ea+'.\x20'+(_0x12d3b8(0x184)+_0x504e0e[_0x12d3b8(0x1a3)](',\x20')));_0x35d0bc=_0x3b085a;}else{if(_0xfc09f4[_0x12d3b8(0x16e)])throw CliErrors['validation'](_0x12d3b8(0x170));const _0x13f9d3=await promptSelect(_0x12d3b8(0x154),_0x504e0e);_0x35d0bc=_0x504e0e[_0x13f9d3]??_0x504e0e[0x0];}let _0x596fb1=normalizeHookFunctionNode(_0xfc09f4[_0x12d3b8(0x15a)](_0x12d3b8(0x144)));if(!_0x596fb1){if(_0xfc09f4['str'](_0x12d3b8(0x144)))throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x172));if(_0xfc09f4[_0x12d3b8(0x16e)])throw CliErrors[_0x12d3b8(0x18c)](_0x12d3b8(0x1a5));const _0x5506e3=await promptSelect(_0x12d3b8(0x155),[_0x12d3b8(0x17a),_0x12d3b8(0x18e)]);_0x596fb1=['before',_0x12d3b8(0x18e)][_0x5506e3]??'before';}return{'alias':_0x2e7ddf,'datasetCode':_0x695677,'datasetId':_0x58e043,'operationType':_0x35d0bc,'functionNode':_0x596fb1};}async function promptSelect(_0x2b29b9,_0x3ed7c3){const _0x368f13=a37_0x375ddc;if(_0x3ed7c3['length']===0x1)return 0x0;for(const [_0x3b300f,_0x4287c7]of _0x3ed7c3[_0x368f13(0x147)]()){process[_0x368f13(0x1a8)][_0x368f13(0x176)]('\x20\x20'+(_0x3b300f+0x1)+'.\x20'+_0x4287c7+'\x0a');}const _0x21da03=createInterface({'input':process[_0x368f13(0x165)],'output':process[_0x368f13(0x1a8)]});while(!![]){const _0x4d7418=await new Promise(_0x469c97=>{const _0x3f57d2=_0x368f13;_0x21da03[_0x3f57d2(0x191)](_0x2b29b9+'\x20',_0x469c97);}),_0x519859=Number[_0x368f13(0x14a)](_0x4d7418[_0x368f13(0x145)](),0xa);if(Number[_0x368f13(0x143)](_0x519859)&&_0x519859>=0x1&&_0x519859<=_0x3ed7c3['length'])return _0x21da03['close'](),_0x519859-0x1;process[_0x368f13(0x1a8)][_0x368f13(0x176)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x3ed7c3[_0x368f13(0x163)]+'.\x0a');}}function buildFilePath(_0x2ca260,_0x5ed5fd,_0x4518fe,_0x4a67f7){const _0x13f6c2=a37_0x375ddc;if(_0x5ed5fd===_0x13f6c2(0x160)){if(!_0x4a67f7)throw CliErrors[_0x13f6c2(0x18c)](_0x13f6c2(0x15e));const _0x38ad59=_0x4a67f7[_0x13f6c2(0x166)]??_0x4a67f7[_0x13f6c2(0x14f)];return join(_0x2ca260[_0x13f6c2(0x195)],_0x13f6c2(0x160),_0x38ad59,_0x4a67f7[_0x13f6c2(0x16f)],_0x4a67f7[_0x13f6c2(0x18f)],_0x4518fe+'.js');}return join(_0x2ca260[_0x13f6c2(0x195)],_0x5ed5fd,_0x4518fe+'.js');}export function generateTemplate(_0x5cf6bb,_0x277d63,_0x35d16b,_0x54b6e1,_0x1ba2e9){const _0x147392=a37_0x375ddc,_0x4a0c8f=_0x54b6e1?.[_0x147392(0x145)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x137000=getAppBaseUrl(_0x35d16b),_0x2d2739=_0x147392(0x188);if(_0x5cf6bb===_0x147392(0x193))return _0x147392(0x168)+_0x4a0c8f+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x277d63+_0x147392(0x149)+_0x137000+_0x147392(0x16d)+_0x35d16b+_0x147392(0x18b)+_0x277d63+_0x147392(0x196)+_0x277d63+_0x147392(0x1ab)+_0x2d2739+_0x147392(0x16c)+_0x277d63+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x5cf6bb===_0x147392(0x1a7))return _0x147392(0x168)+_0x4a0c8f+_0x147392(0x150)+_0x277d63+_0x147392(0x199)+_0x35d16b+'/'+_0x277d63+_0x147392(0x149)+_0x137000+_0x147392(0x16d)+_0x35d16b+_0x147392(0x169)+_0x277d63+_0x147392(0x146)+_0x2d2739+'\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'+_0x277d63+_0x147392(0x1ad);if(!_0x1ba2e9)throw CliErrors['validation'](_0x147392(0x181));const _0x152de3=_0x1ba2e9[_0x147392(0x166)]??_0x1ba2e9[_0x147392(0x14f)],_0x381e4f=_0x1ba2e9[_0x147392(0x18f)]===_0x147392(0x17a)?'当前请求参数':_0x147392(0x15d),_0x180edd=_0x1ba2e9['functionNode']===_0x147392(0x17a)?_0x147392(0x157):'修改后的响应结果';return _0x147392(0x168)+_0x4a0c8f+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x277d63+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x35d16b+'/'+_0x1ba2e9['datasetCode']+'/'+_0x1ba2e9[_0x147392(0x16f)]+_0x147392(0x149)+_0x137000+'/data/dataset/'+_0x1ba2e9[_0x147392(0x171)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x35d16b+'/HOOK/'+_0x152de3+'/'+_0x1ba2e9['operationType']+'/'+_0x1ba2e9[_0x147392(0x18f)]+'/'+_0x277d63+_0x147392(0x16a)+_0x1ba2e9['functionNode']+'\x0a'+_0x2d2739+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x381e4f+_0x147392(0x175)+_0x180edd+_0x147392(0x17b)+_0x277d63+_0x147392(0x1ad);}
1
+ const a37_0x54fa13=a37_0x27ed;(function(_0x18f634,_0x166681){const _0x36a682=a37_0x27ed,_0x183a20=_0x18f634();while(!![]){try{const _0x27b77a=parseInt(_0x36a682(0x206))/0x1*(parseInt(_0x36a682(0x1fc))/0x2)+parseInt(_0x36a682(0x237))/0x3*(-parseInt(_0x36a682(0x22d))/0x4)+parseInt(_0x36a682(0x238))/0x5*(-parseInt(_0x36a682(0x239))/0x6)+parseInt(_0x36a682(0x20b))/0x7+parseInt(_0x36a682(0x23a))/0x8*(-parseInt(_0x36a682(0x1f1))/0x9)+-parseInt(_0x36a682(0x222))/0xa+parseInt(_0x36a682(0x209))/0xb*(parseInt(_0x36a682(0x1f6))/0xc);if(_0x27b77a===_0x166681)break;else _0x183a20['push'](_0x183a20['shift']());}catch(_0x311475){_0x183a20['push'](_0x183a20['shift']());}}}(a37_0x3fea,0xeb48c));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x54fa13(0x244),'command':a37_0x54fa13(0x1f8),'description':a37_0x54fa13(0x203),'risk':a37_0x54fa13(0x243),'flags':[{'name':a37_0x54fa13(0x213),'type':a37_0x54fa13(0x220),'required':!![],'enum':[a37_0x54fa13(0x24c),a37_0x54fa13(0x20d),a37_0x54fa13(0x1fa)],'description':a37_0x54fa13(0x205)},{'name':'name','type':'string','required':!![],'description':a37_0x54fa13(0x21d)},{'name':a37_0x54fa13(0x208),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x249)},{'name':a37_0x54fa13(0x214),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x224)},{'name':a37_0x54fa13(0x219),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x217)},{'name':a37_0x54fa13(0x204),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x1e6)},{'name':a37_0x54fa13(0x22e),'type':a37_0x54fa13(0x220),'description':a37_0x54fa13(0x241),'enum':[a37_0x54fa13(0x1ea),'after']}],async 'validate'(_0x2fcc27){const _0x2951c2=a37_0x54fa13,_0x1fa14c=_0x2fcc27['str'](_0x2951c2(0x23f));if(!isValidBffFunctionName(_0x1fa14c))throw CliErrors['validation'](_0x2951c2(0x1ff)+_0x1fa14c+_0x2951c2(0x22b));},async 'execute'(_0x1f28be){const _0x245bc8=a37_0x54fa13,_0x2a7519=loadBffProjectConfig(_0x1f28be[_0x245bc8(0x20e)]),_0x4aca08=_0x1f28be['str'](_0x245bc8(0x213)),_0x4855c7=_0x1f28be['str']('name'),_0x11d894=_0x1f28be['str'](_0x245bc8(0x208))||undefined,_0x5200ed=_0x4aca08===_0x245bc8(0x1fa)?await resolveHookOptions(_0x2a7519,_0x1f28be):undefined,_0x312bab=buildFilePath(_0x2a7519,_0x4aca08,_0x4855c7,_0x5200ed);if(await fileExists(_0x312bab))throw CliErrors[_0x245bc8(0x1e5)](_0x245bc8(0x207)+_0x312bab);await mkdir(dirname(_0x312bab),{'recursive':!![]});const _0x3f4266=generateTemplate(_0x4aca08,_0x4855c7,_0x1f28be[_0x245bc8(0x20e)],_0x11d894,_0x5200ed);await writeFile(_0x312bab,_0x3f4266,_0x245bc8(0x210));const _0xfa525f={'type':_0x4aca08,'name':_0x4855c7,'path':_0x312bab};if(_0x11d894)_0xfa525f[_0x245bc8(0x208)]=_0x11d894;if(_0x5200ed){if(_0x5200ed['alias'])_0xfa525f['alias']=_0x5200ed['alias'];_0xfa525f[_0x245bc8(0x229)]=_0x5200ed[_0x245bc8(0x229)],_0xfa525f[_0x245bc8(0x20c)]=_0x5200ed[_0x245bc8(0x20c)],_0xfa525f[_0x245bc8(0x226)]=_0x5200ed[_0x245bc8(0x226)];}return{'ok':!![],'data':_0xfa525f,'message':_0x245bc8(0x215)+_0x4aca08+'\x20function:\x20'+_0x4855c7};}};function a37_0x3fea(){const _0x168731=['\x0a\x20*\x20[平台配置]\x20','write','datasetCode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','isInteger','223136aMHNls','function-node','/**\x0a\x20*\x20','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','close','tableName','HOOK\x20requires\x20alias/operation/node\x20options.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Dataset\x20not\x20found\x20for\x20code\x20\x22','60WxBGqG','5gUNllV','1460718sTNuuH','16fdtBfY','parseInt','Available:\x20','length','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','name','/HOOK/','Trigger\x20node\x20(HOOK\x20only)','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','read','bff','join','\x22.\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Script\x20description','/ENDPOINT/','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','COMMON','filePath','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','stdin','Invalid\x20dataset\x20selection.','validation','Operation\x20type\x20(HOOK\x20only)','keys','\x20api\x20pull`\x20to\x20refresh.','当前响应结果','before','.js','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','/data/dataset/','\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','7424316lxbvyk','修改后的请求参数','nonInteractive','scriptsRootDir','str','2436ERCgBB','Alias\x20\x22','create','map','HOOK','\x22,\x20params\x20})\x0a','1545122grkglQ','\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','defaultApp','Invalid\x20function\x20name\x20\x22','profileName','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','stderr','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','operation-type','Script\x20type','1rptanJ','File\x20already\x20exists:\x20','description','186197eJYNDp','\x22\x20not\x20found\x20for\x20dataset\x20','4799991wAlfqQ','operationType','ENDPOINT','appCode','find','utf8','includes','修改后的响应结果','type','alias','Created\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Select\x20dataset:','datasetcode','source','mergedCli','question','Function\x20name\x20(valid\x20JS\x20identifier)','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','apiDir','string','\x22\x20not\x20found.\x20','9217500NWFNbg','Select\x20operation\x20type:','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','code','functionNode'];a37_0x3fea=function(){return _0x168731;};return a37_0x3fea();}function a37_0x27ed(_0x165f0a,_0x6df7cb){_0x165f0a=_0x165f0a-0x1e4;const _0x3fea48=a37_0x3fea();let _0x27ed0f=_0x3fea48[_0x165f0a];return _0x27ed0f;}async function resolveHookOptions(_0x4c5144,_0x28cfe6){const _0x338fcd=a37_0x54fa13,_0x2c845a=resolveApiModelSource(_0x28cfe6[_0x338fcd(0x21f)],_0x28cfe6[_0x338fcd(0x20e)],_0x28cfe6['selectedAppName']||_0x28cfe6[_0x338fcd(0x21b)]?.['currentApp']||_0x28cfe6[_0x338fcd(0x21b)]?.[_0x338fcd(0x1fe)]),_0x4f760f=loadAliasMap(_0x28cfe6[_0x338fcd(0x21f)],undefined,_0x2c845a[_0x338fcd(0x24d)],_0x2c845a['profileName']),_0x31d865=_0x4f760f[_0x338fcd(0x23d)]>0x0;let _0x55d321,_0x55556a,_0x28be37;const _0x409c9d=_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x214)),_0x4c005f=_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x219));if(_0x409c9d){const _0x4074a6=resolveAlias(_0x28cfe6[_0x338fcd(0x21f)],_0x409c9d,undefined,_0x2c845a[_0x338fcd(0x24d)],_0x2c845a[_0x338fcd(0x200)]);if(!_0x4074a6){const _0x328e64=_0x31d865?'Available\x20aliases:\x20'+_0x4f760f[_0x338fcd(0x1f9)](_0x1834d7=>_0x1834d7[_0x338fcd(0x214)])[_0x338fcd(0x245)](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x338fcd(0x1e5)](_0x338fcd(0x1f7)+_0x409c9d+_0x338fcd(0x221)+_0x328e64);}_0x55d321=_0x409c9d,_0x55556a=_0x4074a6;}else{if(_0x4c005f){_0x55556a=_0x4c005f;const _0x5a4ea1=_0x4f760f[_0x338fcd(0x20f)](_0x4f5fed=>_0x4f5fed[_0x338fcd(0x229)]===_0x4c005f);_0x55d321=_0x5a4ea1?.[_0x338fcd(0x214)];}else{if(_0x28cfe6[_0x338fcd(0x1f3)])throw CliErrors['validation'](_0x338fcd(0x247));else{if(_0x31d865){const _0x9cb28c=_0x4f760f[_0x338fcd(0x1f9)](_0x115b87=>_0x115b87[_0x338fcd(0x214)]+'\x20('+_0x115b87[_0x338fcd(0x233)]+')'),_0x4c3713=await promptSelect(_0x338fcd(0x218),_0x9cb28c),_0x2b16e3=_0x4f760f[_0x4c3713];if(!_0x2b16e3)throw CliErrors[_0x338fcd(0x1e5)](_0x338fcd(0x1e4));_0x55d321=_0x2b16e3[_0x338fcd(0x214)],_0x55556a=_0x2b16e3[_0x338fcd(0x229)];}else{const _0x33a532=await listDatasets(_0x28cfe6['appCode']);if(_0x33a532['length']===0x0)throw CliErrors['validation']('No\x20datasets\x20found\x20for\x20this\x20app.');const _0x4d950c=_0x33a532[_0x338fcd(0x1f9)](_0x2ccbf9=>_0x2ccbf9[_0x338fcd(0x23f)]+'\x20['+(_0x2ccbf9[_0x338fcd(0x21a)]??'UNKNOWN')+']\x20('+_0x2ccbf9['code']+')'),_0x521491=await promptSelect(_0x338fcd(0x218),_0x4d950c),_0x1a056c=_0x33a532[_0x521491];if(!_0x1a056c)throw CliErrors[_0x338fcd(0x1e5)]('Invalid\x20dataset\x20selection.');_0x55556a=_0x1a056c[_0x338fcd(0x225)],_0x55d321=undefined;}}}}const _0x514a2c=await listDatasets(_0x28cfe6[_0x338fcd(0x20e)]),_0x3a3dc6=_0x514a2c[_0x338fcd(0x20f)](_0x391dda=>_0x391dda[_0x338fcd(0x225)]===_0x55556a);if(!_0x3a3dc6)throw CliErrors[_0x338fcd(0x1e5)](_0x338fcd(0x236)+_0x55556a+_0x338fcd(0x246)+(_0x55d321?_0x338fcd(0x201)+CLI_BIN_NAME+_0x338fcd(0x1e8):''));_0x28be37=_0x3a3dc6['id'];const _0x50fc02=_0x55d321??_0x55556a,_0x3f959e=await listBffDatasetOperations(_0x28cfe6[_0x338fcd(0x20e)],_0x28be37),_0x4973ae=_0x3f959e?Object[_0x338fcd(0x1e7)](_0x3f959e):[];if(_0x4973ae[_0x338fcd(0x23d)]===0x0)throw CliErrors['validation'](_0x338fcd(0x248)+_0x50fc02+'.');let _0x13dc1c;const _0x48d6a2=_0x28cfe6['str'](_0x338fcd(0x204));if(_0x48d6a2){if(!_0x4973ae[_0x338fcd(0x211)](_0x48d6a2))throw CliErrors[_0x338fcd(0x1e5)]('Operation\x20type\x20\x22'+_0x48d6a2+_0x338fcd(0x20a)+_0x50fc02+'.\x20'+(_0x338fcd(0x23c)+_0x4973ae['join'](',\x20')));_0x13dc1c=_0x48d6a2;}else{if(_0x28cfe6[_0x338fcd(0x1f3)])throw CliErrors['validation']('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x4ec9bb=await promptSelect(_0x338fcd(0x223),_0x4973ae);_0x13dc1c=_0x4973ae[_0x4ec9bb]??_0x4973ae[0x0];}let _0x28a30d=normalizeHookFunctionNode(_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x22e)));if(!_0x28a30d){if(_0x28cfe6[_0x338fcd(0x1f5)](_0x338fcd(0x22e)))throw CliErrors['validation'](_0x338fcd(0x21e));if(_0x28cfe6[_0x338fcd(0x1f3)])throw CliErrors['validation'](_0x338fcd(0x24f));const _0xff9680=await promptSelect('Select\x20trigger\x20node:',[_0x338fcd(0x1ea),'after']);_0x28a30d=[_0x338fcd(0x1ea),'after'][_0xff9680]??'before';}return{'alias':_0x55d321,'datasetCode':_0x55556a,'datasetId':_0x28be37,'operationType':_0x13dc1c,'functionNode':_0x28a30d};}async function promptSelect(_0x4b79d5,_0x1d60d2){const _0x5d3b08=a37_0x54fa13;if(_0x1d60d2['length']===0x1)return 0x0;for(const [_0x589f32,_0x3edbce]of _0x1d60d2['entries']()){process[_0x5d3b08(0x202)][_0x5d3b08(0x228)]('\x20\x20'+(_0x589f32+0x1)+'.\x20'+_0x3edbce+'\x0a');}const _0x12d784=createInterface({'input':process[_0x5d3b08(0x250)],'output':process['stderr']});while(!![]){const _0x2d6e87=await new Promise(_0x2376eb=>{const _0x4c77f4=_0x5d3b08;_0x12d784[_0x4c77f4(0x21c)](_0x4b79d5+'\x20',_0x2376eb);}),_0x4b1f0e=Number[_0x5d3b08(0x23b)](_0x2d6e87['trim'](),0xa);if(Number[_0x5d3b08(0x22c)](_0x4b1f0e)&&_0x4b1f0e>=0x1&&_0x4b1f0e<=_0x1d60d2[_0x5d3b08(0x23d)])return _0x12d784[_0x5d3b08(0x232)](),_0x4b1f0e-0x1;process[_0x5d3b08(0x202)][_0x5d3b08(0x228)](_0x5d3b08(0x242)+_0x1d60d2[_0x5d3b08(0x23d)]+'.\x0a');}}function buildFilePath(_0x18bec5,_0x4e233c,_0x44ab6d,_0x287716){const _0x35812c=a37_0x54fa13;if(_0x4e233c==='HOOK'){if(!_0x287716)throw CliErrors[_0x35812c(0x1e5)](_0x35812c(0x234));const _0x139982=_0x287716[_0x35812c(0x214)]??_0x287716['datasetCode'];return join(_0x18bec5[_0x35812c(0x1f4)],_0x35812c(0x1fa),_0x139982,_0x287716[_0x35812c(0x20c)],_0x287716[_0x35812c(0x226)],_0x44ab6d+_0x35812c(0x1eb));}return join(_0x18bec5['scriptsRootDir'],_0x4e233c,_0x44ab6d+_0x35812c(0x1eb));}export function generateTemplate(_0x551226,_0x2fa378,_0x14b9b8,_0x17fc4a,_0x48553e){const _0x260b1b=a37_0x54fa13,_0x51e5a5=_0x17fc4a?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x318ba5=getAppBaseUrl(_0x14b9b8),_0x2f7d31=_0x260b1b(0x24b);if(_0x551226==='COMMON')return'/**\x0a\x20*\x20'+_0x51e5a5+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x2fa378+'\x0a\x20*\x20[平台配置]\x20'+_0x318ba5+_0x260b1b(0x23e)+_0x14b9b8+'/COMMON/'+_0x2fa378+'.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22'+_0x2fa378+_0x260b1b(0x1fb)+_0x2f7d31+_0x260b1b(0x1f0)+_0x2fa378+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x551226===_0x260b1b(0x20d))return _0x260b1b(0x22f)+_0x51e5a5+_0x260b1b(0x22a)+_0x2fa378+_0x260b1b(0x216)+_0x14b9b8+'/'+_0x2fa378+_0x260b1b(0x227)+_0x318ba5+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x14b9b8+_0x260b1b(0x24a)+_0x2fa378+'.js\x0a'+_0x2f7d31+_0x260b1b(0x1fd)+_0x2fa378+_0x260b1b(0x235);if(!_0x48553e)throw CliErrors[_0x260b1b(0x1e5)](_0x260b1b(0x1ec));const _0x3e4fa4=_0x48553e[_0x260b1b(0x214)]??_0x48553e[_0x260b1b(0x229)],_0xb0db35=_0x48553e[_0x260b1b(0x226)]===_0x260b1b(0x1ea)?'当前请求参数':_0x260b1b(0x1e9),_0x59e814=_0x48553e[_0x260b1b(0x226)]===_0x260b1b(0x1ea)?_0x260b1b(0x1f2):_0x260b1b(0x212);return _0x260b1b(0x22f)+_0x51e5a5+_0x260b1b(0x230)+_0x2fa378+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x14b9b8+'/'+_0x48553e['datasetCode']+'/'+_0x48553e['operationType']+_0x260b1b(0x227)+_0x318ba5+_0x260b1b(0x1ef)+_0x48553e['datasetId']+_0x260b1b(0x24e)+_0x14b9b8+_0x260b1b(0x240)+_0x3e4fa4+'/'+_0x48553e['operationType']+'/'+_0x48553e[_0x260b1b(0x226)]+'/'+_0x2fa378+'.js\x0a\x20*\x20[触发节点]\x20'+_0x48553e[_0x260b1b(0x226)]+'\x0a'+_0x2f7d31+_0x260b1b(0x231)+_0xb0db35+_0x260b1b(0x1ee)+_0x59e814+_0x260b1b(0x1ed)+_0x2fa378+_0x260b1b(0x235);}
@@ -1 +1 @@
1
- const a38_0x1628a0=a38_0xda2d;(function(_0x299363,_0x4e240a){const _0x2eba35=a38_0xda2d,_0x248d44=_0x299363();while(!![]){try{const _0x254dd5=parseInt(_0x2eba35(0x11d))/0x1+parseInt(_0x2eba35(0x139))/0x2*(-parseInt(_0x2eba35(0x119))/0x3)+parseInt(_0x2eba35(0x129))/0x4*(parseInt(_0x2eba35(0x11b))/0x5)+-parseInt(_0x2eba35(0x12a))/0x6+-parseInt(_0x2eba35(0x110))/0x7+parseInt(_0x2eba35(0x11e))/0x8+-parseInt(_0x2eba35(0x137))/0x9*(parseInt(_0x2eba35(0x126))/0xa);if(_0x254dd5===_0x4e240a)break;else _0x248d44['push'](_0x248d44['shift']());}catch(_0x56d1c8){_0x248d44['push'](_0x248d44['shift']());}}}(a38_0xd928,0x96634));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_0xd928(){const _0x48769a=['apps','scriptsRootDir','bff','str','/api/management/library/scripts/delete','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','Would\x20delete\x20','213qqQiuA','Backend\x20Function\x20lock\x20file\x20not\x20found.','45LJGols','trashDir','1214466Tzxgvg','6150832vLSovR','toISOString','remoteId','projectRoot','replace','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','includes','\x20\x20-\x20','2085910zlltUu','split','trashedTo','76324Yxofam','3842316sdVglX','string','scriptsRoot','parse','delete','high-risk-write','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','validation','Lock\x20scope\x20for\x20app\x20\x22','target','lastSync','Deleted\x20','length','9QCfieY','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','9890NFbeOD','Local\x20delete\x20not\x20settled\x20for\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','functions','<timestamp>','map','join','lockFilePath','Multiple\x20functions\x20match\x20\x22','2372923aOKlRZ','appCode'];a38_0xd928=function(){return _0x48769a;};return a38_0xd928();}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x1628a0(0x114),'command':a38_0x1628a0(0x12e),'description':a38_0x1628a0(0x130),'risk':a38_0x1628a0(0x12f),'flags':[{'name':a38_0x1628a0(0x133),'type':a38_0x1628a0(0x12b),'required':!![],'description':a38_0x1628a0(0x117)}],async 'validate'(_0x524d8d){const _0x4c6758=a38_0x1628a0,_0x321f43=loadBffProjectConfig(_0x524d8d[_0x4c6758(0x111)]),_0x411a83=await readBffLockFile(_0x321f43['lockFilePath']);if(!_0x411a83)throw CliErrors[_0x4c6758(0x131)](_0x4c6758(0x138));},async 'dryRun'(_0x3794c7){const _0x551110=a38_0x1628a0,_0x9bdc6b=loadBffProjectConfig(_0x3794c7[_0x551110(0x111)]),_0x326663=await readBffLockFile(_0x9bdc6b[_0x551110(0x10e)]);if(!_0x326663)throw CliErrors['validation'](_0x551110(0x11a));const {appLock:_0x5bbee5}=ensureLockScope(_0x326663,_0x3794c7['appCode'],_0x9bdc6b[_0x551110(0x12c)],_0x551110(0x12e)),_0x17a691=_0x3794c7[_0x551110(0x115)](_0x551110(0x133)),_0xd89d2e=Object['keys'](_0x5bbee5[_0x551110(0x13c)]),_0x265c18=resolveDeleteTarget(_0x17a691,_0xd89d2e),_0x34b4f9=_0x5bbee5[_0x551110(0x13c)][_0x265c18];if(!_0x34b4f9)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x265c18+'\x22.');const _0x60af0d=resolveLocalFilePathFromLockKey(_0x9bdc6b,_0x265c18),_0x46b841=relative(_0x9bdc6b['projectRoot'],_0x60af0d),_0x28bc51=join(_0x9bdc6b[_0x551110(0x11c)],_0x551110(0x13d),_0x46b841);return{'method':'POST','url':_0x551110(0x116),'body':{'appCode':_0x3794c7[_0x551110(0x111)],'target':_0x265c18,'remoteId':_0x34b4f9[_0x551110(0x120)],'localFilePath':_0x60af0d,'trashedPath':_0x28bc51},'description':_0x551110(0x118)+_0x265c18+_0x551110(0x13b)};},async 'execute'(_0x3ed1cf){const _0x14bc3b=a38_0x1628a0,_0x475702=loadBffProjectConfig(_0x3ed1cf[_0x14bc3b(0x111)]),_0x431b4e=await readBffLockFile(_0x475702['lockFilePath']);if(!_0x431b4e)throw CliErrors['validation'](_0x14bc3b(0x11a));const {lockData:_0x4e41e5,appLock:_0x23c76a}=ensureLockScope(_0x431b4e,_0x3ed1cf['appCode'],_0x475702['scriptsRoot'],_0x14bc3b(0x12e)),_0x22173=JSON[_0x14bc3b(0x12d)](JSON['stringify'](_0x4e41e5)),_0x7ff1ab=_0x22173[_0x14bc3b(0x112)][_0x3ed1cf[_0x14bc3b(0x111)]];if(!_0x7ff1ab)throw new Error(_0x14bc3b(0x132)+_0x3ed1cf[_0x14bc3b(0x111)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x10590d=_0x3ed1cf['str'](_0x14bc3b(0x133)),_0x308c93=Object['keys'](_0x7ff1ab[_0x14bc3b(0x13c)]),_0x334cdd=resolveDeleteTarget(_0x10590d,_0x308c93),_0x5657aa=_0x7ff1ab['functions'][_0x334cdd];if(!_0x5657aa)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x334cdd+'\x22.');await deleteBffScript(_0x5657aa[_0x14bc3b(0x120)]),delete _0x7ff1ab['functions'][_0x334cdd],_0x7ff1ab[_0x14bc3b(0x134)]=new Date()[_0x14bc3b(0x11f)](),await writeBffLockFile(_0x475702['lockFilePath'],_0x22173);const _0x18332c=resolveLocalFilePathFromLockKey(_0x475702,_0x334cdd);let _0x2a1673;await fileExists(_0x18332c)&&(_0x2a1673=await moveToTrash(_0x475702[_0x14bc3b(0x121)],_0x475702[_0x14bc3b(0x11c)],_0x18332c),await cleanupEmptyDirectories(dirname(_0x18332c),_0x475702[_0x14bc3b(0x113)]));await waitForDeleteSettlement(_0x475702[_0x14bc3b(0x10e)],_0x3ed1cf[_0x14bc3b(0x111)],_0x334cdd,_0x18332c),await sleep(0x96);const _0xe46af4={'deleted':_0x334cdd,'remoteId':_0x5657aa[_0x14bc3b(0x120)]};if(_0x2a1673)_0xe46af4[_0x14bc3b(0x128)]=_0x2a1673;return{'ok':!![],'data':_0xe46af4,'message':_0x14bc3b(0x135)+_0x334cdd+(_0x2a1673?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function a38_0xda2d(_0x401585,_0x32e9a0){_0x401585=_0x401585-0x10e;const _0xd9280e=a38_0xd928();let _0xda2d87=_0xd9280e[_0x401585];return _0xda2d87;}function resolveDeleteTarget(_0x564ab1,_0x597fee){const _0x411da2=a38_0x1628a0;if(_0x564ab1[_0x411da2(0x124)]('/')){const _0x581b1b=_0x597fee['find'](_0x59aa8b=>_0x59aa8b===_0x564ab1);if(!_0x581b1b)throw CliErrors[_0x411da2(0x131)]('Function\x20not\x20found:\x20'+_0x564ab1);return _0x581b1b;}const _0x5092ab=_0x597fee['filter'](_0x56575f=>_0x56575f[_0x411da2(0x127)]('/')['at'](-0x1)===_0x564ab1);if(_0x5092ab[_0x411da2(0x136)]===0x0)throw CliErrors[_0x411da2(0x131)]('Function\x20not\x20found:\x20'+_0x564ab1);if(_0x5092ab[_0x411da2(0x136)]>0x1)throw CliErrors[_0x411da2(0x131)](_0x411da2(0x10f)+_0x564ab1+_0x411da2(0x123)+_0x5092ab[_0x411da2(0x13e)](_0x210b24=>_0x411da2(0x125)+_0x210b24)[_0x411da2(0x13f)]('\x0a'));return _0x5092ab[0x0];}async function moveToTrash(_0x4057ac,_0x26da6c,_0x1ba5c4){const _0x3dfdac=a38_0x1628a0,_0x3896e6=new Date()['toISOString']()[_0x3dfdac(0x122)](/[:.]/g,'-'),_0x234b66=relative(_0x4057ac,_0x1ba5c4),_0x4ecae4=join(_0x26da6c,_0x3896e6,_0x234b66);return await mkdir(dirname(_0x4ecae4),{'recursive':!![]}),await rename(_0x1ba5c4,_0x4ecae4),_0x4ecae4;}async function cleanupEmptyDirectories(_0x5cad24,_0x4a0807){const _0x50cc12=a38_0x1628a0;let _0x243a0c=resolve(_0x5cad24);const _0x375479=resolve(_0x4a0807);while(_0x243a0c['startsWith'](''+_0x375479+sep)||_0x243a0c===_0x375479){if(_0x243a0c===_0x375479)return;try{const _0x35a060=await readdir(_0x243a0c);if(_0x35a060[_0x50cc12(0x136)]>0x0)return;await rmdir(_0x243a0c);}catch{return;}_0x243a0c=dirname(_0x243a0c);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x5a194e,_0x20ae2b,_0x21752b,_0x1a9f38){const _0x5a7070=a38_0x1628a0;for(let _0x31975a=0x0;_0x31975a<DELETE_SETTLE_RETRY_COUNT;_0x31975a+=0x1){const _0x2c07d8=await readBffLockFile(_0x5a194e),_0x2a3024=!!_0x2c07d8?.[_0x5a7070(0x112)]?.[_0x20ae2b]?.[_0x5a7070(0x13c)]?.[_0x21752b],_0x573ee2=await fileExists(_0x1a9f38);if(!_0x2a3024&&!_0x573ee2)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x5a7070(0x13a)+_0x21752b+'.');}
1
+ const a38_0x274d2=a38_0x3902;function a38_0x3902(_0x58a88f,_0x296a3e){_0x58a88f=_0x58a88f-0x14e;const _0x39a8c6=a38_0x39a8();let _0x390283=_0x39a8c6[_0x58a88f];return _0x390283;}(function(_0x1c4439,_0x3e62cc){const _0x317bd7=a38_0x3902,_0x205fce=_0x1c4439();while(!![]){try{const _0x446c90=-parseInt(_0x317bd7(0x153))/0x1*(-parseInt(_0x317bd7(0x14f))/0x2)+-parseInt(_0x317bd7(0x170))/0x3*(-parseInt(_0x317bd7(0x162))/0x4)+-parseInt(_0x317bd7(0x168))/0x5*(-parseInt(_0x317bd7(0x166))/0x6)+-parseInt(_0x317bd7(0x165))/0x7*(-parseInt(_0x317bd7(0x177))/0x8)+-parseInt(_0x317bd7(0x159))/0x9+-parseInt(_0x317bd7(0x161))/0xa+parseInt(_0x317bd7(0x154))/0xb;if(_0x446c90===_0x3e62cc)break;else _0x205fce['push'](_0x205fce['shift']());}catch(_0x404f8b){_0x205fce['push'](_0x205fce['shift']());}}}(a38_0x39a8,0x4033c));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';function a38_0x39a8(){const _0x51e1fc=['includes','5528NXniOf','Function\x20not\x20found:\x20','map','string','97xcjFeQ','5566539wNnFmh','length','high-risk-write','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','apps','4733487lJQPzY','projectRoot','parse','remoteId','lastSync','/api/management/library/scripts/delete','No\x20lock\x20entry\x20found\x20for\x20\x22','trashDir','2979310IqPEEg','20IYULTl','toISOString','startsWith','110089EdAnNg','4710FzhtLj','Backend\x20Function\x20lock\x20file\x20not\x20found.','655MrvLpP','scriptsRootDir','str','\x22\x20not\x20found\x20after\x20ensureLockScope.','lockFilePath','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','delete','validation','59859BbeWKl','bff','Would\x20delete\x20','split','\x20(local\x20file\x20moved\x20to\x20trash)','<timestamp>','scriptsRoot','56vurhTQ','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','appCode','keys','functions','target'];a38_0x39a8=function(){return _0x51e1fc;};return a38_0x39a8();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x274d2(0x171),'command':a38_0x274d2(0x16e),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a38_0x274d2(0x156),'flags':[{'name':a38_0x274d2(0x17c),'type':a38_0x274d2(0x152),'required':!![],'description':a38_0x274d2(0x178)}],async 'validate'(_0x2e2c2f){const _0x590168=a38_0x274d2,_0x83699b=loadBffProjectConfig(_0x2e2c2f[_0x590168(0x179)]),_0x5593cd=await readBffLockFile(_0x83699b[_0x590168(0x16c)]);if(!_0x5593cd)throw CliErrors[_0x590168(0x16f)]('Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x552314){const _0x537ab7=a38_0x274d2,_0x5a1940=loadBffProjectConfig(_0x552314['appCode']),_0x368f5b=await readBffLockFile(_0x5a1940[_0x537ab7(0x16c)]);if(!_0x368f5b)throw CliErrors['validation'](_0x537ab7(0x167));const {appLock:_0x19ede7}=ensureLockScope(_0x368f5b,_0x552314[_0x537ab7(0x179)],_0x5a1940[_0x537ab7(0x176)],'delete'),_0x519712=_0x552314[_0x537ab7(0x16a)](_0x537ab7(0x17c)),_0x5e376f=Object[_0x537ab7(0x17a)](_0x19ede7[_0x537ab7(0x17b)]),_0x280e4d=resolveDeleteTarget(_0x519712,_0x5e376f),_0x525aee=_0x19ede7[_0x537ab7(0x17b)][_0x280e4d];if(!_0x525aee)throw CliErrors[_0x537ab7(0x16f)](_0x537ab7(0x15f)+_0x280e4d+'\x22.');const _0x4ea489=resolveLocalFilePathFromLockKey(_0x5a1940,_0x280e4d),_0x5000d2=relative(_0x5a1940[_0x537ab7(0x15a)],_0x4ea489),_0x197aa0=join(_0x5a1940[_0x537ab7(0x160)],_0x537ab7(0x175),_0x5000d2);return{'method':'POST','url':_0x537ab7(0x15e),'body':{'appCode':_0x552314['appCode'],'target':_0x280e4d,'remoteId':_0x525aee['remoteId'],'localFilePath':_0x4ea489,'trashedPath':_0x197aa0},'description':_0x537ab7(0x172)+_0x280e4d+_0x537ab7(0x16d)};},async 'execute'(_0x45517d){const _0x567726=a38_0x274d2,_0x4dc779=loadBffProjectConfig(_0x45517d[_0x567726(0x179)]),_0x525a26=await readBffLockFile(_0x4dc779[_0x567726(0x16c)]);if(!_0x525a26)throw CliErrors['validation'](_0x567726(0x167));const {lockData:_0x312d3a,appLock:_0x55bfcc}=ensureLockScope(_0x525a26,_0x45517d[_0x567726(0x179)],_0x4dc779['scriptsRoot'],_0x567726(0x16e)),_0x5dbc79=JSON[_0x567726(0x15b)](JSON['stringify'](_0x312d3a)),_0x41f790=_0x5dbc79['apps'][_0x45517d[_0x567726(0x179)]];if(!_0x41f790)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x45517d[_0x567726(0x179)]+_0x567726(0x16b));const _0x377906=_0x45517d['str']('target'),_0x1a258f=Object['keys'](_0x41f790['functions']),_0x57e095=resolveDeleteTarget(_0x377906,_0x1a258f),_0x3c19df=_0x41f790[_0x567726(0x17b)][_0x57e095];if(!_0x3c19df)throw CliErrors[_0x567726(0x16f)](_0x567726(0x15f)+_0x57e095+'\x22.');await deleteBffScript(_0x3c19df[_0x567726(0x15c)]),delete _0x41f790['functions'][_0x57e095],_0x41f790[_0x567726(0x15d)]=new Date()[_0x567726(0x163)](),await writeBffLockFile(_0x4dc779[_0x567726(0x16c)],_0x5dbc79);const _0x251446=resolveLocalFilePathFromLockKey(_0x4dc779,_0x57e095);let _0x192642;await fileExists(_0x251446)&&(_0x192642=await moveToTrash(_0x4dc779[_0x567726(0x15a)],_0x4dc779[_0x567726(0x160)],_0x251446),await cleanupEmptyDirectories(dirname(_0x251446),_0x4dc779[_0x567726(0x169)]));await waitForDeleteSettlement(_0x4dc779[_0x567726(0x16c)],_0x45517d['appCode'],_0x57e095,_0x251446),await sleep(0x96);const _0x19f676={'deleted':_0x57e095,'remoteId':_0x3c19df['remoteId']};if(_0x192642)_0x19f676['trashedTo']=_0x192642;return{'ok':!![],'data':_0x19f676,'message':'Deleted\x20'+_0x57e095+(_0x192642?_0x567726(0x174):'')};}};function resolveDeleteTarget(_0x4afddf,_0x1a1f5d){const _0x148d30=a38_0x274d2;if(_0x4afddf[_0x148d30(0x14e)]('/')){const _0x100de7=_0x1a1f5d['find'](_0x4f14f9=>_0x4f14f9===_0x4afddf);if(!_0x100de7)throw CliErrors[_0x148d30(0x16f)](_0x148d30(0x150)+_0x4afddf);return _0x100de7;}const _0xef0c06=_0x1a1f5d['filter'](_0x384327=>_0x384327[_0x148d30(0x173)]('/')['at'](-0x1)===_0x4afddf);if(_0xef0c06['length']===0x0)throw CliErrors[_0x148d30(0x16f)]('Function\x20not\x20found:\x20'+_0x4afddf);if(_0xef0c06[_0x148d30(0x155)]>0x1)throw CliErrors[_0x148d30(0x16f)]('Multiple\x20functions\x20match\x20\x22'+_0x4afddf+_0x148d30(0x157)+_0xef0c06[_0x148d30(0x151)](_0x454eeb=>'\x20\x20-\x20'+_0x454eeb)['join']('\x0a'));return _0xef0c06[0x0];}async function moveToTrash(_0x1623a5,_0x431be4,_0x18ad4){const _0x552701=new Date()['toISOString']()['replace'](/[:.]/g,'-'),_0x3722f3=relative(_0x1623a5,_0x18ad4),_0x592743=join(_0x431be4,_0x552701,_0x3722f3);return await mkdir(dirname(_0x592743),{'recursive':!![]}),await rename(_0x18ad4,_0x592743),_0x592743;}async function cleanupEmptyDirectories(_0x3ffd51,_0x8f124e){const _0x2ca4bb=a38_0x274d2;let _0x343407=resolve(_0x3ffd51);const _0x2b21d2=resolve(_0x8f124e);while(_0x343407[_0x2ca4bb(0x164)](''+_0x2b21d2+sep)||_0x343407===_0x2b21d2){if(_0x343407===_0x2b21d2)return;try{const _0x29f4fd=await readdir(_0x343407);if(_0x29f4fd[_0x2ca4bb(0x155)]>0x0)return;await rmdir(_0x343407);}catch{return;}_0x343407=dirname(_0x343407);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x900c28,_0x3a2b7f,_0x11a225,_0x470f9c){const _0x15dca7=a38_0x274d2;for(let _0x4a2eef=0x0;_0x4a2eef<DELETE_SETTLE_RETRY_COUNT;_0x4a2eef+=0x1){const _0x4021c2=await readBffLockFile(_0x900c28),_0x26b5bc=!!_0x4021c2?.[_0x15dca7(0x158)]?.[_0x3a2b7f]?.[_0x15dca7(0x17b)]?.[_0x11a225],_0x13e1ff=await fileExists(_0x470f9c);if(!_0x26b5bc&&!_0x13e1ff)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x11a225+'.');}
@@ -1 +1 @@
1
- const a39_0x3ce64b=a39_0xbaf7;function a39_0x3c5c(){const _0x29b4a6=['createdTime','num','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','scriptType','functionName','(none)','7gNLLwF','detail','updatedTime','verbose','1668044QdeWeX','Script\x20ID','boolean','read','2232102NpYJrv','23155740GUNrYh','Return\x20full\x20raw\x20script\x20object','appCode','336869lvxviv','4TZaQAn','1968627VAOlei','number','scriptContent','3027470zmhxPW','updateUserName','108272gRQdPY'];a39_0x3c5c=function(){return _0x29b4a6;};return a39_0x3c5c();}function a39_0xbaf7(_0x40e4f6,_0x11d0ea){_0x40e4f6=_0x40e4f6-0x19f;const _0x3c5cef=a39_0x3c5c();let _0xbaf7ee=_0x3c5cef[_0x40e4f6];return _0xbaf7ee;}(function(_0x2f55ff,_0x44a881){const _0x18da56=a39_0xbaf7,_0xf33662=_0x2f55ff();while(!![]){try{const _0x386fed=parseInt(_0x18da56(0x1b0))/0x1+-parseInt(_0x18da56(0x1a8))/0x2+-parseInt(_0x18da56(0x1b2))/0x3*(parseInt(_0x18da56(0x1b1))/0x4)+-parseInt(_0x18da56(0x1b5))/0x5+-parseInt(_0x18da56(0x1ac))/0x6*(parseInt(_0x18da56(0x1a4))/0x7)+-parseInt(_0x18da56(0x1b7))/0x8+parseInt(_0x18da56(0x1ad))/0x9;if(_0x386fed===_0x44a881)break;else _0xf33662['push'](_0xf33662['shift']());}catch(_0x3cd7bd){_0xf33662['push'](_0xf33662['shift']());}}}(a39_0x3c5c,0x689a5));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a39_0x3ce64b(0x1a5),'description':a39_0x3ce64b(0x1a0),'risk':a39_0x3ce64b(0x1ab),'flags':[{'name':'id','type':a39_0x3ce64b(0x1b3),'required':!![],'description':a39_0x3ce64b(0x1a9)},{'name':a39_0x3ce64b(0x1a7),'type':a39_0x3ce64b(0x1aa),'description':a39_0x3ce64b(0x1ae)}],async 'execute'(_0x16531d){const _0x45d315=a39_0x3ce64b,_0x3df051=await getBffScriptInfo(_0x16531d[_0x45d315(0x19f)]('id')),_0x453442=_0x16531d['bool'](_0x45d315(0x1a7));if(_0x453442)return{'ok':!![],'data':_0x3df051};return{'ok':!![],'data':{'id':_0x3df051['id'],'functionName':_0x3df051[_0x45d315(0x1a2)]??'','version':_0x3df051['version']??'','updateUserName':_0x3df051[_0x45d315(0x1b6)]??'','appCode':_0x3df051[_0x45d315(0x1af)],'scriptType':_0x3df051[_0x45d315(0x1a1)],'description':_0x3df051['description']||_0x45d315(0x1a3),'createdTime':_0x3df051[_0x45d315(0x1b8)]??'','updatedTime':_0x3df051[_0x45d315(0x1a6)]??'','scriptContent':_0x3df051[_0x45d315(0x1b4)]??''}};}};
1
+ const a39_0x296e5f=a39_0x384e;(function(_0x1467b6,_0x16733f){const _0x4c671f=a39_0x384e,_0x513f11=_0x1467b6();while(!![]){try{const _0x45f108=-parseInt(_0x4c671f(0xc2))/0x1+parseInt(_0x4c671f(0xc3))/0x2*(parseInt(_0x4c671f(0xc9))/0x3)+-parseInt(_0x4c671f(0xd0))/0x4*(-parseInt(_0x4c671f(0xd2))/0x5)+parseInt(_0x4c671f(0xbd))/0x6*(parseInt(_0x4c671f(0xbe))/0x7)+-parseInt(_0x4c671f(0xce))/0x8*(-parseInt(_0x4c671f(0xbb))/0x9)+parseInt(_0x4c671f(0xc6))/0xa+-parseInt(_0x4c671f(0xcd))/0xb*(parseInt(_0x4c671f(0xd3))/0xc);if(_0x45f108===_0x16733f)break;else _0x513f11['push'](_0x513f11['shift']());}catch(_0x5ac3c9){_0x513f11['push'](_0x513f11['shift']());}}}(a39_0x47d8,0xef1ff));import{getBffScriptInfo}from'../../core/api-client.js';function a39_0x47d8(){const _0x310dd4=['scriptType','verbose','1760507SjYARL','84418iWhYvF','(none)','description','15921840rRumYl','detail','num','27PptKht','bool','bff','scriptContent','66xwKMBt','3365984Yvjqmd','createdTime','776WtTnmm','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','49470KRWhcO','4019076SfItgF','Script\x20ID','appCode','18WiTEML','read','99018thKRjG','7dvbZOq','number'];a39_0x47d8=function(){return _0x310dd4;};return a39_0x47d8();}function a39_0x384e(_0x405c55,_0x415de9){_0x405c55=_0x405c55-0xbb;const _0x47d85a=a39_0x47d8();let _0x384ee2=_0x47d85a[_0x405c55];return _0x384ee2;}export const bffDetail={'service':a39_0x296e5f(0xcb),'command':a39_0x296e5f(0xc7),'description':a39_0x296e5f(0xd1),'risk':a39_0x296e5f(0xbc),'flags':[{'name':'id','type':a39_0x296e5f(0xbf),'required':!![],'description':a39_0x296e5f(0xd4)},{'name':'verbose','type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x20855a){const _0x6a80e1=a39_0x296e5f,_0x24bbd7=await getBffScriptInfo(_0x20855a[_0x6a80e1(0xc8)]('id')),_0x4beb60=_0x20855a[_0x6a80e1(0xca)](_0x6a80e1(0xc1));if(_0x4beb60)return{'ok':!![],'data':_0x24bbd7};return{'ok':!![],'data':{'id':_0x24bbd7['id'],'functionName':_0x24bbd7['functionName']??'','version':_0x24bbd7['version']??'','updateUserName':_0x24bbd7['updateUserName']??'','appCode':_0x24bbd7[_0x6a80e1(0xd5)],'scriptType':_0x24bbd7[_0x6a80e1(0xc0)],'description':_0x24bbd7[_0x6a80e1(0xc5)]||_0x6a80e1(0xc4),'createdTime':_0x24bbd7[_0x6a80e1(0xcf)]??'','updatedTime':_0x24bbd7['updatedTime']??'','scriptContent':_0x24bbd7[_0x6a80e1(0xcc)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x1e6fab,_0x1db54e){const _0x38a636=a40_0x4e97,_0x135395=_0x1e6fab();while(!![]){try{const _0x2c4269=parseInt(_0x38a636(0xfc))/0x1*(-parseInt(_0x38a636(0x101))/0x2)+parseInt(_0x38a636(0xfe))/0x3+-parseInt(_0x38a636(0xfb))/0x4+-parseInt(_0x38a636(0x100))/0x5+-parseInt(_0x38a636(0xff))/0x6+-parseInt(_0x38a636(0xfa))/0x7+parseInt(_0x38a636(0xfd))/0x8;if(_0x2c4269===_0x1db54e)break;else _0x135395['push'](_0x135395['shift']());}catch(_0x558c2a){_0x135395['push'](_0x135395['shift']());}}}(a40_0x45ad,0x93b4a));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a40_0x4e97(_0x1ad6c1,_0x2b6996){_0x1ad6c1=_0x1ad6c1-0xfa;const _0x45adb2=a40_0x45ad();let _0x4e9715=_0x45adb2[_0x1ad6c1];return _0x4e9715;}import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a40_0x45ad(){const _0x51f9f1=['18862024KQZRBm','102672AtVSwC','497394otzQdx','2525600nWoQbY','218irqHMJ','1355193sXRBPG','547816HLaKpO','7967Hfozst'];a40_0x45ad=function(){return _0x51f9f1;};return a40_0x45ad();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x514ef3,_0x209c12){const _0xd8348d=a40_0x3092,_0x39d90b=_0x514ef3();while(!![]){try{const _0x462fb6=-parseInt(_0xd8348d(0x13e))/0x1*(parseInt(_0xd8348d(0x139))/0x2)+parseInt(_0xd8348d(0x13b))/0x3*(-parseInt(_0xd8348d(0x13a))/0x4)+parseInt(_0xd8348d(0x134))/0x5+parseInt(_0xd8348d(0x137))/0x6+-parseInt(_0xd8348d(0x138))/0x7+-parseInt(_0xd8348d(0x136))/0x8*(parseInt(_0xd8348d(0x13d))/0x9)+-parseInt(_0xd8348d(0x13c))/0xa*(-parseInt(_0xd8348d(0x135))/0xb);if(_0x462fb6===_0x209c12)break;else _0x39d90b['push'](_0x39d90b['shift']());}catch(_0x4343fa){_0x39d90b['push'](_0x39d90b['shift']());}}}(a40_0xebfc,0x284e2));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a40_0x3092(_0x4c3c6e,_0x4752fc){_0x4c3c6e=_0x4c3c6e-0x134;const _0xebfc94=a40_0xebfc();let _0x3092df=_0xebfc94[_0x4c3c6e];return _0x3092df;}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a40_0xebfc(){const _0x17d2c7=['21AnGmgX','640390BLACCP','558261DsysiC','5iZrJuf','1436025hUZDyp','55oYbJYX','8hPjSiB','874098ocFJHz','1298766bLIiyn','96878ihsZzV','56132iHfbZW'];a40_0xebfc=function(){return _0x17d2c7;};return a40_0xebfc();}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_0x28a77f=a41_0x48fa;(function(_0x79663b,_0x7d6fd8){const _0x5bca0d=a41_0x48fa,_0x57717e=_0x79663b();while(!![]){try{const _0xea9f94=-parseInt(_0x5bca0d(0x13e))/0x1*(parseInt(_0x5bca0d(0x14d))/0x2)+parseInt(_0x5bca0d(0x15a))/0x3*(-parseInt(_0x5bca0d(0x144))/0x4)+parseInt(_0x5bca0d(0x13f))/0x5+parseInt(_0x5bca0d(0x147))/0x6*(parseInt(_0x5bca0d(0x13c))/0x7)+-parseInt(_0x5bca0d(0x153))/0x8+parseInt(_0x5bca0d(0x155))/0x9*(-parseInt(_0x5bca0d(0x14b))/0xa)+parseInt(_0x5bca0d(0x13d))/0xb;if(_0xea9f94===_0x7d6fd8)break;else _0x57717e['push'](_0x57717e['shift']());}catch(_0x1a9d67){_0x57717e['push'](_0x57717e['shift']());}}}(a41_0x364b,0x4f269));function a41_0x48fa(_0x25a117,_0x41ba44){_0x25a117=_0x25a117-0x13c;const _0x364bde=a41_0x364b();let _0x48fa48=_0x364bde[_0x25a117];return _0x48fa48;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x28a77f(0x143),'command':'list','description':a41_0x28a77f(0x148),'risk':a41_0x28a77f(0x14a),'flags':[{'name':a41_0x28a77f(0x15b),'type':a41_0x28a77f(0x14e),'description':a41_0x28a77f(0x14f),'default':a41_0x28a77f(0x156),'enum':[a41_0x28a77f(0x156),a41_0x28a77f(0x14c)]},{'name':'name','type':a41_0x28a77f(0x14e),'description':a41_0x28a77f(0x141)},{'name':'verbose','type':'boolean','description':a41_0x28a77f(0x145)}],async 'execute'(_0x28a7c3){const _0x5daf9b=a41_0x28a77f,_0x32d6d5=await listBffScripts(_0x28a7c3[_0x5daf9b(0x150)],_0x28a7c3[_0x5daf9b(0x142)](_0x5daf9b(0x15b)),{'scriptName':_0x28a7c3[_0x5daf9b(0x142)](_0x5daf9b(0x152))||undefined}),_0x550cee=_0x28a7c3[_0x5daf9b(0x151)](_0x5daf9b(0x157));return{'ok':!![],'data':_0x550cee?_0x32d6d5:_0x32d6d5[_0x5daf9b(0x154)](_0x216e42=>({'id':_0x216e42['id'],'functionName':_0x216e42[_0x5daf9b(0x159)]??'','description':_0x216e42['description']||_0x5daf9b(0x158),'scriptType':_0x216e42[_0x5daf9b(0x146)]})),'message':_0x32d6d5[_0x5daf9b(0x140)]===0x0?_0x5daf9b(0x149):undefined};}};function a41_0x364b(){const _0x5d745b=['bff','33584fvwjeQ','Return\x20full\x20script\x20objects','scriptType','6fzOTUs','List\x20Backend\x20Function\x20scripts','No\x20Backend\x20Function\x20scripts\x20found.','read','270cYGCAr','COMMON','1828sEDACN','string','Script\x20type\x20filter','appCode','bool','name','4540544fAWYFE','map','98073KMWCye','ENDPOINT','verbose','(unnamed)','functionName','126nfqBbT','type','3987179YLuaCE','9131243HERTAi','169unpipD','1466880tScfBB','length','Filter\x20by\x20script\x20name','str'];a41_0x364b=function(){return _0x5d745b;};return a41_0x364b();}
1
+ function a41_0x3745(_0x128548,_0x342706){_0x128548=_0x128548-0xcc;const _0x73f3b2=a41_0x73f3();let _0x3745e5=_0x73f3b2[_0x128548];return _0x3745e5;}function a41_0x73f3(){const _0x5e3ddc=['appCode','type','verbose','2107062ZaakeH','str','200IKzUba','538TbsFPd','8329045uIGXMr','2102GxqKrp','boolean','List\x20Backend\x20Function\x20scripts','No\x20Backend\x20Function\x20scripts\x20found.','10875294mbDCjf','name','922936ufRqKC','Filter\x20by\x20script\x20name','Return\x20full\x20script\x20objects','list','map','590556LqcdhC','bff','COMMON','35MBIBde','functionName','length','(unnamed)','string','2531856nwPYMy'];a41_0x73f3=function(){return _0x5e3ddc;};return a41_0x73f3();}const a41_0x1ad7d3=a41_0x3745;(function(_0x49c4f5,_0x423b19){const _0x103cae=a41_0x3745,_0x463ac0=_0x49c4f5();while(!![]){try{const _0x594186=parseInt(_0x103cae(0xd1))/0x1*(parseInt(_0x103cae(0xd3))/0x2)+parseInt(_0x103cae(0xde))/0x3+-parseInt(_0x103cae(0xd9))/0x4+parseInt(_0x103cae(0xd2))/0x5+parseInt(_0x103cae(0xd7))/0x6+-parseInt(_0x103cae(0xe1))/0x7*(-parseInt(_0x103cae(0xe6))/0x8)+parseInt(_0x103cae(0xce))/0x9*(-parseInt(_0x103cae(0xd0))/0xa);if(_0x594186===_0x423b19)break;else _0x463ac0['push'](_0x463ac0['shift']());}catch(_0x4c330b){_0x463ac0['push'](_0x463ac0['shift']());}}}(a41_0x73f3,0xde28c));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x1ad7d3(0xdf),'command':a41_0x1ad7d3(0xdc),'description':a41_0x1ad7d3(0xd5),'risk':'read','flags':[{'name':a41_0x1ad7d3(0xcc),'type':a41_0x1ad7d3(0xe5),'description':'Script\x20type\x20filter','default':'ENDPOINT','enum':['ENDPOINT',a41_0x1ad7d3(0xe0)]},{'name':a41_0x1ad7d3(0xd8),'type':a41_0x1ad7d3(0xe5),'description':a41_0x1ad7d3(0xda)},{'name':'verbose','type':a41_0x1ad7d3(0xd4),'description':a41_0x1ad7d3(0xdb)}],async 'execute'(_0x4f3c1c){const _0x4c9fcf=a41_0x1ad7d3,_0x4597da=await listBffScripts(_0x4f3c1c[_0x4c9fcf(0xe7)],_0x4f3c1c['str'](_0x4c9fcf(0xcc)),{'scriptName':_0x4f3c1c[_0x4c9fcf(0xcf)]('name')||undefined}),_0x3c2644=_0x4f3c1c['bool'](_0x4c9fcf(0xcd));return{'ok':!![],'data':_0x3c2644?_0x4597da:_0x4597da[_0x4c9fcf(0xdd)](_0x24ec38=>({'id':_0x24ec38['id'],'functionName':_0x24ec38[_0x4c9fcf(0xe2)]??'','description':_0x24ec38['description']||_0x4c9fcf(0xe4),'scriptType':_0x24ec38['scriptType']})),'message':_0x4597da[_0x4c9fcf(0xe3)]===0x0?_0x4c9fcf(0xd6):undefined};}};
@@ -1 +1 @@
1
- const a42_0x3f649b=a42_0x48d6;(function(_0x2fe34c,_0x115d5f){const _0x52ad37=a42_0x48d6,_0xe588b8=_0x2fe34c();while(!![]){try{const _0x3fe11a=parseInt(_0x52ad37(0x1b2))/0x1+-parseInt(_0x52ad37(0x1a7))/0x2*(-parseInt(_0x52ad37(0x1b5))/0x3)+parseInt(_0x52ad37(0x1b3))/0x4+parseInt(_0x52ad37(0x1c5))/0x5*(-parseInt(_0x52ad37(0x1c7))/0x6)+-parseInt(_0x52ad37(0x19f))/0x7+-parseInt(_0x52ad37(0x1b7))/0x8*(parseInt(_0x52ad37(0x19e))/0x9)+parseInt(_0x52ad37(0x1b6))/0xa;if(_0x3fe11a===_0x115d5f)break;else _0xe588b8['push'](_0xe588b8['shift']());}catch(_0x21461f){_0xe588b8['push'](_0xe588b8['shift']());}}}(a42_0x2ebb,0xb0120));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x48d6(_0xf9a73a,_0x598b6e){_0xf9a73a=_0xf9a73a-0x19d;const _0x2ebbae=a42_0x2ebb();let _0x48d624=_0x2ebbae[_0xf9a73a];return _0x48d624;}function a42_0x2ebb(){const _0x237283=['length','6kyjrnm','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','flag','number','225WZPcry','5302689POONDM','--start-time','bff','validation','DEBUG','logs','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','since','364912BQlCwc','--since','str','level','Found\x20','toUpperCase','--end-time','Maximum\x20log\x20lines\x20to\x20return\x20(1-','isSafeInteger','appCode','start-time','713062cclFsh','108628KHDYtb','\x20must\x20be\x20a\x20positive\x20integer.','3yardUa','25372720MbbEqJ','440488KyfRtx','INFO','\x20Backend\x20Function\x20log\x20line(s).','end-time','string','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','Filter\x20by\x20log\x20level','num','trim','read','keyword','now','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','--limit\x20must\x20be\x20between\x201\x20and\x20','3023555AaOdlu'];a42_0x2ebb=function(){return _0x237283;};return a42_0x2ebb();}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_0x3f649b(0x1a3),a42_0x3f649b(0x1b8),'WARN','ERROR'];export function resolveBffLogQuery(_0x23c52c,_0x1d9eb9=Date[a42_0x3f649b(0x1c2)]()){const _0xd508d2=a42_0x3f649b,_0x16454b=_0x23c52c['flag'](_0xd508d2(0x1a6)),_0x45fe1b=_0x23c52c['flag']('start-time'),_0x2443aa=_0x23c52c[_0xd508d2(0x1c9)](_0xd508d2(0x1ba));if(_0x16454b!==undefined&&_0x45fe1b!==undefined)throw CliErrors['validation']('--since\x20cannot\x20be\x20combined\x20with\x20--start-time.');const _0x11afe3=_0x2443aa===undefined?_0x1d9eb9:readPositiveInteger(_0x23c52c[_0xd508d2(0x1be)](_0xd508d2(0x1ba)),_0xd508d2(0x1ad)),_0x4bf482=_0x45fe1b===undefined?_0x11afe3-readSinceMinutes(_0x23c52c)*0xea60:readPositiveInteger(_0x23c52c[_0xd508d2(0x1be)](_0xd508d2(0x1b1)),_0xd508d2(0x1a0));if(_0x4bf482<=0x0)throw CliErrors[_0xd508d2(0x1a2)]('The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.');if(_0x4bf482>_0x11afe3)throw CliErrors[_0xd508d2(0x1a2)]('--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.');const _0xbbc05a=readPositiveInteger(_0x23c52c[_0xd508d2(0x1be)]('limit',DEFAULT_LIMIT),'--limit');if(_0xbbc05a>MAX_LIMIT)throw CliErrors[_0xd508d2(0x1a2)](_0xd508d2(0x1c4)+MAX_LIMIT+'.');const _0x3536c5=_0x23c52c['str'](_0xd508d2(0x1aa))[_0xd508d2(0x1bf)]()[_0xd508d2(0x1ac)]()||undefined,_0x2ece7b=_0x23c52c[_0xd508d2(0x1a9)](_0xd508d2(0x1c1))['trim']()||undefined;return{'appCode':_0x23c52c[_0xd508d2(0x1b0)],'startTime':_0x4bf482,'endTime':_0x11afe3,..._0x45fe1b===undefined?{'sinceMinutes':readSinceMinutes(_0x23c52c)}:{},..._0x3536c5?{'level':_0x3536c5}:{},..._0x2ece7b?{'keyword':_0x2ece7b}:{},'limit':_0xbbc05a};}function readSinceMinutes(_0xcc12ba){const _0x51e461=a42_0x3f649b;return readPositiveInteger(_0xcc12ba['num'](_0x51e461(0x1a6),DEFAULT_SINCE_MINUTES),_0x51e461(0x1a8));}function readPositiveInteger(_0x176f38,_0x5ce923){const _0x4c9635=a42_0x3f649b;if(!Number[_0x4c9635(0x1af)](_0x176f38)||_0x176f38<=0x0)throw CliErrors[_0x4c9635(0x1a2)](_0x5ce923+_0x4c9635(0x1b4));return _0x176f38;}export const bffLogs={'service':a42_0x3f649b(0x1a1),'command':a42_0x3f649b(0x1a4),'description':a42_0x3f649b(0x1a5),'risk':a42_0x3f649b(0x1c0),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x3f649b(0x1a6),'type':a42_0x3f649b(0x19d),'description':a42_0x3f649b(0x1c3)+DEFAULT_SINCE_MINUTES+')'},{'name':'start-time','type':a42_0x3f649b(0x19d),'description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':a42_0x3f649b(0x1ba),'type':a42_0x3f649b(0x19d),'description':a42_0x3f649b(0x1bc)},{'name':'level','type':a42_0x3f649b(0x1bb),'description':a42_0x3f649b(0x1bd),'enum':LOG_LEVELS},{'name':a42_0x3f649b(0x1c1),'type':a42_0x3f649b(0x1bb),'description':'Filter\x20formatted\x20log\x20lines\x20by\x20keyword'},{'name':'limit','type':a42_0x3f649b(0x19d),'description':a42_0x3f649b(0x1ae)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x93c784){resolveBffLogQuery(_0x93c784);},async 'execute'(_0x17a210){const _0x19c7cb=a42_0x3f649b,_0x542b9e=resolveBffLogQuery(_0x17a210),{sinceMinutes:_0x5f2d45,..._0x3482a2}=_0x542b9e,_0x7b64b8=await searchBffScriptLogs(_0x3482a2);return{'ok':!![],'data':{'query':_0x542b9e,'count':_0x7b64b8[_0x19c7cb(0x1c6)],'logs':_0x7b64b8},'message':_0x7b64b8[_0x19c7cb(0x1c6)]===0x0?_0x19c7cb(0x1c8):_0x19c7cb(0x1ab)+_0x7b64b8[_0x19c7cb(0x1c6)]+_0x19c7cb(0x1b9)};}};
1
+ const a42_0x2e2da7=a42_0xb08e;(function(_0x394425,_0x454458){const _0x2e7c8c=a42_0xb08e,_0x524e71=_0x394425();while(!![]){try{const _0xf335f4=-parseInt(_0x2e7c8c(0x115))/0x1*(parseInt(_0x2e7c8c(0x102))/0x2)+parseInt(_0x2e7c8c(0x104))/0x3+parseInt(_0x2e7c8c(0x109))/0x4+-parseInt(_0x2e7c8c(0xf9))/0x5*(-parseInt(_0x2e7c8c(0x117))/0x6)+-parseInt(_0x2e7c8c(0x10e))/0x7*(parseInt(_0x2e7c8c(0xf6))/0x8)+-parseInt(_0x2e7c8c(0xfa))/0x9*(-parseInt(_0x2e7c8c(0x101))/0xa)+parseInt(_0x2e7c8c(0x10d))/0xb*(parseInt(_0x2e7c8c(0x116))/0xc);if(_0xf335f4===_0x454458)break;else _0x524e71['push'](_0x524e71['shift']());}catch(_0x1918ac){_0x524e71['push'](_0x524e71['shift']());}}}(a42_0x11c5,0x6cd39));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x11c5(){const _0x5356dd=['--end-time','str','1VxLxnf','828HaKUnU','12lsYysn','logs','now','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','since','Found\x20','INFO','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','limit','trim','376MCFTra','level','string','1400635hoIwAf','1320993sTZBSP','--since','keyword','Maximum\x20log\x20lines\x20to\x20return\x20(1-','length','ERROR','read','10diLpve','1446674svRTWN','validation','991968HfKvfN','end-time','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','num','DEBUG','1560452KnWceV','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','--limit\x20must\x20be\x20between\x201\x20and\x20','99253blyCAo','131257pehSpv','isSafeInteger','number','start-time','--limit'];a42_0x11c5=function(){return _0x5356dd;};return a42_0x11c5();}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_0x2e2da7(0x108),a42_0x2e2da7(0xf2),'WARN',a42_0x2e2da7(0xff)];export function resolveBffLogQuery(_0x519f53,_0x1be05e=Date[a42_0x2e2da7(0xed)]()){const _0x15da26=a42_0x2e2da7,_0x370c41=_0x519f53['flag'](_0x15da26(0xf0)),_0x30b496=_0x519f53['flag']('start-time'),_0x147d3a=_0x519f53['flag'](_0x15da26(0x105));if(_0x370c41!==undefined&&_0x30b496!==undefined)throw CliErrors[_0x15da26(0x103)](_0x15da26(0xf3));const _0x3fff09=_0x147d3a===undefined?_0x1be05e:readPositiveInteger(_0x519f53['num'](_0x15da26(0x105)),_0x15da26(0x113)),_0x1cf7c0=_0x30b496===undefined?_0x3fff09-readSinceMinutes(_0x519f53)*0xea60:readPositiveInteger(_0x519f53[_0x15da26(0x107)](_0x15da26(0x111)),'--start-time');if(_0x1cf7c0<=0x0)throw CliErrors['validation'](_0x15da26(0xef));if(_0x1cf7c0>_0x3fff09)throw CliErrors['validation'](_0x15da26(0xee));const _0x23604f=readPositiveInteger(_0x519f53[_0x15da26(0x107)](_0x15da26(0xf4),DEFAULT_LIMIT),_0x15da26(0x112));if(_0x23604f>MAX_LIMIT)throw CliErrors[_0x15da26(0x103)](_0x15da26(0x10c)+MAX_LIMIT+'.');const _0x2a7102=_0x519f53[_0x15da26(0x114)](_0x15da26(0xf7))[_0x15da26(0xf5)]()['toUpperCase']()||undefined,_0x27a7ec=_0x519f53[_0x15da26(0x114)](_0x15da26(0xfc))[_0x15da26(0xf5)]()||undefined;return{'appCode':_0x519f53['appCode'],'startTime':_0x1cf7c0,'endTime':_0x3fff09,..._0x30b496===undefined?{'sinceMinutes':readSinceMinutes(_0x519f53)}:{},..._0x2a7102?{'level':_0x2a7102}:{},..._0x27a7ec?{'keyword':_0x27a7ec}:{},'limit':_0x23604f};}function a42_0xb08e(_0x4cbe7e,_0x3d3cc8){_0x4cbe7e=_0x4cbe7e-0xed;const _0x11c529=a42_0x11c5();let _0xb08e0c=_0x11c529[_0x4cbe7e];return _0xb08e0c;}function readSinceMinutes(_0x4b045e){const _0x52f630=a42_0x2e2da7;return readPositiveInteger(_0x4b045e[_0x52f630(0x107)](_0x52f630(0xf0),DEFAULT_SINCE_MINUTES),_0x52f630(0xfb));}function readPositiveInteger(_0x191081,_0x1363ef){const _0x4871ea=a42_0x2e2da7;if(!Number[_0x4871ea(0x10f)](_0x191081)||_0x191081<=0x0)throw CliErrors[_0x4871ea(0x103)](_0x1363ef+'\x20must\x20be\x20a\x20positive\x20integer.');return _0x191081;}export const bffLogs={'service':'bff','command':a42_0x2e2da7(0x118),'description':a42_0x2e2da7(0x10b),'risk':a42_0x2e2da7(0x100),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x2e2da7(0xf0),'type':a42_0x2e2da7(0x110),'description':'Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20'+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x2e2da7(0x111),'type':a42_0x2e2da7(0x110),'description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':'end-time','type':'number','description':a42_0x2e2da7(0x10a)},{'name':a42_0x2e2da7(0xf7),'type':a42_0x2e2da7(0xf8),'description':'Filter\x20by\x20log\x20level','enum':LOG_LEVELS},{'name':a42_0x2e2da7(0xfc),'type':a42_0x2e2da7(0xf8),'description':'Filter\x20formatted\x20log\x20lines\x20by\x20keyword'},{'name':'limit','type':a42_0x2e2da7(0x110),'description':a42_0x2e2da7(0xfd)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x3e85df){resolveBffLogQuery(_0x3e85df);},async 'execute'(_0x2df56f){const _0x1a3111=a42_0x2e2da7,_0x30d566=resolveBffLogQuery(_0x2df56f),{sinceMinutes:_0x2868b5,..._0x275348}=_0x30d566,_0x72bccb=await searchBffScriptLogs(_0x275348);return{'ok':!![],'data':{'query':_0x30d566,'count':_0x72bccb['length'],'logs':_0x72bccb},'message':_0x72bccb[_0x1a3111(0xfe)]===0x0?_0x1a3111(0x106):_0x1a3111(0xf1)+_0x72bccb[_0x1a3111(0xfe)]+'\x20Backend\x20Function\x20log\x20line(s).'};}};
@@ -1 +1 @@
1
- const a43_0x15d1eb=a43_0x25d6;(function(_0x4a6172,_0x4efe1c){const _0xbc6226=a43_0x25d6,_0x6b1862=_0x4a6172();while(!![]){try{const _0x1fb7cd=-parseInt(_0xbc6226(0x8c))/0x1+parseInt(_0xbc6226(0xa4))/0x2+parseInt(_0xbc6226(0xbf))/0x3+-parseInt(_0xbc6226(0x96))/0x4*(parseInt(_0xbc6226(0xc4))/0x5)+-parseInt(_0xbc6226(0x8a))/0x6+parseInt(_0xbc6226(0x108))/0x7*(-parseInt(_0xbc6226(0xb5))/0x8)+parseInt(_0xbc6226(0xdc))/0x9;if(_0x1fb7cd===_0x4efe1c)break;else _0x6b1862['push'](_0x6b1862['shift']());}catch(_0x2994d0){_0x6b1862['push'](_0x6b1862['shift']());}}}(a43_0x3b53,0xd6e45));import{createInterface}from'node:readline';import{readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{randomUUID}from'node:crypto';function a43_0x3b53(){const _0x56a01b=['conflict','\x22\x20from\x20the\x20lock\x20file.','/api/management/library/scripts/list?appCode=','Force\x20overwrite\x20local\x20unsynced\x20changes','Remote\x20script\x20missing\x20id.','set','mergedCli','Lock\x20scope\x20for\x20app\x20\x22','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','2639232UyLTvQ','string','801516FtwhMl','newLockKey','require','toLowerCase','rollback','&currentPage=1&pageSize=','lockFilePath','Could\x20not\x20restore\x20local\x20script\x20\x22','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','oldDirectoryPath','1316FEHNzE','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','\x20skipped','scriptsRoot','cancelled','oldLockKey','utf8','content','HOOK/','oldDirectory','.hook-directory-migrate-','map','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','functionNode','2505890FYpkIT','write','lastSync','\x22:\x20','validation','unresolvable\x20target\x20path','currentApp','hash','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','\x22\x20from\x20\x22','hookLocation','newDirectory','existed','HOOK','defaultApp','all','24aWKWPG','filter','\x20pulled','Pull\x20complete:\x20','split','stdin','Remote\x20script\x20missing\x20content.','\x20--format\x20compress','sourceFilePathByNewLockKey','entry','1400544JTccrQ','code','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','18185vPZgKN','join','requires','NFC','mode','bool','bff','rekey','remoteId','\x22\x20may\x20remain.','pull','functions','toISOString','COMMON','appCode','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','newDirectoryPath','has','ino','push_local','keyChanges','move','close','ENDPOINT','26664372PquotQ','alias','\x22:\x20its\x20target\x20\x22','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','get','reverse','\x22\x20and\x20\x22','&type=','message','\x22\x20to\x20\x22','apiDir','Failed\x20to\x20write\x20local\x20script\x20\x22','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','length','\x20failed','sourceDirectoryPathByNewDirectory','question','functionName','\x20resolution','GET','\x20conflict','datasetCode','projectedFunctions','delete','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.','Would\x20inspect\x20','filePath','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','operationType','stringify','scriptsRootDir','push','entries','yes','ENOENT','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','some','read','type','nonInteractive','force','\x20bff\x20push\x20--type\x20','includes','3183467AsyJii','flatMap','scriptType','\x22\x20not\x20found\x20after\x20ensureLockScope.','lockKey','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','parse','selectedAppName','migrations','str','\x22:\x20both\x20target\x20\x22','scriptContent','case-rename','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','stderr','apps','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','would_pull','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','dev'];a43_0x3b53=function(){return _0x56a01b;};return a43_0x3b53();}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';function a43_0x25d6(_0x4de7f8,_0x13a8d0){_0x4de7f8=_0x4de7f8-0x83;const _0x3b53f2=a43_0x3b53();let _0x25d63e=_0x3b53f2[_0x4de7f8];return _0x25d63e;}import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':a43_0x15d1eb(0xca),'command':a43_0x15d1eb(0xce),'description':a43_0x15d1eb(0x89),'risk':a43_0x15d1eb(0x102),'structuredErrors':!![],'flags':[{'name':a43_0x15d1eb(0x103),'type':a43_0x15d1eb(0x8b),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a43_0x15d1eb(0xd1),a43_0x15d1eb(0xdb),a43_0x15d1eb(0xb2)]},{'name':'force','type':'boolean','description':a43_0x15d1eb(0x84)}],async 'dryRun'(_0x4815f8){const _0x7dc967=a43_0x15d1eb,_0x4d6a85=loadBffProjectConfig(_0x4815f8['appCode']),_0x34138e=await readBffLockFile(_0x4d6a85[_0x7dc967(0x92)]),{appLock:_0x242ec1}=ensureLockScope(_0x34138e??createEmptyBffLock(),_0x4815f8[_0x7dc967(0xd2)],_0x4d6a85[_0x7dc967(0x99)],_0x7dc967(0xce)),_0x1ed462=normalizeBffType(_0x4815f8[_0x7dc967(0x111)](_0x7dc967(0x103)))??undefined,[_0x5259c2,_0x378421]=await Promise[_0x7dc967(0xb4)]([listBffScripts(_0x4815f8[_0x7dc967(0xd2)],_0x1ed462),getBffScriptStatistics(_0x4815f8[_0x7dc967(0xd2)])]),_0xd3e1ec=_0x5259c2[_0x7dc967(0x101)](_0x2bb431=>normalizeBffType(_0x2bb431[_0x7dc967(0x10a)])===_0x7dc967(0xb2)),_0x22b051=_0xd3e1ec?buildDatasetCodeToAliasMap(_0x4815f8[_0x7dc967(0xe6)],_0x4815f8['appCode'],_0x4815f8[_0x7dc967(0x10f)]||_0x4815f8['mergedCli']?.[_0x7dc967(0xaa)]||_0x4815f8['mergedCli']?.[_0x7dc967(0xb3)]):new Map(),_0x1ad380=_0xd3e1ec?await planHookDirectoryMigration(_0x4d6a85,_0x242ec1,_0x22b051,await scanLocalBffFunctions(_0x4d6a85,'HOOK')):undefined,_0x1bb6fb=createHookLocationMap(_0x378421),_0x59db8e=[];for(const _0x24fcfd of _0x5259c2){const _0x5df754=resolveRemoteScriptTarget(_0x4d6a85,_0x24fcfd,_0x1bb6fb,_0x1ad380?.[_0x7dc967(0xf2)]??_0x242ec1[_0x7dc967(0xcf)],_0x22b051);if(!_0x5df754){_0x59db8e['push']({'scriptType':_0x24fcfd[_0x7dc967(0x10a)],'functionName':_0x24fcfd['functionName']??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x5ee64f=(_0x1ad380?.[_0x7dc967(0xf2)]??_0x242ec1[_0x7dc967(0xcf)])[_0x5df754['lockKey']],_0x50757a=_0x24fcfd['scriptContent']!=null?computeContentHash(_0x24fcfd[_0x7dc967(0x113)]):undefined,_0xd71a17=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x1ad380,_0x5df754)??_0x5df754[_0x7dc967(0xf6)],_0x5ee64f,_0x50757a),_0x44eee5=_0xd71a17?localUnsyncedConflict(_0x5df754,_0x24fcfd['id']):undefined;_0x59db8e[_0x7dc967(0xfb)]({'lockKey':_0x5df754[_0x7dc967(0x10c)],'filePath':_0x5df754[_0x7dc967(0xf6)],'remoteId':_0x24fcfd['id']??null,'status':_0x44eee5?_0x7dc967(0x11d):_0x7dc967(0x11a),..._0x44eee5?{'conflict':_0x44eee5}:{},..._0x5df754['hookLocation']?{'alias':_0x5df754[_0x7dc967(0xaf)][_0x7dc967(0xdd)]??null,'datasetCode':_0x5df754[_0x7dc967(0xaf)]['datasetCode'],'operationType':_0x5df754[_0x7dc967(0xaf)][_0x7dc967(0xf8)],'functionNode':_0x5df754[_0x7dc967(0xaf)][_0x7dc967(0xa3)]}:{}});}return{'method':_0x7dc967(0xef),'url':_0x7dc967(0x83)+_0x4815f8[_0x7dc967(0xd2)]+(_0x1ed462?_0x7dc967(0xe3)+_0x1ed462:'')+_0x7dc967(0x91)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x4815f8[_0x7dc967(0xd2)],'filterType':_0x1ed462??null,..._0x1ad380&&_0x1ad380[_0x7dc967(0x110)][_0x7dc967(0xe9)]>0x0?{'hookDirectoryMigrations':_0x1ad380[_0x7dc967(0x110)][_0x7dc967(0xa1)](_0x5c361f=>({'from':_0x5c361f[_0x7dc967(0x9f)],'to':_0x5c361f[_0x7dc967(0xb0)]}))}:{},'files':_0x59db8e},'description':_0x7dc967(0xf5)+_0x59db8e[_0x7dc967(0xe9)]+_0x7dc967(0xad)};},async 'execute'(_0x4b65b7){const _0x45296e=a43_0x15d1eb,_0x1145b6=loadBffProjectConfig(_0x4b65b7[_0x45296e(0xd2)]),_0x390a44=await readBffLockFile(_0x1145b6[_0x45296e(0x92)]),{lockData:_0x38f8c3,appLock:_0x2d7676}=ensureLockScope(_0x390a44??createEmptyBffLock(),_0x4b65b7[_0x45296e(0xd2)],_0x1145b6['scriptsRoot'],_0x45296e(0xce)),_0x532f5d=normalizeBffType(_0x4b65b7[_0x45296e(0x111)](_0x45296e(0x103)))??undefined;if(_0x4b65b7[_0x45296e(0x111)](_0x45296e(0x103))&&!_0x532f5d)throw CliErrors[_0x45296e(0xa8)](_0x45296e(0x100));const [_0x1b5925,_0x245ba6]=await Promise['all']([listBffScripts(_0x4b65b7['appCode'],_0x532f5d),getBffScriptStatistics(_0x4b65b7['appCode'])]);if(_0x1b5925[_0x45296e(0xe9)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x45296e(0xf7)};const _0x1bf238=_0x4b65b7[_0x45296e(0xc9)](_0x45296e(0x105));if(_0x1bf238&&!_0x4b65b7[_0x45296e(0x104)]){const _0x12241b=await confirmForce();if(!_0x12241b)throw CliErrors[_0x45296e(0x9a)]('Force\x20pull\x20cancelled.');}if(_0x1bf238&&_0x4b65b7[_0x45296e(0x104)]){}const _0x4489e1=_0x1b5925[_0x45296e(0x101)](_0xa14946=>normalizeBffType(_0xa14946[_0x45296e(0x10a)])===_0x45296e(0xb2)),_0x20cedd=_0x4489e1?buildDatasetCodeToAliasMap(_0x4b65b7[_0x45296e(0xe6)],_0x4b65b7[_0x45296e(0xd2)],_0x4b65b7['selectedAppName']||_0x4b65b7[_0x45296e(0x87)]?.['currentApp']||_0x4b65b7[_0x45296e(0x87)]?.[_0x45296e(0xb3)]):new Map(),_0x3f31cc=createHookLocationMap(_0x245ba6),_0x2ec079=JSON[_0x45296e(0x10e)](JSON[_0x45296e(0xf9)](_0x38f8c3)),_0x1d4b25=_0x4b65b7['appCode'],_0x5129fc=_0x2ec079[_0x45296e(0x118)][_0x1d4b25];if(!_0x5129fc)throw new Error(_0x45296e(0x88)+_0x1d4b25+_0x45296e(0x10b));const _0x5e8b69=_0x4489e1?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x1145b6,_0x5129fc,_0x20cedd,await scanLocalBffFunctions(_0x1145b6,_0x45296e(0xb2))),_0x5129fc):undefined,_0x4890c3=createPullFileTransaction(),_0x45d29b=[],_0x354e2b=[],_0x3491c9=[],_0x453173=[];for(const _0x1ce597 of _0x1b5925){const _0x4fc4b6=resolveRemoteScriptTarget(_0x1145b6,_0x1ce597,_0x3f31cc,_0x5129fc['functions'],_0x20cedd);if(!_0x4fc4b6){_0x354e2b['push']({'lockKey':_0x1ce597[_0x45296e(0x10a)]+'/'+_0x1ce597[_0x45296e(0xed)],'reason':_0x45296e(0xa9)});continue;}const _0x54ce6a=_0x5129fc[_0x45296e(0xcf)][_0x4fc4b6[_0x45296e(0x10c)]];try{if(!_0x1ce597['id'])throw new Error(_0x45296e(0x85));if(_0x1ce597[_0x45296e(0x113)]==null)throw new Error(_0x45296e(0xbb));const _0x25d083=_0x1ce597[_0x45296e(0x113)],_0x3689f7=computeContentHash(_0x25d083);if(!_0x1bf238){const _0x5135aa=await hasUnsyncedLocalChanges(_0x4fc4b6[_0x45296e(0xf6)],_0x54ce6a,_0x3689f7);if(_0x5135aa){_0x3491c9['push'](localUnsyncedConflict(_0x4fc4b6,_0x1ce597['id']));continue;}}await _0x4890c3[_0x45296e(0xa5)](_0x4fc4b6[_0x45296e(0xf6)],_0x25d083);const _0x586d95={'hash':_0x3689f7,'remoteId':_0x1ce597['id'],'version':_0x1ce597['version']};_0x4fc4b6[_0x45296e(0x103)]==='HOOK'&&_0x4fc4b6[_0x45296e(0xaf)]&&(_0x586d95[_0x45296e(0xdd)]=_0x4fc4b6[_0x45296e(0xaf)]['alias'],_0x586d95[_0x45296e(0xf1)]=_0x4fc4b6[_0x45296e(0xaf)][_0x45296e(0xf1)],_0x586d95['operationType']=_0x4fc4b6[_0x45296e(0xaf)][_0x45296e(0xf8)],_0x586d95[_0x45296e(0xa3)]=_0x4fc4b6[_0x45296e(0xaf)][_0x45296e(0xa3)]),_0x5129fc[_0x45296e(0xcf)][_0x4fc4b6['lockKey']]=_0x586d95,_0x45d29b['push']({'lockKey':_0x4fc4b6[_0x45296e(0x10c)],'remoteId':_0x1ce597['id']});}catch(_0x2d971e){_0x453173[_0x45296e(0xfb)]({'lockKey':_0x4fc4b6[_0x45296e(0x10c)],'error':_0x2d971e instanceof Error?_0x2d971e[_0x45296e(0xe4)]:String(_0x2d971e)});}}_0x5129fc['lastSync']=new Date()[_0x45296e(0xd0)]();try{await writeBffLockFile(_0x1145b6[_0x45296e(0x92)],_0x2ec079);}catch(_0x53bee8){const _0x2a04a9=[...await _0x4890c3[_0x45296e(0x90)](),...await _0x5e8b69?.['rollback']()??[]];throw withRollbackErrors(_0x53bee8,_0x45296e(0x94),_0x2a04a9);}return{'ok':_0x453173[_0x45296e(0xe9)]===0x0,'data':{'pulled':_0x45d29b,'skipped':_0x354e2b,'conflicts':_0x3491c9,'failed':_0x453173},'message':formatPullMessage(_0x45d29b[_0x45296e(0xe9)],_0x354e2b[_0x45296e(0xe9)],_0x3491c9[_0x45296e(0xe9)],_0x453173['length'])};}};function localUnsyncedConflict(_0x1e5792,_0x1bf1d2){const _0xf54cc0=a43_0x15d1eb,_0x1aaae5=_0x1e5792['lockKey'][_0xf54cc0(0xb9)]('/')['at'](-0x1);return{'code':'BFF_LOCAL_UNSYNCED','lockKey':_0x1e5792[_0xf54cc0(0x10c)],'filePath':_0x1e5792[_0xf54cc0(0xf6)],..._0x1bf1d2!=null?{'remoteId':_0x1bf1d2}:{},'message':'Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','nextAction':{'action':_0xf54cc0(0xd7),'command':CLI_BIN_NAME+_0xf54cc0(0x106)+_0x1e5792[_0xf54cc0(0x103)]+'\x20--name\x20'+_0x1aaae5+_0xf54cc0(0xbc),'requiresReview':!![],'message':_0xf54cc0(0xf4)}};}function formatPullMessage(_0x37c4e6,_0x37ab82,_0x27734b,_0x1e37f){const _0xdeaf7=a43_0x15d1eb,_0x24dc8a=[_0xdeaf7(0xb8)+_0x37c4e6+_0xdeaf7(0xb7),_0x37ab82+_0xdeaf7(0x98)];_0x27734b>0x0&&_0x24dc8a['push'](_0x27734b+_0xdeaf7(0xf0)+(_0x27734b===0x1?'':'s')+'\x20'+(_0x27734b===0x1?_0xdeaf7(0xc6):_0xdeaf7(0x8e))+_0xdeaf7(0xee));if(_0x1e37f>0x0)_0x24dc8a['push'](_0x1e37f+_0xdeaf7(0xea));return _0x24dc8a[_0xdeaf7(0xc5)](',\x20');}async function hasUnsyncedLocalChanges(_0x2db74f,_0x2f9336,_0x4f0332){const _0x13f946=a43_0x15d1eb;if(!await fileExists(_0x2db74f))return![];const _0x529b15=await computeFileHash(_0x2db74f);if(!_0x2f9336)return _0x4f0332?_0x529b15!==_0x4f0332:!![];return _0x529b15!==_0x2f9336[_0x13f946(0xab)];}function createPullFileTransaction(){const _0x2ceb3e=new Map(),_0x2a4bae=async(_0x16d4d0,_0x173689)=>{const _0x3164e9=a43_0x25d6;try{if(_0x173689[_0x3164e9(0xb1)])await ensureParentDirectory(_0x16d4d0),await writeFile(_0x16d4d0,_0x173689[_0x3164e9(0x9d)]);else try{await unlink(_0x16d4d0);}catch(_0x4cceb6){if(_0x4cceb6[_0x3164e9(0xc0)]!==_0x3164e9(0xfe))throw _0x4cceb6;}return undefined;}catch(_0x206b13){return _0x206b13 instanceof Error?_0x206b13:new Error(String(_0x206b13));}};return{async 'write'(_0x1afddb,_0xfa4d14){const _0x47d790=a43_0x25d6;if(!_0x2ceb3e[_0x47d790(0xd5)](_0x1afddb))try{_0x2ceb3e[_0x47d790(0x86)](_0x1afddb,{'existed':!![],'content':await readFile(_0x1afddb)});}catch(_0x2366c7){if(_0x2366c7[_0x47d790(0xc0)]!==_0x47d790(0xfe))throw _0x2366c7;_0x2ceb3e[_0x47d790(0x86)](_0x1afddb,{'existed':![]});}try{await ensureParentDirectory(_0x1afddb),await writeFile(_0x1afddb,_0xfa4d14,_0x47d790(0x9c));}catch(_0x41e99f){const _0x4e02ce=await _0x2a4bae(_0x1afddb,_0x2ceb3e['get'](_0x1afddb));if(!_0x4e02ce)_0x2ceb3e[_0x47d790(0xf3)](_0x1afddb);throw withRollbackErrors(_0x41e99f,_0x47d790(0xe7)+_0x1afddb+'\x22.',_0x4e02ce?[_0x4e02ce]:[]);}},async 'rollback'(){const _0x324338=a43_0x25d6,_0x14f72f=[];for(const [_0x18f4cb,_0x4c2e7b]of[..._0x2ceb3e['entries']()]['reverse']()){const _0x4f4dce=await _0x2a4bae(_0x18f4cb,_0x4c2e7b);_0x4f4dce&&_0x14f72f['push'](new Error(_0x324338(0x93)+_0x18f4cb+'\x22:\x20'+_0x4f4dce[_0x324338(0xe4)]));}return _0x14f72f;}};}function withRollbackErrors(_0x125139,_0x2e3d2a,_0x576586){const _0x3fdbe1=a43_0x15d1eb,_0x154380=_0x125139 instanceof Error?_0x125139:new Error(String(_0x125139));if(_0x576586[_0x3fdbe1(0xe9)]===0x0)return _0x154380;return new AggregateError([_0x154380,..._0x576586],_0x2e3d2a+'\x20Recovery\x20errors:\x20'+_0x576586[_0x3fdbe1(0xa1)](_0x3c991b=>_0x3c991b[_0x3fdbe1(0xe4)])[_0x3fdbe1(0xc5)](';\x20'));}function buildDatasetCodeToAliasMap(_0x4f97a2,_0x38a4ef,_0xbff0aa){const _0x3e49d5=a43_0x15d1eb,_0x32122c=resolveApiModelSource(_0x4f97a2,_0x38a4ef,_0xbff0aa),_0x10c2ff=loadAliasMap(_0x4f97a2,undefined,_0x32122c[_0x3e49d5(0xf6)],_0x32122c['profileName']);return assertUnambiguousHookAliases(_0x10c2ff),new Map(_0x10c2ff['map'](_0x44312e=>[_0x44312e[_0x3e49d5(0xf1)][_0x3e49d5(0x8f)](),_0x44312e['alias']]));}async function planHookDirectoryMigration(_0x1b69fe,_0x3f84fe,_0x5f1e18,_0x43922f){const _0x10c65f=a43_0x15d1eb,_0x5d2a21=new Map();for(const [_0x448621,_0x3b9494]of Object[_0x10c65f(0xfc)](_0x3f84fe['functions'])){const [_0x41c108,_0x18279a,_0x2b3be0,_0x456248,_0x59a011,..._0xbace85]=_0x448621[_0x10c65f(0xb9)]('/');if(_0x41c108!==_0x10c65f(0xb2)||!_0x18279a||!_0x2b3be0||!_0x456248||!_0x59a011||_0xbace85['length']>0x0||!_0x3b9494[_0x10c65f(0xf1)])continue;const _0x4c0277=_0x5f1e18[_0x10c65f(0xe0)](_0x3b9494['datasetCode'][_0x10c65f(0x8f)]()),_0xd81679=_0x4c0277??_0x3b9494[_0x10c65f(0xf1)];if(!isSafeHookDirectorySegment(_0x18279a))throw CliErrors[_0x10c65f(0xa8)](_0x10c65f(0xdf)+_0x18279a+_0x10c65f(0x11e));if(!isSafeHookDirectorySegment(_0xd81679))throw CliErrors[_0x10c65f(0xa8)](_0x10c65f(0xff)+_0x18279a+_0x10c65f(0xc3));if(_0x18279a===_0xd81679)continue;const _0x15343b=_0x5d2a21[_0x10c65f(0xe0)](_0x18279a)??{'datasetCode':_0x3b9494[_0x10c65f(0xf1)],'alias':_0x4c0277,'keyChanges':[]};if(_0x15343b['datasetCode']!==_0x3b9494[_0x10c65f(0xf1)])throw CliErrors[_0x10c65f(0xa8)](_0x10c65f(0xff)+_0x18279a+'\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.');const _0x1cf846=_0x10c65f(0x9e)+_0xd81679+'/'+_0x2b3be0+'/'+_0x456248+'/'+_0x59a011;try{resolveLocalFilePathFromLockKey(_0x1b69fe,_0x448621),resolveLocalFilePathFromLockKey(_0x1b69fe,_0x1cf846);}catch(_0x2add80){throw CliErrors['validation'](_0x10c65f(0x116)+_0x448621+_0x10c65f(0xa7)+(_0x2add80 instanceof Error?_0x2add80['message']:String(_0x2add80)));}_0x15343b['keyChanges'][_0x10c65f(0xfb)]({'oldLockKey':_0x448621,'newLockKey':_0x1cf846,'entry':_0x3b9494}),_0x5d2a21['set'](_0x18279a,_0x15343b);}const _0x2402fb=new Set([..._0x5d2a21['values']()][_0x10c65f(0x109)](_0x3fbf31=>_0x3fbf31['keyChanges'][_0x10c65f(0xa1)](_0x198062=>_0x198062['oldLockKey']))),_0x539f59=new Map(),_0x47ea51=new Map();for(const [_0x1d1bdd,_0x4b43fe]of _0x5d2a21){const _0x5dfa04=_0x4b43fe[_0x10c65f(0xdd)]??_0x4b43fe[_0x10c65f(0xf1)],_0x21a734=hookDirectoryIdentity(_0x5dfa04),_0x3b5f6a=_0x539f59['get'](_0x21a734);if(_0x3b5f6a&&_0x3b5f6a!==_0x1d1bdd)throw CliErrors[_0x10c65f(0xa8)](_0x10c65f(0x119)+_0x3b5f6a+'\x22\x20and\x20\x22'+_0x1d1bdd+_0x10c65f(0x112)+_0x5dfa04+'\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.');_0x539f59[_0x10c65f(0x86)](_0x21a734,_0x1d1bdd);for(const _0x43c3d1 of _0x4b43fe[_0x10c65f(0xd8)]){const _0x56c44b=_0x47ea51[_0x10c65f(0xe0)](_0x43c3d1[_0x10c65f(0x8d)]);if(_0x56c44b&&_0x56c44b!==_0x43c3d1[_0x10c65f(0x9b)])throw CliErrors[_0x10c65f(0xa8)]('Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22'+_0x56c44b+_0x10c65f(0xe2)+_0x43c3d1['oldLockKey']+_0x10c65f(0x112)+_0x43c3d1['newLockKey']+_0x10c65f(0x10d));if(_0x2402fb[_0x10c65f(0xd5)](_0x43c3d1['newLockKey']))throw CliErrors[_0x10c65f(0xa8)]('Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22'+_0x43c3d1['oldLockKey']+_0x10c65f(0xde)+_0x43c3d1[_0x10c65f(0x8d)]+_0x10c65f(0xd3));_0x47ea51[_0x10c65f(0x86)](_0x43c3d1[_0x10c65f(0x8d)],_0x43c3d1[_0x10c65f(0x9b)]);}}const _0x2b24b4=new Map();for(const [_0x397a2f,_0x13b3b6]of _0x5f1e18){_0x2b24b4[_0x10c65f(0x86)](hookDirectoryIdentity(_0x13b3b6),_0x397a2f);}const _0x8333b0=[];for(const [_0x785ae8,_0x399b5e]of _0x5d2a21){const _0x544427=_0x399b5e['alias']??_0x399b5e[_0x10c65f(0xf1)],_0x14cd6f=join(_0x1b69fe[_0x10c65f(0xfa)],_0x10c65f(0xb2),_0x785ae8),_0x26e670=join(_0x1b69fe[_0x10c65f(0xfa)],_0x10c65f(0xb2),_0x544427),_0x1e3e87=await directoryExists(_0x14cd6f),_0x44fb5f=await directoryExists(_0x26e670),_0x591405=_0x1e3e87?_0x44fb5f?await sameDirectory(_0x14cd6f,_0x26e670)?'case-rename':undefined:_0x10c65f(0xd9):_0x10c65f(0xcb);if(!_0x591405)throw CliErrors[_0x10c65f(0xa8)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x785ae8+_0x10c65f(0xe5)+_0x544427+_0x10c65f(0xe8));const _0x290672=_0x2b24b4['get'](hookDirectoryIdentity(_0x785ae8));if(_0x290672&&_0x290672!==_0x399b5e[_0x10c65f(0xf1)][_0x10c65f(0x8f)]()){const _0x2427f6=new Set(_0x399b5e['keyChanges'][_0x10c65f(0xa1)](_0x15b899=>_0x15b899[_0x10c65f(0x9b)])),_0x40ffe3=_0x43922f[_0x10c65f(0xb6)](_0x4e578c=>_0x4e578c[_0x10c65f(0x103)]===_0x10c65f(0xb2)&&_0x4e578c[_0x10c65f(0xdd)]!=null&&hookDirectoryIdentity(_0x4e578c[_0x10c65f(0xdd)])===hookDirectoryIdentity(_0x785ae8)&&!_0x2427f6[_0x10c65f(0xd5)](_0x4e578c[_0x10c65f(0x10c)]));if(_0x40ffe3[_0x10c65f(0xe9)]>0x0)throw CliErrors[_0x10c65f(0xa8)](_0x10c65f(0xff)+_0x785ae8+_0x10c65f(0xc2));}const _0x43bee7=_0x2b24b4[_0x10c65f(0xe0)](hookDirectoryIdentity(_0x544427));if(_0x43bee7&&_0x43bee7!==_0x399b5e[_0x10c65f(0xf1)][_0x10c65f(0x8f)]())throw CliErrors['validation'](_0x10c65f(0xff)+_0x785ae8+'\x22\x20to\x20\x22'+_0x544427+'\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');for(const _0x214ac5 of _0x399b5e['keyChanges']){const _0x37acda=_0x3f84fe[_0x10c65f(0xcf)][_0x214ac5[_0x10c65f(0x8d)]];if(_0x37acda&&!_0x2402fb[_0x10c65f(0xd5)](_0x214ac5[_0x10c65f(0x8d)])&&!sameHookIdentity(_0x214ac5[_0x10c65f(0xbe)],_0x37acda))throw CliErrors[_0x10c65f(0xa8)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x785ae8+_0x10c65f(0xe5)+_0x544427+_0x10c65f(0x11b));}_0x8333b0['push']({'oldDirectory':_0x785ae8,'newDirectory':_0x544427,'oldDirectoryPath':_0x14cd6f,'newDirectoryPath':_0x26e670,'mode':_0x591405,'alias':_0x399b5e['alias'],'keyChanges':_0x399b5e[_0x10c65f(0xd8)]});}const _0x22bcca={..._0x3f84fe[_0x10c65f(0xcf)]},_0x56b970=new Map(),_0x49b451=new Map();for(const _0x4dc171 of _0x8333b0){const _0x2f93e5=_0x4dc171[_0x10c65f(0xc8)]!==_0x10c65f(0xcb);_0x2f93e5&&_0x49b451['set'](hookDirectoryIdentity(_0x4dc171[_0x10c65f(0xb0)]),_0x4dc171[_0x10c65f(0x95)]);for(const _0x55d754 of _0x4dc171[_0x10c65f(0xd8)]){const _0x33bf67=_0x22bcca[_0x55d754[_0x10c65f(0x8d)]],_0x4a2971=_0x2f93e5?_0x55d754[_0x10c65f(0xbe)]:_0x33bf67??_0x55d754[_0x10c65f(0xbe)];_0x22bcca[_0x55d754[_0x10c65f(0x8d)]]=canonicalizeHookEntry(_0x4a2971,_0x4dc171[_0x10c65f(0xdd)]),delete _0x22bcca[_0x55d754[_0x10c65f(0x9b)]],_0x2f93e5&&_0x56b970[_0x10c65f(0x86)](_0x55d754['newLockKey'],resolveLocalFilePathFromLockKey(_0x1b69fe,_0x55d754[_0x10c65f(0x9b)]));}}return{'migrations':_0x8333b0,'projectedFunctions':_0x22bcca,'sourceFilePathByNewLockKey':_0x56b970,'sourceDirectoryPathByNewDirectory':_0x49b451};}function resolveMigratedSourceFilePath(_0x5646c6,_0x50e8d6){const _0x44f365=a43_0x15d1eb;if(!_0x5646c6||!_0x50e8d6)return undefined;const _0x129789=_0x5646c6[_0x44f365(0xbd)][_0x44f365(0xe0)](_0x50e8d6[_0x44f365(0x10c)]);if(_0x129789)return _0x129789;if(_0x50e8d6[_0x44f365(0x103)]!==_0x44f365(0xb2))return undefined;const [,_0x55536b,..._0x258241]=_0x50e8d6[_0x44f365(0x10c)][_0x44f365(0xb9)]('/');if(!_0x55536b||_0x258241['length']===0x0)return undefined;const _0x15d452=_0x5646c6[_0x44f365(0xeb)][_0x44f365(0xe0)](hookDirectoryIdentity(_0x55536b));return _0x15d452?join(_0x15d452,..._0x258241)+'.js':undefined;}function sameHookIdentity(_0xd33040,_0x1bba77){const _0x2b4f6d=a43_0x15d1eb;return _0xd33040[_0x2b4f6d(0xcc)]===_0x1bba77[_0x2b4f6d(0xcc)]&&_0xd33040[_0x2b4f6d(0xf1)]===_0x1bba77[_0x2b4f6d(0xf1)]&&_0xd33040[_0x2b4f6d(0xf8)]===_0x1bba77[_0x2b4f6d(0xf8)]&&_0xd33040[_0x2b4f6d(0xa3)]===_0x1bba77[_0x2b4f6d(0xa3)];}function canonicalizeHookEntry(_0x5b475e,_0xea0700){const {alias:_0x44d77f,..._0x25ebac}=_0x5b475e;return _0xea0700?{..._0x25ebac,'alias':_0xea0700}:_0x25ebac;}function hookDirectoryIdentity(_0x4a02aa){const _0x41934a=a43_0x15d1eb;return _0x4a02aa['normalize'](_0x41934a(0xc7))[_0x41934a(0x8f)]();}function isSafeHookDirectorySegment(_0x2d9855){return isSafeLockKeySegment(_0x2d9855);}async function sameDirectory(_0x15b619,_0xd1ecf){const _0x2152c7=a43_0x15d1eb,[_0x2c6966,_0x1c91cd]=await Promise[_0x2152c7(0xb4)]([stat(_0x15b619),stat(_0xd1ecf)]);return _0x2c6966[_0x2152c7(0x11c)]===_0x1c91cd[_0x2152c7(0x11c)]&&_0x2c6966[_0x2152c7(0xd6)]===_0x1c91cd['ino'];}async function applyHookDirectoryMigration(_0x3677dd,_0x2c51d7){const _0x556347=a43_0x15d1eb,_0x17f430=_0x2c51d7[_0x556347(0xcf)],_0x17292d=_0x2c51d7[_0x556347(0xa6)],_0x46d88d=[],_0x482a63=async()=>{const _0x20d198=_0x556347,_0x48506f=[];_0x2c51d7[_0x20d198(0xcf)]=_0x17f430,_0x2c51d7[_0x20d198(0xa6)]=_0x17292d;for(const {migration:_0x68f1ba,temporaryPath:_0x847d86}of[..._0x46d88d][_0x20d198(0xe1)]()){try{_0x847d86?(await rename(_0x68f1ba[_0x20d198(0xd4)],_0x847d86),await rename(_0x847d86,_0x68f1ba[_0x20d198(0x95)])):await rename(_0x68f1ba[_0x20d198(0xd4)],_0x68f1ba[_0x20d198(0x95)]);}catch(_0x525dfd){_0x48506f['push'](new Error(_0x20d198(0xc1)+_0x68f1ba['oldDirectory']+_0x20d198(0xae)+_0x68f1ba['newDirectory']+_0x20d198(0xa7)+(_0x525dfd instanceof Error?_0x525dfd[_0x20d198(0xe4)]:String(_0x525dfd))));}}return _0x48506f;};try{for(const _0x55c77d of _0x3677dd[_0x556347(0x110)]){if(_0x55c77d['mode']===_0x556347(0xd9))await ensureParentDirectory(_0x55c77d['newDirectoryPath']),await rename(_0x55c77d[_0x556347(0x95)],_0x55c77d[_0x556347(0xd4)]),_0x46d88d['push']({'migration':_0x55c77d});else{if(_0x55c77d[_0x556347(0xc8)]===_0x556347(0x114)){const _0x54147c=join(dirname(_0x55c77d[_0x556347(0x95)]),_0x556347(0xa0)+randomUUID());await rename(_0x55c77d[_0x556347(0x95)],_0x54147c);try{await rename(_0x54147c,_0x55c77d[_0x556347(0xd4)]);}catch(_0x1c5d5f){try{await rename(_0x54147c,_0x55c77d[_0x556347(0x95)]);}catch(_0x2754a9){throw withRollbackErrors(_0x1c5d5f,_0x556347(0xa2)+_0x55c77d['oldDirectory']+_0x556347(0xe5)+_0x55c77d[_0x556347(0xb0)]+'\x22;\x20temporary\x20directory\x20\x22'+_0x54147c+_0x556347(0xcd),[new Error(_0x556347(0x97)+_0x54147c+_0x556347(0xe5)+_0x55c77d[_0x556347(0x9f)]+_0x556347(0xa7)+(_0x2754a9 instanceof Error?_0x2754a9[_0x556347(0xe4)]:String(_0x2754a9)))]);}throw _0x1c5d5f;}_0x46d88d[_0x556347(0xfb)]({'migration':_0x55c77d,'temporaryPath':_0x54147c});}}}return _0x2c51d7[_0x556347(0xcf)]=_0x3677dd[_0x556347(0xf2)],{'rollback':_0x482a63};}catch(_0x4f9d52){const _0x380dbb=await _0x482a63();throw withRollbackErrors(_0x4f9d52,_0x556347(0x115),_0x380dbb);}}async function confirmForce(){const _0x1f91d6=a43_0x15d1eb,_0x508fc4=createInterface({'input':process[_0x1f91d6(0xba)],'output':process[_0x1f91d6(0x117)]}),_0xcc4d0e=await new Promise(_0x269479=>{const _0x1ff9d3=_0x1f91d6;_0x508fc4[_0x1ff9d3(0xec)](_0x1ff9d3(0xac),_0x269479);});return _0x508fc4[_0x1f91d6(0xda)](),['y',_0x1f91d6(0xfd)][_0x1f91d6(0x107)](_0xcc4d0e['trim']()[_0x1f91d6(0x8f)]());}
1
+ function a43_0x36f9(_0x15d8df,_0x4a00db){_0x15d8df=_0x15d8df-0x1d4;const _0x176d07=a43_0x176d();let _0x36f9fa=_0x176d07[_0x15d8df];return _0x36f9fa;}const a43_0x24b3b8=a43_0x36f9;(function(_0x376e93,_0x433bcc){const _0x135909=a43_0x36f9,_0x33a4ff=_0x376e93();while(!![]){try{const _0xb9268=-parseInt(_0x135909(0x23d))/0x1+-parseInt(_0x135909(0x258))/0x2*(-parseInt(_0x135909(0x1f3))/0x3)+-parseInt(_0x135909(0x240))/0x4+parseInt(_0x135909(0x1d5))/0x5*(parseInt(_0x135909(0x208))/0x6)+parseInt(_0x135909(0x1e3))/0x7+parseInt(_0x135909(0x1fa))/0x8+-parseInt(_0x135909(0x224))/0x9;if(_0xb9268===_0x433bcc)break;else _0x33a4ff['push'](_0x33a4ff['shift']());}catch(_0x3a47ab){_0x33a4ff['push'](_0x33a4ff['shift']());}}}(a43_0x176d,0x4e6e7));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_0x24b3b8(0x23e),'command':a43_0x24b3b8(0x229),'description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':a43_0x24b3b8(0x1ef),'structuredErrors':!![],'flags':[{'name':a43_0x24b3b8(0x236),'type':'string','description':a43_0x24b3b8(0x234),'enum':[a43_0x24b3b8(0x216),'ENDPOINT',a43_0x24b3b8(0x239)]},{'name':'force','type':a43_0x24b3b8(0x215),'description':a43_0x24b3b8(0x1d4)}],async 'dryRun'(_0x476ecc){const _0x2bf616=a43_0x24b3b8,_0x547c52=loadBffProjectConfig(_0x476ecc['appCode']),_0x214999=await readBffLockFile(_0x547c52[_0x2bf616(0x204)]),{appLock:_0x10ed18}=ensureLockScope(_0x214999??createEmptyBffLock(),_0x476ecc[_0x2bf616(0x1f0)],_0x547c52[_0x2bf616(0x25b)],_0x2bf616(0x229)),_0x80f6d=normalizeBffType(_0x476ecc[_0x2bf616(0x1ea)](_0x2bf616(0x236)))??undefined,[_0x294988,_0x5e729b]=await Promise[_0x2bf616(0x250)]([listBffScripts(_0x476ecc[_0x2bf616(0x1f0)],_0x80f6d),getBffScriptStatistics(_0x476ecc[_0x2bf616(0x1f0)])]),_0x3cde14=_0x294988[_0x2bf616(0x1f1)](_0x2cbae1=>normalizeBffType(_0x2cbae1['scriptType'])===_0x2bf616(0x239)),_0x5bcb0b=_0x3cde14?buildDatasetCodeToAliasMap(_0x476ecc['apiDir'],_0x476ecc[_0x2bf616(0x1f0)],_0x476ecc[_0x2bf616(0x1e0)]||_0x476ecc[_0x2bf616(0x23a)]?.[_0x2bf616(0x1e6)]||_0x476ecc[_0x2bf616(0x23a)]?.[_0x2bf616(0x252)]):new Map(),_0x3def1e=_0x3cde14?await planHookDirectoryMigration(_0x547c52,_0x10ed18,_0x5bcb0b,await scanLocalBffFunctions(_0x547c52,_0x2bf616(0x239))):undefined,_0x1121ba=createHookLocationMap(_0x5e729b),_0x525b52=[];for(const _0x485c6b of _0x294988){const _0x29e237=resolveRemoteScriptTarget(_0x547c52,_0x485c6b,_0x1121ba,_0x3def1e?.['projectedFunctions']??_0x10ed18[_0x2bf616(0x249)],_0x5bcb0b);if(!_0x29e237){_0x525b52['push']({'scriptType':_0x485c6b['scriptType'],'functionName':_0x485c6b[_0x2bf616(0x23f)]??'','status':_0x2bf616(0x269),'reason':'unresolvable\x20target\x20path'});continue;}const _0x4f2b77=(_0x3def1e?.[_0x2bf616(0x1da)]??_0x10ed18[_0x2bf616(0x249)])[_0x29e237['lockKey']],_0x46ef96=_0x485c6b[_0x2bf616(0x200)]!=null?computeContentHash(_0x485c6b[_0x2bf616(0x200)]):undefined,_0xc4f110=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x3def1e,_0x29e237)??_0x29e237[_0x2bf616(0x218)],_0x4f2b77,_0x46ef96),_0x501465=_0xc4f110?localUnsyncedConflict(_0x29e237,_0x485c6b['id']):undefined;_0x525b52['push']({'lockKey':_0x29e237[_0x2bf616(0x231)],'filePath':_0x29e237['filePath'],'remoteId':_0x485c6b['id']??null,'status':_0x501465?_0x2bf616(0x261):_0x2bf616(0x230),..._0x501465?{'conflict':_0x501465}:{},..._0x29e237['hookLocation']?{'alias':_0x29e237[_0x2bf616(0x1fc)][_0x2bf616(0x1e5)]??null,'datasetCode':_0x29e237[_0x2bf616(0x1fc)][_0x2bf616(0x24e)],'operationType':_0x29e237['hookLocation']['operationType'],'functionNode':_0x29e237['hookLocation'][_0x2bf616(0x246)]}:{}});}return{'method':_0x2bf616(0x226),'url':_0x2bf616(0x22b)+_0x476ecc[_0x2bf616(0x1f0)]+(_0x80f6d?_0x2bf616(0x1f7)+_0x80f6d:'')+_0x2bf616(0x20e)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x476ecc[_0x2bf616(0x1f0)],'filterType':_0x80f6d??null,..._0x3def1e&&_0x3def1e[_0x2bf616(0x1dc)][_0x2bf616(0x237)]>0x0?{'hookDirectoryMigrations':_0x3def1e[_0x2bf616(0x1dc)][_0x2bf616(0x265)](_0xd6b18f=>({'from':_0xd6b18f[_0x2bf616(0x244)],'to':_0xd6b18f[_0x2bf616(0x214)]}))}:{},'files':_0x525b52},'description':'Would\x20inspect\x20'+_0x525b52[_0x2bf616(0x237)]+_0x2bf616(0x1fd)};},async 'execute'(_0x50224a){const _0x2febea=a43_0x24b3b8,_0xe3526b=loadBffProjectConfig(_0x50224a[_0x2febea(0x1f0)]),_0x3955a7=await readBffLockFile(_0xe3526b[_0x2febea(0x204)]),{lockData:_0x3bbb56,appLock:_0x41658b}=ensureLockScope(_0x3955a7??createEmptyBffLock(),_0x50224a[_0x2febea(0x1f0)],_0xe3526b[_0x2febea(0x25b)],_0x2febea(0x229)),_0x17153d=normalizeBffType(_0x50224a[_0x2febea(0x1ea)](_0x2febea(0x236)))??undefined;if(_0x50224a[_0x2febea(0x1ea)](_0x2febea(0x236))&&!_0x17153d)throw CliErrors[_0x2febea(0x21e)](_0x2febea(0x221));const [_0x32921c,_0xa27575]=await Promise[_0x2febea(0x250)]([listBffScripts(_0x50224a['appCode'],_0x17153d),getBffScriptStatistics(_0x50224a[_0x2febea(0x1f0)])]);if(_0x32921c[_0x2febea(0x237)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x2febea(0x219)};const _0x50ae3a=_0x50224a['bool'](_0x2febea(0x212));if(_0x50ae3a&&!_0x50224a[_0x2febea(0x211)]){const _0x1193c8=await confirmForce();if(!_0x1193c8)throw CliErrors[_0x2febea(0x255)](_0x2febea(0x232));}if(_0x50ae3a&&_0x50224a[_0x2febea(0x211)]){}const _0x2cde6a=_0x32921c['some'](_0x1979ff=>normalizeBffType(_0x1979ff[_0x2febea(0x238)])===_0x2febea(0x239)),_0x12b1cd=_0x2cde6a?buildDatasetCodeToAliasMap(_0x50224a[_0x2febea(0x245)],_0x50224a[_0x2febea(0x1f0)],_0x50224a[_0x2febea(0x1e0)]||_0x50224a['mergedCli']?.[_0x2febea(0x1e6)]||_0x50224a[_0x2febea(0x23a)]?.[_0x2febea(0x252)]):new Map(),_0x78d90e=createHookLocationMap(_0xa27575),_0x361c4a=JSON[_0x2febea(0x209)](JSON['stringify'](_0x3bbb56)),_0x553352=_0x50224a['appCode'],_0x5dcd5a=_0x361c4a[_0x2febea(0x222)][_0x553352];if(!_0x5dcd5a)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x553352+_0x2febea(0x1eb));const _0x154a6d=_0x2cde6a?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0xe3526b,_0x5dcd5a,_0x12b1cd,await scanLocalBffFunctions(_0xe3526b,_0x2febea(0x239))),_0x5dcd5a):undefined,_0x225089=createPullFileTransaction(),_0x2cd7e9=[],_0x27ff13=[],_0x10c59d=[],_0x6ede95=[];for(const _0x371366 of _0x32921c){const _0x48488d=resolveRemoteScriptTarget(_0xe3526b,_0x371366,_0x78d90e,_0x5dcd5a['functions'],_0x12b1cd);if(!_0x48488d){_0x27ff13[_0x2febea(0x260)]({'lockKey':_0x371366[_0x2febea(0x238)]+'/'+_0x371366[_0x2febea(0x23f)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x9be609=_0x5dcd5a[_0x2febea(0x249)][_0x48488d['lockKey']];try{if(!_0x371366['id'])throw new Error(_0x2febea(0x1ed));if(_0x371366[_0x2febea(0x200)]==null)throw new Error(_0x2febea(0x1e9));const _0x56b666=_0x371366['scriptContent'],_0xccf711=computeContentHash(_0x56b666);if(!_0x50ae3a){const _0x5b182d=await hasUnsyncedLocalChanges(_0x48488d[_0x2febea(0x218)],_0x9be609,_0xccf711);if(_0x5b182d){_0x10c59d[_0x2febea(0x260)](localUnsyncedConflict(_0x48488d,_0x371366['id']));continue;}}await _0x225089[_0x2febea(0x21b)](_0x48488d[_0x2febea(0x218)],_0x56b666);const _0x31b684={'hash':_0xccf711,'remoteId':_0x371366['id'],'version':_0x371366['version']};_0x48488d['type']==='HOOK'&&_0x48488d[_0x2febea(0x1fc)]&&(_0x31b684['alias']=_0x48488d[_0x2febea(0x1fc)][_0x2febea(0x1e5)],_0x31b684[_0x2febea(0x24e)]=_0x48488d[_0x2febea(0x1fc)][_0x2febea(0x24e)],_0x31b684['operationType']=_0x48488d[_0x2febea(0x1fc)][_0x2febea(0x25c)],_0x31b684['functionNode']=_0x48488d[_0x2febea(0x1fc)][_0x2febea(0x246)]),_0x5dcd5a['functions'][_0x48488d[_0x2febea(0x231)]]=_0x31b684,_0x2cd7e9[_0x2febea(0x260)]({'lockKey':_0x48488d[_0x2febea(0x231)],'remoteId':_0x371366['id']});}catch(_0x2c5355){_0x6ede95[_0x2febea(0x260)]({'lockKey':_0x48488d[_0x2febea(0x231)],'error':_0x2c5355 instanceof Error?_0x2c5355[_0x2febea(0x223)]:String(_0x2c5355)});}}_0x5dcd5a[_0x2febea(0x1e1)]=new Date()[_0x2febea(0x1e2)]();try{await writeBffLockFile(_0xe3526b['lockFilePath'],_0x361c4a);}catch(_0x1b693f){const _0x88566b=[...await _0x225089[_0x2febea(0x251)](),...await _0x154a6d?.[_0x2febea(0x251)]()??[]];throw withRollbackErrors(_0x1b693f,_0x2febea(0x1d8),_0x88566b);}return{'ok':_0x6ede95[_0x2febea(0x237)]===0x0,'data':{'pulled':_0x2cd7e9,'skipped':_0x27ff13,'conflicts':_0x10c59d,'failed':_0x6ede95},'message':formatPullMessage(_0x2cd7e9[_0x2febea(0x237)],_0x27ff13[_0x2febea(0x237)],_0x10c59d[_0x2febea(0x237)],_0x6ede95['length'])};}};function localUnsyncedConflict(_0x52e353,_0x1cf6dc){const _0x4f01e5=a43_0x24b3b8,_0x472ba8=_0x52e353[_0x4f01e5(0x231)]['split']('/')['at'](-0x1);return{'code':_0x4f01e5(0x213),'lockKey':_0x52e353[_0x4f01e5(0x231)],'filePath':_0x52e353['filePath'],..._0x1cf6dc!=null?{'remoteId':_0x1cf6dc}:{},'message':'Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','nextAction':{'action':_0x4f01e5(0x207),'command':CLI_BIN_NAME+_0x4f01e5(0x235)+_0x52e353['type']+_0x4f01e5(0x228)+_0x472ba8+_0x4f01e5(0x1f2),'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 a43_0x176d(){const _0x9a142f=['requires','lockFilePath','has','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','push_local','36BYNWmh','parse','utf8','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','keyChanges','join','&currentPage=1&pageSize=','NFC','flatMap','nonInteractive','force','BFF_LOCAL_UNSYNCED','newDirectory','boolean','COMMON','scriptsRootDir','filePath','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','write','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','move','validation','\x20skipped','\x22\x20and\x20\x22','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','apps','message','2658078rqnHqw','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','GET','split','\x20--name\x20','pull','get','/api/management/library/scripts/list?appCode=','sourceDirectoryPathByNewDirectory','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','\x22\x20to\x20\x22','newDirectoryPath','would_pull','lockKey','Force\x20pull\x20cancelled.','dev','Pull\x20only\x20this\x20script\x20type','\x20bff\x20push\x20--type\x20','type','length','scriptType','HOOK','mergedCli','entry','require','508076bzDrFj','bff','functionName','478000ctOHRE','\x20resolution','\x22:\x20its\x20target\x20\x22','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','oldDirectory','apiDir','functionNode','Could\x20not\x20restore\x20local\x20script\x20\x22','stderr','functions','profileName','\x22:\x20','trim','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','datasetCode','\x22:\x20both\x20target\x20\x22','all','rollback','defaultApp','content','case-rename','cancelled','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','.hook-directory-migrate-','146qqkIhd','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','oldDirectoryPath','scriptsRoot','operationType','\x22\x20from\x20the\x20lock\x20file.','stdin','mode','push','conflict','newLockKey','set','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','map','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','HOOK/','skipped','toLowerCase','Force\x20overwrite\x20local\x20unsynced\x20changes','520055geOXPh','normalize','hash','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','entries','projectedFunctions','\x22\x20may\x20remain.','migrations','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','ino','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','selectedAppName','lastSync','toISOString','228508rerdJi','close','alias','currentApp','\x20failed','yes','Remote\x20script\x20missing\x20content.','str','\x22\x20not\x20found\x20after\x20ensureLockScope.','.js','Remote\x20script\x20missing\x20id.','code','read','appCode','some','\x20--format\x20compress','5331XEtWni','rekey','filter','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','&type=','\x22;\x20temporary\x20directory\x20\x22','oldLockKey','3661936RlSXpb','ENOENT','hookLocation','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','Pull\x20complete:\x20','sourceFilePathByNewLockKey','scriptContent','\x20pulled','remoteId'];a43_0x176d=function(){return _0x9a142f;};return a43_0x176d();}function formatPullMessage(_0x1fb84d,_0x3f787b,_0x1ef4f4,_0x39921b){const _0x26e044=a43_0x24b3b8,_0x490f8a=[_0x26e044(0x1fe)+_0x1fb84d+_0x26e044(0x201),_0x3f787b+_0x26e044(0x21f)];_0x1ef4f4>0x0&&_0x490f8a[_0x26e044(0x260)](_0x1ef4f4+'\x20conflict'+(_0x1ef4f4===0x1?'':'s')+'\x20'+(_0x1ef4f4===0x1?_0x26e044(0x203):_0x26e044(0x23c))+_0x26e044(0x241));if(_0x39921b>0x0)_0x490f8a[_0x26e044(0x260)](_0x39921b+_0x26e044(0x1e7));return _0x490f8a[_0x26e044(0x20d)](',\x20');}async function hasUnsyncedLocalChanges(_0x569fb4,_0x57ba61,_0x15187){const _0x15fb39=a43_0x24b3b8;if(!await fileExists(_0x569fb4))return![];const _0x2fdfc9=await computeFileHash(_0x569fb4);if(!_0x57ba61)return _0x15187?_0x2fdfc9!==_0x15187:!![];return _0x2fdfc9!==_0x57ba61[_0x15fb39(0x1d7)];}function createPullFileTransaction(){const _0x56116e=new Map(),_0x3eac13=async(_0x220b8f,_0x4dacb0)=>{const _0x5263d7=a43_0x36f9;try{if(_0x4dacb0['existed'])await ensureParentDirectory(_0x220b8f),await writeFile(_0x220b8f,_0x4dacb0[_0x5263d7(0x253)]);else try{await unlink(_0x220b8f);}catch(_0x14c130){if(_0x14c130[_0x5263d7(0x1ee)]!==_0x5263d7(0x1fb))throw _0x14c130;}return undefined;}catch(_0x131c82){return _0x131c82 instanceof Error?_0x131c82:new Error(String(_0x131c82));}};return{async 'write'(_0xa0a444,_0x1603b9){const _0x279c9a=a43_0x36f9;if(!_0x56116e[_0x279c9a(0x205)](_0xa0a444))try{_0x56116e[_0x279c9a(0x263)](_0xa0a444,{'existed':!![],'content':await readFile(_0xa0a444)});}catch(_0x2cb44b){if(_0x2cb44b[_0x279c9a(0x1ee)]!=='ENOENT')throw _0x2cb44b;_0x56116e[_0x279c9a(0x263)](_0xa0a444,{'existed':![]});}try{await ensureParentDirectory(_0xa0a444),await writeFile(_0xa0a444,_0x1603b9,_0x279c9a(0x20a));}catch(_0x102d78){const _0x3088dc=await _0x3eac13(_0xa0a444,_0x56116e[_0x279c9a(0x22a)](_0xa0a444));if(!_0x3088dc)_0x56116e['delete'](_0xa0a444);throw withRollbackErrors(_0x102d78,'Failed\x20to\x20write\x20local\x20script\x20\x22'+_0xa0a444+'\x22.',_0x3088dc?[_0x3088dc]:[]);}},async 'rollback'(){const _0x8a2ec9=a43_0x36f9,_0x3a8a4b=[];for(const [_0x3dc8b6,_0x2a18a1]of[..._0x56116e[_0x8a2ec9(0x1d9)]()]['reverse']()){const _0x4e5226=await _0x3eac13(_0x3dc8b6,_0x2a18a1);_0x4e5226&&_0x3a8a4b[_0x8a2ec9(0x260)](new Error(_0x8a2ec9(0x247)+_0x3dc8b6+_0x8a2ec9(0x24b)+_0x4e5226['message']));}return _0x3a8a4b;}};}function withRollbackErrors(_0x287409,_0xdeaf78,_0x42f3c9){const _0x21f56b=a43_0x24b3b8,_0x408310=_0x287409 instanceof Error?_0x287409:new Error(String(_0x287409));if(_0x42f3c9[_0x21f56b(0x237)]===0x0)return _0x408310;return new AggregateError([_0x408310,..._0x42f3c9],_0xdeaf78+'\x20Recovery\x20errors:\x20'+_0x42f3c9[_0x21f56b(0x265)](_0xb74659=>_0xb74659[_0x21f56b(0x223)])['join'](';\x20'));}function buildDatasetCodeToAliasMap(_0x356e2e,_0xa9fc3a,_0x2d5988){const _0x1a770c=a43_0x24b3b8,_0x3c8a34=resolveApiModelSource(_0x356e2e,_0xa9fc3a,_0x2d5988),_0x3d81c3=loadAliasMap(_0x356e2e,undefined,_0x3c8a34[_0x1a770c(0x218)],_0x3c8a34[_0x1a770c(0x24a)]);return assertUnambiguousHookAliases(_0x3d81c3),new Map(_0x3d81c3['map'](_0x612960=>[_0x612960['datasetCode'][_0x1a770c(0x26a)](),_0x612960[_0x1a770c(0x1e5)]]));}async function planHookDirectoryMigration(_0x11aae3,_0x57ffd5,_0x3bc841,_0x4416cf){const _0x5f143b=a43_0x24b3b8,_0x2d3c6a=new Map();for(const [_0x5e59a3,_0x52319a]of Object[_0x5f143b(0x1d9)](_0x57ffd5[_0x5f143b(0x249)])){const [_0x3419dd,_0x380667,_0xaeafc4,_0x56cdf9,_0x586987,..._0x239cc7]=_0x5e59a3['split']('/');if(_0x3419dd!=='HOOK'||!_0x380667||!_0xaeafc4||!_0x56cdf9||!_0x586987||_0x239cc7[_0x5f143b(0x237)]>0x0||!_0x52319a['datasetCode'])continue;const _0x3df9c9=_0x3bc841[_0x5f143b(0x22a)](_0x52319a[_0x5f143b(0x24e)]['toLowerCase']()),_0x373e82=_0x3df9c9??_0x52319a['datasetCode'];if(!isSafeHookDirectorySegment(_0x380667))throw CliErrors[_0x5f143b(0x21e)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x380667+_0x5f143b(0x25d));if(!isSafeHookDirectorySegment(_0x373e82))throw CliErrors['validation'](_0x5f143b(0x267)+_0x380667+_0x5f143b(0x21c));if(_0x380667===_0x373e82)continue;const _0x2bf0db=_0x2d3c6a['get'](_0x380667)??{'datasetCode':_0x52319a[_0x5f143b(0x24e)],'alias':_0x3df9c9,'keyChanges':[]};if(_0x2bf0db[_0x5f143b(0x24e)]!==_0x52319a['datasetCode'])throw CliErrors[_0x5f143b(0x21e)](_0x5f143b(0x267)+_0x380667+'\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.');const _0x287c3d=_0x5f143b(0x268)+_0x373e82+'/'+_0xaeafc4+'/'+_0x56cdf9+'/'+_0x586987;try{resolveLocalFilePathFromLockKey(_0x11aae3,_0x5e59a3),resolveLocalFilePathFromLockKey(_0x11aae3,_0x287c3d);}catch(_0x51822b){throw CliErrors[_0x5f143b(0x21e)](_0x5f143b(0x1dd)+_0x5e59a3+_0x5f143b(0x24b)+(_0x51822b instanceof Error?_0x51822b[_0x5f143b(0x223)]:String(_0x51822b)));}_0x2bf0db[_0x5f143b(0x20c)]['push']({'oldLockKey':_0x5e59a3,'newLockKey':_0x287c3d,'entry':_0x52319a}),_0x2d3c6a[_0x5f143b(0x263)](_0x380667,_0x2bf0db);}const _0x348c33=new Set([..._0x2d3c6a['values']()][_0x5f143b(0x210)](_0x1c169e=>_0x1c169e['keyChanges']['map'](_0x4b6479=>_0x4b6479[_0x5f143b(0x1f9)]))),_0x2634d7=new Map(),_0x107e04=new Map();for(const [_0x103561,_0x21283e]of _0x2d3c6a){const _0x3c6a1c=_0x21283e['alias']??_0x21283e['datasetCode'],_0x3370af=hookDirectoryIdentity(_0x3c6a1c),_0x2e04d1=_0x2634d7[_0x5f143b(0x22a)](_0x3370af);if(_0x2e04d1&&_0x2e04d1!==_0x103561)throw CliErrors[_0x5f143b(0x21e)](_0x5f143b(0x259)+_0x2e04d1+_0x5f143b(0x220)+_0x103561+_0x5f143b(0x24f)+_0x3c6a1c+_0x5f143b(0x1f6));_0x2634d7[_0x5f143b(0x263)](_0x3370af,_0x103561);for(const _0x4a94b0 of _0x21283e['keyChanges']){const _0x2db68d=_0x107e04[_0x5f143b(0x22a)](_0x4a94b0[_0x5f143b(0x262)]);if(_0x2db68d&&_0x2db68d!==_0x4a94b0[_0x5f143b(0x1f9)])throw CliErrors['validation'](_0x5f143b(0x21a)+_0x2db68d+'\x22\x20and\x20\x22'+_0x4a94b0[_0x5f143b(0x1f9)]+'\x22:\x20both\x20target\x20\x22'+_0x4a94b0[_0x5f143b(0x262)]+_0x5f143b(0x24d));if(_0x348c33[_0x5f143b(0x205)](_0x4a94b0[_0x5f143b(0x262)]))throw CliErrors[_0x5f143b(0x21e)](_0x5f143b(0x256)+_0x4a94b0['oldLockKey']+_0x5f143b(0x242)+_0x4a94b0[_0x5f143b(0x262)]+_0x5f143b(0x264));_0x107e04[_0x5f143b(0x263)](_0x4a94b0[_0x5f143b(0x262)],_0x4a94b0[_0x5f143b(0x1f9)]);}}const _0x4dc3a7=new Map();for(const [_0xa2ce51,_0x212b97]of _0x3bc841){_0x4dc3a7['set'](hookDirectoryIdentity(_0x212b97),_0xa2ce51);}const _0x5c032d=[];for(const [_0x42cb98,_0x58de95]of _0x2d3c6a){const _0x339479=_0x58de95[_0x5f143b(0x1e5)]??_0x58de95[_0x5f143b(0x24e)],_0x40c073=join(_0x11aae3[_0x5f143b(0x217)],_0x5f143b(0x239),_0x42cb98),_0x33e45b=join(_0x11aae3[_0x5f143b(0x217)],_0x5f143b(0x239),_0x339479),_0x1419e1=await directoryExists(_0x40c073),_0x20208a=await directoryExists(_0x33e45b),_0x5678c5=_0x1419e1?_0x20208a?await sameDirectory(_0x40c073,_0x33e45b)?_0x5f143b(0x254):undefined:_0x5f143b(0x21d):_0x5f143b(0x1f4);if(!_0x5678c5)throw CliErrors[_0x5f143b(0x21e)](_0x5f143b(0x267)+_0x42cb98+_0x5f143b(0x22e)+_0x339479+_0x5f143b(0x20b));const _0x46ec83=_0x4dc3a7[_0x5f143b(0x22a)](hookDirectoryIdentity(_0x42cb98));if(_0x46ec83&&_0x46ec83!==_0x58de95['datasetCode'][_0x5f143b(0x26a)]()){const _0x3e8243=new Set(_0x58de95[_0x5f143b(0x20c)][_0x5f143b(0x265)](_0x2fbd01=>_0x2fbd01[_0x5f143b(0x1f9)])),_0x3ba6be=_0x4416cf[_0x5f143b(0x1f5)](_0x41ca19=>_0x41ca19[_0x5f143b(0x236)]==='HOOK'&&_0x41ca19[_0x5f143b(0x1e5)]!=null&&hookDirectoryIdentity(_0x41ca19['alias'])===hookDirectoryIdentity(_0x42cb98)&&!_0x3e8243['has'](_0x41ca19[_0x5f143b(0x231)]));if(_0x3ba6be[_0x5f143b(0x237)]>0x0)throw CliErrors['validation'](_0x5f143b(0x267)+_0x42cb98+_0x5f143b(0x225));}const _0x1e8c5f=_0x4dc3a7[_0x5f143b(0x22a)](hookDirectoryIdentity(_0x339479));if(_0x1e8c5f&&_0x1e8c5f!==_0x58de95[_0x5f143b(0x24e)]['toLowerCase']())throw CliErrors['validation'](_0x5f143b(0x267)+_0x42cb98+_0x5f143b(0x22e)+_0x339479+_0x5f143b(0x266));for(const _0x28a5b5 of _0x58de95[_0x5f143b(0x20c)]){const _0x18260d=_0x57ffd5[_0x5f143b(0x249)][_0x28a5b5[_0x5f143b(0x262)]];if(_0x18260d&&!_0x348c33[_0x5f143b(0x205)](_0x28a5b5[_0x5f143b(0x262)])&&!sameHookIdentity(_0x28a5b5[_0x5f143b(0x23b)],_0x18260d))throw CliErrors[_0x5f143b(0x21e)](_0x5f143b(0x267)+_0x42cb98+'\x22\x20to\x20\x22'+_0x339479+_0x5f143b(0x1df));}_0x5c032d[_0x5f143b(0x260)]({'oldDirectory':_0x42cb98,'newDirectory':_0x339479,'oldDirectoryPath':_0x40c073,'newDirectoryPath':_0x33e45b,'mode':_0x5678c5,'alias':_0x58de95[_0x5f143b(0x1e5)],'keyChanges':_0x58de95['keyChanges']});}const _0x30e17f={..._0x57ffd5[_0x5f143b(0x249)]},_0x36614a=new Map(),_0xd41ddd=new Map();for(const _0xa8e7ee of _0x5c032d){const _0x452d83=_0xa8e7ee[_0x5f143b(0x25f)]!==_0x5f143b(0x1f4);_0x452d83&&_0xd41ddd[_0x5f143b(0x263)](hookDirectoryIdentity(_0xa8e7ee[_0x5f143b(0x214)]),_0xa8e7ee['oldDirectoryPath']);for(const _0x588deb of _0xa8e7ee[_0x5f143b(0x20c)]){const _0x15c75c=_0x30e17f[_0x588deb['newLockKey']],_0xe1b099=_0x452d83?_0x588deb[_0x5f143b(0x23b)]:_0x15c75c??_0x588deb[_0x5f143b(0x23b)];_0x30e17f[_0x588deb[_0x5f143b(0x262)]]=canonicalizeHookEntry(_0xe1b099,_0xa8e7ee[_0x5f143b(0x1e5)]),delete _0x30e17f[_0x588deb['oldLockKey']],_0x452d83&&_0x36614a['set'](_0x588deb['newLockKey'],resolveLocalFilePathFromLockKey(_0x11aae3,_0x588deb['oldLockKey']));}}return{'migrations':_0x5c032d,'projectedFunctions':_0x30e17f,'sourceFilePathByNewLockKey':_0x36614a,'sourceDirectoryPathByNewDirectory':_0xd41ddd};}function resolveMigratedSourceFilePath(_0x3ec12f,_0x3c0203){const _0x1933e8=a43_0x24b3b8;if(!_0x3ec12f||!_0x3c0203)return undefined;const _0x3d6d21=_0x3ec12f[_0x1933e8(0x1ff)]['get'](_0x3c0203[_0x1933e8(0x231)]);if(_0x3d6d21)return _0x3d6d21;if(_0x3c0203[_0x1933e8(0x236)]!==_0x1933e8(0x239))return undefined;const [,_0x3f3f55,..._0x320569]=_0x3c0203[_0x1933e8(0x231)][_0x1933e8(0x227)]('/');if(!_0x3f3f55||_0x320569[_0x1933e8(0x237)]===0x0)return undefined;const _0x4295eb=_0x3ec12f[_0x1933e8(0x22c)][_0x1933e8(0x22a)](hookDirectoryIdentity(_0x3f3f55));return _0x4295eb?join(_0x4295eb,..._0x320569)+_0x1933e8(0x1ec):undefined;}function sameHookIdentity(_0x50bdef,_0x1b9088){const _0x43b955=a43_0x24b3b8;return _0x50bdef[_0x43b955(0x202)]===_0x1b9088[_0x43b955(0x202)]&&_0x50bdef[_0x43b955(0x24e)]===_0x1b9088[_0x43b955(0x24e)]&&_0x50bdef[_0x43b955(0x25c)]===_0x1b9088[_0x43b955(0x25c)]&&_0x50bdef[_0x43b955(0x246)]===_0x1b9088[_0x43b955(0x246)];}function canonicalizeHookEntry(_0x30c5cf,_0x231a4b){const {alias:_0x403318,..._0xcdb6e8}=_0x30c5cf;return _0x231a4b?{..._0xcdb6e8,'alias':_0x231a4b}:_0xcdb6e8;}function hookDirectoryIdentity(_0x533c00){const _0xacc40d=a43_0x24b3b8;return _0x533c00[_0xacc40d(0x1d6)](_0xacc40d(0x20f))[_0xacc40d(0x26a)]();}function isSafeHookDirectorySegment(_0x3ad914){return isSafeLockKeySegment(_0x3ad914);}async function sameDirectory(_0x4daad8,_0x321dbb){const _0x1ec111=a43_0x24b3b8,[_0x30bdf8,_0x2cc475]=await Promise['all']([stat(_0x4daad8),stat(_0x321dbb)]);return _0x30bdf8[_0x1ec111(0x233)]===_0x2cc475[_0x1ec111(0x233)]&&_0x30bdf8[_0x1ec111(0x1de)]===_0x2cc475['ino'];}async function applyHookDirectoryMigration(_0x7ad9c9,_0x3ce259){const _0x978626=a43_0x24b3b8,_0x34c8ce=_0x3ce259[_0x978626(0x249)],_0x44da71=_0x3ce259[_0x978626(0x1e1)],_0xf71e57=[],_0x54b986=async()=>{const _0x2f32f2=_0x978626,_0x30ccb0=[];_0x3ce259[_0x2f32f2(0x249)]=_0x34c8ce,_0x3ce259[_0x2f32f2(0x1e1)]=_0x44da71;for(const {migration:_0x2110ca,temporaryPath:_0x523a75}of[..._0xf71e57]['reverse']()){try{_0x523a75?(await rename(_0x2110ca[_0x2f32f2(0x22f)],_0x523a75),await rename(_0x523a75,_0x2110ca[_0x2f32f2(0x25a)])):await rename(_0x2110ca['newDirectoryPath'],_0x2110ca['oldDirectoryPath']);}catch(_0x51ba96){_0x30ccb0[_0x2f32f2(0x260)](new Error(_0x2f32f2(0x243)+_0x2110ca['oldDirectory']+'\x22\x20from\x20\x22'+_0x2110ca[_0x2f32f2(0x214)]+'\x22:\x20'+(_0x51ba96 instanceof Error?_0x51ba96[_0x2f32f2(0x223)]:String(_0x51ba96))));}}return _0x30ccb0;};try{for(const _0x579109 of _0x7ad9c9[_0x978626(0x1dc)]){if(_0x579109[_0x978626(0x25f)]===_0x978626(0x21d))await ensureParentDirectory(_0x579109[_0x978626(0x22f)]),await rename(_0x579109[_0x978626(0x25a)],_0x579109[_0x978626(0x22f)]),_0xf71e57['push']({'migration':_0x579109});else{if(_0x579109[_0x978626(0x25f)]===_0x978626(0x254)){const _0x5bf54c=join(dirname(_0x579109[_0x978626(0x25a)]),_0x978626(0x257)+randomUUID());await rename(_0x579109[_0x978626(0x25a)],_0x5bf54c);try{await rename(_0x5bf54c,_0x579109[_0x978626(0x22f)]);}catch(_0x57c7e0){try{await rename(_0x5bf54c,_0x579109[_0x978626(0x25a)]);}catch(_0x2d6fb1){throw withRollbackErrors(_0x57c7e0,_0x978626(0x206)+_0x579109['oldDirectory']+_0x978626(0x22e)+_0x579109[_0x978626(0x214)]+_0x978626(0x1f8)+_0x5bf54c+_0x978626(0x1db),[new Error(_0x978626(0x22d)+_0x5bf54c+'\x22\x20to\x20\x22'+_0x579109[_0x978626(0x244)]+_0x978626(0x24b)+(_0x2d6fb1 instanceof Error?_0x2d6fb1[_0x978626(0x223)]:String(_0x2d6fb1)))]);}throw _0x57c7e0;}_0xf71e57[_0x978626(0x260)]({'migration':_0x579109,'temporaryPath':_0x5bf54c});}}}return _0x3ce259[_0x978626(0x249)]=_0x7ad9c9[_0x978626(0x1da)],{'rollback':_0x54b986};}catch(_0x21a53b){const _0x5a2892=await _0x54b986();throw withRollbackErrors(_0x21a53b,'Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x5a2892);}}async function confirmForce(){const _0x1ef4cf=a43_0x24b3b8,_0x4cec76=createInterface({'input':process[_0x1ef4cf(0x25e)],'output':process[_0x1ef4cf(0x248)]}),_0x21e828=await new Promise(_0x4cc472=>{_0x4cec76['question']('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x4cc472);});return _0x4cec76[_0x1ef4cf(0x1e4)](),['y',_0x1ef4cf(0x1e8)]['includes'](_0x21e828[_0x1ef4cf(0x24c)]()[_0x1ef4cf(0x26a)]());}