@lovrabet/rabetbase-cli 2.5.12 → 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 (380) 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/guides/custom-page-workflow.md +32 -2
  375. package/skills/rabetbase/knowledge/custom-page/generation-standards.md +106 -6
  376. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  377. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  378. package/skills/rabetbase.manifest.json +3 -3
  379. package/templates/custom-pages/blank.json +1 -1
  380. package/templates/custom-pages/dashboard.json +1 -1
@@ -1 +1 @@
1
- const a34_0x4c672b=a34_0x184b;(function(_0x46c2ef,_0x4c2f82){const _0x34ea07=a34_0x184b,_0x3a3f0a=_0x46c2ef();while(!![]){try{const _0xb6ef61=parseInt(_0x34ea07(0xfd))/0x1+parseInt(_0x34ea07(0xe9))/0x2*(parseInt(_0x34ea07(0xeb))/0x3)+-parseInt(_0x34ea07(0xf4))/0x4*(-parseInt(_0x34ea07(0xf2))/0x5)+parseInt(_0x34ea07(0x102))/0x6+parseInt(_0x34ea07(0xfc))/0x7*(-parseInt(_0x34ea07(0xf6))/0x8)+parseInt(_0x34ea07(0xf7))/0x9+-parseInt(_0x34ea07(0x101))/0xa*(parseInt(_0x34ea07(0x100))/0xb);if(_0xb6ef61===_0x4c2f82)break;else _0x3a3f0a['push'](_0x3a3f0a['shift']());}catch(_0x3dfc18){_0x3a3f0a['push'](_0x3a3f0a['shift']());}}}(a34_0x34ef,0xae45c));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x34ef(){const _0x1acbdc=['number','POST','get','Updated','/smartapi/app-config/create','appCode','255eYJUEi','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','10980eYASkL','set','6649648yODMRJ','5723244cmFaZJ','Read\x20config\x20value\x20from\x20file','string','Created','/smartapi/app-config/update','7hToWTG','1418809SCNpTM',',\x20appCode=','update','20185187eJvoLL','10HFWVKB','1231920sKZgKO','app-config','create','write','tags','626VNkuqu','isFinite','9393cFTKDj'];a34_0x34ef=function(){return _0x1acbdc;};return a34_0x34ef();}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_0x184b(_0x32aea3,_0x1aee19){_0x32aea3=_0x32aea3-0xe5;const _0x34ef68=a34_0x34ef();let _0x184b3d=_0x34ef68[_0x32aea3];return _0x184b3d;}const CREATE_PATH=a34_0x4c672b(0xf0),UPDATE_PATH=a34_0x4c672b(0xfb);export const appConfigSet={'service':a34_0x4c672b(0xe5),'command':a34_0x4c672b(0xf5),'description':a34_0x4c672b(0xf3),'risk':a34_0x4c672b(0xe7),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':'file','type':a34_0x4c672b(0xf9),'description':a34_0x4c672b(0xf8)}],async 'validate'(_0x4e1cff){readKeyArg(_0x4e1cff),readOptionalTags(_0x4e1cff),assertSingleValueSource(_0x4e1cff);},async 'dryRun'(_0x3d6fb0){const _0x19ce32=a34_0x4c672b,_0x254789=readKeyArg(_0x3d6fb0),_0x1b66db=readOptionalTags(_0x3d6fb0),_0x1eb3bd=assertSingleValueSource(_0x3d6fb0);await assertValueSourceReadable(_0x1eb3bd);const _0x37e366=await withAppConfigApiBoundary(_0x19ce32(0xee),{'appCode':_0x3d6fb0['appCode'],'key':_0x254789},()=>getAppConfigByKey(_0x3d6fb0[_0x19ce32(0xf1)],_0x254789)),_0x183c20=_0x37e366?_0x19ce32(0xff):'create',_0x4fdd26=_0x37e366?projectAppConfig(_0x37e366):null,_0x1023ee=plannedAppConfig({'appCode':_0x3d6fb0[_0x19ce32(0xf1)],'key':_0x254789,'tags':_0x1b66db??_0x37e366?.[_0x19ce32(0xe8)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x183c20,'appCode':_0x3d6fb0['appCode'],'key':_0x254789,'before':_0x4fdd26,'after':_0x1023ee,'dryRun':!![]}),{'method':_0x19ce32(0xed),'url':_0x183c20===_0x19ce32(0xff)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x704073){const _0x485dab=a34_0x4c672b,_0x15ce7b=readKeyArg(_0x704073),_0x201360=readOptionalTags(_0x704073),_0x52b468=await withAppConfigApiBoundary(_0x485dab(0xee),{'appCode':_0x704073[_0x485dab(0xf1)],'key':_0x15ce7b},()=>getAppConfigByKey(_0x704073[_0x485dab(0xf1)],_0x15ce7b)),_0x5dc6b8=_0x52b468?projectAppConfig(_0x52b468):null,_0x58564=_0x52b468?_0x485dab(0xff):_0x485dab(0xe6),{value:_0x5e3528,warnings:_0x2ce1f1}=await readAppConfigValue(_0x704073),_0x4d8409={'appCode':_0x704073['appCode'],'key':_0x15ce7b,'value':_0x5e3528,'tags':_0x201360??_0x52b468?.[_0x485dab(0xe8)]??undefined};await withAppConfigApiBoundary(_0x58564,{'appCode':_0x704073[_0x485dab(0xf1)],'key':_0x15ce7b},async()=>{_0x52b468?await updateAppConfig({..._0x4d8409,'id':requireAppConfigId(_0x52b468,_0x15ce7b,_0x704073['appCode'])}):await createAppConfig(_0x4d8409);});const _0x4d440b=await withAppConfigApiBoundary(_0x485dab(0xee),{'appCode':_0x704073[_0x485dab(0xf1)],'key':_0x15ce7b},()=>getAppConfigByKey(_0x704073[_0x485dab(0xf1)],_0x15ce7b)),_0x10440e=_0x4d440b?projectAppConfig(_0x4d440b):plannedAppConfig({'appCode':_0x704073[_0x485dab(0xf1)],'key':_0x15ce7b,'tags':_0x4d8409[_0x485dab(0xe8)],'hasValue':_0x5e3528!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x58564,'appCode':_0x704073[_0x485dab(0xf1)],'key':_0x15ce7b,'before':_0x5dc6b8,'after':_0x10440e,'dryRun':![],'warnings':_0x2ce1f1}),'message':(_0x58564===_0x485dab(0xff)?_0x485dab(0xef):_0x485dab(0xfa))+'\x20app\x20config\x20'+_0x15ce7b};}};function requireAppConfigId(_0x56bcdd,_0x4e08d0,_0x54917e){const _0x2f897c=a34_0x4c672b;if(typeof _0x56bcdd['id']===_0x2f897c(0xec)&&Number[_0x2f897c(0xea)](_0x56bcdd['id'])&&_0x56bcdd['id']>0x0)return _0x56bcdd['id'];throw CliErrors['apiError']('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x4e08d0+_0x2f897c(0xfe)+_0x54917e);}
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_0x3c0d5a=a35_0x2d0d;(function(_0x39cf29,_0x54bef1){const _0x5c2b70=a35_0x2d0d,_0x3f4924=_0x39cf29();while(!![]){try{const _0x149d90=parseInt(_0x5c2b70(0xe7))/0x1*(parseInt(_0x5c2b70(0x118))/0x2)+-parseInt(_0x5c2b70(0x113))/0x3+parseInt(_0x5c2b70(0xec))/0x4+-parseInt(_0x5c2b70(0xfe))/0x5*(-parseInt(_0x5c2b70(0x121))/0x6)+parseInt(_0x5c2b70(0x11b))/0x7+parseInt(_0x5c2b70(0x108))/0x8*(-parseInt(_0x5c2b70(0xf8))/0x9)+-parseInt(_0x5c2b70(0x124))/0xa*(parseInt(_0x5c2b70(0x11a))/0xb);if(_0x149d90===_0x54bef1)break;else _0x3f4924['push'](_0x3f4924['shift']());}catch(_0x58db3c){_0x3f4924['push'](_0x3f4924['shift']());}}}(a35_0x40f0,0x99823));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x3c0d5a(0xea),'description':a35_0x3c0d5a(0xfd),'required':!![]};function a35_0x40f0(){const _0xe52822=['path','value\x20is\x20redacted','dryRun','flag','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','from-env','reveal','210636NnFBoC','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','end','name','App\x20config\x20value\x20source\x20is\x20ambiguous.','Runtime\x20app-config\x20key','1600adINGB','warnings','tags','Read\x20config\x20value\x20from\x20stdin','Config\x20tags\x20for\x20filtering/display\x20metadata','setEncoding','key:\x20','args','Value\x20file\x20is\x20not\x20readable:\x20','boolean','32mPzQqO','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','gmtCreate','push','gmtModified','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','stdin','join','before','kind','value','3485688UPrxVJ','Environment\x20variable\x20is\x20not\x20set:\x20','Missing\x20app-config\x20key.','hasValue','appCode','46WzbURl','error','10047851Gwcrgj','7989975DzxJBY','operation','after','apiError','validation','Failed\x20to\x20','13254QmFlqg','url','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','10jfZaqs','str','slice','once','trim','41027CCEEyJ','env','method','key','length','23192UijlWJ','utf8','\x20app\x20config.','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','file'];a35_0x40f0=function(){return _0xe52822;};return a35_0x40f0();}function a35_0x2d0d(_0x4622da,_0x26dac0){_0x4622da=_0x4622da-0xe5;const _0x40f043=a35_0x40f0();let _0x2d0d7f=_0x40f043[_0x4622da];return _0x2d0d7f;}export const VALUE_ARG={'name':a35_0x3c0d5a(0x112),'description':a35_0x3c0d5a(0xef),'required':![]};export const TAGS_FLAG={'name':a35_0x3c0d5a(0x100),'type':'string','description':a35_0x3c0d5a(0x102)};export const STDIN_FLAG={'name':a35_0x3c0d5a(0x10e),'type':a35_0x3c0d5a(0x107),'description':a35_0x3c0d5a(0x101),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x3c0d5a(0xf6),'type':'string','description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a35_0x3c0d5a(0xf7),'type':a35_0x3c0d5a(0x107),'description':a35_0x3c0d5a(0x10d),'default':![]};export function readKeyArg(_0x2dc410){const _0x2604c2=a35_0x3c0d5a,_0x1724f8=_0x2dc410[_0x2604c2(0x105)][0x0]?.['trim']()??'';return validateKey(_0x1724f8),_0x1724f8;}export function readOptionalTags(_0x544810){const _0x5b4320=a35_0x3c0d5a,_0x4dd384=_0x544810[_0x5b4320(0x125)](_0x5b4320(0x100))[_0x5b4320(0xe6)]();if(!_0x4dd384)return undefined;if(_0x4dd384[_0x5b4320(0xeb)]>0x20)throw CliErrors[_0x5b4320(0x11f)]('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x4dd384;}export function validateKey(_0x4240f5){const _0xa3e271=a35_0x3c0d5a;if(!_0x4240f5)throw CliErrors[_0xa3e271(0x11f)](_0xa3e271(0x115));if(_0x4240f5[_0xa3e271(0xeb)]>0x100)throw CliErrors[_0xa3e271(0x11f)](_0xa3e271(0xf9));}export function projectAppConfig(_0x4deff1,_0x1fdf00){const _0x207327=a35_0x3c0d5a,_0x131428=_0x4deff1[_0x207327(0x112)]!==undefined&&_0x4deff1[_0x207327(0x112)]!==null&&_0x4deff1[_0x207327(0x112)]!=='',_0x582aa9={'appCode':_0x4deff1[_0x207327(0x117)],'key':_0x4deff1['key'],'tags':_0x4deff1[_0x207327(0x100)]??undefined,'hasValue':_0x131428,'valueRedacted':_0x131428&&!_0x1fdf00?.[_0x207327(0xf7)],'gmtCreate':_0x4deff1[_0x207327(0x10a)],'gmtModified':_0x4deff1[_0x207327(0x10c)]};return _0x1fdf00?.['reveal']&&(_0x582aa9[_0x207327(0x112)]=_0x4deff1['value']??'',_0x582aa9['valueRedacted']=![]),_0x582aa9;}export function plannedAppConfig(_0x1c7200){const _0x189277=a35_0x3c0d5a,_0x2d7b42=_0x1c7200[_0x189277(0x116)]??!![];return{'appCode':_0x1c7200['appCode'],'key':_0x1c7200[_0x189277(0xea)],'tags':_0x1c7200[_0x189277(0x100)]??undefined,'hasValue':_0x2d7b42,'valueRedacted':_0x2d7b42};}export function buildMutationData(_0xe081c2){const _0x3bb73c=a35_0x3c0d5a;return{'operation':_0xe081c2[_0x3bb73c(0x11c)],'selector':{'appCode':_0xe081c2[_0x3bb73c(0x117)],'key':_0xe081c2[_0x3bb73c(0xea)]},'before':_0xe081c2[_0x3bb73c(0x110)],'after':_0xe081c2[_0x3bb73c(0x11d)],'dryRun':_0xe081c2[_0x3bb73c(0xf3)],'warnings':_0xe081c2[_0x3bb73c(0xff)]??[]};}export async function withAppConfigApiBoundary(_0x230285,_0xd62c76,_0xead381){const _0x12abf4=a35_0x3c0d5a;try{return await _0xead381();}catch{const _0x244d04=['appCode:\x20'+_0xd62c76[_0x12abf4(0x117)]];if(_0xd62c76[_0x12abf4(0xea)])_0x244d04['push'](_0x12abf4(0x104)+_0xd62c76['key']);_0x244d04[_0x12abf4(0x10b)](_0x12abf4(0xf2));throw CliErrors[_0x12abf4(0x11e)](_0x12abf4(0x120)+_0x230285+_0x12abf4(0xee),_0x244d04[_0x12abf4(0x10f)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x5798d8,_0x2e0c72){const _0x531996=a35_0x3c0d5a;return Object['defineProperties'](_0x5798d8,{'method':{'value':_0x2e0c72[_0x531996(0xe9)],'enumerable':![]},'url':{'value':_0x2e0c72[_0x531996(0x122)],'enumerable':![]}});}export function assertSingleValueSource(_0x3096c6){const _0x229f6a=a35_0x3c0d5a,_0x60ef38=[];_0x3096c6[_0x229f6a(0x105)][_0x229f6a(0xeb)]>0x1&&_0x60ef38['push']({'kind':'argument','value':_0x3096c6[_0x229f6a(0x105)][_0x229f6a(0x126)](0x1)[_0x229f6a(0x10f)]('\x20')});const _0x246116=_0x3096c6[_0x229f6a(0xf4)]('value');_0x246116!==undefined&&_0x246116!==null&&_0x60ef38[_0x229f6a(0x10b)]({'kind':'argument','value':String(_0x246116)});_0x3096c6['bool']('stdin')&&_0x60ef38[_0x229f6a(0x10b)]({'kind':_0x229f6a(0x10e)});const _0xad62c9=_0x3096c6[_0x229f6a(0x125)](_0x229f6a(0xf6))[_0x229f6a(0xe6)]();_0xad62c9&&_0x60ef38[_0x229f6a(0x10b)]({'kind':'env','name':_0xad62c9});const _0x98c5c8=_0x3096c6[_0x229f6a(0x125)]('file')[_0x229f6a(0xe6)]();_0x98c5c8&&_0x60ef38[_0x229f6a(0x10b)]({'kind':_0x229f6a(0xf0),'path':_0x98c5c8});if(_0x60ef38['length']===0x0)throw CliErrors[_0x229f6a(0x11f)]('Missing\x20app-config\x20value\x20source.',_0x229f6a(0x123));if(_0x60ef38[_0x229f6a(0xeb)]>0x1)throw CliErrors[_0x229f6a(0x11f)](_0x229f6a(0xfc),_0x229f6a(0x109));return _0x60ef38[0x0];}export async function assertValueSourceReadable(_0x466157){const _0x27cb90=a35_0x3c0d5a;if(_0x466157['kind']===_0x27cb90(0xe8)&&!(_0x466157[_0x27cb90(0xfb)]in process.env))throw CliErrors['validation'](_0x27cb90(0x114)+_0x466157[_0x27cb90(0xfb)]);if(_0x466157[_0x27cb90(0x111)]===_0x27cb90(0xf0))try{await access(_0x466157[_0x27cb90(0xf1)]);}catch{throw CliErrors[_0x27cb90(0x11f)](_0x27cb90(0x106)+_0x466157[_0x27cb90(0xf1)]);}}export async function readAppConfigValue(_0x11a8be){const _0x541e0b=a35_0x3c0d5a,_0x982c5=assertSingleValueSource(_0x11a8be),_0x38c5ec=[];if(_0x982c5['kind']==='argument')return _0x38c5ec[_0x541e0b(0x10b)](_0x541e0b(0xf5)),{'value':_0x982c5[_0x541e0b(0x112)]??'','source':_0x982c5['kind'],'warnings':_0x38c5ec};if(_0x982c5[_0x541e0b(0x111)]==='stdin')return{'value':await readStdin(),'source':_0x982c5[_0x541e0b(0x111)],'warnings':_0x38c5ec};if(_0x982c5['kind']==='env'){if(!(_0x982c5[_0x541e0b(0xfb)]in process.env))throw CliErrors[_0x541e0b(0x11f)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x982c5[_0x541e0b(0xfb)]);return{'value':process.env[_0x982c5.name]??'','source':_0x982c5[_0x541e0b(0x111)],'warnings':_0x38c5ec};}return{'value':await readFile(_0x982c5['path'],_0x541e0b(0xed)),'source':_0x982c5[_0x541e0b(0x111)],'warnings':_0x38c5ec};}function readStdin(){return new Promise((_0x59f382,_0xe0699d)=>{const _0x4812a2=a35_0x2d0d;let _0x2c1f71='';process['stdin'][_0x4812a2(0x103)](_0x4812a2(0xed)),process[_0x4812a2(0x10e)]['on']('data',_0x5206b7=>{_0x2c1f71+=_0x5206b7;}),process[_0x4812a2(0x10e)][_0x4812a2(0xe5)](_0x4812a2(0xfa),()=>_0x59f382(_0x2c1f71)),process[_0x4812a2(0x10e)][_0x4812a2(0xe5)](_0x4812a2(0x119),_0xe0699d);});}
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_0xefae40=a36_0x488b;(function(_0x38c68a,_0x604838){const _0x12b2b2=a36_0x488b,_0x118d9b=_0x38c68a();while(!![]){try{const _0x394114=-parseInt(_0x12b2b2(0x123))/0x1*(parseInt(_0x12b2b2(0x12a))/0x2)+-parseInt(_0x12b2b2(0x128))/0x3+parseInt(_0x12b2b2(0x124))/0x4*(-parseInt(_0x12b2b2(0x11b))/0x5)+-parseInt(_0x12b2b2(0x118))/0x6*(parseInt(_0x12b2b2(0x125))/0x7)+-parseInt(_0x12b2b2(0x11f))/0x8+parseInt(_0x12b2b2(0x11d))/0x9+-parseInt(_0x12b2b2(0x127))/0xa*(-parseInt(_0x12b2b2(0x121))/0xb);if(_0x394114===_0x604838)break;else _0x118d9b['push'](_0x118d9b['shift']());}catch(_0x3639c0){_0x118d9b['push'](_0x118d9b['shift']());}}}(a36_0x4f90,0x58ddc));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x4f90(){const _0x39e402=['10GgArCk','1866267IImRDh','log','26282TZUJWq','Login\x20via\x20browser','auth','nonInteractive','logout','!\x20Not\x20logged\x20in','405102kIZYpA','yes','bool','175gfTQOB','Clear\x20login\x20session','4128543ifTDCJ','write','3324184nbZBKB','✓\x20Logged\x20out','19316341aFXSpq','boolean','41gJpJym','15924RzXQlR','14keZyfF','../../auth/auth-server-ui.js'];a36_0x4f90=function(){return _0x39e402;};return a36_0x4f90();}function a36_0x488b(_0x5524cb,_0x596f10){_0x5524cb=_0x5524cb-0x114;const _0x4f9049=a36_0x4f90();let _0x488b73=_0x4f9049[_0x5524cb];return _0x488b73;}export const authDefinitions=[{'service':a36_0xefae40(0x114),'command':'login','description':a36_0xefae40(0x12b),'risk':a36_0xefae40(0x11e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0xefae40(0x119),'type':a36_0xefae40(0x122),'description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0x2c01a0){const _0x4820bb=a36_0xefae40,{runAuthServer:_0x2ba8d1}=await import(_0x4820bb(0x126));return await _0x2ba8d1({'autoYes':_0x2c01a0[_0x4820bb(0x11a)]('yes'),'nonInteractive':_0x2c01a0[_0x4820bb(0x115)]}),{'ok':!![]};}},{'service':a36_0xefae40(0x114),'command':a36_0xefae40(0x116),'description':a36_0xefae40(0x11c),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2e839d){const _0x4998a1=a36_0xefae40;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x4998a1(0x129)](_0x4998a1(0x120))):console[_0x4998a1(0x129)](_0x4998a1(0x117)),{'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_0x3f9438=a37_0x5388;(function(_0x34151e,_0x26bc2f){const _0x5a161f=a37_0x5388,_0x3add4b=_0x34151e();while(!![]){try{const _0x14a1eb=-parseInt(_0x5a161f(0x183))/0x1+-parseInt(_0x5a161f(0x15b))/0x2*(-parseInt(_0x5a161f(0x163))/0x3)+parseInt(_0x5a161f(0x17b))/0x4+-parseInt(_0x5a161f(0x191))/0x5+-parseInt(_0x5a161f(0x151))/0x6*(parseInt(_0x5a161f(0x1ab))/0x7)+-parseInt(_0x5a161f(0x185))/0x8*(parseInt(_0x5a161f(0x169))/0x9)+parseInt(_0x5a161f(0x19f))/0xa;if(_0x14a1eb===_0x26bc2f)break;else _0x3add4b['push'](_0x3add4b['shift']());}catch(_0x16ae2d){_0x3add4b['push'](_0x3add4b['shift']());}}}(a37_0x285c,0x2529d));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a37_0x285c(){const _0xa9b568=['.js','688SmmBuh','\x20api\x20pull`\x20to\x20refresh.','validation','find','read','description','str','keys','datasetCode','ENDPOINT','Available\x20aliases:\x20','datasetId','45180MKLOkL','alias','operationType','name','nonInteractive','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','修改后的响应结果','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','HOOK','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','scriptsRootDir','Trigger\x20node\x20(HOOK\x20only)','No\x20model\x20aliases\x20found.\x20Run\x20`','6267000srhPft','question','operation-type','HOOK\x20requires\x20alias/operation/node\x20options.','datasetcode','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','currentApp','mergedCli','close','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','apiDir','/HOOK/','256179jYFyqK','after','includes','Select\x20trigger\x20node:','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Function\x20name\x20(valid\x20JS\x20identifier)','before',']\x20(','stderr','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','当前请求参数','\x22\x20not\x20found\x20for\x20dataset\x20','/ENDPOINT/','Created\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','selectedAppName','42gOMmIk','\x0a\x20*\x20[平台配置]\x20','/**\x0a\x20*\x20','UNKNOWN','utf8','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','Available:\x20','Invalid\x20dataset\x20selection.','/COMMON/','filePath','2ketYQQ','map','bff','Dataset\x20not\x20found\x20for\x20code\x20\x22','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x20function:\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','code','492171ImLWEQ','当前响应结果','/data/dataset/','string','Operation\x20type\x20\x22','Select\x20operation\x20type:','27819CtuXjT','Select\x20dataset:','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','profileName','type','\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','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','trim','write','appCode','Script\x20description','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','join','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','isInteger','Alias\x20\x22','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','functionNode','258640VWNBXE','\x22,\x20params\x20})\x0a','defaultApp','No\x20datasets\x20found\x20for\x20this\x20app.','COMMON','length','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','parseInt','172155yxRckm'];a37_0x285c=function(){return _0xa9b568;};return a37_0x285c();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a37_0x5388(_0x2ee6f6,_0x23bb94){_0x2ee6f6=_0x2ee6f6-0x148;const _0x285c83=a37_0x285c();let _0x53880a=_0x285c83[_0x2ee6f6];return _0x53880a;}import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a37_0x3f9438(0x15d),'command':'create','description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a37_0x3f9438(0x189),'flags':[{'name':a37_0x3f9438(0x16d),'type':a37_0x3f9438(0x166),'required':!![],'enum':[a37_0x3f9438(0x17f),'ENDPOINT',a37_0x3f9438(0x19a)],'description':'Script\x20type'},{'name':a37_0x3f9438(0x194),'type':a37_0x3f9438(0x166),'required':!![],'description':a37_0x3f9438(0x1b0)},{'name':a37_0x3f9438(0x18a),'type':'string','description':a37_0x3f9438(0x173)},{'name':a37_0x3f9438(0x192),'type':a37_0x3f9438(0x166),'description':a37_0x3f9438(0x15f)},{'name':a37_0x3f9438(0x1a3),'type':a37_0x3f9438(0x166),'description':a37_0x3f9438(0x156)},{'name':a37_0x3f9438(0x1a1),'type':'string','description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':a37_0x3f9438(0x166),'description':a37_0x3f9438(0x19d),'enum':['before','after']}],async 'validate'(_0x48ddf1){const _0x188dcb=a37_0x3f9438,_0x5d2f69=_0x48ddf1[_0x188dcb(0x18b)](_0x188dcb(0x194));if(!isValidBffFunctionName(_0x5d2f69))throw CliErrors[_0x188dcb(0x187)]('Invalid\x20function\x20name\x20\x22'+_0x5d2f69+_0x188dcb(0x161));},async 'execute'(_0x42ee45){const _0xb32715=a37_0x3f9438,_0x380afe=loadBffProjectConfig(_0x42ee45['appCode']),_0x515349=_0x42ee45[_0xb32715(0x18b)](_0xb32715(0x16d)),_0x16c02f=_0x42ee45[_0xb32715(0x18b)](_0xb32715(0x194)),_0x29d247=_0x42ee45['str'](_0xb32715(0x18a))||undefined,_0x1cb902=_0x515349===_0xb32715(0x19a)?await resolveHookOptions(_0x380afe,_0x42ee45):undefined,_0x4b9435=buildFilePath(_0x380afe,_0x515349,_0x16c02f,_0x1cb902);if(await fileExists(_0x4b9435))throw CliErrors[_0xb32715(0x187)]('File\x20already\x20exists:\x20'+_0x4b9435);await mkdir(dirname(_0x4b9435),{'recursive':!![]});const _0x3f7749=generateTemplate(_0x515349,_0x16c02f,_0x42ee45[_0xb32715(0x172)],_0x29d247,_0x1cb902);await writeFile(_0x4b9435,_0x3f7749,_0xb32715(0x155));const _0x2d301d={'type':_0x515349,'name':_0x16c02f,'path':_0x4b9435};if(_0x29d247)_0x2d301d[_0xb32715(0x18a)]=_0x29d247;if(_0x1cb902){if(_0x1cb902[_0xb32715(0x192)])_0x2d301d[_0xb32715(0x192)]=_0x1cb902[_0xb32715(0x192)];_0x2d301d[_0xb32715(0x18d)]=_0x1cb902[_0xb32715(0x18d)],_0x2d301d[_0xb32715(0x193)]=_0x1cb902['operationType'],_0x2d301d[_0xb32715(0x17a)]=_0x1cb902['functionNode'];}return{'ok':!![],'data':_0x2d301d,'message':_0xb32715(0x14d)+_0x515349+_0xb32715(0x160)+_0x16c02f};}};async function resolveHookOptions(_0x5087bb,_0x4cb988){const _0x3311fd=a37_0x3f9438,_0x2c34fd=resolveApiModelSource(_0x4cb988[_0x3311fd(0x1a9)],_0x4cb988[_0x3311fd(0x172)],_0x4cb988[_0x3311fd(0x150)]||_0x4cb988[_0x3311fd(0x1a6)]?.[_0x3311fd(0x1a5)]||_0x4cb988[_0x3311fd(0x1a6)]?.[_0x3311fd(0x17d)]),_0x6cbdc7=loadAliasMap(_0x4cb988['apiDir'],undefined,_0x2c34fd[_0x3311fd(0x15a)],_0x2c34fd[_0x3311fd(0x16c)]),_0x2768e2=_0x6cbdc7['length']>0x0;let _0x517a9d,_0x2bd758,_0x4977f0;const _0x5ca964=_0x4cb988[_0x3311fd(0x18b)](_0x3311fd(0x192)),_0x51d61b=_0x4cb988[_0x3311fd(0x18b)](_0x3311fd(0x1a3));if(_0x5ca964){const _0x75d36c=resolveAlias(_0x4cb988[_0x3311fd(0x1a9)],_0x5ca964,undefined,_0x2c34fd[_0x3311fd(0x15a)],_0x2c34fd[_0x3311fd(0x16c)]);if(!_0x75d36c){const _0x4bdfe6=_0x2768e2?_0x3311fd(0x18f)+_0x6cbdc7[_0x3311fd(0x15c)](_0x421705=>_0x421705[_0x3311fd(0x192)])['join'](',\x20'):_0x3311fd(0x19e)+CLI_BIN_NAME+_0x3311fd(0x16f);throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x178)+_0x5ca964+'\x22\x20not\x20found.\x20'+_0x4bdfe6);}_0x517a9d=_0x5ca964,_0x2bd758=_0x75d36c;}else{if(_0x51d61b){_0x2bd758=_0x51d61b;const _0x49a0a4=_0x6cbdc7['find'](_0x5937d3=>_0x5937d3[_0x3311fd(0x18d)]===_0x51d61b);_0x517a9d=_0x49a0a4?.[_0x3311fd(0x192)];}else{if(_0x4cb988[_0x3311fd(0x195)])throw CliErrors[_0x3311fd(0x187)]('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x2768e2){const _0x50a775=_0x6cbdc7[_0x3311fd(0x15c)](_0x5a79ec=>_0x5a79ec[_0x3311fd(0x192)]+'\x20('+_0x5a79ec['tableName']+')'),_0x1e4a5f=await promptSelect(_0x3311fd(0x16a),_0x50a775),_0x20169b=_0x6cbdc7[_0x1e4a5f];if(!_0x20169b)throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x158));_0x517a9d=_0x20169b['alias'],_0x2bd758=_0x20169b[_0x3311fd(0x18d)];}else{const _0x13be40=await listDatasets(_0x4cb988[_0x3311fd(0x172)]);if(_0x13be40[_0x3311fd(0x180)]===0x0)throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x17e));const _0x5adc12=_0x13be40['map'](_0x2f4d08=>_0x2f4d08[_0x3311fd(0x194)]+'\x20['+(_0x2f4d08['source']??_0x3311fd(0x154))+_0x3311fd(0x1b2)+_0x2f4d08[_0x3311fd(0x162)]+')'),_0x489c1f=await promptSelect(_0x3311fd(0x16a),_0x5adc12),_0x5ec956=_0x13be40[_0x489c1f];if(!_0x5ec956)throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x158));_0x2bd758=_0x5ec956[_0x3311fd(0x162)],_0x517a9d=undefined;}}}}const _0x16cc5b=await listDatasets(_0x4cb988[_0x3311fd(0x172)]),_0x2d6764=_0x16cc5b[_0x3311fd(0x188)](_0x333faf=>_0x333faf[_0x3311fd(0x162)]===_0x2bd758);if(!_0x2d6764)throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x15e)+_0x2bd758+'\x22.\x20'+(_0x517a9d?_0x3311fd(0x197)+CLI_BIN_NAME+_0x3311fd(0x186):''));_0x4977f0=_0x2d6764['id'];const _0x5e2c4d=_0x517a9d??_0x2bd758,_0x18afe3=await listBffDatasetOperations(_0x4cb988['appCode'],_0x4977f0),_0xf3e4a0=_0x18afe3?Object[_0x3311fd(0x18c)](_0x18afe3):[];if(_0xf3e4a0[_0x3311fd(0x180)]===0x0)throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x1af)+_0x5e2c4d+'.');let _0x49bcc;const _0x4810db=_0x4cb988[_0x3311fd(0x18b)](_0x3311fd(0x1a1));if(_0x4810db){if(!_0xf3e4a0[_0x3311fd(0x1ad)](_0x4810db))throw CliErrors['validation'](_0x3311fd(0x167)+_0x4810db+_0x3311fd(0x14b)+_0x5e2c4d+'.\x20'+(_0x3311fd(0x157)+_0xf3e4a0[_0x3311fd(0x175)](',\x20')));_0x49bcc=_0x4810db;}else{if(_0x4cb988[_0x3311fd(0x195)])throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x199));const _0xca6cc8=await promptSelect(_0x3311fd(0x168),_0xf3e4a0);_0x49bcc=_0xf3e4a0[_0xca6cc8]??_0xf3e4a0[0x0];}let _0x2deff3=normalizeHookFunctionNode(_0x4cb988['str']('function-node'));if(!_0x2deff3){if(_0x4cb988[_0x3311fd(0x18b)]('function-node'))throw CliErrors[_0x3311fd(0x187)](_0x3311fd(0x1a4));if(_0x4cb988[_0x3311fd(0x195)])throw CliErrors[_0x3311fd(0x187)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x48579d=await promptSelect(_0x3311fd(0x1ae),[_0x3311fd(0x1b1),_0x3311fd(0x1ac)]);_0x2deff3=[_0x3311fd(0x1b1),_0x3311fd(0x1ac)][_0x48579d]??_0x3311fd(0x1b1);}return{'alias':_0x517a9d,'datasetCode':_0x2bd758,'datasetId':_0x4977f0,'operationType':_0x49bcc,'functionNode':_0x2deff3};}async function promptSelect(_0x39e9e3,_0x19cb26){const _0x2e8e1e=a37_0x3f9438;if(_0x19cb26[_0x2e8e1e(0x180)]===0x1)return 0x0;for(const [_0x5c16d6,_0x53fd62]of _0x19cb26['entries']()){process[_0x2e8e1e(0x148)][_0x2e8e1e(0x171)]('\x20\x20'+(_0x5c16d6+0x1)+'.\x20'+_0x53fd62+'\x0a');}const _0x3b1366=createInterface({'input':process['stdin'],'output':process[_0x2e8e1e(0x148)]});while(!![]){const _0x35ef32=await new Promise(_0x4d99f0=>{const _0x42d081=_0x2e8e1e;_0x3b1366[_0x42d081(0x1a0)](_0x39e9e3+'\x20',_0x4d99f0);}),_0x30fe54=Number[_0x2e8e1e(0x182)](_0x35ef32[_0x2e8e1e(0x170)](),0xa);if(Number[_0x2e8e1e(0x177)](_0x30fe54)&&_0x30fe54>=0x1&&_0x30fe54<=_0x19cb26[_0x2e8e1e(0x180)])return _0x3b1366[_0x2e8e1e(0x1a7)](),_0x30fe54-0x1;process[_0x2e8e1e(0x148)][_0x2e8e1e(0x171)](_0x2e8e1e(0x16b)+_0x19cb26['length']+'.\x0a');}}function buildFilePath(_0x346c92,_0x77fca6,_0x58fc03,_0x30440b){const _0x1ab8fc=a37_0x3f9438;if(_0x77fca6===_0x1ab8fc(0x19a)){if(!_0x30440b)throw CliErrors[_0x1ab8fc(0x187)](_0x1ab8fc(0x1a2));const _0x4bd751=_0x30440b[_0x1ab8fc(0x192)]??_0x30440b[_0x1ab8fc(0x18d)];return join(_0x346c92[_0x1ab8fc(0x19c)],_0x1ab8fc(0x19a),_0x4bd751,_0x30440b[_0x1ab8fc(0x193)],_0x30440b[_0x1ab8fc(0x17a)],_0x58fc03+_0x1ab8fc(0x184));}return join(_0x346c92[_0x1ab8fc(0x19c)],_0x77fca6,_0x58fc03+_0x1ab8fc(0x184));}export function generateTemplate(_0xc9d33f,_0x21f053,_0x50d2de,_0x130078,_0x549055){const _0x359d41=a37_0x3f9438,_0x591b2c=_0x130078?.[_0x359d41(0x170)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x3213af=getAppBaseUrl(_0x50d2de),_0x37124d=_0x359d41(0x176);if(_0xc9d33f===_0x359d41(0x17f))return'/**\x0a\x20*\x20'+_0x591b2c+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x21f053+_0x359d41(0x152)+_0x3213af+_0x359d41(0x14e)+_0x50d2de+_0x359d41(0x159)+_0x21f053+_0x359d41(0x179)+_0x21f053+_0x359d41(0x17c)+_0x37124d+_0x359d41(0x16e)+_0x21f053+_0x359d41(0x196);if(_0xc9d33f===_0x359d41(0x18e))return _0x359d41(0x153)+_0x591b2c+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x21f053+_0x359d41(0x14f)+_0x50d2de+'/'+_0x21f053+'\x0a\x20*\x20[平台配置]\x20'+_0x3213af+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x50d2de+_0x359d41(0x14c)+_0x21f053+'.js\x0a'+_0x37124d+'\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'+_0x21f053+_0x359d41(0x196);if(!_0x549055)throw CliErrors['validation'](_0x359d41(0x174));const _0x12cb3b=_0x549055['alias']??_0x549055[_0x359d41(0x18d)],_0x407753=_0x549055[_0x359d41(0x17a)]===_0x359d41(0x1b1)?_0x359d41(0x14a):_0x359d41(0x164),_0x53288a=_0x549055[_0x359d41(0x17a)]===_0x359d41(0x1b1)?'修改后的请求参数':_0x359d41(0x198);return _0x359d41(0x153)+_0x591b2c+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x21f053+_0x359d41(0x181)+_0x50d2de+'/'+_0x549055[_0x359d41(0x18d)]+'/'+_0x549055[_0x359d41(0x193)]+_0x359d41(0x152)+_0x3213af+_0x359d41(0x165)+_0x549055[_0x359d41(0x190)]+_0x359d41(0x149)+_0x50d2de+_0x359d41(0x1aa)+_0x12cb3b+'/'+_0x549055[_0x359d41(0x193)]+'/'+_0x549055[_0x359d41(0x17a)]+'/'+_0x21f053+'.js\x0a\x20*\x20[触发节点]\x20'+_0x549055[_0x359d41(0x17a)]+'\x0a'+_0x37124d+_0x359d41(0x19b)+_0x407753+_0x359d41(0x1a8)+_0x53288a+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x21f053+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';}
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_0x5b005f=a38_0x85dd;(function(_0x4f8b10,_0x5b3965){const _0x4ed2fb=a38_0x85dd,_0x4dbc1e=_0x4f8b10();while(!![]){try{const _0xead74c=-parseInt(_0x4ed2fb(0x1c4))/0x1+-parseInt(_0x4ed2fb(0x1d5))/0x2+-parseInt(_0x4ed2fb(0x1d1))/0x3*(parseInt(_0x4ed2fb(0x1bb))/0x4)+parseInt(_0x4ed2fb(0x1bc))/0x5*(parseInt(_0x4ed2fb(0x1ce))/0x6)+-parseInt(_0x4ed2fb(0x1c0))/0x7*(parseInt(_0x4ed2fb(0x1b9))/0x8)+parseInt(_0x4ed2fb(0x1c6))/0x9+parseInt(_0x4ed2fb(0x1c3))/0xa*(parseInt(_0x4ed2fb(0x1c7))/0xb);if(_0xead74c===_0x5b3965)break;else _0x4dbc1e['push'](_0x4dbc1e['shift']());}catch(_0x447d03){_0x4dbc1e['push'](_0x4dbc1e['shift']());}}}(a38_0x3a58,0x5a512));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';function a38_0x85dd(_0x54ac14,_0xd50f10){_0x54ac14=_0x54ac14-0x1ad;const _0x3a588a=a38_0x3a58();let _0x85ddd0=_0x3a588a[_0x54ac14];return _0x85ddd0;}import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x5b005f(0x1ca),'command':a38_0x5b005f(0x1af),'description':a38_0x5b005f(0x1ba),'risk':'high-risk-write','flags':[{'name':'target','type':'string','required':!![],'description':a38_0x5b005f(0x1ad)}],async 'validate'(_0xb6ec46){const _0xb30b98=a38_0x5b005f,_0x3834f4=loadBffProjectConfig(_0xb6ec46['appCode']),_0x1d67be=await readBffLockFile(_0x3834f4['lockFilePath']);if(!_0x1d67be)throw CliErrors[_0xb30b98(0x1cc)](_0xb30b98(0x1da));},async 'dryRun'(_0xbd62da){const _0x54330c=a38_0x5b005f,_0x7ad9b=loadBffProjectConfig(_0xbd62da['appCode']),_0x2a6551=await readBffLockFile(_0x7ad9b[_0x54330c(0x1d4)]);if(!_0x2a6551)throw CliErrors[_0x54330c(0x1cc)](_0x54330c(0x1d6));const {appLock:_0x334c94}=ensureLockScope(_0x2a6551,_0xbd62da[_0x54330c(0x1b2)],_0x7ad9b['scriptsRoot'],_0x54330c(0x1af)),_0x50ee66=_0xbd62da[_0x54330c(0x1d3)](_0x54330c(0x1be)),_0x1f7b74=Object['keys'](_0x334c94['functions']),_0x231329=resolveDeleteTarget(_0x50ee66,_0x1f7b74),_0x2ff413=_0x334c94[_0x54330c(0x1cf)][_0x231329];if(!_0x2ff413)throw CliErrors[_0x54330c(0x1cc)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x231329+'\x22.');const _0x30875d=resolveLocalFilePathFromLockKey(_0x7ad9b,_0x231329),_0x59d186=relative(_0x7ad9b[_0x54330c(0x1b8)],_0x30875d),_0x14d6e1=join(_0x7ad9b[_0x54330c(0x1cd)],'<timestamp>',_0x59d186);return{'method':'POST','url':_0x54330c(0x1c5),'body':{'appCode':_0xbd62da['appCode'],'target':_0x231329,'remoteId':_0x2ff413[_0x54330c(0x1ae)],'localFilePath':_0x30875d,'trashedPath':_0x14d6e1},'description':_0x54330c(0x1b5)+_0x231329+_0x54330c(0x1bd)};},async 'execute'(_0x234f53){const _0x53b99e=a38_0x5b005f,_0x4db2a1=loadBffProjectConfig(_0x234f53[_0x53b99e(0x1b2)]),_0x46efe9=await readBffLockFile(_0x4db2a1[_0x53b99e(0x1d4)]);if(!_0x46efe9)throw CliErrors[_0x53b99e(0x1cc)](_0x53b99e(0x1d6));const {lockData:_0x2c1348,appLock:_0x22eed4}=ensureLockScope(_0x46efe9,_0x234f53[_0x53b99e(0x1b2)],_0x4db2a1[_0x53b99e(0x1b6)],_0x53b99e(0x1af)),_0x13e089=JSON[_0x53b99e(0x1c9)](JSON['stringify'](_0x2c1348)),_0x537199=_0x13e089['apps'][_0x234f53[_0x53b99e(0x1b2)]];if(!_0x537199)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x234f53[_0x53b99e(0x1b2)]+_0x53b99e(0x1d9));const _0x3bab51=_0x234f53['str'](_0x53b99e(0x1be)),_0x5a831d=Object[_0x53b99e(0x1b7)](_0x537199['functions']),_0x46c952=resolveDeleteTarget(_0x3bab51,_0x5a831d),_0x2bebdc=_0x537199[_0x53b99e(0x1cf)][_0x46c952];if(!_0x2bebdc)throw CliErrors[_0x53b99e(0x1cc)](_0x53b99e(0x1cb)+_0x46c952+'\x22.');await deleteBffScript(_0x2bebdc[_0x53b99e(0x1ae)]),delete _0x537199[_0x53b99e(0x1cf)][_0x46c952],_0x537199[_0x53b99e(0x1d2)]=new Date()[_0x53b99e(0x1bf)](),await writeBffLockFile(_0x4db2a1[_0x53b99e(0x1d4)],_0x13e089);const _0x1225a7=resolveLocalFilePathFromLockKey(_0x4db2a1,_0x46c952);let _0x1f98bf;await fileExists(_0x1225a7)&&(_0x1f98bf=await moveToTrash(_0x4db2a1[_0x53b99e(0x1b8)],_0x4db2a1[_0x53b99e(0x1cd)],_0x1225a7),await cleanupEmptyDirectories(dirname(_0x1225a7),_0x4db2a1[_0x53b99e(0x1d7)]));await waitForDeleteSettlement(_0x4db2a1[_0x53b99e(0x1d4)],_0x234f53[_0x53b99e(0x1b2)],_0x46c952,_0x1225a7),await sleep(0x96);const _0x61522b={'deleted':_0x46c952,'remoteId':_0x2bebdc[_0x53b99e(0x1ae)]};if(_0x1f98bf)_0x61522b[_0x53b99e(0x1b0)]=_0x1f98bf;return{'ok':!![],'data':_0x61522b,'message':'Deleted\x20'+_0x46c952+(_0x1f98bf?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x4459c3,_0x5cc52d){const _0x4950fc=a38_0x5b005f;if(_0x4459c3[_0x4950fc(0x1c1)]('/')){const _0xeb008f=_0x5cc52d['find'](_0x27c0c7=>_0x27c0c7===_0x4459c3);if(!_0xeb008f)throw CliErrors['validation'](_0x4950fc(0x1d0)+_0x4459c3);return _0xeb008f;}const _0x5a2b7d=_0x5cc52d[_0x4950fc(0x1b1)](_0x4c9cce=>_0x4c9cce['split']('/')['at'](-0x1)===_0x4459c3);if(_0x5a2b7d[_0x4950fc(0x1db)]===0x0)throw CliErrors[_0x4950fc(0x1cc)](_0x4950fc(0x1d0)+_0x4459c3);if(_0x5a2b7d[_0x4950fc(0x1db)]>0x1)throw CliErrors[_0x4950fc(0x1cc)](_0x4950fc(0x1d8)+_0x4459c3+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x5a2b7d[_0x4950fc(0x1b3)](_0x59002f=>'\x20\x20-\x20'+_0x59002f)['join']('\x0a'));return _0x5a2b7d[0x0];}async function moveToTrash(_0x8fde12,_0x2cdea7,_0x1ed27f){const _0x20450f=a38_0x5b005f,_0x4a94d4=new Date()[_0x20450f(0x1bf)]()[_0x20450f(0x1c2)](/[:.]/g,'-'),_0x1aa5e3=relative(_0x8fde12,_0x1ed27f),_0x3e53c1=join(_0x2cdea7,_0x4a94d4,_0x1aa5e3);return await mkdir(dirname(_0x3e53c1),{'recursive':!![]}),await rename(_0x1ed27f,_0x3e53c1),_0x3e53c1;}async function cleanupEmptyDirectories(_0x119d2e,_0x4fcd7a){const _0x33cfdf=a38_0x5b005f;let _0x13c17c=resolve(_0x119d2e);const _0x10e1de=resolve(_0x4fcd7a);while(_0x13c17c['startsWith'](''+_0x10e1de+sep)||_0x13c17c===_0x10e1de){if(_0x13c17c===_0x10e1de)return;try{const _0x5a9d3e=await readdir(_0x13c17c);if(_0x5a9d3e[_0x33cfdf(0x1db)]>0x0)return;await rmdir(_0x13c17c);}catch{return;}_0x13c17c=dirname(_0x13c17c);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;function a38_0x3a58(){const _0x589b09=['Local\x20delete\x20not\x20settled\x20for\x20','parse','bff','No\x20lock\x20entry\x20found\x20for\x20\x22','validation','trashDir','3647778xXskKH','functions','Function\x20not\x20found:\x20','1431666PjaHPX','lastSync','str','lockFilePath','962150EgMGAS','Backend\x20Function\x20lock\x20file\x20not\x20found.','scriptsRootDir','Multiple\x20functions\x20match\x20\x22','\x22\x20not\x20found\x20after\x20ensureLockScope.','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','length','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','remoteId','delete','trashedTo','filter','appCode','map','apps','Would\x20delete\x20','scriptsRoot','keys','projectRoot','244088VUGWNC','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','4wFkIXt','5cMFwby','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','target','toISOString','98ekhNiq','includes','replace','620ZKhiHj','676908KoRnkU','/api/management/library/scripts/delete','3876840HoIEfn','247247HtZhzi'];a38_0x3a58=function(){return _0x589b09;};return a38_0x3a58();}async function waitForDeleteSettlement(_0x1394f0,_0x3ee9ca,_0x5e9a50,_0xcd630f){const _0x4b206d=a38_0x5b005f;for(let _0x4252b9=0x0;_0x4252b9<DELETE_SETTLE_RETRY_COUNT;_0x4252b9+=0x1){const _0x1a0092=await readBffLockFile(_0x1394f0),_0x3584d=!!_0x1a0092?.[_0x4b206d(0x1b4)]?.[_0x3ee9ca]?.[_0x4b206d(0x1cf)]?.[_0x5e9a50],_0x4e5969=await fileExists(_0xcd630f);if(!_0x3584d&&!_0x4e5969)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x4b206d(0x1c8)+_0x5e9a50+'.');}
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_0x11f614=a39_0x257f;function a39_0x46af(){const _0x29a7db=['appCode','verbose','number','scriptType','boolean','32570vCuYGW','2PUruoa','read','version','functionName','238255IjWZUm','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','1602209LyevZO','230Vnpkwo','3208IAwhWp','4dLEGlE','108Bfvotk','Return\x20full\x20raw\x20script\x20object','377lqXDIk','46908AQYEQR','detail','465306YcwwIE','description','num','(none)','539xbpDLm','createdTime','3924MBJape'];a39_0x46af=function(){return _0x29a7db;};return a39_0x46af();}function a39_0x257f(_0x2328eb,_0x2d9c95){_0x2328eb=_0x2328eb-0xe7;const _0x46af60=a39_0x46af();let _0x257f2f=_0x46af60[_0x2328eb];return _0x257f2f;}(function(_0x80ab0,_0x4bb659){const _0x344c4e=a39_0x257f,_0x5efdad=_0x80ab0();while(!![]){try{const _0x37a0ed=-parseInt(_0x344c4e(0xfe))/0x1*(parseInt(_0x344c4e(0xfa))/0x2)+-parseInt(_0x344c4e(0xed))/0x3*(parseInt(_0x344c4e(0xe7))/0x4)+parseInt(_0x344c4e(0x101))/0x5*(parseInt(_0x344c4e(0xeb))/0x6)+parseInt(_0x344c4e(0x100))/0x7+parseInt(_0x344c4e(0x102))/0x8*(parseInt(_0x344c4e(0xf3))/0x9)+-parseInt(_0x344c4e(0xf9))/0xa*(parseInt(_0x344c4e(0xf1))/0xb)+-parseInt(_0x344c4e(0xe8))/0xc*(parseInt(_0x344c4e(0xea))/0xd);if(_0x37a0ed===_0x4bb659)break;else _0x5efdad['push'](_0x5efdad['shift']());}catch(_0x4b0ac2){_0x5efdad['push'](_0x5efdad['shift']());}}}(a39_0x46af,0x334dc));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a39_0x11f614(0xec),'description':a39_0x11f614(0xff),'risk':a39_0x11f614(0xfb),'flags':[{'name':'id','type':a39_0x11f614(0xf6),'required':!![],'description':'Script\x20ID'},{'name':a39_0x11f614(0xf5),'type':a39_0x11f614(0xf8),'description':a39_0x11f614(0xe9)}],async 'execute'(_0x35f665){const _0x5041ce=a39_0x11f614,_0x39f5dd=await getBffScriptInfo(_0x35f665[_0x5041ce(0xef)]('id')),_0x4f4c7b=_0x35f665['bool']('verbose');if(_0x4f4c7b)return{'ok':!![],'data':_0x39f5dd};return{'ok':!![],'data':{'id':_0x39f5dd['id'],'functionName':_0x39f5dd[_0x5041ce(0xfd)]??'','version':_0x39f5dd[_0x5041ce(0xfc)]??'','updateUserName':_0x39f5dd['updateUserName']??'','appCode':_0x39f5dd[_0x5041ce(0xf4)],'scriptType':_0x39f5dd[_0x5041ce(0xf7)],'description':_0x39f5dd[_0x5041ce(0xee)]||_0x5041ce(0xf0),'createdTime':_0x39f5dd[_0x5041ce(0xf2)]??'','updatedTime':_0x39f5dd['updatedTime']??'','scriptContent':_0x39f5dd['scriptContent']??''}};}};
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(_0x4363de,_0x428068){const _0x5e86c9=a40_0x1a51,_0x57b5f6=_0x4363de();while(!![]){try{const _0x47aa17=parseInt(_0x5e86c9(0x1cd))/0x1+parseInt(_0x5e86c9(0x1c8))/0x2*(-parseInt(_0x5e86c9(0x1c9))/0x3)+parseInt(_0x5e86c9(0x1d0))/0x4*(parseInt(_0x5e86c9(0x1ce))/0x5)+parseInt(_0x5e86c9(0x1ca))/0x6+-parseInt(_0x5e86c9(0x1cc))/0x7*(parseInt(_0x5e86c9(0x1cb))/0x8)+-parseInt(_0x5e86c9(0x1cf))/0x9+parseInt(_0x5e86c9(0x1c7))/0xa;if(_0x47aa17===_0x428068)break;else _0x57b5f6['push'](_0x57b5f6['shift']());}catch(_0x197ff4){_0x57b5f6['push'](_0x57b5f6['shift']());}}}(a40_0x1624,0xab60e));import{bffList}from'../../commands/bff/list.js';function a40_0x1624(){const _0x23cf8a=['8691907xXnQyY','666521CKBeZv','1135gTERxd','408411GpqCiv','7652oaPQLw','8791540BnHmsg','6114QqfzDT','246EMDskf','1558764idGmRK','8FFiNZn'];a40_0x1624=function(){return _0x23cf8a;};return a40_0x1624();}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a40_0x1a51(_0x16399c,_0x4f4ea1){_0x16399c=_0x16399c-0x1c7;const _0x1624a4=a40_0x1624();let _0x1a51ed=_0x1624a4[_0x16399c];return _0x1a51ed;}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_0x1c541d=a41_0x102c;(function(_0x43bc75,_0x38f822){const _0x2cd51f=a41_0x102c,_0x2bc01e=_0x43bc75();while(!![]){try{const _0x87c7a4=parseInt(_0x2cd51f(0x9f))/0x1+parseInt(_0x2cd51f(0x9a))/0x2*(-parseInt(_0x2cd51f(0xb5))/0x3)+parseInt(_0x2cd51f(0xa3))/0x4+-parseInt(_0x2cd51f(0xaa))/0x5+parseInt(_0x2cd51f(0xae))/0x6*(-parseInt(_0x2cd51f(0x98))/0x7)+parseInt(_0x2cd51f(0xa8))/0x8*(parseInt(_0x2cd51f(0x9b))/0x9)+parseInt(_0x2cd51f(0xab))/0xa;if(_0x87c7a4===_0x38f822)break;else _0x2bc01e['push'](_0x2bc01e['shift']());}catch(_0x27d411){_0x2bc01e['push'](_0x2bc01e['shift']());}}}(a41_0x293b,0xb2555));import{listBffScripts}from'../../core/api-client.js';function a41_0x293b(){const _0x52a7ae=['Script\x20type\x20filter','(unnamed)','Return\x20full\x20script\x20objects','appCode','3856soBWAB','scriptType','1103385AAQywK','17631020riKKdb','str','verbose','2739882BiOznG','List\x20Backend\x20Function\x20scripts','string','Filter\x20by\x20script\x20name','COMMON','No\x20Backend\x20Function\x20scripts\x20found.','list','3UWGWNw','map','21oKfvRU','type','1722642IocUGh','9603bQpPxV','name','boolean','bff','327110BrbORK','read','ENDPOINT','functionName','2311544pIbMWo'];a41_0x293b=function(){return _0x52a7ae;};return a41_0x293b();}function a41_0x102c(_0x6d3dd0,_0x55922a){_0x6d3dd0=_0x6d3dd0-0x97;const _0x293b4c=a41_0x293b();let _0x102cde=_0x293b4c[_0x6d3dd0];return _0x102cde;}export const bffList={'service':a41_0x1c541d(0x9e),'command':a41_0x1c541d(0xb4),'description':a41_0x1c541d(0xaf),'risk':a41_0x1c541d(0xa0),'flags':[{'name':a41_0x1c541d(0x99),'type':a41_0x1c541d(0xb0),'description':a41_0x1c541d(0xa4),'default':a41_0x1c541d(0xa1),'enum':[a41_0x1c541d(0xa1),a41_0x1c541d(0xb2)]},{'name':'name','type':'string','description':a41_0x1c541d(0xb1)},{'name':a41_0x1c541d(0xad),'type':a41_0x1c541d(0x9d),'description':a41_0x1c541d(0xa6)}],async 'execute'(_0x44df49){const _0x22db39=a41_0x1c541d,_0x35f576=await listBffScripts(_0x44df49[_0x22db39(0xa7)],_0x44df49[_0x22db39(0xac)](_0x22db39(0x99)),{'scriptName':_0x44df49[_0x22db39(0xac)](_0x22db39(0x9c))||undefined}),_0x2dc9b8=_0x44df49['bool'](_0x22db39(0xad));return{'ok':!![],'data':_0x2dc9b8?_0x35f576:_0x35f576[_0x22db39(0x97)](_0x490ab7=>({'id':_0x490ab7['id'],'functionName':_0x490ab7[_0x22db39(0xa2)]??'','description':_0x490ab7['description']||_0x22db39(0xa5),'scriptType':_0x490ab7[_0x22db39(0xa9)]})),'message':_0x35f576['length']===0x0?_0x22db39(0xb3):undefined};}};
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
- function a42_0x3508(_0x525108,_0x4956d7){_0x525108=_0x525108-0x197;const _0x4e1bd9=a42_0x4e1b();let _0x350858=_0x4e1bd9[_0x525108];return _0x350858;}const a42_0x3b43ee=a42_0x3508;(function(_0x2ed6de,_0x1545b6){const _0x2a0d71=a42_0x3508,_0x6593d6=_0x2ed6de();while(!![]){try{const _0x144420=-parseInt(_0x2a0d71(0x1a7))/0x1+parseInt(_0x2a0d71(0x1a0))/0x2*(parseInt(_0x2a0d71(0x1a1))/0x3)+-parseInt(_0x2a0d71(0x1bb))/0x4+-parseInt(_0x2a0d71(0x1b8))/0x5*(-parseInt(_0x2a0d71(0x1a3))/0x6)+-parseInt(_0x2a0d71(0x1a6))/0x7*(parseInt(_0x2a0d71(0x1af))/0x8)+-parseInt(_0x2a0d71(0x19c))/0x9*(parseInt(_0x2a0d71(0x198))/0xa)+parseInt(_0x2a0d71(0x1b6))/0xb*(parseInt(_0x2a0d71(0x1c6))/0xc);if(_0x144420===_0x1545b6)break;else _0x6593d6['push'](_0x6593d6['shift']());}catch(_0x7f2c11){_0x6593d6['push'](_0x6593d6['shift']());}}}(a42_0x4e1b,0xe0e1d));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0x3b43ee(0x19a),a42_0x3b43ee(0x1aa),a42_0x3b43ee(0x1ba),a42_0x3b43ee(0x1c5)];export function resolveBffLogQuery(_0x4f74fc,_0x232f8e=Date[a42_0x3b43ee(0x1bc)]()){const _0xe80b74=a42_0x3b43ee,_0x88f06a=_0x4f74fc[_0xe80b74(0x1bf)]('since'),_0x436795=_0x4f74fc[_0xe80b74(0x1bf)]('start-time'),_0x4ee878=_0x4f74fc['flag']('end-time');if(_0x88f06a!==undefined&&_0x436795!==undefined)throw CliErrors[_0xe80b74(0x1ab)]('--since\x20cannot\x20be\x20combined\x20with\x20--start-time.');const _0x43cfbc=_0x4ee878===undefined?_0x232f8e:readPositiveInteger(_0x4f74fc['num'](_0xe80b74(0x197)),'--end-time'),_0x116a8c=_0x436795===undefined?_0x43cfbc-readSinceMinutes(_0x4f74fc)*0xea60:readPositiveInteger(_0x4f74fc[_0xe80b74(0x1c0)](_0xe80b74(0x1c1)),_0xe80b74(0x1be));if(_0x116a8c<=0x0)throw CliErrors[_0xe80b74(0x1ab)](_0xe80b74(0x19b));if(_0x116a8c>_0x43cfbc)throw CliErrors[_0xe80b74(0x1ab)](_0xe80b74(0x1b2));const _0x42b4e1=readPositiveInteger(_0x4f74fc[_0xe80b74(0x1c0)](_0xe80b74(0x1b5),DEFAULT_LIMIT),_0xe80b74(0x1c3));if(_0x42b4e1>MAX_LIMIT)throw CliErrors[_0xe80b74(0x1ab)](_0xe80b74(0x1bd)+MAX_LIMIT+'.');const _0x263dbc=_0x4f74fc[_0xe80b74(0x1a4)](_0xe80b74(0x199))['trim']()[_0xe80b74(0x1b4)]()||undefined,_0x4ca7eb=_0x4f74fc[_0xe80b74(0x1a4)](_0xe80b74(0x1c2))['trim']()||undefined;return{'appCode':_0x4f74fc[_0xe80b74(0x1b9)],'startTime':_0x116a8c,'endTime':_0x43cfbc,..._0x436795===undefined?{'sinceMinutes':readSinceMinutes(_0x4f74fc)}:{},..._0x263dbc?{'level':_0x263dbc}:{},..._0x4ca7eb?{'keyword':_0x4ca7eb}:{},'limit':_0x42b4e1};}function readSinceMinutes(_0x4991b5){const _0x4f5090=a42_0x3b43ee;return readPositiveInteger(_0x4991b5[_0x4f5090(0x1c0)](_0x4f5090(0x1b3),DEFAULT_SINCE_MINUTES),_0x4f5090(0x1b7));}function readPositiveInteger(_0x1884ec,_0x5a2901){const _0x3ab3de=a42_0x3b43ee;if(!Number[_0x3ab3de(0x19d)](_0x1884ec)||_0x1884ec<=0x0)throw CliErrors[_0x3ab3de(0x1ab)](_0x5a2901+_0x3ab3de(0x1a5));return _0x1884ec;}function a42_0x4e1b(){const _0x95c393=['bff','number','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','since','toUpperCase','limit','3680974ZaoiFb','--since','15PXVgAk','appCode','WARN','2388220zSGUqq','now','--limit\x20must\x20be\x20between\x201\x20and\x20','--start-time','flag','num','start-time','keyword','--limit','Maximum\x20log\x20lines\x20to\x20return\x20(1-','ERROR','24dDFKBJ','end-time','70AnOvug','level','DEBUG','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','3717WkUlhi','isSafeInteger','Filter\x20by\x20log\x20level','read','68IQYZEW','55467tbDhca','length','2747034DHoIEf','str','\x20must\x20be\x20a\x20positive\x20integer.','7MlUryY','285290vtSqmr','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','string','INFO','validation','\x20Backend\x20Function\x20log\x20line(s).','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','6920464OOKDAG'];a42_0x4e1b=function(){return _0x95c393;};return a42_0x4e1b();}export const bffLogs={'service':a42_0x3b43ee(0x1b0),'command':'logs','description':'Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','risk':a42_0x3b43ee(0x19f),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x3b43ee(0x1b3),'type':a42_0x3b43ee(0x1b1),'description':a42_0x3b43ee(0x1ad)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x3b43ee(0x1c1),'type':a42_0x3b43ee(0x1b1),'description':a42_0x3b43ee(0x1a8)},{'name':a42_0x3b43ee(0x197),'type':a42_0x3b43ee(0x1b1),'description':'Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)'},{'name':a42_0x3b43ee(0x199),'type':a42_0x3b43ee(0x1a9),'description':a42_0x3b43ee(0x19e),'enum':LOG_LEVELS},{'name':'keyword','type':a42_0x3b43ee(0x1a9),'description':a42_0x3b43ee(0x1ae)},{'name':a42_0x3b43ee(0x1b5),'type':a42_0x3b43ee(0x1b1),'description':a42_0x3b43ee(0x1c4)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x1c4969){resolveBffLogQuery(_0x1c4969);},async 'execute'(_0x59df66){const _0x3d8f51=a42_0x3b43ee,_0x99c9fc=resolveBffLogQuery(_0x59df66),{sinceMinutes:_0x259dd6,..._0x3ff721}=_0x99c9fc,_0x8650c2=await searchBffScriptLogs(_0x3ff721);return{'ok':!![],'data':{'query':_0x99c9fc,'count':_0x8650c2[_0x3d8f51(0x1a2)],'logs':_0x8650c2},'message':_0x8650c2['length']===0x0?'No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.':'Found\x20'+_0x8650c2[_0x3d8f51(0x1a2)]+_0x3d8f51(0x1ac)};}};
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_0x4777d1=a43_0x32a3;(function(_0x17923d,_0x488e53){const _0x30b70b=a43_0x32a3,_0x4d454c=_0x17923d();while(!![]){try{const _0x4bed42=parseInt(_0x30b70b(0x127))/0x1+-parseInt(_0x30b70b(0xf0))/0x2+-parseInt(_0x30b70b(0x107))/0x3+parseInt(_0x30b70b(0xfe))/0x4*(parseInt(_0x30b70b(0xc0))/0x5)+-parseInt(_0x30b70b(0x10e))/0x6*(parseInt(_0x30b70b(0x11c))/0x7)+-parseInt(_0x30b70b(0xef))/0x8+parseInt(_0x30b70b(0xe5))/0x9*(parseInt(_0x30b70b(0xbf))/0xa);if(_0x4bed42===_0x488e53)break;else _0x4d454c['push'](_0x4d454c['shift']());}catch(_0x5dca5e){_0x4d454c['push'](_0x4d454c['shift']());}}}(a43_0x49c5,0xdf57e));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':'bff','command':'pull','description':a43_0x4777d1(0xf3),'risk':a43_0x4777d1(0x120),'structuredErrors':!![],'flags':[{'name':'type','type':'string','description':'Pull\x20only\x20this\x20script\x20type','enum':[a43_0x4777d1(0x13d),a43_0x4777d1(0xe3),a43_0x4777d1(0xda)]},{'name':a43_0x4777d1(0xe9),'type':'boolean','description':a43_0x4777d1(0xe2)}],async 'dryRun'(_0x75cfe0){const _0xde9dcd=a43_0x4777d1,_0x5e1e61=loadBffProjectConfig(_0x75cfe0[_0xde9dcd(0x104)]),_0x1fd2e0=await readBffLockFile(_0x5e1e61['lockFilePath']),{appLock:_0x420714}=ensureLockScope(_0x1fd2e0??createEmptyBffLock(),_0x75cfe0[_0xde9dcd(0x104)],_0x5e1e61[_0xde9dcd(0xd7)],_0xde9dcd(0x123)),_0x4b5abf=normalizeBffType(_0x75cfe0['str'](_0xde9dcd(0xd6)))??undefined,[_0x2c3b6c,_0xd5fb5c]=await Promise[_0xde9dcd(0xb1)]([listBffScripts(_0x75cfe0[_0xde9dcd(0x104)],_0x4b5abf),getBffScriptStatistics(_0x75cfe0['appCode'])]),_0x4139af=_0x2c3b6c[_0xde9dcd(0x12d)](_0x69daec=>normalizeBffType(_0x69daec[_0xde9dcd(0x10d)])===_0xde9dcd(0xda)),_0x4003db=_0x4139af?buildDatasetCodeToAliasMap(_0x75cfe0[_0xde9dcd(0xd5)],_0x75cfe0[_0xde9dcd(0x104)],_0x75cfe0['selectedAppName']||_0x75cfe0[_0xde9dcd(0x126)]?.[_0xde9dcd(0x10a)]||_0x75cfe0[_0xde9dcd(0x126)]?.['defaultApp']):new Map(),_0x441f22=_0x4139af?await planHookDirectoryMigration(_0x5e1e61,_0x420714,_0x4003db,await scanLocalBffFunctions(_0x5e1e61,_0xde9dcd(0xda))):undefined,_0x34c409=createHookLocationMap(_0xd5fb5c),_0x1bc228=[];for(const _0x49b2a6 of _0x2c3b6c){const _0x24c2eb=resolveRemoteScriptTarget(_0x5e1e61,_0x49b2a6,_0x34c409,_0x441f22?.[_0xde9dcd(0xdd)]??_0x420714[_0xde9dcd(0xba)],_0x4003db);if(!_0x24c2eb){_0x1bc228[_0xde9dcd(0x132)]({'scriptType':_0x49b2a6[_0xde9dcd(0x10d)],'functionName':_0x49b2a6[_0xde9dcd(0x116)]??'','status':_0xde9dcd(0xf8),'reason':'unresolvable\x20target\x20path'});continue;}const _0x210849=(_0x441f22?.[_0xde9dcd(0xdd)]??_0x420714[_0xde9dcd(0xba)])[_0x24c2eb['lockKey']],_0x1abbe9=_0x49b2a6[_0xde9dcd(0xdc)]!=null?computeContentHash(_0x49b2a6[_0xde9dcd(0xdc)]):undefined,_0x204341=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x441f22,_0x24c2eb)??_0x24c2eb['filePath'],_0x210849,_0x1abbe9),_0x58eca4=_0x204341?localUnsyncedConflict(_0x24c2eb,_0x49b2a6['id']):undefined;_0x1bc228[_0xde9dcd(0x132)]({'lockKey':_0x24c2eb['lockKey'],'filePath':_0x24c2eb['filePath'],'remoteId':_0x49b2a6['id']??null,'status':_0x58eca4?_0xde9dcd(0xd1):_0xde9dcd(0xc2),..._0x58eca4?{'conflict':_0x58eca4}:{},..._0x24c2eb[_0xde9dcd(0xc4)]?{'alias':_0x24c2eb['hookLocation'][_0xde9dcd(0x105)]??null,'datasetCode':_0x24c2eb['hookLocation'][_0xde9dcd(0x13b)],'operationType':_0x24c2eb[_0xde9dcd(0xc4)][_0xde9dcd(0x10f)],'functionNode':_0x24c2eb['hookLocation'][_0xde9dcd(0xaf)]}:{}});}return{'method':_0xde9dcd(0xca),'url':_0xde9dcd(0xc5)+_0x75cfe0['appCode']+(_0x4b5abf?'&type='+_0x4b5abf:'')+_0xde9dcd(0xf9)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x75cfe0['appCode'],'filterType':_0x4b5abf??null,..._0x441f22&&_0x441f22['migrations'][_0xde9dcd(0x129)]>0x0?{'hookDirectoryMigrations':_0x441f22[_0xde9dcd(0xd9)]['map'](_0x400485=>({'from':_0x400485['oldDirectory'],'to':_0x400485[_0xde9dcd(0x113)]}))}:{},'files':_0x1bc228},'description':'Would\x20inspect\x20'+_0x1bc228['length']+_0xde9dcd(0xc9)};},async 'execute'(_0x38ebe4){const _0x3b86da=a43_0x4777d1,_0x565610=loadBffProjectConfig(_0x38ebe4[_0x3b86da(0x104)]),_0x593c22=await readBffLockFile(_0x565610['lockFilePath']),{lockData:_0x33599b,appLock:_0x33d249}=ensureLockScope(_0x593c22??createEmptyBffLock(),_0x38ebe4[_0x3b86da(0x104)],_0x565610[_0x3b86da(0xd7)],_0x3b86da(0x123)),_0x37bbda=normalizeBffType(_0x38ebe4[_0x3b86da(0xfc)]('type'))??undefined;if(_0x38ebe4[_0x3b86da(0xfc)](_0x3b86da(0xd6))&&!_0x37bbda)throw CliErrors[_0x3b86da(0x109)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x26b425,_0x27a08f]=await Promise[_0x3b86da(0xb1)]([listBffScripts(_0x38ebe4['appCode'],_0x37bbda),getBffScriptStatistics(_0x38ebe4[_0x3b86da(0x104)])]);if(_0x26b425[_0x3b86da(0x129)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x3b86da(0xb5)};const _0x589122=_0x38ebe4[_0x3b86da(0xff)](_0x3b86da(0xe9));if(_0x589122&&!_0x38ebe4[_0x3b86da(0x12f)]){const _0x34173c=await confirmForce();if(!_0x34173c)throw CliErrors['cancelled']('Force\x20pull\x20cancelled.');}if(_0x589122&&_0x38ebe4['nonInteractive']){}const _0x3cd40f=_0x26b425[_0x3b86da(0x12d)](_0x4a5c37=>normalizeBffType(_0x4a5c37[_0x3b86da(0x10d)])===_0x3b86da(0xda)),_0xbe672e=_0x3cd40f?buildDatasetCodeToAliasMap(_0x38ebe4['apiDir'],_0x38ebe4['appCode'],_0x38ebe4['selectedAppName']||_0x38ebe4[_0x3b86da(0x126)]?.['currentApp']||_0x38ebe4['mergedCli']?.[_0x3b86da(0x11a)]):new Map(),_0x3fecf2=createHookLocationMap(_0x27a08f),_0x5f4c86=JSON[_0x3b86da(0x135)](JSON[_0x3b86da(0x124)](_0x33599b)),_0x3736b6=_0x38ebe4['appCode'],_0x1f9edc=_0x5f4c86['apps'][_0x3736b6];if(!_0x1f9edc)throw new Error(_0x3b86da(0x101)+_0x3736b6+_0x3b86da(0x130));const _0x27634e=_0x3cd40f?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x565610,_0x1f9edc,_0xbe672e,await scanLocalBffFunctions(_0x565610,_0x3b86da(0xda))),_0x1f9edc):undefined,_0x1a5dfd=createPullFileTransaction(),_0x5a2090=[],_0x8fe907=[],_0x501c63=[],_0x582025=[];for(const _0x1bd40f of _0x26b425){const _0x3d6b3f=resolveRemoteScriptTarget(_0x565610,_0x1bd40f,_0x3fecf2,_0x1f9edc['functions'],_0xbe672e);if(!_0x3d6b3f){_0x8fe907[_0x3b86da(0x132)]({'lockKey':_0x1bd40f['scriptType']+'/'+_0x1bd40f[_0x3b86da(0x116)],'reason':_0x3b86da(0x138)});continue;}const _0x363e75=_0x1f9edc[_0x3b86da(0xba)][_0x3d6b3f[_0x3b86da(0xe0)]];try{if(!_0x1bd40f['id'])throw new Error(_0x3b86da(0x118));if(_0x1bd40f['scriptContent']==null)throw new Error(_0x3b86da(0xea));const _0x1672a9=_0x1bd40f['scriptContent'],_0x5c6881=computeContentHash(_0x1672a9);if(!_0x589122){const _0x64c043=await hasUnsyncedLocalChanges(_0x3d6b3f['filePath'],_0x363e75,_0x5c6881);if(_0x64c043){_0x501c63[_0x3b86da(0x132)](localUnsyncedConflict(_0x3d6b3f,_0x1bd40f['id']));continue;}}await _0x1a5dfd['write'](_0x3d6b3f[_0x3b86da(0xf1)],_0x1672a9);const _0x4c84e2={'hash':_0x5c6881,'remoteId':_0x1bd40f['id'],'version':_0x1bd40f['version']};_0x3d6b3f[_0x3b86da(0xd6)]===_0x3b86da(0xda)&&_0x3d6b3f['hookLocation']&&(_0x4c84e2[_0x3b86da(0x105)]=_0x3d6b3f['hookLocation'][_0x3b86da(0x105)],_0x4c84e2[_0x3b86da(0x13b)]=_0x3d6b3f[_0x3b86da(0xc4)]['datasetCode'],_0x4c84e2['operationType']=_0x3d6b3f['hookLocation'][_0x3b86da(0x10f)],_0x4c84e2[_0x3b86da(0xaf)]=_0x3d6b3f[_0x3b86da(0xc4)][_0x3b86da(0xaf)]),_0x1f9edc['functions'][_0x3d6b3f[_0x3b86da(0xe0)]]=_0x4c84e2,_0x5a2090[_0x3b86da(0x132)]({'lockKey':_0x3d6b3f[_0x3b86da(0xe0)],'remoteId':_0x1bd40f['id']});}catch(_0x26e91d){_0x582025['push']({'lockKey':_0x3d6b3f[_0x3b86da(0xe0)],'error':_0x26e91d instanceof Error?_0x26e91d[_0x3b86da(0xcd)]:String(_0x26e91d)});}}_0x1f9edc[_0x3b86da(0xfb)]=new Date()[_0x3b86da(0x13e)]();try{await writeBffLockFile(_0x565610[_0x3b86da(0xe4)],_0x5f4c86);}catch(_0x235274){const _0xce63c1=[...await _0x1a5dfd['rollback'](),...await _0x27634e?.['rollback']()??[]];throw withRollbackErrors(_0x235274,_0x3b86da(0x13c),_0xce63c1);}return{'ok':_0x582025[_0x3b86da(0x129)]===0x0,'data':{'pulled':_0x5a2090,'skipped':_0x8fe907,'conflicts':_0x501c63,'failed':_0x582025},'message':formatPullMessage(_0x5a2090[_0x3b86da(0x129)],_0x8fe907[_0x3b86da(0x129)],_0x501c63[_0x3b86da(0x129)],_0x582025[_0x3b86da(0x129)])};}};function localUnsyncedConflict(_0x1795a0,_0xe50fa3){const _0x4119a0=a43_0x4777d1,_0x1b8354=_0x1795a0[_0x4119a0(0xe0)]['split']('/')['at'](-0x1);return{'code':_0x4119a0(0xfd),'lockKey':_0x1795a0[_0x4119a0(0xe0)],'filePath':_0x1795a0[_0x4119a0(0xf1)],..._0xe50fa3!=null?{'remoteId':_0xe50fa3}:{},'message':_0x4119a0(0xf4),'nextAction':{'action':_0x4119a0(0x10b),'command':CLI_BIN_NAME+_0x4119a0(0x102)+_0x1795a0[_0x4119a0(0xd6)]+_0x4119a0(0x136)+_0x1b8354+_0x4119a0(0x112),'requiresReview':!![],'message':_0x4119a0(0xcc)}};}function a43_0x49c5(){const _0x12ac61=['type','scriptsRoot','remoteId','migrations','HOOK','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','scriptContent','projectedFunctions','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','requires','lockKey','\x22\x20from\x20the\x20lock\x20file.','Force\x20overwrite\x20local\x20unsynced\x20changes','ENDPOINT','lockFilePath','27162YYvAxH','entries','oldDirectoryPath','oldDirectory','force','Remote\x20script\x20missing\x20content.','NFC','ino','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','scriptsRootDir','146952LDQBbU','3455594WlJlTY','filePath','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','\x20resolution','toLowerCase','join','skipped','&currentPage=1&pageSize=','move','lastSync','str','BFF_LOCAL_UNSYNCED','142280jNJqkG','bool','rekey','Lock\x20scope\x20for\x20app\x20\x22','\x20bff\x20push\x20--type\x20','hash','appCode','alias','question','356715wKKlEs','profileName','validation','currentApp','push_local','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','scriptType','6yLwsmP','operationType','trim','\x22;\x20temporary\x20directory\x20\x22','\x20--format\x20compress','newDirectory','\x22:\x20its\x20target\x20\x22','.js','functionName','newDirectoryPath','Remote\x20script\x20missing\x20id.','existed','defaultApp','case-rename','12316017GGywbW','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','newLockKey','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','read','reverse','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','pull','stringify','\x20pulled','mergedCli','1793582VakIvE','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','length','stderr','get','includes','some','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','nonInteractive','\x22\x20not\x20found\x20after\x20ensureLockScope.','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','push','stdin','\x20skipped','parse','\x20--name\x20','delete','unresolvable\x20target\x20path','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','oldLockKey','datasetCode','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','COMMON','toISOString','keyChanges','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','functionNode','Failed\x20to\x20write\x20local\x20script\x20\x22','all','has','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','map','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','\x22\x20from\x20\x22','\x20conflict','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','flatMap','functions','normalize','set','\x22:\x20both\x20target\x20\x22','\x22:\x20','8980BpToOb','5gWjZal','HOOK/','would_pull','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','hookLocation','/api/management/library/scripts/list?appCode=','Pull\x20complete:\x20','\x22\x20and\x20\x22','ENOENT','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','GET','mode','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.','message','\x20Recovery\x20errors:\x20','entry','code','conflict','\x22\x20to\x20\x22','split','values','apiDir'];a43_0x49c5=function(){return _0x12ac61;};return a43_0x49c5();}function formatPullMessage(_0x1123e3,_0x4b22c9,_0x5acb28,_0x274b4f){const _0x130ec9=a43_0x4777d1,_0x2baa75=[_0x130ec9(0xc6)+_0x1123e3+_0x130ec9(0x125),_0x4b22c9+_0x130ec9(0x134)];_0x5acb28>0x0&&_0x2baa75['push'](_0x5acb28+_0x130ec9(0xb7)+(_0x5acb28===0x1?'':'s')+'\x20'+(_0x5acb28===0x1?_0x130ec9(0xdf):'require')+_0x130ec9(0xf5));if(_0x274b4f>0x0)_0x2baa75['push'](_0x274b4f+'\x20failed');return _0x2baa75['join'](',\x20');}async function hasUnsyncedLocalChanges(_0x539313,_0x1fb6c9,_0xf3cad7){const _0x2f70b0=a43_0x4777d1;if(!await fileExists(_0x539313))return![];const _0x1e1249=await computeFileHash(_0x539313);if(!_0x1fb6c9)return _0xf3cad7?_0x1e1249!==_0xf3cad7:!![];return _0x1e1249!==_0x1fb6c9[_0x2f70b0(0x103)];}function createPullFileTransaction(){const _0x3df5f5=new Map(),_0x24d3e7=async(_0x1e5680,_0x587a3d)=>{const _0x59ab5b=a43_0x32a3;try{if(_0x587a3d[_0x59ab5b(0x119)])await ensureParentDirectory(_0x1e5680),await writeFile(_0x1e5680,_0x587a3d['content']);else try{await unlink(_0x1e5680);}catch(_0x30fa46){if(_0x30fa46[_0x59ab5b(0xd0)]!==_0x59ab5b(0xc8))throw _0x30fa46;}return undefined;}catch(_0x3882e1){return _0x3882e1 instanceof Error?_0x3882e1:new Error(String(_0x3882e1));}};return{async 'write'(_0x2e0c1e,_0x4c9dc9){const _0x2c2f80=a43_0x32a3;if(!_0x3df5f5[_0x2c2f80(0xb2)](_0x2e0c1e))try{_0x3df5f5['set'](_0x2e0c1e,{'existed':!![],'content':await readFile(_0x2e0c1e)});}catch(_0x38d412){if(_0x38d412[_0x2c2f80(0xd0)]!=='ENOENT')throw _0x38d412;_0x3df5f5[_0x2c2f80(0xbc)](_0x2e0c1e,{'existed':![]});}try{await ensureParentDirectory(_0x2e0c1e),await writeFile(_0x2e0c1e,_0x4c9dc9,'utf8');}catch(_0x2f61cf){const _0x36aaa3=await _0x24d3e7(_0x2e0c1e,_0x3df5f5[_0x2c2f80(0x12b)](_0x2e0c1e));if(!_0x36aaa3)_0x3df5f5[_0x2c2f80(0x137)](_0x2e0c1e);throw withRollbackErrors(_0x2f61cf,_0x2c2f80(0xb0)+_0x2e0c1e+'\x22.',_0x36aaa3?[_0x36aaa3]:[]);}},async 'rollback'(){const _0x36044a=a43_0x32a3,_0xacab0b=[];for(const [_0x23adc2,_0x29ee41]of[..._0x3df5f5[_0x36044a(0xe6)]()]['reverse']()){const _0xacf132=await _0x24d3e7(_0x23adc2,_0x29ee41);_0xacf132&&_0xacab0b['push'](new Error('Could\x20not\x20restore\x20local\x20script\x20\x22'+_0x23adc2+'\x22:\x20'+_0xacf132['message']));}return _0xacab0b;}};}function withRollbackErrors(_0x304658,_0x10cf0d,_0x3444cb){const _0x3e41d1=a43_0x4777d1,_0x223474=_0x304658 instanceof Error?_0x304658:new Error(String(_0x304658));if(_0x3444cb['length']===0x0)return _0x223474;return new AggregateError([_0x223474,..._0x3444cb],_0x10cf0d+_0x3e41d1(0xce)+_0x3444cb['map'](_0x1bc42c=>_0x1bc42c['message'])[_0x3e41d1(0xf7)](';\x20'));}function a43_0x32a3(_0x1a72ba,_0xa513ec){_0x1a72ba=_0x1a72ba-0xad;const _0x49c5a0=a43_0x49c5();let _0x32a309=_0x49c5a0[_0x1a72ba];return _0x32a309;}function buildDatasetCodeToAliasMap(_0x395d19,_0x509105,_0x3d12d6){const _0x3777c7=a43_0x4777d1,_0xca9ebe=resolveApiModelSource(_0x395d19,_0x509105,_0x3d12d6),_0x3e4086=loadAliasMap(_0x395d19,undefined,_0xca9ebe[_0x3777c7(0xf1)],_0xca9ebe[_0x3777c7(0x108)]);return assertUnambiguousHookAliases(_0x3e4086),new Map(_0x3e4086['map'](_0x233934=>[_0x233934[_0x3777c7(0x13b)]['toLowerCase'](),_0x233934[_0x3777c7(0x105)]]));}async function planHookDirectoryMigration(_0x18e9d0,_0xd2b654,_0x47d028,_0x42f594){const _0x4be73d=a43_0x4777d1,_0x36dfad=new Map();for(const [_0x1b57fb,_0x29052b]of Object[_0x4be73d(0xe6)](_0xd2b654['functions'])){const [_0x3089cf,_0x155094,_0x101048,_0x54eaa0,_0x50108e,..._0x2429bf]=_0x1b57fb[_0x4be73d(0xd3)]('/');if(_0x3089cf!==_0x4be73d(0xda)||!_0x155094||!_0x101048||!_0x54eaa0||!_0x50108e||_0x2429bf[_0x4be73d(0x129)]>0x0||!_0x29052b[_0x4be73d(0x13b)])continue;const _0x29cd4b=_0x47d028[_0x4be73d(0x12b)](_0x29052b['datasetCode'][_0x4be73d(0xf6)]()),_0x27a018=_0x29cd4b??_0x29052b[_0x4be73d(0x13b)];if(!isSafeHookDirectorySegment(_0x155094))throw CliErrors['validation'](_0x4be73d(0x131)+_0x155094+_0x4be73d(0xe1));if(!isSafeHookDirectorySegment(_0x27a018))throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0xb3)+_0x155094+_0x4be73d(0xc3));if(_0x155094===_0x27a018)continue;const _0x29ab67=_0x36dfad['get'](_0x155094)??{'datasetCode':_0x29052b[_0x4be73d(0x13b)],'alias':_0x29cd4b,'keyChanges':[]};if(_0x29ab67[_0x4be73d(0x13b)]!==_0x29052b[_0x4be73d(0x13b)])throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0xb3)+_0x155094+_0x4be73d(0xb8));const _0x5ace62=_0x4be73d(0xc1)+_0x27a018+'/'+_0x101048+'/'+_0x54eaa0+'/'+_0x50108e;try{resolveLocalFilePathFromLockKey(_0x18e9d0,_0x1b57fb),resolveLocalFilePathFromLockKey(_0x18e9d0,_0x5ace62);}catch(_0x1435a8){throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0xf2)+_0x1b57fb+_0x4be73d(0xbe)+(_0x1435a8 instanceof Error?_0x1435a8[_0x4be73d(0xcd)]:String(_0x1435a8)));}_0x29ab67[_0x4be73d(0xad)][_0x4be73d(0x132)]({'oldLockKey':_0x1b57fb,'newLockKey':_0x5ace62,'entry':_0x29052b}),_0x36dfad[_0x4be73d(0xbc)](_0x155094,_0x29ab67);}const _0x130b7f=new Set([..._0x36dfad[_0x4be73d(0xd4)]()][_0x4be73d(0xb9)](_0x477ef1=>_0x477ef1['keyChanges']['map'](_0x2034bf=>_0x2034bf[_0x4be73d(0x13a)]))),_0x3128cc=new Map(),_0x971b33=new Map();for(const [_0x185a90,_0x364b1d]of _0x36dfad){const _0x77221=_0x364b1d[_0x4be73d(0x105)]??_0x364b1d[_0x4be73d(0x13b)],_0x5eb6d=hookDirectoryIdentity(_0x77221),_0x43cef8=_0x3128cc[_0x4be73d(0x12b)](_0x5eb6d);if(_0x43cef8&&_0x43cef8!==_0x185a90)throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0x11d)+_0x43cef8+_0x4be73d(0xc7)+_0x185a90+_0x4be73d(0xbd)+_0x77221+_0x4be73d(0xae));_0x3128cc[_0x4be73d(0xbc)](_0x5eb6d,_0x185a90);for(const _0x578ac2 of _0x364b1d[_0x4be73d(0xad)]){const _0x6d571=_0x971b33[_0x4be73d(0x12b)](_0x578ac2[_0x4be73d(0x11e)]);if(_0x6d571&&_0x6d571!==_0x578ac2[_0x4be73d(0x13a)])throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0x11f)+_0x6d571+_0x4be73d(0xc7)+_0x578ac2[_0x4be73d(0x13a)]+_0x4be73d(0xbd)+_0x578ac2[_0x4be73d(0x11e)]+_0x4be73d(0x122));if(_0x130b7f['has'](_0x578ac2['newLockKey']))throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0xde)+_0x578ac2[_0x4be73d(0x13a)]+_0x4be73d(0x114)+_0x578ac2[_0x4be73d(0x11e)]+_0x4be73d(0x128));_0x971b33[_0x4be73d(0xbc)](_0x578ac2['newLockKey'],_0x578ac2['oldLockKey']);}}const _0x2b7af7=new Map();for(const [_0x298fee,_0x29a16b]of _0x47d028){_0x2b7af7[_0x4be73d(0xbc)](hookDirectoryIdentity(_0x29a16b),_0x298fee);}const _0x2c3f68=[];for(const [_0x1b4da5,_0x23ed68]of _0x36dfad){const _0x4c45d8=_0x23ed68[_0x4be73d(0x105)]??_0x23ed68[_0x4be73d(0x13b)],_0x33379e=join(_0x18e9d0[_0x4be73d(0xee)],_0x4be73d(0xda),_0x1b4da5),_0x56ebee=join(_0x18e9d0[_0x4be73d(0xee)],'HOOK',_0x4c45d8),_0x5ad2b3=await directoryExists(_0x33379e),_0x20d3c3=await directoryExists(_0x56ebee),_0x5e1607=_0x5ad2b3?_0x20d3c3?await sameDirectory(_0x33379e,_0x56ebee)?_0x4be73d(0x11b):undefined:_0x4be73d(0xfa):_0x4be73d(0x100);if(!_0x5e1607)throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0xb3)+_0x1b4da5+'\x22\x20to\x20\x22'+_0x4c45d8+'\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.');const _0x40d649=_0x2b7af7[_0x4be73d(0x12b)](hookDirectoryIdentity(_0x1b4da5));if(_0x40d649&&_0x40d649!==_0x23ed68[_0x4be73d(0x13b)]['toLowerCase']()){const _0xe73089=new Set(_0x23ed68[_0x4be73d(0xad)][_0x4be73d(0xb4)](_0x116a1e=>_0x116a1e[_0x4be73d(0x13a)])),_0x1ef30c=_0x42f594['filter'](_0x14d645=>_0x14d645[_0x4be73d(0xd6)]==='HOOK'&&_0x14d645[_0x4be73d(0x105)]!=null&&hookDirectoryIdentity(_0x14d645[_0x4be73d(0x105)])===hookDirectoryIdentity(_0x1b4da5)&&!_0xe73089[_0x4be73d(0xb2)](_0x14d645[_0x4be73d(0xe0)]));if(_0x1ef30c[_0x4be73d(0x129)]>0x0)throw CliErrors['validation'](_0x4be73d(0xb3)+_0x1b4da5+'\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');}const _0x49079d=_0x2b7af7['get'](hookDirectoryIdentity(_0x4c45d8));if(_0x49079d&&_0x49079d!==_0x23ed68['datasetCode'][_0x4be73d(0xf6)]())throw CliErrors[_0x4be73d(0x109)](_0x4be73d(0xb3)+_0x1b4da5+'\x22\x20to\x20\x22'+_0x4c45d8+_0x4be73d(0xdb));for(const _0x4dc7ac of _0x23ed68['keyChanges']){const _0x342486=_0xd2b654[_0x4be73d(0xba)][_0x4dc7ac['newLockKey']];if(_0x342486&&!_0x130b7f[_0x4be73d(0xb2)](_0x4dc7ac[_0x4be73d(0x11e)])&&!sameHookIdentity(_0x4dc7ac[_0x4be73d(0xcf)],_0x342486))throw CliErrors[_0x4be73d(0x109)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x1b4da5+_0x4be73d(0xd2)+_0x4c45d8+_0x4be73d(0xed));}_0x2c3f68[_0x4be73d(0x132)]({'oldDirectory':_0x1b4da5,'newDirectory':_0x4c45d8,'oldDirectoryPath':_0x33379e,'newDirectoryPath':_0x56ebee,'mode':_0x5e1607,'alias':_0x23ed68[_0x4be73d(0x105)],'keyChanges':_0x23ed68['keyChanges']});}const _0x1bcef1={..._0xd2b654[_0x4be73d(0xba)]},_0x5d8e3d=new Map(),_0x1e1d75=new Map();for(const _0x382ba3 of _0x2c3f68){const _0xcccf2a=_0x382ba3[_0x4be73d(0xcb)]!==_0x4be73d(0x100);_0xcccf2a&&_0x1e1d75['set'](hookDirectoryIdentity(_0x382ba3[_0x4be73d(0x113)]),_0x382ba3[_0x4be73d(0xe7)]);for(const _0x17eb23 of _0x382ba3[_0x4be73d(0xad)]){const _0x343c15=_0x1bcef1[_0x17eb23[_0x4be73d(0x11e)]],_0x288f57=_0xcccf2a?_0x17eb23['entry']:_0x343c15??_0x17eb23[_0x4be73d(0xcf)];_0x1bcef1[_0x17eb23[_0x4be73d(0x11e)]]=canonicalizeHookEntry(_0x288f57,_0x382ba3[_0x4be73d(0x105)]),delete _0x1bcef1[_0x17eb23['oldLockKey']],_0xcccf2a&&_0x5d8e3d['set'](_0x17eb23[_0x4be73d(0x11e)],resolveLocalFilePathFromLockKey(_0x18e9d0,_0x17eb23[_0x4be73d(0x13a)]));}}return{'migrations':_0x2c3f68,'projectedFunctions':_0x1bcef1,'sourceFilePathByNewLockKey':_0x5d8e3d,'sourceDirectoryPathByNewDirectory':_0x1e1d75};}function resolveMigratedSourceFilePath(_0x2fc3f9,_0x345f38){const _0x2dd999=a43_0x4777d1;if(!_0x2fc3f9||!_0x345f38)return undefined;const _0x2ef5e1=_0x2fc3f9['sourceFilePathByNewLockKey'][_0x2dd999(0x12b)](_0x345f38[_0x2dd999(0xe0)]);if(_0x2ef5e1)return _0x2ef5e1;if(_0x345f38[_0x2dd999(0xd6)]!=='HOOK')return undefined;const [,_0x2cd456,..._0x5b439f]=_0x345f38[_0x2dd999(0xe0)][_0x2dd999(0xd3)]('/');if(!_0x2cd456||_0x5b439f[_0x2dd999(0x129)]===0x0)return undefined;const _0x356ef9=_0x2fc3f9['sourceDirectoryPathByNewDirectory']['get'](hookDirectoryIdentity(_0x2cd456));return _0x356ef9?join(_0x356ef9,..._0x5b439f)+_0x2dd999(0x115):undefined;}function sameHookIdentity(_0x45cf03,_0x51486b){const _0x15bfaf=a43_0x4777d1;return _0x45cf03[_0x15bfaf(0xd8)]===_0x51486b[_0x15bfaf(0xd8)]&&_0x45cf03[_0x15bfaf(0x13b)]===_0x51486b[_0x15bfaf(0x13b)]&&_0x45cf03[_0x15bfaf(0x10f)]===_0x51486b[_0x15bfaf(0x10f)]&&_0x45cf03[_0x15bfaf(0xaf)]===_0x51486b[_0x15bfaf(0xaf)];}function canonicalizeHookEntry(_0x541d15,_0x35b67b){const {alias:_0x830d62,..._0x4fc672}=_0x541d15;return _0x35b67b?{..._0x4fc672,'alias':_0x35b67b}:_0x4fc672;}function hookDirectoryIdentity(_0x3fe23e){const _0x6e2b38=a43_0x4777d1;return _0x3fe23e[_0x6e2b38(0xbb)](_0x6e2b38(0xeb))[_0x6e2b38(0xf6)]();}function isSafeHookDirectorySegment(_0x52ca2b){return isSafeLockKeySegment(_0x52ca2b);}async function sameDirectory(_0x530b5b,_0x3ca3ed){const _0x17b093=a43_0x4777d1,[_0x41a694,_0xd19d12]=await Promise[_0x17b093(0xb1)]([stat(_0x530b5b),stat(_0x3ca3ed)]);return _0x41a694['dev']===_0xd19d12['dev']&&_0x41a694[_0x17b093(0xec)]===_0xd19d12[_0x17b093(0xec)];}async function applyHookDirectoryMigration(_0x29957a,_0x1e5e64){const _0x69e87=a43_0x4777d1,_0x5df906=_0x1e5e64[_0x69e87(0xba)],_0x5719d1=_0x1e5e64['lastSync'],_0x1d06ad=[],_0x234d54=async()=>{const _0x14bd6b=_0x69e87,_0x214019=[];_0x1e5e64[_0x14bd6b(0xba)]=_0x5df906,_0x1e5e64[_0x14bd6b(0xfb)]=_0x5719d1;for(const {migration:_0x554c7e,temporaryPath:_0x4b352a}of[..._0x1d06ad][_0x14bd6b(0x121)]()){try{_0x4b352a?(await rename(_0x554c7e['newDirectoryPath'],_0x4b352a),await rename(_0x4b352a,_0x554c7e['oldDirectoryPath'])):await rename(_0x554c7e[_0x14bd6b(0x117)],_0x554c7e[_0x14bd6b(0xe7)]);}catch(_0x19d130){_0x214019['push'](new Error(_0x14bd6b(0x10c)+_0x554c7e['oldDirectory']+_0x14bd6b(0xb6)+_0x554c7e['newDirectory']+_0x14bd6b(0xbe)+(_0x19d130 instanceof Error?_0x19d130['message']:String(_0x19d130))));}}return _0x214019;};try{for(const _0x40cf2b of _0x29957a['migrations']){if(_0x40cf2b[_0x69e87(0xcb)]===_0x69e87(0xfa))await ensureParentDirectory(_0x40cf2b[_0x69e87(0x117)]),await rename(_0x40cf2b[_0x69e87(0xe7)],_0x40cf2b['newDirectoryPath']),_0x1d06ad[_0x69e87(0x132)]({'migration':_0x40cf2b});else{if(_0x40cf2b[_0x69e87(0xcb)]===_0x69e87(0x11b)){const _0x36cec6=join(dirname(_0x40cf2b[_0x69e87(0xe7)]),'.hook-directory-migrate-'+randomUUID());await rename(_0x40cf2b['oldDirectoryPath'],_0x36cec6);try{await rename(_0x36cec6,_0x40cf2b[_0x69e87(0x117)]);}catch(_0x50e7fa){try{await rename(_0x36cec6,_0x40cf2b[_0x69e87(0xe7)]);}catch(_0x4c48b3){throw withRollbackErrors(_0x50e7fa,'Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22'+_0x40cf2b[_0x69e87(0xe8)]+_0x69e87(0xd2)+_0x40cf2b['newDirectory']+_0x69e87(0x111)+_0x36cec6+'\x22\x20may\x20remain.',[new Error(_0x69e87(0x12e)+_0x36cec6+_0x69e87(0xd2)+_0x40cf2b[_0x69e87(0xe8)]+_0x69e87(0xbe)+(_0x4c48b3 instanceof Error?_0x4c48b3[_0x69e87(0xcd)]:String(_0x4c48b3)))]);}throw _0x50e7fa;}_0x1d06ad['push']({'migration':_0x40cf2b,'temporaryPath':_0x36cec6});}}}return _0x1e5e64['functions']=_0x29957a['projectedFunctions'],{'rollback':_0x234d54};}catch(_0x1ce04e){const _0x1c0c47=await _0x234d54();throw withRollbackErrors(_0x1ce04e,'Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x1c0c47);}}async function confirmForce(){const _0x27b250=a43_0x4777d1,_0x441fec=createInterface({'input':process[_0x27b250(0x133)],'output':process[_0x27b250(0x12a)]}),_0x3e91eb=await new Promise(_0x2f2e71=>{const _0x4cd171=_0x27b250;_0x441fec[_0x4cd171(0x106)](_0x4cd171(0x139),_0x2f2e71);});return _0x441fec['close'](),['y','yes'][_0x27b250(0x12c)](_0x3e91eb[_0x27b250(0x110)]()['toLowerCase']());}
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)]());}