@lovrabet/rabetbase-cli 2.5.11 → 2.5.12-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (379) 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.d.ts +1 -0
  283. package/lib/constant/routing-profile.js +1 -1
  284. package/lib/context/app-resolver.js +1 -1
  285. package/lib/context/auth-resolver.js +1 -1
  286. package/lib/context/config-loader.js +1 -1
  287. package/lib/context.js +1 -1
  288. package/lib/core/alias-resolver.js +1 -1
  289. package/lib/core/api-client.js +1 -1
  290. package/lib/core/bff/config.js +1 -1
  291. package/lib/core/bff/file-system.js +1 -1
  292. package/lib/core/bff/hash.js +1 -1
  293. package/lib/core/bff/hook-directory.js +1 -1
  294. package/lib/core/bff/lock.js +1 -1
  295. package/lib/core/bff/utils.js +1 -1
  296. package/lib/core/cross-db-analysis.js +1 -1
  297. package/lib/core/cross-db-relation.js +1 -1
  298. package/lib/core/db-resolver.js +1 -1
  299. package/lib/core/flow-config.js +1 -1
  300. package/lib/core/instant-api-policy/config.js +1 -1
  301. package/lib/core/instant-api-policy/endpoints.js +1 -1
  302. package/lib/core/kb-management-client.js +1 -1
  303. package/lib/core/kb-search-client.js +1 -1
  304. package/lib/core/page/file-system.js +1 -1
  305. package/lib/core/page/hash.js +1 -1
  306. package/lib/core/page/lock.js +1 -1
  307. package/lib/core/page/lr-smart-jsx.js +1 -1
  308. package/lib/core/sql-index-auditor.js +1 -1
  309. package/lib/core/sql-sync/config.js +1 -1
  310. package/lib/core/sql-sync/file-system.js +1 -1
  311. package/lib/core/sql-sync/hash.js +1 -1
  312. package/lib/core/sql-sync/lock.js +1 -1
  313. package/lib/core/sql-sync/utils.js +1 -1
  314. package/lib/core/sql-validator.js +1 -1
  315. package/lib/errors.js +1 -1
  316. package/lib/framework/build-all-flags.js +1 -1
  317. package/lib/framework/error-output.js +1 -1
  318. package/lib/framework/explicit-yes.js +1 -1
  319. package/lib/framework/flags.js +1 -1
  320. package/lib/framework/help.js +1 -1
  321. package/lib/framework/index.js +1 -1
  322. package/lib/framework/output.js +1 -1
  323. package/lib/framework/response.js +1 -1
  324. package/lib/framework/runner-alias.js +1 -1
  325. package/lib/framework/runner.js +1 -1
  326. package/lib/framework/schema-export.js +1 -1
  327. package/lib/framework/supported-flags.js +1 -1
  328. package/lib/framework/types.js +1 -1
  329. package/lib/generated/build-info.d.ts +4 -4
  330. package/lib/generated/build-info.js +1 -1
  331. package/lib/generated/official-routing.d.ts +2 -1
  332. package/lib/generated/official-routing.js +1 -1
  333. package/lib/generated/routing-contract.js +1 -1
  334. package/lib/help.js +1 -1
  335. package/lib/postinstall.js +1 -1
  336. package/lib/runtime/confirmation.js +1 -1
  337. package/lib/runtime/event.js +1 -1
  338. package/lib/runtime/index.js +1 -1
  339. package/lib/runtime/queue.js +1 -1
  340. package/lib/runtime/resolve.js +1 -1
  341. package/lib/services/dataset-design/checkpoint.js +1 -1
  342. package/lib/services/dataset-design/commands.js +1 -1
  343. package/lib/services/dataset-design/contract.js +1 -1
  344. package/lib/skills/builtin-skill.js +1 -1
  345. package/lib/skills/main.js +1 -1
  346. package/lib/skills/npx-skills-add.js +1 -1
  347. package/lib/skills/skill-presence.js +1 -1
  348. package/lib/telemetry/cli-command-trace.js +1 -1
  349. package/lib/telemetry/cli-help-trace.js +1 -1
  350. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  351. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  352. package/lib/telemetry/send-cli-trace-log.js +1 -1
  353. package/lib/utils/ai_config.js +1 -1
  354. package/lib/utils/apply-jq-filter.js +1 -1
  355. package/lib/utils/cdn-config.js +1 -1
  356. package/lib/utils/check-sdk-version.js +1 -1
  357. package/lib/utils/cli-version-check.js +1 -1
  358. package/lib/utils/cli-version-policy.js +1 -1
  359. package/lib/utils/config.js +1 -1
  360. package/lib/utils/entity-with-id.js +1 -1
  361. package/lib/utils/file-utils.js +1 -1
  362. package/lib/utils/guides-cdn.js +1 -1
  363. package/lib/utils/http-client.js +1 -1
  364. package/lib/utils/is-non-interactive.js +1 -1
  365. package/lib/utils/logger.js +1 -1
  366. package/lib/utils/params.js +1 -1
  367. package/lib/utils/platform.js +1 -1
  368. package/lib/utils/sleep.js +1 -1
  369. package/lib/utils/template-replacer.js +1 -1
  370. package/lib/utils/update-notice.js +1 -1
  371. package/lib/utils/version.js +1 -1
  372. package/lib/utils/with-active-cookie.js +1 -1
  373. package/lib/utils/write-cli-side-channel.js +1 -1
  374. package/package.json +1 -1
  375. package/skills/rabetbase/SKILL.md +1 -1
  376. package/skills/rabetbase/references/rabetbase-kb.md +1 -1
  377. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  378. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  379. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a34_0x13ff4a=a34_0x4954;function a34_0x5111(){const _0x219643=['apiError','write','file','update','get','POST','\x20app\x20config\x20','296780evQZUp','38FyQMMh','string','/smartapi/app-config/create','2624256EgrAtP','79569WLIwOU','81HumbqE','number','10913WKBeac','Read\x20config\x20value\x20from\x20file',',\x20appCode=','Updated','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','create','1650330yGiOHv','App\x20config\x20server\x20id\x20missing\x20for\x20key=','454392hbkYnv','/smartapi/app-config/update','2282838HtCEIn','isFinite','6DHQUqj','appCode','tags'];a34_0x5111=function(){return _0x219643;};return a34_0x5111();}(function(_0x337f67,_0x33f8d0){const _0x5f1dd8=a34_0x4954,_0x18904a=_0x337f67();while(!![]){try{const _0x2ee793=-parseInt(_0x5f1dd8(0xf0))/0x1*(parseInt(_0x5f1dd8(0xe9))/0x2)+parseInt(_0x5f1dd8(0xfa))/0x3+parseInt(_0x5f1dd8(0xec))/0x4+-parseInt(_0x5f1dd8(0xe8))/0x5+parseInt(_0x5f1dd8(0xde))/0x6*(-parseInt(_0x5f1dd8(0xed))/0x7)+-parseInt(_0x5f1dd8(0xf8))/0x8*(parseInt(_0x5f1dd8(0xee))/0x9)+-parseInt(_0x5f1dd8(0xf6))/0xa;if(_0x2ee793===_0x33f8d0)break;else _0x18904a['push'](_0x18904a['shift']());}catch(_0x4a0aed){_0x18904a['push'](_0x18904a['shift']());}}}(a34_0x5111,0x70f7c));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';function a34_0x4954(_0x1ae793,_0x765628){_0x1ae793=_0x1ae793-0xde;const _0x511150=a34_0x5111();let _0x495461=_0x511150[_0x1ae793];return _0x495461;}const CREATE_PATH=a34_0x13ff4a(0xeb),UPDATE_PATH=a34_0x13ff4a(0xf9);export const appConfigSet={'service':'app-config','command':'set','description':a34_0x13ff4a(0xf4),'risk':a34_0x13ff4a(0xe2),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x13ff4a(0xe3),'type':a34_0x13ff4a(0xea),'description':a34_0x13ff4a(0xf1)}],async 'validate'(_0x519e01){readKeyArg(_0x519e01),readOptionalTags(_0x519e01),assertSingleValueSource(_0x519e01);},async 'dryRun'(_0x4bad75){const _0x2f2ff4=a34_0x13ff4a,_0x5cc371=readKeyArg(_0x4bad75),_0x24dfdd=readOptionalTags(_0x4bad75),_0x8b978a=assertSingleValueSource(_0x4bad75);await assertValueSourceReadable(_0x8b978a);const _0x109024=await withAppConfigApiBoundary(_0x2f2ff4(0xe5),{'appCode':_0x4bad75[_0x2f2ff4(0xdf)],'key':_0x5cc371},()=>getAppConfigByKey(_0x4bad75[_0x2f2ff4(0xdf)],_0x5cc371)),_0x455608=_0x109024?'update':_0x2f2ff4(0xf5),_0x190387=_0x109024?projectAppConfig(_0x109024):null,_0x1fe707=plannedAppConfig({'appCode':_0x4bad75['appCode'],'key':_0x5cc371,'tags':_0x24dfdd??_0x109024?.[_0x2f2ff4(0xe0)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x455608,'appCode':_0x4bad75[_0x2f2ff4(0xdf)],'key':_0x5cc371,'before':_0x190387,'after':_0x1fe707,'dryRun':!![]}),{'method':_0x2f2ff4(0xe6),'url':_0x455608===_0x2f2ff4(0xe4)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x439d1e){const _0x57e3b6=a34_0x13ff4a,_0x3ca3b3=readKeyArg(_0x439d1e),_0x9037c2=readOptionalTags(_0x439d1e),_0x2bb2da=await withAppConfigApiBoundary(_0x57e3b6(0xe5),{'appCode':_0x439d1e[_0x57e3b6(0xdf)],'key':_0x3ca3b3},()=>getAppConfigByKey(_0x439d1e[_0x57e3b6(0xdf)],_0x3ca3b3)),_0x348e51=_0x2bb2da?projectAppConfig(_0x2bb2da):null,_0x269df0=_0x2bb2da?_0x57e3b6(0xe4):_0x57e3b6(0xf5),{value:_0x5219ed,warnings:_0x2681b0}=await readAppConfigValue(_0x439d1e),_0x40cde2={'appCode':_0x439d1e[_0x57e3b6(0xdf)],'key':_0x3ca3b3,'value':_0x5219ed,'tags':_0x9037c2??_0x2bb2da?.['tags']??undefined};await withAppConfigApiBoundary(_0x269df0,{'appCode':_0x439d1e[_0x57e3b6(0xdf)],'key':_0x3ca3b3},async()=>{const _0x209ddd=_0x57e3b6;_0x2bb2da?await updateAppConfig({..._0x40cde2,'id':requireAppConfigId(_0x2bb2da,_0x3ca3b3,_0x439d1e[_0x209ddd(0xdf)])}):await createAppConfig(_0x40cde2);});const _0x2f7d15=await withAppConfigApiBoundary(_0x57e3b6(0xe5),{'appCode':_0x439d1e[_0x57e3b6(0xdf)],'key':_0x3ca3b3},()=>getAppConfigByKey(_0x439d1e['appCode'],_0x3ca3b3)),_0x569b48=_0x2f7d15?projectAppConfig(_0x2f7d15):plannedAppConfig({'appCode':_0x439d1e['appCode'],'key':_0x3ca3b3,'tags':_0x40cde2[_0x57e3b6(0xe0)],'hasValue':_0x5219ed!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x269df0,'appCode':_0x439d1e[_0x57e3b6(0xdf)],'key':_0x3ca3b3,'before':_0x348e51,'after':_0x569b48,'dryRun':![],'warnings':_0x2681b0}),'message':(_0x269df0===_0x57e3b6(0xe4)?_0x57e3b6(0xf3):'Created')+_0x57e3b6(0xe7)+_0x3ca3b3};}};function requireAppConfigId(_0x972b45,_0x17de36,_0x40f058){const _0x150688=a34_0x13ff4a;if(typeof _0x972b45['id']===_0x150688(0xef)&&Number[_0x150688(0xfb)](_0x972b45['id'])&&_0x972b45['id']>0x0)return _0x972b45['id'];throw CliErrors[_0x150688(0xe1)](_0x150688(0xf7)+_0x17de36+_0x150688(0xf2)+_0x40f058);}
1
+ const a34_0x471457=a34_0x30ce;(function(_0x202742,_0x479d1a){const _0x854080=a34_0x30ce,_0x22106d=_0x202742();while(!![]){try{const _0x4ddac0=-parseInt(_0x854080(0x1cb))/0x1+parseInt(_0x854080(0x1d9))/0x2*(parseInt(_0x854080(0x1dd))/0x3)+parseInt(_0x854080(0x1da))/0x4*(parseInt(_0x854080(0x1e5))/0x5)+-parseInt(_0x854080(0x1cf))/0x6+-parseInt(_0x854080(0x1e1))/0x7+parseInt(_0x854080(0x1d0))/0x8*(-parseInt(_0x854080(0x1d1))/0x9)+parseInt(_0x854080(0x1e4))/0xa;if(_0x4ddac0===_0x479d1a)break;else _0x22106d['push'](_0x22106d['shift']());}catch(_0x3d38ac){_0x22106d['push'](_0x22106d['shift']());}}}(a34_0x48d7,0xa413a));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x30ce(_0x1270e6,_0x3f171d){_0x1270e6=_0x1270e6-0x1ca;const _0x48d732=a34_0x48d7();let _0x30cefb=_0x48d732[_0x1270e6];return _0x30cefb;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a34_0x48d7(){const _0x5b4728=['9578680mkORaF','15GJZqEW','POST','Updated','417671XFaHgv','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','number','\x20app\x20config\x20','1836432Drccon','50488CpOAkL','153oEncMz',',\x20appCode=','App\x20config\x20server\x20id\x20missing\x20for\x20key=','file','string','get','appCode','update','4QfBkrc','215712XERgMd','set','tags','1636716ZVtTby','isFinite','Created','apiError','4953956QoOPIa','write','create'];a34_0x48d7=function(){return _0x5b4728;};return a34_0x48d7();}import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH='/smartapi/app-config/create',UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':'app-config','command':a34_0x471457(0x1db),'description':a34_0x471457(0x1cc),'risk':a34_0x471457(0x1e2),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x471457(0x1d4),'type':a34_0x471457(0x1d5),'description':'Read\x20config\x20value\x20from\x20file'}],async 'validate'(_0x41bf78){readKeyArg(_0x41bf78),readOptionalTags(_0x41bf78),assertSingleValueSource(_0x41bf78);},async 'dryRun'(_0x2d07a9){const _0x136d57=a34_0x471457,_0x4fdc57=readKeyArg(_0x2d07a9),_0x1fb75d=readOptionalTags(_0x2d07a9),_0x470b12=assertSingleValueSource(_0x2d07a9);await assertValueSourceReadable(_0x470b12);const _0x1628d1=await withAppConfigApiBoundary(_0x136d57(0x1d6),{'appCode':_0x2d07a9['appCode'],'key':_0x4fdc57},()=>getAppConfigByKey(_0x2d07a9[_0x136d57(0x1d7)],_0x4fdc57)),_0x793fb0=_0x1628d1?'update':_0x136d57(0x1e3),_0x11b8cf=_0x1628d1?projectAppConfig(_0x1628d1):null,_0x2d2908=plannedAppConfig({'appCode':_0x2d07a9[_0x136d57(0x1d7)],'key':_0x4fdc57,'tags':_0x1fb75d??_0x1628d1?.[_0x136d57(0x1dc)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x793fb0,'appCode':_0x2d07a9[_0x136d57(0x1d7)],'key':_0x4fdc57,'before':_0x11b8cf,'after':_0x2d2908,'dryRun':!![]}),{'method':_0x136d57(0x1e6),'url':_0x793fb0===_0x136d57(0x1d8)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x18e794){const _0x51515d=a34_0x471457,_0x4768a5=readKeyArg(_0x18e794),_0x592a3a=readOptionalTags(_0x18e794),_0x233614=await withAppConfigApiBoundary(_0x51515d(0x1d6),{'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5},()=>getAppConfigByKey(_0x18e794[_0x51515d(0x1d7)],_0x4768a5)),_0x55ca7c=_0x233614?projectAppConfig(_0x233614):null,_0x1f9fe2=_0x233614?_0x51515d(0x1d8):'create',{value:_0x2a74b4,warnings:_0x4ecaf0}=await readAppConfigValue(_0x18e794),_0x321d1f={'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5,'value':_0x2a74b4,'tags':_0x592a3a??_0x233614?.['tags']??undefined};await withAppConfigApiBoundary(_0x1f9fe2,{'appCode':_0x18e794['appCode'],'key':_0x4768a5},async()=>{const _0xebe1aa=_0x51515d;_0x233614?await updateAppConfig({..._0x321d1f,'id':requireAppConfigId(_0x233614,_0x4768a5,_0x18e794[_0xebe1aa(0x1d7)])}):await createAppConfig(_0x321d1f);});const _0x4f430c=await withAppConfigApiBoundary(_0x51515d(0x1d6),{'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5},()=>getAppConfigByKey(_0x18e794[_0x51515d(0x1d7)],_0x4768a5)),_0x533800=_0x4f430c?projectAppConfig(_0x4f430c):plannedAppConfig({'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5,'tags':_0x321d1f[_0x51515d(0x1dc)],'hasValue':_0x2a74b4!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x1f9fe2,'appCode':_0x18e794[_0x51515d(0x1d7)],'key':_0x4768a5,'before':_0x55ca7c,'after':_0x533800,'dryRun':![],'warnings':_0x4ecaf0}),'message':(_0x1f9fe2===_0x51515d(0x1d8)?_0x51515d(0x1ca):_0x51515d(0x1df))+_0x51515d(0x1ce)+_0x4768a5};}};function requireAppConfigId(_0x54a510,_0x2121a7,_0x563598){const _0x5ea31f=a34_0x471457;if(typeof _0x54a510['id']===_0x5ea31f(0x1cd)&&Number[_0x5ea31f(0x1de)](_0x54a510['id'])&&_0x54a510['id']>0x0)return _0x54a510['id'];throw CliErrors[_0x5ea31f(0x1e0)](_0x5ea31f(0x1d3)+_0x2121a7+_0x5ea31f(0x1d2)+_0x563598);}
@@ -1 +1 @@
1
- const a35_0x34ea46=a35_0x3d2e;(function(_0x149c83,_0x24b386){const _0x23cb7d=a35_0x3d2e,_0x2ab16a=_0x149c83();while(!![]){try{const _0x220b06=parseInt(_0x23cb7d(0x16a))/0x1+parseInt(_0x23cb7d(0x163))/0x2+parseInt(_0x23cb7d(0x183))/0x3+parseInt(_0x23cb7d(0x198))/0x4*(-parseInt(_0x23cb7d(0x199))/0x5)+parseInt(_0x23cb7d(0x164))/0x6+-parseInt(_0x23cb7d(0x19d))/0x7*(parseInt(_0x23cb7d(0x18d))/0x8)+-parseInt(_0x23cb7d(0x176))/0x9*(-parseInt(_0x23cb7d(0x189))/0xa);if(_0x220b06===_0x24b386)break;else _0x2ab16a['push'](_0x2ab16a['shift']());}catch(_0x5e2861){_0x2ab16a['push'](_0x2ab16a['shift']());}}}(a35_0x2e44,0x4600c));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':a35_0x34ea46(0x19c),'required':!![]};export const VALUE_ARG={'name':'value','description':a35_0x34ea46(0x192),'required':![]};export const TAGS_FLAG={'name':a35_0x34ea46(0x18f),'type':a35_0x34ea46(0x16e),'description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a35_0x34ea46(0x172),'type':a35_0x34ea46(0x19f),'description':a35_0x34ea46(0x18b),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x34ea46(0x16c),'type':'string','description':a35_0x34ea46(0x1a2)};export const REVEAL_FLAG={'name':'reveal','type':'boolean','description':a35_0x34ea46(0x195),'default':![]};export function readKeyArg(_0x2ad705){const _0x9705de=a35_0x34ea46,_0x5e1c39=_0x2ad705[_0x9705de(0x18a)][0x0]?.[_0x9705de(0x17f)]()??'';return validateKey(_0x5e1c39),_0x5e1c39;}export function readOptionalTags(_0x27ee5b){const _0x5504bc=a35_0x34ea46,_0x3b5afe=_0x27ee5b[_0x5504bc(0x17a)](_0x5504bc(0x18f))[_0x5504bc(0x17f)]();if(!_0x3b5afe)return undefined;if(_0x3b5afe[_0x5504bc(0x19a)]>0x20)throw CliErrors['validation'](_0x5504bc(0x17c));return _0x3b5afe;}export function validateKey(_0xd91a0){const _0x13e5c2=a35_0x34ea46;if(!_0xd91a0)throw CliErrors[_0x13e5c2(0x16f)](_0x13e5c2(0x175));if(_0xd91a0[_0x13e5c2(0x19a)]>0x100)throw CliErrors[_0x13e5c2(0x16f)](_0x13e5c2(0x180));}export function projectAppConfig(_0x2117b7,_0x59f0aa){const _0x88b3d0=a35_0x34ea46,_0x1949e8=_0x2117b7['value']!==undefined&&_0x2117b7[_0x88b3d0(0x170)]!==null&&_0x2117b7[_0x88b3d0(0x170)]!=='',_0x2fa749={'appCode':_0x2117b7['appCode'],'key':_0x2117b7[_0x88b3d0(0x185)],'tags':_0x2117b7[_0x88b3d0(0x18f)]??undefined,'hasValue':_0x1949e8,'valueRedacted':_0x1949e8&&!_0x59f0aa?.[_0x88b3d0(0x171)],'gmtCreate':_0x2117b7[_0x88b3d0(0x182)],'gmtModified':_0x2117b7[_0x88b3d0(0x173)]};return _0x59f0aa?.[_0x88b3d0(0x171)]&&(_0x2fa749[_0x88b3d0(0x170)]=_0x2117b7['value']??'',_0x2fa749[_0x88b3d0(0x16b)]=![]),_0x2fa749;}function a35_0x2e44(){const _0x1acbc4=['name','slice','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','once','file','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','path','dryRun','1944552khWNkU','5oeQPVM','length','error','Runtime\x20app-config\x20key','2218006doKvmL','hasValue','boolean','end','Failed\x20to\x20','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','985494eeqfHl','1364712lOAOwX','appCode:\x20','appCode','operation','flag','join','179525mUDQDH','valueRedacted','from-env','kind','string','validation','value','reveal','stdin','gmtModified','push','Missing\x20app-config\x20key.','18owVXUR','env','apiError','before','str','data','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','utf8','argument','trim','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','Missing\x20app-config\x20value\x20source.','gmtCreate','96624jOwKoV','key:\x20','key','\x20app\x20config.','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','method','788980ayChNJ','args','Read\x20config\x20value\x20from\x20stdin','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','8nNUjTo','defineProperties','tags'];a35_0x2e44=function(){return _0x1acbc4;};return a35_0x2e44();}export function plannedAppConfig(_0x2dc4e1){const _0x10c178=a35_0x34ea46,_0x271431=_0x2dc4e1[_0x10c178(0x19e)]??!![];return{'appCode':_0x2dc4e1[_0x10c178(0x166)],'key':_0x2dc4e1[_0x10c178(0x185)],'tags':_0x2dc4e1[_0x10c178(0x18f)]??undefined,'hasValue':_0x271431,'valueRedacted':_0x271431};}export function buildMutationData(_0x54cebd){const _0x18ffe1=a35_0x34ea46;return{'operation':_0x54cebd[_0x18ffe1(0x167)],'selector':{'appCode':_0x54cebd[_0x18ffe1(0x166)],'key':_0x54cebd[_0x18ffe1(0x185)]},'before':_0x54cebd[_0x18ffe1(0x179)],'after':_0x54cebd['after'],'dryRun':_0x54cebd[_0x18ffe1(0x197)],'warnings':_0x54cebd['warnings']??[]};}export async function withAppConfigApiBoundary(_0x6f37b7,_0xdeafc6,_0x13f0bd){const _0x1c70a8=a35_0x34ea46;try{return await _0x13f0bd();}catch{const _0x552f8b=[_0x1c70a8(0x165)+_0xdeafc6[_0x1c70a8(0x166)]];if(_0xdeafc6[_0x1c70a8(0x185)])_0x552f8b[_0x1c70a8(0x174)](_0x1c70a8(0x184)+_0xdeafc6[_0x1c70a8(0x185)]);_0x552f8b[_0x1c70a8(0x174)]('value\x20is\x20redacted');throw CliErrors[_0x1c70a8(0x178)](_0x1c70a8(0x1a1)+_0x6f37b7+_0x1c70a8(0x186),_0x552f8b['join'](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x39bb75,_0x1599fb){const _0x513ea2=a35_0x34ea46;return Object[_0x513ea2(0x18e)](_0x39bb75,{'method':{'value':_0x1599fb[_0x513ea2(0x188)],'enumerable':![]},'url':{'value':_0x1599fb['url'],'enumerable':![]}});}export function assertSingleValueSource(_0xf5116e){const _0x31dc26=a35_0x34ea46,_0x224f57=[];_0xf5116e[_0x31dc26(0x18a)][_0x31dc26(0x19a)]>0x1&&_0x224f57[_0x31dc26(0x174)]({'kind':_0x31dc26(0x17e),'value':_0xf5116e[_0x31dc26(0x18a)][_0x31dc26(0x191)](0x1)[_0x31dc26(0x169)]('\x20')});const _0xd51829=_0xf5116e[_0x31dc26(0x168)]('value');_0xd51829!==undefined&&_0xd51829!==null&&_0x224f57[_0x31dc26(0x174)]({'kind':_0x31dc26(0x17e),'value':String(_0xd51829)});_0xf5116e['bool'](_0x31dc26(0x172))&&_0x224f57['push']({'kind':_0x31dc26(0x172)});const _0x5656c1=_0xf5116e[_0x31dc26(0x17a)](_0x31dc26(0x16c))[_0x31dc26(0x17f)]();_0x5656c1&&_0x224f57[_0x31dc26(0x174)]({'kind':_0x31dc26(0x177),'name':_0x5656c1});const _0x40003a=_0xf5116e['str'](_0x31dc26(0x194))[_0x31dc26(0x17f)]();_0x40003a&&_0x224f57['push']({'kind':'file','path':_0x40003a});if(_0x224f57[_0x31dc26(0x19a)]===0x0)throw CliErrors[_0x31dc26(0x16f)](_0x31dc26(0x181),_0x31dc26(0x18c));if(_0x224f57['length']>0x1)throw CliErrors[_0x31dc26(0x16f)]('App\x20config\x20value\x20source\x20is\x20ambiguous.','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');return _0x224f57[0x0];}function a35_0x3d2e(_0x27ddeb,_0x59fd1a){_0x27ddeb=_0x27ddeb-0x163;const _0x2e44f7=a35_0x2e44();let _0x3d2efe=_0x2e44f7[_0x27ddeb];return _0x3d2efe;}export async function assertValueSourceReadable(_0x5f449d){const _0x3e2503=a35_0x34ea46;if(_0x5f449d[_0x3e2503(0x16d)]===_0x3e2503(0x177)&&!(_0x5f449d[_0x3e2503(0x190)]in process.env))throw CliErrors[_0x3e2503(0x16f)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x5f449d[_0x3e2503(0x190)]);if(_0x5f449d[_0x3e2503(0x16d)]===_0x3e2503(0x194))try{await access(_0x5f449d[_0x3e2503(0x196)]);}catch{throw CliErrors['validation']('Value\x20file\x20is\x20not\x20readable:\x20'+_0x5f449d[_0x3e2503(0x196)]);}}export async function readAppConfigValue(_0x288356){const _0x409973=a35_0x34ea46,_0x26f88b=assertSingleValueSource(_0x288356),_0x2893fe=[];if(_0x26f88b[_0x409973(0x16d)]===_0x409973(0x17e))return _0x2893fe[_0x409973(0x174)](_0x409973(0x187)),{'value':_0x26f88b[_0x409973(0x170)]??'','source':_0x26f88b[_0x409973(0x16d)],'warnings':_0x2893fe};if(_0x26f88b['kind']===_0x409973(0x172))return{'value':await readStdin(),'source':_0x26f88b[_0x409973(0x16d)],'warnings':_0x2893fe};if(_0x26f88b[_0x409973(0x16d)]==='env'){if(!(_0x26f88b[_0x409973(0x190)]in process.env))throw CliErrors[_0x409973(0x16f)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x26f88b['name']);return{'value':process.env[_0x26f88b.name]??'','source':_0x26f88b[_0x409973(0x16d)],'warnings':_0x2893fe};}return{'value':await readFile(_0x26f88b[_0x409973(0x196)],_0x409973(0x17d)),'source':_0x26f88b[_0x409973(0x16d)],'warnings':_0x2893fe};}function readStdin(){return new Promise((_0x3e3433,_0x549c80)=>{const _0x3c6ea8=a35_0x3d2e;let _0x8470f8='';process[_0x3c6ea8(0x172)]['setEncoding']('utf8'),process['stdin']['on'](_0x3c6ea8(0x17b),_0x1f7dc0=>{_0x8470f8+=_0x1f7dc0;}),process[_0x3c6ea8(0x172)][_0x3c6ea8(0x193)](_0x3c6ea8(0x1a0),()=>_0x3e3433(_0x8470f8)),process[_0x3c6ea8(0x172)]['once'](_0x3c6ea8(0x19b),_0x549c80);});}
1
+ const a35_0x264bb6=a35_0x1002;(function(_0x5230c6,_0x2ef422){const _0xe8e788=a35_0x1002,_0x5d0ea2=_0x5230c6();while(!![]){try{const _0x31ea05=parseInt(_0xe8e788(0xdc))/0x1+-parseInt(_0xe8e788(0xbc))/0x2+parseInt(_0xe8e788(0xc9))/0x3*(parseInt(_0xe8e788(0xba))/0x4)+-parseInt(_0xe8e788(0xc1))/0x5*(-parseInt(_0xe8e788(0xbd))/0x6)+parseInt(_0xe8e788(0xd6))/0x7*(-parseInt(_0xe8e788(0xab))/0x8)+-parseInt(_0xe8e788(0xda))/0x9*(parseInt(_0xe8e788(0xe2))/0xa)+-parseInt(_0xe8e788(0xb0))/0xb;if(_0x31ea05===_0x2ef422)break;else _0x5d0ea2['push'](_0x5d0ea2['shift']());}catch(_0x4f13e4){_0x5d0ea2['push'](_0x5d0ea2['shift']());}}}(a35_0x566e,0x6c3b9));function a35_0x566e(){const _0x37f119=['argument','path','tags','value','\x20app\x20config.','error','key','Value\x20file\x20is\x20not\x20readable:\x20','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','21DqoVdy','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','reveal','validation','7029171lqRYmw','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','707803JWXeSN','name','url','Read\x20config\x20value\x20from\x20stdin','key:\x20','appCode','10DInBSC','length','str','appCode:\x20','args','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','push','Missing\x20app-config\x20key.','Environment\x20variable\x20is\x20not\x20set:\x20','609536hKxAyT','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','Failed\x20to\x20','boolean','Config\x20tags\x20for\x20filtering/display\x20metadata','1313598BkKiKN','trim','Runtime\x20app-config\x20key','valueRedacted','bool','operation','stdin','flag','gmtCreate','hasValue','482948uqzzKT','value\x20is\x20redacted','925176GFWcMg','578352PJEVIG','once','from-env','apiError','25pDGjez','join','gmtModified','end','env','warnings','kind','file','21rKHvHq','dryRun','after','defineProperties'];a35_0x566e=function(){return _0x37f119;};return a35_0x566e();}import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x264bb6(0xd3),'description':a35_0x264bb6(0xb2),'required':!![]};export const VALUE_ARG={'name':a35_0x264bb6(0xd0),'description':a35_0x264bb6(0xdb),'required':![]};export const TAGS_FLAG={'name':a35_0x264bb6(0xcf),'type':'string','description':a35_0x264bb6(0xaf)};export const STDIN_FLAG={'name':a35_0x264bb6(0xb6),'type':a35_0x264bb6(0xae),'description':a35_0x264bb6(0xdf),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x264bb6(0xbf),'type':'string','description':a35_0x264bb6(0xac)};export const REVEAL_FLAG={'name':a35_0x264bb6(0xd8),'type':a35_0x264bb6(0xae),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x45d924){const _0x21e76e=a35_0x264bb6,_0x57f069=_0x45d924[_0x21e76e(0xe6)][0x0]?.['trim']()??'';return validateKey(_0x57f069),_0x57f069;}export function readOptionalTags(_0x519c72){const _0x2f7a1b=a35_0x264bb6,_0x312580=_0x519c72[_0x2f7a1b(0xe4)](_0x2f7a1b(0xcf))[_0x2f7a1b(0xb1)]();if(!_0x312580)return undefined;if(_0x312580['length']>0x20)throw CliErrors[_0x2f7a1b(0xd9)]('App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.');return _0x312580;}export function validateKey(_0x4c3d50){const _0x5ca42f=a35_0x264bb6;if(!_0x4c3d50)throw CliErrors['validation'](_0x5ca42f(0xe9));if(_0x4c3d50['length']>0x100)throw CliErrors[_0x5ca42f(0xd9)](_0x5ca42f(0xd7));}export function projectAppConfig(_0x5d2f61,_0x2d93ab){const _0x192be4=a35_0x264bb6,_0x256f2e=_0x5d2f61['value']!==undefined&&_0x5d2f61[_0x192be4(0xd0)]!==null&&_0x5d2f61['value']!=='',_0x49cadd={'appCode':_0x5d2f61[_0x192be4(0xe1)],'key':_0x5d2f61['key'],'tags':_0x5d2f61[_0x192be4(0xcf)]??undefined,'hasValue':_0x256f2e,'valueRedacted':_0x256f2e&&!_0x2d93ab?.['reveal'],'gmtCreate':_0x5d2f61[_0x192be4(0xb8)],'gmtModified':_0x5d2f61[_0x192be4(0xc3)]};return _0x2d93ab?.[_0x192be4(0xd8)]&&(_0x49cadd['value']=_0x5d2f61[_0x192be4(0xd0)]??'',_0x49cadd[_0x192be4(0xb3)]=![]),_0x49cadd;}export function plannedAppConfig(_0x2438f5){const _0x305878=a35_0x264bb6,_0x4c8e6d=_0x2438f5[_0x305878(0xb9)]??!![];return{'appCode':_0x2438f5[_0x305878(0xe1)],'key':_0x2438f5[_0x305878(0xd3)],'tags':_0x2438f5[_0x305878(0xcf)]??undefined,'hasValue':_0x4c8e6d,'valueRedacted':_0x4c8e6d};}export function buildMutationData(_0x215291){const _0x305ae2=a35_0x264bb6;return{'operation':_0x215291[_0x305ae2(0xb5)],'selector':{'appCode':_0x215291[_0x305ae2(0xe1)],'key':_0x215291[_0x305ae2(0xd3)]},'before':_0x215291['before'],'after':_0x215291[_0x305ae2(0xcb)],'dryRun':_0x215291[_0x305ae2(0xca)],'warnings':_0x215291[_0x305ae2(0xc6)]??[]};}export async function withAppConfigApiBoundary(_0x5c424c,_0x1e3319,_0x5e0675){const _0x175174=a35_0x264bb6;try{return await _0x5e0675();}catch{const _0x1627e7=[_0x175174(0xe5)+_0x1e3319[_0x175174(0xe1)]];if(_0x1e3319['key'])_0x1627e7['push'](_0x175174(0xe0)+_0x1e3319[_0x175174(0xd3)]);_0x1627e7[_0x175174(0xe8)](_0x175174(0xbb));throw CliErrors[_0x175174(0xc0)](_0x175174(0xad)+_0x5c424c+_0x175174(0xd1),_0x1627e7[_0x175174(0xc2)](';\x20')+'.');}}function a35_0x1002(_0x308835,_0x707daa){_0x308835=_0x308835-0xab;const _0x566ede=a35_0x566e();let _0x1002fd=_0x566ede[_0x308835];return _0x1002fd;}export function asAppConfigDryRunResult(_0x1de12c,_0x3aa7c5){const _0x527146=a35_0x264bb6;return Object[_0x527146(0xcc)](_0x1de12c,{'method':{'value':_0x3aa7c5['method'],'enumerable':![]},'url':{'value':_0x3aa7c5[_0x527146(0xde)],'enumerable':![]}});}export function assertSingleValueSource(_0xab51d2){const _0x3426da=a35_0x264bb6,_0x5d292d=[];_0xab51d2['args'][_0x3426da(0xe3)]>0x1&&_0x5d292d[_0x3426da(0xe8)]({'kind':_0x3426da(0xcd),'value':_0xab51d2[_0x3426da(0xe6)]['slice'](0x1)['join']('\x20')});const _0x19952c=_0xab51d2[_0x3426da(0xb7)](_0x3426da(0xd0));_0x19952c!==undefined&&_0x19952c!==null&&_0x5d292d[_0x3426da(0xe8)]({'kind':_0x3426da(0xcd),'value':String(_0x19952c)});_0xab51d2[_0x3426da(0xb4)](_0x3426da(0xb6))&&_0x5d292d[_0x3426da(0xe8)]({'kind':'stdin'});const _0x4e3f2b=_0xab51d2[_0x3426da(0xe4)](_0x3426da(0xbf))[_0x3426da(0xb1)]();_0x4e3f2b&&_0x5d292d['push']({'kind':_0x3426da(0xc5),'name':_0x4e3f2b});const _0x5e3c44=_0xab51d2[_0x3426da(0xe4)](_0x3426da(0xc8))[_0x3426da(0xb1)]();_0x5e3c44&&_0x5d292d['push']({'kind':_0x3426da(0xc8),'path':_0x5e3c44});if(_0x5d292d[_0x3426da(0xe3)]===0x0)throw CliErrors['validation']('Missing\x20app-config\x20value\x20source.',_0x3426da(0xd5));if(_0x5d292d[_0x3426da(0xe3)]>0x1)throw CliErrors[_0x3426da(0xd9)]('App\x20config\x20value\x20source\x20is\x20ambiguous.',_0x3426da(0xe7));return _0x5d292d[0x0];}export async function assertValueSourceReadable(_0x4271b3){const _0x7e4d27=a35_0x264bb6;if(_0x4271b3[_0x7e4d27(0xc7)]===_0x7e4d27(0xc5)&&!(_0x4271b3[_0x7e4d27(0xdd)]in process.env))throw CliErrors['validation']('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x4271b3[_0x7e4d27(0xdd)]);if(_0x4271b3[_0x7e4d27(0xc7)]===_0x7e4d27(0xc8))try{await access(_0x4271b3['path']);}catch{throw CliErrors[_0x7e4d27(0xd9)](_0x7e4d27(0xd4)+_0x4271b3[_0x7e4d27(0xce)]);}}export async function readAppConfigValue(_0x35554c){const _0x1f5562=a35_0x264bb6,_0x2957df=assertSingleValueSource(_0x35554c),_0x3ef0aa=[];if(_0x2957df[_0x1f5562(0xc7)]===_0x1f5562(0xcd))return _0x3ef0aa[_0x1f5562(0xe8)]('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x2957df[_0x1f5562(0xd0)]??'','source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};if(_0x2957df['kind']===_0x1f5562(0xb6))return{'value':await readStdin(),'source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};if(_0x2957df[_0x1f5562(0xc7)]===_0x1f5562(0xc5)){if(!(_0x2957df[_0x1f5562(0xdd)]in process.env))throw CliErrors[_0x1f5562(0xd9)](_0x1f5562(0xea)+_0x2957df[_0x1f5562(0xdd)]);return{'value':process.env[_0x2957df.name]??'','source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};}return{'value':await readFile(_0x2957df[_0x1f5562(0xce)],'utf8'),'source':_0x2957df[_0x1f5562(0xc7)],'warnings':_0x3ef0aa};}function readStdin(){return new Promise((_0x116ac2,_0x5b14d8)=>{const _0x575c72=a35_0x1002;let _0x28d462='';process['stdin']['setEncoding']('utf8'),process[_0x575c72(0xb6)]['on']('data',_0x2c2ae5=>{_0x28d462+=_0x2c2ae5;}),process['stdin'][_0x575c72(0xbe)](_0x575c72(0xc4),()=>_0x116ac2(_0x28d462)),process['stdin'][_0x575c72(0xbe)](_0x575c72(0xd2),_0x5b14d8);});}
@@ -1 +1 @@
1
- function a36_0x3a9d(_0x518900,_0x184ca3){_0x518900=_0x518900-0x126;const _0x287bb7=a36_0x287b();let _0x3a9dad=_0x287bb7[_0x518900];return _0x3a9dad;}const a36_0x4d3d72=a36_0x3a9d;(function(_0x56398f,_0x36de00){const _0x4f9ec1=a36_0x3a9d,_0x286b42=_0x56398f();while(!![]){try{const _0x5eaab2=-parseInt(_0x4f9ec1(0x12e))/0x1*(parseInt(_0x4f9ec1(0x130))/0x2)+parseInt(_0x4f9ec1(0x131))/0x3+parseInt(_0x4f9ec1(0x129))/0x4*(-parseInt(_0x4f9ec1(0x139))/0x5)+parseInt(_0x4f9ec1(0x12f))/0x6+parseInt(_0x4f9ec1(0x12a))/0x7+-parseInt(_0x4f9ec1(0x134))/0x8+parseInt(_0x4f9ec1(0x136))/0x9;if(_0x5eaab2===_0x36de00)break;else _0x286b42['push'](_0x286b42['shift']());}catch(_0x540cc2){_0x286b42['push'](_0x286b42['shift']());}}}(a36_0x287b,0x1e83c));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x287b(){const _0x166021=['nonInteractive','25928dUHkNX','587790KYgxSo','✓\x20Logged\x20out','yes','logout','236741XVSxHz','558492OxlodR','2wnuAhB','111312ZTcCwA','write','boolean','738280VLQPiJ','login','2625426ooAEOg','Login\x20via\x20browser','log','40FqNjMF','../../auth/auth-server-ui.js','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately'];a36_0x287b=function(){return _0x166021;};return a36_0x287b();}export const authDefinitions=[{'service':'auth','command':a36_0x4d3d72(0x135),'description':a36_0x4d3d72(0x137),'risk':a36_0x4d3d72(0x132),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x4d3d72(0x12c),'type':a36_0x4d3d72(0x133),'description':a36_0x4d3d72(0x127),'default':![]}],async 'execute'(_0x2aa3d2){const _0x260b4f=a36_0x4d3d72,{runAuthServer:_0x5d3b63}=await import(_0x260b4f(0x126));return await _0x5d3b63({'autoYes':_0x2aa3d2['bool']('yes'),'nonInteractive':_0x2aa3d2[_0x260b4f(0x128)]}),{'ok':!![]};}},{'service':'auth','command':a36_0x4d3d72(0x12d),'description':'Clear\x20login\x20session','risk':a36_0x4d3d72(0x132),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x8aa4f1){const _0x2d6181=a36_0x4d3d72;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x2d6181(0x138)](_0x2d6181(0x12b))):console[_0x2d6181(0x138)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
1
+ const a36_0x2dee4d=a36_0x2042;(function(_0x144d45,_0x4d3c9b){const _0x27df1a=a36_0x2042,_0x37a8d3=_0x144d45();while(!![]){try{const _0x45b85=parseInt(_0x27df1a(0x1b6))/0x1+-parseInt(_0x27df1a(0x1b1))/0x2*(-parseInt(_0x27df1a(0x1b8))/0x3)+-parseInt(_0x27df1a(0x1b9))/0x4*(-parseInt(_0x27df1a(0x1ba))/0x5)+parseInt(_0x27df1a(0x1c5))/0x6+parseInt(_0x27df1a(0x1be))/0x7*(parseInt(_0x27df1a(0x1c6))/0x8)+parseInt(_0x27df1a(0x1bb))/0x9*(-parseInt(_0x27df1a(0x1bc))/0xa)+-parseInt(_0x27df1a(0x1b3))/0xb;if(_0x45b85===_0x4d3c9b)break;else _0x37a8d3['push'](_0x37a8d3['shift']());}catch(_0x59bc84){_0x37a8d3['push'](_0x37a8d3['shift']());}}}(a36_0x1d3b,0x82a95));function a36_0x2042(_0x19e88a,_0x146390){_0x19e88a=_0x19e88a-0x1b0;const _0x1d3be5=a36_0x1d3b();let _0x204237=_0x1d3be5[_0x19e88a];return _0x204237;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':a36_0x2dee4d(0x1b2),'risk':a36_0x2dee4d(0x1c2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x2dee4d(0x1c3),'type':a36_0x2dee4d(0x1bf),'description':a36_0x2dee4d(0x1c1),'default':![]}],async 'execute'(_0x4e36b0){const _0x153ca6=a36_0x2dee4d,{runAuthServer:_0x3b4554}=await import(_0x153ca6(0x1b0));return await _0x3b4554({'autoYes':_0x4e36b0['bool'](_0x153ca6(0x1c3)),'nonInteractive':_0x4e36b0[_0x153ca6(0x1b4)]}),{'ok':!![]};}},{'service':a36_0x2dee4d(0x1bd),'command':'logout','description':a36_0x2dee4d(0x1c4),'risk':a36_0x2dee4d(0x1c2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x296aa5){const _0x2192e8=a36_0x2dee4d;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x2192e8(0x1b7)](_0x2192e8(0x1b5))):console['log'](_0x2192e8(0x1c0)),{'ok':!![]};}}];function a36_0x1d3b(){const _0x435159=['785067gLFPWd','log','3069591ZKcLlB','1055588hhJbom','10dfkJGT','9EfDhtT','9895780GMetMo','auth','1009211qYkMPv','boolean','!\x20Not\x20logged\x20in','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','write','yes','Clear\x20login\x20session','4110006RCRcUD','24FbOJOk','../../auth/auth-server-ui.js','2onQMax','Login\x20via\x20browser','21216921FwYHGx','nonInteractive','✓\x20Logged\x20out'];a36_0x1d3b=function(){return _0x435159;};return a36_0x1d3b();}
@@ -1 +1 @@
1
- const a37_0xc44fdd=a37_0x38ee;(function(_0x2d9e9d,_0x464449){const _0x3e9359=a37_0x38ee,_0x1ba0c8=_0x2d9e9d();while(!![]){try{const _0xba83d8=parseInt(_0x3e9359(0x1c6))/0x1+-parseInt(_0x3e9359(0x1dd))/0x2+parseInt(_0x3e9359(0x1b6))/0x3+parseInt(_0x3e9359(0x1d5))/0x4*(parseInt(_0x3e9359(0x20b))/0x5)+parseInt(_0x3e9359(0x1c4))/0x6*(-parseInt(_0x3e9359(0x1df))/0x7)+parseInt(_0x3e9359(0x1ae))/0x8*(-parseInt(_0x3e9359(0x1b4))/0x9)+parseInt(_0x3e9359(0x1ff))/0xa;if(_0xba83d8===_0x464449)break;else _0x1ba0c8['push'](_0x1ba0c8['shift']());}catch(_0x2cdbb4){_0x1ba0c8['push'](_0x1ba0c8['shift']());}}}(a37_0x45e6,0xa4cf2));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';function a37_0x45e6(){const _0x8849f0=['stderr','6910980bPfNYZ','\x22\x20not\x20found\x20for\x20dataset\x20','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','after','/ENDPOINT/','datasetCode','tableName','operation-type','/data/dataset/','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','trim','1630675mfIRVz','before','Operation\x20type\x20\x22','alias','\x22.\x20','includes','currentApp','Invalid\x20dataset\x20selection.','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Select\x20operation\x20type:','\x20api\x20pull`\x20to\x20refresh.','appCode','validation','Operation\x20type\x20(HOOK\x20only)','create','close','isInteger','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Function\x20name\x20(valid\x20JS\x20identifier)','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','HOOK','40DkRNxu','\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','bff','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','Select\x20dataset:','\x20function:\x20','111294YhIEmG','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','1242996IIXhjc','string','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','/HOOK/','/**\x0a\x20*\x20','Created\x20','Select\x20trigger\x20node:','code','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22,\x20params\x20})\x0a','Invalid\x20function\x20name\x20\x22','4511226LOwaBm','parseInt','173715RmmhSO','join','.js\x0a','HOOK\x20requires\x20alias/operation/node\x20options.','apiDir','nonInteractive','source','question','entries','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','Dataset\x20not\x20found\x20for\x20code\x20\x22','Script\x20description','operationType','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','File\x20already\x20exists:\x20','4eicxnq','description','COMMON','No\x20operation\x20types\x20found\x20for\x20dataset\x20','defaultApp','修改后的响应结果','ENDPOINT','datasetcode','233042nhpAZm','No\x20datasets\x20found\x20for\x20this\x20app.','7mgquHg','read','write','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','datasetId','Trigger\x20node\x20(HOOK\x20only)','stdin','name','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','/COMMON/','str','find','map','修改后的请求参数','\x0a\x20*\x20[平台配置]\x20','Available\x20aliases:\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','type','当前响应结果','.js','\x22\x20not\x20found.\x20','mergedCli','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','functionNode','scriptsRootDir','length','UNKNOWN','function-node','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','profileName'];a37_0x45e6=function(){return _0x8849f0;};return a37_0x45e6();}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0x38ee(_0x2a2314,_0x2bf0d4){_0x2a2314=_0x2a2314-0x1a2;const _0x45e6b3=a37_0x45e6();let _0x38ee43=_0x45e6b3[_0x2a2314];return _0x38ee43;}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_0xc44fdd(0x1b0),'command':a37_0xc44fdd(0x1a7),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a37_0xc44fdd(0x1e0),'flags':[{'name':a37_0xc44fdd(0x1f0),'type':'string','required':!![],'enum':[a37_0xc44fdd(0x1d7),a37_0xc44fdd(0x1db),a37_0xc44fdd(0x1ad)],'description':'Script\x20type'},{'name':a37_0xc44fdd(0x1e6),'type':a37_0xc44fdd(0x1b7),'required':!![],'description':a37_0xc44fdd(0x1ab)},{'name':'description','type':'string','description':a37_0xc44fdd(0x1d1)},{'name':a37_0xc44fdd(0x20e),'type':'string','description':a37_0xc44fdd(0x213)},{'name':a37_0xc44fdd(0x1dc),'type':'string','description':a37_0xc44fdd(0x1d3)},{'name':a37_0xc44fdd(0x207),'type':'string','description':a37_0xc44fdd(0x1a6)},{'name':a37_0xc44fdd(0x1fa),'type':'string','description':a37_0xc44fdd(0x1e4),'enum':[a37_0xc44fdd(0x20c),a37_0xc44fdd(0x203)]}],async 'validate'(_0x3130fd){const _0x5ac436=a37_0xc44fdd,_0x1c3159=_0x3130fd[_0x5ac436(0x1e9)](_0x5ac436(0x1e6));if(!isValidBffFunctionName(_0x1c3159))throw CliErrors[_0x5ac436(0x1a5)](_0x5ac436(0x1c3)+_0x1c3159+'\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).');},async 'execute'(_0x52fb86){const _0x24cf51=a37_0xc44fdd,_0x3a1d87=loadBffProjectConfig(_0x52fb86[_0x24cf51(0x1a4)]),_0x7c616=_0x52fb86['str'](_0x24cf51(0x1f0)),_0xe66623=_0x52fb86[_0x24cf51(0x1e9)](_0x24cf51(0x1e6)),_0xf7b470=_0x52fb86[_0x24cf51(0x1e9)](_0x24cf51(0x1d6))||undefined,_0x30fc83=_0x7c616===_0x24cf51(0x1ad)?await resolveHookOptions(_0x3a1d87,_0x52fb86):undefined,_0x4cbde7=buildFilePath(_0x3a1d87,_0x7c616,_0xe66623,_0x30fc83);if(await fileExists(_0x4cbde7))throw CliErrors[_0x24cf51(0x1a5)](_0x24cf51(0x1d4)+_0x4cbde7);await mkdir(dirname(_0x4cbde7),{'recursive':!![]});const _0x540e90=generateTemplate(_0x7c616,_0xe66623,_0x52fb86['appCode'],_0xf7b470,_0x30fc83);await writeFile(_0x4cbde7,_0x540e90,'utf8');const _0x142e95={'type':_0x7c616,'name':_0xe66623,'path':_0x4cbde7};if(_0xf7b470)_0x142e95['description']=_0xf7b470;if(_0x30fc83){if(_0x30fc83[_0x24cf51(0x20e)])_0x142e95[_0x24cf51(0x20e)]=_0x30fc83[_0x24cf51(0x20e)];_0x142e95[_0x24cf51(0x205)]=_0x30fc83['datasetCode'],_0x142e95[_0x24cf51(0x1d2)]=_0x30fc83[_0x24cf51(0x1d2)],_0x142e95[_0x24cf51(0x1f6)]=_0x30fc83[_0x24cf51(0x1f6)];}return{'ok':!![],'data':_0x142e95,'message':_0x24cf51(0x1bd)+_0x7c616+_0x24cf51(0x1b3)+_0xe66623};}};async function resolveHookOptions(_0x1aef75,_0x5d01f0){const _0x590370=a37_0xc44fdd,_0x2bd291=resolveApiModelSource(_0x5d01f0[_0x590370(0x1ca)],_0x5d01f0[_0x590370(0x1a4)],_0x5d01f0['selectedAppName']||_0x5d01f0['mergedCli']?.[_0x590370(0x211)]||_0x5d01f0[_0x590370(0x1f4)]?.[_0x590370(0x1d9)]),_0x1a631b=loadAliasMap(_0x5d01f0[_0x590370(0x1ca)],undefined,_0x2bd291['filePath'],_0x2bd291[_0x590370(0x1fd)]),_0xd680af=_0x1a631b['length']>0x0;let _0x458d42,_0x4c40a8,_0x136a17;const _0x45dacd=_0x5d01f0[_0x590370(0x1e9)](_0x590370(0x20e)),_0x29c4a5=_0x5d01f0[_0x590370(0x1e9)](_0x590370(0x1dc));if(_0x45dacd){const _0xd9134a=resolveAlias(_0x5d01f0['apiDir'],_0x45dacd,undefined,_0x2bd291['filePath'],_0x2bd291['profileName']);if(!_0xd9134a){const _0x4eeade=_0xd680af?_0x590370(0x1ee)+_0x1a631b[_0x590370(0x1eb)](_0x1e142d=>_0x1e142d[_0x590370(0x20e)])[_0x590370(0x1c7)](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x590370(0x1a5)]('Alias\x20\x22'+_0x45dacd+_0x590370(0x1f3)+_0x4eeade);}_0x458d42=_0x45dacd,_0x4c40a8=_0xd9134a;}else{if(_0x29c4a5){_0x4c40a8=_0x29c4a5;const _0x3eddbf=_0x1a631b[_0x590370(0x1ea)](_0x4aad2a=>_0x4aad2a['datasetCode']===_0x29c4a5);_0x458d42=_0x3eddbf?.[_0x590370(0x20e)];}else{if(_0x5d01f0[_0x590370(0x1cb)])throw CliErrors[_0x590370(0x1a5)](_0x590370(0x1c1));else{if(_0xd680af){const _0x5a5d0d=_0x1a631b['map'](_0x410823=>_0x410823[_0x590370(0x20e)]+'\x20('+_0x410823[_0x590370(0x206)]+')'),_0x32c982=await promptSelect(_0x590370(0x1b2),_0x5a5d0d),_0x3d396e=_0x1a631b[_0x32c982];if(!_0x3d396e)throw CliErrors['validation'](_0x590370(0x212));_0x458d42=_0x3d396e['alias'],_0x4c40a8=_0x3d396e[_0x590370(0x205)];}else{const _0x5766f4=await listDatasets(_0x5d01f0[_0x590370(0x1a4)]);if(_0x5766f4[_0x590370(0x1f8)]===0x0)throw CliErrors['validation'](_0x590370(0x1de));const _0x24c64a=_0x5766f4[_0x590370(0x1eb)](_0x1defcc=>_0x1defcc[_0x590370(0x1e6)]+'\x20['+(_0x1defcc[_0x590370(0x1cc)]??_0x590370(0x1f9))+']\x20('+_0x1defcc[_0x590370(0x1bf)]+')'),_0x116817=await promptSelect(_0x590370(0x1b2),_0x24c64a),_0x1b006e=_0x5766f4[_0x116817];if(!_0x1b006e)throw CliErrors['validation'](_0x590370(0x212));_0x4c40a8=_0x1b006e[_0x590370(0x1bf)],_0x458d42=undefined;}}}}const _0x4b2569=await listDatasets(_0x5d01f0['appCode']),_0x40de6b=_0x4b2569['find'](_0x5c207b=>_0x5c207b[_0x590370(0x1bf)]===_0x4c40a8);if(!_0x40de6b)throw CliErrors['validation'](_0x590370(0x1d0)+_0x4c40a8+_0x590370(0x20f)+(_0x458d42?_0x590370(0x1ba)+CLI_BIN_NAME+_0x590370(0x1a3):''));_0x136a17=_0x40de6b['id'];const _0x3d536c=_0x458d42??_0x4c40a8,_0x592f36=await listBffDatasetOperations(_0x5d01f0[_0x590370(0x1a4)],_0x136a17),_0x10530e=_0x592f36?Object['keys'](_0x592f36):[];if(_0x10530e[_0x590370(0x1f8)]===0x0)throw CliErrors[_0x590370(0x1a5)](_0x590370(0x1d8)+_0x3d536c+'.');let _0x42210d;const _0x2bd6e0=_0x5d01f0[_0x590370(0x1e9)](_0x590370(0x207));if(_0x2bd6e0){if(!_0x10530e[_0x590370(0x210)](_0x2bd6e0))throw CliErrors[_0x590370(0x1a5)](_0x590370(0x20d)+_0x2bd6e0+_0x590370(0x200)+_0x3d536c+'.\x20'+('Available:\x20'+_0x10530e[_0x590370(0x1c7)](',\x20')));_0x42210d=_0x2bd6e0;}else{if(_0x5d01f0[_0x590370(0x1cb)])throw CliErrors[_0x590370(0x1a5)](_0x590370(0x1aa));const _0x1fad3a=await promptSelect(_0x590370(0x1a2),_0x10530e);_0x42210d=_0x10530e[_0x1fad3a]??_0x10530e[0x0];}let _0x446c5c=normalizeHookFunctionNode(_0x5d01f0[_0x590370(0x1e9)]('function-node'));if(!_0x446c5c){if(_0x5d01f0['str'](_0x590370(0x1fa)))throw CliErrors[_0x590370(0x1a5)](_0x590370(0x201));if(_0x5d01f0[_0x590370(0x1cb)])throw CliErrors[_0x590370(0x1a5)](_0x590370(0x1e7));const _0x5ba115=await promptSelect(_0x590370(0x1be),[_0x590370(0x20c),_0x590370(0x203)]);_0x446c5c=['before',_0x590370(0x203)][_0x5ba115]??_0x590370(0x20c);}return{'alias':_0x458d42,'datasetCode':_0x4c40a8,'datasetId':_0x136a17,'operationType':_0x42210d,'functionNode':_0x446c5c};}async function promptSelect(_0xa5294e,_0x14b0ff){const _0x290a7a=a37_0xc44fdd;if(_0x14b0ff[_0x290a7a(0x1f8)]===0x1)return 0x0;for(const [_0x5a1524,_0x40a496]of _0x14b0ff[_0x290a7a(0x1ce)]()){process[_0x290a7a(0x1fe)][_0x290a7a(0x1e1)]('\x20\x20'+(_0x5a1524+0x1)+'.\x20'+_0x40a496+'\x0a');}const _0x79fece=createInterface({'input':process[_0x290a7a(0x1e5)],'output':process[_0x290a7a(0x1fe)]});while(!![]){const _0x2a6196=await new Promise(_0x4e3b1d=>{const _0x497fc6=_0x290a7a;_0x79fece[_0x497fc6(0x1cd)](_0xa5294e+'\x20',_0x4e3b1d);}),_0x403019=Number[_0x290a7a(0x1c5)](_0x2a6196[_0x290a7a(0x20a)](),0xa);if(Number[_0x290a7a(0x1a9)](_0x403019)&&_0x403019>=0x1&&_0x403019<=_0x14b0ff['length'])return _0x79fece[_0x290a7a(0x1a8)](),_0x403019-0x1;process[_0x290a7a(0x1fe)][_0x290a7a(0x1e1)](_0x290a7a(0x1b9)+_0x14b0ff['length']+'.\x0a');}}function buildFilePath(_0x5bd7f7,_0x13d4ea,_0x405230,_0x496431){const _0x1f46a7=a37_0xc44fdd;if(_0x13d4ea===_0x1f46a7(0x1ad)){if(!_0x496431)throw CliErrors[_0x1f46a7(0x1a5)](_0x1f46a7(0x1c9));const _0x6628d2=_0x496431[_0x1f46a7(0x20e)]??_0x496431['datasetCode'];return join(_0x5bd7f7['scriptsRootDir'],_0x1f46a7(0x1ad),_0x6628d2,_0x496431[_0x1f46a7(0x1d2)],_0x496431[_0x1f46a7(0x1f6)],_0x405230+_0x1f46a7(0x1f2));}return join(_0x5bd7f7[_0x1f46a7(0x1f7)],_0x13d4ea,_0x405230+'.js');}export function generateTemplate(_0x50096f,_0x2157d5,_0x40cb54,_0x61b382,_0x402398){const _0x3b96da=a37_0xc44fdd,_0x200c59=_0x61b382?.[_0x3b96da(0x20a)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0xe46fe=getAppBaseUrl(_0x40cb54),_0xbab750=_0x3b96da(0x1b5);if(_0x50096f===_0x3b96da(0x1d7))return _0x3b96da(0x1bc)+_0x200c59+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x2157d5+_0x3b96da(0x1ed)+_0xe46fe+_0x3b96da(0x209)+_0x40cb54+_0x3b96da(0x1e8)+_0x2157d5+_0x3b96da(0x1f5)+_0x2157d5+_0x3b96da(0x1c2)+_0xbab750+'\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'+_0x2157d5+_0x3b96da(0x202);if(_0x50096f===_0x3b96da(0x1db))return _0x3b96da(0x1bc)+_0x200c59+_0x3b96da(0x1cf)+_0x2157d5+_0x3b96da(0x1ef)+_0x40cb54+'/'+_0x2157d5+_0x3b96da(0x1ed)+_0xe46fe+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x40cb54+_0x3b96da(0x204)+_0x2157d5+_0x3b96da(0x1c8)+_0xbab750+_0x3b96da(0x1af)+_0x2157d5+_0x3b96da(0x202);if(!_0x402398)throw CliErrors[_0x3b96da(0x1a5)](_0x3b96da(0x1b8));const _0x3cff16=_0x402398['alias']??_0x402398[_0x3b96da(0x205)],_0x322f23=_0x402398['functionNode']===_0x3b96da(0x20c)?'当前请求参数':_0x3b96da(0x1f1),_0x4bee71=_0x402398[_0x3b96da(0x1f6)]===_0x3b96da(0x20c)?_0x3b96da(0x1ec):_0x3b96da(0x1da);return _0x3b96da(0x1bc)+_0x200c59+_0x3b96da(0x1b1)+_0x2157d5+_0x3b96da(0x1fb)+_0x40cb54+'/'+_0x402398[_0x3b96da(0x205)]+'/'+_0x402398['operationType']+_0x3b96da(0x1ed)+_0xe46fe+_0x3b96da(0x208)+_0x402398[_0x3b96da(0x1e3)]+_0x3b96da(0x1c0)+_0x40cb54+_0x3b96da(0x1bb)+_0x3cff16+'/'+_0x402398[_0x3b96da(0x1d2)]+'/'+_0x402398[_0x3b96da(0x1f6)]+'/'+_0x2157d5+'.js\x0a\x20*\x20[触发节点]\x20'+_0x402398['functionNode']+'\x0a'+_0xbab750+_0x3b96da(0x1e2)+_0x322f23+_0x3b96da(0x1ac)+_0x4bee71+_0x3b96da(0x1fc)+_0x2157d5+_0x3b96da(0x202);}
1
+ const a37_0x5b05a3=a37_0x4cff;(function(_0x5b4521,_0x5d592d){const _0x72b440=a37_0x4cff,_0x472f2c=_0x5b4521();while(!![]){try{const _0x450a30=parseInt(_0x72b440(0x202))/0x1*(parseInt(_0x72b440(0x24e))/0x2)+-parseInt(_0x72b440(0x256))/0x3*(-parseInt(_0x72b440(0x1ff))/0x4)+-parseInt(_0x72b440(0x250))/0x5*(-parseInt(_0x72b440(0x21e))/0x6)+parseInt(_0x72b440(0x1ef))/0x7+parseInt(_0x72b440(0x248))/0x8+-parseInt(_0x72b440(0x222))/0x9*(parseInt(_0x72b440(0x21f))/0xa)+-parseInt(_0x72b440(0x245))/0xb;if(_0x450a30===_0x5d592d)break;else _0x472f2c['push'](_0x472f2c['shift']());}catch(_0x5b0782){_0x472f2c['push'](_0x472f2c['shift']());}}}(a37_0xeae6,0xa5cb4));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_0x5b05a3(0x212),'command':a37_0x5b05a3(0x22c),'description':a37_0x5b05a3(0x24f),'risk':'read','flags':[{'name':'type','type':a37_0x5b05a3(0x227),'required':!![],'enum':[a37_0x5b05a3(0x1f4),a37_0x5b05a3(0x1f2),a37_0x5b05a3(0x1fe)],'description':a37_0x5b05a3(0x224)},{'name':a37_0x5b05a3(0x21c),'type':a37_0x5b05a3(0x227),'required':!![],'description':a37_0x5b05a3(0x226)},{'name':a37_0x5b05a3(0x230),'type':a37_0x5b05a3(0x227),'description':a37_0x5b05a3(0x23d)},{'name':a37_0x5b05a3(0x242),'type':'string','description':a37_0x5b05a3(0x24c)},{'name':'datasetcode','type':a37_0x5b05a3(0x227),'description':a37_0x5b05a3(0x214)},{'name':a37_0x5b05a3(0x204),'type':a37_0x5b05a3(0x227),'description':a37_0x5b05a3(0x1f3)},{'name':a37_0x5b05a3(0x21d),'type':a37_0x5b05a3(0x227),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before',a37_0x5b05a3(0x234)]}],async 'validate'(_0x295ccb){const _0x18ceec=a37_0x5b05a3,_0x570949=_0x295ccb[_0x18ceec(0x218)](_0x18ceec(0x21c));if(!isValidBffFunctionName(_0x570949))throw CliErrors[_0x18ceec(0x243)](_0x18ceec(0x233)+_0x570949+_0x18ceec(0x251));},async 'execute'(_0x28eb57){const _0x277561=a37_0x5b05a3,_0x3357a3=loadBffProjectConfig(_0x28eb57[_0x277561(0x1fd)]),_0x20e24e=_0x28eb57['str'](_0x277561(0x1f6)),_0x35196b=_0x28eb57[_0x277561(0x218)](_0x277561(0x21c)),_0x2202a7=_0x28eb57[_0x277561(0x218)](_0x277561(0x230))||undefined,_0x12b59a=_0x20e24e===_0x277561(0x1fe)?await resolveHookOptions(_0x3357a3,_0x28eb57):undefined,_0x3bf5ff=buildFilePath(_0x3357a3,_0x20e24e,_0x35196b,_0x12b59a);if(await fileExists(_0x3bf5ff))throw CliErrors['validation'](_0x277561(0x20d)+_0x3bf5ff);await mkdir(dirname(_0x3bf5ff),{'recursive':!![]});const _0x26fb43=generateTemplate(_0x20e24e,_0x35196b,_0x28eb57[_0x277561(0x1fd)],_0x2202a7,_0x12b59a);await writeFile(_0x3bf5ff,_0x26fb43,'utf8');const _0x48ca00={'type':_0x20e24e,'name':_0x35196b,'path':_0x3bf5ff};if(_0x2202a7)_0x48ca00[_0x277561(0x230)]=_0x2202a7;if(_0x12b59a){if(_0x12b59a[_0x277561(0x242)])_0x48ca00[_0x277561(0x242)]=_0x12b59a[_0x277561(0x242)];_0x48ca00['datasetCode']=_0x12b59a[_0x277561(0x201)],_0x48ca00[_0x277561(0x22b)]=_0x12b59a['operationType'],_0x48ca00['functionNode']=_0x12b59a['functionNode'];}return{'ok':!![],'data':_0x48ca00,'message':_0x277561(0x244)+_0x20e24e+_0x277561(0x219)+_0x35196b};}};async function resolveHookOptions(_0x5b6eb0,_0x2fd256){const _0x27fe54=a37_0x5b05a3,_0x2f8f59=resolveApiModelSource(_0x2fd256[_0x27fe54(0x253)],_0x2fd256[_0x27fe54(0x1fd)],_0x2fd256['selectedAppName']||_0x2fd256['mergedCli']?.['currentApp']||_0x2fd256[_0x27fe54(0x239)]?.[_0x27fe54(0x24b)]),_0x3c3641=loadAliasMap(_0x2fd256['apiDir'],undefined,_0x2f8f59[_0x27fe54(0x247)],_0x2f8f59[_0x27fe54(0x24a)]),_0x32c22c=_0x3c3641[_0x27fe54(0x206)]>0x0;let _0x187290,_0x39b752,_0x1a1284;const _0xef1128=_0x2fd256[_0x27fe54(0x218)]('alias'),_0x1dd64b=_0x2fd256[_0x27fe54(0x218)](_0x27fe54(0x20e));if(_0xef1128){const _0x1e202c=resolveAlias(_0x2fd256[_0x27fe54(0x253)],_0xef1128,undefined,_0x2f8f59[_0x27fe54(0x247)],_0x2f8f59['profileName']);if(!_0x1e202c){const _0x538628=_0x32c22c?_0x27fe54(0x254)+_0x3c3641[_0x27fe54(0x22d)](_0x371f6f=>_0x371f6f['alias'])[_0x27fe54(0x211)](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors['validation'](_0x27fe54(0x207)+_0xef1128+_0x27fe54(0x23c)+_0x538628);}_0x187290=_0xef1128,_0x39b752=_0x1e202c;}else{if(_0x1dd64b){_0x39b752=_0x1dd64b;const _0x432ec7=_0x3c3641[_0x27fe54(0x1f5)](_0x2a8640=>_0x2a8640[_0x27fe54(0x201)]===_0x1dd64b);_0x187290=_0x432ec7?.[_0x27fe54(0x242)];}else{if(_0x2fd256[_0x27fe54(0x23b)])throw CliErrors['validation'](_0x27fe54(0x217));else{if(_0x32c22c){const _0xf70949=_0x3c3641['map'](_0x3ade99=>_0x3ade99['alias']+'\x20('+_0x3ade99[_0x27fe54(0x241)]+')'),_0x295083=await promptSelect(_0x27fe54(0x258),_0xf70949),_0x19c63b=_0x3c3641[_0x295083];if(!_0x19c63b)throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x23e));_0x187290=_0x19c63b[_0x27fe54(0x242)],_0x39b752=_0x19c63b['datasetCode'];}else{const _0x322be6=await listDatasets(_0x2fd256[_0x27fe54(0x1fd)]);if(_0x322be6[_0x27fe54(0x206)]===0x0)throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x237));const _0x46ad7a=_0x322be6['map'](_0x419e94=>_0x419e94['name']+'\x20['+(_0x419e94['source']??'UNKNOWN')+']\x20('+_0x419e94[_0x27fe54(0x246)]+')'),_0x40b094=await promptSelect(_0x27fe54(0x258),_0x46ad7a),_0xad72b8=_0x322be6[_0x40b094];if(!_0xad72b8)throw CliErrors[_0x27fe54(0x243)]('Invalid\x20dataset\x20selection.');_0x39b752=_0xad72b8[_0x27fe54(0x246)],_0x187290=undefined;}}}}const _0x251a65=await listDatasets(_0x2fd256[_0x27fe54(0x1fd)]),_0xd38edd=_0x251a65[_0x27fe54(0x1f5)](_0x1015f6=>_0x1015f6[_0x27fe54(0x246)]===_0x39b752);if(!_0xd38edd)throw CliErrors[_0x27fe54(0x243)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x39b752+_0x27fe54(0x216)+(_0x187290?_0x27fe54(0x220)+CLI_BIN_NAME+_0x27fe54(0x209):''));_0x1a1284=_0xd38edd['id'];const _0x4f403f=_0x187290??_0x39b752,_0x433dc6=await listBffDatasetOperations(_0x2fd256[_0x27fe54(0x1fd)],_0x1a1284),_0x3deddc=_0x433dc6?Object[_0x27fe54(0x257)](_0x433dc6):[];if(_0x3deddc[_0x27fe54(0x206)]===0x0)throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x22a)+_0x4f403f+'.');let _0x45c655;const _0x402a88=_0x2fd256[_0x27fe54(0x218)](_0x27fe54(0x204));if(_0x402a88){if(!_0x3deddc[_0x27fe54(0x20a)](_0x402a88))throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x1f8)+_0x402a88+_0x27fe54(0x1fc)+_0x4f403f+'.\x20'+('Available:\x20'+_0x3deddc[_0x27fe54(0x211)](',\x20')));_0x45c655=_0x402a88;}else{if(_0x2fd256[_0x27fe54(0x23b)])throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x1ee));const _0x33304a=await promptSelect(_0x27fe54(0x23f),_0x3deddc);_0x45c655=_0x3deddc[_0x33304a]??_0x3deddc[0x0];}let _0x159bbf=normalizeHookFunctionNode(_0x2fd256['str'](_0x27fe54(0x21d)));if(!_0x159bbf){if(_0x2fd256[_0x27fe54(0x218)]('function-node'))throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x24d));if(_0x2fd256[_0x27fe54(0x23b)])throw CliErrors[_0x27fe54(0x243)](_0x27fe54(0x1ed));const _0x2d3bb8=await promptSelect(_0x27fe54(0x1fb),[_0x27fe54(0x223),_0x27fe54(0x234)]);_0x159bbf=['before',_0x27fe54(0x234)][_0x2d3bb8]??_0x27fe54(0x223);}return{'alias':_0x187290,'datasetCode':_0x39b752,'datasetId':_0x1a1284,'operationType':_0x45c655,'functionNode':_0x159bbf};}async function promptSelect(_0x263515,_0x1b0914){const _0x4c3748=a37_0x5b05a3;if(_0x1b0914[_0x4c3748(0x206)]===0x1)return 0x0;for(const [_0x31cfc9,_0x3ada1e]of _0x1b0914[_0x4c3748(0x21a)]()){process['stderr'][_0x4c3748(0x232)]('\x20\x20'+(_0x31cfc9+0x1)+'.\x20'+_0x3ada1e+'\x0a');}const _0x2ea7ab=createInterface({'input':process[_0x4c3748(0x229)],'output':process['stderr']});while(!![]){const _0x7893a6=await new Promise(_0x15f1a8=>{const _0x2e2937=_0x4c3748;_0x2ea7ab[_0x2e2937(0x210)](_0x263515+'\x20',_0x15f1a8);}),_0x37c2cc=Number[_0x4c3748(0x200)](_0x7893a6['trim'](),0xa);if(Number[_0x4c3748(0x225)](_0x37c2cc)&&_0x37c2cc>=0x1&&_0x37c2cc<=_0x1b0914['length'])return _0x2ea7ab[_0x4c3748(0x1f7)](),_0x37c2cc-0x1;process[_0x4c3748(0x231)][_0x4c3748(0x232)](_0x4c3748(0x1f1)+_0x1b0914[_0x4c3748(0x206)]+'.\x0a');}}function a37_0xeae6(){const _0x432058=['\x22.\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','str','\x20function:\x20','entries','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','name','function-node','1214562UEtOwe','370YdJnsV','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','62613knhsks','before','Script\x20type','isInteger','Function\x20name\x20(valid\x20JS\x20identifier)','string','当前响应结果','stdin','No\x20operation\x20types\x20found\x20for\x20dataset\x20','operationType','create','map','functionNode','当前请求参数','description','stderr','write','Invalid\x20function\x20name\x20\x22','after','修改后的请求参数','/ENDPOINT/','No\x20datasets\x20found\x20for\x20this\x20app.','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','mergedCli','.js\x0a\x20*\x20[触发节点]\x20','nonInteractive','\x22\x20not\x20found.\x20','Script\x20description','Invalid\x20dataset\x20selection.','Select\x20operation\x20type:','\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','tableName','alias','validation','Created\x20','14624709iDTFqK','code','filePath','4293384mishHw','\x0a\x20*\x20[平台配置]\x20','profileName','defaultApp','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','806862TPZtLl','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','15fqpoqk','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','\x22,\x20params\x20})\x0a','apiDir','Available\x20aliases:\x20','/**\x0a\x20*\x20','105gFUsas','keys','Select\x20dataset:','/HOOK/','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','2393755zdZiqH','修改后的响应结果','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','ENDPOINT','Operation\x20type\x20(HOOK\x20only)','COMMON','find','type','close','Operation\x20type\x20\x22','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','.js','Select\x20trigger\x20node:','\x22\x20not\x20found\x20for\x20dataset\x20','appCode','HOOK','43048DRnohf','parseInt','datasetCode','1WAjwaH','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','operation-type','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','length','Alias\x20\x22','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','\x20api\x20pull`\x20to\x20refresh.','includes','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','File\x20already\x20exists:\x20','datasetcode','/data/dataset/','question','join','bff','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','scriptsRootDir'];a37_0xeae6=function(){return _0x432058;};return a37_0xeae6();}function a37_0x4cff(_0x2dc9d7,_0x492859){_0x2dc9d7=_0x2dc9d7-0x1ed;const _0xeae6a4=a37_0xeae6();let _0x4cffa2=_0xeae6a4[_0x2dc9d7];return _0x4cffa2;}function buildFilePath(_0x2e5285,_0x20dc11,_0x159ec3,_0x327992){const _0x3cd8fd=a37_0x5b05a3;if(_0x20dc11==='HOOK'){if(!_0x327992)throw CliErrors[_0x3cd8fd(0x243)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0x41669f=_0x327992['alias']??_0x327992[_0x3cd8fd(0x201)];return join(_0x2e5285[_0x3cd8fd(0x215)],_0x3cd8fd(0x1fe),_0x41669f,_0x327992['operationType'],_0x327992[_0x3cd8fd(0x22e)],_0x159ec3+_0x3cd8fd(0x1fa));}return join(_0x2e5285[_0x3cd8fd(0x215)],_0x20dc11,_0x159ec3+_0x3cd8fd(0x1fa));}export function generateTemplate(_0xe6557a,_0x377bf0,_0x2d1c1e,_0x249a6d,_0x2319a2){const _0x222b76=a37_0x5b05a3,_0x5255a1=_0x249a6d?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x4d08b8=getAppBaseUrl(_0x2d1c1e),_0x28adbb='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0xe6557a===_0x222b76(0x1f4))return _0x222b76(0x255)+_0x5255a1+_0x222b76(0x1f9)+_0x377bf0+'\x0a\x20*\x20[平台配置]\x20'+_0x4d08b8+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x2d1c1e+'/COMMON/'+_0x377bf0+_0x222b76(0x20c)+_0x377bf0+_0x222b76(0x252)+_0x28adbb+_0x222b76(0x240)+_0x377bf0+_0x222b76(0x21b);if(_0xe6557a===_0x222b76(0x1f2))return _0x222b76(0x255)+_0x5255a1+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x377bf0+_0x222b76(0x203)+_0x2d1c1e+'/'+_0x377bf0+_0x222b76(0x249)+_0x4d08b8+_0x222b76(0x20b)+_0x2d1c1e+_0x222b76(0x236)+_0x377bf0+'.js\x0a'+_0x28adbb+'\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'+_0x377bf0+_0x222b76(0x21b);if(!_0x2319a2)throw CliErrors[_0x222b76(0x243)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x2515eb=_0x2319a2[_0x222b76(0x242)]??_0x2319a2[_0x222b76(0x201)],_0x2adcb7=_0x2319a2[_0x222b76(0x22e)]===_0x222b76(0x223)?_0x222b76(0x22f):_0x222b76(0x228),_0x249f1b=_0x2319a2[_0x222b76(0x22e)]===_0x222b76(0x223)?_0x222b76(0x235):_0x222b76(0x1f0);return _0x222b76(0x255)+_0x5255a1+_0x222b76(0x213)+_0x377bf0+_0x222b76(0x208)+_0x2d1c1e+'/'+_0x2319a2[_0x222b76(0x201)]+'/'+_0x2319a2[_0x222b76(0x22b)]+_0x222b76(0x249)+_0x4d08b8+_0x222b76(0x20f)+_0x2319a2['datasetId']+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x2d1c1e+_0x222b76(0x259)+_0x2515eb+'/'+_0x2319a2[_0x222b76(0x22b)]+'/'+_0x2319a2['functionNode']+'/'+_0x377bf0+_0x222b76(0x23a)+_0x2319a2[_0x222b76(0x22e)]+'\x0a'+_0x28adbb+_0x222b76(0x238)+_0x2adcb7+_0x222b76(0x221)+_0x249f1b+_0x222b76(0x205)+_0x377bf0+_0x222b76(0x21b);}
@@ -1 +1 @@
1
- const a38_0x24bf67=a38_0x11c7;function a38_0x11c7(_0x2dcc36,_0x38ae18){_0x2dcc36=_0x2dcc36-0x184;const _0x54493c=a38_0x5449();let _0x11c7c7=_0x54493c[_0x2dcc36];return _0x11c7c7;}function a38_0x5449(){const _0x103fea=['remoteId','5UsJLfF','str','4389024AfgzXM','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','split','scriptsRoot','validation','startsWith','parse','trashedTo','find','length','963568tMCEWd','252086zPmkyK','scriptsRootDir','60gjnxkz','5944540sgtriM','toISOString','Backend\x20Function\x20lock\x20file\x20not\x20found.','Would\x20delete\x20','projectRoot','lockFilePath','map','join','appCode','\x20\x20-\x20','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','Lock\x20scope\x20for\x20app\x20\x22','apps','Multiple\x20functions\x20match\x20\x22','filter','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','target','trashDir','324152bEWlWt','No\x20lock\x20entry\x20found\x20for\x20\x22','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','keys','delete','1020671mZFoCT','stringify','/api/management/library/scripts/delete','includes','Function\x20not\x20found:\x20','9xfXOcN','functions','3585636oGMRnD'];a38_0x5449=function(){return _0x103fea;};return a38_0x5449();}(function(_0x53aa06,_0x16db0a){const _0x1b846f=a38_0x11c7,_0x142c13=_0x53aa06();while(!![]){try{const _0x2e205f=-parseInt(_0x1b846f(0x1a7))/0x1+parseInt(_0x1b846f(0x18d))/0x2*(-parseInt(_0x1b846f(0x1ac))/0x3)+-parseInt(_0x1b846f(0x18c))/0x4*(parseInt(_0x1b846f(0x1b0))/0x5)+-parseInt(_0x1b846f(0x1b2))/0x6+parseInt(_0x1b846f(0x190))/0x7+parseInt(_0x1b846f(0x1a2))/0x8+parseInt(_0x1b846f(0x1ae))/0x9*(parseInt(_0x1b846f(0x18f))/0xa);if(_0x2e205f===_0x16db0a)break;else _0x142c13['push'](_0x142c13['shift']());}catch(_0x39b408){_0x142c13['push'](_0x142c13['shift']());}}}(a38_0x5449,0xddea7));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':'bff','command':a38_0x24bf67(0x1a6),'description':a38_0x24bf67(0x1a4),'risk':'high-risk-write','flags':[{'name':a38_0x24bf67(0x1a0),'type':'string','required':!![],'description':a38_0x24bf67(0x1b3)}],async 'validate'(_0x150260){const _0x56c6dc=a38_0x24bf67,_0x31ea89=loadBffProjectConfig(_0x150260[_0x56c6dc(0x198)]),_0x26b46b=await readBffLockFile(_0x31ea89['lockFilePath']);if(!_0x26b46b)throw CliErrors[_0x56c6dc(0x186)](_0x56c6dc(0x19f));},async 'dryRun'(_0x3a9606){const _0xd3a427=a38_0x24bf67,_0x291831=loadBffProjectConfig(_0x3a9606[_0xd3a427(0x198)]),_0x5eda9f=await readBffLockFile(_0x291831[_0xd3a427(0x195)]);if(!_0x5eda9f)throw CliErrors[_0xd3a427(0x186)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0x5ea769}=ensureLockScope(_0x5eda9f,_0x3a9606[_0xd3a427(0x198)],_0x291831[_0xd3a427(0x185)],'delete'),_0xebbd09=_0x3a9606[_0xd3a427(0x1b1)]('target'),_0x6def9c=Object[_0xd3a427(0x1a5)](_0x5ea769[_0xd3a427(0x1ad)]),_0x39b1db=resolveDeleteTarget(_0xebbd09,_0x6def9c),_0x525c3a=_0x5ea769[_0xd3a427(0x1ad)][_0x39b1db];if(!_0x525c3a)throw CliErrors['validation'](_0xd3a427(0x1a3)+_0x39b1db+'\x22.');const _0x37bdee=resolveLocalFilePathFromLockKey(_0x291831,_0x39b1db),_0x1f6d8a=relative(_0x291831[_0xd3a427(0x194)],_0x37bdee),_0x5cff05=join(_0x291831[_0xd3a427(0x1a1)],'<timestamp>',_0x1f6d8a);return{'method':'POST','url':_0xd3a427(0x1a9),'body':{'appCode':_0x3a9606[_0xd3a427(0x198)],'target':_0x39b1db,'remoteId':_0x525c3a[_0xd3a427(0x1af)],'localFilePath':_0x37bdee,'trashedPath':_0x5cff05},'description':_0xd3a427(0x193)+_0x39b1db+_0xd3a427(0x19a)};},async 'execute'(_0x3fdf4b){const _0x5b6f0f=a38_0x24bf67,_0x3ee86f=loadBffProjectConfig(_0x3fdf4b[_0x5b6f0f(0x198)]),_0x1398b7=await readBffLockFile(_0x3ee86f[_0x5b6f0f(0x195)]);if(!_0x1398b7)throw CliErrors[_0x5b6f0f(0x186)](_0x5b6f0f(0x192));const {lockData:_0x3da2e6,appLock:_0x5d61da}=ensureLockScope(_0x1398b7,_0x3fdf4b[_0x5b6f0f(0x198)],_0x3ee86f[_0x5b6f0f(0x185)],'delete'),_0x24c413=JSON[_0x5b6f0f(0x188)](JSON[_0x5b6f0f(0x1a8)](_0x3da2e6)),_0x5c0de8=_0x24c413[_0x5b6f0f(0x19c)][_0x3fdf4b['appCode']];if(!_0x5c0de8)throw new Error(_0x5b6f0f(0x19b)+_0x3fdf4b['appCode']+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x2f016a=_0x3fdf4b[_0x5b6f0f(0x1b1)](_0x5b6f0f(0x1a0)),_0x2a6501=Object[_0x5b6f0f(0x1a5)](_0x5c0de8[_0x5b6f0f(0x1ad)]),_0x51734a=resolveDeleteTarget(_0x2f016a,_0x2a6501),_0x4bff0e=_0x5c0de8[_0x5b6f0f(0x1ad)][_0x51734a];if(!_0x4bff0e)throw CliErrors[_0x5b6f0f(0x186)](_0x5b6f0f(0x1a3)+_0x51734a+'\x22.');await deleteBffScript(_0x4bff0e['remoteId']),delete _0x5c0de8['functions'][_0x51734a],_0x5c0de8['lastSync']=new Date()[_0x5b6f0f(0x191)](),await writeBffLockFile(_0x3ee86f[_0x5b6f0f(0x195)],_0x24c413);const _0x4b5297=resolveLocalFilePathFromLockKey(_0x3ee86f,_0x51734a);let _0x1f53c5;await fileExists(_0x4b5297)&&(_0x1f53c5=await moveToTrash(_0x3ee86f[_0x5b6f0f(0x194)],_0x3ee86f[_0x5b6f0f(0x1a1)],_0x4b5297),await cleanupEmptyDirectories(dirname(_0x4b5297),_0x3ee86f[_0x5b6f0f(0x18e)]));await waitForDeleteSettlement(_0x3ee86f[_0x5b6f0f(0x195)],_0x3fdf4b['appCode'],_0x51734a,_0x4b5297),await sleep(0x96);const _0x3ae5f2={'deleted':_0x51734a,'remoteId':_0x4bff0e['remoteId']};if(_0x1f53c5)_0x3ae5f2[_0x5b6f0f(0x189)]=_0x1f53c5;return{'ok':!![],'data':_0x3ae5f2,'message':'Deleted\x20'+_0x51734a+(_0x1f53c5?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x94b286,_0x231055){const _0x5099d7=a38_0x24bf67;if(_0x94b286[_0x5099d7(0x1aa)]('/')){const _0x44ecd4=_0x231055[_0x5099d7(0x18a)](_0x3ba6fe=>_0x3ba6fe===_0x94b286);if(!_0x44ecd4)throw CliErrors[_0x5099d7(0x186)](_0x5099d7(0x1ab)+_0x94b286);return _0x44ecd4;}const _0x2d11ef=_0x231055[_0x5099d7(0x19e)](_0x4aad78=>_0x4aad78[_0x5099d7(0x184)]('/')['at'](-0x1)===_0x94b286);if(_0x2d11ef['length']===0x0)throw CliErrors[_0x5099d7(0x186)](_0x5099d7(0x1ab)+_0x94b286);if(_0x2d11ef[_0x5099d7(0x18b)]>0x1)throw CliErrors[_0x5099d7(0x186)](_0x5099d7(0x19d)+_0x94b286+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x2d11ef[_0x5099d7(0x196)](_0xb645db=>_0x5099d7(0x199)+_0xb645db)[_0x5099d7(0x197)]('\x0a'));return _0x2d11ef[0x0];}async function moveToTrash(_0x32ff21,_0x588753,_0x4cdc6f){const _0x55e532=a38_0x24bf67,_0x3caf3a=new Date()[_0x55e532(0x191)]()['replace'](/[:.]/g,'-'),_0xc2ccfb=relative(_0x32ff21,_0x4cdc6f),_0x24f7df=join(_0x588753,_0x3caf3a,_0xc2ccfb);return await mkdir(dirname(_0x24f7df),{'recursive':!![]}),await rename(_0x4cdc6f,_0x24f7df),_0x24f7df;}async function cleanupEmptyDirectories(_0x1f4569,_0x3ce650){const _0x432a56=a38_0x24bf67;let _0x2299a3=resolve(_0x1f4569);const _0x3a9a71=resolve(_0x3ce650);while(_0x2299a3[_0x432a56(0x187)](''+_0x3a9a71+sep)||_0x2299a3===_0x3a9a71){if(_0x2299a3===_0x3a9a71)return;try{const _0x877c02=await readdir(_0x2299a3);if(_0x877c02[_0x432a56(0x18b)]>0x0)return;await rmdir(_0x2299a3);}catch{return;}_0x2299a3=dirname(_0x2299a3);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x5552a5,_0x2a237b,_0x5f598f,_0x5dc435){const _0x514d87=a38_0x24bf67;for(let _0x1094f=0x0;_0x1094f<DELETE_SETTLE_RETRY_COUNT;_0x1094f+=0x1){const _0x1e69b1=await readBffLockFile(_0x5552a5),_0x3c8737=!!_0x1e69b1?.['apps']?.[_0x2a237b]?.[_0x514d87(0x1ad)]?.[_0x5f598f],_0x14f083=await fileExists(_0x5dc435);if(!_0x3c8737&&!_0x14f083)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x5f598f+'.');}
1
+ const a38_0x17d302=a38_0x5978;(function(_0x457bf0,_0x294614){const _0x29430d=a38_0x5978,_0x44ef0b=_0x457bf0();while(!![]){try{const _0x12a8c1=parseInt(_0x29430d(0x1d0))/0x1*(-parseInt(_0x29430d(0x1d8))/0x2)+parseInt(_0x29430d(0x1cb))/0x3*(-parseInt(_0x29430d(0x1db))/0x4)+parseInt(_0x29430d(0x1f6))/0x5+parseInt(_0x29430d(0x1d7))/0x6*(parseInt(_0x29430d(0x1dc))/0x7)+parseInt(_0x29430d(0x1ee))/0x8*(-parseInt(_0x29430d(0x1c9))/0x9)+-parseInt(_0x29430d(0x1fa))/0xa*(-parseInt(_0x29430d(0x1e9))/0xb)+parseInt(_0x29430d(0x1e1))/0xc;if(_0x12a8c1===_0x294614)break;else _0x44ef0b['push'](_0x44ef0b['shift']());}catch(_0x15476d){_0x44ef0b['push'](_0x44ef0b['shift']());}}}(a38_0x1fe0,0xa80b9));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a38_0x5978(_0x216f18,_0x17e58c){_0x216f18=_0x216f18-0x1c9;const _0x1fe00d=a38_0x1fe0();let _0x597863=_0x1fe00d[_0x216f18];return _0x597863;}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x17d302(0x1ed),'command':a38_0x17d302(0x1f5),'description':a38_0x17d302(0x1e3),'risk':a38_0x17d302(0x1fc),'flags':[{'name':'target','type':'string','required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x55f71d){const _0x2ed66e=a38_0x17d302,_0x4fe3f8=loadBffProjectConfig(_0x55f71d['appCode']),_0x17e92a=await readBffLockFile(_0x4fe3f8[_0x2ed66e(0x1fb)]);if(!_0x17e92a)throw CliErrors[_0x2ed66e(0x1dd)](_0x2ed66e(0x1df));},async 'dryRun'(_0x5235ab){const _0x5d9d0c=a38_0x17d302,_0x237479=loadBffProjectConfig(_0x5235ab[_0x5d9d0c(0x1cf)]),_0xdd5355=await readBffLockFile(_0x237479[_0x5d9d0c(0x1fb)]);if(!_0xdd5355)throw CliErrors[_0x5d9d0c(0x1dd)](_0x5d9d0c(0x1f1));const {appLock:_0x56e8f7}=ensureLockScope(_0xdd5355,_0x5235ab[_0x5d9d0c(0x1cf)],_0x237479[_0x5d9d0c(0x1d4)],'delete'),_0x302bdf=_0x5235ab[_0x5d9d0c(0x1e0)](_0x5d9d0c(0x1d3)),_0x1501cc=Object[_0x5d9d0c(0x1de)](_0x56e8f7[_0x5d9d0c(0x1f3)]),_0x3e7607=resolveDeleteTarget(_0x302bdf,_0x1501cc),_0x4664b7=_0x56e8f7[_0x5d9d0c(0x1f3)][_0x3e7607];if(!_0x4664b7)throw CliErrors[_0x5d9d0c(0x1dd)](_0x5d9d0c(0x1e7)+_0x3e7607+'\x22.');const _0x5dcc89=resolveLocalFilePathFromLockKey(_0x237479,_0x3e7607),_0x4e469c=relative(_0x237479[_0x5d9d0c(0x1e4)],_0x5dcc89),_0x517109=join(_0x237479[_0x5d9d0c(0x1f9)],'<timestamp>',_0x4e469c);return{'method':'POST','url':'/api/management/library/scripts/delete','body':{'appCode':_0x5235ab['appCode'],'target':_0x3e7607,'remoteId':_0x4664b7[_0x5d9d0c(0x1f8)],'localFilePath':_0x5dcc89,'trashedPath':_0x517109},'description':_0x5d9d0c(0x1f4)+_0x3e7607+_0x5d9d0c(0x1f0)};},async 'execute'(_0x286c11){const _0xd1f8fd=a38_0x17d302,_0x919b1c=loadBffProjectConfig(_0x286c11[_0xd1f8fd(0x1cf)]),_0x561f24=await readBffLockFile(_0x919b1c[_0xd1f8fd(0x1fb)]);if(!_0x561f24)throw CliErrors[_0xd1f8fd(0x1dd)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {lockData:_0x451e12,appLock:_0xa31f08}=ensureLockScope(_0x561f24,_0x286c11[_0xd1f8fd(0x1cf)],_0x919b1c['scriptsRoot'],_0xd1f8fd(0x1f5)),_0xf9aaab=JSON['parse'](JSON[_0xd1f8fd(0x1d2)](_0x451e12)),_0x341b1c=_0xf9aaab[_0xd1f8fd(0x1ec)][_0x286c11[_0xd1f8fd(0x1cf)]];if(!_0x341b1c)throw new Error(_0xd1f8fd(0x1cc)+_0x286c11[_0xd1f8fd(0x1cf)]+_0xd1f8fd(0x1e6));const _0x1368fb=_0x286c11[_0xd1f8fd(0x1e0)](_0xd1f8fd(0x1d3)),_0xaddace=Object[_0xd1f8fd(0x1de)](_0x341b1c[_0xd1f8fd(0x1f3)]),_0x4fcb08=resolveDeleteTarget(_0x1368fb,_0xaddace),_0x2b321c=_0x341b1c[_0xd1f8fd(0x1f3)][_0x4fcb08];if(!_0x2b321c)throw CliErrors[_0xd1f8fd(0x1dd)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x4fcb08+'\x22.');await deleteBffScript(_0x2b321c['remoteId']),delete _0x341b1c[_0xd1f8fd(0x1f3)][_0x4fcb08],_0x341b1c[_0xd1f8fd(0x1e8)]=new Date()[_0xd1f8fd(0x1e2)](),await writeBffLockFile(_0x919b1c[_0xd1f8fd(0x1fb)],_0xf9aaab);const _0x24db63=resolveLocalFilePathFromLockKey(_0x919b1c,_0x4fcb08);let _0x27c679;await fileExists(_0x24db63)&&(_0x27c679=await moveToTrash(_0x919b1c['projectRoot'],_0x919b1c[_0xd1f8fd(0x1f9)],_0x24db63),await cleanupEmptyDirectories(dirname(_0x24db63),_0x919b1c[_0xd1f8fd(0x1f2)]));await waitForDeleteSettlement(_0x919b1c['lockFilePath'],_0x286c11['appCode'],_0x4fcb08,_0x24db63),await sleep(0x96);const _0x1b8b0b={'deleted':_0x4fcb08,'remoteId':_0x2b321c[_0xd1f8fd(0x1f8)]};if(_0x27c679)_0x1b8b0b[_0xd1f8fd(0x1f7)]=_0x27c679;return{'ok':!![],'data':_0x1b8b0b,'message':_0xd1f8fd(0x1ca)+_0x4fcb08+(_0x27c679?_0xd1f8fd(0x1ef):'')};}};function resolveDeleteTarget(_0x18cc3d,_0x4f5d21){const _0x2d07a5=a38_0x17d302;if(_0x18cc3d[_0x2d07a5(0x1ce)]('/')){const _0x4a4f8c=_0x4f5d21[_0x2d07a5(0x1fd)](_0x36ab36=>_0x36ab36===_0x18cc3d);if(!_0x4a4f8c)throw CliErrors[_0x2d07a5(0x1dd)](_0x2d07a5(0x1ea)+_0x18cc3d);return _0x4a4f8c;}const _0x374323=_0x4f5d21[_0x2d07a5(0x1d1)](_0x37679a=>_0x37679a['split']('/')['at'](-0x1)===_0x18cc3d);if(_0x374323['length']===0x0)throw CliErrors[_0x2d07a5(0x1dd)](_0x2d07a5(0x1ea)+_0x18cc3d);if(_0x374323[_0x2d07a5(0x1da)]>0x1)throw CliErrors['validation']('Multiple\x20functions\x20match\x20\x22'+_0x18cc3d+_0x2d07a5(0x1e5)+_0x374323[_0x2d07a5(0x1d5)](_0x2288f9=>_0x2d07a5(0x1d9)+_0x2288f9)['join']('\x0a'));return _0x374323[0x0];}function a38_0x1fe0(){const _0x192f24=['appCode','86930SCZJyc','filter','stringify','target','scriptsRoot','map','Local\x20delete\x20not\x20settled\x20for\x20','195498VFbFbz','28PqqeHe','\x20\x20-\x20','length','1619308xgAyhr','119yvjLEv','validation','keys','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','str','28275492mRRmnw','toISOString','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','projectRoot','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x22\x20not\x20found\x20after\x20ensureLockScope.','No\x20lock\x20entry\x20found\x20for\x20\x22','lastSync','55yaBGfr','Function\x20not\x20found:\x20','replace','apps','bff','1824bwnNHo','\x20(local\x20file\x20moved\x20to\x20trash)','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','Backend\x20Function\x20lock\x20file\x20not\x20found.','scriptsRootDir','functions','Would\x20delete\x20','delete','1763645Osoyid','trashedTo','remoteId','trashDir','1833710cNjbVB','lockFilePath','high-risk-write','find','41841imTuPm','Deleted\x20','9TFPWES','Lock\x20scope\x20for\x20app\x20\x22','startsWith','includes'];a38_0x1fe0=function(){return _0x192f24;};return a38_0x1fe0();}async function moveToTrash(_0x1e6aaa,_0x461947,_0x49ef0c){const _0x504cca=a38_0x17d302,_0x1d23d9=new Date()[_0x504cca(0x1e2)]()[_0x504cca(0x1eb)](/[:.]/g,'-'),_0x15fe6a=relative(_0x1e6aaa,_0x49ef0c),_0x102799=join(_0x461947,_0x1d23d9,_0x15fe6a);return await mkdir(dirname(_0x102799),{'recursive':!![]}),await rename(_0x49ef0c,_0x102799),_0x102799;}async function cleanupEmptyDirectories(_0xf6c1b4,_0x40cabb){const _0x3006a4=a38_0x17d302;let _0x2ef0b7=resolve(_0xf6c1b4);const _0x2b7267=resolve(_0x40cabb);while(_0x2ef0b7[_0x3006a4(0x1cd)](''+_0x2b7267+sep)||_0x2ef0b7===_0x2b7267){if(_0x2ef0b7===_0x2b7267)return;try{const _0x17c91c=await readdir(_0x2ef0b7);if(_0x17c91c['length']>0x0)return;await rmdir(_0x2ef0b7);}catch{return;}_0x2ef0b7=dirname(_0x2ef0b7);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x15eed0,_0x2c4a2c,_0x3c106a,_0x515140){const _0x10ac0c=a38_0x17d302;for(let _0x55bdc4=0x0;_0x55bdc4<DELETE_SETTLE_RETRY_COUNT;_0x55bdc4+=0x1){const _0x4c7903=await readBffLockFile(_0x15eed0),_0x1853dc=!!_0x4c7903?.[_0x10ac0c(0x1ec)]?.[_0x2c4a2c]?.[_0x10ac0c(0x1f3)]?.[_0x3c106a],_0x5db79a=await fileExists(_0x515140);if(!_0x1853dc&&!_0x5db79a)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x10ac0c(0x1d6)+_0x3c106a+'.');}
@@ -1 +1 @@
1
- function a39_0x1116(){const _0x5c9b76=['2395151bXtAwJ','3372jkBhdp','9385YRSRfW','30SvzgHj','bool','8AlIDZR','functionName','updatedTime','54DbINHg','1880556mjnXSy','4540cMLaab','(none)','version','read','num','1974679fkcnjO','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','32862MPUWXt','number','detail','6099732zRTvEo','description','bff','verbose','appCode','updateUserName','scriptContent','360iJIGGW','createdTime'];a39_0x1116=function(){return _0x5c9b76;};return a39_0x1116();}function a39_0x538c(_0x1cd090,_0x3c279f){_0x1cd090=_0x1cd090-0x12e;const _0x1116c2=a39_0x1116();let _0x538cfa=_0x1116c2[_0x1cd090];return _0x538cfa;}const a39_0x58e2e9=a39_0x538c;(function(_0x3f6208,_0x31738d){const _0x52eb88=a39_0x538c,_0x462b1a=_0x3f6208();while(!![]){try{const _0x18e62d=-parseInt(_0x52eb88(0x143))/0x1*(parseInt(_0x52eb88(0x13a))/0x2)+parseInt(_0x52eb88(0x130))/0x3*(-parseInt(_0x52eb88(0x13c))/0x4)+-parseInt(_0x52eb88(0x134))/0x5*(-parseInt(_0x52eb88(0x133))/0x6)+parseInt(_0x52eb88(0x141))/0x7*(-parseInt(_0x52eb88(0x137))/0x8)+parseInt(_0x52eb88(0x146))/0x9+-parseInt(_0x52eb88(0x135))/0xa*(-parseInt(_0x52eb88(0x132))/0xb)+-parseInt(_0x52eb88(0x13b))/0xc;if(_0x18e62d===_0x31738d)break;else _0x462b1a['push'](_0x462b1a['shift']());}catch(_0x346491){_0x462b1a['push'](_0x462b1a['shift']());}}}(a39_0x1116,0xe17a9));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x58e2e9(0x148),'command':a39_0x58e2e9(0x145),'description':a39_0x58e2e9(0x142),'risk':a39_0x58e2e9(0x13f),'flags':[{'name':'id','type':a39_0x58e2e9(0x144),'required':!![],'description':'Script\x20ID'},{'name':a39_0x58e2e9(0x149),'type':'boolean','description':'Return\x20full\x20raw\x20script\x20object'}],async 'execute'(_0x15f0c0){const _0x5257a3=a39_0x58e2e9,_0x4340a3=await getBffScriptInfo(_0x15f0c0[_0x5257a3(0x140)]('id')),_0x12eab9=_0x15f0c0[_0x5257a3(0x136)](_0x5257a3(0x149));if(_0x12eab9)return{'ok':!![],'data':_0x4340a3};return{'ok':!![],'data':{'id':_0x4340a3['id'],'functionName':_0x4340a3[_0x5257a3(0x138)]??'','version':_0x4340a3[_0x5257a3(0x13e)]??'','updateUserName':_0x4340a3[_0x5257a3(0x12e)]??'','appCode':_0x4340a3[_0x5257a3(0x14a)],'scriptType':_0x4340a3['scriptType'],'description':_0x4340a3[_0x5257a3(0x147)]||_0x5257a3(0x13d),'createdTime':_0x4340a3[_0x5257a3(0x131)]??'','updatedTime':_0x4340a3[_0x5257a3(0x139)]??'','scriptContent':_0x4340a3[_0x5257a3(0x12f)]??''}};}};
1
+ const a39_0x5d7a86=a39_0xe015;(function(_0x53993c,_0x3f95f0){const _0x211466=a39_0xe015,_0x3cbe66=_0x53993c();while(!![]){try{const _0x14dd05=parseInt(_0x211466(0xbf))/0x1+parseInt(_0x211466(0xc8))/0x2*(parseInt(_0x211466(0xc2))/0x3)+parseInt(_0x211466(0xbb))/0x4+-parseInt(_0x211466(0xbe))/0x5*(parseInt(_0x211466(0xc9))/0x6)+parseInt(_0x211466(0xc0))/0x7+-parseInt(_0x211466(0xb8))/0x8*(-parseInt(_0x211466(0xb6))/0x9)+-parseInt(_0x211466(0xcd))/0xa;if(_0x14dd05===_0x3f95f0)break;else _0x3cbe66['push'](_0x3cbe66['shift']());}catch(_0xe02839){_0x3cbe66['push'](_0x3cbe66['shift']());}}}(a39_0x5c4d,0x5a922));function a39_0xe015(_0xc53c5f,_0x3b7c7a){_0xc53c5f=_0xc53c5f-0xb5;const _0x5c4d78=a39_0x5c4d();let _0xe0156b=_0x5c4d78[_0xc53c5f];return _0xe0156b;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x5d7a86(0xcc),'command':'detail','description':a39_0x5d7a86(0xc7),'risk':a39_0x5d7a86(0xb7),'flags':[{'name':'id','type':a39_0x5d7a86(0xca),'required':!![],'description':a39_0x5d7a86(0xc1)},{'name':a39_0x5d7a86(0xcf),'type':a39_0x5d7a86(0xb5),'description':a39_0x5d7a86(0xc4)}],async 'execute'(_0x3e3858){const _0x539b0a=a39_0x5d7a86,_0x1b29b9=await getBffScriptInfo(_0x3e3858[_0x539b0a(0xbc)]('id')),_0x171a18=_0x3e3858[_0x539b0a(0xbd)](_0x539b0a(0xcf));if(_0x171a18)return{'ok':!![],'data':_0x1b29b9};return{'ok':!![],'data':{'id':_0x1b29b9['id'],'functionName':_0x1b29b9[_0x539b0a(0xc5)]??'','version':_0x1b29b9[_0x539b0a(0xc3)]??'','updateUserName':_0x1b29b9[_0x539b0a(0xba)]??'','appCode':_0x1b29b9['appCode'],'scriptType':_0x1b29b9[_0x539b0a(0xb9)],'description':_0x1b29b9['description']||_0x539b0a(0xce),'createdTime':_0x1b29b9['createdTime']??'','updatedTime':_0x1b29b9[_0x539b0a(0xcb)]??'','scriptContent':_0x1b29b9[_0x539b0a(0xc6)]??''}};}};function a39_0x5c4d(){const _0x34ddee=['2965896gSZwbk','number','updatedTime','bff','4809580nykuDi','(none)','verbose','boolean','9nlJbMg','read','1735768XNGfBK','scriptType','updateUserName','1363616ZEUZFB','num','bool','5wCPizi','164476IrrrES','3110849TJRTcJ','Script\x20ID','42PHdSxT','version','Return\x20full\x20raw\x20script\x20object','functionName','scriptContent','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','25642kNopoG'];a39_0x5c4d=function(){return _0x34ddee;};return a39_0x5c4d();}
@@ -1 +1 @@
1
- (function(_0x1af3be,_0x5d5bfd){const _0x3fae00=a40_0x218b,_0x5b2cc4=_0x1af3be();while(!![]){try{const _0x1124dd=-parseInt(_0x3fae00(0x167))/0x1*(parseInt(_0x3fae00(0x161))/0x2)+parseInt(_0x3fae00(0x160))/0x3*(-parseInt(_0x3fae00(0x165))/0x4)+parseInt(_0x3fae00(0x162))/0x5+-parseInt(_0x3fae00(0x163))/0x6+-parseInt(_0x3fae00(0x169))/0x7*(-parseInt(_0x3fae00(0x168))/0x8)+-parseInt(_0x3fae00(0x16b))/0x9*(parseInt(_0x3fae00(0x16a))/0xa)+parseInt(_0x3fae00(0x164))/0xb*(parseInt(_0x3fae00(0x166))/0xc);if(_0x1124dd===_0x5d5bfd)break;else _0x5b2cc4['push'](_0x5b2cc4['shift']());}catch(_0x4bf5a7){_0x5b2cc4['push'](_0x5b2cc4['shift']());}}}(a40_0x2010,0x56de8));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';function a40_0x2010(){const _0x4db12e=['265538CfIvrR','1696360bBYbJB','18aVJDXD','315onUmVJ','57174BBKaeH','3333185Czlyvp','2475144yiKvSD','13089263BPLLBh','25956TbwSvX','12ZjCxNM','9oFoMBW','40HOnllY'];a40_0x2010=function(){return _0x4db12e;};return a40_0x2010();}function a40_0x218b(_0x2247c7,_0x44742c){_0x2247c7=_0x2247c7-0x160;const _0x201043=a40_0x2010();let _0x218bdb=_0x201043[_0x2247c7];return _0x218bdb;}export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x3a0b66,_0x3f61ba){const _0x4676d8=a40_0x30b0,_0x44494e=_0x3a0b66();while(!![]){try{const _0xb42809=-parseInt(_0x4676d8(0x1ae))/0x1*(-parseInt(_0x4676d8(0x1b4))/0x2)+-parseInt(_0x4676d8(0x1b5))/0x3+-parseInt(_0x4676d8(0x1b1))/0x4*(-parseInt(_0x4676d8(0x1b9))/0x5)+parseInt(_0x4676d8(0x1b6))/0x6*(-parseInt(_0x4676d8(0x1b7))/0x7)+-parseInt(_0x4676d8(0x1b3))/0x8+-parseInt(_0x4676d8(0x1b2))/0x9*(-parseInt(_0x4676d8(0x1af))/0xa)+parseInt(_0x4676d8(0x1b8))/0xb*(parseInt(_0x4676d8(0x1b0))/0xc);if(_0xb42809===_0x3f61ba)break;else _0x44494e['push'](_0x44494e['shift']());}catch(_0x5e73d5){_0x44494e['push'](_0x44494e['shift']());}}}(a40_0x352f,0xdf2d1));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a40_0x30b0(_0xe01f3,_0x37667b){_0xe01f3=_0xe01f3-0x1ae;const _0x352f98=a40_0x352f();let _0x30b0e5=_0x352f98[_0xe01f3];return _0x30b0e5;}import{bffStatus}from'../../commands/bff/status.js';function a40_0x352f(){const _0x126279=['611824FJxfHc','2864600aECSfu','12ARryFd','4twWVBp','9tPTYcN','4112288bASvMM','4otCwsM','1960143FZysJP','48hzaZCB','404908LPpQgA','4482181MydhQR','3133595LVoxFz'];a40_0x352f=function(){return _0x126279;};return a40_0x352f();}import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a41_0x5646a7=a41_0xcdb5;(function(_0x254b0b,_0x4fb212){const _0x55bda9=a41_0xcdb5,_0x55fdcc=_0x254b0b();while(!![]){try{const _0xa91b6d=parseInt(_0x55bda9(0xb9))/0x1*(-parseInt(_0x55bda9(0xc0))/0x2)+parseInt(_0x55bda9(0xa2))/0x3*(-parseInt(_0x55bda9(0xaa))/0x4)+-parseInt(_0x55bda9(0xa7))/0x5+parseInt(_0x55bda9(0xba))/0x6+-parseInt(_0x55bda9(0xa6))/0x7*(parseInt(_0x55bda9(0xb5))/0x8)+-parseInt(_0x55bda9(0xa3))/0x9+parseInt(_0x55bda9(0xa8))/0xa*(parseInt(_0x55bda9(0xb1))/0xb);if(_0xa91b6d===_0x4fb212)break;else _0x55fdcc['push'](_0x55fdcc['shift']());}catch(_0x4a2acd){_0x55fdcc['push'](_0x55fdcc['shift']());}}}(a41_0x5eaa,0xabe8d));import{listBffScripts}from'../../core/api-client.js';function a41_0xcdb5(_0x317a0c,_0x439330){_0x317a0c=_0x317a0c-0xa1;const _0x5eaa95=a41_0x5eaa();let _0xcdb53=_0x5eaa95[_0x317a0c];return _0xcdb53;}function a41_0x5eaa(){const _0x280ab0=['list','string','Filter\x20by\x20script\x20name','634821JinsGR','verbose','name','functionName','288aNyaCL','boolean','appCode','map','10832nSmafQ','101970ZBdEaz','type','Return\x20full\x20script\x20objects','(unnamed)','scriptType','bool','80dNXipD','Script\x20type\x20filter','str','511767OqQcWH','11619162oZOAVl','read','ENDPOINT','28049yazQeN','1963265PGYczY','570XewlDo','length','8RgcITf','bff','description','List\x20Backend\x20Function\x20scripts'];a41_0x5eaa=function(){return _0x280ab0;};return a41_0x5eaa();}export const bffList={'service':a41_0x5646a7(0xab),'command':a41_0x5646a7(0xae),'description':a41_0x5646a7(0xad),'risk':a41_0x5646a7(0xa4),'flags':[{'name':a41_0x5646a7(0xbb),'type':a41_0x5646a7(0xaf),'description':a41_0x5646a7(0xc1),'default':a41_0x5646a7(0xa5),'enum':[a41_0x5646a7(0xa5),'COMMON']},{'name':a41_0x5646a7(0xb3),'type':a41_0x5646a7(0xaf),'description':a41_0x5646a7(0xb0)},{'name':a41_0x5646a7(0xb2),'type':a41_0x5646a7(0xb6),'description':a41_0x5646a7(0xbc)}],async 'execute'(_0x38e557){const _0x45f7b0=a41_0x5646a7,_0x3fed0d=await listBffScripts(_0x38e557[_0x45f7b0(0xb7)],_0x38e557[_0x45f7b0(0xa1)](_0x45f7b0(0xbb)),{'scriptName':_0x38e557[_0x45f7b0(0xa1)](_0x45f7b0(0xb3))||undefined}),_0x5e5178=_0x38e557[_0x45f7b0(0xbf)](_0x45f7b0(0xb2));return{'ok':!![],'data':_0x5e5178?_0x3fed0d:_0x3fed0d[_0x45f7b0(0xb8)](_0x3da7cc=>({'id':_0x3da7cc['id'],'functionName':_0x3da7cc[_0x45f7b0(0xb4)]??'','description':_0x3da7cc[_0x45f7b0(0xac)]||_0x45f7b0(0xbd),'scriptType':_0x3da7cc[_0x45f7b0(0xbe)]})),'message':_0x3fed0d[_0x45f7b0(0xa9)]===0x0?'No\x20Backend\x20Function\x20scripts\x20found.':undefined};}};
1
+ const a41_0x5a4ab6=a41_0x331d;function a41_0x331d(_0x279629,_0x3f1c88){_0x279629=_0x279629-0x1c9;const _0x15c468=a41_0x15c4();let _0x331dca=_0x15c468[_0x279629];return _0x331dca;}function a41_0x15c4(){const _0x41ed61=['450730vQuajv','Script\x20type\x20filter','4119696QSfVaB','List\x20Backend\x20Function\x20scripts','No\x20Backend\x20Function\x20scripts\x20found.','bool','COMMON','read','str','boolean','bff','7463922FvdAHK','82iNSkWC','6095704MUOQsa','7SFHkjR','Return\x20full\x20script\x20objects','90YdqIOO','verbose','type','map','name','string','appCode','46554ndBEky','list','1039807MGLtIx','623051erJkLU','ENDPOINT','Filter\x20by\x20script\x20name','9xtjtBS','(unnamed)'];a41_0x15c4=function(){return _0x41ed61;};return a41_0x15c4();}(function(_0x2db817,_0x22ec30){const _0x5b5658=a41_0x331d,_0xdaa847=_0x2db817();while(!![]){try{const _0x13b978=-parseInt(_0x5b5658(0x1e2))/0x1+parseInt(_0x5b5658(0x1d5))/0x2*(parseInt(_0x5b5658(0x1e0))/0x3)+parseInt(_0x5b5658(0x1cb))/0x4+parseInt(_0x5b5658(0x1c9))/0x5+-parseInt(_0x5b5658(0x1d4))/0x6*(-parseInt(_0x5b5658(0x1d7))/0x7)+-parseInt(_0x5b5658(0x1d6))/0x8*(parseInt(_0x5b5658(0x1e6))/0x9)+-parseInt(_0x5b5658(0x1d9))/0xa*(parseInt(_0x5b5658(0x1e3))/0xb);if(_0x13b978===_0x22ec30)break;else _0xdaa847['push'](_0xdaa847['shift']());}catch(_0x1151df){_0xdaa847['push'](_0xdaa847['shift']());}}}(a41_0x15c4,0xa8274));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x5a4ab6(0x1d3),'command':a41_0x5a4ab6(0x1e1),'description':a41_0x5a4ab6(0x1cc),'risk':a41_0x5a4ab6(0x1d0),'flags':[{'name':'type','type':a41_0x5a4ab6(0x1de),'description':a41_0x5a4ab6(0x1ca),'default':'ENDPOINT','enum':[a41_0x5a4ab6(0x1e4),a41_0x5a4ab6(0x1cf)]},{'name':a41_0x5a4ab6(0x1dd),'type':a41_0x5a4ab6(0x1de),'description':a41_0x5a4ab6(0x1e5)},{'name':a41_0x5a4ab6(0x1da),'type':a41_0x5a4ab6(0x1d2),'description':a41_0x5a4ab6(0x1d8)}],async 'execute'(_0x395748){const _0x166687=a41_0x5a4ab6,_0x34f5de=await listBffScripts(_0x395748[_0x166687(0x1df)],_0x395748[_0x166687(0x1d1)](_0x166687(0x1db)),{'scriptName':_0x395748[_0x166687(0x1d1)](_0x166687(0x1dd))||undefined}),_0x1e54d2=_0x395748[_0x166687(0x1ce)]('verbose');return{'ok':!![],'data':_0x1e54d2?_0x34f5de:_0x34f5de[_0x166687(0x1dc)](_0x301d32=>({'id':_0x301d32['id'],'functionName':_0x301d32['functionName']??'','description':_0x301d32['description']||_0x166687(0x1e7),'scriptType':_0x301d32['scriptType']})),'message':_0x34f5de['length']===0x0?_0x166687(0x1cd):undefined};}};
@@ -1 +1 @@
1
- const a42_0x3ce3d4=a42_0x2732;(function(_0x564e58,_0x4f698e){const _0x1ed291=a42_0x2732,_0x2e235f=_0x564e58();while(!![]){try{const _0x3ee7f7=-parseInt(_0x1ed291(0x189))/0x1+-parseInt(_0x1ed291(0x173))/0x2+-parseInt(_0x1ed291(0x182))/0x3+-parseInt(_0x1ed291(0x183))/0x4*(parseInt(_0x1ed291(0x176))/0x5)+-parseInt(_0x1ed291(0x16b))/0x6+-parseInt(_0x1ed291(0x16e))/0x7+parseInt(_0x1ed291(0x184))/0x8*(parseInt(_0x1ed291(0x16c))/0x9);if(_0x3ee7f7===_0x4f698e)break;else _0x2e235f['push'](_0x2e235f['shift']());}catch(_0x3a9026){_0x2e235f['push'](_0x2e235f['shift']());}}}(a42_0x45a5,0x53620));function a42_0x45a5(){const _0x3a489b=['INFO','--limit\x20must\x20be\x20between\x201\x20and\x20','logs','bff','validation','--since','string','ERROR','3464700wcfCLd','17627598yDGpWa','now','3176530SwAngx','Maximum\x20log\x20lines\x20to\x20return\x20(1-','--end-time','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','keyword','262570gcCiQd','\x20must\x20be\x20a\x20positive\x20integer.','level','22240ODaTtQ','start-time','Filter\x20by\x20log\x20level','end-time','number','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','--start-time','limit','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','trim','length','read','496986oCeymY','176jHQPdY','8DxtQhq','num','isSafeInteger','flag','--limit','93187HkPeZD','since','toUpperCase','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','DEBUG'];a42_0x45a5=function(){return _0x3a489b;};return a42_0x45a5();}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_0x3ce3d4(0x18e),a42_0x3ce3d4(0x18f),'WARN',a42_0x3ce3d4(0x196)];export function resolveBffLogQuery(_0x1c0a7b,_0x461837=Date[a42_0x3ce3d4(0x16d)]()){const _0x37438a=a42_0x3ce3d4,_0x407e05=_0x1c0a7b[_0x37438a(0x187)]('since'),_0x1f9468=_0x1c0a7b['flag'](_0x37438a(0x177)),_0x36d9e7=_0x1c0a7b['flag']('end-time');if(_0x407e05!==undefined&&_0x1f9468!==undefined)throw CliErrors[_0x37438a(0x193)]('--since\x20cannot\x20be\x20combined\x20with\x20--start-time.');const _0x420f0f=_0x36d9e7===undefined?_0x461837:readPositiveInteger(_0x1c0a7b[_0x37438a(0x185)](_0x37438a(0x179)),_0x37438a(0x170)),_0x1ba9fb=_0x1f9468===undefined?_0x420f0f-readSinceMinutes(_0x1c0a7b)*0xea60:readPositiveInteger(_0x1c0a7b['num']('start-time'),_0x37438a(0x17c));if(_0x1ba9fb<=0x0)throw CliErrors[_0x37438a(0x193)](_0x37438a(0x17e));if(_0x1ba9fb>_0x420f0f)throw CliErrors[_0x37438a(0x193)](_0x37438a(0x18c));const _0x23fbe9=readPositiveInteger(_0x1c0a7b[_0x37438a(0x185)](_0x37438a(0x17d),DEFAULT_LIMIT),_0x37438a(0x188));if(_0x23fbe9>MAX_LIMIT)throw CliErrors['validation'](_0x37438a(0x190)+MAX_LIMIT+'.');const _0x25896=_0x1c0a7b['str']('level')[_0x37438a(0x17f)]()[_0x37438a(0x18b)]()||undefined,_0x2470e2=_0x1c0a7b['str'](_0x37438a(0x172))[_0x37438a(0x17f)]()||undefined;return{'appCode':_0x1c0a7b['appCode'],'startTime':_0x1ba9fb,'endTime':_0x420f0f,..._0x1f9468===undefined?{'sinceMinutes':readSinceMinutes(_0x1c0a7b)}:{},..._0x25896?{'level':_0x25896}:{},..._0x2470e2?{'keyword':_0x2470e2}:{},'limit':_0x23fbe9};}function readSinceMinutes(_0x5bb058){const _0x11445a=a42_0x3ce3d4;return readPositiveInteger(_0x5bb058[_0x11445a(0x185)](_0x11445a(0x18a),DEFAULT_SINCE_MINUTES),_0x11445a(0x194));}function readPositiveInteger(_0x56dc22,_0x25a9d5){const _0x21fe4e=a42_0x3ce3d4;if(!Number[_0x21fe4e(0x186)](_0x56dc22)||_0x56dc22<=0x0)throw CliErrors[_0x21fe4e(0x193)](_0x25a9d5+_0x21fe4e(0x174));return _0x56dc22;}function a42_0x2732(_0x2cfce1,_0x27ed7b){_0x2cfce1=_0x2cfce1-0x16b;const _0x45a59f=a42_0x45a5();let _0x273252=_0x45a59f[_0x2cfce1];return _0x273252;}export const bffLogs={'service':a42_0x3ce3d4(0x192),'command':a42_0x3ce3d4(0x191),'description':'Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','risk':a42_0x3ce3d4(0x181),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x3ce3d4(0x18a),'type':a42_0x3ce3d4(0x17a),'description':a42_0x3ce3d4(0x18d)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x3ce3d4(0x177),'type':a42_0x3ce3d4(0x17a),'description':a42_0x3ce3d4(0x171)},{'name':'end-time','type':a42_0x3ce3d4(0x17a),'description':'Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)'},{'name':a42_0x3ce3d4(0x175),'type':'string','description':a42_0x3ce3d4(0x178),'enum':LOG_LEVELS},{'name':a42_0x3ce3d4(0x172),'type':a42_0x3ce3d4(0x195),'description':'Filter\x20formatted\x20log\x20lines\x20by\x20keyword'},{'name':'limit','type':a42_0x3ce3d4(0x17a),'description':a42_0x3ce3d4(0x16f)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x28bc50){resolveBffLogQuery(_0x28bc50);},async 'execute'(_0x402346){const _0xde45ef=a42_0x3ce3d4,_0x324a56=resolveBffLogQuery(_0x402346),{sinceMinutes:_0x11a7d6,..._0x526066}=_0x324a56,_0x19a329=await searchBffScriptLogs(_0x526066);return{'ok':!![],'data':{'query':_0x324a56,'count':_0x19a329[_0xde45ef(0x180)],'logs':_0x19a329},'message':_0x19a329['length']===0x0?_0xde45ef(0x17b):'Found\x20'+_0x19a329[_0xde45ef(0x180)]+'\x20Backend\x20Function\x20log\x20line(s).'};}};
1
+ const a42_0x1d42a5=a42_0x4841;function a42_0x4841(_0x2239cb,_0xb0ddaf){_0x2239cb=_0x2239cb-0x1dd;const _0x559dea=a42_0x559d();let _0x4841d4=_0x559dea[_0x2239cb];return _0x4841d4;}(function(_0x3ee016,_0x46bedc){const _0x49e85e=a42_0x4841,_0x31218b=_0x3ee016();while(!![]){try{const _0x471e97=-parseInt(_0x49e85e(0x207))/0x1*(parseInt(_0x49e85e(0x1fd))/0x2)+-parseInt(_0x49e85e(0x1f3))/0x3*(-parseInt(_0x49e85e(0x1ff))/0x4)+parseInt(_0x49e85e(0x1e6))/0x5*(-parseInt(_0x49e85e(0x1e8))/0x6)+-parseInt(_0x49e85e(0x1e7))/0x7*(-parseInt(_0x49e85e(0x1f4))/0x8)+-parseInt(_0x49e85e(0x1f0))/0x9*(parseInt(_0x49e85e(0x1e3))/0xa)+parseInt(_0x49e85e(0x1f6))/0xb*(parseInt(_0x49e85e(0x1df))/0xc)+parseInt(_0x49e85e(0x202))/0xd*(parseInt(_0x49e85e(0x1ea))/0xe);if(_0x471e97===_0x46bedc)break;else _0x31218b['push'](_0x31218b['shift']());}catch(_0xb5baa1){_0x31218b['push'](_0x31218b['shift']());}}}(a42_0x559d,0x44993));function a42_0x559d(){const _0x368362=['ERROR','--since','Filter\x20by\x20log\x20level','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','length','end-time','50602xurxXf','isSafeInteger','5864wykWMc','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','76726DAxDpq','read','level','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','validation','14HguddF','since','--limit','now','Found\x20','toUpperCase','start-time','bff','WARN','\x20must\x20be\x20a\x20positive\x20integer.','12WHOpje','DEBUG','--end-time','num','1696870NJRYkf','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','trim','5lTxXTa','1288erNtdT','2693466QjSYUq','INFO','1442BswIPy','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','flag','str','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','logs','27uDGjPj','number','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','849qgbvJN','21064owBRwf','string','944999NztfZU'];a42_0x559d=function(){return _0x368362;};return a42_0x559d();}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_0x1d42a5(0x1e0),a42_0x1d42a5(0x1e9),a42_0x1d42a5(0x1dd),a42_0x1d42a5(0x1f7)];export function resolveBffLogQuery(_0x4da62f,_0x523a78=Date[a42_0x1d42a5(0x20a)]()){const _0x502a28=a42_0x1d42a5,_0x18af2d=_0x4da62f[_0x502a28(0x1ec)]('since'),_0x1860a1=_0x4da62f[_0x502a28(0x1ec)](_0x502a28(0x20d)),_0x4bfe2d=_0x4da62f[_0x502a28(0x1ec)](_0x502a28(0x1fc));if(_0x18af2d!==undefined&&_0x1860a1!==undefined)throw CliErrors[_0x502a28(0x206)](_0x502a28(0x201));const _0x2e66f7=_0x4bfe2d===undefined?_0x523a78:readPositiveInteger(_0x4da62f[_0x502a28(0x1e2)](_0x502a28(0x1fc)),_0x502a28(0x1e1)),_0x404ffd=_0x1860a1===undefined?_0x2e66f7-readSinceMinutes(_0x4da62f)*0xea60:readPositiveInteger(_0x4da62f[_0x502a28(0x1e2)](_0x502a28(0x20d)),'--start-time');if(_0x404ffd<=0x0)throw CliErrors[_0x502a28(0x206)](_0x502a28(0x1eb));if(_0x404ffd>_0x2e66f7)throw CliErrors[_0x502a28(0x206)](_0x502a28(0x1fa));const _0x12191c=readPositiveInteger(_0x4da62f[_0x502a28(0x1e2)]('limit',DEFAULT_LIMIT),_0x502a28(0x209));if(_0x12191c>MAX_LIMIT)throw CliErrors[_0x502a28(0x206)]('--limit\x20must\x20be\x20between\x201\x20and\x20'+MAX_LIMIT+'.');const _0xd8434e=_0x4da62f['str'](_0x502a28(0x204))['trim']()[_0x502a28(0x20c)]()||undefined,_0x53ab2d=_0x4da62f[_0x502a28(0x1ed)]('keyword')[_0x502a28(0x1e5)]()||undefined;return{'appCode':_0x4da62f['appCode'],'startTime':_0x404ffd,'endTime':_0x2e66f7,..._0x1860a1===undefined?{'sinceMinutes':readSinceMinutes(_0x4da62f)}:{},..._0xd8434e?{'level':_0xd8434e}:{},..._0x53ab2d?{'keyword':_0x53ab2d}:{},'limit':_0x12191c};}function readSinceMinutes(_0x3d47b3){const _0x27a67c=a42_0x1d42a5;return readPositiveInteger(_0x3d47b3[_0x27a67c(0x1e2)]('since',DEFAULT_SINCE_MINUTES),_0x27a67c(0x1f8));}function readPositiveInteger(_0x34429f,_0x58b462){const _0x2ce38d=a42_0x1d42a5;if(!Number[_0x2ce38d(0x1fe)](_0x34429f)||_0x34429f<=0x0)throw CliErrors[_0x2ce38d(0x206)](_0x58b462+_0x2ce38d(0x1de));return _0x34429f;}export const bffLogs={'service':a42_0x1d42a5(0x20e),'command':a42_0x1d42a5(0x1ef),'description':a42_0x1d42a5(0x1f2),'risk':a42_0x1d42a5(0x203),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x1d42a5(0x208),'type':a42_0x1d42a5(0x1f1),'description':a42_0x1d42a5(0x205)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x1d42a5(0x20d),'type':a42_0x1d42a5(0x1f1),'description':a42_0x1d42a5(0x1e4)},{'name':a42_0x1d42a5(0x1fc),'type':a42_0x1d42a5(0x1f1),'description':a42_0x1d42a5(0x1ee)},{'name':a42_0x1d42a5(0x204),'type':a42_0x1d42a5(0x1f5),'description':a42_0x1d42a5(0x1f9),'enum':LOG_LEVELS},{'name':'keyword','type':'string','description':a42_0x1d42a5(0x200)},{'name':'limit','type':a42_0x1d42a5(0x1f1),'description':'Maximum\x20log\x20lines\x20to\x20return\x20(1-'+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x2625ff){resolveBffLogQuery(_0x2625ff);},async 'execute'(_0x104321){const _0xac9f3c=a42_0x1d42a5,_0x1a0437=resolveBffLogQuery(_0x104321),{sinceMinutes:_0x2e1250,..._0x515dc1}=_0x1a0437,_0xc98d3d=await searchBffScriptLogs(_0x515dc1);return{'ok':!![],'data':{'query':_0x1a0437,'count':_0xc98d3d[_0xac9f3c(0x1fb)],'logs':_0xc98d3d},'message':_0xc98d3d[_0xac9f3c(0x1fb)]===0x0?'No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.':_0xac9f3c(0x20b)+_0xc98d3d[_0xac9f3c(0x1fb)]+'\x20Backend\x20Function\x20log\x20line(s).'};}};
@@ -1 +1 @@
1
- const a43_0x54976f=a43_0x510b;(function(_0x1a0188,_0x28c3c1){const _0x29bd38=a43_0x510b,_0xfb992a=_0x1a0188();while(!![]){try{const _0x12ee29=parseInt(_0x29bd38(0x22d))/0x1+parseInt(_0x29bd38(0x26a))/0x2+parseInt(_0x29bd38(0x26f))/0x3+parseInt(_0x29bd38(0x258))/0x4+parseInt(_0x29bd38(0x1ff))/0x5+-parseInt(_0x29bd38(0x257))/0x6*(-parseInt(_0x29bd38(0x25b))/0x7)+parseInt(_0x29bd38(0x202))/0x8*(-parseInt(_0x29bd38(0x246))/0x9);if(_0x12ee29===_0x28c3c1)break;else _0xfb992a['push'](_0xfb992a['shift']());}catch(_0x14f708){_0xfb992a['push'](_0xfb992a['shift']());}}}(a43_0x41eb,0x77ca5));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_0x54976f(0x276),'command':a43_0x54976f(0x25e),'description':a43_0x54976f(0x260),'risk':a43_0x54976f(0x1fd),'structuredErrors':!![],'flags':[{'name':a43_0x54976f(0x230),'type':a43_0x54976f(0x219),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a43_0x54976f(0x1f5),'ENDPOINT',a43_0x54976f(0x22a)]},{'name':a43_0x54976f(0x1e6),'type':a43_0x54976f(0x26b),'description':a43_0x54976f(0x255)}],async 'dryRun'(_0x738562){const _0x41fa42=a43_0x54976f,_0x1f232f=loadBffProjectConfig(_0x738562[_0x41fa42(0x20c)]),_0x28d9a5=await readBffLockFile(_0x1f232f['lockFilePath']),{appLock:_0x15be34}=ensureLockScope(_0x28d9a5??createEmptyBffLock(),_0x738562['appCode'],_0x1f232f[_0x41fa42(0x233)],_0x41fa42(0x25e)),_0x44546a=normalizeBffType(_0x738562[_0x41fa42(0x256)](_0x41fa42(0x230)))??undefined,[_0xffcc51,_0x22aa10]=await Promise[_0x41fa42(0x1e3)]([listBffScripts(_0x738562[_0x41fa42(0x20c)],_0x44546a),getBffScriptStatistics(_0x738562[_0x41fa42(0x20c)])]),_0x147cf2=_0xffcc51[_0x41fa42(0x212)](_0x52aace=>normalizeBffType(_0x52aace[_0x41fa42(0x205)])==='HOOK'),_0x1b6704=_0x147cf2?buildDatasetCodeToAliasMap(_0x738562[_0x41fa42(0x1f1)],_0x738562[_0x41fa42(0x20c)],_0x738562[_0x41fa42(0x239)]||_0x738562['mergedCli']?.['currentApp']||_0x738562[_0x41fa42(0x254)]?.[_0x41fa42(0x20f)]):new Map(),_0x2b64cb=_0x147cf2?await planHookDirectoryMigration(_0x1f232f,_0x15be34,_0x1b6704,await scanLocalBffFunctions(_0x1f232f,_0x41fa42(0x22a))):undefined,_0x16e129=createHookLocationMap(_0x22aa10),_0xdbd284=[];for(const _0x34966b of _0xffcc51){const _0x343ba1=resolveRemoteScriptTarget(_0x1f232f,_0x34966b,_0x16e129,_0x2b64cb?.[_0x41fa42(0x275)]??_0x15be34[_0x41fa42(0x244)],_0x1b6704);if(!_0x343ba1){_0xdbd284[_0x41fa42(0x21d)]({'scriptType':_0x34966b[_0x41fa42(0x205)],'functionName':_0x34966b[_0x41fa42(0x20d)]??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x82ac86=(_0x2b64cb?.[_0x41fa42(0x275)]??_0x15be34['functions'])[_0x343ba1[_0x41fa42(0x24f)]],_0x495048=_0x34966b['scriptContent']!=null?computeContentHash(_0x34966b[_0x41fa42(0x23b)]):undefined,_0x4129b8=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x2b64cb,_0x343ba1)??_0x343ba1['filePath'],_0x82ac86,_0x495048),_0x1eaa4a=_0x4129b8?localUnsyncedConflict(_0x343ba1,_0x34966b['id']):undefined;_0xdbd284['push']({'lockKey':_0x343ba1['lockKey'],'filePath':_0x343ba1[_0x41fa42(0x26e)],'remoteId':_0x34966b['id']??null,'status':_0x1eaa4a?_0x41fa42(0x1f4):_0x41fa42(0x1ea),..._0x1eaa4a?{'conflict':_0x1eaa4a}:{},..._0x343ba1['hookLocation']?{'alias':_0x343ba1['hookLocation']['alias']??null,'datasetCode':_0x343ba1[_0x41fa42(0x266)][_0x41fa42(0x249)],'operationType':_0x343ba1[_0x41fa42(0x266)][_0x41fa42(0x226)],'functionNode':_0x343ba1[_0x41fa42(0x266)]['functionNode']}:{}});}return{'method':'GET','url':_0x41fa42(0x20b)+_0x738562[_0x41fa42(0x20c)]+(_0x44546a?_0x41fa42(0x21e)+_0x44546a:'')+'&currentPage=1&pageSize='+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x738562[_0x41fa42(0x20c)],'filterType':_0x44546a??null,..._0x2b64cb&&_0x2b64cb['migrations'][_0x41fa42(0x209)]>0x0?{'hookDirectoryMigrations':_0x2b64cb[_0x41fa42(0x277)][_0x41fa42(0x262)](_0x1cab8b=>({'from':_0x1cab8b[_0x41fa42(0x273)],'to':_0x1cab8b[_0x41fa42(0x22c)]}))}:{},'files':_0xdbd284},'description':_0x41fa42(0x23a)+_0xdbd284[_0x41fa42(0x209)]+_0x41fa42(0x24e)};},async 'execute'(_0x5ebd89){const _0x40d251=a43_0x54976f,_0x6d59f3=loadBffProjectConfig(_0x5ebd89[_0x40d251(0x20c)]),_0x118efd=await readBffLockFile(_0x6d59f3[_0x40d251(0x217)]),{lockData:_0x1cda68,appLock:_0xa09d38}=ensureLockScope(_0x118efd??createEmptyBffLock(),_0x5ebd89[_0x40d251(0x20c)],_0x6d59f3[_0x40d251(0x233)],_0x40d251(0x25e)),_0x5e47b4=normalizeBffType(_0x5ebd89[_0x40d251(0x256)](_0x40d251(0x230)))??undefined;if(_0x5ebd89[_0x40d251(0x256)]('type')&&!_0x5e47b4)throw CliErrors[_0x40d251(0x264)](_0x40d251(0x236));const [_0x187265,_0x391f5e]=await Promise[_0x40d251(0x1e3)]([listBffScripts(_0x5ebd89['appCode'],_0x5e47b4),getBffScriptStatistics(_0x5ebd89['appCode'])]);if(_0x187265[_0x40d251(0x209)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x40d251(0x22f)};const _0x25f572=_0x5ebd89[_0x40d251(0x274)](_0x40d251(0x1e6));if(_0x25f572&&!_0x5ebd89[_0x40d251(0x203)]){const _0x3e7229=await confirmForce();if(!_0x3e7229)throw CliErrors[_0x40d251(0x232)](_0x40d251(0x259));}if(_0x25f572&&_0x5ebd89[_0x40d251(0x203)]){}const _0x3ca6bc=_0x187265[_0x40d251(0x212)](_0x46609f=>normalizeBffType(_0x46609f['scriptType'])===_0x40d251(0x22a)),_0x5d5c12=_0x3ca6bc?buildDatasetCodeToAliasMap(_0x5ebd89['apiDir'],_0x5ebd89['appCode'],_0x5ebd89[_0x40d251(0x239)]||_0x5ebd89[_0x40d251(0x254)]?.['currentApp']||_0x5ebd89['mergedCli']?.['defaultApp']):new Map(),_0x41bf59=createHookLocationMap(_0x391f5e),_0x4fde7d=JSON[_0x40d251(0x25a)](JSON[_0x40d251(0x1ed)](_0x1cda68)),_0x2d1de1=_0x5ebd89[_0x40d251(0x20c)],_0xa0e252=_0x4fde7d[_0x40d251(0x1f8)][_0x2d1de1];if(!_0xa0e252)throw new Error(_0x40d251(0x26d)+_0x2d1de1+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x4c546f=_0x3ca6bc?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x6d59f3,_0xa0e252,_0x5d5c12,await scanLocalBffFunctions(_0x6d59f3,_0x40d251(0x22a))),_0xa0e252):undefined,_0x19bbe4=createPullFileTransaction(),_0x3a72c9=[],_0xf8b0a7=[],_0x41f556=[],_0x2a4d74=[];for(const _0x2ba62f of _0x187265){const _0x14001c=resolveRemoteScriptTarget(_0x6d59f3,_0x2ba62f,_0x41bf59,_0xa0e252['functions'],_0x5d5c12);if(!_0x14001c){_0xf8b0a7['push']({'lockKey':_0x2ba62f[_0x40d251(0x205)]+'/'+_0x2ba62f['functionName'],'reason':_0x40d251(0x207)});continue;}const _0x37052b=_0xa0e252['functions'][_0x14001c[_0x40d251(0x24f)]];try{if(!_0x2ba62f['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x2ba62f[_0x40d251(0x23b)]==null)throw new Error(_0x40d251(0x267));const _0x36c84f=_0x2ba62f[_0x40d251(0x23b)],_0x2980c3=computeContentHash(_0x36c84f);if(!_0x25f572){const _0x2bc51a=await hasUnsyncedLocalChanges(_0x14001c[_0x40d251(0x26e)],_0x37052b,_0x2980c3);if(_0x2bc51a){_0x41f556[_0x40d251(0x21d)](localUnsyncedConflict(_0x14001c,_0x2ba62f['id']));continue;}}await _0x19bbe4[_0x40d251(0x251)](_0x14001c['filePath'],_0x36c84f);const _0x61e71c={'hash':_0x2980c3,'remoteId':_0x2ba62f['id'],'version':_0x2ba62f[_0x40d251(0x204)]};_0x14001c['type']===_0x40d251(0x22a)&&_0x14001c[_0x40d251(0x266)]&&(_0x61e71c['alias']=_0x14001c[_0x40d251(0x266)]['alias'],_0x61e71c[_0x40d251(0x249)]=_0x14001c[_0x40d251(0x266)][_0x40d251(0x249)],_0x61e71c[_0x40d251(0x226)]=_0x14001c[_0x40d251(0x266)][_0x40d251(0x226)],_0x61e71c['functionNode']=_0x14001c[_0x40d251(0x266)][_0x40d251(0x248)]),_0xa0e252['functions'][_0x14001c[_0x40d251(0x24f)]]=_0x61e71c,_0x3a72c9[_0x40d251(0x21d)]({'lockKey':_0x14001c['lockKey'],'remoteId':_0x2ba62f['id']});}catch(_0x1496f4){_0x2a4d74[_0x40d251(0x21d)]({'lockKey':_0x14001c[_0x40d251(0x24f)],'error':_0x1496f4 instanceof Error?_0x1496f4[_0x40d251(0x268)]:String(_0x1496f4)});}}_0xa0e252['lastSync']=new Date()[_0x40d251(0x231)]();try{await writeBffLockFile(_0x6d59f3[_0x40d251(0x217)],_0x4fde7d);}catch(_0x3dbcf4){const _0x281b7b=[...await _0x19bbe4['rollback'](),...await _0x4c546f?.[_0x40d251(0x250)]()??[]];throw withRollbackErrors(_0x3dbcf4,'Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x281b7b);}return{'ok':_0x2a4d74[_0x40d251(0x209)]===0x0,'data':{'pulled':_0x3a72c9,'skipped':_0xf8b0a7,'conflicts':_0x41f556,'failed':_0x2a4d74},'message':formatPullMessage(_0x3a72c9[_0x40d251(0x209)],_0xf8b0a7[_0x40d251(0x209)],_0x41f556[_0x40d251(0x209)],_0x2a4d74[_0x40d251(0x209)])};}};function localUnsyncedConflict(_0x1bfdc0,_0x4164db){const _0x45828d=a43_0x54976f,_0xc75244=_0x1bfdc0[_0x45828d(0x24f)][_0x45828d(0x269)]('/')['at'](-0x1);return{'code':_0x45828d(0x208),'lockKey':_0x1bfdc0[_0x45828d(0x24f)],'filePath':_0x1bfdc0[_0x45828d(0x26e)],..._0x4164db!=null?{'remoteId':_0x4164db}:{},'message':_0x45828d(0x222),'nextAction':{'action':_0x45828d(0x23c),'command':CLI_BIN_NAME+_0x45828d(0x21f)+_0x1bfdc0[_0x45828d(0x230)]+_0x45828d(0x1fa)+_0xc75244+_0x45828d(0x238),'requiresReview':!![],'message':_0x45828d(0x223)}};}function formatPullMessage(_0xe5e28c,_0x2d0f85,_0x34ddfa,_0x462ad7){const _0x5e44ff=a43_0x54976f,_0x20392c=[_0x5e44ff(0x24d)+_0xe5e28c+_0x5e44ff(0x200),_0x2d0f85+_0x5e44ff(0x253)];_0x34ddfa>0x0&&_0x20392c['push'](_0x34ddfa+_0x5e44ff(0x211)+(_0x34ddfa===0x1?'':'s')+'\x20'+(_0x34ddfa===0x1?_0x5e44ff(0x247):_0x5e44ff(0x263))+_0x5e44ff(0x24a));if(_0x462ad7>0x0)_0x20392c['push'](_0x462ad7+_0x5e44ff(0x228));return _0x20392c[_0x5e44ff(0x224)](',\x20');}async function hasUnsyncedLocalChanges(_0x1cfcef,_0x29ac99,_0x4f730a){if(!await fileExists(_0x1cfcef))return![];const _0x2cdd23=await computeFileHash(_0x1cfcef);if(!_0x29ac99)return _0x4f730a?_0x2cdd23!==_0x4f730a:!![];return _0x2cdd23!==_0x29ac99['hash'];}function createPullFileTransaction(){const _0x14e45e=new Map(),_0x281cfe=async(_0x49a9a0,_0x36779c)=>{const _0x78686d=a43_0x510b;try{if(_0x36779c['existed'])await ensureParentDirectory(_0x49a9a0),await writeFile(_0x49a9a0,_0x36779c[_0x78686d(0x237)]);else try{await unlink(_0x49a9a0);}catch(_0x506dcd){if(_0x506dcd['code']!==_0x78686d(0x1e4))throw _0x506dcd;}return undefined;}catch(_0x5549d6){return _0x5549d6 instanceof Error?_0x5549d6:new Error(String(_0x5549d6));}};return{async 'write'(_0x2e936e,_0x1335d6){const _0x47a519=a43_0x510b;if(!_0x14e45e['has'](_0x2e936e))try{_0x14e45e[_0x47a519(0x245)](_0x2e936e,{'existed':!![],'content':await readFile(_0x2e936e)});}catch(_0x3314fb){if(_0x3314fb[_0x47a519(0x1ef)]!==_0x47a519(0x1e4))throw _0x3314fb;_0x14e45e[_0x47a519(0x245)](_0x2e936e,{'existed':![]});}try{await ensureParentDirectory(_0x2e936e),await writeFile(_0x2e936e,_0x1335d6,_0x47a519(0x1f7));}catch(_0x488a70){const _0x3e4574=await _0x281cfe(_0x2e936e,_0x14e45e['get'](_0x2e936e));if(!_0x3e4574)_0x14e45e[_0x47a519(0x22b)](_0x2e936e);throw withRollbackErrors(_0x488a70,_0x47a519(0x25d)+_0x2e936e+'\x22.',_0x3e4574?[_0x3e4574]:[]);}},async 'rollback'(){const _0x45b0fc=a43_0x510b,_0x267cd9=[];for(const [_0x1dea60,_0xbb8cf6]of[..._0x14e45e[_0x45b0fc(0x214)]()][_0x45b0fc(0x22e)]()){const _0x1f6a8b=await _0x281cfe(_0x1dea60,_0xbb8cf6);_0x1f6a8b&&_0x267cd9[_0x45b0fc(0x21d)](new Error(_0x45b0fc(0x221)+_0x1dea60+_0x45b0fc(0x265)+_0x1f6a8b[_0x45b0fc(0x268)]));}return _0x267cd9;}};}function withRollbackErrors(_0xd097e5,_0x365f55,_0x5e4d4c){const _0x19296e=a43_0x54976f,_0x3517f8=_0xd097e5 instanceof Error?_0xd097e5:new Error(String(_0xd097e5));if(_0x5e4d4c[_0x19296e(0x209)]===0x0)return _0x3517f8;return new AggregateError([_0x3517f8,..._0x5e4d4c],_0x365f55+'\x20Recovery\x20errors:\x20'+_0x5e4d4c[_0x19296e(0x262)](_0x315976=>_0x315976[_0x19296e(0x268)])[_0x19296e(0x224)](';\x20'));}function buildDatasetCodeToAliasMap(_0x518c0a,_0x4a25a0,_0x14d058){const _0x270a09=a43_0x54976f,_0x344f8f=resolveApiModelSource(_0x518c0a,_0x4a25a0,_0x14d058),_0x5b04a1=loadAliasMap(_0x518c0a,undefined,_0x344f8f[_0x270a09(0x26e)],_0x344f8f['profileName']);return assertUnambiguousHookAliases(_0x5b04a1),new Map(_0x5b04a1[_0x270a09(0x262)](_0x414741=>[_0x414741[_0x270a09(0x249)][_0x270a09(0x20a)](),_0x414741[_0x270a09(0x25f)]]));}async function planHookDirectoryMigration(_0x57b0d6,_0x554fd7,_0x1a8580,_0x3b68d9){const _0x3b19a6=a43_0x54976f,_0x2c6299=new Map();for(const [_0x468e8f,_0x2af7d9]of Object[_0x3b19a6(0x214)](_0x554fd7[_0x3b19a6(0x244)])){const [_0x5aa786,_0x4c8276,_0x153801,_0x263495,_0x1f4df4,..._0x1e7c51]=_0x468e8f[_0x3b19a6(0x269)]('/');if(_0x5aa786!==_0x3b19a6(0x22a)||!_0x4c8276||!_0x153801||!_0x263495||!_0x1f4df4||_0x1e7c51[_0x3b19a6(0x209)]>0x0||!_0x2af7d9['datasetCode'])continue;const _0x5e5293=_0x1a8580[_0x3b19a6(0x210)](_0x2af7d9['datasetCode'][_0x3b19a6(0x20a)]()),_0x255fec=_0x5e5293??_0x2af7d9[_0x3b19a6(0x249)];if(!isSafeHookDirectorySegment(_0x4c8276))throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x24c)+_0x4c8276+_0x3b19a6(0x252));if(!isSafeHookDirectorySegment(_0x255fec))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x4c8276+_0x3b19a6(0x241));if(_0x4c8276===_0x255fec)continue;const _0x276ae9=_0x2c6299[_0x3b19a6(0x210)](_0x4c8276)??{'datasetCode':_0x2af7d9[_0x3b19a6(0x249)],'alias':_0x5e5293,'keyChanges':[]};if(_0x276ae9[_0x3b19a6(0x249)]!==_0x2af7d9[_0x3b19a6(0x249)])throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x234)+_0x4c8276+_0x3b19a6(0x243));const _0x1f970a=_0x3b19a6(0x1fe)+_0x255fec+'/'+_0x153801+'/'+_0x263495+'/'+_0x1f4df4;try{resolveLocalFilePathFromLockKey(_0x57b0d6,_0x468e8f),resolveLocalFilePathFromLockKey(_0x57b0d6,_0x1f970a);}catch(_0x227378){throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x272)+_0x468e8f+_0x3b19a6(0x265)+(_0x227378 instanceof Error?_0x227378['message']:String(_0x227378)));}_0x276ae9[_0x3b19a6(0x1f6)][_0x3b19a6(0x21d)]({'oldLockKey':_0x468e8f,'newLockKey':_0x1f970a,'entry':_0x2af7d9}),_0x2c6299[_0x3b19a6(0x245)](_0x4c8276,_0x276ae9);}const _0x57de56=new Set([..._0x2c6299[_0x3b19a6(0x21a)]()][_0x3b19a6(0x1e5)](_0x4ee1f7=>_0x4ee1f7[_0x3b19a6(0x1f6)][_0x3b19a6(0x262)](_0x564c37=>_0x564c37['oldLockKey']))),_0x7770e7=new Map(),_0x1abce9=new Map();for(const [_0xc02a2a,_0x2de086]of _0x2c6299){const _0x48abef=_0x2de086[_0x3b19a6(0x25f)]??_0x2de086['datasetCode'],_0x3c03bf=hookDirectoryIdentity(_0x48abef),_0x37ff82=_0x7770e7['get'](_0x3c03bf);if(_0x37ff82&&_0x37ff82!==_0xc02a2a)throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x23e)+_0x37ff82+_0x3b19a6(0x220)+_0xc02a2a+_0x3b19a6(0x261)+_0x48abef+_0x3b19a6(0x1e2));_0x7770e7[_0x3b19a6(0x245)](_0x3c03bf,_0xc02a2a);for(const _0x1971ad of _0x2de086[_0x3b19a6(0x1f6)]){const _0x328662=_0x1abce9[_0x3b19a6(0x210)](_0x1971ad[_0x3b19a6(0x229)]);if(_0x328662&&_0x328662!==_0x1971ad[_0x3b19a6(0x227)])throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22'+_0x328662+_0x3b19a6(0x220)+_0x1971ad[_0x3b19a6(0x227)]+'\x22:\x20both\x20target\x20\x22'+_0x1971ad[_0x3b19a6(0x229)]+_0x3b19a6(0x1f0));if(_0x57de56['has'](_0x1971ad['newLockKey']))throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x206)+_0x1971ad[_0x3b19a6(0x227)]+'\x22:\x20its\x20target\x20\x22'+_0x1971ad[_0x3b19a6(0x229)]+_0x3b19a6(0x1e1));_0x1abce9[_0x3b19a6(0x245)](_0x1971ad[_0x3b19a6(0x229)],_0x1971ad[_0x3b19a6(0x227)]);}}const _0xd83048=new Map();for(const [_0x84e042,_0xc3d855]of _0x1a8580){_0xd83048[_0x3b19a6(0x245)](hookDirectoryIdentity(_0xc3d855),_0x84e042);}const _0xda566f=[];for(const [_0x5f4f8b,_0x13b51a]of _0x2c6299){const _0x1231fa=_0x13b51a['alias']??_0x13b51a['datasetCode'],_0x3f1ae9=join(_0x57b0d6[_0x3b19a6(0x21b)],_0x3b19a6(0x22a),_0x5f4f8b),_0x25521d=join(_0x57b0d6[_0x3b19a6(0x21b)],'HOOK',_0x1231fa),_0x3a68f2=await directoryExists(_0x3f1ae9),_0x764fd9=await directoryExists(_0x25521d),_0xa6462=_0x3a68f2?_0x764fd9?await sameDirectory(_0x3f1ae9,_0x25521d)?_0x3b19a6(0x1e7):undefined:_0x3b19a6(0x1eb):_0x3b19a6(0x218);if(!_0xa6462)throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x234)+_0x5f4f8b+_0x3b19a6(0x1ee)+_0x1231fa+'\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.');const _0x35247c=_0xd83048[_0x3b19a6(0x210)](hookDirectoryIdentity(_0x5f4f8b));if(_0x35247c&&_0x35247c!==_0x13b51a[_0x3b19a6(0x249)][_0x3b19a6(0x20a)]()){const _0x3da436=new Set(_0x13b51a[_0x3b19a6(0x1f6)]['map'](_0x1bd4bf=>_0x1bd4bf['oldLockKey'])),_0x433c27=_0x3b68d9['filter'](_0x1391b6=>_0x1391b6['type']===_0x3b19a6(0x22a)&&_0x1391b6[_0x3b19a6(0x25f)]!=null&&hookDirectoryIdentity(_0x1391b6[_0x3b19a6(0x25f)])===hookDirectoryIdentity(_0x5f4f8b)&&!_0x3da436['has'](_0x1391b6[_0x3b19a6(0x24f)]));if(_0x433c27[_0x3b19a6(0x209)]>0x0)throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x234)+_0x5f4f8b+_0x3b19a6(0x23f));}const _0x3169a0=_0xd83048[_0x3b19a6(0x210)](hookDirectoryIdentity(_0x1231fa));if(_0x3169a0&&_0x3169a0!==_0x13b51a[_0x3b19a6(0x249)][_0x3b19a6(0x20a)]())throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x234)+_0x5f4f8b+_0x3b19a6(0x1ee)+_0x1231fa+_0x3b19a6(0x216));for(const _0x575fba of _0x13b51a[_0x3b19a6(0x1f6)]){const _0x244f70=_0x554fd7[_0x3b19a6(0x244)][_0x575fba[_0x3b19a6(0x229)]];if(_0x244f70&&!_0x57de56[_0x3b19a6(0x1e8)](_0x575fba[_0x3b19a6(0x229)])&&!sameHookIdentity(_0x575fba[_0x3b19a6(0x271)],_0x244f70))throw CliErrors[_0x3b19a6(0x264)](_0x3b19a6(0x234)+_0x5f4f8b+'\x22\x20to\x20\x22'+_0x1231fa+_0x3b19a6(0x1f3));}_0xda566f[_0x3b19a6(0x21d)]({'oldDirectory':_0x5f4f8b,'newDirectory':_0x1231fa,'oldDirectoryPath':_0x3f1ae9,'newDirectoryPath':_0x25521d,'mode':_0xa6462,'alias':_0x13b51a[_0x3b19a6(0x25f)],'keyChanges':_0x13b51a['keyChanges']});}const _0x1f1144={..._0x554fd7['functions']},_0x41a6ae=new Map(),_0x438f2c=new Map();for(const _0x47b7ad of _0xda566f){const _0x57bf78=_0x47b7ad[_0x3b19a6(0x278)]!==_0x3b19a6(0x218);_0x57bf78&&_0x438f2c[_0x3b19a6(0x245)](hookDirectoryIdentity(_0x47b7ad[_0x3b19a6(0x22c)]),_0x47b7ad[_0x3b19a6(0x235)]);for(const _0x4c761e of _0x47b7ad[_0x3b19a6(0x1f6)]){const _0x42c0ef=_0x1f1144[_0x4c761e[_0x3b19a6(0x229)]],_0x3b8060=_0x57bf78?_0x4c761e[_0x3b19a6(0x271)]:_0x42c0ef??_0x4c761e[_0x3b19a6(0x271)];_0x1f1144[_0x4c761e['newLockKey']]=canonicalizeHookEntry(_0x3b8060,_0x47b7ad[_0x3b19a6(0x25f)]),delete _0x1f1144[_0x4c761e[_0x3b19a6(0x227)]],_0x57bf78&&_0x41a6ae[_0x3b19a6(0x245)](_0x4c761e[_0x3b19a6(0x229)],resolveLocalFilePathFromLockKey(_0x57b0d6,_0x4c761e[_0x3b19a6(0x227)]));}}return{'migrations':_0xda566f,'projectedFunctions':_0x1f1144,'sourceFilePathByNewLockKey':_0x41a6ae,'sourceDirectoryPathByNewDirectory':_0x438f2c};}function a43_0x41eb(){const _0x4d6e1f=['Remote\x20script\x20missing\x20content.','message','split','1853584vZfNOO','boolean','lastSync','Lock\x20scope\x20for\x20app\x20\x22','filePath','2323365XLnHrG','newDirectoryPath','entry','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','oldDirectory','bool','projectedFunctions','bff','migrations','mode','close','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','all','ENOENT','flatMap','force','case-rename','has','yes','would_pull','move','sourceDirectoryPathByNewDirectory','stringify','\x22\x20to\x20\x22','code','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','apiDir','remoteId','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','conflict','COMMON','keyChanges','utf8','apps','includes','\x20--name\x20','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','dev','read','HOOK/','1787395LHvBli','\x20pulled','stderr','6607864EXQvaZ','nonInteractive','version','scriptType','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','unresolvable\x20target\x20path','BFF_LOCAL_UNSYNCED','length','toLowerCase','/api/management/library/scripts/list?appCode=','appCode','functionName','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','defaultApp','get','\x20conflict','some','.hook-directory-migrate-','entries','sourceFilePathByNewLockKey','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','lockFilePath','rekey','string','values','scriptsRootDir','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','push','&type=','\x20bff\x20push\x20--type\x20','\x22\x20and\x20\x22','Could\x20not\x20restore\x20local\x20script\x20\x22','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','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.','join','stdin','operationType','oldLockKey','\x20failed','newLockKey','HOOK','delete','newDirectory','80396NUWyDs','reverse','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','type','toISOString','cancelled','scriptsRoot','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','oldDirectoryPath','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','content','\x20--format\x20compress','selectedAppName','Would\x20inspect\x20','scriptContent','push_local','.js','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','\x22;\x20temporary\x20directory\x20\x22','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','NFC','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','functions','set','36AuUrpu','requires','functionNode','datasetCode','\x20resolution','ino','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','Pull\x20complete:\x20','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','lockKey','rollback','write','\x22\x20from\x20the\x20lock\x20file.','\x20skipped','mergedCli','Force\x20overwrite\x20local\x20unsynced\x20changes','str','6tzBigZ','3825696dVRZSI','Force\x20pull\x20cancelled.','parse','4893329CQySAG','\x22\x20from\x20\x22','Failed\x20to\x20write\x20local\x20script\x20\x22','pull','alias','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','\x22:\x20both\x20target\x20\x22','map','require','validation','\x22:\x20','hookLocation'];a43_0x41eb=function(){return _0x4d6e1f;};return a43_0x41eb();}function resolveMigratedSourceFilePath(_0x444245,_0x54740a){const _0x396f2e=a43_0x54976f;if(!_0x444245||!_0x54740a)return undefined;const _0x33e709=_0x444245[_0x396f2e(0x215)][_0x396f2e(0x210)](_0x54740a['lockKey']);if(_0x33e709)return _0x33e709;if(_0x54740a['type']!==_0x396f2e(0x22a))return undefined;const [,_0x243f58,..._0x57b16d]=_0x54740a[_0x396f2e(0x24f)][_0x396f2e(0x269)]('/');if(!_0x243f58||_0x57b16d['length']===0x0)return undefined;const _0x4d7d4d=_0x444245[_0x396f2e(0x1ec)][_0x396f2e(0x210)](hookDirectoryIdentity(_0x243f58));return _0x4d7d4d?join(_0x4d7d4d,..._0x57b16d)+_0x396f2e(0x23d):undefined;}function sameHookIdentity(_0x20fed6,_0x1f0f55){const _0x53f33c=a43_0x54976f;return _0x20fed6[_0x53f33c(0x1f2)]===_0x1f0f55[_0x53f33c(0x1f2)]&&_0x20fed6[_0x53f33c(0x249)]===_0x1f0f55[_0x53f33c(0x249)]&&_0x20fed6[_0x53f33c(0x226)]===_0x1f0f55[_0x53f33c(0x226)]&&_0x20fed6[_0x53f33c(0x248)]===_0x1f0f55[_0x53f33c(0x248)];}function canonicalizeHookEntry(_0x24fda6,_0x419752){const {alias:_0xfd35db,..._0x5ec793}=_0x24fda6;return _0x419752?{..._0x5ec793,'alias':_0x419752}:_0x5ec793;}function hookDirectoryIdentity(_0x1d1d6f){const _0x1f0e31=a43_0x54976f;return _0x1d1d6f['normalize'](_0x1f0e31(0x242))[_0x1f0e31(0x20a)]();}function isSafeHookDirectorySegment(_0x2b6f07){return isSafeLockKeySegment(_0x2b6f07);}async function sameDirectory(_0x46334f,_0x1d61a2){const _0x5823ae=a43_0x54976f,[_0x3dcafe,_0x3efe12]=await Promise[_0x5823ae(0x1e3)]([stat(_0x46334f),stat(_0x1d61a2)]);return _0x3dcafe[_0x5823ae(0x1fc)]===_0x3efe12['dev']&&_0x3dcafe[_0x5823ae(0x24b)]===_0x3efe12['ino'];}async function applyHookDirectoryMigration(_0x55b785,_0x2830dd){const _0x104ba4=a43_0x54976f,_0x48cfea=_0x2830dd[_0x104ba4(0x244)],_0x475475=_0x2830dd[_0x104ba4(0x26c)],_0x4fcd86=[],_0x59e83f=async()=>{const _0x41829f=_0x104ba4,_0x58171a=[];_0x2830dd[_0x41829f(0x244)]=_0x48cfea,_0x2830dd[_0x41829f(0x26c)]=_0x475475;for(const {migration:_0x2cf2a3,temporaryPath:_0x1c3d69}of[..._0x4fcd86][_0x41829f(0x22e)]()){try{_0x1c3d69?(await rename(_0x2cf2a3[_0x41829f(0x270)],_0x1c3d69),await rename(_0x1c3d69,_0x2cf2a3[_0x41829f(0x235)])):await rename(_0x2cf2a3[_0x41829f(0x270)],_0x2cf2a3[_0x41829f(0x235)]);}catch(_0x4ad7a1){_0x58171a[_0x41829f(0x21d)](new Error(_0x41829f(0x20e)+_0x2cf2a3['oldDirectory']+_0x41829f(0x25c)+_0x2cf2a3[_0x41829f(0x22c)]+_0x41829f(0x265)+(_0x4ad7a1 instanceof Error?_0x4ad7a1[_0x41829f(0x268)]:String(_0x4ad7a1))));}}return _0x58171a;};try{for(const _0x58235b of _0x55b785[_0x104ba4(0x277)]){if(_0x58235b['mode']===_0x104ba4(0x1eb))await ensureParentDirectory(_0x58235b[_0x104ba4(0x270)]),await rename(_0x58235b[_0x104ba4(0x235)],_0x58235b['newDirectoryPath']),_0x4fcd86['push']({'migration':_0x58235b});else{if(_0x58235b[_0x104ba4(0x278)]===_0x104ba4(0x1e7)){const _0x68794=join(dirname(_0x58235b['oldDirectoryPath']),_0x104ba4(0x213)+randomUUID());await rename(_0x58235b['oldDirectoryPath'],_0x68794);try{await rename(_0x68794,_0x58235b['newDirectoryPath']);}catch(_0x7fffde){try{await rename(_0x68794,_0x58235b[_0x104ba4(0x235)]);}catch(_0x1de994){throw withRollbackErrors(_0x7fffde,_0x104ba4(0x27a)+_0x58235b[_0x104ba4(0x273)]+_0x104ba4(0x1ee)+_0x58235b[_0x104ba4(0x22c)]+_0x104ba4(0x240)+_0x68794+'\x22\x20may\x20remain.',[new Error(_0x104ba4(0x1fb)+_0x68794+'\x22\x20to\x20\x22'+_0x58235b[_0x104ba4(0x273)]+'\x22:\x20'+(_0x1de994 instanceof Error?_0x1de994[_0x104ba4(0x268)]:String(_0x1de994)))]);}throw _0x7fffde;}_0x4fcd86['push']({'migration':_0x58235b,'temporaryPath':_0x68794});}}}return _0x2830dd[_0x104ba4(0x244)]=_0x55b785[_0x104ba4(0x275)],{'rollback':_0x59e83f};}catch(_0x4acf31){const _0x14e229=await _0x59e83f();throw withRollbackErrors(_0x4acf31,'Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x14e229);}}function a43_0x510b(_0x41541f,_0x1e843a){_0x41541f=_0x41541f-0x1e1;const _0x41eb57=a43_0x41eb();let _0x510bbd=_0x41eb57[_0x41541f];return _0x510bbd;}async function confirmForce(){const _0x4c5ec=a43_0x54976f,_0x1df691=createInterface({'input':process[_0x4c5ec(0x225)],'output':process[_0x4c5ec(0x201)]}),_0x7aaa9b=await new Promise(_0x1fa684=>{const _0x55c245=_0x4c5ec;_0x1df691['question'](_0x55c245(0x21c),_0x1fa684);});return _0x1df691[_0x4c5ec(0x279)](),['y',_0x4c5ec(0x1e9)][_0x4c5ec(0x1f9)](_0x7aaa9b['trim']()['toLowerCase']());}
1
+ const a43_0x5e2799=a43_0x35d5;(function(_0x4ae0f8,_0x56df36){const _0x5150f6=a43_0x35d5,_0x13d3d2=_0x4ae0f8();while(!![]){try{const _0x41880a=parseInt(_0x5150f6(0xb5))/0x1*(parseInt(_0x5150f6(0xc5))/0x2)+parseInt(_0x5150f6(0xfc))/0x3*(parseInt(_0x5150f6(0xf2))/0x4)+parseInt(_0x5150f6(0xe9))/0x5*(parseInt(_0x5150f6(0x93))/0x6)+parseInt(_0x5150f6(0xd6))/0x7+parseInt(_0x5150f6(0x83))/0x8+parseInt(_0x5150f6(0xe4))/0x9+-parseInt(_0x5150f6(0x102))/0xa;if(_0x41880a===_0x56df36)break;else _0x13d3d2['push'](_0x13d3d2['shift']());}catch(_0x17093f){_0x13d3d2['push'](_0x13d3d2['shift']());}}}(a43_0x2f06,0xbf0fe));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';function a43_0x2f06(){const _0x29757c=['appCode','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','currentApp','flatMap','3KaeZFP','migrations','scriptsRootDir','Remote\x20script\x20missing\x20content.','lastSync','push_local','55787620zmXtbo','rollback','filePath','scriptsRoot','\x22\x20may\x20remain.','push','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.','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','sourceDirectoryPathByNewDirectory','ino','oldDirectoryPath','sourceFilePathByNewLockKey','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','split','apiDir','\x20Recovery\x20errors:\x20','\x20bff\x20push\x20--type\x20','HOOK/','force','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','existed','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','10947920BNJAGr','Pull\x20only\x20this\x20script\x20type','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','\x22\x20from\x20\x22','.js','&type=','scriptType','string','oldDirectory','dev','hookLocation','content','length','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','stringify','\x22\x20from\x20the\x20lock\x20file.','1083708FrBeOD','apps','Could\x20not\x20restore\x20local\x20script\x20\x22','has','\x20--format\x20compress','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','conflict','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','keyChanges','code','some','toLowerCase','newDirectory','functionNode','newLockKey','lockKey','nonInteractive','\x20failed','join','question','all','normalize','boolean','stderr','trim','Would\x20inspect\x20','profileName','Pull\x20complete:\x20','read','move','remoteId','mergedCli','str','Failed\x20to\x20write\x20local\x20script\x20\x22','8NgNRqg','type','operationType','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','yes','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','projectedFunctions','\x20resolution','\x22\x20to\x20\x22','HOOK','\x22:\x20','bool','map','case-rename','requires','cancelled','61260pUOiOu','parse','message','set','\x20skipped','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','utf8','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','NFC','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','values','&currentPage=1&pageSize=','functions','datasetCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','9970548ukCgNZ','would_pull','\x22:\x20its\x20target\x20\x22','includes','\x20pulled','lockFilePath','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','ENDPOINT','entry','ENOENT','\x22\x20and\x20\x22','delete','reverse','rekey','7707195Cwergq','Force\x20overwrite\x20local\x20unsynced\x20changes','oldLockKey','validation','\x20conflict','25pvmFOH','functionName','pull','\x22:\x20both\x20target\x20\x22','mode','/api/management/library/scripts/list?appCode=','entries','\x22;\x20temporary\x20directory\x20\x22','newDirectoryPath','6256052RluOHv','BFF_LOCAL_UNSYNCED','get','scriptContent','selectedAppName','alias'];a43_0x2f06=function(){return _0x29757c;};return a43_0x2f06();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':'bff','command':a43_0x5e2799(0xeb),'description':a43_0x5e2799(0x10f),'risk':a43_0x5e2799(0xaf),'structuredErrors':!![],'flags':[{'name':a43_0x5e2799(0xb6),'type':a43_0x5e2799(0x8a),'description':a43_0x5e2799(0x84),'enum':['COMMON',a43_0x5e2799(0xdd),'HOOK']},{'name':'force','type':a43_0x5e2799(0xa9),'description':a43_0x5e2799(0xe5)}],async 'dryRun'(_0x797d03){const _0xd6dabe=a43_0x5e2799,_0x38b4d9=loadBffProjectConfig(_0x797d03[_0xd6dabe(0xf8)]),_0x411f6f=await readBffLockFile(_0x38b4d9[_0xd6dabe(0xdb)]),{appLock:_0x51394b}=ensureLockScope(_0x411f6f??createEmptyBffLock(),_0x797d03['appCode'],_0x38b4d9[_0xd6dabe(0x105)],_0xd6dabe(0xeb)),_0x940b8c=normalizeBffType(_0x797d03['str'](_0xd6dabe(0xb6)))??undefined,[_0x4a8247,_0x342c34]=await Promise[_0xd6dabe(0xa7)]([listBffScripts(_0x797d03[_0xd6dabe(0xf8)],_0x940b8c),getBffScriptStatistics(_0x797d03[_0xd6dabe(0xf8)])]),_0x1c70ad=_0x4a8247[_0xd6dabe(0x9d)](_0x194429=>normalizeBffType(_0x194429[_0xd6dabe(0x89)])===_0xd6dabe(0xbe)),_0x1ff0ff=_0x1c70ad?buildDatasetCodeToAliasMap(_0x797d03[_0xd6dabe(0x111)],_0x797d03[_0xd6dabe(0xf8)],_0x797d03[_0xd6dabe(0xf6)]||_0x797d03[_0xd6dabe(0xb2)]?.[_0xd6dabe(0xfa)]||_0x797d03[_0xd6dabe(0xb2)]?.['defaultApp']):new Map(),_0x2e12cf=_0x1c70ad?await planHookDirectoryMigration(_0x38b4d9,_0x51394b,_0x1ff0ff,await scanLocalBffFunctions(_0x38b4d9,'HOOK')):undefined,_0xa7b11c=createHookLocationMap(_0x342c34),_0x3dfb06=[];for(const _0x294b53 of _0x4a8247){const _0x3b5842=resolveRemoteScriptTarget(_0x38b4d9,_0x294b53,_0xa7b11c,_0x2e12cf?.[_0xd6dabe(0xbb)]??_0x51394b[_0xd6dabe(0xd3)],_0x1ff0ff);if(!_0x3b5842){_0x3dfb06[_0xd6dabe(0x107)]({'scriptType':_0x294b53[_0xd6dabe(0x89)],'functionName':_0x294b53['functionName']??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x2ba799=(_0x2e12cf?.[_0xd6dabe(0xbb)]??_0x51394b[_0xd6dabe(0xd3)])[_0x3b5842[_0xd6dabe(0xa2)]],_0x3bbfff=_0x294b53[_0xd6dabe(0xf5)]!=null?computeContentHash(_0x294b53[_0xd6dabe(0xf5)]):undefined,_0x84478d=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x2e12cf,_0x3b5842)??_0x3b5842[_0xd6dabe(0x104)],_0x2ba799,_0x3bbfff),_0x3c9528=_0x84478d?localUnsyncedConflict(_0x3b5842,_0x294b53['id']):undefined;_0x3dfb06['push']({'lockKey':_0x3b5842[_0xd6dabe(0xa2)],'filePath':_0x3b5842['filePath'],'remoteId':_0x294b53['id']??null,'status':_0x3c9528?_0xd6dabe(0x99):_0xd6dabe(0xd7),..._0x3c9528?{'conflict':_0x3c9528}:{},..._0x3b5842['hookLocation']?{'alias':_0x3b5842[_0xd6dabe(0x8d)][_0xd6dabe(0xf7)]??null,'datasetCode':_0x3b5842[_0xd6dabe(0x8d)]['datasetCode'],'operationType':_0x3b5842[_0xd6dabe(0x8d)][_0xd6dabe(0xb7)],'functionNode':_0x3b5842[_0xd6dabe(0x8d)][_0xd6dabe(0xa0)]}:{}});}return{'method':'GET','url':_0xd6dabe(0xee)+_0x797d03[_0xd6dabe(0xf8)]+(_0x940b8c?_0xd6dabe(0x88)+_0x940b8c:'')+_0xd6dabe(0xd2)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x797d03[_0xd6dabe(0xf8)],'filterType':_0x940b8c??null,..._0x2e12cf&&_0x2e12cf[_0xd6dabe(0xfd)][_0xd6dabe(0x8f)]>0x0?{'hookDirectoryMigrations':_0x2e12cf[_0xd6dabe(0xfd)][_0xd6dabe(0xc1)](_0x2eb72f=>({'from':_0x2eb72f['oldDirectory'],'to':_0x2eb72f[_0xd6dabe(0x9f)]}))}:{},'files':_0x3dfb06},'description':_0xd6dabe(0xac)+_0x3dfb06['length']+_0xd6dabe(0xdc)};},async 'execute'(_0x1b3331){const _0x123023=a43_0x5e2799,_0x4ac574=loadBffProjectConfig(_0x1b3331[_0x123023(0xf8)]),_0x16ef84=await readBffLockFile(_0x4ac574['lockFilePath']),{lockData:_0x23ef0a,appLock:_0x5892e9}=ensureLockScope(_0x16ef84??createEmptyBffLock(),_0x1b3331[_0x123023(0xf8)],_0x4ac574[_0x123023(0x105)],_0x123023(0xeb)),_0x5a3b5a=normalizeBffType(_0x1b3331[_0x123023(0xb3)]('type'))??undefined;if(_0x1b3331['str'](_0x123023(0xb6))&&!_0x5a3b5a)throw CliErrors['validation']('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x108fd7,_0x385b97]=await Promise[_0x123023(0xa7)]([listBffScripts(_0x1b3331[_0x123023(0xf8)],_0x5a3b5a),getBffScriptStatistics(_0x1b3331[_0x123023(0xf8)])]);if(_0x108fd7[_0x123023(0x8f)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x123023(0xcd)};const _0x16b5b1=_0x1b3331[_0x123023(0xc0)](_0x123023(0x115));if(_0x16b5b1&&!_0x1b3331[_0x123023(0xa3)]){const _0x324aed=await confirmForce();if(!_0x324aed)throw CliErrors[_0x123023(0xc4)]('Force\x20pull\x20cancelled.');}if(_0x16b5b1&&_0x1b3331['nonInteractive']){}const _0x3378f9=_0x108fd7[_0x123023(0x9d)](_0x2d2522=>normalizeBffType(_0x2d2522['scriptType'])===_0x123023(0xbe)),_0x450531=_0x3378f9?buildDatasetCodeToAliasMap(_0x1b3331['apiDir'],_0x1b3331['appCode'],_0x1b3331[_0x123023(0xf6)]||_0x1b3331['mergedCli']?.[_0x123023(0xfa)]||_0x1b3331[_0x123023(0xb2)]?.['defaultApp']):new Map(),_0x416855=createHookLocationMap(_0x385b97),_0x5501da=JSON[_0x123023(0xc6)](JSON[_0x123023(0x91)](_0x23ef0a)),_0x1bc881=_0x1b3331[_0x123023(0xf8)],_0x207806=_0x5501da[_0x123023(0x94)][_0x1bc881];if(!_0x207806)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x1bc881+_0x123023(0xd5));const _0x3095ca=_0x3378f9?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x4ac574,_0x207806,_0x450531,await scanLocalBffFunctions(_0x4ac574,_0x123023(0xbe))),_0x207806):undefined,_0x31877c=createPullFileTransaction(),_0xcd7a3b=[],_0x1a7484=[],_0x41b043=[],_0x2ff60f=[];for(const _0xad3bbb of _0x108fd7){const _0x2092c2=resolveRemoteScriptTarget(_0x4ac574,_0xad3bbb,_0x416855,_0x207806['functions'],_0x450531);if(!_0x2092c2){_0x1a7484['push']({'lockKey':_0xad3bbb['scriptType']+'/'+_0xad3bbb[_0x123023(0xea)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x56dc69=_0x207806['functions'][_0x2092c2[_0x123023(0xa2)]];try{if(!_0xad3bbb['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0xad3bbb[_0x123023(0xf5)]==null)throw new Error(_0x123023(0xff));const _0x57059c=_0xad3bbb['scriptContent'],_0x5dfb57=computeContentHash(_0x57059c);if(!_0x16b5b1){const _0x54c394=await hasUnsyncedLocalChanges(_0x2092c2[_0x123023(0x104)],_0x56dc69,_0x5dfb57);if(_0x54c394){_0x41b043[_0x123023(0x107)](localUnsyncedConflict(_0x2092c2,_0xad3bbb['id']));continue;}}await _0x31877c['write'](_0x2092c2[_0x123023(0x104)],_0x57059c);const _0x299344={'hash':_0x5dfb57,'remoteId':_0xad3bbb['id'],'version':_0xad3bbb['version']};_0x2092c2[_0x123023(0xb6)]===_0x123023(0xbe)&&_0x2092c2[_0x123023(0x8d)]&&(_0x299344[_0x123023(0xf7)]=_0x2092c2['hookLocation'][_0x123023(0xf7)],_0x299344[_0x123023(0xd4)]=_0x2092c2[_0x123023(0x8d)][_0x123023(0xd4)],_0x299344[_0x123023(0xb7)]=_0x2092c2[_0x123023(0x8d)][_0x123023(0xb7)],_0x299344['functionNode']=_0x2092c2[_0x123023(0x8d)][_0x123023(0xa0)]),_0x207806[_0x123023(0xd3)][_0x2092c2['lockKey']]=_0x299344,_0xcd7a3b['push']({'lockKey':_0x2092c2[_0x123023(0xa2)],'remoteId':_0xad3bbb['id']});}catch(_0x568639){_0x2ff60f['push']({'lockKey':_0x2092c2['lockKey'],'error':_0x568639 instanceof Error?_0x568639['message']:String(_0x568639)});}}_0x207806['lastSync']=new Date()['toISOString']();try{await writeBffLockFile(_0x4ac574[_0x123023(0xdb)],_0x5501da);}catch(_0x60c229){const _0x1f4e0f=[...await _0x31877c[_0x123023(0x103)](),...await _0x3095ca?.[_0x123023(0x103)]()??[]];throw withRollbackErrors(_0x60c229,'Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x1f4e0f);}return{'ok':_0x2ff60f[_0x123023(0x8f)]===0x0,'data':{'pulled':_0xcd7a3b,'skipped':_0x1a7484,'conflicts':_0x41b043,'failed':_0x2ff60f},'message':formatPullMessage(_0xcd7a3b[_0x123023(0x8f)],_0x1a7484['length'],_0x41b043[_0x123023(0x8f)],_0x2ff60f[_0x123023(0x8f)])};}};function a43_0x35d5(_0x385929,_0x269af0){_0x385929=_0x385929-0x80;const _0x2f066d=a43_0x2f06();let _0x35d59d=_0x2f066d[_0x385929];return _0x35d59d;}function localUnsyncedConflict(_0x1f67cf,_0xb6800b){const _0x516db4=a43_0x5e2799,_0x369553=_0x1f67cf[_0x516db4(0xa2)][_0x516db4(0x110)]('/')['at'](-0x1);return{'code':_0x516db4(0xf3),'lockKey':_0x1f67cf[_0x516db4(0xa2)],'filePath':_0x1f67cf[_0x516db4(0x104)],..._0xb6800b!=null?{'remoteId':_0xb6800b}:{},'message':_0x516db4(0x109),'nextAction':{'action':_0x516db4(0x101),'command':CLI_BIN_NAME+_0x516db4(0x113)+_0x1f67cf[_0x516db4(0xb6)]+'\x20--name\x20'+_0x369553+_0x516db4(0x97),'requiresReview':!![],'message':_0x516db4(0x108)}};}function formatPullMessage(_0x4bb318,_0x553ae0,_0x36041d,_0x567632){const _0x2e192f=a43_0x5e2799,_0x16ca18=[_0x2e192f(0xae)+_0x4bb318+_0x2e192f(0xda),_0x553ae0+_0x2e192f(0xc9)];_0x36041d>0x0&&_0x16ca18[_0x2e192f(0x107)](_0x36041d+_0x2e192f(0xe8)+(_0x36041d===0x1?'':'s')+'\x20'+(_0x36041d===0x1?_0x2e192f(0xc3):'require')+_0x2e192f(0xbc));if(_0x567632>0x0)_0x16ca18[_0x2e192f(0x107)](_0x567632+_0x2e192f(0xa4));return _0x16ca18['join'](',\x20');}async function hasUnsyncedLocalChanges(_0x1de41e,_0xf010fd,_0x521075){if(!await fileExists(_0x1de41e))return![];const _0x308081=await computeFileHash(_0x1de41e);if(!_0xf010fd)return _0x521075?_0x308081!==_0x521075:!![];return _0x308081!==_0xf010fd['hash'];}function createPullFileTransaction(){const _0x34c402=new Map(),_0x1f4c59=async(_0x2286a8,_0x2a9bca)=>{const _0x2e8cf9=a43_0x35d5;try{if(_0x2a9bca[_0x2e8cf9(0x81)])await ensureParentDirectory(_0x2286a8),await writeFile(_0x2286a8,_0x2a9bca[_0x2e8cf9(0x8e)]);else try{await unlink(_0x2286a8);}catch(_0x5e7540){if(_0x5e7540[_0x2e8cf9(0x9c)]!==_0x2e8cf9(0xdf))throw _0x5e7540;}return undefined;}catch(_0x233f6e){return _0x233f6e instanceof Error?_0x233f6e:new Error(String(_0x233f6e));}};return{async 'write'(_0xfaa6da,_0x14cdbe){const _0x54ae3f=a43_0x35d5;if(!_0x34c402[_0x54ae3f(0x96)](_0xfaa6da))try{_0x34c402[_0x54ae3f(0xc8)](_0xfaa6da,{'existed':!![],'content':await readFile(_0xfaa6da)});}catch(_0x36d9f8){if(_0x36d9f8[_0x54ae3f(0x9c)]!==_0x54ae3f(0xdf))throw _0x36d9f8;_0x34c402[_0x54ae3f(0xc8)](_0xfaa6da,{'existed':![]});}try{await ensureParentDirectory(_0xfaa6da),await writeFile(_0xfaa6da,_0x14cdbe,_0x54ae3f(0xcb));}catch(_0x16c71a){const _0x22f532=await _0x1f4c59(_0xfaa6da,_0x34c402[_0x54ae3f(0xf4)](_0xfaa6da));if(!_0x22f532)_0x34c402[_0x54ae3f(0xe1)](_0xfaa6da);throw withRollbackErrors(_0x16c71a,_0x54ae3f(0xb4)+_0xfaa6da+'\x22.',_0x22f532?[_0x22f532]:[]);}},async 'rollback'(){const _0x33e483=a43_0x35d5,_0x5d9adb=[];for(const [_0x30b7a5,_0x10f20d]of[..._0x34c402[_0x33e483(0xef)]()][_0x33e483(0xe2)]()){const _0x4c54e8=await _0x1f4c59(_0x30b7a5,_0x10f20d);_0x4c54e8&&_0x5d9adb['push'](new Error(_0x33e483(0x95)+_0x30b7a5+_0x33e483(0xbf)+_0x4c54e8[_0x33e483(0xc7)]));}return _0x5d9adb;}};}function withRollbackErrors(_0x2a77c3,_0x2f103e,_0x5d7fd0){const _0x1497d1=a43_0x5e2799,_0xb8b6fa=_0x2a77c3 instanceof Error?_0x2a77c3:new Error(String(_0x2a77c3));if(_0x5d7fd0[_0x1497d1(0x8f)]===0x0)return _0xb8b6fa;return new AggregateError([_0xb8b6fa,..._0x5d7fd0],_0x2f103e+_0x1497d1(0x112)+_0x5d7fd0[_0x1497d1(0xc1)](_0x57f38e=>_0x57f38e[_0x1497d1(0xc7)])[_0x1497d1(0xa5)](';\x20'));}function buildDatasetCodeToAliasMap(_0x5bd265,_0xcdc171,_0x155bbe){const _0x5d68da=a43_0x5e2799,_0x2f46b2=resolveApiModelSource(_0x5bd265,_0xcdc171,_0x155bbe),_0x4c7b3c=loadAliasMap(_0x5bd265,undefined,_0x2f46b2[_0x5d68da(0x104)],_0x2f46b2[_0x5d68da(0xad)]);return assertUnambiguousHookAliases(_0x4c7b3c),new Map(_0x4c7b3c[_0x5d68da(0xc1)](_0x12fdec=>[_0x12fdec[_0x5d68da(0xd4)][_0x5d68da(0x9e)](),_0x12fdec[_0x5d68da(0xf7)]]));}async function planHookDirectoryMigration(_0x45ca83,_0x261c8f,_0x3c4a72,_0x16bd38){const _0xd9cdf4=a43_0x5e2799,_0x52dca3=new Map();for(const [_0xa0854d,_0x2ae2ff]of Object[_0xd9cdf4(0xef)](_0x261c8f['functions'])){const [_0x3753bc,_0x16ff93,_0x52e889,_0x3a68d5,_0x502019,..._0x498913]=_0xa0854d['split']('/');if(_0x3753bc!==_0xd9cdf4(0xbe)||!_0x16ff93||!_0x52e889||!_0x3a68d5||!_0x502019||_0x498913['length']>0x0||!_0x2ae2ff[_0xd9cdf4(0xd4)])continue;const _0x234dfc=_0x3c4a72[_0xd9cdf4(0xf4)](_0x2ae2ff[_0xd9cdf4(0xd4)][_0xd9cdf4(0x9e)]()),_0x4a2bde=_0x234dfc??_0x2ae2ff[_0xd9cdf4(0xd4)];if(!isSafeHookDirectorySegment(_0x16ff93))throw CliErrors[_0xd9cdf4(0xe7)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x16ff93+_0xd9cdf4(0x92));if(!isSafeHookDirectorySegment(_0x4a2bde))throw CliErrors['validation'](_0xd9cdf4(0x85)+_0x16ff93+'\x22:\x20its\x20target\x20directory\x20is\x20unsafe.');if(_0x16ff93===_0x4a2bde)continue;const _0x4e8e28=_0x52dca3[_0xd9cdf4(0xf4)](_0x16ff93)??{'datasetCode':_0x2ae2ff[_0xd9cdf4(0xd4)],'alias':_0x234dfc,'keyChanges':[]};if(_0x4e8e28['datasetCode']!==_0x2ae2ff[_0xd9cdf4(0xd4)])throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x16ff93+_0xd9cdf4(0xcc));const _0x24860c=_0xd9cdf4(0x114)+_0x4a2bde+'/'+_0x52e889+'/'+_0x3a68d5+'/'+_0x502019;try{resolveLocalFilePathFromLockKey(_0x45ca83,_0xa0854d),resolveLocalFilePathFromLockKey(_0x45ca83,_0x24860c);}catch(_0x195997){throw CliErrors['validation'](_0xd9cdf4(0x98)+_0xa0854d+_0xd9cdf4(0xbf)+(_0x195997 instanceof Error?_0x195997[_0xd9cdf4(0xc7)]:String(_0x195997)));}_0x4e8e28[_0xd9cdf4(0x9b)][_0xd9cdf4(0x107)]({'oldLockKey':_0xa0854d,'newLockKey':_0x24860c,'entry':_0x2ae2ff}),_0x52dca3[_0xd9cdf4(0xc8)](_0x16ff93,_0x4e8e28);}const _0x3cb079=new Set([..._0x52dca3[_0xd9cdf4(0xd1)]()][_0xd9cdf4(0xfb)](_0x5843ad=>_0x5843ad[_0xd9cdf4(0x9b)][_0xd9cdf4(0xc1)](_0x4197b8=>_0x4197b8[_0xd9cdf4(0xe6)]))),_0x3245f3=new Map(),_0x5de385=new Map();for(const [_0x18655f,_0x73b485]of _0x52dca3){const _0x44b47b=_0x73b485[_0xd9cdf4(0xf7)]??_0x73b485['datasetCode'],_0x51c26c=hookDirectoryIdentity(_0x44b47b),_0x1bd16c=_0x3245f3[_0xd9cdf4(0xf4)](_0x51c26c);if(_0x1bd16c&&_0x1bd16c!==_0x18655f)throw CliErrors['validation'](_0xd9cdf4(0xba)+_0x1bd16c+_0xd9cdf4(0xe0)+_0x18655f+_0xd9cdf4(0xec)+_0x44b47b+'\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.');_0x3245f3['set'](_0x51c26c,_0x18655f);for(const _0x326b5d of _0x73b485[_0xd9cdf4(0x9b)]){const _0x4f8aa8=_0x5de385['get'](_0x326b5d[_0xd9cdf4(0xa1)]);if(_0x4f8aa8&&_0x4f8aa8!==_0x326b5d['oldLockKey'])throw CliErrors[_0xd9cdf4(0xe7)](_0xd9cdf4(0x90)+_0x4f8aa8+_0xd9cdf4(0xe0)+_0x326b5d[_0xd9cdf4(0xe6)]+'\x22:\x20both\x20target\x20\x22'+_0x326b5d[_0xd9cdf4(0xa1)]+'\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');if(_0x3cb079[_0xd9cdf4(0x96)](_0x326b5d[_0xd9cdf4(0xa1)]))throw CliErrors['validation'](_0xd9cdf4(0x82)+_0x326b5d[_0xd9cdf4(0xe6)]+_0xd9cdf4(0xd8)+_0x326b5d[_0xd9cdf4(0xa1)]+_0xd9cdf4(0x9a));_0x5de385['set'](_0x326b5d[_0xd9cdf4(0xa1)],_0x326b5d['oldLockKey']);}}const _0x2bda59=new Map();for(const [_0x2420e9,_0x40af87]of _0x3c4a72){_0x2bda59[_0xd9cdf4(0xc8)](hookDirectoryIdentity(_0x40af87),_0x2420e9);}const _0x14cba7=[];for(const [_0x101ad1,_0x50fbdd]of _0x52dca3){const _0xee7004=_0x50fbdd[_0xd9cdf4(0xf7)]??_0x50fbdd[_0xd9cdf4(0xd4)],_0x52fedc=join(_0x45ca83[_0xd9cdf4(0xfe)],_0xd9cdf4(0xbe),_0x101ad1),_0xf706cf=join(_0x45ca83[_0xd9cdf4(0xfe)],_0xd9cdf4(0xbe),_0xee7004),_0x51339f=await directoryExists(_0x52fedc),_0x93fbd3=await directoryExists(_0xf706cf),_0x4d7af6=_0x51339f?_0x93fbd3?await sameDirectory(_0x52fedc,_0xf706cf)?_0xd9cdf4(0xc2):undefined:'move':'rekey';if(!_0x4d7af6)throw CliErrors['validation'](_0xd9cdf4(0x85)+_0x101ad1+_0xd9cdf4(0xbd)+_0xee7004+_0xd9cdf4(0xd0));const _0x1ef4b4=_0x2bda59['get'](hookDirectoryIdentity(_0x101ad1));if(_0x1ef4b4&&_0x1ef4b4!==_0x50fbdd[_0xd9cdf4(0xd4)][_0xd9cdf4(0x9e)]()){const _0x182958=new Set(_0x50fbdd['keyChanges'][_0xd9cdf4(0xc1)](_0x2ffb04=>_0x2ffb04[_0xd9cdf4(0xe6)])),_0x1f95aa=_0x16bd38['filter'](_0x54473a=>_0x54473a[_0xd9cdf4(0xb6)]==='HOOK'&&_0x54473a[_0xd9cdf4(0xf7)]!=null&&hookDirectoryIdentity(_0x54473a[_0xd9cdf4(0xf7)])===hookDirectoryIdentity(_0x101ad1)&&!_0x182958[_0xd9cdf4(0x96)](_0x54473a[_0xd9cdf4(0xa2)]));if(_0x1f95aa[_0xd9cdf4(0x8f)]>0x0)throw CliErrors['validation'](_0xd9cdf4(0x85)+_0x101ad1+'\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');}const _0x2dbfdf=_0x2bda59[_0xd9cdf4(0xf4)](hookDirectoryIdentity(_0xee7004));if(_0x2dbfdf&&_0x2dbfdf!==_0x50fbdd[_0xd9cdf4(0xd4)][_0xd9cdf4(0x9e)]())throw CliErrors[_0xd9cdf4(0xe7)](_0xd9cdf4(0x85)+_0x101ad1+_0xd9cdf4(0xbd)+_0xee7004+_0xd9cdf4(0xca));for(const _0x1b0c5d of _0x50fbdd['keyChanges']){const _0x82cace=_0x261c8f[_0xd9cdf4(0xd3)][_0x1b0c5d[_0xd9cdf4(0xa1)]];if(_0x82cace&&!_0x3cb079[_0xd9cdf4(0x96)](_0x1b0c5d[_0xd9cdf4(0xa1)])&&!sameHookIdentity(_0x1b0c5d[_0xd9cdf4(0xde)],_0x82cace))throw CliErrors[_0xd9cdf4(0xe7)](_0xd9cdf4(0x85)+_0x101ad1+'\x22\x20to\x20\x22'+_0xee7004+'\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.');}_0x14cba7[_0xd9cdf4(0x107)]({'oldDirectory':_0x101ad1,'newDirectory':_0xee7004,'oldDirectoryPath':_0x52fedc,'newDirectoryPath':_0xf706cf,'mode':_0x4d7af6,'alias':_0x50fbdd[_0xd9cdf4(0xf7)],'keyChanges':_0x50fbdd[_0xd9cdf4(0x9b)]});}const _0x117295={..._0x261c8f['functions']},_0x4b5553=new Map(),_0xcf6afc=new Map();for(const _0x2439ca of _0x14cba7){const _0x5ee22d=_0x2439ca[_0xd9cdf4(0xed)]!==_0xd9cdf4(0xe3);_0x5ee22d&&_0xcf6afc[_0xd9cdf4(0xc8)](hookDirectoryIdentity(_0x2439ca[_0xd9cdf4(0x9f)]),_0x2439ca[_0xd9cdf4(0x10d)]);for(const _0x47d024 of _0x2439ca[_0xd9cdf4(0x9b)]){const _0xef39f6=_0x117295[_0x47d024[_0xd9cdf4(0xa1)]],_0x214134=_0x5ee22d?_0x47d024[_0xd9cdf4(0xde)]:_0xef39f6??_0x47d024[_0xd9cdf4(0xde)];_0x117295[_0x47d024[_0xd9cdf4(0xa1)]]=canonicalizeHookEntry(_0x214134,_0x2439ca[_0xd9cdf4(0xf7)]),delete _0x117295[_0x47d024[_0xd9cdf4(0xe6)]],_0x5ee22d&&_0x4b5553[_0xd9cdf4(0xc8)](_0x47d024['newLockKey'],resolveLocalFilePathFromLockKey(_0x45ca83,_0x47d024[_0xd9cdf4(0xe6)]));}}return{'migrations':_0x14cba7,'projectedFunctions':_0x117295,'sourceFilePathByNewLockKey':_0x4b5553,'sourceDirectoryPathByNewDirectory':_0xcf6afc};}function resolveMigratedSourceFilePath(_0x206fd3,_0x47b9c1){const _0x7a7f65=a43_0x5e2799;if(!_0x206fd3||!_0x47b9c1)return undefined;const _0x553fe7=_0x206fd3[_0x7a7f65(0x10e)]['get'](_0x47b9c1[_0x7a7f65(0xa2)]);if(_0x553fe7)return _0x553fe7;if(_0x47b9c1[_0x7a7f65(0xb6)]!==_0x7a7f65(0xbe))return undefined;const [,_0x1c1979,..._0x234caa]=_0x47b9c1[_0x7a7f65(0xa2)][_0x7a7f65(0x110)]('/');if(!_0x1c1979||_0x234caa['length']===0x0)return undefined;const _0x13c9cf=_0x206fd3[_0x7a7f65(0x10b)][_0x7a7f65(0xf4)](hookDirectoryIdentity(_0x1c1979));return _0x13c9cf?join(_0x13c9cf,..._0x234caa)+_0x7a7f65(0x87):undefined;}function sameHookIdentity(_0x56b2ac,_0x3ded91){const _0x1fcb1b=a43_0x5e2799;return _0x56b2ac[_0x1fcb1b(0xb1)]===_0x3ded91['remoteId']&&_0x56b2ac[_0x1fcb1b(0xd4)]===_0x3ded91['datasetCode']&&_0x56b2ac['operationType']===_0x3ded91[_0x1fcb1b(0xb7)]&&_0x56b2ac[_0x1fcb1b(0xa0)]===_0x3ded91['functionNode'];}function canonicalizeHookEntry(_0x462148,_0x87094b){const {alias:_0x3a06a6,..._0xbeb018}=_0x462148;return _0x87094b?{..._0xbeb018,'alias':_0x87094b}:_0xbeb018;}function hookDirectoryIdentity(_0x595c8f){const _0x51e517=a43_0x5e2799;return _0x595c8f[_0x51e517(0xa8)](_0x51e517(0xcf))[_0x51e517(0x9e)]();}function isSafeHookDirectorySegment(_0x2de881){return isSafeLockKeySegment(_0x2de881);}async function sameDirectory(_0x388eba,_0x57060d){const _0x2143f1=a43_0x5e2799,[_0x5819ce,_0x2efd72]=await Promise[_0x2143f1(0xa7)]([stat(_0x388eba),stat(_0x57060d)]);return _0x5819ce['dev']===_0x2efd72[_0x2143f1(0x8c)]&&_0x5819ce['ino']===_0x2efd72[_0x2143f1(0x10c)];}async function applyHookDirectoryMigration(_0x12d402,_0x9d1b6){const _0x2cca64=a43_0x5e2799,_0x4c9482=_0x9d1b6[_0x2cca64(0xd3)],_0x501655=_0x9d1b6[_0x2cca64(0x100)],_0x2ec54c=[],_0x2b850f=async()=>{const _0x465869=_0x2cca64,_0x4126fe=[];_0x9d1b6[_0x465869(0xd3)]=_0x4c9482,_0x9d1b6[_0x465869(0x100)]=_0x501655;for(const {migration:_0xc8df3c,temporaryPath:_0x2cdb03}of[..._0x2ec54c][_0x465869(0xe2)]()){try{_0x2cdb03?(await rename(_0xc8df3c[_0x465869(0xf1)],_0x2cdb03),await rename(_0x2cdb03,_0xc8df3c[_0x465869(0x10d)])):await rename(_0xc8df3c[_0x465869(0xf1)],_0xc8df3c['oldDirectoryPath']);}catch(_0x46aa39){_0x4126fe[_0x465869(0x107)](new Error(_0x465869(0xce)+_0xc8df3c[_0x465869(0x8b)]+_0x465869(0x86)+_0xc8df3c[_0x465869(0x9f)]+'\x22:\x20'+(_0x46aa39 instanceof Error?_0x46aa39['message']:String(_0x46aa39))));}}return _0x4126fe;};try{for(const _0xb3857e of _0x12d402['migrations']){if(_0xb3857e[_0x2cca64(0xed)]===_0x2cca64(0xb0))await ensureParentDirectory(_0xb3857e[_0x2cca64(0xf1)]),await rename(_0xb3857e[_0x2cca64(0x10d)],_0xb3857e['newDirectoryPath']),_0x2ec54c['push']({'migration':_0xb3857e});else{if(_0xb3857e[_0x2cca64(0xed)]===_0x2cca64(0xc2)){const _0x3ba38e=join(dirname(_0xb3857e[_0x2cca64(0x10d)]),'.hook-directory-migrate-'+randomUUID());await rename(_0xb3857e[_0x2cca64(0x10d)],_0x3ba38e);try{await rename(_0x3ba38e,_0xb3857e[_0x2cca64(0xf1)]);}catch(_0x5148b1){try{await rename(_0x3ba38e,_0xb3857e[_0x2cca64(0x10d)]);}catch(_0x144c9c){throw withRollbackErrors(_0x5148b1,_0x2cca64(0xf9)+_0xb3857e[_0x2cca64(0x8b)]+_0x2cca64(0xbd)+_0xb3857e['newDirectory']+_0x2cca64(0xf0)+_0x3ba38e+_0x2cca64(0x106),[new Error(_0x2cca64(0xb8)+_0x3ba38e+'\x22\x20to\x20\x22'+_0xb3857e['oldDirectory']+'\x22:\x20'+(_0x144c9c instanceof Error?_0x144c9c[_0x2cca64(0xc7)]:String(_0x144c9c)))]);}throw _0x5148b1;}_0x2ec54c['push']({'migration':_0xb3857e,'temporaryPath':_0x3ba38e});}}}return _0x9d1b6[_0x2cca64(0xd3)]=_0x12d402[_0x2cca64(0xbb)],{'rollback':_0x2b850f};}catch(_0x3e6a28){const _0x3cdc87=await _0x2b850f();throw withRollbackErrors(_0x3e6a28,_0x2cca64(0x10a),_0x3cdc87);}}async function confirmForce(){const _0x26a1eb=a43_0x5e2799,_0x37059b=createInterface({'input':process['stdin'],'output':process[_0x26a1eb(0xaa)]}),_0xcc9f2c=await new Promise(_0x501f3f=>{const _0x2a0416=_0x26a1eb;_0x37059b[_0x2a0416(0xa6)](_0x2a0416(0x80),_0x501f3f);});return _0x37059b['close'](),['y',_0x26a1eb(0xb9)][_0x26a1eb(0xd9)](_0xcc9f2c[_0x26a1eb(0xab)]()['toLowerCase']());}