@lovrabet/rabetbase-cli 2.5.2-beta.7 → 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_0x29cb16=a31_0x373d;function a31_0x58f7(){const _0x10bd8b=['#api-list\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','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','2KORpjJ','type','\x22\x20not\x20found.\x20','修改后的请求参数','HOOK\x20requires\x20hookOptions\x20for\x20template\x20generation.','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20ENDPOINT\x0a\x20*\x20[脚本名称]\x20','Operation\x20type\x20\x22','4524741PhMOhU','743655NkyTNE','Available:\x20','961276TPTLeE','Script\x20description','/**\x0a\x20*\x20','isInteger','\x20\x20Enter\x20a\x20number\x20between\x201\x20and\x20','str','.js','No\x20api.ts\x20found.\x20Run\x20`','The\x20api.ts\x20may\x20be\x20stale\x20—\x20run\x20`','当前请求参数','stderr','Invalid\x20function\x20name\x20\x22','code','\x0a\x20*\x20[接口路径]\x20POST\x20/api/','Available\x20aliases:\x20','修改后的响应结果','\x22,\x20params\x20})\x0a','222mcnOeW','File\x20already\x20exists:\x20','No\x20datasets\x20found\x20for\x20this\x20app.','Invalid\x20dataset\x20selection.','length','HOOK','after','\x22.\x20Must\x20be\x20a\x20valid\x20JS\x20identifier\x20(e.g.\x20createOrder,\x20beforeFilter).','question','/data/dataset/','appCode','alias','--alias\x20or\x20--datasetcode\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','scriptsRootDir','33754BOXvql','close','find','operationType','before','Select\x20dataset:','source','No\x20operation\x20types\x20found\x20for\x20dataset\x20','Dataset\x20code\x20(HOOK\x20only,\x20fallback\x20when\x20alias\x20unavailable)','\x20api\x20pull`\x20to\x20refresh.','function-node','--function-node\x20must\x20be\x20\x27before\x27\x20or\x20\x27after\x27.','\x0a\x20*\x20[平台配置]\x20','/data/backend-function\x0a\x20*\x20[本地路径]\x20.rabetbase/bff/','map','utf8',']\x20(','--operation-type\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','3242344RBheoQ','apiDir','string','operation-type','validation','\x0a\x20*\x20[接口路径]\x20POST\x20/api/endpoint/','\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','.js\x0a\x20*\x20[调用方式]\x20context.client.bff.execute({\x20scriptName:\x20\x22','datasetId','当前响应结果','\x0a\x20*/\x0aexport\x20default\x20async\x20function\x20','/ENDPOINT/','COMMON','Created\x20','join','description','.js\x0a\x20*\x20[触发节点]\x20','functionNode','\x0a\x20*\x0a\x20*\x20[脚本类型]\x20COMMON\x0a\x20*\x20[脚本名称]\x20','.js\x0a','Script\x20type','--function-node\x20is\x20required\x20for\x20HOOK\x20in\x20non-interactive\x20mode.','ENDPOINT','\x20function:\x20','73188SMvkmp','trim','nonInteractive','(params,\x20context)\x20{\x0a\x20\x20return\x20params;\x0a}\x0a','create','Function\x20name\x20(valid\x20JS\x20identifier)','Dataset\x20alias\x20from\x20api.ts\x20(HOOK\x20only,\x20preferred)','Select\x20trigger\x20node:','name','Operation\x20type\x20(HOOK\x20only)','datasetCode','561147HdJCxQ','includes','write'];a31_0x58f7=function(){return _0x10bd8b;};return a31_0x58f7();}(function(_0x23f3e9,_0x370951){const _0x2b4178=a31_0x373d,_0x4c40c6=_0x23f3e9();while(!![]){try{const _0x1b76a8=-parseInt(_0x2b4178(0x18c))/0x1+-parseInt(_0x2b4178(0x19d))/0x2*(-parseInt(_0x2b4178(0x197))/0x3)+parseInt(_0x2b4178(0x1a7))/0x4+-parseInt(_0x2b4178(0x1a5))/0x5+-parseInt(_0x2b4178(0x1b8))/0x6*(-parseInt(_0x2b4178(0x1c6))/0x7)+parseInt(_0x2b4178(0x174))/0x8+-parseInt(_0x2b4178(0x1a4))/0x9;if(_0x1b76a8===_0x370951)break;else _0x4c40c6['push'](_0x4c40c6['shift']());}catch(_0x3d7ed5){_0x4c40c6['push'](_0x4c40c6['shift']());}}}(a31_0x58f7,0x45ec7));function a31_0x373d(_0xe1a24d,_0x6625fc){_0xe1a24d=_0xe1a24d-0x174;const _0x58f74e=a31_0x58f7();let _0x373d63=_0x58f74e[_0xe1a24d];return _0x373d63;}import{createInterface}from'node:readline';import{mkdir,writeFile}from'node:fs/promises';import{dirname,join}from'node:path';import{listDatasets,listBffDatasetOperations}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{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':'bff','command':a31_0x29cb16(0x190),'description':'Scaffold\x20a\x20new\x20Backend\x20Function\x20script\x20from\x20template','risk':'read','flags':[{'name':a31_0x29cb16(0x19e),'type':a31_0x29cb16(0x176),'required':!![],'enum':['COMMON',a31_0x29cb16(0x18a),a31_0x29cb16(0x1bd)],'description':a31_0x29cb16(0x188)},{'name':a31_0x29cb16(0x194),'type':a31_0x29cb16(0x176),'required':!![],'description':a31_0x29cb16(0x191)},{'name':'description','type':'string','description':a31_0x29cb16(0x1a8)},{'name':a31_0x29cb16(0x1c3),'type':a31_0x29cb16(0x176),'description':a31_0x29cb16(0x192)},{'name':a31_0x29cb16(0x19b),'type':a31_0x29cb16(0x176),'description':a31_0x29cb16(0x1ce)},{'name':a31_0x29cb16(0x177),'type':a31_0x29cb16(0x176),'description':a31_0x29cb16(0x195)},{'name':a31_0x29cb16(0x1d0),'type':'string','description':'Trigger\x20node\x20(HOOK\x20only)','enum':[a31_0x29cb16(0x1ca),'after']}],async 'validate'(_0x15941d){const _0x28da3d=a31_0x29cb16,_0x5c50b1=_0x15941d['str'](_0x28da3d(0x194));if(!isValidBffFunctionName(_0x5c50b1))throw CliErrors[_0x28da3d(0x178)](_0x28da3d(0x1b2)+_0x5c50b1+_0x28da3d(0x1bf));},async 'execute'(_0x51b0a8){const _0x1a8fa3=a31_0x29cb16,_0xa74ed6=loadBffProjectConfig(_0x51b0a8['appCode']),_0x248553=_0x51b0a8[_0x1a8fa3(0x1ac)](_0x1a8fa3(0x19e)),_0x32ff03=_0x51b0a8[_0x1a8fa3(0x1ac)](_0x1a8fa3(0x194)),_0x263b01=_0x51b0a8['str']('description')||undefined,_0x5f4f5e=_0x248553===_0x1a8fa3(0x1bd)?await resolveHookOptions(_0xa74ed6,_0x51b0a8):undefined,_0x24b9ac=buildFilePath(_0xa74ed6,_0x248553,_0x32ff03,_0x5f4f5e);if(await fileExists(_0x24b9ac))throw CliErrors['validation'](_0x1a8fa3(0x1b9)+_0x24b9ac);await mkdir(dirname(_0x24b9ac),{'recursive':!![]});const _0x49ec36=generateTemplate(_0x248553,_0x32ff03,_0x51b0a8[_0x1a8fa3(0x1c2)],_0x263b01,_0x5f4f5e);await writeFile(_0x24b9ac,_0x49ec36,_0x1a8fa3(0x1d5));const _0x5a0345={'type':_0x248553,'name':_0x32ff03,'path':_0x24b9ac};if(_0x263b01)_0x5a0345[_0x1a8fa3(0x183)]=_0x263b01;if(_0x5f4f5e){if(_0x5f4f5e[_0x1a8fa3(0x1c3)])_0x5a0345[_0x1a8fa3(0x1c3)]=_0x5f4f5e[_0x1a8fa3(0x1c3)];_0x5a0345['datasetCode']=_0x5f4f5e[_0x1a8fa3(0x196)],_0x5a0345[_0x1a8fa3(0x1c9)]=_0x5f4f5e[_0x1a8fa3(0x1c9)],_0x5a0345['functionNode']=_0x5f4f5e[_0x1a8fa3(0x185)];}return{'ok':!![],'data':_0x5a0345,'message':_0x1a8fa3(0x181)+_0x248553+_0x1a8fa3(0x18b)+_0x32ff03};}};async function resolveHookOptions(_0x3ebc62,_0x25a123){const _0x162c63=a31_0x29cb16,_0x1d22bb=loadAliasMap(_0x25a123[_0x162c63(0x175)],undefined,resolveApiFilePath(_0x25a123[_0x162c63(0x175)],_0x25a123[_0x162c63(0x1c2)])),_0x119a23=_0x1d22bb[_0x162c63(0x1bc)]>0x0;let _0x5e38d6,_0x575733,_0x5a7388;const _0x1c32f0=_0x25a123[_0x162c63(0x1ac)](_0x162c63(0x1c3)),_0xc797b0=_0x25a123[_0x162c63(0x1ac)](_0x162c63(0x19b));if(_0x1c32f0){const _0x22996a=resolveAlias(_0x25a123[_0x162c63(0x175)],_0x1c32f0,undefined,resolveApiFilePath(_0x25a123['apiDir'],_0x25a123['appCode']));if(!_0x22996a){const _0x2593c5=_0x119a23?_0x162c63(0x1b5)+_0x1d22bb[_0x162c63(0x1d4)](_0x38a7b7=>_0x38a7b7[_0x162c63(0x1c3)])[_0x162c63(0x182)](',\x20'):_0x162c63(0x1ae)+CLI_BIN_NAME+'\x20api\x20pull`\x20first,\x20or\x20use\x20--datasetcode\x20instead.';throw CliErrors[_0x162c63(0x178)]('Alias\x20\x22'+_0x1c32f0+_0x162c63(0x19f)+_0x2593c5);}_0x5e38d6=_0x1c32f0,_0x575733=_0x22996a;}else{if(_0xc797b0){_0x575733=_0xc797b0;const _0x19d61f=_0x1d22bb[_0x162c63(0x1c8)](_0x1edc9e=>_0x1edc9e[_0x162c63(0x196)]===_0xc797b0);_0x5e38d6=_0x19d61f?.[_0x162c63(0x1c3)];}else{if(_0x25a123[_0x162c63(0x18e)])throw CliErrors[_0x162c63(0x178)](_0x162c63(0x1c4));else{if(_0x119a23){const _0x3afed3=_0x1d22bb[_0x162c63(0x1d4)](_0x9e0e34=>_0x9e0e34['alias']+'\x20('+_0x9e0e34['tableName']+')'),_0x5448c1=await promptSelect('Select\x20dataset:',_0x3afed3),_0x17691d=_0x1d22bb[_0x5448c1];if(!_0x17691d)throw CliErrors[_0x162c63(0x178)](_0x162c63(0x1bb));_0x5e38d6=_0x17691d[_0x162c63(0x1c3)],_0x575733=_0x17691d[_0x162c63(0x196)];}else{const _0x42528d=await listDatasets(_0x25a123[_0x162c63(0x1c2)]);if(_0x42528d[_0x162c63(0x1bc)]===0x0)throw CliErrors['validation'](_0x162c63(0x1ba));const _0x3034b1=_0x42528d[_0x162c63(0x1d4)](_0x279e33=>_0x279e33['name']+'\x20['+(_0x279e33[_0x162c63(0x1cc)]??'UNKNOWN')+_0x162c63(0x1d6)+_0x279e33[_0x162c63(0x1b3)]+')'),_0x280735=await promptSelect(_0x162c63(0x1cb),_0x3034b1),_0x5ca1a3=_0x42528d[_0x280735];if(!_0x5ca1a3)throw CliErrors[_0x162c63(0x178)]('Invalid\x20dataset\x20selection.');_0x575733=_0x5ca1a3[_0x162c63(0x1b3)],_0x5e38d6=undefined;}}}}const _0x20694d=await listDatasets(_0x25a123[_0x162c63(0x1c2)]),_0xb18a07=_0x20694d['find'](_0x258b39=>_0x258b39[_0x162c63(0x1b3)]===_0x575733);if(!_0xb18a07)throw CliErrors[_0x162c63(0x178)]('Dataset\x20not\x20found\x20for\x20code\x20\x22'+_0x575733+'\x22.\x20'+(_0x5e38d6?_0x162c63(0x1af)+CLI_BIN_NAME+_0x162c63(0x1cf):''));_0x5a7388=_0xb18a07['id'];const _0xa92b90=_0x5e38d6??_0x575733,_0x14e953=await listBffDatasetOperations(_0x25a123['appCode'],_0x5a7388),_0x57dd8e=_0x14e953?Object['keys'](_0x14e953):[];if(_0x57dd8e['length']===0x0)throw CliErrors[_0x162c63(0x178)](_0x162c63(0x1cd)+_0xa92b90+'.');let _0x22651d;const _0x30438c=_0x25a123[_0x162c63(0x1ac)]('operation-type');if(_0x30438c){if(!_0x57dd8e[_0x162c63(0x198)](_0x30438c))throw CliErrors[_0x162c63(0x178)](_0x162c63(0x1a3)+_0x30438c+'\x22\x20not\x20found\x20for\x20dataset\x20'+_0xa92b90+'.\x20'+(_0x162c63(0x1a6)+_0x57dd8e[_0x162c63(0x182)](',\x20')));_0x22651d=_0x30438c;}else{if(_0x25a123[_0x162c63(0x18e)])throw CliErrors[_0x162c63(0x178)](_0x162c63(0x1d7));const _0x58b4db=await promptSelect('Select\x20operation\x20type:',_0x57dd8e);_0x22651d=_0x57dd8e[_0x58b4db]??_0x57dd8e[0x0];}let _0x52314e=normalizeHookFunctionNode(_0x25a123[_0x162c63(0x1ac)](_0x162c63(0x1d0)));if(!_0x52314e){if(_0x25a123[_0x162c63(0x1ac)](_0x162c63(0x1d0)))throw CliErrors['validation'](_0x162c63(0x1d1));if(_0x25a123[_0x162c63(0x18e)])throw CliErrors[_0x162c63(0x178)](_0x162c63(0x189));const _0x952275=await promptSelect(_0x162c63(0x193),[_0x162c63(0x1ca),'after']);_0x52314e=[_0x162c63(0x1ca),_0x162c63(0x1be)][_0x952275]??_0x162c63(0x1ca);}return{'alias':_0x5e38d6,'datasetCode':_0x575733,'datasetId':_0x5a7388,'operationType':_0x22651d,'functionNode':_0x52314e};}async function promptSelect(_0x392237,_0x5e7491){const _0x17872b=a31_0x29cb16;if(_0x5e7491['length']===0x1)return 0x0;for(const [_0xa4ceef,_0x1faad2]of _0x5e7491['entries']()){process[_0x17872b(0x1b1)][_0x17872b(0x199)]('\x20\x20'+(_0xa4ceef+0x1)+'.\x20'+_0x1faad2+'\x0a');}const _0x789423=createInterface({'input':process['stdin'],'output':process[_0x17872b(0x1b1)]});while(!![]){const _0x3c049f=await new Promise(_0xba2d70=>{const _0x40c91e=_0x17872b;_0x789423[_0x40c91e(0x1c0)](_0x392237+'\x20',_0xba2d70);}),_0x4dbb3a=Number['parseInt'](_0x3c049f[_0x17872b(0x18d)](),0xa);if(Number[_0x17872b(0x1aa)](_0x4dbb3a)&&_0x4dbb3a>=0x1&&_0x4dbb3a<=_0x5e7491[_0x17872b(0x1bc)])return _0x789423[_0x17872b(0x1c7)](),_0x4dbb3a-0x1;process[_0x17872b(0x1b1)][_0x17872b(0x199)](_0x17872b(0x1ab)+_0x5e7491[_0x17872b(0x1bc)]+'.\x0a');}}function buildFilePath(_0x3f9297,_0x2b5439,_0x29e395,_0x3e31df){const _0xf0fd68=a31_0x29cb16;if(_0x2b5439===_0xf0fd68(0x1bd)){if(!_0x3e31df)throw CliErrors[_0xf0fd68(0x178)]('HOOK\x20requires\x20alias/operation/node\x20options.');const _0xde638e=_0x3e31df[_0xf0fd68(0x1c3)]??_0x3e31df['datasetCode'];return join(_0x3f9297[_0xf0fd68(0x1c5)],_0xf0fd68(0x1bd),_0xde638e,_0x3e31df[_0xf0fd68(0x1c9)],_0x3e31df['functionNode'],_0x29e395+'.js');}return join(_0x3f9297[_0xf0fd68(0x1c5)],_0x2b5439,_0x29e395+_0xf0fd68(0x1ad));}export function generateTemplate(_0x3d9ea9,_0x3caa8d,_0x373a7a,_0x205681,_0x52ecb9){const _0x139cae=a31_0x29cb16,_0x3b571b=_0x205681?.[_0x139cae(0x18d)]()||DEFAULT_BFF_SCRIPT_DESCRIPTION,_0x354e38=getAppBaseUrl(_0x373a7a),_0x2a1e6a='\x20*\x20[依赖数据集]\x20无(如有依赖,DB_TABLE\x20填物理表名;METADATA\x20填数据集编码与用途)\x0a\x20*\x20[调用\x20BF]\x20无(如有调用,填写脚本名称与用途)\x0a\x20*\x20[执行\x20SQL]\x20无(如有执行,填写\x20SQL\x20名称与用途)\x0a\x20*\x20[副作用]\x20无(如有通知或外部调用,说明影响与失败策略)';if(_0x3d9ea9===_0x139cae(0x180))return _0x139cae(0x1a9)+_0x3b571b+_0x139cae(0x186)+_0x3caa8d+_0x139cae(0x1d2)+_0x354e38+_0x139cae(0x1d3)+_0x373a7a+'/COMMON/'+_0x3caa8d+_0x139cae(0x17b)+_0x3caa8d+_0x139cae(0x1b7)+_0x2a1e6a+_0x139cae(0x17a)+_0x3caa8d+_0x139cae(0x18f);if(_0x3d9ea9===_0x139cae(0x18a))return'/**\x0a\x20*\x20'+_0x3b571b+_0x139cae(0x1a2)+_0x3caa8d+_0x139cae(0x179)+_0x373a7a+'/'+_0x3caa8d+_0x139cae(0x1d2)+_0x354e38+_0x139cae(0x1d3)+_0x373a7a+_0x139cae(0x17f)+_0x3caa8d+_0x139cae(0x187)+_0x2a1e6a+_0x139cae(0x19c)+_0x3caa8d+_0x139cae(0x18f);if(!_0x52ecb9)throw CliErrors['validation'](_0x139cae(0x1a1));const _0xf243c6=_0x52ecb9[_0x139cae(0x1c3)]??_0x52ecb9[_0x139cae(0x196)],_0x4af008=_0x52ecb9['functionNode']==='before'?_0x139cae(0x1b0):_0x139cae(0x17d),_0x2bcb5d=_0x52ecb9[_0x139cae(0x185)]===_0x139cae(0x1ca)?_0x139cae(0x1a0):_0x139cae(0x1b6);return'/**\x0a\x20*\x20'+_0x3b571b+'\x0a\x20*\x0a\x20*\x20[脚本类型]\x20HOOK\x0a\x20*\x20[脚本名称]\x20'+_0x3caa8d+_0x139cae(0x1b4)+_0x373a7a+'/'+_0x52ecb9['datasetCode']+'/'+_0x52ecb9[_0x139cae(0x1c9)]+_0x139cae(0x1d2)+_0x354e38+_0x139cae(0x1c1)+_0x52ecb9[_0x139cae(0x17c)]+_0x139cae(0x19a)+_0x373a7a+'/HOOK/'+_0xf243c6+'/'+_0x52ecb9[_0x139cae(0x1c9)]+'/'+_0x52ecb9['functionNode']+'/'+_0x3caa8d+_0x139cae(0x184)+_0x52ecb9[_0x139cae(0x185)]+'\x0a'+_0x2a1e6a+'\x0a\x20*\x20[参数字段]\x20按实际输入为\x20params.<字段名>\x20补充\x20JSDoc\x20参数标签;无字段时仅保留根参数\x0a\x20*\x20[异常说明]\x20无;显式抛出异常时补充异常类型与触发条件\x0a\x20*\x0a\x20*\x20@param\x20{Object}\x20params\x20'+_0x4af008+'\x0a\x20*\x20@param\x20{Object}\x20context\x20平台注入的执行上下文\x0a\x20*\x20@returns\x20{Promise<Object>}\x20'+_0x2bcb5d+_0x139cae(0x17e)+_0x3caa8d+_0x139cae(0x18f);}
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_0x573b2e=a32_0x2824;(function(_0x57835b,_0x22bd11){const _0x4fb627=a32_0x2824,_0x3c770=_0x57835b();while(!![]){try{const _0x493b3a=parseInt(_0x4fb627(0x179))/0x1+parseInt(_0x4fb627(0x160))/0x2+parseInt(_0x4fb627(0x170))/0x3*(-parseInt(_0x4fb627(0x180))/0x4)+parseInt(_0x4fb627(0x15e))/0x5+parseInt(_0x4fb627(0x186))/0x6*(parseInt(_0x4fb627(0x16e))/0x7)+-parseInt(_0x4fb627(0x166))/0x8+-parseInt(_0x4fb627(0x169))/0x9;if(_0x493b3a===_0x22bd11)break;else _0x3c770['push'](_0x3c770['shift']());}catch(_0x55c0a6){_0x3c770['push'](_0x3c770['shift']());}}}(a32_0x1042,0x436ba));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteBffScript}from'../../core/api-client.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{fileExists,resolveLocalFilePathFromLockKey}from'../../core/bff/file-system.js';function a32_0x2824(_0x480ff1,_0x3dfd70){_0x480ff1=_0x480ff1-0x15e;const _0x10424b=a32_0x1042();let _0x282422=_0x10424b[_0x480ff1];return _0x282422;}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_0x573b2e(0x182),'command':a32_0x573b2e(0x16f),'description':a32_0x573b2e(0x177),'risk':'high-risk-write','flags':[{'name':'target','type':a32_0x573b2e(0x16b),'required':!![],'description':a32_0x573b2e(0x175)}],async 'validate'(_0x10257c){const _0x5aede0=a32_0x573b2e,_0x47186a=loadBffProjectConfig(_0x10257c[_0x5aede0(0x17c)]),_0x164659=await readBffLockFile(_0x47186a[_0x5aede0(0x178)]);if(!_0x164659)throw CliErrors['validation'](_0x5aede0(0x18b));},async 'dryRun'(_0x40de10){const _0x23b826=a32_0x573b2e,_0x5de24d=loadBffProjectConfig(_0x40de10['appCode']),_0x40e385=await readBffLockFile(_0x5de24d[_0x23b826(0x178)]);if(!_0x40e385)throw CliErrors['validation'](_0x23b826(0x15f));const {appLock:_0x426fd9}=ensureLockScope(_0x40e385,_0x40de10[_0x23b826(0x17c)],_0x5de24d['scriptsRoot'],_0x23b826(0x16f)),_0x3766ca=_0x40de10['str'](_0x23b826(0x17a)),_0x1ae3bf=Object['keys'](_0x426fd9[_0x23b826(0x185)]),_0x301b8b=resolveDeleteTarget(_0x3766ca,_0x1ae3bf),_0x344cce=_0x426fd9[_0x23b826(0x185)][_0x301b8b];if(!_0x344cce)throw CliErrors[_0x23b826(0x171)](_0x23b826(0x16a)+_0x301b8b+'\x22.');const _0x205dd3=resolveLocalFilePathFromLockKey(_0x5de24d,_0x301b8b),_0x3105e0=relative(_0x5de24d['projectRoot'],_0x205dd3),_0x3ca81e=join(_0x5de24d[_0x23b826(0x187)],_0x23b826(0x161),_0x3105e0);return{'method':_0x23b826(0x168),'url':_0x23b826(0x16c),'body':{'appCode':_0x40de10[_0x23b826(0x17c)],'target':_0x301b8b,'remoteId':_0x344cce[_0x23b826(0x183)],'localFilePath':_0x205dd3,'trashedPath':_0x3ca81e},'description':_0x23b826(0x173)+_0x301b8b+_0x23b826(0x165)};},async 'execute'(_0xd80449){const _0x3e8442=a32_0x573b2e,_0x219f64=loadBffProjectConfig(_0xd80449[_0x3e8442(0x17c)]),_0x8ebb51=await readBffLockFile(_0x219f64[_0x3e8442(0x178)]);if(!_0x8ebb51)throw CliErrors[_0x3e8442(0x171)](_0x3e8442(0x15f));const {lockData:_0x56ed9e,appLock:_0x2f9bd0}=ensureLockScope(_0x8ebb51,_0xd80449[_0x3e8442(0x17c)],_0x219f64[_0x3e8442(0x174)],_0x3e8442(0x16f)),_0x756fc7=JSON['parse'](JSON[_0x3e8442(0x189)](_0x56ed9e)),_0x44b430=_0x756fc7[_0x3e8442(0x18d)][_0xd80449[_0x3e8442(0x17c)]];if(!_0x44b430)throw new Error(_0x3e8442(0x188)+_0xd80449[_0x3e8442(0x17c)]+_0x3e8442(0x162));const _0x412577=_0xd80449[_0x3e8442(0x18e)](_0x3e8442(0x17a)),_0x33b52f=Object['keys'](_0x44b430[_0x3e8442(0x185)]),_0x16bf27=resolveDeleteTarget(_0x412577,_0x33b52f),_0x1fe6de=_0x44b430[_0x3e8442(0x185)][_0x16bf27];if(!_0x1fe6de)throw CliErrors[_0x3e8442(0x171)]('No\x20lock\x20entry\x20found\x20for\x20\x22'+_0x16bf27+'\x22.');await deleteBffScript(_0x1fe6de[_0x3e8442(0x183)]),delete _0x44b430[_0x3e8442(0x185)][_0x16bf27],_0x44b430['lastSync']=new Date()[_0x3e8442(0x18a)](),await writeBffLockFile(_0x219f64['lockFilePath'],_0x756fc7);const _0x405c05=resolveLocalFilePathFromLockKey(_0x219f64,_0x16bf27);let _0x1484af;await fileExists(_0x405c05)&&(_0x1484af=await moveToTrash(_0x219f64[_0x3e8442(0x172)],_0x219f64['trashDir'],_0x405c05),await cleanupEmptyDirectories(dirname(_0x405c05),_0x219f64[_0x3e8442(0x17d)]));await waitForDeleteSettlement(_0x219f64[_0x3e8442(0x178)],_0xd80449['appCode'],_0x16bf27,_0x405c05),await sleep(0x96);const _0x2794cc={'deleted':_0x16bf27,'remoteId':_0x1fe6de[_0x3e8442(0x183)]};if(_0x1484af)_0x2794cc['trashedTo']=_0x1484af;return{'ok':!![],'data':_0x2794cc,'message':_0x3e8442(0x17f)+_0x16bf27+(_0x1484af?_0x3e8442(0x18c):'')};}};function resolveDeleteTarget(_0x2d8890,_0x40a9ae){const _0x413b1f=a32_0x573b2e;if(_0x2d8890['includes']('/')){const _0x464e25=_0x40a9ae[_0x413b1f(0x16d)](_0x45b7f6=>_0x45b7f6===_0x2d8890);if(!_0x464e25)throw CliErrors[_0x413b1f(0x171)]('Function\x20not\x20found:\x20'+_0x2d8890);return _0x464e25;}const _0xa6c8f6=_0x40a9ae[_0x413b1f(0x17e)](_0x300b80=>_0x300b80['split']('/')['at'](-0x1)===_0x2d8890);if(_0xa6c8f6[_0x413b1f(0x163)]===0x0)throw CliErrors[_0x413b1f(0x171)]('Function\x20not\x20found:\x20'+_0x2d8890);if(_0xa6c8f6['length']>0x1)throw CliErrors['validation'](_0x413b1f(0x184)+_0x2d8890+_0x413b1f(0x181)+_0xa6c8f6['map'](_0x341bfb=>'\x20\x20-\x20'+_0x341bfb)[_0x413b1f(0x167)]('\x0a'));return _0xa6c8f6[0x0];}async function moveToTrash(_0x38fa49,_0x4264e1,_0x4652a8){const _0x4f2e17=a32_0x573b2e,_0x2f9479=new Date()[_0x4f2e17(0x18a)]()[_0x4f2e17(0x164)](/[:.]/g,'-'),_0x15720a=relative(_0x38fa49,_0x4652a8),_0x37e9df=join(_0x4264e1,_0x2f9479,_0x15720a);return await mkdir(dirname(_0x37e9df),{'recursive':!![]}),await rename(_0x4652a8,_0x37e9df),_0x37e9df;}async function cleanupEmptyDirectories(_0x47069d,_0x54da0a){const _0x46fefa=a32_0x573b2e;let _0x52e40b=resolve(_0x47069d);const _0x5303ae=resolve(_0x54da0a);while(_0x52e40b[_0x46fefa(0x176)](''+_0x5303ae+sep)||_0x52e40b===_0x5303ae){if(_0x52e40b===_0x5303ae)return;try{const _0x3322e0=await readdir(_0x52e40b);if(_0x3322e0[_0x46fefa(0x163)]>0x0)return;await rmdir(_0x52e40b);}catch{return;}_0x52e40b=dirname(_0x52e40b);}}function a32_0x1042(){const _0x350755=['Backend\x20Function\x20lock\x20file\x20not\x20found.','904932fPuCif','<timestamp>','\x22\x20not\x20found\x20after\x20ensureLockScope.','length','replace','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20trash','3282496CPhPeW','join','POST','5743026yvRxXs','No\x20lock\x20entry\x20found\x20for\x20\x22','string','/api/management/library/scripts/delete','find','35KOBFDL','delete','3jPzmda','validation','projectRoot','Would\x20delete\x20','scriptsRoot','Lock\x20key\x20(e.g.\x20ENDPOINT/createOrder)\x20or\x20short\x20function\x20name','startsWith','Delete\x20a\x20Backend\x20Function\x20script\x20from\x20remote\x20and\x20local','lockFilePath','491191QIQTfb','target','Local\x20delete\x20not\x20settled\x20for\x20','appCode','scriptsRootDir','filter','Deleted\x20','825596XMiTuY','\x22.\x20Use\x20the\x20full\x20lock\x20key:\x0a','bff','remoteId','Multiple\x20functions\x20match\x20\x22','functions','235092WYuJup','trashDir','Lock\x20scope\x20for\x20app\x20\x22','stringify','toISOString','Backend\x20Function\x20lock\x20file\x20not\x20found.\x20Run\x20`push`\x20or\x20`pull`\x20first\x20to\x20initialize\x20sync\x20state.','\x20(local\x20file\x20moved\x20to\x20trash)','apps','str','1957060VmYHep'];a32_0x1042=function(){return _0x350755;};return a32_0x1042();}const DELETE_SETTLE_RETRY_COUNT=0x14,DELETE_SETTLE_DELAY_MS=0x64;async function waitForDeleteSettlement(_0x5c42b7,_0x1fa139,_0x4f15a8,_0x5b610e){const _0x456ecb=a32_0x573b2e;for(let _0x35cbe4=0x0;_0x35cbe4<DELETE_SETTLE_RETRY_COUNT;_0x35cbe4+=0x1){const _0x491815=await readBffLockFile(_0x5c42b7),_0x40308e=!!_0x491815?.[_0x456ecb(0x18d)]?.[_0x1fa139]?.['functions']?.[_0x4f15a8],_0x56076b=await fileExists(_0x5b610e);if(!_0x40308e&&!_0x56076b)return;await sleep(DELETE_SETTLE_DELAY_MS);}throw new Error(_0x456ecb(0x17b)+_0x4f15a8+'.');}
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
- const a33_0x5b04d9=a33_0x331e;function a33_0x331e(_0x1acc84,_0x3873f4){_0x1acc84=_0x1acc84-0x9b;const _0x8825d7=a33_0x8825();let _0x331e55=_0x8825d7[_0x1acc84];return _0x331e55;}(function(_0xfb723b,_0xf63f03){const _0x45f92a=a33_0x331e,_0x2d6c28=_0xfb723b();while(!![]){try{const _0x44579a=parseInt(_0x45f92a(0xb2))/0x1+parseInt(_0x45f92a(0x9b))/0x2*(parseInt(_0x45f92a(0xb0))/0x3)+parseInt(_0x45f92a(0xa0))/0x4*(parseInt(_0x45f92a(0xac))/0x5)+parseInt(_0x45f92a(0xa3))/0x6+-parseInt(_0x45f92a(0xa4))/0x7*(-parseInt(_0x45f92a(0xa9))/0x8)+parseInt(_0x45f92a(0x9c))/0x9+-parseInt(_0x45f92a(0xa1))/0xa;if(_0x44579a===_0xf63f03)break;else _0x2d6c28['push'](_0x2d6c28['shift']());}catch(_0x670dfa){_0x2d6c28['push'](_0x2d6c28['shift']());}}}(a33_0x8825,0xd072e));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':'detail','description':'Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','risk':'read','flags':[{'name':'id','type':'number','required':!![],'description':a33_0x5b04d9(0x9d)},{'name':a33_0x5b04d9(0xa6),'type':a33_0x5b04d9(0xad),'description':a33_0x5b04d9(0x9e)}],async 'execute'(_0x3a2f32){const _0x52debd=a33_0x5b04d9,_0x1ff261=await getBffScriptInfo(_0x3a2f32[_0x52debd(0xaa)]('id')),_0x11ae0f=_0x3a2f32['bool'](_0x52debd(0xa6));if(_0x11ae0f)return{'ok':!![],'data':_0x1ff261};return{'ok':!![],'data':{'id':_0x1ff261['id'],'functionName':_0x1ff261[_0x52debd(0x9f)]??'','version':_0x1ff261[_0x52debd(0xa7)]??'','updateUserName':_0x1ff261[_0x52debd(0xa5)]??'','appCode':_0x1ff261[_0x52debd(0xa8)],'scriptType':_0x1ff261[_0x52debd(0xab)],'description':_0x1ff261[_0x52debd(0xb1)]||_0x52debd(0xaf),'createdTime':_0x1ff261[_0x52debd(0xae)]??'','updatedTime':_0x1ff261['updatedTime']??'','scriptContent':_0x1ff261[_0x52debd(0xa2)]??''}};}};function a33_0x8825(){const _0x5e5ea7=['description','138875FKVTVX','7094oOrBFC','7057170IQAbkU','Script\x20ID','Return\x20full\x20raw\x20script\x20object','functionName','73492HjkRdy','31807080sVjcen','scriptContent','8722734fqlviw','5822446XMqVHU','updateUserName','verbose','version','appCode','8THMoTu','num','scriptType','135bFMOqQ','boolean','createdTime','(none)','279rSOovz'];a33_0x8825=function(){return _0x5e5ea7;};return a33_0x8825();}
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(_0x147e1c,_0x5c9bf7){const _0x769d4f=a34_0x32a0,_0x252a5f=_0x147e1c();while(!![]){try{const _0x6bf821=-parseInt(_0x769d4f(0x11c))/0x1+-parseInt(_0x769d4f(0x123))/0x2*(-parseInt(_0x769d4f(0x11f))/0x3)+parseInt(_0x769d4f(0x11e))/0x4+parseInt(_0x769d4f(0x125))/0x5*(parseInt(_0x769d4f(0x122))/0x6)+-parseInt(_0x769d4f(0x11d))/0x7+parseInt(_0x769d4f(0x120))/0x8+-parseInt(_0x769d4f(0x121))/0x9*(-parseInt(_0x769d4f(0x124))/0xa);if(_0x6bf821===_0x5c9bf7)break;else _0x252a5f['push'](_0x252a5f['shift']());}catch(_0x2f788d){_0x252a5f['push'](_0x252a5f['shift']());}}}(a34_0x1c5a,0x638c3));import{bffList}from'../../commands/bff/list.js';function a34_0x32a0(_0x2b344b,_0x37cf08){_0x2b344b=_0x2b344b-0x11c;const _0x1c5a2d=a34_0x1c5a();let _0x32a0d0=_0x1c5a2d[_0x2b344b];return _0x32a0d0;}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a34_0x1c5a(){const _0x5985c9=['23319cPawRr','66mxEpvM','2fxjUeS','410cVPsmb','296695ZFYODI','490751YGjEjH','4627910SrPcSN','768356rpeZNr','573213yhbeMw','3340064EqLxbW'];a34_0x1c5a=function(){return _0x5985c9;};return a34_0x1c5a();}import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';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
- const a35_0x1f9e3f=a35_0x49d4;(function(_0x2d70b7,_0x4c330f){const _0xab0d57=a35_0x49d4,_0x5589fc=_0x2d70b7();while(!![]){try{const _0x17e938=-parseInt(_0xab0d57(0x140))/0x1*(-parseInt(_0xab0d57(0x14b))/0x2)+parseInt(_0xab0d57(0x13f))/0x3*(parseInt(_0xab0d57(0x130))/0x4)+-parseInt(_0xab0d57(0x13b))/0x5*(parseInt(_0xab0d57(0x144))/0x6)+-parseInt(_0xab0d57(0x141))/0x7*(parseInt(_0xab0d57(0x12f))/0x8)+-parseInt(_0xab0d57(0x131))/0x9+parseInt(_0xab0d57(0x12e))/0xa*(parseInt(_0xab0d57(0x137))/0xb)+parseInt(_0xab0d57(0x134))/0xc;if(_0x17e938===_0x4c330f)break;else _0x5589fc['push'](_0x5589fc['shift']());}catch(_0x3008a3){_0x5589fc['push'](_0x5589fc['shift']());}}}(a35_0x459d,0xf2f4f));function a35_0x49d4(_0x49009b,_0x770887){_0x49009b=_0x49009b-0x12e;const _0x459d8c=a35_0x459d();let _0x49d49b=_0x459d8c[_0x49009b];return _0x49d49b;}function a35_0x459d(){const _0x51516d=['bool','functionName','6MboJcS','2NAnWeX','10686907VEdFGm','read','string','839598uNEdLv','Return\x20full\x20script\x20objects','verbose','boolean','Script\x20type\x20filter','length','ENDPOINT','950970FZYEdh','COMMON','List\x20Backend\x20Function\x20scripts','5674630XNfPCf','8xAuwga','3369212qqOwCV','10347111XOvKuH','bff','description','398772JaXaDt','appCode','Filter\x20by\x20script\x20name','33CxQXOJ','map','str','type','25XaHIdL','name'];a35_0x459d=function(){return _0x51516d;};return a35_0x459d();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x1f9e3f(0x132),'command':'list','description':a35_0x1f9e3f(0x14d),'risk':a35_0x1f9e3f(0x142),'flags':[{'name':a35_0x1f9e3f(0x13a),'type':'string','description':a35_0x1f9e3f(0x148),'default':'ENDPOINT','enum':[a35_0x1f9e3f(0x14a),a35_0x1f9e3f(0x14c)]},{'name':a35_0x1f9e3f(0x13c),'type':a35_0x1f9e3f(0x143),'description':a35_0x1f9e3f(0x136)},{'name':a35_0x1f9e3f(0x146),'type':a35_0x1f9e3f(0x147),'description':a35_0x1f9e3f(0x145)}],async 'execute'(_0x8836b9){const _0x90140f=a35_0x1f9e3f,_0x4864c6=await listBffScripts(_0x8836b9[_0x90140f(0x135)],_0x8836b9[_0x90140f(0x139)](_0x90140f(0x13a)),{'scriptName':_0x8836b9[_0x90140f(0x139)](_0x90140f(0x13c))||undefined}),_0x3076e8=_0x8836b9[_0x90140f(0x13d)]('verbose');return{'ok':!![],'data':_0x3076e8?_0x4864c6:_0x4864c6[_0x90140f(0x138)](_0x20b189=>({'id':_0x20b189['id'],'functionName':_0x20b189[_0x90140f(0x13e)]??'','description':_0x20b189[_0x90140f(0x133)]||'(unnamed)','scriptType':_0x20b189['scriptType']})),'message':_0x4864c6[_0x90140f(0x149)]===0x0?'No\x20Backend\x20Function\x20scripts\x20found.':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_0xbe77b0=a36_0x3c7a;function a36_0x3c7a(_0x1a59ff,_0x35834f){_0x1a59ff=_0x1a59ff-0x18f;const _0x571525=a36_0x5715();let _0x3c7a8d=_0x571525[_0x1a59ff];return _0x3c7a8d;}(function(_0x1f8fff,_0x5323fe){const _0x7d721f=a36_0x3c7a,_0x574444=_0x1f8fff();while(!![]){try{const _0x3553b9=-parseInt(_0x7d721f(0x19a))/0x1*(parseInt(_0x7d721f(0x1b5))/0x2)+-parseInt(_0x7d721f(0x1d6))/0x3*(-parseInt(_0x7d721f(0x1a2))/0x4)+parseInt(_0x7d721f(0x1a6))/0x5*(-parseInt(_0x7d721f(0x1ab))/0x6)+parseInt(_0x7d721f(0x1ae))/0x7+-parseInt(_0x7d721f(0x197))/0x8+parseInt(_0x7d721f(0x1a4))/0x9*(-parseInt(_0x7d721f(0x1cf))/0xa)+-parseInt(_0x7d721f(0x1ad))/0xb*(-parseInt(_0x7d721f(0x1a8))/0xc);if(_0x3553b9===_0x5323fe)break;else _0x574444['push'](_0x574444['shift']());}catch(_0x351796){_0x574444['push'](_0x574444['shift']());}}}(a36_0x5715,0x4fe2e));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';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';function a36_0x5715(){const _0x1abf06=['parse','Pull\x20complete:\x20','string','/api/management/library/scripts/list?appCode=','version','message','filePath','Remote\x20script\x20missing\x20content.','yes','Lock\x20scope\x20for\x20app\x20\x22','appCode','cancelled','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','close','\x20skipped,\x20','type','str','alias','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','stringify','COMMON','HOOK','conflict','596540kkLqsH','functions','ENDPOINT','nonInteractive','Pull\x20only\x20this\x20script\x20type','all','toLowerCase','1480341cTrODM','length','boolean','lockKey','force','lockFilePath','unresolvable\x20target\x20path','&type=','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','datasetCode','read','3247448giXIql','would_pull','hookLocation','221043OwUjbv','Force\x20pull\x20cancelled.','functionName','push','\x20failed','stdin','utf8','toISOString','4UmRLFN','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','27SAvfsD','GET','5OLSkSU','includes','12895932fLHaug','validation','pull','2972298IkiiSo','scriptType','11YRRepA','1970276fNISWg','functionNode','operationType','scriptsRoot','skipped','scriptContent','question','4dJVgIl','bool','local\x20unsynced\x20changes'];a36_0x5715=function(){return _0x1abf06;};return a36_0x5715();}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a36_0xbe77b0(0x1aa),'description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':a36_0xbe77b0(0x196),'flags':[{'name':'type','type':a36_0xbe77b0(0x1ba),'description':a36_0xbe77b0(0x1d3),'enum':[a36_0xbe77b0(0x1cc),a36_0xbe77b0(0x1d1),a36_0xbe77b0(0x1cd)]},{'name':a36_0xbe77b0(0x190),'type':a36_0xbe77b0(0x1d8),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0xc41663){const _0x385332=a36_0xbe77b0,_0x35c7bb=loadBffProjectConfig(_0xc41663[_0x385332(0x1c2)]),_0x4d2436=await readBffLockFile(_0x35c7bb[_0x385332(0x191)]),{appLock:_0x453cd1}=ensureLockScope(_0x4d2436??createEmptyBffLock(),_0xc41663[_0x385332(0x1c2)],_0x35c7bb[_0x385332(0x1b1)],_0x385332(0x1aa)),_0x44aad7=normalizeBffType(_0xc41663[_0x385332(0x1c8)](_0x385332(0x1c7)))??undefined,_0x3d93c7=buildDatasetCodeToAliasMap(_0xc41663['apiDir'],_0xc41663[_0x385332(0x1c2)]),[_0x4b97c4,_0x25256a]=await Promise[_0x385332(0x1d4)]([listBffScripts(_0xc41663[_0x385332(0x1c2)],_0x44aad7),getBffScriptStatistics(_0xc41663['appCode'])]),_0x32c49b=createHookLocationMap(_0x25256a),_0x185d1d=[];for(const _0x1609a9 of _0x4b97c4){const _0x556c2c=resolveRemoteScriptTarget(_0x35c7bb,_0x1609a9,_0x32c49b,_0x453cd1[_0x385332(0x1d0)],_0x3d93c7);if(!_0x556c2c){_0x185d1d[_0x385332(0x19d)]({'scriptType':_0x1609a9['scriptType'],'functionName':_0x1609a9[_0x385332(0x19c)]??'','status':_0x385332(0x1b2),'reason':'unresolvable\x20target\x20path'});continue;}const _0x3a90fb=_0x453cd1[_0x385332(0x1d0)][_0x556c2c[_0x385332(0x18f)]],_0x10dcc1=_0x1609a9[_0x385332(0x1b3)]!=null?computeContentHash(_0x1609a9['scriptContent']):undefined,_0x58b51=await hasUnsyncedLocalChanges(_0x556c2c[_0x385332(0x1be)],_0x3a90fb,_0x10dcc1);_0x185d1d[_0x385332(0x19d)]({'lockKey':_0x556c2c['lockKey'],'filePath':_0x556c2c[_0x385332(0x1be)],'remoteId':_0x1609a9['id']??null,'status':_0x58b51?_0x385332(0x1ce):_0x385332(0x198)});}return{'method':_0x385332(0x1a5),'url':_0x385332(0x1bb)+_0xc41663['appCode']+(_0x44aad7?_0x385332(0x193)+_0x44aad7:''),'body':{'appCode':_0xc41663[_0x385332(0x1c2)],'filterType':_0x44aad7??null,'files':_0x185d1d},'description':'Would\x20inspect\x20'+_0x185d1d[_0x385332(0x1d7)]+_0x385332(0x1a3)};},async 'execute'(_0x2a45e9){const _0x4a5910=a36_0xbe77b0,_0x17d439=loadBffProjectConfig(_0x2a45e9['appCode']),_0x59e817=await readBffLockFile(_0x17d439[_0x4a5910(0x191)]),{lockData:_0x1ecaa5,appLock:_0x30b160}=ensureLockScope(_0x59e817??createEmptyBffLock(),_0x2a45e9[_0x4a5910(0x1c2)],_0x17d439[_0x4a5910(0x1b1)],'pull'),_0x5539b1=normalizeBffType(_0x2a45e9['str'](_0x4a5910(0x1c7)))??undefined;if(_0x2a45e9[_0x4a5910(0x1c8)](_0x4a5910(0x1c7))&&!_0x5539b1)throw CliErrors[_0x4a5910(0x1a9)](_0x4a5910(0x1ca));const [_0x47d73a,_0x1216a9]=await Promise[_0x4a5910(0x1d4)]([listBffScripts(_0x2a45e9[_0x4a5910(0x1c2)],_0x5539b1),getBffScriptStatistics(_0x2a45e9[_0x4a5910(0x1c2)])]);if(_0x47d73a['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4a5910(0x1c4)};const _0x3d2b73=_0x2a45e9[_0x4a5910(0x1b6)](_0x4a5910(0x190));if(_0x3d2b73&&!_0x2a45e9['nonInteractive']){const _0x116eb6=await confirmForce();if(!_0x116eb6)throw CliErrors[_0x4a5910(0x1c3)](_0x4a5910(0x19b));}if(_0x3d2b73&&_0x2a45e9[_0x4a5910(0x1d2)]){}const _0x2acf5d=buildDatasetCodeToAliasMap(_0x2a45e9['apiDir'],_0x2a45e9[_0x4a5910(0x1c2)]),_0x4ddf0c=createHookLocationMap(_0x1216a9),_0x597435=JSON[_0x4a5910(0x1b8)](JSON[_0x4a5910(0x1cb)](_0x1ecaa5)),_0x469609=_0x2a45e9[_0x4a5910(0x1c2)],_0x8e9aea=_0x597435['apps'][_0x469609];if(!_0x8e9aea)throw new Error(_0x4a5910(0x1c1)+_0x469609+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x34b945=[],_0xa281ac=[],_0x26fdef=[];for(const _0x2b4f96 of _0x47d73a){const _0xe0d50b=resolveRemoteScriptTarget(_0x17d439,_0x2b4f96,_0x4ddf0c,_0x30b160[_0x4a5910(0x1d0)],_0x2acf5d);if(!_0xe0d50b){_0xa281ac[_0x4a5910(0x19d)]({'lockKey':_0x2b4f96[_0x4a5910(0x1ac)]+'/'+_0x2b4f96['functionName'],'reason':_0x4a5910(0x192)});continue;}const _0x5a4806=_0x30b160[_0x4a5910(0x1d0)][_0xe0d50b[_0x4a5910(0x18f)]];try{if(!_0x2b4f96['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x2b4f96[_0x4a5910(0x1b3)]==null)throw new Error(_0x4a5910(0x1bf));const _0x13e88e=_0x2b4f96[_0x4a5910(0x1b3)],_0x4f0fd1=computeContentHash(_0x13e88e);if(!_0x3d2b73){const _0x504120=await hasUnsyncedLocalChanges(_0xe0d50b[_0x4a5910(0x1be)],_0x5a4806,_0x4f0fd1);if(_0x504120){_0xa281ac[_0x4a5910(0x19d)]({'lockKey':_0xe0d50b[_0x4a5910(0x18f)],'reason':_0x4a5910(0x1b7)});continue;}}await ensureParentDirectory(_0xe0d50b[_0x4a5910(0x1be)]),await writeFile(_0xe0d50b['filePath'],_0x13e88e,_0x4a5910(0x1a0));const _0x3f3bc4={'hash':_0x4f0fd1,'remoteId':_0x2b4f96['id'],'version':_0x2b4f96[_0x4a5910(0x1bc)]};_0xe0d50b[_0x4a5910(0x1c7)]===_0x4a5910(0x1cd)&&_0xe0d50b[_0x4a5910(0x199)]&&(_0x3f3bc4[_0x4a5910(0x1c9)]=_0xe0d50b[_0x4a5910(0x199)][_0x4a5910(0x1c9)],_0x3f3bc4[_0x4a5910(0x195)]=_0xe0d50b['hookLocation']['datasetCode'],_0x3f3bc4[_0x4a5910(0x1b0)]=_0xe0d50b[_0x4a5910(0x199)][_0x4a5910(0x1b0)],_0x3f3bc4[_0x4a5910(0x1af)]=_0xe0d50b[_0x4a5910(0x199)][_0x4a5910(0x1af)]),_0x8e9aea[_0x4a5910(0x1d0)][_0xe0d50b[_0x4a5910(0x18f)]]=_0x3f3bc4,_0x34b945[_0x4a5910(0x19d)]({'lockKey':_0xe0d50b[_0x4a5910(0x18f)],'remoteId':_0x2b4f96['id']});}catch(_0x59bd32){_0x26fdef[_0x4a5910(0x19d)]({'lockKey':_0xe0d50b[_0x4a5910(0x18f)],'error':_0x59bd32 instanceof Error?_0x59bd32[_0x4a5910(0x1bd)]:String(_0x59bd32)});}}return _0x8e9aea['lastSync']=new Date()[_0x4a5910(0x1a1)](),await writeBffLockFile(_0x17d439[_0x4a5910(0x191)],_0x597435),{'ok':_0x26fdef[_0x4a5910(0x1d7)]===0x0,'data':{'pulled':_0x34b945,'skipped':_0xa281ac,'failed':_0x26fdef},'message':_0x4a5910(0x1b9)+_0x34b945[_0x4a5910(0x1d7)]+'\x20pulled,\x20'+_0xa281ac['length']+_0x4a5910(0x1c6)+_0x26fdef[_0x4a5910(0x1d7)]+_0x4a5910(0x19e)};}};async function hasUnsyncedLocalChanges(_0x42e6e7,_0x3c8786,_0x1be440){if(!await fileExists(_0x42e6e7))return![];const _0x154195=await computeFileHash(_0x42e6e7);if(!_0x3c8786)return _0x1be440?_0x154195!==_0x1be440:!![];return _0x154195!==_0x3c8786['hash'];}function buildDatasetCodeToAliasMap(_0x3faf8d,_0x38b0aa){const _0x131919=a36_0xbe77b0,_0x176318=loadAliasMap(_0x3faf8d,undefined,resolveApiFilePath(_0x3faf8d,_0x38b0aa));return new Map(_0x176318['map'](_0x4c8073=>[_0x4c8073[_0x131919(0x195)],_0x4c8073[_0x131919(0x1c9)]]));}async function confirmForce(){const _0x4c7990=a36_0xbe77b0,_0x1d01c6=createInterface({'input':process[_0x4c7990(0x19f)],'output':process['stderr']}),_0x222ca2=await new Promise(_0x786274=>{const _0x455357=_0x4c7990;_0x1d01c6[_0x455357(0x1b4)](_0x455357(0x194),_0x786274);});return _0x1d01c6[_0x4c7990(0x1c5)](),['y',_0x4c7990(0x1c0)][_0x4c7990(0x1a7)](_0x222ca2['trim']()[_0x4c7990(0x1d5)]());}
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_0xe8d9c4=a37_0x4c43;(function(_0x19db58,_0x5c0f52){const _0x2271d7=a37_0x4c43,_0x564e6c=_0x19db58();while(!![]){try{const _0x56b263=parseInt(_0x2271d7(0x18f))/0x1+-parseInt(_0x2271d7(0x1c0))/0x2*(parseInt(_0x2271d7(0x172))/0x3)+parseInt(_0x2271d7(0x199))/0x4*(parseInt(_0x2271d7(0x1a6))/0x5)+parseInt(_0x2271d7(0x1bc))/0x6+-parseInt(_0x2271d7(0x1b1))/0x7*(-parseInt(_0x2271d7(0x1b2))/0x8)+parseInt(_0x2271d7(0x1ac))/0x9*(parseInt(_0x2271d7(0x179))/0xa)+-parseInt(_0x2271d7(0x17d))/0xb;if(_0x56b263===_0x5c0f52)break;else _0x564e6c['push'](_0x564e6c['shift']());}catch(_0x1c9789){_0x564e6c['push'](_0x564e6c['shift']());}}}(a37_0x2b4a,0xb5b96));import{readFile}from'node:fs/promises';function a37_0x2b4a(){const _0x4bb915=['remoteId','204280ixoUnv','datasetId','force','runtime\x20cache\x20cleared','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','bool','set','datasetCode','ENDPOINT','aliasToDatasetCode','script','would_push','\x20failed,\x20','110MkvzJH','boolean','validation','write','Force\x20push\x20ignoring\x20hash\x20protection','has','5815089rJSGpY','join','functionNode','push','scriptsRoot','140TEovCp','421936plRWjw','code','version','unchanged','description','runtime\x20cache\x20not\x20needed','get','Push\x20only\x20this\x20script\x20type','parse','\x22.\x20','7194642pIgMJS','stringify','length','lockFilePath','2645782CKRbCa','/api/management/library/scripts/save','Lock\x20scope\x20for\x20app\x20\x22','3WDqpMj','map','bff','HOOK','datasetCodeToDataset','name','functions','10uhAnRU','utf8','every','Would\x20inspect\x20','25400991KzHUQT','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','lastSync','update','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','string','Push\x20complete:\x20','status','filePath','apps','operationType','No\x20local\x20Backend\x20Function\x20scripts\x20found.','Local\x20function\x20not\x20found:\x20','hash','type','\x20skipped,\x20','alias','attempted','352806zYpvzH',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','create','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','lockKey','appCode','COMMON','toISOString','message'];a37_0x2b4a=function(){return _0x4bb915;};return a37_0x2b4a();}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';function a37_0x4c43(_0x5c3270,_0x57dd83){_0x5c3270=_0x5c3270-0x172;const _0x2b4a86=a37_0x2b4a();let _0x4c43ec=_0x2b4a86[_0x5c3270];return _0x4c43ec;}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':a37_0xe8d9c4(0x174),'command':a37_0xe8d9c4(0x1af),'description':a37_0xe8d9c4(0x17e),'risk':a37_0xe8d9c4(0x1a9),'flags':[{'name':a37_0xe8d9c4(0x18b),'type':a37_0xe8d9c4(0x182),'description':a37_0xe8d9c4(0x1b9),'enum':[a37_0xe8d9c4(0x195),a37_0xe8d9c4(0x1a1),'HOOK']},{'name':'name','type':a37_0xe8d9c4(0x182),'description':a37_0xe8d9c4(0x19d)},{'name':a37_0xe8d9c4(0x19b),'type':a37_0xe8d9c4(0x1a7),'description':a37_0xe8d9c4(0x1aa)}],async 'dryRun'(_0x461a87){const _0x244a16=a37_0xe8d9c4,_0x79479f=loadBffProjectConfig(_0x461a87[_0x244a16(0x194)]),_0x43eeb9=await readBffLockFile(_0x79479f[_0x244a16(0x1bf)]),{appLock:_0x1ac7ca}=ensureLockScope(_0x43eeb9??createEmptyBffLock(),_0x461a87[_0x244a16(0x194)],_0x79479f[_0x244a16(0x1b0)],_0x244a16(0x1af)),_0x4f9fac=await getTargetFunctions(_0x79479f,_0x461a87),_0x31b302=_0x461a87['bool'](_0x244a16(0x19b)),_0x294b75=[];for(const _0x37f2c4 of _0x4f9fac){const _0x424a1a=await computeFileHash(_0x37f2c4[_0x244a16(0x185)]),_0x468c6f=_0x1ac7ca[_0x244a16(0x178)][_0x37f2c4[_0x244a16(0x193)]],_0x37be77=!!_0x468c6f&&_0x468c6f[_0x244a16(0x18a)]===_0x424a1a,_0x10d48a=!_0x31b302&&_0x37be77?_0x244a16(0x1b5):_0x244a16(0x1a4);_0x294b75[_0x244a16(0x1af)]({'lockKey':_0x37f2c4[_0x244a16(0x193)],'filePath':_0x37f2c4[_0x244a16(0x185)],'remoteId':_0x468c6f?.[_0x244a16(0x198)]??null,'mode':_0x468c6f?.['remoteId']?_0x244a16(0x180):_0x244a16(0x191),'status':_0x10d48a});}return{'method':'POST','url':_0x244a16(0x1c1),'body':{'appCode':_0x461a87['appCode'],'force':_0x31b302,'files':_0x294b75,'cacheClearAtRuntime':_0x294b75['some'](_0x1b305c=>_0x1b305c['status']===_0x244a16(0x1a4)),'cacheClearAtRuntimeTimes':_0x294b75['some'](_0x13e5aa=>_0x13e5aa[_0x244a16(0x184)]===_0x244a16(0x1a4))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x244a16(0x17c)+_0x294b75[_0x244a16(0x1be)]+_0x244a16(0x192)};},async 'execute'(_0x4d42f7){const _0xa1d88c=a37_0xe8d9c4,_0x52b123=loadBffProjectConfig(_0x4d42f7[_0xa1d88c(0x194)]),_0x1175d9=await readBffLockFile(_0x52b123[_0xa1d88c(0x1bf)]),{lockData:_0x4eb37a,appLock:_0x221ac8}=ensureLockScope(_0x1175d9??createEmptyBffLock(),_0x4d42f7['appCode'],_0x52b123[_0xa1d88c(0x1b0)],'push'),_0x196832=await getTargetFunctions(_0x52b123,_0x4d42f7);if(_0x196832[_0xa1d88c(0x1be)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xa1d88c(0x188)};const _0x17c409=_0x4d42f7[_0xa1d88c(0x19e)](_0xa1d88c(0x19b)),_0x5b1c4d=JSON[_0xa1d88c(0x1ba)](JSON[_0xa1d88c(0x1bd)](_0x4eb37a)),_0x31c807=_0x5b1c4d[_0xa1d88c(0x186)][_0x4d42f7['appCode']];if(!_0x31c807)throw new Error(_0xa1d88c(0x1c2)+_0x4d42f7[_0xa1d88c(0x194)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x5f4b35=await buildHookMaps(_0x4d42f7['appCode'],_0x4d42f7['apiDir'],_0x196832,_0x31c807),_0x142fa8=[],_0x2ba67b=[],_0x510817=[];for(const _0x18d3b1 of _0x196832){const _0x11ec18=await computeFileHash(_0x18d3b1[_0xa1d88c(0x185)]),_0x158b01=_0x31c807['functions'][_0x18d3b1[_0xa1d88c(0x193)]];if(!_0x17c409&&_0x158b01&&_0x158b01[_0xa1d88c(0x18a)]===_0x11ec18){_0x2ba67b[_0xa1d88c(0x1af)]({'lockKey':_0x18d3b1['lockKey'],'reason':_0xa1d88c(0x1b5)});continue;}try{await uploadSingleFunction(_0x4d42f7[_0xa1d88c(0x194)],_0x18d3b1,_0x31c807,_0x5f4b35);const _0x5eaae7=_0x31c807[_0xa1d88c(0x178)][_0x18d3b1['lockKey']];_0x142fa8[_0xa1d88c(0x1af)]({'lockKey':_0x18d3b1[_0xa1d88c(0x193)],'remoteId':_0x5eaae7?.[_0xa1d88c(0x198)]??0x0});}catch(_0x23a0c2){_0x510817['push']({'lockKey':_0x18d3b1[_0xa1d88c(0x193)],'error':_0x23a0c2 instanceof Error?_0x23a0c2[_0xa1d88c(0x197)]:String(_0x23a0c2)});}}_0x31c807[_0xa1d88c(0x17f)]=new Date()[_0xa1d88c(0x196)](),await writeBffLockFile(_0x52b123[_0xa1d88c(0x1bf)],_0x5b1c4d),await waitForUploadedLockEntries(_0x52b123[_0xa1d88c(0x1bf)],_0x4d42f7[_0xa1d88c(0x194)],_0x142fa8['map'](_0xd16274=>_0xd16274[_0xa1d88c(0x193)]));let _0x10d040={'attempted':![],'cleared':![]};if(_0x142fa8[_0xa1d88c(0x1be)]>0x0)try{let _0x3af3fa='';for(let _0x28c313=0x0;_0x28c313<CACHE_CLEAR_ATTEMPTS;_0x28c313+=0x1){_0x3af3fa=await clearBffScriptCache(),_0x28c313<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x10d040={'attempted':!![],'cleared':!![],'message':_0x3af3fa||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x181489){_0x10d040={'attempted':!![],'cleared':![],'error':_0x181489 instanceof Error?_0x181489['message']:String(_0x181489)};}const _0x266ba5=_0x510817[_0xa1d88c(0x1be)]===0x0&&(_0x10d040[_0xa1d88c(0x18e)]?_0x10d040['cleared']:!![]),_0x5d834b=_0x266ba5,_0x56be2f=_0x10d040['attempted']?_0x10d040['cleared']?_0xa1d88c(0x19c):'runtime\x20cache\x20clear\x20failed':_0xa1d88c(0x1b7);return{'ok':_0x5d834b,'data':{'uploaded':_0x142fa8,'skipped':_0x2ba67b,'failed':_0x510817,'cacheClear':_0x10d040},'message':_0xa1d88c(0x183)+_0x142fa8[_0xa1d88c(0x1be)]+'\x20uploaded,\x20'+_0x2ba67b[_0xa1d88c(0x1be)]+_0xa1d88c(0x18c)+_0x510817['length']+_0xa1d88c(0x1a5)+_0x56be2f};}};async function getTargetFunctions(_0x11fb30,_0x58a5fb){const _0x47fcd1=a37_0xe8d9c4,_0x46e19a=_0x58a5fb['str']('type'),_0x3ac20e=_0x58a5fb['str'](_0x47fcd1(0x177)),_0xef9952=normalizeBffType(_0x46e19a)??undefined;if(_0x3ac20e&&!_0xef9952)throw CliErrors['validation'](_0x47fcd1(0x181));const _0x2345a3=await scanLocalBffFunctions(_0x11fb30,_0xef9952);if(_0x3ac20e){const _0x4a63ac=_0x2345a3['filter'](_0x36c2ee=>_0x36c2ee[_0x47fcd1(0x177)]===_0x3ac20e);if(_0x4a63ac['length']===0x0)throw CliErrors[_0x47fcd1(0x1a8)](_0x47fcd1(0x189)+_0xef9952+'/'+_0x3ac20e);return _0x4a63ac;}return _0x2345a3;}async function buildHookMaps(_0x546de3,_0x21d0a3,_0x2ea399,_0x14b329){const _0x5f3923=a37_0xe8d9c4,_0x4bbfdd=_0x2ea399['some'](_0x4f27ef=>_0x4f27ef[_0x5f3923(0x18b)]===_0x5f3923(0x175));if(!_0x4bbfdd)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x5b1a22=loadAliasMap(_0x21d0a3,undefined,resolveApiFilePath(_0x21d0a3,_0x546de3)),_0x1e71ab=new Map(_0x5b1a22['map'](_0x4c7b26=>[_0x4c7b26[_0x5f3923(0x18d)],_0x4c7b26[_0x5f3923(0x1a0)]]));for(const _0x37b931 of Object['values'](_0x14b329[_0x5f3923(0x178)])){_0x37b931[_0x5f3923(0x18d)]&&_0x37b931[_0x5f3923(0x1a0)]&&!_0x1e71ab[_0x5f3923(0x1ab)](_0x37b931[_0x5f3923(0x18d)])&&_0x1e71ab[_0x5f3923(0x19f)](_0x37b931[_0x5f3923(0x18d)],_0x37b931['datasetCode']);}const _0x31b180=await listDatasets(_0x546de3),_0x1855ed=new Map(_0x31b180[_0x5f3923(0x173)](_0x221f01=>[_0x221f01[_0x5f3923(0x1b3)],_0x221f01]));return{'aliasToDatasetCode':_0x1e71ab,'datasetCodeToDataset':_0x1855ed};}async function uploadSingleFunction(_0x1d8e6f,_0x41c967,_0x323977,_0x2f1e7b){const _0x59ef0e=a37_0xe8d9c4,_0x14ee66=await readFile(_0x41c967[_0x59ef0e(0x185)],_0x59ef0e(0x17a)),_0x1bbfe1=await computeFileHash(_0x41c967[_0x59ef0e(0x185)]),_0x4fab64=_0x323977['functions'][_0x41c967[_0x59ef0e(0x193)]];if(_0x4fab64?.['remoteId']&&_0x4fab64[_0x59ef0e(0x1b4)]==null)throw CliErrors[_0x59ef0e(0x1a8)](_0x41c967[_0x59ef0e(0x193)]+_0x59ef0e(0x190));let _0x41a3a2=extractScriptDescription(_0x14ee66);if(!_0x41a3a2&&_0x4fab64?.[_0x59ef0e(0x198)]){const _0x58a93f=await getBffScriptInfo(_0x4fab64[_0x59ef0e(0x198)]);_0x41a3a2=_0x58a93f[_0x59ef0e(0x1b6)]||undefined;}const _0x588a26={'appCode':_0x1d8e6f,'functionName':_0x41c967['name'],'scriptType':_0x41c967['type'],'scriptContent':_0x14ee66};if(_0x4fab64?.[_0x59ef0e(0x198)])_0x588a26['id']=_0x4fab64['remoteId'];if(_0x4fab64?.['version']!=null)_0x588a26[_0x59ef0e(0x1b4)]=_0x4fab64[_0x59ef0e(0x1b4)];if(_0x41a3a2)_0x588a26[_0x59ef0e(0x1b6)]=_0x41a3a2;if(_0x41c967[_0x59ef0e(0x18b)]==='HOOK'){const _0x44a1a3=_0x41c967[_0x59ef0e(0x18d)];if(!_0x44a1a3||!_0x41c967[_0x59ef0e(0x187)]||!_0x41c967[_0x59ef0e(0x1ae)])throw CliErrors[_0x59ef0e(0x1a8)]('Incomplete\x20HOOK\x20path:\x20'+_0x41c967[_0x59ef0e(0x193)]);const _0x3e136b=_0x2f1e7b[_0x59ef0e(0x1a2)]['get'](_0x44a1a3)??_0x4fab64?.[_0x59ef0e(0x1a0)]??_0x44a1a3,_0x278275=_0x2f1e7b[_0x59ef0e(0x176)]['get'](_0x3e136b);if(!_0x278275)throw CliErrors[_0x59ef0e(0x1a8)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x44a1a3+_0x59ef0e(0x1bb)+('Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x588a26[_0x59ef0e(0x19a)]=_0x278275['id'],_0x588a26[_0x59ef0e(0x187)]=_0x41c967[_0x59ef0e(0x187)],_0x588a26['functionNode']=_0x41c967[_0x59ef0e(0x1ae)];}const _0x4d1ae4=await saveBffScript(_0x588a26),_0x55f384=_0x4d1ae4['id'],_0x2a1618=_0x4d1ae4[_0x59ef0e(0x1a3)]??await getBffScriptInfo(_0x55f384),_0xbd5c2d={'hash':_0x1bbfe1,'remoteId':_0x55f384,'version':_0x2a1618[_0x59ef0e(0x1b4)]};if(_0x41c967[_0x59ef0e(0x18b)]==='HOOK'){const _0x353cc5=_0x41c967[_0x59ef0e(0x18d)],_0x41d41d=_0x2f1e7b[_0x59ef0e(0x1a2)][_0x59ef0e(0x1b8)](_0x353cc5)??_0x4fab64?.['datasetCode']??_0x353cc5;_0x2f1e7b[_0x59ef0e(0x1a2)][_0x59ef0e(0x1ab)](_0x353cc5)?_0xbd5c2d['alias']=_0x353cc5:_0xbd5c2d[_0x59ef0e(0x18d)]=_0x4fab64?.['alias'],_0xbd5c2d['datasetCode']=_0x41d41d,_0xbd5c2d[_0x59ef0e(0x187)]=_0x41c967[_0x59ef0e(0x187)],_0xbd5c2d[_0x59ef0e(0x1ae)]=_0x41c967[_0x59ef0e(0x1ae)];}_0x323977[_0x59ef0e(0x178)][_0x41c967[_0x59ef0e(0x193)]]=_0xbd5c2d;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1480d7,_0x26ff6c,_0x4152ba){const _0x2aa164=a37_0xe8d9c4;if(_0x4152ba['length']===0x0)return;for(let _0x1f7cca=0x0;_0x1f7cca<LOCK_SETTLE_RETRY_COUNT;_0x1f7cca+=0x1){const _0xb77961=await readBffLockFile(_0x1480d7),_0x3420ce=_0xb77961?.[_0x2aa164(0x186)]?.[_0x26ff6c]?.['functions']??{},_0x2ef154=_0x4152ba[_0x2aa164(0x17b)](_0x4b0465=>!!_0x3420ce[_0x4b0465]?.[_0x2aa164(0x198)]);if(_0x2ef154)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x4152ba[_0x2aa164(0x1ad)](',\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
- function a38_0x3453(_0x164498,_0x573cb7){_0x164498=_0x164498-0x94;const _0x3f2f95=a38_0x3f2f();let _0x345316=_0x3f2f95[_0x164498];return _0x345316;}const a38_0x5f15ff=a38_0x3453;(function(_0x4fa31e,_0x3787e8){const _0x450d7b=a38_0x3453,_0x3924a2=_0x4fa31e();while(!![]){try{const _0x271610=-parseInt(_0x450d7b(0xac))/0x1+parseInt(_0x450d7b(0xae))/0x2+-parseInt(_0x450d7b(0xa1))/0x3+-parseInt(_0x450d7b(0xaa))/0x4+parseInt(_0x450d7b(0xa2))/0x5+parseInt(_0x450d7b(0xa7))/0x6+parseInt(_0x450d7b(0x97))/0x7*(parseInt(_0x450d7b(0x9c))/0x8);if(_0x271610===_0x3787e8)break;else _0x3924a2['push'](_0x3924a2['shift']());}catch(_0x4debf6){_0x3924a2['push'](_0x3924a2['shift']());}}}(a38_0x3f2f,0x46e71));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';function a38_0x3f2f(){const _0x5b68fc=['983664YmeyYN','21655KVkgdb','alias','appCode','\x20remote-only','lockKey','1635840SQJUcM','boolean','datasetCode','549968bhbtFb','bool','536506DEJBmb','hash','393104dmGyOe','functions','length','\x20modified,\x20','lockFilePath','read','70SfZLnW','map','remote','apiDir','all','655024hkLUcj','bff','push','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','status'];a38_0x3f2f=function(){return _0x5b68fc;};return a38_0x3f2f();}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x5f15ff(0x9d),'command':a38_0x5f15ff(0xa0),'description':'Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','risk':a38_0x5f15ff(0x96),'flags':[{'name':a38_0x5f15ff(0x99),'type':a38_0x5f15ff(0xa8),'description':a38_0x5f15ff(0x9f)}],async 'execute'(_0x3fb5b8){const _0x2c63e5=a38_0x5f15ff,_0xd36b0=loadBffProjectConfig(_0x3fb5b8[_0x2c63e5(0xa4)]),_0x5d2d6a=await readBffLockFile(_0xd36b0[_0x2c63e5(0x95)]),{appLock:_0x29ae8f}=ensureLockScope(_0x5d2d6a??createEmptyBffLock(),_0x3fb5b8[_0x2c63e5(0xa4)],_0xd36b0['scriptsRoot'],_0x2c63e5(0xa0)),_0x5e5629=await scanLocalBffFunctions(_0xd36b0),_0xf7eec7=[],_0x975eea=[],_0x3f2daa=[];for(const _0x2c6fcd of _0x5e5629){const _0x6cfb32=await computeFileHash(_0x2c6fcd['filePath']),_0x27b44f=_0x29ae8f['functions'][_0x2c6fcd[_0x2c63e5(0xa6)]];if(!_0x27b44f)_0xf7eec7[_0x2c63e5(0x9e)](_0x2c6fcd['lockKey']);else _0x27b44f[_0x2c63e5(0xad)]!==_0x6cfb32?_0x975eea['push'](_0x2c6fcd['lockKey']):_0x3f2daa[_0x2c63e5(0x9e)](_0x2c6fcd[_0x2c63e5(0xa6)]);}const _0x3d424c=[];if(_0x3fb5b8[_0x2c63e5(0xab)](_0x2c63e5(0x99))){const _0x2079e4=loadAliasMap(_0x3fb5b8[_0x2c63e5(0x9a)],undefined,resolveApiFilePath(_0x3fb5b8[_0x2c63e5(0x9a)],_0x3fb5b8['appCode'])),_0xe18096=new Map(_0x2079e4['map'](_0x121984=>[_0x121984[_0x2c63e5(0xa9)],_0x121984[_0x2c63e5(0xa3)]])),[_0x8b0465,_0x2a38eb]=await Promise[_0x2c63e5(0x9b)]([listBffScripts(_0x3fb5b8[_0x2c63e5(0xa4)]),getBffScriptStatistics(_0x3fb5b8['appCode'])]),_0x573e6c=createHookLocationMap(_0x2a38eb),_0xb0ca44=new Set(_0x5e5629[_0x2c63e5(0x98)](_0x46ad88=>_0x46ad88['lockKey']));for(const _0x4d0331 of _0x8b0465){const _0xe6f810=resolveRemoteScriptTarget(_0xd36b0,_0x4d0331,_0x573e6c,_0x29ae8f[_0x2c63e5(0xaf)],_0xe18096);_0xe6f810&&!_0xb0ca44['has'](_0xe6f810[_0x2c63e5(0xa6)])&&_0x3d424c['push'](_0xe6f810['lockKey']);}}const _0x154b2b=_0xf7eec7[_0x2c63e5(0xb0)]===0x0&&_0x975eea[_0x2c63e5(0xb0)]===0x0&&_0x3d424c[_0x2c63e5(0xb0)]===0x0;return{'ok':!![],'data':{'added':_0xf7eec7,'modified':_0x975eea,'unchanged':_0x3f2daa,'remoteOnly':_0x3d424c},'message':_0x154b2b?'All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.':_0xf7eec7[_0x2c63e5(0xb0)]+'\x20added,\x20'+_0x975eea['length']+_0x2c63e5(0x94)+_0x3f2daa['length']+'\x20unchanged'+(_0x3d424c[_0x2c63e5(0xb0)]>0x0?',\x20'+_0x3d424c[_0x2c63e5(0xb0)]+_0x2c63e5(0xa5):'')};}};
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
- (function(_0x5e7af5,_0x5ca588){const _0x3325a7=a39_0x4e2f,_0x108eff=_0x5e7af5();while(!![]){try{const _0x48943a=-parseInt(_0x3325a7(0xee))/0x1*(-parseInt(_0x3325a7(0xed))/0x2)+parseInt(_0x3325a7(0xde))/0x3+-parseInt(_0x3325a7(0xeb))/0x4*(parseInt(_0x3325a7(0xf1))/0x5)+parseInt(_0x3325a7(0xe6))/0x6+parseInt(_0x3325a7(0xe0))/0x7*(parseInt(_0x3325a7(0xea))/0x8)+-parseInt(_0x3325a7(0xe1))/0x9+-parseInt(_0x3325a7(0xe3))/0xa;if(_0x48943a===_0x5ca588)break;else _0x108eff['push'](_0x108eff['shift']());}catch(_0x2b4114){_0x108eff['push'](_0x108eff['shift']());}}}(a39_0x5abf,0x59662));function a39_0x4e2f(_0x42b1aa,_0x3b9189){_0x42b1aa=_0x42b1aa-0xd7;const _0x5abfb0=a39_0x5abf();let _0x4e2fd6=_0x5abfb0[_0x42b1aa];return _0x4e2fd6;}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':'Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x55ee24){const _0x187430=a39_0x4e2f;logger[_0x187430(0xf2)](process[_0x187430(0xec)]()),logger[_0x187430(0xdf)]('cli-skill-install',_0x187430(0xdc));const _0x391b66=installBuiltinSkill({'stdio':_0x55ee24[_0x187430(0xe2)]?'pipe':_0x187430(0xdb)});if(!_0x391b66['ok'])throw CliErrors[_0x187430(0xd7)](_0x187430(0xdd)+_0x391b66['code']+']:\x20'+(_0x391b66[_0x187430(0xe5)]||'unknown'),_0x187430(0xd9)+_0x391b66[_0x187430(0xe9)]);return console[_0x187430(0xf0)](_0x391b66['changed']?'CLI\x20Built-in\x20Skill\x20'+_0x391b66[_0x187430(0xef)]+_0x187430(0xe4)+(_0x391b66[_0x187430(0xda)]?_0x187430(0xe7)+_0x391b66[_0x187430(0xda)]:'\x20via\x20skills@latest'):_0x187430(0xd8)+_0x391b66[_0x187430(0xef)]+_0x187430(0xe8)+(_0x391b66[_0x187430(0xda)]?_0x187430(0xe7)+_0x391b66['installedPath']:'')),{'ok':!![]};}}];function a39_0x5abf(){const _0x2fd663=['repairCommand','84880jPJaRI','342552BeQrcz','cwd','56vTaSIz','575JRWzDZ','skillVersion','log','25aogyHf','setLogPath','apiError','CLI\x20Built-in\x20Skill\x20','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','installedPath','inherit','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','Built-in\x20Skill\x20install\x20failed\x20[','2018031AhgplI','info','287WTXYwW','1503342xYhasW','nonInteractive','4318970pKHzbl','\x20installed','error','1617096XsQpEE','\x20at\x20','\x20is\x20already\x20current'];a39_0x5abf=function(){return _0x2fd663;};return a39_0x5abf();}
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_0x599362=a40_0x3b3c;(function(_0x149f5b,_0x4f28ce){const _0x2bdaff=a40_0x3b3c,_0xea03f=_0x149f5b();while(!![]){try{const _0x29b58c=parseInt(_0x2bdaff(0x16d))/0x1+-parseInt(_0x2bdaff(0x16b))/0x2+-parseInt(_0x2bdaff(0x16e))/0x3*(parseInt(_0x2bdaff(0x163))/0x4)+parseInt(_0x2bdaff(0x120))/0x5+parseInt(_0x2bdaff(0x16c))/0x6*(-parseInt(_0x2bdaff(0x15e))/0x7)+-parseInt(_0x2bdaff(0x160))/0x8+parseInt(_0x2bdaff(0x12b))/0x9*(parseInt(_0x2bdaff(0x169))/0xa);if(_0x29b58c===_0x4f28ce)break;else _0xea03f['push'](_0xea03f['shift']());}catch(_0x56c444){_0xea03f['push'](_0xea03f['shift']());}}}(a40_0x2193,0x60e86));import a40_0x4b4472 from'chalk';function a40_0x2193(){const _0xd47ae7=['1120fRnWLg','state','2911624xTmFut','green','string','128EqUMqY','\x20→\x20','Update\x20available:\x20','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Already\x20on\x20requested\x20version\x20(v','boolean','5150njYFPP','...','221734QgHBbx','1842kvAveJ','268019jrwKmY','11499xcZBMT','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20is\x20up\x20to\x20date.',',\x20then\x20verify\x20with:\x20','entries','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','read','yellow','str','3720480tPgSYV','Current\x20version\x20v','length','trim','Updated\x20to\x20v','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','start',']:\x20','\x20is\x20newer\x20than\x20npm\x20latest\x20v','expected\x20','549zhEfJJ','info','Install\x20a\x20specific\x20CLI\x20version','filter','run','latest','https://registry.npmjs.org/-/package/','Beta\x20version:\x20','Version\x20comparison\x20failed','install','bool','execPath',',\x20state\x20','pipe','fromEntries','\x20\x20Try\x20manually:\x20','npm','current','succeed','includes','toLowerCase','Checking\x20CLI\x20Built-in\x20Skill...','beta',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','slice','red','\x20doctor','bun','object','Requested\x20version:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20','repairCommand','skillVersion','source','error','Run:\x20','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','apiError','gray','Updating\x20via\x20',',\x20found\x20','valid','/dist-tags','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','code','Current\x20version:\x20','fail','version','validation','message','log'];a40_0x2193=function(){return _0xd47ae7;};return a40_0x2193();}import a40_0x5ab40d from'ora';import a40_0x167437 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';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0xaa9259=a40_0x3b3c;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0xaa9259(0x143)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x42b2d5=a40_0x3b3c,_0x2166c=process[_0x42b2d5(0x136)][_0x42b2d5(0x13f)]();if(_0x2166c[_0x42b2d5(0x13e)](_0x42b2d5(0x146)))return _0x42b2d5(0x146);return _0x42b2d5(0x13b);}const updateFlags=[{'name':a40_0x599362(0x141),'type':a40_0x599362(0x168),'description':a40_0x599362(0x118),'default':![]},{'name':a40_0x599362(0x15a),'type':a40_0x599362(0x162),'description':a40_0x599362(0x12d)}];function getRequestedVersion(_0x256f3c){const _0x272256=a40_0x599362;return _0x256f3c[_0x272256(0x11f)](_0x272256(0x15a))[_0x272256(0x123)]();}async function validateUpdateFlags(_0x3e7794){const _0x418aae=a40_0x599362,_0x2e612c=_0x3e7794[_0x418aae(0x135)]('beta'),_0x15454f=getRequestedVersion(_0x3e7794);if(_0x2e612c&&_0x15454f)throw CliErrors[_0x418aae(0x15b)](_0x418aae(0x166),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x15454f&&!a40_0x167437[_0x418aae(0x154)](_0x15454f))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x15454f,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x55bdc0=a40_0x599362;try{const _0x42c605=await fetch(_0x55bdc0(0x131)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x55bdc0(0x155),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x42c605['ok'])return null;const _0x31cc5e=await _0x42c605['json']();if(!_0x31cc5e||typeof _0x31cc5e!==_0x55bdc0(0x147))return null;return Object[_0x55bdc0(0x139)](Object[_0x55bdc0(0x11b)](_0x31cc5e)[_0x55bdc0(0x12e)](([,_0x447c8c])=>typeof _0x447c8c==='string'&&_0x447c8c['trim']()[_0x55bdc0(0x122)]>0x0)['map'](([_0xc76a8,_0x143df7])=>[_0xc76a8,String(_0x143df7)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x22ba4e){const _0x43859d=await fetchNpmDistTags();return _0x43859d?.[_0x22ba4e]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x5b3711){const _0x308c93=a40_0x599362,_0x1c060f=getRequestedVersion(_0x5b3711);if(_0x1c060f)return{'version':_0x1c060f,'source':'version'};if(_0x5b3711[_0x308c93(0x135)]('beta')){const _0x31224a=await fetchNpmDistTagVersion(_0x308c93(0x141));if(!_0x31224a)return null;return{'version':_0x31224a,'source':_0x308c93(0x141)};}const _0x27fd20=await fetchLatestVersion();if(!_0x27fd20)return null;return{'version':_0x27fd20,'source':_0x308c93(0x130)};}function shouldInstallTarget(_0x3df9fe,_0x17bb25){const _0x501b=a40_0x599362;if(_0x17bb25[_0x501b(0x14c)]===_0x501b(0x15a)||_0x17bb25[_0x501b(0x14c)]==='beta')return!a40_0x167437['eq'](_0x3df9fe,_0x17bb25['version']);return a40_0x167437['lt'](_0x3df9fe,_0x17bb25[_0x501b(0x15a)]);}function getInstallPlanLabel(_0x40256e,_0x3efa19){const _0x3edffb=a40_0x599362;switch(_0x3efa19[_0x3edffb(0x14c)]){case _0x3edffb(0x141):return _0x3edffb(0x132)+a40_0x4b4472[_0x3edffb(0x11e)](_0x40256e)+_0x3edffb(0x164)+a40_0x4b4472['green'](_0x3efa19['version']);case _0x3edffb(0x15a):return _0x3edffb(0x148)+a40_0x4b4472[_0x3edffb(0x11e)](_0x40256e)+_0x3edffb(0x164)+a40_0x4b4472[_0x3edffb(0x161)](_0x3efa19['version']);case _0x3edffb(0x130):default:return _0x3edffb(0x165)+a40_0x4b4472[_0x3edffb(0x11e)](_0x40256e)+_0x3edffb(0x164)+a40_0x4b4472[_0x3edffb(0x161)](_0x3efa19['version']);}}function repairCurrentBuiltinSkill(){const _0x3f18e1=a40_0x599362;console[_0x3f18e1(0x15d)](a40_0x4b4472[_0x3f18e1(0x151)](_0x3f18e1(0x140)));const _0x5caca4=installBuiltinSkill();if(_0x5caca4['ok']){console['log'](a40_0x4b4472['gray'](_0x3f18e1(0x149)+_0x5caca4[_0x3f18e1(0x14b)]+'\x20is\x20up\x20to\x20date.'));return;}throw CliErrors['apiError'](_0x3f18e1(0x14f)+_0x5caca4[_0x3f18e1(0x157)]+_0x3f18e1(0x128)+(_0x5caca4['error']||'unknown'),_0x3f18e1(0x14e)+_0x5caca4['repairCommand']+_0x3f18e1(0x11a)+CLI_BIN_NAME+_0x3f18e1(0x145));}function verifyUpdatedBuiltinSkill(_0x48cfdd){const _0x1e56f4=a40_0x599362,_0x4b5a9e=inspectInstalledBuiltinSkillVersion(_0x48cfdd);if(_0x4b5a9e[_0x1e56f4(0x15f)]===_0x1e56f4(0x13c)){console[_0x1e56f4(0x15d)](a40_0x4b4472[_0x1e56f4(0x151)](_0x1e56f4(0x149)+_0x48cfdd+_0x1e56f4(0x119)));return;}const _0x22f4c7=_0x4b5a9e[_0x1e56f4(0x14b)]?_0x1e56f4(0x12a)+_0x48cfdd+_0x1e56f4(0x153)+_0x4b5a9e[_0x1e56f4(0x14b)]:_0x1e56f4(0x12a)+_0x48cfdd+_0x1e56f4(0x137)+_0x4b5a9e[_0x1e56f4(0x15f)];throw CliErrors[_0x1e56f4(0x150)]('CLI\x20updated\x20to\x20v'+_0x48cfdd+_0x1e56f4(0x142)+_0x22f4c7,'Run:\x20'+_0x4b5a9e[_0x1e56f4(0x14a)]+_0x1e56f4(0x11a)+CLI_BIN_NAME+_0x1e56f4(0x145));}function a40_0x3b3c(_0x3fbce9,_0x41e79c){_0x3fbce9=_0x3fbce9-0x118;const _0x219321=a40_0x2193();let _0x3b3c04=_0x219321[_0x3fbce9];return _0x3b3c04;}async function execute(_0x27d9e6){const _0x57d509=a40_0x599362;await validateUpdateFlags(_0x27d9e6);const _0x4eb685=getCurrentVersion();console[_0x57d509(0x15d)](_0x57d509(0x158)+_0x4eb685);const _0x525481=a40_0x5ab40d('Checking\x20for\x20updates...')[_0x57d509(0x127)](),_0x2e0846=await resolveTargetVersion(_0x27d9e6);if(!_0x2e0846){const _0x41c36d=_0x27d9e6['bool'](_0x57d509(0x141))?_0x57d509(0x126):_0x57d509(0x11c);return _0x525481[_0x57d509(0x159)](_0x41c36d),console[_0x57d509(0x15d)](a40_0x4b4472[_0x57d509(0x151)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x41c36d};}const _0x3e0a30=a40_0x167437[_0x57d509(0x154)](VERSION),_0x3ee520=a40_0x167437[_0x57d509(0x154)](_0x2e0846[_0x57d509(0x15a)]);if(!_0x3e0a30||!_0x3ee520)return _0x525481['fail'](_0x57d509(0x133)),{'ok':![],'message':_0x57d509(0x133)};if(!shouldInstallTarget(_0x3e0a30,_0x2e0846)){const _0x978350=_0x2e0846['source']===_0x57d509(0x15a)?_0x57d509(0x167)+_0x2e0846[_0x57d509(0x15a)]+')':a40_0x167437['gt'](_0x3e0a30,_0x3ee520)?_0x57d509(0x121)+_0x4eb685+_0x57d509(0x129)+_0x2e0846[_0x57d509(0x15a)]:'Already\x20up\x20to\x20date\x20(v'+_0x2e0846[_0x57d509(0x15a)]+')';return _0x525481[_0x57d509(0x13d)](_0x978350),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x525481[_0x57d509(0x12c)](getInstallPlanLabel(_0x4eb685,_0x2e0846));const _0x2da2c7=detectPackageManager(),_0x2c8871=_0x2da2c7==='npm'?resolveNpmBin(_0x57d509(0x13b)):_0x2da2c7,_0x232e2c=a40_0x5ab40d(_0x57d509(0x152)+_0x2da2c7+_0x57d509(0x16a))[_0x57d509(0x127)]();try{await execa(_0x2c8871,[_0x57d509(0x134),'-g',NPM_PACKAGE_NAME+'@'+_0x2e0846[_0x57d509(0x15a)]],{'stdio':_0x57d509(0x138)}),_0x232e2c[_0x57d509(0x13d)](_0x57d509(0x124)+_0x2e0846[_0x57d509(0x15a)]),console[_0x57d509(0x15d)](a40_0x4b4472['gray'](_0x57d509(0x125)));}catch(_0x295dec){return _0x232e2c[_0x57d509(0x159)]('Update\x20failed'),console[_0x57d509(0x14d)](a40_0x4b4472[_0x57d509(0x144)]('\x20\x20'+_0x295dec[_0x57d509(0x15c)])),console['log'](a40_0x4b4472[_0x57d509(0x151)](_0x57d509(0x13a)+_0x2da2c7+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x2e0846['version'])),{'ok':![],'message':_0x295dec['message']};}return verifyUpdatedBuiltinSkill(_0x2e0846[_0x57d509(0x15a)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a40_0x599362(0x12f),'description':a40_0x599362(0x156),'risk':a40_0x599362(0x11d),'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(_0x123fee,_0x38f2af){const _0x441ad9=a41_0x5cfc,_0xd1a151=_0x123fee();while(!![]){try{const _0x2cf995=parseInt(_0x441ad9(0x19c))/0x1+-parseInt(_0x441ad9(0x19f))/0x2*(-parseInt(_0x441ad9(0x1a1))/0x3)+parseInt(_0x441ad9(0x1a0))/0x4+-parseInt(_0x441ad9(0x19a))/0x5*(parseInt(_0x441ad9(0x19b))/0x6)+parseInt(_0x441ad9(0x19e))/0x7+parseInt(_0x441ad9(0x1a2))/0x8+-parseInt(_0x441ad9(0x19d))/0x9;if(_0x2cf995===_0x38f2af)break;else _0xd1a151['push'](_0xd1a151['shift']());}catch(_0xa8b57){_0xd1a151['push'](_0xd1a151['shift']());}}}(a41_0x436c,0x78b0e));function a41_0x5cfc(_0x21c46d,_0x310e63){_0x21c46d=_0x21c46d-0x19a;const _0x436cc1=a41_0x436c();let _0x5cfcc5=_0x436cc1[_0x21c46d];return _0x5cfcc5;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x436c(){const _0x54f88b=['4100832PRUOXu','2665YhrMjs','2964KzslcQ','559287uUroeu','13447548RTUfFx','1363341eSDQVm','13982VOLucL','2290804HKxvaV','177kropvM'];a41_0x436c=function(){return _0x54f88b;};return a41_0x436c();}
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
- const a42_0x913d8e=a42_0x3bea;(function(_0x588410,_0x3ceea7){const _0x1900ac=a42_0x3bea,_0x40eb29=_0x588410();while(!![]){try{const _0x642b1f=-parseInt(_0x1900ac(0x178))/0x1*(parseInt(_0x1900ac(0x17b))/0x2)+-parseInt(_0x1900ac(0x184))/0x3*(parseInt(_0x1900ac(0x177))/0x4)+parseInt(_0x1900ac(0x182))/0x5*(parseInt(_0x1900ac(0x17c))/0x6)+-parseInt(_0x1900ac(0x176))/0x7*(parseInt(_0x1900ac(0x180))/0x8)+-parseInt(_0x1900ac(0x172))/0x9+parseInt(_0x1900ac(0x170))/0xa+parseInt(_0x1900ac(0x171))/0xb;if(_0x642b1f===_0x3ceea7)break;else _0x40eb29['push'](_0x40eb29['shift']());}catch(_0x4c87dc){_0x40eb29['push'](_0x40eb29['shift']());}}}(a42_0x4838,0x591d1));function a42_0x3bea(_0x4a9f5c,_0x510a2f){_0x4a9f5c=_0x4a9f5c-0x170;const _0x483838=a42_0x4838();let _0x3bea05=_0x483838[_0x4a9f5c];return _0x3bea05;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x4838(){const _0x487b1a=['tableName','229514kUXKeZ','234zIsIiS','operation','bool','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','1072tobImO','codegen','84375XdeRzy','code','2106477zsdFyF','sdk','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','boolean','appCode','6076900jZTSSm','3678345joXwar','557811aGTFut','str','Omit\x20import\x20statements\x20from\x20generated\x20code','string','18613BeqIba','4JMkonu','1eWMNNA','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation'];a42_0x4838=function(){return _0x487b1a;};return a42_0x4838();}export const codegenSdk={'service':a42_0x913d8e(0x181),'command':a42_0x913d8e(0x185),'description':a42_0x913d8e(0x179),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a42_0x913d8e(0x175),'description':a42_0x913d8e(0x186)},{'name':a42_0x913d8e(0x17d),'type':'string','required':!![],'description':a42_0x913d8e(0x17f)},{'name':'skip-imports','type':a42_0x913d8e(0x187),'description':a42_0x913d8e(0x174)}],async 'execute'(_0x5e9143){const _0x31ef80=a42_0x913d8e,{dataset:_0x1b0b63,operation:_0x41ca0f}=await getOperationDetail(_0x5e9143[_0x31ef80(0x188)],_0x5e9143['str']('code'),_0x5e9143[_0x31ef80(0x173)](_0x31ef80(0x17d))),_0x59e3f1=generateSdkCode(_0x1b0b63,_0x41ca0f,{'includeImports':!_0x5e9143[_0x31ef80(0x17e)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x1b0b63['name'],'code':_0x1b0b63[_0x31ef80(0x183)],'tableName':_0x1b0b63[_0x31ef80(0x17a)]},'operation':_0x5e9143[_0x31ef80(0x173)]('operation'),'code':_0x59e3f1}};}};
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_0x8b53d4=a43_0x2b9f;(function(_0x8293db,_0x3cc5d3){const _0x1c89a0=a43_0x2b9f,_0x541861=_0x8293db();while(!![]){try{const _0x4e8b37=-parseInt(_0x1c89a0(0x1ce))/0x1+parseInt(_0x1c89a0(0x1d3))/0x2*(-parseInt(_0x1c89a0(0x1e0))/0x3)+parseInt(_0x1c89a0(0x1d7))/0x4*(-parseInt(_0x1c89a0(0x1d1))/0x5)+-parseInt(_0x1c89a0(0x1cd))/0x6+-parseInt(_0x1c89a0(0x1e1))/0x7+parseInt(_0x1c89a0(0x1cc))/0x8*(-parseInt(_0x1c89a0(0x1cf))/0x9)+parseInt(_0x1c89a0(0x1e2))/0xa*(parseInt(_0x1c89a0(0x1d6))/0xb);if(_0x4e8b37===_0x3cc5d3)break;else _0x541861['push'](_0x541861['shift']());}catch(_0xf8267f){_0x541861['push'](_0x541861['shift']());}}}(a43_0x28fa,0xcb611));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x2b9f(_0x30fc8e,_0x2c8237){_0x30fc8e=_0x30fc8e-0x1cb;const _0x28fa54=a43_0x28fa();let _0x2b9f93=_0x28fa54[_0x30fc8e];return _0x2b9f93;}export const codegenSql={'service':a43_0x8b53d4(0x1e4),'command':a43_0x8b53d4(0x1db),'description':a43_0x8b53d4(0x1da),'risk':'read','flags':[SQLCODE_FLAG,{'name':'target','type':a43_0x8b53d4(0x1df),'description':a43_0x8b53d4(0x1dc),'default':'sdk','enum':[a43_0x8b53d4(0x1d5),a43_0x8b53d4(0x1d2)]},{'name':a43_0x8b53d4(0x1e3),'type':a43_0x8b53d4(0x1d4),'description':a43_0x8b53d4(0x1d0)}],async 'execute'(_0x588649){const _0x952231=a43_0x8b53d4,_0x1d25c9=await getSqlQueryInfo(_0x588649[_0x952231(0x1e5)],_0x588649['str'](_0x952231(0x1cb))),_0x16b035=_0x588649['str'](_0x952231(0x1d8))||_0x952231(0x1d5),_0x396cf7=generateSqlCodeTemplate(_0x1d25c9,{'target':_0x16b035,'includeImports':!_0x588649[_0x952231(0x1de)](_0x952231(0x1e3))});return{'ok':!![],'data':{'sqlCode':_0x1d25c9[_0x952231(0x1d9)],'sqlName':_0x1d25c9[_0x952231(0x1dd)],'target':_0x16b035,'code':_0x396cf7}};}};function a43_0x28fa(){const _0x1889f9=['sqlName','bool','string','175290RLdJTr','4276475EFxazs','130KowfgO','no-imports','codegen','appCode','sqlcode','824264lmwsTw','7679718DMhaKO','862331NFHTLQ','117LplRbr','Omit\x20import\x20statements\x20from\x20generated\x20code','5qrhjUq','bff','2DdThHU','boolean','sdk','4648501pBxpaa','2038296WnNiGs','target','sqlCode','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','sql','Code\x20target:\x20sdk\x20(default)\x20or\x20bff'];a43_0x28fa=function(){return _0x1889f9;};return a43_0x28fa();}
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}};}};