@lovrabet/rabetbase-cli 2.5.10-beta.4 → 2.5.10

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 +4 -4
  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_0x17c8e4=a34_0x16d9;(function(_0x5886b3,_0x5529fa){const _0x2d1cd5=a34_0x16d9,_0x17a167=_0x5886b3();while(!![]){try{const _0x244589=parseInt(_0x2d1cd5(0x19d))/0x1+parseInt(_0x2d1cd5(0x1a0))/0x2*(parseInt(_0x2d1cd5(0x193))/0x3)+parseInt(_0x2d1cd5(0x194))/0x4*(-parseInt(_0x2d1cd5(0x18f))/0x5)+-parseInt(_0x2d1cd5(0x191))/0x6+-parseInt(_0x2d1cd5(0x195))/0x7+parseInt(_0x2d1cd5(0x1a2))/0x8*(parseInt(_0x2d1cd5(0x18a))/0x9)+parseInt(_0x2d1cd5(0x18d))/0xa*(parseInt(_0x2d1cd5(0x190))/0xb);if(_0x244589===_0x5529fa)break;else _0x17a167['push'](_0x17a167['shift']());}catch(_0x508698){_0x17a167['push'](_0x17a167['shift']());}}}(a34_0x5978,0x21a3f));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assertSingleValueSource,assertValueSourceReadable,asAppConfigDryRunResult,buildMutationData,FROM_ENV_FLAG,KEY_ARG,plannedAppConfig,projectAppConfig,readAppConfigValue,readKeyArg,readOptionalTags,STDIN_FLAG,TAGS_FLAG,VALUE_ARG,withAppConfigApiBoundary}from'../../commands/app-config/shared.js';const CREATE_PATH=a34_0x17c8e4(0x18b),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a34_0x17c8e4(0x192),'command':'set','description':'Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','risk':a34_0x17c8e4(0x19b),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':'file','type':'string','description':a34_0x17c8e4(0x18e)}],async 'validate'(_0x2ed6f1){readKeyArg(_0x2ed6f1),readOptionalTags(_0x2ed6f1),assertSingleValueSource(_0x2ed6f1);},async 'dryRun'(_0x2bcab2){const _0x4bf666=a34_0x17c8e4,_0x219eb7=readKeyArg(_0x2bcab2),_0xaae06c=readOptionalTags(_0x2bcab2),_0x2d256b=assertSingleValueSource(_0x2bcab2);await assertValueSourceReadable(_0x2d256b);const _0x2a0b1b=await withAppConfigApiBoundary('get',{'appCode':_0x2bcab2[_0x4bf666(0x18c)],'key':_0x219eb7},()=>getAppConfigByKey(_0x2bcab2[_0x4bf666(0x18c)],_0x219eb7)),_0x37156d=_0x2a0b1b?_0x4bf666(0x198):_0x4bf666(0x19c),_0x39358e=_0x2a0b1b?projectAppConfig(_0x2a0b1b):null,_0xebbd45=plannedAppConfig({'appCode':_0x2bcab2[_0x4bf666(0x18c)],'key':_0x219eb7,'tags':_0xaae06c??_0x2a0b1b?.['tags'],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x37156d,'appCode':_0x2bcab2[_0x4bf666(0x18c)],'key':_0x219eb7,'before':_0x39358e,'after':_0xebbd45,'dryRun':!![]}),{'method':_0x4bf666(0x19a),'url':_0x37156d===_0x4bf666(0x198)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x3f9a3e){const _0x351d89=a34_0x17c8e4,_0x24e779=readKeyArg(_0x3f9a3e),_0x1fae69=readOptionalTags(_0x3f9a3e),_0x560932=await withAppConfigApiBoundary('get',{'appCode':_0x3f9a3e['appCode'],'key':_0x24e779},()=>getAppConfigByKey(_0x3f9a3e[_0x351d89(0x18c)],_0x24e779)),_0x42c6c5=_0x560932?projectAppConfig(_0x560932):null,_0x349f3f=_0x560932?_0x351d89(0x198):_0x351d89(0x19c),{value:_0x33a47b,warnings:_0x450636}=await readAppConfigValue(_0x3f9a3e),_0x27e692={'appCode':_0x3f9a3e[_0x351d89(0x18c)],'key':_0x24e779,'value':_0x33a47b,'tags':_0x1fae69??_0x560932?.[_0x351d89(0x199)]??undefined};await withAppConfigApiBoundary(_0x349f3f,{'appCode':_0x3f9a3e[_0x351d89(0x18c)],'key':_0x24e779},async()=>{_0x560932?await updateAppConfig({..._0x27e692,'id':requireAppConfigId(_0x560932,_0x24e779,_0x3f9a3e['appCode'])}):await createAppConfig(_0x27e692);});const _0x9ed46c=await withAppConfigApiBoundary(_0x351d89(0x189),{'appCode':_0x3f9a3e[_0x351d89(0x18c)],'key':_0x24e779},()=>getAppConfigByKey(_0x3f9a3e[_0x351d89(0x18c)],_0x24e779)),_0x44908f=_0x9ed46c?projectAppConfig(_0x9ed46c):plannedAppConfig({'appCode':_0x3f9a3e[_0x351d89(0x18c)],'key':_0x24e779,'tags':_0x27e692[_0x351d89(0x199)],'hasValue':_0x33a47b!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x349f3f,'appCode':_0x3f9a3e[_0x351d89(0x18c)],'key':_0x24e779,'before':_0x42c6c5,'after':_0x44908f,'dryRun':![],'warnings':_0x450636}),'message':(_0x349f3f===_0x351d89(0x198)?_0x351d89(0x196):_0x351d89(0x188))+_0x351d89(0x19f)+_0x24e779};}};function requireAppConfigId(_0x25d55e,_0x58b6db,_0x1f04cc){const _0x1f81b3=a34_0x17c8e4;if(typeof _0x25d55e['id']==='number'&&Number[_0x1f81b3(0x19e)](_0x25d55e['id'])&&_0x25d55e['id']>0x0)return _0x25d55e['id'];throw CliErrors[_0x1f81b3(0x1a1)](_0x1f81b3(0x197)+_0x58b6db+',\x20appCode='+_0x1f04cc);}function a34_0x16d9(_0x5bc496,_0x5f2c94){_0x5bc496=_0x5bc496-0x188;const _0x59781d=a34_0x5978();let _0x16d997=_0x59781d[_0x5bc496];return _0x16d997;}function a34_0x5978(){const _0x4d7fad=['apiError','816liEdct','Created','get','243lcZhDX','/smartapi/app-config/create','appCode','50ZlzdWK','Read\x20config\x20value\x20from\x20file','95puknLY','461989ZMVXSl','521412anNgrY','app-config','6942rSHuXD','16840FlcSmr','221543kJtlmP','Updated','App\x20config\x20server\x20id\x20missing\x20for\x20key=','update','tags','POST','write','create','105071hFjakM','isFinite','\x20app\x20config\x20','16owQbbv'];a34_0x5978=function(){return _0x4d7fad;};return a34_0x5978();}
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 +1 @@
1
- const a35_0x5b3135=a35_0x5802;(function(_0x11e410,_0x434f65){const _0x11c62d=a35_0x5802,_0x21ccb0=_0x11e410();while(!![]){try{const _0x552863=parseInt(_0x11c62d(0x210))/0x1*(-parseInt(_0x11c62d(0x20c))/0x2)+-parseInt(_0x11c62d(0x1df))/0x3+parseInt(_0x11c62d(0x1e2))/0x4*(parseInt(_0x11c62d(0x21c))/0x5)+-parseInt(_0x11c62d(0x1e6))/0x6*(-parseInt(_0x11c62d(0x201))/0x7)+parseInt(_0x11c62d(0x1f6))/0x8*(-parseInt(_0x11c62d(0x200))/0x9)+parseInt(_0x11c62d(0x1de))/0xa*(-parseInt(_0x11c62d(0x1fc))/0xb)+parseInt(_0x11c62d(0x219))/0xc;if(_0x552863===_0x434f65)break;else _0x21ccb0['push'](_0x21ccb0['shift']());}catch(_0x122a33){_0x21ccb0['push'](_0x21ccb0['shift']());}}}(a35_0x96e4,0xeb5a6));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x5b3135(0x212),'description':a35_0x5b3135(0x1f8),'required':!![]};export const VALUE_ARG={'name':a35_0x5b3135(0x1ea),'description':'Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','required':![]};export const TAGS_FLAG={'name':a35_0x5b3135(0x20d),'type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':a35_0x5b3135(0x209),'type':'boolean','description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':a35_0x5b3135(0x1e0),'type':a35_0x5b3135(0x1fd),'description':a35_0x5b3135(0x208)};export const REVEAL_FLAG={'name':a35_0x5b3135(0x214),'type':a35_0x5b3135(0x1f2),'description':a35_0x5b3135(0x21f),'default':![]};export function readKeyArg(_0x5df9f3){const _0x4af741=a35_0x5b3135,_0xe7cbdf=_0x5df9f3[_0x4af741(0x217)][0x0]?.[_0x4af741(0x218)]()??'';return validateKey(_0xe7cbdf),_0xe7cbdf;}function a35_0x96e4(){const _0x2248ac=['value\x20is\x20redacted','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','209PvCWpI','string','path','Missing\x20app-config\x20key.','2102598fgwKoO','14TwzpEg','env','setEncoding','url','appCode','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','utf8','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','stdin','data','join','46LacYol','tags','slice','warnings','11797CJMWWH','kind','key','bool','reveal','after','push','args','trim','47739648NIGdna','argument','length','2115FEWhWi','file','before','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','941530vBZJEh','1803774IQiDnw','from-env','str','1080yICrQg','name','gmtCreate','once','4205892uZfYCT','hasValue','end','apiError','value','validation','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','key:\x20','valueRedacted','appCode:\x20','Environment\x20variable\x20is\x20not\x20set:\x20','gmtModified','boolean','error','Missing\x20app-config\x20value\x20source.','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','64Atafft','dryRun','Runtime\x20app-config\x20key','operation'];a35_0x96e4=function(){return _0x2248ac;};return a35_0x96e4();}export function readOptionalTags(_0x1658d3){const _0x11d540=a35_0x5b3135,_0xc8a112=_0x1658d3['str']('tags')['trim']();if(!_0xc8a112)return undefined;if(_0xc8a112[_0x11d540(0x21b)]>0x20)throw CliErrors['validation'](_0x11d540(0x1fb));return _0xc8a112;}export function validateKey(_0x49f359){const _0x415642=a35_0x5b3135;if(!_0x49f359)throw CliErrors[_0x415642(0x1eb)](_0x415642(0x1ff));if(_0x49f359[_0x415642(0x21b)]>0x100)throw CliErrors[_0x415642(0x1eb)](_0x415642(0x1ec));}export function projectAppConfig(_0x4ad415,_0x50d53c){const _0x572202=a35_0x5b3135,_0x58e5fc=_0x4ad415[_0x572202(0x1ea)]!==undefined&&_0x4ad415[_0x572202(0x1ea)]!==null&&_0x4ad415[_0x572202(0x1ea)]!=='',_0x10ee45={'appCode':_0x4ad415[_0x572202(0x205)],'key':_0x4ad415[_0x572202(0x212)],'tags':_0x4ad415[_0x572202(0x20d)]??undefined,'hasValue':_0x58e5fc,'valueRedacted':_0x58e5fc&&!_0x50d53c?.[_0x572202(0x214)],'gmtCreate':_0x4ad415[_0x572202(0x1e4)],'gmtModified':_0x4ad415[_0x572202(0x1f1)]};return _0x50d53c?.[_0x572202(0x214)]&&(_0x10ee45['value']=_0x4ad415[_0x572202(0x1ea)]??'',_0x10ee45[_0x572202(0x1ee)]=![]),_0x10ee45;}export function plannedAppConfig(_0x49ba65){const _0x40c1d6=a35_0x5b3135,_0x19e2bf=_0x49ba65[_0x40c1d6(0x1e7)]??!![];return{'appCode':_0x49ba65[_0x40c1d6(0x205)],'key':_0x49ba65['key'],'tags':_0x49ba65[_0x40c1d6(0x20d)]??undefined,'hasValue':_0x19e2bf,'valueRedacted':_0x19e2bf};}export function buildMutationData(_0x3cbfb2){const _0xa10405=a35_0x5b3135;return{'operation':_0x3cbfb2[_0xa10405(0x1f9)],'selector':{'appCode':_0x3cbfb2['appCode'],'key':_0x3cbfb2[_0xa10405(0x212)]},'before':_0x3cbfb2[_0xa10405(0x21e)],'after':_0x3cbfb2[_0xa10405(0x215)],'dryRun':_0x3cbfb2[_0xa10405(0x1f7)],'warnings':_0x3cbfb2[_0xa10405(0x20f)]??[]};}function a35_0x5802(_0x21465b,_0x4360d2){_0x21465b=_0x21465b-0x1de;const _0x96e4f1=a35_0x96e4();let _0x580291=_0x96e4f1[_0x21465b];return _0x580291;}export async function withAppConfigApiBoundary(_0x3ef27e,_0x578378,_0x109d75){const _0x952791=a35_0x5b3135;try{return await _0x109d75();}catch{const _0x40518a=[_0x952791(0x1ef)+_0x578378[_0x952791(0x205)]];if(_0x578378[_0x952791(0x212)])_0x40518a[_0x952791(0x216)](_0x952791(0x1ed)+_0x578378[_0x952791(0x212)]);_0x40518a[_0x952791(0x216)](_0x952791(0x1fa));throw CliErrors[_0x952791(0x1e9)]('Failed\x20to\x20'+_0x3ef27e+'\x20app\x20config.',_0x40518a[_0x952791(0x20b)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x4d753b,_0xff945f){const _0x59e856=a35_0x5b3135;return Object['defineProperties'](_0x4d753b,{'method':{'value':_0xff945f['method'],'enumerable':![]},'url':{'value':_0xff945f[_0x59e856(0x204)],'enumerable':![]}});}export function assertSingleValueSource(_0xaf1db){const _0x47c192=a35_0x5b3135,_0x1fe111=[];_0xaf1db['args'][_0x47c192(0x21b)]>0x1&&_0x1fe111[_0x47c192(0x216)]({'kind':_0x47c192(0x21a),'value':_0xaf1db[_0x47c192(0x217)][_0x47c192(0x20e)](0x1)[_0x47c192(0x20b)]('\x20')});const _0x6a764c=_0xaf1db['flag']('value');_0x6a764c!==undefined&&_0x6a764c!==null&&_0x1fe111[_0x47c192(0x216)]({'kind':'argument','value':String(_0x6a764c)});_0xaf1db[_0x47c192(0x213)]('stdin')&&_0x1fe111[_0x47c192(0x216)]({'kind':_0x47c192(0x209)});const _0x33025e=_0xaf1db[_0x47c192(0x1e1)](_0x47c192(0x1e0))[_0x47c192(0x218)]();_0x33025e&&_0x1fe111['push']({'kind':_0x47c192(0x202),'name':_0x33025e});const _0x333a6a=_0xaf1db[_0x47c192(0x1e1)](_0x47c192(0x21d))['trim']();_0x333a6a&&_0x1fe111[_0x47c192(0x216)]({'kind':_0x47c192(0x21d),'path':_0x333a6a});if(_0x1fe111[_0x47c192(0x21b)]===0x0)throw CliErrors[_0x47c192(0x1eb)](_0x47c192(0x1f4),'Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');if(_0x1fe111[_0x47c192(0x21b)]>0x1)throw CliErrors['validation']('App\x20config\x20value\x20source\x20is\x20ambiguous.',_0x47c192(0x206));return _0x1fe111[0x0];}export async function assertValueSourceReadable(_0x29aab6){const _0x3071e7=a35_0x5b3135;if(_0x29aab6[_0x3071e7(0x211)]===_0x3071e7(0x202)&&!(_0x29aab6[_0x3071e7(0x1e3)]in process.env))throw CliErrors[_0x3071e7(0x1eb)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x29aab6['name']);if(_0x29aab6[_0x3071e7(0x211)]===_0x3071e7(0x21d))try{await access(_0x29aab6[_0x3071e7(0x1fe)]);}catch{throw CliErrors['validation']('Value\x20file\x20is\x20not\x20readable:\x20'+_0x29aab6['path']);}}export async function readAppConfigValue(_0x545645){const _0x5240aa=a35_0x5b3135,_0x378383=assertSingleValueSource(_0x545645),_0x3f2aa6=[];if(_0x378383[_0x5240aa(0x211)]===_0x5240aa(0x21a))return _0x3f2aa6[_0x5240aa(0x216)](_0x5240aa(0x1f5)),{'value':_0x378383[_0x5240aa(0x1ea)]??'','source':_0x378383[_0x5240aa(0x211)],'warnings':_0x3f2aa6};if(_0x378383[_0x5240aa(0x211)]===_0x5240aa(0x209))return{'value':await readStdin(),'source':_0x378383['kind'],'warnings':_0x3f2aa6};if(_0x378383['kind']===_0x5240aa(0x202)){if(!(_0x378383['name']in process.env))throw CliErrors['validation'](_0x5240aa(0x1f0)+_0x378383[_0x5240aa(0x1e3)]);return{'value':process.env[_0x378383.name]??'','source':_0x378383[_0x5240aa(0x211)],'warnings':_0x3f2aa6};}return{'value':await readFile(_0x378383['path'],'utf8'),'source':_0x378383[_0x5240aa(0x211)],'warnings':_0x3f2aa6};}function readStdin(){return new Promise((_0xa65e7b,_0x4ee55d)=>{const _0x4dd80c=a35_0x5802;let _0x599070='';process[_0x4dd80c(0x209)][_0x4dd80c(0x203)](_0x4dd80c(0x207)),process[_0x4dd80c(0x209)]['on'](_0x4dd80c(0x20a),_0x2383c8=>{_0x599070+=_0x2383c8;}),process[_0x4dd80c(0x209)][_0x4dd80c(0x1e5)](_0x4dd80c(0x1e8),()=>_0xa65e7b(_0x599070)),process[_0x4dd80c(0x209)][_0x4dd80c(0x1e5)](_0x4dd80c(0x1f3),_0x4ee55d);});}
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 +1 @@
1
- const a36_0x353cfb=a36_0xa1d2;(function(_0x1e642f,_0x21d66b){const _0x38c8b7=a36_0xa1d2,_0x593708=_0x1e642f();while(!![]){try{const _0x149723=-parseInt(_0x38c8b7(0x175))/0x1+-parseInt(_0x38c8b7(0x171))/0x2*(parseInt(_0x38c8b7(0x16a))/0x3)+parseInt(_0x38c8b7(0x168))/0x4*(parseInt(_0x38c8b7(0x170))/0x5)+-parseInt(_0x38c8b7(0x16b))/0x6+parseInt(_0x38c8b7(0x17c))/0x7*(parseInt(_0x38c8b7(0x169))/0x8)+parseInt(_0x38c8b7(0x16c))/0x9*(-parseInt(_0x38c8b7(0x177))/0xa)+parseInt(_0x38c8b7(0x172))/0xb;if(_0x149723===_0x21d66b)break;else _0x593708['push'](_0x593708['shift']());}catch(_0x3176e9){_0x593708['push'](_0x593708['shift']());}}}(a36_0x2690,0x50bf1));import{unlinkSync,existsSync}from'node:fs';function a36_0xa1d2(_0x47f29e,_0x467f00){_0x47f29e=_0x47f29e-0x168;const _0x269096=a36_0x2690();let _0xa1d26e=_0x269096[_0x47f29e];return _0xa1d26e;}function a36_0x2690(){const _0x25febb=['../../auth/auth-server-ui.js','Clear\x20login\x20session','261842wCmUTp','!\x20Not\x20logged\x20in','3387950czMxHP','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','nonInteractive','log','logout','2194682qLexQw','1079348miWIXu','8jNrjyG','45PUDhkN','2384802awjYed','9hjAsYw','auth','boolean','yes','10yWSTnt','1332srUZxD','5341941skTqFs'];a36_0x2690=function(){return _0x25febb;};return a36_0x2690();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':'auth','command':'login','description':'Login\x20via\x20browser','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x353cfb(0x16f),'type':a36_0x353cfb(0x16e),'description':a36_0x353cfb(0x178),'default':![]}],async 'execute'(_0x39dbf5){const _0x56491a=a36_0x353cfb,{runAuthServer:_0x23f1f3}=await import(_0x56491a(0x173));return await _0x23f1f3({'autoYes':_0x39dbf5['bool'](_0x56491a(0x16f)),'nonInteractive':_0x39dbf5[_0x56491a(0x179)]}),{'ok':!![]};}},{'service':a36_0x353cfb(0x16d),'command':a36_0x353cfb(0x17b),'description':a36_0x353cfb(0x174),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4a96f5){const _0x9a5e69=a36_0x353cfb;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x9a5e69(0x17a)]('✓\x20Logged\x20out')):console[_0x9a5e69(0x17a)](_0x9a5e69(0x176)),{'ok':!![]};}}];
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 +1 @@
1
- const a37_0x52781a=a37_0x2aaf;(function(_0x3852c4,_0x410461){const _0x21090a=a37_0x2aaf,_0x4a635e=_0x3852c4();while(!![]){try{const _0x16af32=parseInt(_0x21090a(0x1cf))/0x1*(parseInt(_0x21090a(0x1b8))/0x2)+parseInt(_0x21090a(0x1d8))/0x3+-parseInt(_0x21090a(0x1d2))/0x4*(-parseInt(_0x21090a(0x1e3))/0x5)+-parseInt(_0x21090a(0x1a4))/0x6*(-parseInt(_0x21090a(0x187))/0x7)+parseInt(_0x21090a(0x1d5))/0x8+parseInt(_0x21090a(0x1c5))/0x9*(parseInt(_0x21090a(0x1cd))/0xa)+-parseInt(_0x21090a(0x1ce))/0xb*(parseInt(_0x21090a(0x198))/0xc);if(_0x16af32===_0x410461)break;else _0x4a635e['push'](_0x4a635e['shift']());}catch(_0x15ca9f){_0x4a635e['push'](_0x4a635e['shift']());}}}(a37_0x4ac8,0x3caa0));function a37_0x2aaf(_0x4532e2,_0x5af261){_0x4532e2=_0x4532e2-0x185;const _0x4ac822=a37_0x4ac8();let _0x2aafee=_0x4ac822[_0x4532e2];return _0x2aafee;}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';function a37_0x4ac8(){const _0x10b215=['\x20api\x20pull`\x20to\x20refresh.','HOOK\x20requires\x20alias/operation/node\x20options.','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','24Syurev','operationType','Dataset\x20not\x20found\x20for\x20code\x20\x22','parseInt','/**\x0a\x20*\x20','description','selectedAppName','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','.js','functionNode','\x0a\x20*\x20[平台配置]\x20','Available:\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','File\x20already\x20exists:\x20','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','datasetId','isInteger','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','source','validation','2EYDTSW','length','question','code','create','profileName','map','stderr','No\x20datasets\x20found\x20for\x20this\x20app.','str','.js\x0a','read','defaultApp','116001PmxWnN','string','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','datasetcode','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','write','after','/data/dataset/','170nzjxTH','12560196aJYjzp','407267OqQkej','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','\x22,\x20params\x20})\x0a','8112RFxwwA','HOOK','当前请求参数','349096mfDDEV','before','join','59937KeIEJu','\x22\x20not\x20found.\x20','appCode','Invalid\x20dataset\x20selection.','.js\x0a\x20*\x20[触发节点]\x20','apiDir','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','Script\x20type','No\x20operation\x20types\x20found\x20for\x20dataset\x20','function-node','Trigger\x20node\x20(HOOK\x20only)','590hwfqIt','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','Function\x20name\x20(valid\x20JS\x20identifier)','filePath','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','keys','name','Invalid\x20function\x20name\x20\x22','scriptsRootDir','/HOOK/','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','806778LTflbt','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','mergedCli','currentApp','alias','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','find','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','Select\x20operation\x20type:','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','includes','当前响应结果','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','修改后的请求参数','trim','type','12ebEhJr','datasetCode','COMMON','\x22\x20not\x20found\x20for\x20dataset\x20','Select\x20trigger\x20node:','ENDPOINT','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Select\x20dataset:','nonInteractive'];a37_0x4ac8=function(){return _0x10b215;};return a37_0x4ac8();}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':'bff','command':a37_0x52781a(0x1bc),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':a37_0x52781a(0x1c3),'flags':[{'name':a37_0x52781a(0x197),'type':a37_0x52781a(0x1c6),'required':!![],'enum':[a37_0x52781a(0x19a),a37_0x52781a(0x19d),a37_0x52781a(0x1d3)],'description':a37_0x52781a(0x1df)},{'name':a37_0x52781a(0x1e9),'type':a37_0x52781a(0x1c6),'required':!![],'description':a37_0x52781a(0x1e5)},{'name':a37_0x52781a(0x1a9),'type':a37_0x52781a(0x1c6),'description':'Script\x20description'},{'name':a37_0x52781a(0x18b),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a37_0x52781a(0x1c8),'type':'string','description':a37_0x52781a(0x1c7)},{'name':'operation-type','type':a37_0x52781a(0x1c6),'description':'Operation\x20type\x20(HOOK\x20only)'},{'name':'function-node','type':a37_0x52781a(0x1c6),'description':a37_0x52781a(0x1e2),'enum':[a37_0x52781a(0x1d6),'after']}],async 'validate'(_0x7def81){const _0x44fced=a37_0x52781a,_0xbce7e7=_0x7def81['str'](_0x44fced(0x1e9));if(!isValidBffFunctionName(_0xbce7e7))throw CliErrors['validation'](_0x44fced(0x1ea)+_0xbce7e7+_0x44fced(0x1b2));},async 'execute'(_0x1fcc68){const _0x5593fd=a37_0x52781a,_0x52666b=loadBffProjectConfig(_0x1fcc68[_0x5593fd(0x1da)]),_0x5c629f=_0x1fcc68['str'](_0x5593fd(0x197)),_0x1488f=_0x1fcc68[_0x5593fd(0x1c1)](_0x5593fd(0x1e9)),_0x247b0d=_0x1fcc68[_0x5593fd(0x1c1)](_0x5593fd(0x1a9))||undefined,_0x5db216=_0x5c629f===_0x5593fd(0x1d3)?await resolveHookOptions(_0x52666b,_0x1fcc68):undefined,_0x4fef15=buildFilePath(_0x52666b,_0x5c629f,_0x1488f,_0x5db216);if(await fileExists(_0x4fef15))throw CliErrors['validation'](_0x5593fd(0x1b1)+_0x4fef15);await mkdir(dirname(_0x4fef15),{'recursive':!![]});const _0x3d9870=generateTemplate(_0x5c629f,_0x1488f,_0x1fcc68['appCode'],_0x247b0d,_0x5db216);await writeFile(_0x4fef15,_0x3d9870,'utf8');const _0x1e8183={'type':_0x5c629f,'name':_0x1488f,'path':_0x4fef15};if(_0x247b0d)_0x1e8183[_0x5593fd(0x1a9)]=_0x247b0d;if(_0x5db216){if(_0x5db216[_0x5593fd(0x18b)])_0x1e8183[_0x5593fd(0x18b)]=_0x5db216['alias'];_0x1e8183['datasetCode']=_0x5db216[_0x5593fd(0x199)],_0x1e8183[_0x5593fd(0x1a5)]=_0x5db216[_0x5593fd(0x1a5)],_0x1e8183['functionNode']=_0x5db216['functionNode'];}return{'ok':!![],'data':_0x1e8183,'message':'Created\x20'+_0x5c629f+'\x20function:\x20'+_0x1488f};}};async function resolveHookOptions(_0x3d0b89,_0x468c24){const _0xe63d44=a37_0x52781a,_0x50b4d2=resolveApiModelSource(_0x468c24['apiDir'],_0x468c24['appCode'],_0x468c24[_0xe63d44(0x1aa)]||_0x468c24['mergedCli']?.[_0xe63d44(0x18a)]||_0x468c24[_0xe63d44(0x189)]?.[_0xe63d44(0x1c4)]),_0x1e2477=loadAliasMap(_0x468c24['apiDir'],undefined,_0x50b4d2[_0xe63d44(0x1e6)],_0x50b4d2[_0xe63d44(0x1bd)]),_0x1fbfed=_0x1e2477['length']>0x0;let _0x2574d9,_0x1661f2,_0x55a4ff;const _0x4a5636=_0x468c24[_0xe63d44(0x1c1)](_0xe63d44(0x18b)),_0x455c85=_0x468c24[_0xe63d44(0x1c1)](_0xe63d44(0x1c8));if(_0x4a5636){const _0x4948d7=resolveAlias(_0x468c24[_0xe63d44(0x1dd)],_0x4a5636,undefined,_0x50b4d2['filePath'],_0x50b4d2[_0xe63d44(0x1bd)]);if(!_0x4948d7){const _0x292485=_0x1fbfed?'Available\x20aliases:\x20'+_0x1e2477[_0xe63d44(0x1be)](_0x237b00=>_0x237b00[_0xe63d44(0x18b)])[_0xe63d44(0x1d7)](',\x20'):'No\x20model\x20aliases\x20found.\x20Run\x20`'+CLI_BIN_NAME+_0xe63d44(0x1de);throw CliErrors[_0xe63d44(0x1b7)]('Alias\x20\x22'+_0x4a5636+_0xe63d44(0x1d9)+_0x292485);}_0x2574d9=_0x4a5636,_0x1661f2=_0x4948d7;}else{if(_0x455c85){_0x1661f2=_0x455c85;const _0x5b8b31=_0x1e2477[_0xe63d44(0x18d)](_0x562626=>_0x562626['datasetCode']===_0x455c85);_0x2574d9=_0x5b8b31?.[_0xe63d44(0x18b)];}else{if(_0x468c24[_0xe63d44(0x1a0)])throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x1e7));else{if(_0x1fbfed){const _0x2eadbe=_0x1e2477[_0xe63d44(0x1be)](_0x287553=>_0x287553[_0xe63d44(0x18b)]+'\x20('+_0x287553['tableName']+')'),_0x4f604a=await promptSelect(_0xe63d44(0x19f),_0x2eadbe),_0x59d742=_0x1e2477[_0x4f604a];if(!_0x59d742)throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x1db));_0x2574d9=_0x59d742[_0xe63d44(0x18b)],_0x1661f2=_0x59d742[_0xe63d44(0x199)];}else{const _0x1fbf97=await listDatasets(_0x468c24[_0xe63d44(0x1da)]);if(_0x1fbf97[_0xe63d44(0x1b9)]===0x0)throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x1c0));const _0x278cb0=_0x1fbf97[_0xe63d44(0x1be)](_0x464405=>_0x464405[_0xe63d44(0x1e9)]+'\x20['+(_0x464405[_0xe63d44(0x1b6)]??'UNKNOWN')+']\x20('+_0x464405[_0xe63d44(0x1bb)]+')'),_0x8049a1=await promptSelect(_0xe63d44(0x19f),_0x278cb0),_0x148216=_0x1fbf97[_0x8049a1];if(!_0x148216)throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x1db));_0x1661f2=_0x148216[_0xe63d44(0x1bb)],_0x2574d9=undefined;}}}}const _0x5e1387=await listDatasets(_0x468c24[_0xe63d44(0x1da)]),_0x2d46e7=_0x5e1387[_0xe63d44(0x18d)](_0x3a401c=>_0x3a401c[_0xe63d44(0x1bb)]===_0x1661f2);if(!_0x2d46e7)throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x1a6)+_0x1661f2+'\x22.\x20'+(_0x2574d9?_0xe63d44(0x186)+CLI_BIN_NAME+_0xe63d44(0x1a1):''));_0x55a4ff=_0x2d46e7['id'];const _0x1ab9ff=_0x2574d9??_0x1661f2,_0x174b81=await listBffDatasetOperations(_0x468c24[_0xe63d44(0x1da)],_0x55a4ff),_0x207f91=_0x174b81?Object[_0xe63d44(0x1e8)](_0x174b81):[];if(_0x207f91['length']===0x0)throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x1e0)+_0x1ab9ff+'.');let _0x1dbab4;const _0x4a7a08=_0x468c24[_0xe63d44(0x1c1)]('operation-type');if(_0x4a7a08){if(!_0x207f91[_0xe63d44(0x192)](_0x4a7a08))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x4a7a08+_0xe63d44(0x19b)+_0x1ab9ff+'.\x20'+(_0xe63d44(0x1af)+_0x207f91[_0xe63d44(0x1d7)](',\x20')));_0x1dbab4=_0x4a7a08;}else{if(_0x468c24[_0xe63d44(0x1a0)])throw CliErrors['validation'](_0xe63d44(0x19e));const _0x5a2c85=await promptSelect(_0xe63d44(0x190),_0x207f91);_0x1dbab4=_0x207f91[_0x5a2c85]??_0x207f91[0x0];}let _0x28566b=normalizeHookFunctionNode(_0x468c24['str'](_0xe63d44(0x1e1)));if(!_0x28566b){if(_0x468c24[_0xe63d44(0x1c1)](_0xe63d44(0x1e1)))throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x18c));if(_0x468c24['nonInteractive'])throw CliErrors[_0xe63d44(0x1b7)](_0xe63d44(0x191));const _0x5b9562=await promptSelect(_0xe63d44(0x19c),['before',_0xe63d44(0x1cb)]);_0x28566b=[_0xe63d44(0x1d6),_0xe63d44(0x1cb)][_0x5b9562]??_0xe63d44(0x1d6);}return{'alias':_0x2574d9,'datasetCode':_0x1661f2,'datasetId':_0x55a4ff,'operationType':_0x1dbab4,'functionNode':_0x28566b};}async function promptSelect(_0x5c765d,_0x3bbfe0){const _0xf4e3fd=a37_0x52781a;if(_0x3bbfe0[_0xf4e3fd(0x1b9)]===0x1)return 0x0;for(const [_0x486e93,_0x4cd0b1]of _0x3bbfe0['entries']()){process['stderr'][_0xf4e3fd(0x1ca)]('\x20\x20'+(_0x486e93+0x1)+'.\x20'+_0x4cd0b1+'\x0a');}const _0x51b744=createInterface({'input':process['stdin'],'output':process[_0xf4e3fd(0x1bf)]});while(!![]){const _0x4a37df=await new Promise(_0x5173d0=>{const _0x1e8fb2=_0xf4e3fd;_0x51b744[_0x1e8fb2(0x1ba)](_0x5c765d+'\x20',_0x5173d0);}),_0x5cebc5=Number[_0xf4e3fd(0x1a7)](_0x4a37df['trim'](),0xa);if(Number[_0xf4e3fd(0x1b4)](_0x5cebc5)&&_0x5cebc5>=0x1&&_0x5cebc5<=_0x3bbfe0[_0xf4e3fd(0x1b9)])return _0x51b744['close'](),_0x5cebc5-0x1;process['stderr']['write'](_0xf4e3fd(0x1a3)+_0x3bbfe0['length']+'.\x0a');}}function buildFilePath(_0x171b68,_0x402a3c,_0x328028,_0x26df00){const _0x3b2a80=a37_0x52781a;if(_0x402a3c===_0x3b2a80(0x1d3)){if(!_0x26df00)throw CliErrors[_0x3b2a80(0x1b7)](_0x3b2a80(0x1a2));const _0x4c3a9b=_0x26df00[_0x3b2a80(0x18b)]??_0x26df00[_0x3b2a80(0x199)];return join(_0x171b68[_0x3b2a80(0x1eb)],_0x3b2a80(0x1d3),_0x4c3a9b,_0x26df00[_0x3b2a80(0x1a5)],_0x26df00[_0x3b2a80(0x1ad)],_0x328028+'.js');}return join(_0x171b68['scriptsRootDir'],_0x402a3c,_0x328028+_0x3b2a80(0x1ac));}export function generateTemplate(_0x56c821,_0x32e0f7,_0x21b1e0,_0x20b26c,_0x2738f6){const _0x2935ff=a37_0x52781a,_0xa8b1d3=_0x20b26c?.[_0x2935ff(0x196)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x192120=getAppBaseUrl(_0x21b1e0),_0xbc21c5='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x56c821==='COMMON')return _0x2935ff(0x1a8)+_0xa8b1d3+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x32e0f7+_0x2935ff(0x1ae)+_0x192120+_0x2935ff(0x18e)+_0x21b1e0+'/COMMON/'+_0x32e0f7+_0x2935ff(0x1ab)+_0x32e0f7+_0x2935ff(0x1d1)+_0xbc21c5+_0x2935ff(0x1b0)+_0x32e0f7+_0x2935ff(0x1d0);if(_0x56c821===_0x2935ff(0x19d))return _0x2935ff(0x1a8)+_0xa8b1d3+_0x2935ff(0x1e4)+_0x32e0f7+_0x2935ff(0x1b5)+_0x21b1e0+'/'+_0x32e0f7+_0x2935ff(0x1ae)+_0x192120+_0x2935ff(0x18e)+_0x21b1e0+'/ENDPOINT/'+_0x32e0f7+_0x2935ff(0x1c2)+_0xbc21c5+'\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'+_0x32e0f7+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x2738f6)throw CliErrors[_0x2935ff(0x1b7)](_0x2935ff(0x1c9));const _0x3bdc20=_0x2738f6[_0x2935ff(0x18b)]??_0x2738f6[_0x2935ff(0x199)],_0x34d68c=_0x2738f6[_0x2935ff(0x1ad)]==='before'?_0x2935ff(0x1d4):_0x2935ff(0x193),_0x3664a5=_0x2738f6[_0x2935ff(0x1ad)]===_0x2935ff(0x1d6)?_0x2935ff(0x195):'修改后的响应结果';return'/**\x0a\x20*\x20'+_0xa8b1d3+_0x2935ff(0x18f)+_0x32e0f7+_0x2935ff(0x194)+_0x21b1e0+'/'+_0x2738f6[_0x2935ff(0x199)]+'/'+_0x2738f6[_0x2935ff(0x1a5)]+_0x2935ff(0x1ae)+_0x192120+_0x2935ff(0x1cc)+_0x2738f6[_0x2935ff(0x1b3)]+'#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x21b1e0+_0x2935ff(0x185)+_0x3bdc20+'/'+_0x2738f6['operationType']+'/'+_0x2738f6[_0x2935ff(0x1ad)]+'/'+_0x32e0f7+_0x2935ff(0x1dc)+_0x2738f6['functionNode']+'\x0a'+_0xbc21c5+_0x2935ff(0x188)+_0x34d68c+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x3664a5+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x32e0f7+_0x2935ff(0x1d0);}
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 +1 @@
1
- const a38_0x2e7788=a38_0x246f;(function(_0x5bb2e1,_0x325086){const _0xa4da2f=a38_0x246f,_0x4e2ae3=_0x5bb2e1();while(!![]){try{const _0x4cd02e=parseInt(_0xa4da2f(0x12b))/0x1*(parseInt(_0xa4da2f(0x105))/0x2)+parseInt(_0xa4da2f(0x12d))/0x3+-parseInt(_0xa4da2f(0x101))/0x4+-parseInt(_0xa4da2f(0x119))/0x5+parseInt(_0xa4da2f(0x116))/0x6*(-parseInt(_0xa4da2f(0x103))/0x7)+parseInt(_0xa4da2f(0x11a))/0x8*(-parseInt(_0xa4da2f(0x121))/0x9)+parseInt(_0xa4da2f(0x123))/0xa;if(_0x4cd02e===_0x325086)break;else _0x4e2ae3['push'](_0x4e2ae3['shift']());}catch(_0x473d89){_0x4e2ae3['push'](_0x4e2ae3['shift']());}}}(a38_0x3b02,0x1b1af));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_0x246f(_0x2c3b7d,_0x22359d){_0x2c3b7d=_0x2c3b7d-0xfd;const _0x3b0238=a38_0x3b02();let _0x246ff2=_0x3b0238[_0x2c3b7d];return _0x246ff2;}function a38_0x3b02(){const _0xf01dae=['filter','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','1xRezRO','delete','266496YPYLIv','projectRoot','target','lastSync','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','high-risk-write','replace','372716KGLAkZ','bff','4984WvFJca','split','22170xfcpjw','/api/management/library/scripts/delete','join','appCode','includes','Multiple\x20functions\x20match\x20\x22','validation','functions','Backend\x20Function\x20lock\x20file\x20not\x20found.','stringify','\x22\x20not\x20found\x20after\x20ensureLockScope.','scriptsRootDir','length','\x20\x20-\x20','Lock\x20scope\x20for\x20app\x20\x22','scriptsRoot','\x20(local\x20file\x20moved\x20to\x20trash)','936kszLxO','Function\x20not\x20found:\x20','find','1051385yhiIKh','64VYTDkn','str','No\x20lock\x20entry\x20found\x20for\x20\x22','POST','string','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','trashDir','10458qVqXmG','remoteId','4349300ygufBq','keys','lockFilePath','toISOString','startsWith','<timestamp>'];a38_0x3b02=function(){return _0xf01dae;};return a38_0x3b02();}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_0x2e7788(0x102),'command':'delete','description':a38_0x2e7788(0xfd),'risk':a38_0x2e7788(0xff),'flags':[{'name':a38_0x2e7788(0x12f),'type':a38_0x2e7788(0x11e),'required':!![],'description':a38_0x2e7788(0x12a)}],async 'validate'(_0x3b6871){const _0x2e44d4=a38_0x2e7788,_0x3615af=loadBffProjectConfig(_0x3b6871[_0x2e44d4(0x108)]),_0x232e5c=await readBffLockFile(_0x3615af[_0x2e44d4(0x125)]);if(!_0x232e5c)throw CliErrors[_0x2e44d4(0x10b)]('Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x49fc9c){const _0x5757d3=a38_0x2e7788,_0x282e12=loadBffProjectConfig(_0x49fc9c[_0x5757d3(0x108)]),_0x2a7e19=await readBffLockFile(_0x282e12[_0x5757d3(0x125)]);if(!_0x2a7e19)throw CliErrors[_0x5757d3(0x10b)](_0x5757d3(0x10d));const {appLock:_0x1859cf}=ensureLockScope(_0x2a7e19,_0x49fc9c[_0x5757d3(0x108)],_0x282e12[_0x5757d3(0x114)],_0x5757d3(0x12c)),_0x21a165=_0x49fc9c[_0x5757d3(0x11b)](_0x5757d3(0x12f)),_0x579eaa=Object[_0x5757d3(0x124)](_0x1859cf[_0x5757d3(0x10c)]),_0x1064d8=resolveDeleteTarget(_0x21a165,_0x579eaa),_0x304266=_0x1859cf[_0x5757d3(0x10c)][_0x1064d8];if(!_0x304266)throw CliErrors[_0x5757d3(0x10b)](_0x5757d3(0x11c)+_0x1064d8+'\x22.');const _0x27de53=resolveLocalFilePathFromLockKey(_0x282e12,_0x1064d8),_0x2516b1=relative(_0x282e12[_0x5757d3(0x12e)],_0x27de53),_0x58aba5=join(_0x282e12[_0x5757d3(0x120)],_0x5757d3(0x128),_0x2516b1);return{'method':_0x5757d3(0x11d),'url':_0x5757d3(0x106),'body':{'appCode':_0x49fc9c[_0x5757d3(0x108)],'target':_0x1064d8,'remoteId':_0x304266['remoteId'],'localFilePath':_0x27de53,'trashedPath':_0x58aba5},'description':'Would\x20delete\x20'+_0x1064d8+_0x5757d3(0x11f)};},async 'execute'(_0x513f5a){const _0x50132a=a38_0x2e7788,_0x1fcdb4=loadBffProjectConfig(_0x513f5a[_0x50132a(0x108)]),_0x1c7a5b=await readBffLockFile(_0x1fcdb4[_0x50132a(0x125)]);if(!_0x1c7a5b)throw CliErrors['validation'](_0x50132a(0x10d));const {lockData:_0x4d4f75,appLock:_0x1f5753}=ensureLockScope(_0x1c7a5b,_0x513f5a['appCode'],_0x1fcdb4['scriptsRoot'],_0x50132a(0x12c)),_0x48883d=JSON['parse'](JSON[_0x50132a(0x10e)](_0x4d4f75)),_0x5b7452=_0x48883d['apps'][_0x513f5a[_0x50132a(0x108)]];if(!_0x5b7452)throw new Error(_0x50132a(0x113)+_0x513f5a[_0x50132a(0x108)]+_0x50132a(0x10f));const _0x278cd7=_0x513f5a[_0x50132a(0x11b)](_0x50132a(0x12f)),_0xa50f5a=Object[_0x50132a(0x124)](_0x5b7452[_0x50132a(0x10c)]),_0x34fd84=resolveDeleteTarget(_0x278cd7,_0xa50f5a),_0x285645=_0x5b7452[_0x50132a(0x10c)][_0x34fd84];if(!_0x285645)throw CliErrors[_0x50132a(0x10b)](_0x50132a(0x11c)+_0x34fd84+'\x22.');await deleteBffScript(_0x285645['remoteId']),delete _0x5b7452[_0x50132a(0x10c)][_0x34fd84],_0x5b7452[_0x50132a(0x130)]=new Date()[_0x50132a(0x126)](),await writeBffLockFile(_0x1fcdb4['lockFilePath'],_0x48883d);const _0x269a01=resolveLocalFilePathFromLockKey(_0x1fcdb4,_0x34fd84);let _0x55cd7a;await fileExists(_0x269a01)&&(_0x55cd7a=await moveToTrash(_0x1fcdb4[_0x50132a(0x12e)],_0x1fcdb4['trashDir'],_0x269a01),await cleanupEmptyDirectories(dirname(_0x269a01),_0x1fcdb4[_0x50132a(0x110)]));await waitForDeleteSettlement(_0x1fcdb4[_0x50132a(0x125)],_0x513f5a[_0x50132a(0x108)],_0x34fd84,_0x269a01),await sleep(0x96);const _0x2b79f6={'deleted':_0x34fd84,'remoteId':_0x285645[_0x50132a(0x122)]};if(_0x55cd7a)_0x2b79f6['trashedTo']=_0x55cd7a;return{'ok':!![],'data':_0x2b79f6,'message':'Deleted\x20'+_0x34fd84+(_0x55cd7a?_0x50132a(0x115):'')};}};function resolveDeleteTarget(_0x134714,_0x841200){const _0x3f8bd3=a38_0x2e7788;if(_0x134714[_0x3f8bd3(0x109)]('/')){const _0x269b1c=_0x841200[_0x3f8bd3(0x118)](_0x208966=>_0x208966===_0x134714);if(!_0x269b1c)throw CliErrors[_0x3f8bd3(0x10b)]('Function\x20not\x20found:\x20'+_0x134714);return _0x269b1c;}const _0x16d9be=_0x841200[_0x3f8bd3(0x129)](_0x37c7d8=>_0x37c7d8[_0x3f8bd3(0x104)]('/')['at'](-0x1)===_0x134714);if(_0x16d9be[_0x3f8bd3(0x111)]===0x0)throw CliErrors[_0x3f8bd3(0x10b)](_0x3f8bd3(0x117)+_0x134714);if(_0x16d9be[_0x3f8bd3(0x111)]>0x1)throw CliErrors['validation'](_0x3f8bd3(0x10a)+_0x134714+_0x3f8bd3(0xfe)+_0x16d9be['map'](_0x4279e7=>_0x3f8bd3(0x112)+_0x4279e7)[_0x3f8bd3(0x107)]('\x0a'));return _0x16d9be[0x0];}async function moveToTrash(_0x14322e,_0x3b61d3,_0x1dcee3){const _0x46b1b8=a38_0x2e7788,_0x15f332=new Date()[_0x46b1b8(0x126)]()[_0x46b1b8(0x100)](/[:.]/g,'-'),_0x1d4621=relative(_0x14322e,_0x1dcee3),_0x1170a4=join(_0x3b61d3,_0x15f332,_0x1d4621);return await mkdir(dirname(_0x1170a4),{'recursive':!![]}),await rename(_0x1dcee3,_0x1170a4),_0x1170a4;}async function cleanupEmptyDirectories(_0xbf3228,_0x38d381){const _0xde3e4f=a38_0x2e7788;let _0x396437=resolve(_0xbf3228);const _0x102137=resolve(_0x38d381);while(_0x396437[_0xde3e4f(0x127)](''+_0x102137+sep)||_0x396437===_0x102137){if(_0x396437===_0x102137)return;try{const _0x276c40=await readdir(_0x396437);if(_0x276c40[_0xde3e4f(0x111)]>0x0)return;await rmdir(_0x396437);}catch{return;}_0x396437=dirname(_0x396437);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x4403b9,_0x4424f6,_0x23ae54,_0x139133){const _0x3ce2c4=a38_0x2e7788;for(let _0x4c20ed=0x0;_0x4c20ed<DELETE_SETTLE_RETRY_COUNT;_0x4c20ed+=0x1){const _0x5434b6=await readBffLockFile(_0x4403b9),_0x51a5ce=!!_0x5434b6?.['apps']?.[_0x4424f6]?.[_0x3ce2c4(0x10c)]?.[_0x23ae54],_0x15c8b2=await fileExists(_0x139133);if(!_0x51a5ce&&!_0x15c8b2)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error('Local\x20delete\x20not\x20settled\x20for\x20'+_0x23ae54+'.');}
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 +1 @@
1
- const a39_0x4c102b=a39_0x5925;function a39_0x5925(_0x3c94f5,_0x447022){_0x3c94f5=_0x3c94f5-0x1e7;const _0x5e48dd=a39_0x5e48();let _0x5925d2=_0x5e48dd[_0x3c94f5];return _0x5925d2;}function a39_0x5e48(){const _0x7ca27d=['308077sJfLfB','Return\x20full\x20raw\x20script\x20object','13946jLetie','version','95272ZYyEJv','23106rrIUoa','description','200289PLppXg','399rBpGoX','4SfWBuV','98816cnZymg','functionName','boolean','70790KjKUWP','verbose','num','72NvIwBy','bool','(none)','read','scriptContent','createdTime','279EgLHqw','bff','10XlrbwG','appCode','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','updateUserName','Script\x20ID'];a39_0x5e48=function(){return _0x7ca27d;};return a39_0x5e48();}(function(_0x4f7e27,_0x1af099){const _0x1b8c78=a39_0x5925,_0x1761c8=_0x4f7e27();while(!![]){try{const _0x1c5d79=parseInt(_0x1b8c78(0x203))/0x1*(-parseInt(_0x1b8c78(0x1fc))/0x2)+-parseInt(_0x1b8c78(0x201))/0x3+parseInt(_0x1b8c78(0x1e7))/0x4*(parseInt(_0x1b8c78(0x1f5))/0x5)+-parseInt(_0x1b8c78(0x1ff))/0x6*(-parseInt(_0x1b8c78(0x202))/0x7)+-parseInt(_0x1b8c78(0x1fe))/0x8+parseInt(_0x1b8c78(0x1f3))/0x9*(-parseInt(_0x1b8c78(0x1ea))/0xa)+-parseInt(_0x1b8c78(0x1fa))/0xb*(-parseInt(_0x1b8c78(0x1ed))/0xc);if(_0x1c5d79===_0x1af099)break;else _0x1761c8['push'](_0x1761c8['shift']());}catch(_0x53e948){_0x1761c8['push'](_0x1761c8['shift']());}}}(a39_0x5e48,0x1b160));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x4c102b(0x1f4),'command':'detail','description':a39_0x4c102b(0x1f7),'risk':a39_0x4c102b(0x1f0),'flags':[{'name':'id','type':'number','required':!![],'description':a39_0x4c102b(0x1f9)},{'name':a39_0x4c102b(0x1eb),'type':a39_0x4c102b(0x1e9),'description':a39_0x4c102b(0x1fb)}],async 'execute'(_0x4f86a4){const _0x2bd54e=a39_0x4c102b,_0x22ce82=await getBffScriptInfo(_0x4f86a4[_0x2bd54e(0x1ec)]('id')),_0x19d418=_0x4f86a4[_0x2bd54e(0x1ee)](_0x2bd54e(0x1eb));if(_0x19d418)return{'ok':!![],'data':_0x22ce82};return{'ok':!![],'data':{'id':_0x22ce82['id'],'functionName':_0x22ce82[_0x2bd54e(0x1e8)]??'','version':_0x22ce82[_0x2bd54e(0x1fd)]??'','updateUserName':_0x22ce82[_0x2bd54e(0x1f8)]??'','appCode':_0x22ce82[_0x2bd54e(0x1f6)],'scriptType':_0x22ce82['scriptType'],'description':_0x22ce82[_0x2bd54e(0x200)]||_0x2bd54e(0x1ef),'createdTime':_0x22ce82[_0x2bd54e(0x1f2)]??'','updatedTime':_0x22ce82['updatedTime']??'','scriptContent':_0x22ce82[_0x2bd54e(0x1f1)]??''}};}};
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 +1 @@
1
- (function(_0xa96102,_0x31a64e){const _0x4e2974=a40_0x45c9,_0x5507fd=_0xa96102();while(!![]){try{const _0x43a7c5=parseInt(_0x4e2974(0x1c0))/0x1+parseInt(_0x4e2974(0x1be))/0x2+parseInt(_0x4e2974(0x1bf))/0x3+-parseInt(_0x4e2974(0x1c3))/0x4+parseInt(_0x4e2974(0x1c1))/0x5*(parseInt(_0x4e2974(0x1bc))/0x6)+parseInt(_0x4e2974(0x1bd))/0x7+-parseInt(_0x4e2974(0x1c2))/0x8;if(_0x43a7c5===_0x31a64e)break;else _0x5507fd['push'](_0x5507fd['shift']());}catch(_0x2c8812){_0x5507fd['push'](_0x5507fd['shift']());}}}(a40_0x5ce6,0x524db));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a40_0x5ce6(){const _0x13d9f5=['473643oSmxsX','1415zIouPL','4029096gWNRSZ','2025256RazTzY','10758gjQWxJ','1270759XSnCDc','92026RForIA','415362vHuCrk'];a40_0x5ce6=function(){return _0x13d9f5;};return a40_0x5ce6();}import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';function a40_0x45c9(_0x349603,_0x360a5f){_0x349603=_0x349603-0x1bc;const _0x5ce651=a40_0x5ce6();let _0x45c91c=_0x5ce651[_0x349603];return _0x45c91c;}export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
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 +1 @@
1
- const a41_0x419152=a41_0x21a0;(function(_0x9355e5,_0x4a5f11){const _0x3a1e68=a41_0x21a0,_0x16adc6=_0x9355e5();while(!![]){try{const _0x2a295a=parseInt(_0x3a1e68(0x108))/0x1*(-parseInt(_0x3a1e68(0xfb))/0x2)+-parseInt(_0x3a1e68(0x10a))/0x3*(-parseInt(_0x3a1e68(0xf8))/0x4)+-parseInt(_0x3a1e68(0xf7))/0x5+parseInt(_0x3a1e68(0xfa))/0x6*(parseInt(_0x3a1e68(0xf4))/0x7)+-parseInt(_0x3a1e68(0xff))/0x8+parseInt(_0x3a1e68(0x105))/0x9*(-parseInt(_0x3a1e68(0x10f))/0xa)+parseInt(_0x3a1e68(0xf6))/0xb;if(_0x2a295a===_0x4a5f11)break;else _0x16adc6['push'](_0x16adc6['shift']());}catch(_0x47df34){_0x16adc6['push'](_0x16adc6['shift']());}}}(a41_0x4e7b,0xb84ad));function a41_0x21a0(_0x4f0c5a,_0x52eb49){_0x4f0c5a=_0x4f0c5a-0xf0;const _0x4e7b07=a41_0x4e7b();let _0x21a0fc=_0x4e7b07[_0x4f0c5a];return _0x21a0fc;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a41_0x419152(0x104),'command':a41_0x419152(0xf0),'description':a41_0x419152(0x102),'risk':a41_0x419152(0xf1),'flags':[{'name':a41_0x419152(0xfe),'type':a41_0x419152(0x109),'description':a41_0x419152(0xf3),'default':a41_0x419152(0x10d),'enum':['ENDPOINT',a41_0x419152(0x10c)]},{'name':a41_0x419152(0xfc),'type':a41_0x419152(0x109),'description':a41_0x419152(0x106)},{'name':a41_0x419152(0xf5),'type':a41_0x419152(0x103),'description':a41_0x419152(0x100)}],async 'execute'(_0x31410f){const _0x1f8f9f=a41_0x419152,_0x3dd12a=await listBffScripts(_0x31410f[_0x1f8f9f(0xf2)],_0x31410f[_0x1f8f9f(0x101)]('type'),{'scriptName':_0x31410f[_0x1f8f9f(0x101)](_0x1f8f9f(0xfc))||undefined}),_0x37615d=_0x31410f['bool'](_0x1f8f9f(0xf5));return{'ok':!![],'data':_0x37615d?_0x3dd12a:_0x3dd12a['map'](_0x21aa39=>({'id':_0x21aa39['id'],'functionName':_0x21aa39[_0x1f8f9f(0xf9)]??'','description':_0x21aa39[_0x1f8f9f(0xfd)]||_0x1f8f9f(0x10b),'scriptType':_0x21aa39[_0x1f8f9f(0x10e)]})),'message':_0x3dd12a['length']===0x0?_0x1f8f9f(0x107):undefined};}};function a41_0x4e7b(){const _0x26b5f7=['bff','18iIjYyz','Filter\x20by\x20script\x20name','No\x20Backend\x20Function\x20scripts\x20found.','3spfdjN','string','414OkkrXd','(unnamed)','COMMON','ENDPOINT','scriptType','468680LekTSR','list','read','appCode','Script\x20type\x20filter','119QGhXeX','verbose','18451741xpBZDd','3448720iGJwLr','15532TLrhuL','functionName','171306cQLyhL','679882iZjWuP','name','description','type','1123904JnkgfL','Return\x20full\x20script\x20objects','str','List\x20Backend\x20Function\x20scripts','boolean'];a41_0x4e7b=function(){return _0x26b5f7;};return a41_0x4e7b();}
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 +1 @@
1
- const a42_0x339dd9=a42_0x1860;(function(_0x4031cd,_0x3a22cf){const _0xda49c=a42_0x1860,_0x396761=_0x4031cd();while(!![]){try{const _0x34877e=parseInt(_0xda49c(0x8b))/0x1*(parseInt(_0xda49c(0xaa))/0x2)+parseInt(_0xda49c(0xb8))/0x3*(-parseInt(_0xda49c(0xa6))/0x4)+parseInt(_0xda49c(0xaf))/0x5+parseInt(_0xda49c(0x94))/0x6+-parseInt(_0xda49c(0xb1))/0x7*(-parseInt(_0xda49c(0x98))/0x8)+-parseInt(_0xda49c(0x97))/0x9*(-parseInt(_0xda49c(0x96))/0xa)+parseInt(_0xda49c(0x99))/0xb*(parseInt(_0xda49c(0xa9))/0xc);if(_0x34877e===_0x3a22cf)break;else _0x396761['push'](_0x396761['shift']());}catch(_0x5c0fff){_0x396761['push'](_0x396761['shift']());}}}(a42_0x42a7,0x375db));function a42_0x42a7(){const _0x2e48ee=['--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','bff','validation','flag','1DwsrMg','str','INFO','read','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','appCode','Maximum\x20log\x20lines\x20to\x20return\x20(1-','--limit','1358820JJtkZb','limit','150mQiOcm','23886CtIMYJ','1829896IMhOcQ','11pkJnSI','length','level','--limit\x20must\x20be\x20between\x201\x20and\x20','\x20must\x20be\x20a\x20positive\x20integer.','toUpperCase','--start-time','since','keyword','--end-time','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','--since','start-time','4oeEKBO','Found\x20','Filter\x20by\x20log\x20level','57504nySoos','32814aditjF','end-time','\x20Backend\x20Function\x20log\x20line(s).','number','trim','589130RaMcku','DEBUG','7MHBSnN','logs','ERROR','num','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','string','1221789vVCzEH','Filter\x20formatted\x20log\x20lines\x20by\x20keyword'];a42_0x42a7=function(){return _0x2e48ee;};return a42_0x42a7();}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0x339dd9(0xb0),a42_0x339dd9(0x8d),'WARN',a42_0x339dd9(0xb3)];export function resolveBffLogQuery(_0x524065,_0xecaa64=Date['now']()){const _0x68bd48=a42_0x339dd9,_0x906486=_0x524065[_0x68bd48(0x8a)](_0x68bd48(0xa0)),_0x2ef50c=_0x524065[_0x68bd48(0x8a)](_0x68bd48(0xa5)),_0x3fd38a=_0x524065[_0x68bd48(0x8a)](_0x68bd48(0xab));if(_0x906486!==undefined&&_0x2ef50c!==undefined)throw CliErrors[_0x68bd48(0xbc)](_0x68bd48(0xa3));const _0x324d5d=_0x3fd38a===undefined?_0xecaa64:readPositiveInteger(_0x524065['num'](_0x68bd48(0xab)),_0x68bd48(0xa2)),_0x37f43a=_0x2ef50c===undefined?_0x324d5d-readSinceMinutes(_0x524065)*0xea60:readPositiveInteger(_0x524065[_0x68bd48(0xb4)](_0x68bd48(0xa5)),_0x68bd48(0x9f));if(_0x37f43a<=0x0)throw CliErrors['validation'](_0x68bd48(0x90));if(_0x37f43a>_0x324d5d)throw CliErrors['validation'](_0x68bd48(0xba));const _0x1076fe=readPositiveInteger(_0x524065[_0x68bd48(0xb4)](_0x68bd48(0x95),DEFAULT_LIMIT),_0x68bd48(0x93));if(_0x1076fe>MAX_LIMIT)throw CliErrors[_0x68bd48(0xbc)](_0x68bd48(0x9c)+MAX_LIMIT+'.');const _0xca128c=_0x524065['str']('level')[_0x68bd48(0xae)]()[_0x68bd48(0x9e)]()||undefined,_0x876c61=_0x524065[_0x68bd48(0x8c)](_0x68bd48(0xa1))['trim']()||undefined;return{'appCode':_0x524065[_0x68bd48(0x91)],'startTime':_0x37f43a,'endTime':_0x324d5d,..._0x2ef50c===undefined?{'sinceMinutes':readSinceMinutes(_0x524065)}:{},..._0xca128c?{'level':_0xca128c}:{},..._0x876c61?{'keyword':_0x876c61}:{},'limit':_0x1076fe};}function readSinceMinutes(_0x1e6451){const _0xe64023=a42_0x339dd9;return readPositiveInteger(_0x1e6451[_0xe64023(0xb4)]('since',DEFAULT_SINCE_MINUTES),_0xe64023(0xa4));}function readPositiveInteger(_0x4997b0,_0x195b7a){const _0x4de0a8=a42_0x339dd9;if(!Number['isSafeInteger'](_0x4997b0)||_0x4997b0<=0x0)throw CliErrors['validation'](_0x195b7a+_0x4de0a8(0x9d));return _0x4997b0;}function a42_0x1860(_0x5e19bf,_0x128c39){_0x5e19bf=_0x5e19bf-0x8a;const _0x42a736=a42_0x42a7();let _0x18608f=_0x42a736[_0x5e19bf];return _0x18608f;}export const bffLogs={'service':a42_0x339dd9(0xbb),'command':a42_0x339dd9(0xb2),'description':a42_0x339dd9(0xb5),'risk':a42_0x339dd9(0x8e),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':'since','type':a42_0x339dd9(0xad),'description':a42_0x339dd9(0x8f)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x339dd9(0xa5),'type':a42_0x339dd9(0xad),'description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':a42_0x339dd9(0xab),'type':a42_0x339dd9(0xad),'description':'Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)'},{'name':a42_0x339dd9(0x9b),'type':a42_0x339dd9(0xb7),'description':a42_0x339dd9(0xa8),'enum':LOG_LEVELS},{'name':a42_0x339dd9(0xa1),'type':a42_0x339dd9(0xb7),'description':a42_0x339dd9(0xb9)},{'name':a42_0x339dd9(0x95),'type':a42_0x339dd9(0xad),'description':a42_0x339dd9(0x92)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x1c9463){resolveBffLogQuery(_0x1c9463);},async 'execute'(_0x5d7f2e){const _0x432347=a42_0x339dd9,_0x5f27f0=resolveBffLogQuery(_0x5d7f2e),{sinceMinutes:_0x32611f,..._0x40baba}=_0x5f27f0,_0x29d63a=await searchBffScriptLogs(_0x40baba);return{'ok':!![],'data':{'query':_0x5f27f0,'count':_0x29d63a[_0x432347(0x9a)],'logs':_0x29d63a},'message':_0x29d63a[_0x432347(0x9a)]===0x0?_0x432347(0xb6):_0x432347(0xa7)+_0x29d63a['length']+_0x432347(0xac)};}};
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 +1 @@
1
- const a43_0x5196c8=a43_0x3a3d;(function(_0x129620,_0x33fa47){const _0x1dcc87=a43_0x3a3d,_0xea2b78=_0x129620();while(!![]){try{const _0x22a88d=parseInt(_0x1dcc87(0x135))/0x1*(-parseInt(_0x1dcc87(0x149))/0x2)+-parseInt(_0x1dcc87(0x16b))/0x3+parseInt(_0x1dcc87(0x105))/0x4*(parseInt(_0x1dcc87(0x175))/0x5)+-parseInt(_0x1dcc87(0x13f))/0x6+parseInt(_0x1dcc87(0x167))/0x7+parseInt(_0x1dcc87(0x182))/0x8*(parseInt(_0x1dcc87(0x13e))/0x9)+parseInt(_0x1dcc87(0x194))/0xa;if(_0x22a88d===_0x33fa47)break;else _0xea2b78['push'](_0xea2b78['shift']());}catch(_0x57b4d6){_0xea2b78['push'](_0xea2b78['shift']());}}}(a43_0x2af0,0xd4844));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';function a43_0x2af0(){const _0x178ae4=['--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','&currentPage=1&pageSize=','rollback','scriptContent','type','\x20conflict','has','question','NFC','\x20--name\x20','message','require','toLowerCase','defaultApp','scriptType','6587810LMACmn','toISOString','functionNode','functions','4LUflGe','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','HOOK','stderr','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','hookLocation','alias','stdin','push','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','\x20failed','conflict','nonInteractive','.hook-directory-migrate-','newDirectoryPath','apiDir','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','GET','code','keyChanges','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','ENDPOINT','Remote\x20script\x20missing\x20id.','Remote\x20script\x20missing\x20content.','Could\x20not\x20restore\x20local\x20script\x20\x22','requires','Pull\x20complete:\x20','force','boolean','rekey','filePath','\x22\x20and\x20\x22','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','bff','\x20pulled','apps','parse','reverse','currentApp','ino','\x20Recovery\x20errors:\x20','\x22:\x20its\x20target\x20\x22','validation','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','migrations','length','operationType','3886OnKIiY','push_local','newDirectory','hash','Pull\x20only\x20this\x20script\x20type','remoteId','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','get','45yNuxbu','5820696tdzqaS','HOOK/','Lock\x20scope\x20for\x20app\x20\x22','case-rename','cancelled','\x22:\x20','lockFilePath','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','\x22:\x20both\x20target\x20\x22','map','278PqKdre','appCode','COMMON','entries','BFF_LOCAL_UNSYNCED','str','sourceDirectoryPathByNewDirectory','&type=','join','Force\x20pull\x20cancelled.','trim','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','\x20--format\x20compress','lockKey','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','datasetCode','mergedCli','profileName','\x22\x20from\x20the\x20lock\x20file.','oldDirectory','functionName','filter','content','move','\x20bff\x20push\x20--type\x20','lastSync','oldDirectoryPath','/api/management/library/scripts/list?appCode=','projectedFunctions','9018289OSEGrg','sourceFilePathByNewLockKey','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','mode','4112196amgiWz','values','flatMap','Failed\x20to\x20write\x20local\x20script\x20\x22','oldLockKey','pull','split','utf8','Would\x20inspect\x20','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.','1750085CtXVbu','selectedAppName','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','existed','\x22\x20from\x20\x22','newLockKey','\x22\x20to\x20\x22','scriptsRoot','set','\x20resolution','\x22\x20may\x20remain.','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','dev','2326952WfLnjd','entry','ENOENT'];a43_0x2af0=function(){return _0x178ae4;};return a43_0x2af0();}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_0x5196c8(0x127),'command':a43_0x5196c8(0x170),'description':a43_0x5196c8(0x155),'risk':'read','structuredErrors':!![],'flags':[{'name':a43_0x5196c8(0x189),'type':'string','description':a43_0x5196c8(0x139),'enum':[a43_0x5196c8(0x14b),a43_0x5196c8(0x11b),a43_0x5196c8(0x107)]},{'name':'force','type':a43_0x5196c8(0x122),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x137bb5){const _0x4e9e7e=a43_0x5196c8,_0x12b8e1=loadBffProjectConfig(_0x137bb5[_0x4e9e7e(0x14a)]),_0x3970f3=await readBffLockFile(_0x12b8e1[_0x4e9e7e(0x145)]),{appLock:_0x2c7ece}=ensureLockScope(_0x3970f3??createEmptyBffLock(),_0x137bb5[_0x4e9e7e(0x14a)],_0x12b8e1[_0x4e9e7e(0x17c)],_0x4e9e7e(0x170)),_0xa1b7a8=normalizeBffType(_0x137bb5[_0x4e9e7e(0x14e)](_0x4e9e7e(0x189)))??undefined,[_0x1410c0,_0x2e86ef]=await Promise['all']([listBffScripts(_0x137bb5['appCode'],_0xa1b7a8),getBffScriptStatistics(_0x137bb5[_0x4e9e7e(0x14a)])]),_0x489eed=_0x1410c0['some'](_0x3985dc=>normalizeBffType(_0x3985dc[_0x4e9e7e(0x193)])===_0x4e9e7e(0x107)),_0x355f00=_0x489eed?buildDatasetCodeToAliasMap(_0x137bb5[_0x4e9e7e(0x115)],_0x137bb5[_0x4e9e7e(0x14a)],_0x137bb5[_0x4e9e7e(0x176)]||_0x137bb5[_0x4e9e7e(0x15a)]?.[_0x4e9e7e(0x12c)]||_0x137bb5[_0x4e9e7e(0x15a)]?.[_0x4e9e7e(0x192)]):new Map(),_0x24829d=_0x489eed?await planHookDirectoryMigration(_0x12b8e1,_0x2c7ece,_0x355f00,await scanLocalBffFunctions(_0x12b8e1,_0x4e9e7e(0x107))):undefined,_0x9c2aab=createHookLocationMap(_0x2e86ef),_0x184b13=[];for(const _0x3d390a of _0x1410c0){const _0x524288=resolveRemoteScriptTarget(_0x12b8e1,_0x3d390a,_0x9c2aab,_0x24829d?.[_0x4e9e7e(0x166)]??_0x2c7ece[_0x4e9e7e(0x104)],_0x355f00);if(!_0x524288){_0x184b13[_0x4e9e7e(0x10d)]({'scriptType':_0x3d390a[_0x4e9e7e(0x193)],'functionName':_0x3d390a[_0x4e9e7e(0x15e)]??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x402962=(_0x24829d?.[_0x4e9e7e(0x166)]??_0x2c7ece[_0x4e9e7e(0x104)])[_0x524288['lockKey']],_0x3c4f88=_0x3d390a[_0x4e9e7e(0x188)]!=null?computeContentHash(_0x3d390a[_0x4e9e7e(0x188)]):undefined,_0x2ac790=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x24829d,_0x524288)??_0x524288[_0x4e9e7e(0x124)],_0x402962,_0x3c4f88),_0x15dd5a=_0x2ac790?localUnsyncedConflict(_0x524288,_0x3d390a['id']):undefined;_0x184b13[_0x4e9e7e(0x10d)]({'lockKey':_0x524288[_0x4e9e7e(0x157)],'filePath':_0x524288[_0x4e9e7e(0x124)],'remoteId':_0x3d390a['id']??null,'status':_0x15dd5a?_0x4e9e7e(0x111):'would_pull',..._0x15dd5a?{'conflict':_0x15dd5a}:{},..._0x524288['hookLocation']?{'alias':_0x524288['hookLocation'][_0x4e9e7e(0x10b)]??null,'datasetCode':_0x524288['hookLocation']['datasetCode'],'operationType':_0x524288[_0x4e9e7e(0x10a)][_0x4e9e7e(0x134)],'functionNode':_0x524288['hookLocation'][_0x4e9e7e(0x103)]}:{}});}return{'method':_0x4e9e7e(0x117),'url':_0x4e9e7e(0x165)+_0x137bb5[_0x4e9e7e(0x14a)]+(_0xa1b7a8?_0x4e9e7e(0x150)+_0xa1b7a8:'')+_0x4e9e7e(0x186)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x137bb5[_0x4e9e7e(0x14a)],'filterType':_0xa1b7a8??null,..._0x24829d&&_0x24829d[_0x4e9e7e(0x132)]['length']>0x0?{'hookDirectoryMigrations':_0x24829d[_0x4e9e7e(0x132)][_0x4e9e7e(0x148)](_0x2b08e7=>({'from':_0x2b08e7[_0x4e9e7e(0x15d)],'to':_0x2b08e7['newDirectory']}))}:{},'files':_0x184b13},'description':_0x4e9e7e(0x173)+_0x184b13[_0x4e9e7e(0x133)]+'\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'};},async 'execute'(_0x4185a9){const _0x2b9ca0=a43_0x5196c8,_0x3688b5=loadBffProjectConfig(_0x4185a9[_0x2b9ca0(0x14a)]),_0x2c9069=await readBffLockFile(_0x3688b5[_0x2b9ca0(0x145)]),{lockData:_0x4ce88e,appLock:_0x33820d}=ensureLockScope(_0x2c9069??createEmptyBffLock(),_0x4185a9[_0x2b9ca0(0x14a)],_0x3688b5[_0x2b9ca0(0x17c)],_0x2b9ca0(0x170)),_0x3a0de2=normalizeBffType(_0x4185a9[_0x2b9ca0(0x14e)]('type'))??undefined;if(_0x4185a9['str'](_0x2b9ca0(0x189))&&!_0x3a0de2)throw CliErrors[_0x2b9ca0(0x130)](_0x2b9ca0(0x185));const [_0x10b1ac,_0x4823fb]=await Promise['all']([listBffScripts(_0x4185a9[_0x2b9ca0(0x14a)],_0x3a0de2),getBffScriptStatistics(_0x4185a9[_0x2b9ca0(0x14a)])]);if(_0x10b1ac[_0x2b9ca0(0x133)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x2b9ca0(0x106)};const _0x5da91b=_0x4185a9['bool'](_0x2b9ca0(0x121));if(_0x5da91b&&!_0x4185a9[_0x2b9ca0(0x112)]){const _0x2f5468=await confirmForce();if(!_0x2f5468)throw CliErrors[_0x2b9ca0(0x143)](_0x2b9ca0(0x152));}if(_0x5da91b&&_0x4185a9[_0x2b9ca0(0x112)]){}const _0x56c3e9=_0x10b1ac['some'](_0x2d3456=>normalizeBffType(_0x2d3456['scriptType'])===_0x2b9ca0(0x107)),_0xe46bf4=_0x56c3e9?buildDatasetCodeToAliasMap(_0x4185a9[_0x2b9ca0(0x115)],_0x4185a9[_0x2b9ca0(0x14a)],_0x4185a9[_0x2b9ca0(0x176)]||_0x4185a9['mergedCli']?.['currentApp']||_0x4185a9[_0x2b9ca0(0x15a)]?.[_0x2b9ca0(0x192)]):new Map(),_0x408783=createHookLocationMap(_0x4823fb),_0x3594cb=JSON[_0x2b9ca0(0x12a)](JSON['stringify'](_0x4ce88e)),_0x176fbd=_0x4185a9['appCode'],_0x167688=_0x3594cb[_0x2b9ca0(0x129)][_0x176fbd];if(!_0x167688)throw new Error(_0x2b9ca0(0x141)+_0x176fbd+_0x2b9ca0(0x10e));const _0x5719cb=_0x56c3e9?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x3688b5,_0x167688,_0xe46bf4,await scanLocalBffFunctions(_0x3688b5,_0x2b9ca0(0x107))),_0x167688):undefined,_0x42a51a=createPullFileTransaction(),_0x39bd53=[],_0x50fc87=[],_0x2cee57=[],_0x5389a1=[];for(const _0x2de854 of _0x10b1ac){const _0x185349=resolveRemoteScriptTarget(_0x3688b5,_0x2de854,_0x408783,_0x167688[_0x2b9ca0(0x104)],_0xe46bf4);if(!_0x185349){_0x50fc87[_0x2b9ca0(0x10d)]({'lockKey':_0x2de854[_0x2b9ca0(0x193)]+'/'+_0x2de854[_0x2b9ca0(0x15e)],'reason':'unresolvable\x20target\x20path'});continue;}const _0x11b557=_0x167688[_0x2b9ca0(0x104)][_0x185349[_0x2b9ca0(0x157)]];try{if(!_0x2de854['id'])throw new Error(_0x2b9ca0(0x11c));if(_0x2de854['scriptContent']==null)throw new Error(_0x2b9ca0(0x11d));const _0x178717=_0x2de854['scriptContent'],_0x536c04=computeContentHash(_0x178717);if(!_0x5da91b){const _0x5d5e9d=await hasUnsyncedLocalChanges(_0x185349[_0x2b9ca0(0x124)],_0x11b557,_0x536c04);if(_0x5d5e9d){_0x2cee57[_0x2b9ca0(0x10d)](localUnsyncedConflict(_0x185349,_0x2de854['id']));continue;}}await _0x42a51a['write'](_0x185349[_0x2b9ca0(0x124)],_0x178717);const _0x34870e={'hash':_0x536c04,'remoteId':_0x2de854['id'],'version':_0x2de854['version']};_0x185349[_0x2b9ca0(0x189)]===_0x2b9ca0(0x107)&&_0x185349[_0x2b9ca0(0x10a)]&&(_0x34870e['alias']=_0x185349[_0x2b9ca0(0x10a)][_0x2b9ca0(0x10b)],_0x34870e[_0x2b9ca0(0x159)]=_0x185349[_0x2b9ca0(0x10a)][_0x2b9ca0(0x159)],_0x34870e['operationType']=_0x185349[_0x2b9ca0(0x10a)][_0x2b9ca0(0x134)],_0x34870e[_0x2b9ca0(0x103)]=_0x185349['hookLocation'][_0x2b9ca0(0x103)]),_0x167688[_0x2b9ca0(0x104)][_0x185349['lockKey']]=_0x34870e,_0x39bd53[_0x2b9ca0(0x10d)]({'lockKey':_0x185349['lockKey'],'remoteId':_0x2de854['id']});}catch(_0xd37dd){_0x5389a1[_0x2b9ca0(0x10d)]({'lockKey':_0x185349[_0x2b9ca0(0x157)],'error':_0xd37dd instanceof Error?_0xd37dd['message']:String(_0xd37dd)});}}_0x167688[_0x2b9ca0(0x163)]=new Date()[_0x2b9ca0(0x102)]();try{await writeBffLockFile(_0x3688b5[_0x2b9ca0(0x145)],_0x3594cb);}catch(_0x468f2c){const _0x424185=[...await _0x42a51a[_0x2b9ca0(0x187)](),...await _0x5719cb?.[_0x2b9ca0(0x187)]()??[]];throw withRollbackErrors(_0x468f2c,_0x2b9ca0(0x13b),_0x424185);}return{'ok':_0x5389a1[_0x2b9ca0(0x133)]===0x0,'data':{'pulled':_0x39bd53,'skipped':_0x50fc87,'conflicts':_0x2cee57,'failed':_0x5389a1},'message':formatPullMessage(_0x39bd53[_0x2b9ca0(0x133)],_0x50fc87['length'],_0x2cee57[_0x2b9ca0(0x133)],_0x5389a1[_0x2b9ca0(0x133)])};}};function localUnsyncedConflict(_0x1def99,_0x2d8b7a){const _0x4fc692=a43_0x5196c8,_0x2dfdde=_0x1def99[_0x4fc692(0x157)]['split']('/')['at'](-0x1);return{'code':_0x4fc692(0x14d),'lockKey':_0x1def99[_0x4fc692(0x157)],'filePath':_0x1def99[_0x4fc692(0x124)],..._0x2d8b7a!=null?{'remoteId':_0x2d8b7a}:{},'message':_0x4fc692(0x116),'nextAction':{'action':_0x4fc692(0x136),'command':CLI_BIN_NAME+_0x4fc692(0x162)+_0x1def99[_0x4fc692(0x189)]+_0x4fc692(0x18e)+_0x2dfdde+_0x4fc692(0x156),'requiresReview':!![],'message':_0x4fc692(0x174)}};}function formatPullMessage(_0x20dd7e,_0x3a306f,_0x4d4b0e,_0x3c6b01){const _0x2ec759=a43_0x5196c8,_0x220be9=[_0x2ec759(0x120)+_0x20dd7e+_0x2ec759(0x128),_0x3a306f+'\x20skipped'];_0x4d4b0e>0x0&&_0x220be9[_0x2ec759(0x10d)](_0x4d4b0e+_0x2ec759(0x18a)+(_0x4d4b0e===0x1?'':'s')+'\x20'+(_0x4d4b0e===0x1?_0x2ec759(0x11f):_0x2ec759(0x190))+_0x2ec759(0x17e));if(_0x3c6b01>0x0)_0x220be9['push'](_0x3c6b01+_0x2ec759(0x110));return _0x220be9[_0x2ec759(0x151)](',\x20');}async function hasUnsyncedLocalChanges(_0x2ae784,_0x13242c,_0x248828){const _0x38c635=a43_0x5196c8;if(!await fileExists(_0x2ae784))return![];const _0x352aca=await computeFileHash(_0x2ae784);if(!_0x13242c)return _0x248828?_0x352aca!==_0x248828:!![];return _0x352aca!==_0x13242c[_0x38c635(0x138)];}function createPullFileTransaction(){const _0x295cd5=new Map(),_0x2a217f=async(_0x546609,_0x3619ef)=>{const _0x55c4a8=a43_0x3a3d;try{if(_0x3619ef[_0x55c4a8(0x178)])await ensureParentDirectory(_0x546609),await writeFile(_0x546609,_0x3619ef[_0x55c4a8(0x160)]);else try{await unlink(_0x546609);}catch(_0x4d6dba){if(_0x4d6dba[_0x55c4a8(0x118)]!==_0x55c4a8(0x184))throw _0x4d6dba;}return undefined;}catch(_0x6f73cd){return _0x6f73cd instanceof Error?_0x6f73cd:new Error(String(_0x6f73cd));}};return{async 'write'(_0x372706,_0x446e4e){const _0x4e5c68=a43_0x3a3d;if(!_0x295cd5[_0x4e5c68(0x18b)](_0x372706))try{_0x295cd5[_0x4e5c68(0x17d)](_0x372706,{'existed':!![],'content':await readFile(_0x372706)});}catch(_0x32cfb4){if(_0x32cfb4['code']!==_0x4e5c68(0x184))throw _0x32cfb4;_0x295cd5[_0x4e5c68(0x17d)](_0x372706,{'existed':![]});}try{await ensureParentDirectory(_0x372706),await writeFile(_0x372706,_0x446e4e,_0x4e5c68(0x172));}catch(_0x323ba6){const _0x32f5bb=await _0x2a217f(_0x372706,_0x295cd5[_0x4e5c68(0x13d)](_0x372706));if(!_0x32f5bb)_0x295cd5['delete'](_0x372706);throw withRollbackErrors(_0x323ba6,_0x4e5c68(0x16e)+_0x372706+'\x22.',_0x32f5bb?[_0x32f5bb]:[]);}},async 'rollback'(){const _0x138204=a43_0x3a3d,_0x4efb06=[];for(const [_0x59419a,_0x21c424]of[..._0x295cd5['entries']()][_0x138204(0x12b)]()){const _0x1d1cab=await _0x2a217f(_0x59419a,_0x21c424);_0x1d1cab&&_0x4efb06[_0x138204(0x10d)](new Error(_0x138204(0x11e)+_0x59419a+'\x22:\x20'+_0x1d1cab[_0x138204(0x18f)]));}return _0x4efb06;}};}function withRollbackErrors(_0x41a011,_0x16139a,_0xca5b2a){const _0x55ab6c=a43_0x5196c8,_0x3674f9=_0x41a011 instanceof Error?_0x41a011:new Error(String(_0x41a011));if(_0xca5b2a[_0x55ab6c(0x133)]===0x0)return _0x3674f9;return new AggregateError([_0x3674f9,..._0xca5b2a],_0x16139a+_0x55ab6c(0x12e)+_0xca5b2a[_0x55ab6c(0x148)](_0x537fcb=>_0x537fcb[_0x55ab6c(0x18f)])[_0x55ab6c(0x151)](';\x20'));}function buildDatasetCodeToAliasMap(_0x3adbaf,_0x120a32,_0x3f9184){const _0x11ec50=a43_0x5196c8,_0x1fb0c1=resolveApiModelSource(_0x3adbaf,_0x120a32,_0x3f9184),_0xf33f7c=loadAliasMap(_0x3adbaf,undefined,_0x1fb0c1['filePath'],_0x1fb0c1[_0x11ec50(0x15b)]);return assertUnambiguousHookAliases(_0xf33f7c),new Map(_0xf33f7c[_0x11ec50(0x148)](_0x3ebc2c=>[_0x3ebc2c[_0x11ec50(0x159)][_0x11ec50(0x191)](),_0x3ebc2c['alias']]));}async function planHookDirectoryMigration(_0x2fc93e,_0x17f442,_0x2ce14b,_0x1be22f){const _0x4df57d=a43_0x5196c8,_0x187095=new Map();for(const [_0x3d6fc9,_0x1ebec8]of Object[_0x4df57d(0x14c)](_0x17f442['functions'])){const [_0x139c04,_0x5de625,_0xecaa5f,_0x36830d,_0x1fc112,..._0x14d36f]=_0x3d6fc9[_0x4df57d(0x171)]('/');if(_0x139c04!==_0x4df57d(0x107)||!_0x5de625||!_0xecaa5f||!_0x36830d||!_0x1fc112||_0x14d36f[_0x4df57d(0x133)]>0x0||!_0x1ebec8[_0x4df57d(0x159)])continue;const _0x1006b8=_0x2ce14b[_0x4df57d(0x13d)](_0x1ebec8[_0x4df57d(0x159)]['toLowerCase']()),_0x2568f4=_0x1006b8??_0x1ebec8[_0x4df57d(0x159)];if(!isSafeHookDirectorySegment(_0x5de625))throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x158)+_0x5de625+_0x4df57d(0x15c));if(!isSafeHookDirectorySegment(_0x2568f4))throw CliErrors['validation'](_0x4df57d(0x177)+_0x5de625+_0x4df57d(0x109));if(_0x5de625===_0x2568f4)continue;const _0x198e79=_0x187095[_0x4df57d(0x13d)](_0x5de625)??{'datasetCode':_0x1ebec8['datasetCode'],'alias':_0x1006b8,'keyChanges':[]};if(_0x198e79[_0x4df57d(0x159)]!==_0x1ebec8[_0x4df57d(0x159)])throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x177)+_0x5de625+_0x4df57d(0x11a));const _0x266798=_0x4df57d(0x140)+_0x2568f4+'/'+_0xecaa5f+'/'+_0x36830d+'/'+_0x1fc112;try{resolveLocalFilePathFromLockKey(_0x2fc93e,_0x3d6fc9),resolveLocalFilePathFromLockKey(_0x2fc93e,_0x266798);}catch(_0x30f999){throw CliErrors[_0x4df57d(0x130)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22'+_0x3d6fc9+_0x4df57d(0x144)+(_0x30f999 instanceof Error?_0x30f999[_0x4df57d(0x18f)]:String(_0x30f999)));}_0x198e79[_0x4df57d(0x119)][_0x4df57d(0x10d)]({'oldLockKey':_0x3d6fc9,'newLockKey':_0x266798,'entry':_0x1ebec8}),_0x187095['set'](_0x5de625,_0x198e79);}const _0x47ff49=new Set([..._0x187095[_0x4df57d(0x16c)]()][_0x4df57d(0x16d)](_0x293c0c=>_0x293c0c[_0x4df57d(0x119)]['map'](_0x157287=>_0x157287[_0x4df57d(0x16f)]))),_0xd8e483=new Map(),_0x5e2ac9=new Map();for(const [_0x57747f,_0x5af870]of _0x187095){const _0x228ec2=_0x5af870['alias']??_0x5af870[_0x4df57d(0x159)],_0x4d7cfe=hookDirectoryIdentity(_0x228ec2),_0x268aa0=_0xd8e483[_0x4df57d(0x13d)](_0x4d7cfe);if(_0x268aa0&&_0x268aa0!==_0x57747f)throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directories\x20\x22'+_0x268aa0+_0x4df57d(0x125)+_0x57747f+_0x4df57d(0x147)+_0x228ec2+_0x4df57d(0x126));_0xd8e483[_0x4df57d(0x17d)](_0x4d7cfe,_0x57747f);for(const _0x3cd846 of _0x5af870['keyChanges']){const _0x9137c1=_0x5e2ac9[_0x4df57d(0x13d)](_0x3cd846[_0x4df57d(0x17a)]);if(_0x9137c1&&_0x9137c1!==_0x3cd846['oldLockKey'])throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x154)+_0x9137c1+'\x22\x20and\x20\x22'+_0x3cd846[_0x4df57d(0x16f)]+_0x4df57d(0x147)+_0x3cd846['newLockKey']+'\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');if(_0x47ff49[_0x4df57d(0x18b)](_0x3cd846[_0x4df57d(0x17a)]))throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x169)+_0x3cd846[_0x4df57d(0x16f)]+_0x4df57d(0x12f)+_0x3cd846[_0x4df57d(0x17a)]+'\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');_0x5e2ac9[_0x4df57d(0x17d)](_0x3cd846['newLockKey'],_0x3cd846[_0x4df57d(0x16f)]);}}const _0x750751=new Map();for(const [_0x132e0b,_0x5818e2]of _0x2ce14b){_0x750751[_0x4df57d(0x17d)](hookDirectoryIdentity(_0x5818e2),_0x132e0b);}const _0x136bcd=[];for(const [_0x35f2dc,_0x57c495]of _0x187095){const _0x37f2b5=_0x57c495[_0x4df57d(0x10b)]??_0x57c495[_0x4df57d(0x159)],_0x54e2e5=join(_0x2fc93e['scriptsRootDir'],'HOOK',_0x35f2dc),_0x169b5e=join(_0x2fc93e['scriptsRootDir'],'HOOK',_0x37f2b5),_0x5082e4=await directoryExists(_0x54e2e5),_0x4ebca1=await directoryExists(_0x169b5e),_0xf9d177=_0x5082e4?_0x4ebca1?await sameDirectory(_0x54e2e5,_0x169b5e)?_0x4df57d(0x142):undefined:_0x4df57d(0x161):_0x4df57d(0x123);if(!_0xf9d177)throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x177)+_0x35f2dc+_0x4df57d(0x17b)+_0x37f2b5+_0x4df57d(0x10f));const _0x25082d=_0x750751[_0x4df57d(0x13d)](hookDirectoryIdentity(_0x35f2dc));if(_0x25082d&&_0x25082d!==_0x57c495['datasetCode'][_0x4df57d(0x191)]()){const _0x4c12b1=new Set(_0x57c495[_0x4df57d(0x119)]['map'](_0x478611=>_0x478611[_0x4df57d(0x16f)])),_0x5e70be=_0x1be22f[_0x4df57d(0x15f)](_0x5d79ea=>_0x5d79ea[_0x4df57d(0x189)]===_0x4df57d(0x107)&&_0x5d79ea[_0x4df57d(0x10b)]!=null&&hookDirectoryIdentity(_0x5d79ea['alias'])===hookDirectoryIdentity(_0x35f2dc)&&!_0x4c12b1[_0x4df57d(0x18b)](_0x5d79ea[_0x4df57d(0x157)]));if(_0x5e70be['length']>0x0)throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x177)+_0x35f2dc+'\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');}const _0x26f435=_0x750751[_0x4df57d(0x13d)](hookDirectoryIdentity(_0x37f2b5));if(_0x26f435&&_0x26f435!==_0x57c495[_0x4df57d(0x159)]['toLowerCase']())throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x177)+_0x35f2dc+_0x4df57d(0x17b)+_0x37f2b5+'\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.');for(const _0x33ad01 of _0x57c495[_0x4df57d(0x119)]){const _0x2f8e53=_0x17f442[_0x4df57d(0x104)][_0x33ad01[_0x4df57d(0x17a)]];if(_0x2f8e53&&!_0x47ff49['has'](_0x33ad01[_0x4df57d(0x17a)])&&!sameHookIdentity(_0x33ad01[_0x4df57d(0x183)],_0x2f8e53))throw CliErrors[_0x4df57d(0x130)](_0x4df57d(0x177)+_0x35f2dc+_0x4df57d(0x17b)+_0x37f2b5+_0x4df57d(0x146));}_0x136bcd['push']({'oldDirectory':_0x35f2dc,'newDirectory':_0x37f2b5,'oldDirectoryPath':_0x54e2e5,'newDirectoryPath':_0x169b5e,'mode':_0xf9d177,'alias':_0x57c495['alias'],'keyChanges':_0x57c495[_0x4df57d(0x119)]});}const _0x3b7cd5={..._0x17f442[_0x4df57d(0x104)]},_0x27332b=new Map(),_0x5d7e23=new Map();for(const _0x415f40 of _0x136bcd){const _0x18a148=_0x415f40[_0x4df57d(0x16a)]!=='rekey';_0x18a148&&_0x5d7e23[_0x4df57d(0x17d)](hookDirectoryIdentity(_0x415f40[_0x4df57d(0x137)]),_0x415f40[_0x4df57d(0x164)]);for(const _0x14fa8a of _0x415f40['keyChanges']){const _0x202811=_0x3b7cd5[_0x14fa8a[_0x4df57d(0x17a)]],_0x1bd110=_0x18a148?_0x14fa8a[_0x4df57d(0x183)]:_0x202811??_0x14fa8a['entry'];_0x3b7cd5[_0x14fa8a[_0x4df57d(0x17a)]]=canonicalizeHookEntry(_0x1bd110,_0x415f40['alias']),delete _0x3b7cd5[_0x14fa8a[_0x4df57d(0x16f)]],_0x18a148&&_0x27332b['set'](_0x14fa8a[_0x4df57d(0x17a)],resolveLocalFilePathFromLockKey(_0x2fc93e,_0x14fa8a['oldLockKey']));}}return{'migrations':_0x136bcd,'projectedFunctions':_0x3b7cd5,'sourceFilePathByNewLockKey':_0x27332b,'sourceDirectoryPathByNewDirectory':_0x5d7e23};}function resolveMigratedSourceFilePath(_0xdf74ac,_0x4f44ff){const _0x5f522d=a43_0x5196c8;if(!_0xdf74ac||!_0x4f44ff)return undefined;const _0x115c6c=_0xdf74ac[_0x5f522d(0x168)]['get'](_0x4f44ff[_0x5f522d(0x157)]);if(_0x115c6c)return _0x115c6c;if(_0x4f44ff[_0x5f522d(0x189)]!==_0x5f522d(0x107))return undefined;const [,_0x26db3d,..._0x1c52da]=_0x4f44ff[_0x5f522d(0x157)][_0x5f522d(0x171)]('/');if(!_0x26db3d||_0x1c52da[_0x5f522d(0x133)]===0x0)return undefined;const _0x17c8a7=_0xdf74ac[_0x5f522d(0x14f)][_0x5f522d(0x13d)](hookDirectoryIdentity(_0x26db3d));return _0x17c8a7?join(_0x17c8a7,..._0x1c52da)+'.js':undefined;}function sameHookIdentity(_0xa8e3b1,_0x339c84){const _0x3b502b=a43_0x5196c8;return _0xa8e3b1[_0x3b502b(0x13a)]===_0x339c84[_0x3b502b(0x13a)]&&_0xa8e3b1[_0x3b502b(0x159)]===_0x339c84[_0x3b502b(0x159)]&&_0xa8e3b1[_0x3b502b(0x134)]===_0x339c84['operationType']&&_0xa8e3b1[_0x3b502b(0x103)]===_0x339c84[_0x3b502b(0x103)];}function canonicalizeHookEntry(_0x3165bb,_0x52e518){const {alias:_0x44a8c5,..._0x1a34be}=_0x3165bb;return _0x52e518?{..._0x1a34be,'alias':_0x52e518}:_0x1a34be;}function hookDirectoryIdentity(_0x80b31c){const _0xea50c7=a43_0x5196c8;return _0x80b31c['normalize'](_0xea50c7(0x18d))[_0xea50c7(0x191)]();}function a43_0x3a3d(_0x5d97fe,_0x31751e){_0x5d97fe=_0x5d97fe-0x102;const _0x2af05b=a43_0x2af0();let _0x3a3d12=_0x2af05b[_0x5d97fe];return _0x3a3d12;}function isSafeHookDirectorySegment(_0x1e4032){return isSafeLockKeySegment(_0x1e4032);}async function sameDirectory(_0xd19ca4,_0xa70096){const _0x566e94=a43_0x5196c8,[_0x143450,_0x211c6e]=await Promise['all']([stat(_0xd19ca4),stat(_0xa70096)]);return _0x143450[_0x566e94(0x181)]===_0x211c6e[_0x566e94(0x181)]&&_0x143450[_0x566e94(0x12d)]===_0x211c6e[_0x566e94(0x12d)];}async function applyHookDirectoryMigration(_0x58b7fc,_0x396dbc){const _0xb52163=a43_0x5196c8,_0x225d9e=_0x396dbc[_0xb52163(0x104)],_0x38479b=_0x396dbc[_0xb52163(0x163)],_0xf32ca0=[],_0x1f8078=async()=>{const _0x20f2ec=_0xb52163,_0x59cf10=[];_0x396dbc[_0x20f2ec(0x104)]=_0x225d9e,_0x396dbc[_0x20f2ec(0x163)]=_0x38479b;for(const {migration:_0x175488,temporaryPath:_0x44e1c9}of[..._0xf32ca0][_0x20f2ec(0x12b)]()){try{_0x44e1c9?(await rename(_0x175488[_0x20f2ec(0x114)],_0x44e1c9),await rename(_0x44e1c9,_0x175488['oldDirectoryPath'])):await rename(_0x175488['newDirectoryPath'],_0x175488[_0x20f2ec(0x164)]);}catch(_0x3321bb){_0x59cf10[_0x20f2ec(0x10d)](new Error(_0x20f2ec(0x13c)+_0x175488[_0x20f2ec(0x15d)]+_0x20f2ec(0x179)+_0x175488[_0x20f2ec(0x137)]+_0x20f2ec(0x144)+(_0x3321bb instanceof Error?_0x3321bb['message']:String(_0x3321bb))));}}return _0x59cf10;};try{for(const _0x3d1387 of _0x58b7fc[_0xb52163(0x132)]){if(_0x3d1387[_0xb52163(0x16a)]==='move')await ensureParentDirectory(_0x3d1387[_0xb52163(0x114)]),await rename(_0x3d1387[_0xb52163(0x164)],_0x3d1387[_0xb52163(0x114)]),_0xf32ca0[_0xb52163(0x10d)]({'migration':_0x3d1387});else{if(_0x3d1387[_0xb52163(0x16a)]===_0xb52163(0x142)){const _0x227fc1=join(dirname(_0x3d1387['oldDirectoryPath']),_0xb52163(0x113)+randomUUID());await rename(_0x3d1387[_0xb52163(0x164)],_0x227fc1);try{await rename(_0x227fc1,_0x3d1387['newDirectoryPath']);}catch(_0x5e0434){try{await rename(_0x227fc1,_0x3d1387[_0xb52163(0x164)]);}catch(_0x3d7d0c){throw withRollbackErrors(_0x5e0434,_0xb52163(0x131)+_0x3d1387[_0xb52163(0x15d)]+_0xb52163(0x17b)+_0x3d1387[_0xb52163(0x137)]+'\x22;\x20temporary\x20directory\x20\x22'+_0x227fc1+_0xb52163(0x17f),[new Error('Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22'+_0x227fc1+_0xb52163(0x17b)+_0x3d1387[_0xb52163(0x15d)]+'\x22:\x20'+(_0x3d7d0c instanceof Error?_0x3d7d0c[_0xb52163(0x18f)]:String(_0x3d7d0c)))]);}throw _0x5e0434;}_0xf32ca0[_0xb52163(0x10d)]({'migration':_0x3d1387,'temporaryPath':_0x227fc1});}}}return _0x396dbc[_0xb52163(0x104)]=_0x58b7fc[_0xb52163(0x166)],{'rollback':_0x1f8078};}catch(_0x22f44b){const _0x42cce8=await _0x1f8078();throw withRollbackErrors(_0x22f44b,'Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x42cce8);}}async function confirmForce(){const _0x1d7575=a43_0x5196c8,_0x2fe9f3=createInterface({'input':process[_0x1d7575(0x10c)],'output':process[_0x1d7575(0x108)]}),_0x5a8027=await new Promise(_0x1df636=>{const _0x31ee02=_0x1d7575;_0x2fe9f3[_0x31ee02(0x18c)](_0x31ee02(0x180),_0x1df636);});return _0x2fe9f3['close'](),['y','yes']['includes'](_0x5a8027[_0x1d7575(0x153)]()[_0x1d7575(0x191)]());}
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)]());}