@lovrabet/rabetbase-cli 2.5.2 → 2.5.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (348) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.d.ts +1 -1
  4. package/lib/api/generate-api-file.js +1 -1
  5. package/lib/api/generate-sdk-config-file.d.ts +2 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/auth/auth-server-ui.js +1 -1
  8. package/lib/auth/auth-server.js +1 -1
  9. package/lib/auth/constant.js +1 -1
  10. package/lib/auth/get-cookie.js +1 -1
  11. package/lib/auth/get-session-user.js +1 -1
  12. package/lib/auth/is-session-valid.js +1 -1
  13. package/lib/auth/login-success-html.js +1 -1
  14. package/lib/auth/logout.js +1 -1
  15. package/lib/cli-flags.js +1 -1
  16. package/lib/cli.js +1 -1
  17. package/lib/commands/api/generate.js +1 -1
  18. package/lib/commands/api/index.js +1 -1
  19. package/lib/commands/api/list.js +1 -1
  20. package/lib/commands/api/pull.js +1 -1
  21. package/lib/commands/api/shared.js +1 -1
  22. package/lib/commands/app/index.js +1 -1
  23. package/lib/commands/app/list.js +1 -1
  24. package/lib/commands/app/members-list.js +1 -1
  25. package/lib/commands/app/remote-directory.js +1 -1
  26. package/lib/commands/app/shared.js +1 -1
  27. package/lib/commands/app-config/delete.js +1 -1
  28. package/lib/commands/app-config/get.js +1 -1
  29. package/lib/commands/app-config/index.js +1 -1
  30. package/lib/commands/app-config/list.js +1 -1
  31. package/lib/commands/app-config/set.js +1 -1
  32. package/lib/commands/app-config/shared.js +1 -1
  33. package/lib/commands/auth/index.js +1 -1
  34. package/lib/commands/bff/create.js +1 -1
  35. package/lib/commands/bff/delete.js +1 -1
  36. package/lib/commands/bff/detail.js +1 -1
  37. package/lib/commands/bff/index.js +1 -1
  38. package/lib/commands/bff/list.js +1 -1
  39. package/lib/commands/bff/pull.js +1 -1
  40. package/lib/commands/bff/push.js +1 -1
  41. package/lib/commands/bff/status.js +1 -1
  42. package/lib/commands/cli-skill/index.js +1 -1
  43. package/lib/commands/cli-update.js +1 -1
  44. package/lib/commands/codegen/index.js +1 -1
  45. package/lib/commands/codegen/sdk.js +1 -1
  46. package/lib/commands/codegen/sql.js +1 -1
  47. package/lib/commands/common/app-registry.js +1 -1
  48. package/lib/commands/common/app-selector.js +1 -1
  49. package/lib/commands/common/async-task.js +1 -1
  50. package/lib/commands/common/dry-run.js +1 -1
  51. package/lib/commands/common/flags.js +1 -1
  52. package/lib/commands/common/local-file.js +1 -1
  53. package/lib/commands/common/validate.js +1 -1
  54. package/lib/commands/config/delete.js +1 -1
  55. package/lib/commands/config/get.js +1 -1
  56. package/lib/commands/config/index.js +1 -1
  57. package/lib/commands/config/init.js +1 -1
  58. package/lib/commands/config/list.js +1 -1
  59. package/lib/commands/config/set.js +1 -1
  60. package/lib/commands/config/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/business-groups.js +1 -1
  63. package/lib/commands/dataset/capability.js +1 -1
  64. package/lib/commands/dataset/delete.js +1 -1
  65. package/lib/commands/dataset/detail.js +1 -1
  66. package/lib/commands/dataset/extend-update.js +1 -1
  67. package/lib/commands/dataset/field-restore.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  82. package/lib/commands/db/analysis-batching.js +1 -1
  83. package/lib/commands/db/analyze-batch-plan.js +1 -1
  84. package/lib/commands/db/analyze-cancel.js +1 -1
  85. package/lib/commands/db/analyze-start.js +1 -1
  86. package/lib/commands/db/analyze-status.js +1 -1
  87. package/lib/commands/db/create.js +1 -1
  88. package/lib/commands/db/delete.js +1 -1
  89. package/lib/commands/db/detail.js +1 -1
  90. package/lib/commands/db/diff-refresh-start.js +1 -1
  91. package/lib/commands/db/diff-refresh-status.js +1 -1
  92. package/lib/commands/db/diff.js +1 -1
  93. package/lib/commands/db/index.js +1 -1
  94. package/lib/commands/db/list.js +1 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/table-diff-shared.js +1 -1
  97. package/lib/commands/db/tables.js +1 -1
  98. package/lib/commands/db/test.js +1 -1
  99. package/lib/commands/db/update.js +1 -1
  100. package/lib/commands/deployment/index.js +1 -1
  101. package/lib/commands/deployment/sync-all.js +1 -1
  102. package/lib/commands/deployment/sync-jobs.js +1 -1
  103. package/lib/commands/deployment/sync-status.js +1 -1
  104. package/lib/commands/doctor.js +1 -1
  105. package/lib/commands/file/index.js +1 -1
  106. package/lib/commands/instant-api-policy/current.js +1 -1
  107. package/lib/commands/instant-api-policy/index.js +1 -1
  108. package/lib/commands/instant-api-policy/init.js +1 -1
  109. package/lib/commands/instant-api-policy/publish.js +1 -1
  110. package/lib/commands/instant-api-policy/pull.js +1 -1
  111. package/lib/commands/instant-api-policy/revision.js +1 -1
  112. package/lib/commands/instant-api-policy/revisions.js +1 -1
  113. package/lib/commands/instant-api-policy/rollback.js +1 -1
  114. package/lib/commands/instant-api-policy/shared.js +1 -1
  115. package/lib/commands/instant-api-policy/validate.js +1 -1
  116. package/lib/commands/issue/index.js +1 -1
  117. package/lib/commands/issue/nudge.js +1 -1
  118. package/lib/commands/issue/report.js +1 -1
  119. package/lib/commands/issue/shared.js +1 -1
  120. package/lib/commands/kb/create.js +1 -1
  121. package/lib/commands/kb/delete.js +1 -1
  122. package/lib/commands/kb/detail.js +1 -1
  123. package/lib/commands/kb/index.js +1 -1
  124. package/lib/commands/kb/list.js +1 -1
  125. package/lib/commands/kb/search.js +1 -1
  126. package/lib/commands/kb/shared.js +1 -1
  127. package/lib/commands/kb/update.js +1 -1
  128. package/lib/commands/logs/index.js +1 -1
  129. package/lib/commands/menu/asset-update.js +1 -1
  130. package/lib/commands/menu/delete.js +1 -1
  131. package/lib/commands/menu/external-link-create.js +1 -1
  132. package/lib/commands/menu/external-link-update.js +1 -1
  133. package/lib/commands/menu/group-create.js +1 -1
  134. package/lib/commands/menu/group-update.js +1 -1
  135. package/lib/commands/menu/index.js +1 -1
  136. package/lib/commands/menu/list.js +1 -1
  137. package/lib/commands/menu/move.js +1 -1
  138. package/lib/commands/menu/regroup-start.js +1 -1
  139. package/lib/commands/menu/rename.js +1 -1
  140. package/lib/commands/menu/shared/compare-table.js +1 -1
  141. package/lib/commands/menu/shared/delete-plan.js +1 -1
  142. package/lib/commands/menu/shared/facts.js +1 -1
  143. package/lib/commands/menu/shared/index.js +1 -1
  144. package/lib/commands/menu/shared/inquirer.js +1 -1
  145. package/lib/commands/menu/shared/local-pages.js +1 -1
  146. package/lib/commands/menu/shared/logic.js +1 -1
  147. package/lib/commands/menu/shared/mutations.js +1 -1
  148. package/lib/commands/menu/shared/service.js +1 -1
  149. package/lib/commands/menu/shared/sync-core.js +1 -1
  150. package/lib/commands/menu/shared/update-core.js +1 -1
  151. package/lib/commands/menu/shared/valid-url.js +1 -1
  152. package/lib/commands/menu/sync.js +1 -1
  153. package/lib/commands/menu/visibility-update.js +1 -1
  154. package/lib/commands/notification/config-create.js +1 -1
  155. package/lib/commands/notification/config-delete.js +1 -1
  156. package/lib/commands/notification/config-list.js +1 -1
  157. package/lib/commands/notification/config-update.js +1 -1
  158. package/lib/commands/notification/index.js +1 -1
  159. package/lib/commands/notification/shared.js +1 -1
  160. package/lib/commands/ocr/index.js +1 -1
  161. package/lib/commands/page/create.js +1 -1
  162. package/lib/commands/page/custom/detail.js +1 -1
  163. package/lib/commands/page/custom/list.js +1 -1
  164. package/lib/commands/page/custom/publish.js +1 -1
  165. package/lib/commands/page/custom/shared.js +1 -1
  166. package/lib/commands/page/custom/syntax.js +1 -1
  167. package/lib/commands/page/custom/update.js +1 -1
  168. package/lib/commands/page/data-list-status.js +1 -1
  169. package/lib/commands/page/generate-start.js +1 -1
  170. package/lib/commands/page/generate-status.js +1 -1
  171. package/lib/commands/page/index.js +1 -1
  172. package/lib/commands/page/pull.js +1 -1
  173. package/lib/commands/page/push.js +1 -1
  174. package/lib/commands/page/relation-audit.js +1 -1
  175. package/lib/commands/page/restore.js +1 -1
  176. package/lib/commands/page/shared.js +1 -1
  177. package/lib/commands/page/sync.js +1 -1
  178. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  179. package/lib/commands/project/create/format-elapsed.js +1 -1
  180. package/lib/commands/project/create/main.js +1 -1
  181. package/lib/commands/project/create/materialize-project-template.js +1 -1
  182. package/lib/commands/project/create/project-name.js +1 -1
  183. package/lib/commands/project/create/project-template-archive.js +1 -1
  184. package/lib/commands/project/create/project-template-path.js +1 -1
  185. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  186. package/lib/commands/project/create/use-format-code.js +1 -1
  187. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  188. package/lib/commands/project/domain-routing-sync.js +1 -1
  189. package/lib/commands/project/index.js +1 -1
  190. package/lib/commands/project/upgrade.js +1 -1
  191. package/lib/commands/registry.js +1 -1
  192. package/lib/commands/role/delete.js +1 -1
  193. package/lib/commands/role/detail.js +1 -1
  194. package/lib/commands/role/index.js +1 -1
  195. package/lib/commands/role/list.js +1 -1
  196. package/lib/commands/role/shared.js +1 -1
  197. package/lib/commands/role/update.js +1 -1
  198. package/lib/commands/role/user-add.js +1 -1
  199. package/lib/commands/role/user-remove.js +1 -1
  200. package/lib/commands/role/user-resolve.js +1 -1
  201. package/lib/commands/rule/get.js +1 -1
  202. package/lib/commands/rule/index.js +1 -1
  203. package/lib/commands/rule/list.js +1 -1
  204. package/lib/commands/rule/set.js +1 -1
  205. package/lib/commands/rule/shared.js +1 -1
  206. package/lib/commands/run/index.js +1 -1
  207. package/lib/commands/schema.js +1 -1
  208. package/lib/commands/sql/create.js +1 -1
  209. package/lib/commands/sql/delete.js +1 -1
  210. package/lib/commands/sql/detail.js +1 -1
  211. package/lib/commands/sql/exec.js +1 -1
  212. package/lib/commands/sql/index.js +1 -1
  213. package/lib/commands/sql/list.js +1 -1
  214. package/lib/commands/sql/pull.js +1 -1
  215. package/lib/commands/sql/push.js +1 -1
  216. package/lib/commands/sql/shared.js +1 -1
  217. package/lib/commands/sql/status.js +1 -1
  218. package/lib/commands/sql/validate.js +1 -1
  219. package/lib/commands/task/index.js +1 -1
  220. package/lib/commands/task/status.js +1 -1
  221. package/lib/commands/tenant/index.js +1 -1
  222. package/lib/commands/tenant/members-list.js +1 -1
  223. package/lib/commands/tenant/shared.js +1 -1
  224. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  225. package/lib/commands/user-account/index.js +1 -1
  226. package/lib/commands/workspace/add.js +1 -1
  227. package/lib/commands/workspace/index.js +1 -1
  228. package/lib/commands/workspace/remove.js +1 -1
  229. package/lib/config/domain-config.js +1 -1
  230. package/lib/config/project-domain-routing.js +1 -1
  231. package/lib/config/region-config.d.ts +23 -0
  232. package/lib/config/region-config.js +1 -0
  233. package/lib/config/schema.d.ts +15 -0
  234. package/lib/config/schema.js +1 -1
  235. package/lib/constant/cdn.js +1 -1
  236. package/lib/constant/cli.js +1 -1
  237. package/lib/constant/defaults.js +1 -1
  238. package/lib/constant/domain.js +1 -1
  239. package/lib/constant/env.js +1 -1
  240. package/lib/constant/output.js +1 -1
  241. package/lib/constant/paths.js +1 -1
  242. package/lib/constant/region.js +1 -1
  243. package/lib/constant/risk.js +1 -1
  244. package/lib/constant/routing-profile.js +1 -1
  245. package/lib/context/app-resolver.d.ts +6 -0
  246. package/lib/context/app-resolver.js +1 -1
  247. package/lib/context/auth-resolver.js +1 -1
  248. package/lib/context/config-loader.js +1 -1
  249. package/lib/context.d.ts +13 -0
  250. package/lib/context.js +1 -1
  251. package/lib/core/alias-resolver.js +1 -1
  252. package/lib/core/api-client.d.ts +2 -0
  253. package/lib/core/api-client.js +1 -1
  254. package/lib/core/bff/config.js +1 -1
  255. package/lib/core/bff/file-system.js +1 -1
  256. package/lib/core/bff/hash.js +1 -1
  257. package/lib/core/bff/lock.js +1 -1
  258. package/lib/core/bff/utils.js +1 -1
  259. package/lib/core/db-resolver.js +1 -1
  260. package/lib/core/instant-api-policy/config.js +1 -1
  261. package/lib/core/kb-search-client.js +1 -1
  262. package/lib/core/page/file-system.js +1 -1
  263. package/lib/core/page/hash.js +1 -1
  264. package/lib/core/page/lock.js +1 -1
  265. package/lib/core/page/lr-smart-jsx.d.ts +6 -0
  266. package/lib/core/page/lr-smart-jsx.js +1 -0
  267. package/lib/core/sql-index-auditor.js +1 -1
  268. package/lib/core/sql-sync/config.js +1 -1
  269. package/lib/core/sql-sync/file-system.js +1 -1
  270. package/lib/core/sql-sync/hash.js +1 -1
  271. package/lib/core/sql-sync/lock.js +1 -1
  272. package/lib/core/sql-sync/utils.js +1 -1
  273. package/lib/core/sql-validator.js +1 -1
  274. package/lib/errors.js +1 -1
  275. package/lib/framework/build-all-flags.js +1 -1
  276. package/lib/framework/error-output.js +1 -1
  277. package/lib/framework/explicit-yes.js +1 -1
  278. package/lib/framework/flags.js +1 -1
  279. package/lib/framework/help.js +1 -1
  280. package/lib/framework/index.js +1 -1
  281. package/lib/framework/output.js +1 -1
  282. package/lib/framework/response.js +1 -1
  283. package/lib/framework/runner-alias.js +1 -1
  284. package/lib/framework/runner.js +1 -1
  285. package/lib/framework/schema-export.js +1 -1
  286. package/lib/framework/supported-flags.js +1 -1
  287. package/lib/framework/types.js +1 -1
  288. package/lib/generated/build-info.d.ts +4 -4
  289. package/lib/generated/build-info.js +1 -1
  290. package/lib/generated/official-routing.js +1 -1
  291. package/lib/generated/routing-contract.js +1 -1
  292. package/lib/help.js +1 -1
  293. package/lib/postinstall.js +1 -1
  294. package/lib/runtime/confirmation.js +1 -1
  295. package/lib/runtime/event.js +1 -1
  296. package/lib/runtime/index.js +1 -1
  297. package/lib/runtime/queue.js +1 -1
  298. package/lib/runtime/resolve.js +1 -1
  299. package/lib/skills/builtin-skill.js +1 -1
  300. package/lib/skills/main.js +1 -1
  301. package/lib/skills/npx-skills-add.js +1 -1
  302. package/lib/skills/skill-presence.js +1 -1
  303. package/lib/telemetry/cli-command-trace.js +1 -1
  304. package/lib/telemetry/cli-help-trace.js +1 -1
  305. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  306. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  307. package/lib/telemetry/send-cli-trace-log.js +1 -1
  308. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  309. package/lib/types/index.d.ts +1 -1
  310. package/lib/utils/ai_config.js +1 -1
  311. package/lib/utils/apply-jq-filter.js +1 -1
  312. package/lib/utils/cdn-config.js +1 -1
  313. package/lib/utils/check-sdk-version.js +1 -1
  314. package/lib/utils/cli-version-check.js +1 -1
  315. package/lib/utils/cli-version-policy.js +1 -1
  316. package/lib/utils/config.d.ts +2 -8
  317. package/lib/utils/config.js +1 -1
  318. package/lib/utils/entity-with-id.js +1 -1
  319. package/lib/utils/file-utils.js +1 -1
  320. package/lib/utils/guides-cdn.js +1 -1
  321. package/lib/utils/http-client.js +1 -1
  322. package/lib/utils/is-non-interactive.js +1 -1
  323. package/lib/utils/logger.js +1 -1
  324. package/lib/utils/params.js +1 -1
  325. package/lib/utils/platform.js +1 -1
  326. package/lib/utils/sleep.js +1 -1
  327. package/lib/utils/template-replacer.d.ts +2 -1
  328. package/lib/utils/template-replacer.js +1 -1
  329. package/lib/utils/update-notice.js +1 -1
  330. package/lib/utils/version.js +1 -1
  331. package/lib/utils/with-active-cookie.js +1 -1
  332. package/lib/utils/write-cli-side-channel.js +1 -1
  333. package/package.json +1 -1
  334. package/skills/rabetbase/SKILL.md +6 -5
  335. package/skills/rabetbase/guides/page-development-workflow.md +3 -0
  336. package/skills/rabetbase/guides/sdk-client-generation.md +5 -5
  337. package/skills/rabetbase/knowledge/page-schema/LrSmartJsx.md +11 -3
  338. package/skills/rabetbase/references/rabetbase-api-pull.md +5 -4
  339. package/skills/rabetbase/references/rabetbase-app-list.md +3 -0
  340. package/skills/rabetbase/references/rabetbase-bff-list.md +1 -1
  341. package/skills/rabetbase/references/rabetbase-bff-pull.md +2 -0
  342. package/skills/rabetbase/references/rabetbase-bff-status.md +2 -0
  343. package/skills/rabetbase/references/rabetbase-config.md +10 -9
  344. package/skills/rabetbase/references/rabetbase-doctor.md +2 -2
  345. package/skills/rabetbase/references/rabetbase-page-push.md +5 -1
  346. package/skills/rabetbase/references/rabetbase-workspace.md +4 -2
  347. package/skills/rabetbase.manifest.json +3 -3
  348. package/templates/generate-api/client.ts.tpl +1 -1
@@ -1 +1 @@
1
- const a31_0x1b12c2=a31_0x1c57;(function(_0x2e7e2c,_0x1d1222){const _0x18b1f6=a31_0x1c57,_0x3c3284=_0x2e7e2c();while(!![]){try{const _0x4c086b=-parseInt(_0x18b1f6(0x12f))/0x1+parseInt(_0x18b1f6(0x127))/0x2+-parseInt(_0x18b1f6(0x148))/0x3*(parseInt(_0x18b1f6(0x153))/0x4)+-parseInt(_0x18b1f6(0x144))/0x5*(-parseInt(_0x18b1f6(0x115))/0x6)+-parseInt(_0x18b1f6(0x10a))/0x7*(parseInt(_0x18b1f6(0x132))/0x8)+-parseInt(_0x18b1f6(0x164))/0x9*(parseInt(_0x18b1f6(0x13b))/0xa)+parseInt(_0x18b1f6(0x149))/0xb;if(_0x4c086b===_0x1d1222)break;else _0x3c3284['push'](_0x3c3284['shift']());}catch(_0x24862f){_0x3c3284['push'](_0x3c3284['shift']());}}}(a31_0xe08c,0x341d8));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a31_0xe08c(){const _0x4d9a1a=['apiDir','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','/**\x0a\x20*\x20','Trigger\x20node\x20(HOOK\x20only)','\x20function:\x20','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','20jJTZDK','before','No\x20api.ts\x20found.\x20Run\x20`','alias','558537YhtGyb','9519411vCZNwT','validation','COMMON','operation-type','code','Function\x20name\x20(valid\x20JS\x20identifier)','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','Invalid\x20dataset\x20selection.','map','question','4HdnRoG','join','Available:\x20','/ENDPOINT/','keys','修改后的响应结果','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','operationType','Operation\x20type\x20(HOOK\x20only)','/HOOK/','type','source','read','entries','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Script\x20description','Alias\x20\x22','13653IHrJEt','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','ENDPOINT','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','stderr','Select\x20operation\x20type:','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','str','parseInt','/COMMON/','.js','stdin','No\x20operation\x20types\x20found\x20for\x20dataset\x20','appCode','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','11662eswjOr','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','includes','name','datasetCode','isInteger','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','修改后的请求参数','\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','314958WqoxRP','datasetcode','\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','nonInteractive','trim','\x0a\x20*\x20[平台配置]\x20','Select\x20dataset:','HOOK\x20requires\x20alias/operation/node\x20options.','scriptsRootDir','UNKNOWN','bff','Select\x20trigger\x20node:','Operation\x20type\x20\x22','\x22\x20not\x20found.\x20','Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','datasetId','No\x20datasets\x20found\x20for\x20this\x20app.','\x22,\x20params\x20})\x0a','108382uHZcAG','Invalid\x20function\x20name\x20\x22','\x22.\x20','HOOK','after','write','create','description','212068RrZtZS','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x20api\x20pull`\x20to\x20refresh.','600wSvLth','functionNode','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','string','Available\x20aliases:\x20','File\x20already\x20exists:\x20','length','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','close','2590CgWPCr','find'];a31_0xe08c=function(){return _0x4d9a1a;};return a31_0xe08c();}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a31_0x1c57(_0x278511,_0x42d1ed){_0x278511=_0x278511-0x108;const _0xe08cf7=a31_0xe08c();let _0x1c5747=_0xe08cf7[_0x278511];return _0x1c5747;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x1b12c2(0x11f),'command':a31_0x1b12c2(0x12d),'description':a31_0x1b12c2(0x123),'risk':a31_0x1b12c2(0x15f),'flags':[{'name':a31_0x1b12c2(0x15d),'type':'string','required':!![],'enum':[a31_0x1b12c2(0x14b),'ENDPOINT',a31_0x1b12c2(0x12a)],'description':'Script\x20type'},{'name':a31_0x1b12c2(0x10f),'type':a31_0x1b12c2(0x135),'required':!![],'description':a31_0x1b12c2(0x14e)},{'name':a31_0x1b12c2(0x12e),'type':a31_0x1b12c2(0x135),'description':a31_0x1b12c2(0x162)},{'name':a31_0x1b12c2(0x147),'type':a31_0x1b12c2(0x135),'description':a31_0x1b12c2(0x10d)},{'name':a31_0x1b12c2(0x116),'type':a31_0x1b12c2(0x135),'description':a31_0x1b12c2(0x108)},{'name':a31_0x1b12c2(0x14c),'type':'string','description':a31_0x1b12c2(0x15b)},{'name':'function-node','type':a31_0x1b12c2(0x135),'description':a31_0x1b12c2(0x140),'enum':[a31_0x1b12c2(0x145),'after']}],async 'validate'(_0x42af51){const _0x28a0f2=a31_0x1b12c2,_0x4b8cc4=_0x42af51[_0x28a0f2(0x16b)](_0x28a0f2(0x10f));if(!isValidBffFunctionName(_0x4b8cc4))throw CliErrors[_0x28a0f2(0x14a)](_0x28a0f2(0x128)+_0x4b8cc4+_0x28a0f2(0x13e));},async 'execute'(_0x36cefd){const _0x4fde60=a31_0x1b12c2,_0xd6aec4=loadBffProjectConfig(_0x36cefd[_0x4fde60(0x171)]),_0x6993ef=_0x36cefd[_0x4fde60(0x16b)](_0x4fde60(0x15d)),_0x4d8980=_0x36cefd['str'](_0x4fde60(0x10f)),_0x4c59fc=_0x36cefd[_0x4fde60(0x16b)](_0x4fde60(0x12e))||undefined,_0x24854c=_0x6993ef===_0x4fde60(0x12a)?await resolveHookOptions(_0xd6aec4,_0x36cefd):undefined,_0x5cc879=buildFilePath(_0xd6aec4,_0x6993ef,_0x4d8980,_0x24854c);if(await fileExists(_0x5cc879))throw CliErrors[_0x4fde60(0x14a)](_0x4fde60(0x137)+_0x5cc879);await mkdir(dirname(_0x5cc879),{'recursive':!![]});const _0x5033f8=generateTemplate(_0x6993ef,_0x4d8980,_0x36cefd['appCode'],_0x4c59fc,_0x24854c);await writeFile(_0x5cc879,_0x5033f8,'utf8');const _0x3c80a3={'type':_0x6993ef,'name':_0x4d8980,'path':_0x5cc879};if(_0x4c59fc)_0x3c80a3['description']=_0x4c59fc;if(_0x24854c){if(_0x24854c[_0x4fde60(0x147)])_0x3c80a3[_0x4fde60(0x147)]=_0x24854c[_0x4fde60(0x147)];_0x3c80a3[_0x4fde60(0x110)]=_0x24854c[_0x4fde60(0x110)],_0x3c80a3['operationType']=_0x24854c[_0x4fde60(0x15a)],_0x3c80a3[_0x4fde60(0x133)]=_0x24854c[_0x4fde60(0x133)];}return{'ok':!![],'data':_0x3c80a3,'message':'Created\x20'+_0x6993ef+_0x4fde60(0x141)+_0x4d8980};}};async function resolveHookOptions(_0x19a100,_0x20b800){const _0x471928=a31_0x1b12c2,_0x14afcd=loadAliasMap(_0x20b800[_0x471928(0x13d)],undefined,resolveApiFilePath(_0x20b800['apiDir'],_0x20b800['appCode'])),_0xdd1e65=_0x14afcd[_0x471928(0x138)]>0x0;let _0x510352,_0x165f1a,_0x300a7c;const _0x3cec52=_0x20b800[_0x471928(0x16b)](_0x471928(0x147)),_0x38b227=_0x20b800['str'](_0x471928(0x116));if(_0x3cec52){const _0x1f2776=resolveAlias(_0x20b800[_0x471928(0x13d)],_0x3cec52,undefined,resolveApiFilePath(_0x20b800[_0x471928(0x13d)],_0x20b800[_0x471928(0x171)]));if(!_0x1f2776){const _0x559332=_0xdd1e65?_0x471928(0x136)+_0x14afcd[_0x471928(0x151)](_0x933509=>_0x933509[_0x471928(0x147)])[_0x471928(0x154)](',\x20'):_0x471928(0x146)+CLI_BIN_NAME+_0x471928(0x109);throw CliErrors[_0x471928(0x14a)](_0x471928(0x163)+_0x3cec52+_0x471928(0x122)+_0x559332);}_0x510352=_0x3cec52,_0x165f1a=_0x1f2776;}else{if(_0x38b227){_0x165f1a=_0x38b227;const _0x2142a7=_0x14afcd[_0x471928(0x13c)](_0x50cdd0=>_0x50cdd0['datasetCode']===_0x38b227);_0x510352=_0x2142a7?.['alias'];}else{if(_0x20b800['nonInteractive'])throw CliErrors[_0x471928(0x14a)](_0x471928(0x10b));else{if(_0xdd1e65){const _0x35150e=_0x14afcd[_0x471928(0x151)](_0x519a4e=>_0x519a4e[_0x471928(0x147)]+'\x20('+_0x519a4e['tableName']+')'),_0x209eb2=await promptSelect(_0x471928(0x11b),_0x35150e),_0x564ed2=_0x14afcd[_0x209eb2];if(!_0x564ed2)throw CliErrors[_0x471928(0x14a)](_0x471928(0x150));_0x510352=_0x564ed2[_0x471928(0x147)],_0x165f1a=_0x564ed2[_0x471928(0x110)];}else{const _0x5d8573=await listDatasets(_0x20b800[_0x471928(0x171)]);if(_0x5d8573[_0x471928(0x138)]===0x0)throw CliErrors[_0x471928(0x14a)](_0x471928(0x125));const _0x200402=_0x5d8573['map'](_0x1df676=>_0x1df676[_0x471928(0x10f)]+'\x20['+(_0x1df676[_0x471928(0x15e)]??_0x471928(0x11e))+']\x20('+_0x1df676['code']+')'),_0x38e214=await promptSelect(_0x471928(0x11b),_0x200402),_0x3d5bd2=_0x5d8573[_0x38e214];if(!_0x3d5bd2)throw CliErrors[_0x471928(0x14a)](_0x471928(0x150));_0x165f1a=_0x3d5bd2[_0x471928(0x14d)],_0x510352=undefined;}}}}const _0x14da91=await listDatasets(_0x20b800[_0x471928(0x171)]),_0x3b3779=_0x14da91[_0x471928(0x13c)](_0x11fe7d=>_0x11fe7d[_0x471928(0x14d)]===_0x165f1a);if(!_0x3b3779)throw CliErrors[_0x471928(0x14a)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x165f1a+_0x471928(0x129)+(_0x510352?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x471928(0x131):''));_0x300a7c=_0x3b3779['id'];const _0x1067ef=_0x510352??_0x165f1a,_0x5e2376=await listBffDatasetOperations(_0x20b800['appCode'],_0x300a7c),_0x14a8a6=_0x5e2376?Object[_0x471928(0x157)](_0x5e2376):[];if(_0x14a8a6['length']===0x0)throw CliErrors['validation'](_0x471928(0x170)+_0x1067ef+'.');let _0x16c4e5;const _0x1029a2=_0x20b800[_0x471928(0x16b)](_0x471928(0x14c));if(_0x1029a2){if(!_0x14a8a6[_0x471928(0x10e)](_0x1029a2))throw CliErrors[_0x471928(0x14a)](_0x471928(0x121)+_0x1029a2+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0x1067ef+'.\x20'+(_0x471928(0x155)+_0x14a8a6[_0x471928(0x154)](',\x20')));_0x16c4e5=_0x1029a2;}else{if(_0x20b800[_0x471928(0x118)])throw CliErrors['validation']('--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0x5cc998=await promptSelect(_0x471928(0x169),_0x14a8a6);_0x16c4e5=_0x14a8a6[_0x5cc998]??_0x14a8a6[0x0];}let _0x52d016=normalizeHookFunctionNode(_0x20b800[_0x471928(0x16b)]('function-node'));if(!_0x52d016){if(_0x20b800[_0x471928(0x16b)]('function-node'))throw CliErrors[_0x471928(0x14a)](_0x471928(0x130));if(_0x20b800[_0x471928(0x118)])throw CliErrors[_0x471928(0x14a)]('--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.');const _0xb8e143=await promptSelect(_0x471928(0x120),[_0x471928(0x145),_0x471928(0x12b)]);_0x52d016=[_0x471928(0x145),_0x471928(0x12b)][_0xb8e143]??_0x471928(0x145);}return{'alias':_0x510352,'datasetCode':_0x165f1a,'datasetId':_0x300a7c,'operationType':_0x16c4e5,'functionNode':_0x52d016};}async function promptSelect(_0x1ea826,_0x20145d){const _0x174a24=a31_0x1b12c2;if(_0x20145d['length']===0x1)return 0x0;for(const [_0x2a3430,_0x29db00]of _0x20145d[_0x174a24(0x160)]()){process['stderr'][_0x174a24(0x12c)]('\x20\x20'+(_0x2a3430+0x1)+'.\x20'+_0x29db00+'\x0a');}const _0x41dc68=createInterface({'input':process[_0x174a24(0x16f)],'output':process[_0x174a24(0x168)]});while(!![]){const _0x20dbf7=await new Promise(_0x2d56fc=>{const _0x28478c=_0x174a24;_0x41dc68[_0x28478c(0x152)](_0x1ea826+'\x20',_0x2d56fc);}),_0x53c483=Number[_0x174a24(0x16c)](_0x20dbf7[_0x174a24(0x119)](),0xa);if(Number[_0x174a24(0x111)](_0x53c483)&&_0x53c483>=0x1&&_0x53c483<=_0x20145d[_0x174a24(0x138)])return _0x41dc68[_0x174a24(0x13a)](),_0x53c483-0x1;process[_0x174a24(0x168)][_0x174a24(0x12c)]('\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20'+_0x20145d[_0x174a24(0x138)]+'.\x0a');}}function buildFilePath(_0x1917b3,_0x3601d9,_0x54a594,_0x5a5fa2){const _0x5b3f30=a31_0x1b12c2;if(_0x3601d9===_0x5b3f30(0x12a)){if(!_0x5a5fa2)throw CliErrors[_0x5b3f30(0x14a)](_0x5b3f30(0x11c));const _0x2f8f57=_0x5a5fa2['alias']??_0x5a5fa2[_0x5b3f30(0x110)];return join(_0x1917b3['scriptsRootDir'],_0x5b3f30(0x12a),_0x2f8f57,_0x5a5fa2['operationType'],_0x5a5fa2[_0x5b3f30(0x133)],_0x54a594+_0x5b3f30(0x16e));}return join(_0x1917b3[_0x5b3f30(0x11d)],_0x3601d9,_0x54a594+_0x5b3f30(0x16e));}export function generateTemplate(_0x58ba7b,_0x57bd42,_0x11373c,_0x42a4e9,_0xd34750){const _0x382a50=a31_0x1b12c2,_0x1c2a2d=_0x42a4e9?.['trim']()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x469181=getAppBaseUrl(_0x11373c),_0x780e03=_0x382a50(0x16a);if(_0x58ba7b===_0x382a50(0x14b))return'/**\x0a\x20*\x20'+_0x1c2a2d+_0x382a50(0x10c)+_0x57bd42+_0x382a50(0x11a)+_0x469181+'/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/'+_0x11373c+_0x382a50(0x16d)+_0x57bd42+_0x382a50(0x143)+_0x57bd42+_0x382a50(0x126)+_0x780e03+_0x382a50(0x114)+_0x57bd42+'(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a';if(_0x58ba7b===_0x382a50(0x166))return'/**\x0a\x20*\x20'+_0x1c2a2d+_0x382a50(0x165)+_0x57bd42+_0x382a50(0x167)+_0x11373c+'/'+_0x57bd42+_0x382a50(0x11a)+_0x469181+_0x382a50(0x112)+_0x11373c+_0x382a50(0x156)+_0x57bd42+'.js\x0a'+_0x780e03+_0x382a50(0x117)+_0x57bd42+_0x382a50(0x161);if(!_0xd34750)throw CliErrors[_0x382a50(0x14a)](_0x382a50(0x159));const _0x4bda5c=_0xd34750[_0x382a50(0x147)]??_0xd34750[_0x382a50(0x110)],_0x12fbeb=_0xd34750[_0x382a50(0x133)]===_0x382a50(0x145)?'当前请求参数':'当前响应结果',_0x4f9e8e=_0xd34750['functionNode']===_0x382a50(0x145)?_0x382a50(0x113):_0x382a50(0x158);return _0x382a50(0x13f)+_0x1c2a2d+_0x382a50(0x142)+_0x57bd42+_0x382a50(0x134)+_0x11373c+'/'+_0xd34750[_0x382a50(0x110)]+'/'+_0xd34750['operationType']+_0x382a50(0x11a)+_0x469181+'/data/dataset/'+_0xd34750[_0x382a50(0x124)]+_0x382a50(0x14f)+_0x11373c+_0x382a50(0x15c)+_0x4bda5c+'/'+_0xd34750['operationType']+'/'+_0xd34750['functionNode']+'/'+_0x57bd42+'.js\x0a\x20*\x20[触发节点]\x20'+_0xd34750[_0x382a50(0x133)]+'\x0a'+_0x780e03+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x12fbeb+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x4f9e8e+_0x382a50(0x139)+_0x57bd42+_0x382a50(0x161);}
1
+ const a31_0x101808=a31_0x3f4f;(function(_0x33ee71,_0x354f19){const _0x10bfab=a31_0x3f4f,_0x229c64=_0x33ee71();while(!![]){try{const _0x123cc5=parseInt(_0x10bfab(0x1cb))/0x1+-parseInt(_0x10bfab(0x208))/0x2+parseInt(_0x10bfab(0x210))/0x3+-parseInt(_0x10bfab(0x1ee))/0x4*(parseInt(_0x10bfab(0x202))/0x5)+-parseInt(_0x10bfab(0x207))/0x6*(-parseInt(_0x10bfab(0x1e0))/0x7)+-parseInt(_0x10bfab(0x203))/0x8*(-parseInt(_0x10bfab(0x227))/0x9)+parseInt(_0x10bfab(0x223))/0xa;if(_0x123cc5===_0x354f19)break;else _0x229c64['push'](_0x229c64['shift']());}catch(_0x412745){_0x229c64['push'](_0x229c64['shift']());}}}(a31_0x5b7b,0xd13de));import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';function a31_0x3f4f(_0xa10033,_0x5434c1){_0xa10033=_0xa10033-0x1c1;const _0x5b7b09=a31_0x5b7b();let _0x3f4fa8=_0x5b7b09[_0xa10033];return _0x3f4fa8;}function a31_0x5b7b(){const _0x14931b=['string','\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','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','Invalid\x20dataset\x20selection.','Script\x20description','/**\x0a\x20*\x20','当前请求参数','before','\x22.\x20','description','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','stderr','329fflXQf','scriptsRootDir','find','function-node','HOOK\x20requires\x20alias/operation/node\x20options.','utf8','create','.js\x0a','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','stdin','#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','Select\x20trigger\x20node:','trim','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','5648BJQATQ','type','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20',']\x20(','alias','File\x20already\x20exists:\x20','\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20','\x22\x20not\x20found.\x20','keys','ENDPOINT','\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20','\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','Operation\x20type\x20(HOOK\x20only)','修改后的响应结果','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','\x0a\x20*\x20[平台配置]\x20','code','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','4820ZvDlEg','16CDsRux','/COMMON/','name','apiDir','5514kLFuWk','2168064SEKzXk','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','map','\x22\x20not\x20found\x20for\x20dataset\x20','Function\x20name\x20(valid\x20JS\x20identifier)','nonInteractive','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','.js','3819261rNfALx','\x22,\x20params\x20})\x0a','str','isInteger','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Available:\x20','\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','write','Alias\x20\x22','No\x20api.ts\x20found.\x20Run\x20`','bff','Select\x20dataset:','Dataset\x20not\x20found\x20for\x20code\x20\x22','question','source','Script\x20type','datasetcode','close','6044120Qunhoq','COMMON','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','No\x20datasets\x20found\x20for\x20this\x20app.','4545999pgabEr','functionNode','operation-type','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Trigger\x20node\x20(HOOK\x20only)','\x20api\x20pull`\x20to\x20refresh.','修改后的请求参数','UNKNOWN','当前响应结果','operationType','appCode','after','371340oixrga','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','Invalid\x20function\x20name\x20\x22','HOOK','datasetCode','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','parseInt','validation','\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'];a31_0x5b7b=function(){return _0x14931b;};return a31_0x5b7b();}import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists}from'../../core/bff/file-system.js';import{DEFAULT_BFF_SCRIPT_DESCRIPTION,isValidBffFunctionName,normalizeHookFunctionNode}from'../../core/bff/utils.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getAppBaseUrl}from'../../constant/domain.js';export const bffCreate={'service':a31_0x101808(0x21b),'command':a31_0x101808(0x1e6),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':'read','flags':[{'name':a31_0x101808(0x1ef),'type':a31_0x101808(0x1d4),'required':!![],'enum':[a31_0x101808(0x224),a31_0x101808(0x1f7),a31_0x101808(0x1ce)],'description':a31_0x101808(0x220)},{'name':a31_0x101808(0x205),'type':a31_0x101808(0x1d4),'required':!![],'description':a31_0x101808(0x20c)},{'name':'description','type':a31_0x101808(0x1d4),'description':a31_0x101808(0x1d8)},{'name':a31_0x101808(0x1f2),'type':a31_0x101808(0x1d4),'description':a31_0x101808(0x1c2)},{'name':a31_0x101808(0x221),'type':a31_0x101808(0x1d4),'description':a31_0x101808(0x20e)},{'name':a31_0x101808(0x1c1),'type':'string','description':a31_0x101808(0x1fc)},{'name':a31_0x101808(0x1e3),'type':'string','description':a31_0x101808(0x1c3),'enum':[a31_0x101808(0x1db),a31_0x101808(0x1ca)]}],async 'validate'(_0x3f1a10){const _0x23530a=a31_0x101808,_0x59a517=_0x3f1a10[_0x23530a(0x212)](_0x23530a(0x205));if(!isValidBffFunctionName(_0x59a517))throw CliErrors[_0x23530a(0x1d2)](_0x23530a(0x1cd)+_0x59a517+_0x23530a(0x1d6));},async 'execute'(_0x32acbc){const _0xcebd53=a31_0x101808,_0x219706=loadBffProjectConfig(_0x32acbc['appCode']),_0x36e2c8=_0x32acbc[_0xcebd53(0x212)](_0xcebd53(0x1ef)),_0x29e873=_0x32acbc[_0xcebd53(0x212)]('name'),_0x32dc8c=_0x32acbc[_0xcebd53(0x212)](_0xcebd53(0x1dd))||undefined,_0xb1812f=_0x36e2c8===_0xcebd53(0x1ce)?await resolveHookOptions(_0x219706,_0x32acbc):undefined,_0x24c042=buildFilePath(_0x219706,_0x36e2c8,_0x29e873,_0xb1812f);if(await fileExists(_0x24c042))throw CliErrors['validation'](_0xcebd53(0x1f3)+_0x24c042);await mkdir(dirname(_0x24c042),{'recursive':!![]});const _0x34bcb8=generateTemplate(_0x36e2c8,_0x29e873,_0x32acbc[_0xcebd53(0x1c9)],_0x32dc8c,_0xb1812f);await writeFile(_0x24c042,_0x34bcb8,_0xcebd53(0x1e5));const _0xc36852={'type':_0x36e2c8,'name':_0x29e873,'path':_0x24c042};if(_0x32dc8c)_0xc36852[_0xcebd53(0x1dd)]=_0x32dc8c;if(_0xb1812f){if(_0xb1812f[_0xcebd53(0x1f2)])_0xc36852['alias']=_0xb1812f[_0xcebd53(0x1f2)];_0xc36852['datasetCode']=_0xb1812f[_0xcebd53(0x1cf)],_0xc36852[_0xcebd53(0x1c8)]=_0xb1812f[_0xcebd53(0x1c8)],_0xc36852[_0xcebd53(0x228)]=_0xb1812f[_0xcebd53(0x228)];}return{'ok':!![],'data':_0xc36852,'message':'Created\x20'+_0x36e2c8+'\x20function:\x20'+_0x29e873};}};async function resolveHookOptions(_0x54ba0f,_0x181626){const _0x1a4bb1=a31_0x101808,_0x583a59=loadAliasMap(_0x181626[_0x1a4bb1(0x206)],undefined,resolveApiFilePath(_0x181626[_0x1a4bb1(0x206)],_0x181626['appCode'])),_0x1a8a88=_0x583a59[_0x1a4bb1(0x217)]>0x0;let _0x5e0923,_0x2f05f4,_0x1d1d7b;const _0x39abd2=_0x181626[_0x1a4bb1(0x212)](_0x1a4bb1(0x1f2)),_0x3a8475=_0x181626['str'](_0x1a4bb1(0x221));if(_0x39abd2){const _0x36cd46=resolveAlias(_0x181626[_0x1a4bb1(0x206)],_0x39abd2,undefined,resolveApiFilePath(_0x181626[_0x1a4bb1(0x206)],_0x181626[_0x1a4bb1(0x1c9)]));if(!_0x36cd46){const _0x2bb621=_0x1a8a88?'Available\x20aliases:\x20'+_0x583a59[_0x1a4bb1(0x20a)](_0x10d66c=>_0x10d66c[_0x1a4bb1(0x1f2)])['join'](',\x20'):_0x1a4bb1(0x21a)+CLI_BIN_NAME+_0x1a4bb1(0x1fa);throw CliErrors[_0x1a4bb1(0x1d2)](_0x1a4bb1(0x219)+_0x39abd2+_0x1a4bb1(0x1f5)+_0x2bb621);}_0x5e0923=_0x39abd2,_0x2f05f4=_0x36cd46;}else{if(_0x3a8475){_0x2f05f4=_0x3a8475;const _0x2c160d=_0x583a59[_0x1a4bb1(0x1e2)](_0x1d5470=>_0x1d5470[_0x1a4bb1(0x1cf)]===_0x3a8475);_0x5e0923=_0x2c160d?.[_0x1a4bb1(0x1f2)];}else{if(_0x181626[_0x1a4bb1(0x20d)])throw CliErrors['validation'](_0x1a4bb1(0x1d0));else{if(_0x1a8a88){const _0x27b6e0=_0x583a59[_0x1a4bb1(0x20a)](_0x562804=>_0x562804[_0x1a4bb1(0x1f2)]+'\x20('+_0x562804['tableName']+')'),_0x2849f3=await promptSelect(_0x1a4bb1(0x21c),_0x27b6e0),_0x5b84cc=_0x583a59[_0x2849f3];if(!_0x5b84cc)throw CliErrors[_0x1a4bb1(0x1d2)]('Invalid\x20dataset\x20selection.');_0x5e0923=_0x5b84cc[_0x1a4bb1(0x1f2)],_0x2f05f4=_0x5b84cc[_0x1a4bb1(0x1cf)];}else{const _0x99cc7a=await listDatasets(_0x181626[_0x1a4bb1(0x1c9)]);if(_0x99cc7a[_0x1a4bb1(0x217)]===0x0)throw CliErrors[_0x1a4bb1(0x1d2)](_0x1a4bb1(0x226));const _0x5d9534=_0x99cc7a['map'](_0x53f72c=>_0x53f72c['name']+'\x20['+(_0x53f72c[_0x1a4bb1(0x21f)]??_0x1a4bb1(0x1c6))+_0x1a4bb1(0x1f1)+_0x53f72c[_0x1a4bb1(0x200)]+')'),_0x21a0b6=await promptSelect('Select\x20dataset:',_0x5d9534),_0x29e674=_0x99cc7a[_0x21a0b6];if(!_0x29e674)throw CliErrors[_0x1a4bb1(0x1d2)](_0x1a4bb1(0x1d7));_0x2f05f4=_0x29e674[_0x1a4bb1(0x200)],_0x5e0923=undefined;}}}}const _0x2373dd=await listDatasets(_0x181626['appCode']),_0x391819=_0x2373dd[_0x1a4bb1(0x1e2)](_0x1976c6=>_0x1976c6['code']===_0x2f05f4);if(!_0x391819)throw CliErrors[_0x1a4bb1(0x1d2)](_0x1a4bb1(0x21d)+_0x2f05f4+_0x1a4bb1(0x1dc)+(_0x5e0923?'The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`'+CLI_BIN_NAME+_0x1a4bb1(0x1c4):''));_0x1d1d7b=_0x391819['id'];const _0x470bcd=_0x5e0923??_0x2f05f4,_0x57b2ce=await listBffDatasetOperations(_0x181626[_0x1a4bb1(0x1c9)],_0x1d1d7b),_0x876317=_0x57b2ce?Object[_0x1a4bb1(0x1f6)](_0x57b2ce):[];if(_0x876317[_0x1a4bb1(0x217)]===0x0)throw CliErrors[_0x1a4bb1(0x1d2)](_0x1a4bb1(0x214)+_0x470bcd+'.');let _0x2dfdcd;const _0x377820=_0x181626[_0x1a4bb1(0x212)](_0x1a4bb1(0x1c1));if(_0x377820){if(!_0x876317['includes'](_0x377820))throw CliErrors['validation']('Operation\x20type\x20\x22'+_0x377820+_0x1a4bb1(0x20b)+_0x470bcd+'.\x20'+(_0x1a4bb1(0x215)+_0x876317['join'](',\x20')));_0x2dfdcd=_0x377820;}else{if(_0x181626[_0x1a4bb1(0x20d)])throw CliErrors['validation'](_0x1a4bb1(0x209));const _0xcde24c=await promptSelect('Select\x20operation\x20type:',_0x876317);_0x2dfdcd=_0x876317[_0xcde24c]??_0x876317[0x0];}let _0x44ad66=normalizeHookFunctionNode(_0x181626[_0x1a4bb1(0x212)]('function-node'));if(!_0x44ad66){if(_0x181626[_0x1a4bb1(0x212)](_0x1a4bb1(0x1e3)))throw CliErrors[_0x1a4bb1(0x1d2)](_0x1a4bb1(0x1ed));if(_0x181626[_0x1a4bb1(0x20d)])throw CliErrors[_0x1a4bb1(0x1d2)](_0x1a4bb1(0x1fe));const _0x285cfb=await promptSelect(_0x1a4bb1(0x1eb),[_0x1a4bb1(0x1db),_0x1a4bb1(0x1ca)]);_0x44ad66=[_0x1a4bb1(0x1db),_0x1a4bb1(0x1ca)][_0x285cfb]??_0x1a4bb1(0x1db);}return{'alias':_0x5e0923,'datasetCode':_0x2f05f4,'datasetId':_0x1d1d7b,'operationType':_0x2dfdcd,'functionNode':_0x44ad66};}async function promptSelect(_0x308645,_0x1e97f2){const _0x264a1c=a31_0x101808;if(_0x1e97f2[_0x264a1c(0x217)]===0x1)return 0x0;for(const [_0x413b67,_0x2a576d]of _0x1e97f2['entries']()){process[_0x264a1c(0x1df)]['write']('\x20\x20'+(_0x413b67+0x1)+'.\x20'+_0x2a576d+'\x0a');}const _0x353bd4=createInterface({'input':process[_0x264a1c(0x1e9)],'output':process[_0x264a1c(0x1df)]});while(!![]){const _0x3cf501=await new Promise(_0x43a154=>{const _0x121afb=_0x264a1c;_0x353bd4[_0x121afb(0x21e)](_0x308645+'\x20',_0x43a154);}),_0x581457=Number[_0x264a1c(0x1d1)](_0x3cf501[_0x264a1c(0x1ec)](),0xa);if(Number[_0x264a1c(0x213)](_0x581457)&&_0x581457>=0x1&&_0x581457<=_0x1e97f2[_0x264a1c(0x217)])return _0x353bd4[_0x264a1c(0x222)](),_0x581457-0x1;process[_0x264a1c(0x1df)][_0x264a1c(0x218)](_0x264a1c(0x1f0)+_0x1e97f2[_0x264a1c(0x217)]+'.\x0a');}}function buildFilePath(_0x159a4a,_0x319c78,_0x1a7ceb,_0xa379db){const _0x2c6473=a31_0x101808;if(_0x319c78===_0x2c6473(0x1ce)){if(!_0xa379db)throw CliErrors[_0x2c6473(0x1d2)](_0x2c6473(0x1e4));const _0x5bab1c=_0xa379db['alias']??_0xa379db[_0x2c6473(0x1cf)];return join(_0x159a4a[_0x2c6473(0x1e1)],'HOOK',_0x5bab1c,_0xa379db['operationType'],_0xa379db['functionNode'],_0x1a7ceb+'.js');}return join(_0x159a4a[_0x2c6473(0x1e1)],_0x319c78,_0x1a7ceb+_0x2c6473(0x20f));}export function generateTemplate(_0x237e4a,_0x2605f3,_0x5a16b3,_0x26b9f4,_0x3b91cf){const _0x5e09c9=a31_0x101808,_0x215f2d=_0x26b9f4?.[_0x5e09c9(0x1ec)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0xd9106f=getAppBaseUrl(_0x5a16b3),_0x5dc466=_0x5e09c9(0x1f8);if(_0x237e4a==='COMMON')return _0x5e09c9(0x1d9)+_0x215f2d+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20'+_0x2605f3+_0x5e09c9(0x1ff)+_0xd9106f+_0x5e09c9(0x201)+_0x5a16b3+_0x5e09c9(0x204)+_0x2605f3+_0x5e09c9(0x225)+_0x2605f3+_0x5e09c9(0x211)+_0x5dc466+_0x5e09c9(0x1d5)+_0x2605f3+_0x5e09c9(0x1cc);if(_0x237e4a===_0x5e09c9(0x1f7))return _0x5e09c9(0x1d9)+_0x215f2d+_0x5e09c9(0x1fb)+_0x2605f3+_0x5e09c9(0x1e8)+_0x5a16b3+'/'+_0x2605f3+_0x5e09c9(0x1ff)+_0xd9106f+_0x5e09c9(0x201)+_0x5a16b3+'/ENDPOINT/'+_0x2605f3+_0x5e09c9(0x1e7)+_0x5dc466+_0x5e09c9(0x216)+_0x2605f3+_0x5e09c9(0x1cc);if(!_0x3b91cf)throw CliErrors[_0x5e09c9(0x1d2)]('HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.');const _0x568e5c=_0x3b91cf[_0x5e09c9(0x1f2)]??_0x3b91cf[_0x5e09c9(0x1cf)],_0x567704=_0x3b91cf[_0x5e09c9(0x228)]===_0x5e09c9(0x1db)?_0x5e09c9(0x1da):_0x5e09c9(0x1c7),_0x4587b1=_0x3b91cf[_0x5e09c9(0x228)]===_0x5e09c9(0x1db)?_0x5e09c9(0x1c5):_0x5e09c9(0x1fd);return _0x5e09c9(0x1d9)+_0x215f2d+_0x5e09c9(0x1f9)+_0x2605f3+_0x5e09c9(0x1de)+_0x5a16b3+'/'+_0x3b91cf['datasetCode']+'/'+_0x3b91cf[_0x5e09c9(0x1c8)]+_0x5e09c9(0x1ff)+_0xd9106f+'/data/dataset/'+_0x3b91cf['datasetId']+_0x5e09c9(0x1ea)+_0x5a16b3+'/HOOK/'+_0x568e5c+'/'+_0x3b91cf[_0x5e09c9(0x1c8)]+'/'+_0x3b91cf[_0x5e09c9(0x228)]+'/'+_0x2605f3+'.js\x0a\x20*\x20[触发节点]\x20'+_0x3b91cf['functionNode']+'\x0a'+_0x5dc466+_0x5e09c9(0x1f4)+_0x567704+_0x5e09c9(0x1d3)+_0x4587b1+'\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20'+_0x2605f3+_0x5e09c9(0x1cc);}
@@ -1 +1 @@
1
- const a32_0x322b92=a32_0x3a17;function a32_0x3a17(_0x309d94,_0x3508c7){_0x309d94=_0x309d94-0x10c;const _0x3f531c=a32_0x3f53();let _0x3a17fb=_0x3f531c[_0x309d94];return _0x3a17fb;}(function(_0x3a0c4b,_0x2853ef){const _0x54a4df=a32_0x3a17,_0x435aed=_0x3a0c4b();while(!![]){try{const _0x1086f0=-parseInt(_0x54a4df(0x117))/0x1+parseInt(_0x54a4df(0x128))/0x2+parseInt(_0x54a4df(0x130))/0x3+-parseInt(_0x54a4df(0x125))/0x4+-parseInt(_0x54a4df(0x10f))/0x5+parseInt(_0x54a4df(0x13d))/0x6+-parseInt(_0x54a4df(0x113))/0x7*(-parseInt(_0x54a4df(0x122))/0x8);if(_0x1086f0===_0x2853ef)break;else _0x435aed['push'](_0x435aed['shift']());}catch(_0x3a535b){_0x435aed['push'](_0x435aed['shift']());}}}(a32_0x3f53,0xb8959));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';import{ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a32_0x3f53(){const _0x27ba40=['\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','appCode','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','string','target','/api/management/library/scripts/delete','No\x20lock\x20entry\x20found\x20for\x20\x22','scriptsRootDir','35976SggQxS','filter','bff','4553840tRbvru','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','\x22\x20not\x20found\x20after\x20ensureLockScope.','1136350KpTUVm','str','projectRoot','map','high-risk-write','\x20\x20-\x20','length','replace','3407121BoSgUB','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','keys','Backend\x20Function\x20lock\x20file\x20not\x20found.','validation','Function\x20not\x20found:\x20','toISOString','functions','Lock\x20scope\x20for\x20app\x20\x22','delete','find','trashDir','apps','3674268LJGmcx','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','stringify','Deleted\x20','remoteId','4995015VQIqru','Multiple\x20functions\x20match\x20\x22','Local\x20delete\x20not\x20settled\x20for\x20','Would\x20delete\x20','1288rquitZ','lockFilePath','scriptsRoot','includes','250188zwmDZD','parse','split'];a32_0x3f53=function(){return _0x27ba40;};return a32_0x3f53();}import{CliErrors}from'../../errors.js';import{sleep}from'../../utils/sleep.js';export const bffDelete={'service':a32_0x322b92(0x124),'command':'delete','description':a32_0x322b92(0x13e),'risk':a32_0x322b92(0x12c),'flags':[{'name':a32_0x322b92(0x11e),'type':a32_0x322b92(0x11d),'required':!![],'description':a32_0x322b92(0x131)}],async 'validate'(_0x18a3ec){const _0x27e204=a32_0x322b92,_0x133463=loadBffProjectConfig(_0x18a3ec[_0x27e204(0x11b)]),_0x53cfd2=await readBffLockFile(_0x133463['lockFilePath']);if(!_0x53cfd2)throw CliErrors[_0x27e204(0x134)](_0x27e204(0x11c));},async 'dryRun'(_0x237efb){const _0x256fc7=a32_0x322b92,_0xf860af=loadBffProjectConfig(_0x237efb[_0x256fc7(0x11b)]),_0x11d3c6=await readBffLockFile(_0xf860af[_0x256fc7(0x114)]);if(!_0x11d3c6)throw CliErrors[_0x256fc7(0x134)]('Backend\x20Function\x20lock\x20file\x20not\x20found.');const {appLock:_0x392114}=ensureLockScope(_0x11d3c6,_0x237efb[_0x256fc7(0x11b)],_0xf860af['scriptsRoot'],_0x256fc7(0x139)),_0x1dabcf=_0x237efb[_0x256fc7(0x129)]('target'),_0x329055=Object[_0x256fc7(0x132)](_0x392114[_0x256fc7(0x137)]),_0x149e61=resolveDeleteTarget(_0x1dabcf,_0x329055),_0x150c47=_0x392114[_0x256fc7(0x137)][_0x149e61];if(!_0x150c47)throw CliErrors[_0x256fc7(0x134)](_0x256fc7(0x120)+_0x149e61+'\x22.');const _0x5c2f0e=resolveLocalFilePathFromLockKey(_0xf860af,_0x149e61),_0xe95eea=relative(_0xf860af[_0x256fc7(0x12a)],_0x5c2f0e),_0x8acff=join(_0xf860af[_0x256fc7(0x13b)],'<timestamp>',_0xe95eea);return{'method':'POST','url':_0x256fc7(0x11f),'body':{'appCode':_0x237efb[_0x256fc7(0x11b)],'target':_0x149e61,'remoteId':_0x150c47[_0x256fc7(0x10e)],'localFilePath':_0x5c2f0e,'trashedPath':_0x8acff},'description':_0x256fc7(0x112)+_0x149e61+_0x256fc7(0x11a)};},async 'execute'(_0x9cd6e9){const _0x3e4f95=a32_0x322b92,_0x1f2a6f=loadBffProjectConfig(_0x9cd6e9[_0x3e4f95(0x11b)]),_0x25bd88=await readBffLockFile(_0x1f2a6f['lockFilePath']);if(!_0x25bd88)throw CliErrors['validation'](_0x3e4f95(0x133));const {lockData:_0x59d401,appLock:_0xe57ea}=ensureLockScope(_0x25bd88,_0x9cd6e9[_0x3e4f95(0x11b)],_0x1f2a6f[_0x3e4f95(0x115)],_0x3e4f95(0x139)),_0x359dea=JSON[_0x3e4f95(0x118)](JSON[_0x3e4f95(0x10c)](_0x59d401)),_0x30a2d7=_0x359dea['apps'][_0x9cd6e9[_0x3e4f95(0x11b)]];if(!_0x30a2d7)throw new Error(_0x3e4f95(0x138)+_0x9cd6e9[_0x3e4f95(0x11b)]+_0x3e4f95(0x127));const _0x42f6c2=_0x9cd6e9['str'](_0x3e4f95(0x11e)),_0x360227=Object[_0x3e4f95(0x132)](_0x30a2d7[_0x3e4f95(0x137)]),_0x5bcdc5=resolveDeleteTarget(_0x42f6c2,_0x360227),_0x4c54bf=_0x30a2d7[_0x3e4f95(0x137)][_0x5bcdc5];if(!_0x4c54bf)throw CliErrors[_0x3e4f95(0x134)](_0x3e4f95(0x120)+_0x5bcdc5+'\x22.');await deleteBffScript(_0x4c54bf['remoteId']),delete _0x30a2d7[_0x3e4f95(0x137)][_0x5bcdc5],_0x30a2d7['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x1f2a6f['lockFilePath'],_0x359dea);const _0x570dd9=resolveLocalFilePathFromLockKey(_0x1f2a6f,_0x5bcdc5);let _0x1736fe;await fileExists(_0x570dd9)&&(_0x1736fe=await moveToTrash(_0x1f2a6f[_0x3e4f95(0x12a)],_0x1f2a6f[_0x3e4f95(0x13b)],_0x570dd9),await cleanupEmptyDirectories(dirname(_0x570dd9),_0x1f2a6f[_0x3e4f95(0x121)]));await waitForDeleteSettlement(_0x1f2a6f[_0x3e4f95(0x114)],_0x9cd6e9[_0x3e4f95(0x11b)],_0x5bcdc5,_0x570dd9),await sleep(0x96);const _0x1cf6ed={'deleted':_0x5bcdc5,'remoteId':_0x4c54bf[_0x3e4f95(0x10e)]};if(_0x1736fe)_0x1cf6ed['trashedTo']=_0x1736fe;return{'ok':!![],'data':_0x1cf6ed,'message':_0x3e4f95(0x10d)+_0x5bcdc5+(_0x1736fe?'\x20(local\x20file\x20moved\x20to\x20trash)':'')};}};function resolveDeleteTarget(_0x4a0012,_0x48508c){const _0x21d45d=a32_0x322b92;if(_0x4a0012[_0x21d45d(0x116)]('/')){const _0x598ee2=_0x48508c[_0x21d45d(0x13a)](_0x3b03d8=>_0x3b03d8===_0x4a0012);if(!_0x598ee2)throw CliErrors[_0x21d45d(0x134)](_0x21d45d(0x135)+_0x4a0012);return _0x598ee2;}const _0x36f8e7=_0x48508c[_0x21d45d(0x123)](_0x3c7d1a=>_0x3c7d1a[_0x21d45d(0x119)]('/')['at'](-0x1)===_0x4a0012);if(_0x36f8e7['length']===0x0)throw CliErrors['validation'](_0x21d45d(0x135)+_0x4a0012);if(_0x36f8e7['length']>0x1)throw CliErrors[_0x21d45d(0x134)](_0x21d45d(0x110)+_0x4a0012+_0x21d45d(0x126)+_0x36f8e7[_0x21d45d(0x12b)](_0x56f7e7=>_0x21d45d(0x12d)+_0x56f7e7)['join']('\x0a'));return _0x36f8e7[0x0];}async function moveToTrash(_0x46a403,_0x507d9e,_0x1fdb97){const _0x8c8d2=a32_0x322b92,_0x55c1a1=new Date()[_0x8c8d2(0x136)]()[_0x8c8d2(0x12f)](/[:.]/g,'-'),_0x56771e=relative(_0x46a403,_0x1fdb97),_0x2f6c54=join(_0x507d9e,_0x55c1a1,_0x56771e);return await mkdir(dirname(_0x2f6c54),{'recursive':!![]}),await rename(_0x1fdb97,_0x2f6c54),_0x2f6c54;}async function cleanupEmptyDirectories(_0x42658a,_0x2bf953){const _0x285fed=a32_0x322b92;let _0x9b331a=resolve(_0x42658a);const _0x38b4a9=resolve(_0x2bf953);while(_0x9b331a['startsWith'](''+_0x38b4a9+sep)||_0x9b331a===_0x38b4a9){if(_0x9b331a===_0x38b4a9)return;try{const _0x1824da=await readdir(_0x9b331a);if(_0x1824da[_0x285fed(0x12e)]>0x0)return;await rmdir(_0x9b331a);}catch{return;}_0x9b331a=dirname(_0x9b331a);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x58325e,_0x39d10e,_0x1c5b84,_0x40954f){const _0x3fa82b=a32_0x322b92;for(let _0xa21a62=0x0;_0xa21a62<DELETE_SETTLE_RETRY_COUNT;_0xa21a62+=0x1){const _0xd72456=await readBffLockFile(_0x58325e),_0x5ee775=!!_0xd72456?.[_0x3fa82b(0x13c)]?.[_0x39d10e]?.[_0x3fa82b(0x137)]?.[_0x1c5b84],_0x4dc1bf=await fileExists(_0x40954f);if(!_0x5ee775&&!_0x4dc1bf)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x3fa82b(0x111)+_0x1c5b84+'.');}
1
+ const a32_0x517e9a=a32_0x36d5;(function(_0x147ccd,_0x142363){const _0x1f3443=a32_0x36d5,_0xbb922e=_0x147ccd();while(!![]){try{const _0x226499=parseInt(_0x1f3443(0xb3))/0x1+parseInt(_0x1f3443(0x98))/0x2*(parseInt(_0x1f3443(0xa3))/0x3)+parseInt(_0x1f3443(0xb7))/0x4*(-parseInt(_0x1f3443(0xc0))/0x5)+parseInt(_0x1f3443(0xbc))/0x6+-parseInt(_0x1f3443(0x9f))/0x7+parseInt(_0x1f3443(0xbe))/0x8+-parseInt(_0x1f3443(0x9d))/0x9*(parseInt(_0x1f3443(0xb2))/0xa);if(_0x226499===_0x142363)break;else _0xbb922e['push'](_0xbb922e['shift']());}catch(_0x96dcc2){_0xbb922e['push'](_0xbb922e['shift']());}}}(a32_0x23b7,0x55cdf));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a32_0x23b7(){const _0x32f799=['2700EYUtvg','428196vDAtBG','delete','keys','No\x20lock\x20entry\x20found\x20for\x20\x22','360268BFhlVR','bff','Local\x20delete\x20not\x20settled\x20for\x20','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x20\x20-\x20','403176zOwvEJ','length','2862192WXqAuB','target','5FihsDe','str','Would\x20delete\x20','join','POST','toISOString','scriptsRootDir','find','remoteId','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','lockFilePath','scriptsRoot','40464ALsGdp','stringify','projectRoot','Multiple\x20functions\x20match\x20\x22','/api/management/library/scripts/delete','7542WOxnpc','functions','2572304WxhvDw','appCode','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','validation','27orStKH','Lock\x20scope\x20for\x20app\x20\x22','split','high-risk-write','string','filter','Backend\x20Function\x20lock\x20file\x20not\x20found.','\x20(local\x20file\x20moved\x20to\x20trash)','trashedTo','apps','replace','lastSync','Function\x20not\x20found:\x20','map','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name'];a32_0x23b7=function(){return _0x32f799;};return a32_0x23b7();}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':a32_0x517e9a(0xb8),'command':a32_0x517e9a(0xb4),'description':'Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','risk':a32_0x517e9a(0xa6),'flags':[{'name':a32_0x517e9a(0xbf),'type':a32_0x517e9a(0xa7),'required':!![],'description':a32_0x517e9a(0xb1)}],async 'validate'(_0x42c7e0){const _0x54dc22=a32_0x517e9a,_0x14412d=loadBffProjectConfig(_0x42c7e0[_0x54dc22(0xa0)]),_0x3e145b=await readBffLockFile(_0x14412d[_0x54dc22(0x96)]);if(!_0x3e145b)throw CliErrors['validation'](_0x54dc22(0x95));},async 'dryRun'(_0x270cf5){const _0x5f426a=a32_0x517e9a,_0xdccfe0=loadBffProjectConfig(_0x270cf5[_0x5f426a(0xa0)]),_0x29317b=await readBffLockFile(_0xdccfe0[_0x5f426a(0x96)]);if(!_0x29317b)throw CliErrors[_0x5f426a(0xa2)](_0x5f426a(0xa9));const {appLock:_0x1173b0}=ensureLockScope(_0x29317b,_0x270cf5[_0x5f426a(0xa0)],_0xdccfe0[_0x5f426a(0x97)],'delete'),_0x4c6eff=_0x270cf5[_0x5f426a(0xc1)](_0x5f426a(0xbf)),_0x1c1a63=Object[_0x5f426a(0xb5)](_0x1173b0[_0x5f426a(0x9e)]),_0x5c73bc=resolveDeleteTarget(_0x4c6eff,_0x1c1a63),_0x487e8e=_0x1173b0['functions'][_0x5c73bc];if(!_0x487e8e)throw CliErrors[_0x5f426a(0xa2)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x5c73bc+'\x22.');const _0x5b0882=resolveLocalFilePathFromLockKey(_0xdccfe0,_0x5c73bc),_0x32c23a=relative(_0xdccfe0[_0x5f426a(0x9a)],_0x5b0882),_0x5a5da1=join(_0xdccfe0['trashDir'],'<timestamp>',_0x32c23a);return{'method':_0x5f426a(0xc4),'url':_0x5f426a(0x9c),'body':{'appCode':_0x270cf5[_0x5f426a(0xa0)],'target':_0x5c73bc,'remoteId':_0x487e8e[_0x5f426a(0x94)],'localFilePath':_0x5b0882,'trashedPath':_0x5a5da1},'description':_0x5f426a(0xc2)+_0x5c73bc+_0x5f426a(0xa1)};},async 'execute'(_0x15bed0){const _0x4a69a5=a32_0x517e9a,_0x22fbd7=loadBffProjectConfig(_0x15bed0[_0x4a69a5(0xa0)]),_0x363dfe=await readBffLockFile(_0x22fbd7[_0x4a69a5(0x96)]);if(!_0x363dfe)throw CliErrors[_0x4a69a5(0xa2)](_0x4a69a5(0xa9));const {lockData:_0x5705d3,appLock:_0x247cd2}=ensureLockScope(_0x363dfe,_0x15bed0[_0x4a69a5(0xa0)],_0x22fbd7[_0x4a69a5(0x97)],_0x4a69a5(0xb4)),_0x2cc57f=JSON['parse'](JSON[_0x4a69a5(0x99)](_0x5705d3)),_0x2e1e3a=_0x2cc57f[_0x4a69a5(0xac)][_0x15bed0[_0x4a69a5(0xa0)]];if(!_0x2e1e3a)throw new Error(_0x4a69a5(0xa4)+_0x15bed0[_0x4a69a5(0xa0)]+_0x4a69a5(0xba));const _0x3bd22c=_0x15bed0[_0x4a69a5(0xc1)](_0x4a69a5(0xbf)),_0x5da522=Object[_0x4a69a5(0xb5)](_0x2e1e3a[_0x4a69a5(0x9e)]),_0x39fdf0=resolveDeleteTarget(_0x3bd22c,_0x5da522),_0x5c0984=_0x2e1e3a[_0x4a69a5(0x9e)][_0x39fdf0];if(!_0x5c0984)throw CliErrors['validation'](_0x4a69a5(0xb6)+_0x39fdf0+'\x22.');await deleteBffScript(_0x5c0984[_0x4a69a5(0x94)]),delete _0x2e1e3a[_0x4a69a5(0x9e)][_0x39fdf0],_0x2e1e3a[_0x4a69a5(0xae)]=new Date()[_0x4a69a5(0x91)](),await writeBffLockFile(_0x22fbd7[_0x4a69a5(0x96)],_0x2cc57f);const _0x1dc5b5=resolveLocalFilePathFromLockKey(_0x22fbd7,_0x39fdf0);let _0x57a9f4;await fileExists(_0x1dc5b5)&&(_0x57a9f4=await moveToTrash(_0x22fbd7[_0x4a69a5(0x9a)],_0x22fbd7['trashDir'],_0x1dc5b5),await cleanupEmptyDirectories(dirname(_0x1dc5b5),_0x22fbd7[_0x4a69a5(0x92)]));await waitForDeleteSettlement(_0x22fbd7[_0x4a69a5(0x96)],_0x15bed0['appCode'],_0x39fdf0,_0x1dc5b5),await sleep(0x96);const _0x52810d={'deleted':_0x39fdf0,'remoteId':_0x5c0984[_0x4a69a5(0x94)]};if(_0x57a9f4)_0x52810d[_0x4a69a5(0xab)]=_0x57a9f4;return{'ok':!![],'data':_0x52810d,'message':'Deleted\x20'+_0x39fdf0+(_0x57a9f4?_0x4a69a5(0xaa):'')};}};function resolveDeleteTarget(_0x49df88,_0x39478e){const _0x1d59ac=a32_0x517e9a;if(_0x49df88['includes']('/')){const _0x7e77aa=_0x39478e[_0x1d59ac(0x93)](_0xa4b357=>_0xa4b357===_0x49df88);if(!_0x7e77aa)throw CliErrors['validation'](_0x1d59ac(0xaf)+_0x49df88);return _0x7e77aa;}const _0x52a372=_0x39478e[_0x1d59ac(0xa8)](_0x8b775c=>_0x8b775c[_0x1d59ac(0xa5)]('/')['at'](-0x1)===_0x49df88);if(_0x52a372[_0x1d59ac(0xbd)]===0x0)throw CliErrors[_0x1d59ac(0xa2)](_0x1d59ac(0xaf)+_0x49df88);if(_0x52a372['length']>0x1)throw CliErrors[_0x1d59ac(0xa2)](_0x1d59ac(0x9b)+_0x49df88+'\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a'+_0x52a372[_0x1d59ac(0xb0)](_0x4f9049=>_0x1d59ac(0xbb)+_0x4f9049)[_0x1d59ac(0xc3)]('\x0a'));return _0x52a372[0x0];}function a32_0x36d5(_0xa1a36b,_0x2ae7ee){_0xa1a36b=_0xa1a36b-0x91;const _0x23b751=a32_0x23b7();let _0x36d592=_0x23b751[_0xa1a36b];return _0x36d592;}async function moveToTrash(_0x50de11,_0x5cb579,_0xa9f50b){const _0x5adb0d=a32_0x517e9a,_0x368eb8=new Date()[_0x5adb0d(0x91)]()[_0x5adb0d(0xad)](/[:.]/g,'-'),_0x50cf74=relative(_0x50de11,_0xa9f50b),_0x36b3d9=join(_0x5cb579,_0x368eb8,_0x50cf74);return await mkdir(dirname(_0x36b3d9),{'recursive':!![]}),await rename(_0xa9f50b,_0x36b3d9),_0x36b3d9;}async function cleanupEmptyDirectories(_0xa11f0e,_0x3c26f7){const _0xc3e33d=a32_0x517e9a;let _0x22463c=resolve(_0xa11f0e);const _0x98e95f=resolve(_0x3c26f7);while(_0x22463c['startsWith'](''+_0x98e95f+sep)||_0x22463c===_0x98e95f){if(_0x22463c===_0x98e95f)return;try{const _0x579c80=await readdir(_0x22463c);if(_0x579c80[_0xc3e33d(0xbd)]>0x0)return;await rmdir(_0x22463c);}catch{return;}_0x22463c=dirname(_0x22463c);}}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x537a6a,_0x29b1e3,_0x54cec3,_0x395e66){const _0x3d39cd=a32_0x517e9a;for(let _0x5bda7c=0x0;_0x5bda7c<DELETE_SETTLE_RETRY_COUNT;_0x5bda7c+=0x1){const _0x564cd6=await readBffLockFile(_0x537a6a),_0x31623c=!!_0x564cd6?.[_0x3d39cd(0xac)]?.[_0x29b1e3]?.[_0x3d39cd(0x9e)]?.[_0x54cec3],_0x3ec624=await fileExists(_0x395e66);if(!_0x31623c&&!_0x3ec624)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x3d39cd(0xb9)+_0x54cec3+'.');}
@@ -1 +1 @@
1
- function a33_0x44c6(){const _0x26c3d5=['updateUserName','14jxCByE','99LAVFWy','2PtFxey','17397osRMAV','460558oPQNia','5117970ztJVSt','107804FKAMih','number','Script\x20ID','669450isHnYT','2352laFrUl','(none)','appCode','1786602BnWCRy','description','updatedTime','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','verbose','version','Return\x20full\x20raw\x20script\x20object','4134450nWlHCU','boolean','detail','createdTime'];a33_0x44c6=function(){return _0x26c3d5;};return a33_0x44c6();}const a33_0x4a722e=a33_0xb9f4;function a33_0xb9f4(_0x4a4755,_0x27a5ad){_0x4a4755=_0x4a4755-0x121;const _0x44c646=a33_0x44c6();let _0xb9f47=_0x44c646[_0x4a4755];return _0xb9f47;}(function(_0x2b2aa0,_0x53646c){const _0x5850f9=a33_0xb9f4,_0x5c569d=_0x2b2aa0();while(!![]){try{const _0x1ab79f=-parseInt(_0x5850f9(0x122))/0x1*(-parseInt(_0x5850f9(0x139))/0x2)+parseInt(_0x5850f9(0x138))/0x3*(parseInt(_0x5850f9(0x124))/0x4)+parseInt(_0x5850f9(0x132))/0x5+-parseInt(_0x5850f9(0x12b))/0x6*(parseInt(_0x5850f9(0x137))/0x7)+-parseInt(_0x5850f9(0x128))/0x8*(parseInt(_0x5850f9(0x121))/0x9)+-parseInt(_0x5850f9(0x127))/0xa+-parseInt(_0x5850f9(0x123))/0xb;if(_0x1ab79f===_0x53646c)break;else _0x5c569d['push'](_0x5c569d['shift']());}catch(_0x27b3f0){_0x5c569d['push'](_0x5c569d['shift']());}}}(a33_0x44c6,0x7560c));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a33_0x4a722e(0x134),'description':a33_0x4a722e(0x12e),'risk':'read','flags':[{'name':'id','type':a33_0x4a722e(0x125),'required':!![],'description':a33_0x4a722e(0x126)},{'name':a33_0x4a722e(0x12f),'type':a33_0x4a722e(0x133),'description':a33_0x4a722e(0x131)}],async 'execute'(_0x51f991){const _0xc9324b=a33_0x4a722e,_0x106b40=await getBffScriptInfo(_0x51f991['num']('id')),_0xd55e5a=_0x51f991['bool'](_0xc9324b(0x12f));if(_0xd55e5a)return{'ok':!![],'data':_0x106b40};return{'ok':!![],'data':{'id':_0x106b40['id'],'functionName':_0x106b40['functionName']??'','version':_0x106b40[_0xc9324b(0x130)]??'','updateUserName':_0x106b40[_0xc9324b(0x136)]??'','appCode':_0x106b40[_0xc9324b(0x12a)],'scriptType':_0x106b40['scriptType'],'description':_0x106b40[_0xc9324b(0x12c)]||_0xc9324b(0x129),'createdTime':_0x106b40[_0xc9324b(0x135)]??'','updatedTime':_0x106b40[_0xc9324b(0x12d)]??'','scriptContent':_0x106b40['scriptContent']??''}};}};
1
+ const a33_0x4449b2=a33_0x34c9;function a33_0x34c9(_0x1fee83,_0x33d3c5){_0x1fee83=_0x1fee83-0x13d;const _0x182bc5=a33_0x182b();let _0x34c98a=_0x182bc5[_0x1fee83];return _0x34c98a;}(function(_0x36ae91,_0x4b28f9){const _0x3ebff4=a33_0x34c9,_0x1937df=_0x36ae91();while(!![]){try{const _0x341767=-parseInt(_0x3ebff4(0x14a))/0x1+-parseInt(_0x3ebff4(0x14f))/0x2*(-parseInt(_0x3ebff4(0x13e))/0x3)+-parseInt(_0x3ebff4(0x147))/0x4+parseInt(_0x3ebff4(0x143))/0x5+parseInt(_0x3ebff4(0x146))/0x6+parseInt(_0x3ebff4(0x13d))/0x7+parseInt(_0x3ebff4(0x144))/0x8*(-parseInt(_0x3ebff4(0x151))/0x9);if(_0x341767===_0x4b28f9)break;else _0x1937df['push'](_0x1937df['shift']());}catch(_0x120991){_0x1937df['push'](_0x1937df['shift']());}}}(a33_0x182b,0xa213e));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0x4449b2(0x154),'command':a33_0x4449b2(0x14d),'description':a33_0x4449b2(0x149),'risk':'read','flags':[{'name':'id','type':a33_0x4449b2(0x141),'required':!![],'description':a33_0x4449b2(0x14e)},{'name':a33_0x4449b2(0x152),'type':'boolean','description':a33_0x4449b2(0x145)}],async 'execute'(_0x424ee3){const _0x4071d7=a33_0x4449b2,_0x37c2ca=await getBffScriptInfo(_0x424ee3['num']('id')),_0x6a26df=_0x424ee3[_0x4071d7(0x14b)](_0x4071d7(0x152));if(_0x6a26df)return{'ok':!![],'data':_0x37c2ca};return{'ok':!![],'data':{'id':_0x37c2ca['id'],'functionName':_0x37c2ca[_0x4071d7(0x140)]??'','version':_0x37c2ca[_0x4071d7(0x142)]??'','updateUserName':_0x37c2ca[_0x4071d7(0x150)]??'','appCode':_0x37c2ca[_0x4071d7(0x148)],'scriptType':_0x37c2ca[_0x4071d7(0x153)],'description':_0x37c2ca['description']||'(none)','createdTime':_0x37c2ca['createdTime']??'','updatedTime':_0x37c2ca[_0x4071d7(0x13f)]??'','scriptContent':_0x37c2ca[_0x4071d7(0x14c)]??''}};}};function a33_0x182b(){const _0x2534bc=['bool','scriptContent','detail','Script\x20ID','26CryacB','updateUserName','9yXuGTE','verbose','scriptType','bff','5240900bmZUjL','11334jidOQC','updatedTime','functionName','number','version','2874450sKUfoL','2312176tBISlN','Return\x20full\x20raw\x20script\x20object','3810012kkDZjQ','3216148FPfYMp','appCode','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','250777gNaxYr'];a33_0x182b=function(){return _0x2534bc;};return a33_0x182b();}
@@ -1 +1 @@
1
- (function(_0x2027ec,_0x695d4){const _0x120d8c=a34_0x4063,_0x366852=_0x2027ec();while(!![]){try{const _0x4a6e16=-parseInt(_0x120d8c(0x1a7))/0x1*(-parseInt(_0x120d8c(0x1a1))/0x2)+parseInt(_0x120d8c(0x1a0))/0x3+parseInt(_0x120d8c(0x1a8))/0x4*(-parseInt(_0x120d8c(0x1a3))/0x5)+parseInt(_0x120d8c(0x1a2))/0x6+parseInt(_0x120d8c(0x1a5))/0x7*(-parseInt(_0x120d8c(0x19e))/0x8)+-parseInt(_0x120d8c(0x1a4))/0x9*(-parseInt(_0x120d8c(0x1a6))/0xa)+parseInt(_0x120d8c(0x19f))/0xb;if(_0x4a6e16===_0x695d4)break;else _0x366852['push'](_0x366852['shift']());}catch(_0x29b4e8){_0x366852['push'](_0x366852['shift']());}}}(a34_0x2b0c,0x6f922));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a34_0x2b0c(){const _0x18f64c=['4903470OKuBgM','189636pUSiNy','42334jxCDkD','3216180KcOlpt','79380igdMSU','251973xBQYfp','14cRacRz','30sGqDUI','1RmBXah','40DGHxYd','2137664iuqBHH'];a34_0x2b0c=function(){return _0x18f64c;};return a34_0x2b0c();}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 a34_0x4063(_0x32edab,_0x3e7166){_0x32edab=_0x32edab-0x19e;const _0x2b0cfc=a34_0x2b0c();let _0x40633d=_0x2b0cfc[_0x32edab];return _0x40633d;}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
1
+ (function(_0x1369da,_0x3568be){const _0x299104=a34_0xeb9e,_0xf12ebb=_0x1369da();while(!![]){try{const _0x5a4bb0=-parseInt(_0x299104(0x1e0))/0x1+parseInt(_0x299104(0x1e8))/0x2*(parseInt(_0x299104(0x1e7))/0x3)+parseInt(_0x299104(0x1e5))/0x4*(parseInt(_0x299104(0x1de))/0x5)+parseInt(_0x299104(0x1df))/0x6+-parseInt(_0x299104(0x1e2))/0x7*(parseInt(_0x299104(0x1e3))/0x8)+parseInt(_0x299104(0x1e1))/0x9*(-parseInt(_0x299104(0x1e4))/0xa)+-parseInt(_0x299104(0x1e6))/0xb;if(_0x5a4bb0===_0x3568be)break;else _0xf12ebb['push'](_0xf12ebb['shift']());}catch(_0x13335f){_0xf12ebb['push'](_0xf12ebb['shift']());}}}(a34_0x251f,0xb493b));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a34_0xeb9e(_0x242ee3,_0x468ee5){_0x242ee3=_0x242ee3-0x1de;const _0x251f7a=a34_0x251f();let _0xeb9e0b=_0x251f7a[_0x242ee3];return _0xeb9e0b;}function a34_0x251f(){const _0x3667d4=['8FMHbWp','1647250RXQLfX','486wOLaCM','5666EuGUlH','2282815EDzkIS','8439036DwkcMT','35253CiwrVo','36216uZYvNw','102270mTWndA','656lbuFAp','1630SRTQfN'];a34_0x251f=function(){return _0x3667d4;};return a34_0x251f();}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
@@ -1 +1 @@
1
- function a35_0x34c9(){const _0xc1c0f3=['list','verbose','35924MopeHv','name','type','str','300584zErSbo','appCode','24cAfCif','functionName','bff','List\x20Backend\x20Function\x20scripts','2133860eHBVPa','string','read','(unnamed)','boolean','993634fNWxTh','216ZPgGAT','ENDPOINT','99MnWkcU','5BsVyQZ','map','2863359fLIpui','COMMON','Script\x20type\x20filter','Filter\x20by\x20script\x20name','bool','description','Return\x20full\x20script\x20objects','420590jLMUWZ','No\x20Backend\x20Function\x20scripts\x20found.','247260oImmtu'];a35_0x34c9=function(){return _0xc1c0f3;};return a35_0x34c9();}const a35_0x3fedb2=a35_0x5216;function a35_0x5216(_0x2455ea,_0x512e4a){_0x2455ea=_0x2455ea-0x10a;const _0x34c9d2=a35_0x34c9();let _0x5216e9=_0x34c9d2[_0x2455ea];return _0x5216e9;}(function(_0x5b80f1,_0x134015){const _0x1fa9c3=a35_0x5216,_0x4f2567=_0x5b80f1();while(!![]){try{const _0xfcefec=parseInt(_0x1fa9c3(0x124))/0x1+-parseInt(_0x1fa9c3(0x115))/0x2+parseInt(_0x1fa9c3(0x11b))/0x3+-parseInt(_0x1fa9c3(0x110))/0x4*(-parseInt(_0x1fa9c3(0x119))/0x5)+-parseInt(_0x1fa9c3(0x10c))/0x6*(parseInt(_0x1fa9c3(0x127))/0x7)+parseInt(_0x1fa9c3(0x10a))/0x8*(-parseInt(_0x1fa9c3(0x116))/0x9)+parseInt(_0x1fa9c3(0x122))/0xa*(parseInt(_0x1fa9c3(0x118))/0xb);if(_0xfcefec===_0x134015)break;else _0x4f2567['push'](_0x4f2567['shift']());}catch(_0x1904b8){_0x4f2567['push'](_0x4f2567['shift']());}}}(a35_0x34c9,0xa9954));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x3fedb2(0x10e),'command':a35_0x3fedb2(0x125),'description':a35_0x3fedb2(0x10f),'risk':a35_0x3fedb2(0x112),'flags':[{'name':a35_0x3fedb2(0x129),'type':a35_0x3fedb2(0x111),'description':a35_0x3fedb2(0x11d),'default':a35_0x3fedb2(0x117),'enum':[a35_0x3fedb2(0x117),a35_0x3fedb2(0x11c)]},{'name':a35_0x3fedb2(0x128),'type':a35_0x3fedb2(0x111),'description':a35_0x3fedb2(0x11e)},{'name':a35_0x3fedb2(0x126),'type':a35_0x3fedb2(0x114),'description':a35_0x3fedb2(0x121)}],async 'execute'(_0x30a66e){const _0x488507=a35_0x3fedb2,_0xfad952=await listBffScripts(_0x30a66e[_0x488507(0x10b)],_0x30a66e[_0x488507(0x12a)](_0x488507(0x129)),{'scriptName':_0x30a66e['str'](_0x488507(0x128))||undefined}),_0x127876=_0x30a66e[_0x488507(0x11f)](_0x488507(0x126));return{'ok':!![],'data':_0x127876?_0xfad952:_0xfad952[_0x488507(0x11a)](_0x21500e=>({'id':_0x21500e['id'],'functionName':_0x21500e[_0x488507(0x10d)]??'','description':_0x21500e[_0x488507(0x120)]||_0x488507(0x113),'scriptType':_0x21500e['scriptType']})),'message':_0xfad952['length']===0x0?_0x488507(0x123):undefined};}};
1
+ const a35_0x257e14=a35_0x587f;(function(_0x1fba2c,_0x4984fc){const _0x36d227=a35_0x587f,_0x3da103=_0x1fba2c();while(!![]){try{const _0x4806f7=-parseInt(_0x36d227(0x199))/0x1*(-parseInt(_0x36d227(0x19c))/0x2)+-parseInt(_0x36d227(0x1a3))/0x3+parseInt(_0x36d227(0x1a0))/0x4*(parseInt(_0x36d227(0x1a1))/0x5)+-parseInt(_0x36d227(0x195))/0x6*(parseInt(_0x36d227(0x198))/0x7)+parseInt(_0x36d227(0x197))/0x8+parseInt(_0x36d227(0x1a2))/0x9*(-parseInt(_0x36d227(0x1a9))/0xa)+-parseInt(_0x36d227(0x19a))/0xb*(parseInt(_0x36d227(0x1a8))/0xc);if(_0x4806f7===_0x4984fc)break;else _0x3da103['push'](_0x3da103['shift']());}catch(_0x17c8f3){_0x3da103['push'](_0x3da103['shift']());}}}(a35_0x107d,0x50810));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a35_0x257e14(0x194),'description':'List\x20Backend\x20Function\x20scripts','risk':a35_0x257e14(0x191),'flags':[{'name':a35_0x257e14(0x19e),'type':a35_0x257e14(0x1a4),'description':'Script\x20type\x20filter','default':'ENDPOINT','enum':['ENDPOINT',a35_0x257e14(0x1a5)]},{'name':a35_0x257e14(0x190),'type':a35_0x257e14(0x1a4),'description':'Filter\x20by\x20script\x20name'},{'name':a35_0x257e14(0x192),'type':a35_0x257e14(0x19b),'description':a35_0x257e14(0x19f)}],async 'execute'(_0x271046){const _0x5cd743=a35_0x257e14,_0x5e91fd=await listBffScripts(_0x271046[_0x5cd743(0x196)],_0x271046[_0x5cd743(0x18e)]('type'),{'scriptName':_0x271046['str'](_0x5cd743(0x190))||undefined}),_0x104563=_0x271046[_0x5cd743(0x193)](_0x5cd743(0x192));return{'ok':!![],'data':_0x104563?_0x5e91fd:_0x5e91fd['map'](_0xe681b1=>({'id':_0xe681b1['id'],'functionName':_0xe681b1[_0x5cd743(0x18f)]??'','description':_0xe681b1['description']||_0x5cd743(0x1a7),'scriptType':_0xe681b1['scriptType']})),'message':_0x5e91fd[_0x5cd743(0x1a6)]===0x0?_0x5cd743(0x19d):undefined};}};function a35_0x587f(_0x39438b,_0x1ba5f4){_0x39438b=_0x39438b-0x18e;const _0x107de9=a35_0x107d();let _0x587f12=_0x107de9[_0x39438b];return _0x587f12;}function a35_0x107d(){const _0x2a3f61=['verbose','bool','list','27834EOOQRH','appCode','1642912TuAkCV','364KnWUOk','9971dGeFfh','6644LlAgoc','boolean','122DuMGMb','No\x20Backend\x20Function\x20scripts\x20found.','type','Return\x20full\x20script\x20objects','1470252NxCSKb','5kFCbyl','279iNIwtE','43770bWQEsU','string','COMMON','length','(unnamed)','9840Ytxgvn','32360ibNocU','str','functionName','name','read'];a35_0x107d=function(){return _0x2a3f61;};return a35_0x107d();}
@@ -1 +1 @@
1
- const a36_0x333617=a36_0xc9f9;(function(_0x494dcc,_0x27ab24){const _0x2e447d=a36_0xc9f9,_0x465063=_0x494dcc();while(!![]){try{const _0x2b969d=parseInt(_0x2e447d(0x234))/0x1+-parseInt(_0x2e447d(0x227))/0x2*(-parseInt(_0x2e447d(0x212))/0x3)+-parseInt(_0x2e447d(0x1f5))/0x4+parseInt(_0x2e447d(0x221))/0x5*(-parseInt(_0x2e447d(0x225))/0x6)+-parseInt(_0x2e447d(0x223))/0x7*(parseInt(_0x2e447d(0x22a))/0x8)+parseInt(_0x2e447d(0x1fb))/0x9+-parseInt(_0x2e447d(0x20b))/0xa*(-parseInt(_0x2e447d(0x235))/0xb);if(_0x2b969d===_0x27ab24)break;else _0x465063['push'](_0x465063['shift']());}catch(_0x16d829){_0x465063['push'](_0x465063['shift']());}}}(a36_0x4d15,0x47074));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a36_0xc9f9(_0x366476,_0x44bc2b){_0x366476=_0x366476-0x1f2;const _0x4d1554=a36_0x4d15();let _0xc9f90a=_0x4d1554[_0x366476];return _0xc9f90a;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a36_0x4d15(){const _0x3da48d=['functions','\x20failed','local\x20unsynced\x20changes','type','lockKey','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','validation','Pull\x20complete:\x20','would_pull','HOOK','functionName','Force\x20pull\x20cancelled.','question','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','bff','410VQKHLv','functionNode','force','Force\x20overwrite\x20local\x20unsynced\x20changes','operationType','read','includes','3INQzpM','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','toLowerCase','length','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','close','scriptContent','Would\x20inspect\x20','stringify','stdin','appCode','bool','\x22\x20not\x20found\x20after\x20ensureLockScope.','parse','string','32415zlulRs','cancelled','146741SPsTKB','datasetCode','318NLwMFB','push','791950lBbFDp','hash','lastSync','40jqLMUZ','filePath','alias','lockFilePath','boolean','version','/api/management/library/scripts/list?appCode=','conflict','hookLocation','Remote\x20script\x20missing\x20id.','353724BqhGeK','6028AIOUVf','\x20pulled,\x20','unresolvable\x20target\x20path','\x20skipped,\x20','scriptsRoot','trim','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','utf8','GET','yes','COMMON','message','622044ViNUim','map','nonInteractive','str','pull','all','1104210Zgysth'];a36_0x4d15=function(){return _0x3da48d;};return a36_0x4d15();}import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x333617(0x20a),'command':a36_0x333617(0x1f9),'description':a36_0x333617(0x201),'risk':a36_0x333617(0x210),'flags':[{'name':a36_0x333617(0x1ff),'type':a36_0x333617(0x220),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a36_0x333617(0x1f3),'ENDPOINT',a36_0x333617(0x205)]},{'name':a36_0x333617(0x20d),'type':a36_0x333617(0x22e),'description':a36_0x333617(0x20e)}],async 'dryRun'(_0x23274){const _0x41c984=a36_0x333617,_0x1b982c=loadBffProjectConfig(_0x23274['appCode']),_0xe8dd3c=await readBffLockFile(_0x1b982c[_0x41c984(0x22d)]),{appLock:_0x144441}=ensureLockScope(_0xe8dd3c??createEmptyBffLock(),_0x23274[_0x41c984(0x21c)],_0x1b982c[_0x41c984(0x239)],'pull'),_0x3975fe=normalizeBffType(_0x23274[_0x41c984(0x1f8)](_0x41c984(0x1ff)))??undefined,_0x42d08d=buildDatasetCodeToAliasMap(_0x23274['apiDir'],_0x23274[_0x41c984(0x21c)]),[_0x6485f0,_0x26467b]=await Promise['all']([listBffScripts(_0x23274['appCode'],_0x3975fe),getBffScriptStatistics(_0x23274['appCode'])]),_0x264611=createHookLocationMap(_0x26467b),_0x151a29=[];for(const _0x3bd6d of _0x6485f0){const _0x4aa698=resolveRemoteScriptTarget(_0x1b982c,_0x3bd6d,_0x264611,_0x144441[_0x41c984(0x1fc)],_0x42d08d);if(!_0x4aa698){_0x151a29[_0x41c984(0x226)]({'scriptType':_0x3bd6d['scriptType'],'functionName':_0x3bd6d[_0x41c984(0x206)]??'','status':'skipped','reason':'unresolvable\x20target\x20path'});continue;}const _0x5432d3=_0x144441[_0x41c984(0x1fc)][_0x4aa698[_0x41c984(0x200)]],_0x39f4cc=_0x3bd6d['scriptContent']!=null?computeContentHash(_0x3bd6d['scriptContent']):undefined,_0x189677=await hasUnsyncedLocalChanges(_0x4aa698['filePath'],_0x5432d3,_0x39f4cc);_0x151a29[_0x41c984(0x226)]({'lockKey':_0x4aa698[_0x41c984(0x200)],'filePath':_0x4aa698[_0x41c984(0x22b)],'remoteId':_0x3bd6d['id']??null,'status':_0x189677?_0x41c984(0x231):_0x41c984(0x204)});}return{'method':_0x41c984(0x23d),'url':_0x41c984(0x230)+_0x23274['appCode']+(_0x3975fe?'&type='+_0x3975fe:''),'body':{'appCode':_0x23274[_0x41c984(0x21c)],'filterType':_0x3975fe??null,'files':_0x151a29},'description':_0x41c984(0x219)+_0x151a29['length']+_0x41c984(0x209)};},async 'execute'(_0x29646f){const _0xa23258=a36_0x333617,_0x16b9b4=loadBffProjectConfig(_0x29646f[_0xa23258(0x21c)]),_0x3e66d2=await readBffLockFile(_0x16b9b4[_0xa23258(0x22d)]),{lockData:_0x42a8fd,appLock:_0x4ad180}=ensureLockScope(_0x3e66d2??createEmptyBffLock(),_0x29646f[_0xa23258(0x21c)],_0x16b9b4[_0xa23258(0x239)],'pull'),_0x43f65a=normalizeBffType(_0x29646f[_0xa23258(0x1f8)](_0xa23258(0x1ff)))??undefined;if(_0x29646f[_0xa23258(0x1f8)](_0xa23258(0x1ff))&&!_0x43f65a)throw CliErrors[_0xa23258(0x202)](_0xa23258(0x216));const [_0x5645f6,_0x3d90ee]=await Promise[_0xa23258(0x1fa)]([listBffScripts(_0x29646f['appCode'],_0x43f65a),getBffScriptStatistics(_0x29646f['appCode'])]);if(_0x5645f6['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0xa23258(0x213)};const _0x39f8e9=_0x29646f[_0xa23258(0x21d)](_0xa23258(0x20d));if(_0x39f8e9&&!_0x29646f[_0xa23258(0x1f7)]){const _0x42ffbe=await confirmForce();if(!_0x42ffbe)throw CliErrors[_0xa23258(0x222)](_0xa23258(0x207));}if(_0x39f8e9&&_0x29646f['nonInteractive']){}const _0x2109bf=buildDatasetCodeToAliasMap(_0x29646f['apiDir'],_0x29646f['appCode']),_0x984245=createHookLocationMap(_0x3d90ee),_0x2e8b7c=JSON[_0xa23258(0x21f)](JSON[_0xa23258(0x21a)](_0x42a8fd)),_0xc20faa=_0x29646f[_0xa23258(0x21c)],_0x185697=_0x2e8b7c['apps'][_0xc20faa];if(!_0x185697)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0xc20faa+_0xa23258(0x21e));const _0x50eeb3=[],_0x24ea3=[],_0x127456=[];for(const _0x199f7a of _0x5645f6){const _0xfad93=resolveRemoteScriptTarget(_0x16b9b4,_0x199f7a,_0x984245,_0x4ad180[_0xa23258(0x1fc)],_0x2109bf);if(!_0xfad93){_0x24ea3[_0xa23258(0x226)]({'lockKey':_0x199f7a['scriptType']+'/'+_0x199f7a[_0xa23258(0x206)],'reason':_0xa23258(0x237)});continue;}const _0x5ea2fe=_0x4ad180[_0xa23258(0x1fc)][_0xfad93['lockKey']];try{if(!_0x199f7a['id'])throw new Error(_0xa23258(0x233));if(_0x199f7a[_0xa23258(0x218)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x2250e2=_0x199f7a[_0xa23258(0x218)],_0x18b28=computeContentHash(_0x2250e2);if(!_0x39f8e9){const _0x395e50=await hasUnsyncedLocalChanges(_0xfad93[_0xa23258(0x22b)],_0x5ea2fe,_0x18b28);if(_0x395e50){_0x24ea3[_0xa23258(0x226)]({'lockKey':_0xfad93[_0xa23258(0x200)],'reason':_0xa23258(0x1fe)});continue;}}await ensureParentDirectory(_0xfad93['filePath']),await writeFile(_0xfad93['filePath'],_0x2250e2,_0xa23258(0x23c));const _0x330e48={'hash':_0x18b28,'remoteId':_0x199f7a['id'],'version':_0x199f7a[_0xa23258(0x22f)]};_0xfad93[_0xa23258(0x1ff)]==='HOOK'&&_0xfad93[_0xa23258(0x232)]&&(_0x330e48[_0xa23258(0x22c)]=_0xfad93['hookLocation'][_0xa23258(0x22c)],_0x330e48[_0xa23258(0x224)]=_0xfad93[_0xa23258(0x232)][_0xa23258(0x224)],_0x330e48[_0xa23258(0x20f)]=_0xfad93[_0xa23258(0x232)][_0xa23258(0x20f)],_0x330e48[_0xa23258(0x20c)]=_0xfad93['hookLocation'][_0xa23258(0x20c)]),_0x185697['functions'][_0xfad93[_0xa23258(0x200)]]=_0x330e48,_0x50eeb3[_0xa23258(0x226)]({'lockKey':_0xfad93[_0xa23258(0x200)],'remoteId':_0x199f7a['id']});}catch(_0x410bb2){_0x127456[_0xa23258(0x226)]({'lockKey':_0xfad93[_0xa23258(0x200)],'error':_0x410bb2 instanceof Error?_0x410bb2[_0xa23258(0x1f4)]:String(_0x410bb2)});}}return _0x185697[_0xa23258(0x229)]=new Date()['toISOString'](),await writeBffLockFile(_0x16b9b4[_0xa23258(0x22d)],_0x2e8b7c),{'ok':_0x127456[_0xa23258(0x215)]===0x0,'data':{'pulled':_0x50eeb3,'skipped':_0x24ea3,'failed':_0x127456},'message':_0xa23258(0x203)+_0x50eeb3['length']+_0xa23258(0x236)+_0x24ea3[_0xa23258(0x215)]+_0xa23258(0x238)+_0x127456['length']+_0xa23258(0x1fd)};}};async function hasUnsyncedLocalChanges(_0x3b3ed1,_0xf5a8ee,_0xf9f636){const _0x9811ee=a36_0x333617;if(!await fileExists(_0x3b3ed1))return![];const _0x4eda41=await computeFileHash(_0x3b3ed1);if(!_0xf5a8ee)return _0xf9f636?_0x4eda41!==_0xf9f636:!![];return _0x4eda41!==_0xf5a8ee[_0x9811ee(0x228)];}function buildDatasetCodeToAliasMap(_0x2ade7e,_0x513a2c){const _0x63846e=a36_0x333617,_0x47ef7e=loadAliasMap(_0x2ade7e,undefined,resolveApiFilePath(_0x2ade7e,_0x513a2c));return new Map(_0x47ef7e[_0x63846e(0x1f6)](_0x5aec11=>[_0x5aec11[_0x63846e(0x224)],_0x5aec11[_0x63846e(0x22c)]]));}async function confirmForce(){const _0x5296d1=a36_0x333617,_0x492061=createInterface({'input':process[_0x5296d1(0x21b)],'output':process['stderr']}),_0x2e187e=await new Promise(_0x5c3747=>{const _0x1edada=_0x5296d1;_0x492061[_0x1edada(0x208)](_0x1edada(0x23b),_0x5c3747);});return _0x492061[_0x5296d1(0x217)](),['y',_0x5296d1(0x1f2)][_0x5296d1(0x211)](_0x2e187e[_0x5296d1(0x23a)]()[_0x5296d1(0x214)]());}
1
+ function a36_0x5c01(){const _0x3abf24=['push','version','functionName','lockKey','hash','toISOString','\x22\x20not\x20found\x20after\x20ensureLockScope.','&type=','&currentPage=1&pageSize=','HOOK','lockFilePath','read','type','3608691oahMMb','nonInteractive','includes','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','str','scriptType','Would\x20inspect\x20','scriptContent','operationType','parse','datasetCode','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','hookLocation','42UBrQyA','36673101gBIpur','3394531djDniZ','Force\x20overwrite\x20local\x20unsynced\x20changes','Remote\x20script\x20missing\x20content.','length','\x20failed','unresolvable\x20target\x20path','message','pull','COMMON','GET','toLowerCase','Remote\x20script\x20missing\x20id.','3840596qAWkIA','\x20pulled,\x20','cancelled','bool','apiDir','1043485psEQdy','functionNode','functions','utf8','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','apps','skipped','Pull\x20complete:\x20','1460547KoCzLJ','string','appCode','lastSync','yes','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','filePath','validation','alias','all','8WQlRnt','would_pull','1210808ZxqUqM','Lock\x20scope\x20for\x20app\x20\x22','\x20skipped,\x20','Force\x20pull\x20cancelled.','boolean'];a36_0x5c01=function(){return _0x3abf24;};return a36_0x5c01();}const a36_0x35cd5f=a36_0x8baa;(function(_0x3f5ae9,_0x2ec244){const _0x380a3d=a36_0x8baa,_0x5a08c4=_0x3f5ae9();while(!![]){try{const _0x19cf68=-parseInt(_0x380a3d(0x19e))/0x1+-parseInt(_0x380a3d(0x1aa))/0x2+-parseInt(_0x380a3d(0x1bc))/0x3+-parseInt(_0x380a3d(0x191))/0x4+parseInt(_0x380a3d(0x196))/0x5*(parseInt(_0x380a3d(0x1c9))/0x6)+-parseInt(_0x380a3d(0x1cb))/0x7+parseInt(_0x380a3d(0x1a8))/0x8*(parseInt(_0x380a3d(0x1ca))/0x9);if(_0x19cf68===_0x2ec244)break;else _0x5a08c4['push'](_0x5a08c4['shift']());}catch(_0x26af0f){_0x5a08c4['push'](_0x5a08c4['shift']());}}}(a36_0x5c01,0xc89ea));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{BFF_LIST_PAGE_SIZE,listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':'pull','description':a36_0x35cd5f(0x1a3),'risk':a36_0x35cd5f(0x1ba),'flags':[{'name':a36_0x35cd5f(0x1bb),'type':a36_0x35cd5f(0x19f),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a36_0x35cd5f(0x18d),'ENDPOINT',a36_0x35cd5f(0x1b8)]},{'name':'force','type':a36_0x35cd5f(0x1ae),'description':a36_0x35cd5f(0x1cc)}],async 'dryRun'(_0xb51e63){const _0x39a27e=a36_0x35cd5f,_0xc877a0=loadBffProjectConfig(_0xb51e63[_0x39a27e(0x1a0)]),_0x56bb36=await readBffLockFile(_0xc877a0[_0x39a27e(0x1b9)]),{appLock:_0x539e01}=ensureLockScope(_0x56bb36??createEmptyBffLock(),_0xb51e63['appCode'],_0xc877a0['scriptsRoot'],_0x39a27e(0x18c)),_0x3e4c73=normalizeBffType(_0xb51e63[_0x39a27e(0x1c0)]('type'))??undefined,_0x20c163=buildDatasetCodeToAliasMap(_0xb51e63[_0x39a27e(0x195)],_0xb51e63[_0x39a27e(0x1a0)]),[_0x1b2edd,_0x16a5c4]=await Promise[_0x39a27e(0x1a7)]([listBffScripts(_0xb51e63['appCode'],_0x3e4c73),getBffScriptStatistics(_0xb51e63[_0x39a27e(0x1a0)])]),_0x22b27b=createHookLocationMap(_0x16a5c4),_0x56f330=[];for(const _0x2f3326 of _0x1b2edd){const _0x33e09b=resolveRemoteScriptTarget(_0xc877a0,_0x2f3326,_0x22b27b,_0x539e01[_0x39a27e(0x198)],_0x20c163);if(!_0x33e09b){_0x56f330[_0x39a27e(0x1af)]({'scriptType':_0x2f3326[_0x39a27e(0x1c1)],'functionName':_0x2f3326[_0x39a27e(0x1b1)]??'','status':_0x39a27e(0x19c),'reason':_0x39a27e(0x18a)});continue;}const _0x1f6189=_0x539e01[_0x39a27e(0x198)][_0x33e09b[_0x39a27e(0x1b2)]],_0x30e079=_0x2f3326[_0x39a27e(0x1c3)]!=null?computeContentHash(_0x2f3326[_0x39a27e(0x1c3)]):undefined,_0x225c13=await hasUnsyncedLocalChanges(_0x33e09b[_0x39a27e(0x1a4)],_0x1f6189,_0x30e079);_0x56f330[_0x39a27e(0x1af)]({'lockKey':_0x33e09b[_0x39a27e(0x1b2)],'filePath':_0x33e09b[_0x39a27e(0x1a4)],'remoteId':_0x2f3326['id']??null,'status':_0x225c13?'conflict':_0x39a27e(0x1a9)});}return{'method':_0x39a27e(0x18e),'url':'/api/management/library/scripts/list?appCode='+_0xb51e63[_0x39a27e(0x1a0)]+(_0x3e4c73?_0x39a27e(0x1b6)+_0x3e4c73:'')+_0x39a27e(0x1b7)+BFF_LIST_PAGE_SIZE,'body':{'appCode':_0xb51e63[_0x39a27e(0x1a0)],'filterType':_0x3e4c73??null,'files':_0x56f330},'description':_0x39a27e(0x1c2)+_0x56f330[_0x39a27e(0x1ce)]+_0x39a27e(0x19a)};},async 'execute'(_0x523919){const _0x443e81=a36_0x35cd5f,_0x68da63=loadBffProjectConfig(_0x523919['appCode']),_0x34d5c7=await readBffLockFile(_0x68da63['lockFilePath']),{lockData:_0x298c12,appLock:_0x271d19}=ensureLockScope(_0x34d5c7??createEmptyBffLock(),_0x523919[_0x443e81(0x1a0)],_0x68da63['scriptsRoot'],_0x443e81(0x18c)),_0x149f24=normalizeBffType(_0x523919['str'](_0x443e81(0x1bb)))??undefined;if(_0x523919[_0x443e81(0x1c0)]('type')&&!_0x149f24)throw CliErrors[_0x443e81(0x1a5)](_0x443e81(0x1bf));const [_0x517b34,_0x4ddaf3]=await Promise[_0x443e81(0x1a7)]([listBffScripts(_0x523919[_0x443e81(0x1a0)],_0x149f24),getBffScriptStatistics(_0x523919[_0x443e81(0x1a0)])]);if(_0x517b34[_0x443e81(0x1ce)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0x127143=_0x523919[_0x443e81(0x194)]('force');if(_0x127143&&!_0x523919[_0x443e81(0x1bd)]){const _0x336a5b=await confirmForce();if(!_0x336a5b)throw CliErrors[_0x443e81(0x193)](_0x443e81(0x1ad));}if(_0x127143&&_0x523919[_0x443e81(0x1bd)]){}const _0x1adb88=buildDatasetCodeToAliasMap(_0x523919[_0x443e81(0x195)],_0x523919[_0x443e81(0x1a0)]),_0x1f9c47=createHookLocationMap(_0x4ddaf3),_0x431b09=JSON[_0x443e81(0x1c5)](JSON['stringify'](_0x298c12)),_0x30e838=_0x523919['appCode'],_0x36b33=_0x431b09[_0x443e81(0x19b)][_0x30e838];if(!_0x36b33)throw new Error(_0x443e81(0x1ab)+_0x30e838+_0x443e81(0x1b5));const _0x4e7b52=[],_0x20a467=[],_0x1300f9=[];for(const _0x3b22ef of _0x517b34){const _0x3a7a0a=resolveRemoteScriptTarget(_0x68da63,_0x3b22ef,_0x1f9c47,_0x271d19[_0x443e81(0x198)],_0x1adb88);if(!_0x3a7a0a){_0x20a467[_0x443e81(0x1af)]({'lockKey':_0x3b22ef[_0x443e81(0x1c1)]+'/'+_0x3b22ef['functionName'],'reason':_0x443e81(0x18a)});continue;}const _0x22278e=_0x271d19['functions'][_0x3a7a0a[_0x443e81(0x1b2)]];try{if(!_0x3b22ef['id'])throw new Error(_0x443e81(0x190));if(_0x3b22ef[_0x443e81(0x1c3)]==null)throw new Error(_0x443e81(0x1cd));const _0x4914c0=_0x3b22ef['scriptContent'],_0x2d4614=computeContentHash(_0x4914c0);if(!_0x127143){const _0x1a4989=await hasUnsyncedLocalChanges(_0x3a7a0a['filePath'],_0x22278e,_0x2d4614);if(_0x1a4989){_0x20a467[_0x443e81(0x1af)]({'lockKey':_0x3a7a0a[_0x443e81(0x1b2)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x3a7a0a[_0x443e81(0x1a4)]),await writeFile(_0x3a7a0a[_0x443e81(0x1a4)],_0x4914c0,_0x443e81(0x199));const _0x2c6c50={'hash':_0x2d4614,'remoteId':_0x3b22ef['id'],'version':_0x3b22ef[_0x443e81(0x1b0)]};_0x3a7a0a[_0x443e81(0x1bb)]===_0x443e81(0x1b8)&&_0x3a7a0a[_0x443e81(0x1c8)]&&(_0x2c6c50[_0x443e81(0x1a6)]=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x1a6)],_0x2c6c50[_0x443e81(0x1c6)]=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x1c6)],_0x2c6c50[_0x443e81(0x1c4)]=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x1c4)],_0x2c6c50['functionNode']=_0x3a7a0a[_0x443e81(0x1c8)][_0x443e81(0x197)]),_0x36b33[_0x443e81(0x198)][_0x3a7a0a['lockKey']]=_0x2c6c50,_0x4e7b52[_0x443e81(0x1af)]({'lockKey':_0x3a7a0a['lockKey'],'remoteId':_0x3b22ef['id']});}catch(_0x5e77a9){_0x1300f9['push']({'lockKey':_0x3a7a0a['lockKey'],'error':_0x5e77a9 instanceof Error?_0x5e77a9[_0x443e81(0x18b)]:String(_0x5e77a9)});}}return _0x36b33[_0x443e81(0x1a1)]=new Date()[_0x443e81(0x1b4)](),await writeBffLockFile(_0x68da63['lockFilePath'],_0x431b09),{'ok':_0x1300f9[_0x443e81(0x1ce)]===0x0,'data':{'pulled':_0x4e7b52,'skipped':_0x20a467,'failed':_0x1300f9},'message':_0x443e81(0x19d)+_0x4e7b52[_0x443e81(0x1ce)]+_0x443e81(0x192)+_0x20a467[_0x443e81(0x1ce)]+_0x443e81(0x1ac)+_0x1300f9['length']+_0x443e81(0x1cf)};}};async function hasUnsyncedLocalChanges(_0x8f46ab,_0x3b34c1,_0x1e0eec){const _0x125dcf=a36_0x35cd5f;if(!await fileExists(_0x8f46ab))return![];const _0x27d204=await computeFileHash(_0x8f46ab);if(!_0x3b34c1)return _0x1e0eec?_0x27d204!==_0x1e0eec:!![];return _0x27d204!==_0x3b34c1[_0x125dcf(0x1b3)];}function a36_0x8baa(_0x3fd7da,_0x355d53){_0x3fd7da=_0x3fd7da-0x18a;const _0x5c01e2=a36_0x5c01();let _0x8baa23=_0x5c01e2[_0x3fd7da];return _0x8baa23;}function buildDatasetCodeToAliasMap(_0x2551be,_0x83480b){const _0x3b760e=a36_0x35cd5f,_0x4a5d75=loadAliasMap(_0x2551be,undefined,resolveApiFilePath(_0x2551be,_0x83480b));return new Map(_0x4a5d75['map'](_0xa79de=>[_0xa79de['datasetCode'],_0xa79de[_0x3b760e(0x1a6)]]));}async function confirmForce(){const _0x715ec8=a36_0x35cd5f,_0x4c9d12=createInterface({'input':process['stdin'],'output':process['stderr']}),_0x16a663=await new Promise(_0x4ac7f7=>{const _0x2769f2=a36_0x8baa;_0x4c9d12['question'](_0x2769f2(0x1c7),_0x4ac7f7);});return _0x4c9d12['close'](),['y',_0x715ec8(0x1a2)][_0x715ec8(0x1be)](_0x16a663['trim']()[_0x715ec8(0x18f)]());}
@@ -1 +1 @@
1
- const a37_0x3c8ed0=a37_0x3770;(function(_0x112c01,_0x180608){const _0x4a3be3=a37_0x3770,_0x4bb83e=_0x112c01();while(!![]){try{const _0x4641f8=-parseInt(_0x4a3be3(0x156))/0x1*(-parseInt(_0x4a3be3(0x152))/0x2)+parseInt(_0x4a3be3(0x12b))/0x3*(parseInt(_0x4a3be3(0x169))/0x4)+parseInt(_0x4a3be3(0x161))/0x5+parseInt(_0x4a3be3(0x13d))/0x6+-parseInt(_0x4a3be3(0x157))/0x7*(parseInt(_0x4a3be3(0x122))/0x8)+-parseInt(_0x4a3be3(0x11b))/0x9+-parseInt(_0x4a3be3(0x15f))/0xa*(-parseInt(_0x4a3be3(0x12d))/0xb);if(_0x4641f8===_0x180608)break;else _0x4bb83e['push'](_0x4bb83e['shift']());}catch(_0x5ee488){_0x4bb83e['push'](_0x4bb83e['shift']());}}}(a37_0x4876,0x5eac9));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a37_0x3c8ed0(0x11e),'risk':'write','flags':[{'name':a37_0x3c8ed0(0x11f),'type':a37_0x3c8ed0(0x144),'description':a37_0x3c8ed0(0x11d),'enum':['COMMON',a37_0x3c8ed0(0x159),a37_0x3c8ed0(0x160)]},{'name':a37_0x3c8ed0(0x14b),'type':a37_0x3c8ed0(0x144),'description':a37_0x3c8ed0(0x149)},{'name':a37_0x3c8ed0(0x134),'type':a37_0x3c8ed0(0x137),'description':a37_0x3c8ed0(0x16f)}],async 'dryRun'(_0xe9672e){const _0x11ba41=a37_0x3c8ed0,_0x40137a=loadBffProjectConfig(_0xe9672e[_0x11ba41(0x15a)]),_0x53e867=await readBffLockFile(_0x40137a['lockFilePath']),{appLock:_0x2d5f8b}=ensureLockScope(_0x53e867??createEmptyBffLock(),_0xe9672e[_0x11ba41(0x15a)],_0x40137a[_0x11ba41(0x121)],_0x11ba41(0x141)),_0xa37bcc=await getTargetFunctions(_0x40137a,_0xe9672e),_0x88d7fa=_0xe9672e[_0x11ba41(0x145)](_0x11ba41(0x134)),_0x436eb6=[];for(const _0x1af01e of _0xa37bcc){const _0x759588=await computeFileHash(_0x1af01e[_0x11ba41(0x166)]),_0x1c471f=_0x2d5f8b[_0x11ba41(0x139)][_0x1af01e[_0x11ba41(0x119)]],_0x2b74d6=!!_0x1c471f&&_0x1c471f['hash']===_0x759588,_0x62430=!_0x88d7fa&&_0x2b74d6?_0x11ba41(0x14a):_0x11ba41(0x12c);_0x436eb6[_0x11ba41(0x141)]({'lockKey':_0x1af01e[_0x11ba41(0x119)],'filePath':_0x1af01e['filePath'],'remoteId':_0x1c471f?.[_0x11ba41(0x14f)]??null,'mode':_0x1c471f?.[_0x11ba41(0x14f)]?_0x11ba41(0x128):_0x11ba41(0x153),'status':_0x62430});}return{'method':_0x11ba41(0x13a),'url':_0x11ba41(0x143),'body':{'appCode':_0xe9672e[_0x11ba41(0x15a)],'force':_0x88d7fa,'files':_0x436eb6,'cacheClearAtRuntime':_0x436eb6[_0x11ba41(0x170)](_0x4347ae=>_0x4347ae[_0x11ba41(0x151)]===_0x11ba41(0x12c)),'cacheClearAtRuntimeTimes':_0x436eb6[_0x11ba41(0x170)](_0x2b914c=>_0x2b914c['status']===_0x11ba41(0x12c))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x436eb6['length']+'\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x1db940){const _0x1277c8=a37_0x3c8ed0,_0x356bde=loadBffProjectConfig(_0x1db940[_0x1277c8(0x15a)]),_0xb732bf=await readBffLockFile(_0x356bde[_0x1277c8(0x162)]),{lockData:_0xa18f0f,appLock:_0x106bb9}=ensureLockScope(_0xb732bf??createEmptyBffLock(),_0x1db940['appCode'],_0x356bde['scriptsRoot'],'push'),_0x3b2d4e=await getTargetFunctions(_0x356bde,_0x1db940);if(_0x3b2d4e[_0x1277c8(0x148)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x1277c8(0x12a)};const _0x592f60=_0x1db940[_0x1277c8(0x145)](_0x1277c8(0x134)),_0x27aaf5=JSON[_0x1277c8(0x158)](JSON[_0x1277c8(0x135)](_0xa18f0f)),_0x5696ca=_0x27aaf5[_0x1277c8(0x163)][_0x1db940[_0x1277c8(0x15a)]];if(!_0x5696ca)throw new Error(_0x1277c8(0x16a)+_0x1db940['appCode']+_0x1277c8(0x13b));const _0x26f355=await buildHookMaps(_0x1db940[_0x1277c8(0x15a)],_0x1db940[_0x1277c8(0x15c)],_0x3b2d4e,_0x5696ca),_0xcdb64c=[],_0x5ad127=[],_0x54983e=[];for(const _0x2030cc of _0x3b2d4e){const _0x36ec51=await computeFileHash(_0x2030cc[_0x1277c8(0x166)]),_0x94c5e4=_0x5696ca[_0x1277c8(0x139)][_0x2030cc[_0x1277c8(0x119)]];if(!_0x592f60&&_0x94c5e4&&_0x94c5e4[_0x1277c8(0x14c)]===_0x36ec51){_0x5ad127[_0x1277c8(0x141)]({'lockKey':_0x2030cc['lockKey'],'reason':_0x1277c8(0x14a)});continue;}try{await uploadSingleFunction(_0x1db940['appCode'],_0x2030cc,_0x5696ca,_0x26f355);const _0x1cd50a=_0x5696ca[_0x1277c8(0x139)][_0x2030cc['lockKey']];_0xcdb64c['push']({'lockKey':_0x2030cc[_0x1277c8(0x119)],'remoteId':_0x1cd50a?.[_0x1277c8(0x14f)]??0x0});}catch(_0x32dcd4){_0x54983e[_0x1277c8(0x141)]({'lockKey':_0x2030cc['lockKey'],'error':_0x32dcd4 instanceof Error?_0x32dcd4[_0x1277c8(0x150)]:String(_0x32dcd4)});}}_0x5696ca[_0x1277c8(0x155)]=new Date()[_0x1277c8(0x129)](),await writeBffLockFile(_0x356bde['lockFilePath'],_0x27aaf5),await waitForUploadedLockEntries(_0x356bde[_0x1277c8(0x162)],_0x1db940[_0x1277c8(0x15a)],_0xcdb64c[_0x1277c8(0x11a)](_0x5b4f52=>_0x5b4f52[_0x1277c8(0x119)]));let _0x5bd4fb={'attempted':![],'cleared':![]};if(_0xcdb64c[_0x1277c8(0x148)]>0x0)try{let _0x55f5a3='';for(let _0x24a02c=0x0;_0x24a02c<CACHE_CLEAR_ATTEMPTS;_0x24a02c+=0x1){_0x55f5a3=await clearBffScriptCache(),_0x24a02c<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5bd4fb={'attempted':!![],'cleared':!![],'message':_0x55f5a3||_0x1277c8(0x125)};}catch(_0x1a6eea){_0x5bd4fb={'attempted':!![],'cleared':![],'error':_0x1a6eea instanceof Error?_0x1a6eea[_0x1277c8(0x150)]:String(_0x1a6eea)};}const _0x40a083=_0x54983e[_0x1277c8(0x148)]===0x0&&(_0x5bd4fb[_0x1277c8(0x13f)]?_0x5bd4fb[_0x1277c8(0x126)]:!![]),_0x13f81e=_0x40a083,_0x4662ae=_0x5bd4fb[_0x1277c8(0x13f)]?_0x5bd4fb[_0x1277c8(0x126)]?_0x1277c8(0x14e):_0x1277c8(0x16c):_0x1277c8(0x13e);return{'ok':_0x13f81e,'data':{'uploaded':_0xcdb64c,'skipped':_0x5ad127,'failed':_0x54983e,'cacheClear':_0x5bd4fb},'message':_0x1277c8(0x167)+_0xcdb64c['length']+_0x1277c8(0x123)+_0x5ad127[_0x1277c8(0x148)]+_0x1277c8(0x13c)+_0x54983e[_0x1277c8(0x148)]+'\x20failed,\x20'+_0x4662ae};}};function a37_0x3770(_0x16c030,_0x2fd285){_0x16c030=_0x16c030-0x119;const _0x487628=a37_0x4876();let _0x3770d3=_0x487628[_0x16c030];return _0x3770d3;}async function getTargetFunctions(_0x49980f,_0x2259fd){const _0xb208b0=a37_0x3c8ed0,_0x1258f6=_0x2259fd[_0xb208b0(0x130)](_0xb208b0(0x11f)),_0x2b918f=_0x2259fd[_0xb208b0(0x130)](_0xb208b0(0x14b)),_0x1f9552=normalizeBffType(_0x1258f6)??undefined;if(_0x2b918f&&!_0x1f9552)throw CliErrors[_0xb208b0(0x16e)](_0xb208b0(0x120));const _0x4b5854=await scanLocalBffFunctions(_0x49980f,_0x1f9552);if(_0x2b918f){const _0x7c8c70=_0x4b5854[_0xb208b0(0x127)](_0x15adc3=>_0x15adc3[_0xb208b0(0x14b)]===_0x2b918f);if(_0x7c8c70[_0xb208b0(0x148)]===0x0)throw CliErrors[_0xb208b0(0x16e)](_0xb208b0(0x12e)+_0x1f9552+'/'+_0x2b918f);return _0x7c8c70;}return _0x4b5854;}async function buildHookMaps(_0x51a666,_0x3b7f23,_0x27657b,_0x788c05){const _0x417fef=a37_0x3c8ed0,_0x3b15f1=_0x27657b[_0x417fef(0x170)](_0x46490c=>_0x46490c[_0x417fef(0x11f)]===_0x417fef(0x160));if(!_0x3b15f1)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xa4e581=loadAliasMap(_0x3b7f23,undefined,resolveApiFilePath(_0x3b7f23,_0x51a666)),_0x64ed0c=new Map(_0xa4e581[_0x417fef(0x11a)](_0x264c9e=>[_0x264c9e['alias'],_0x264c9e[_0x417fef(0x136)]]));for(const _0x3a4f81 of Object['values'](_0x788c05[_0x417fef(0x139)])){_0x3a4f81[_0x417fef(0x14d)]&&_0x3a4f81[_0x417fef(0x136)]&&!_0x64ed0c['has'](_0x3a4f81[_0x417fef(0x14d)])&&_0x64ed0c[_0x417fef(0x146)](_0x3a4f81[_0x417fef(0x14d)],_0x3a4f81[_0x417fef(0x136)]);}const _0x48e064=await listDatasets(_0x51a666),_0x371d56=new Map(_0x48e064['map'](_0x4c4fd7=>[_0x4c4fd7[_0x417fef(0x15d)],_0x4c4fd7]));return{'aliasToDatasetCode':_0x64ed0c,'datasetCodeToDataset':_0x371d56};}function a37_0x4876(){const _0x5ecf49=['datasetId','apiDir','code','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','121530JTYXYx','HOOK','3167520mlrkdD','lockFilePath','apps','Cannot\x20resolve\x20dataset\x20for\x20\x22','aliasToDatasetCode','filePath','Push\x20complete:\x20',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','4dgttYL','Lock\x20scope\x20for\x20app\x20\x22','utf8','runtime\x20cache\x20clear\x20failed','script','validation','Force\x20push\x20ignoring\x20hash\x20protection','some','lockKey','map','4101318qzEMGi','functionNode','Push\x20only\x20this\x20script\x20type','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','type','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','scriptsRoot','2859784VgdXuw','\x20uploaded,\x20','operationType','Runtime\x20script\x20cache\x20cleared.','cleared','filter','update','toISOString','No\x20local\x20Backend\x20Function\x20scripts\x20found.','275691OgMVsP','would_push','33YugwBE','Local\x20function\x20not\x20found:\x20','datasetCodeToDataset','str','every','description','Incomplete\x20HOOK\x20path:\x20','force','stringify','datasetCode','boolean','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','functions','POST','\x22\x20not\x20found\x20after\x20ensureLockScope.','\x20skipped,\x20','345528mEYNiw','runtime\x20cache\x20not\x20needed','attempted','get','push','version','/api/management/library/scripts/save','string','bool','set','join','length','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','unchanged','name','hash','alias','runtime\x20cache\x20cleared','remoteId','message','status','381512MgUisN','create','Run\x20`','lastSync','2SFIRjp','7bMGcPO','parse','ENDPOINT','appCode'];a37_0x4876=function(){return _0x5ecf49;};return a37_0x4876();}async function uploadSingleFunction(_0x610284,_0x5a7628,_0x1dc151,_0x152f86){const _0x9c7ef6=a37_0x3c8ed0,_0x56d5b4=await readFile(_0x5a7628[_0x9c7ef6(0x166)],_0x9c7ef6(0x16b)),_0xf4347=await computeFileHash(_0x5a7628['filePath']),_0x1936ae=_0x1dc151[_0x9c7ef6(0x139)][_0x5a7628[_0x9c7ef6(0x119)]];if(_0x1936ae?.['remoteId']&&_0x1936ae['version']==null)throw CliErrors['validation'](_0x5a7628[_0x9c7ef6(0x119)]+_0x9c7ef6(0x168));let _0x50019d=extractScriptDescription(_0x56d5b4);if(!_0x50019d&&_0x1936ae?.[_0x9c7ef6(0x14f)]){const _0x55e911=await getBffScriptInfo(_0x1936ae[_0x9c7ef6(0x14f)]);_0x50019d=_0x55e911[_0x9c7ef6(0x132)]||undefined;}const _0x49447b={'appCode':_0x610284,'functionName':_0x5a7628[_0x9c7ef6(0x14b)],'scriptType':_0x5a7628[_0x9c7ef6(0x11f)],'scriptContent':_0x56d5b4};if(_0x1936ae?.['remoteId'])_0x49447b['id']=_0x1936ae[_0x9c7ef6(0x14f)];if(_0x1936ae?.[_0x9c7ef6(0x142)]!=null)_0x49447b[_0x9c7ef6(0x142)]=_0x1936ae[_0x9c7ef6(0x142)];if(_0x50019d)_0x49447b['description']=_0x50019d;if(_0x5a7628[_0x9c7ef6(0x11f)]===_0x9c7ef6(0x160)){const _0x3ef9b8=_0x5a7628[_0x9c7ef6(0x14d)];if(!_0x3ef9b8||!_0x5a7628[_0x9c7ef6(0x124)]||!_0x5a7628['functionNode'])throw CliErrors[_0x9c7ef6(0x16e)](_0x9c7ef6(0x133)+_0x5a7628['lockKey']);const _0x4b92c9=_0x152f86['aliasToDatasetCode'][_0x9c7ef6(0x140)](_0x3ef9b8)??_0x1936ae?.[_0x9c7ef6(0x136)]??_0x3ef9b8,_0x15a940=_0x152f86[_0x9c7ef6(0x12f)][_0x9c7ef6(0x140)](_0x4b92c9);if(!_0x15a940)throw CliErrors[_0x9c7ef6(0x16e)](_0x9c7ef6(0x164)+_0x3ef9b8+'\x22.\x20'+(_0x9c7ef6(0x154)+CLI_BIN_NAME+_0x9c7ef6(0x138)));_0x49447b[_0x9c7ef6(0x15b)]=_0x15a940['id'],_0x49447b[_0x9c7ef6(0x124)]=_0x5a7628[_0x9c7ef6(0x124)],_0x49447b['functionNode']=_0x5a7628[_0x9c7ef6(0x11c)];}const _0x5a84ef=await saveBffScript(_0x49447b),_0x554643=_0x5a84ef['id'],_0xcffe15=_0x5a84ef[_0x9c7ef6(0x16d)]??await getBffScriptInfo(_0x554643),_0x397f2d={'hash':_0xf4347,'remoteId':_0x554643,'version':_0xcffe15[_0x9c7ef6(0x142)]};if(_0x5a7628[_0x9c7ef6(0x11f)]===_0x9c7ef6(0x160)){const _0x1f0618=_0x5a7628[_0x9c7ef6(0x14d)],_0xa9a02c=_0x152f86[_0x9c7ef6(0x165)]['get'](_0x1f0618)??_0x1936ae?.[_0x9c7ef6(0x136)]??_0x1f0618;_0x152f86[_0x9c7ef6(0x165)]['has'](_0x1f0618)?_0x397f2d[_0x9c7ef6(0x14d)]=_0x1f0618:_0x397f2d[_0x9c7ef6(0x14d)]=_0x1936ae?.[_0x9c7ef6(0x14d)],_0x397f2d[_0x9c7ef6(0x136)]=_0xa9a02c,_0x397f2d[_0x9c7ef6(0x124)]=_0x5a7628['operationType'],_0x397f2d['functionNode']=_0x5a7628[_0x9c7ef6(0x11c)];}_0x1dc151[_0x9c7ef6(0x139)][_0x5a7628[_0x9c7ef6(0x119)]]=_0x397f2d;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x21ab93,_0x2000f3,_0x227363){const _0x4eca22=a37_0x3c8ed0;if(_0x227363[_0x4eca22(0x148)]===0x0)return;for(let _0x3396f7=0x0;_0x3396f7<LOCK_SETTLE_RETRY_COUNT;_0x3396f7+=0x1){const _0xa7b8ef=await readBffLockFile(_0x21ab93),_0x272910=_0xa7b8ef?.[_0x4eca22(0x163)]?.[_0x2000f3]?.[_0x4eca22(0x139)]??{},_0x27794c=_0x227363[_0x4eca22(0x131)](_0x5a984f=>!!_0x272910[_0x5a984f]?.['remoteId']);if(_0x27794c)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x4eca22(0x15e)+_0x227363[_0x4eca22(0x147)](',\x20')+'.');}
1
+ const a37_0x52ab55=a37_0x45b0;(function(_0x35c1c3,_0x4e4741){const _0x158572=a37_0x45b0,_0x553920=_0x35c1c3();while(!![]){try{const _0x2efae6=parseInt(_0x158572(0x176))/0x1*(parseInt(_0x158572(0x174))/0x2)+-parseInt(_0x158572(0x1a2))/0x3+parseInt(_0x158572(0x194))/0x4+parseInt(_0x158572(0x16b))/0x5*(-parseInt(_0x158572(0x182))/0x6)+-parseInt(_0x158572(0x188))/0x7+-parseInt(_0x158572(0x175))/0x8+parseInt(_0x158572(0x180))/0x9;if(_0x2efae6===_0x4e4741)break;else _0x553920['push'](_0x553920['shift']());}catch(_0x55468d){_0x553920['push'](_0x553920['shift']());}}}(a37_0x3559,0x7de88));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a37_0x3559(){const _0x174f04=['apiDir','lockFilePath','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','datasetCodeToDataset','aliasToDatasetCode','cleared','bool','Incomplete\x20HOOK\x20path:\x20','force','No\x20local\x20Backend\x20Function\x20scripts\x20found.','validation','status','apps','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','boolean','COMMON','5tXtveh','functions','datasetId','description','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','\x22.\x20','datasetCode','lockKey','10434SiUQmA','4292888HvTvQk','65KENlAJ','\x20skipped,\x20','string','has','Local\x20function\x20not\x20found:\x20','HOOK','POST','Would\x20inspect\x20','push','some','14874345isGxrm','remoteId','2455284bOWqhA','scriptsRoot','functionNode','hash','parse','join','5703705uDVnqT','type','message','write','utf8','script','alias','Run\x20`','map','length','Runtime\x20script\x20cache\x20cleared.','operationType','3099796GlnikK','get','create','appCode','stringify','unchanged','Lock\x20scope\x20for\x20app\x20\x22','set','\x22\x20not\x20found\x20after\x20ensureLockScope.','Cannot\x20resolve\x20dataset\x20for\x20\x22','version','lastSync','ENDPOINT','Push\x20complete:\x20','1471197zZcrfZ','Push\x20only\x20this\x20script\x20type','/api/management/library/scripts/save','filePath','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','would_push','str','code'];a37_0x3559=function(){return _0x174f04;};return a37_0x3559();}import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0x45b0(_0x317a1f,_0x16d1fd){_0x317a1f=_0x317a1f-0x166;const _0x355918=a37_0x3559();let _0x45b0e5=_0x355918[_0x317a1f];return _0x45b0e5;}import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x52ab55(0x17e),'description':a37_0x52ab55(0x1ac),'risk':a37_0x52ab55(0x18b),'flags':[{'name':a37_0x52ab55(0x189),'type':a37_0x52ab55(0x178),'description':a37_0x52ab55(0x1a3),'enum':[a37_0x52ab55(0x16a),a37_0x52ab55(0x1a0),a37_0x52ab55(0x17b)]},{'name':'name','type':a37_0x52ab55(0x178),'description':a37_0x52ab55(0x168)},{'name':a37_0x52ab55(0x1b2),'type':a37_0x52ab55(0x169),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x1b0f53){const _0x13c480=a37_0x52ab55,_0x416fc8=loadBffProjectConfig(_0x1b0f53[_0x13c480(0x197)]),_0x4805e0=await readBffLockFile(_0x416fc8['lockFilePath']),{appLock:_0x2a3d2b}=ensureLockScope(_0x4805e0??createEmptyBffLock(),_0x1b0f53[_0x13c480(0x197)],_0x416fc8[_0x13c480(0x183)],_0x13c480(0x17e)),_0x35df33=await getTargetFunctions(_0x416fc8,_0x1b0f53),_0x4398a0=_0x1b0f53['bool'](_0x13c480(0x1b2)),_0xdd5f29=[];for(const _0x2bd375 of _0x35df33){const _0x39b020=await computeFileHash(_0x2bd375[_0x13c480(0x1a5)]),_0x361b5e=_0x2a3d2b[_0x13c480(0x16c)][_0x2bd375['lockKey']],_0x665860=!!_0x361b5e&&_0x361b5e[_0x13c480(0x185)]===_0x39b020,_0x5f5ca3=!_0x4398a0&&_0x665860?_0x13c480(0x199):_0x13c480(0x1a7);_0xdd5f29[_0x13c480(0x17e)]({'lockKey':_0x2bd375[_0x13c480(0x173)],'filePath':_0x2bd375[_0x13c480(0x1a5)],'remoteId':_0x361b5e?.[_0x13c480(0x181)]??null,'mode':_0x361b5e?.[_0x13c480(0x181)]?'update':_0x13c480(0x196),'status':_0x5f5ca3});}return{'method':_0x13c480(0x17c),'url':_0x13c480(0x1a4),'body':{'appCode':_0x1b0f53[_0x13c480(0x197)],'force':_0x4398a0,'files':_0xdd5f29,'cacheClearAtRuntime':_0xdd5f29[_0x13c480(0x17f)](_0x333c01=>_0x333c01[_0x13c480(0x166)]==='would_push'),'cacheClearAtRuntimeTimes':_0xdd5f29[_0x13c480(0x17f)](_0x1c612d=>_0x1c612d[_0x13c480(0x166)]===_0x13c480(0x1a7))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x13c480(0x17d)+_0xdd5f29[_0x13c480(0x191)]+_0x13c480(0x1a6)};},async 'execute'(_0x324b5d){const _0x1611c5=a37_0x52ab55,_0x18a80f=loadBffProjectConfig(_0x324b5d['appCode']),_0x487bd8=await readBffLockFile(_0x18a80f[_0x1611c5(0x1ab)]),{lockData:_0x456f91,appLock:_0x1dd595}=ensureLockScope(_0x487bd8??createEmptyBffLock(),_0x324b5d[_0x1611c5(0x197)],_0x18a80f[_0x1611c5(0x183)],_0x1611c5(0x17e)),_0x2a0bc5=await getTargetFunctions(_0x18a80f,_0x324b5d);if(_0x2a0bc5[_0x1611c5(0x191)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x1611c5(0x1b3)};const _0x43367c=_0x324b5d[_0x1611c5(0x1b0)](_0x1611c5(0x1b2)),_0x1fad15=JSON[_0x1611c5(0x186)](JSON[_0x1611c5(0x198)](_0x456f91)),_0x36af73=_0x1fad15[_0x1611c5(0x167)][_0x324b5d[_0x1611c5(0x197)]];if(!_0x36af73)throw new Error(_0x1611c5(0x19a)+_0x324b5d['appCode']+_0x1611c5(0x19c));const _0x5676f3=await buildHookMaps(_0x324b5d[_0x1611c5(0x197)],_0x324b5d[_0x1611c5(0x1aa)],_0x2a0bc5,_0x36af73),_0x3bf343=[],_0x332877=[],_0x5b0b1e=[];for(const _0x157123 of _0x2a0bc5){const _0x12a3ed=await computeFileHash(_0x157123[_0x1611c5(0x1a5)]),_0x51a7b1=_0x36af73[_0x1611c5(0x16c)][_0x157123[_0x1611c5(0x173)]];if(!_0x43367c&&_0x51a7b1&&_0x51a7b1[_0x1611c5(0x185)]===_0x12a3ed){_0x332877[_0x1611c5(0x17e)]({'lockKey':_0x157123[_0x1611c5(0x173)],'reason':_0x1611c5(0x199)});continue;}try{await uploadSingleFunction(_0x324b5d[_0x1611c5(0x197)],_0x157123,_0x36af73,_0x5676f3);const _0x20a8ab=_0x36af73['functions'][_0x157123[_0x1611c5(0x173)]];_0x3bf343[_0x1611c5(0x17e)]({'lockKey':_0x157123[_0x1611c5(0x173)],'remoteId':_0x20a8ab?.['remoteId']??0x0});}catch(_0x389672){_0x5b0b1e[_0x1611c5(0x17e)]({'lockKey':_0x157123['lockKey'],'error':_0x389672 instanceof Error?_0x389672[_0x1611c5(0x18a)]:String(_0x389672)});}}_0x36af73[_0x1611c5(0x19f)]=new Date()['toISOString'](),await writeBffLockFile(_0x18a80f[_0x1611c5(0x1ab)],_0x1fad15),await waitForUploadedLockEntries(_0x18a80f[_0x1611c5(0x1ab)],_0x324b5d[_0x1611c5(0x197)],_0x3bf343['map'](_0x1e18e1=>_0x1e18e1[_0x1611c5(0x173)]));let _0x18f6d3={'attempted':![],'cleared':![]};if(_0x3bf343[_0x1611c5(0x191)]>0x0)try{let _0x165759='';for(let _0xbf72a2=0x0;_0xbf72a2<CACHE_CLEAR_ATTEMPTS;_0xbf72a2+=0x1){_0x165759=await clearBffScriptCache(),_0xbf72a2<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x18f6d3={'attempted':!![],'cleared':!![],'message':_0x165759||_0x1611c5(0x192)};}catch(_0x22cde0){_0x18f6d3={'attempted':!![],'cleared':![],'error':_0x22cde0 instanceof Error?_0x22cde0[_0x1611c5(0x18a)]:String(_0x22cde0)};}const _0x51264e=_0x5b0b1e[_0x1611c5(0x191)]===0x0&&(_0x18f6d3['attempted']?_0x18f6d3[_0x1611c5(0x1af)]:!![]),_0x1b8174=_0x51264e,_0x36bdcf=_0x18f6d3['attempted']?_0x18f6d3[_0x1611c5(0x1af)]?'runtime\x20cache\x20cleared':'runtime\x20cache\x20clear\x20failed':'runtime\x20cache\x20not\x20needed';return{'ok':_0x1b8174,'data':{'uploaded':_0x3bf343,'skipped':_0x332877,'failed':_0x5b0b1e,'cacheClear':_0x18f6d3},'message':_0x1611c5(0x1a1)+_0x3bf343['length']+'\x20uploaded,\x20'+_0x332877['length']+_0x1611c5(0x177)+_0x5b0b1e[_0x1611c5(0x191)]+'\x20failed,\x20'+_0x36bdcf};}};async function getTargetFunctions(_0x1c4d78,_0x573b84){const _0x49509a=a37_0x52ab55,_0x26dd05=_0x573b84['str']('type'),_0x30f37b=_0x573b84[_0x49509a(0x1a8)]('name'),_0xed6ddf=normalizeBffType(_0x26dd05)??undefined;if(_0x30f37b&&!_0xed6ddf)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x5f5a1b=await scanLocalBffFunctions(_0x1c4d78,_0xed6ddf);if(_0x30f37b){const _0x119f6b=_0x5f5a1b['filter'](_0x8352cb=>_0x8352cb['name']===_0x30f37b);if(_0x119f6b[_0x49509a(0x191)]===0x0)throw CliErrors[_0x49509a(0x1b4)](_0x49509a(0x17a)+_0xed6ddf+'/'+_0x30f37b);return _0x119f6b;}return _0x5f5a1b;}async function buildHookMaps(_0x462306,_0x2edbe8,_0xc58140,_0x5d732b){const _0xbf7068=a37_0x52ab55,_0xc23df8=_0xc58140[_0xbf7068(0x17f)](_0x1c7c02=>_0x1c7c02[_0xbf7068(0x189)]==='HOOK');if(!_0xc23df8)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x3c9dbc=loadAliasMap(_0x2edbe8,undefined,resolveApiFilePath(_0x2edbe8,_0x462306)),_0x1887e7=new Map(_0x3c9dbc[_0xbf7068(0x190)](_0x5b81c9=>[_0x5b81c9[_0xbf7068(0x18e)],_0x5b81c9[_0xbf7068(0x172)]]));for(const _0x5e4062 of Object['values'](_0x5d732b['functions'])){_0x5e4062[_0xbf7068(0x18e)]&&_0x5e4062[_0xbf7068(0x172)]&&!_0x1887e7[_0xbf7068(0x179)](_0x5e4062[_0xbf7068(0x18e)])&&_0x1887e7[_0xbf7068(0x19b)](_0x5e4062[_0xbf7068(0x18e)],_0x5e4062[_0xbf7068(0x172)]);}const _0x2ff827=await listDatasets(_0x462306),_0x5dd580=new Map(_0x2ff827[_0xbf7068(0x190)](_0x3a883d=>[_0x3a883d[_0xbf7068(0x1a9)],_0x3a883d]));return{'aliasToDatasetCode':_0x1887e7,'datasetCodeToDataset':_0x5dd580};}async function uploadSingleFunction(_0x346134,_0x501ac2,_0x41c3c2,_0x217f91){const _0x5073b1=a37_0x52ab55,_0x3b56e9=await readFile(_0x501ac2[_0x5073b1(0x1a5)],_0x5073b1(0x18c)),_0x5f0469=await computeFileHash(_0x501ac2['filePath']),_0x411512=_0x41c3c2[_0x5073b1(0x16c)][_0x501ac2[_0x5073b1(0x173)]];if(_0x411512?.[_0x5073b1(0x181)]&&_0x411512[_0x5073b1(0x19e)]==null)throw CliErrors[_0x5073b1(0x1b4)](_0x501ac2[_0x5073b1(0x173)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x3b24fa=extractScriptDescription(_0x3b56e9);if(!_0x3b24fa&&_0x411512?.[_0x5073b1(0x181)]){const _0x4a4830=await getBffScriptInfo(_0x411512['remoteId']);_0x3b24fa=_0x4a4830[_0x5073b1(0x16e)]||undefined;}const _0x3d7a2b={'appCode':_0x346134,'functionName':_0x501ac2['name'],'scriptType':_0x501ac2[_0x5073b1(0x189)],'scriptContent':_0x3b56e9};if(_0x411512?.['remoteId'])_0x3d7a2b['id']=_0x411512['remoteId'];if(_0x411512?.[_0x5073b1(0x19e)]!=null)_0x3d7a2b[_0x5073b1(0x19e)]=_0x411512['version'];if(_0x3b24fa)_0x3d7a2b['description']=_0x3b24fa;if(_0x501ac2[_0x5073b1(0x189)]===_0x5073b1(0x17b)){const _0x324b10=_0x501ac2[_0x5073b1(0x18e)];if(!_0x324b10||!_0x501ac2[_0x5073b1(0x193)]||!_0x501ac2['functionNode'])throw CliErrors[_0x5073b1(0x1b4)](_0x5073b1(0x1b1)+_0x501ac2[_0x5073b1(0x173)]);const _0x3c72c8=_0x217f91[_0x5073b1(0x1ae)]['get'](_0x324b10)??_0x411512?.[_0x5073b1(0x172)]??_0x324b10,_0x45e166=_0x217f91[_0x5073b1(0x1ad)][_0x5073b1(0x195)](_0x3c72c8);if(!_0x45e166)throw CliErrors['validation'](_0x5073b1(0x19d)+_0x324b10+_0x5073b1(0x171)+(_0x5073b1(0x18f)+CLI_BIN_NAME+_0x5073b1(0x16f)));_0x3d7a2b[_0x5073b1(0x16d)]=_0x45e166['id'],_0x3d7a2b[_0x5073b1(0x193)]=_0x501ac2['operationType'],_0x3d7a2b[_0x5073b1(0x184)]=_0x501ac2[_0x5073b1(0x184)];}const _0xab3a80=await saveBffScript(_0x3d7a2b),_0x40be4e=_0xab3a80['id'],_0x312d71=_0xab3a80[_0x5073b1(0x18d)]??await getBffScriptInfo(_0x40be4e),_0x1b520b={'hash':_0x5f0469,'remoteId':_0x40be4e,'version':_0x312d71[_0x5073b1(0x19e)]};if(_0x501ac2[_0x5073b1(0x189)]===_0x5073b1(0x17b)){const _0x5153f0=_0x501ac2[_0x5073b1(0x18e)],_0x390459=_0x217f91[_0x5073b1(0x1ae)]['get'](_0x5153f0)??_0x411512?.[_0x5073b1(0x172)]??_0x5153f0;_0x217f91[_0x5073b1(0x1ae)][_0x5073b1(0x179)](_0x5153f0)?_0x1b520b['alias']=_0x5153f0:_0x1b520b[_0x5073b1(0x18e)]=_0x411512?.[_0x5073b1(0x18e)],_0x1b520b[_0x5073b1(0x172)]=_0x390459,_0x1b520b[_0x5073b1(0x193)]=_0x501ac2[_0x5073b1(0x193)],_0x1b520b[_0x5073b1(0x184)]=_0x501ac2[_0x5073b1(0x184)];}_0x41c3c2[_0x5073b1(0x16c)][_0x501ac2[_0x5073b1(0x173)]]=_0x1b520b;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x157ce0,_0x7ab773,_0x2e00ef){const _0x19c499=a37_0x52ab55;if(_0x2e00ef[_0x19c499(0x191)]===0x0)return;for(let _0x4981be=0x0;_0x4981be<LOCK_SETTLE_RETRY_COUNT;_0x4981be+=0x1){const _0x307461=await readBffLockFile(_0x157ce0),_0x2ce1ba=_0x307461?.['apps']?.[_0x7ab773]?.[_0x19c499(0x16c)]??{},_0x12c19f=_0x2e00ef['every'](_0x32718f=>!!_0x2ce1ba[_0x32718f]?.[_0x19c499(0x181)]);if(_0x12c19f)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x19c499(0x170)+_0x2e00ef[_0x19c499(0x187)](',\x20')+'.');}
@@ -1 +1 @@
1
- const a38_0x44c453=a38_0x4080;function a38_0x4080(_0xef425a,_0x1c7c68){_0xef425a=_0xef425a-0x1ab;const _0x390832=a38_0x3908();let _0x408081=_0x390832[_0xef425a];return _0x408081;}(function(_0x1902e4,_0x4ea5cc){const _0x1c0d3f=a38_0x4080,_0x420b70=_0x1902e4();while(!![]){try{const _0x40f96a=-parseInt(_0x1c0d3f(0x1bf))/0x1*(parseInt(_0x1c0d3f(0x1ba))/0x2)+-parseInt(_0x1c0d3f(0x1cc))/0x3*(-parseInt(_0x1c0d3f(0x1c8))/0x4)+-parseInt(_0x1c0d3f(0x1ce))/0x5+parseInt(_0x1c0d3f(0x1b8))/0x6*(-parseInt(_0x1c0d3f(0x1c9))/0x7)+parseInt(_0x1c0d3f(0x1c0))/0x8+-parseInt(_0x1c0d3f(0x1cd))/0x9*(-parseInt(_0x1c0d3f(0x1c3))/0xa)+parseInt(_0x1c0d3f(0x1c1))/0xb*(parseInt(_0x1c0d3f(0x1c4))/0xc);if(_0x40f96a===_0x4ea5cc)break;else _0x420b70['push'](_0x420b70['shift']());}catch(_0x38d549){_0x420b70['push'](_0x420b70['shift']());}}}(a38_0x3908,0x532b2));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a38_0x3908(){const _0x562bc1=['bool','558196uOUFUz','120134zRDajL','apiDir','all','3WGUJRX','4730841wjPvad','2675615tSrYvl','\x20unchanged','map','appCode','has','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','functions','scriptsRoot','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','\x20remote-only','filePath','remote','lockFilePath','\x20added,\x20','168SHNAzl','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','26xBcAQV','length','lockKey','push','status','49199YFdFfY','1683936gjBdES','6161177zvucyh','read','10ftbYzB','24TMryUW','datasetCode','bff'];a38_0x3908=function(){return _0x562bc1;};return a38_0x3908();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x44c453(0x1c6),'command':a38_0x44c453(0x1be),'description':a38_0x44c453(0x1b9),'risk':a38_0x44c453(0x1c2),'flags':[{'name':a38_0x44c453(0x1b5),'type':'boolean','description':a38_0x44c453(0x1b2)}],async 'execute'(_0x478267){const _0x2ba90b=a38_0x44c453,_0x56191e=loadBffProjectConfig(_0x478267[_0x2ba90b(0x1ad)]),_0xf027a9=await readBffLockFile(_0x56191e[_0x2ba90b(0x1b6)]),{appLock:_0x2413b5}=ensureLockScope(_0xf027a9??createEmptyBffLock(),_0x478267[_0x2ba90b(0x1ad)],_0x56191e[_0x2ba90b(0x1b1)],'status'),_0x128bd9=await scanLocalBffFunctions(_0x56191e),_0x29c4ad=[],_0x2fb76d=[],_0x310bb2=[];for(const _0x1dafb6 of _0x128bd9){const _0x1ab923=await computeFileHash(_0x1dafb6[_0x2ba90b(0x1b4)]),_0x30c448=_0x2413b5[_0x2ba90b(0x1b0)][_0x1dafb6[_0x2ba90b(0x1bc)]];if(!_0x30c448)_0x29c4ad[_0x2ba90b(0x1bd)](_0x1dafb6[_0x2ba90b(0x1bc)]);else _0x30c448['hash']!==_0x1ab923?_0x2fb76d['push'](_0x1dafb6['lockKey']):_0x310bb2[_0x2ba90b(0x1bd)](_0x1dafb6['lockKey']);}const _0x367817=[];if(_0x478267[_0x2ba90b(0x1c7)](_0x2ba90b(0x1b5))){const _0x236651=loadAliasMap(_0x478267['apiDir'],undefined,resolveApiFilePath(_0x478267[_0x2ba90b(0x1ca)],_0x478267[_0x2ba90b(0x1ad)])),_0x23e1cd=new Map(_0x236651[_0x2ba90b(0x1ac)](_0x1a0358=>[_0x1a0358[_0x2ba90b(0x1c5)],_0x1a0358['alias']])),[_0x20a265,_0xb16c3d]=await Promise[_0x2ba90b(0x1cb)]([listBffScripts(_0x478267[_0x2ba90b(0x1ad)]),getBffScriptStatistics(_0x478267[_0x2ba90b(0x1ad)])]),_0x4d4230=createHookLocationMap(_0xb16c3d),_0x7a329b=new Set(_0x128bd9['map'](_0x292af8=>_0x292af8[_0x2ba90b(0x1bc)]));for(const _0x1e2946 of _0x20a265){const _0x243b35=resolveRemoteScriptTarget(_0x56191e,_0x1e2946,_0x4d4230,_0x2413b5[_0x2ba90b(0x1b0)],_0x23e1cd);_0x243b35&&!_0x7a329b[_0x2ba90b(0x1ae)](_0x243b35[_0x2ba90b(0x1bc)])&&_0x367817[_0x2ba90b(0x1bd)](_0x243b35[_0x2ba90b(0x1bc)]);}}const _0x5c8510=_0x29c4ad['length']===0x0&&_0x2fb76d[_0x2ba90b(0x1bb)]===0x0&&_0x367817[_0x2ba90b(0x1bb)]===0x0;return{'ok':!![],'data':{'added':_0x29c4ad,'modified':_0x2fb76d,'unchanged':_0x310bb2,'remoteOnly':_0x367817},'message':_0x5c8510?_0x2ba90b(0x1af):_0x29c4ad['length']+_0x2ba90b(0x1b7)+_0x2fb76d['length']+'\x20modified,\x20'+_0x310bb2[_0x2ba90b(0x1bb)]+_0x2ba90b(0x1ab)+(_0x367817[_0x2ba90b(0x1bb)]>0x0?',\x20'+_0x367817[_0x2ba90b(0x1bb)]+_0x2ba90b(0x1b3):'')};}};
1
+ const a38_0x5808c3=a38_0x9dec;(function(_0x15a9b8,_0x13758a){const _0x7a043c=a38_0x9dec,_0xcd05fb=_0x15a9b8();while(!![]){try{const _0x2f63fc=parseInt(_0x7a043c(0x182))/0x1*(-parseInt(_0x7a043c(0x16e))/0x2)+parseInt(_0x7a043c(0x16d))/0x3+parseInt(_0x7a043c(0x17f))/0x4+-parseInt(_0x7a043c(0x17e))/0x5*(parseInt(_0x7a043c(0x187))/0x6)+-parseInt(_0x7a043c(0x181))/0x7+-parseInt(_0x7a043c(0x17d))/0x8*(-parseInt(_0x7a043c(0x179))/0x9)+parseInt(_0x7a043c(0x16b))/0xa;if(_0x2f63fc===_0x13758a)break;else _0xcd05fb['push'](_0xcd05fb['shift']());}catch(_0xfe907d){_0xcd05fb['push'](_0xcd05fb['shift']());}}}(a38_0x20c6,0x22898));function a38_0x9dec(_0x1ff10e,_0x465397){_0x1ff10e=_0x1ff10e-0x16b;const _0x20c62e=a38_0x20c6();let _0x9dec3=_0x20c62e[_0x1ff10e];return _0x9dec3;}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a38_0x20c6(){const _0x40c1ad=['apiDir','status','lockKey','8oCOwgT','25225ndaxMf','552600ZaJjAG','\x20unchanged','1723771XqiwtL','81BqDYGG','map','alias','\x20modified,\x20','all','318PkGQYA','push','appCode','lockFilePath','\x20added,\x20','functions','4524970GNJaMl','filePath','240234OzdNBV','1566EWeqpy','length','bff','\x20remote-only','read','has','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','datasetCode','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','remote','bool','430200wkwAkX'];a38_0x20c6=function(){return _0x40c1ad;};return a38_0x20c6();}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x5808c3(0x170),'command':a38_0x5808c3(0x17b),'description':a38_0x5808c3(0x176),'risk':a38_0x5808c3(0x172),'flags':[{'name':a38_0x5808c3(0x177),'type':'boolean','description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x5edd1b){const _0x1aa88a=a38_0x5808c3,_0x208882=loadBffProjectConfig(_0x5edd1b[_0x1aa88a(0x189)]),_0x2bb9c1=await readBffLockFile(_0x208882[_0x1aa88a(0x18a)]),{appLock:_0x2a3943}=ensureLockScope(_0x2bb9c1??createEmptyBffLock(),_0x5edd1b[_0x1aa88a(0x189)],_0x208882['scriptsRoot'],_0x1aa88a(0x17b)),_0x11ea41=await scanLocalBffFunctions(_0x208882),_0x5c7da5=[],_0x30a611=[],_0x104cbc=[];for(const _0x3d26c1 of _0x11ea41){const _0x172700=await computeFileHash(_0x3d26c1[_0x1aa88a(0x16c)]),_0x17f715=_0x2a3943[_0x1aa88a(0x18c)][_0x3d26c1[_0x1aa88a(0x17c)]];if(!_0x17f715)_0x5c7da5[_0x1aa88a(0x188)](_0x3d26c1['lockKey']);else _0x17f715['hash']!==_0x172700?_0x30a611['push'](_0x3d26c1[_0x1aa88a(0x17c)]):_0x104cbc['push'](_0x3d26c1[_0x1aa88a(0x17c)]);}const _0x64c49a=[];if(_0x5edd1b[_0x1aa88a(0x178)](_0x1aa88a(0x177))){const _0x116a16=loadAliasMap(_0x5edd1b[_0x1aa88a(0x17a)],undefined,resolveApiFilePath(_0x5edd1b[_0x1aa88a(0x17a)],_0x5edd1b['appCode'])),_0x471726=new Map(_0x116a16[_0x1aa88a(0x183)](_0x4b323f=>[_0x4b323f[_0x1aa88a(0x175)],_0x4b323f[_0x1aa88a(0x184)]])),[_0x289542,_0x53a7fb]=await Promise[_0x1aa88a(0x186)]([listBffScripts(_0x5edd1b[_0x1aa88a(0x189)]),getBffScriptStatistics(_0x5edd1b['appCode'])]),_0x2e969e=createHookLocationMap(_0x53a7fb),_0x15aab6=new Set(_0x11ea41[_0x1aa88a(0x183)](_0x3cbeac=>_0x3cbeac[_0x1aa88a(0x17c)]));for(const _0x348c53 of _0x289542){const _0x5a8504=resolveRemoteScriptTarget(_0x208882,_0x348c53,_0x2e969e,_0x2a3943['functions'],_0x471726);_0x5a8504&&!_0x15aab6[_0x1aa88a(0x173)](_0x5a8504[_0x1aa88a(0x17c)])&&_0x64c49a['push'](_0x5a8504['lockKey']);}}const _0xca8288=_0x5c7da5[_0x1aa88a(0x16f)]===0x0&&_0x30a611[_0x1aa88a(0x16f)]===0x0&&_0x64c49a[_0x1aa88a(0x16f)]===0x0;return{'ok':!![],'data':{'added':_0x5c7da5,'modified':_0x30a611,'unchanged':_0x104cbc,'remoteOnly':_0x64c49a},'message':_0xca8288?_0x1aa88a(0x174):_0x5c7da5[_0x1aa88a(0x16f)]+_0x1aa88a(0x18b)+_0x30a611[_0x1aa88a(0x16f)]+_0x1aa88a(0x185)+_0x104cbc[_0x1aa88a(0x16f)]+_0x1aa88a(0x180)+(_0x64c49a[_0x1aa88a(0x16f)]>0x0?',\x20'+_0x64c49a['length']+_0x1aa88a(0x171):'')};}};
@@ -1 +1 @@
1
- const a39_0x2ae5af=a39_0x13dd;function a39_0x13dd(_0x51da67,_0x5b5826){_0x51da67=_0x51da67-0x19d;const _0x39c7bf=a39_0x39c7();let _0x13ddb6=_0x39c7bf[_0x51da67];return _0x13ddb6;}(function(_0x4086fe,_0x3ca241){const _0x48487f=a39_0x13dd,_0x5996c8=_0x4086fe();while(!![]){try{const _0xf4bf4e=-parseInt(_0x48487f(0x1af))/0x1*(-parseInt(_0x48487f(0x1b0))/0x2)+parseInt(_0x48487f(0x1ad))/0x3*(parseInt(_0x48487f(0x1b5))/0x4)+-parseInt(_0x48487f(0x1ba))/0x5+-parseInt(_0x48487f(0x1b4))/0x6*(-parseInt(_0x48487f(0x1bc))/0x7)+parseInt(_0x48487f(0x1bb))/0x8+-parseInt(_0x48487f(0x1a3))/0x9+parseInt(_0x48487f(0x1a2))/0xa;if(_0xf4bf4e===_0x3ca241)break;else _0x5996c8['push'](_0x5996c8['shift']());}catch(_0x273d7e){_0x5996c8['push'](_0x5996c8['shift']());}}}(a39_0x39c7,0x2b50a));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';function a39_0x39c7(){const _0x4e7f70=['pipe','installedPath','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','246702ZsYysW','4lbkBYs','apiError','install','CLI\x20Built-in\x20Skill\x20','read','847500vmoAWV','199952ilxgbv','7AGBzwe','skillVersion','info','repairCommand','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20',']:\x20','\x20via\x20skills@latest','\x20installed','Built-in\x20Skill\x20install\x20failed\x20[','unknown','3501550dPiXaT','2168316mxjAGb','changed','log','nonInteractive','inherit','\x20at\x20','error','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','cli-skill','code','393090hUwhgY','cwd','2gEZQcm','40546tynPHE'];a39_0x39c7=function(){return _0x4e7f70;};return a39_0x39c7();}export const cliSkillDefinitions=[{'service':a39_0x2ae5af(0x1ab),'command':a39_0x2ae5af(0x1b7),'description':a39_0x2ae5af(0x1aa),'risk':a39_0x2ae5af(0x1b9),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x51b06f){const _0x2e9c79=a39_0x2ae5af;logger['setLogPath'](process[_0x2e9c79(0x1ae)]()),logger[_0x2e9c79(0x1be)]('cli-skill-install',_0x2e9c79(0x1b3));const _0x3239f2=installBuiltinSkill({'stdio':_0x51b06f[_0x2e9c79(0x1a6)]?_0x2e9c79(0x1b1):_0x2e9c79(0x1a7)});if(!_0x3239f2['ok'])throw CliErrors[_0x2e9c79(0x1b6)](_0x2e9c79(0x1a0)+_0x3239f2[_0x2e9c79(0x1ac)]+_0x2e9c79(0x19d)+(_0x3239f2[_0x2e9c79(0x1a9)]||_0x2e9c79(0x1a1)),_0x2e9c79(0x1c0)+_0x3239f2[_0x2e9c79(0x1bf)]);return console[_0x2e9c79(0x1a5)](_0x3239f2[_0x2e9c79(0x1a4)]?_0x2e9c79(0x1b8)+_0x3239f2[_0x2e9c79(0x1bd)]+_0x2e9c79(0x19f)+(_0x3239f2[_0x2e9c79(0x1b2)]?_0x2e9c79(0x1a8)+_0x3239f2[_0x2e9c79(0x1b2)]:_0x2e9c79(0x19e)):_0x2e9c79(0x1b8)+_0x3239f2['skillVersion']+'\x20is\x20already\x20current'+(_0x3239f2[_0x2e9c79(0x1b2)]?_0x2e9c79(0x1a8)+_0x3239f2['installedPath']:'')),{'ok':!![]};}}];
1
+ const a39_0x2c3dfc=a39_0x1605;(function(_0x5be8af,_0x452c45){const _0x18dc54=a39_0x1605,_0x9b7ec3=_0x5be8af();while(!![]){try{const _0x369dd8=parseInt(_0x18dc54(0x138))/0x1*(parseInt(_0x18dc54(0x149))/0x2)+parseInt(_0x18dc54(0x146))/0x3+-parseInt(_0x18dc54(0x130))/0x4*(parseInt(_0x18dc54(0x134))/0x5)+-parseInt(_0x18dc54(0x151))/0x6*(parseInt(_0x18dc54(0x145))/0x7)+parseInt(_0x18dc54(0x14a))/0x8*(-parseInt(_0x18dc54(0x148))/0x9)+-parseInt(_0x18dc54(0x13b))/0xa+parseInt(_0x18dc54(0x131))/0xb;if(_0x369dd8===_0x452c45)break;else _0x9b7ec3['push'](_0x9b7ec3['shift']());}catch(_0x11026f){_0x9b7ec3['push'](_0x9b7ec3['shift']());}}}(a39_0xe3ec,0x7af59));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a39_0xe3ec(){const _0x2f0738=['\x20is\x20already\x20current','\x20via\x20skills@latest','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','skillVersion','inherit','installedPath','Built-in\x20Skill\x20install\x20failed\x20[','729904fvmLsJ','1516701eRmAIz','CLI\x20Built-in\x20Skill\x20','36459EDSIAG','1338FaDnZg','1792wJBRgC',']:\x20','\x20installed','code','read','cwd','cli-skill','6aqRvYu','info','pipe','error','421964EahqNO','15767763HlUPno','changed','repairCommand','15ACniqa','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','cli-skill-install','setLogPath','1AOadLb','\x20at\x20','apiError','1078590zaQxfs','log','install'];a39_0xe3ec=function(){return _0x2f0738;};return a39_0xe3ec();}function a39_0x1605(_0x979ae,_0x2c8da2){_0x979ae=_0x979ae-0x130;const _0xe3ecc8=a39_0xe3ec();let _0x16055a=_0xe3ecc8[_0x979ae];return _0x16055a;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x2c3dfc(0x150),'command':a39_0x2c3dfc(0x13d),'description':a39_0x2c3dfc(0x135),'risk':a39_0x2c3dfc(0x14e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x13d3ea){const _0x19d782=a39_0x2c3dfc;logger[_0x19d782(0x137)](process[_0x19d782(0x14f)]()),logger[_0x19d782(0x152)](_0x19d782(0x136),'Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.');const _0x57bc60=installBuiltinSkill({'stdio':_0x13d3ea['nonInteractive']?_0x19d782(0x153):_0x19d782(0x142)});if(!_0x57bc60['ok'])throw CliErrors[_0x19d782(0x13a)](_0x19d782(0x144)+_0x57bc60[_0x19d782(0x14d)]+_0x19d782(0x14b)+(_0x57bc60[_0x19d782(0x154)]||'unknown'),_0x19d782(0x140)+_0x57bc60[_0x19d782(0x133)]);return console[_0x19d782(0x13c)](_0x57bc60[_0x19d782(0x132)]?_0x19d782(0x147)+_0x57bc60[_0x19d782(0x141)]+_0x19d782(0x14c)+(_0x57bc60['installedPath']?_0x19d782(0x139)+_0x57bc60[_0x19d782(0x143)]:_0x19d782(0x13f)):_0x19d782(0x147)+_0x57bc60['skillVersion']+_0x19d782(0x13e)+(_0x57bc60[_0x19d782(0x143)]?_0x19d782(0x139)+_0x57bc60[_0x19d782(0x143)]:'')),{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a40_0x327f92=a40_0x35b5;(function(_0x7f6513,_0x515a06){const _0x4e3a19=a40_0x35b5,_0x54ddc2=_0x7f6513();while(!![]){try{const _0x1b3ccb=-parseInt(_0x4e3a19(0x148))/0x1*(-parseInt(_0x4e3a19(0x10e))/0x2)+parseInt(_0x4e3a19(0x143))/0x3*(-parseInt(_0x4e3a19(0x10f))/0x4)+-parseInt(_0x4e3a19(0x14e))/0x5+-parseInt(_0x4e3a19(0x140))/0x6+parseInt(_0x4e3a19(0x136))/0x7+parseInt(_0x4e3a19(0x113))/0x8+-parseInt(_0x4e3a19(0x15d))/0x9;if(_0x1b3ccb===_0x515a06)break;else _0x54ddc2['push'](_0x54ddc2['shift']());}catch(_0x338f85){_0x54ddc2['push'](_0x54ddc2['shift']());}}}(a40_0x2724,0x86926));import a40_0xbd8660 from'chalk';import a40_0x12f130 from'ora';import a40_0x3a0dab from'semver';function a40_0x2724(){const _0x4faed6=['apiError','Install\x20a\x20specific\x20CLI\x20version','bun','Beta\x20version:\x20','beta','Already\x20on\x20requested\x20version\x20(v','@latest','update','message','npm','Run:\x20',']:\x20','gray','state','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','map','version','validation','boolean','Current\x20version:\x20','yellow','...',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','red','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','Version\x20comparison\x20failed','\x20install\x20-g\x20',',\x20state\x20','\x20is\x20up\x20to\x20date.','run','trim','string','5415039zRveuH','install','Updated\x20to\x20v','Invalid\x20version:\x20','/dist-tags','current','Updating\x20via\x20','Current\x20version\x20v','https://registry.npmjs.org/-/package/','code','4661058FFYTkb','Already\x20up\x20to\x20date\x20(v','succeed','21UwtuRf','latest','fromEntries','expected\x20','length','16MZcpwt','\x20→\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20\x20CLI\x20Built-in\x20Skill\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','timeout','4422210sgYpDs','entries','log','str',',\x20found\x20','json','green','CLI\x20updated\x20to\x20v',',\x20then\x20verify\x20with:\x20','\x20is\x20newer\x20than\x20npm\x20latest\x20v','valid','info','\x20doctor','skillVersion','unknown','1666116oVgDki','start','toLowerCase','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','source','object','error','bool','fail','124144OFKblF','169408xxWhCl','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','filter','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','7418800lQfOvX','pipe'];a40_0x2724=function(){return _0x4faed6;};return a40_0x2724();}import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x75cf93=a40_0x35b5;return GIT_COMMIT!==_0x75cf93(0x15c)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME['slice'](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x368281=a40_0x35b5,_0x18ff8e=process['execPath'][_0x368281(0x15f)]();if(_0x18ff8e['includes']('bun'))return _0x368281(0x117);return _0x368281(0x11e);}const updateFlags=[{'name':a40_0x327f92(0x119),'type':a40_0x327f92(0x127),'description':a40_0x327f92(0x14a),'default':![]},{'name':'version','type':a40_0x327f92(0x135),'description':a40_0x327f92(0x116)}];function getRequestedVersion(_0x4a6e4a){const _0x402a6d=a40_0x327f92;return _0x4a6e4a[_0x402a6d(0x151)]('version')[_0x402a6d(0x134)]();}async function validateUpdateFlags(_0x112d76){const _0x542e87=a40_0x327f92,_0x1c1bb9=_0x112d76[_0x542e87(0x10c)]('beta'),_0x2a947f=getRequestedVersion(_0x112d76);if(_0x1c1bb9&&_0x2a947f)throw CliErrors[_0x542e87(0x126)](_0x542e87(0x107),_0x542e87(0x112));if(_0x2a947f&&!a40_0x3a0dab[_0x542e87(0x158)](_0x2a947f))throw CliErrors[_0x542e87(0x126)](_0x542e87(0x139)+_0x2a947f,_0x542e87(0x14c));}async function fetchNpmDistTags(){const _0x4ac8cd=a40_0x327f92;try{const _0x3e9255=await fetch(_0x4ac8cd(0x13e)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x4ac8cd(0x13a),{'signal':AbortSignal[_0x4ac8cd(0x14d)](0x2710)});if(!_0x3e9255['ok'])return null;const _0x22930e=await _0x3e9255[_0x4ac8cd(0x153)]();if(!_0x22930e||typeof _0x22930e!==_0x4ac8cd(0x10a))return null;return Object[_0x4ac8cd(0x145)](Object[_0x4ac8cd(0x14f)](_0x22930e)[_0x4ac8cd(0x111)](([,_0x18cb3b])=>typeof _0x18cb3b===_0x4ac8cd(0x135)&&_0x18cb3b[_0x4ac8cd(0x134)]()[_0x4ac8cd(0x147)]>0x0)[_0x4ac8cd(0x124)](([_0x146f29,_0x54e98d])=>[_0x146f29,String(_0x54e98d)[_0x4ac8cd(0x134)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x54d531){const _0x15c610=await fetchNpmDistTags();return _0x15c610?.[_0x54d531]??null;}async function fetchLatestVersion(){const _0xcc95ef=a40_0x327f92;return fetchNpmDistTagVersion(_0xcc95ef(0x144));}async function resolveTargetVersion(_0x57a3ce){const _0x323661=a40_0x327f92,_0x4d8beb=getRequestedVersion(_0x57a3ce);if(_0x4d8beb)return{'version':_0x4d8beb,'source':'version'};if(_0x57a3ce[_0x323661(0x10c)](_0x323661(0x119))){const _0x43d133=await fetchNpmDistTagVersion(_0x323661(0x119));if(!_0x43d133)return null;return{'version':_0x43d133,'source':'beta'};}const _0x24f7d2=await fetchLatestVersion();if(!_0x24f7d2)return null;return{'version':_0x24f7d2,'source':'latest'};}function shouldInstallTarget(_0x3c5db7,_0x1dac58){const _0x53fb9b=a40_0x327f92;if(_0x1dac58[_0x53fb9b(0x109)]===_0x53fb9b(0x125)||_0x1dac58[_0x53fb9b(0x109)]==='beta')return!a40_0x3a0dab['eq'](_0x3c5db7,_0x1dac58[_0x53fb9b(0x125)]);return a40_0x3a0dab['lt'](_0x3c5db7,_0x1dac58['version']);}function a40_0x35b5(_0x16772b,_0x343373){_0x16772b=_0x16772b-0x107;const _0x2724f4=a40_0x2724();let _0x35b5d8=_0x2724f4[_0x16772b];return _0x35b5d8;}function getInstallPlanLabel(_0x5a4fc7,_0x3e34d9){const _0x453d5e=a40_0x327f92;switch(_0x3e34d9[_0x453d5e(0x109)]){case _0x453d5e(0x119):return _0x453d5e(0x118)+a40_0xbd8660[_0x453d5e(0x129)](_0x5a4fc7)+_0x453d5e(0x149)+a40_0xbd8660[_0x453d5e(0x154)](_0x3e34d9[_0x453d5e(0x125)]);case _0x453d5e(0x125):return'Requested\x20version:\x20'+a40_0xbd8660[_0x453d5e(0x129)](_0x5a4fc7)+'\x20→\x20'+a40_0xbd8660['green'](_0x3e34d9[_0x453d5e(0x125)]);case _0x453d5e(0x144):default:return'Update\x20available:\x20'+a40_0xbd8660[_0x453d5e(0x129)](_0x5a4fc7)+_0x453d5e(0x149)+a40_0xbd8660[_0x453d5e(0x154)](_0x3e34d9['version']);}}function repairCurrentBuiltinSkill(){const _0x501a89=a40_0x327f92;console[_0x501a89(0x150)](a40_0xbd8660[_0x501a89(0x121)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x5e871f=installBuiltinSkill();if(_0x5e871f['ok']){console[_0x501a89(0x150)](a40_0xbd8660[_0x501a89(0x121)](_0x501a89(0x14b)+_0x5e871f[_0x501a89(0x15b)]+_0x501a89(0x132)));return;}throw CliErrors[_0x501a89(0x115)](_0x501a89(0x12e)+_0x5e871f[_0x501a89(0x13f)]+_0x501a89(0x120)+(_0x5e871f['error']||_0x501a89(0x15c)),'Run:\x20'+_0x5e871f['repairCommand']+_0x501a89(0x156)+CLI_BIN_NAME+'\x20doctor');}function verifyUpdatedBuiltinSkill(_0x26d0b2){const _0x2a5c8d=a40_0x327f92,_0x2325b8=inspectInstalledBuiltinSkillVersion(_0x26d0b2);if(_0x2325b8[_0x2a5c8d(0x122)]===_0x2a5c8d(0x13b)){console[_0x2a5c8d(0x150)](a40_0xbd8660[_0x2a5c8d(0x121)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x26d0b2+_0x2a5c8d(0x132)));return;}const _0x2f6747=_0x2325b8[_0x2a5c8d(0x15b)]?_0x2a5c8d(0x146)+_0x26d0b2+_0x2a5c8d(0x152)+_0x2325b8['skillVersion']:_0x2a5c8d(0x146)+_0x26d0b2+_0x2a5c8d(0x131)+_0x2325b8[_0x2a5c8d(0x122)];throw CliErrors[_0x2a5c8d(0x115)](_0x2a5c8d(0x155)+_0x26d0b2+_0x2a5c8d(0x12b)+_0x2f6747,_0x2a5c8d(0x11f)+_0x2325b8['repairCommand']+_0x2a5c8d(0x156)+CLI_BIN_NAME+_0x2a5c8d(0x15a));}async function execute(_0x32a3e3){const _0x3da52d=a40_0x327f92;await validateUpdateFlags(_0x32a3e3);const _0x10487e=getCurrentVersion();console[_0x3da52d(0x150)](_0x3da52d(0x128)+_0x10487e);const _0x257bfc=a40_0x12f130('Checking\x20for\x20updates...')[_0x3da52d(0x15e)](),_0x9593=await resolveTargetVersion(_0x32a3e3);if(!_0x9593){const _0x453d96=_0x32a3e3['bool'](_0x3da52d(0x119))?_0x3da52d(0x110):_0x3da52d(0x123);return _0x257bfc[_0x3da52d(0x10d)](_0x453d96),console['log'](a40_0xbd8660[_0x3da52d(0x121)](_0x3da52d(0x108)+NPM_PACKAGE_NAME+_0x3da52d(0x11b))),{'ok':![],'message':_0x453d96};}const _0x153eb4=a40_0x3a0dab[_0x3da52d(0x158)](VERSION),_0x484bb0=a40_0x3a0dab[_0x3da52d(0x158)](_0x9593['version']);if(!_0x153eb4||!_0x484bb0)return _0x257bfc[_0x3da52d(0x10d)](_0x3da52d(0x12f)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x153eb4,_0x9593)){const _0x5a6849=_0x9593[_0x3da52d(0x109)]===_0x3da52d(0x125)?_0x3da52d(0x11a)+_0x9593['version']+')':a40_0x3a0dab['gt'](_0x153eb4,_0x484bb0)?_0x3da52d(0x13d)+_0x10487e+_0x3da52d(0x157)+_0x9593[_0x3da52d(0x125)]:_0x3da52d(0x141)+_0x9593[_0x3da52d(0x125)]+')';return _0x257bfc[_0x3da52d(0x142)](_0x5a6849),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x257bfc[_0x3da52d(0x159)](getInstallPlanLabel(_0x10487e,_0x9593));const _0x486e3d=detectPackageManager(),_0x9f35fa=_0x486e3d===_0x3da52d(0x11e)?resolveNpmBin(_0x3da52d(0x11e)):_0x486e3d,_0x2b8897=a40_0x12f130(_0x3da52d(0x13c)+_0x486e3d+_0x3da52d(0x12a))[_0x3da52d(0x15e)]();try{await execa(_0x9f35fa,[_0x3da52d(0x137),'-g',NPM_PACKAGE_NAME+'@'+_0x9593[_0x3da52d(0x125)]],{'stdio':_0x3da52d(0x114)}),_0x2b8897[_0x3da52d(0x142)](_0x3da52d(0x138)+_0x9593[_0x3da52d(0x125)]),console[_0x3da52d(0x150)](a40_0xbd8660[_0x3da52d(0x121)](_0x3da52d(0x12d)));}catch(_0x12936b){return _0x2b8897[_0x3da52d(0x10d)]('Update\x20failed'),console[_0x3da52d(0x10b)](a40_0xbd8660[_0x3da52d(0x12c)]('\x20\x20'+_0x12936b[_0x3da52d(0x11d)])),console[_0x3da52d(0x150)](a40_0xbd8660[_0x3da52d(0x121)]('\x20\x20Try\x20manually:\x20'+_0x486e3d+_0x3da52d(0x130)+NPM_PACKAGE_NAME+'@'+_0x9593[_0x3da52d(0x125)])),{'ok':![],'message':_0x12936b[_0x3da52d(0x11d)]};}return verifyUpdatedBuiltinSkill(_0x9593[_0x3da52d(0x125)]),{'ok':!![]};}export const updateDefinition={'service':a40_0x327f92(0x11c),'command':a40_0x327f92(0x133),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
1
+ const a40_0x1e9577=a40_0x2711;(function(_0x1477fb,_0x4b7555){const _0x1416ac=a40_0x2711,_0x1f3a47=_0x1477fb();while(!![]){try{const _0x55148b=-parseInt(_0x1416ac(0x161))/0x1+parseInt(_0x1416ac(0x197))/0x2+-parseInt(_0x1416ac(0x16a))/0x3*(parseInt(_0x1416ac(0x144))/0x4)+parseInt(_0x1416ac(0x156))/0x5*(parseInt(_0x1416ac(0x184))/0x6)+parseInt(_0x1416ac(0x193))/0x7*(parseInt(_0x1416ac(0x149))/0x8)+-parseInt(_0x1416ac(0x173))/0x9*(-parseInt(_0x1416ac(0x174))/0xa)+-parseInt(_0x1416ac(0x17a))/0xb;if(_0x55148b===_0x4b7555)break;else _0x1f3a47['push'](_0x1f3a47['shift']());}catch(_0x5be69e){_0x1f3a47['push'](_0x1f3a47['shift']());}}}(a40_0x5706,0x4aaf9));import a40_0x5d1c61 from'chalk';import a40_0x43f33d from'ora';import a40_0x2fbb1 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';function a40_0x5706(){const _0x94301f=['trim','\x20install\x20-g\x20','slice','state','latest','Update\x20failed','Updating\x20via\x20','toLowerCase','includes','...','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','beta','valid',',\x20state\x20','78491lFIwDr','str','repairCommand','Checking\x20for\x20updates...','902978NObENE','read',',\x20found\x20','Invalid\x20version:\x20','expected\x20','91792BToHmD','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','map','https://registry.npmjs.org/-/package/','Version\x20comparison\x20failed','184edjbHb','Beta\x20version:\x20','\x20is\x20newer\x20than\x20npm\x20latest\x20v','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20doctor','filter','current','log','version','yellow','update','start','message','335510LTfiAA','CLI\x20updated\x20to\x20v','length','apiError','skillVersion','green',']:\x20','Requested\x20version:\x20','succeed','Run:\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','100472hvpLIE','fail','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20→\x20',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','boolean',',\x20then\x20verify\x20with:\x20','Update\x20available:\x20','69ZZtcbL','\x20\x20CLI\x20Built-in\x20Skill\x20','gray','validation','fromEntries','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Try\x20manually:\x20','run','Current\x20version\x20v','1471905aayyMD','10VfrUMa','red','install','\x20is\x20up\x20to\x20date.','bool','npm','5231160wDikAR','code','source','info','Checking\x20CLI\x20Built-in\x20Skill...','unknown','timeout','string','bun','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','48PTSLoQ'];a40_0x5706=function(){return _0x94301f;};return a40_0x5706();}function a40_0x2711(_0x465e3c,_0xa1986c){_0x465e3c=_0x465e3c-0x142;const _0x57063f=a40_0x5706();let _0x2711ad=_0x57063f[_0x465e3c];return _0x2711ad;}import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x55b942=a40_0x2711;return GIT_COMMIT!==_0x55b942(0x17f)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x55b942(0x187)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0xdc6e58=a40_0x2711,_0x3da5f0=process['execPath'][_0xdc6e58(0x18c)]();if(_0x3da5f0[_0xdc6e58(0x18d)](_0xdc6e58(0x182)))return'bun';return _0xdc6e58(0x179);}const updateFlags=[{'name':a40_0x1e9577(0x190),'type':a40_0x1e9577(0x167),'description':a40_0x1e9577(0x163),'default':![]},{'name':'version','type':a40_0x1e9577(0x181),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0xf03976){const _0x3feda0=a40_0x1e9577;return _0xf03976[_0x3feda0(0x194)]('version')[_0x3feda0(0x185)]();}async function validateUpdateFlags(_0x27a91a){const _0x5b44b9=a40_0x1e9577,_0x23ec3c=_0x27a91a[_0x5b44b9(0x178)](_0x5b44b9(0x190)),_0x318f3d=getRequestedVersion(_0x27a91a);if(_0x23ec3c&&_0x318f3d)throw CliErrors[_0x5b44b9(0x16d)](_0x5b44b9(0x14c),_0x5b44b9(0x145));if(_0x318f3d&&!a40_0x2fbb1[_0x5b44b9(0x191)](_0x318f3d))throw CliErrors[_0x5b44b9(0x16d)](_0x5b44b9(0x142)+_0x318f3d,_0x5b44b9(0x183));}async function fetchNpmDistTags(){const _0x1f96af=a40_0x1e9577;try{const _0x39ad3a=await fetch(_0x1f96af(0x147)+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x1f96af(0x180)](0x2710)});if(!_0x39ad3a['ok'])return null;const _0x103c27=await _0x39ad3a['json']();if(!_0x103c27||typeof _0x103c27!=='object')return null;return Object[_0x1f96af(0x16e)](Object['entries'](_0x103c27)[_0x1f96af(0x14e)](([,_0x55fa2a])=>typeof _0x55fa2a===_0x1f96af(0x181)&&_0x55fa2a[_0x1f96af(0x185)]()[_0x1f96af(0x158)]>0x0)[_0x1f96af(0x146)](([_0x411238,_0xcaf3d3])=>[_0x411238,String(_0xcaf3d3)[_0x1f96af(0x185)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x3d7655){const _0x4e8855=await fetchNpmDistTags();return _0x4e8855?.[_0x3d7655]??null;}async function fetchLatestVersion(){const _0x56d722=a40_0x1e9577;return fetchNpmDistTagVersion(_0x56d722(0x189));}async function resolveTargetVersion(_0x25ec01){const _0x26baab=a40_0x1e9577,_0x5194cc=getRequestedVersion(_0x25ec01);if(_0x5194cc)return{'version':_0x5194cc,'source':_0x26baab(0x151)};if(_0x25ec01[_0x26baab(0x178)](_0x26baab(0x190))){const _0x14b9a6=await fetchNpmDistTagVersion(_0x26baab(0x190));if(!_0x14b9a6)return null;return{'version':_0x14b9a6,'source':'beta'};}const _0x2604cf=await fetchLatestVersion();if(!_0x2604cf)return null;return{'version':_0x2604cf,'source':_0x26baab(0x189)};}function shouldInstallTarget(_0x4eba64,_0x10bd35){const _0x45433a=a40_0x1e9577;if(_0x10bd35[_0x45433a(0x17c)]===_0x45433a(0x151)||_0x10bd35[_0x45433a(0x17c)]==='beta')return!a40_0x2fbb1['eq'](_0x4eba64,_0x10bd35[_0x45433a(0x151)]);return a40_0x2fbb1['lt'](_0x4eba64,_0x10bd35['version']);}function getInstallPlanLabel(_0x13031f,_0x49889e){const _0x3d1a83=a40_0x1e9577;switch(_0x49889e[_0x3d1a83(0x17c)]){case _0x3d1a83(0x190):return _0x3d1a83(0x14a)+a40_0x5d1c61['yellow'](_0x13031f)+'\x20→\x20'+a40_0x5d1c61['green'](_0x49889e['version']);case'version':return _0x3d1a83(0x15d)+a40_0x5d1c61['yellow'](_0x13031f)+'\x20→\x20'+a40_0x5d1c61['green'](_0x49889e[_0x3d1a83(0x151)]);case _0x3d1a83(0x189):default:return _0x3d1a83(0x169)+a40_0x5d1c61[_0x3d1a83(0x152)](_0x13031f)+_0x3d1a83(0x164)+a40_0x5d1c61[_0x3d1a83(0x15b)](_0x49889e[_0x3d1a83(0x151)]);}}function repairCurrentBuiltinSkill(){const _0x4c8235=a40_0x1e9577;console['log'](a40_0x5d1c61['gray'](_0x4c8235(0x17e)));const _0x1a4c19=installBuiltinSkill();if(_0x1a4c19['ok']){console[_0x4c8235(0x150)](a40_0x5d1c61[_0x4c8235(0x16c)](_0x4c8235(0x16b)+_0x1a4c19[_0x4c8235(0x15a)]+'\x20is\x20up\x20to\x20date.'));return;}throw CliErrors[_0x4c8235(0x159)]('CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x1a4c19[_0x4c8235(0x17b)]+_0x4c8235(0x15c)+(_0x1a4c19['error']||_0x4c8235(0x17f)),_0x4c8235(0x15f)+_0x1a4c19[_0x4c8235(0x195)]+_0x4c8235(0x168)+CLI_BIN_NAME+_0x4c8235(0x14d));}function verifyUpdatedBuiltinSkill(_0xeef811){const _0x493699=a40_0x1e9577,_0x5358b0=inspectInstalledBuiltinSkillVersion(_0xeef811);if(_0x5358b0[_0x493699(0x188)]===_0x493699(0x14f)){console[_0x493699(0x150)](a40_0x5d1c61['gray'](_0x493699(0x16b)+_0xeef811+_0x493699(0x177)));return;}const _0x5ee421=_0x5358b0[_0x493699(0x15a)]?'expected\x20'+_0xeef811+_0x493699(0x199)+_0x5358b0['skillVersion']:_0x493699(0x143)+_0xeef811+_0x493699(0x192)+_0x5358b0[_0x493699(0x188)];throw CliErrors[_0x493699(0x159)](_0x493699(0x157)+_0xeef811+_0x493699(0x165)+_0x5ee421,'Run:\x20'+_0x5358b0[_0x493699(0x195)]+_0x493699(0x168)+CLI_BIN_NAME+_0x493699(0x14d));}async function execute(_0x3a7a47){const _0x458e3b=a40_0x1e9577;await validateUpdateFlags(_0x3a7a47);const _0x44d2a0=getCurrentVersion();console[_0x458e3b(0x150)]('Current\x20version:\x20'+_0x44d2a0);const _0x7ae997=a40_0x43f33d(_0x458e3b(0x196))[_0x458e3b(0x154)](),_0x1c3e42=await resolveTargetVersion(_0x3a7a47);if(!_0x1c3e42){const _0x529345=_0x3a7a47[_0x458e3b(0x178)](_0x458e3b(0x190))?_0x458e3b(0x166):_0x458e3b(0x18f);return _0x7ae997[_0x458e3b(0x162)](_0x529345),console[_0x458e3b(0x150)](a40_0x5d1c61['gray'](_0x458e3b(0x16f)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x529345};}const _0x46effb=a40_0x2fbb1[_0x458e3b(0x191)](VERSION),_0x336f26=a40_0x2fbb1['valid'](_0x1c3e42[_0x458e3b(0x151)]);if(!_0x46effb||!_0x336f26)return _0x7ae997['fail']('Version\x20comparison\x20failed'),{'ok':![],'message':_0x458e3b(0x148)};if(!shouldInstallTarget(_0x46effb,_0x1c3e42)){const _0x282bac=_0x1c3e42[_0x458e3b(0x17c)]==='version'?'Already\x20on\x20requested\x20version\x20(v'+_0x1c3e42[_0x458e3b(0x151)]+')':a40_0x2fbb1['gt'](_0x46effb,_0x336f26)?_0x458e3b(0x172)+_0x44d2a0+_0x458e3b(0x14b)+_0x1c3e42[_0x458e3b(0x151)]:'Already\x20up\x20to\x20date\x20(v'+_0x1c3e42['version']+')';return _0x7ae997['succeed'](_0x282bac),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x7ae997[_0x458e3b(0x17d)](getInstallPlanLabel(_0x44d2a0,_0x1c3e42));const _0x3179b0=detectPackageManager(),_0x411ebd=_0x3179b0===_0x458e3b(0x179)?resolveNpmBin(_0x458e3b(0x179)):_0x3179b0,_0x5d0172=a40_0x43f33d(_0x458e3b(0x18b)+_0x3179b0+_0x458e3b(0x18e))[_0x458e3b(0x154)]();try{await execa(_0x411ebd,[_0x458e3b(0x176),'-g',NPM_PACKAGE_NAME+'@'+_0x1c3e42[_0x458e3b(0x151)]],{'stdio':'pipe'}),_0x5d0172[_0x458e3b(0x15e)]('Updated\x20to\x20v'+_0x1c3e42[_0x458e3b(0x151)]),console[_0x458e3b(0x150)](a40_0x5d1c61['gray']('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'));}catch(_0x275b32){return _0x5d0172[_0x458e3b(0x162)](_0x458e3b(0x18a)),console['error'](a40_0x5d1c61[_0x458e3b(0x175)]('\x20\x20'+_0x275b32['message'])),console[_0x458e3b(0x150)](a40_0x5d1c61[_0x458e3b(0x16c)](_0x458e3b(0x170)+_0x3179b0+_0x458e3b(0x186)+NPM_PACKAGE_NAME+'@'+_0x1c3e42[_0x458e3b(0x151)])),{'ok':![],'message':_0x275b32[_0x458e3b(0x155)]};}return verifyUpdatedBuiltinSkill(_0x1c3e42[_0x458e3b(0x151)]),{'ok':!![]};}export const updateDefinition={'service':a40_0x1e9577(0x153),'command':a40_0x1e9577(0x171),'description':a40_0x1e9577(0x160),'risk':a40_0x1e9577(0x198),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
@@ -1 +1 @@
1
- function a41_0x34ba(_0x11fffb,_0x5e82a2){_0x11fffb=_0x11fffb-0x16a;const _0x53a4f1=a41_0x53a4();let _0x34bab1=_0x53a4f1[_0x11fffb];return _0x34bab1;}(function(_0x1e315f,_0x292bb6){const _0x1334c3=a41_0x34ba,_0x2f9bd6=_0x1e315f();while(!![]){try{const _0x4be530=parseInt(_0x1334c3(0x16a))/0x1+parseInt(_0x1334c3(0x170))/0x2*(parseInt(_0x1334c3(0x16c))/0x3)+parseInt(_0x1334c3(0x172))/0x4*(parseInt(_0x1334c3(0x16b))/0x5)+-parseInt(_0x1334c3(0x171))/0x6+parseInt(_0x1334c3(0x174))/0x7+parseInt(_0x1334c3(0x16f))/0x8*(parseInt(_0x1334c3(0x16e))/0x9)+-parseInt(_0x1334c3(0x173))/0xa*(parseInt(_0x1334c3(0x16d))/0xb);if(_0x4be530===_0x292bb6)break;else _0x2f9bd6['push'](_0x2f9bd6['shift']());}catch(_0x35d29b){_0x2f9bd6['push'](_0x2f9bd6['shift']());}}}(a41_0x53a4,0x44237));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x53a4(){const _0x360092=['37560dheckm','1262536MPektm','3915IJvoEO','232DFPcMI','4gwxDCa','1147254PpJjyo','4qpXBQZ','10sslSFj','1727691GXPBOF','28919EPgmyd','1358465QkKGAh'];a41_0x53a4=function(){return _0x360092;};return a41_0x53a4();}
1
+ (function(_0x32dd25,_0x23cf81){const _0x12927e=a41_0x100c,_0x38fcf8=_0x32dd25();while(!![]){try{const _0x34dd4e=parseInt(_0x12927e(0xb3))/0x1+-parseInt(_0x12927e(0xb9))/0x2+parseInt(_0x12927e(0xb8))/0x3*(parseInt(_0x12927e(0xb5))/0x4)+parseInt(_0x12927e(0xba))/0x5*(parseInt(_0x12927e(0xbd))/0x6)+-parseInt(_0x12927e(0xb7))/0x7*(-parseInt(_0x12927e(0xb6))/0x8)+parseInt(_0x12927e(0xbc))/0x9*(-parseInt(_0x12927e(0xb4))/0xa)+-parseInt(_0x12927e(0xbb))/0xb;if(_0x34dd4e===_0x23cf81)break;else _0x38fcf8['push'](_0x38fcf8['shift']());}catch(_0x466751){_0x38fcf8['push'](_0x38fcf8['shift']());}}}(a41_0x1038,0x63507));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x100c(_0x44c055,_0x6c546a){_0x44c055=_0x44c055-0xb3;const _0x1038c9=a41_0x1038();let _0x100cbf=_0x1038c9[_0x44c055];return _0x100cbf;}export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x1038(){const _0x17a0a8=['1137828jpoWNG','8YdESWa','2733899amupBw','3wXbjwu','861408mXhShT','30LgNnaH','1295987JZWGbZ','1881828iLxPAt','323916XRnEAm','165474pAOdlt','10sgikks'];a41_0x1038=function(){return _0x17a0a8;};return a41_0x1038();}
@@ -1 +1 @@
1
- function a42_0x4a6c(_0x53c56c,_0x3e4c1b){_0x53c56c=_0x53c56c-0xaa;const _0x101e7f=a42_0x101e();let _0x4a6c82=_0x101e7f[_0x53c56c];return _0x4a6c82;}function a42_0x101e(){const _0x130bad=['7210576IaNcdG','2474345HVWlBj','bool','1016188oxwTCr','codegen','operation','125902yAvaYX','code','skip-imports','tableName','18mZoDqD','read','1741797mOdhuq','96OJDeQM','Omit\x20import\x20statements\x20from\x20generated\x20code','sdk','alias','506811IFOtsg','string','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','8riJGfx','str','name','11498910ixBBvu'];a42_0x101e=function(){return _0x130bad;};return a42_0x101e();}const a42_0xbcb249=a42_0x4a6c;(function(_0x3e16df,_0x2357eb){const _0x4b56c9=a42_0x4a6c,_0x13fdfa=_0x3e16df();while(!![]){try{const _0x1ce22f=-parseInt(_0x4b56c9(0xbc))/0x1+-parseInt(_0x4b56c9(0xae))/0x2+-parseInt(_0x4b56c9(0xb7))/0x3+-parseInt(_0x4b56c9(0xbf))/0x4*(-parseInt(_0x4b56c9(0xac))/0x5)+parseInt(_0x4b56c9(0xb8))/0x6*(-parseInt(_0x4b56c9(0xb1))/0x7)+-parseInt(_0x4b56c9(0xab))/0x8+-parseInt(_0x4b56c9(0xb5))/0x9*(-parseInt(_0x4b56c9(0xaa))/0xa);if(_0x1ce22f===_0x2357eb)break;else _0x13fdfa['push'](_0x13fdfa['shift']());}catch(_0x3396bf){_0x13fdfa['push'](_0x13fdfa['shift']());}}}(a42_0x101e,0x7b456));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0xbcb249(0xaf),'command':a42_0xbcb249(0xba),'description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':a42_0xbcb249(0xb6),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0xbcb249(0xbb),'type':a42_0xbcb249(0xbd),'description':a42_0xbcb249(0xbe)},{'name':a42_0xbcb249(0xb0),'type':a42_0xbcb249(0xbd),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0xbcb249(0xb3),'type':'boolean','description':a42_0xbcb249(0xb9)}],async 'execute'(_0x576075){const _0x1fa59f=a42_0xbcb249,{dataset:_0x4b4585,operation:_0x462b52}=await getOperationDetail(_0x576075['appCode'],_0x576075['str'](_0x1fa59f(0xb2)),_0x576075[_0x1fa59f(0xc0)](_0x1fa59f(0xb0))),_0x2a2151=generateSdkCode(_0x4b4585,_0x462b52,{'includeImports':!_0x576075[_0x1fa59f(0xad)](_0x1fa59f(0xb3))});return{'ok':!![],'data':{'dataset':{'name':_0x4b4585[_0x1fa59f(0xc1)],'code':_0x4b4585[_0x1fa59f(0xb2)],'tableName':_0x4b4585[_0x1fa59f(0xb4)]},'operation':_0x576075[_0x1fa59f(0xc0)](_0x1fa59f(0xb0)),'code':_0x2a2151}};}};
1
+ const a42_0x5d685f=a42_0x14e0;(function(_0x54ee2c,_0x3e0973){const _0x934c15=a42_0x14e0,_0x199f05=_0x54ee2c();while(!![]){try{const _0x5db391=parseInt(_0x934c15(0x80))/0x1*(-parseInt(_0x934c15(0x82))/0x2)+parseInt(_0x934c15(0x76))/0x3*(parseInt(_0x934c15(0x83))/0x4)+-parseInt(_0x934c15(0x75))/0x5*(parseInt(_0x934c15(0x77))/0x6)+-parseInt(_0x934c15(0x70))/0x7*(-parseInt(_0x934c15(0x6e))/0x8)+-parseInt(_0x934c15(0x7a))/0x9+-parseInt(_0x934c15(0x81))/0xa*(-parseInt(_0x934c15(0x7f))/0xb)+parseInt(_0x934c15(0x6b))/0xc;if(_0x5db391===_0x3e0973)break;else _0x199f05['push'](_0x199f05['shift']());}catch(_0x8a7974){_0x199f05['push'](_0x199f05['shift']());}}}(a42_0xb238,0x26215));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a42_0x14e0(_0x2d40fc,_0x2141aa){_0x2d40fc=_0x2d40fc-0x6b;const _0xb238e0=a42_0xb238();let _0x14e015=_0xb238e0[_0x2d40fc];return _0x14e015;}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x5d685f(0x7e),'command':'sdk','description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x5d685f(0x79),'type':a42_0x5d685f(0x84),'description':a42_0x5d685f(0x71)},{'name':a42_0x5d685f(0x7c),'type':a42_0x5d685f(0x84),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0x5d685f(0x6f),'type':a42_0x5d685f(0x7d),'description':a42_0x5d685f(0x6c)}],async 'execute'(_0x49f563){const _0x47a0e9=a42_0x5d685f,{dataset:_0x119ed8,operation:_0x181996}=await getOperationDetail(_0x49f563[_0x47a0e9(0x7b)],_0x49f563['str'](_0x47a0e9(0x72)),_0x49f563[_0x47a0e9(0x74)](_0x47a0e9(0x7c))),_0x416f0e=generateSdkCode(_0x119ed8,_0x181996,{'includeImports':!_0x49f563[_0x47a0e9(0x6d)](_0x47a0e9(0x6f))});return{'ok':!![],'data':{'dataset':{'name':_0x119ed8[_0x47a0e9(0x73)],'code':_0x119ed8[_0x47a0e9(0x72)],'tableName':_0x119ed8[_0x47a0e9(0x78)]},'operation':_0x49f563[_0x47a0e9(0x74)]('operation'),'code':_0x416f0e}};}};function a42_0xb238(){const _0x4aa623=['str','75xCpVDN','189555QFnMOn','23442ztFkGE','tableName','alias','2464893QaZnuV','appCode','operation','boolean','codegen','1837ECATbg','168159SaLRSP','16340HdJDDp','2zUFbJm','4VBOJgl','string','2578800gCUPJo','Omit\x20import\x20statements\x20from\x20generated\x20code','bool','846872TGyFli','skip-imports','7cHkwzc','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','code','name'];a42_0xb238=function(){return _0x4aa623;};return a42_0xb238();}
@@ -1 +1 @@
1
- const a43_0x202a6b=a43_0x439d;(function(_0x11aea6,_0x4864b3){const _0xd43a2b=a43_0x439d,_0x1d6915=_0x11aea6();while(!![]){try{const _0x3d1fa5=parseInt(_0xd43a2b(0x97))/0x1*(parseInt(_0xd43a2b(0x99))/0x2)+-parseInt(_0xd43a2b(0x89))/0x3+parseInt(_0xd43a2b(0x9d))/0x4+-parseInt(_0xd43a2b(0x86))/0x5*(-parseInt(_0xd43a2b(0x88))/0x6)+-parseInt(_0xd43a2b(0x8b))/0x7*(parseInt(_0xd43a2b(0x9b))/0x8)+parseInt(_0xd43a2b(0x8e))/0x9+parseInt(_0xd43a2b(0x98))/0xa*(-parseInt(_0xd43a2b(0x91))/0xb);if(_0x3d1fa5===_0x4864b3)break;else _0x1d6915['push'](_0x1d6915['shift']());}catch(_0x46898d){_0x1d6915['push'](_0x1d6915['shift']());}}}(a43_0x3e3d,0x98fcd));function a43_0x3e3d(){const _0x20afea=['41640mdEhjd','sqlcode','3873632tRdRgl','sdk','134105pmmnpP','bool','216mNOLKT','165069eEkkyd','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','952jzzDVJ','no-imports','sql','7037226lTkvvJ','sqlName','boolean','7439652KLbNZG','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','appCode','str','read','sqlCode','1urWfoM','20bNoUNp','52652lRcZsf','bff'];a43_0x3e3d=function(){return _0x20afea;};return a43_0x3e3d();}function a43_0x439d(_0x50b329,_0x4fb7d7){_0x50b329=_0x50b329-0x86;const _0x3e3da3=a43_0x3e3d();let _0x439dd5=_0x3e3da3[_0x50b329];return _0x439dd5;}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':'codegen','command':a43_0x202a6b(0x8d),'description':a43_0x202a6b(0x8a),'risk':a43_0x202a6b(0x95),'flags':[SQLCODE_FLAG,{'name':'target','type':'string','description':a43_0x202a6b(0x92),'default':a43_0x202a6b(0x9e),'enum':[a43_0x202a6b(0x9e),a43_0x202a6b(0x9a)]},{'name':a43_0x202a6b(0x8c),'type':a43_0x202a6b(0x90),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x29b2d0){const _0x51aaf8=a43_0x202a6b,_0xcd59d6=await getSqlQueryInfo(_0x29b2d0[_0x51aaf8(0x93)],_0x29b2d0[_0x51aaf8(0x94)](_0x51aaf8(0x9c))),_0x11621e=_0x29b2d0[_0x51aaf8(0x94)]('target')||'sdk',_0x11c10a=generateSqlCodeTemplate(_0xcd59d6,{'target':_0x11621e,'includeImports':!_0x29b2d0[_0x51aaf8(0x87)](_0x51aaf8(0x8c))});return{'ok':!![],'data':{'sqlCode':_0xcd59d6[_0x51aaf8(0x96)],'sqlName':_0xcd59d6[_0x51aaf8(0x8f)],'target':_0x11621e,'code':_0x11c10a}};}};
1
+ function a43_0x4b84(){const _0x5a600d=['codegen','3504320VhFoGJ','sdk','sqlCode','1986600rjgQWn','5134776zDFjgu','bool','no-imports','str','boolean','12VZXqxK','198303IFaqni','3223934TYpFrq','5857749YYrycv','target','21TfKsNQ','124694TGxpEY','appCode','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query'];a43_0x4b84=function(){return _0x5a600d;};return a43_0x4b84();}const a43_0x55493e=a43_0x583f;(function(_0xd54b47,_0x213231){const _0x3e9758=a43_0x583f,_0x2ebb6a=_0xd54b47();while(!![]){try{const _0x5cc3a2=parseInt(_0x3e9758(0x103))/0x1+parseInt(_0x3e9758(0x108))/0x2*(-parseInt(_0x3e9758(0x107))/0x3)+parseInt(_0x3e9758(0xfc))/0x4+-parseInt(_0x3e9758(0xf9))/0x5+-parseInt(_0x3e9758(0x102))/0x6*(-parseInt(_0x3e9758(0x104))/0x7)+-parseInt(_0x3e9758(0xfd))/0x8+parseInt(_0x3e9758(0x105))/0x9;if(_0x5cc3a2===_0x213231)break;else _0x2ebb6a['push'](_0x2ebb6a['shift']());}catch(_0x4d89ed){_0x2ebb6a['push'](_0x2ebb6a['shift']());}}}(a43_0x4b84,0x77176));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x583f(_0x51e82c,_0x4f16e3){_0x51e82c=_0x51e82c-0xf7;const _0x4b84ee=a43_0x4b84();let _0x583f6a=_0x4b84ee[_0x51e82c];return _0x583f6a;}export const codegenSql={'service':a43_0x55493e(0xf8),'command':'sql','description':a43_0x55493e(0xf7),'risk':'read','flags':[SQLCODE_FLAG,{'name':a43_0x55493e(0x106),'type':'string','description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x55493e(0xfa),'enum':['sdk','bff']},{'name':a43_0x55493e(0xff),'type':a43_0x55493e(0x101),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x4f96cd){const _0x5b24c7=a43_0x55493e,_0x22bdf9=await getSqlQueryInfo(_0x4f96cd[_0x5b24c7(0x109)],_0x4f96cd[_0x5b24c7(0x100)]('sqlcode')),_0x4535e6=_0x4f96cd[_0x5b24c7(0x100)](_0x5b24c7(0x106))||'sdk',_0x377bc1=generateSqlCodeTemplate(_0x22bdf9,{'target':_0x4535e6,'includeImports':!_0x4f96cd[_0x5b24c7(0xfe)](_0x5b24c7(0xff))});return{'ok':!![],'data':{'sqlCode':_0x22bdf9[_0x5b24c7(0xfb)],'sqlName':_0x22bdf9['sqlName'],'target':_0x4535e6,'code':_0x377bc1}};}};