@lovrabet/rabetbase-cli 2.5.10 → 2.5.11-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 (376) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/api-group.js +1 -1
  3. package/lib/api/fetch-model-list.js +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.js +1 -1
  6. package/lib/api/legacy-api-file.js +1 -1
  7. package/lib/api/model-registry-file.js +1 -1
  8. package/lib/api/model-registry-scaffold.js +1 -1
  9. package/lib/api/model-source.js +1 -1
  10. package/lib/auth/auth-server-ui.js +1 -1
  11. package/lib/auth/auth-server.js +1 -1
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.js +1 -1
  14. package/lib/auth/get-session-user.js +1 -1
  15. package/lib/auth/is-session-valid.js +1 -1
  16. package/lib/auth/login-success-html.js +1 -1
  17. package/lib/auth/logout.js +1 -1
  18. package/lib/cli-flags.js +1 -1
  19. package/lib/cli.js +1 -1
  20. package/lib/commands/api/generate.js +1 -1
  21. package/lib/commands/api/index.js +1 -1
  22. package/lib/commands/api/list.js +1 -1
  23. package/lib/commands/api/pull.js +1 -1
  24. package/lib/commands/api/shared.js +1 -1
  25. package/lib/commands/app/detail.js +1 -1
  26. package/lib/commands/app/index.js +1 -1
  27. package/lib/commands/app/list.js +1 -1
  28. package/lib/commands/app/members-list.js +1 -1
  29. package/lib/commands/app/remote-directory.js +1 -1
  30. package/lib/commands/app/shared.js +1 -1
  31. package/lib/commands/app-config/delete.js +1 -1
  32. package/lib/commands/app-config/get.js +1 -1
  33. package/lib/commands/app-config/index.js +1 -1
  34. package/lib/commands/app-config/list.js +1 -1
  35. package/lib/commands/app-config/set.js +1 -1
  36. package/lib/commands/app-config/shared.js +1 -1
  37. package/lib/commands/auth/index.js +1 -1
  38. package/lib/commands/bff/create.js +1 -1
  39. package/lib/commands/bff/delete.js +1 -1
  40. package/lib/commands/bff/detail.js +1 -1
  41. package/lib/commands/bff/index.js +1 -1
  42. package/lib/commands/bff/list.js +1 -1
  43. package/lib/commands/bff/logs.js +1 -1
  44. package/lib/commands/bff/pull.js +1 -1
  45. package/lib/commands/bff/push.js +1 -1
  46. package/lib/commands/bff/status.js +1 -1
  47. package/lib/commands/cli-skill/index.js +1 -1
  48. package/lib/commands/cli-update.js +1 -1
  49. package/lib/commands/codegen/index.js +1 -1
  50. package/lib/commands/codegen/sdk.js +1 -1
  51. package/lib/commands/codegen/sql.js +1 -1
  52. package/lib/commands/common/app-registry.js +1 -1
  53. package/lib/commands/common/app-selector.js +1 -1
  54. package/lib/commands/common/async-task.js +1 -1
  55. package/lib/commands/common/dry-run.js +1 -1
  56. package/lib/commands/common/flags.js +1 -1
  57. package/lib/commands/common/local-file.js +1 -1
  58. package/lib/commands/common/validate.js +1 -1
  59. package/lib/commands/config/delete.js +1 -1
  60. package/lib/commands/config/get.js +1 -1
  61. package/lib/commands/config/index.js +1 -1
  62. package/lib/commands/config/init.js +1 -1
  63. package/lib/commands/config/list.js +1 -1
  64. package/lib/commands/config/set.js +1 -1
  65. package/lib/commands/config/shared.js +1 -1
  66. package/lib/commands/dataset/batch-design.js +1 -1
  67. package/lib/commands/dataset/business-group-update.js +1 -1
  68. package/lib/commands/dataset/business-groups.js +1 -1
  69. package/lib/commands/dataset/capability.js +1 -1
  70. package/lib/commands/dataset/cross-relation-create.js +1 -1
  71. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  72. package/lib/commands/dataset/cross-relation-list.js +1 -1
  73. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  74. package/lib/commands/dataset/cross-relation-update.js +1 -1
  75. package/lib/commands/dataset/delete.js +1 -1
  76. package/lib/commands/dataset/design-context.js +1 -1
  77. package/lib/commands/dataset/design-start.js +1 -1
  78. package/lib/commands/dataset/design-status.js +1 -1
  79. package/lib/commands/dataset/design-sync-retry.js +1 -1
  80. package/lib/commands/dataset/design-sync-status.js +1 -1
  81. package/lib/commands/dataset/design-validate.js +1 -1
  82. package/lib/commands/dataset/detail.js +1 -1
  83. package/lib/commands/dataset/extend-update.js +1 -1
  84. package/lib/commands/dataset/field-restore.js +1 -1
  85. package/lib/commands/dataset/field-update.js +1 -1
  86. package/lib/commands/dataset/generate.js +1 -1
  87. package/lib/commands/dataset/index.js +1 -1
  88. package/lib/commands/dataset/list.js +1 -1
  89. package/lib/commands/dataset/operations.js +1 -1
  90. package/lib/commands/dataset/relation-audit.js +1 -1
  91. package/lib/commands/dataset/relation-create.js +1 -1
  92. package/lib/commands/dataset/relation-delete.js +1 -1
  93. package/lib/commands/dataset/relation-shared.js +1 -1
  94. package/lib/commands/dataset/relation-update.js +1 -1
  95. package/lib/commands/dataset/relations.js +1 -1
  96. package/lib/commands/dataset/rename.js +1 -1
  97. package/lib/commands/dataset/restore.js +1 -1
  98. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  99. package/lib/commands/db/analysis-batching.js +1 -1
  100. package/lib/commands/db/analyze-batch-plan.js +1 -1
  101. package/lib/commands/db/analyze-cancel.js +1 -1
  102. package/lib/commands/db/analyze-start.js +1 -1
  103. package/lib/commands/db/analyze-status.js +1 -1
  104. package/lib/commands/db/create.js +1 -1
  105. package/lib/commands/db/cross-db-analysis-shared.js +1 -1
  106. package/lib/commands/db/cross-db-analyze-latest.js +1 -1
  107. package/lib/commands/db/cross-db-analyze-start.js +1 -1
  108. package/lib/commands/db/cross-db-analyze-status.js +1 -1
  109. package/lib/commands/db/delete.js +1 -1
  110. package/lib/commands/db/detail.js +1 -1
  111. package/lib/commands/db/diff-refresh-start.js +1 -1
  112. package/lib/commands/db/diff-refresh-status.js +1 -1
  113. package/lib/commands/db/diff.js +1 -1
  114. package/lib/commands/db/index.js +1 -1
  115. package/lib/commands/db/list.js +1 -1
  116. package/lib/commands/db/shared.js +1 -1
  117. package/lib/commands/db/table-diff-shared.js +1 -1
  118. package/lib/commands/db/tables.js +1 -1
  119. package/lib/commands/db/test.js +1 -1
  120. package/lib/commands/db/update.js +1 -1
  121. package/lib/commands/deployment/index.js +1 -1
  122. package/lib/commands/deployment/sync-all.js +1 -1
  123. package/lib/commands/deployment/sync-jobs.js +1 -1
  124. package/lib/commands/deployment/sync-status.js +1 -1
  125. package/lib/commands/doctor.js +1 -1
  126. package/lib/commands/file/index.js +1 -1
  127. package/lib/commands/flow/create.js +1 -1
  128. package/lib/commands/flow/detail.js +1 -1
  129. package/lib/commands/flow/index.js +1 -1
  130. package/lib/commands/flow/list.js +1 -1
  131. package/lib/commands/flow/page-list.js +1 -1
  132. package/lib/commands/flow/publish.js +1 -1
  133. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  134. package/lib/commands/flow/runtime-role-list.js +1 -1
  135. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  136. package/lib/commands/flow/runtime-user-search.js +1 -1
  137. package/lib/commands/flow/shared.js +1 -1
  138. package/lib/commands/flow/update.js +1 -1
  139. package/lib/commands/flow/validate.js +1 -1
  140. package/lib/commands/instant-api-policy/current.js +1 -1
  141. package/lib/commands/instant-api-policy/index.js +1 -1
  142. package/lib/commands/instant-api-policy/init.js +1 -1
  143. package/lib/commands/instant-api-policy/publish.js +1 -1
  144. package/lib/commands/instant-api-policy/pull.js +1 -1
  145. package/lib/commands/instant-api-policy/revision.js +1 -1
  146. package/lib/commands/instant-api-policy/revisions.js +1 -1
  147. package/lib/commands/instant-api-policy/rollback.js +1 -1
  148. package/lib/commands/instant-api-policy/shared.js +1 -1
  149. package/lib/commands/instant-api-policy/validate.js +1 -1
  150. package/lib/commands/issue/context.js +1 -1
  151. package/lib/commands/issue/index.js +1 -1
  152. package/lib/commands/issue/nudge.js +1 -1
  153. package/lib/commands/issue/report.js +1 -1
  154. package/lib/commands/kb/create.js +1 -1
  155. package/lib/commands/kb/delete.js +1 -1
  156. package/lib/commands/kb/detail.js +1 -1
  157. package/lib/commands/kb/index.js +1 -1
  158. package/lib/commands/kb/list.js +1 -1
  159. package/lib/commands/kb/search.js +1 -1
  160. package/lib/commands/kb/shared.js +1 -1
  161. package/lib/commands/kb/update.js +1 -1
  162. package/lib/commands/logs/index.js +1 -1
  163. package/lib/commands/menu/asset-update.js +1 -1
  164. package/lib/commands/menu/delete.js +1 -1
  165. package/lib/commands/menu/external-link-create.js +1 -1
  166. package/lib/commands/menu/external-link-update.js +1 -1
  167. package/lib/commands/menu/group-create.js +1 -1
  168. package/lib/commands/menu/group-update.js +1 -1
  169. package/lib/commands/menu/index.js +1 -1
  170. package/lib/commands/menu/list.js +1 -1
  171. package/lib/commands/menu/move.js +1 -1
  172. package/lib/commands/menu/regroup-start.js +1 -1
  173. package/lib/commands/menu/rename.js +1 -1
  174. package/lib/commands/menu/shared/compare-table.js +1 -1
  175. package/lib/commands/menu/shared/delete-plan.js +1 -1
  176. package/lib/commands/menu/shared/facts.js +1 -1
  177. package/lib/commands/menu/shared/index.js +1 -1
  178. package/lib/commands/menu/shared/inquirer.js +1 -1
  179. package/lib/commands/menu/shared/local-pages.js +1 -1
  180. package/lib/commands/menu/shared/logic.js +1 -1
  181. package/lib/commands/menu/shared/mutations.js +1 -1
  182. package/lib/commands/menu/shared/path.js +1 -1
  183. package/lib/commands/menu/shared/service.js +1 -1
  184. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  185. package/lib/commands/menu/shared/sync-core.js +1 -1
  186. package/lib/commands/menu/shared/update-core.js +1 -1
  187. package/lib/commands/menu/shared/valid-url.js +1 -1
  188. package/lib/commands/menu/subapp-assets-status.js +1 -1
  189. package/lib/commands/menu/subapp-assets-update.js +1 -1
  190. package/lib/commands/menu/sync.js +1 -1
  191. package/lib/commands/menu/visibility-update.js +1 -1
  192. package/lib/commands/notification/config-create.js +1 -1
  193. package/lib/commands/notification/config-delete.js +1 -1
  194. package/lib/commands/notification/config-list.js +1 -1
  195. package/lib/commands/notification/config-update.js +1 -1
  196. package/lib/commands/notification/index.js +1 -1
  197. package/lib/commands/notification/shared.js +1 -1
  198. package/lib/commands/ocr/index.js +1 -1
  199. package/lib/commands/page/create.js +1 -1
  200. package/lib/commands/page/custom/detail.js +1 -1
  201. package/lib/commands/page/custom/list.js +1 -1
  202. package/lib/commands/page/custom/publish.js +1 -1
  203. package/lib/commands/page/custom/shared.js +1 -1
  204. package/lib/commands/page/custom/syntax.js +1 -1
  205. package/lib/commands/page/custom/update.js +1 -1
  206. package/lib/commands/page/data-list-status.js +1 -1
  207. package/lib/commands/page/generate-start.js +1 -1
  208. package/lib/commands/page/generate-status.js +1 -1
  209. package/lib/commands/page/index.js +1 -1
  210. package/lib/commands/page/pull.js +1 -1
  211. package/lib/commands/page/push.js +1 -1
  212. package/lib/commands/page/relation-audit.js +1 -1
  213. package/lib/commands/page/restore.js +1 -1
  214. package/lib/commands/page/shared.js +1 -1
  215. package/lib/commands/page/sync.js +1 -1
  216. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  217. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  218. package/lib/commands/project/create/format-elapsed.js +1 -1
  219. package/lib/commands/project/create/main.js +1 -1
  220. package/lib/commands/project/create/materialize-project-template.js +1 -1
  221. package/lib/commands/project/create/project-name.js +1 -1
  222. package/lib/commands/project/create/project-template-archive.js +1 -1
  223. package/lib/commands/project/create/project-template-path.js +1 -1
  224. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  225. package/lib/commands/project/create/use-format-code.js +1 -1
  226. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  227. package/lib/commands/project/domain-routing-sync.js +1 -1
  228. package/lib/commands/project/index.js +1 -1
  229. package/lib/commands/project/upgrade.js +1 -1
  230. package/lib/commands/registry.js +1 -1
  231. package/lib/commands/role/delete.js +1 -1
  232. package/lib/commands/role/detail.js +1 -1
  233. package/lib/commands/role/index.js +1 -1
  234. package/lib/commands/role/list.js +1 -1
  235. package/lib/commands/role/shared.js +1 -1
  236. package/lib/commands/role/update.js +1 -1
  237. package/lib/commands/role/user-add.js +1 -1
  238. package/lib/commands/role/user-remove.js +1 -1
  239. package/lib/commands/role/user-resolve.js +1 -1
  240. package/lib/commands/rule/get.js +1 -1
  241. package/lib/commands/rule/index.js +1 -1
  242. package/lib/commands/rule/list.js +1 -1
  243. package/lib/commands/rule/set.js +1 -1
  244. package/lib/commands/rule/shared.js +1 -1
  245. package/lib/commands/run/index.js +1 -1
  246. package/lib/commands/schema.js +1 -1
  247. package/lib/commands/sql/create.js +1 -1
  248. package/lib/commands/sql/delete.js +1 -1
  249. package/lib/commands/sql/detail.js +1 -1
  250. package/lib/commands/sql/exec.js +1 -1
  251. package/lib/commands/sql/index.js +1 -1
  252. package/lib/commands/sql/list.js +1 -1
  253. package/lib/commands/sql/pull.js +1 -1
  254. package/lib/commands/sql/push.js +1 -1
  255. package/lib/commands/sql/shared.js +1 -1
  256. package/lib/commands/sql/status.js +1 -1
  257. package/lib/commands/sql/validate.js +1 -1
  258. package/lib/commands/task/index.js +1 -1
  259. package/lib/commands/task/status.js +1 -1
  260. package/lib/commands/tenant/index.js +1 -1
  261. package/lib/commands/tenant/members-list.js +1 -1
  262. package/lib/commands/tenant/shared.js +1 -1
  263. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  264. package/lib/commands/user-account/feishu-bind.js +1 -1
  265. package/lib/commands/user-account/index.js +1 -1
  266. package/lib/commands/workspace/add.js +1 -1
  267. package/lib/commands/workspace/index.js +1 -1
  268. package/lib/commands/workspace/remove.js +1 -1
  269. package/lib/config/domain-config.js +1 -1
  270. package/lib/config/project-domain-routing.js +1 -1
  271. package/lib/config/region-config.js +1 -1
  272. package/lib/config/schema.js +1 -1
  273. package/lib/constant/cdn.js +1 -1
  274. package/lib/constant/cli.js +1 -1
  275. package/lib/constant/defaults.js +1 -1
  276. package/lib/constant/domain.js +1 -1
  277. package/lib/constant/env.js +1 -1
  278. package/lib/constant/output.js +1 -1
  279. package/lib/constant/paths.js +1 -1
  280. package/lib/constant/region.js +1 -1
  281. package/lib/constant/risk.js +1 -1
  282. package/lib/constant/routing-profile.js +1 -1
  283. package/lib/context/app-resolver.js +1 -1
  284. package/lib/context/auth-resolver.js +1 -1
  285. package/lib/context/config-loader.js +1 -1
  286. package/lib/context.js +1 -1
  287. package/lib/core/alias-resolver.js +1 -1
  288. package/lib/core/api-client.js +1 -1
  289. package/lib/core/bff/config.js +1 -1
  290. package/lib/core/bff/file-system.js +1 -1
  291. package/lib/core/bff/hash.js +1 -1
  292. package/lib/core/bff/hook-directory.js +1 -1
  293. package/lib/core/bff/lock.js +1 -1
  294. package/lib/core/bff/utils.js +1 -1
  295. package/lib/core/cross-db-analysis.js +1 -1
  296. package/lib/core/cross-db-relation.js +1 -1
  297. package/lib/core/db-resolver.js +1 -1
  298. package/lib/core/flow-config.js +1 -1
  299. package/lib/core/instant-api-policy/config.js +1 -1
  300. package/lib/core/instant-api-policy/endpoints.js +1 -1
  301. package/lib/core/kb-management-client.js +1 -1
  302. package/lib/core/kb-search-client.js +1 -1
  303. package/lib/core/page/file-system.js +1 -1
  304. package/lib/core/page/hash.js +1 -1
  305. package/lib/core/page/lock.js +1 -1
  306. package/lib/core/page/lr-smart-jsx.js +1 -1
  307. package/lib/core/sql-index-auditor.js +1 -1
  308. package/lib/core/sql-sync/config.js +1 -1
  309. package/lib/core/sql-sync/file-system.js +1 -1
  310. package/lib/core/sql-sync/hash.js +1 -1
  311. package/lib/core/sql-sync/lock.js +1 -1
  312. package/lib/core/sql-sync/utils.js +1 -1
  313. package/lib/core/sql-validator.js +1 -1
  314. package/lib/errors.js +1 -1
  315. package/lib/framework/build-all-flags.js +1 -1
  316. package/lib/framework/error-output.js +1 -1
  317. package/lib/framework/explicit-yes.js +1 -1
  318. package/lib/framework/flags.js +1 -1
  319. package/lib/framework/help.js +1 -1
  320. package/lib/framework/index.js +1 -1
  321. package/lib/framework/output.js +1 -1
  322. package/lib/framework/response.js +1 -1
  323. package/lib/framework/runner-alias.js +1 -1
  324. package/lib/framework/runner.js +1 -1
  325. package/lib/framework/schema-export.js +1 -1
  326. package/lib/framework/supported-flags.js +1 -1
  327. package/lib/framework/types.js +1 -1
  328. package/lib/generated/build-info.d.ts +4 -4
  329. package/lib/generated/build-info.js +1 -1
  330. package/lib/generated/official-routing.js +1 -1
  331. package/lib/generated/routing-contract.js +1 -1
  332. package/lib/help.js +1 -1
  333. package/lib/postinstall.js +1 -1
  334. package/lib/runtime/confirmation.js +1 -1
  335. package/lib/runtime/event.js +1 -1
  336. package/lib/runtime/index.js +1 -1
  337. package/lib/runtime/queue.js +1 -1
  338. package/lib/runtime/resolve.js +1 -1
  339. package/lib/services/dataset-design/checkpoint.js +1 -1
  340. package/lib/services/dataset-design/commands.js +1 -1
  341. package/lib/services/dataset-design/contract.js +1 -1
  342. package/lib/skills/builtin-skill.js +1 -1
  343. package/lib/skills/main.js +1 -1
  344. package/lib/skills/npx-skills-add.js +1 -1
  345. package/lib/skills/skill-presence.js +1 -1
  346. package/lib/telemetry/cli-command-trace.js +1 -1
  347. package/lib/telemetry/cli-help-trace.js +1 -1
  348. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  349. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  350. package/lib/telemetry/send-cli-trace-log.js +1 -1
  351. package/lib/utils/ai_config.js +1 -1
  352. package/lib/utils/apply-jq-filter.js +1 -1
  353. package/lib/utils/cdn-config.js +1 -1
  354. package/lib/utils/check-sdk-version.js +1 -1
  355. package/lib/utils/cli-version-check.js +1 -1
  356. package/lib/utils/cli-version-policy.js +1 -1
  357. package/lib/utils/config.js +1 -1
  358. package/lib/utils/entity-with-id.js +1 -1
  359. package/lib/utils/file-utils.js +1 -1
  360. package/lib/utils/guides-cdn.js +1 -1
  361. package/lib/utils/http-client.js +1 -1
  362. package/lib/utils/is-non-interactive.js +1 -1
  363. package/lib/utils/logger.js +1 -1
  364. package/lib/utils/params.js +1 -1
  365. package/lib/utils/platform.js +1 -1
  366. package/lib/utils/sleep.js +1 -1
  367. package/lib/utils/template-replacer.js +1 -1
  368. package/lib/utils/update-notice.js +1 -1
  369. package/lib/utils/version.js +1 -1
  370. package/lib/utils/with-active-cookie.js +1 -1
  371. package/lib/utils/write-cli-side-channel.js +1 -1
  372. package/package.json +1 -1
  373. package/skills/rabetbase/SKILL.md +1 -1
  374. package/skills/rabetbase-dataset-generation/SKILL.md +1 -1
  375. package/skills/rabetbase-page-generation/SKILL.md +1 -1
  376. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a34_0x3ac0d7=a34_0x2f44;(function(_0x355b0c,_0x3511b7){const _0x4269bc=a34_0x2f44,_0x4de600=_0x355b0c();while(!![]){try{const _0x24aa73=parseInt(_0x4269bc(0x1fd))/0x1+parseInt(_0x4269bc(0x1ef))/0x2+parseInt(_0x4269bc(0x1e2))/0x3+-parseInt(_0x4269bc(0x1f3))/0x4*(parseInt(_0x4269bc(0x1ee))/0x5)+-parseInt(_0x4269bc(0x1e7))/0x6*(-parseInt(_0x4269bc(0x1e3))/0x7)+-parseInt(_0x4269bc(0x1eb))/0x8+parseInt(_0x4269bc(0x1e4))/0x9*(-parseInt(_0x4269bc(0x1ed))/0xa);if(_0x24aa73===_0x3511b7)break;else _0x4de600['push'](_0x4de600['shift']());}catch(_0x586d00){_0x4de600['push'](_0x4de600['shift']());}}}(a34_0x19c1,0x4205e));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a34_0x19c1(){const _0x514084=['Read\x20config\x20value\x20from\x20file','set','tags','1266592xZLIyX','isFinite','39720zHLyWf','1994885awpGUs','816942TMZrYn','apiError','appCode','number','4iLENbk','write','app-config','/smartapi/app-config/create','get','\x20app\x20config\x20','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','Updated','update','string','41465VjSjyR','1116261NhYsqH','154FvxToY','9RryuNE','create','POST','2640tBtXdW'];a34_0x19c1=function(){return _0x514084;};return a34_0x19c1();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a34_0x3ac0d7(0x1f6),UPDATE_PATH='/smartapi/app-config/update';function a34_0x2f44(_0x35ccad,_0x582f44){_0x35ccad=_0x35ccad-0x1e2;const _0x19c1b6=a34_0x19c1();let _0x2f4475=_0x19c1b6[_0x35ccad];return _0x2f4475;}export const appConfigSet={'service':a34_0x3ac0d7(0x1f5),'command':a34_0x3ac0d7(0x1e9),'description':a34_0x3ac0d7(0x1f9),'risk':a34_0x3ac0d7(0x1f4),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':'file','type':a34_0x3ac0d7(0x1fc),'description':a34_0x3ac0d7(0x1e8)}],async 'validate'(_0x2e2142){readKeyArg(_0x2e2142),readOptionalTags(_0x2e2142),assertSingleValueSource(_0x2e2142);},async 'dryRun'(_0x2f122d){const _0x59ea49=a34_0x3ac0d7,_0x52b9c4=readKeyArg(_0x2f122d),_0x20841b=readOptionalTags(_0x2f122d),_0x3456bc=assertSingleValueSource(_0x2f122d);await assertValueSourceReadable(_0x3456bc);const _0x4683ac=await withAppConfigApiBoundary(_0x59ea49(0x1f7),{'appCode':_0x2f122d[_0x59ea49(0x1f1)],'key':_0x52b9c4},()=>getAppConfigByKey(_0x2f122d[_0x59ea49(0x1f1)],_0x52b9c4)),_0x42224f=_0x4683ac?_0x59ea49(0x1fb):_0x59ea49(0x1e5),_0x7a982b=_0x4683ac?projectAppConfig(_0x4683ac):null,_0x29d96c=plannedAppConfig({'appCode':_0x2f122d[_0x59ea49(0x1f1)],'key':_0x52b9c4,'tags':_0x20841b??_0x4683ac?.[_0x59ea49(0x1ea)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x42224f,'appCode':_0x2f122d['appCode'],'key':_0x52b9c4,'before':_0x7a982b,'after':_0x29d96c,'dryRun':!![]}),{'method':_0x59ea49(0x1e6),'url':_0x42224f===_0x59ea49(0x1fb)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x2885b9){const _0x5f138e=a34_0x3ac0d7,_0x163ea8=readKeyArg(_0x2885b9),_0x1b4e68=readOptionalTags(_0x2885b9),_0x1c73cf=await withAppConfigApiBoundary(_0x5f138e(0x1f7),{'appCode':_0x2885b9[_0x5f138e(0x1f1)],'key':_0x163ea8},()=>getAppConfigByKey(_0x2885b9[_0x5f138e(0x1f1)],_0x163ea8)),_0x5ad589=_0x1c73cf?projectAppConfig(_0x1c73cf):null,_0x537db7=_0x1c73cf?_0x5f138e(0x1fb):_0x5f138e(0x1e5),{value:_0x2dfc28,warnings:_0x130d8f}=await readAppConfigValue(_0x2885b9),_0x374896={'appCode':_0x2885b9[_0x5f138e(0x1f1)],'key':_0x163ea8,'value':_0x2dfc28,'tags':_0x1b4e68??_0x1c73cf?.[_0x5f138e(0x1ea)]??undefined};await withAppConfigApiBoundary(_0x537db7,{'appCode':_0x2885b9['appCode'],'key':_0x163ea8},async()=>{const _0x2cac26=_0x5f138e;_0x1c73cf?await updateAppConfig({..._0x374896,'id':requireAppConfigId(_0x1c73cf,_0x163ea8,_0x2885b9[_0x2cac26(0x1f1)])}):await createAppConfig(_0x374896);});const _0x4e6c95=await withAppConfigApiBoundary(_0x5f138e(0x1f7),{'appCode':_0x2885b9[_0x5f138e(0x1f1)],'key':_0x163ea8},()=>getAppConfigByKey(_0x2885b9[_0x5f138e(0x1f1)],_0x163ea8)),_0x514085=_0x4e6c95?projectAppConfig(_0x4e6c95):plannedAppConfig({'appCode':_0x2885b9[_0x5f138e(0x1f1)],'key':_0x163ea8,'tags':_0x374896[_0x5f138e(0x1ea)],'hasValue':_0x2dfc28!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x537db7,'appCode':_0x2885b9[_0x5f138e(0x1f1)],'key':_0x163ea8,'before':_0x5ad589,'after':_0x514085,'dryRun':![],'warnings':_0x130d8f}),'message':(_0x537db7==='update'?_0x5f138e(0x1fa):'Created')+_0x5f138e(0x1f8)+_0x163ea8};}};function requireAppConfigId(_0x1912b1,_0x38e8cc,_0x6a6c76){const _0x332b71=a34_0x3ac0d7;if(typeof _0x1912b1['id']===_0x332b71(0x1f2)&&Number[_0x332b71(0x1ec)](_0x1912b1['id'])&&_0x1912b1['id']>0x0)return _0x1912b1['id'];throw CliErrors[_0x332b71(0x1f0)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x38e8cc+',\x20appCode='+_0x6a6c76);}
1
+ function a34_0x41ec(_0x5812bb,_0x285f67){_0x5812bb=_0x5812bb-0x149;const _0x32bc39=a34_0x32bc();let _0x41ec63=_0x32bc39[_0x5812bb];return _0x41ec63;}const a34_0x45afe7=a34_0x41ec;(function(_0x4279f4,_0x447c6f){const _0x1bf120=a34_0x41ec,_0x29bf05=_0x4279f4();while(!![]){try{const _0x2e745d=-parseInt(_0x1bf120(0x14e))/0x1+parseInt(_0x1bf120(0x15e))/0x2+parseInt(_0x1bf120(0x157))/0x3*(-parseInt(_0x1bf120(0x160))/0x4)+parseInt(_0x1bf120(0x165))/0x5*(-parseInt(_0x1bf120(0x15d))/0x6)+-parseInt(_0x1bf120(0x154))/0x7*(-parseInt(_0x1bf120(0x15a))/0x8)+-parseInt(_0x1bf120(0x156))/0x9*(-parseInt(_0x1bf120(0x163))/0xa)+-parseInt(_0x1bf120(0x14b))/0xb;if(_0x2e745d===_0x447c6f)break;else _0x29bf05['push'](_0x29bf05['shift']());}catch(_0x18d27c){_0x29bf05['push'](_0x29bf05['shift']());}}}(a34_0x32bc,0x52575));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH='/smartapi/app-config/create',UPDATE_PATH=a34_0x45afe7(0x159);export const appConfigSet={'service':a34_0x45afe7(0x162),'command':a34_0x45afe7(0x14d),'description':a34_0x45afe7(0x15f),'risk':'write','args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x45afe7(0x155),'type':'string','description':a34_0x45afe7(0x158)}],async 'validate'(_0x37b375){readKeyArg(_0x37b375),readOptionalTags(_0x37b375),assertSingleValueSource(_0x37b375);},async 'dryRun'(_0x1b9220){const _0x32ca80=a34_0x45afe7,_0x145d76=readKeyArg(_0x1b9220),_0x2f856f=readOptionalTags(_0x1b9220),_0x47e738=assertSingleValueSource(_0x1b9220);await assertValueSourceReadable(_0x47e738);const _0x3d8594=await withAppConfigApiBoundary(_0x32ca80(0x150),{'appCode':_0x1b9220['appCode'],'key':_0x145d76},()=>getAppConfigByKey(_0x1b9220[_0x32ca80(0x152)],_0x145d76)),_0x212151=_0x3d8594?_0x32ca80(0x151):_0x32ca80(0x14f),_0x1f7a40=_0x3d8594?projectAppConfig(_0x3d8594):null,_0x5b935b=plannedAppConfig({'appCode':_0x1b9220['appCode'],'key':_0x145d76,'tags':_0x2f856f??_0x3d8594?.[_0x32ca80(0x166)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x212151,'appCode':_0x1b9220['appCode'],'key':_0x145d76,'before':_0x1f7a40,'after':_0x5b935b,'dryRun':!![]}),{'method':_0x32ca80(0x153),'url':_0x212151===_0x32ca80(0x151)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x4cfdf6){const _0x13607b=a34_0x45afe7,_0x126f1d=readKeyArg(_0x4cfdf6),_0x5e3f1d=readOptionalTags(_0x4cfdf6),_0x437362=await withAppConfigApiBoundary(_0x13607b(0x150),{'appCode':_0x4cfdf6[_0x13607b(0x152)],'key':_0x126f1d},()=>getAppConfigByKey(_0x4cfdf6[_0x13607b(0x152)],_0x126f1d)),_0x1f3464=_0x437362?projectAppConfig(_0x437362):null,_0x4ad129=_0x437362?_0x13607b(0x151):_0x13607b(0x14f),{value:_0x186fa2,warnings:_0x3b7d86}=await readAppConfigValue(_0x4cfdf6),_0x2e9518={'appCode':_0x4cfdf6['appCode'],'key':_0x126f1d,'value':_0x186fa2,'tags':_0x5e3f1d??_0x437362?.[_0x13607b(0x166)]??undefined};await withAppConfigApiBoundary(_0x4ad129,{'appCode':_0x4cfdf6[_0x13607b(0x152)],'key':_0x126f1d},async()=>{const _0x44abb0=_0x13607b;_0x437362?await updateAppConfig({..._0x2e9518,'id':requireAppConfigId(_0x437362,_0x126f1d,_0x4cfdf6[_0x44abb0(0x152)])}):await createAppConfig(_0x2e9518);});const _0x1a7882=await withAppConfigApiBoundary('get',{'appCode':_0x4cfdf6[_0x13607b(0x152)],'key':_0x126f1d},()=>getAppConfigByKey(_0x4cfdf6[_0x13607b(0x152)],_0x126f1d)),_0x1d2c5a=_0x1a7882?projectAppConfig(_0x1a7882):plannedAppConfig({'appCode':_0x4cfdf6[_0x13607b(0x152)],'key':_0x126f1d,'tags':_0x2e9518[_0x13607b(0x166)],'hasValue':_0x186fa2!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x4ad129,'appCode':_0x4cfdf6[_0x13607b(0x152)],'key':_0x126f1d,'before':_0x1f3464,'after':_0x1d2c5a,'dryRun':![],'warnings':_0x3b7d86}),'message':(_0x4ad129===_0x13607b(0x151)?_0x13607b(0x164):_0x13607b(0x149))+'\x20app\x20config\x20'+_0x126f1d};}};function requireAppConfigId(_0x332ce2,_0x4fd1b5,_0x1dcaf8){const _0x5bbcc4=a34_0x45afe7;if(typeof _0x332ce2['id']===_0x5bbcc4(0x14a)&&Number[_0x5bbcc4(0x14c)](_0x332ce2['id'])&&_0x332ce2['id']>0x0)return _0x332ce2['id'];throw CliErrors[_0x5bbcc4(0x161)](_0x5bbcc4(0x15b)+_0x4fd1b5+_0x5bbcc4(0x15c)+_0x1dcaf8);}function a34_0x32bc(){const _0xa3a41=['506194dZyJkN','create','get','update','appCode','POST','7qDybFJ','file','12996chHYsU','6195TdIXvk','Read\x20config\x20value\x20from\x20file','/smartapi/app-config/update','5233368rbnXsz','App\x20config\x20server\x20id\x20missing\x20for\x20key=',',\x20appCode=','654UvoegT','603308utJZZm','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','124cxXJvw','apiError','app-config','3830cVkUia','Updated','26820okJBCC','tags','Created','number','183953xhGZes','isFinite','set'];a34_0x32bc=function(){return _0xa3a41;};return a34_0x32bc();}
@@ -1 +1 @@
1
- const a35_0x1647bf=a35_0x1117;(function(_0x30dcb3,_0x42123b){const _0x1f23b2=a35_0x1117,_0x53fba6=_0x30dcb3();while(!![]){try{const _0x5631e3=-parseInt(_0x1f23b2(0xa5))/0x1+parseInt(_0x1f23b2(0x9f))/0x2*(parseInt(_0x1f23b2(0xd5))/0x3)+parseInt(_0x1f23b2(0xd7))/0x4*(-parseInt(_0x1f23b2(0xb3))/0x5)+-parseInt(_0x1f23b2(0xc7))/0x6+-parseInt(_0x1f23b2(0xc6))/0x7*(-parseInt(_0x1f23b2(0xb1))/0x8)+-parseInt(_0x1f23b2(0xb8))/0x9*(-parseInt(_0x1f23b2(0xa4))/0xa)+parseInt(_0x1f23b2(0x9e))/0xb*(parseInt(_0x1f23b2(0xc5))/0xc);if(_0x5631e3===_0x42123b)break;else _0x53fba6['push'](_0x53fba6['shift']());}catch(_0x24d2da){_0x53fba6['push'](_0x53fba6['shift']());}}}(a35_0x240c,0x4b3b2));function a35_0x1117(_0x1319f0,_0x595a91){_0x1319f0=_0x1319f0-0x97;const _0x240c8f=a35_0x240c();let _0x11175a=_0x240c8f[_0x1319f0];return _0x11175a;}function a35_0x240c(){const _0x44c4db=['2532cFubjO','kind','bool','reveal','key:\x20','setEncoding','warnings','Read\x20config\x20value\x20from\x20stdin','join','name','1205809QjHUnI','9914hopRdW','validation','data','trim','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','12610PaOKft','570068wfeNTf','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','operation','once','from-env','\x20app\x20config.','value','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','argument','push','appCode','Missing\x20app-config\x20key.','56LGvFPd','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','755dHLWRG','gmtModified','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','tags','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','468EcMKYg','url','env','stdin','defineProperties','str','hasValue','path','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','App\x20config\x20value\x20source\x20is\x20ambiguous.','dryRun','before','Failed\x20to\x20','36BZmTkn','554687pBJODZ','1368756ZZAtPb','valueRedacted','end','error','string','Environment\x20variable\x20is\x20not\x20set:\x20','args','Value\x20file\x20is\x20not\x20readable:\x20','boolean','file','key','length','utf8','slice','153EATmyO','Runtime\x20app-config\x20key'];a35_0x240c=function(){return _0x44c4db;};return a35_0x240c();}import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x1647bf(0xd1),'description':a35_0x1647bf(0xd6),'required':!![]};export const VALUE_ARG={'name':a35_0x1647bf(0xab),'description':a35_0x1647bf(0xa6),'required':![]};export const TAGS_FLAG={'name':a35_0x1647bf(0xb6),'type':a35_0x1647bf(0xcb),'description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a35_0x1647bf(0xbb),'type':a35_0x1647bf(0xcf),'description':a35_0x1647bf(0x9b),'default':![]};export const FROM_ENV_FLAG={'name':a35_0x1647bf(0xa9),'type':'string','description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':'reveal','type':a35_0x1647bf(0xcf),'description':a35_0x1647bf(0xb2),'default':![]};export function readKeyArg(_0x4f2f25){const _0x18fab9=a35_0x1647bf,_0x45f780=_0x4f2f25[_0x18fab9(0xcd)][0x0]?.['trim']()??'';return validateKey(_0x45f780),_0x45f780;}export function readOptionalTags(_0x51d0a3){const _0x4bdbc8=a35_0x1647bf,_0x874891=_0x51d0a3[_0x4bdbc8(0xbd)]('tags')['trim']();if(!_0x874891)return undefined;if(_0x874891['length']>0x20)throw CliErrors[_0x4bdbc8(0xa0)](_0x4bdbc8(0xac));return _0x874891;}export function validateKey(_0x1a72e9){const _0x41f015=a35_0x1647bf;if(!_0x1a72e9)throw CliErrors['validation'](_0x41f015(0xb0));if(_0x1a72e9[_0x41f015(0xd2)]>0x100)throw CliErrors[_0x41f015(0xa0)](_0x41f015(0xa3));}export function projectAppConfig(_0x5afb02,_0x188829){const _0x371c00=a35_0x1647bf,_0x206274=_0x5afb02[_0x371c00(0xab)]!==undefined&&_0x5afb02[_0x371c00(0xab)]!==null&&_0x5afb02[_0x371c00(0xab)]!=='',_0x36b5d0={'appCode':_0x5afb02[_0x371c00(0xaf)],'key':_0x5afb02[_0x371c00(0xd1)],'tags':_0x5afb02[_0x371c00(0xb6)]??undefined,'hasValue':_0x206274,'valueRedacted':_0x206274&&!_0x188829?.[_0x371c00(0x97)],'gmtCreate':_0x5afb02['gmtCreate'],'gmtModified':_0x5afb02[_0x371c00(0xb4)]};return _0x188829?.['reveal']&&(_0x36b5d0['value']=_0x5afb02['value']??'',_0x36b5d0[_0x371c00(0xc8)]=![]),_0x36b5d0;}export function plannedAppConfig(_0x29f041){const _0x49856a=a35_0x1647bf,_0x4be71b=_0x29f041[_0x49856a(0xbe)]??!![];return{'appCode':_0x29f041[_0x49856a(0xaf)],'key':_0x29f041['key'],'tags':_0x29f041[_0x49856a(0xb6)]??undefined,'hasValue':_0x4be71b,'valueRedacted':_0x4be71b};}export function buildMutationData(_0x254e53){const _0x446882=a35_0x1647bf;return{'operation':_0x254e53[_0x446882(0xa7)],'selector':{'appCode':_0x254e53['appCode'],'key':_0x254e53[_0x446882(0xd1)]},'before':_0x254e53[_0x446882(0xc3)],'after':_0x254e53['after'],'dryRun':_0x254e53[_0x446882(0xc2)],'warnings':_0x254e53[_0x446882(0x9a)]??[]};}export async function withAppConfigApiBoundary(_0x5e0513,_0x211246,_0x55eccf){const _0x48e0a9=a35_0x1647bf;try{return await _0x55eccf();}catch{const _0x429d57=['appCode:\x20'+_0x211246[_0x48e0a9(0xaf)]];if(_0x211246[_0x48e0a9(0xd1)])_0x429d57[_0x48e0a9(0xae)](_0x48e0a9(0x98)+_0x211246[_0x48e0a9(0xd1)]);_0x429d57['push']('value\x20is\x20redacted');throw CliErrors['apiError'](_0x48e0a9(0xc4)+_0x5e0513+_0x48e0a9(0xaa),_0x429d57[_0x48e0a9(0x9c)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x499575,_0x5c1c94){const _0x467bdf=a35_0x1647bf;return Object[_0x467bdf(0xbc)](_0x499575,{'method':{'value':_0x5c1c94['method'],'enumerable':![]},'url':{'value':_0x5c1c94[_0x467bdf(0xb9)],'enumerable':![]}});}export function assertSingleValueSource(_0x253960){const _0x13f595=a35_0x1647bf,_0x594dc3=[];_0x253960[_0x13f595(0xcd)]['length']>0x1&&_0x594dc3[_0x13f595(0xae)]({'kind':_0x13f595(0xad),'value':_0x253960[_0x13f595(0xcd)][_0x13f595(0xd4)](0x1)[_0x13f595(0x9c)]('\x20')});const _0x5d1386=_0x253960['flag'](_0x13f595(0xab));_0x5d1386!==undefined&&_0x5d1386!==null&&_0x594dc3[_0x13f595(0xae)]({'kind':_0x13f595(0xad),'value':String(_0x5d1386)});_0x253960[_0x13f595(0xd9)](_0x13f595(0xbb))&&_0x594dc3[_0x13f595(0xae)]({'kind':'stdin'});const _0x111e78=_0x253960[_0x13f595(0xbd)](_0x13f595(0xa9))[_0x13f595(0xa2)]();_0x111e78&&_0x594dc3[_0x13f595(0xae)]({'kind':_0x13f595(0xba),'name':_0x111e78});const _0x41bb96=_0x253960['str']('file')[_0x13f595(0xa2)]();_0x41bb96&&_0x594dc3['push']({'kind':_0x13f595(0xd0),'path':_0x41bb96});if(_0x594dc3[_0x13f595(0xd2)]===0x0)throw CliErrors[_0x13f595(0xa0)]('Missing\x20app-config\x20value\x20source.',_0x13f595(0xc0));if(_0x594dc3[_0x13f595(0xd2)]>0x1)throw CliErrors['validation'](_0x13f595(0xc1),_0x13f595(0xb5));return _0x594dc3[0x0];}export async function assertValueSourceReadable(_0x7ccce8){const _0x57548f=a35_0x1647bf;if(_0x7ccce8[_0x57548f(0xd8)]==='env'&&!(_0x7ccce8[_0x57548f(0x9d)]in process.env))throw CliErrors['validation'](_0x57548f(0xcc)+_0x7ccce8[_0x57548f(0x9d)]);if(_0x7ccce8[_0x57548f(0xd8)]===_0x57548f(0xd0))try{await access(_0x7ccce8['path']);}catch{throw CliErrors[_0x57548f(0xa0)](_0x57548f(0xce)+_0x7ccce8[_0x57548f(0xbf)]);}}export async function readAppConfigValue(_0x1b98ce){const _0x56100c=a35_0x1647bf,_0x54cb76=assertSingleValueSource(_0x1b98ce),_0x5c2c16=[];if(_0x54cb76[_0x56100c(0xd8)]==='argument')return _0x5c2c16[_0x56100c(0xae)](_0x56100c(0xb7)),{'value':_0x54cb76[_0x56100c(0xab)]??'','source':_0x54cb76[_0x56100c(0xd8)],'warnings':_0x5c2c16};if(_0x54cb76[_0x56100c(0xd8)]===_0x56100c(0xbb))return{'value':await readStdin(),'source':_0x54cb76[_0x56100c(0xd8)],'warnings':_0x5c2c16};if(_0x54cb76['kind']==='env'){if(!(_0x54cb76[_0x56100c(0x9d)]in process.env))throw CliErrors[_0x56100c(0xa0)](_0x56100c(0xcc)+_0x54cb76[_0x56100c(0x9d)]);return{'value':process.env[_0x54cb76.name]??'','source':_0x54cb76[_0x56100c(0xd8)],'warnings':_0x5c2c16};}return{'value':await readFile(_0x54cb76[_0x56100c(0xbf)],_0x56100c(0xd3)),'source':_0x54cb76[_0x56100c(0xd8)],'warnings':_0x5c2c16};}function readStdin(){return new Promise((_0x42716a,_0x5e5a81)=>{const _0x1b6784=a35_0x1117;let _0x597870='';process[_0x1b6784(0xbb)][_0x1b6784(0x99)]('utf8'),process[_0x1b6784(0xbb)]['on'](_0x1b6784(0xa1),_0x2cb430=>{_0x597870+=_0x2cb430;}),process[_0x1b6784(0xbb)][_0x1b6784(0xa8)](_0x1b6784(0xc9),()=>_0x42716a(_0x597870)),process[_0x1b6784(0xbb)][_0x1b6784(0xa8)](_0x1b6784(0xca),_0x5e5a81);});}
1
+ const a35_0x5be0ba=a35_0x55c6;function a35_0x55c6(_0x32173f,_0x4b9d2f){_0x32173f=_0x32173f-0x18d;const _0x2f7382=a35_0x2f73();let _0x55c69e=_0x2f7382[_0x32173f];return _0x55c69e;}(function(_0x2c0c7f,_0x523b66){const _0x7f7788=a35_0x55c6,_0x27d037=_0x2c0c7f();while(!![]){try{const _0x1bb0df=parseInt(_0x7f7788(0x19d))/0x1+parseInt(_0x7f7788(0x1aa))/0x2*(parseInt(_0x7f7788(0x191))/0x3)+-parseInt(_0x7f7788(0x19e))/0x4*(-parseInt(_0x7f7788(0x1a1))/0x5)+parseInt(_0x7f7788(0x192))/0x6*(parseInt(_0x7f7788(0x19b))/0x7)+parseInt(_0x7f7788(0x199))/0x8*(parseInt(_0x7f7788(0x1c7))/0x9)+-parseInt(_0x7f7788(0x1c1))/0xa+parseInt(_0x7f7788(0x196))/0xb*(-parseInt(_0x7f7788(0x1b7))/0xc);if(_0x1bb0df===_0x523b66)break;else _0x27d037['push'](_0x27d037['shift']());}catch(_0x3c8eb3){_0x27d037['push'](_0x27d037['shift']());}}}(a35_0x2f73,0xb4f57));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':a35_0x5be0ba(0x1a0),'required':!![]};export const VALUE_ARG={'name':a35_0x5be0ba(0x1a6),'description':a35_0x5be0ba(0x1ae),'required':![]};export const TAGS_FLAG={'name':a35_0x5be0ba(0x1b9),'type':'string','description':a35_0x5be0ba(0x1b4)};export const STDIN_FLAG={'name':a35_0x5be0ba(0x1a5),'type':a35_0x5be0ba(0x195),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a35_0x5be0ba(0x1cc),'type':a35_0x5be0ba(0x1cf),'description':'Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable'};export const REVEAL_FLAG={'name':a35_0x5be0ba(0x1bd),'type':a35_0x5be0ba(0x195),'description':'Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','default':![]};export function readKeyArg(_0x3a9cb6){const _0x5b0254=a35_0x5be0ba,_0x30fa93=_0x3a9cb6['args'][0x0]?.[_0x5b0254(0x1b5)]()??'';return validateKey(_0x30fa93),_0x30fa93;}export function readOptionalTags(_0x5ae2ab){const _0x3b0d13=a35_0x5be0ba,_0x316df4=_0x5ae2ab[_0x3b0d13(0x1c5)](_0x3b0d13(0x1b9))[_0x3b0d13(0x1b5)]();if(!_0x316df4)return undefined;if(_0x316df4[_0x3b0d13(0x19f)]>0x20)throw CliErrors[_0x3b0d13(0x1cb)](_0x3b0d13(0x1c0));return _0x316df4;}export function validateKey(_0x162fe9){const _0x54dc8d=a35_0x5be0ba;if(!_0x162fe9)throw CliErrors[_0x54dc8d(0x1cb)](_0x54dc8d(0x1b2));if(_0x162fe9['length']>0x100)throw CliErrors[_0x54dc8d(0x1cb)](_0x54dc8d(0x1a3));}export function projectAppConfig(_0x37fd8a,_0x5b1043){const _0x2b1027=a35_0x5be0ba,_0x25f2f3=_0x37fd8a['value']!==undefined&&_0x37fd8a[_0x2b1027(0x1a6)]!==null&&_0x37fd8a[_0x2b1027(0x1a6)]!=='',_0x1bde5a={'appCode':_0x37fd8a[_0x2b1027(0x1bf)],'key':_0x37fd8a['key'],'tags':_0x37fd8a[_0x2b1027(0x1b9)]??undefined,'hasValue':_0x25f2f3,'valueRedacted':_0x25f2f3&&!_0x5b1043?.['reveal'],'gmtCreate':_0x37fd8a[_0x2b1027(0x1bb)],'gmtModified':_0x37fd8a[_0x2b1027(0x1be)]};return _0x5b1043?.['reveal']&&(_0x1bde5a[_0x2b1027(0x1a6)]=_0x37fd8a[_0x2b1027(0x1a6)]??'',_0x1bde5a[_0x2b1027(0x1ac)]=![]),_0x1bde5a;}export function plannedAppConfig(_0x40eaab){const _0x3d15e6=a35_0x5be0ba,_0x5738cd=_0x40eaab[_0x3d15e6(0x1b0)]??!![];return{'appCode':_0x40eaab['appCode'],'key':_0x40eaab[_0x3d15e6(0x1c3)],'tags':_0x40eaab[_0x3d15e6(0x1b9)]??undefined,'hasValue':_0x5738cd,'valueRedacted':_0x5738cd};}export function buildMutationData(_0x39fe21){const _0x56e506=a35_0x5be0ba;return{'operation':_0x39fe21['operation'],'selector':{'appCode':_0x39fe21[_0x56e506(0x1bf)],'key':_0x39fe21['key']},'before':_0x39fe21[_0x56e506(0x18e)],'after':_0x39fe21[_0x56e506(0x1a2)],'dryRun':_0x39fe21[_0x56e506(0x19c)],'warnings':_0x39fe21[_0x56e506(0x1b3)]??[]};}export async function withAppConfigApiBoundary(_0x356d4a,_0x907b04,_0x75832f){const _0x1971dd=a35_0x5be0ba;try{return await _0x75832f();}catch{const _0x589e6e=[_0x1971dd(0x1a8)+_0x907b04['appCode']];if(_0x907b04[_0x1971dd(0x1c3)])_0x589e6e[_0x1971dd(0x194)](_0x1971dd(0x1a7)+_0x907b04[_0x1971dd(0x1c3)]);_0x589e6e[_0x1971dd(0x194)](_0x1971dd(0x1ba));throw CliErrors['apiError'](_0x1971dd(0x18f)+_0x356d4a+_0x1971dd(0x190),_0x589e6e[_0x1971dd(0x1cd)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x56ec84,_0x309c1c){const _0x19c7c9=a35_0x5be0ba;return Object[_0x19c7c9(0x1ad)](_0x56ec84,{'method':{'value':_0x309c1c['method'],'enumerable':![]},'url':{'value':_0x309c1c['url'],'enumerable':![]}});}export function assertSingleValueSource(_0x357581){const _0x498df3=a35_0x5be0ba,_0x3c0547=[];_0x357581[_0x498df3(0x1c4)][_0x498df3(0x19f)]>0x1&&_0x3c0547['push']({'kind':'argument','value':_0x357581['args'][_0x498df3(0x1ab)](0x1)['join']('\x20')});const _0x52baa2=_0x357581[_0x498df3(0x1c2)]('value');_0x52baa2!==undefined&&_0x52baa2!==null&&_0x3c0547[_0x498df3(0x194)]({'kind':_0x498df3(0x1c8),'value':String(_0x52baa2)});_0x357581[_0x498df3(0x1b1)](_0x498df3(0x1a5))&&_0x3c0547[_0x498df3(0x194)]({'kind':'stdin'});const _0x52bd41=_0x357581[_0x498df3(0x1c5)](_0x498df3(0x1cc))[_0x498df3(0x1b5)]();_0x52bd41&&_0x3c0547[_0x498df3(0x194)]({'kind':_0x498df3(0x1a9),'name':_0x52bd41});const _0x310f8b=_0x357581[_0x498df3(0x1c5)](_0x498df3(0x1ca))[_0x498df3(0x1b5)]();_0x310f8b&&_0x3c0547[_0x498df3(0x194)]({'kind':_0x498df3(0x1ca),'path':_0x310f8b});if(_0x3c0547[_0x498df3(0x19f)]===0x0)throw CliErrors[_0x498df3(0x1cb)](_0x498df3(0x1ce),'Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');if(_0x3c0547[_0x498df3(0x19f)]>0x1)throw CliErrors['validation']('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 _0x3c0547[0x0];}export async function assertValueSourceReadable(_0x3a2be1){const _0x32b2a3=a35_0x5be0ba;if(_0x3a2be1['kind']==='env'&&!(_0x3a2be1['name']in process.env))throw CliErrors[_0x32b2a3(0x1cb)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x3a2be1[_0x32b2a3(0x1bc)]);if(_0x3a2be1[_0x32b2a3(0x1b6)]===_0x32b2a3(0x1ca))try{await access(_0x3a2be1[_0x32b2a3(0x198)]);}catch{throw CliErrors[_0x32b2a3(0x1cb)](_0x32b2a3(0x1a4)+_0x3a2be1[_0x32b2a3(0x198)]);}}export async function readAppConfigValue(_0x2e8e29){const _0x4a76d0=a35_0x5be0ba,_0x5eae20=assertSingleValueSource(_0x2e8e29),_0x171ead=[];if(_0x5eae20[_0x4a76d0(0x1b6)]===_0x4a76d0(0x1c8))return _0x171ead[_0x4a76d0(0x194)](_0x4a76d0(0x197)),{'value':_0x5eae20[_0x4a76d0(0x1a6)]??'','source':_0x5eae20[_0x4a76d0(0x1b6)],'warnings':_0x171ead};if(_0x5eae20[_0x4a76d0(0x1b6)]===_0x4a76d0(0x1a5))return{'value':await readStdin(),'source':_0x5eae20['kind'],'warnings':_0x171ead};if(_0x5eae20['kind']===_0x4a76d0(0x1a9)){if(!(_0x5eae20[_0x4a76d0(0x1bc)]in process.env))throw CliErrors['validation'](_0x4a76d0(0x19a)+_0x5eae20[_0x4a76d0(0x1bc)]);return{'value':process.env[_0x5eae20.name]??'','source':_0x5eae20['kind'],'warnings':_0x171ead};}return{'value':await readFile(_0x5eae20[_0x4a76d0(0x198)],'utf8'),'source':_0x5eae20['kind'],'warnings':_0x171ead};}function a35_0x2f73(){const _0x2ced6f=['end','push','boolean','11cHzTPU','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','path','17768xHVqQO','Environment\x20variable\x20is\x20not\x20set:\x20','4011FdRuSm','dryRun','87006LAwpVx','2224etufNX','length','Runtime\x20app-config\x20key','865XQgRPk','after','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','Value\x20file\x20is\x20not\x20readable:\x20','stdin','value','key:\x20','appCode:\x20','env','85688bOBHlF','slice','valueRedacted','defineProperties','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','setEncoding','hasValue','bool','Missing\x20app-config\x20key.','warnings','Config\x20tags\x20for\x20filtering/display\x20metadata','trim','kind','10920540emiWDt','once','tags','value\x20is\x20redacted','gmtCreate','name','reveal','gmtModified','appCode','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','3083960GraLyY','flag','key','args','str','error','1431BMiwhj','argument','data','file','validation','from-env','join','Missing\x20app-config\x20value\x20source.','string','utf8','before','Failed\x20to\x20','\x20app\x20config.','66mmWbJS','5034GzyWoL'];a35_0x2f73=function(){return _0x2ced6f;};return a35_0x2f73();}function readStdin(){return new Promise((_0x243f85,_0x1da2ac)=>{const _0x14fb03=a35_0x55c6;let _0x5acddc='';process[_0x14fb03(0x1a5)][_0x14fb03(0x1af)](_0x14fb03(0x18d)),process[_0x14fb03(0x1a5)]['on'](_0x14fb03(0x1c9),_0x494a7b=>{_0x5acddc+=_0x494a7b;}),process[_0x14fb03(0x1a5)]['once'](_0x14fb03(0x193),()=>_0x243f85(_0x5acddc)),process[_0x14fb03(0x1a5)][_0x14fb03(0x1b8)](_0x14fb03(0x1c6),_0x1da2ac);});}
@@ -1 +1 @@
1
- const a36_0x5e86be=a36_0x12d4;(function(_0x3d18a1,_0x17b34){const _0x5f204c=a36_0x12d4,_0x49027c=_0x3d18a1();while(!![]){try{const _0x5d3aed=-parseInt(_0x5f204c(0x1fd))/0x1*(-parseInt(_0x5f204c(0x1f1))/0x2)+-parseInt(_0x5f204c(0x1f0))/0x3*(-parseInt(_0x5f204c(0x1f6))/0x4)+parseInt(_0x5f204c(0x1fb))/0x5+-parseInt(_0x5f204c(0x1f5))/0x6+-parseInt(_0x5f204c(0x1eb))/0x7*(-parseInt(_0x5f204c(0x1f7))/0x8)+-parseInt(_0x5f204c(0x1f9))/0x9+parseInt(_0x5f204c(0x1ed))/0xa;if(_0x5d3aed===_0x17b34)break;else _0x49027c['push'](_0x49027c['shift']());}catch(_0x1dae46){_0x49027c['push'](_0x49027c['shift']());}}}(a36_0x34d9,0xdae32));function a36_0x12d4(_0x88e936,_0x22b09c){_0x88e936=_0x88e936-0x1e9;const _0x34d95a=a36_0x34d9();let _0x12d41b=_0x34d95a[_0x88e936];return _0x12d41b;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x34d9(){const _0x4a2f4c=['log','1475020GUwCaP','Login\x20via\x20browser','2609YbhBVu','yes','bool','logout','../../auth/auth-server-ui.js','7Anznyl','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','12985810cspLLm','✓\x20Logged\x20out','Clear\x20login\x20session','4839lBGIAJ','302DkQxbP','nonInteractive','write','boolean','9290436RAMrJa','1996YvVUXK','2318672GoqsVO','auth','5735673ByIpNh'];a36_0x34d9=function(){return _0x4a2f4c;};return a36_0x34d9();}export const authDefinitions=[{'service':a36_0x5e86be(0x1f8),'command':'login','description':a36_0x5e86be(0x1fc),'risk':a36_0x5e86be(0x1f3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x5e86be(0x1fe),'type':a36_0x5e86be(0x1f4),'description':a36_0x5e86be(0x1ec),'default':![]}],async 'execute'(_0x5c8ed0){const _0x522bc7=a36_0x5e86be,{runAuthServer:_0x399d0d}=await import(_0x522bc7(0x1ea));return await _0x399d0d({'autoYes':_0x5c8ed0[_0x522bc7(0x1ff)](_0x522bc7(0x1fe)),'nonInteractive':_0x5c8ed0[_0x522bc7(0x1f2)]}),{'ok':!![]};}},{'service':a36_0x5e86be(0x1f8),'command':a36_0x5e86be(0x1e9),'description':a36_0x5e86be(0x1ef),'risk':a36_0x5e86be(0x1f3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2815d5){const _0x129587=a36_0x5e86be;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x129587(0x1fa)](_0x129587(0x1ee))):console[_0x129587(0x1fa)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
1
+ const a36_0x4dc632=a36_0x3270;(function(_0x9bda72,_0x934050){const _0x4b3efb=a36_0x3270,_0x4d28e8=_0x9bda72();while(!![]){try{const _0x77655a=-parseInt(_0x4b3efb(0x199))/0x1*(parseInt(_0x4b3efb(0x19e))/0x2)+-parseInt(_0x4b3efb(0x193))/0x3*(-parseInt(_0x4b3efb(0x191))/0x4)+parseInt(_0x4b3efb(0x1a5))/0x5*(-parseInt(_0x4b3efb(0x197))/0x6)+parseInt(_0x4b3efb(0x19b))/0x7*(parseInt(_0x4b3efb(0x19f))/0x8)+-parseInt(_0x4b3efb(0x1a0))/0x9+-parseInt(_0x4b3efb(0x195))/0xa*(parseInt(_0x4b3efb(0x18d))/0xb)+-parseInt(_0x4b3efb(0x19c))/0xc*(-parseInt(_0x4b3efb(0x19d))/0xd);if(_0x77655a===_0x934050)break;else _0x4d28e8['push'](_0x4d28e8['shift']());}catch(_0x1b962c){_0x4d28e8['push'](_0x4d28e8['shift']());}}}(a36_0x8d3d,0xc1c66));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x3270(_0x3194e0,_0x113088){_0x3194e0=_0x3194e0-0x18d;const _0x8d3db8=a36_0x8d3d();let _0x3270c1=_0x8d3db8[_0x3194e0];return _0x3270c1;}export const authDefinitions=[{'service':a36_0x4dc632(0x18e),'command':a36_0x4dc632(0x1a1),'description':a36_0x4dc632(0x194),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x4dc632(0x1a6),'type':a36_0x4dc632(0x190),'description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0x2ced57){const _0x5d80af=a36_0x4dc632,{runAuthServer:_0x25e867}=await import('../../auth/auth-server-ui.js');return await _0x25e867({'autoYes':_0x2ced57[_0x5d80af(0x1a4)](_0x5d80af(0x1a6)),'nonInteractive':_0x2ced57[_0x5d80af(0x196)]}),{'ok':!![]};}},{'service':a36_0x4dc632(0x18e),'command':a36_0x4dc632(0x1a3),'description':a36_0x4dc632(0x19a),'risk':a36_0x4dc632(0x192),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3b14de){const _0x1e8091=a36_0x4dc632;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x1e8091(0x1a2)](_0x1e8091(0x198))):console[_0x1e8091(0x1a2)](_0x1e8091(0x18f)),{'ok':!![]};}}];function a36_0x8d3d(){const _0x1aaa26=['logout','bool','35TLkiBD','yes','33cWBOZH','auth','!\x20Not\x20logged\x20in','boolean','2092jvMHCO','write','633SfXRTq','Login\x20via\x20browser','76630NCXeTn','nonInteractive','415356xTyHUR','✓\x20Logged\x20out','1402jUfnMs','Clear\x20login\x20session','378763DZEgXP','694236ORwsKj','247cfUpUW','1732ryQagR','200ibEjQa','421920KdXibR','login','log'];a36_0x8d3d=function(){return _0x1aaa26;};return a36_0x8d3d();}
@@ -1 +1 @@
1
- const a37_0x282431=a37_0x106f;(function(_0x5ebbc6,_0x2eee9f){const _0x5f576c=a37_0x106f,_0x9c5fd1=_0x5ebbc6();while(!![]){try{const _0x81e6ec=-parseInt(_0x5f576c(0x95))/0x1+parseInt(_0x5f576c(0xe2))/0x2*(-parseInt(_0x5f576c(0xe8))/0x3)+-parseInt(_0x5f576c(0xc1))/0x4+parseInt(_0x5f576c(0x9b))/0x5*(-parseInt(_0x5f576c(0xe0))/0x6)+-parseInt(_0x5f576c(0x93))/0x7*(parseInt(_0x5f576c(0x80))/0x8)+parseInt(_0x5f576c(0xbd))/0x9+-parseInt(_0x5f576c(0xdb))/0xa*(-parseInt(_0x5f576c(0xb8))/0xb);if(_0x81e6ec===_0x2eee9f)break;else _0x9c5fd1['push'](_0x9c5fd1['shift']());}catch(_0x206622){_0x9c5fd1['push'](_0x9c5fd1['shift']());}}}(a37_0x14c1,0x4096d));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';function a37_0x14c1(){const _0x3266ae=['HOOK\x20requires\x20alias/operation/node\x20options.','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','datasetId','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','source','selectedAppName','bff','keys','stderr','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','nonInteractive','str','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','write','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','30TiAvyS','name','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','当前响应结果','appCode','27132QoeMgY','\x20api\x20pull`\x20to\x20refresh.','146434GNxtsk','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','\x22,\x20params\x20})\x0a','entries','apiDir','HOOK','3QgArUx','scriptsRootDir','string','after','Invalid\x20function\x20name\x20\x22','filePath','3620872jQWnLf','COMMON','stdin','find','function-node','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','trim','description','/ENDPOINT/','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','.js','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','UNKNOWN','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','create','Function\x20name\x20(valid\x20JS\x20identifier)','defaultApp','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','No\x20model\x20aliases\x20found.\x20Run\x20`','7lggEmv','includes','341619cptKDR','Select\x20trigger\x20node:','Script\x20description','/COMMON/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','question','495OhcmMN','datasetCode','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','close','mergedCli','parseInt','functionNode','operationType','Operation\x20type\x20(HOOK\x20only)','read','修改后的响应结果','Select\x20operation\x20type:','Select\x20dataset:',']\x20(','validation','datasetcode','No\x20datasets\x20found\x20for\x20this\x20app.','File\x20already\x20exists:\x20','Operation\x20type\x20\x22','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','/**\x0a\x20*\x20','alias','length','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','.js\x0a','\x22\x20not\x20found\x20for\x20dataset\x20','code','Alias\x20\x22','\x22\x20not\x20found.\x20','5447937WHjnja','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','当前请求参数','map','type','3255615KMcJoT','currentApp','Invalid\x20dataset\x20selection.','\x22.\x20','1071424cftFDB','before','profileName','join','.js\x0a\x20*\x20[触发节点]\x20','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','/data/dataset/','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Script\x20type'];a37_0x14c1=function(){return _0x3266ae;};return a37_0x14c1();}function a37_0x106f(_0x5ef440,_0x22ec36){_0x5ef440=_0x5ef440-0x7c;const _0x14c159=a37_0x14c1();let _0x106f39=_0x14c159[_0x5ef440];return _0x106f39;}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_0x282431(0xd1),'command':a37_0x282431(0x8e),'description':a37_0x282431(0x8d),'risk':a37_0x282431(0xa4),'flags':[{'name':a37_0x282431(0xbc),'type':'string','required':!![],'enum':[a37_0x282431(0x81),'ENDPOINT',a37_0x282431(0xe7)],'description':a37_0x282431(0xca)},{'name':a37_0x282431(0xdc),'type':a37_0x282431(0x7c),'required':!![],'description':a37_0x282431(0x8f)},{'name':a37_0x282431(0x87),'type':a37_0x282431(0x7c),'description':a37_0x282431(0x97)},{'name':a37_0x282431(0xb0),'type':a37_0x282431(0x7c),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':'datasetcode','type':a37_0x282431(0x7c),'description':a37_0x282431(0x8b)},{'name':'operation-type','type':a37_0x282431(0x7c),'description':a37_0x282431(0xa3)},{'name':a37_0x282431(0x84),'type':a37_0x282431(0x7c),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':['before','after']}],async 'validate'(_0x3f2a49){const _0x1c057b=a37_0x282431,_0x1e34e7=_0x3f2a49[_0x1c057b(0xd6)](_0x1c057b(0xdc));if(!isValidBffFunctionName(_0x1e34e7))throw CliErrors['validation'](_0x1c057b(0x7e)+_0x1e34e7+_0x1c057b(0x89));},async 'execute'(_0x10ed8b){const _0xfe1e7=a37_0x282431,_0x21db1c=loadBffProjectConfig(_0x10ed8b[_0xfe1e7(0xdf)]),_0x4ac455=_0x10ed8b[_0xfe1e7(0xd6)]('type'),_0x1ae9b4=_0x10ed8b[_0xfe1e7(0xd6)]('name'),_0x466423=_0x10ed8b['str']('description')||undefined,_0x4e8485=_0x4ac455===_0xfe1e7(0xe7)?await resolveHookOptions(_0x21db1c,_0x10ed8b):undefined,_0x140d35=buildFilePath(_0x21db1c,_0x4ac455,_0x1ae9b4,_0x4e8485);if(await fileExists(_0x140d35))throw CliErrors['validation'](_0xfe1e7(0xac)+_0x140d35);await mkdir(dirname(_0x140d35),{'recursive':!![]});const _0x1d8733=generateTemplate(_0x4ac455,_0x1ae9b4,_0x10ed8b[_0xfe1e7(0xdf)],_0x466423,_0x4e8485);await writeFile(_0x140d35,_0x1d8733,'utf8');const _0x345ada={'type':_0x4ac455,'name':_0x1ae9b4,'path':_0x140d35};if(_0x466423)_0x345ada[_0xfe1e7(0x87)]=_0x466423;if(_0x4e8485){if(_0x4e8485['alias'])_0x345ada[_0xfe1e7(0xb0)]=_0x4e8485[_0xfe1e7(0xb0)];_0x345ada['datasetCode']=_0x4e8485[_0xfe1e7(0x9c)],_0x345ada['operationType']=_0x4e8485['operationType'],_0x345ada[_0xfe1e7(0xa1)]=_0x4e8485[_0xfe1e7(0xa1)];}return{'ok':!![],'data':_0x345ada,'message':'Created\x20'+_0x4ac455+'\x20function:\x20'+_0x1ae9b4};}};async function resolveHookOptions(_0x49d6b9,_0x8076f6){const _0x573e99=a37_0x282431,_0xcbfa8e=resolveApiModelSource(_0x8076f6[_0x573e99(0xe6)],_0x8076f6[_0x573e99(0xdf)],_0x8076f6[_0x573e99(0xd0)]||_0x8076f6[_0x573e99(0x9f)]?.[_0x573e99(0xbe)]||_0x8076f6['mergedCli']?.[_0x573e99(0x90)]),_0x398aeb=loadAliasMap(_0x8076f6[_0x573e99(0xe6)],undefined,_0xcbfa8e['filePath'],_0xcbfa8e[_0x573e99(0xc3)]),_0x329974=_0x398aeb[_0x573e99(0xb1)]>0x0;let _0x37a32a,_0x204010,_0x3e6d2e;const _0x4095df=_0x8076f6[_0x573e99(0xd6)](_0x573e99(0xb0)),_0x608663=_0x8076f6[_0x573e99(0xd6)](_0x573e99(0xaa));if(_0x4095df){const _0x1d687e=resolveAlias(_0x8076f6[_0x573e99(0xe6)],_0x4095df,undefined,_0xcbfa8e[_0x573e99(0x7f)],_0xcbfa8e[_0x573e99(0xc3)]);if(!_0x1d687e){const _0x42ee70=_0x329974?'Available\x20aliases:\x20'+_0x398aeb[_0x573e99(0xbb)](_0x203565=>_0x203565['alias'])[_0x573e99(0xc4)](',\x20'):_0x573e99(0x92)+CLI_BIN_NAME+_0x573e99(0xce);throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xb6)+_0x4095df+_0x573e99(0xb7)+_0x42ee70);}_0x37a32a=_0x4095df,_0x204010=_0x1d687e;}else{if(_0x608663){_0x204010=_0x608663;const _0x3f1b76=_0x398aeb[_0x573e99(0x83)](_0x57fc6f=>_0x57fc6f[_0x573e99(0x9c)]===_0x608663);_0x37a32a=_0x3f1b76?.['alias'];}else{if(_0x8076f6['nonInteractive'])throw CliErrors['validation']('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x329974){const _0x1a10d6=_0x398aeb[_0x573e99(0xbb)](_0x12d67e=>_0x12d67e['alias']+'\x20('+_0x12d67e['tableName']+')'),_0x3092cd=await promptSelect(_0x573e99(0xa7),_0x1a10d6),_0x1d5bdf=_0x398aeb[_0x3092cd];if(!_0x1d5bdf)throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xbf));_0x37a32a=_0x1d5bdf[_0x573e99(0xb0)],_0x204010=_0x1d5bdf[_0x573e99(0x9c)];}else{const _0x4b1a29=await listDatasets(_0x8076f6['appCode']);if(_0x4b1a29[_0x573e99(0xb1)]===0x0)throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xab));const _0x288705=_0x4b1a29[_0x573e99(0xbb)](_0xd57047=>_0xd57047[_0x573e99(0xdc)]+'\x20['+(_0xd57047[_0x573e99(0xcf)]??_0x573e99(0x8c))+_0x573e99(0xa8)+_0xd57047['code']+')'),_0x2a9f25=await promptSelect('Select\x20dataset:',_0x288705),_0x3eb049=_0x4b1a29[_0x2a9f25];if(!_0x3eb049)throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xbf));_0x204010=_0x3eb049[_0x573e99(0xb5)],_0x37a32a=undefined;}}}}const _0x3b2629=await listDatasets(_0x8076f6[_0x573e99(0xdf)]),_0x53b481=_0x3b2629[_0x573e99(0x83)](_0x38660e=>_0x38660e['code']===_0x204010);if(!_0x53b481)throw CliErrors[_0x573e99(0xa9)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x204010+_0x573e99(0xc0)+(_0x37a32a?_0x573e99(0xda)+CLI_BIN_NAME+_0x573e99(0xe1):''));_0x3e6d2e=_0x53b481['id'];const _0x482b68=_0x37a32a??_0x204010,_0x505d2e=await listBffDatasetOperations(_0x8076f6[_0x573e99(0xdf)],_0x3e6d2e),_0x7648f1=_0x505d2e?Object[_0x573e99(0xd2)](_0x505d2e):[];if(_0x7648f1[_0x573e99(0xb1)]===0x0)throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xc9)+_0x482b68+'.');let _0x2d6c2b;const _0x14233d=_0x8076f6['str']('operation-type');if(_0x14233d){if(!_0x7648f1[_0x573e99(0x94)](_0x14233d))throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xad)+_0x14233d+_0x573e99(0xb4)+_0x482b68+'.\x20'+('Available:\x20'+_0x7648f1[_0x573e99(0xc4)](',\x20')));_0x2d6c2b=_0x14233d;}else{if(_0x8076f6['nonInteractive'])throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xae));const _0xae2a26=await promptSelect(_0x573e99(0xa6),_0x7648f1);_0x2d6c2b=_0x7648f1[_0xae2a26]??_0x7648f1[0x0];}let _0x14370a=normalizeHookFunctionNode(_0x8076f6[_0x573e99(0xd6)](_0x573e99(0x84)));if(!_0x14370a){if(_0x8076f6[_0x573e99(0xd6)](_0x573e99(0x84)))throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xb9));if(_0x8076f6[_0x573e99(0xd5)])throw CliErrors[_0x573e99(0xa9)](_0x573e99(0xcc));const _0x4ff1d4=await promptSelect(_0x573e99(0x96),['before','after']);_0x14370a=[_0x573e99(0xc2),_0x573e99(0x7d)][_0x4ff1d4]??'before';}return{'alias':_0x37a32a,'datasetCode':_0x204010,'datasetId':_0x3e6d2e,'operationType':_0x2d6c2b,'functionNode':_0x14370a};}async function promptSelect(_0x3c1de8,_0xdc5167){const _0x40109c=a37_0x282431;if(_0xdc5167[_0x40109c(0xb1)]===0x1)return 0x0;for(const [_0x4f0e83,_0x5d7990]of _0xdc5167[_0x40109c(0xe5)]()){process[_0x40109c(0xd3)][_0x40109c(0xd9)]('\x20\x20'+(_0x4f0e83+0x1)+'.\x20'+_0x5d7990+'\x0a');}const _0x19aa97=createInterface({'input':process[_0x40109c(0x82)],'output':process[_0x40109c(0xd3)]});while(!![]){const _0x487f2c=await new Promise(_0x5e2fa1=>{const _0xa1a0da=_0x40109c;_0x19aa97[_0xa1a0da(0x9a)](_0x3c1de8+'\x20',_0x5e2fa1);}),_0x4e2b09=Number[_0x40109c(0xa0)](_0x487f2c[_0x40109c(0x86)](),0xa);if(Number['isInteger'](_0x4e2b09)&&_0x4e2b09>=0x1&&_0x4e2b09<=_0xdc5167[_0x40109c(0xb1)])return _0x19aa97[_0x40109c(0x9e)](),_0x4e2b09-0x1;process[_0x40109c(0xd3)]['write'](_0x40109c(0x9d)+_0xdc5167['length']+'.\x0a');}}function buildFilePath(_0x381f6a,_0x48d287,_0x2552af,_0xd867a9){const _0x5abee5=a37_0x282431;if(_0x48d287===_0x5abee5(0xe7)){if(!_0xd867a9)throw CliErrors['validation'](_0x5abee5(0xcb));const _0x1bab01=_0xd867a9[_0x5abee5(0xb0)]??_0xd867a9[_0x5abee5(0x9c)];return join(_0x381f6a[_0x5abee5(0xe9)],_0x5abee5(0xe7),_0x1bab01,_0xd867a9['operationType'],_0xd867a9[_0x5abee5(0xa1)],_0x2552af+'.js');}return join(_0x381f6a[_0x5abee5(0xe9)],_0x48d287,_0x2552af+_0x5abee5(0x8a));}export function generateTemplate(_0x33a0de,_0x7f31a5,_0x3b3526,_0x345d5f,_0x5c5d60){const _0x3fc8ff=a37_0x282431,_0x49f137=_0x345d5f?.[_0x3fc8ff(0x86)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x11e7ad=getAppBaseUrl(_0x3b3526),_0xe4ea29=_0x3fc8ff(0xb2);if(_0x33a0de==='COMMON')return _0x3fc8ff(0xaf)+_0x49f137+_0x3fc8ff(0xe3)+_0x7f31a5+'\x0a\x20*\x20[平台配置]\x20'+_0x11e7ad+_0x3fc8ff(0xdd)+_0x3b3526+_0x3fc8ff(0x98)+_0x7f31a5+_0x3fc8ff(0x91)+_0x7f31a5+_0x3fc8ff(0xe4)+_0xe4ea29+_0x3fc8ff(0xd8)+_0x7f31a5+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x33a0de==='ENDPOINT')return _0x3fc8ff(0xaf)+_0x49f137+_0x3fc8ff(0x99)+_0x7f31a5+_0x3fc8ff(0xc6)+_0x3b3526+'/'+_0x7f31a5+'\x0a\x20*\x20[平台配置]\x20'+_0x11e7ad+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x3b3526+_0x3fc8ff(0x88)+_0x7f31a5+_0x3fc8ff(0xb3)+_0xe4ea29+'\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'+_0x7f31a5+_0x3fc8ff(0xc8);if(!_0x5c5d60)throw CliErrors[_0x3fc8ff(0xa9)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x1a7c2a=_0x5c5d60[_0x3fc8ff(0xb0)]??_0x5c5d60['datasetCode'],_0xc0c94c=_0x5c5d60['functionNode']===_0x3fc8ff(0xc2)?_0x3fc8ff(0xba):_0x3fc8ff(0xde),_0x5e133d=_0x5c5d60[_0x3fc8ff(0xa1)]===_0x3fc8ff(0xc2)?'修改后的请求参数':_0x3fc8ff(0xa5);return _0x3fc8ff(0xaf)+_0x49f137+_0x3fc8ff(0xd4)+_0x7f31a5+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x3b3526+'/'+_0x5c5d60[_0x3fc8ff(0x9c)]+'/'+_0x5c5d60[_0x3fc8ff(0xa2)]+'\x0a\x20*\x20[平台配置]\x20'+_0x11e7ad+_0x3fc8ff(0xc7)+_0x5c5d60[_0x3fc8ff(0xcd)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x3b3526+'/HOOK/'+_0x1a7c2a+'/'+_0x5c5d60[_0x3fc8ff(0xa2)]+'/'+_0x5c5d60['functionNode']+'/'+_0x7f31a5+_0x3fc8ff(0xc5)+_0x5c5d60[_0x3fc8ff(0xa1)]+'\x0a'+_0xe4ea29+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0xc0c94c+_0x3fc8ff(0xd7)+_0x5e133d+_0x3fc8ff(0x85)+_0x7f31a5+_0x3fc8ff(0xc8);}
1
+ function a37_0x5859(){const _0x51e10a=['/HOOK/','COMMON','datasetId','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','stdin','\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','当前响应结果','alias','isInteger','write','修改后的请求参数','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','/data/dataset/','nonInteractive','length','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Available\x20aliases:\x20','ENDPOINT','当前请求参数','Script\x20description','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','entries','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','Invalid\x20function\x20name\x20\x22','functionNode','currentApp','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','No\x20datasets\x20found\x20for\x20this\x20app.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','\x22\x20not\x20found.\x20','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','\x0a\x20*\x20[平台配置]\x20','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','close','965132ghHtDU','Alias\x20\x22','\x20function:\x20','Select\x20operation\x20type:','str','Select\x20dataset:','after','Dataset\x20not\x20found\x20for\x20code\x20\x22','\x22\x20not\x20found\x20for\x20dataset\x20','File\x20already\x20exists:\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','/**\x0a\x20*\x20','No\x20model\x20aliases\x20found.\x20Run\x20`','\x22,\x20params\x20})\x0a','question','trim','map','description','datasetcode','Created\x20','2221065oHGEfy','string','1278498WXuwtK','validation','6093488uMqsID','profileName','.js','filePath','type','datasetCode','before','2ykqmPu','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','mergedCli','operationType','defaultApp','Script\x20type','scriptsRootDir','UNKNOWN','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','Select\x20trigger\x20node:','operation-type','19316zedoGE','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','HOOK\x20requires\x20alias/operation/node\x20options.','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','read','修改后的响应结果','source','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Function\x20name\x20(valid\x20JS\x20identifier)','stderr','11707206CCSJDb','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','1905qHlKPy','tableName','selectedAppName','HOOK',']\x20(','bff','Invalid\x20dataset\x20selection.','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','2627199RmPKet','appCode','.js\x0a','code','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','/ENDPOINT/','apiDir','name','find','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','/COMMON/'];a37_0x5859=function(){return _0x51e10a;};return a37_0x5859();}const a37_0x30e755=a37_0x29ed;(function(_0x274b5a,_0x3f6be2){const _0x11a53e=a37_0x29ed,_0x2b0a61=_0x274b5a();while(!![]){try{const _0x2ca9ce=-parseInt(_0x11a53e(0x19c))/0x1*(-parseInt(_0x11a53e(0x1bb))/0x2)+parseInt(_0x11a53e(0x16f))/0x3+-parseInt(_0x11a53e(0x15b))/0x4*(parseInt(_0x11a53e(0x167))/0x5)+-parseInt(_0x11a53e(0x1b2))/0x6+parseInt(_0x11a53e(0x165))/0x7+-parseInt(_0x11a53e(0x1b4))/0x8+parseInt(_0x11a53e(0x1b0))/0x9;if(_0x2ca9ce===_0x3f6be2)break;else _0x2b0a61['push'](_0x2b0a61['shift']());}catch(_0x565526){_0x2b0a61['push'](_0x2b0a61['shift']());}}}(a37_0x5859,0xe6d52));function a37_0x29ed(_0x2c14f2,_0xa4e469){_0x2c14f2=_0x2c14f2-0x155;const _0x5859f3=a37_0x5859();let _0x29ed56=_0x5859f3[_0x2c14f2];return _0x29ed56;}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_0x30e755(0x16c),'command':'create','description':a37_0x30e755(0x15e),'risk':a37_0x30e755(0x15f),'flags':[{'name':a37_0x30e755(0x1b8),'type':a37_0x30e755(0x1b1),'required':!![],'enum':['COMMON','ENDPOINT',a37_0x30e755(0x16a)],'description':a37_0x30e755(0x155)},{'name':a37_0x30e755(0x176),'type':a37_0x30e755(0x1b1),'required':!![],'description':a37_0x30e755(0x163)},{'name':a37_0x30e755(0x1ad),'type':'string','description':a37_0x30e755(0x18d)},{'name':a37_0x30e755(0x181),'type':a37_0x30e755(0x1b1),'description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a37_0x30e755(0x1ae),'type':'string','description':a37_0x30e755(0x1a6)},{'name':a37_0x30e755(0x15a),'type':'string','description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':a37_0x30e755(0x1b1),'description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a37_0x30e755(0x1ba),a37_0x30e755(0x1a2)]}],async 'validate'(_0x111a67){const _0x3babaa=a37_0x30e755,_0x3d7c6a=_0x111a67[_0x3babaa(0x1a0)]('name');if(!isValidBffFunctionName(_0x3d7c6a))throw CliErrors[_0x3babaa(0x1b3)](_0x3babaa(0x191)+_0x3d7c6a+_0x3babaa(0x178));},async 'execute'(_0x745064){const _0x386af9=a37_0x30e755,_0x3bf740=loadBffProjectConfig(_0x745064[_0x386af9(0x170)]),_0x5aef45=_0x745064['str'](_0x386af9(0x1b8)),_0x3b81b5=_0x745064['str'](_0x386af9(0x176)),_0x5c1a24=_0x745064[_0x386af9(0x1a0)](_0x386af9(0x1ad))||undefined,_0x4ae82f=_0x5aef45==='HOOK'?await resolveHookOptions(_0x3bf740,_0x745064):undefined,_0x1e3253=buildFilePath(_0x3bf740,_0x5aef45,_0x3b81b5,_0x4ae82f);if(await fileExists(_0x1e3253))throw CliErrors[_0x386af9(0x1b3)](_0x386af9(0x1a5)+_0x1e3253);await mkdir(dirname(_0x1e3253),{'recursive':!![]});const _0x224563=generateTemplate(_0x5aef45,_0x3b81b5,_0x745064[_0x386af9(0x170)],_0x5c1a24,_0x4ae82f);await writeFile(_0x1e3253,_0x224563,'utf8');const _0x3cb251={'type':_0x5aef45,'name':_0x3b81b5,'path':_0x1e3253};if(_0x5c1a24)_0x3cb251['description']=_0x5c1a24;if(_0x4ae82f){if(_0x4ae82f['alias'])_0x3cb251[_0x386af9(0x181)]=_0x4ae82f[_0x386af9(0x181)];_0x3cb251[_0x386af9(0x1b9)]=_0x4ae82f[_0x386af9(0x1b9)],_0x3cb251[_0x386af9(0x1be)]=_0x4ae82f[_0x386af9(0x1be)],_0x3cb251['functionNode']=_0x4ae82f[_0x386af9(0x192)];}return{'ok':!![],'data':_0x3cb251,'message':_0x386af9(0x1af)+_0x5aef45+_0x386af9(0x19e)+_0x3b81b5};}};async function resolveHookOptions(_0x4bd916,_0x457a79){const _0xe227bd=a37_0x30e755,_0x5c5753=resolveApiModelSource(_0x457a79[_0xe227bd(0x175)],_0x457a79[_0xe227bd(0x170)],_0x457a79[_0xe227bd(0x169)]||_0x457a79['mergedCli']?.[_0xe227bd(0x193)]||_0x457a79[_0xe227bd(0x1bd)]?.[_0xe227bd(0x1bf)]),_0x3461ec=loadAliasMap(_0x457a79['apiDir'],undefined,_0x5c5753[_0xe227bd(0x1b7)],_0x5c5753[_0xe227bd(0x1b5)]),_0x5808a8=_0x3461ec['length']>0x0;let _0x132175,_0x529a38,_0x313442;const _0x20b693=_0x457a79[_0xe227bd(0x1a0)](_0xe227bd(0x181)),_0x5ab6f7=_0x457a79[_0xe227bd(0x1a0)](_0xe227bd(0x1ae));if(_0x20b693){const _0x4ddd8e=resolveAlias(_0x457a79['apiDir'],_0x20b693,undefined,_0x5c5753['filePath'],_0x5c5753[_0xe227bd(0x1b5)]);if(!_0x4ddd8e){const _0x4861e5=_0x5808a8?_0xe227bd(0x18a)+_0x3461ec[_0xe227bd(0x1ac)](_0x96fe93=>_0x96fe93[_0xe227bd(0x181)])['join'](',\x20'):_0xe227bd(0x1a8)+CLI_BIN_NAME+_0xe227bd(0x18e);throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x19d)+_0x20b693+_0xe227bd(0x197)+_0x4861e5);}_0x132175=_0x20b693,_0x529a38=_0x4ddd8e;}else{if(_0x5ab6f7){_0x529a38=_0x5ab6f7;const _0x1a1b0d=_0x3461ec[_0xe227bd(0x177)](_0x5d65ee=>_0x5d65ee['datasetCode']===_0x5ab6f7);_0x132175=_0x1a1b0d?.[_0xe227bd(0x181)];}else{if(_0x457a79[_0xe227bd(0x187)])throw CliErrors['validation']('--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');else{if(_0x5808a8){const _0xf6cc6=_0x3461ec[_0xe227bd(0x1ac)](_0xfae18f=>_0xfae18f[_0xe227bd(0x181)]+'\x20('+_0xfae18f[_0xe227bd(0x168)]+')'),_0x2fe9ce=await promptSelect(_0xe227bd(0x1a1),_0xf6cc6),_0x4b82a9=_0x3461ec[_0x2fe9ce];if(!_0x4b82a9)throw CliErrors['validation']('Invalid\x20dataset\x20selection.');_0x132175=_0x4b82a9[_0xe227bd(0x181)],_0x529a38=_0x4b82a9['datasetCode'];}else{const _0x27ad0c=await listDatasets(_0x457a79[_0xe227bd(0x170)]);if(_0x27ad0c[_0xe227bd(0x188)]===0x0)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x195));const _0x4fdc26=_0x27ad0c[_0xe227bd(0x1ac)](_0x8a9c47=>_0x8a9c47[_0xe227bd(0x176)]+'\x20['+(_0x8a9c47[_0xe227bd(0x161)]??_0xe227bd(0x157))+_0xe227bd(0x16b)+_0x8a9c47[_0xe227bd(0x172)]+')'),_0x610c6=await promptSelect(_0xe227bd(0x1a1),_0x4fdc26),_0x371907=_0x27ad0c[_0x610c6];if(!_0x371907)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x16d));_0x529a38=_0x371907[_0xe227bd(0x172)],_0x132175=undefined;}}}}const _0x580930=await listDatasets(_0x457a79[_0xe227bd(0x170)]),_0x358d66=_0x580930[_0xe227bd(0x177)](_0x4ca104=>_0x4ca104[_0xe227bd(0x172)]===_0x529a38);if(!_0x358d66)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x1a3)+_0x529a38+'\x22.\x20'+(_0x132175?_0xe227bd(0x16e)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh.':''));_0x313442=_0x358d66['id'];const _0x16c433=_0x132175??_0x529a38,_0x173cf6=await listBffDatasetOperations(_0x457a79[_0xe227bd(0x170)],_0x313442),_0x35fb27=_0x173cf6?Object['keys'](_0x173cf6):[];if(_0x35fb27[_0xe227bd(0x188)]===0x0)throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x189)+_0x16c433+'.');let _0x3f5b39;const _0x20ca1f=_0x457a79[_0xe227bd(0x1a0)]('operation-type');if(_0x20ca1f){if(!_0x35fb27['includes'](_0x20ca1f))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x20ca1f+_0xe227bd(0x1a4)+_0x16c433+'.\x20'+('Available:\x20'+_0x35fb27['join'](',\x20')));_0x3f5b39=_0x20ca1f;}else{if(_0x457a79[_0xe227bd(0x187)])throw CliErrors['validation'](_0xe227bd(0x166));const _0x472395=await promptSelect(_0xe227bd(0x19f),_0x35fb27);_0x3f5b39=_0x35fb27[_0x472395]??_0x35fb27[0x0];}let _0x1fc388=normalizeHookFunctionNode(_0x457a79[_0xe227bd(0x1a0)]('function-node'));if(!_0x1fc388){if(_0x457a79['str']('function-node'))throw CliErrors[_0xe227bd(0x1b3)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x457a79[_0xe227bd(0x187)])throw CliErrors[_0xe227bd(0x1b3)](_0xe227bd(0x162));const _0x174169=await promptSelect(_0xe227bd(0x159),[_0xe227bd(0x1ba),_0xe227bd(0x1a2)]);_0x1fc388=[_0xe227bd(0x1ba),_0xe227bd(0x1a2)][_0x174169]??_0xe227bd(0x1ba);}return{'alias':_0x132175,'datasetCode':_0x529a38,'datasetId':_0x313442,'operationType':_0x3f5b39,'functionNode':_0x1fc388};}async function promptSelect(_0x2153e2,_0x448d8a){const _0x1c8838=a37_0x30e755;if(_0x448d8a[_0x1c8838(0x188)]===0x1)return 0x0;for(const [_0x30579f,_0x2e5e36]of _0x448d8a[_0x1c8838(0x18f)]()){process['stderr'][_0x1c8838(0x183)]('\x20\x20'+(_0x30579f+0x1)+'.\x20'+_0x2e5e36+'\x0a');}const _0x288f88=createInterface({'input':process[_0x1c8838(0x17e)],'output':process[_0x1c8838(0x164)]});while(!![]){const _0x128f24=await new Promise(_0x59f3c0=>{const _0x3cbf66=_0x1c8838;_0x288f88[_0x3cbf66(0x1aa)](_0x2153e2+'\x20',_0x59f3c0);}),_0x30bf5d=Number['parseInt'](_0x128f24[_0x1c8838(0x1ab)](),0xa);if(Number[_0x1c8838(0x182)](_0x30bf5d)&&_0x30bf5d>=0x1&&_0x30bf5d<=_0x448d8a[_0x1c8838(0x188)])return _0x288f88[_0x1c8838(0x19b)](),_0x30bf5d-0x1;process[_0x1c8838(0x164)]['write']('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x448d8a[_0x1c8838(0x188)]+'.\x0a');}}function buildFilePath(_0x63fc68,_0x578d7e,_0x1bd4c1,_0x4d3f7d){const _0x5d950a=a37_0x30e755;if(_0x578d7e===_0x5d950a(0x16a)){if(!_0x4d3f7d)throw CliErrors['validation'](_0x5d950a(0x15d));const _0x1148a4=_0x4d3f7d[_0x5d950a(0x181)]??_0x4d3f7d[_0x5d950a(0x1b9)];return join(_0x63fc68[_0x5d950a(0x156)],_0x5d950a(0x16a),_0x1148a4,_0x4d3f7d[_0x5d950a(0x1be)],_0x4d3f7d[_0x5d950a(0x192)],_0x1bd4c1+_0x5d950a(0x1b6));}return join(_0x63fc68[_0x5d950a(0x156)],_0x578d7e,_0x1bd4c1+'.js');}export function generateTemplate(_0x4c5ad1,_0x7cc6b3,_0x512973,_0x4b4557,_0x245b0e){const _0x46ecd0=a37_0x30e755,_0x154497=_0x4b4557?.[_0x46ecd0(0x1ab)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x9d72ca=getAppBaseUrl(_0x512973),_0x2b6ef5=_0x46ecd0(0x173);if(_0x4c5ad1===_0x46ecd0(0x17b))return _0x46ecd0(0x1a7)+_0x154497+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x7cc6b3+_0x46ecd0(0x199)+_0x9d72ca+_0x46ecd0(0x194)+_0x512973+_0x46ecd0(0x179)+_0x7cc6b3+_0x46ecd0(0x19a)+_0x7cc6b3+_0x46ecd0(0x1a9)+_0x2b6ef5+_0x46ecd0(0x185)+_0x7cc6b3+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x4c5ad1===_0x46ecd0(0x18b))return _0x46ecd0(0x1a7)+_0x154497+_0x46ecd0(0x196)+_0x7cc6b3+_0x46ecd0(0x15c)+_0x512973+'/'+_0x7cc6b3+_0x46ecd0(0x199)+_0x9d72ca+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x512973+_0x46ecd0(0x174)+_0x7cc6b3+_0x46ecd0(0x171)+_0x2b6ef5+_0x46ecd0(0x17f)+_0x7cc6b3+_0x46ecd0(0x17d);if(!_0x245b0e)throw CliErrors[_0x46ecd0(0x1b3)](_0x46ecd0(0x190));const _0x1ea3ca=_0x245b0e[_0x46ecd0(0x181)]??_0x245b0e['datasetCode'],_0x542b00=_0x245b0e[_0x46ecd0(0x192)]===_0x46ecd0(0x1ba)?_0x46ecd0(0x18c):_0x46ecd0(0x180),_0xe9ca03=_0x245b0e[_0x46ecd0(0x192)]===_0x46ecd0(0x1ba)?_0x46ecd0(0x184):_0x46ecd0(0x160);return _0x46ecd0(0x1a7)+_0x154497+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x7cc6b3+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x512973+'/'+_0x245b0e[_0x46ecd0(0x1b9)]+'/'+_0x245b0e[_0x46ecd0(0x1be)]+_0x46ecd0(0x199)+_0x9d72ca+_0x46ecd0(0x186)+_0x245b0e[_0x46ecd0(0x17c)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x512973+_0x46ecd0(0x17a)+_0x1ea3ca+'/'+_0x245b0e[_0x46ecd0(0x1be)]+'/'+_0x245b0e[_0x46ecd0(0x192)]+'/'+_0x7cc6b3+'.js\x0a\x20*\x20[触发节点]\x20'+_0x245b0e[_0x46ecd0(0x192)]+'\x0a'+_0x2b6ef5+_0x46ecd0(0x1bc)+_0x542b00+_0x46ecd0(0x198)+_0xe9ca03+_0x46ecd0(0x158)+_0x7cc6b3+_0x46ecd0(0x17d);}
@@ -1 +1 @@
1
- const a38_0x400a62=a38_0x13b0;function a38_0x54ac(){const _0x111be9=['keys','remoteId','11HgfoqF','741512ZOgklh','No\x20lock\x20entry\x20found\x20for\x20\x22','length','25620SGyWYE','Would\x20delete\x20','map','high-risk-write','string','projectRoot','toISOString','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','\x22\x20not\x20found\x20after\x20ensureLockScope.','1105NPnrYd','Multiple\x20functions\x20match\x20\x22','154RfIOou','startsWith','<timestamp>','delete','apps','join','stringify','2848048XyChAw','filter','19772PyvMcP','includes','lockFilePath','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','1030310Usarrf','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','bff','validation','\x20(local\x20file\x20moved\x20to\x20trash)','Lock\x20scope\x20for\x20app\x20\x22','lastSync','Local\x20delete\x20not\x20settled\x20for\x20','scriptsRootDir','492710rlFabt','replace','Function\x20not\x20found:\x20','Backend\x20Function\x20lock\x20file\x20not\x20found.','appCode','69XEkhJP','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','split','9PZtLab','235670tWfdyZ','trashDir','parse','functions','target','find','scriptsRoot','24dirdgl'];a38_0x54ac=function(){return _0x111be9;};return a38_0x54ac();}(function(_0x1e3d2f,_0x530a17){const _0x38ae5c=a38_0x13b0,_0x5527c6=_0x1e3d2f();while(!![]){try{const _0x4a790d=-parseInt(_0x38ae5c(0xb7))/0x1*(parseInt(_0x38ae5c(0xad))/0x2)+parseInt(_0x38ae5c(0xa9))/0x3*(-parseInt(_0x38ae5c(0x97))/0x4)+parseInt(_0x38ae5c(0x9b))/0x5*(parseInt(_0x38ae5c(0xb4))/0x6)+parseInt(_0x38ae5c(0x95))/0x7+parseInt(_0x38ae5c(0xb8))/0x8*(parseInt(_0x38ae5c(0xac))/0x9)+parseInt(_0x38ae5c(0xa4))/0xa*(parseInt(_0x38ae5c(0x8e))/0xb)+parseInt(_0x38ae5c(0xbb))/0xc*(parseInt(_0x38ae5c(0x8c))/0xd);if(_0x4a790d===_0x530a17)break;else _0x5527c6['push'](_0x5527c6['shift']());}catch(_0x46d812){_0x5527c6['push'](_0x5527c6['shift']());}}}(a38_0x54ac,0xbfb2c));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':a38_0x400a62(0x9d),'command':a38_0x400a62(0x91),'description':a38_0x400a62(0xc2),'risk':a38_0x400a62(0xbe),'flags':[{'name':a38_0x400a62(0xb1),'type':a38_0x400a62(0xbf),'required':!![],'description':a38_0x400a62(0x9a)}],async 'validate'(_0x4c76d1){const _0x226fdf=a38_0x400a62,_0x4d8703=loadBffProjectConfig(_0x4c76d1['appCode']),_0xe693d=await readBffLockFile(_0x4d8703[_0x226fdf(0x99)]);if(!_0xe693d)throw CliErrors[_0x226fdf(0x9e)](_0x226fdf(0x9c));},async 'dryRun'(_0x33a4e0){const _0x130e76=a38_0x400a62,_0x62dbe8=loadBffProjectConfig(_0x33a4e0[_0x130e76(0xa8)]),_0x491e11=await readBffLockFile(_0x62dbe8[_0x130e76(0x99)]);if(!_0x491e11)throw CliErrors['validation'](_0x130e76(0xa7));const {appLock:_0x62e966}=ensureLockScope(_0x491e11,_0x33a4e0['appCode'],_0x62dbe8[_0x130e76(0xb3)],_0x130e76(0x91)),_0x136788=_0x33a4e0['str'](_0x130e76(0xb1)),_0x412e7b=Object[_0x130e76(0xb5)](_0x62e966[_0x130e76(0xb0)]),_0x3ec16c=resolveDeleteTarget(_0x136788,_0x412e7b),_0x2da338=_0x62e966[_0x130e76(0xb0)][_0x3ec16c];if(!_0x2da338)throw CliErrors[_0x130e76(0x9e)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x3ec16c+'\x22.');const _0x3bb9f3=resolveLocalFilePathFromLockKey(_0x62dbe8,_0x3ec16c),_0x35817c=relative(_0x62dbe8['projectRoot'],_0x3bb9f3),_0x2f2546=join(_0x62dbe8[_0x130e76(0xae)],_0x130e76(0x90),_0x35817c);return{'method':'POST','url':'/api/management/library/scripts/delete','body':{'appCode':_0x33a4e0[_0x130e76(0xa8)],'target':_0x3ec16c,'remoteId':_0x2da338[_0x130e76(0xb6)],'localFilePath':_0x3bb9f3,'trashedPath':_0x2f2546},'description':_0x130e76(0xbc)+_0x3ec16c+'\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash'};},async 'execute'(_0x4ff507){const _0x6fa4f6=a38_0x400a62,_0x3cfd8e=loadBffProjectConfig(_0x4ff507[_0x6fa4f6(0xa8)]),_0x37283a=await readBffLockFile(_0x3cfd8e[_0x6fa4f6(0x99)]);if(!_0x37283a)throw CliErrors[_0x6fa4f6(0x9e)](_0x6fa4f6(0xa7));const {lockData:_0x2602d1,appLock:_0x3117f3}=ensureLockScope(_0x37283a,_0x4ff507[_0x6fa4f6(0xa8)],_0x3cfd8e[_0x6fa4f6(0xb3)],_0x6fa4f6(0x91)),_0x349893=JSON[_0x6fa4f6(0xaf)](JSON[_0x6fa4f6(0x94)](_0x2602d1)),_0x4e8ee8=_0x349893[_0x6fa4f6(0x92)][_0x4ff507[_0x6fa4f6(0xa8)]];if(!_0x4e8ee8)throw new Error(_0x6fa4f6(0xa0)+_0x4ff507[_0x6fa4f6(0xa8)]+_0x6fa4f6(0xc3));const _0x4e099b=_0x4ff507['str']('target'),_0x336dc5=Object[_0x6fa4f6(0xb5)](_0x4e8ee8['functions']),_0x2ae25d=resolveDeleteTarget(_0x4e099b,_0x336dc5),_0x14e693=_0x4e8ee8['functions'][_0x2ae25d];if(!_0x14e693)throw CliErrors[_0x6fa4f6(0x9e)](_0x6fa4f6(0xb9)+_0x2ae25d+'\x22.');await deleteBffScript(_0x14e693[_0x6fa4f6(0xb6)]),delete _0x4e8ee8[_0x6fa4f6(0xb0)][_0x2ae25d],_0x4e8ee8[_0x6fa4f6(0xa1)]=new Date()[_0x6fa4f6(0xc1)](),await writeBffLockFile(_0x3cfd8e[_0x6fa4f6(0x99)],_0x349893);const _0x220ed5=resolveLocalFilePathFromLockKey(_0x3cfd8e,_0x2ae25d);let _0x2fff88;await fileExists(_0x220ed5)&&(_0x2fff88=await moveToTrash(_0x3cfd8e[_0x6fa4f6(0xc0)],_0x3cfd8e[_0x6fa4f6(0xae)],_0x220ed5),await cleanupEmptyDirectories(dirname(_0x220ed5),_0x3cfd8e[_0x6fa4f6(0xa3)]));await waitForDeleteSettlement(_0x3cfd8e[_0x6fa4f6(0x99)],_0x4ff507['appCode'],_0x2ae25d,_0x220ed5),await sleep(0x96);const _0x1179da={'deleted':_0x2ae25d,'remoteId':_0x14e693['remoteId']};if(_0x2fff88)_0x1179da['trashedTo']=_0x2fff88;return{'ok':!![],'data':_0x1179da,'message':'Deleted\x20'+_0x2ae25d+(_0x2fff88?_0x6fa4f6(0x9f):'')};}};function a38_0x13b0(_0x224694,_0x4bc6db){_0x224694=_0x224694-0x8c;const _0x54ac17=a38_0x54ac();let _0x13b0f3=_0x54ac17[_0x224694];return _0x13b0f3;}function resolveDeleteTarget(_0x6f45eb,_0x9564f8){const _0x101263=a38_0x400a62;if(_0x6f45eb[_0x101263(0x98)]('/')){const _0x17e98f=_0x9564f8[_0x101263(0xb2)](_0x1293fc=>_0x1293fc===_0x6f45eb);if(!_0x17e98f)throw CliErrors[_0x101263(0x9e)](_0x101263(0xa6)+_0x6f45eb);return _0x17e98f;}const _0x10af5f=_0x9564f8[_0x101263(0x96)](_0x4e7448=>_0x4e7448[_0x101263(0xab)]('/')['at'](-0x1)===_0x6f45eb);if(_0x10af5f[_0x101263(0xba)]===0x0)throw CliErrors[_0x101263(0x9e)]('Function\x20not\x20found:\x20'+_0x6f45eb);if(_0x10af5f['length']>0x1)throw CliErrors[_0x101263(0x9e)](_0x101263(0x8d)+_0x6f45eb+_0x101263(0xaa)+_0x10af5f[_0x101263(0xbd)](_0x298dec=>'\x20\x20-\x20'+_0x298dec)[_0x101263(0x93)]('\x0a'));return _0x10af5f[0x0];}async function moveToTrash(_0xa4ed9e,_0x20e9d8,_0x390146){const _0xf445f0=a38_0x400a62,_0x59708c=new Date()['toISOString']()[_0xf445f0(0xa5)](/[:.]/g,'-'),_0x5a2b63=relative(_0xa4ed9e,_0x390146),_0x4e5c6a=join(_0x20e9d8,_0x59708c,_0x5a2b63);return await mkdir(dirname(_0x4e5c6a),{'recursive':!![]}),await rename(_0x390146,_0x4e5c6a),_0x4e5c6a;}async function cleanupEmptyDirectories(_0x2a16d0,_0xe480a7){const _0x6123b7=a38_0x400a62;let _0x516c68=resolve(_0x2a16d0);const _0x1404ad=resolve(_0xe480a7);while(_0x516c68[_0x6123b7(0x8f)](''+_0x1404ad+sep)||_0x516c68===_0x1404ad){if(_0x516c68===_0x1404ad)return;try{const _0x342405=await readdir(_0x516c68);if(_0x342405['length']>0x0)return;await rmdir(_0x516c68);}catch{return;}_0x516c68=dirname(_0x516c68);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x2e9ea8,_0x2b9358,_0xd49c8a,_0x3ebb2c){const _0x50550b=a38_0x400a62;for(let _0x279664=0x0;_0x279664<DELETE_SETTLE_RETRY_COUNT;_0x279664+=0x1){const _0x332534=await readBffLockFile(_0x2e9ea8),_0x446034=!!_0x332534?.[_0x50550b(0x92)]?.[_0x2b9358]?.[_0x50550b(0xb0)]?.[_0xd49c8a],_0x3201e3=await fileExists(_0x3ebb2c);if(!_0x446034&&!_0x3201e3)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x50550b(0xa2)+_0xd49c8a+'.');}
1
+ const a38_0x5db290=a38_0x4573;(function(_0x141b79,_0x2e148a){const _0x3aa86b=a38_0x4573,_0x16bc57=_0x141b79();while(!![]){try{const _0x26143e=-parseInt(_0x3aa86b(0x194))/0x1+parseInt(_0x3aa86b(0x195))/0x2*(parseInt(_0x3aa86b(0x171))/0x3)+-parseInt(_0x3aa86b(0x183))/0x4+-parseInt(_0x3aa86b(0x17b))/0x5*(parseInt(_0x3aa86b(0x172))/0x6)+-parseInt(_0x3aa86b(0x17e))/0x7+-parseInt(_0x3aa86b(0x197))/0x8*(parseInt(_0x3aa86b(0x18b))/0x9)+parseInt(_0x3aa86b(0x174))/0xa*(parseInt(_0x3aa86b(0x177))/0xb);if(_0x26143e===_0x2e148a)break;else _0x16bc57['push'](_0x16bc57['shift']());}catch(_0x3bb230){_0x16bc57['push'](_0x16bc57['shift']());}}}(a38_0x329f,0x8bce0));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';function a38_0x329f(){const _0x1c950e=['map','3832368ycYTmq','filter','scriptsRoot','Deleted\x20','target','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','trashDir','Backend\x20Function\x20lock\x20file\x20not\x20found.','toISOString','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','validation','appCode','6jNzJuU','560778MTbhXL','high-risk-write','10yoBdWz','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','38314870WTRngq','apps','replace','stringify','55QhDaDQ','POST','functions','5056660KPWcMK','Lock\x20scope\x20for\x20app\x20\x22','Function\x20not\x20found:\x20','Would\x20delete\x20','No\x20lock\x20entry\x20found\x20for\x20\x22','1743612RmuEru','projectRoot','Local\x20delete\x20not\x20settled\x20for\x20','string','lockFilePath','delete','Multiple\x20functions\x20match\x20\x22','remoteId','18skVsQz','includes','split','length','lastSync','scriptsRootDir','parse','\x20\x20-\x20','startsWith','145998CJgXix','379936SvmTzF'];a38_0x329f=function(){return _0x1c950e;};return a38_0x329f();}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':'delete','description':a38_0x5db290(0x16e),'risk':a38_0x5db290(0x173),'flags':[{'name':a38_0x5db290(0x169),'type':a38_0x5db290(0x186),'required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x19ac31){const _0x52c18a=a38_0x5db290,_0x423790=loadBffProjectConfig(_0x19ac31[_0x52c18a(0x170)]),_0x1ccd56=await readBffLockFile(_0x423790[_0x52c18a(0x187)]);if(!_0x1ccd56)throw CliErrors[_0x52c18a(0x16f)](_0x52c18a(0x176));},async 'dryRun'(_0x8d4712){const _0x439aa6=a38_0x5db290,_0x49cbc2=loadBffProjectConfig(_0x8d4712[_0x439aa6(0x170)]),_0x19cf92=await readBffLockFile(_0x49cbc2[_0x439aa6(0x187)]);if(!_0x19cf92)throw CliErrors[_0x439aa6(0x16f)](_0x439aa6(0x16c));const {appLock:_0x27da0a}=ensureLockScope(_0x19cf92,_0x8d4712[_0x439aa6(0x170)],_0x49cbc2[_0x439aa6(0x199)],_0x439aa6(0x188)),_0x3099f5=_0x8d4712['str']('target'),_0x2022a3=Object['keys'](_0x27da0a[_0x439aa6(0x17d)]),_0x5b921b=resolveDeleteTarget(_0x3099f5,_0x2022a3),_0x553a2b=_0x27da0a[_0x439aa6(0x17d)][_0x5b921b];if(!_0x553a2b)throw CliErrors[_0x439aa6(0x16f)](_0x439aa6(0x182)+_0x5b921b+'\x22.');const _0x370aa2=resolveLocalFilePathFromLockKey(_0x49cbc2,_0x5b921b),_0x2db96f=relative(_0x49cbc2[_0x439aa6(0x184)],_0x370aa2),_0x2b4a25=join(_0x49cbc2['trashDir'],'<timestamp>',_0x2db96f);return{'method':_0x439aa6(0x17c),'url':'/api/management/library/scripts/delete','body':{'appCode':_0x8d4712[_0x439aa6(0x170)],'target':_0x5b921b,'remoteId':_0x553a2b[_0x439aa6(0x18a)],'localFilePath':_0x370aa2,'trashedPath':_0x2b4a25},'description':_0x439aa6(0x181)+_0x5b921b+_0x439aa6(0x16a)};},async 'execute'(_0x420431){const _0x5dad94=a38_0x5db290,_0x52c44a=loadBffProjectConfig(_0x420431[_0x5dad94(0x170)]),_0x3031f3=await readBffLockFile(_0x52c44a[_0x5dad94(0x187)]);if(!_0x3031f3)throw CliErrors['validation'](_0x5dad94(0x16c));const {lockData:_0xc0778c,appLock:_0x3f8837}=ensureLockScope(_0x3031f3,_0x420431['appCode'],_0x52c44a['scriptsRoot'],_0x5dad94(0x188)),_0x3d9b76=JSON[_0x5dad94(0x191)](JSON[_0x5dad94(0x17a)](_0xc0778c)),_0x44bf59=_0x3d9b76[_0x5dad94(0x178)][_0x420431[_0x5dad94(0x170)]];if(!_0x44bf59)throw new Error(_0x5dad94(0x17f)+_0x420431[_0x5dad94(0x170)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x25f126=_0x420431['str'](_0x5dad94(0x169)),_0x977841=Object['keys'](_0x44bf59[_0x5dad94(0x17d)]),_0x57ec5a=resolveDeleteTarget(_0x25f126,_0x977841),_0x478f3f=_0x44bf59[_0x5dad94(0x17d)][_0x57ec5a];if(!_0x478f3f)throw CliErrors[_0x5dad94(0x16f)](_0x5dad94(0x182)+_0x57ec5a+'\x22.');await deleteBffScript(_0x478f3f[_0x5dad94(0x18a)]),delete _0x44bf59['functions'][_0x57ec5a],_0x44bf59[_0x5dad94(0x18f)]=new Date()[_0x5dad94(0x16d)](),await writeBffLockFile(_0x52c44a['lockFilePath'],_0x3d9b76);const _0x3aab11=resolveLocalFilePathFromLockKey(_0x52c44a,_0x57ec5a);let _0x5e0fb9;await fileExists(_0x3aab11)&&(_0x5e0fb9=await moveToTrash(_0x52c44a['projectRoot'],_0x52c44a[_0x5dad94(0x16b)],_0x3aab11),await cleanupEmptyDirectories(dirname(_0x3aab11),_0x52c44a[_0x5dad94(0x190)]));await waitForDeleteSettlement(_0x52c44a[_0x5dad94(0x187)],_0x420431[_0x5dad94(0x170)],_0x57ec5a,_0x3aab11),await sleep(0x96);const _0x8e299e={'deleted':_0x57ec5a,'remoteId':_0x478f3f['remoteId']};if(_0x5e0fb9)_0x8e299e['trashedTo']=_0x5e0fb9;return{'ok':!![],'data':_0x8e299e,'message':_0x5dad94(0x19a)+_0x57ec5a+(_0x5e0fb9?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function a38_0x4573(_0x3ea50e,_0x56ecde){_0x3ea50e=_0x3ea50e-0x169;const _0x329ff2=a38_0x329f();let _0x4573b1=_0x329ff2[_0x3ea50e];return _0x4573b1;}function resolveDeleteTarget(_0x44347a,_0x35ac68){const _0x5d62bf=a38_0x5db290;if(_0x44347a[_0x5d62bf(0x18c)]('/')){const _0x4c2d15=_0x35ac68['find'](_0x1ed08e=>_0x1ed08e===_0x44347a);if(!_0x4c2d15)throw CliErrors['validation'](_0x5d62bf(0x180)+_0x44347a);return _0x4c2d15;}const _0x401b5e=_0x35ac68[_0x5d62bf(0x198)](_0x3be6a3=>_0x3be6a3[_0x5d62bf(0x18d)]('/')['at'](-0x1)===_0x44347a);if(_0x401b5e[_0x5d62bf(0x18e)]===0x0)throw CliErrors['validation'](_0x5d62bf(0x180)+_0x44347a);if(_0x401b5e[_0x5d62bf(0x18e)]>0x1)throw CliErrors['validation'](_0x5d62bf(0x189)+_0x44347a+_0x5d62bf(0x175)+_0x401b5e[_0x5d62bf(0x196)](_0x478efa=>_0x5d62bf(0x192)+_0x478efa)['join']('\x0a'));return _0x401b5e[0x0];}async function moveToTrash(_0x236485,_0x580f03,_0x447a48){const _0x2b2804=a38_0x5db290,_0x362420=new Date()[_0x2b2804(0x16d)]()[_0x2b2804(0x179)](/[:.]/g,'-'),_0x52cb6d=relative(_0x236485,_0x447a48),_0x46514f=join(_0x580f03,_0x362420,_0x52cb6d);return await mkdir(dirname(_0x46514f),{'recursive':!![]}),await rename(_0x447a48,_0x46514f),_0x46514f;}async function cleanupEmptyDirectories(_0x187149,_0x2ce1f9){const _0x249618=a38_0x5db290;let _0x31cad8=resolve(_0x187149);const _0x2cfd21=resolve(_0x2ce1f9);while(_0x31cad8[_0x249618(0x193)](''+_0x2cfd21+sep)||_0x31cad8===_0x2cfd21){if(_0x31cad8===_0x2cfd21)return;try{const _0xbdb9f0=await readdir(_0x31cad8);if(_0xbdb9f0['length']>0x0)return;await rmdir(_0x31cad8);}catch{return;}_0x31cad8=dirname(_0x31cad8);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x3fb12e,_0x9898b5,_0x311e47,_0x9a78c7){const _0xb5fa79=a38_0x5db290;for(let _0x286bd3=0x0;_0x286bd3<DELETE_SETTLE_RETRY_COUNT;_0x286bd3+=0x1){const _0x5bcbe4=await readBffLockFile(_0x3fb12e),_0x37798d=!!_0x5bcbe4?.['apps']?.[_0x9898b5]?.[_0xb5fa79(0x17d)]?.[_0x311e47],_0x1969d6=await fileExists(_0x9a78c7);if(!_0x37798d&&!_0x1969d6)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0xb5fa79(0x185)+_0x311e47+'.');}
@@ -1 +1 @@
1
- const a39_0x21d2d4=a39_0x3204;(function(_0x4c51e1,_0x5a2772){const _0x141135=a39_0x3204,_0xf1b427=_0x4c51e1();while(!![]){try{const _0x4875bc=-parseInt(_0x141135(0x176))/0x1+parseInt(_0x141135(0x16e))/0x2*(parseInt(_0x141135(0x17a))/0x3)+parseInt(_0x141135(0x17d))/0x4*(parseInt(_0x141135(0x164))/0x5)+parseInt(_0x141135(0x17e))/0x6*(parseInt(_0x141135(0x16d))/0x7)+parseInt(_0x141135(0x16f))/0x8*(parseInt(_0x141135(0x169))/0x9)+parseInt(_0x141135(0x173))/0xa*(-parseInt(_0x141135(0x177))/0xb)+parseInt(_0x141135(0x178))/0xc;if(_0x4875bc===_0x5a2772)break;else _0xf1b427['push'](_0xf1b427['shift']());}catch(_0x363063){_0xf1b427['push'](_0xf1b427['shift']());}}}(a39_0x46e9,0xa39bb));function a39_0x3204(_0x19b076,_0x1452dc){_0x19b076=_0x19b076-0x164;const _0x46e9e0=a39_0x46e9();let _0x320447=_0x46e9e0[_0x19b076];return _0x320447;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x21d2d4(0x17c),'command':a39_0x21d2d4(0x165),'description':a39_0x21d2d4(0x17b),'risk':a39_0x21d2d4(0x179),'flags':[{'name':'id','type':a39_0x21d2d4(0x16a),'required':!![],'description':a39_0x21d2d4(0x172)},{'name':a39_0x21d2d4(0x174),'type':a39_0x21d2d4(0x175),'description':a39_0x21d2d4(0x16b)}],async 'execute'(_0xda13d6){const _0x4b162f=a39_0x21d2d4,_0x3d38a9=await getBffScriptInfo(_0xda13d6[_0x4b162f(0x167)]('id')),_0x15f8f0=_0xda13d6[_0x4b162f(0x16c)](_0x4b162f(0x174));if(_0x15f8f0)return{'ok':!![],'data':_0x3d38a9};return{'ok':!![],'data':{'id':_0x3d38a9['id'],'functionName':_0x3d38a9['functionName']??'','version':_0x3d38a9[_0x4b162f(0x168)]??'','updateUserName':_0x3d38a9[_0x4b162f(0x171)]??'','appCode':_0x3d38a9[_0x4b162f(0x166)],'scriptType':_0x3d38a9[_0x4b162f(0x170)],'description':_0x3d38a9['description']||'(none)','createdTime':_0x3d38a9['createdTime']??'','updatedTime':_0x3d38a9['updatedTime']??'','scriptContent':_0x3d38a9['scriptContent']??''}};}};function a39_0x46e9(){const _0xfc094=['scriptType','updateUserName','Script\x20ID','19270WOhUYo','verbose','boolean','1316170BJaxwl','902tqeMer','6106224YOwNfw','read','1263HlYIIT','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','bff','10316BpcFAB','30WGChyc','35FvCzmy','detail','appCode','num','version','9oBsOhQ','number','Return\x20full\x20raw\x20script\x20object','bool','430129AclPUY','1040TPIPfn','8730104uqNaoN'];a39_0x46e9=function(){return _0xfc094;};return a39_0x46e9();}
1
+ const a39_0x249099=a39_0x12d7;function a39_0x12d7(_0x53977f,_0x22adc8){_0x53977f=_0x53977f-0x129;const _0xdb648a=a39_0xdb64();let _0x12d7a1=_0xdb648a[_0x53977f];return _0x12d7a1;}function a39_0xdb64(){const _0x1a92d1=['updatedTime','scriptType','15084390IzSekB','2387403WOtlVC','bff','updateUserName','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','read','number','368466tPmqOG','4314QZfkDR','scriptContent','46014MzsPDQ','590ZodyfY','145wuWdll','version','1655556bNSZDv','functionName','boolean','(none)','detail','184RrrAHd','128807bVtIWc','Return\x20full\x20raw\x20script\x20object','description','appCode','verbose','Script\x20ID'];a39_0xdb64=function(){return _0x1a92d1;};return a39_0xdb64();}(function(_0x4063ce,_0x289cf5){const _0x403f98=a39_0x12d7,_0x1f012d=_0x4063ce();while(!![]){try{const _0x29cd0b=-parseInt(_0x403f98(0x12d))/0x1+parseInt(_0x403f98(0x131))/0x2*(-parseInt(_0x403f98(0x12e))/0x3)+parseInt(_0x403f98(0x134))/0x4+-parseInt(_0x403f98(0x132))/0x5*(parseInt(_0x403f98(0x130))/0x6)+parseInt(_0x403f98(0x13a))/0x7*(-parseInt(_0x403f98(0x139))/0x8)+-parseInt(_0x403f98(0x143))/0x9+parseInt(_0x403f98(0x142))/0xa;if(_0x29cd0b===_0x289cf5)break;else _0x1f012d['push'](_0x1f012d['shift']());}catch(_0x2a1f54){_0x1f012d['push'](_0x1f012d['shift']());}}}(a39_0xdb64,0x35689));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x249099(0x144),'command':a39_0x249099(0x138),'description':a39_0x249099(0x12a),'risk':a39_0x249099(0x12b),'flags':[{'name':'id','type':a39_0x249099(0x12c),'required':!![],'description':a39_0x249099(0x13f)},{'name':'verbose','type':a39_0x249099(0x136),'description':a39_0x249099(0x13b)}],async 'execute'(_0x122cc0){const _0x3bd92c=a39_0x249099,_0x49cebd=await getBffScriptInfo(_0x122cc0['num']('id')),_0x293d7e=_0x122cc0['bool'](_0x3bd92c(0x13e));if(_0x293d7e)return{'ok':!![],'data':_0x49cebd};return{'ok':!![],'data':{'id':_0x49cebd['id'],'functionName':_0x49cebd[_0x3bd92c(0x135)]??'','version':_0x49cebd[_0x3bd92c(0x133)]??'','updateUserName':_0x49cebd[_0x3bd92c(0x129)]??'','appCode':_0x49cebd[_0x3bd92c(0x13d)],'scriptType':_0x49cebd[_0x3bd92c(0x141)],'description':_0x49cebd[_0x3bd92c(0x13c)]||_0x3bd92c(0x137),'createdTime':_0x49cebd['createdTime']??'','updatedTime':_0x49cebd[_0x3bd92c(0x140)]??'','scriptContent':_0x49cebd[_0x3bd92c(0x12f)]??''}};}};
@@ -1 +1 @@
1
- (function(_0x446b6b,_0x530afd){const _0x5baf4=a40_0x3eb8,_0x48b89f=_0x446b6b();while(!![]){try{const _0x29c6fd=-parseInt(_0x5baf4(0x7d))/0x1*(-parseInt(_0x5baf4(0x82))/0x2)+-parseInt(_0x5baf4(0x79))/0x3*(-parseInt(_0x5baf4(0x7a))/0x4)+-parseInt(_0x5baf4(0x7e))/0x5+parseInt(_0x5baf4(0x80))/0x6+-parseInt(_0x5baf4(0x7b))/0x7+-parseInt(_0x5baf4(0x7f))/0x8+-parseInt(_0x5baf4(0x7c))/0x9*(parseInt(_0x5baf4(0x81))/0xa);if(_0x29c6fd===_0x530afd)break;else _0x48b89f['push'](_0x48b89f['shift']());}catch(_0x47cf6f){_0x48b89f['push'](_0x48b89f['shift']());}}}(a40_0x18eb,0x7eb83));function a40_0x3eb8(_0x3a7162,_0x38cfc){_0x3a7162=_0x3a7162-0x79;const _0x18eb16=a40_0x18eb();let _0x3eb8a1=_0x18eb16[_0x3a7162];return _0x3eb8a1;}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a40_0x18eb(){const _0x31973d=['505550KHQuWr','54818JrjHTS','15asEidY','191432BkqWZL','1073905YEsMFU','9CoWwMP','17ABnIRa','3717125hcBuRg','1705896bEpWVu','5846592lBvXIb'];a40_0x18eb=function(){return _0x31973d;};return a40_0x18eb();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ function a40_0x1a60(_0x5cea25,_0x5c5558){_0x5cea25=_0x5cea25-0x15f;const _0x47ae5f=a40_0x47ae();let _0x1a6019=_0x47ae5f[_0x5cea25];return _0x1a6019;}(function(_0x4c652c,_0x4df5e9){const _0x3f05b4=a40_0x1a60,_0x454321=_0x4c652c();while(!![]){try{const _0x38e264=-parseInt(_0x3f05b4(0x162))/0x1*(parseInt(_0x3f05b4(0x16b))/0x2)+parseInt(_0x3f05b4(0x164))/0x3*(parseInt(_0x3f05b4(0x167))/0x4)+parseInt(_0x3f05b4(0x15f))/0x5*(-parseInt(_0x3f05b4(0x169))/0x6)+parseInt(_0x3f05b4(0x166))/0x7*(parseInt(_0x3f05b4(0x161))/0x8)+-parseInt(_0x3f05b4(0x165))/0x9*(parseInt(_0x3f05b4(0x160))/0xa)+parseInt(_0x3f05b4(0x163))/0xb*(parseInt(_0x3f05b4(0x16a))/0xc)+-parseInt(_0x3f05b4(0x168))/0xd;if(_0x38e264===_0x4df5e9)break;else _0x454321['push'](_0x454321['shift']());}catch(_0x40ddd6){_0x454321['push'](_0x454321['shift']());}}}(a40_0x47ae,0xea88f));import{bffList}from'../../commands/bff/list.js';function a40_0x47ae(){const _0x4d23a2=['112YkFroN','1021fxfCPr','4939HofMTg','108OGxrSG','1106883LQEfOq','954086NqpHhL','179016nKhzce','12331475rMieWk','180cOwXvT','46452Urpttr','2434DKhMlT','63965PfGptr','140EaEndR'];a40_0x47ae=function(){return _0x4d23a2;};return a40_0x47ae();}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';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a41_0x34b995=a41_0x2406;(function(_0x3da265,_0x174637){const _0x240672=a41_0x2406,_0x4e1cd4=_0x3da265();while(!![]){try{const _0x3c2cbf=-parseInt(_0x240672(0x1f4))/0x1+-parseInt(_0x240672(0x1f8))/0x2*(-parseInt(_0x240672(0x206))/0x3)+-parseInt(_0x240672(0x1ff))/0x4+-parseInt(_0x240672(0x201))/0x5*(parseInt(_0x240672(0x202))/0x6)+-parseInt(_0x240672(0x1f7))/0x7*(-parseInt(_0x240672(0x205))/0x8)+-parseInt(_0x240672(0x207))/0x9+parseInt(_0x240672(0x208))/0xa*(parseInt(_0x240672(0x204))/0xb);if(_0x3c2cbf===_0x174637)break;else _0x4e1cd4['push'](_0x4e1cd4['shift']());}catch(_0x37fca2){_0x4e1cd4['push'](_0x4e1cd4['shift']());}}}(a41_0x4610,0x3e570));function a41_0x2406(_0x41942c,_0x2beb53){_0x41942c=_0x41942c-0x1f3;const _0x4610fa=a41_0x4610();let _0x24069f=_0x4610fa[_0x41942c];return _0x24069f;}function a41_0x4610(){const _0x2a425e=['102WqOsbL','description','8909153ahPfzE','8HQHGqO','11658uuyacE','105066nqzVgE','10uralRr','bool','name','Filter\x20by\x20script\x20name','scriptType','string','verbose','462157pgKpzg','No\x20Backend\x20Function\x20scripts\x20found.','List\x20Backend\x20Function\x20scripts','2435797WbUmaa','136fplYvj','type','ENDPOINT','str','COMMON','functionName','map','1010396QMKDev','appCode','129520lIFyiA'];a41_0x4610=function(){return _0x2a425e;};return a41_0x4610();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':'list','description':a41_0x34b995(0x1f6),'risk':'read','flags':[{'name':a41_0x34b995(0x1f9),'type':a41_0x34b995(0x20d),'description':'Script\x20type\x20filter','default':a41_0x34b995(0x1fa),'enum':['ENDPOINT',a41_0x34b995(0x1fc)]},{'name':a41_0x34b995(0x20a),'type':'string','description':a41_0x34b995(0x20b)},{'name':'verbose','type':'boolean','description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x6398d7){const _0x183483=a41_0x34b995,_0xfd7490=await listBffScripts(_0x6398d7[_0x183483(0x200)],_0x6398d7[_0x183483(0x1fb)](_0x183483(0x1f9)),{'scriptName':_0x6398d7[_0x183483(0x1fb)](_0x183483(0x20a))||undefined}),_0x32a79f=_0x6398d7[_0x183483(0x209)](_0x183483(0x1f3));return{'ok':!![],'data':_0x32a79f?_0xfd7490:_0xfd7490[_0x183483(0x1fe)](_0x37a2ce=>({'id':_0x37a2ce['id'],'functionName':_0x37a2ce[_0x183483(0x1fd)]??'','description':_0x37a2ce[_0x183483(0x203)]||'(unnamed)','scriptType':_0x37a2ce[_0x183483(0x20c)]})),'message':_0xfd7490['length']===0x0?_0x183483(0x1f5):undefined};}};
1
+ const a41_0x25f38e=a41_0x210e;function a41_0x210e(_0x1b4df8,_0x23f51f){_0x1b4df8=_0x1b4df8-0xaa;const _0x35fc16=a41_0x35fc();let _0x210ece=_0x35fc16[_0x1b4df8];return _0x210ece;}function a41_0x35fc(){const _0x1982b1=['name','read','bff','list','No\x20Backend\x20Function\x20scripts\x20found.','318Zizxie','type','5071599ihITKE','2933679QujeMf','6647424RLYCKG','2869390DMRmAF','Return\x20full\x20script\x20objects','1188406gzLMAT','string','2PLSuLD','11221lzrQDz','List\x20Backend\x20Function\x20scripts','boolean','appCode','(unnamed)','1386248GNWKhw','Filter\x20by\x20script\x20name','str','description','verbose','ENDPOINT','map'];a41_0x35fc=function(){return _0x1982b1;};return a41_0x35fc();}(function(_0x1e01fc,_0x184e06){const _0x531abb=a41_0x210e,_0x3309ea=_0x1e01fc();while(!![]){try{const _0x5a1965=parseInt(_0x531abb(0xb2))/0x1*(-parseInt(_0x531abb(0xb4))/0x2)+parseInt(_0x531abb(0xae))/0x3+parseInt(_0x531abb(0xba))/0x4+parseInt(_0x531abb(0xb0))/0x5+parseInt(_0x531abb(0xab))/0x6*(-parseInt(_0x531abb(0xb5))/0x7)+parseInt(_0x531abb(0xaf))/0x8+-parseInt(_0x531abb(0xad))/0x9;if(_0x5a1965===_0x184e06)break;else _0x3309ea['push'](_0x3309ea['shift']());}catch(_0x3895d2){_0x3309ea['push'](_0x3309ea['shift']());}}}(a41_0x35fc,0xd9de1));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x25f38e(0xc3),'command':a41_0x25f38e(0xc4),'description':a41_0x25f38e(0xb6),'risk':a41_0x25f38e(0xc2),'flags':[{'name':a41_0x25f38e(0xac),'type':a41_0x25f38e(0xb3),'description':'Script\x20type\x20filter','default':a41_0x25f38e(0xbf),'enum':[a41_0x25f38e(0xbf),'COMMON']},{'name':a41_0x25f38e(0xc1),'type':'string','description':a41_0x25f38e(0xbb)},{'name':a41_0x25f38e(0xbe),'type':a41_0x25f38e(0xb7),'description':a41_0x25f38e(0xb1)}],async 'execute'(_0x2600b9){const _0x56fc58=a41_0x25f38e,_0x4e9169=await listBffScripts(_0x2600b9[_0x56fc58(0xb8)],_0x2600b9[_0x56fc58(0xbc)]('type'),{'scriptName':_0x2600b9['str']('name')||undefined}),_0x2f3265=_0x2600b9['bool'](_0x56fc58(0xbe));return{'ok':!![],'data':_0x2f3265?_0x4e9169:_0x4e9169[_0x56fc58(0xc0)](_0x24b1ac=>({'id':_0x24b1ac['id'],'functionName':_0x24b1ac['functionName']??'','description':_0x24b1ac[_0x56fc58(0xbd)]||_0x56fc58(0xb9),'scriptType':_0x24b1ac['scriptType']})),'message':_0x4e9169['length']===0x0?_0x56fc58(0xaa):undefined};}};
@@ -1 +1 @@
1
- const a42_0x29566c=a42_0x54d8;function a42_0x54d8(_0x2398ed,_0x253056){_0x2398ed=_0x2398ed-0xba;const _0x277f28=a42_0x277f();let _0x54d8f5=_0x277f28[_0x2398ed];return _0x54d8f5;}(function(_0x34d002,_0x2aaad7){const _0x536815=a42_0x54d8,_0x2bbb8f=_0x34d002();while(!![]){try{const _0x4bd2f1=parseInt(_0x536815(0xe6))/0x1*(-parseInt(_0x536815(0xbd))/0x2)+parseInt(_0x536815(0xda))/0x3*(parseInt(_0x536815(0xce))/0x4)+-parseInt(_0x536815(0xc7))/0x5*(-parseInt(_0x536815(0xde))/0x6)+parseInt(_0x536815(0xd0))/0x7+-parseInt(_0x536815(0xc3))/0x8*(parseInt(_0x536815(0xd6))/0x9)+-parseInt(_0x536815(0xd7))/0xa+-parseInt(_0x536815(0xc6))/0xb*(-parseInt(_0x536815(0xd8))/0xc);if(_0x4bd2f1===_0x2aaad7)break;else _0x2bbb8f['push'](_0x2bbb8f['shift']());}catch(_0x2027e1){_0x2bbb8f['push'](_0x2bbb8f['shift']());}}}(a42_0x277f,0x646e9));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x277f(){const _0x133a58=['end-time','15DIhoPs','length','validation','since','6YSGwEn','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','INFO','str','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','trim','bff','17dWQxzh','flag','limit','WARN','88174mzHJmi','logs','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','--end-time','appCode','88jrHryK','num','--limit','52976gReiZo','2245735WFNvnf','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','--start-time','DEBUG','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','now','Maximum\x20log\x20lines\x20to\x20return\x20(1-','581372VjYnqZ','number','2400566rxkTGn','\x20Backend\x20Function\x20log\x20line(s).','level','start-time','ERROR','Filter\x20by\x20log\x20level','158607fFsmJj','4193470UifPAG','636EKlIdN'];a42_0x277f=function(){return _0x133a58;};return a42_0x277f();}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_0x29566c(0xca),a42_0x29566c(0xe0),a42_0x29566c(0xbc),a42_0x29566c(0xd4)];export function resolveBffLogQuery(_0x59a375,_0x2720c6=Date[a42_0x29566c(0xcc)]()){const _0x3c203b=a42_0x29566c,_0x2c6c71=_0x59a375[_0x3c203b(0xba)](_0x3c203b(0xdd)),_0x4a7226=_0x59a375[_0x3c203b(0xba)]('start-time'),_0x4c3179=_0x59a375[_0x3c203b(0xba)](_0x3c203b(0xd9));if(_0x2c6c71!==undefined&&_0x4a7226!==undefined)throw CliErrors['validation'](_0x3c203b(0xbf));const _0x5e260c=_0x4c3179===undefined?_0x2720c6:readPositiveInteger(_0x59a375['num'](_0x3c203b(0xd9)),_0x3c203b(0xc1)),_0x39749f=_0x4a7226===undefined?_0x5e260c-readSinceMinutes(_0x59a375)*0xea60:readPositiveInteger(_0x59a375[_0x3c203b(0xc4)](_0x3c203b(0xd3)),_0x3c203b(0xc9));if(_0x39749f<=0x0)throw CliErrors['validation']('The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.');if(_0x39749f>_0x5e260c)throw CliErrors[_0x3c203b(0xdc)](_0x3c203b(0xc0));const _0x3f073e=readPositiveInteger(_0x59a375[_0x3c203b(0xc4)]('limit',DEFAULT_LIMIT),_0x3c203b(0xc5));if(_0x3f073e>MAX_LIMIT)throw CliErrors[_0x3c203b(0xdc)]('--limit\x20must\x20be\x20between\x201\x20and\x20'+MAX_LIMIT+'.');const _0x4541c8=_0x59a375[_0x3c203b(0xe1)](_0x3c203b(0xd2))[_0x3c203b(0xe4)]()['toUpperCase']()||undefined,_0x4999f4=_0x59a375[_0x3c203b(0xe1)]('keyword')[_0x3c203b(0xe4)]()||undefined;return{'appCode':_0x59a375[_0x3c203b(0xc2)],'startTime':_0x39749f,'endTime':_0x5e260c,..._0x4a7226===undefined?{'sinceMinutes':readSinceMinutes(_0x59a375)}:{},..._0x4541c8?{'level':_0x4541c8}:{},..._0x4999f4?{'keyword':_0x4999f4}:{},'limit':_0x3f073e};}function readSinceMinutes(_0x4e0dc1){const _0x4b5179=a42_0x29566c;return readPositiveInteger(_0x4e0dc1[_0x4b5179(0xc4)](_0x4b5179(0xdd),DEFAULT_SINCE_MINUTES),'--since');}function readPositiveInteger(_0x800bc9,_0x1de828){const _0x348be2=a42_0x29566c;if(!Number['isSafeInteger'](_0x800bc9)||_0x800bc9<=0x0)throw CliErrors[_0x348be2(0xdc)](_0x1de828+'\x20must\x20be\x20a\x20positive\x20integer.');return _0x800bc9;}export const bffLogs={'service':a42_0x29566c(0xe5),'command':a42_0x29566c(0xbe),'description':'Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','risk':'read','structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x29566c(0xdd),'type':a42_0x29566c(0xcf),'description':a42_0x29566c(0xdf)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x29566c(0xd3),'type':a42_0x29566c(0xcf),'description':a42_0x29566c(0xe3)},{'name':a42_0x29566c(0xd9),'type':'number','description':a42_0x29566c(0xe2)},{'name':a42_0x29566c(0xd2),'type':'string','description':a42_0x29566c(0xd5),'enum':LOG_LEVELS},{'name':'keyword','type':'string','description':a42_0x29566c(0xcb)},{'name':a42_0x29566c(0xbb),'type':a42_0x29566c(0xcf),'description':a42_0x29566c(0xcd)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x11ce3e){resolveBffLogQuery(_0x11ce3e);},async 'execute'(_0x4af376){const _0x4e6dea=a42_0x29566c,_0x505ad6=resolveBffLogQuery(_0x4af376),{sinceMinutes:_0x3fa8f0,..._0x2127d3}=_0x505ad6,_0x1a0c78=await searchBffScriptLogs(_0x2127d3);return{'ok':!![],'data':{'query':_0x505ad6,'count':_0x1a0c78[_0x4e6dea(0xdb)],'logs':_0x1a0c78},'message':_0x1a0c78['length']===0x0?_0x4e6dea(0xc8):'Found\x20'+_0x1a0c78[_0x4e6dea(0xdb)]+_0x4e6dea(0xd1)};}};
1
+ const a42_0x1798b1=a42_0x3218;(function(_0x49d68f,_0xc17aa4){const _0x2e334f=a42_0x3218,_0x4c7686=_0x49d68f();while(!![]){try{const _0x429c5c=-parseInt(_0x2e334f(0x85))/0x1*(parseInt(_0x2e334f(0x8c))/0x2)+parseInt(_0x2e334f(0x9b))/0x3+parseInt(_0x2e334f(0x92))/0x4+-parseInt(_0x2e334f(0x76))/0x5*(-parseInt(_0x2e334f(0x94))/0x6)+-parseInt(_0x2e334f(0x79))/0x7+-parseInt(_0x2e334f(0x74))/0x8+parseInt(_0x2e334f(0x87))/0x9;if(_0x429c5c===_0xc17aa4)break;else _0x4c7686['push'](_0x4c7686['shift']());}catch(_0xd93458){_0x4c7686['push'](_0x4c7686['shift']());}}}(a42_0x51c1,0x71b39));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';function a42_0x3218(_0x265aa9,_0x1f15d8){_0x265aa9=_0x265aa9-0x74;const _0x51c1e6=a42_0x51c1();let _0x32185b=_0x51c1e6[_0x265aa9];return _0x32185b;}import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0x1798b1(0x9a),'INFO',a42_0x1798b1(0x8d),a42_0x1798b1(0x7d)];export function resolveBffLogQuery(_0x34d16d,_0x132654=Date[a42_0x1798b1(0x9c)]()){const _0x200650=a42_0x1798b1,_0x44a65e=_0x34d16d[_0x200650(0x84)](_0x200650(0x91)),_0x5183fa=_0x34d16d[_0x200650(0x84)](_0x200650(0x90)),_0x5a5f4e=_0x34d16d[_0x200650(0x84)](_0x200650(0x77));if(_0x44a65e!==undefined&&_0x5183fa!==undefined)throw CliErrors['validation']('--since\x20cannot\x20be\x20combined\x20with\x20--start-time.');const _0x1206de=_0x5a5f4e===undefined?_0x132654:readPositiveInteger(_0x34d16d[_0x200650(0x78)]('end-time'),_0x200650(0x7a)),_0x2160db=_0x5183fa===undefined?_0x1206de-readSinceMinutes(_0x34d16d)*0xea60:readPositiveInteger(_0x34d16d[_0x200650(0x78)](_0x200650(0x90)),_0x200650(0x95));if(_0x2160db<=0x0)throw CliErrors[_0x200650(0x8a)]('The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.');if(_0x2160db>_0x1206de)throw CliErrors[_0x200650(0x8a)](_0x200650(0x93));const _0x172677=readPositiveInteger(_0x34d16d['num'](_0x200650(0x96),DEFAULT_LIMIT),'--limit');if(_0x172677>MAX_LIMIT)throw CliErrors[_0x200650(0x8a)](_0x200650(0x97)+MAX_LIMIT+'.');const _0x5c87b5=_0x34d16d[_0x200650(0x7f)](_0x200650(0x89))['trim']()[_0x200650(0x81)]()||undefined,_0x367841=_0x34d16d[_0x200650(0x7f)](_0x200650(0x98))[_0x200650(0x7c)]()||undefined;return{'appCode':_0x34d16d[_0x200650(0x8e)],'startTime':_0x2160db,'endTime':_0x1206de,..._0x5183fa===undefined?{'sinceMinutes':readSinceMinutes(_0x34d16d)}:{},..._0x5c87b5?{'level':_0x5c87b5}:{},..._0x367841?{'keyword':_0x367841}:{},'limit':_0x172677};}function a42_0x51c1(){const _0x3d8769=['level','validation','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','1855890zsXlMb','WARN','appCode','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','start-time','since','515528zZNtzn','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','1460946DeRTJG','--start-time','limit','--limit\x20must\x20be\x20between\x201\x20and\x20','keyword','Filter\x20by\x20log\x20level','DEBUG','842091tKfbIS','now','7359432pXxEfX','isSafeInteger','10lmoinI','end-time','num','1864100gGkWJy','--end-time','\x20must\x20be\x20a\x20positive\x20integer.','trim','ERROR','length','str','number','toUpperCase','string','\x20Backend\x20Function\x20log\x20line(s).','flag','1gKkTSI','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','15150006PPJScP','--since'];a42_0x51c1=function(){return _0x3d8769;};return a42_0x51c1();}function readSinceMinutes(_0x18cb60){const _0x52a291=a42_0x1798b1;return readPositiveInteger(_0x18cb60[_0x52a291(0x78)](_0x52a291(0x91),DEFAULT_SINCE_MINUTES),_0x52a291(0x88));}function readPositiveInteger(_0x1c4f1d,_0x2546a3){const _0x49386b=a42_0x1798b1;if(!Number[_0x49386b(0x75)](_0x1c4f1d)||_0x1c4f1d<=0x0)throw CliErrors[_0x49386b(0x8a)](_0x2546a3+_0x49386b(0x7b));return _0x1c4f1d;}export const bffLogs={'service':'bff','command':'logs','description':a42_0x1798b1(0x8b),'risk':'read','structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x1798b1(0x91),'type':'number','description':'Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20'+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x1798b1(0x90),'type':a42_0x1798b1(0x80),'description':a42_0x1798b1(0x86)},{'name':a42_0x1798b1(0x77),'type':'number','description':'Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)'},{'name':a42_0x1798b1(0x89),'type':'string','description':a42_0x1798b1(0x99),'enum':LOG_LEVELS},{'name':'keyword','type':a42_0x1798b1(0x82),'description':a42_0x1798b1(0x8f)},{'name':a42_0x1798b1(0x96),'type':a42_0x1798b1(0x80),'description':'Maximum\x20log\x20lines\x20to\x20return\x20(1-'+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x517393){resolveBffLogQuery(_0x517393);},async 'execute'(_0x3019dc){const _0x1972e4=a42_0x1798b1,_0x33fb58=resolveBffLogQuery(_0x3019dc),{sinceMinutes:_0x3ae0b4,..._0x116148}=_0x33fb58,_0x8726a5=await searchBffScriptLogs(_0x116148);return{'ok':!![],'data':{'query':_0x33fb58,'count':_0x8726a5[_0x1972e4(0x7e)],'logs':_0x8726a5},'message':_0x8726a5[_0x1972e4(0x7e)]===0x0?'No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.':'Found\x20'+_0x8726a5[_0x1972e4(0x7e)]+_0x1972e4(0x83)};}};
@@ -1 +1 @@
1
- function a43_0x3f0d(_0x1a49ab,_0x1476a3){_0x1a49ab=_0x1a49ab-0xc3;const _0x253be0=a43_0x253b();let _0x3f0dfe=_0x253be0[_0x1a49ab];return _0x3f0dfe;}const a43_0x2847ba=a43_0x3f0d;(function(_0x1d1247,_0x22843a){const _0x55972b=a43_0x3f0d,_0x109fd3=_0x1d1247();while(!![]){try{const _0x3d7a5b=parseInt(_0x55972b(0x137))/0x1+-parseInt(_0x55972b(0xd4))/0x2+parseInt(_0x55972b(0xd6))/0x3*(-parseInt(_0x55972b(0x14a))/0x4)+-parseInt(_0x55972b(0x11a))/0x5*(parseInt(_0x55972b(0x108))/0x6)+parseInt(_0x55972b(0xcf))/0x7*(-parseInt(_0x55972b(0x132))/0x8)+-parseInt(_0x55972b(0x100))/0x9+parseInt(_0x55972b(0x147))/0xa;if(_0x3d7a5b===_0x22843a)break;else _0x109fd3['push'](_0x109fd3['shift']());}catch(_0x1d9ec5){_0x109fd3['push'](_0x109fd3['shift']());}}}(a43_0x253b,0xe1a9f));import{createInterface}from'node:readline';import{readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{randomUUID}from'node:crypto';function a43_0x253b(){const _0x2b5509=['split','NFC','map','currentApp','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','\x20failed','operationType','\x22:\x20both\x20target\x20\x22','\x22:\x20its\x20target\x20\x22','BFF_LOCAL_UNSYNCED','686LnFJLt','\x22;\x20temporary\x20directory\x20\x22','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','move','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','449868TKYTas','Remote\x20script\x20missing\x20content.','1186383VDphMi','bool','write','\x22\x20from\x20the\x20lock\x20file.','requires','migrations','COMMON','ENDPOINT','version','.hook-directory-migrate-','mergedCli','lastSync','ino','join','nonInteractive','Force\x20overwrite\x20local\x20unsynced\x20changes','projectedFunctions','\x22\x20and\x20\x22','require','functions','filePath','Force\x20pull\x20cancelled.','hookLocation','stdin','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','toLowerCase','\x20conflict','\x22\x20from\x20\x22','&type=','stringify','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','values','would_pull','sourceDirectoryPathByNewDirectory','parse','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','length','appCode','remoteId','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','scriptType','datasetCode','8586324dTfrAq','&currentPage=1&pageSize=','defaultApp','scriptsRoot','profileName','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','oldDirectoryPath','str','9774930GXlTqn','skipped','Failed\x20to\x20write\x20local\x20script\x20\x22','Pull\x20only\x20this\x20script\x20type','some','includes','\x20--format\x20compress','HOOK/','normalize','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','oldDirectory','lockFilePath','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','delete','unresolvable\x20target\x20path','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','alias','5aPgGuF','\x22\x20may\x20remain.','dev','existed','/api/management/library/scripts/list?appCode=','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','cancelled','boolean','trim','newDirectory','content','functionNode','toISOString','entries','oldLockKey','bff','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','set','utf8','\x22\x20not\x20found\x20after\x20ensureLockScope.','force','\x20pulled','rollback','.js','43664iIaVTA','get','push','type','read','1299606MvoEAT','flatMap','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','message','newDirectoryPath','rekey','pull','\x20resolution','selectedAppName','scriptContent','lockKey','has','entry','Remote\x20script\x20missing\x20id.','scriptsRootDir','37586440mdxFjo','apiDir','\x20--name\x20','8CUcjvi','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','functionName','validation','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','Lock\x20scope\x20for\x20app\x20\x22','mode','newLockKey','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','question','keyChanges','yes','\x22:\x20','\x22\x20to\x20\x22','all','ENOENT','apps','Pull\x20complete:\x20','reverse','HOOK','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.','GET','stderr'];a43_0x253b=function(){return _0x2b5509;};return a43_0x253b();}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_0x2847ba(0x129),'command':'pull','description':a43_0x2847ba(0xee),'risk':a43_0x2847ba(0x136),'structuredErrors':!![],'flags':[{'name':a43_0x2847ba(0x135),'type':'string','description':a43_0x2847ba(0x10b),'enum':[a43_0x2847ba(0xdc),a43_0x2847ba(0xdd),a43_0x2847ba(0x160)]},{'name':a43_0x2847ba(0x12e),'type':a43_0x2847ba(0x121),'description':a43_0x2847ba(0xe5)}],async 'dryRun'(_0x2e7ed9){const _0x33c87f=a43_0x2847ba,_0x58407c=loadBffProjectConfig(_0x2e7ed9['appCode']),_0x417607=await readBffLockFile(_0x58407c[_0x33c87f(0x113)]),{appLock:_0x383689}=ensureLockScope(_0x417607??createEmptyBffLock(),_0x2e7ed9[_0x33c87f(0xfb)],_0x58407c[_0x33c87f(0x103)],_0x33c87f(0x13e)),_0x49f9ed=normalizeBffType(_0x2e7ed9[_0x33c87f(0x107)](_0x33c87f(0x135)))??undefined,[_0x58997f,_0x343779]=await Promise[_0x33c87f(0x15b)]([listBffScripts(_0x2e7ed9[_0x33c87f(0xfb)],_0x49f9ed),getBffScriptStatistics(_0x2e7ed9[_0x33c87f(0xfb)])]),_0x771f1e=_0x58997f[_0x33c87f(0x10c)](_0x1f3233=>normalizeBffType(_0x1f3233['scriptType'])===_0x33c87f(0x160)),_0x5367ad=_0x771f1e?buildDatasetCodeToAliasMap(_0x2e7ed9[_0x33c87f(0x148)],_0x2e7ed9[_0x33c87f(0xfb)],_0x2e7ed9[_0x33c87f(0x140)]||_0x2e7ed9[_0x33c87f(0xe0)]?.[_0x33c87f(0xc8)]||_0x2e7ed9[_0x33c87f(0xe0)]?.[_0x33c87f(0x102)]):new Map(),_0x8cb015=_0x771f1e?await planHookDirectoryMigration(_0x58407c,_0x383689,_0x5367ad,await scanLocalBffFunctions(_0x58407c,_0x33c87f(0x160))):undefined,_0x344494=createHookLocationMap(_0x343779),_0x4929ee=[];for(const _0x5eb51b of _0x58997f){const _0x22b0d4=resolveRemoteScriptTarget(_0x58407c,_0x5eb51b,_0x344494,_0x8cb015?.[_0x33c87f(0xe6)]??_0x383689['functions'],_0x5367ad);if(!_0x22b0d4){_0x4929ee['push']({'scriptType':_0x5eb51b['scriptType'],'functionName':_0x5eb51b[_0x33c87f(0x14d)]??'','status':_0x33c87f(0x109),'reason':_0x33c87f(0x116)});continue;}const _0x269571=(_0x8cb015?.['projectedFunctions']??_0x383689[_0x33c87f(0xe9)])[_0x22b0d4[_0x33c87f(0x142)]],_0xbcf92c=_0x5eb51b[_0x33c87f(0x141)]!=null?computeContentHash(_0x5eb51b['scriptContent']):undefined,_0xcf4a69=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x8cb015,_0x22b0d4)??_0x22b0d4[_0x33c87f(0xea)],_0x269571,_0xbcf92c),_0xa00c5a=_0xcf4a69?localUnsyncedConflict(_0x22b0d4,_0x5eb51b['id']):undefined;_0x4929ee['push']({'lockKey':_0x22b0d4['lockKey'],'filePath':_0x22b0d4[_0x33c87f(0xea)],'remoteId':_0x5eb51b['id']??null,'status':_0xa00c5a?'conflict':_0x33c87f(0xf6),..._0xa00c5a?{'conflict':_0xa00c5a}:{},..._0x22b0d4[_0x33c87f(0xec)]?{'alias':_0x22b0d4['hookLocation'][_0x33c87f(0x119)]??null,'datasetCode':_0x22b0d4[_0x33c87f(0xec)][_0x33c87f(0xff)],'operationType':_0x22b0d4[_0x33c87f(0xec)]['operationType'],'functionNode':_0x22b0d4[_0x33c87f(0xec)][_0x33c87f(0x125)]}:{}});}return{'method':_0x33c87f(0xc3),'url':_0x33c87f(0x11e)+_0x2e7ed9[_0x33c87f(0xfb)]+(_0x49f9ed?_0x33c87f(0xf2)+_0x49f9ed:'')+_0x33c87f(0x101)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x2e7ed9[_0x33c87f(0xfb)],'filterType':_0x49f9ed??null,..._0x8cb015&&_0x8cb015[_0x33c87f(0xdb)][_0x33c87f(0xfa)]>0x0?{'hookDirectoryMigrations':_0x8cb015[_0x33c87f(0xdb)][_0x33c87f(0xc7)](_0x15b5ed=>({'from':_0x15b5ed[_0x33c87f(0x112)],'to':_0x15b5ed[_0x33c87f(0x123)]}))}:{},'files':_0x4929ee},'description':'Would\x20inspect\x20'+_0x4929ee[_0x33c87f(0xfa)]+'\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'};},async 'execute'(_0x17ebbe){const _0x332171=a43_0x2847ba,_0x397c94=loadBffProjectConfig(_0x17ebbe[_0x332171(0xfb)]),_0x6781f8=await readBffLockFile(_0x397c94[_0x332171(0x113)]),{lockData:_0x7bf2a1,appLock:_0xcfd1e1}=ensureLockScope(_0x6781f8??createEmptyBffLock(),_0x17ebbe[_0x332171(0xfb)],_0x397c94[_0x332171(0x103)],_0x332171(0x13e)),_0x2ff0bf=normalizeBffType(_0x17ebbe[_0x332171(0x107)](_0x332171(0x135)))??undefined;if(_0x17ebbe[_0x332171(0x107)](_0x332171(0x135))&&!_0x2ff0bf)throw CliErrors[_0x332171(0x14e)](_0x332171(0xd3));const [_0x4762de,_0x254635]=await Promise[_0x332171(0x15b)]([listBffScripts(_0x17ebbe[_0x332171(0xfb)],_0x2ff0bf),getBffScriptStatistics(_0x17ebbe[_0x332171(0xfb)])]);if(_0x4762de[_0x332171(0xfa)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x332171(0x117)};const _0x321611=_0x17ebbe[_0x332171(0xd7)](_0x332171(0x12e));if(_0x321611&&!_0x17ebbe[_0x332171(0xe4)]){const _0x84fb1e=await confirmForce();if(!_0x84fb1e)throw CliErrors[_0x332171(0x120)](_0x332171(0xeb));}if(_0x321611&&_0x17ebbe[_0x332171(0xe4)]){}const _0x352b33=_0x4762de[_0x332171(0x10c)](_0x4ff28f=>normalizeBffType(_0x4ff28f['scriptType'])===_0x332171(0x160)),_0x485ea4=_0x352b33?buildDatasetCodeToAliasMap(_0x17ebbe['apiDir'],_0x17ebbe[_0x332171(0xfb)],_0x17ebbe[_0x332171(0x140)]||_0x17ebbe['mergedCli']?.[_0x332171(0xc8)]||_0x17ebbe[_0x332171(0xe0)]?.[_0x332171(0x102)]):new Map(),_0x2c66a7=createHookLocationMap(_0x254635),_0x4b6753=JSON[_0x332171(0xf8)](JSON[_0x332171(0xf3)](_0x7bf2a1)),_0x2c86c2=_0x17ebbe[_0x332171(0xfb)],_0x263411=_0x4b6753[_0x332171(0x15d)][_0x2c86c2];if(!_0x263411)throw new Error(_0x332171(0x151)+_0x2c86c2+_0x332171(0x12d));const _0x14d85f=_0x352b33?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x397c94,_0x263411,_0x485ea4,await scanLocalBffFunctions(_0x397c94,_0x332171(0x160))),_0x263411):undefined,_0x206d5b=createPullFileTransaction(),_0x20fb14=[],_0x3f2da8=[],_0x1d4211=[],_0x488329=[];for(const _0x4962f6 of _0x4762de){const _0x20c0af=resolveRemoteScriptTarget(_0x397c94,_0x4962f6,_0x2c66a7,_0x263411[_0x332171(0xe9)],_0x485ea4);if(!_0x20c0af){_0x3f2da8[_0x332171(0x134)]({'lockKey':_0x4962f6[_0x332171(0xfe)]+'/'+_0x4962f6[_0x332171(0x14d)],'reason':_0x332171(0x116)});continue;}const _0x503bd4=_0x263411[_0x332171(0xe9)][_0x20c0af[_0x332171(0x142)]];try{if(!_0x4962f6['id'])throw new Error(_0x332171(0x145));if(_0x4962f6[_0x332171(0x141)]==null)throw new Error(_0x332171(0xd5));const _0x212532=_0x4962f6[_0x332171(0x141)],_0xf4b899=computeContentHash(_0x212532);if(!_0x321611){const _0x5a7852=await hasUnsyncedLocalChanges(_0x20c0af[_0x332171(0xea)],_0x503bd4,_0xf4b899);if(_0x5a7852){_0x1d4211[_0x332171(0x134)](localUnsyncedConflict(_0x20c0af,_0x4962f6['id']));continue;}}await _0x206d5b[_0x332171(0xd8)](_0x20c0af['filePath'],_0x212532);const _0x365ab4={'hash':_0xf4b899,'remoteId':_0x4962f6['id'],'version':_0x4962f6[_0x332171(0xde)]};_0x20c0af[_0x332171(0x135)]==='HOOK'&&_0x20c0af[_0x332171(0xec)]&&(_0x365ab4['alias']=_0x20c0af['hookLocation'][_0x332171(0x119)],_0x365ab4['datasetCode']=_0x20c0af[_0x332171(0xec)]['datasetCode'],_0x365ab4['operationType']=_0x20c0af['hookLocation'][_0x332171(0xcb)],_0x365ab4[_0x332171(0x125)]=_0x20c0af[_0x332171(0xec)][_0x332171(0x125)]),_0x263411['functions'][_0x20c0af[_0x332171(0x142)]]=_0x365ab4,_0x20fb14[_0x332171(0x134)]({'lockKey':_0x20c0af[_0x332171(0x142)],'remoteId':_0x4962f6['id']});}catch(_0x46a07d){_0x488329[_0x332171(0x134)]({'lockKey':_0x20c0af[_0x332171(0x142)],'error':_0x46a07d instanceof Error?_0x46a07d[_0x332171(0x13b)]:String(_0x46a07d)});}}_0x263411[_0x332171(0xe1)]=new Date()[_0x332171(0x126)]();try{await writeBffLockFile(_0x397c94[_0x332171(0x113)],_0x4b6753);}catch(_0x49ecc2){const _0x170cc7=[...await _0x206d5b['rollback'](),...await _0x14d85f?.[_0x332171(0x130)]()??[]];throw withRollbackErrors(_0x49ecc2,_0x332171(0x155),_0x170cc7);}return{'ok':_0x488329['length']===0x0,'data':{'pulled':_0x20fb14,'skipped':_0x3f2da8,'conflicts':_0x1d4211,'failed':_0x488329},'message':formatPullMessage(_0x20fb14[_0x332171(0xfa)],_0x3f2da8[_0x332171(0xfa)],_0x1d4211['length'],_0x488329['length'])};}};function localUnsyncedConflict(_0x15168d,_0x22c795){const _0x218309=a43_0x2847ba,_0x65aa63=_0x15168d[_0x218309(0x142)][_0x218309(0xc5)]('/')['at'](-0x1);return{'code':_0x218309(0xce),'lockKey':_0x15168d[_0x218309(0x142)],'filePath':_0x15168d['filePath'],..._0x22c795!=null?{'remoteId':_0x22c795}:{},'message':_0x218309(0x14f),'nextAction':{'action':'push_local','command':CLI_BIN_NAME+'\x20bff\x20push\x20--type\x20'+_0x15168d[_0x218309(0x135)]+_0x218309(0x149)+_0x65aa63+_0x218309(0x10e),'requiresReview':!![],'message':_0x218309(0x161)}};}function formatPullMessage(_0x1134b4,_0x50315e,_0x9e7e9f,_0x5ecc54){const _0xd456ae=a43_0x2847ba,_0x6f5bbb=[_0xd456ae(0x15e)+_0x1134b4+_0xd456ae(0x12f),_0x50315e+'\x20skipped'];_0x9e7e9f>0x0&&_0x6f5bbb[_0xd456ae(0x134)](_0x9e7e9f+_0xd456ae(0xf0)+(_0x9e7e9f===0x1?'':'s')+'\x20'+(_0x9e7e9f===0x1?_0xd456ae(0xda):_0xd456ae(0xe8))+_0xd456ae(0x13f));if(_0x5ecc54>0x0)_0x6f5bbb[_0xd456ae(0x134)](_0x5ecc54+_0xd456ae(0xca));return _0x6f5bbb[_0xd456ae(0xe3)](',\x20');}async function hasUnsyncedLocalChanges(_0x28405f,_0x48f6ce,_0x2a8f84){if(!await fileExists(_0x28405f))return![];const _0x336fc8=await computeFileHash(_0x28405f);if(!_0x48f6ce)return _0x2a8f84?_0x336fc8!==_0x2a8f84:!![];return _0x336fc8!==_0x48f6ce['hash'];}function createPullFileTransaction(){const _0x5c5616=new Map(),_0x3880f7=async(_0x5c9f4b,_0x136426)=>{const _0x6a9b94=a43_0x3f0d;try{if(_0x136426[_0x6a9b94(0x11d)])await ensureParentDirectory(_0x5c9f4b),await writeFile(_0x5c9f4b,_0x136426[_0x6a9b94(0x124)]);else try{await unlink(_0x5c9f4b);}catch(_0x1634de){if(_0x1634de['code']!==_0x6a9b94(0x15c))throw _0x1634de;}return undefined;}catch(_0x239f9c){return _0x239f9c instanceof Error?_0x239f9c:new Error(String(_0x239f9c));}};return{async 'write'(_0x4576a7,_0x5ebad9){const _0x2ebadc=a43_0x3f0d;if(!_0x5c5616['has'](_0x4576a7))try{_0x5c5616['set'](_0x4576a7,{'existed':!![],'content':await readFile(_0x4576a7)});}catch(_0x977f7f){if(_0x977f7f['code']!==_0x2ebadc(0x15c))throw _0x977f7f;_0x5c5616['set'](_0x4576a7,{'existed':![]});}try{await ensureParentDirectory(_0x4576a7),await writeFile(_0x4576a7,_0x5ebad9,_0x2ebadc(0x12c));}catch(_0x34c9e9){const _0x5d8178=await _0x3880f7(_0x4576a7,_0x5c5616['get'](_0x4576a7));if(!_0x5d8178)_0x5c5616[_0x2ebadc(0x115)](_0x4576a7);throw withRollbackErrors(_0x34c9e9,_0x2ebadc(0x10a)+_0x4576a7+'\x22.',_0x5d8178?[_0x5d8178]:[]);}},async 'rollback'(){const _0x58ea6b=a43_0x3f0d,_0x36619c=[];for(const [_0x5e9967,_0xdc62a8]of[..._0x5c5616[_0x58ea6b(0x127)]()][_0x58ea6b(0x15f)]()){const _0x26a49a=await _0x3880f7(_0x5e9967,_0xdc62a8);_0x26a49a&&_0x36619c[_0x58ea6b(0x134)](new Error('Could\x20not\x20restore\x20local\x20script\x20\x22'+_0x5e9967+_0x58ea6b(0x159)+_0x26a49a[_0x58ea6b(0x13b)]));}return _0x36619c;}};}function withRollbackErrors(_0x47b21c,_0x245528,_0x50ae8c){const _0x23ce82=a43_0x2847ba,_0x461884=_0x47b21c instanceof Error?_0x47b21c:new Error(String(_0x47b21c));if(_0x50ae8c[_0x23ce82(0xfa)]===0x0)return _0x461884;return new AggregateError([_0x461884,..._0x50ae8c],_0x245528+'\x20Recovery\x20errors:\x20'+_0x50ae8c['map'](_0x10c75f=>_0x10c75f[_0x23ce82(0x13b)])[_0x23ce82(0xe3)](';\x20'));}function buildDatasetCodeToAliasMap(_0x3b80b4,_0x22a090,_0xe25ba5){const _0x1dc2b0=a43_0x2847ba,_0x413b68=resolveApiModelSource(_0x3b80b4,_0x22a090,_0xe25ba5),_0x5f464f=loadAliasMap(_0x3b80b4,undefined,_0x413b68[_0x1dc2b0(0xea)],_0x413b68[_0x1dc2b0(0x104)]);return assertUnambiguousHookAliases(_0x5f464f),new Map(_0x5f464f[_0x1dc2b0(0xc7)](_0x568a9e=>[_0x568a9e['datasetCode'][_0x1dc2b0(0xef)](),_0x568a9e[_0x1dc2b0(0x119)]]));}async function planHookDirectoryMigration(_0x57318a,_0x4620b7,_0x54f843,_0x16c71c){const _0x3da747=a43_0x2847ba,_0x18d92b=new Map();for(const [_0x3a2294,_0x2dea8d]of Object[_0x3da747(0x127)](_0x4620b7['functions'])){const [_0x3fdc52,_0x49cad0,_0xa41ada,_0x3ccd0e,_0x367d47,..._0x3496bd]=_0x3a2294[_0x3da747(0xc5)]('/');if(_0x3fdc52!==_0x3da747(0x160)||!_0x49cad0||!_0xa41ada||!_0x3ccd0e||!_0x367d47||_0x3496bd[_0x3da747(0xfa)]>0x0||!_0x2dea8d[_0x3da747(0xff)])continue;const _0x6d3b75=_0x54f843[_0x3da747(0x133)](_0x2dea8d['datasetCode'][_0x3da747(0xef)]()),_0x2106eb=_0x6d3b75??_0x2dea8d['datasetCode'];if(!isSafeHookDirectorySegment(_0x49cad0))throw CliErrors[_0x3da747(0x14e)](_0x3da747(0x150)+_0x49cad0+_0x3da747(0xd9));if(!isSafeHookDirectorySegment(_0x2106eb))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x49cad0+_0x3da747(0xc9));if(_0x49cad0===_0x2106eb)continue;const _0x5198cd=_0x18d92b[_0x3da747(0x133)](_0x49cad0)??{'datasetCode':_0x2dea8d[_0x3da747(0xff)],'alias':_0x6d3b75,'keyChanges':[]};if(_0x5198cd['datasetCode']!==_0x2dea8d['datasetCode'])throw CliErrors[_0x3da747(0x14e)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x49cad0+_0x3da747(0x13a));const _0xb9f98f=_0x3da747(0x10f)+_0x2106eb+'/'+_0xa41ada+'/'+_0x3ccd0e+'/'+_0x367d47;try{resolveLocalFilePathFromLockKey(_0x57318a,_0x3a2294),resolveLocalFilePathFromLockKey(_0x57318a,_0xb9f98f);}catch(_0x4982c4){throw CliErrors[_0x3da747(0x14e)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'+_0x3a2294+'\x22:\x20'+(_0x4982c4 instanceof Error?_0x4982c4[_0x3da747(0x13b)]:String(_0x4982c4)));}_0x5198cd[_0x3da747(0x157)][_0x3da747(0x134)]({'oldLockKey':_0x3a2294,'newLockKey':_0xb9f98f,'entry':_0x2dea8d}),_0x18d92b[_0x3da747(0x12b)](_0x49cad0,_0x5198cd);}const _0x5f4426=new Set([..._0x18d92b[_0x3da747(0xf5)]()][_0x3da747(0x138)](_0x1dada7=>_0x1dada7['keyChanges'][_0x3da747(0xc7)](_0x1ebcaa=>_0x1ebcaa['oldLockKey']))),_0x2d1bd3=new Map(),_0x23a7bc=new Map();for(const [_0x5817fb,_0x21a707]of _0x18d92b){const _0x14aae2=_0x21a707[_0x3da747(0x119)]??_0x21a707[_0x3da747(0xff)],_0x50293d=hookDirectoryIdentity(_0x14aae2),_0xcd5942=_0x2d1bd3[_0x3da747(0x133)](_0x50293d);if(_0xcd5942&&_0xcd5942!==_0x5817fb)throw CliErrors['validation'](_0x3da747(0x118)+_0xcd5942+_0x3da747(0xe7)+_0x5817fb+'\x22:\x20both\x20target\x20\x22'+_0x14aae2+_0x3da747(0x11f));_0x2d1bd3[_0x3da747(0x12b)](_0x50293d,_0x5817fb);for(const _0x3e26d4 of _0x21a707['keyChanges']){const _0xf84038=_0x23a7bc[_0x3da747(0x133)](_0x3e26d4[_0x3da747(0x153)]);if(_0xf84038&&_0xf84038!==_0x3e26d4['oldLockKey'])throw CliErrors[_0x3da747(0x14e)](_0x3da747(0x154)+_0xf84038+_0x3da747(0xe7)+_0x3e26d4[_0x3da747(0x128)]+_0x3da747(0xcc)+_0x3e26d4[_0x3da747(0x153)]+_0x3da747(0x12a));if(_0x5f4426[_0x3da747(0x143)](_0x3e26d4[_0x3da747(0x153)]))throw CliErrors['validation'](_0x3da747(0xf9)+_0x3e26d4[_0x3da747(0x128)]+_0x3da747(0xcd)+_0x3e26d4[_0x3da747(0x153)]+_0x3da747(0xfd));_0x23a7bc[_0x3da747(0x12b)](_0x3e26d4[_0x3da747(0x153)],_0x3e26d4['oldLockKey']);}}const _0x3da110=new Map();for(const [_0x3ba233,_0x4cf5b4]of _0x54f843){_0x3da110[_0x3da747(0x12b)](hookDirectoryIdentity(_0x4cf5b4),_0x3ba233);}const _0x5070a3=[];for(const [_0x37c3d3,_0x762e81]of _0x18d92b){const _0x233bd3=_0x762e81[_0x3da747(0x119)]??_0x762e81[_0x3da747(0xff)],_0x3a4abb=join(_0x57318a[_0x3da747(0x146)],_0x3da747(0x160),_0x37c3d3),_0x67d8e=join(_0x57318a[_0x3da747(0x146)],'HOOK',_0x233bd3),_0x3ea1f1=await directoryExists(_0x3a4abb),_0x5c6391=await directoryExists(_0x67d8e),_0x1ac0e7=_0x3ea1f1?_0x5c6391?await sameDirectory(_0x3a4abb,_0x67d8e)?'case-rename':undefined:_0x3da747(0xd2):'rekey';if(!_0x1ac0e7)throw CliErrors[_0x3da747(0x14e)](_0x3da747(0x105)+_0x37c3d3+_0x3da747(0x15a)+_0x233bd3+_0x3da747(0x14b));const _0x9d558d=_0x3da110[_0x3da747(0x133)](hookDirectoryIdentity(_0x37c3d3));if(_0x9d558d&&_0x9d558d!==_0x762e81[_0x3da747(0xff)][_0x3da747(0xef)]()){const _0x2ed761=new Set(_0x762e81[_0x3da747(0x157)]['map'](_0x467498=>_0x467498[_0x3da747(0x128)])),_0x210fbe=_0x16c71c['filter'](_0x22eb89=>_0x22eb89[_0x3da747(0x135)]===_0x3da747(0x160)&&_0x22eb89['alias']!=null&&hookDirectoryIdentity(_0x22eb89['alias'])===hookDirectoryIdentity(_0x37c3d3)&&!_0x2ed761[_0x3da747(0x143)](_0x22eb89[_0x3da747(0x142)]));if(_0x210fbe['length']>0x0)throw CliErrors[_0x3da747(0x14e)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x37c3d3+'\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');}const _0x277aef=_0x3da110[_0x3da747(0x133)](hookDirectoryIdentity(_0x233bd3));if(_0x277aef&&_0x277aef!==_0x762e81['datasetCode'][_0x3da747(0xef)]())throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x37c3d3+_0x3da747(0x15a)+_0x233bd3+_0x3da747(0xf4));for(const _0x41d28f of _0x762e81['keyChanges']){const _0x310a0c=_0x4620b7['functions'][_0x41d28f[_0x3da747(0x153)]];if(_0x310a0c&&!_0x5f4426[_0x3da747(0x143)](_0x41d28f['newLockKey'])&&!sameHookIdentity(_0x41d28f[_0x3da747(0x144)],_0x310a0c))throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x37c3d3+_0x3da747(0x15a)+_0x233bd3+'\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.');}_0x5070a3[_0x3da747(0x134)]({'oldDirectory':_0x37c3d3,'newDirectory':_0x233bd3,'oldDirectoryPath':_0x3a4abb,'newDirectoryPath':_0x67d8e,'mode':_0x1ac0e7,'alias':_0x762e81[_0x3da747(0x119)],'keyChanges':_0x762e81['keyChanges']});}const _0x31035a={..._0x4620b7[_0x3da747(0xe9)]},_0x2857e0=new Map(),_0x4afc32=new Map();for(const _0x3948bd of _0x5070a3){const _0x4cf55f=_0x3948bd['mode']!==_0x3da747(0x13d);_0x4cf55f&&_0x4afc32[_0x3da747(0x12b)](hookDirectoryIdentity(_0x3948bd[_0x3da747(0x123)]),_0x3948bd['oldDirectoryPath']);for(const _0x3f579e of _0x3948bd[_0x3da747(0x157)]){const _0x487167=_0x31035a[_0x3f579e[_0x3da747(0x153)]],_0x488fdb=_0x4cf55f?_0x3f579e['entry']:_0x487167??_0x3f579e[_0x3da747(0x144)];_0x31035a[_0x3f579e['newLockKey']]=canonicalizeHookEntry(_0x488fdb,_0x3948bd['alias']),delete _0x31035a[_0x3f579e['oldLockKey']],_0x4cf55f&&_0x2857e0[_0x3da747(0x12b)](_0x3f579e['newLockKey'],resolveLocalFilePathFromLockKey(_0x57318a,_0x3f579e[_0x3da747(0x128)]));}}return{'migrations':_0x5070a3,'projectedFunctions':_0x31035a,'sourceFilePathByNewLockKey':_0x2857e0,'sourceDirectoryPathByNewDirectory':_0x4afc32};}function resolveMigratedSourceFilePath(_0x558920,_0xbd7ea0){const _0x2eb08b=a43_0x2847ba;if(!_0x558920||!_0xbd7ea0)return undefined;const _0x1dbb59=_0x558920['sourceFilePathByNewLockKey']['get'](_0xbd7ea0[_0x2eb08b(0x142)]);if(_0x1dbb59)return _0x1dbb59;if(_0xbd7ea0[_0x2eb08b(0x135)]!==_0x2eb08b(0x160))return undefined;const [,_0x23e7ad,..._0x17c5aa]=_0xbd7ea0[_0x2eb08b(0x142)]['split']('/');if(!_0x23e7ad||_0x17c5aa[_0x2eb08b(0xfa)]===0x0)return undefined;const _0x405b39=_0x558920[_0x2eb08b(0xf7)][_0x2eb08b(0x133)](hookDirectoryIdentity(_0x23e7ad));return _0x405b39?join(_0x405b39,..._0x17c5aa)+_0x2eb08b(0x131):undefined;}function sameHookIdentity(_0x233c39,_0x33e8f1){const _0x45800d=a43_0x2847ba;return _0x233c39[_0x45800d(0xfc)]===_0x33e8f1[_0x45800d(0xfc)]&&_0x233c39['datasetCode']===_0x33e8f1[_0x45800d(0xff)]&&_0x233c39[_0x45800d(0xcb)]===_0x33e8f1['operationType']&&_0x233c39[_0x45800d(0x125)]===_0x33e8f1[_0x45800d(0x125)];}function canonicalizeHookEntry(_0x5c40b4,_0x297b0f){const {alias:_0x67c41,..._0x55c2c}=_0x5c40b4;return _0x297b0f?{..._0x55c2c,'alias':_0x297b0f}:_0x55c2c;}function hookDirectoryIdentity(_0x3ce861){const _0x23e1e6=a43_0x2847ba;return _0x3ce861[_0x23e1e6(0x110)](_0x23e1e6(0xc6))[_0x23e1e6(0xef)]();}function isSafeHookDirectorySegment(_0x2f56b3){return isSafeLockKeySegment(_0x2f56b3);}async function sameDirectory(_0x2b1dd2,_0x16969a){const _0x3f71e9=a43_0x2847ba,[_0x4ad30e,_0xed0b77]=await Promise[_0x3f71e9(0x15b)]([stat(_0x2b1dd2),stat(_0x16969a)]);return _0x4ad30e['dev']===_0xed0b77[_0x3f71e9(0x11c)]&&_0x4ad30e[_0x3f71e9(0xe2)]===_0xed0b77['ino'];}async function applyHookDirectoryMigration(_0x5a6e51,_0x361e1c){const _0x56dd5c=a43_0x2847ba,_0x17b5c1=_0x361e1c['functions'],_0x19af53=_0x361e1c['lastSync'],_0x51fad8=[],_0x5ec45d=async()=>{const _0x22899e=a43_0x3f0d,_0x358eb0=[];_0x361e1c['functions']=_0x17b5c1,_0x361e1c[_0x22899e(0xe1)]=_0x19af53;for(const {migration:_0x1c728f,temporaryPath:_0x257f60}of[..._0x51fad8][_0x22899e(0x15f)]()){try{_0x257f60?(await rename(_0x1c728f[_0x22899e(0x13c)],_0x257f60),await rename(_0x257f60,_0x1c728f[_0x22899e(0x106)])):await rename(_0x1c728f[_0x22899e(0x13c)],_0x1c728f[_0x22899e(0x106)]);}catch(_0x354830){_0x358eb0[_0x22899e(0x134)](new Error(_0x22899e(0x14c)+_0x1c728f['oldDirectory']+_0x22899e(0xf1)+_0x1c728f['newDirectory']+_0x22899e(0x159)+(_0x354830 instanceof Error?_0x354830[_0x22899e(0x13b)]:String(_0x354830))));}}return _0x358eb0;};try{for(const _0xc8465b of _0x5a6e51[_0x56dd5c(0xdb)]){if(_0xc8465b[_0x56dd5c(0x152)]===_0x56dd5c(0xd2))await ensureParentDirectory(_0xc8465b['newDirectoryPath']),await rename(_0xc8465b[_0x56dd5c(0x106)],_0xc8465b['newDirectoryPath']),_0x51fad8[_0x56dd5c(0x134)]({'migration':_0xc8465b});else{if(_0xc8465b[_0x56dd5c(0x152)]==='case-rename'){const _0x3a8129=join(dirname(_0xc8465b[_0x56dd5c(0x106)]),_0x56dd5c(0xdf)+randomUUID());await rename(_0xc8465b[_0x56dd5c(0x106)],_0x3a8129);try{await rename(_0x3a8129,_0xc8465b[_0x56dd5c(0x13c)]);}catch(_0x2ba87f){try{await rename(_0x3a8129,_0xc8465b[_0x56dd5c(0x106)]);}catch(_0x15f99c){throw withRollbackErrors(_0x2ba87f,_0x56dd5c(0xd1)+_0xc8465b[_0x56dd5c(0x112)]+_0x56dd5c(0x15a)+_0xc8465b[_0x56dd5c(0x123)]+_0x56dd5c(0xd0)+_0x3a8129+_0x56dd5c(0x11b),[new Error(_0x56dd5c(0x114)+_0x3a8129+_0x56dd5c(0x15a)+_0xc8465b[_0x56dd5c(0x112)]+_0x56dd5c(0x159)+(_0x15f99c instanceof Error?_0x15f99c[_0x56dd5c(0x13b)]:String(_0x15f99c)))]);}throw _0x2ba87f;}_0x51fad8[_0x56dd5c(0x134)]({'migration':_0xc8465b,'temporaryPath':_0x3a8129});}}}return _0x361e1c[_0x56dd5c(0xe9)]=_0x5a6e51['projectedFunctions'],{'rollback':_0x5ec45d};}catch(_0x457fe6){const _0xfd5464=await _0x5ec45d();throw withRollbackErrors(_0x457fe6,_0x56dd5c(0x111),_0xfd5464);}}async function confirmForce(){const _0x36c2b6=a43_0x2847ba,_0x21e0cc=createInterface({'input':process[_0x36c2b6(0xed)],'output':process[_0x36c2b6(0xc4)]}),_0x5b1fc5=await new Promise(_0x588be5=>{const _0x48841e=_0x36c2b6;_0x21e0cc[_0x48841e(0x156)](_0x48841e(0x139),_0x588be5);});return _0x21e0cc['close'](),['y',_0x36c2b6(0x158)][_0x36c2b6(0x10d)](_0x5b1fc5[_0x36c2b6(0x122)]()[_0x36c2b6(0xef)]());}
1
+ const a43_0x43b08b=a43_0x35f6;(function(_0x5c41de,_0x486d9a){const _0x57c4a9=a43_0x35f6,_0x408509=_0x5c41de();while(!![]){try{const _0x5ad49c=parseInt(_0x57c4a9(0x147))/0x1*(parseInt(_0x57c4a9(0x137))/0x2)+parseInt(_0x57c4a9(0x10c))/0x3+parseInt(_0x57c4a9(0x108))/0x4+parseInt(_0x57c4a9(0x169))/0x5*(parseInt(_0x57c4a9(0x143))/0x6)+-parseInt(_0x57c4a9(0x10a))/0x7*(parseInt(_0x57c4a9(0x15f))/0x8)+-parseInt(_0x57c4a9(0x15c))/0x9+-parseInt(_0x57c4a9(0x142))/0xa;if(_0x5ad49c===_0x486d9a)break;else _0x408509['push'](_0x408509['shift']());}catch(_0x1daf60){_0x408509['push'](_0x408509['shift']());}}}(a43_0x4def,0xd1f6a));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';function a43_0x4def(){const _0x34b905=['version','flatMap','cancelled','boolean','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','stringify','alias','HOOK/','functions','\x22:\x20','length','mode','message','2959716GpFyzT','toLowerCase','26985Sgehlr','newDirectory','1741626ZmMnUr','remoteId','lastSync','profileName','push','some','Pull\x20only\x20this\x20script\x20type','str','operationType','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','content','stdin','scriptType','includes','scriptContent','code','join','requires','conflict','datasetCode','get','/api/management/library/scripts/list?appCode=','.hook-directory-migrate-','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','\x20failed','entry','appCode','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','\x20--format\x20compress','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','entries','oldDirectoryPath','pull','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','nonInteractive','set','values','skipped','validation','dev','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','mergedCli','34sBMiRT','currentApp','Force\x20overwrite\x20local\x20unsynced\x20changes','split','question','yes','Pull\x20complete:\x20','sourceDirectoryPathByNewDirectory','string','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','type','14565020uhUzrZ','90YCfldH','functionNode','lockKey','close','34789KQOuCw','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','has','\x20conflict','\x22\x20to\x20\x22','lockFilePath','keyChanges','newDirectoryPath','.js','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','HOOK','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','GET','trim','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','oldLockKey','&type=','Force\x20pull\x20cancelled.','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','Failed\x20to\x20write\x20local\x20script\x20\x22','7133373mnOOuG','\x20skipped','require','248LRupKI','hookLocation','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','write','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','newLockKey','existed','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','Would\x20inspect\x20','rollback','438910JwKUUs','read','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','BFF_LOCAL_UNSYNCED','reverse','\x22;\x20temporary\x20directory\x20\x22','ino','oldDirectory','filter','bool','projectedFunctions','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','scriptsRootDir','push_local','unresolvable\x20target\x20path','scriptsRoot','defaultApp','would_pull','normalize','ENDPOINT','\x22\x20may\x20remain.','rekey','selectedAppName','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','COMMON','stderr','sourceFilePathByNewLockKey','ENOENT','\x20--name\x20','map','Could\x20not\x20restore\x20local\x20script\x20\x22','\x22:\x20both\x20target\x20\x22','\x20pulled','Lock\x20scope\x20for\x20app\x20\x22','force','filePath','Remote\x20script\x20missing\x20id.','migrations','apiDir','Cannot\x20migrate\x20HOOK\x20directory\x20\x22'];a43_0x4def=function(){return _0x34b905;};return a43_0x4def();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,directoryExists,ensureParentDirectory,fileExists,isSafeLockKeySegment,normalizeBffType,resolveLocalFilePathFromLockKey,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{assertUnambiguousHookAliases}from'../../core/bff/hook-directory.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':'bff','command':a43_0x43b08b(0x12c),'description':a43_0x43b08b(0x15a),'risk':a43_0x43b08b(0x16a),'structuredErrors':!![],'flags':[{'name':a43_0x43b08b(0x141),'type':a43_0x43b08b(0x13f),'description':a43_0x43b08b(0x112),'enum':[a43_0x43b08b(0xeb),a43_0x43b08b(0xe6),'HOOK']},{'name':a43_0x43b08b(0xf5),'type':a43_0x43b08b(0xfe),'description':a43_0x43b08b(0x139)}],async 'dryRun'(_0x20dd77){const _0x475ea1=a43_0x43b08b,_0xf2e646=loadBffProjectConfig(_0x20dd77['appCode']),_0x1d0a83=await readBffLockFile(_0xf2e646[_0x475ea1(0x14c)]),{appLock:_0x16d7b4}=ensureLockScope(_0x1d0a83??createEmptyBffLock(),_0x20dd77[_0x475ea1(0x126)],_0xf2e646[_0x475ea1(0xe2)],'pull'),_0x57c231=normalizeBffType(_0x20dd77[_0x475ea1(0x113)](_0x475ea1(0x141)))??undefined,[_0x1c0d27,_0x539a11]=await Promise['all']([listBffScripts(_0x20dd77[_0x475ea1(0x126)],_0x57c231),getBffScriptStatistics(_0x20dd77[_0x475ea1(0x126)])]),_0x370ef4=_0x1c0d27[_0x475ea1(0x111)](_0x550e70=>normalizeBffType(_0x550e70[_0x475ea1(0x118)])===_0x475ea1(0x151)),_0x57e4fb=_0x370ef4?buildDatasetCodeToAliasMap(_0x20dd77[_0x475ea1(0xf9)],_0x20dd77[_0x475ea1(0x126)],_0x20dd77[_0x475ea1(0xe9)]||_0x20dd77[_0x475ea1(0x136)]?.[_0x475ea1(0x138)]||_0x20dd77[_0x475ea1(0x136)]?.[_0x475ea1(0xe3)]):new Map(),_0x5683b9=_0x370ef4?await planHookDirectoryMigration(_0xf2e646,_0x16d7b4,_0x57e4fb,await scanLocalBffFunctions(_0xf2e646,_0x475ea1(0x151))):undefined,_0x51eadf=createHookLocationMap(_0x539a11),_0x48f82f=[];for(const _0xdd5dc7 of _0x1c0d27){const _0x3dd6a9=resolveRemoteScriptTarget(_0xf2e646,_0xdd5dc7,_0x51eadf,_0x5683b9?.[_0x475ea1(0xdd)]??_0x16d7b4[_0x475ea1(0x103)],_0x57e4fb);if(!_0x3dd6a9){_0x48f82f['push']({'scriptType':_0xdd5dc7['scriptType'],'functionName':_0xdd5dc7['functionName']??'','status':_0x475ea1(0x132),'reason':_0x475ea1(0xe1)});continue;}const _0x13aa39=(_0x5683b9?.[_0x475ea1(0xdd)]??_0x16d7b4[_0x475ea1(0x103)])[_0x3dd6a9[_0x475ea1(0x145)]],_0x922e4=_0xdd5dc7[_0x475ea1(0x11a)]!=null?computeContentHash(_0xdd5dc7[_0x475ea1(0x11a)]):undefined,_0x5b6e58=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x5683b9,_0x3dd6a9)??_0x3dd6a9[_0x475ea1(0xf6)],_0x13aa39,_0x922e4),_0x28e73f=_0x5b6e58?localUnsyncedConflict(_0x3dd6a9,_0xdd5dc7['id']):undefined;_0x48f82f[_0x475ea1(0x110)]({'lockKey':_0x3dd6a9['lockKey'],'filePath':_0x3dd6a9[_0x475ea1(0xf6)],'remoteId':_0xdd5dc7['id']??null,'status':_0x28e73f?_0x475ea1(0x11e):_0x475ea1(0xe4),..._0x28e73f?{'conflict':_0x28e73f}:{},..._0x3dd6a9[_0x475ea1(0x160)]?{'alias':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x101)]??null,'datasetCode':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x11f)],'operationType':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x114)],'functionNode':_0x3dd6a9[_0x475ea1(0x160)][_0x475ea1(0x144)]}:{}});}return{'method':_0x475ea1(0x154),'url':_0x475ea1(0x121)+_0x20dd77[_0x475ea1(0x126)]+(_0x57c231?_0x475ea1(0x158)+_0x57c231:'')+'&currentPage=1&pageSize='+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x20dd77['appCode'],'filterType':_0x57c231??null,..._0x5683b9&&_0x5683b9[_0x475ea1(0xf8)][_0x475ea1(0x105)]>0x0?{'hookDirectoryMigrations':_0x5683b9[_0x475ea1(0xf8)][_0x475ea1(0xf0)](_0x3f3809=>({'from':_0x3f3809['oldDirectory'],'to':_0x3f3809[_0x475ea1(0x10b)]}))}:{},'files':_0x48f82f},'description':_0x475ea1(0x167)+_0x48f82f[_0x475ea1(0x105)]+_0x475ea1(0x135)};},async 'execute'(_0x586e2a){const _0x383817=a43_0x43b08b,_0x2e6338=loadBffProjectConfig(_0x586e2a[_0x383817(0x126)]),_0x4ed4c7=await readBffLockFile(_0x2e6338['lockFilePath']),{lockData:_0x12af0b,appLock:_0xa95aa9}=ensureLockScope(_0x4ed4c7??createEmptyBffLock(),_0x586e2a[_0x383817(0x126)],_0x2e6338[_0x383817(0xe2)],_0x383817(0x12c)),_0x858031=normalizeBffType(_0x586e2a[_0x383817(0x113)](_0x383817(0x141)))??undefined;if(_0x586e2a[_0x383817(0x113)](_0x383817(0x141))&&!_0x858031)throw CliErrors[_0x383817(0x133)](_0x383817(0x12d));const [_0x2e1db6,_0x301d5d]=await Promise['all']([listBffScripts(_0x586e2a[_0x383817(0x126)],_0x858031),getBffScriptStatistics(_0x586e2a['appCode'])]);if(_0x2e1db6[_0x383817(0x105)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x383817(0xea)};const _0x4da893=_0x586e2a[_0x383817(0xdc)](_0x383817(0xf5));if(_0x4da893&&!_0x586e2a[_0x383817(0x12f)]){const _0x539935=await confirmForce();if(!_0x539935)throw CliErrors[_0x383817(0xfd)](_0x383817(0x159));}if(_0x4da893&&_0x586e2a[_0x383817(0x12f)]){}const _0x2e8489=_0x2e1db6[_0x383817(0x111)](_0x47f83e=>normalizeBffType(_0x47f83e[_0x383817(0x118)])===_0x383817(0x151)),_0xee4bbc=_0x2e8489?buildDatasetCodeToAliasMap(_0x586e2a[_0x383817(0xf9)],_0x586e2a[_0x383817(0x126)],_0x586e2a[_0x383817(0xe9)]||_0x586e2a[_0x383817(0x136)]?.[_0x383817(0x138)]||_0x586e2a[_0x383817(0x136)]?.[_0x383817(0xe3)]):new Map(),_0x340a95=createHookLocationMap(_0x301d5d),_0x63fa27=JSON['parse'](JSON[_0x383817(0x100)](_0x12af0b)),_0x14b735=_0x586e2a[_0x383817(0x126)],_0xad6be3=_0x63fa27['apps'][_0x14b735];if(!_0xad6be3)throw new Error(_0x383817(0xf4)+_0x14b735+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x3b48ca=_0x2e8489?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x2e6338,_0xad6be3,_0xee4bbc,await scanLocalBffFunctions(_0x2e6338,_0x383817(0x151))),_0xad6be3):undefined,_0x14e4b4=createPullFileTransaction(),_0x43709e=[],_0x1831a4=[],_0x193d8d=[],_0x38b54e=[];for(const _0x3b9675 of _0x2e1db6){const _0x36899c=resolveRemoteScriptTarget(_0x2e6338,_0x3b9675,_0x340a95,_0xad6be3[_0x383817(0x103)],_0xee4bbc);if(!_0x36899c){_0x1831a4['push']({'lockKey':_0x3b9675['scriptType']+'/'+_0x3b9675['functionName'],'reason':_0x383817(0xe1)});continue;}const _0x14f9b5=_0xad6be3['functions'][_0x36899c[_0x383817(0x145)]];try{if(!_0x3b9675['id'])throw new Error(_0x383817(0xf7));if(_0x3b9675[_0x383817(0x11a)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x229b3c=_0x3b9675[_0x383817(0x11a)],_0x488b57=computeContentHash(_0x229b3c);if(!_0x4da893){const _0x45de7a=await hasUnsyncedLocalChanges(_0x36899c[_0x383817(0xf6)],_0x14f9b5,_0x488b57);if(_0x45de7a){_0x193d8d[_0x383817(0x110)](localUnsyncedConflict(_0x36899c,_0x3b9675['id']));continue;}}await _0x14e4b4[_0x383817(0x162)](_0x36899c[_0x383817(0xf6)],_0x229b3c);const _0x5d443b={'hash':_0x488b57,'remoteId':_0x3b9675['id'],'version':_0x3b9675[_0x383817(0xfb)]};_0x36899c[_0x383817(0x141)]===_0x383817(0x151)&&_0x36899c['hookLocation']&&(_0x5d443b[_0x383817(0x101)]=_0x36899c[_0x383817(0x160)][_0x383817(0x101)],_0x5d443b[_0x383817(0x11f)]=_0x36899c[_0x383817(0x160)]['datasetCode'],_0x5d443b[_0x383817(0x114)]=_0x36899c[_0x383817(0x160)][_0x383817(0x114)],_0x5d443b[_0x383817(0x144)]=_0x36899c[_0x383817(0x160)][_0x383817(0x144)]),_0xad6be3['functions'][_0x36899c[_0x383817(0x145)]]=_0x5d443b,_0x43709e[_0x383817(0x110)]({'lockKey':_0x36899c[_0x383817(0x145)],'remoteId':_0x3b9675['id']});}catch(_0x216f03){_0x38b54e['push']({'lockKey':_0x36899c['lockKey'],'error':_0x216f03 instanceof Error?_0x216f03[_0x383817(0x107)]:String(_0x216f03)});}}_0xad6be3['lastSync']=new Date()['toISOString']();try{await writeBffLockFile(_0x2e6338[_0x383817(0x14c)],_0x63fa27);}catch(_0x5b4f57){const _0x31185c=[...await _0x14e4b4['rollback'](),...await _0x3b48ca?.[_0x383817(0x168)]()??[]];throw withRollbackErrors(_0x5b4f57,_0x383817(0x16b),_0x31185c);}return{'ok':_0x38b54e[_0x383817(0x105)]===0x0,'data':{'pulled':_0x43709e,'skipped':_0x1831a4,'conflicts':_0x193d8d,'failed':_0x38b54e},'message':formatPullMessage(_0x43709e[_0x383817(0x105)],_0x1831a4[_0x383817(0x105)],_0x193d8d[_0x383817(0x105)],_0x38b54e[_0x383817(0x105)])};}};function localUnsyncedConflict(_0x16eda9,_0x4f340c){const _0x52c39b=a43_0x43b08b,_0x483f78=_0x16eda9[_0x52c39b(0x145)]['split']('/')['at'](-0x1);return{'code':_0x52c39b(0x16c),'lockKey':_0x16eda9[_0x52c39b(0x145)],'filePath':_0x16eda9[_0x52c39b(0xf6)],..._0x4f340c!=null?{'remoteId':_0x4f340c}:{},'message':_0x52c39b(0x161),'nextAction':{'action':_0x52c39b(0xe0),'command':CLI_BIN_NAME+'\x20bff\x20push\x20--type\x20'+_0x16eda9[_0x52c39b(0x141)]+_0x52c39b(0xef)+_0x483f78+_0x52c39b(0x128),'requiresReview':!![],'message':'If\x20the\x20reviewed\x20local\x20script\x20should\x20win,\x20run\x20this\x20command\x20to\x20update\x20the\x20remote\x20script.\x20Do\x20not\x20use\x20--force\x20to\x20resolve\x20a\x20content\x20conflict.'}};}function formatPullMessage(_0x48ea72,_0x150890,_0x1befdd,_0x419c7e){const _0x13f259=a43_0x43b08b,_0x3e7e1c=[_0x13f259(0x13d)+_0x48ea72+_0x13f259(0xf3),_0x150890+_0x13f259(0x15d)];_0x1befdd>0x0&&_0x3e7e1c['push'](_0x1befdd+_0x13f259(0x14a)+(_0x1befdd===0x1?'':'s')+'\x20'+(_0x1befdd===0x1?_0x13f259(0x11d):_0x13f259(0x15e))+'\x20resolution');if(_0x419c7e>0x0)_0x3e7e1c['push'](_0x419c7e+_0x13f259(0x124));return _0x3e7e1c[_0x13f259(0x11c)](',\x20');}function a43_0x35f6(_0x1d02e1,_0x384ed5){_0x1d02e1=_0x1d02e1-0xda;const _0x4def8a=a43_0x4def();let _0x35f6f2=_0x4def8a[_0x1d02e1];return _0x35f6f2;}async function hasUnsyncedLocalChanges(_0x4ba554,_0xc613cc,_0x8d3c6b){if(!await fileExists(_0x4ba554))return![];const _0x2f1905=await computeFileHash(_0x4ba554);if(!_0xc613cc)return _0x8d3c6b?_0x2f1905!==_0x8d3c6b:!![];return _0x2f1905!==_0xc613cc['hash'];}function createPullFileTransaction(){const _0xf6ebeb=new Map(),_0x466851=async(_0x51f56b,_0x284626)=>{const _0x12b850=a43_0x35f6;try{if(_0x284626[_0x12b850(0x165)])await ensureParentDirectory(_0x51f56b),await writeFile(_0x51f56b,_0x284626[_0x12b850(0x116)]);else try{await unlink(_0x51f56b);}catch(_0x3e9217){if(_0x3e9217[_0x12b850(0x11b)]!==_0x12b850(0xee))throw _0x3e9217;}return undefined;}catch(_0x4e1604){return _0x4e1604 instanceof Error?_0x4e1604:new Error(String(_0x4e1604));}};return{async 'write'(_0x418b1a,_0xcf5af1){const _0x5135ea=a43_0x35f6;if(!_0xf6ebeb[_0x5135ea(0x149)](_0x418b1a))try{_0xf6ebeb[_0x5135ea(0x130)](_0x418b1a,{'existed':!![],'content':await readFile(_0x418b1a)});}catch(_0x4808de){if(_0x4808de[_0x5135ea(0x11b)]!=='ENOENT')throw _0x4808de;_0xf6ebeb[_0x5135ea(0x130)](_0x418b1a,{'existed':![]});}try{await ensureParentDirectory(_0x418b1a),await writeFile(_0x418b1a,_0xcf5af1,'utf8');}catch(_0x2dd1b3){const _0x2e3e12=await _0x466851(_0x418b1a,_0xf6ebeb[_0x5135ea(0x120)](_0x418b1a));if(!_0x2e3e12)_0xf6ebeb['delete'](_0x418b1a);throw withRollbackErrors(_0x2dd1b3,_0x5135ea(0x15b)+_0x418b1a+'\x22.',_0x2e3e12?[_0x2e3e12]:[]);}},async 'rollback'(){const _0x2e90ca=a43_0x35f6,_0x12f8c7=[];for(const [_0x72f6b9,_0x5d318f]of[..._0xf6ebeb[_0x2e90ca(0x12a)]()][_0x2e90ca(0x16d)]()){const _0x230d83=await _0x466851(_0x72f6b9,_0x5d318f);_0x230d83&&_0x12f8c7['push'](new Error(_0x2e90ca(0xf1)+_0x72f6b9+'\x22:\x20'+_0x230d83[_0x2e90ca(0x107)]));}return _0x12f8c7;}};}function withRollbackErrors(_0x46a7d2,_0x3d00ac,_0x2b0bbc){const _0x324400=a43_0x43b08b,_0x13bf94=_0x46a7d2 instanceof Error?_0x46a7d2:new Error(String(_0x46a7d2));if(_0x2b0bbc['length']===0x0)return _0x13bf94;return new AggregateError([_0x13bf94,..._0x2b0bbc],_0x3d00ac+'\x20Recovery\x20errors:\x20'+_0x2b0bbc[_0x324400(0xf0)](_0x1558db=>_0x1558db['message'])['join'](';\x20'));}function buildDatasetCodeToAliasMap(_0x5e1a6f,_0x2bdc4e,_0x4ad510){const _0x177194=a43_0x43b08b,_0x29da15=resolveApiModelSource(_0x5e1a6f,_0x2bdc4e,_0x4ad510),_0x39ec33=loadAliasMap(_0x5e1a6f,undefined,_0x29da15[_0x177194(0xf6)],_0x29da15[_0x177194(0x10f)]);return assertUnambiguousHookAliases(_0x39ec33),new Map(_0x39ec33[_0x177194(0xf0)](_0x21ef19=>[_0x21ef19[_0x177194(0x11f)][_0x177194(0x109)](),_0x21ef19['alias']]));}async function planHookDirectoryMigration(_0x1f8ba8,_0xbc4ef3,_0x5b6b1f,_0xc93b7f){const _0x168528=a43_0x43b08b,_0x2959d8=new Map();for(const [_0x462440,_0x166ec9]of Object[_0x168528(0x12a)](_0xbc4ef3[_0x168528(0x103)])){const [_0x242e16,_0x55d6df,_0x2e2492,_0x4f698d,_0x40dfea,..._0x13c5ff]=_0x462440[_0x168528(0x13a)]('/');if(_0x242e16!=='HOOK'||!_0x55d6df||!_0x2e2492||!_0x4f698d||!_0x40dfea||_0x13c5ff[_0x168528(0x105)]>0x0||!_0x166ec9[_0x168528(0x11f)])continue;const _0x3b37aa=_0x5b6b1f[_0x168528(0x120)](_0x166ec9[_0x168528(0x11f)][_0x168528(0x109)]()),_0x2db6de=_0x3b37aa??_0x166ec9[_0x168528(0x11f)];if(!isSafeHookDirectorySegment(_0x55d6df))throw CliErrors['validation']('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x55d6df+'\x22\x20from\x20the\x20lock\x20file.');if(!isSafeHookDirectorySegment(_0x2db6de))throw CliErrors['validation'](_0x168528(0xfa)+_0x55d6df+_0x168528(0x115));if(_0x55d6df===_0x2db6de)continue;const _0x22936a=_0x2959d8[_0x168528(0x120)](_0x55d6df)??{'datasetCode':_0x166ec9[_0x168528(0x11f)],'alias':_0x3b37aa,'keyChanges':[]};if(_0x22936a[_0x168528(0x11f)]!==_0x166ec9[_0x168528(0x11f)])throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x55d6df+_0x168528(0xde));const _0x182a6a=_0x168528(0x102)+_0x2db6de+'/'+_0x2e2492+'/'+_0x4f698d+'/'+_0x40dfea;try{resolveLocalFilePathFromLockKey(_0x1f8ba8,_0x462440),resolveLocalFilePathFromLockKey(_0x1f8ba8,_0x182a6a);}catch(_0x180dc8){throw CliErrors[_0x168528(0x133)](_0x168528(0x148)+_0x462440+_0x168528(0x104)+(_0x180dc8 instanceof Error?_0x180dc8[_0x168528(0x107)]:String(_0x180dc8)));}_0x22936a[_0x168528(0x14d)][_0x168528(0x110)]({'oldLockKey':_0x462440,'newLockKey':_0x182a6a,'entry':_0x166ec9}),_0x2959d8[_0x168528(0x130)](_0x55d6df,_0x22936a);}const _0x323344=new Set([..._0x2959d8[_0x168528(0x131)]()][_0x168528(0xfc)](_0x5d1e2c=>_0x5d1e2c[_0x168528(0x14d)][_0x168528(0xf0)](_0x5e6d9f=>_0x5e6d9f[_0x168528(0x157)]))),_0x38280b=new Map(),_0x24243b=new Map();for(const [_0x328d7b,_0x36bef7]of _0x2959d8){const _0x5a1a92=_0x36bef7['alias']??_0x36bef7['datasetCode'],_0x325cf5=hookDirectoryIdentity(_0x5a1a92),_0x2daeac=_0x38280b[_0x168528(0x120)](_0x325cf5);if(_0x2daeac&&_0x2daeac!==_0x328d7b)throw CliErrors[_0x168528(0x133)](_0x168528(0x150)+_0x2daeac+'\x22\x20and\x20\x22'+_0x328d7b+'\x22:\x20both\x20target\x20\x22'+_0x5a1a92+_0x168528(0x140));_0x38280b[_0x168528(0x130)](_0x325cf5,_0x328d7b);for(const _0x5a1763 of _0x36bef7['keyChanges']){const _0x171c75=_0x24243b[_0x168528(0x120)](_0x5a1763['newLockKey']);if(_0x171c75&&_0x171c75!==_0x5a1763[_0x168528(0x157)])throw CliErrors[_0x168528(0x133)](_0x168528(0x129)+_0x171c75+'\x22\x20and\x20\x22'+_0x5a1763[_0x168528(0x157)]+_0x168528(0xf2)+_0x5a1763[_0x168528(0x164)]+_0x168528(0x12e));if(_0x323344['has'](_0x5a1763['newLockKey']))throw CliErrors[_0x168528(0x133)](_0x168528(0x152)+_0x5a1763[_0x168528(0x157)]+'\x22:\x20its\x20target\x20\x22'+_0x5a1763[_0x168528(0x164)]+'\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');_0x24243b[_0x168528(0x130)](_0x5a1763[_0x168528(0x164)],_0x5a1763['oldLockKey']);}}const _0x451dfe=new Map();for(const [_0x210381,_0x145b2e]of _0x5b6b1f){_0x451dfe['set'](hookDirectoryIdentity(_0x145b2e),_0x210381);}const _0x115519=[];for(const [_0x21017e,_0x44cabd]of _0x2959d8){const _0x16b346=_0x44cabd[_0x168528(0x101)]??_0x44cabd[_0x168528(0x11f)],_0xd84c5=join(_0x1f8ba8[_0x168528(0xdf)],_0x168528(0x151),_0x21017e),_0x5d5fb5=join(_0x1f8ba8[_0x168528(0xdf)],'HOOK',_0x16b346),_0xdcb96e=await directoryExists(_0xd84c5),_0x201372=await directoryExists(_0x5d5fb5),_0x175960=_0xdcb96e?_0x201372?await sameDirectory(_0xd84c5,_0x5d5fb5)?'case-rename':undefined:'move':'rekey';if(!_0x175960)throw CliErrors[_0x168528(0x133)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x21017e+'\x22\x20to\x20\x22'+_0x16b346+_0x168528(0x127));const _0xcc062c=_0x451dfe[_0x168528(0x120)](hookDirectoryIdentity(_0x21017e));if(_0xcc062c&&_0xcc062c!==_0x44cabd[_0x168528(0x11f)][_0x168528(0x109)]()){const _0x3ec37d=new Set(_0x44cabd[_0x168528(0x14d)][_0x168528(0xf0)](_0x52ab8b=>_0x52ab8b['oldLockKey'])),_0x12b62c=_0xc93b7f[_0x168528(0xdb)](_0x5768a5=>_0x5768a5[_0x168528(0x141)]===_0x168528(0x151)&&_0x5768a5['alias']!=null&&hookDirectoryIdentity(_0x5768a5[_0x168528(0x101)])===hookDirectoryIdentity(_0x21017e)&&!_0x3ec37d[_0x168528(0x149)](_0x5768a5[_0x168528(0x145)]));if(_0x12b62c[_0x168528(0x105)]>0x0)throw CliErrors['validation'](_0x168528(0xfa)+_0x21017e+_0x168528(0x163));}const _0x268e6c=_0x451dfe[_0x168528(0x120)](hookDirectoryIdentity(_0x16b346));if(_0x268e6c&&_0x268e6c!==_0x44cabd[_0x168528(0x11f)][_0x168528(0x109)]())throw CliErrors[_0x168528(0x133)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x21017e+'\x22\x20to\x20\x22'+_0x16b346+_0x168528(0x153));for(const _0x52f992 of _0x44cabd[_0x168528(0x14d)]){const _0x1f2517=_0xbc4ef3[_0x168528(0x103)][_0x52f992[_0x168528(0x164)]];if(_0x1f2517&&!_0x323344[_0x168528(0x149)](_0x52f992[_0x168528(0x164)])&&!sameHookIdentity(_0x52f992[_0x168528(0x125)],_0x1f2517))throw CliErrors[_0x168528(0x133)](_0x168528(0xfa)+_0x21017e+_0x168528(0x14b)+_0x16b346+_0x168528(0xff));}_0x115519[_0x168528(0x110)]({'oldDirectory':_0x21017e,'newDirectory':_0x16b346,'oldDirectoryPath':_0xd84c5,'newDirectoryPath':_0x5d5fb5,'mode':_0x175960,'alias':_0x44cabd[_0x168528(0x101)],'keyChanges':_0x44cabd[_0x168528(0x14d)]});}const _0x2b922e={..._0xbc4ef3[_0x168528(0x103)]},_0x3893ad=new Map(),_0x11c2a4=new Map();for(const _0x3b1cc9 of _0x115519){const _0x1bf130=_0x3b1cc9['mode']!==_0x168528(0xe8);_0x1bf130&&_0x11c2a4[_0x168528(0x130)](hookDirectoryIdentity(_0x3b1cc9['newDirectory']),_0x3b1cc9[_0x168528(0x12b)]);for(const _0x3f9601 of _0x3b1cc9['keyChanges']){const _0x8d7456=_0x2b922e[_0x3f9601[_0x168528(0x164)]],_0x1c4698=_0x1bf130?_0x3f9601[_0x168528(0x125)]:_0x8d7456??_0x3f9601[_0x168528(0x125)];_0x2b922e[_0x3f9601['newLockKey']]=canonicalizeHookEntry(_0x1c4698,_0x3b1cc9['alias']),delete _0x2b922e[_0x3f9601[_0x168528(0x157)]],_0x1bf130&&_0x3893ad[_0x168528(0x130)](_0x3f9601[_0x168528(0x164)],resolveLocalFilePathFromLockKey(_0x1f8ba8,_0x3f9601[_0x168528(0x157)]));}}return{'migrations':_0x115519,'projectedFunctions':_0x2b922e,'sourceFilePathByNewLockKey':_0x3893ad,'sourceDirectoryPathByNewDirectory':_0x11c2a4};}function resolveMigratedSourceFilePath(_0x566827,_0x529907){const _0x15d5ee=a43_0x43b08b;if(!_0x566827||!_0x529907)return undefined;const _0x323b8e=_0x566827[_0x15d5ee(0xed)][_0x15d5ee(0x120)](_0x529907['lockKey']);if(_0x323b8e)return _0x323b8e;if(_0x529907['type']!=='HOOK')return undefined;const [,_0x1ae5bd,..._0xe325cf]=_0x529907['lockKey'][_0x15d5ee(0x13a)]('/');if(!_0x1ae5bd||_0xe325cf[_0x15d5ee(0x105)]===0x0)return undefined;const _0x3a07f9=_0x566827[_0x15d5ee(0x13e)][_0x15d5ee(0x120)](hookDirectoryIdentity(_0x1ae5bd));return _0x3a07f9?join(_0x3a07f9,..._0xe325cf)+_0x15d5ee(0x14f):undefined;}function sameHookIdentity(_0xf94da4,_0x372208){const _0x323ad6=a43_0x43b08b;return _0xf94da4[_0x323ad6(0x10d)]===_0x372208[_0x323ad6(0x10d)]&&_0xf94da4[_0x323ad6(0x11f)]===_0x372208[_0x323ad6(0x11f)]&&_0xf94da4[_0x323ad6(0x114)]===_0x372208[_0x323ad6(0x114)]&&_0xf94da4['functionNode']===_0x372208[_0x323ad6(0x144)];}function canonicalizeHookEntry(_0x357ef5,_0x200581){const {alias:_0x7cb840,..._0x5744e7}=_0x357ef5;return _0x200581?{..._0x5744e7,'alias':_0x200581}:_0x5744e7;}function hookDirectoryIdentity(_0x2f1784){const _0x1d9dd0=a43_0x43b08b;return _0x2f1784[_0x1d9dd0(0xe5)]('NFC')[_0x1d9dd0(0x109)]();}function isSafeHookDirectorySegment(_0xe03fe2){return isSafeLockKeySegment(_0xe03fe2);}async function sameDirectory(_0x3e745a,_0x4ab009){const _0x1805ec=a43_0x43b08b,[_0x14732e,_0xd0f1ba]=await Promise['all']([stat(_0x3e745a),stat(_0x4ab009)]);return _0x14732e[_0x1805ec(0x134)]===_0xd0f1ba[_0x1805ec(0x134)]&&_0x14732e['ino']===_0xd0f1ba[_0x1805ec(0x16f)];}async function applyHookDirectoryMigration(_0x26926e,_0x3de425){const _0x4efb6a=a43_0x43b08b,_0x4176e2=_0x3de425[_0x4efb6a(0x103)],_0x5372fe=_0x3de425[_0x4efb6a(0x10e)],_0x3d314d=[],_0x107dde=async()=>{const _0x14d566=_0x4efb6a,_0x3bcf13=[];_0x3de425['functions']=_0x4176e2,_0x3de425[_0x14d566(0x10e)]=_0x5372fe;for(const {migration:_0x407fa2,temporaryPath:_0x4902d8}of[..._0x3d314d]['reverse']()){try{_0x4902d8?(await rename(_0x407fa2[_0x14d566(0x14e)],_0x4902d8),await rename(_0x4902d8,_0x407fa2[_0x14d566(0x12b)])):await rename(_0x407fa2[_0x14d566(0x14e)],_0x407fa2[_0x14d566(0x12b)]);}catch(_0x555f2a){_0x3bcf13['push'](new Error(_0x14d566(0x123)+_0x407fa2[_0x14d566(0xda)]+'\x22\x20from\x20\x22'+_0x407fa2[_0x14d566(0x10b)]+'\x22:\x20'+(_0x555f2a instanceof Error?_0x555f2a[_0x14d566(0x107)]:String(_0x555f2a))));}}return _0x3bcf13;};try{for(const _0x185e89 of _0x26926e[_0x4efb6a(0xf8)]){if(_0x185e89[_0x4efb6a(0x106)]==='move')await ensureParentDirectory(_0x185e89[_0x4efb6a(0x14e)]),await rename(_0x185e89[_0x4efb6a(0x12b)],_0x185e89[_0x4efb6a(0x14e)]),_0x3d314d[_0x4efb6a(0x110)]({'migration':_0x185e89});else{if(_0x185e89[_0x4efb6a(0x106)]==='case-rename'){const _0x2ccd57=join(dirname(_0x185e89[_0x4efb6a(0x12b)]),_0x4efb6a(0x122)+randomUUID());await rename(_0x185e89[_0x4efb6a(0x12b)],_0x2ccd57);try{await rename(_0x2ccd57,_0x185e89[_0x4efb6a(0x14e)]);}catch(_0x572bb8){try{await rename(_0x2ccd57,_0x185e89[_0x4efb6a(0x12b)]);}catch(_0x2fda1f){throw withRollbackErrors(_0x572bb8,'Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22'+_0x185e89[_0x4efb6a(0xda)]+'\x22\x20to\x20\x22'+_0x185e89[_0x4efb6a(0x10b)]+_0x4efb6a(0x16e)+_0x2ccd57+_0x4efb6a(0xe7),[new Error('Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22'+_0x2ccd57+'\x22\x20to\x20\x22'+_0x185e89[_0x4efb6a(0xda)]+_0x4efb6a(0x104)+(_0x2fda1f instanceof Error?_0x2fda1f[_0x4efb6a(0x107)]:String(_0x2fda1f)))]);}throw _0x572bb8;}_0x3d314d[_0x4efb6a(0x110)]({'migration':_0x185e89,'temporaryPath':_0x2ccd57});}}}return _0x3de425['functions']=_0x26926e[_0x4efb6a(0xdd)],{'rollback':_0x107dde};}catch(_0xbfbb2c){const _0x587dd5=await _0x107dde();throw withRollbackErrors(_0xbfbb2c,_0x4efb6a(0x166),_0x587dd5);}}async function confirmForce(){const _0x58bd66=a43_0x43b08b,_0x2080b8=createInterface({'input':process[_0x58bd66(0x117)],'output':process[_0x58bd66(0xec)]}),_0x23fcd7=await new Promise(_0xfc74a4=>{const _0x22fdcf=_0x58bd66;_0x2080b8[_0x22fdcf(0x13b)](_0x22fdcf(0x156),_0xfc74a4);});return _0x2080b8[_0x58bd66(0x146)](),['y',_0x58bd66(0x13c)][_0x58bd66(0x119)](_0x23fcd7[_0x58bd66(0x155)]()[_0x58bd66(0x109)]());}