@lovrabet/rabetbase-cli 2.5.4-beta.5 → 2.5.4

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 (358) 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/detail.js +1 -1
  77. package/lib/commands/dataset/extend-update.js +1 -1
  78. package/lib/commands/dataset/field-restore.js +1 -1
  79. package/lib/commands/dataset/field-update.js +1 -1
  80. package/lib/commands/dataset/generate.js +1 -1
  81. package/lib/commands/dataset/index.js +1 -1
  82. package/lib/commands/dataset/list.js +1 -1
  83. package/lib/commands/dataset/operations.js +1 -1
  84. package/lib/commands/dataset/relation-audit.js +1 -1
  85. package/lib/commands/dataset/relation-create.js +1 -1
  86. package/lib/commands/dataset/relation-delete.js +1 -1
  87. package/lib/commands/dataset/relation-shared.js +1 -1
  88. package/lib/commands/dataset/relation-update.js +1 -1
  89. package/lib/commands/dataset/relations.js +1 -1
  90. package/lib/commands/dataset/rename.js +1 -1
  91. package/lib/commands/dataset/restore.js +1 -1
  92. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  93. package/lib/commands/db/analysis-batching.js +1 -1
  94. package/lib/commands/db/analyze-batch-plan.js +1 -1
  95. package/lib/commands/db/analyze-cancel.js +1 -1
  96. package/lib/commands/db/analyze-start.js +1 -1
  97. package/lib/commands/db/analyze-status.js +1 -1
  98. package/lib/commands/db/create.js +1 -1
  99. package/lib/commands/db/delete.js +1 -1
  100. package/lib/commands/db/detail.js +1 -1
  101. package/lib/commands/db/diff-refresh-start.js +1 -1
  102. package/lib/commands/db/diff-refresh-status.js +1 -1
  103. package/lib/commands/db/diff.js +1 -1
  104. package/lib/commands/db/index.js +1 -1
  105. package/lib/commands/db/list.js +1 -1
  106. package/lib/commands/db/shared.js +1 -1
  107. package/lib/commands/db/table-diff-shared.js +1 -1
  108. package/lib/commands/db/tables.js +1 -1
  109. package/lib/commands/db/test.js +1 -1
  110. package/lib/commands/db/update.js +1 -1
  111. package/lib/commands/deployment/index.js +1 -1
  112. package/lib/commands/deployment/sync-all.js +1 -1
  113. package/lib/commands/deployment/sync-jobs.js +1 -1
  114. package/lib/commands/deployment/sync-status.js +1 -1
  115. package/lib/commands/doctor.js +1 -1
  116. package/lib/commands/file/index.js +1 -1
  117. package/lib/commands/flow/create.js +1 -1
  118. package/lib/commands/flow/detail.js +1 -1
  119. package/lib/commands/flow/index.js +1 -1
  120. package/lib/commands/flow/list.js +1 -1
  121. package/lib/commands/flow/publish.js +1 -1
  122. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  123. package/lib/commands/flow/runtime-role-list.js +1 -1
  124. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  125. package/lib/commands/flow/runtime-user-search.js +1 -1
  126. package/lib/commands/flow/shared.js +1 -1
  127. package/lib/commands/flow/update.js +1 -1
  128. package/lib/commands/flow/validate.js +1 -1
  129. package/lib/commands/instant-api-policy/current.js +1 -1
  130. package/lib/commands/instant-api-policy/index.js +1 -1
  131. package/lib/commands/instant-api-policy/init.js +1 -1
  132. package/lib/commands/instant-api-policy/publish.js +1 -1
  133. package/lib/commands/instant-api-policy/pull.js +1 -1
  134. package/lib/commands/instant-api-policy/revision.js +1 -1
  135. package/lib/commands/instant-api-policy/revisions.js +1 -1
  136. package/lib/commands/instant-api-policy/rollback.js +1 -1
  137. package/lib/commands/instant-api-policy/shared.js +1 -1
  138. package/lib/commands/instant-api-policy/validate.js +1 -1
  139. package/lib/commands/issue/index.js +1 -1
  140. package/lib/commands/issue/nudge.js +1 -1
  141. package/lib/commands/issue/report.js +1 -1
  142. package/lib/commands/issue/shared.js +1 -1
  143. package/lib/commands/kb/create.js +1 -1
  144. package/lib/commands/kb/delete.js +1 -1
  145. package/lib/commands/kb/detail.js +1 -1
  146. package/lib/commands/kb/index.js +1 -1
  147. package/lib/commands/kb/list.js +1 -1
  148. package/lib/commands/kb/search.js +1 -1
  149. package/lib/commands/kb/shared.js +1 -1
  150. package/lib/commands/kb/update.js +1 -1
  151. package/lib/commands/logs/index.js +1 -1
  152. package/lib/commands/menu/asset-update.js +1 -1
  153. package/lib/commands/menu/delete.js +1 -1
  154. package/lib/commands/menu/external-link-create.js +1 -1
  155. package/lib/commands/menu/external-link-update.js +1 -1
  156. package/lib/commands/menu/group-create.js +1 -1
  157. package/lib/commands/menu/group-update.js +1 -1
  158. package/lib/commands/menu/index.js +1 -1
  159. package/lib/commands/menu/list.js +1 -1
  160. package/lib/commands/menu/move.js +1 -1
  161. package/lib/commands/menu/regroup-start.js +1 -1
  162. package/lib/commands/menu/rename.js +1 -1
  163. package/lib/commands/menu/shared/compare-table.js +1 -1
  164. package/lib/commands/menu/shared/delete-plan.js +1 -1
  165. package/lib/commands/menu/shared/facts.js +1 -1
  166. package/lib/commands/menu/shared/index.js +1 -1
  167. package/lib/commands/menu/shared/inquirer.js +1 -1
  168. package/lib/commands/menu/shared/local-pages.js +1 -1
  169. package/lib/commands/menu/shared/logic.js +1 -1
  170. package/lib/commands/menu/shared/mutations.js +1 -1
  171. package/lib/commands/menu/shared/path.js +1 -1
  172. package/lib/commands/menu/shared/service.js +1 -1
  173. package/lib/commands/menu/shared/subapp-assets.js +1 -1
  174. package/lib/commands/menu/shared/sync-core.js +1 -1
  175. package/lib/commands/menu/shared/update-core.js +1 -1
  176. package/lib/commands/menu/shared/valid-url.js +1 -1
  177. package/lib/commands/menu/subapp-assets-status.js +1 -1
  178. package/lib/commands/menu/subapp-assets-update.js +1 -1
  179. package/lib/commands/menu/sync.js +1 -1
  180. package/lib/commands/menu/visibility-update.js +1 -1
  181. package/lib/commands/notification/config-create.js +1 -1
  182. package/lib/commands/notification/config-delete.js +1 -1
  183. package/lib/commands/notification/config-list.js +1 -1
  184. package/lib/commands/notification/config-update.js +1 -1
  185. package/lib/commands/notification/index.js +1 -1
  186. package/lib/commands/notification/shared.js +1 -1
  187. package/lib/commands/ocr/index.js +1 -1
  188. package/lib/commands/page/create.js +1 -1
  189. package/lib/commands/page/custom/detail.js +1 -1
  190. package/lib/commands/page/custom/list.js +1 -1
  191. package/lib/commands/page/custom/publish.js +1 -1
  192. package/lib/commands/page/custom/shared.js +1 -1
  193. package/lib/commands/page/custom/syntax.js +1 -1
  194. package/lib/commands/page/custom/update.js +1 -1
  195. package/lib/commands/page/data-list-status.js +1 -1
  196. package/lib/commands/page/generate-start.js +1 -1
  197. package/lib/commands/page/generate-status.js +1 -1
  198. package/lib/commands/page/index.js +1 -1
  199. package/lib/commands/page/pull.js +1 -1
  200. package/lib/commands/page/push.js +1 -1
  201. package/lib/commands/page/relation-audit.js +1 -1
  202. package/lib/commands/page/restore.js +1 -1
  203. package/lib/commands/page/shared.js +1 -1
  204. package/lib/commands/page/sync.js +1 -1
  205. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  206. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  207. package/lib/commands/project/create/format-elapsed.js +1 -1
  208. package/lib/commands/project/create/main.js +1 -1
  209. package/lib/commands/project/create/materialize-project-template.js +1 -1
  210. package/lib/commands/project/create/project-name.js +1 -1
  211. package/lib/commands/project/create/project-template-archive.js +1 -1
  212. package/lib/commands/project/create/project-template-path.js +1 -1
  213. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  214. package/lib/commands/project/create/use-format-code.js +1 -1
  215. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  216. package/lib/commands/project/domain-routing-sync.js +1 -1
  217. package/lib/commands/project/index.js +1 -1
  218. package/lib/commands/project/upgrade.js +1 -1
  219. package/lib/commands/registry.js +1 -1
  220. package/lib/commands/role/delete.js +1 -1
  221. package/lib/commands/role/detail.js +1 -1
  222. package/lib/commands/role/index.js +1 -1
  223. package/lib/commands/role/list.js +1 -1
  224. package/lib/commands/role/shared.js +1 -1
  225. package/lib/commands/role/update.js +1 -1
  226. package/lib/commands/role/user-add.js +1 -1
  227. package/lib/commands/role/user-remove.js +1 -1
  228. package/lib/commands/role/user-resolve.js +1 -1
  229. package/lib/commands/rule/get.js +1 -1
  230. package/lib/commands/rule/index.js +1 -1
  231. package/lib/commands/rule/list.js +1 -1
  232. package/lib/commands/rule/set.js +1 -1
  233. package/lib/commands/rule/shared.js +1 -1
  234. package/lib/commands/run/index.js +1 -1
  235. package/lib/commands/schema.js +1 -1
  236. package/lib/commands/sql/create.js +1 -1
  237. package/lib/commands/sql/delete.js +1 -1
  238. package/lib/commands/sql/detail.js +1 -1
  239. package/lib/commands/sql/exec.js +1 -1
  240. package/lib/commands/sql/index.js +1 -1
  241. package/lib/commands/sql/list.js +1 -1
  242. package/lib/commands/sql/pull.js +1 -1
  243. package/lib/commands/sql/push.js +1 -1
  244. package/lib/commands/sql/shared.js +1 -1
  245. package/lib/commands/sql/status.js +1 -1
  246. package/lib/commands/sql/validate.js +1 -1
  247. package/lib/commands/task/index.js +1 -1
  248. package/lib/commands/task/status.js +1 -1
  249. package/lib/commands/tenant/index.js +1 -1
  250. package/lib/commands/tenant/members-list.js +1 -1
  251. package/lib/commands/tenant/shared.js +1 -1
  252. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  253. package/lib/commands/user-account/feishu-bind.js +1 -1
  254. package/lib/commands/user-account/index.js +1 -1
  255. package/lib/commands/workspace/add.js +1 -1
  256. package/lib/commands/workspace/index.js +1 -1
  257. package/lib/commands/workspace/remove.js +1 -1
  258. package/lib/config/domain-config.js +1 -1
  259. package/lib/config/project-domain-routing.js +1 -1
  260. package/lib/config/region-config.js +1 -1
  261. package/lib/config/schema.js +1 -1
  262. package/lib/constant/cdn.js +1 -1
  263. package/lib/constant/cli.js +1 -1
  264. package/lib/constant/defaults.js +1 -1
  265. package/lib/constant/domain.js +1 -1
  266. package/lib/constant/env.js +1 -1
  267. package/lib/constant/output.js +1 -1
  268. package/lib/constant/paths.js +1 -1
  269. package/lib/constant/region.js +1 -1
  270. package/lib/constant/risk.js +1 -1
  271. package/lib/constant/routing-profile.js +1 -1
  272. package/lib/context/app-resolver.js +1 -1
  273. package/lib/context/auth-resolver.js +1 -1
  274. package/lib/context/config-loader.js +1 -1
  275. package/lib/context.js +1 -1
  276. package/lib/core/alias-resolver.js +1 -1
  277. package/lib/core/api-client.js +1 -1
  278. package/lib/core/bff/config.js +1 -1
  279. package/lib/core/bff/file-system.js +1 -1
  280. package/lib/core/bff/hash.js +1 -1
  281. package/lib/core/bff/hook-directory.js +1 -1
  282. package/lib/core/bff/lock.js +1 -1
  283. package/lib/core/bff/utils.js +1 -1
  284. package/lib/core/cross-db-relation.js +1 -1
  285. package/lib/core/db-resolver.js +1 -1
  286. package/lib/core/flow-config.js +1 -1
  287. package/lib/core/instant-api-policy/config.js +1 -1
  288. package/lib/core/kb-search-client.js +1 -1
  289. package/lib/core/page/file-system.js +1 -1
  290. package/lib/core/page/hash.js +1 -1
  291. package/lib/core/page/lock.js +1 -1
  292. package/lib/core/page/lr-smart-jsx.js +1 -1
  293. package/lib/core/sql-index-auditor.js +1 -1
  294. package/lib/core/sql-sync/config.js +1 -1
  295. package/lib/core/sql-sync/file-system.js +1 -1
  296. package/lib/core/sql-sync/hash.js +1 -1
  297. package/lib/core/sql-sync/lock.js +1 -1
  298. package/lib/core/sql-sync/utils.js +1 -1
  299. package/lib/core/sql-validator.js +1 -1
  300. package/lib/errors.js +1 -1
  301. package/lib/framework/build-all-flags.js +1 -1
  302. package/lib/framework/error-output.js +1 -1
  303. package/lib/framework/explicit-yes.js +1 -1
  304. package/lib/framework/flags.js +1 -1
  305. package/lib/framework/help.js +1 -1
  306. package/lib/framework/index.js +1 -1
  307. package/lib/framework/output.js +1 -1
  308. package/lib/framework/response.js +1 -1
  309. package/lib/framework/runner-alias.js +1 -1
  310. package/lib/framework/runner.js +1 -1
  311. package/lib/framework/schema-export.js +1 -1
  312. package/lib/framework/supported-flags.js +1 -1
  313. package/lib/framework/types.js +1 -1
  314. package/lib/generated/build-info.d.ts +4 -4
  315. package/lib/generated/build-info.js +1 -1
  316. package/lib/generated/official-routing.js +1 -1
  317. package/lib/generated/routing-contract.js +1 -1
  318. package/lib/help.js +1 -1
  319. package/lib/postinstall.js +1 -1
  320. package/lib/runtime/confirmation.js +1 -1
  321. package/lib/runtime/event.js +1 -1
  322. package/lib/runtime/index.js +1 -1
  323. package/lib/runtime/queue.js +1 -1
  324. package/lib/runtime/resolve.js +1 -1
  325. package/lib/skills/builtin-skill.js +1 -1
  326. package/lib/skills/main.js +1 -1
  327. package/lib/skills/npx-skills-add.js +1 -1
  328. package/lib/skills/skill-presence.js +1 -1
  329. package/lib/telemetry/cli-command-trace.js +1 -1
  330. package/lib/telemetry/cli-help-trace.js +1 -1
  331. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  332. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  333. package/lib/telemetry/send-cli-trace-log.js +1 -1
  334. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  335. package/lib/utils/ai_config.js +1 -1
  336. package/lib/utils/apply-jq-filter.js +1 -1
  337. package/lib/utils/cdn-config.js +1 -1
  338. package/lib/utils/check-sdk-version.js +1 -1
  339. package/lib/utils/cli-version-check.js +1 -1
  340. package/lib/utils/cli-version-policy.js +1 -1
  341. package/lib/utils/config.js +1 -1
  342. package/lib/utils/entity-with-id.js +1 -1
  343. package/lib/utils/file-utils.js +1 -1
  344. package/lib/utils/guides-cdn.js +1 -1
  345. package/lib/utils/http-client.js +1 -1
  346. package/lib/utils/is-non-interactive.js +1 -1
  347. package/lib/utils/logger.js +1 -1
  348. package/lib/utils/params.js +1 -1
  349. package/lib/utils/platform.js +1 -1
  350. package/lib/utils/sleep.js +1 -1
  351. package/lib/utils/template-replacer.js +1 -1
  352. package/lib/utils/update-notice.js +1 -1
  353. package/lib/utils/version.js +1 -1
  354. package/lib/utils/with-active-cookie.js +1 -1
  355. package/lib/utils/write-cli-side-channel.js +1 -1
  356. package/package.json +1 -1
  357. package/skills/rabetbase/SKILL.md +1 -1
  358. package/skills/rabetbase.manifest.json +3 -3
@@ -1 +1 @@
1
- const a34_0x2cd5f5=a34_0x5888;(function(_0x3382c3,_0xb8e4da){const _0x357fe2=a34_0x5888,_0x49fde7=_0x3382c3();while(!![]){try{const _0x13dc6c=parseInt(_0x357fe2(0xce))/0x1*(-parseInt(_0x357fe2(0xb4))/0x2)+-parseInt(_0x357fe2(0xc1))/0x3+parseInt(_0x357fe2(0xcd))/0x4+-parseInt(_0x357fe2(0xb9))/0x5*(parseInt(_0x357fe2(0xb8))/0x6)+parseInt(_0x357fe2(0xbe))/0x7*(-parseInt(_0x357fe2(0xb1))/0x8)+-parseInt(_0x357fe2(0xb2))/0x9*(parseInt(_0x357fe2(0xc6))/0xa)+-parseInt(_0x357fe2(0xc4))/0xb*(-parseInt(_0x357fe2(0xbc))/0xc);if(_0x13dc6c===_0xb8e4da)break;else _0x49fde7['push'](_0x49fde7['shift']());}catch(_0x2897d1){_0x49fde7['push'](_0x49fde7['shift']());}}}(a34_0xf93c,0x2f83d));import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';function a34_0xf93c(){const _0x34731c=['write','create','2667951yrfDDg','Read\x20config\x20value\x20from\x20file','8030CwFmuB','get','/smartapi/app-config/update','file','apiError',',\x20appCode=','Updated','612568OrxmRu','3AekYrb','isFinite','tags','2864sylXGR','261kIbFHG','string','13192YnoMML','/smartapi/app-config/create','number','\x20app\x20config\x20','95334AlmHvV','110CiWGYL','POST','App\x20config\x20server\x20id\x20missing\x20for\x20key=','36jgbTav','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','2562DXRJoq','appCode','update','487449zaqMqE'];a34_0xf93c=function(){return _0x34731c;};return a34_0xf93c();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a34_0x5888(_0x3f7787,_0x641e43){_0x3f7787=_0x3f7787-0xaf;const _0xf93c1e=a34_0xf93c();let _0x58888d=_0xf93c1e[_0x3f7787];return _0x58888d;}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_0x2cd5f5(0xb5),UPDATE_PATH=a34_0x2cd5f5(0xc8);export const appConfigSet={'service':'app-config','command':'set','description':a34_0x2cd5f5(0xbd),'risk':a34_0x2cd5f5(0xc2),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x2cd5f5(0xc9),'type':a34_0x2cd5f5(0xb3),'description':a34_0x2cd5f5(0xc5)}],async 'validate'(_0x76dfc4){readKeyArg(_0x76dfc4),readOptionalTags(_0x76dfc4),assertSingleValueSource(_0x76dfc4);},async 'dryRun'(_0x4eafd1){const _0x1f36a2=a34_0x2cd5f5,_0x4b9630=readKeyArg(_0x4eafd1),_0x251c12=readOptionalTags(_0x4eafd1),_0x34793e=assertSingleValueSource(_0x4eafd1);await assertValueSourceReadable(_0x34793e);const _0x5496c5=await withAppConfigApiBoundary(_0x1f36a2(0xc7),{'appCode':_0x4eafd1[_0x1f36a2(0xbf)],'key':_0x4b9630},()=>getAppConfigByKey(_0x4eafd1[_0x1f36a2(0xbf)],_0x4b9630)),_0x57bb02=_0x5496c5?_0x1f36a2(0xc0):_0x1f36a2(0xc3),_0x47b4e6=_0x5496c5?projectAppConfig(_0x5496c5):null,_0x240a5f=plannedAppConfig({'appCode':_0x4eafd1[_0x1f36a2(0xbf)],'key':_0x4b9630,'tags':_0x251c12??_0x5496c5?.[_0x1f36a2(0xb0)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x57bb02,'appCode':_0x4eafd1[_0x1f36a2(0xbf)],'key':_0x4b9630,'before':_0x47b4e6,'after':_0x240a5f,'dryRun':!![]}),{'method':_0x1f36a2(0xba),'url':_0x57bb02===_0x1f36a2(0xc0)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x5c9d4b){const _0x32a8b1=a34_0x2cd5f5,_0x4b175b=readKeyArg(_0x5c9d4b),_0x5f5272=readOptionalTags(_0x5c9d4b),_0x3080e4=await withAppConfigApiBoundary('get',{'appCode':_0x5c9d4b['appCode'],'key':_0x4b175b},()=>getAppConfigByKey(_0x5c9d4b['appCode'],_0x4b175b)),_0x16fb9c=_0x3080e4?projectAppConfig(_0x3080e4):null,_0x3cca7b=_0x3080e4?_0x32a8b1(0xc0):_0x32a8b1(0xc3),{value:_0x7354e9,warnings:_0x23d8d3}=await readAppConfigValue(_0x5c9d4b),_0x35fcc9={'appCode':_0x5c9d4b['appCode'],'key':_0x4b175b,'value':_0x7354e9,'tags':_0x5f5272??_0x3080e4?.[_0x32a8b1(0xb0)]??undefined};await withAppConfigApiBoundary(_0x3cca7b,{'appCode':_0x5c9d4b[_0x32a8b1(0xbf)],'key':_0x4b175b},async()=>{const _0x29a49d=_0x32a8b1;_0x3080e4?await updateAppConfig({..._0x35fcc9,'id':requireAppConfigId(_0x3080e4,_0x4b175b,_0x5c9d4b[_0x29a49d(0xbf)])}):await createAppConfig(_0x35fcc9);});const _0x38d78f=await withAppConfigApiBoundary(_0x32a8b1(0xc7),{'appCode':_0x5c9d4b['appCode'],'key':_0x4b175b},()=>getAppConfigByKey(_0x5c9d4b['appCode'],_0x4b175b)),_0x3c531f=_0x38d78f?projectAppConfig(_0x38d78f):plannedAppConfig({'appCode':_0x5c9d4b[_0x32a8b1(0xbf)],'key':_0x4b175b,'tags':_0x35fcc9[_0x32a8b1(0xb0)],'hasValue':_0x7354e9!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x3cca7b,'appCode':_0x5c9d4b[_0x32a8b1(0xbf)],'key':_0x4b175b,'before':_0x16fb9c,'after':_0x3c531f,'dryRun':![],'warnings':_0x23d8d3}),'message':(_0x3cca7b===_0x32a8b1(0xc0)?_0x32a8b1(0xcc):'Created')+_0x32a8b1(0xb7)+_0x4b175b};}};function requireAppConfigId(_0x197ab2,_0x2f676d,_0x45843b){const _0x5d86fb=a34_0x2cd5f5;if(typeof _0x197ab2['id']===_0x5d86fb(0xb6)&&Number[_0x5d86fb(0xaf)](_0x197ab2['id'])&&_0x197ab2['id']>0x0)return _0x197ab2['id'];throw CliErrors[_0x5d86fb(0xca)](_0x5d86fb(0xbb)+_0x2f676d+_0x5d86fb(0xcb)+_0x45843b);}
1
+ const a34_0x2fcd4e=a34_0x6ee9;(function(_0x1d71b2,_0x43e742){const _0x48399c=a34_0x6ee9,_0x1c197e=_0x1d71b2();while(!![]){try{const _0x2df03c=parseInt(_0x48399c(0x14e))/0x1+parseInt(_0x48399c(0x165))/0x2*(parseInt(_0x48399c(0x16a))/0x3)+-parseInt(_0x48399c(0x15c))/0x4*(-parseInt(_0x48399c(0x168))/0x5)+parseInt(_0x48399c(0x163))/0x6*(parseInt(_0x48399c(0x15a))/0x7)+parseInt(_0x48399c(0x164))/0x8*(parseInt(_0x48399c(0x151))/0x9)+parseInt(_0x48399c(0x159))/0xa*(parseInt(_0x48399c(0x156))/0xb)+-parseInt(_0x48399c(0x14b))/0xc*(parseInt(_0x48399c(0x161))/0xd);if(_0x2df03c===_0x43e742)break;else _0x1c197e['push'](_0x1c197e['shift']());}catch(_0x555ea8){_0x1c197e['push'](_0x1c197e['shift']());}}}(a34_0x46b3,0xd3c3c));function a34_0x6ee9(_0x40d82a,_0x24e237){_0x40d82a=_0x40d82a-0x14b;const _0x46b399=a34_0x46b3();let _0x6ee9bf=_0x46b399[_0x40d82a];return _0x6ee9bf;}import{createAppConfig,getAppConfigByKey,updateAppConfig}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a34_0x46b3(){const _0x49a9e2=['6rDdNGt','183856jtWUdn','21314zIHKvi','/smartapi/app-config/create','write','3441835YKvfXC','create','99sfdPbn','12Udssib','string','tags','1239491MIApMK','number',',\x20appCode=','36ylAhoJ','get','Read\x20config\x20value\x20from\x20file','Created','appCode','1409309dnlmaW','Updated','update','20KehVqd','768215zUuagI','Create\x20or\x20update\x20one\x20runtime\x20app-config\x20key','8AUySiK','apiError','file','app-config','\x20app\x20config\x20','33259577IdaKFK','isFinite'];a34_0x46b3=function(){return _0x49a9e2;};return a34_0x46b3();}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_0x2fcd4e(0x166),UPDATE_PATH='/smartapi/app-config/update';export const appConfigSet={'service':a34_0x2fcd4e(0x15f),'command':'set','description':a34_0x2fcd4e(0x15b),'risk':a34_0x2fcd4e(0x167),'args':[KEY_ARG,VALUE_ARG],'flags':[APPCODE_FLAG_OPTIONAL,TAGS_FLAG,STDIN_FLAG,FROM_ENV_FLAG,{'name':a34_0x2fcd4e(0x15e),'type':a34_0x2fcd4e(0x14c),'description':a34_0x2fcd4e(0x153)}],async 'validate'(_0x55b2f1){readKeyArg(_0x55b2f1),readOptionalTags(_0x55b2f1),assertSingleValueSource(_0x55b2f1);},async 'dryRun'(_0x8f10b6){const _0x173d40=a34_0x2fcd4e,_0x190abb=readKeyArg(_0x8f10b6),_0x266b1f=readOptionalTags(_0x8f10b6),_0x53c8ba=assertSingleValueSource(_0x8f10b6);await assertValueSourceReadable(_0x53c8ba);const _0x123936=await withAppConfigApiBoundary(_0x173d40(0x152),{'appCode':_0x8f10b6[_0x173d40(0x155)],'key':_0x190abb},()=>getAppConfigByKey(_0x8f10b6[_0x173d40(0x155)],_0x190abb)),_0x4b8d76=_0x123936?_0x173d40(0x158):_0x173d40(0x169),_0x19dea0=_0x123936?projectAppConfig(_0x123936):null,_0x35fddd=plannedAppConfig({'appCode':_0x8f10b6[_0x173d40(0x155)],'key':_0x190abb,'tags':_0x266b1f??_0x123936?.[_0x173d40(0x14d)],'hasValue':!![]});return asAppConfigDryRunResult(buildMutationData({'operation':_0x4b8d76,'appCode':_0x8f10b6[_0x173d40(0x155)],'key':_0x190abb,'before':_0x19dea0,'after':_0x35fddd,'dryRun':!![]}),{'method':'POST','url':_0x4b8d76===_0x173d40(0x158)?UPDATE_PATH:CREATE_PATH});},async 'execute'(_0x12bea7){const _0x384322=a34_0x2fcd4e,_0x44de0c=readKeyArg(_0x12bea7),_0x2f454b=readOptionalTags(_0x12bea7),_0x4a098d=await withAppConfigApiBoundary(_0x384322(0x152),{'appCode':_0x12bea7[_0x384322(0x155)],'key':_0x44de0c},()=>getAppConfigByKey(_0x12bea7[_0x384322(0x155)],_0x44de0c)),_0x563e5b=_0x4a098d?projectAppConfig(_0x4a098d):null,_0x3c7d6f=_0x4a098d?_0x384322(0x158):'create',{value:_0x631149,warnings:_0x4ef619}=await readAppConfigValue(_0x12bea7),_0x58b241={'appCode':_0x12bea7[_0x384322(0x155)],'key':_0x44de0c,'value':_0x631149,'tags':_0x2f454b??_0x4a098d?.[_0x384322(0x14d)]??undefined};await withAppConfigApiBoundary(_0x3c7d6f,{'appCode':_0x12bea7['appCode'],'key':_0x44de0c},async()=>{_0x4a098d?await updateAppConfig({..._0x58b241,'id':requireAppConfigId(_0x4a098d,_0x44de0c,_0x12bea7['appCode'])}):await createAppConfig(_0x58b241);});const _0x251e7e=await withAppConfigApiBoundary(_0x384322(0x152),{'appCode':_0x12bea7['appCode'],'key':_0x44de0c},()=>getAppConfigByKey(_0x12bea7[_0x384322(0x155)],_0x44de0c)),_0x4a09ef=_0x251e7e?projectAppConfig(_0x251e7e):plannedAppConfig({'appCode':_0x12bea7['appCode'],'key':_0x44de0c,'tags':_0x58b241['tags'],'hasValue':_0x631149!==''});return{'ok':!![],'data':buildMutationData({'operation':_0x3c7d6f,'appCode':_0x12bea7['appCode'],'key':_0x44de0c,'before':_0x563e5b,'after':_0x4a09ef,'dryRun':![],'warnings':_0x4ef619}),'message':(_0x3c7d6f===_0x384322(0x158)?_0x384322(0x157):_0x384322(0x154))+_0x384322(0x160)+_0x44de0c};}};function requireAppConfigId(_0x1053ba,_0x1abc71,_0x101790){const _0x46ed8e=a34_0x2fcd4e;if(typeof _0x1053ba['id']===_0x46ed8e(0x14f)&&Number[_0x46ed8e(0x162)](_0x1053ba['id'])&&_0x1053ba['id']>0x0)return _0x1053ba['id'];throw CliErrors[_0x46ed8e(0x15d)]('App\x20config\x20server\x20id\x20missing\x20for\x20key='+_0x1abc71+_0x46ed8e(0x150)+_0x101790);}
@@ -1 +1 @@
1
- const a35_0x4d3f24=a35_0x2b68;(function(_0x5d7bbc,_0x522bd2){const _0x3d30bc=a35_0x2b68,_0x17bd7c=_0x5d7bbc();while(!![]){try{const _0x1b3b12=parseInt(_0x3d30bc(0x154))/0x1+parseInt(_0x3d30bc(0x14b))/0x2+parseInt(_0x3d30bc(0x13b))/0x3*(parseInt(_0x3d30bc(0x13e))/0x4)+parseInt(_0x3d30bc(0x155))/0x5*(-parseInt(_0x3d30bc(0x145))/0x6)+parseInt(_0x3d30bc(0x147))/0x7*(parseInt(_0x3d30bc(0x14a))/0x8)+-parseInt(_0x3d30bc(0x150))/0x9*(parseInt(_0x3d30bc(0x122))/0xa)+-parseInt(_0x3d30bc(0x12c))/0xb*(parseInt(_0x3d30bc(0x131))/0xc);if(_0x1b3b12===_0x522bd2)break;else _0x17bd7c['push'](_0x17bd7c['shift']());}catch(_0x58990f){_0x17bd7c['push'](_0x17bd7c['shift']());}}}(a35_0x22c8,0xcd254));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':a35_0x4d3f24(0x144),'description':a35_0x4d3f24(0x12b),'required':!![]};export const VALUE_ARG={'name':a35_0x4d3f24(0x137),'description':a35_0x4d3f24(0x12e),'required':![]};export const TAGS_FLAG={'name':a35_0x4d3f24(0x13a),'type':'string','description':'Config\x20tags\x20for\x20filtering/display\x20metadata'};export const STDIN_FLAG={'name':'stdin','type':a35_0x4d3f24(0x134),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};export const FROM_ENV_FLAG={'name':'from-env','type':'string','description':a35_0x4d3f24(0x11e)};export const REVEAL_FLAG={'name':a35_0x4d3f24(0x138),'type':a35_0x4d3f24(0x134),'description':a35_0x4d3f24(0x14e),'default':![]};export function readKeyArg(_0x141a26){const _0x5e449f=a35_0x4d3f24,_0xf13bda=_0x141a26[_0x5e449f(0x139)][0x0]?.[_0x5e449f(0x149)]()??'';return validateKey(_0xf13bda),_0xf13bda;}export function readOptionalTags(_0x3f1e2e){const _0x45e324=a35_0x4d3f24,_0x462671=_0x3f1e2e[_0x45e324(0x156)](_0x45e324(0x13a))[_0x45e324(0x149)]();if(!_0x462671)return undefined;if(_0x462671[_0x45e324(0x13f)]>0x20)throw CliErrors[_0x45e324(0x158)](_0x45e324(0x146));return _0x462671;}export function validateKey(_0x213727){const _0x1bc14f=a35_0x4d3f24;if(!_0x213727)throw CliErrors[_0x1bc14f(0x158)]('Missing\x20app-config\x20key.');if(_0x213727['length']>0x100)throw CliErrors[_0x1bc14f(0x158)](_0x1bc14f(0x123));}export function projectAppConfig(_0x55d06b,_0xbd5cf9){const _0x4e41f2=a35_0x4d3f24,_0x417d66=_0x55d06b[_0x4e41f2(0x137)]!==undefined&&_0x55d06b[_0x4e41f2(0x137)]!==null&&_0x55d06b[_0x4e41f2(0x137)]!=='',_0x6270ca={'appCode':_0x55d06b[_0x4e41f2(0x152)],'key':_0x55d06b[_0x4e41f2(0x144)],'tags':_0x55d06b[_0x4e41f2(0x13a)]??undefined,'hasValue':_0x417d66,'valueRedacted':_0x417d66&&!_0xbd5cf9?.['reveal'],'gmtCreate':_0x55d06b['gmtCreate'],'gmtModified':_0x55d06b[_0x4e41f2(0x120)]};return _0xbd5cf9?.[_0x4e41f2(0x138)]&&(_0x6270ca[_0x4e41f2(0x137)]=_0x55d06b['value']??'',_0x6270ca[_0x4e41f2(0x14c)]=![]),_0x6270ca;}export function plannedAppConfig(_0x47a45d){const _0x37f224=a35_0x4d3f24,_0x53574b=_0x47a45d[_0x37f224(0x151)]??!![];return{'appCode':_0x47a45d[_0x37f224(0x152)],'key':_0x47a45d[_0x37f224(0x144)],'tags':_0x47a45d[_0x37f224(0x13a)]??undefined,'hasValue':_0x53574b,'valueRedacted':_0x53574b};}export function buildMutationData(_0x4f364f){const _0x4ef146=a35_0x4d3f24;return{'operation':_0x4f364f['operation'],'selector':{'appCode':_0x4f364f[_0x4ef146(0x152)],'key':_0x4f364f[_0x4ef146(0x144)]},'before':_0x4f364f[_0x4ef146(0x121)],'after':_0x4f364f[_0x4ef146(0x11f)],'dryRun':_0x4f364f['dryRun'],'warnings':_0x4f364f[_0x4ef146(0x14f)]??[]};}export async function withAppConfigApiBoundary(_0x3e99f0,_0x18dd29,_0x21faac){const _0x4767ab=a35_0x4d3f24;try{return await _0x21faac();}catch{const _0x1d2910=[_0x4767ab(0x125)+_0x18dd29[_0x4767ab(0x152)]];if(_0x18dd29[_0x4767ab(0x144)])_0x1d2910[_0x4767ab(0x127)]('key:\x20'+_0x18dd29[_0x4767ab(0x144)]);_0x1d2910[_0x4767ab(0x127)](_0x4767ab(0x159));throw CliErrors[_0x4767ab(0x142)]('Failed\x20to\x20'+_0x3e99f0+_0x4767ab(0x129),_0x1d2910[_0x4767ab(0x12a)](';\x20')+'.');}}function a35_0x2b68(_0x15e36a,_0x1d59c2){_0x15e36a=_0x15e36a-0x11e;const _0x22c8c5=a35_0x22c8();let _0x2b68d3=_0x22c8c5[_0x15e36a];return _0x2b68d3;}export function asAppConfigDryRunResult(_0x5f338c,_0xbfdf96){const _0x1e743d=a35_0x4d3f24;return Object[_0x1e743d(0x126)](_0x5f338c,{'method':{'value':_0xbfdf96[_0x1e743d(0x133)],'enumerable':![]},'url':{'value':_0xbfdf96[_0x1e743d(0x14d)],'enumerable':![]}});}export function assertSingleValueSource(_0x45b2bb){const _0xc7c044=a35_0x4d3f24,_0x286d48=[];_0x45b2bb[_0xc7c044(0x139)][_0xc7c044(0x13f)]>0x1&&_0x286d48[_0xc7c044(0x127)]({'kind':_0xc7c044(0x135),'value':_0x45b2bb[_0xc7c044(0x139)]['slice'](0x1)[_0xc7c044(0x12a)]('\x20')});const _0x12fd6a=_0x45b2bb[_0xc7c044(0x13c)]('value');_0x12fd6a!==undefined&&_0x12fd6a!==null&&_0x286d48['push']({'kind':_0xc7c044(0x135),'value':String(_0x12fd6a)});_0x45b2bb[_0xc7c044(0x132)](_0xc7c044(0x13d))&&_0x286d48[_0xc7c044(0x127)]({'kind':_0xc7c044(0x13d)});const _0x44f298=_0x45b2bb[_0xc7c044(0x156)]('from-env')[_0xc7c044(0x149)]();_0x44f298&&_0x286d48['push']({'kind':_0xc7c044(0x136),'name':_0x44f298});const _0x565c34=_0x45b2bb[_0xc7c044(0x156)](_0xc7c044(0x148))[_0xc7c044(0x149)]();_0x565c34&&_0x286d48['push']({'kind':_0xc7c044(0x148),'path':_0x565c34});if(_0x286d48[_0xc7c044(0x13f)]===0x0)throw CliErrors[_0xc7c044(0x158)]('Missing\x20app-config\x20value\x20source.',_0xc7c044(0x15a));if(_0x286d48[_0xc7c044(0x13f)]>0x1)throw CliErrors[_0xc7c044(0x158)](_0xc7c044(0x157),'Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.');return _0x286d48[0x0];}function a35_0x22c8(){const _0x29cb22=['355736sfyBEw','3246142CKsogU','valueRedacted','url','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','warnings','11075679YzRoeC','hasValue','appCode','end','1350405XcjkAy','1428045SHSedr','str','App\x20config\x20value\x20source\x20is\x20ambiguous.','validation','value\x20is\x20redacted','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','after','gmtModified','before','10xdmJzu','App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.','Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','appCode:\x20','defineProperties','push','Value\x20file\x20is\x20not\x20readable:\x20','\x20app\x20config.','join','Runtime\x20app-config\x20key','28667408DmZRAA','utf8','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','kind','path','12zUpLiK','bool','method','boolean','argument','env','value','reveal','args','tags','672225ZhQaCa','flag','stdin','16xxYnjO','length','name','data','apiError','once','key','12KzCfRb','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','217IupCQX','file','trim'];a35_0x22c8=function(){return _0x29cb22;};return a35_0x22c8();}export async function assertValueSourceReadable(_0x37e236){const _0x5d750f=a35_0x4d3f24;if(_0x37e236[_0x5d750f(0x12f)]==='env'&&!(_0x37e236['name']in process.env))throw CliErrors[_0x5d750f(0x158)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x37e236[_0x5d750f(0x140)]);if(_0x37e236['kind']==='file')try{await access(_0x37e236[_0x5d750f(0x130)]);}catch{throw CliErrors[_0x5d750f(0x158)](_0x5d750f(0x128)+_0x37e236[_0x5d750f(0x130)]);}}export async function readAppConfigValue(_0x57ef9a){const _0x457a19=a35_0x4d3f24,_0x566d2e=assertSingleValueSource(_0x57ef9a),_0x24c14c=[];if(_0x566d2e[_0x457a19(0x12f)]===_0x457a19(0x135))return _0x24c14c[_0x457a19(0x127)](_0x457a19(0x124)),{'value':_0x566d2e[_0x457a19(0x137)]??'','source':_0x566d2e[_0x457a19(0x12f)],'warnings':_0x24c14c};if(_0x566d2e[_0x457a19(0x12f)]==='stdin')return{'value':await readStdin(),'source':_0x566d2e['kind'],'warnings':_0x24c14c};if(_0x566d2e[_0x457a19(0x12f)]==='env'){if(!(_0x566d2e['name']in process.env))throw CliErrors[_0x457a19(0x158)]('Environment\x20variable\x20is\x20not\x20set:\x20'+_0x566d2e[_0x457a19(0x140)]);return{'value':process.env[_0x566d2e.name]??'','source':_0x566d2e['kind'],'warnings':_0x24c14c};}return{'value':await readFile(_0x566d2e[_0x457a19(0x130)],_0x457a19(0x12d)),'source':_0x566d2e[_0x457a19(0x12f)],'warnings':_0x24c14c};}function readStdin(){return new Promise((_0x150b83,_0x9f87af)=>{const _0x29fd7c=a35_0x2b68;let _0x2c1d42='';process[_0x29fd7c(0x13d)]['setEncoding'](_0x29fd7c(0x12d)),process['stdin']['on'](_0x29fd7c(0x141),_0x5cf519=>{_0x2c1d42+=_0x5cf519;}),process[_0x29fd7c(0x13d)][_0x29fd7c(0x143)](_0x29fd7c(0x153),()=>_0x150b83(_0x2c1d42)),process[_0x29fd7c(0x13d)][_0x29fd7c(0x143)]('error',_0x9f87af);});}
1
+ const a35_0x2075b6=a35_0x5ca5;(function(_0x4b3330,_0x2d152){const _0x28efa6=a35_0x5ca5,_0x426c1a=_0x4b3330();while(!![]){try{const _0x593478=-parseInt(_0x28efa6(0x135))/0x1+parseInt(_0x28efa6(0x133))/0x2*(-parseInt(_0x28efa6(0x12c))/0x3)+-parseInt(_0x28efa6(0x15b))/0x4+parseInt(_0x28efa6(0x124))/0x5+parseInt(_0x28efa6(0x161))/0x6*(-parseInt(_0x28efa6(0x125))/0x7)+-parseInt(_0x28efa6(0x12b))/0x8*(parseInt(_0x28efa6(0x134))/0x9)+parseInt(_0x28efa6(0x15a))/0xa*(parseInt(_0x28efa6(0x149))/0xb);if(_0x593478===_0x2d152)break;else _0x426c1a['push'](_0x426c1a['shift']());}catch(_0x8afc7a){_0x426c1a['push'](_0x426c1a['shift']());}}}(a35_0x3e06,0xc670d));import{access,readFile}from'node:fs/promises';import{CliErrors}from'../../errors.js';export const KEY_ARG={'name':'key','description':a35_0x2075b6(0x12d),'required':!![]};export const VALUE_ARG={'name':a35_0x2075b6(0x126),'description':a35_0x2075b6(0x12e),'required':![]};export const TAGS_FLAG={'name':a35_0x2075b6(0x15f),'type':a35_0x2075b6(0x142),'description':a35_0x2075b6(0x160)};export const STDIN_FLAG={'name':a35_0x2075b6(0x156),'type':a35_0x2075b6(0x162),'description':'Read\x20config\x20value\x20from\x20stdin','default':![]};function a35_0x3e06(){const _0x3fd5c7=['before','11520575OvUAwn','Missing\x20app-config\x20value\x20source.','validation','bool','length','path','data','file','argument','once','Use\x20exactly\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','hasValue','push','stdin','args','apiError','defineProperties','50FdKQVJ','5403228FnkxUc','utf8','Read\x20config\x20value\x20from\x20the\x20named\x20environment\x20variable','Value\x20file\x20is\x20not\x20readable:\x20','tags','Config\x20tags\x20for\x20filtering/display\x20metadata','2034zWXzUx','boolean','Missing\x20app-config\x20key.','method','Reveal\x20the\x20sensitive\x20value\x20for\x20this\x20single\x20key','1713370vCEjLc','10451BFmEem','value','end','env','from-env','setEncoding','9320VDmMdz','15RaYDIH','Runtime\x20app-config\x20key','Sensitive\x20config\x20value.\x20Prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.','flag','appCode','after','valueRedacted','81534vTYjom','9459FRSFSk','1481302vGMXSN','name','Failed\x20to\x20','Use\x20one\x20of:\x20positional\x20<value>,\x20--stdin,\x20--from-env\x20<NAME>,\x20or\x20--file\x20<path>.','join','error','str','trim','Environment\x20variable\x20is\x20not\x20set:\x20','kind','slice','App\x20config\x20tags\x20length\x20cannot\x20exceed\x2032.','key','string','warnings','dryRun','value\x20is\x20redacted','reveal','url'];a35_0x3e06=function(){return _0x3fd5c7;};return a35_0x3e06();}export const FROM_ENV_FLAG={'name':a35_0x2075b6(0x129),'type':a35_0x2075b6(0x142),'description':a35_0x2075b6(0x15d)};export const REVEAL_FLAG={'name':a35_0x2075b6(0x146),'type':'boolean','description':a35_0x2075b6(0x123),'default':![]};export function readKeyArg(_0x3df2eb){const _0x63d20e=a35_0x2075b6,_0x40ac13=_0x3df2eb[_0x63d20e(0x157)][0x0]?.[_0x63d20e(0x13c)]()??'';return validateKey(_0x40ac13),_0x40ac13;}function a35_0x5ca5(_0x549a51,_0x16ccfa){_0x549a51=_0x549a51-0x122;const _0x3e060a=a35_0x3e06();let _0x5ca52d=_0x3e060a[_0x549a51];return _0x5ca52d;}export function readOptionalTags(_0x3c2954){const _0x5d6d56=a35_0x2075b6,_0x15f626=_0x3c2954['str'](_0x5d6d56(0x15f))['trim']();if(!_0x15f626)return undefined;if(_0x15f626[_0x5d6d56(0x14d)]>0x20)throw CliErrors[_0x5d6d56(0x14b)](_0x5d6d56(0x140));return _0x15f626;}export function validateKey(_0x4cd963){const _0x2ed5e3=a35_0x2075b6;if(!_0x4cd963)throw CliErrors[_0x2ed5e3(0x14b)](_0x2ed5e3(0x163));if(_0x4cd963[_0x2ed5e3(0x14d)]>0x100)throw CliErrors[_0x2ed5e3(0x14b)]('App\x20config\x20key\x20length\x20cannot\x20exceed\x20256.');}export function projectAppConfig(_0x38b441,_0x48a672){const _0x9dce66=a35_0x2075b6,_0x1af1be=_0x38b441[_0x9dce66(0x126)]!==undefined&&_0x38b441['value']!==null&&_0x38b441['value']!=='',_0x18217e={'appCode':_0x38b441[_0x9dce66(0x130)],'key':_0x38b441['key'],'tags':_0x38b441['tags']??undefined,'hasValue':_0x1af1be,'valueRedacted':_0x1af1be&&!_0x48a672?.[_0x9dce66(0x146)],'gmtCreate':_0x38b441['gmtCreate'],'gmtModified':_0x38b441['gmtModified']};return _0x48a672?.[_0x9dce66(0x146)]&&(_0x18217e[_0x9dce66(0x126)]=_0x38b441[_0x9dce66(0x126)]??'',_0x18217e[_0x9dce66(0x132)]=![]),_0x18217e;}export function plannedAppConfig(_0x2b3c63){const _0x41c2c2=a35_0x2075b6,_0x393a37=_0x2b3c63[_0x41c2c2(0x154)]??!![];return{'appCode':_0x2b3c63['appCode'],'key':_0x2b3c63['key'],'tags':_0x2b3c63[_0x41c2c2(0x15f)]??undefined,'hasValue':_0x393a37,'valueRedacted':_0x393a37};}export function buildMutationData(_0x4b1d78){const _0x2f90e0=a35_0x2075b6;return{'operation':_0x4b1d78['operation'],'selector':{'appCode':_0x4b1d78[_0x2f90e0(0x130)],'key':_0x4b1d78['key']},'before':_0x4b1d78[_0x2f90e0(0x148)],'after':_0x4b1d78[_0x2f90e0(0x131)],'dryRun':_0x4b1d78[_0x2f90e0(0x144)],'warnings':_0x4b1d78[_0x2f90e0(0x143)]??[]};}export async function withAppConfigApiBoundary(_0x286089,_0x556cf7,_0x3d7fd4){const _0x525cb1=a35_0x2075b6;try{return await _0x3d7fd4();}catch{const _0x238ae2=['appCode:\x20'+_0x556cf7[_0x525cb1(0x130)]];if(_0x556cf7[_0x525cb1(0x141)])_0x238ae2[_0x525cb1(0x155)]('key:\x20'+_0x556cf7[_0x525cb1(0x141)]);_0x238ae2[_0x525cb1(0x155)](_0x525cb1(0x145));throw CliErrors[_0x525cb1(0x158)](_0x525cb1(0x137)+_0x286089+'\x20app\x20config.',_0x238ae2[_0x525cb1(0x139)](';\x20')+'.');}}export function asAppConfigDryRunResult(_0x5c63d1,_0x2c6eba){const _0xf04948=a35_0x2075b6;return Object[_0xf04948(0x159)](_0x5c63d1,{'method':{'value':_0x2c6eba[_0xf04948(0x122)],'enumerable':![]},'url':{'value':_0x2c6eba[_0xf04948(0x147)],'enumerable':![]}});}export function assertSingleValueSource(_0x549c7a){const _0x140f69=a35_0x2075b6,_0x174c24=[];_0x549c7a[_0x140f69(0x157)]['length']>0x1&&_0x174c24['push']({'kind':_0x140f69(0x151),'value':_0x549c7a[_0x140f69(0x157)][_0x140f69(0x13f)](0x1)[_0x140f69(0x139)]('\x20')});const _0x246037=_0x549c7a[_0x140f69(0x12f)](_0x140f69(0x126));_0x246037!==undefined&&_0x246037!==null&&_0x174c24[_0x140f69(0x155)]({'kind':'argument','value':String(_0x246037)});_0x549c7a[_0x140f69(0x14c)]('stdin')&&_0x174c24[_0x140f69(0x155)]({'kind':_0x140f69(0x156)});const _0x57bea2=_0x549c7a[_0x140f69(0x13b)]('from-env')[_0x140f69(0x13c)]();_0x57bea2&&_0x174c24[_0x140f69(0x155)]({'kind':_0x140f69(0x128),'name':_0x57bea2});const _0x5a719f=_0x549c7a['str'](_0x140f69(0x150))[_0x140f69(0x13c)]();_0x5a719f&&_0x174c24[_0x140f69(0x155)]({'kind':_0x140f69(0x150),'path':_0x5a719f});if(_0x174c24['length']===0x0)throw CliErrors['validation'](_0x140f69(0x14a),_0x140f69(0x138));if(_0x174c24[_0x140f69(0x14d)]>0x1)throw CliErrors[_0x140f69(0x14b)]('App\x20config\x20value\x20source\x20is\x20ambiguous.',_0x140f69(0x153));return _0x174c24[0x0];}export async function assertValueSourceReadable(_0x4c5e96){const _0x4c50e1=a35_0x2075b6;if(_0x4c5e96[_0x4c50e1(0x13e)]===_0x4c50e1(0x128)&&!(_0x4c5e96[_0x4c50e1(0x136)]in process.env))throw CliErrors[_0x4c50e1(0x14b)](_0x4c50e1(0x13d)+_0x4c5e96['name']);if(_0x4c5e96['kind']==='file')try{await access(_0x4c5e96[_0x4c50e1(0x14e)]);}catch{throw CliErrors['validation'](_0x4c50e1(0x15e)+_0x4c5e96['path']);}}export async function readAppConfigValue(_0x5e42be){const _0x21f059=a35_0x2075b6,_0x3b88c6=assertSingleValueSource(_0x5e42be),_0x2068bb=[];if(_0x3b88c6[_0x21f059(0x13e)]===_0x21f059(0x151))return _0x2068bb[_0x21f059(0x155)]('Value\x20was\x20provided\x20as\x20a\x20command\x20argument;\x20prefer\x20--stdin,\x20--from-env,\x20or\x20--file\x20for\x20secrets.'),{'value':_0x3b88c6[_0x21f059(0x126)]??'','source':_0x3b88c6[_0x21f059(0x13e)],'warnings':_0x2068bb};if(_0x3b88c6['kind']===_0x21f059(0x156))return{'value':await readStdin(),'source':_0x3b88c6['kind'],'warnings':_0x2068bb};if(_0x3b88c6[_0x21f059(0x13e)]===_0x21f059(0x128)){if(!(_0x3b88c6['name']in process.env))throw CliErrors[_0x21f059(0x14b)](_0x21f059(0x13d)+_0x3b88c6['name']);return{'value':process.env[_0x3b88c6.name]??'','source':_0x3b88c6[_0x21f059(0x13e)],'warnings':_0x2068bb};}return{'value':await readFile(_0x3b88c6[_0x21f059(0x14e)],_0x21f059(0x15c)),'source':_0x3b88c6[_0x21f059(0x13e)],'warnings':_0x2068bb};}function readStdin(){return new Promise((_0x2bc333,_0x285771)=>{const _0xf77b7f=a35_0x5ca5;let _0x145ec7='';process[_0xf77b7f(0x156)][_0xf77b7f(0x12a)](_0xf77b7f(0x15c)),process[_0xf77b7f(0x156)]['on'](_0xf77b7f(0x14f),_0x50fd1e=>{_0x145ec7+=_0x50fd1e;}),process[_0xf77b7f(0x156)][_0xf77b7f(0x152)](_0xf77b7f(0x127),()=>_0x2bc333(_0x145ec7)),process[_0xf77b7f(0x156)]['once'](_0xf77b7f(0x13a),_0x285771);});}
@@ -1 +1 @@
1
- const a36_0x3b23ab=a36_0xc6a3;(function(_0x558ad6,_0x3ec35b){const _0x5e88c2=a36_0xc6a3,_0xb28d16=_0x558ad6();while(!![]){try{const _0xbec55f=-parseInt(_0x5e88c2(0xc4))/0x1*(parseInt(_0x5e88c2(0xbd))/0x2)+parseInt(_0x5e88c2(0xbe))/0x3*(parseInt(_0x5e88c2(0xc1))/0x4)+parseInt(_0x5e88c2(0xbc))/0x5*(parseInt(_0x5e88c2(0xc8))/0x6)+parseInt(_0x5e88c2(0xc7))/0x7+parseInt(_0x5e88c2(0xce))/0x8+parseInt(_0x5e88c2(0xcc))/0x9*(parseInt(_0x5e88c2(0xcf))/0xa)+parseInt(_0x5e88c2(0xbf))/0xb*(-parseInt(_0x5e88c2(0xc9))/0xc);if(_0xbec55f===_0x3ec35b)break;else _0xb28d16['push'](_0xb28d16['shift']());}catch(_0x20f800){_0xb28d16['push'](_0xb28d16['shift']());}}}(a36_0x1fbc,0xe9b9a));function a36_0xc6a3(_0x343ee1,_0x2bd8c7){_0x343ee1=_0x343ee1-0xbc;const _0x1fbccd=a36_0x1fbc();let _0xc6a331=_0x1fbccd[_0x343ee1];return _0xc6a331;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'../../auth/constant.js';function a36_0x1fbc(){const _0x16efbc=['5729030VAQKXP','write','nonInteractive','5970zFZbWw','16292BIJbPR','7599ocywPe','1845217eCoqOe','login','1804RMfide','boolean','logout','122rFgwlT','Clear\x20login\x20session','auth','419713rCFjoU','3324UjcNfV','48OnUAej','yes','✓\x20Logged\x20out','9NPaTqx','log','1483336hrdsel'];a36_0x1fbc=function(){return _0x16efbc;};return a36_0x1fbc();}export const authDefinitions=[{'service':'auth','command':a36_0x3b23ab(0xc0),'description':'Login\x20via\x20browser','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':a36_0x3b23ab(0xca),'type':a36_0x3b23ab(0xc2),'description':'Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','default':![]}],async 'execute'(_0x3017be){const _0x401f46=a36_0x3b23ab,{runAuthServer:_0x1373a3}=await import('../../auth/auth-server-ui.js');return await _0x1373a3({'autoYes':_0x3017be['bool'](_0x401f46(0xca)),'nonInteractive':_0x3017be[_0x401f46(0xd1)]}),{'ok':!![]};}},{'service':a36_0x3b23ab(0xc6),'command':a36_0x3b23ab(0xc3),'description':a36_0x3b23ab(0xc5),'risk':a36_0x3b23ab(0xd0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x53101d){const _0x1e85e5=a36_0x3b23ab;return existsSync(cookieFile)?(unlinkSync(cookieFile),console['log'](_0x1e85e5(0xcb))):console[_0x1e85e5(0xcd)]('!\x20Not\x20logged\x20in'),{'ok':!![]};}}];
1
+ const a36_0x286f57=a36_0x48f9;(function(_0x4b81ef,_0x3d71b8){const _0x175634=a36_0x48f9,_0x50e6b0=_0x4b81ef();while(!![]){try{const _0x46499f=-parseInt(_0x175634(0x125))/0x1+-parseInt(_0x175634(0x136))/0x2*(parseInt(_0x175634(0x12c))/0x3)+-parseInt(_0x175634(0x129))/0x4*(-parseInt(_0x175634(0x130))/0x5)+-parseInt(_0x175634(0x132))/0x6*(parseInt(_0x175634(0x137))/0x7)+-parseInt(_0x175634(0x124))/0x8+parseInt(_0x175634(0x126))/0x9+parseInt(_0x175634(0x12a))/0xa*(parseInt(_0x175634(0x123))/0xb);if(_0x46499f===_0x3d71b8)break;else _0x50e6b0['push'](_0x50e6b0['shift']());}catch(_0x245318){_0x50e6b0['push'](_0x50e6b0['shift']());}}}(a36_0x98ad,0x46869));import{unlinkSync,existsSync}from'node:fs';function a36_0x48f9(_0x5e5b63,_0x4d98fd){_0x5e5b63=_0x5e5b63-0x122;const _0x98ad4=a36_0x98ad();let _0x48f99e=_0x98ad4[_0x5e5b63];return _0x48f99e;}function a36_0x98ad(){const _0x3d67ae=['login','449796fYCwsE','Clear\x20login\x20session','log','../../auth/auth-server-ui.js','801042Cexvon','7Mwdtpu','!\x20Not\x20logged\x20in','11RNMorP','3809928pKrtPU','444330SZXPWE','707679fUWyTL','nonInteractive','logout','36zhQeHG','12254020JRbqMW','Login\x20via\x20browser','3qUXPcp','Skip\x20login\x20confirmation\x20and\x20start\x20browser\x20auth\x20immediately','bool','auth','211610hgpIkU'];a36_0x98ad=function(){return _0x3d67ae;};return a36_0x98ad();}import{cookieFile}from'../../auth/constant.js';export const authDefinitions=[{'service':a36_0x286f57(0x12f),'command':a36_0x286f57(0x131),'description':a36_0x286f57(0x12b),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[{'name':'yes','type':'boolean','description':a36_0x286f57(0x12d),'default':![]}],async 'execute'(_0x407755){const _0x1320c1=a36_0x286f57,{runAuthServer:_0x4e842a}=await import(_0x1320c1(0x135));return await _0x4e842a({'autoYes':_0x407755[_0x1320c1(0x12e)]('yes'),'nonInteractive':_0x407755[_0x1320c1(0x127)]}),{'ok':!![]};}},{'service':'auth','command':a36_0x286f57(0x128),'description':a36_0x286f57(0x133),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x5875c6){const _0x55564d=a36_0x286f57;return existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x55564d(0x134)]('✓\x20Logged\x20out')):console[_0x55564d(0x134)](_0x55564d(0x122)),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a37_0x22f5af=a37_0xd485;(function(_0x9de35c,_0x3b55e7){const _0xb9064d=a37_0xd485,_0x2a115e=_0x9de35c();while(!![]){try{const _0x2a9bbc=-parseInt(_0xb9064d(0xf5))/0x1+-parseInt(_0xb9064d(0xbb))/0x2*(parseInt(_0xb9064d(0x110))/0x3)+-parseInt(_0xb9064d(0xc1))/0x4*(-parseInt(_0xb9064d(0x11e))/0x5)+-parseInt(_0xb9064d(0x10c))/0x6+-parseInt(_0xb9064d(0xfc))/0x7+parseInt(_0xb9064d(0xe6))/0x8+-parseInt(_0xb9064d(0xba))/0x9*(-parseInt(_0xb9064d(0xe7))/0xa);if(_0x2a9bbc===_0x3b55e7)break;else _0x2a115e['push'](_0x2a115e['shift']());}catch(_0xb500d6){_0x2a115e['push'](_0x2a115e['shift']());}}}(a37_0x5e1c,0xd9f2f));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';function a37_0xd485(_0x70e962,_0x1e3459){_0x70e962=_0x70e962-0xb8;const _0x5e1c6e=a37_0x5e1c();let _0xd485c1=_0x5e1c6e[_0x70e962];return _0xd485c1;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';function a37_0x5e1c(){const _0x46c871=['Available\x20aliases:\x20','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Trigger\x20node\x20(HOOK\x20only)','\x0a\x20*\x20[平台配置]\x20','selectedAppName','before','mergedCli','datasetcode','修改后的响应结果','.js\x0a','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x20function:\x20','alias','apiDir','当前请求参数','appCode','filePath','Select\x20dataset:','Created\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','map','description','write','after','operation-type','defaultApp','Invalid\x20dataset\x20selection.','COMMON','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','join','4343616YZknbU','900lNpWKv','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','entries','No\x20model\x20aliases\x20found.\x20Run\x20`','UNKNOWN','\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','Available:\x20','function-node','Script\x20type','ENDPOINT','parseInt','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20to\x20refresh.','1083644XAVOrU','close','str','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','stdin','.js','500010FzYtJm','Operation\x20type\x20\x22','\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','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无(如有通知或外部调用,说明影响与失败策略)','Select\x20operation\x20type:','The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','utf8','/COMMON/','name','\x22,\x20params\x20})\x0a','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','string','profileName','datasetCode','Operation\x20type\x20(HOOK\x20only)','6611178MnqUNn','HOOK\x20requires\x20alias/operation/node\x20options.','Invalid\x20function\x20name\x20\x22','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','125961hSUSQA','\x22\x20not\x20found\x20for\x20dataset\x20','nonInteractive','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','read','trim','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','currentApp','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','find','operationType','File\x20already\x20exists:\x20','\x22.\x20','8496485MzDSsr','修改后的请求参数','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','source','scriptsRootDir',']\x20(','HOOK','tableName','isInteger','No\x20datasets\x20found\x20for\x20this\x20app.','type','128529tTFryl','18QtmXIG','Dataset\x20not\x20found\x20for\x20code\x20\x22','validation','code','Script\x20description','\x22\x20not\x20found.\x20','4KVFkpA','/**\x0a\x20*\x20','question','stderr','keys','functionNode','Select\x20trigger\x20node:'];a37_0x5e1c=function(){return _0x46c871;};return a37_0x5e1c();}export const bffCreate={'service':'bff','command':'create','description':a37_0x22f5af(0x10f),'risk':a37_0x22f5af(0x114),'flags':[{'name':a37_0x22f5af(0xb9),'type':a37_0x22f5af(0x108),'required':!![],'enum':[a37_0x22f5af(0xe3),a37_0x22f5af(0xf1),a37_0x22f5af(0x124)],'description':a37_0x22f5af(0xf0)},{'name':a37_0x22f5af(0x105),'type':a37_0x22f5af(0x108),'required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a37_0x22f5af(0xdd),'type':a37_0x22f5af(0x108),'description':a37_0x22f5af(0xbf)},{'name':a37_0x22f5af(0xd4),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)'},{'name':a37_0x22f5af(0xcf),'type':a37_0x22f5af(0x108),'description':a37_0x22f5af(0xf3)},{'name':'operation-type','type':a37_0x22f5af(0x108),'description':a37_0x22f5af(0x10b)},{'name':a37_0x22f5af(0xef),'type':a37_0x22f5af(0x108),'description':a37_0x22f5af(0xca),'enum':[a37_0x22f5af(0xcd),'after']}],async 'validate'(_0x2b5b30){const _0x388ef1=a37_0x22f5af,_0xe5cb90=_0x2b5b30['str'](_0x388ef1(0x105));if(!isValidBffFunctionName(_0xe5cb90))throw CliErrors['validation'](_0x388ef1(0x10e)+_0xe5cb90+_0x388ef1(0xf9));},async 'execute'(_0x2e8151){const _0x3acbac=a37_0x22f5af,_0x23f90a=loadBffProjectConfig(_0x2e8151['appCode']),_0x4a5b34=_0x2e8151[_0x3acbac(0xf7)](_0x3acbac(0xb9)),_0x4f439c=_0x2e8151['str'](_0x3acbac(0x105)),_0x398d7d=_0x2e8151[_0x3acbac(0xf7)]('description')||undefined,_0x2a0f95=_0x4a5b34===_0x3acbac(0x124)?await resolveHookOptions(_0x23f90a,_0x2e8151):undefined,_0x23d709=buildFilePath(_0x23f90a,_0x4a5b34,_0x4f439c,_0x2a0f95);if(await fileExists(_0x23d709))throw CliErrors[_0x3acbac(0xbd)](_0x3acbac(0x11c)+_0x23d709);await mkdir(dirname(_0x23d709),{'recursive':!![]});const _0x46f4d4=generateTemplate(_0x4a5b34,_0x4f439c,_0x2e8151[_0x3acbac(0xd7)],_0x398d7d,_0x2a0f95);await writeFile(_0x23d709,_0x46f4d4,_0x3acbac(0x103));const _0x1eb7ca={'type':_0x4a5b34,'name':_0x4f439c,'path':_0x23d709};if(_0x398d7d)_0x1eb7ca['description']=_0x398d7d;if(_0x2a0f95){if(_0x2a0f95['alias'])_0x1eb7ca[_0x3acbac(0xd4)]=_0x2a0f95['alias'];_0x1eb7ca['datasetCode']=_0x2a0f95[_0x3acbac(0x10a)],_0x1eb7ca['operationType']=_0x2a0f95['operationType'],_0x1eb7ca[_0x3acbac(0xc6)]=_0x2a0f95['functionNode'];}return{'ok':!![],'data':_0x1eb7ca,'message':_0x3acbac(0xda)+_0x4a5b34+_0x3acbac(0xd3)+_0x4f439c};}};async function resolveHookOptions(_0x48a754,_0x2acb5a){const _0x13cb7c=a37_0x22f5af,_0x30b65a=resolveApiModelSource(_0x2acb5a[_0x13cb7c(0xd5)],_0x2acb5a['appCode'],_0x2acb5a[_0x13cb7c(0xcc)]||_0x2acb5a[_0x13cb7c(0xce)]?.[_0x13cb7c(0x117)]||_0x2acb5a[_0x13cb7c(0xce)]?.[_0x13cb7c(0xe1)]),_0x3e30f4=loadAliasMap(_0x2acb5a[_0x13cb7c(0xd5)],undefined,_0x30b65a[_0x13cb7c(0xd8)],_0x30b65a[_0x13cb7c(0x109)]),_0x268567=_0x3e30f4[_0x13cb7c(0xff)]>0x0;let _0x4ee6f2,_0x212224,_0x3d826a;const _0x1e7e93=_0x2acb5a['str']('alias'),_0x38506e=_0x2acb5a['str'](_0x13cb7c(0xcf));if(_0x1e7e93){const _0x56cefe=resolveAlias(_0x2acb5a[_0x13cb7c(0xd5)],_0x1e7e93,undefined,_0x30b65a[_0x13cb7c(0xd8)],_0x30b65a[_0x13cb7c(0x109)]);if(!_0x56cefe){const _0x30e7d9=_0x268567?_0x13cb7c(0xc8)+_0x3e30f4[_0x13cb7c(0xdc)](_0x311ed5=>_0x311ed5[_0x13cb7c(0xd4)])[_0x13cb7c(0xe5)](',\x20'):_0x13cb7c(0xeb)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x13cb7c(0xbd)]('Alias\x20\x22'+_0x1e7e93+_0x13cb7c(0xc0)+_0x30e7d9);}_0x4ee6f2=_0x1e7e93,_0x212224=_0x56cefe;}else{if(_0x38506e){_0x212224=_0x38506e;const _0x129ecc=_0x3e30f4[_0x13cb7c(0x11a)](_0x1d5325=>_0x1d5325[_0x13cb7c(0x10a)]===_0x38506e);_0x4ee6f2=_0x129ecc?.[_0x13cb7c(0xd4)];}else{if(_0x2acb5a[_0x13cb7c(0x112)])throw CliErrors[_0x13cb7c(0xbd)](_0x13cb7c(0xc9));else{if(_0x268567){const _0x9817ed=_0x3e30f4['map'](_0x29b168=>_0x29b168['alias']+'\x20('+_0x29b168[_0x13cb7c(0x125)]+')'),_0x424f6c=await promptSelect(_0x13cb7c(0xd9),_0x9817ed),_0x5dc87b=_0x3e30f4[_0x424f6c];if(!_0x5dc87b)throw CliErrors['validation'](_0x13cb7c(0xe2));_0x4ee6f2=_0x5dc87b[_0x13cb7c(0xd4)],_0x212224=_0x5dc87b[_0x13cb7c(0x10a)];}else{const _0x17ea1f=await listDatasets(_0x2acb5a[_0x13cb7c(0xd7)]);if(_0x17ea1f['length']===0x0)throw CliErrors[_0x13cb7c(0xbd)](_0x13cb7c(0xb8));const _0x29225e=_0x17ea1f[_0x13cb7c(0xdc)](_0x4afbc4=>_0x4afbc4[_0x13cb7c(0x105)]+'\x20['+(_0x4afbc4[_0x13cb7c(0x121)]??_0x13cb7c(0xec))+_0x13cb7c(0x123)+_0x4afbc4[_0x13cb7c(0xbe)]+')'),_0x3e9460=await promptSelect(_0x13cb7c(0xd9),_0x29225e),_0xf8fb51=_0x17ea1f[_0x3e9460];if(!_0xf8fb51)throw CliErrors[_0x13cb7c(0xbd)](_0x13cb7c(0xe2));_0x212224=_0xf8fb51[_0x13cb7c(0xbe)],_0x4ee6f2=undefined;}}}}const _0x45ec0a=await listDatasets(_0x2acb5a[_0x13cb7c(0xd7)]),_0x2f3d17=_0x45ec0a[_0x13cb7c(0x11a)](_0x544316=>_0x544316[_0x13cb7c(0xbe)]===_0x212224);if(!_0x2f3d17)throw CliErrors['validation'](_0x13cb7c(0xbc)+_0x212224+_0x13cb7c(0x11d)+(_0x4ee6f2?_0x13cb7c(0x102)+CLI_BIN_NAME+_0x13cb7c(0xf4):''));_0x3d826a=_0x2f3d17['id'];const _0x3b7e19=_0x4ee6f2??_0x212224,_0x51481c=await listBffDatasetOperations(_0x2acb5a[_0x13cb7c(0xd7)],_0x3d826a),_0xf46202=_0x51481c?Object[_0x13cb7c(0xc5)](_0x51481c):[];if(_0xf46202[_0x13cb7c(0xff)]===0x0)throw CliErrors[_0x13cb7c(0xbd)]('No\x20operation\x20types\x20found\x20for\x20dataset\x20'+_0x3b7e19+'.');let _0x15b694;const _0x4fd68b=_0x2acb5a[_0x13cb7c(0xf7)](_0x13cb7c(0xe0));if(_0x4fd68b){if(!_0xf46202['includes'](_0x4fd68b))throw CliErrors['validation'](_0x13cb7c(0xfd)+_0x4fd68b+_0x13cb7c(0x111)+_0x3b7e19+'.\x20'+(_0x13cb7c(0xee)+_0xf46202[_0x13cb7c(0xe5)](',\x20')));_0x15b694=_0x4fd68b;}else{if(_0x2acb5a[_0x13cb7c(0x112)])throw CliErrors[_0x13cb7c(0xbd)](_0x13cb7c(0xf8));const _0x4c358e=await promptSelect(_0x13cb7c(0x101),_0xf46202);_0x15b694=_0xf46202[_0x4c358e]??_0xf46202[0x0];}let _0x143e0f=normalizeHookFunctionNode(_0x2acb5a[_0x13cb7c(0xf7)](_0x13cb7c(0xef)));if(!_0x143e0f){if(_0x2acb5a[_0x13cb7c(0xf7)](_0x13cb7c(0xef)))throw CliErrors['validation'](_0x13cb7c(0xe8));if(_0x2acb5a['nonInteractive'])throw CliErrors[_0x13cb7c(0xbd)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x5eb525=await promptSelect(_0x13cb7c(0xc7),[_0x13cb7c(0xcd),_0x13cb7c(0xdf)]);_0x143e0f=[_0x13cb7c(0xcd),_0x13cb7c(0xdf)][_0x5eb525]??_0x13cb7c(0xcd);}return{'alias':_0x4ee6f2,'datasetCode':_0x212224,'datasetId':_0x3d826a,'operationType':_0x15b694,'functionNode':_0x143e0f};}async function promptSelect(_0x35c02f,_0x3cdccc){const _0x124e8a=a37_0x22f5af;if(_0x3cdccc[_0x124e8a(0xff)]===0x1)return 0x0;for(const [_0x3d7fb3,_0x245441]of _0x3cdccc[_0x124e8a(0xea)]()){process[_0x124e8a(0xc4)][_0x124e8a(0xde)]('\x20\x20'+(_0x3d7fb3+0x1)+'.\x20'+_0x245441+'\x0a');}const _0x439ee3=createInterface({'input':process[_0x124e8a(0xfa)],'output':process['stderr']});while(!![]){const _0x668fca=await new Promise(_0x15e795=>{const _0x52c411=_0x124e8a;_0x439ee3[_0x52c411(0xc3)](_0x35c02f+'\x20',_0x15e795);}),_0x3c1746=Number[_0x124e8a(0xf2)](_0x668fca[_0x124e8a(0x115)](),0xa);if(Number[_0x124e8a(0x126)](_0x3c1746)&&_0x3c1746>=0x1&&_0x3c1746<=_0x3cdccc['length'])return _0x439ee3[_0x124e8a(0xf6)](),_0x3c1746-0x1;process[_0x124e8a(0xc4)][_0x124e8a(0xde)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x3cdccc[_0x124e8a(0xff)]+'.\x0a');}}function buildFilePath(_0x171aa4,_0x406bc5,_0x5d0f3a,_0x3d74a2){const _0x2717a7=a37_0x22f5af;if(_0x406bc5===_0x2717a7(0x124)){if(!_0x3d74a2)throw CliErrors[_0x2717a7(0xbd)](_0x2717a7(0x10d));const _0x4ba36e=_0x3d74a2['alias']??_0x3d74a2[_0x2717a7(0x10a)];return join(_0x171aa4[_0x2717a7(0x122)],'HOOK',_0x4ba36e,_0x3d74a2['operationType'],_0x3d74a2['functionNode'],_0x5d0f3a+_0x2717a7(0xfb));}return join(_0x171aa4['scriptsRootDir'],_0x406bc5,_0x5d0f3a+_0x2717a7(0xfb));}export function generateTemplate(_0x2deb90,_0x120847,_0x6638d,_0x5a1769,_0x3d5636){const _0x252895=a37_0x22f5af,_0x33f1a8=_0x5a1769?.[_0x252895(0x115)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x437791=getAppBaseUrl(_0x6638d),_0x590f2b=_0x252895(0x100);if(_0x2deb90===_0x252895(0xe3))return _0x252895(0xc2)+_0x33f1a8+_0x252895(0x107)+_0x120847+_0x252895(0xcb)+_0x437791+_0x252895(0xe9)+_0x6638d+_0x252895(0x104)+_0x120847+_0x252895(0x118)+_0x120847+_0x252895(0x106)+_0x590f2b+_0x252895(0xed)+_0x120847+_0x252895(0x119);if(_0x2deb90===_0x252895(0xf1))return _0x252895(0xc2)+_0x33f1a8+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20'+_0x120847+_0x252895(0x113)+_0x6638d+'/'+_0x120847+'\x0a\x20*\x20[平台配置]\x20'+_0x437791+_0x252895(0xe9)+_0x6638d+'/ENDPOINT/'+_0x120847+_0x252895(0xd1)+_0x590f2b+_0x252895(0xfe)+_0x120847+_0x252895(0x119);if(!_0x3d5636)throw CliErrors['validation'](_0x252895(0xd2));const _0x168c21=_0x3d5636[_0x252895(0xd4)]??_0x3d5636[_0x252895(0x10a)],_0x11205e=_0x3d5636[_0x252895(0xc6)]===_0x252895(0xcd)?_0x252895(0xd6):'当前响应结果',_0xf79fd5=_0x3d5636[_0x252895(0xc6)]===_0x252895(0xcd)?_0x252895(0x11f):_0x252895(0xd0);return _0x252895(0xc2)+_0x33f1a8+_0x252895(0x120)+_0x120847+'\x0a\x20*\x20[接口路径]\x20POST\x20/api/'+_0x6638d+'/'+_0x3d5636[_0x252895(0x10a)]+'/'+_0x3d5636[_0x252895(0x11b)]+'\x0a\x20*\x20[平台配置]\x20'+_0x437791+'/data/dataset/'+_0x3d5636['datasetId']+_0x252895(0x116)+_0x6638d+'/HOOK/'+_0x168c21+'/'+_0x3d5636[_0x252895(0x11b)]+'/'+_0x3d5636[_0x252895(0xc6)]+'/'+_0x120847+'.js\x0a\x20*\x20[触发节点]\x20'+_0x3d5636['functionNode']+'\x0a'+_0x590f2b+_0x252895(0xdb)+_0x11205e+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0xf79fd5+_0x252895(0xe4)+_0x120847+_0x252895(0x119);}
1
+ const a37_0x15ca3c=a37_0x3926;(function(_0x4cab90,_0x4904e8){const _0x1462c1=a37_0x3926,_0x45138f=_0x4cab90();while(!![]){try{const _0x3370cb=parseInt(_0x1462c1(0x140))/0x1+-parseInt(_0x1462c1(0x125))/0x2*(-parseInt(_0x1462c1(0x16b))/0x3)+parseInt(_0x1462c1(0x129))/0x4*(parseInt(_0x1462c1(0x16d))/0x5)+-parseInt(_0x1462c1(0x12e))/0x6*(parseInt(_0x1462c1(0x15f))/0x7)+parseInt(_0x1462c1(0x149))/0x8+-parseInt(_0x1462c1(0x13f))/0x9*(parseInt(_0x1462c1(0x14b))/0xa)+-parseInt(_0x1462c1(0x141))/0xb;if(_0x3370cb===_0x4904e8)break;else _0x45138f['push'](_0x45138f['shift']());}catch(_0x344ecc){_0x45138f['push'](_0x45138f['shift']());}}}(a37_0x3449,0x3eb3f));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_0x3926(_0x563e3c,_0x2085ec){_0x563e3c=_0x563e3c-0x124;const _0x34491d=a37_0x3449();let _0x3926c6=_0x34491d[_0x563e3c];return _0x3926c6;}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';function a37_0x3449(){const _0xc572b6=['The\x20generated\x20model\x20facts\x20may\x20be\x20stale\x20—\x20run\x20`','str','.js','function-node','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','length','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20','operation-type','\x0a\x20*\x20[平台配置]\x20','datasetId','/**\x0a\x20*\x20','修改后的请求参数','name','appCode','mergedCli','UNKNOWN','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Operation\x20type\x20\x22','966fSxRCq','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','Select\x20dataset:','No\x20model\x20aliases\x20found.\x20Run\x20`','Invalid\x20dataset\x20selection.','\x20api\x20pull`\x20to\x20refresh.','Available\x20aliases:\x20','alias','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','stderr','keys','1149QDrman','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','5WIvPHT','/ENDPOINT/','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','after','profileName','bff','Script\x20description','Created\x20','Available:\x20','selectedAppName','functionNode','\x22.\x20','stdin','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','apiDir','当前响应结果','datasetCode','\x20function:\x20','includes','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','write','Alias\x20\x22','map','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','defaultApp','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','/data/dataset/','currentApp','close','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','description','No\x20datasets\x20found\x20for\x20this\x20app.','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','operationType','find','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','Trigger\x20node\x20(HOOK\x20only)','Invalid\x20function\x20name\x20\x22','\x22\x20not\x20found\x20for\x20dataset\x20','1708NIejJQ','join','question','HOOK','1312788lIGQxK','filePath','utf8','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','/HOOK/','7746zKLFlN','type','parseInt','string','Operation\x20type\x20(HOOK\x20only)','nonInteractive','Select\x20operation\x20type:','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','File\x20already\x20exists:\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20请求参数\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20TODO:\x20补充返回数据结构\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','.js\x0a\x20*\x20[触发节点]\x20','source','validation','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','1098yieEYT','459486sHTESN','8883226JHbqEJ','No\x20operation\x20types\x20found\x20for\x20dataset\x20','COMMON','before','HOOK\x20requires\x20alias/operation/node\x20options.','修改后的响应结果','code','tableName','3532592tpBqTQ','\x22,\x20params\x20})\x0a','25720YWkuHW','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'];a37_0x3449=function(){return _0xc572b6;};return a37_0x3449();}export const bffCreate={'service':a37_0x15ca3c(0x172),'command':'create','description':a37_0x15ca3c(0x13e),'risk':'read','flags':[{'name':a37_0x15ca3c(0x12f),'type':'string','required':!![],'enum':['COMMON','ENDPOINT','HOOK'],'description':'Script\x20type'},{'name':a37_0x15ca3c(0x159),'type':'string','required':!![],'description':'Function\x20name\x20(valid\x20JS\x20identifier)'},{'name':a37_0x15ca3c(0x18b),'type':'string','description':a37_0x15ca3c(0x173)},{'name':'alias','type':'string','description':a37_0x15ca3c(0x137)},{'name':'datasetcode','type':a37_0x15ca3c(0x131),'description':a37_0x15ca3c(0x190)},{'name':a37_0x15ca3c(0x154),'type':'string','description':a37_0x15ca3c(0x132)},{'name':a37_0x15ca3c(0x150),'type':a37_0x15ca3c(0x131),'description':a37_0x15ca3c(0x192),'enum':[a37_0x15ca3c(0x144),a37_0x15ca3c(0x170)]}],async 'validate'(_0x13bb7e){const _0x40c8e3=a37_0x15ca3c,_0x130687=_0x13bb7e[_0x40c8e3(0x14e)](_0x40c8e3(0x159));if(!isValidBffFunctionName(_0x130687))throw CliErrors[_0x40c8e3(0x13d)](_0x40c8e3(0x193)+_0x130687+_0x40c8e3(0x186));},async 'execute'(_0x54f3b0){const _0x290424=a37_0x15ca3c,_0x4016c9=loadBffProjectConfig(_0x54f3b0[_0x290424(0x15a)]),_0x3fed4b=_0x54f3b0[_0x290424(0x14e)](_0x290424(0x12f)),_0x1f3470=_0x54f3b0[_0x290424(0x14e)](_0x290424(0x159)),_0x5384d9=_0x54f3b0['str']('description')||undefined,_0x1f63e7=_0x3fed4b===_0x290424(0x128)?await resolveHookOptions(_0x4016c9,_0x54f3b0):undefined,_0x53d5dc=buildFilePath(_0x4016c9,_0x3fed4b,_0x1f3470,_0x1f63e7);if(await fileExists(_0x53d5dc))throw CliErrors['validation'](_0x290424(0x136)+_0x53d5dc);await mkdir(dirname(_0x53d5dc),{'recursive':!![]});const _0x1a879e=generateTemplate(_0x3fed4b,_0x1f3470,_0x54f3b0[_0x290424(0x15a)],_0x5384d9,_0x1f63e7);await writeFile(_0x53d5dc,_0x1a879e,_0x290424(0x12b));const _0x3d996a={'type':_0x3fed4b,'name':_0x1f3470,'path':_0x53d5dc};if(_0x5384d9)_0x3d996a[_0x290424(0x18b)]=_0x5384d9;if(_0x1f63e7){if(_0x1f63e7[_0x290424(0x167)])_0x3d996a['alias']=_0x1f63e7[_0x290424(0x167)];_0x3d996a['datasetCode']=_0x1f63e7[_0x290424(0x17d)],_0x3d996a[_0x290424(0x18e)]=_0x1f63e7[_0x290424(0x18e)],_0x3d996a['functionNode']=_0x1f63e7['functionNode'];}return{'ok':!![],'data':_0x3d996a,'message':_0x290424(0x174)+_0x3fed4b+_0x290424(0x17e)+_0x1f3470};}};async function resolveHookOptions(_0x336ca8,_0x2c1631){const _0x58320c=a37_0x15ca3c,_0x42ee99=resolveApiModelSource(_0x2c1631[_0x58320c(0x17b)],_0x2c1631[_0x58320c(0x15a)],_0x2c1631[_0x58320c(0x176)]||_0x2c1631[_0x58320c(0x15b)]?.[_0x58320c(0x188)]||_0x2c1631['mergedCli']?.[_0x58320c(0x185)]),_0x2f306a=loadAliasMap(_0x2c1631[_0x58320c(0x17b)],undefined,_0x42ee99[_0x58320c(0x12a)],_0x42ee99[_0x58320c(0x171)]),_0x33d8e7=_0x2f306a[_0x58320c(0x152)]>0x0;let _0x166e0d,_0x197d0f,_0x7b1093;const _0x1cc175=_0x2c1631[_0x58320c(0x14e)](_0x58320c(0x167)),_0x19c5c9=_0x2c1631[_0x58320c(0x14e)]('datasetcode');if(_0x1cc175){const _0x25fe51=resolveAlias(_0x2c1631[_0x58320c(0x17b)],_0x1cc175,undefined,_0x42ee99[_0x58320c(0x12a)],_0x42ee99[_0x58320c(0x171)]);if(!_0x25fe51){const _0x7049b6=_0x33d8e7?_0x58320c(0x166)+_0x2f306a[_0x58320c(0x183)](_0x307ee5=>_0x307ee5[_0x58320c(0x167)])[_0x58320c(0x126)](',\x20'):_0x58320c(0x163)+CLI_BIN_NAME+_0x58320c(0x12c);throw CliErrors[_0x58320c(0x13d)](_0x58320c(0x182)+_0x1cc175+'\x22\x20not\x20found.\x20'+_0x7049b6);}_0x166e0d=_0x1cc175,_0x197d0f=_0x25fe51;}else{if(_0x19c5c9){_0x197d0f=_0x19c5c9;const _0x5bb408=_0x2f306a[_0x58320c(0x18f)](_0x9227bc=>_0x9227bc['datasetCode']===_0x19c5c9);_0x166e0d=_0x5bb408?.[_0x58320c(0x167)];}else{if(_0x2c1631[_0x58320c(0x133)])throw CliErrors[_0x58320c(0x13d)](_0x58320c(0x15d));else{if(_0x33d8e7){const _0x2f4f46=_0x2f306a['map'](_0xcfcec9=>_0xcfcec9[_0x58320c(0x167)]+'\x20('+_0xcfcec9[_0x58320c(0x148)]+')'),_0x20c49f=await promptSelect(_0x58320c(0x162),_0x2f4f46),_0x116e23=_0x2f306a[_0x20c49f];if(!_0x116e23)throw CliErrors['validation'](_0x58320c(0x164));_0x166e0d=_0x116e23['alias'],_0x197d0f=_0x116e23[_0x58320c(0x17d)];}else{const _0x22baf9=await listDatasets(_0x2c1631[_0x58320c(0x15a)]);if(_0x22baf9[_0x58320c(0x152)]===0x0)throw CliErrors[_0x58320c(0x13d)](_0x58320c(0x18c));const _0x417e0f=_0x22baf9[_0x58320c(0x183)](_0x14049c=>_0x14049c[_0x58320c(0x159)]+'\x20['+(_0x14049c[_0x58320c(0x13c)]??_0x58320c(0x15c))+']\x20('+_0x14049c['code']+')'),_0x26eff=await promptSelect(_0x58320c(0x162),_0x417e0f),_0x2ca2b2=_0x22baf9[_0x26eff];if(!_0x2ca2b2)throw CliErrors[_0x58320c(0x13d)](_0x58320c(0x164));_0x197d0f=_0x2ca2b2[_0x58320c(0x147)],_0x166e0d=undefined;}}}}const _0x59cb01=await listDatasets(_0x2c1631[_0x58320c(0x15a)]),_0x4bbaef=_0x59cb01[_0x58320c(0x18f)](_0x41a037=>_0x41a037[_0x58320c(0x147)]===_0x197d0f);if(!_0x4bbaef)throw CliErrors[_0x58320c(0x13d)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x197d0f+_0x58320c(0x178)+(_0x166e0d?_0x58320c(0x14d)+CLI_BIN_NAME+_0x58320c(0x165):''));_0x7b1093=_0x4bbaef['id'];const _0x4b4f06=_0x166e0d??_0x197d0f,_0x240f34=await listBffDatasetOperations(_0x2c1631['appCode'],_0x7b1093),_0x194dbc=_0x240f34?Object[_0x58320c(0x16a)](_0x240f34):[];if(_0x194dbc[_0x58320c(0x152)]===0x0)throw CliErrors['validation'](_0x58320c(0x142)+_0x4b4f06+'.');let _0x56a4f5;const _0x2dda50=_0x2c1631[_0x58320c(0x14e)](_0x58320c(0x154));if(_0x2dda50){if(!_0x194dbc[_0x58320c(0x17f)](_0x2dda50))throw CliErrors[_0x58320c(0x13d)](_0x58320c(0x15e)+_0x2dda50+_0x58320c(0x124)+_0x4b4f06+'.\x20'+(_0x58320c(0x175)+_0x194dbc[_0x58320c(0x126)](',\x20')));_0x56a4f5=_0x2dda50;}else{if(_0x2c1631[_0x58320c(0x133)])throw CliErrors[_0x58320c(0x13d)](_0x58320c(0x161));const _0x17d752=await promptSelect(_0x58320c(0x134),_0x194dbc);_0x56a4f5=_0x194dbc[_0x17d752]??_0x194dbc[0x0];}let _0x482a91=normalizeHookFunctionNode(_0x2c1631[_0x58320c(0x14e)](_0x58320c(0x150)));if(!_0x482a91){if(_0x2c1631[_0x58320c(0x14e)](_0x58320c(0x150)))throw CliErrors[_0x58320c(0x13d)]('--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.');if(_0x2c1631[_0x58320c(0x133)])throw CliErrors[_0x58320c(0x13d)](_0x58320c(0x160));const _0x1fc618=await promptSelect('Select\x20trigger\x20node:',[_0x58320c(0x144),_0x58320c(0x170)]);_0x482a91=[_0x58320c(0x144),_0x58320c(0x170)][_0x1fc618]??_0x58320c(0x144);}return{'alias':_0x166e0d,'datasetCode':_0x197d0f,'datasetId':_0x7b1093,'operationType':_0x56a4f5,'functionNode':_0x482a91};}async function promptSelect(_0x5b43d7,_0x25f293){const _0x122bab=a37_0x15ca3c;if(_0x25f293[_0x122bab(0x152)]===0x1)return 0x0;for(const [_0x5bf726,_0xdff51f]of _0x25f293['entries']()){process[_0x122bab(0x169)][_0x122bab(0x181)]('\x20\x20'+(_0x5bf726+0x1)+'.\x20'+_0xdff51f+'\x0a');}const _0x537669=createInterface({'input':process[_0x122bab(0x179)],'output':process[_0x122bab(0x169)]});while(!![]){const _0x2397d6=await new Promise(_0x10e5b7=>{const _0x3de219=_0x122bab;_0x537669[_0x3de219(0x127)](_0x5b43d7+'\x20',_0x10e5b7);}),_0x41d090=Number[_0x122bab(0x130)](_0x2397d6['trim'](),0xa);if(Number['isInteger'](_0x41d090)&&_0x41d090>=0x1&&_0x41d090<=_0x25f293[_0x122bab(0x152)])return _0x537669[_0x122bab(0x189)](),_0x41d090-0x1;process[_0x122bab(0x169)][_0x122bab(0x181)](_0x122bab(0x16c)+_0x25f293[_0x122bab(0x152)]+'.\x0a');}}function buildFilePath(_0x323740,_0x3b7e98,_0x12d7e8,_0xe3d581){const _0x19fa5f=a37_0x15ca3c;if(_0x3b7e98===_0x19fa5f(0x128)){if(!_0xe3d581)throw CliErrors[_0x19fa5f(0x13d)](_0x19fa5f(0x145));const _0x22662d=_0xe3d581[_0x19fa5f(0x167)]??_0xe3d581[_0x19fa5f(0x17d)];return join(_0x323740['scriptsRootDir'],'HOOK',_0x22662d,_0xe3d581[_0x19fa5f(0x18e)],_0xe3d581['functionNode'],_0x12d7e8+'.js');}return join(_0x323740['scriptsRootDir'],_0x3b7e98,_0x12d7e8+_0x19fa5f(0x14f));}export function generateTemplate(_0x596781,_0x198233,_0x5d8ad7,_0x55d2ed,_0x1bf064){const _0x79960b=a37_0x15ca3c,_0x369aea=_0x55d2ed?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x178bf8=getAppBaseUrl(_0x5d8ad7),_0x2f1565=_0x79960b(0x17a);if(_0x596781===_0x79960b(0x143))return _0x79960b(0x157)+_0x369aea+_0x79960b(0x138)+_0x198233+_0x79960b(0x155)+_0x178bf8+_0x79960b(0x14c)+_0x5d8ad7+'/COMMON/'+_0x198233+_0x79960b(0x18d)+_0x198233+_0x79960b(0x14a)+_0x2f1565+_0x79960b(0x139)+_0x198233+_0x79960b(0x151);if(_0x596781==='ENDPOINT')return _0x79960b(0x157)+_0x369aea+_0x79960b(0x13a)+_0x198233+_0x79960b(0x191)+_0x5d8ad7+'/'+_0x198233+'\x0a\x20*\x20[平台配置]\x20'+_0x178bf8+_0x79960b(0x14c)+_0x5d8ad7+_0x79960b(0x16e)+_0x198233+'.js\x0a'+_0x2f1565+'\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'+_0x198233+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(!_0x1bf064)throw CliErrors[_0x79960b(0x13d)](_0x79960b(0x180));const _0x22801b=_0x1bf064[_0x79960b(0x167)]??_0x1bf064[_0x79960b(0x17d)],_0x1a77c9=_0x1bf064[_0x79960b(0x177)]===_0x79960b(0x144)?'当前请求参数':_0x79960b(0x17c),_0x935d6d=_0x1bf064['functionNode']===_0x79960b(0x144)?_0x79960b(0x158):_0x79960b(0x146);return _0x79960b(0x157)+_0x369aea+_0x79960b(0x135)+_0x198233+_0x79960b(0x18a)+_0x5d8ad7+'/'+_0x1bf064[_0x79960b(0x17d)]+'/'+_0x1bf064['operationType']+_0x79960b(0x155)+_0x178bf8+_0x79960b(0x187)+_0x1bf064[_0x79960b(0x156)]+_0x79960b(0x168)+_0x5d8ad7+_0x79960b(0x12d)+_0x22801b+'/'+_0x1bf064[_0x79960b(0x18e)]+'/'+_0x1bf064[_0x79960b(0x177)]+'/'+_0x198233+_0x79960b(0x13b)+_0x1bf064[_0x79960b(0x177)]+'\x0a'+_0x2f1565+_0x79960b(0x184)+_0x1a77c9+_0x79960b(0x153)+_0x935d6d+_0x79960b(0x16f)+_0x198233+_0x79960b(0x151);}
@@ -1 +1 @@
1
- const a38_0x48f01b=a38_0x593f;(function(_0x5e0ed6,_0x1e97bb){const _0x5df9da=a38_0x593f,_0x2ef6e2=_0x5e0ed6();while(!![]){try{const _0x4536e1=parseInt(_0x5df9da(0x1f6))/0x1*(-parseInt(_0x5df9da(0x203))/0x2)+-parseInt(_0x5df9da(0x1e6))/0x3*(parseInt(_0x5df9da(0x20f))/0x4)+-parseInt(_0x5df9da(0x1dd))/0x5*(-parseInt(_0x5df9da(0x1ee))/0x6)+parseInt(_0x5df9da(0x201))/0x7*(parseInt(_0x5df9da(0x1de))/0x8)+parseInt(_0x5df9da(0x1f8))/0x9*(parseInt(_0x5df9da(0x1db))/0xa)+parseInt(_0x5df9da(0x20d))/0xb*(-parseInt(_0x5df9da(0x204))/0xc)+-parseInt(_0x5df9da(0x209))/0xd;if(_0x4536e1===_0x1e97bb)break;else _0x2ef6e2['push'](_0x2ef6e2['shift']());}catch(_0x18461b){_0x2ef6e2['push'](_0x2ef6e2['shift']());}}}(a38_0x3386,0xb05d3));function a38_0x593f(_0x56718d,_0x126c44){_0x56718d=_0x56718d-0x1db;const _0x338613=a38_0x3386();let _0x593fcb=_0x338613[_0x56718d];return _0x593fcb;}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_0x48f01b(0x1ec),'command':'delete','description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a38_0x48f01b(0x1f5),'flags':[{'name':a38_0x48f01b(0x20b),'type':'string','required':!![],'description':'Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'}],async 'validate'(_0x21648e){const _0x5201d5=a38_0x48f01b,_0x1fb3c5=loadBffProjectConfig(_0x21648e[_0x5201d5(0x1f1)]),_0x5ab0ed=await readBffLockFile(_0x1fb3c5[_0x5201d5(0x210)]);if(!_0x5ab0ed)throw CliErrors[_0x5201d5(0x205)]('Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.');},async 'dryRun'(_0x7bf862){const _0x3d41e3=a38_0x48f01b,_0x370220=loadBffProjectConfig(_0x7bf862[_0x3d41e3(0x1f1)]),_0x572d89=await readBffLockFile(_0x370220[_0x3d41e3(0x210)]);if(!_0x572d89)throw CliErrors['validation'](_0x3d41e3(0x1e0));const {appLock:_0xbc5285}=ensureLockScope(_0x572d89,_0x7bf862[_0x3d41e3(0x1f1)],_0x370220[_0x3d41e3(0x1e2)],_0x3d41e3(0x1ed)),_0x4527d8=_0x7bf862[_0x3d41e3(0x1e3)](_0x3d41e3(0x20b)),_0x1c6037=Object[_0x3d41e3(0x202)](_0xbc5285[_0x3d41e3(0x206)]),_0x3674bf=resolveDeleteTarget(_0x4527d8,_0x1c6037),_0x2faa31=_0xbc5285[_0x3d41e3(0x206)][_0x3674bf];if(!_0x2faa31)throw CliErrors[_0x3d41e3(0x205)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x3674bf+'\x22.');const _0xedcdb5=resolveLocalFilePathFromLockKey(_0x370220,_0x3674bf),_0x46a049=relative(_0x370220[_0x3d41e3(0x207)],_0xedcdb5),_0x35b6e0=join(_0x370220[_0x3d41e3(0x1df)],_0x3d41e3(0x1e1),_0x46a049);return{'method':_0x3d41e3(0x208),'url':_0x3d41e3(0x1f7),'body':{'appCode':_0x7bf862['appCode'],'target':_0x3674bf,'remoteId':_0x2faa31[_0x3d41e3(0x1f0)],'localFilePath':_0xedcdb5,'trashedPath':_0x35b6e0},'description':'Would\x20delete\x20'+_0x3674bf+_0x3d41e3(0x200)};},async 'execute'(_0x39a685){const _0x5c3d6b=a38_0x48f01b,_0x48d7aa=loadBffProjectConfig(_0x39a685[_0x5c3d6b(0x1f1)]),_0x4d8c90=await readBffLockFile(_0x48d7aa[_0x5c3d6b(0x210)]);if(!_0x4d8c90)throw CliErrors[_0x5c3d6b(0x205)](_0x5c3d6b(0x1e0));const {lockData:_0x48ff0d,appLock:_0x186679}=ensureLockScope(_0x4d8c90,_0x39a685[_0x5c3d6b(0x1f1)],_0x48d7aa[_0x5c3d6b(0x1e2)],_0x5c3d6b(0x1ed)),_0x298406=JSON[_0x5c3d6b(0x1dc)](JSON[_0x5c3d6b(0x1fc)](_0x48ff0d)),_0x4beb11=_0x298406[_0x5c3d6b(0x1fa)][_0x39a685[_0x5c3d6b(0x1f1)]];if(!_0x4beb11)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x39a685['appCode']+_0x5c3d6b(0x20e));const _0x3361ce=_0x39a685['str']('target'),_0x2a57a4=Object[_0x5c3d6b(0x202)](_0x4beb11[_0x5c3d6b(0x206)]),_0xd93060=resolveDeleteTarget(_0x3361ce,_0x2a57a4),_0x2ef867=_0x4beb11[_0x5c3d6b(0x206)][_0xd93060];if(!_0x2ef867)throw CliErrors[_0x5c3d6b(0x205)](_0x5c3d6b(0x1fe)+_0xd93060+'\x22.');await deleteBffScript(_0x2ef867[_0x5c3d6b(0x1f0)]),delete _0x4beb11[_0x5c3d6b(0x206)][_0xd93060],_0x4beb11[_0x5c3d6b(0x1ff)]=new Date()[_0x5c3d6b(0x20a)](),await writeBffLockFile(_0x48d7aa[_0x5c3d6b(0x210)],_0x298406);const _0x59626b=resolveLocalFilePathFromLockKey(_0x48d7aa,_0xd93060);let _0x99e147;await fileExists(_0x59626b)&&(_0x99e147=await moveToTrash(_0x48d7aa[_0x5c3d6b(0x207)],_0x48d7aa['trashDir'],_0x59626b),await cleanupEmptyDirectories(dirname(_0x59626b),_0x48d7aa[_0x5c3d6b(0x1ef)]));await waitForDeleteSettlement(_0x48d7aa['lockFilePath'],_0x39a685[_0x5c3d6b(0x1f1)],_0xd93060,_0x59626b),await sleep(0x96);const _0x556cad={'deleted':_0xd93060,'remoteId':_0x2ef867[_0x5c3d6b(0x1f0)]};if(_0x99e147)_0x556cad[_0x5c3d6b(0x1e8)]=_0x99e147;return{'ok':!![],'data':_0x556cad,'message':_0x5c3d6b(0x1e7)+_0xd93060+(_0x99e147?_0x5c3d6b(0x1e4):'')};}};function resolveDeleteTarget(_0x35937c,_0x30684b){const _0x17a5e3=a38_0x48f01b;if(_0x35937c[_0x17a5e3(0x1fb)]('/')){const _0x238440=_0x30684b[_0x17a5e3(0x1f9)](_0x31c365=>_0x31c365===_0x35937c);if(!_0x238440)throw CliErrors[_0x17a5e3(0x205)](_0x17a5e3(0x1fd)+_0x35937c);return _0x238440;}const _0x5469ef=_0x30684b[_0x17a5e3(0x20c)](_0x2da490=>_0x2da490[_0x17a5e3(0x1e9)]('/')['at'](-0x1)===_0x35937c);if(_0x5469ef[_0x17a5e3(0x1e5)]===0x0)throw CliErrors[_0x17a5e3(0x205)](_0x17a5e3(0x1fd)+_0x35937c);if(_0x5469ef['length']>0x1)throw CliErrors[_0x17a5e3(0x205)](_0x17a5e3(0x1eb)+_0x35937c+_0x17a5e3(0x1f4)+_0x5469ef['map'](_0x35950f=>_0x17a5e3(0x211)+_0x35950f)[_0x17a5e3(0x1ea)]('\x0a'));return _0x5469ef[0x0];}async function moveToTrash(_0xe68388,_0x396dbe,_0x4cfd7b){const _0x34d315=a38_0x48f01b,_0x374e20=new Date()['toISOString']()[_0x34d315(0x1f3)](/[:.]/g,'-'),_0x5809f1=relative(_0xe68388,_0x4cfd7b),_0x50032f=join(_0x396dbe,_0x374e20,_0x5809f1);return await mkdir(dirname(_0x50032f),{'recursive':!![]}),await rename(_0x4cfd7b,_0x50032f),_0x50032f;}async function cleanupEmptyDirectories(_0xd1412f,_0x56e923){const _0x1693c0=a38_0x48f01b;let _0x1b5079=resolve(_0xd1412f);const _0x2c7421=resolve(_0x56e923);while(_0x1b5079[_0x1693c0(0x212)](''+_0x2c7421+sep)||_0x1b5079===_0x2c7421){if(_0x1b5079===_0x2c7421)return;try{const _0x24e845=await readdir(_0x1b5079);if(_0x24e845['length']>0x0)return;await rmdir(_0x1b5079);}catch{return;}_0x1b5079=dirname(_0x1b5079);}}function a38_0x3386(){const _0x1acae3=['877943kHQWOk','\x22\x20not\x20found\x20after\x20ensureLockScope.','4ZOjWdE','lockFilePath','\x20\x20-\x20','startsWith','234220MKkOnx','parse','75ifDJBc','16JyzKwD','trashDir','Backend\x20Function\x20lock\x20file\x20not\x20found.','<timestamp>','scriptsRoot','str','\x20(local\x20file\x20moved\x20to\x20trash)','length','188598VgolZH','Deleted\x20','trashedTo','split','join','Multiple\x20functions\x20match\x20\x22','bff','delete','402594GpPhiK','scriptsRootDir','remoteId','appCode','Local\x20delete\x20not\x20settled\x20for\x20','replace','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','high-risk-write','267bWEXQw','/api/management/library/scripts/delete','279VAJlle','find','apps','includes','stringify','Function\x20not\x20found:\x20','No\x20lock\x20entry\x20found\x20for\x20\x22','lastSync','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','4275635IpPOtM','keys','4918WJrBWM','12xfoOVq','validation','functions','projectRoot','POST','18623254yuVToA','toISOString','target','filter'];a38_0x3386=function(){return _0x1acae3;};return a38_0x3386();}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x555683,_0x18e548,_0x3b881e,_0xd1170b){const _0x2197f7=a38_0x48f01b;for(let _0x94bb9a=0x0;_0x94bb9a<DELETE_SETTLE_RETRY_COUNT;_0x94bb9a+=0x1){const _0x266b5f=await readBffLockFile(_0x555683),_0x38702b=!!_0x266b5f?.['apps']?.[_0x18e548]?.[_0x2197f7(0x206)]?.[_0x3b881e],_0x4d2e1f=await fileExists(_0xd1170b);if(!_0x38702b&&!_0x4d2e1f)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x2197f7(0x1f2)+_0x3b881e+'.');}
1
+ const a38_0x1822f4=a38_0x5c2d;(function(_0x3906c3,_0x34927d){const _0x48a8fb=a38_0x5c2d,_0x45a0ce=_0x3906c3();while(!![]){try{const _0x2c8b29=-parseInt(_0x48a8fb(0x100))/0x1+parseInt(_0x48a8fb(0xf9))/0x2+parseInt(_0x48a8fb(0xfb))/0x3*(parseInt(_0x48a8fb(0xf8))/0x4)+parseInt(_0x48a8fb(0x128))/0x5+parseInt(_0x48a8fb(0x11b))/0x6+parseInt(_0x48a8fb(0x11e))/0x7+-parseInt(_0x48a8fb(0x111))/0x8*(parseInt(_0x48a8fb(0x109))/0x9);if(_0x2c8b29===_0x34927d)break;else _0x45a0ce['push'](_0x45a0ce['shift']());}catch(_0x32774d){_0x45a0ce['push'](_0x45a0ce['shift']());}}}(a38_0x3571,0x387e3));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a38_0x5c2d(_0x4c0681,_0x40a763){_0x4c0681=_0x4c0681-0xf7;const _0x35712e=a38_0x3571();let _0x5c2d10=_0x35712e[_0x4c0681];return _0x5c2d10;}import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';function a38_0x3571(){const _0xb59073=['126371OsXuCq','parse','\x22\x20not\x20found\x20after\x20ensureLockScope.','filter','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','bff','\x20(local\x20file\x20moved\x20to\x20trash)','high-risk-write','scriptsRootDir','functions','1686450vQQUgO','/api/management/library/scripts/delete','Lock\x20scope\x20for\x20app\x20\x22','17800wcijpq','254290KoYvXb','validation','9sVNfLZ','toISOString','length','trashDir','remoteId','222329vYXBMA','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x20\x20-\x20','Multiple\x20functions\x20match\x20\x22','appCode','find','map','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','join','279DQNgcL','keys','No\x20lock\x20entry\x20found\x20for\x20\x22','Local\x20delete\x20not\x20settled\x20for\x20','scriptsRoot','lastSync','Function\x20not\x20found:\x20','Would\x20delete\x20','120448RHEeFJ','apps','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','str','lockFilePath','target','projectRoot','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','delete','replace','2547732apZKCF','startsWith','includes'];a38_0x3571=function(){return _0xb59073;};return a38_0x3571();}import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a38_0x1822f4(0x123),'command':a38_0x1822f4(0x119),'description':a38_0x1822f4(0x118),'risk':a38_0x1822f4(0x125),'flags':[{'name':a38_0x1822f4(0x116),'type':'string','required':!![],'description':a38_0x1822f4(0x122)}],async 'validate'(_0x1ff08c){const _0x2bd4db=a38_0x1822f4,_0x389f1d=loadBffProjectConfig(_0x1ff08c[_0x2bd4db(0x104)]),_0x8681ee=await readBffLockFile(_0x389f1d[_0x2bd4db(0x115)]);if(!_0x8681ee)throw CliErrors[_0x2bd4db(0xfa)](_0x2bd4db(0x107));},async 'dryRun'(_0x2a3b43){const _0x41ec89=a38_0x1822f4,_0x2acfa2=loadBffProjectConfig(_0x2a3b43['appCode']),_0x549dcb=await readBffLockFile(_0x2acfa2['lockFilePath']);if(!_0x549dcb)throw CliErrors[_0x41ec89(0xfa)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0x51cd5b}=ensureLockScope(_0x549dcb,_0x2a3b43[_0x41ec89(0x104)],_0x2acfa2[_0x41ec89(0x10d)],_0x41ec89(0x119)),_0x4dd9d1=_0x2a3b43[_0x41ec89(0x114)](_0x41ec89(0x116)),_0x27fb84=Object[_0x41ec89(0x10a)](_0x51cd5b[_0x41ec89(0x127)]),_0x24e6d8=resolveDeleteTarget(_0x4dd9d1,_0x27fb84),_0x4eecec=_0x51cd5b[_0x41ec89(0x127)][_0x24e6d8];if(!_0x4eecec)throw CliErrors['validation']('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x24e6d8+'\x22.');const _0x85aecf=resolveLocalFilePathFromLockKey(_0x2acfa2,_0x24e6d8),_0x5d8d3a=relative(_0x2acfa2['projectRoot'],_0x85aecf),_0x59c38a=join(_0x2acfa2['trashDir'],'<timestamp>',_0x5d8d3a);return{'method':'POST','url':_0x41ec89(0x129),'body':{'appCode':_0x2a3b43[_0x41ec89(0x104)],'target':_0x24e6d8,'remoteId':_0x4eecec[_0x41ec89(0xff)],'localFilePath':_0x85aecf,'trashedPath':_0x59c38a},'description':_0x41ec89(0x110)+_0x24e6d8+_0x41ec89(0x113)};},async 'execute'(_0x2e11aa){const _0x18510b=a38_0x1822f4,_0x54431b=loadBffProjectConfig(_0x2e11aa['appCode']),_0xc48375=await readBffLockFile(_0x54431b[_0x18510b(0x115)]);if(!_0xc48375)throw CliErrors[_0x18510b(0xfa)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {lockData:_0x383813,appLock:_0x435f31}=ensureLockScope(_0xc48375,_0x2e11aa['appCode'],_0x54431b[_0x18510b(0x10d)],_0x18510b(0x119)),_0x5eec68=JSON[_0x18510b(0x11f)](JSON['stringify'](_0x383813)),_0x1c0d8c=_0x5eec68[_0x18510b(0x112)][_0x2e11aa[_0x18510b(0x104)]];if(!_0x1c0d8c)throw new Error(_0x18510b(0xf7)+_0x2e11aa[_0x18510b(0x104)]+_0x18510b(0x120));const _0xc9fdd=_0x2e11aa[_0x18510b(0x114)](_0x18510b(0x116)),_0x18c4cb=Object['keys'](_0x1c0d8c['functions']),_0x5f2f40=resolveDeleteTarget(_0xc9fdd,_0x18c4cb),_0x35e685=_0x1c0d8c[_0x18510b(0x127)][_0x5f2f40];if(!_0x35e685)throw CliErrors[_0x18510b(0xfa)](_0x18510b(0x10b)+_0x5f2f40+'\x22.');await deleteBffScript(_0x35e685[_0x18510b(0xff)]),delete _0x1c0d8c[_0x18510b(0x127)][_0x5f2f40],_0x1c0d8c[_0x18510b(0x10e)]=new Date()['toISOString'](),await writeBffLockFile(_0x54431b[_0x18510b(0x115)],_0x5eec68);const _0x516801=resolveLocalFilePathFromLockKey(_0x54431b,_0x5f2f40);let _0x39909b;await fileExists(_0x516801)&&(_0x39909b=await moveToTrash(_0x54431b[_0x18510b(0x117)],_0x54431b[_0x18510b(0xfe)],_0x516801),await cleanupEmptyDirectories(dirname(_0x516801),_0x54431b[_0x18510b(0x126)]));await waitForDeleteSettlement(_0x54431b[_0x18510b(0x115)],_0x2e11aa[_0x18510b(0x104)],_0x5f2f40,_0x516801),await sleep(0x96);const _0x1433ff={'deleted':_0x5f2f40,'remoteId':_0x35e685[_0x18510b(0xff)]};if(_0x39909b)_0x1433ff['trashedTo']=_0x39909b;return{'ok':!![],'data':_0x1433ff,'message':'Deleted\x20'+_0x5f2f40+(_0x39909b?_0x18510b(0x124):'')};}};function resolveDeleteTarget(_0x194e81,_0x19ced8){const _0x1a6304=a38_0x1822f4;if(_0x194e81[_0x1a6304(0x11d)]('/')){const _0x122300=_0x19ced8[_0x1a6304(0x105)](_0x30d2b1=>_0x30d2b1===_0x194e81);if(!_0x122300)throw CliErrors[_0x1a6304(0xfa)](_0x1a6304(0x10f)+_0x194e81);return _0x122300;}const _0x581d2e=_0x19ced8[_0x1a6304(0x121)](_0x122ce3=>_0x122ce3['split']('/')['at'](-0x1)===_0x194e81);if(_0x581d2e[_0x1a6304(0xfd)]===0x0)throw CliErrors[_0x1a6304(0xfa)]('Function\x20not\x20found:\x20'+_0x194e81);if(_0x581d2e[_0x1a6304(0xfd)]>0x1)throw CliErrors[_0x1a6304(0xfa)](_0x1a6304(0x103)+_0x194e81+_0x1a6304(0x101)+_0x581d2e[_0x1a6304(0x106)](_0xe969e5=>_0x1a6304(0x102)+_0xe969e5)[_0x1a6304(0x108)]('\x0a'));return _0x581d2e[0x0];}async function moveToTrash(_0x251cca,_0x576092,_0x298543){const _0x5edd3e=a38_0x1822f4,_0x4060a4=new Date()[_0x5edd3e(0xfc)]()[_0x5edd3e(0x11a)](/[:.]/g,'-'),_0xc6aa8b=relative(_0x251cca,_0x298543),_0xd402fc=join(_0x576092,_0x4060a4,_0xc6aa8b);return await mkdir(dirname(_0xd402fc),{'recursive':!![]}),await rename(_0x298543,_0xd402fc),_0xd402fc;}async function cleanupEmptyDirectories(_0x4c8af3,_0x1850b5){const _0x34ab89=a38_0x1822f4;let _0x38a503=resolve(_0x4c8af3);const _0x5c9dc5=resolve(_0x1850b5);while(_0x38a503[_0x34ab89(0x11c)](''+_0x5c9dc5+sep)||_0x38a503===_0x5c9dc5){if(_0x38a503===_0x5c9dc5)return;try{const _0x49b0d8=await readdir(_0x38a503);if(_0x49b0d8[_0x34ab89(0xfd)]>0x0)return;await rmdir(_0x38a503);}catch{return;}_0x38a503=dirname(_0x38a503);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x53b0b6,_0x1ce89,_0x6f5dfe,_0x4f1489){const _0x4bfede=a38_0x1822f4;for(let _0x23d38d=0x0;_0x23d38d<DELETE_SETTLE_RETRY_COUNT;_0x23d38d+=0x1){const _0x5bc801=await readBffLockFile(_0x53b0b6),_0x572a11=!!_0x5bc801?.[_0x4bfede(0x112)]?.[_0x1ce89]?.['functions']?.[_0x6f5dfe],_0x4eb8b2=await fileExists(_0x4f1489);if(!_0x572a11&&!_0x4eb8b2)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x4bfede(0x10c)+_0x6f5dfe+'.');}
@@ -1 +1 @@
1
- const a39_0x2c10a9=a39_0xdde4;function a39_0xdde4(_0x2f42e1,_0x3c2269){_0x2f42e1=_0x2f42e1-0x10d;const _0x5b0455=a39_0x5b04();let _0xdde4b5=_0x5b0455[_0x2f42e1];return _0xdde4b5;}(function(_0x451a38,_0x3de32e){const _0x3c81a1=a39_0xdde4,_0x5a1ba1=_0x451a38();while(!![]){try{const _0x92f7c3=parseInt(_0x3c81a1(0x10d))/0x1+-parseInt(_0x3c81a1(0x117))/0x2+parseInt(_0x3c81a1(0x127))/0x3*(parseInt(_0x3c81a1(0x122))/0x4)+-parseInt(_0x3c81a1(0x115))/0x5*(parseInt(_0x3c81a1(0x118))/0x6)+-parseInt(_0x3c81a1(0x11d))/0x7*(-parseInt(_0x3c81a1(0x119))/0x8)+parseInt(_0x3c81a1(0x110))/0x9+parseInt(_0x3c81a1(0x116))/0xa;if(_0x92f7c3===_0x3de32e)break;else _0x5a1ba1['push'](_0x5a1ba1['shift']());}catch(_0x1a1eb3){_0x5a1ba1['push'](_0x5a1ba1['shift']());}}}(a39_0x5b04,0x92898));import{getBffScriptInfo}from'../../core/api-client.js';function a39_0x5b04(){const _0x496573=['number','Script\x20ID','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','scriptContent','901473KXbJYI','98178KcSTpS','appCode','updateUserName','5557770AMGpcv','functionName','version','bff','verbose','218975FrRckv','2275150aXFIhj','1891040uramyc','108AmwcUM','78296xNPPpD','scriptType','boolean','num','350EzAmdt','(none)','bool','Return\x20full\x20raw\x20script\x20object','createdTime','12gBhvUz'];a39_0x5b04=function(){return _0x496573;};return a39_0x5b04();}export const bffDetail={'service':a39_0x2c10a9(0x113),'command':'detail','description':a39_0x2c10a9(0x125),'risk':'read','flags':[{'name':'id','type':a39_0x2c10a9(0x123),'required':!![],'description':a39_0x2c10a9(0x124)},{'name':a39_0x2c10a9(0x114),'type':a39_0x2c10a9(0x11b),'description':a39_0x2c10a9(0x120)}],async 'execute'(_0x27bbbb){const _0x2b3d09=a39_0x2c10a9,_0x339c8d=await getBffScriptInfo(_0x27bbbb[_0x2b3d09(0x11c)]('id')),_0x21938d=_0x27bbbb[_0x2b3d09(0x11f)](_0x2b3d09(0x114));if(_0x21938d)return{'ok':!![],'data':_0x339c8d};return{'ok':!![],'data':{'id':_0x339c8d['id'],'functionName':_0x339c8d[_0x2b3d09(0x111)]??'','version':_0x339c8d[_0x2b3d09(0x112)]??'','updateUserName':_0x339c8d[_0x2b3d09(0x10f)]??'','appCode':_0x339c8d[_0x2b3d09(0x10e)],'scriptType':_0x339c8d[_0x2b3d09(0x11a)],'description':_0x339c8d['description']||_0x2b3d09(0x11e),'createdTime':_0x339c8d[_0x2b3d09(0x121)]??'','updatedTime':_0x339c8d['updatedTime']??'','scriptContent':_0x339c8d[_0x2b3d09(0x126)]??''}};}};
1
+ const a39_0x4b53cb=a39_0x5bb0;(function(_0x1331b8,_0x4ff3a1){const _0x4ae560=a39_0x5bb0,_0x4d5f4c=_0x1331b8();while(!![]){try{const _0x3f43d9=-parseInt(_0x4ae560(0xba))/0x1+parseInt(_0x4ae560(0xc2))/0x2*(parseInt(_0x4ae560(0xb7))/0x3)+parseInt(_0x4ae560(0xb8))/0x4*(-parseInt(_0x4ae560(0xbe))/0x5)+-parseInt(_0x4ae560(0xc4))/0x6*(-parseInt(_0x4ae560(0xc0))/0x7)+parseInt(_0x4ae560(0xc7))/0x8*(parseInt(_0x4ae560(0xc9))/0x9)+parseInt(_0x4ae560(0xb4))/0xa*(-parseInt(_0x4ae560(0xbc))/0xb)+parseInt(_0x4ae560(0xc3))/0xc;if(_0x3f43d9===_0x4ff3a1)break;else _0x4d5f4c['push'](_0x4d5f4c['shift']());}catch(_0x28c644){_0x4d5f4c['push'](_0x4d5f4c['shift']());}}}(a39_0x26ae,0x93757));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a39_0x4b53cb(0xb9),'command':'detail','description':a39_0x4b53cb(0xc1),'risk':a39_0x4b53cb(0xca),'flags':[{'name':'id','type':a39_0x4b53cb(0xb6),'required':!![],'description':a39_0x4b53cb(0xbf)},{'name':'verbose','type':a39_0x4b53cb(0xbb),'description':a39_0x4b53cb(0xc8)}],async 'execute'(_0xec0e65){const _0x6ca2b=a39_0x4b53cb,_0x1a12a5=await getBffScriptInfo(_0xec0e65[_0x6ca2b(0xcd)]('id')),_0x5766c6=_0xec0e65[_0x6ca2b(0xbd)](_0x6ca2b(0xcc));if(_0x5766c6)return{'ok':!![],'data':_0x1a12a5};return{'ok':!![],'data':{'id':_0x1a12a5['id'],'functionName':_0x1a12a5['functionName']??'','version':_0x1a12a5[_0x6ca2b(0xce)]??'','updateUserName':_0x1a12a5[_0x6ca2b(0xb5)]??'','appCode':_0x1a12a5['appCode'],'scriptType':_0x1a12a5['scriptType'],'description':_0x1a12a5['description']||_0x6ca2b(0xc6),'createdTime':_0x1a12a5[_0x6ca2b(0xc5)]??'','updatedTime':_0x1a12a5[_0x6ca2b(0xcf)]??'','scriptContent':_0x1a12a5[_0x6ca2b(0xcb)]??''}};}};function a39_0x5bb0(_0x2d018b,_0x221b08){_0x2d018b=_0x2d018b-0xb4;const _0x26aece=a39_0x26ae();let _0x5bb06b=_0x26aece[_0x2d018b];return _0x5bb06b;}function a39_0x26ae(){const _0x519249=['9714qqVExG','createdTime','(none)','96wptOBd','Return\x20full\x20raw\x20script\x20object','15912KDMquR','read','scriptContent','verbose','num','version','updatedTime','30GALSFF','updateUserName','number','207150sFUyoj','1524536ziUrfL','bff','444655OdPhxF','boolean','97229veRfTC','bool','5RtXxaE','Script\x20ID','189MjWDai','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','18Mvnizd','9239016rTLHYH'];a39_0x26ae=function(){return _0x519249;};return a39_0x26ae();}
@@ -1 +1 @@
1
- (function(_0x460dfc,_0x3dc3f3){const _0x173f42=a40_0x972c,_0x593710=_0x460dfc();while(!![]){try{const _0x5ac156=parseInt(_0x173f42(0x15b))/0x1+parseInt(_0x173f42(0x15d))/0x2+parseInt(_0x173f42(0x159))/0x3+-parseInt(_0x173f42(0x157))/0x4+parseInt(_0x173f42(0x15e))/0x5*(-parseInt(_0x173f42(0x160))/0x6)+-parseInt(_0x173f42(0x15c))/0x7*(-parseInt(_0x173f42(0x15a))/0x8)+parseInt(_0x173f42(0x158))/0x9*(-parseInt(_0x173f42(0x15f))/0xa);if(_0x5ac156===_0x3dc3f3)break;else _0x593710['push'](_0x593710['shift']());}catch(_0x4d17b6){_0x593710['push'](_0x593710['shift']());}}}(a40_0xf735,0x9b7fe));function a40_0x972c(_0x4be28b,_0x21bfc4){_0x4be28b=_0x4be28b-0x157;const _0xf735b6=a40_0xf735();let _0x972c7d=_0xf735b6[_0x4be28b];return _0x972c7d;}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';function a40_0xf735(){const _0x106e98=['282wbQueo','797196yPbQPy','1078551bNtTrp','3323991ueNIDn','1603864VUHmdN','2020xwWryk','21bHAYny','892262TEpGxz','102325oLAUcG','30GJsZmx'];a40_0xf735=function(){return _0x106e98;};return a40_0xf735();}import{bffLogs}from'../../commands/bff/logs.js';export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0xe0ba84,_0xc02361){const _0x1fa260=a40_0x376f,_0x40c6a8=_0xe0ba84();while(!![]){try{const _0x195121=parseInt(_0x1fa260(0x121))/0x1*(parseInt(_0x1fa260(0x123))/0x2)+parseInt(_0x1fa260(0x120))/0x3*(parseInt(_0x1fa260(0x11c))/0x4)+-parseInt(_0x1fa260(0x122))/0x5+-parseInt(_0x1fa260(0x11d))/0x6+-parseInt(_0x1fa260(0x124))/0x7+parseInt(_0x1fa260(0x11f))/0x8+parseInt(_0x1fa260(0x11e))/0x9;if(_0x195121===_0xc02361)break;else _0x40c6a8['push'](_0x40c6a8['shift']());}catch(_0xa25c7b){_0x40c6a8['push'](_0x40c6a8['shift']());}}}(a40_0x23c7,0xf2a0d));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_0x23c7(){const _0x2e021f=['1xTVIhw','6935950MJEBUO','402994mxEQGT','8673672baGdFu','4156OAWxaS','6969540Hwmlyq','10298169Ahuids','14213280dXPrcZ','4791chdmsp'];a40_0x23c7=function(){return _0x2e021f;};return a40_0x23c7();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';import{bffLogs}from'../../commands/bff/logs.js';function a40_0x376f(_0x9bec83,_0x10504e){_0x9bec83=_0x9bec83-0x11c;const _0x23c7e1=a40_0x23c7();let _0x376f6e=_0x23c7e1[_0x9bec83];return _0x376f6e;}export const bffDefinitions=[bffList,bffDetail,bffLogs,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- const a41_0x6556dd=a41_0x318e;(function(_0x2b7afd,_0x1b3725){const _0xd4e17a=a41_0x318e,_0x1ee823=_0x2b7afd();while(!![]){try{const _0x2c4f01=parseInt(_0xd4e17a(0x81))/0x1*(parseInt(_0xd4e17a(0x77))/0x2)+parseInt(_0xd4e17a(0x7c))/0x3*(-parseInt(_0xd4e17a(0x69))/0x4)+-parseInt(_0xd4e17a(0x6b))/0x5+-parseInt(_0xd4e17a(0x70))/0x6*(parseInt(_0xd4e17a(0x7e))/0x7)+-parseInt(_0xd4e17a(0x6a))/0x8+-parseInt(_0xd4e17a(0x75))/0x9+parseInt(_0xd4e17a(0x6f))/0xa*(parseInt(_0xd4e17a(0x6d))/0xb);if(_0x2c4f01===_0x1b3725)break;else _0x1ee823['push'](_0x1ee823['shift']());}catch(_0x335276){_0x1ee823['push'](_0x1ee823['shift']());}}}(a41_0x33d6,0x5bdd3));function a41_0x318e(_0x38d01d,_0x2c381c){_0x38d01d=_0x38d01d-0x66;const _0x33d62f=a41_0x33d6();let _0x318e20=_0x33d62f[_0x38d01d];return _0x318e20;}import{listBffScripts}from'../../core/api-client.js';function a41_0x33d6(){const _0x44290b=['type','2752002AYOPpB','length','14tMQmpA','verbose','List\x20Backend\x20Function\x20scripts','appCode','Script\x20type\x20filter','30XfAkrc','(unnamed)','2485GqKihe','map','ENDPOINT','21977WndlVj','Return\x20full\x20script\x20objects','read','Filter\x20by\x20script\x20name','21188aLmEIm','3380184cpjAYF','3364770VZMqpV','bff','374XUOBTF','boolean','574890TOMKiM','4698RcydhS','string','description','str'];a41_0x33d6=function(){return _0x44290b;};return a41_0x33d6();}export const bffList={'service':a41_0x6556dd(0x6c),'command':'list','description':a41_0x6556dd(0x79),'risk':a41_0x6556dd(0x67),'flags':[{'name':a41_0x6556dd(0x74),'type':a41_0x6556dd(0x71),'description':a41_0x6556dd(0x7b),'default':'ENDPOINT','enum':[a41_0x6556dd(0x80),'COMMON']},{'name':'name','type':a41_0x6556dd(0x71),'description':a41_0x6556dd(0x68)},{'name':a41_0x6556dd(0x78),'type':a41_0x6556dd(0x6e),'description':a41_0x6556dd(0x66)}],async 'execute'(_0x47668d){const _0x551404=a41_0x6556dd,_0x3323c4=await listBffScripts(_0x47668d[_0x551404(0x7a)],_0x47668d[_0x551404(0x73)](_0x551404(0x74)),{'scriptName':_0x47668d[_0x551404(0x73)]('name')||undefined}),_0x3919b8=_0x47668d['bool']('verbose');return{'ok':!![],'data':_0x3919b8?_0x3323c4:_0x3323c4[_0x551404(0x7f)](_0x594802=>({'id':_0x594802['id'],'functionName':_0x594802['functionName']??'','description':_0x594802[_0x551404(0x72)]||_0x551404(0x7d),'scriptType':_0x594802['scriptType']})),'message':_0x3323c4[_0x551404(0x76)]===0x0?'No\x20Backend\x20Function\x20scripts\x20found.':undefined};}};
1
+ function a41_0x1fd6(){const _0x446f57=['Script\x20type\x20filter','name','scriptType','map','type','boolean','appCode','24pXfzGG','590vDUyAK','4VveltI','4202752tuZGcd','functionName','list','7LhcpEQ','No\x20Backend\x20Function\x20scripts\x20found.','347695DmUaLd','read','25867pjLqkb','508852dJpHJX','449339joSIrs','description','COMMON','List\x20Backend\x20Function\x20scripts','verbose','string','689229xqOHqF','143406nlgUUZ','str'];a41_0x1fd6=function(){return _0x446f57;};return a41_0x1fd6();}function a41_0x2402(_0x56c2b9,_0x4380e6){_0x56c2b9=_0x56c2b9-0x79;const _0x1fd674=a41_0x1fd6();let _0x240286=_0x1fd674[_0x56c2b9];return _0x240286;}const a41_0x4ae00d=a41_0x2402;(function(_0x359e83,_0x187065){const _0x86a9eb=a41_0x2402,_0x15f877=_0x359e83();while(!![]){try{const _0x4b5a3a=parseInt(_0x86a9eb(0x84))/0x1*(-parseInt(_0x86a9eb(0x7c))/0x2)+parseInt(_0x86a9eb(0x8c))/0x3+parseInt(_0x86a9eb(0x85))/0x4+parseInt(_0x86a9eb(0x82))/0x5*(-parseInt(_0x86a9eb(0x7a))/0x6)+parseInt(_0x86a9eb(0x80))/0x7*(-parseInt(_0x86a9eb(0x7d))/0x8)+parseInt(_0x86a9eb(0x8d))/0x9*(parseInt(_0x86a9eb(0x7b))/0xa)+parseInt(_0x86a9eb(0x86))/0xb;if(_0x4b5a3a===_0x187065)break;else _0x15f877['push'](_0x15f877['shift']());}catch(_0x1829c7){_0x15f877['push'](_0x15f877['shift']());}}}(a41_0x1fd6,0x75d75));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a41_0x4ae00d(0x7f),'description':a41_0x4ae00d(0x89),'risk':a41_0x4ae00d(0x83),'flags':[{'name':a41_0x4ae00d(0x93),'type':a41_0x4ae00d(0x8b),'description':a41_0x4ae00d(0x8f),'default':'ENDPOINT','enum':['ENDPOINT',a41_0x4ae00d(0x88)]},{'name':a41_0x4ae00d(0x90),'type':a41_0x4ae00d(0x8b),'description':'Filter\x20by\x20script\x20name'},{'name':a41_0x4ae00d(0x8a),'type':a41_0x4ae00d(0x94),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x34f61b){const _0x2aeffa=a41_0x4ae00d,_0x464ce2=await listBffScripts(_0x34f61b[_0x2aeffa(0x79)],_0x34f61b['str']('type'),{'scriptName':_0x34f61b[_0x2aeffa(0x8e)](_0x2aeffa(0x90))||undefined}),_0xd80124=_0x34f61b['bool']('verbose');return{'ok':!![],'data':_0xd80124?_0x464ce2:_0x464ce2[_0x2aeffa(0x92)](_0x15c6ba=>({'id':_0x15c6ba['id'],'functionName':_0x15c6ba[_0x2aeffa(0x7e)]??'','description':_0x15c6ba[_0x2aeffa(0x87)]||'(unnamed)','scriptType':_0x15c6ba[_0x2aeffa(0x91)]})),'message':_0x464ce2['length']===0x0?_0x2aeffa(0x81):undefined};}};
@@ -1 +1 @@
1
- const a42_0x4938f8=a42_0x16f0;(function(_0x9ecd7c,_0x2de0e1){const _0x44f480=a42_0x16f0,_0x4aff8d=_0x9ecd7c();while(!![]){try{const _0x17fec3=parseInt(_0x44f480(0xb2))/0x1+-parseInt(_0x44f480(0xae))/0x2*(parseInt(_0x44f480(0xb9))/0x3)+parseInt(_0x44f480(0xcc))/0x4+parseInt(_0x44f480(0xc6))/0x5*(-parseInt(_0x44f480(0xc2))/0x6)+-parseInt(_0x44f480(0xb1))/0x7*(parseInt(_0x44f480(0xd7))/0x8)+parseInt(_0x44f480(0xc1))/0x9*(parseInt(_0x44f480(0xb5))/0xa)+-parseInt(_0x44f480(0xd0))/0xb*(-parseInt(_0x44f480(0xac))/0xc);if(_0x17fec3===_0x2de0e1)break;else _0x4aff8d['push'](_0x4aff8d['shift']());}catch(_0x1fd1d8){_0x4aff8d['push'](_0x4aff8d['shift']());}}}(a42_0x5f1a,0x8018b));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{searchBffScriptLogs}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a42_0x16f0(_0x3af83e,_0x54de11){_0x3af83e=_0x3af83e-0xaa;const _0x5f1a82=a42_0x5f1a();let _0x16f043=_0x5f1a82[_0x3af83e];return _0x16f043;}function a42_0x5f1a(){const _0xfc2634=['--since','1044sBHcdX','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','10MEXZIj','number','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','973foggjF','872255CboiNF','--limit','keyword','120qHHvLF','validation','WARN','str','27309gkyXpJ','flag','The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.','now','bff','\x20must\x20be\x20a\x20positive\x20integer.','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','string','189099snGawG','1003746NnZKCP','limit','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','since','25XMeawt','length','end-time','\x20Backend\x20Function\x20log\x20line(s).','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','Maximum\x20log\x20lines\x20to\x20return\x20(1-','807220DYIQwW','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','read','appCode','80806QfVLzY','ERROR','--start-time','level','num','trim','--limit\x20must\x20be\x20between\x201\x20and\x20','32152KTquAd','DEBUG','start-time','Filter\x20by\x20log\x20level','Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20','Found\x20'];a42_0x5f1a=function(){return _0xfc2634;};return a42_0x5f1a();}const DEFAULT_SINCE_MINUTES=0x1e,DEFAULT_LIMIT=0xc8,MAX_LIMIT=0x3e8,LOG_LEVELS=[a42_0x4938f8(0xd8),'INFO',a42_0x4938f8(0xb7),a42_0x4938f8(0xd1)];export function resolveBffLogQuery(_0x334563,_0x3de87d=Date[a42_0x4938f8(0xbc)]()){const _0x11af5f=a42_0x4938f8,_0x3510bb=_0x334563[_0x11af5f(0xba)](_0x11af5f(0xc5)),_0x244e5a=_0x334563[_0x11af5f(0xba)](_0x11af5f(0xd9)),_0x4b30d3=_0x334563[_0x11af5f(0xba)]('end-time');if(_0x3510bb!==undefined&&_0x244e5a!==undefined)throw CliErrors[_0x11af5f(0xb6)](_0x11af5f(0xbf));const _0x507605=_0x4b30d3===undefined?_0x3de87d:readPositiveInteger(_0x334563['num']('end-time'),'--end-time'),_0x13db15=_0x244e5a===undefined?_0x507605-readSinceMinutes(_0x334563)*0xea60:readPositiveInteger(_0x334563['num'](_0x11af5f(0xd9)),_0x11af5f(0xd2));if(_0x13db15<=0x0)throw CliErrors['validation'](_0x11af5f(0xbb));if(_0x13db15>_0x507605)throw CliErrors[_0x11af5f(0xb6)](_0x11af5f(0xad));const _0x31fdfe=readPositiveInteger(_0x334563[_0x11af5f(0xd4)](_0x11af5f(0xc3),DEFAULT_LIMIT),_0x11af5f(0xb3));if(_0x31fdfe>MAX_LIMIT)throw CliErrors['validation'](_0x11af5f(0xd6)+MAX_LIMIT+'.');const _0x1d89c3=_0x334563[_0x11af5f(0xb8)](_0x11af5f(0xd3))[_0x11af5f(0xd5)]()['toUpperCase']()||undefined,_0x24cfcb=_0x334563[_0x11af5f(0xb8)](_0x11af5f(0xb4))[_0x11af5f(0xd5)]()||undefined;return{'appCode':_0x334563[_0x11af5f(0xcf)],'startTime':_0x13db15,'endTime':_0x507605,..._0x244e5a===undefined?{'sinceMinutes':readSinceMinutes(_0x334563)}:{},..._0x1d89c3?{'level':_0x1d89c3}:{},..._0x24cfcb?{'keyword':_0x24cfcb}:{},'limit':_0x31fdfe};}function readSinceMinutes(_0x596ba4){const _0xd836b7=a42_0x4938f8;return readPositiveInteger(_0x596ba4[_0xd836b7(0xd4)]('since',DEFAULT_SINCE_MINUTES),_0xd836b7(0xab));}function readPositiveInteger(_0x176f69,_0x306ac9){const _0x3b829b=a42_0x4938f8;if(!Number['isSafeInteger'](_0x176f69)||_0x176f69<=0x0)throw CliErrors[_0x3b829b(0xb6)](_0x306ac9+_0x3b829b(0xbe));return _0x176f69;}export const bffLogs={'service':a42_0x4938f8(0xbd),'command':'logs','description':a42_0x4938f8(0xcd),'risk':a42_0x4938f8(0xce),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':a42_0x4938f8(0xc5),'type':a42_0x4938f8(0xaf),'description':a42_0x4938f8(0xdb)+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x4938f8(0xd9),'type':a42_0x4938f8(0xaf),'description':'Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds'},{'name':a42_0x4938f8(0xc8),'type':a42_0x4938f8(0xaf),'description':a42_0x4938f8(0xc4)},{'name':a42_0x4938f8(0xd3),'type':a42_0x4938f8(0xc0),'description':a42_0x4938f8(0xda),'enum':LOG_LEVELS},{'name':'keyword','type':'string','description':a42_0x4938f8(0xca)},{'name':'limit','type':'number','description':a42_0x4938f8(0xcb)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x22cc0e){resolveBffLogQuery(_0x22cc0e);},async 'execute'(_0xf97db4){const _0x5cbdf3=a42_0x4938f8,_0x2a1586=resolveBffLogQuery(_0xf97db4),{sinceMinutes:_0x1ed818,..._0x2e540a}=_0x2a1586,_0x35de94=await searchBffScriptLogs(_0x2e540a);return{'ok':!![],'data':{'query':_0x2a1586,'count':_0x35de94[_0x5cbdf3(0xc7)],'logs':_0x35de94},'message':_0x35de94[_0x5cbdf3(0xc7)]===0x0?_0x5cbdf3(0xb0):_0x5cbdf3(0xaa)+_0x35de94[_0x5cbdf3(0xc7)]+_0x5cbdf3(0xc9)};}};
1
+ function a42_0x3449(_0x3599c9,_0x20b53f){_0x3599c9=_0x3599c9-0xfd;const _0x32247c=a42_0x3224();let _0x34498a=_0x32247c[_0x3599c9];return _0x34498a;}const a42_0x42c929=a42_0x3449;(function(_0x5e28d2,_0x4164e1){const _0x57eff8=a42_0x3449,_0x66efb1=_0x5e28d2();while(!![]){try{const _0x43ea5e=-parseInt(_0x57eff8(0x121))/0x1+-parseInt(_0x57eff8(0x110))/0x2+parseInt(_0x57eff8(0x100))/0x3+-parseInt(_0x57eff8(0xff))/0x4+-parseInt(_0x57eff8(0x115))/0x5*(parseInt(_0x57eff8(0x118))/0x6)+-parseInt(_0x57eff8(0x11f))/0x7+parseInt(_0x57eff8(0x11a))/0x8;if(_0x43ea5e===_0x4164e1)break;else _0x66efb1['push'](_0x66efb1['shift']());}catch(_0x79adbb){_0x66efb1['push'](_0x66efb1['shift']());}}}(a42_0x3224,0x92959));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_0x42c929(0x103),a42_0x42c929(0x123),a42_0x42c929(0x114),a42_0x42c929(0x101)];export function resolveBffLogQuery(_0x20da30,_0x5aba7f=Date['now']()){const _0x4090d7=a42_0x42c929,_0x191712=_0x20da30[_0x4090d7(0x12a)](_0x4090d7(0x11c)),_0x12be7b=_0x20da30['flag'](_0x4090d7(0x104)),_0x2dd871=_0x20da30[_0x4090d7(0x12a)](_0x4090d7(0x102));if(_0x191712!==undefined&&_0x12be7b!==undefined)throw CliErrors['validation'](_0x4090d7(0x129));const _0x569286=_0x2dd871===undefined?_0x5aba7f:readPositiveInteger(_0x20da30[_0x4090d7(0xfd)](_0x4090d7(0x102)),_0x4090d7(0x124)),_0x451e7b=_0x12be7b===undefined?_0x569286-readSinceMinutes(_0x20da30)*0xea60:readPositiveInteger(_0x20da30[_0x4090d7(0xfd)]('start-time'),_0x4090d7(0x11e));if(_0x451e7b<=0x0)throw CliErrors[_0x4090d7(0x112)]('The\x20resolved\x20log\x20start\x20time\x20must\x20be\x20greater\x20than\x200.');if(_0x451e7b>_0x569286)throw CliErrors[_0x4090d7(0x112)](_0x4090d7(0x109));const _0x1fc5bc=readPositiveInteger(_0x20da30[_0x4090d7(0xfd)]('limit',DEFAULT_LIMIT),_0x4090d7(0x11d));if(_0x1fc5bc>MAX_LIMIT)throw CliErrors[_0x4090d7(0x112)]('--limit\x20must\x20be\x20between\x201\x20and\x20'+MAX_LIMIT+'.');const _0x9b4e79=_0x20da30[_0x4090d7(0x10e)]('level')[_0x4090d7(0x108)]()[_0x4090d7(0x105)]()||undefined,_0x10c27f=_0x20da30[_0x4090d7(0x10e)](_0x4090d7(0x111))[_0x4090d7(0x108)]()||undefined;return{'appCode':_0x20da30[_0x4090d7(0x126)],'startTime':_0x451e7b,'endTime':_0x569286,..._0x12be7b===undefined?{'sinceMinutes':readSinceMinutes(_0x20da30)}:{},..._0x9b4e79?{'level':_0x9b4e79}:{},..._0x10c27f?{'keyword':_0x10c27f}:{},'limit':_0x1fc5bc};}function readSinceMinutes(_0x377d3a){const _0x395e63=a42_0x42c929;return readPositiveInteger(_0x377d3a[_0x395e63(0xfd)](_0x395e63(0x11c),DEFAULT_SINCE_MINUTES),_0x395e63(0x125));}function readPositiveInteger(_0x568be6,_0x4f5f47){const _0x4a7bf1=a42_0x42c929;if(!Number[_0x4a7bf1(0x113)](_0x568be6)||_0x568be6<=0x0)throw CliErrors[_0x4a7bf1(0x112)](_0x4f5f47+'\x20must\x20be\x20a\x20positive\x20integer.');return _0x568be6;}function a42_0x3224(){const _0x10ac5a=['23215hvEqGq','Filter\x20formatted\x20log\x20lines\x20by\x20keyword','string','780NQmUUR','Query\x20end\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds\x20(default:\x20now)','26136504UNJscn','Query\x20recent\x20Backend\x20Function\x20runtime\x20logs\x20for\x20development\x20debugging','since','--limit','--start-time','8283520bIJHzO','\x20Backend\x20Function\x20log\x20line(s).','127040BUyvNq','Filter\x20by\x20log\x20level','INFO','--end-time','--since','appCode','number','bff','--since\x20cannot\x20be\x20combined\x20with\x20--start-time.','flag','num','Query\x20start\x20time\x20as\x20a\x20Unix\x20timestamp\x20in\x20milliseconds','1291168VgjYKG','1184418jrWTeT','ERROR','end-time','DEBUG','start-time','toUpperCase','logs','length','trim','--start-time\x20must\x20be\x20less\x20than\x20or\x20equal\x20to\x20--end-time.','Found\x20','level','Maximum\x20log\x20lines\x20to\x20return\x20(1-','No\x20Backend\x20Function\x20logs\x20found\x20for\x20the\x20selected\x20range.','str','read','1649356izgTRt','keyword','validation','isSafeInteger','WARN'];a42_0x3224=function(){return _0x10ac5a;};return a42_0x3224();}export const bffLogs={'service':a42_0x42c929(0x128),'command':a42_0x42c929(0x106),'description':a42_0x42c929(0x11b),'risk':a42_0x42c929(0x10f),'structuredErrors':!![],'flags':[APPCODE_FLAG_OPTIONAL,{'name':'since','type':a42_0x42c929(0x127),'description':'Minutes\x20before\x20the\x20end\x20time\x20to\x20query\x20(default:\x20'+DEFAULT_SINCE_MINUTES+')'},{'name':a42_0x42c929(0x104),'type':a42_0x42c929(0x127),'description':a42_0x42c929(0xfe)},{'name':'end-time','type':a42_0x42c929(0x127),'description':a42_0x42c929(0x119)},{'name':a42_0x42c929(0x10b),'type':'string','description':a42_0x42c929(0x122),'enum':LOG_LEVELS},{'name':a42_0x42c929(0x111),'type':a42_0x42c929(0x117),'description':a42_0x42c929(0x116)},{'name':'limit','type':a42_0x42c929(0x127),'description':a42_0x42c929(0x10c)+MAX_LIMIT+')','default':DEFAULT_LIMIT}],async 'validate'(_0x5c4bf7){resolveBffLogQuery(_0x5c4bf7);},async 'execute'(_0x3e1464){const _0x533709=a42_0x42c929,_0x5a8f36=resolveBffLogQuery(_0x3e1464),{sinceMinutes:_0x481afc,..._0x490528}=_0x5a8f36,_0x245157=await searchBffScriptLogs(_0x490528);return{'ok':!![],'data':{'query':_0x5a8f36,'count':_0x245157['length'],'logs':_0x245157},'message':_0x245157['length']===0x0?_0x533709(0x10d):_0x533709(0x10a)+_0x245157[_0x533709(0x107)]+_0x533709(0x120)};}};
@@ -1 +1 @@
1
- const a43_0x36663f=a43_0x56ec;(function(_0x12c9d4,_0x17b5ef){const _0x4a3571=a43_0x56ec,_0x48609e=_0x12c9d4();while(!![]){try{const _0x396429=parseInt(_0x4a3571(0x133))/0x1+parseInt(_0x4a3571(0x168))/0x2*(parseInt(_0x4a3571(0x117))/0x3)+parseInt(_0x4a3571(0x13c))/0x4*(-parseInt(_0x4a3571(0x13f))/0x5)+-parseInt(_0x4a3571(0x10b))/0x6*(parseInt(_0x4a3571(0x149))/0x7)+-parseInt(_0x4a3571(0x12a))/0x8*(parseInt(_0x4a3571(0x171))/0x9)+-parseInt(_0x4a3571(0x176))/0xa+parseInt(_0x4a3571(0xe8))/0xb*(parseInt(_0x4a3571(0x10d))/0xc);if(_0x396429===_0x17b5ef)break;else _0x48609e['push'](_0x48609e['shift']());}catch(_0x42d7d5){_0x48609e['push'](_0x48609e['shift']());}}}(a43_0x823f,0x45c79));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';function a43_0x823f(){const _0x3f96e0=['all','entries','12fbXnBW','delete','41508UmFupa','functionName','Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22','Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','NFC','stdin','string','remoteId','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','39DaEujZ','skipped','\x22\x20not\x20found\x20after\x20ensureLockScope.','functions','\x22;\x20temporary\x20directory\x20\x22','\x20failed','Pull\x20only\x20this\x20script\x20type','/api/management/library/scripts/list?appCode=','has','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','oldLockKey','pull','unresolvable\x20target\x20path','conflict','\x22:\x20both\x20target\x20\x22','COMMON','scriptsRootDir','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','\x22\x20from\x20the\x20lock\x20file.','2595536ILgDoS','scriptType','length','push_local','scriptsRoot','split','datasetCode','content','oldDirectoryPath','249809MqTJec','\x22\x20and\x20\x22','profileName','ino','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','hookLocation','newLockKey','case-rename','push','16HAkzeh','question','type','65655djSzhP','Failed\x20to\x20write\x20local\x20script\x20\x22','rollback','require','\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','\x22\x20from\x20\x22','filePath','trim','projectedFunctions','Could\x20not\x20restore\x20local\x20script\x20\x22','795487OtMSDn','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','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.','toISOString','version','set','Pull\x20complete:\x20','\x20skipped','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','read','force','Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22','\x20Recovery\x20errors:\x20','oldDirectory','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','HOOK/','stringify','reverse','boolean','validation','Force\x20overwrite\x20local\x20unsynced\x20changes','operationType','parse','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','functionNode','rekey','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','normalize','existed','ENOENT','lockFilePath','26908OBpFWX','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','mergedCli','newDirectory','bff','\x22\x20to\x20\x22','stderr','sourceDirectoryPathByNewDirectory','toLowerCase','9AvwYCS','hash','Force\x20pull\x20cancelled.','alias','lockKey','2852490WjLhKl','entry','would_pull','Lock\x20scope\x20for\x20app\x20\x22','some','.hook-directory-migrate-','migrations','BFF_LOCAL_UNSYNCED','appCode','get','&type=','.js','\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','str','HOOK','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','flatMap','2387BbdGUl','Would\x20inspect\x20','scriptContent','defaultApp','bool','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','utf8','\x20--format\x20compress','ENDPOINT','message','\x22:\x20its\x20target\x20\x22','nonInteractive','values','\x20bff\x20push\x20--type\x20','dev','move','keyChanges','selectedAppName','sourceFilePathByNewLockKey','\x22:\x20','newDirectoryPath','GET','map','lastSync','apiDir','currentApp','Remote\x20script\x20missing\x20content.','\x20conflict','mode','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','join','Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.','&currentPage=1&pageSize='];a43_0x823f=function(){return _0x3f96e0;};return a43_0x823f();}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';function a43_0x56ec(_0x226d0c,_0x5522bd){_0x226d0c=_0x226d0c-0xe4;const _0x823ff8=a43_0x823f();let _0x56ecc0=_0x823ff8[_0x226d0c];return _0x56ecc0;}export const bffPull={'service':a43_0x36663f(0x16c),'command':'pull','description':a43_0x36663f(0x14a),'risk':a43_0x36663f(0x152),'structuredErrors':!![],'flags':[{'name':a43_0x36663f(0x13e),'type':a43_0x36663f(0x113),'description':a43_0x36663f(0x11d),'enum':[a43_0x36663f(0x126),a43_0x36663f(0xf0),a43_0x36663f(0xe5)]},{'name':a43_0x36663f(0x153),'type':a43_0x36663f(0x15b),'description':a43_0x36663f(0x15d)}],async 'dryRun'(_0x2542d1){const _0x259e77=a43_0x36663f,_0x39bba0=loadBffProjectConfig(_0x2542d1[_0x259e77(0x17e)]),_0x1e14c8=await readBffLockFile(_0x39bba0['lockFilePath']),{appLock:_0x36dc90}=ensureLockScope(_0x1e14c8??createEmptyBffLock(),_0x2542d1[_0x259e77(0x17e)],_0x39bba0[_0x259e77(0x12e)],'pull'),_0x3b6c31=normalizeBffType(_0x2542d1[_0x259e77(0xe4)](_0x259e77(0x13e)))??undefined,[_0x20a079,_0x334f71]=await Promise[_0x259e77(0x109)]([listBffScripts(_0x2542d1[_0x259e77(0x17e)],_0x3b6c31),getBffScriptStatistics(_0x2542d1[_0x259e77(0x17e)])]),_0x4971ad=_0x20a079[_0x259e77(0x17a)](_0x4ab37e=>normalizeBffType(_0x4ab37e['scriptType'])==='HOOK'),_0xf996ca=_0x4971ad?buildDatasetCodeToAliasMap(_0x2542d1[_0x259e77(0x100)],_0x2542d1['appCode'],_0x2542d1[_0x259e77(0xf9)]||_0x2542d1['mergedCli']?.[_0x259e77(0x101)]||_0x2542d1[_0x259e77(0x16a)]?.[_0x259e77(0xeb)]):new Map(),_0x1232b7=_0x4971ad?await planHookDirectoryMigration(_0x39bba0,_0x36dc90,_0xf996ca,await scanLocalBffFunctions(_0x39bba0,_0x259e77(0xe5))):undefined,_0x1433e6=createHookLocationMap(_0x334f71),_0x30cca5=[];for(const _0x23aea9 of _0x20a079){const _0x3d0146=resolveRemoteScriptTarget(_0x39bba0,_0x23aea9,_0x1433e6,_0x1232b7?.[_0x259e77(0x147)]??_0x36dc90[_0x259e77(0x11a)],_0xf996ca);if(!_0x3d0146){_0x30cca5[_0x259e77(0x13b)]({'scriptType':_0x23aea9['scriptType'],'functionName':_0x23aea9[_0x259e77(0x10e)]??'','status':_0x259e77(0x118),'reason':'unresolvable\x20target\x20path'});continue;}const _0x1fd622=(_0x1232b7?.[_0x259e77(0x147)]??_0x36dc90[_0x259e77(0x11a)])[_0x3d0146[_0x259e77(0x175)]],_0x496bc6=_0x23aea9['scriptContent']!=null?computeContentHash(_0x23aea9[_0x259e77(0xea)]):undefined,_0x16e9b1=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0x1232b7,_0x3d0146)??_0x3d0146['filePath'],_0x1fd622,_0x496bc6),_0x36234a=_0x16e9b1?localUnsyncedConflict(_0x3d0146,_0x23aea9['id']):undefined;_0x30cca5[_0x259e77(0x13b)]({'lockKey':_0x3d0146[_0x259e77(0x175)],'filePath':_0x3d0146[_0x259e77(0x145)],'remoteId':_0x23aea9['id']??null,'status':_0x36234a?_0x259e77(0x124):_0x259e77(0x178),..._0x36234a?{'conflict':_0x36234a}:{},..._0x3d0146[_0x259e77(0x138)]?{'alias':_0x3d0146[_0x259e77(0x138)]['alias']??null,'datasetCode':_0x3d0146[_0x259e77(0x138)][_0x259e77(0x130)],'operationType':_0x3d0146[_0x259e77(0x138)][_0x259e77(0x15e)],'functionNode':_0x3d0146[_0x259e77(0x138)][_0x259e77(0x161)]}:{}});}return{'method':_0x259e77(0xfd),'url':_0x259e77(0x11e)+_0x2542d1[_0x259e77(0x17e)]+(_0x3b6c31?_0x259e77(0x180)+_0x3b6c31:'')+_0x259e77(0x108)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x2542d1[_0x259e77(0x17e)],'filterType':_0x3b6c31??null,..._0x1232b7&&_0x1232b7[_0x259e77(0x17c)][_0x259e77(0x12c)]>0x0?{'hookDirectoryMigrations':_0x1232b7[_0x259e77(0x17c)]['map'](_0x2bce28=>({'from':_0x2bce28['oldDirectory'],'to':_0x2bce28['newDirectory']}))}:{},'files':_0x30cca5},'description':_0x259e77(0xe9)+_0x30cca5['length']+_0x259e77(0x137)};},async 'execute'(_0x2b7546){const _0x5273cd=a43_0x36663f,_0x2f9551=loadBffProjectConfig(_0x2b7546['appCode']),_0x275813=await readBffLockFile(_0x2f9551[_0x5273cd(0x167)]),{lockData:_0x27aede,appLock:_0x5e37ec}=ensureLockScope(_0x275813??createEmptyBffLock(),_0x2b7546[_0x5273cd(0x17e)],_0x2f9551[_0x5273cd(0x12e)],_0x5273cd(0x122)),_0x919f95=normalizeBffType(_0x2b7546['str'](_0x5273cd(0x13e)))??undefined;if(_0x2b7546[_0x5273cd(0xe4)](_0x5273cd(0x13e))&&!_0x919f95)throw CliErrors['validation'](_0x5273cd(0x115));const [_0x1aa18f,_0x52258b]=await Promise['all']([listBffScripts(_0x2b7546['appCode'],_0x919f95),getBffScriptStatistics(_0x2b7546[_0x5273cd(0x17e)])]);if(_0x1aa18f[_0x5273cd(0x12c)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x5273cd(0x183)};const _0x378c55=_0x2b7546[_0x5273cd(0xec)](_0x5273cd(0x153));if(_0x378c55&&!_0x2b7546[_0x5273cd(0xf3)]){const _0x14e861=await confirmForce();if(!_0x14e861)throw CliErrors['cancelled'](_0x5273cd(0x173));}if(_0x378c55&&_0x2b7546[_0x5273cd(0xf3)]){}const _0x2bec86=_0x1aa18f[_0x5273cd(0x17a)](_0x10c440=>normalizeBffType(_0x10c440[_0x5273cd(0x12b)])===_0x5273cd(0xe5)),_0x4c372a=_0x2bec86?buildDatasetCodeToAliasMap(_0x2b7546[_0x5273cd(0x100)],_0x2b7546[_0x5273cd(0x17e)],_0x2b7546['selectedAppName']||_0x2b7546[_0x5273cd(0x16a)]?.[_0x5273cd(0x101)]||_0x2b7546[_0x5273cd(0x16a)]?.[_0x5273cd(0xeb)]):new Map(),_0x193e45=createHookLocationMap(_0x52258b),_0x3f66ff=JSON[_0x5273cd(0x15f)](JSON[_0x5273cd(0x159)](_0x27aede)),_0x5746fa=_0x2b7546[_0x5273cd(0x17e)],_0x1349b9=_0x3f66ff['apps'][_0x5746fa];if(!_0x1349b9)throw new Error(_0x5273cd(0x179)+_0x5746fa+_0x5273cd(0x119));const _0x3cdf57=_0x2bec86?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x2f9551,_0x1349b9,_0x4c372a,await scanLocalBffFunctions(_0x2f9551,_0x5273cd(0xe5))),_0x1349b9):undefined,_0x2703c3=createPullFileTransaction(),_0x29083a=[],_0x8f6307=[],_0x49c635=[],_0x5dedf7=[];for(const _0x22af97 of _0x1aa18f){const _0x197ce8=resolveRemoteScriptTarget(_0x2f9551,_0x22af97,_0x193e45,_0x1349b9[_0x5273cd(0x11a)],_0x4c372a);if(!_0x197ce8){_0x8f6307['push']({'lockKey':_0x22af97[_0x5273cd(0x12b)]+'/'+_0x22af97[_0x5273cd(0x10e)],'reason':_0x5273cd(0x123)});continue;}const _0x5eb888=_0x1349b9[_0x5273cd(0x11a)][_0x197ce8['lockKey']];try{if(!_0x22af97['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x22af97[_0x5273cd(0xea)]==null)throw new Error(_0x5273cd(0x102));const _0x55df7d=_0x22af97['scriptContent'],_0x152603=computeContentHash(_0x55df7d);if(!_0x378c55){const _0x100748=await hasUnsyncedLocalChanges(_0x197ce8[_0x5273cd(0x145)],_0x5eb888,_0x152603);if(_0x100748){_0x49c635[_0x5273cd(0x13b)](localUnsyncedConflict(_0x197ce8,_0x22af97['id']));continue;}}await _0x2703c3['write'](_0x197ce8[_0x5273cd(0x145)],_0x55df7d);const _0x5e5cdf={'hash':_0x152603,'remoteId':_0x22af97['id'],'version':_0x22af97[_0x5273cd(0x14d)]};_0x197ce8[_0x5273cd(0x13e)]===_0x5273cd(0xe5)&&_0x197ce8[_0x5273cd(0x138)]&&(_0x5e5cdf[_0x5273cd(0x174)]=_0x197ce8[_0x5273cd(0x138)][_0x5273cd(0x174)],_0x5e5cdf['datasetCode']=_0x197ce8[_0x5273cd(0x138)][_0x5273cd(0x130)],_0x5e5cdf[_0x5273cd(0x15e)]=_0x197ce8[_0x5273cd(0x138)][_0x5273cd(0x15e)],_0x5e5cdf[_0x5273cd(0x161)]=_0x197ce8[_0x5273cd(0x138)][_0x5273cd(0x161)]),_0x1349b9[_0x5273cd(0x11a)][_0x197ce8[_0x5273cd(0x175)]]=_0x5e5cdf,_0x29083a[_0x5273cd(0x13b)]({'lockKey':_0x197ce8[_0x5273cd(0x175)],'remoteId':_0x22af97['id']});}catch(_0x13ad93){_0x5dedf7['push']({'lockKey':_0x197ce8['lockKey'],'error':_0x13ad93 instanceof Error?_0x13ad93[_0x5273cd(0xf1)]:String(_0x13ad93)});}}_0x1349b9[_0x5273cd(0xff)]=new Date()[_0x5273cd(0x14c)]();try{await writeBffLockFile(_0x2f9551['lockFilePath'],_0x3f66ff);}catch(_0x5af9cc){const _0x34fb06=[...await _0x2703c3['rollback'](),...await _0x3cdf57?.[_0x5273cd(0x141)]()??[]];throw withRollbackErrors(_0x5af9cc,_0x5273cd(0x107),_0x34fb06);}return{'ok':_0x5dedf7[_0x5273cd(0x12c)]===0x0,'data':{'pulled':_0x29083a,'skipped':_0x8f6307,'conflicts':_0x49c635,'failed':_0x5dedf7},'message':formatPullMessage(_0x29083a[_0x5273cd(0x12c)],_0x8f6307[_0x5273cd(0x12c)],_0x49c635[_0x5273cd(0x12c)],_0x5dedf7['length'])};}};function localUnsyncedConflict(_0x47cab6,_0x1275ca){const _0x38370c=a43_0x36663f,_0x56f308=_0x47cab6[_0x38370c(0x175)][_0x38370c(0x12f)]('/')['at'](-0x1);return{'code':_0x38370c(0x17d),'lockKey':_0x47cab6[_0x38370c(0x175)],'filePath':_0x47cab6['filePath'],..._0x1275ca!=null?{'remoteId':_0x1275ca}:{},'message':_0x38370c(0x169),'nextAction':{'action':_0x38370c(0x12d),'command':CLI_BIN_NAME+_0x38370c(0xf5)+_0x47cab6[_0x38370c(0x13e)]+'\x20--name\x20'+_0x56f308+_0x38370c(0xef),'requiresReview':!![],'message':_0x38370c(0x14b)}};}function formatPullMessage(_0x19cde4,_0x12eb3b,_0x464edd,_0x3bf17e){const _0x30478c=a43_0x36663f,_0x295010=[_0x30478c(0x14f)+_0x19cde4+'\x20pulled',_0x12eb3b+_0x30478c(0x150)];_0x464edd>0x0&&_0x295010['push'](_0x464edd+_0x30478c(0x103)+(_0x464edd===0x1?'':'s')+'\x20'+(_0x464edd===0x1?'requires':_0x30478c(0x142))+'\x20resolution');if(_0x3bf17e>0x0)_0x295010[_0x30478c(0x13b)](_0x3bf17e+_0x30478c(0x11c));return _0x295010[_0x30478c(0x106)](',\x20');}async function hasUnsyncedLocalChanges(_0x4cb218,_0x59464b,_0x93536b){const _0x3edcbd=a43_0x36663f;if(!await fileExists(_0x4cb218))return![];const _0x5cbc89=await computeFileHash(_0x4cb218);if(!_0x59464b)return _0x93536b?_0x5cbc89!==_0x93536b:!![];return _0x5cbc89!==_0x59464b[_0x3edcbd(0x172)];}function createPullFileTransaction(){const _0x23f7c9=new Map(),_0x4bdefa=async(_0x430fd0,_0x5c6a6b)=>{const _0x423b6a=a43_0x56ec;try{if(_0x5c6a6b[_0x423b6a(0x165)])await ensureParentDirectory(_0x430fd0),await writeFile(_0x430fd0,_0x5c6a6b[_0x423b6a(0x131)]);else try{await unlink(_0x430fd0);}catch(_0x3bee66){if(_0x3bee66['code']!==_0x423b6a(0x166))throw _0x3bee66;}return undefined;}catch(_0x58f578){return _0x58f578 instanceof Error?_0x58f578:new Error(String(_0x58f578));}};return{async 'write'(_0x2566b6,_0x1ae15a){const _0x32a9df=a43_0x56ec;if(!_0x23f7c9[_0x32a9df(0x11f)](_0x2566b6))try{_0x23f7c9[_0x32a9df(0x14e)](_0x2566b6,{'existed':!![],'content':await readFile(_0x2566b6)});}catch(_0xbe2ff8){if(_0xbe2ff8['code']!==_0x32a9df(0x166))throw _0xbe2ff8;_0x23f7c9[_0x32a9df(0x14e)](_0x2566b6,{'existed':![]});}try{await ensureParentDirectory(_0x2566b6),await writeFile(_0x2566b6,_0x1ae15a,_0x32a9df(0xee));}catch(_0x4a89e7){const _0x3c742a=await _0x4bdefa(_0x2566b6,_0x23f7c9['get'](_0x2566b6));if(!_0x3c742a)_0x23f7c9[_0x32a9df(0x10c)](_0x2566b6);throw withRollbackErrors(_0x4a89e7,_0x32a9df(0x140)+_0x2566b6+'\x22.',_0x3c742a?[_0x3c742a]:[]);}},async 'rollback'(){const _0x55cf46=a43_0x56ec,_0x459e64=[];for(const [_0x26eeb8,_0x1820fe]of[..._0x23f7c9['entries']()][_0x55cf46(0x15a)]()){const _0xd0a76=await _0x4bdefa(_0x26eeb8,_0x1820fe);_0xd0a76&&_0x459e64['push'](new Error(_0x55cf46(0x148)+_0x26eeb8+_0x55cf46(0xfb)+_0xd0a76[_0x55cf46(0xf1)]));}return _0x459e64;}};}function withRollbackErrors(_0x1690ad,_0x4cea60,_0x26e4fc){const _0x15841f=a43_0x36663f,_0x16c5a0=_0x1690ad instanceof Error?_0x1690ad:new Error(String(_0x1690ad));if(_0x26e4fc[_0x15841f(0x12c)]===0x0)return _0x16c5a0;return new AggregateError([_0x16c5a0,..._0x26e4fc],_0x4cea60+_0x15841f(0x155)+_0x26e4fc[_0x15841f(0xfe)](_0x2c1d93=>_0x2c1d93[_0x15841f(0xf1)])['join'](';\x20'));}function buildDatasetCodeToAliasMap(_0x19edbd,_0x188a01,_0x8db999){const _0x3cad42=a43_0x36663f,_0x75b291=resolveApiModelSource(_0x19edbd,_0x188a01,_0x8db999),_0x43a5e7=loadAliasMap(_0x19edbd,undefined,_0x75b291[_0x3cad42(0x145)],_0x75b291[_0x3cad42(0x135)]);return assertUnambiguousHookAliases(_0x43a5e7),new Map(_0x43a5e7[_0x3cad42(0xfe)](_0x1683a=>[_0x1683a['datasetCode']['toLowerCase'](),_0x1683a[_0x3cad42(0x174)]]));}async function planHookDirectoryMigration(_0xfc3c0c,_0x4a6839,_0x2ecedf,_0x392c37){const _0x379957=a43_0x36663f,_0x3d34e2=new Map();for(const [_0x4557ff,_0x233cb7]of Object[_0x379957(0x10a)](_0x4a6839[_0x379957(0x11a)])){const [_0x1e1b18,_0x74912e,_0x427976,_0x2fb1bb,_0x56c3f4,..._0x3e5397]=_0x4557ff[_0x379957(0x12f)]('/');if(_0x1e1b18!==_0x379957(0xe5)||!_0x74912e||!_0x427976||!_0x2fb1bb||!_0x56c3f4||_0x3e5397['length']>0x0||!_0x233cb7[_0x379957(0x130)])continue;const _0x2a0413=_0x2ecedf[_0x379957(0x17f)](_0x233cb7[_0x379957(0x130)][_0x379957(0x170)]()),_0x325851=_0x2a0413??_0x233cb7[_0x379957(0x130)];if(!isSafeHookDirectorySegment(_0x74912e))throw CliErrors[_0x379957(0x15c)](_0x379957(0x154)+_0x74912e+_0x379957(0x129));if(!isSafeHookDirectorySegment(_0x325851))throw CliErrors[_0x379957(0x15c)](_0x379957(0x160)+_0x74912e+_0x379957(0x116));if(_0x74912e===_0x325851)continue;const _0x2ab71a=_0x3d34e2[_0x379957(0x17f)](_0x74912e)??{'datasetCode':_0x233cb7[_0x379957(0x130)],'alias':_0x2a0413,'keyChanges':[]};if(_0x2ab71a[_0x379957(0x130)]!==_0x233cb7[_0x379957(0x130)])throw CliErrors[_0x379957(0x15c)](_0x379957(0x160)+_0x74912e+_0x379957(0x182));const _0x2ac195=_0x379957(0x158)+_0x325851+'/'+_0x427976+'/'+_0x2fb1bb+'/'+_0x56c3f4;try{resolveLocalFilePathFromLockKey(_0xfc3c0c,_0x4557ff),resolveLocalFilePathFromLockKey(_0xfc3c0c,_0x2ac195);}catch(_0x113636){throw CliErrors[_0x379957(0x15c)](_0x379957(0xed)+_0x4557ff+_0x379957(0xfb)+(_0x113636 instanceof Error?_0x113636[_0x379957(0xf1)]:String(_0x113636)));}_0x2ab71a['keyChanges']['push']({'oldLockKey':_0x4557ff,'newLockKey':_0x2ac195,'entry':_0x233cb7}),_0x3d34e2[_0x379957(0x14e)](_0x74912e,_0x2ab71a);}const _0x59115f=new Set([..._0x3d34e2[_0x379957(0xf4)]()][_0x379957(0xe7)](_0x1a5dda=>_0x1a5dda[_0x379957(0xf8)][_0x379957(0xfe)](_0x32d3b6=>_0x32d3b6[_0x379957(0x121)]))),_0x3faee4=new Map(),_0x566c0d=new Map();for(const [_0x534708,_0x2ddce5]of _0x3d34e2){const _0x45d590=_0x2ddce5[_0x379957(0x174)]??_0x2ddce5['datasetCode'],_0xaff51=hookDirectoryIdentity(_0x45d590),_0x30a508=_0x3faee4[_0x379957(0x17f)](_0xaff51);if(_0x30a508&&_0x30a508!==_0x534708)throw CliErrors[_0x379957(0x15c)](_0x379957(0x163)+_0x30a508+_0x379957(0x134)+_0x534708+_0x379957(0x125)+_0x45d590+'\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.');_0x3faee4[_0x379957(0x14e)](_0xaff51,_0x534708);for(const _0x13dd1e of _0x2ddce5['keyChanges']){const _0x1d6b50=_0x566c0d[_0x379957(0x17f)](_0x13dd1e[_0x379957(0x139)]);if(_0x1d6b50&&_0x1d6b50!==_0x13dd1e['oldLockKey'])throw CliErrors[_0x379957(0x15c)](_0x379957(0x10f)+_0x1d6b50+'\x22\x20and\x20\x22'+_0x13dd1e[_0x379957(0x121)]+'\x22:\x20both\x20target\x20\x22'+_0x13dd1e[_0x379957(0x139)]+_0x379957(0x143));if(_0x59115f[_0x379957(0x11f)](_0x13dd1e[_0x379957(0x139)]))throw CliErrors[_0x379957(0x15c)]('Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22'+_0x13dd1e[_0x379957(0x121)]+_0x379957(0xf2)+_0x13dd1e['newLockKey']+'\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');_0x566c0d[_0x379957(0x14e)](_0x13dd1e[_0x379957(0x139)],_0x13dd1e[_0x379957(0x121)]);}}const _0x15a311=new Map();for(const [_0x30eaa9,_0x520487]of _0x2ecedf){_0x15a311[_0x379957(0x14e)](hookDirectoryIdentity(_0x520487),_0x30eaa9);}const _0x1f3b6b=[];for(const [_0x3f4730,_0x2475a8]of _0x3d34e2){const _0x98a164=_0x2475a8['alias']??_0x2475a8[_0x379957(0x130)],_0x4d5ac2=join(_0xfc3c0c[_0x379957(0x127)],_0x379957(0xe5),_0x3f4730),_0x2acb7d=join(_0xfc3c0c[_0x379957(0x127)],'HOOK',_0x98a164),_0x31832d=await directoryExists(_0x4d5ac2),_0x551763=await directoryExists(_0x2acb7d),_0x5dd692=_0x31832d?_0x551763?await sameDirectory(_0x4d5ac2,_0x2acb7d)?_0x379957(0x13a):undefined:_0x379957(0xf7):'rekey';if(!_0x5dd692)throw CliErrors[_0x379957(0x15c)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x3f4730+_0x379957(0x16d)+_0x98a164+_0x379957(0x120));const _0x2259ac=_0x15a311[_0x379957(0x17f)](hookDirectoryIdentity(_0x3f4730));if(_0x2259ac&&_0x2259ac!==_0x2475a8[_0x379957(0x130)][_0x379957(0x170)]()){const _0x192206=new Set(_0x2475a8[_0x379957(0xf8)][_0x379957(0xfe)](_0x5bc4b8=>_0x5bc4b8[_0x379957(0x121)])),_0x41139c=_0x392c37['filter'](_0x57c66b=>_0x57c66b['type']===_0x379957(0xe5)&&_0x57c66b[_0x379957(0x174)]!=null&&hookDirectoryIdentity(_0x57c66b[_0x379957(0x174)])===hookDirectoryIdentity(_0x3f4730)&&!_0x192206[_0x379957(0x11f)](_0x57c66b['lockKey']));if(_0x41139c[_0x379957(0x12c)]>0x0)throw CliErrors[_0x379957(0x15c)](_0x379957(0x160)+_0x3f4730+_0x379957(0x105));}const _0x56aed8=_0x15a311[_0x379957(0x17f)](hookDirectoryIdentity(_0x98a164));if(_0x56aed8&&_0x56aed8!==_0x2475a8[_0x379957(0x130)][_0x379957(0x170)]())throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x3f4730+_0x379957(0x16d)+_0x98a164+_0x379957(0x151));for(const _0x3fc931 of _0x2475a8['keyChanges']){const _0x7c72c9=_0x4a6839[_0x379957(0x11a)][_0x3fc931[_0x379957(0x139)]];if(_0x7c72c9&&!_0x59115f[_0x379957(0x11f)](_0x3fc931[_0x379957(0x139)])&&!sameHookIdentity(_0x3fc931['entry'],_0x7c72c9))throw CliErrors[_0x379957(0x15c)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x3f4730+_0x379957(0x16d)+_0x98a164+_0x379957(0x128));}_0x1f3b6b['push']({'oldDirectory':_0x3f4730,'newDirectory':_0x98a164,'oldDirectoryPath':_0x4d5ac2,'newDirectoryPath':_0x2acb7d,'mode':_0x5dd692,'alias':_0x2475a8[_0x379957(0x174)],'keyChanges':_0x2475a8[_0x379957(0xf8)]});}const _0x540bba={..._0x4a6839[_0x379957(0x11a)]},_0x419de5=new Map(),_0xb633dc=new Map();for(const _0x1695ed of _0x1f3b6b){const _0x16b9f6=_0x1695ed[_0x379957(0x104)]!==_0x379957(0x162);_0x16b9f6&&_0xb633dc[_0x379957(0x14e)](hookDirectoryIdentity(_0x1695ed[_0x379957(0x16b)]),_0x1695ed[_0x379957(0x132)]);for(const _0xa24fc0 of _0x1695ed['keyChanges']){const _0x5c2922=_0x540bba[_0xa24fc0[_0x379957(0x139)]],_0x9b437c=_0x16b9f6?_0xa24fc0[_0x379957(0x177)]:_0x5c2922??_0xa24fc0['entry'];_0x540bba[_0xa24fc0[_0x379957(0x139)]]=canonicalizeHookEntry(_0x9b437c,_0x1695ed['alias']),delete _0x540bba[_0xa24fc0[_0x379957(0x121)]],_0x16b9f6&&_0x419de5[_0x379957(0x14e)](_0xa24fc0[_0x379957(0x139)],resolveLocalFilePathFromLockKey(_0xfc3c0c,_0xa24fc0[_0x379957(0x121)]));}}return{'migrations':_0x1f3b6b,'projectedFunctions':_0x540bba,'sourceFilePathByNewLockKey':_0x419de5,'sourceDirectoryPathByNewDirectory':_0xb633dc};}function resolveMigratedSourceFilePath(_0x4d6ff7,_0x182fb7){const _0x542c7e=a43_0x36663f;if(!_0x4d6ff7||!_0x182fb7)return undefined;const _0x5e21bc=_0x4d6ff7[_0x542c7e(0xfa)][_0x542c7e(0x17f)](_0x182fb7[_0x542c7e(0x175)]);if(_0x5e21bc)return _0x5e21bc;if(_0x182fb7[_0x542c7e(0x13e)]!==_0x542c7e(0xe5))return undefined;const [,_0x42e20d,..._0x45316b]=_0x182fb7[_0x542c7e(0x175)][_0x542c7e(0x12f)]('/');if(!_0x42e20d||_0x45316b[_0x542c7e(0x12c)]===0x0)return undefined;const _0x4b6c56=_0x4d6ff7[_0x542c7e(0x16f)]['get'](hookDirectoryIdentity(_0x42e20d));return _0x4b6c56?join(_0x4b6c56,..._0x45316b)+_0x542c7e(0x181):undefined;}function sameHookIdentity(_0x283215,_0x522ada){const _0x5cb9f3=a43_0x36663f;return _0x283215[_0x5cb9f3(0x114)]===_0x522ada[_0x5cb9f3(0x114)]&&_0x283215['datasetCode']===_0x522ada[_0x5cb9f3(0x130)]&&_0x283215[_0x5cb9f3(0x15e)]===_0x522ada[_0x5cb9f3(0x15e)]&&_0x283215[_0x5cb9f3(0x161)]===_0x522ada[_0x5cb9f3(0x161)];}function canonicalizeHookEntry(_0xb5a7c3,_0x40b7a8){const {alias:_0x3ab0ef,..._0x2fd665}=_0xb5a7c3;return _0x40b7a8?{..._0x2fd665,'alias':_0x40b7a8}:_0x2fd665;}function hookDirectoryIdentity(_0x588642){const _0x2db99e=a43_0x36663f;return _0x588642[_0x2db99e(0x164)](_0x2db99e(0x111))['toLowerCase']();}function isSafeHookDirectorySegment(_0x4c6eee){return isSafeLockKeySegment(_0x4c6eee);}async function sameDirectory(_0x2c4617,_0x51e7a9){const _0x5e21aa=a43_0x36663f,[_0x10b586,_0x168448]=await Promise[_0x5e21aa(0x109)]([stat(_0x2c4617),stat(_0x51e7a9)]);return _0x10b586[_0x5e21aa(0xf6)]===_0x168448[_0x5e21aa(0xf6)]&&_0x10b586[_0x5e21aa(0x136)]===_0x168448[_0x5e21aa(0x136)];}async function applyHookDirectoryMigration(_0x3b17f9,_0x49c013){const _0x3f1f35=a43_0x36663f,_0xb59398=_0x49c013['functions'],_0x287caa=_0x49c013[_0x3f1f35(0xff)],_0x38679c=[],_0xf9dd99=async()=>{const _0xa5ad46=_0x3f1f35,_0x2cd608=[];_0x49c013[_0xa5ad46(0x11a)]=_0xb59398,_0x49c013[_0xa5ad46(0xff)]=_0x287caa;for(const {migration:_0x434984,temporaryPath:_0x49d758}of[..._0x38679c][_0xa5ad46(0x15a)]()){try{_0x49d758?(await rename(_0x434984[_0xa5ad46(0xfc)],_0x49d758),await rename(_0x49d758,_0x434984[_0xa5ad46(0x132)])):await rename(_0x434984[_0xa5ad46(0xfc)],_0x434984['oldDirectoryPath']);}catch(_0x1bbab5){_0x2cd608[_0xa5ad46(0x13b)](new Error('Could\x20not\x20restore\x20HOOK\x20directory\x20\x22'+_0x434984[_0xa5ad46(0x156)]+_0xa5ad46(0x144)+_0x434984[_0xa5ad46(0x16b)]+_0xa5ad46(0xfb)+(_0x1bbab5 instanceof Error?_0x1bbab5['message']:String(_0x1bbab5))));}}return _0x2cd608;};try{for(const _0x17809f of _0x3b17f9[_0x3f1f35(0x17c)]){if(_0x17809f[_0x3f1f35(0x104)]==='move')await ensureParentDirectory(_0x17809f[_0x3f1f35(0xfc)]),await rename(_0x17809f[_0x3f1f35(0x132)],_0x17809f[_0x3f1f35(0xfc)]),_0x38679c[_0x3f1f35(0x13b)]({'migration':_0x17809f});else{if(_0x17809f[_0x3f1f35(0x104)]===_0x3f1f35(0x13a)){const _0x560800=join(dirname(_0x17809f[_0x3f1f35(0x132)]),_0x3f1f35(0x17b)+randomUUID());await rename(_0x17809f['oldDirectoryPath'],_0x560800);try{await rename(_0x560800,_0x17809f[_0x3f1f35(0xfc)]);}catch(_0x22d00a){try{await rename(_0x560800,_0x17809f['oldDirectoryPath']);}catch(_0x15bef0){throw withRollbackErrors(_0x22d00a,'Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22'+_0x17809f[_0x3f1f35(0x156)]+_0x3f1f35(0x16d)+_0x17809f[_0x3f1f35(0x16b)]+_0x3f1f35(0x11b)+_0x560800+'\x22\x20may\x20remain.',[new Error(_0x3f1f35(0x157)+_0x560800+_0x3f1f35(0x16d)+_0x17809f[_0x3f1f35(0x156)]+'\x22:\x20'+(_0x15bef0 instanceof Error?_0x15bef0['message']:String(_0x15bef0)))]);}throw _0x22d00a;}_0x38679c[_0x3f1f35(0x13b)]({'migration':_0x17809f,'temporaryPath':_0x560800});}}}return _0x49c013[_0x3f1f35(0x11a)]=_0x3b17f9['projectedFunctions'],{'rollback':_0xf9dd99};}catch(_0x2ec69b){const _0x35eab2=await _0xf9dd99();throw withRollbackErrors(_0x2ec69b,_0x3f1f35(0x110),_0x35eab2);}}async function confirmForce(){const _0x16bcee=a43_0x36663f,_0x45b8dd=createInterface({'input':process[_0x16bcee(0x112)],'output':process[_0x16bcee(0x16e)]}),_0x104345=await new Promise(_0x8221d3=>{const _0x3cc731=_0x16bcee;_0x45b8dd[_0x3cc731(0x13d)](_0x3cc731(0xe6),_0x8221d3);});return _0x45b8dd['close'](),['y','yes']['includes'](_0x104345[_0x16bcee(0x146)]()['toLowerCase']());}
1
+ const a43_0x27f8d1=a43_0x7e08;function a43_0x7e08(_0xde8849,_0x118e87){_0xde8849=_0xde8849-0x146;const _0x395ad8=a43_0x395a();let _0x7e082d=_0x395ad8[_0xde8849];return _0x7e082d;}(function(_0x5d869c,_0x173f86){const _0xda683a=a43_0x7e08,_0x740891=_0x5d869c();while(!![]){try{const _0x380614=parseInt(_0xda683a(0x17b))/0x1*(-parseInt(_0xda683a(0x19a))/0x2)+parseInt(_0xda683a(0x1ba))/0x3*(parseInt(_0xda683a(0x16f))/0x4)+parseInt(_0xda683a(0x16b))/0x5*(-parseInt(_0xda683a(0x1ce))/0x6)+parseInt(_0xda683a(0x195))/0x7+-parseInt(_0xda683a(0x168))/0x8*(parseInt(_0xda683a(0x1d5))/0x9)+parseInt(_0xda683a(0x148))/0xa*(parseInt(_0xda683a(0x18d))/0xb)+parseInt(_0xda683a(0x1db))/0xc*(parseInt(_0xda683a(0x14e))/0xd);if(_0x380614===_0x173f86)break;else _0x740891['push'](_0x740891['shift']());}catch(_0x490941){_0x740891['push'](_0x740891['shift']());}}}(a43_0x395a,0x48cf7));import{createInterface}from'node:readline';import{readFile,rename,stat,unlink,writeFile}from'node:fs/promises';import{randomUUID}from'node:crypto';import{dirname,join}from'node:path';import{BFF_LIST_PAGE_SIZE,listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiModelSource}from'../../api/model-source.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,directoryExists,ensureParentDirectory,fileExists,isSafeLockKeySegment,normalizeBffType,resolveLocalFilePathFromLockKey,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{assertUnambiguousHookAliases}from'../../core/bff/hook-directory.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export const bffPull={'service':a43_0x27f8d1(0x147),'command':a43_0x27f8d1(0x170),'description':a43_0x27f8d1(0x1a2),'risk':a43_0x27f8d1(0x1c9),'structuredErrors':!![],'flags':[{'name':a43_0x27f8d1(0x193),'type':'string','description':'Pull\x20only\x20this\x20script\x20type','enum':[a43_0x27f8d1(0x14d),'ENDPOINT',a43_0x27f8d1(0x191)]},{'name':a43_0x27f8d1(0x17a),'type':a43_0x27f8d1(0x15d),'description':a43_0x27f8d1(0x1cb)}],async 'dryRun'(_0x180422){const _0x54d961=a43_0x27f8d1,_0x1010e9=loadBffProjectConfig(_0x180422[_0x54d961(0x1d6)]),_0x1e3272=await readBffLockFile(_0x1010e9['lockFilePath']),{appLock:_0x1bafce}=ensureLockScope(_0x1e3272??createEmptyBffLock(),_0x180422[_0x54d961(0x1d6)],_0x1010e9[_0x54d961(0x183)],'pull'),_0x8e4b8b=normalizeBffType(_0x180422[_0x54d961(0x1ac)](_0x54d961(0x193)))??undefined,[_0x1c72bf,_0x4070af]=await Promise['all']([listBffScripts(_0x180422[_0x54d961(0x1d6)],_0x8e4b8b),getBffScriptStatistics(_0x180422['appCode'])]),_0x641275=_0x1c72bf[_0x54d961(0x1c3)](_0x394bdb=>normalizeBffType(_0x394bdb['scriptType'])==='HOOK'),_0x21b84a=_0x641275?buildDatasetCodeToAliasMap(_0x180422[_0x54d961(0x19b)],_0x180422[_0x54d961(0x1d6)],_0x180422[_0x54d961(0x184)]||_0x180422[_0x54d961(0x175)]?.[_0x54d961(0x176)]||_0x180422[_0x54d961(0x175)]?.[_0x54d961(0x1a1)]):new Map(),_0xc97c2e=_0x641275?await planHookDirectoryMigration(_0x1010e9,_0x1bafce,_0x21b84a,await scanLocalBffFunctions(_0x1010e9,_0x54d961(0x191))):undefined,_0x1c7efa=createHookLocationMap(_0x4070af),_0x212623=[];for(const _0x315785 of _0x1c72bf){const _0x3b917f=resolveRemoteScriptTarget(_0x1010e9,_0x315785,_0x1c7efa,_0xc97c2e?.[_0x54d961(0x1d8)]??_0x1bafce[_0x54d961(0x17c)],_0x21b84a);if(!_0x3b917f){_0x212623[_0x54d961(0x18e)]({'scriptType':_0x315785[_0x54d961(0x1dd)],'functionName':_0x315785[_0x54d961(0x1c7)]??'','status':_0x54d961(0x1bd),'reason':_0x54d961(0x1c6)});continue;}const _0x141098=(_0xc97c2e?.[_0x54d961(0x1d8)]??_0x1bafce['functions'])[_0x3b917f[_0x54d961(0x1ad)]],_0x4662b4=_0x315785[_0x54d961(0x166)]!=null?computeContentHash(_0x315785[_0x54d961(0x166)]):undefined,_0x593b17=await hasUnsyncedLocalChanges(resolveMigratedSourceFilePath(_0xc97c2e,_0x3b917f)??_0x3b917f[_0x54d961(0x186)],_0x141098,_0x4662b4),_0x2c8c31=_0x593b17?localUnsyncedConflict(_0x3b917f,_0x315785['id']):undefined;_0x212623['push']({'lockKey':_0x3b917f['lockKey'],'filePath':_0x3b917f['filePath'],'remoteId':_0x315785['id']??null,'status':_0x2c8c31?'conflict':_0x54d961(0x1d7),..._0x2c8c31?{'conflict':_0x2c8c31}:{},..._0x3b917f[_0x54d961(0x1d3)]?{'alias':_0x3b917f[_0x54d961(0x1d3)][_0x54d961(0x194)]??null,'datasetCode':_0x3b917f[_0x54d961(0x1d3)][_0x54d961(0x1c0)],'operationType':_0x3b917f[_0x54d961(0x1d3)][_0x54d961(0x1bc)],'functionNode':_0x3b917f[_0x54d961(0x1d3)][_0x54d961(0x1b1)]}:{}});}return{'method':_0x54d961(0x14a),'url':_0x54d961(0x150)+_0x180422[_0x54d961(0x1d6)]+(_0x8e4b8b?_0x54d961(0x15e)+_0x8e4b8b:'')+'&currentPage=1&pageSize='+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0x180422[_0x54d961(0x1d6)],'filterType':_0x8e4b8b??null,..._0xc97c2e&&_0xc97c2e[_0x54d961(0x161)][_0x54d961(0x16a)]>0x0?{'hookDirectoryMigrations':_0xc97c2e['migrations']['map'](_0xa2b2f2=>({'from':_0xa2b2f2[_0x54d961(0x158)],'to':_0xa2b2f2[_0x54d961(0x1c4)]}))}:{},'files':_0x212623},'description':_0x54d961(0x1dc)+_0x212623[_0x54d961(0x16a)]+'\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'};},async 'execute'(_0x3912dc){const _0x23b472=a43_0x27f8d1,_0x4f1506=loadBffProjectConfig(_0x3912dc[_0x23b472(0x1d6)]),_0x337b67=await readBffLockFile(_0x4f1506[_0x23b472(0x17e)]),{lockData:_0x19d3ca,appLock:_0x2ea86e}=ensureLockScope(_0x337b67??createEmptyBffLock(),_0x3912dc[_0x23b472(0x1d6)],_0x4f1506['scriptsRoot'],_0x23b472(0x170)),_0x3bf888=normalizeBffType(_0x3912dc['str']('type'))??undefined;if(_0x3912dc['str'](_0x23b472(0x193))&&!_0x3bf888)throw CliErrors[_0x23b472(0x162)](_0x23b472(0x1b5));const [_0x1a8124,_0x2e1930]=await Promise[_0x23b472(0x1ab)]([listBffScripts(_0x3912dc['appCode'],_0x3bf888),getBffScriptStatistics(_0x3912dc[_0x23b472(0x1d6)])]);if(_0x1a8124[_0x23b472(0x16a)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'conflicts':[],'failed':[]},'message':_0x23b472(0x173)};const _0x2f023f=_0x3912dc['bool'](_0x23b472(0x17a));if(_0x2f023f&&!_0x3912dc[_0x23b472(0x180)]){const _0x120e36=await confirmForce();if(!_0x120e36)throw CliErrors[_0x23b472(0x15c)](_0x23b472(0x19e));}if(_0x2f023f&&_0x3912dc['nonInteractive']){}const _0xb1887b=_0x1a8124['some'](_0x544265=>normalizeBffType(_0x544265[_0x23b472(0x1dd)])==='HOOK'),_0xd42c0a=_0xb1887b?buildDatasetCodeToAliasMap(_0x3912dc[_0x23b472(0x19b)],_0x3912dc[_0x23b472(0x1d6)],_0x3912dc[_0x23b472(0x184)]||_0x3912dc[_0x23b472(0x175)]?.['currentApp']||_0x3912dc[_0x23b472(0x175)]?.['defaultApp']):new Map(),_0x51cb60=createHookLocationMap(_0x2e1930),_0x4ef5c5=JSON[_0x23b472(0x18f)](JSON[_0x23b472(0x1cf)](_0x19d3ca)),_0x301500=_0x3912dc[_0x23b472(0x1d6)],_0x1e79f9=_0x4ef5c5['apps'][_0x301500];if(!_0x1e79f9)throw new Error(_0x23b472(0x1a3)+_0x301500+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x1e3c13=_0xb1887b?await applyHookDirectoryMigration(await planHookDirectoryMigration(_0x4f1506,_0x1e79f9,_0xd42c0a,await scanLocalBffFunctions(_0x4f1506,'HOOK')),_0x1e79f9):undefined,_0x2f86ca=createPullFileTransaction(),_0x1d7096=[],_0x88ef88=[],_0x281587=[],_0x24a3f3=[];for(const _0x19b318 of _0x1a8124){const _0x1d4bfb=resolveRemoteScriptTarget(_0x4f1506,_0x19b318,_0x51cb60,_0x1e79f9[_0x23b472(0x17c)],_0xd42c0a);if(!_0x1d4bfb){_0x88ef88['push']({'lockKey':_0x19b318[_0x23b472(0x1dd)]+'/'+_0x19b318[_0x23b472(0x1c7)],'reason':_0x23b472(0x1c6)});continue;}const _0x4a19cf=_0x1e79f9[_0x23b472(0x17c)][_0x1d4bfb[_0x23b472(0x1ad)]];try{if(!_0x19b318['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x19b318[_0x23b472(0x166)]==null)throw new Error(_0x23b472(0x157));const _0x1ff23f=_0x19b318['scriptContent'],_0x5f5cc7=computeContentHash(_0x1ff23f);if(!_0x2f023f){const _0x13320a=await hasUnsyncedLocalChanges(_0x1d4bfb['filePath'],_0x4a19cf,_0x5f5cc7);if(_0x13320a){_0x281587[_0x23b472(0x18e)](localUnsyncedConflict(_0x1d4bfb,_0x19b318['id']));continue;}}await _0x2f86ca[_0x23b472(0x1d9)](_0x1d4bfb[_0x23b472(0x186)],_0x1ff23f);const _0x510089={'hash':_0x5f5cc7,'remoteId':_0x19b318['id'],'version':_0x19b318['version']};_0x1d4bfb[_0x23b472(0x193)]===_0x23b472(0x191)&&_0x1d4bfb[_0x23b472(0x1d3)]&&(_0x510089[_0x23b472(0x194)]=_0x1d4bfb[_0x23b472(0x1d3)][_0x23b472(0x194)],_0x510089['datasetCode']=_0x1d4bfb['hookLocation'][_0x23b472(0x1c0)],_0x510089['operationType']=_0x1d4bfb[_0x23b472(0x1d3)][_0x23b472(0x1bc)],_0x510089[_0x23b472(0x1b1)]=_0x1d4bfb[_0x23b472(0x1d3)][_0x23b472(0x1b1)]),_0x1e79f9[_0x23b472(0x17c)][_0x1d4bfb[_0x23b472(0x1ad)]]=_0x510089,_0x1d7096[_0x23b472(0x18e)]({'lockKey':_0x1d4bfb[_0x23b472(0x1ad)],'remoteId':_0x19b318['id']});}catch(_0x542d78){_0x24a3f3[_0x23b472(0x18e)]({'lockKey':_0x1d4bfb[_0x23b472(0x1ad)],'error':_0x542d78 instanceof Error?_0x542d78[_0x23b472(0x14c)]:String(_0x542d78)});}}_0x1e79f9[_0x23b472(0x16e)]=new Date()[_0x23b472(0x1b8)]();try{await writeBffLockFile(_0x4f1506[_0x23b472(0x17e)],_0x4ef5c5);}catch(_0x2af6bb){const _0x2b0cb8=[...await _0x2f86ca[_0x23b472(0x1da)](),...await _0x1e3c13?.[_0x23b472(0x1da)]()??[]];throw withRollbackErrors(_0x2af6bb,'Failed\x20to\x20write\x20the\x20Backend\x20Function\x20lock\x20file;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x2b0cb8);}return{'ok':_0x24a3f3['length']===0x0,'data':{'pulled':_0x1d7096,'skipped':_0x88ef88,'conflicts':_0x281587,'failed':_0x24a3f3},'message':formatPullMessage(_0x1d7096[_0x23b472(0x16a)],_0x88ef88['length'],_0x281587['length'],_0x24a3f3[_0x23b472(0x16a)])};}};function localUnsyncedConflict(_0x5c725d,_0xab7697){const _0x47bb57=a43_0x27f8d1,_0x9b1552=_0x5c725d[_0x47bb57(0x1ad)][_0x47bb57(0x171)]('/')['at'](-0x1);return{'code':'BFF_LOCAL_UNSYNCED','lockKey':_0x5c725d[_0x47bb57(0x1ad)],'filePath':_0x5c725d['filePath'],..._0xab7697!=null?{'remoteId':_0xab7697}:{},'message':_0x47bb57(0x15a),'nextAction':{'action':_0x47bb57(0x177),'command':CLI_BIN_NAME+_0x47bb57(0x1ae)+_0x5c725d['type']+_0x47bb57(0x1bf)+_0x9b1552+_0x47bb57(0x188),'requiresReview':!![],'message':_0x47bb57(0x1c2)}};}function formatPullMessage(_0x3246a8,_0x1bb502,_0x5f4c67,_0xf6cfcf){const _0x519cb6=a43_0x27f8d1,_0x4a447f=['Pull\x20complete:\x20'+_0x3246a8+_0x519cb6(0x155),_0x1bb502+_0x519cb6(0x1a5)];_0x5f4c67>0x0&&_0x4a447f[_0x519cb6(0x18e)](_0x5f4c67+'\x20conflict'+(_0x5f4c67===0x1?'':'s')+'\x20'+(_0x5f4c67===0x1?_0x519cb6(0x1d4):'require')+'\x20resolution');if(_0xf6cfcf>0x0)_0x4a447f[_0x519cb6(0x18e)](_0xf6cfcf+_0x519cb6(0x152));return _0x4a447f[_0x519cb6(0x174)](',\x20');}async function hasUnsyncedLocalChanges(_0x5930,_0x273b49,_0x755c48){const _0x2683dc=a43_0x27f8d1;if(!await fileExists(_0x5930))return![];const _0x4aab34=await computeFileHash(_0x5930);if(!_0x273b49)return _0x755c48?_0x4aab34!==_0x755c48:!![];return _0x4aab34!==_0x273b49[_0x2683dc(0x1a4)];}function createPullFileTransaction(){const _0x5954bc=new Map(),_0x58d838=async(_0x2f491f,_0x5c5241)=>{const _0x1896da=a43_0x7e08;try{if(_0x5c5241[_0x1896da(0x149)])await ensureParentDirectory(_0x2f491f),await writeFile(_0x2f491f,_0x5c5241[_0x1896da(0x156)]);else try{await unlink(_0x2f491f);}catch(_0x357be4){if(_0x357be4[_0x1896da(0x1aa)]!==_0x1896da(0x160))throw _0x357be4;}return undefined;}catch(_0x9669b1){return _0x9669b1 instanceof Error?_0x9669b1:new Error(String(_0x9669b1));}};return{async 'write'(_0x157320,_0x2a344e){const _0x369880=a43_0x7e08;if(!_0x5954bc['has'](_0x157320))try{_0x5954bc[_0x369880(0x1a8)](_0x157320,{'existed':!![],'content':await readFile(_0x157320)});}catch(_0x755c0d){if(_0x755c0d['code']!==_0x369880(0x160))throw _0x755c0d;_0x5954bc[_0x369880(0x1a8)](_0x157320,{'existed':![]});}try{await ensureParentDirectory(_0x157320),await writeFile(_0x157320,_0x2a344e,_0x369880(0x1b0));}catch(_0x3421bc){const _0x59afc7=await _0x58d838(_0x157320,_0x5954bc[_0x369880(0x15f)](_0x157320));if(!_0x59afc7)_0x5954bc[_0x369880(0x1b9)](_0x157320);throw withRollbackErrors(_0x3421bc,_0x369880(0x1a7)+_0x157320+'\x22.',_0x59afc7?[_0x59afc7]:[]);}},async 'rollback'(){const _0x2d6f17=a43_0x7e08,_0x2b2053=[];for(const [_0x1a8bb7,_0x4ae69e]of[..._0x5954bc[_0x2d6f17(0x18b)]()][_0x2d6f17(0x19c)]()){const _0x3d161e=await _0x58d838(_0x1a8bb7,_0x4ae69e);_0x3d161e&&_0x2b2053[_0x2d6f17(0x18e)](new Error(_0x2d6f17(0x1cd)+_0x1a8bb7+_0x2d6f17(0x1be)+_0x3d161e[_0x2d6f17(0x14c)]));}return _0x2b2053;}};}function withRollbackErrors(_0x3f0b7f,_0x5ae34c,_0xdd61ad){const _0x1f6d1c=a43_0x27f8d1,_0x4a9eab=_0x3f0b7f instanceof Error?_0x3f0b7f:new Error(String(_0x3f0b7f));if(_0xdd61ad[_0x1f6d1c(0x16a)]===0x0)return _0x4a9eab;return new AggregateError([_0x4a9eab,..._0xdd61ad],_0x5ae34c+_0x1f6d1c(0x167)+_0xdd61ad[_0x1f6d1c(0x1b3)](_0x382469=>_0x382469[_0x1f6d1c(0x14c)])[_0x1f6d1c(0x174)](';\x20'));}function buildDatasetCodeToAliasMap(_0x4baf42,_0xc82e4a,_0x36d93f){const _0xfdd774=a43_0x27f8d1,_0x3dae37=resolveApiModelSource(_0x4baf42,_0xc82e4a,_0x36d93f),_0x3da54b=loadAliasMap(_0x4baf42,undefined,_0x3dae37[_0xfdd774(0x186)],_0x3dae37[_0xfdd774(0x14b)]);return assertUnambiguousHookAliases(_0x3da54b),new Map(_0x3da54b[_0xfdd774(0x1b3)](_0x27e2bc=>[_0x27e2bc[_0xfdd774(0x1c0)]['toLowerCase'](),_0x27e2bc['alias']]));}async function planHookDirectoryMigration(_0x13bc75,_0x3cf4ce,_0x27c476,_0x44824d){const _0x393464=a43_0x27f8d1,_0x4654bf=new Map();for(const [_0x43b45b,_0x55bc21]of Object['entries'](_0x3cf4ce[_0x393464(0x17c)])){const [_0x14834b,_0x25b6eb,_0xbd58e2,_0x2c072e,_0x275135,..._0x308ecb]=_0x43b45b[_0x393464(0x171)]('/');if(_0x14834b!=='HOOK'||!_0x25b6eb||!_0xbd58e2||!_0x2c072e||!_0x275135||_0x308ecb[_0x393464(0x16a)]>0x0||!_0x55bc21['datasetCode'])continue;const _0x465d0a=_0x27c476[_0x393464(0x15f)](_0x55bc21[_0x393464(0x1c0)][_0x393464(0x169)]()),_0x452c06=_0x465d0a??_0x55bc21[_0x393464(0x1c0)];if(!isSafeHookDirectorySegment(_0x25b6eb))throw CliErrors[_0x393464(0x162)]('Cannot\x20migrate\x20unsafe\x20HOOK\x20directory\x20\x22'+_0x25b6eb+_0x393464(0x192));if(!isSafeHookDirectorySegment(_0x452c06))throw CliErrors[_0x393464(0x162)](_0x393464(0x16c)+_0x25b6eb+_0x393464(0x1af));if(_0x25b6eb===_0x452c06)continue;const _0x294ec1=_0x4654bf[_0x393464(0x15f)](_0x25b6eb)??{'datasetCode':_0x55bc21[_0x393464(0x1c0)],'alias':_0x465d0a,'keyChanges':[]};if(_0x294ec1[_0x393464(0x1c0)]!==_0x55bc21[_0x393464(0x1c0)])throw CliErrors[_0x393464(0x162)]('Cannot\x20migrate\x20HOOK\x20directory\x20\x22'+_0x25b6eb+'\x22:\x20it\x20is\x20tracked\x20by\x20multiple\x20Datasets.');const _0x35c01a=_0x393464(0x18c)+_0x452c06+'/'+_0xbd58e2+'/'+_0x2c072e+'/'+_0x275135;try{resolveLocalFilePathFromLockKey(_0x13bc75,_0x43b45b),resolveLocalFilePathFromLockKey(_0x13bc75,_0x35c01a);}catch(_0x2a29aa){throw CliErrors[_0x393464(0x162)](_0x393464(0x198)+_0x43b45b+'\x22:\x20'+(_0x2a29aa instanceof Error?_0x2a29aa['message']:String(_0x2a29aa)));}_0x294ec1[_0x393464(0x190)][_0x393464(0x18e)]({'oldLockKey':_0x43b45b,'newLockKey':_0x35c01a,'entry':_0x55bc21}),_0x4654bf[_0x393464(0x1a8)](_0x25b6eb,_0x294ec1);}const _0x3b53c5=new Set([..._0x4654bf['values']()][_0x393464(0x181)](_0x29abd6=>_0x29abd6['keyChanges'][_0x393464(0x1b3)](_0x12ec3e=>_0x12ec3e[_0x393464(0x1b6)]))),_0x242e80=new Map(),_0x3a0164=new Map();for(const [_0x43974c,_0x152bf4]of _0x4654bf){const _0x215067=_0x152bf4[_0x393464(0x194)]??_0x152bf4[_0x393464(0x1c0)],_0xeadcfb=hookDirectoryIdentity(_0x215067),_0x136a46=_0x242e80[_0x393464(0x15f)](_0xeadcfb);if(_0x136a46&&_0x136a46!==_0x43974c)throw CliErrors[_0x393464(0x162)](_0x393464(0x199)+_0x136a46+_0x393464(0x165)+_0x43974c+_0x393464(0x151)+_0x215067+_0x393464(0x172));_0x242e80['set'](_0xeadcfb,_0x43974c);for(const _0x518712 of _0x152bf4['keyChanges']){const _0xf7d6d7=_0x3a0164[_0x393464(0x15f)](_0x518712[_0x393464(0x146)]);if(_0xf7d6d7&&_0xf7d6d7!==_0x518712['oldLockKey'])throw CliErrors['validation']('Cannot\x20migrate\x20HOOK\x20lock\x20keys\x20\x22'+_0xf7d6d7+_0x393464(0x165)+_0x518712[_0x393464(0x1b6)]+_0x393464(0x151)+_0x518712['newLockKey']+'\x22.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.');if(_0x3b53c5[_0x393464(0x189)](_0x518712[_0x393464(0x146)]))throw CliErrors['validation'](_0x393464(0x182)+_0x518712[_0x393464(0x1b6)]+_0x393464(0x197)+_0x518712[_0x393464(0x146)]+_0x393464(0x1a6));_0x3a0164[_0x393464(0x1a8)](_0x518712[_0x393464(0x146)],_0x518712[_0x393464(0x1b6)]);}}const _0x40d254=new Map();for(const [_0x7af792,_0xbd402d]of _0x27c476){_0x40d254['set'](hookDirectoryIdentity(_0xbd402d),_0x7af792);}const _0x371e30=[];for(const [_0x443f4f,_0x4f50dc]of _0x4654bf){const _0x15203d=_0x4f50dc[_0x393464(0x194)]??_0x4f50dc[_0x393464(0x1c0)],_0xc25484=join(_0x13bc75['scriptsRootDir'],'HOOK',_0x443f4f),_0x1b8034=join(_0x13bc75['scriptsRootDir'],_0x393464(0x191),_0x15203d),_0x33b6a2=await directoryExists(_0xc25484),_0x1cfc51=await directoryExists(_0x1b8034),_0x20c344=_0x33b6a2?_0x1cfc51?await sameDirectory(_0xc25484,_0x1b8034)?_0x393464(0x17f):undefined:_0x393464(0x153):_0x393464(0x1d2);if(!_0x20c344)throw CliErrors[_0x393464(0x162)](_0x393464(0x16c)+_0x443f4f+'\x22\x20to\x20\x22'+_0x15203d+_0x393464(0x163));const _0x362742=_0x40d254[_0x393464(0x15f)](hookDirectoryIdentity(_0x443f4f));if(_0x362742&&_0x362742!==_0x4f50dc[_0x393464(0x1c0)][_0x393464(0x169)]()){const _0x201940=new Set(_0x4f50dc['keyChanges']['map'](_0x1f79dc=>_0x1f79dc[_0x393464(0x1b6)])),_0x49e405=_0x44824d[_0x393464(0x185)](_0x65eaeb=>_0x65eaeb[_0x393464(0x193)]===_0x393464(0x191)&&_0x65eaeb['alias']!=null&&hookDirectoryIdentity(_0x65eaeb[_0x393464(0x194)])===hookDirectoryIdentity(_0x443f4f)&&!_0x201940['has'](_0x65eaeb['lockKey']));if(_0x49e405[_0x393464(0x16a)]>0x0)throw CliErrors[_0x393464(0x162)](_0x393464(0x16c)+_0x443f4f+_0x393464(0x19d));}const _0x15760b=_0x40d254[_0x393464(0x15f)](hookDirectoryIdentity(_0x15203d));if(_0x15760b&&_0x15760b!==_0x4f50dc[_0x393464(0x1c0)]['toLowerCase']())throw CliErrors['validation'](_0x393464(0x16c)+_0x443f4f+_0x393464(0x159)+_0x15203d+_0x393464(0x1c5));for(const _0x4ab9c7 of _0x4f50dc[_0x393464(0x190)]){const _0x57a42f=_0x3cf4ce[_0x393464(0x17c)][_0x4ab9c7[_0x393464(0x146)]];if(_0x57a42f&&!_0x3b53c5['has'](_0x4ab9c7['newLockKey'])&&!sameHookIdentity(_0x4ab9c7[_0x393464(0x1ca)],_0x57a42f))throw CliErrors[_0x393464(0x162)](_0x393464(0x16c)+_0x443f4f+_0x393464(0x159)+_0x15203d+_0x393464(0x154));}_0x371e30[_0x393464(0x18e)]({'oldDirectory':_0x443f4f,'newDirectory':_0x15203d,'oldDirectoryPath':_0xc25484,'newDirectoryPath':_0x1b8034,'mode':_0x20c344,'alias':_0x4f50dc[_0x393464(0x194)],'keyChanges':_0x4f50dc[_0x393464(0x190)]});}const _0x4cf6f1={..._0x3cf4ce['functions']},_0x5cbf4b=new Map(),_0x1d508b=new Map();for(const _0x597274 of _0x371e30){const _0x559060=_0x597274[_0x393464(0x1b2)]!=='rekey';_0x559060&&_0x1d508b[_0x393464(0x1a8)](hookDirectoryIdentity(_0x597274['newDirectory']),_0x597274[_0x393464(0x16d)]);for(const _0x5392ed of _0x597274[_0x393464(0x190)]){const _0x1650c4=_0x4cf6f1[_0x5392ed[_0x393464(0x146)]],_0x4fd37c=_0x559060?_0x5392ed['entry']:_0x1650c4??_0x5392ed[_0x393464(0x1ca)];_0x4cf6f1[_0x5392ed[_0x393464(0x146)]]=canonicalizeHookEntry(_0x4fd37c,_0x597274['alias']),delete _0x4cf6f1[_0x5392ed['oldLockKey']],_0x559060&&_0x5cbf4b[_0x393464(0x1a8)](_0x5392ed[_0x393464(0x146)],resolveLocalFilePathFromLockKey(_0x13bc75,_0x5392ed['oldLockKey']));}}return{'migrations':_0x371e30,'projectedFunctions':_0x4cf6f1,'sourceFilePathByNewLockKey':_0x5cbf4b,'sourceDirectoryPathByNewDirectory':_0x1d508b};}function resolveMigratedSourceFilePath(_0x56d53a,_0x5f7d76){const _0x5cb5e4=a43_0x27f8d1;if(!_0x56d53a||!_0x5f7d76)return undefined;const _0x269691=_0x56d53a[_0x5cb5e4(0x1de)][_0x5cb5e4(0x15f)](_0x5f7d76[_0x5cb5e4(0x1ad)]);if(_0x269691)return _0x269691;if(_0x5f7d76[_0x5cb5e4(0x193)]!=='HOOK')return undefined;const [,_0x52f787,..._0x4ccfc7]=_0x5f7d76[_0x5cb5e4(0x1ad)]['split']('/');if(!_0x52f787||_0x4ccfc7[_0x5cb5e4(0x16a)]===0x0)return undefined;const _0x51ec8b=_0x56d53a[_0x5cb5e4(0x18a)]['get'](hookDirectoryIdentity(_0x52f787));return _0x51ec8b?join(_0x51ec8b,..._0x4ccfc7)+_0x5cb5e4(0x1b4):undefined;}function sameHookIdentity(_0x5d9e5e,_0x474b29){const _0x2b9013=a43_0x27f8d1;return _0x5d9e5e[_0x2b9013(0x1c1)]===_0x474b29[_0x2b9013(0x1c1)]&&_0x5d9e5e[_0x2b9013(0x1c0)]===_0x474b29['datasetCode']&&_0x5d9e5e[_0x2b9013(0x1bc)]===_0x474b29[_0x2b9013(0x1bc)]&&_0x5d9e5e[_0x2b9013(0x1b1)]===_0x474b29[_0x2b9013(0x1b1)];}function canonicalizeHookEntry(_0x4fdd10,_0x599d02){const {alias:_0x42df26,..._0x2984ab}=_0x4fdd10;return _0x599d02?{..._0x2984ab,'alias':_0x599d02}:_0x2984ab;}function hookDirectoryIdentity(_0x2dd194){const _0x245cc9=a43_0x27f8d1;return _0x2dd194['normalize'](_0x245cc9(0x1bb))[_0x245cc9(0x169)]();}function isSafeHookDirectorySegment(_0x5131b7){return isSafeLockKeySegment(_0x5131b7);}async function sameDirectory(_0x566b38,_0x31a9bb){const _0x35cbe6=a43_0x27f8d1,[_0x5c3ad4,_0x7f32d]=await Promise[_0x35cbe6(0x1ab)]([stat(_0x566b38),stat(_0x31a9bb)]);return _0x5c3ad4[_0x35cbe6(0x187)]===_0x7f32d['dev']&&_0x5c3ad4[_0x35cbe6(0x15b)]===_0x7f32d['ino'];}function a43_0x395a(){const _0x5333c6=['pull','split','\x22.\x20Resolve\x20the\x20directories\x20manually\x20before\x20retrying.','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','join','mergedCli','currentApp','push_local','.hook-directory-migrate-','stderr','force','356527kMGqiU','functions','trim','lockFilePath','case-rename','nonInteractive','flatMap','Cannot\x20migrate\x20HOOK\x20lock\x20key\x20\x22','scriptsRoot','selectedAppName','filter','filePath','dev','\x20--format\x20compress','has','sourceDirectoryPathByNewDirectory','entries','HOOK/','198RbqEhA','push','parse','keyChanges','HOOK','\x22\x20from\x20the\x20lock\x20file.','type','alias','3230283gyZsmW','\x22\x20from\x20\x22','\x22:\x20its\x20target\x20\x22','Cannot\x20migrate\x20unsafe\x20HOOK\x20lock\x20key\x20\x22','Cannot\x20migrate\x20HOOK\x20directories\x20\x22','2FmErmS','apiDir','reverse','\x22:\x20it\x20is\x20now\x20another\x20Dataset\x20alias\x20and\x20contains\x20untracked\x20scripts.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','Force\x20pull\x20cancelled.','Failed\x20to\x20rename\x20HOOK\x20directory\x20\x22','\x22;\x20temporary\x20directory\x20\x22','defaultApp','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','Lock\x20scope\x20for\x20app\x20\x22','hash','\x20skipped','\x22\x20is\x20another\x20legacy\x20key\x20being\x20migrated.\x20Resolve\x20the\x20lock\x20entries\x20manually\x20before\x20retrying.','Failed\x20to\x20write\x20local\x20script\x20\x22','set','\x22\x20may\x20remain.','code','all','str','lockKey','\x20bff\x20push\x20--type\x20','\x22:\x20its\x20target\x20directory\x20is\x20unsafe.','utf8','functionNode','mode','map','.js','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','oldLockKey','question','toISOString','delete','266664tlfuuQ','NFC','operationType','skipped','\x22:\x20','\x20--name\x20','datasetCode','remoteId','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.','some','newDirectory','\x22:\x20the\x20destination\x20is\x20another\x20Dataset\x20alias.\x20Resolve\x20the\x20directory\x20manually\x20before\x20retrying.','unresolvable\x20target\x20path','functionName','includes','read','entry','Force\x20overwrite\x20local\x20unsynced\x20changes','newDirectoryPath','Could\x20not\x20restore\x20local\x20script\x20\x22','3390tujokZ','stringify','Could\x20not\x20restore\x20HOOK\x20directory\x20\x22','Could\x20not\x20restore\x20temporary\x20HOOK\x20directory\x20\x22','rekey','hookLocation','requires','9geKftS','appCode','would_pull','projectedFunctions','write','rollback','3468qcVMGx','Would\x20inspect\x20','scriptType','sourceFilePathByNewLockKey','newLockKey','bff','84050YOwAjb','existed','GET','profileName','message','COMMON','4069RCEnvK','yes','/api/management/library/scripts/list?appCode=','\x22:\x20both\x20target\x20\x22','\x20failed','move','\x22:\x20target\x20lock\x20key\x20is\x20already\x20bound\x20to\x20another\x20script.','\x20pulled','content','Remote\x20script\x20missing\x20content.','oldDirectory','\x22\x20to\x20\x22','Local\x20script\x20differs\x20from\x20the\x20last\x20pulled\x20version.\x20Review\x20it\x20before\x20choosing\x20the\x20source\x20of\x20truth.','ino','cancelled','boolean','&type=','get','ENOENT','migrations','validation','\x22:\x20the\x20target\x20directory\x20already\x20exists.\x20Resolve\x20the\x20directories\x20and\x20retry.','stdin','\x22\x20and\x20\x22','scriptContent','\x20Recovery\x20errors:\x20','1000792RGxDIE','toLowerCase','length','895Aqhaft','Cannot\x20migrate\x20HOOK\x20directory\x20\x22','oldDirectoryPath','lastSync','8rvVuVf'];a43_0x395a=function(){return _0x5333c6;};return a43_0x395a();}async function applyHookDirectoryMigration(_0x2fcf23,_0xf060e0){const _0x32767e=a43_0x27f8d1,_0x1dd855=_0xf060e0[_0x32767e(0x17c)],_0x5aa4fe=_0xf060e0[_0x32767e(0x16e)],_0x3a05d6=[],_0x1b50f3=async()=>{const _0x15fe69=_0x32767e,_0x498e6f=[];_0xf060e0[_0x15fe69(0x17c)]=_0x1dd855,_0xf060e0[_0x15fe69(0x16e)]=_0x5aa4fe;for(const {migration:_0x2e1f4a,temporaryPath:_0x3a7d78}of[..._0x3a05d6][_0x15fe69(0x19c)]()){try{_0x3a7d78?(await rename(_0x2e1f4a[_0x15fe69(0x1cc)],_0x3a7d78),await rename(_0x3a7d78,_0x2e1f4a['oldDirectoryPath'])):await rename(_0x2e1f4a[_0x15fe69(0x1cc)],_0x2e1f4a[_0x15fe69(0x16d)]);}catch(_0x4c0119){_0x498e6f[_0x15fe69(0x18e)](new Error(_0x15fe69(0x1d0)+_0x2e1f4a[_0x15fe69(0x158)]+_0x15fe69(0x196)+_0x2e1f4a[_0x15fe69(0x1c4)]+_0x15fe69(0x1be)+(_0x4c0119 instanceof Error?_0x4c0119[_0x15fe69(0x14c)]:String(_0x4c0119))));}}return _0x498e6f;};try{for(const _0x286b6c of _0x2fcf23[_0x32767e(0x161)]){if(_0x286b6c[_0x32767e(0x1b2)]==='move')await ensureParentDirectory(_0x286b6c['newDirectoryPath']),await rename(_0x286b6c[_0x32767e(0x16d)],_0x286b6c[_0x32767e(0x1cc)]),_0x3a05d6[_0x32767e(0x18e)]({'migration':_0x286b6c});else{if(_0x286b6c[_0x32767e(0x1b2)]===_0x32767e(0x17f)){const _0x8efd21=join(dirname(_0x286b6c['oldDirectoryPath']),_0x32767e(0x178)+randomUUID());await rename(_0x286b6c['oldDirectoryPath'],_0x8efd21);try{await rename(_0x8efd21,_0x286b6c[_0x32767e(0x1cc)]);}catch(_0x25830d){try{await rename(_0x8efd21,_0x286b6c['oldDirectoryPath']);}catch(_0x2395eb){throw withRollbackErrors(_0x25830d,_0x32767e(0x19f)+_0x286b6c['oldDirectory']+_0x32767e(0x159)+_0x286b6c[_0x32767e(0x1c4)]+_0x32767e(0x1a0)+_0x8efd21+_0x32767e(0x1a9),[new Error(_0x32767e(0x1d1)+_0x8efd21+_0x32767e(0x159)+_0x286b6c['oldDirectory']+_0x32767e(0x1be)+(_0x2395eb instanceof Error?_0x2395eb[_0x32767e(0x14c)]:String(_0x2395eb)))]);}throw _0x25830d;}_0x3a05d6['push']({'migration':_0x286b6c,'temporaryPath':_0x8efd21});}}}return _0xf060e0['functions']=_0x2fcf23[_0x32767e(0x1d8)],{'rollback':_0x1b50f3};}catch(_0x3243e0){const _0x50afdd=await _0x1b50f3();throw withRollbackErrors(_0x3243e0,'Failed\x20to\x20migrate\x20HOOK\x20directories;\x20local\x20changes\x20could\x20not\x20be\x20completely\x20rolled\x20back.',_0x50afdd);}}async function confirmForce(){const _0x28e91a=a43_0x27f8d1,_0x18ebea=createInterface({'input':process[_0x28e91a(0x164)],'output':process[_0x28e91a(0x179)]}),_0x56f697=await new Promise(_0x3fa172=>{const _0x8227cc=_0x28e91a;_0x18ebea[_0x8227cc(0x1b7)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x3fa172);});return _0x18ebea['close'](),['y',_0x28e91a(0x14f)][_0x28e91a(0x1c8)](_0x56f697[_0x28e91a(0x17d)]()[_0x28e91a(0x169)]());}