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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (388) hide show
  1. package/README.md +8 -2
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/api-group.js +1 -1
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.js +1 -1
  6. package/lib/api/generate-sdk-config-file.js +1 -1
  7. package/lib/api/legacy-api-file.js +1 -1
  8. package/lib/api/model-registry-file.js +1 -1
  9. package/lib/api/model-registry-scaffold.js +1 -1
  10. package/lib/api/model-source.js +1 -1
  11. package/lib/auth/auth-server-ui.js +1 -1
  12. package/lib/auth/auth-server.js +1 -1
  13. package/lib/auth/constant.js +1 -1
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.js +1 -1
  16. package/lib/auth/is-session-valid.js +1 -1
  17. package/lib/auth/login-success-html.js +1 -1
  18. package/lib/auth/logout.js +1 -1
  19. package/lib/cli-flags.js +1 -1
  20. package/lib/cli.js +1 -1
  21. package/lib/commands/api/generate.js +1 -1
  22. package/lib/commands/api/index.js +1 -1
  23. package/lib/commands/api/list.js +1 -1
  24. package/lib/commands/api/pull.js +1 -1
  25. package/lib/commands/api/shared.js +1 -1
  26. package/lib/commands/app/detail.d.ts +2 -0
  27. package/lib/commands/app/detail.js +1 -0
  28. package/lib/commands/app/index.js +1 -1
  29. package/lib/commands/app/list.js +1 -1
  30. package/lib/commands/app/members-list.js +1 -1
  31. package/lib/commands/app/remote-directory.js +1 -1
  32. package/lib/commands/app/shared.js +1 -1
  33. package/lib/commands/app-config/delete.js +1 -1
  34. package/lib/commands/app-config/get.js +1 -1
  35. package/lib/commands/app-config/index.js +1 -1
  36. package/lib/commands/app-config/list.js +1 -1
  37. package/lib/commands/app-config/set.js +1 -1
  38. package/lib/commands/app-config/shared.js +1 -1
  39. package/lib/commands/auth/index.js +1 -1
  40. package/lib/commands/bff/create.js +1 -1
  41. package/lib/commands/bff/delete.js +1 -1
  42. package/lib/commands/bff/detail.js +1 -1
  43. package/lib/commands/bff/index.js +1 -1
  44. package/lib/commands/bff/list.js +1 -1
  45. package/lib/commands/bff/logs.js +1 -1
  46. package/lib/commands/bff/pull.js +1 -1
  47. package/lib/commands/bff/push.js +1 -1
  48. package/lib/commands/bff/status.js +1 -1
  49. package/lib/commands/cli-skill/index.js +1 -1
  50. package/lib/commands/cli-update.js +1 -1
  51. package/lib/commands/codegen/index.js +1 -1
  52. package/lib/commands/codegen/sdk.js +1 -1
  53. package/lib/commands/codegen/sql.js +1 -1
  54. package/lib/commands/common/app-registry.js +1 -1
  55. package/lib/commands/common/app-selector.js +1 -1
  56. package/lib/commands/common/async-task.js +1 -1
  57. package/lib/commands/common/dry-run.js +1 -1
  58. package/lib/commands/common/flags.js +1 -1
  59. package/lib/commands/common/local-file.js +1 -1
  60. package/lib/commands/common/validate.js +1 -1
  61. package/lib/commands/config/delete.js +1 -1
  62. package/lib/commands/config/get.js +1 -1
  63. package/lib/commands/config/index.js +1 -1
  64. package/lib/commands/config/init.js +1 -1
  65. package/lib/commands/config/list.js +1 -1
  66. package/lib/commands/config/set.js +1 -1
  67. package/lib/commands/config/shared.js +1 -1
  68. package/lib/commands/dataset/batch-design.js +1 -1
  69. package/lib/commands/dataset/business-group-update.js +1 -1
  70. package/lib/commands/dataset/business-groups.js +1 -1
  71. package/lib/commands/dataset/capability.js +1 -1
  72. package/lib/commands/dataset/cross-relation-create.js +1 -1
  73. package/lib/commands/dataset/cross-relation-delete.js +1 -1
  74. package/lib/commands/dataset/cross-relation-list.js +1 -1
  75. package/lib/commands/dataset/cross-relation-shared.js +1 -1
  76. package/lib/commands/dataset/cross-relation-update.js +1 -1
  77. package/lib/commands/dataset/delete.js +1 -1
  78. package/lib/commands/dataset/detail.js +1 -1
  79. package/lib/commands/dataset/extend-update.js +1 -1
  80. package/lib/commands/dataset/field-restore.js +1 -1
  81. package/lib/commands/dataset/field-update.js +1 -1
  82. package/lib/commands/dataset/generate.js +1 -1
  83. package/lib/commands/dataset/index.js +1 -1
  84. package/lib/commands/dataset/list.js +1 -1
  85. package/lib/commands/dataset/operations.js +1 -1
  86. package/lib/commands/dataset/relation-audit.js +1 -1
  87. package/lib/commands/dataset/relation-create.js +1 -1
  88. package/lib/commands/dataset/relation-delete.js +1 -1
  89. package/lib/commands/dataset/relation-shared.js +1 -1
  90. package/lib/commands/dataset/relation-update.js +1 -1
  91. package/lib/commands/dataset/relations.js +1 -1
  92. package/lib/commands/dataset/rename.js +1 -1
  93. package/lib/commands/dataset/restore.js +1 -1
  94. package/lib/commands/dataset/user-deleted-field-list.js +1 -1
  95. package/lib/commands/db/analysis-batching.js +1 -1
  96. package/lib/commands/db/analyze-batch-plan.js +1 -1
  97. package/lib/commands/db/analyze-cancel.js +1 -1
  98. package/lib/commands/db/analyze-start.js +1 -1
  99. package/lib/commands/db/analyze-status.js +1 -1
  100. package/lib/commands/db/create.js +1 -1
  101. package/lib/commands/db/delete.js +1 -1
  102. package/lib/commands/db/detail.js +1 -1
  103. package/lib/commands/db/diff-refresh-start.js +1 -1
  104. package/lib/commands/db/diff-refresh-status.js +1 -1
  105. package/lib/commands/db/diff.js +1 -1
  106. package/lib/commands/db/index.js +1 -1
  107. package/lib/commands/db/list.js +1 -1
  108. package/lib/commands/db/shared.js +1 -1
  109. package/lib/commands/db/table-diff-shared.js +1 -1
  110. package/lib/commands/db/tables.js +1 -1
  111. package/lib/commands/db/test.js +1 -1
  112. package/lib/commands/db/update.js +1 -1
  113. package/lib/commands/deployment/index.js +1 -1
  114. package/lib/commands/deployment/sync-all.js +1 -1
  115. package/lib/commands/deployment/sync-jobs.js +1 -1
  116. package/lib/commands/deployment/sync-status.js +1 -1
  117. package/lib/commands/doctor.js +1 -1
  118. package/lib/commands/file/index.js +1 -1
  119. package/lib/commands/flow/create.js +1 -1
  120. package/lib/commands/flow/detail.js +1 -1
  121. package/lib/commands/flow/index.js +1 -1
  122. package/lib/commands/flow/list.js +1 -1
  123. package/lib/commands/flow/publish.js +1 -1
  124. package/lib/commands/flow/runtime-resources-shared.js +1 -1
  125. package/lib/commands/flow/runtime-role-list.js +1 -1
  126. package/lib/commands/flow/runtime-role-user-list.js +1 -1
  127. package/lib/commands/flow/runtime-user-search.js +1 -1
  128. package/lib/commands/flow/shared.js +1 -1
  129. package/lib/commands/flow/update.js +1 -1
  130. package/lib/commands/flow/validate.js +1 -1
  131. package/lib/commands/instant-api-policy/current.js +1 -1
  132. package/lib/commands/instant-api-policy/index.js +1 -1
  133. package/lib/commands/instant-api-policy/init.js +1 -1
  134. package/lib/commands/instant-api-policy/publish.js +1 -1
  135. package/lib/commands/instant-api-policy/pull.js +1 -1
  136. package/lib/commands/instant-api-policy/revision.js +1 -1
  137. package/lib/commands/instant-api-policy/revisions.js +1 -1
  138. package/lib/commands/instant-api-policy/rollback.js +1 -1
  139. package/lib/commands/instant-api-policy/shared.js +1 -1
  140. package/lib/commands/instant-api-policy/validate.js +1 -1
  141. package/lib/commands/issue/index.js +1 -1
  142. package/lib/commands/issue/nudge.js +1 -1
  143. package/lib/commands/issue/report.js +1 -1
  144. package/lib/commands/issue/shared.js +1 -1
  145. package/lib/commands/kb/create.js +1 -1
  146. package/lib/commands/kb/delete.js +1 -1
  147. package/lib/commands/kb/detail.js +1 -1
  148. package/lib/commands/kb/index.js +1 -1
  149. package/lib/commands/kb/list.js +1 -1
  150. package/lib/commands/kb/search.js +1 -1
  151. package/lib/commands/kb/shared.js +1 -1
  152. package/lib/commands/kb/update.js +1 -1
  153. package/lib/commands/logs/index.js +1 -1
  154. package/lib/commands/menu/asset-update.js +1 -1
  155. package/lib/commands/menu/delete.js +1 -1
  156. package/lib/commands/menu/external-link-create.js +1 -1
  157. package/lib/commands/menu/external-link-update.js +1 -1
  158. package/lib/commands/menu/group-create.js +1 -1
  159. package/lib/commands/menu/group-update.js +1 -1
  160. package/lib/commands/menu/index.js +1 -1
  161. package/lib/commands/menu/list.js +1 -1
  162. package/lib/commands/menu/move.js +1 -1
  163. package/lib/commands/menu/regroup-start.js +1 -1
  164. package/lib/commands/menu/rename.js +1 -1
  165. package/lib/commands/menu/shared/compare-table.js +1 -1
  166. package/lib/commands/menu/shared/delete-plan.js +1 -1
  167. package/lib/commands/menu/shared/facts.js +1 -1
  168. package/lib/commands/menu/shared/index.js +1 -1
  169. package/lib/commands/menu/shared/inquirer.js +1 -1
  170. package/lib/commands/menu/shared/local-pages.d.ts +1 -1
  171. package/lib/commands/menu/shared/local-pages.js +1 -1
  172. package/lib/commands/menu/shared/logic.d.ts +3 -1
  173. package/lib/commands/menu/shared/logic.js +1 -1
  174. package/lib/commands/menu/shared/mutations.js +1 -1
  175. package/lib/commands/menu/shared/path.d.ts +2 -0
  176. package/lib/commands/menu/shared/path.js +1 -0
  177. package/lib/commands/menu/shared/service.d.ts +6 -1
  178. package/lib/commands/menu/shared/service.js +1 -1
  179. package/lib/commands/menu/shared/subapp-assets.d.ts +28 -0
  180. package/lib/commands/menu/shared/subapp-assets.js +1 -0
  181. package/lib/commands/menu/shared/sync-core.d.ts +2 -1
  182. package/lib/commands/menu/shared/sync-core.js +1 -1
  183. package/lib/commands/menu/shared/types.d.ts +14 -4
  184. package/lib/commands/menu/shared/update-core.js +1 -1
  185. package/lib/commands/menu/shared/valid-url.js +1 -1
  186. package/lib/commands/menu/subapp-assets-status.d.ts +2 -0
  187. package/lib/commands/menu/subapp-assets-status.js +1 -0
  188. package/lib/commands/menu/subapp-assets-update.d.ts +2 -0
  189. package/lib/commands/menu/subapp-assets-update.js +1 -0
  190. package/lib/commands/menu/sync.js +1 -1
  191. package/lib/commands/menu/visibility-update.js +1 -1
  192. package/lib/commands/notification/config-create.js +1 -1
  193. package/lib/commands/notification/config-delete.js +1 -1
  194. package/lib/commands/notification/config-list.js +1 -1
  195. package/lib/commands/notification/config-update.js +1 -1
  196. package/lib/commands/notification/index.js +1 -1
  197. package/lib/commands/notification/shared.js +1 -1
  198. package/lib/commands/ocr/index.js +1 -1
  199. package/lib/commands/page/create.js +1 -1
  200. package/lib/commands/page/custom/detail.js +1 -1
  201. package/lib/commands/page/custom/list.js +1 -1
  202. package/lib/commands/page/custom/publish.js +1 -1
  203. package/lib/commands/page/custom/shared.js +1 -1
  204. package/lib/commands/page/custom/syntax.js +1 -1
  205. package/lib/commands/page/custom/update.js +1 -1
  206. package/lib/commands/page/data-list-status.js +1 -1
  207. package/lib/commands/page/generate-start.js +1 -1
  208. package/lib/commands/page/generate-status.js +1 -1
  209. package/lib/commands/page/index.js +1 -1
  210. package/lib/commands/page/pull.js +1 -1
  211. package/lib/commands/page/push.js +1 -1
  212. package/lib/commands/page/relation-audit.js +1 -1
  213. package/lib/commands/page/restore.js +1 -1
  214. package/lib/commands/page/shared.js +1 -1
  215. package/lib/commands/page/sync.js +1 -1
  216. package/lib/commands/project/api-architecture-upgrade.js +1 -1
  217. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  218. package/lib/commands/project/create/format-elapsed.js +1 -1
  219. package/lib/commands/project/create/main.js +1 -1
  220. package/lib/commands/project/create/materialize-project-template.js +1 -1
  221. package/lib/commands/project/create/project-name.js +1 -1
  222. package/lib/commands/project/create/project-template-archive.js +1 -1
  223. package/lib/commands/project/create/project-template-path.js +1 -1
  224. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  225. package/lib/commands/project/create/use-format-code.js +1 -1
  226. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  227. package/lib/commands/project/domain-routing-sync.js +1 -1
  228. package/lib/commands/project/index.js +1 -1
  229. package/lib/commands/project/upgrade.js +1 -1
  230. package/lib/commands/registry.js +1 -1
  231. package/lib/commands/role/delete.js +1 -1
  232. package/lib/commands/role/detail.js +1 -1
  233. package/lib/commands/role/index.js +1 -1
  234. package/lib/commands/role/list.js +1 -1
  235. package/lib/commands/role/shared.js +1 -1
  236. package/lib/commands/role/update.js +1 -1
  237. package/lib/commands/role/user-add.js +1 -1
  238. package/lib/commands/role/user-remove.js +1 -1
  239. package/lib/commands/role/user-resolve.js +1 -1
  240. package/lib/commands/rule/get.js +1 -1
  241. package/lib/commands/rule/index.js +1 -1
  242. package/lib/commands/rule/list.js +1 -1
  243. package/lib/commands/rule/set.js +1 -1
  244. package/lib/commands/rule/shared.js +1 -1
  245. package/lib/commands/run/index.js +1 -1
  246. package/lib/commands/schema.js +1 -1
  247. package/lib/commands/sql/create.js +1 -1
  248. package/lib/commands/sql/delete.js +1 -1
  249. package/lib/commands/sql/detail.js +1 -1
  250. package/lib/commands/sql/exec.js +1 -1
  251. package/lib/commands/sql/index.js +1 -1
  252. package/lib/commands/sql/list.js +1 -1
  253. package/lib/commands/sql/pull.js +1 -1
  254. package/lib/commands/sql/push.js +1 -1
  255. package/lib/commands/sql/shared.js +1 -1
  256. package/lib/commands/sql/status.js +1 -1
  257. package/lib/commands/sql/validate.js +1 -1
  258. package/lib/commands/task/index.js +1 -1
  259. package/lib/commands/task/status.js +1 -1
  260. package/lib/commands/tenant/index.js +1 -1
  261. package/lib/commands/tenant/members-list.js +1 -1
  262. package/lib/commands/tenant/shared.js +1 -1
  263. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  264. package/lib/commands/user-account/feishu-bind.js +1 -1
  265. package/lib/commands/user-account/index.js +1 -1
  266. package/lib/commands/workspace/add.js +1 -1
  267. package/lib/commands/workspace/index.js +1 -1
  268. package/lib/commands/workspace/remove.js +1 -1
  269. package/lib/config/domain-config.js +1 -1
  270. package/lib/config/project-domain-routing.js +1 -1
  271. package/lib/config/region-config.js +1 -1
  272. package/lib/config/schema.js +1 -1
  273. package/lib/constant/cdn.js +1 -1
  274. package/lib/constant/cli.js +1 -1
  275. package/lib/constant/defaults.js +1 -1
  276. package/lib/constant/domain.js +1 -1
  277. package/lib/constant/env.js +1 -1
  278. package/lib/constant/output.js +1 -1
  279. package/lib/constant/paths.js +1 -1
  280. package/lib/constant/region.js +1 -1
  281. package/lib/constant/risk.js +1 -1
  282. package/lib/constant/routing-profile.js +1 -1
  283. package/lib/context/app-resolver.js +1 -1
  284. package/lib/context/auth-resolver.js +1 -1
  285. package/lib/context/config-loader.js +1 -1
  286. package/lib/context.js +1 -1
  287. package/lib/core/alias-resolver.js +1 -1
  288. package/lib/core/api-client.d.ts +15 -0
  289. package/lib/core/api-client.js +1 -1
  290. package/lib/core/bff/config.js +1 -1
  291. package/lib/core/bff/file-system.js +1 -1
  292. package/lib/core/bff/hash.js +1 -1
  293. package/lib/core/bff/hook-directory.js +1 -1
  294. package/lib/core/bff/lock.js +1 -1
  295. package/lib/core/bff/utils.js +1 -1
  296. package/lib/core/cross-db-relation.js +1 -1
  297. package/lib/core/db-resolver.js +1 -1
  298. package/lib/core/flow-config.js +1 -1
  299. package/lib/core/instant-api-policy/config.js +1 -1
  300. package/lib/core/kb-search-client.js +1 -1
  301. package/lib/core/page/file-system.js +1 -1
  302. package/lib/core/page/hash.js +1 -1
  303. package/lib/core/page/lock.js +1 -1
  304. package/lib/core/page/lr-smart-jsx.js +1 -1
  305. package/lib/core/sql-index-auditor.js +1 -1
  306. package/lib/core/sql-sync/config.js +1 -1
  307. package/lib/core/sql-sync/file-system.js +1 -1
  308. package/lib/core/sql-sync/hash.js +1 -1
  309. package/lib/core/sql-sync/lock.js +1 -1
  310. package/lib/core/sql-sync/utils.js +1 -1
  311. package/lib/core/sql-validator.js +1 -1
  312. package/lib/errors.js +1 -1
  313. package/lib/framework/build-all-flags.js +1 -1
  314. package/lib/framework/error-output.js +1 -1
  315. package/lib/framework/explicit-yes.js +1 -1
  316. package/lib/framework/flags.js +1 -1
  317. package/lib/framework/help.js +1 -1
  318. package/lib/framework/index.js +1 -1
  319. package/lib/framework/output.js +1 -1
  320. package/lib/framework/response.js +1 -1
  321. package/lib/framework/runner-alias.js +1 -1
  322. package/lib/framework/runner.js +1 -1
  323. package/lib/framework/schema-export.js +1 -1
  324. package/lib/framework/supported-flags.js +1 -1
  325. package/lib/framework/types.js +1 -1
  326. package/lib/generated/build-info.d.ts +4 -4
  327. package/lib/generated/build-info.js +1 -1
  328. package/lib/generated/official-routing.js +1 -1
  329. package/lib/generated/routing-contract.js +1 -1
  330. package/lib/help.js +1 -1
  331. package/lib/postinstall.js +1 -1
  332. package/lib/runtime/confirmation.js +1 -1
  333. package/lib/runtime/event.js +1 -1
  334. package/lib/runtime/index.js +1 -1
  335. package/lib/runtime/queue.js +1 -1
  336. package/lib/runtime/resolve.js +1 -1
  337. package/lib/skills/builtin-skill.js +1 -1
  338. package/lib/skills/main.js +1 -1
  339. package/lib/skills/npx-skills-add.js +1 -1
  340. package/lib/skills/skill-presence.js +1 -1
  341. package/lib/telemetry/cli-command-trace.js +1 -1
  342. package/lib/telemetry/cli-help-trace.js +1 -1
  343. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  344. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  345. package/lib/telemetry/send-cli-trace-log.js +1 -1
  346. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  347. package/lib/utils/ai_config.js +1 -1
  348. package/lib/utils/apply-jq-filter.js +1 -1
  349. package/lib/utils/cdn-config.js +1 -1
  350. package/lib/utils/check-sdk-version.js +1 -1
  351. package/lib/utils/cli-version-check.js +1 -1
  352. package/lib/utils/cli-version-policy.js +1 -1
  353. package/lib/utils/config.js +1 -1
  354. package/lib/utils/entity-with-id.js +1 -1
  355. package/lib/utils/file-utils.js +1 -1
  356. package/lib/utils/guides-cdn.js +1 -1
  357. package/lib/utils/http-client.js +1 -1
  358. package/lib/utils/is-non-interactive.js +1 -1
  359. package/lib/utils/logger.js +1 -1
  360. package/lib/utils/params.js +1 -1
  361. package/lib/utils/platform.js +1 -1
  362. package/lib/utils/sleep.js +1 -1
  363. package/lib/utils/template-replacer.js +1 -1
  364. package/lib/utils/update-notice.js +1 -1
  365. package/lib/utils/version.js +1 -1
  366. package/lib/utils/with-active-cookie.js +1 -1
  367. package/lib/utils/write-cli-side-channel.js +1 -1
  368. package/package.json +1 -1
  369. package/skills/rabetbase/SKILL.md +21 -12
  370. package/skills/rabetbase/guides/backend-function.md +2 -7
  371. package/skills/rabetbase/guides/bff-creation-workflow.md +24 -23
  372. package/skills/rabetbase/guides/host-frontend-integration.md +62 -0
  373. package/skills/rabetbase/guides/independent-deployment.md +45 -0
  374. package/skills/rabetbase/guides/troubleshooting.md +9 -1
  375. package/skills/rabetbase/references/rabetbase-app-detail.md +31 -0
  376. package/skills/rabetbase/references/rabetbase-bff-detail.md +1 -1
  377. package/skills/rabetbase/references/rabetbase-bff-push.md +2 -2
  378. package/skills/rabetbase/references/rabetbase-data-list-status.md +1 -0
  379. package/skills/rabetbase/references/rabetbase-deployment-sync-all.md +5 -1
  380. package/skills/rabetbase/references/rabetbase-menu-asset-update.md +9 -7
  381. package/skills/rabetbase/references/rabetbase-menu-list.md +2 -2
  382. package/skills/rabetbase/references/rabetbase-menu-subapp-assets-status.md +19 -0
  383. package/skills/rabetbase/references/rabetbase-menu-subapp-assets-update.md +27 -0
  384. package/skills/rabetbase/references/rabetbase-menu-sync.md +40 -14
  385. package/skills/rabetbase/references/rabetbase-page-create.md +1 -1
  386. package/skills/rabetbase/references/rabetbase-page-generate-start.md +5 -3
  387. package/skills/rabetbase/references/rabetbase-page-generate-status.md +1 -0
  388. package/skills/rabetbase.manifest.json +8 -3
@@ -1 +1 @@
1
- const a168_0x1b98da=a168_0x59bf;(function(_0xbb24b5,_0x2648dd){const _0x55f39f=a168_0x59bf,_0x292269=_0xbb24b5();while(!![]){try{const _0x426739=-parseInt(_0x55f39f(0xef))/0x1*(-parseInt(_0x55f39f(0xba))/0x2)+parseInt(_0x55f39f(0xd3))/0x3*(-parseInt(_0x55f39f(0xd1))/0x4)+-parseInt(_0x55f39f(0xdf))/0x5+-parseInt(_0x55f39f(0xfb))/0x6*(parseInt(_0x55f39f(0xf1))/0x7)+parseInt(_0x55f39f(0xff))/0x8+parseInt(_0x55f39f(0xa3))/0x9*(-parseInt(_0x55f39f(0xbf))/0xa)+parseInt(_0x55f39f(0xaf))/0xb;if(_0x426739===_0x2648dd)break;else _0x292269['push'](_0x292269['shift']());}catch(_0x1b17b6){_0x292269['push'](_0x292269['shift']());}}}(a168_0x39d6,0x3f26c));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a168_0x1b98da(0x9c),'required':!![],'description':a168_0x1b98da(0xfd)};export const MENU_SORT_FLAG={'name':'sort','type':a168_0x1b98da(0x9c),'description':a168_0x1b98da(0x9e)};function a168_0x39d6(){const _0x889650=['9603275qZMPBb','menu_confirmation_required','get','byId','stringify','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','stage','after','appCode','parent-id','dryRun','2sXedLI','before','prototype','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','error','5080QlbRMO','hint','toLowerCase','pre-write-recheck','menu_permission_denied','warnings','trim','backend','length','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','hasOwnProperty','rawFlags','cookie','menu_parent_not_folder','code','path','Menu\x20','expected-children-count','588628OWyPjq','yes','3lZZzqV','\x22,\x20not\x20folder.','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','plannedActions','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.','menu_mutation_failed','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','expect-path','root','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','Cannot\x20append\x20a\x20','681095kvRhCv','hash','message','test',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','isSafeInteger','menu_verification_failed','menu_state_drift','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','validation','call','map','--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.','snapshotHash','verification','selector','15815CEfViT','\x20menu\x20','2562cNdxGX','planFile',',\x20current\x20','parentId','filter','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','max','flagMissing','data','cascade','5970MGedjz','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','Exact\x20online\x20menu\x20id','string','167440wePpjN','\x20child\x20count\x20changed:\x20expected\x20','\x20parent\x20changed:\x20expected\x20','unknown','targets','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','sort','str','deleteOrder','number','type','Sibling\x20sort\x20value\x20(non-negative\x20integer)','Permission\x20denied\x20while\x20attempting\x20to\x20','failedRecords','num','childrenCount','63FzXDkn','Failed\x20to\x20','menu_sort_invalid','folder','\x20path\x20changed:\x20expected\x20','menu_not_found','expect-parent-id','succeeded','recheck\x20online\x20menu\x20facts\x20before\x20','bool','failed','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.'];a168_0x39d6=function(){return _0x889650;};return a168_0x39d6();}export const MENU_PARENT_ID_FLAG={'name':a168_0x1b98da(0xb8),'type':'string','description':a168_0x1b98da(0xda)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':'expect-parent-id','type':a168_0x1b98da(0xfe),'description':a168_0x1b98da(0xdd)};export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':a168_0x1b98da(0xdb),'type':a168_0x1b98da(0xfe),'description':a168_0x1b98da(0xb4)},{'name':'expected-children-count','type':a168_0x1b98da(0x9c),'description':a168_0x1b98da(0xd5)}];export function validateExactId(_0x2ec42a){const _0x567251=a168_0x1b98da,_0x304041=_0x2ec42a[_0x567251(0xa1)]('id');if(!Number[_0x567251(0xe4)](_0x304041)||_0x304041<=0x0)throw CliErrors['validation'](_0x567251(0xfc));return _0x304041;}export function validateSort(_0x4f0fb6,_0x4202f0=a168_0x1b98da(0x105)){const _0x1f00ea=a168_0x1b98da;if(!hasFlag(_0x4f0fb6,_0x4202f0))return undefined;const _0x57ce89=_0x4f0fb6['num'](_0x4202f0);if(!Number['isSafeInteger'](_0x57ce89)||_0x57ce89<0x0||_0x57ce89>MAX_MENU_SORT)throw menuError(_0x1f00ea(0xa5),'--'+_0x4202f0+_0x1f00ea(0xbd)+MAX_MENU_SORT+'.',_0x1f00ea(0xae));return _0x57ce89;}function a168_0x59bf(_0x4126e9,_0x2bbe3a){_0x4126e9=_0x4126e9-0x9a;const _0x39d6bc=a168_0x39d6();let _0x59bf40=_0x39d6bc[_0x4126e9];return _0x59bf40;}export function nextSiblingSort(_0x168ee9,_0x15d71d,_0x5e8c23){const _0x110e2f=a168_0x1b98da,_0x386526=getChildren(_0x168ee9,_0x15d71d)[_0x110e2f(0xea)](_0x363da1=>_0x363da1[_0x110e2f(0x105)])[_0x110e2f(0xf5)](_0x199573=>typeof _0x199573===_0x110e2f(0x9c));if(_0x386526[_0x110e2f(0xc7)]===0x0)return 0x0;const _0x598d28=Math[_0x110e2f(0xf7)](..._0x386526);if(_0x598d28>=MAX_MENU_SORT)throw menuError('menu_sort_overflow',_0x110e2f(0xde)+_0x5e8c23+'\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20'+_0x598d28+'.','Reorder\x20sibling\x20menus\x20below\x20'+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x598d28+0x1;}export function requireExplicitYes(_0x5a3d40){const _0x1596ed=a168_0x1b98da;if(_0x5a3d40[_0x1596ed(0xac)]('dry-run'))return;if(!_0x5a3d40[_0x1596ed(0xac)](_0x1596ed(0xd2)))throw menuError(_0x1596ed(0xb0),_0x1596ed(0xd9),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export async function fetchMutationSnapshot(_0x1bced8,_0x5cc803,_0x5c75d9){const _0x1526e7=a168_0x1b98da;try{return await fetchMenuSnapshot(_0x1bced8[_0x1526e7(0xb7)],_0x1bced8[_0x1526e7(0xcb)]);}catch(_0x2a6184){throw mapMenuApiError(_0x2a6184,'read\x20online\x20menu\x20facts\x20before\x20'+_0x5cc803,_0x5c75d9);}}export async function recheckMutationSnapshot(_0x85456a,_0x348cf2,_0x5744f8,_0x1a31aa){const _0x141c7f=a168_0x1b98da;let _0x2f24a5;try{_0x2f24a5=await fetchMenuSnapshot(_0x85456a[_0x141c7f(0xb7)],_0x85456a['cookie']);}catch(_0x95aaab){const _0x4f4238=mapMenuApiError(_0x95aaab,_0x141c7f(0xab)+_0x5744f8,_0x1a31aa);throw menuFailure(_0x4f4238,_0x348cf2,{'stage':_0x141c7f(0xc2),'failed':_0x1a31aa==null?{}:{'id':_0x1a31aa}});}if(_0x2f24a5[_0x141c7f(0xe0)]!==_0x348cf2[_0x141c7f(0xec)]){const _0x393100=menuError(_0x141c7f(0xe6),'Online\x20menu\x20state\x20changed\x20before\x20'+_0x5744f8+_0x141c7f(0xe3),'Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.');throw menuFailure(_0x393100,_0x348cf2,{'stage':_0x141c7f(0xc2),'failed':{..._0x1a31aa==null?{}:{'id':_0x1a31aa},'expectedSnapshotHash':_0x348cf2[_0x141c7f(0xec)],'currentSnapshotHash':_0x2f24a5[_0x141c7f(0xe0)]}});}return _0x2f24a5;}export function parseParentId(_0x296fdb,_0x43e31e,_0x4948ae={}){const _0x230859=a168_0x1b98da;if(!hasFlag(_0x296fdb,_0x43e31e)){if(_0x4948ae['required'])throw CliErrors[_0x230859(0xf8)](_0x43e31e);return undefined;}const _0x1d379b=_0x296fdb[_0x230859(0x9a)](_0x43e31e)[_0x230859(0xc5)]();if(_0x1d379b[_0x230859(0xc1)]()===_0x230859(0xdc))return null;if(!/^\d+$/[_0x230859(0xe2)](_0x1d379b))throw CliErrors[_0x230859(0xe8)]('--'+_0x43e31e+_0x230859(0xc8));const _0x35a51e=Number(_0x1d379b);if(!Number[_0x230859(0xe4)](_0x35a51e)||_0x35a51e<=0x0)throw CliErrors[_0x230859(0xe8)]('--'+_0x43e31e+'\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.');return _0x35a51e;}export function requireMenu(_0xb12047,_0x21f81a){const _0x2041bd=a168_0x1b98da,_0x101115=_0xb12047[_0x2041bd(0xb2)][_0x2041bd(0xb1)](_0x21f81a);if(!_0x101115)throw menuError(_0x2041bd(0xa8),'Online\x20menu\x20not\x20found:\x20'+_0x21f81a,_0x2041bd(0xd7));return _0x101115;}export function requireFolder(_0x13ff47,_0x2a4304){const _0x5d0b41=a168_0x1b98da,_0x247f49=requireMenu(_0x13ff47,_0x2a4304);if(_0x247f49[_0x5d0b41(0x9d)]!==_0x5d0b41(0xa6))throw menuError(_0x5d0b41(0xcc),_0x5d0b41(0xcf)+_0x2a4304+'\x20is\x20type\x20\x22'+(_0x247f49[_0x5d0b41(0x9d)]||_0x5d0b41(0x102))+_0x5d0b41(0xd4),_0x5d0b41(0x104));return _0x247f49;}export function assertExpectedState(_0x185867,_0x48c9b3){const _0x33fbfb=a168_0x1b98da;if(hasFlag(_0x185867,_0x33fbfb(0xa9))){const _0x241ea0=parseParentId(_0x185867,_0x33fbfb(0xa9),{'required':!![]});if(_0x48c9b3['parentId']!==_0x241ea0)throw stateDrift(_0x33fbfb(0xcf)+_0x48c9b3['id']+_0x33fbfb(0x101)+formatParent(_0x241ea0)+_0x33fbfb(0xf3)+formatParent(_0x48c9b3[_0x33fbfb(0xf4)])+'.');}if(hasFlag(_0x185867,'expect-path')){const _0x1739cd=_0x185867[_0x33fbfb(0x9a)](_0x33fbfb(0xdb));if(_0x48c9b3[_0x33fbfb(0xce)]!==_0x1739cd)throw stateDrift(_0x33fbfb(0xcf)+_0x48c9b3['id']+_0x33fbfb(0xa7)+JSON[_0x33fbfb(0xb3)](_0x1739cd)+_0x33fbfb(0xf3)+JSON[_0x33fbfb(0xb3)](_0x48c9b3[_0x33fbfb(0xce)])+'.');}if(hasFlag(_0x185867,'expected-children-count')){const _0x3f7c4a=_0x185867[_0x33fbfb(0xa1)](_0x33fbfb(0xd0));if(!Number[_0x33fbfb(0xe4)](_0x3f7c4a)||_0x3f7c4a<0x0)throw CliErrors[_0x33fbfb(0xe8)](_0x33fbfb(0xeb));if(_0x48c9b3['childrenCount']!==_0x3f7c4a)throw stateDrift('Menu\x20'+_0x48c9b3['id']+_0x33fbfb(0x100)+_0x3f7c4a+_0x33fbfb(0xf3)+_0x48c9b3[_0x33fbfb(0xa2)]+'.');}}export function assertVerified(_0x4d4379,_0x216926,_0x579c03=a168_0x1b98da(0xe7)){const _0x3d4bcf=a168_0x1b98da;if(!_0x4d4379)throw menuError(_0x3d4bcf(0xe5),_0x216926,_0x579c03);}export function mutationResult(_0x55f3d6){const _0x21e223=a168_0x1b98da;return{'operation':_0x55f3d6['operation'],'selector':_0x55f3d6[_0x21e223(0xee)],'before':_0x55f3d6[_0x21e223(0xbb)],'after':_0x55f3d6[_0x21e223(0xb6)],'dryRun':_0x55f3d6[_0x21e223(0xb9)],'backend':_0x55f3d6[_0x21e223(0xc6)],..._0x55f3d6[_0x21e223(0xd6)]?{'plannedActions':_0x55f3d6['plannedActions']}:{},..._0x55f3d6[_0x21e223(0x103)]?{'targets':_0x55f3d6[_0x21e223(0x103)]}:{},..._0x55f3d6[_0x21e223(0x9b)]?{'deleteOrder':_0x55f3d6['deleteOrder']}:{},'snapshotHash':_0x55f3d6[_0x21e223(0xec)],..._0x55f3d6[_0x21e223(0xfa)]?{'cascade':_0x55f3d6['cascade']}:{},..._0x55f3d6[_0x21e223(0xf2)]?{'planFile':_0x55f3d6[_0x21e223(0xf2)]}:{},'succeeded':_0x55f3d6[_0x21e223(0xaa)]??[],'failed':_0x55f3d6[_0x21e223(0xad)]??[],'warnings':_0x55f3d6[_0x21e223(0xc4)]??[],'verification':_0x55f3d6[_0x21e223(0xed)],'error':_0x55f3d6[_0x21e223(0xbe)]};}export function menuDryRunResult(_0x3456fb,_0x7ebc94){return{..._0x3456fb,..._0x7ebc94};}export function menuFailure(_0x50bb88,_0x45649e,_0x357471){const _0x3da8ba=a168_0x1b98da,_0x3d6a73=mutationResult({..._0x45649e,'after':_0x357471['after']===undefined?_0x45649e[_0x3da8ba(0xb6)]:_0x357471[_0x3da8ba(0xb6)],'backend':_0x357471[_0x3da8ba(0xc6)]??_0x45649e[_0x3da8ba(0xc6)],'dryRun':![],'succeeded':_0x357471[_0x3da8ba(0xaa)]??[],'failed':_0x357471[_0x3da8ba(0xa0)]??[{..._0x357471[_0x3da8ba(0xad)]??{},'stage':_0x357471[_0x3da8ba(0xb5)],'code':_0x50bb88[_0x3da8ba(0xcd)],'message':_0x50bb88[_0x3da8ba(0xe1)]}],'warnings':[..._0x45649e[_0x3da8ba(0xc4)],..._0x357471[_0x3da8ba(0xc4)]??[]],'verification':_0x357471[_0x3da8ba(0xed)],'error':{'code':_0x50bb88[_0x3da8ba(0xcd)],'message':_0x50bb88[_0x3da8ba(0xe1)],..._0x50bb88[_0x3da8ba(0xc0)]?{'hint':_0x50bb88[_0x3da8ba(0xc0)]}:{}}});return Object['defineProperty'](_0x50bb88,_0x3da8ba(0xf9),{'value':_0x3d6a73,'enumerable':!![],'configurable':!![]}),_0x50bb88;}export function asVerificationError(_0x3bed0c,_0x2b71b2){const _0x3e6458=a168_0x1b98da;if(_0x3bed0c instanceof CliError&&_0x3bed0c['code']===_0x3e6458(0xe5))return _0x3bed0c;const _0x574016=_0x3bed0c instanceof Error?_0x3bed0c['message']:String(_0x3bed0c);return menuError(_0x3e6458(0xe5),''+_0x2b71b2+(_0x574016?':\x20'+_0x574016:''),'The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.');}export function describeMenuErrorCause(_0x5ed843,_0x18ec88,_0x11c254){const _0x41a40b=a168_0x1b98da,_0x17853a=mapMenuApiError(_0x5ed843,_0x18ec88,_0x11c254);return{'causeCode':_0x17853a[_0x41a40b(0xcd)],'causeMessage':_0x17853a[_0x41a40b(0xe1)]};}export function hasFlag(_0x46811c,_0x383e25){const _0xff36de=a168_0x1b98da;return Object[_0xff36de(0xbc)][_0xff36de(0xc9)][_0xff36de(0xe9)](_0x46811c[_0xff36de(0xca)],_0x383e25)&&_0x46811c['rawFlags'][_0x383e25]!==undefined;}export function toApiParentId(_0x4777d0){return _0x4777d0??0x0;}export function formatParent(_0x56273d){const _0x119f8c=a168_0x1b98da;return _0x56273d==null?_0x119f8c(0xdc):String(_0x56273d);}export function menuError(_0x29d3bd,_0x1723e9,_0x143927){return new CliError(_0x29d3bd,0x1,_0x1723e9,_0x143927);}export function mapMenuApiError(_0x18ed29,_0x1e8d01,_0x41d229){const _0x4d6ded=a168_0x1b98da;if(_0x18ed29 instanceof CliError&&_0x18ed29['code']!=='api_error')return _0x18ed29;const _0x1b9125=_0x18ed29 instanceof Error?_0x18ed29[_0x4d6ded(0xe1)]:String(_0x18ed29);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4d6ded(0xe2)](_0x1b9125))return menuError(_0x4d6ded(0xc3),_0x4d6ded(0x9f)+_0x1e8d01+(_0x41d229?_0x4d6ded(0xf0)+_0x41d229:'')+'.','Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.');return menuError(_0x4d6ded(0xd8),_0x4d6ded(0xa4)+_0x1e8d01+(_0x41d229?'\x20menu\x20'+_0x41d229:'')+':\x20'+_0x1b9125,_0x4d6ded(0xf6));}export function isMenuResponseLoss(_0x2b35a5){const _0x2f3e6e=a168_0x1b98da,_0x4bccc1=_0x2b35a5 instanceof Error?_0x2b35a5[_0x2f3e6e(0xe1)]:String(_0x2b35a5);if(_0x2b35a5 instanceof CliError)return _0x2b35a5[_0x2f3e6e(0xcd)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x2f3e6e(0xe2)](_0x4bccc1);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x2f3e6e(0xe2)](_0x4bccc1);}function stateDrift(_0x1c654b){const _0x1c5ce7=a168_0x1b98da;return menuError(_0x1c5ce7(0xe6),_0x1c654b,'Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.');}
1
+ const a169_0x36feb0=a169_0x9ecc;(function(_0x200ce4,_0x4e5e4d){const _0x23b9d2=a169_0x9ecc,_0x3a02aa=_0x200ce4();while(!![]){try{const _0x17bb4a=parseInt(_0x23b9d2(0x1b1))/0x1*(-parseInt(_0x23b9d2(0x1ac))/0x2)+-parseInt(_0x23b9d2(0x1c9))/0x3+-parseInt(_0x23b9d2(0x1f9))/0x4*(parseInt(_0x23b9d2(0x20a))/0x5)+parseInt(_0x23b9d2(0x1d5))/0x6*(parseInt(_0x23b9d2(0x1d6))/0x7)+-parseInt(_0x23b9d2(0x1af))/0x8+-parseInt(_0x23b9d2(0x1c8))/0x9*(parseInt(_0x23b9d2(0x1ab))/0xa)+parseInt(_0x23b9d2(0x1f8))/0xb*(parseInt(_0x23b9d2(0x1bc))/0xc);if(_0x17bb4a===_0x4e5e4d)break;else _0x3a02aa['push'](_0x3a02aa['shift']());}catch(_0x200728){_0x3a02aa['push'](_0x3a02aa['shift']());}}}(a169_0xe3b5,0xa2c08));import{CliError,CliErrors}from'../../../errors.js';import{fetchMenuSnapshot,getChildren}from'../../../commands/menu/shared/facts.js';export const MAX_MENU_SORT=0x7fffffff;export const MENU_ID_FLAG={'name':'id','type':a169_0x36feb0(0x1c7),'required':!![],'description':a169_0x36feb0(0x208)};function a169_0xe3b5(){const _0x511bd6=['Confirm\x20that\x20the\x20current\x20account\x20can\x20manage\x20menus\x20for\x20this\x20app.','snapshotHash','unknown','get','\x20is\x20type\x20\x22','type','cookie','defineProperty','Abort\x20unless\x20the\x20current\x20parent\x20id\x20matches;\x20use\x20root\x20for\x20root\x20level','failed','warnings','num','Choose\x20a\x20sort\x20value\x20within\x20the\x20Java\x20Integer\x20range\x20used\x20by\x20the\x20menu\x20service.','Exact\x20online\x20menu\x20id','code','5WORcqB','Menu\x20','Parent\x20folder\x20id;\x20use\x20root\x20for\x20a\x20root-level\x20node','byId','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20again\x20and\x20review\x20the\x20latest\x20snapshot\x20before\x20retrying.','before','targets','isSafeInteger','verification','\x22,\x20not\x20folder.','recheck\x20online\x20menu\x20facts\x20before\x20','backend','parentId','parent-id','cascade','hasOwnProperty','5414740mRfBLU','2tstknF','appCode','Choose\x20a\x20menu\x20whose\x20type\x20is\x20folder,\x20or\x20use\x20root.','4311496sZtovc','data','746839gwVtEw','test','Re-run\x20menu\x20list\x20to\x20inspect\x20the\x20latest\x20online\x20state\x20before\x20retrying.','menu_sort_overflow',',\x20current\x20','menu_sort_invalid','Abort\x20unless\x20the\x20current\x20menu\x20path\x20exactly\x20matches','\x20menu\x20','expect-parent-id','Permission\x20denied\x20while\x20attempting\x20to\x20','toLowerCase','3636czULju','operation','pre-write-recheck','Reorder\x20sibling\x20menus\x20below\x20','read\x20online\x20menu\x20facts\x20before\x20','path','Run\x20the\x20same\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','sort','succeeded','This\x20menu\x20mutation\x20requires\x20explicit\x20--yes.','The\x20write\x20may\x20already\x20have\x20taken\x20effect.\x20Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20inspect\x20the\x20returned\x20id\x20before\x20retrying.','number','9eTyOEv','3126195PDmFZm','expect-path','Re-run\x20the\x20command\x20with\x20--dry-run\x20and\x20update\x20the\x20expect\x20flags\x20before\x20retrying.','plannedActions','length','selector','menu_verification_failed','menu_not_found','folder','validation','str','\x20because\x20the\x20current\x20maximum\x20sibling\x20sort\x20is\x20','6yBnPHK','4151294CkVMnE','api_error','trim','failedRecords','deleteOrder','planFile','Online\x20menu\x20not\x20found:\x20','\x20must\x20be\x20an\x20integer\x20between\x200\x20and\x20','flagMissing','\x20parent\x20changed:\x20expected\x20','menu_confirmation_required','--id\x20must\x20be\x20a\x20positive\x20integer\x20menu\x20id.','menu_state_drift','Abort\x20unless\x20the\x20current\x20direct\x20child\x20count\x20matches','string','after','rawFlags',';\x20the\x20planned\x20snapshot\x20is\x20no\x20longer\x20current.','required','\x20child\x20count\x20changed:\x20expected\x20','root','Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20to\x20inspect\x20the\x20latest\x20online\x20menu\x20state.','Cannot\x20append\x20a\x20','Online\x20menu\x20state\x20changed\x20before\x20','max','expected-children-count','filter','hash','menu_mutation_failed','stringify','message','bool','\x20must\x20be\x20a\x20positive\x20menu\x20id\x20or\x20root.','menu_parent_not_folder','130658MVVZrM','2624516QPCphm','hint'];a169_0xe3b5=function(){return _0x511bd6;};return a169_0xe3b5();}export const MENU_SORT_FLAG={'name':a169_0x36feb0(0x1c3),'type':a169_0x36feb0(0x1c7),'description':'Sibling\x20sort\x20value\x20(non-negative\x20integer)'};export const MENU_PARENT_ID_FLAG={'name':a169_0x36feb0(0x1a8),'type':'string','description':a169_0x36feb0(0x20c)};export const MENU_EXPECT_PARENT_ID_FLAG={'name':a169_0x36feb0(0x1b9),'type':a169_0x36feb0(0x1e4),'description':a169_0x36feb0(0x203)};function a169_0x9ecc(_0x2e785e,_0xa07085){_0x2e785e=_0x2e785e-0x1a7;const _0xe3b594=a169_0xe3b5();let _0x9eccdf=_0xe3b594[_0x2e785e];return _0x9eccdf;}export const MENU_EXPECT_FLAGS=[MENU_EXPECT_PARENT_ID_FLAG,{'name':'expect-path','type':'string','description':a169_0x36feb0(0x1b7)},{'name':a169_0x36feb0(0x1ef),'type':a169_0x36feb0(0x1c7),'description':a169_0x36feb0(0x1e3)}];export function validateExactId(_0x4c36a7){const _0x1fe91f=a169_0x36feb0,_0x4e1b10=_0x4c36a7['num']('id');if(!Number[_0x1fe91f(0x211)](_0x4e1b10)||_0x4e1b10<=0x0)throw CliErrors[_0x1fe91f(0x1d2)](_0x1fe91f(0x1e1));return _0x4e1b10;}export function validateSort(_0x1f3349,_0x37b61b=a169_0x36feb0(0x1c3)){const _0x521471=a169_0x36feb0;if(!hasFlag(_0x1f3349,_0x37b61b))return undefined;const _0x1583e5=_0x1f3349[_0x521471(0x206)](_0x37b61b);if(!Number['isSafeInteger'](_0x1583e5)||_0x1583e5<0x0||_0x1583e5>MAX_MENU_SORT)throw menuError(_0x521471(0x1b6),'--'+_0x37b61b+_0x521471(0x1dd)+MAX_MENU_SORT+'.',_0x521471(0x207));return _0x1583e5;}export function nextSiblingSort(_0x325bb0,_0x4ec24b,_0x40c6a1){const _0x350ee4=a169_0x36feb0,_0x15e105=getChildren(_0x325bb0,_0x4ec24b)['map'](_0x401a7c=>_0x401a7c[_0x350ee4(0x1c3)])[_0x350ee4(0x1f0)](_0x34c861=>typeof _0x34c861===_0x350ee4(0x1c7));if(_0x15e105[_0x350ee4(0x1cd)]===0x0)return 0x0;const _0x27da21=Math[_0x350ee4(0x1ee)](..._0x15e105);if(_0x27da21>=MAX_MENU_SORT)throw menuError(_0x350ee4(0x1b4),_0x350ee4(0x1ec)+_0x40c6a1+_0x350ee4(0x1d4)+_0x27da21+'.',_0x350ee4(0x1bf)+MAX_MENU_SORT+',\x20or\x20pass\x20an\x20explicit\x20--sort\x20value.');return _0x27da21+0x1;}export function requireExplicitYes(_0x36cc0f){const _0x2ebe08=a169_0x36feb0;if(_0x36cc0f[_0x2ebe08(0x1f5)]('dry-run'))return;if(!_0x36cc0f['bool']('yes'))throw menuError(_0x2ebe08(0x1e0),_0x2ebe08(0x1c5),_0x2ebe08(0x1c2));}export async function fetchMutationSnapshot(_0x101b95,_0x1de1fd,_0x228ecd){const _0x2ec776=a169_0x36feb0;try{return await fetchMenuSnapshot(_0x101b95[_0x2ec776(0x1ad)],_0x101b95[_0x2ec776(0x201)]);}catch(_0x50a947){throw mapMenuApiError(_0x50a947,_0x2ec776(0x1c0)+_0x1de1fd,_0x228ecd);}}export async function recheckMutationSnapshot(_0x2fa97c,_0x73e30e,_0x532016,_0x264949){const _0x1feab7=a169_0x36feb0;let _0x525e3a;try{_0x525e3a=await fetchMenuSnapshot(_0x2fa97c[_0x1feab7(0x1ad)],_0x2fa97c['cookie']);}catch(_0x1c6530){const _0x2e7c42=mapMenuApiError(_0x1c6530,_0x1feab7(0x214)+_0x532016,_0x264949);throw menuFailure(_0x2e7c42,_0x73e30e,{'stage':_0x1feab7(0x1be),'failed':_0x264949==null?{}:{'id':_0x264949}});}if(_0x525e3a[_0x1feab7(0x1f1)]!==_0x73e30e[_0x1feab7(0x1fc)]){const _0x4dd25b=menuError(_0x1feab7(0x1e2),_0x1feab7(0x1ed)+_0x532016+_0x1feab7(0x1e7),_0x1feab7(0x20e));throw menuFailure(_0x4dd25b,_0x73e30e,{'stage':_0x1feab7(0x1be),'failed':{..._0x264949==null?{}:{'id':_0x264949},'expectedSnapshotHash':_0x73e30e[_0x1feab7(0x1fc)],'currentSnapshotHash':_0x525e3a['hash']}});}return _0x525e3a;}export function parseParentId(_0x28b022,_0x39c4f6,_0x1ea72a={}){const _0x4d39d8=a169_0x36feb0;if(!hasFlag(_0x28b022,_0x39c4f6)){if(_0x1ea72a[_0x4d39d8(0x1e8)])throw CliErrors[_0x4d39d8(0x1de)](_0x39c4f6);return undefined;}const _0x1f4a55=_0x28b022[_0x4d39d8(0x1d3)](_0x39c4f6)[_0x4d39d8(0x1d8)]();if(_0x1f4a55[_0x4d39d8(0x1bb)]()===_0x4d39d8(0x1ea))return null;if(!/^\d+$/[_0x4d39d8(0x1b2)](_0x1f4a55))throw CliErrors['validation']('--'+_0x39c4f6+_0x4d39d8(0x1f6));const _0x64c80a=Number(_0x1f4a55);if(!Number['isSafeInteger'](_0x64c80a)||_0x64c80a<=0x0)throw CliErrors[_0x4d39d8(0x1d2)]('--'+_0x39c4f6+_0x4d39d8(0x1f6));return _0x64c80a;}export function requireMenu(_0x458666,_0x1c2033){const _0x58ac26=a169_0x36feb0,_0x1000c2=_0x458666[_0x58ac26(0x20d)][_0x58ac26(0x1fe)](_0x1c2033);if(!_0x1000c2)throw menuError(_0x58ac26(0x1d0),_0x58ac26(0x1dc)+_0x1c2033,'Run\x20`rabetbase\x20menu\x20list\x20--format\x20json`\x20and\x20use\x20an\x20exact\x20id\x20from\x20the\x20current\x20app.');return _0x1000c2;}export function requireFolder(_0x1d4910,_0x36a31f){const _0x213dbe=a169_0x36feb0,_0x3b271f=requireMenu(_0x1d4910,_0x36a31f);if(_0x3b271f[_0x213dbe(0x200)]!==_0x213dbe(0x1d1))throw menuError(_0x213dbe(0x1f7),'Menu\x20'+_0x36a31f+_0x213dbe(0x1ff)+(_0x3b271f[_0x213dbe(0x200)]||_0x213dbe(0x1fd))+_0x213dbe(0x213),_0x213dbe(0x1ae));return _0x3b271f;}export function assertExpectedState(_0x467d49,_0x1e6662){const _0x14a156=a169_0x36feb0;if(hasFlag(_0x467d49,_0x14a156(0x1b9))){const _0x1ca48e=parseParentId(_0x467d49,'expect-parent-id',{'required':!![]});if(_0x1e6662[_0x14a156(0x1a7)]!==_0x1ca48e)throw stateDrift(_0x14a156(0x20b)+_0x1e6662['id']+_0x14a156(0x1df)+formatParent(_0x1ca48e)+_0x14a156(0x1b5)+formatParent(_0x1e6662[_0x14a156(0x1a7)])+'.');}if(hasFlag(_0x467d49,_0x14a156(0x1ca))){const _0x24f871=_0x467d49['str'](_0x14a156(0x1ca));if(_0x1e6662[_0x14a156(0x1c1)]!==_0x24f871)throw stateDrift(_0x14a156(0x20b)+_0x1e6662['id']+'\x20path\x20changed:\x20expected\x20'+JSON[_0x14a156(0x1f3)](_0x24f871)+_0x14a156(0x1b5)+JSON[_0x14a156(0x1f3)](_0x1e6662[_0x14a156(0x1c1)])+'.');}if(hasFlag(_0x467d49,_0x14a156(0x1ef))){const _0x25ac98=_0x467d49['num'](_0x14a156(0x1ef));if(!Number['isSafeInteger'](_0x25ac98)||_0x25ac98<0x0)throw CliErrors[_0x14a156(0x1d2)]('--expected-children-count\x20must\x20be\x20a\x20non-negative\x20integer.');if(_0x1e6662['childrenCount']!==_0x25ac98)throw stateDrift(_0x14a156(0x20b)+_0x1e6662['id']+_0x14a156(0x1e9)+_0x25ac98+_0x14a156(0x1b5)+_0x1e6662['childrenCount']+'.');}}export function assertVerified(_0x1917df,_0x260b4e,_0x125a0f=a169_0x36feb0(0x1eb)){const _0x433630=a169_0x36feb0;if(!_0x1917df)throw menuError(_0x433630(0x1cf),_0x260b4e,_0x125a0f);}export function mutationResult(_0x4003f0){const _0x24cf2d=a169_0x36feb0;return{'operation':_0x4003f0[_0x24cf2d(0x1bd)],'selector':_0x4003f0[_0x24cf2d(0x1ce)],'before':_0x4003f0[_0x24cf2d(0x20f)],'after':_0x4003f0['after'],'dryRun':_0x4003f0['dryRun'],'backend':_0x4003f0[_0x24cf2d(0x215)],..._0x4003f0[_0x24cf2d(0x1cc)]?{'plannedActions':_0x4003f0[_0x24cf2d(0x1cc)]}:{},..._0x4003f0[_0x24cf2d(0x210)]?{'targets':_0x4003f0[_0x24cf2d(0x210)]}:{},..._0x4003f0[_0x24cf2d(0x1da)]?{'deleteOrder':_0x4003f0[_0x24cf2d(0x1da)]}:{},'snapshotHash':_0x4003f0[_0x24cf2d(0x1fc)],..._0x4003f0[_0x24cf2d(0x1a9)]?{'cascade':_0x4003f0[_0x24cf2d(0x1a9)]}:{},..._0x4003f0[_0x24cf2d(0x1db)]?{'planFile':_0x4003f0[_0x24cf2d(0x1db)]}:{},'succeeded':_0x4003f0[_0x24cf2d(0x1c4)]??[],'failed':_0x4003f0[_0x24cf2d(0x204)]??[],'warnings':_0x4003f0[_0x24cf2d(0x205)]??[],'verification':_0x4003f0[_0x24cf2d(0x212)],'error':_0x4003f0['error']};}export function menuDryRunResult(_0x70ca08,_0x21708f){return{..._0x70ca08,..._0x21708f};}export function menuFailure(_0x3d2620,_0x36eeb6,_0x38a992){const _0x25c6ba=a169_0x36feb0,_0x53735f=mutationResult({..._0x36eeb6,'after':_0x38a992[_0x25c6ba(0x1e5)]===undefined?_0x36eeb6[_0x25c6ba(0x1e5)]:_0x38a992[_0x25c6ba(0x1e5)],'backend':_0x38a992[_0x25c6ba(0x215)]??_0x36eeb6[_0x25c6ba(0x215)],'dryRun':![],'succeeded':_0x38a992[_0x25c6ba(0x1c4)]??[],'failed':_0x38a992[_0x25c6ba(0x1d9)]??[{..._0x38a992[_0x25c6ba(0x204)]??{},'stage':_0x38a992['stage'],'code':_0x3d2620['code'],'message':_0x3d2620[_0x25c6ba(0x1f4)]}],'warnings':[..._0x36eeb6[_0x25c6ba(0x205)],..._0x38a992[_0x25c6ba(0x205)]??[]],'verification':_0x38a992[_0x25c6ba(0x212)],'error':{'code':_0x3d2620[_0x25c6ba(0x209)],'message':_0x3d2620[_0x25c6ba(0x1f4)],..._0x3d2620['hint']?{'hint':_0x3d2620[_0x25c6ba(0x1fa)]}:{}}});return Object[_0x25c6ba(0x202)](_0x3d2620,_0x25c6ba(0x1b0),{'value':_0x53735f,'enumerable':!![],'configurable':!![]}),_0x3d2620;}export function asVerificationError(_0x5eaa51,_0x1e28e4){const _0x40ed70=a169_0x36feb0;if(_0x5eaa51 instanceof CliError&&_0x5eaa51['code']==='menu_verification_failed')return _0x5eaa51;const _0x5aa2a9=_0x5eaa51 instanceof Error?_0x5eaa51['message']:String(_0x5eaa51);return menuError(_0x40ed70(0x1cf),''+_0x1e28e4+(_0x5aa2a9?':\x20'+_0x5aa2a9:''),_0x40ed70(0x1c6));}export function describeMenuErrorCause(_0x4aa0ee,_0x1b813,_0x26d8b6){const _0x2eb6ed=a169_0x36feb0,_0x5ad991=mapMenuApiError(_0x4aa0ee,_0x1b813,_0x26d8b6);return{'causeCode':_0x5ad991[_0x2eb6ed(0x209)],'causeMessage':_0x5ad991[_0x2eb6ed(0x1f4)]};}export function hasFlag(_0x1ffbe3,_0x15cbd7){const _0x1cbd2f=a169_0x36feb0;return Object['prototype'][_0x1cbd2f(0x1aa)]['call'](_0x1ffbe3[_0x1cbd2f(0x1e6)],_0x15cbd7)&&_0x1ffbe3[_0x1cbd2f(0x1e6)][_0x15cbd7]!==undefined;}export function toApiParentId(_0x210d5d){return _0x210d5d??0x0;}export function formatParent(_0x3e2693){const _0x33d6c4=a169_0x36feb0;return _0x3e2693==null?_0x33d6c4(0x1ea):String(_0x3e2693);}export function menuError(_0x1140d0,_0x2103c2,_0x2b532a){return new CliError(_0x1140d0,0x1,_0x2103c2,_0x2b532a);}export function mapMenuApiError(_0x590d84,_0x14a3e0,_0x57a0e5){const _0x4b2ee9=a169_0x36feb0;if(_0x590d84 instanceof CliError&&_0x590d84['code']!==_0x4b2ee9(0x1d7))return _0x590d84;const _0x31f378=_0x590d84 instanceof Error?_0x590d84['message']:String(_0x590d84);if(/HTTP 403|forbidden|permission|无权限|权限不足|没有权限/i[_0x4b2ee9(0x1b2)](_0x31f378))return menuError('menu_permission_denied',_0x4b2ee9(0x1ba)+_0x14a3e0+(_0x57a0e5?_0x4b2ee9(0x1b8)+_0x57a0e5:'')+'.',_0x4b2ee9(0x1fb));return menuError(_0x4b2ee9(0x1f2),'Failed\x20to\x20'+_0x14a3e0+(_0x57a0e5?'\x20menu\x20'+_0x57a0e5:'')+':\x20'+_0x31f378,_0x4b2ee9(0x1b3));}export function isMenuResponseLoss(_0x2fa87c){const _0x4fd326=a169_0x36feb0,_0x11940b=_0x2fa87c instanceof Error?_0x2fa87c[_0x4fd326(0x1f4)]:String(_0x2fa87c);if(_0x2fa87c instanceof CliError)return _0x2fa87c[_0x4fd326(0x209)]==='api_error'&&/^Request (?:failed|timeout):/i[_0x4fd326(0x1b2)](_0x11940b);return/timeout|timed out|ECONNRESET|socket hang up|network|fetch failed|connection closed|aborted|terminated|unexpected end of JSON|premature close|body stream/i[_0x4fd326(0x1b2)](_0x11940b);}function stateDrift(_0x1f6baa){const _0x29f09c=a169_0x36feb0;return menuError('menu_state_drift',_0x1f6baa,_0x29f09c(0x1cb));}
@@ -0,0 +1,2 @@
1
+ /** Canonical comparison key; keep the original page path in requests and output. */
2
+ export declare function menuPathKey(path: string): string;
@@ -0,0 +1 @@
1
+ function a170_0x4301(_0x269fc0,_0x851943){_0x269fc0=_0x269fc0-0xbd;const _0x10e7a8=a170_0x10e7();let _0x43019c=_0x10e7a8[_0x269fc0];return _0x43019c;}(function(_0x1dba6a,_0x3a65df){const _0x8de57b=a170_0x4301,_0x10b0a4=_0x1dba6a();while(!![]){try{const _0x3b134f=-parseInt(_0x8de57b(0xbf))/0x1*(-parseInt(_0x8de57b(0xc0))/0x2)+parseInt(_0x8de57b(0xbe))/0x3*(-parseInt(_0x8de57b(0xc9))/0x4)+-parseInt(_0x8de57b(0xc7))/0x5+-parseInt(_0x8de57b(0xc3))/0x6*(-parseInt(_0x8de57b(0xc4))/0x7)+-parseInt(_0x8de57b(0xc1))/0x8+parseInt(_0x8de57b(0xc5))/0x9*(parseInt(_0x8de57b(0xc2))/0xa)+parseInt(_0x8de57b(0xc6))/0xb*(parseInt(_0x8de57b(0xbd))/0xc);if(_0x3b134f===_0x3a65df)break;else _0x10b0a4['push'](_0x10b0a4['shift']());}catch(_0x2c65a7){_0x10b0a4['push'](_0x10b0a4['shift']());}}}(a170_0x10e7,0x667a6));export function menuPathKey(_0x5f501d){const _0x4b8930=a170_0x4301,_0xb539b5=_0x5f501d[_0x4b8930(0xc8)]();if(!_0xb539b5)return'';return _0xb539b5['replace'](/^\/+/,'')['replace'](/\/+$/,'')||'/';}function a170_0x10e7(){const _0x3504fe=['187EGVrcZ','1566980XYmjFr','trim','106132ELbPLq','421296dWSjIv','93YmFCRV','410485kWvawP','4ljReHH','2807992xKDwRq','390oHNiWY','2330154AtBpun','7aJziUh','23193zKHWHi'];a170_0x10e7=function(){return _0x3504fe;};return a170_0x10e7();}
@@ -9,7 +9,12 @@ export declare function createMenu(appCode: string, cookie: string, params: {
9
9
  export declare function createMenus(appCode: string, cookie: string, pages: Array<{
10
10
  path: string;
11
11
  label: string;
12
- }>, resources?: string[]): Promise<MenuMutationEntity[]>;
12
+ visible?: boolean;
13
+ parentId?: number;
14
+ order?: number;
15
+ }>, resources?: string[], options?: {
16
+ appName?: string;
17
+ }): Promise<MenuMutationEntity[]>;
13
18
  export declare function updateMenuCdnUrl(appCode: string, cookie: string, params: UpdateMenuCdnUrlParams): Promise<MenuMutationEntity>;
14
19
  export declare function createMenuEntity(appCode: string, cookie: string, params: Omit<Menu, "appCode">): Promise<MenuMutationEntity>;
15
20
  export declare function updateMenuEntity(appCode: string, cookie: string, params: Omit<UpdateMenu, "appCode">): Promise<MenuMutationEntity>;
@@ -1 +1 @@
1
- (function(_0x2e07fa,_0x5e174b){const _0x3b9ae6=a169_0x51af,_0x4f6636=_0x2e07fa();while(!![]){try{const _0x321ba6=parseInt(_0x3b9ae6(0x15b))/0x1+-parseInt(_0x3b9ae6(0x151))/0x2+-parseInt(_0x3b9ae6(0x16d))/0x3+parseInt(_0x3b9ae6(0x14e))/0x4+parseInt(_0x3b9ae6(0x161))/0x5*(parseInt(_0x3b9ae6(0x163))/0x6)+-parseInt(_0x3b9ae6(0x16b))/0x7+parseInt(_0x3b9ae6(0x155))/0x8*(parseInt(_0x3b9ae6(0x168))/0x9);if(_0x321ba6===_0x5e174b)break;else _0x4f6636['push'](_0x4f6636['shift']());}catch(_0x1406b8){_0x4f6636['push'](_0x4f6636['shift']());}}}(a169_0x29b0,0x933ab));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a169_0x3085e9,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x16fa23,_0x112291){const _0x46981c=a169_0x51af,_0x2f0916=getEnv();logger[_0x46981c(0x164)](_0x46981c(0x149),isProduction(_0x2f0916)?_0x46981c(0x14d)+_0x16fa23+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x16fa23+')');const _0x62352d=await fetchMenuSnapshot(_0x16fa23,_0x112291,{'verbose':!![]});return logger[_0x46981c(0x164)](_0x46981c(0x149),_0x46981c(0x158)+_0x62352d['total']+_0x46981c(0x160)),_0x62352d[_0x46981c(0x15e)][_0x46981c(0x14f)](toProcessedMenuItem);}export async function createMenu(_0x139065,_0x3e3c1d,_0x322025){const _0x467976=a169_0x51af;logger[_0x467976(0x164)](_0x467976(0x15d),_0x467976(0x166)+_0x322025['label']+'\x20('+_0x322025[_0x467976(0x15a)]+')');const _0x4e27b1={'appCode':_0x139065,'type':_0x467976(0x162),'sort':0x0,'extend':{'loadScriptMode':_0x467976(0x150),'resources':_0x322025[_0x467976(0x14c)]?JSON['stringify'](_0x322025[_0x467976(0x14c)]):undefined},..._0x322025},_0x2bfc65=await createMenuRecord(_0x4e27b1,_0x3e3c1d,_0x467976(0x157)+_0x322025[_0x467976(0x154)]+'\x22');return logger[_0x467976(0x164)](_0x467976(0x15d),_0x467976(0x16a)+_0x322025[_0x467976(0x154)]),_0x2bfc65;}async function createSingleMenu(_0x60e22e,_0x39b2e9,_0xa53ca2,_0x1adfd4){const _0x149eeb=a169_0x51af,_0x212d73={'appCode':_0x60e22e,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x149eeb(0x150),'resources':_0x1adfd4?JSON[_0x149eeb(0x14b)](_0x1adfd4):undefined},'label':_0xa53ca2[_0x149eeb(0x154)],'path':_0xa53ca2[_0x149eeb(0x15a)]},_0x511c55=await createMenuRecord(_0x212d73,_0x39b2e9,'Create\x20menu\x20\x22'+_0xa53ca2['label']+'\x22');return logger[_0x149eeb(0x164)](_0x149eeb(0x15d),_0x149eeb(0x16a)+_0xa53ca2[_0x149eeb(0x154)]),_0x511c55;}export async function createMenus(_0x1e2325,_0x2dda23,_0x479a77,_0x5e2ada){const _0x856301=a169_0x51af;logger[_0x856301(0x164)]('create-menus',_0x856301(0x156)+_0x479a77[_0x856301(0x169)]);const _0x3afb40=await Promise[_0x856301(0x152)](_0x479a77['map'](_0x49121a=>createSingleMenu(_0x1e2325,_0x2dda23,_0x49121a,_0x5e2ada)));return logger[_0x856301(0x164)](_0x856301(0x15c),_0x856301(0x16c)+_0x479a77['length']),_0x3afb40;}function a169_0x29b0(){const _0x31349e=['Update\x20menu\x20assets\x20\x22','\x20online\x20menus\x20successfully','25QuzBYS','procode','281514jcaBVh','info','update-menu-cdn-url','Creating\x20menu:\x20','Menu\x20assets\x20synced:\x20','25902NkuRTD','length','Menu\x20created\x20successfully:\x20','7157094tKaSwS','Batch\x20menu\x20creation\x20completed,\x20total\x20','1843725QrkUBl','get-online-menu-list','Update\x20menu\x20','stringify','resources','Fetching\x20online\x20menu\x20list...\x20(appCode:\x20','313260hfiCSs','map','import','1535246ETeAkU','all','menuGroups','label','5208yVBxtt','Start\x20batch\x20menu\x20creation,\x20total\x20','Create\x20menu\x20\x22','Fetched\x20','Delete\x20','path','821203lnInXz','create-menus','create-menu','menus'];a169_0x29b0=function(){return _0x31349e;};return a169_0x29b0();}function a169_0x51af(_0x4760ca,_0x229d02){_0x4760ca=_0x4760ca-0x149;const _0x29b0c9=a169_0x29b0();let _0x51afc1=_0x29b0c9[_0x4760ca];return _0x51afc1;}export async function updateMenuCdnUrl(_0x1464b3,_0x38b0c6,_0x25637a){const _0x488f0f=a169_0x51af;logger['info'](_0x488f0f(0x165),'Updating\x20menu\x20asset\x20links:\x20'+_0x25637a[_0x488f0f(0x154)]+'\x20('+_0x25637a[_0x488f0f(0x15a)]+')');const _0x222d25={'id':_0x25637a['id'],'appCode':_0x1464b3,'extend':{..._0x25637a['extend']??{},..._0x25637a['loadScriptMode']?{'loadScriptMode':_0x25637a['loadScriptMode']}:{},'resources':_0x25637a[_0x488f0f(0x14c)]?JSON['stringify'](_0x25637a[_0x488f0f(0x14c)]):undefined}},_0x3e66e6=await updateMenuRecord(_0x222d25,_0x38b0c6,_0x488f0f(0x15f)+_0x25637a[_0x488f0f(0x154)]+'\x22');return logger['info'](_0x488f0f(0x165),_0x488f0f(0x167)+_0x25637a[_0x488f0f(0x154)],undefined),_0x3e66e6;}export async function createMenuEntity(_0x573a8d,_0x1a5ca1,_0x165761){return createMenuRecord({'appCode':_0x573a8d,..._0x165761},_0x1a5ca1,'Create\x20menu\x20\x22'+_0x165761['label']+'\x22');}export async function updateMenuEntity(_0x531445,_0x4f56dd,_0x52e4eb){const _0x321664=a169_0x51af;return updateMenuRecord({'appCode':_0x531445,..._0x52e4eb},_0x4f56dd,_0x321664(0x14a)+_0x52e4eb['id']);}export async function batchDeleteMenuEntities(_0x2fa3d7,_0x281b95){const _0x160d02=a169_0x51af;return batchDeleteMenuRecords(_0x281b95,_0x2fa3d7,_0x160d02(0x159)+_0x281b95[_0x160d02(0x169)]+'\x20menu'+(_0x281b95[_0x160d02(0x169)]===0x1?'':'s'));}export async function startMenuRegroup(_0x35c59f,_0x3d2267){const _0x3c1fec=a169_0x51af;return a169_0x3085e9(_0x3d2267,_0x35c59f,'Regroup\x20'+_0x3d2267[_0x3c1fec(0x153)][_0x3c1fec(0x169)]+'\x20menu\x20group(s)');}
1
+ (function(_0x4426f7,_0x5608c1){const _0x374716=a171_0x454e,_0x41ec18=_0x4426f7();while(!![]){try{const _0x1ccbab=-parseInt(_0x374716(0x107))/0x1+-parseInt(_0x374716(0x102))/0x2+-parseInt(_0x374716(0x100))/0x3+parseInt(_0x374716(0x114))/0x4+parseInt(_0x374716(0x10b))/0x5+-parseInt(_0x374716(0xf9))/0x6+parseInt(_0x374716(0x118))/0x7*(parseInt(_0x374716(0x11b))/0x8);if(_0x1ccbab===_0x5608c1)break;else _0x41ec18['push'](_0x41ec18['shift']());}catch(_0x3c8036){_0x41ec18['push'](_0x41ec18['shift']());}}}(a171_0x255f,0x5ce68));import{getEnv,isProduction}from'../../../constant/env.js';import{logger}from'../../../utils/logger.js';import{fetchMenuSnapshot,toProcessedMenuItem}from'../../../commands/menu/shared/facts.js';import{batchDeleteMenuRecords,createMenuRecord,startMenuRegroup as a171_0x2248c0,updateMenuRecord}from'../../../core/api-client.js';export async function getOnlineMenuList(_0x1d7664,_0x4790ee){const _0x3f7133=a171_0x454e,_0x5c97ab=getEnv();logger[_0x3f7133(0x11d)](_0x3f7133(0x11c),isProduction(_0x5c97ab)?'Fetching\x20online\x20menu\x20list...\x20(appCode:\x20'+_0x1d7664+')':'Fetching\x20daily\x20menu\x20list...\x20(appCode:\x20'+_0x1d7664+')');const _0x30c6b6=await fetchMenuSnapshot(_0x1d7664,_0x4790ee,{'verbose':!![]});return logger[_0x3f7133(0x11d)]('get-online-menu-list','Fetched\x20'+_0x30c6b6['total']+'\x20online\x20menus\x20successfully'),_0x30c6b6[_0x3f7133(0x116)][_0x3f7133(0xf6)](toProcessedMenuItem);}export async function createMenu(_0x56ea77,_0x45114c,_0x1e6781){const _0x2fed26=a171_0x454e;logger[_0x2fed26(0x11d)](_0x2fed26(0x115),_0x2fed26(0x10a)+_0x1e6781[_0x2fed26(0x110)]+'\x20('+_0x1e6781[_0x2fed26(0x105)]+')');const _0x165ea0={'appCode':_0x56ea77,'type':_0x2fed26(0xf7),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x1e6781[_0x2fed26(0xf8)]?JSON[_0x2fed26(0x111)](_0x1e6781[_0x2fed26(0xf8)]):undefined},..._0x1e6781},_0x30cdb8=await createMenuRecord(_0x165ea0,_0x45114c,'Create\x20menu\x20\x22'+_0x1e6781[_0x2fed26(0x110)]+'\x22');return logger['info'](_0x2fed26(0x115),'Menu\x20created\x20successfully:\x20'+_0x1e6781[_0x2fed26(0x110)]),_0x30cdb8;}function a171_0x255f(){const _0x2adc47=['Menu\x20created\x20successfully:\x20','\x20menu\x20group(s)','import','Updating\x20menu\x20asset\x20links:\x20','1762992FBSXLo','\x20menu','602928NNXpZi','Menu\x20assets\x20synced:\x20','visible','path','all','58471vJbAeD','length','boolean','Creating\x20menu:\x20','633300RCkIOC','extend','update-menu-cdn-url','parentId','Create\x20menu\x20\x22','label','stringify','create-menus','appName','822624cnecuL','create-menu','menus','Update\x20menu\x20assets\x20\x22','8903335MOkYxp','Batch\x20menu\x20creation\x20completed,\x20total\x20','order','8AJhWSL','get-online-menu-list','info','number','map','procode','resources','1656612cpPmCk','loadScriptMode','Regroup\x20'];a171_0x255f=function(){return _0x2adc47;};return a171_0x255f();}async function createSingleMenu(_0x2eb70a,_0x454f2f,_0x45d9ce,_0x40e1bc,_0x5afd57){const _0x48c6d0=a171_0x454e,_0xc002fd={'appCode':_0x2eb70a,'type':'procode','sort':_0x48c6d0(0x11a)in _0x45d9ce&&typeof _0x45d9ce[_0x48c6d0(0x11a)]==='number'?_0x45d9ce[_0x48c6d0(0x11a)]:0x0,..._0x48c6d0(0x104)in _0x45d9ce&&typeof _0x45d9ce[_0x48c6d0(0x104)]===_0x48c6d0(0x109)?{'visible':_0x45d9ce[_0x48c6d0(0x104)]}:{},..._0x48c6d0(0x10e)in _0x45d9ce&&typeof _0x45d9ce[_0x48c6d0(0x10e)]===_0x48c6d0(0x11e)?{'parentId':_0x45d9ce[_0x48c6d0(0x10e)]}:{},'extend':{..._0x5afd57?.[_0x48c6d0(0x113)]?{'appName':_0x5afd57[_0x48c6d0(0x113)]}:{},'loadScriptMode':_0x48c6d0(0xfe),'resources':_0x40e1bc?JSON[_0x48c6d0(0x111)](_0x40e1bc):undefined},'label':_0x45d9ce[_0x48c6d0(0x110)],'path':_0x45d9ce['path']},_0x288c6b=await createMenuRecord(_0xc002fd,_0x454f2f,_0x48c6d0(0x10f)+_0x45d9ce[_0x48c6d0(0x110)]+'\x22');return logger[_0x48c6d0(0x11d)](_0x48c6d0(0x115),_0x48c6d0(0xfc)+_0x45d9ce['label']),_0x288c6b;}export async function createMenus(_0x45e652,_0x25b0cf,_0x426a14,_0x4d456a,_0xc7b150){const _0x4d0f9e=a171_0x454e;logger[_0x4d0f9e(0x11d)]('create-menus','Start\x20batch\x20menu\x20creation,\x20total\x20'+_0x426a14[_0x4d0f9e(0x108)]);const _0x287fb9=await Promise[_0x4d0f9e(0x106)](_0x426a14[_0x4d0f9e(0xf6)](_0x55869b=>createSingleMenu(_0x45e652,_0x25b0cf,_0x55869b,_0x4d456a,_0xc7b150)));return logger[_0x4d0f9e(0x11d)](_0x4d0f9e(0x112),_0x4d0f9e(0x119)+_0x426a14['length']),_0x287fb9;}export async function updateMenuCdnUrl(_0x1625d4,_0x236305,_0x21d54f){const _0x156b25=a171_0x454e;logger[_0x156b25(0x11d)](_0x156b25(0x10d),_0x156b25(0xff)+_0x21d54f[_0x156b25(0x110)]+'\x20('+_0x21d54f['path']+')');const _0x35c117={'id':_0x21d54f['id'],'appCode':_0x1625d4,'extend':{..._0x21d54f[_0x156b25(0x10c)]??{},..._0x21d54f[_0x156b25(0xfa)]?{'loadScriptMode':_0x21d54f[_0x156b25(0xfa)]}:{},'resources':_0x21d54f['resources']?JSON[_0x156b25(0x111)](_0x21d54f['resources']):undefined}},_0xa43cb4=await updateMenuRecord(_0x35c117,_0x236305,_0x156b25(0x117)+_0x21d54f[_0x156b25(0x110)]+'\x22');return logger['info'](_0x156b25(0x10d),_0x156b25(0x103)+_0x21d54f[_0x156b25(0x110)],undefined),_0xa43cb4;}export async function createMenuEntity(_0x490b57,_0x4cd603,_0xbdebc2){const _0xd90f66=a171_0x454e;return createMenuRecord({'appCode':_0x490b57,..._0xbdebc2},_0x4cd603,_0xd90f66(0x10f)+_0xbdebc2['label']+'\x22');}export async function updateMenuEntity(_0x517e29,_0x580e52,_0x94fe76){return updateMenuRecord({'appCode':_0x517e29,..._0x94fe76},_0x580e52,'Update\x20menu\x20'+_0x94fe76['id']);}function a171_0x454e(_0x34c66a,_0x394c58){_0x34c66a=_0x34c66a-0xf6;const _0x255f3f=a171_0x255f();let _0x454e4a=_0x255f3f[_0x34c66a];return _0x454e4a;}export async function batchDeleteMenuEntities(_0x144f78,_0x176e75){const _0x5109fd=a171_0x454e;return batchDeleteMenuRecords(_0x176e75,_0x144f78,'Delete\x20'+_0x176e75[_0x5109fd(0x108)]+_0x5109fd(0x101)+(_0x176e75[_0x5109fd(0x108)]===0x1?'':'s'));}export async function startMenuRegroup(_0x2f148c,_0xb9b261){const _0x47d419=a171_0x454e;return a171_0x2248c0(_0xb9b261,_0x2f148c,_0x47d419(0xfb)+_0xb9b261['menuGroups'][_0x47d419(0x108)]+_0x47d419(0xfd));}
@@ -0,0 +1,28 @@
1
+ import type { SmartAppRecord } from "../../../core/api-client.js";
2
+ import type { ProcessedMenuItem } from "../../../commands/menu/shared/types.js";
3
+ import type { FlagDef, RuntimeContext } from "../../../framework/types.js";
4
+ export declare function buildSubappAssetsStatus(app: Pick<SmartAppRecord, "extend">, menus: ProcessedMenuItem[], appName: string): {
5
+ appName: string;
6
+ hostCapabilityVerified: boolean;
7
+ sharedConfigured: boolean;
8
+ sharedResources: string[];
9
+ loadScriptMode: {} | null;
10
+ basename: {} | null;
11
+ boundMenus: number;
12
+ staleMenuFallbacks: number;
13
+ menus: {
14
+ id: number;
15
+ path: string;
16
+ preferredSourceIfSupported: string;
17
+ preferredResourcesIfSupported: string[] | null;
18
+ menuFallbackResources: string[] | null;
19
+ menuFallbackError: string | null;
20
+ fallbackDiffers: boolean | null;
21
+ }[];
22
+ };
23
+ export declare function assertSharedResourcesConfigured(appCode: string, cookie: string, appName: string): Promise<void>;
24
+ export declare const SUBAPP_ASSET_SELECTOR_FLAGS: FlagDef[];
25
+ export declare function getSubappSelector(ctx: Pick<RuntimeContext, "str" | "appCode">): {
26
+ appCode: string;
27
+ appName: string;
28
+ };
@@ -0,0 +1 @@
1
+ function a172_0x228b(){const _0x5ddd33=['1777512vaAOaq','map','validation','app','string','2643861errxEY','780sdnLyC','app.extend.assets\x20must\x20be\x20an\x20array.','\x20resources','length','trim','menu\x20','246301QnQDbw','\x20must\x20be\x20an\x20array\x20of\x20URLs.','sharedResources','893014UebciJ','102294ZQXGPI','object','app.extend','str','10crcpjZ','message','assets','Duplicate\x20subapp\x20records\x20for\x20','\x20contains\x20invalid\x20JSON.','--app-name\x20is\x20required.','menu','resources','filter','appCode','subapp.resources','\x20must\x20be\x20a\x20JSON\x20string\x20of\x20URLs.','Explicit\x20frontend\x20subapp\x20appName\x20matching\x20host\x20assets\x20and\x20menu\x20bindings;\x20not\x20inferred\x20from\x20package\x20name\x20or\x20app\x20code','appName','stringify','Menu\x20host\x20app\x20code;\x20overrides\x20the\x20selected\x20workspace\x20app','\x20must\x20be\x20a\x20JSON\x20object.','21QPcDlm','extend','36BCsdpw','parse','app-name','No\x20shared\x20resources\x20configured\x20for\x20','isArray','path','62332LuWBKo','sharedConfigured','623892UWhjOc','some'];a172_0x228b=function(){return _0x5ddd33;};return a172_0x228b();}const a172_0x371033=a172_0x30a4;(function(_0x45a35b,_0x3fa892){const _0x269411=a172_0x30a4,_0x4dd415=_0x45a35b();while(!![]){try{const _0x10101b=-parseInt(_0x269411(0x1db))/0x1+-parseInt(_0x269411(0x1dc))/0x2+-parseInt(_0x269411(0x1d1))/0x3+parseInt(_0x269411(0x1c8))/0x4*(parseInt(_0x269411(0x1af))/0x5)+parseInt(_0x269411(0x1ca))/0x6*(-parseInt(_0x269411(0x1c0))/0x7)+-parseInt(_0x269411(0x1cc))/0x8*(-parseInt(_0x269411(0x1c2))/0x9)+-parseInt(_0x269411(0x1d2))/0xa*(-parseInt(_0x269411(0x1d8))/0xb);if(_0x10101b===_0x3fa892)break;else _0x4dd415['push'](_0x4dd415['shift']());}catch(_0x15e248){_0x4dd415['push'](_0x4dd415['shift']());}}}(a172_0x228b,0x81282));import{getSmartAppRecord}from'../../../core/api-client.js';import{APPCODE_FLAG}from'../../../commands/common/flags.js';import{CliErrors}from'../../../errors.js';function objectValue(_0x371c53,_0x3ac569){const _0x465867=a172_0x30a4,_0x5289ec=typeof _0x371c53===_0x465867(0x1d0)?parseJson(_0x371c53,_0x3ac569):_0x371c53;if(!_0x5289ec||typeof _0x5289ec!==_0x465867(0x1dd)||Array[_0x465867(0x1c6)](_0x5289ec))throw CliErrors[_0x465867(0x1ce)](_0x3ac569+_0x465867(0x1bf));return _0x5289ec;}function parseJson(_0x4f0121,_0x998f2e){const _0x52438b=a172_0x30a4;try{return JSON[_0x52438b(0x1c3)](_0x4f0121);}catch{throw CliErrors[_0x52438b(0x1ce)](_0x998f2e+_0x52438b(0x1b3));}}function resourceList(_0x28a40a,_0x2145e6){const _0x1227da=a172_0x30a4;if(typeof _0x28a40a!==_0x1227da(0x1d0))throw CliErrors[_0x1227da(0x1ce)](_0x2145e6+_0x1227da(0x1ba));const _0x1ae707=parseJson(_0x28a40a,_0x2145e6);if(!Array[_0x1227da(0x1c6)](_0x1ae707)||_0x1ae707[_0x1227da(0x1cb)](_0x421d6e=>typeof _0x421d6e!==_0x1227da(0x1d0)))throw CliErrors['validation'](_0x2145e6+_0x1227da(0x1d9));return _0x1ae707;}function a172_0x30a4(_0x586cf7,_0x105aae){_0x586cf7=_0x586cf7-0x1ad;const _0x228ba4=a172_0x228b();let _0x30a440=_0x228ba4[_0x586cf7];return _0x30a440;}export function buildSubappAssetsStatus(_0x22a441,_0x55582d,_0x1a9fa0){const _0x131777=a172_0x30a4,_0x5a9522=_0x22a441[_0x131777(0x1c1)]==null?{}:objectValue(_0x22a441[_0x131777(0x1c1)],_0x131777(0x1ad)),_0x2eb0db=_0x5a9522['assets']==null?[]:typeof _0x5a9522[_0x131777(0x1b1)]===_0x131777(0x1d0)?parseJson(_0x5a9522[_0x131777(0x1b1)],'app.extend.assets'):_0x5a9522['assets'];if(!Array[_0x131777(0x1c6)](_0x2eb0db))throw CliErrors[_0x131777(0x1ce)](_0x131777(0x1d3));const _0x47ee82=_0x2eb0db[_0x131777(0x1cd)]((_0x2a6703,_0x3cdcc0)=>objectValue(_0x2a6703,'app.extend.assets['+_0x3cdcc0+']')),_0x5a42e3=_0x47ee82[_0x131777(0x1b7)](_0x29a87d=>_0x29a87d[_0x131777(0x1bc)]===_0x1a9fa0);if(_0x5a42e3[_0x131777(0x1d5)]>0x1)throw CliErrors[_0x131777(0x1ce)](_0x131777(0x1b2)+_0x1a9fa0+'.');const _0x437a99=_0x5a42e3[0x0],_0x52a254=_0x437a99?.[_0x131777(0x1b6)]==null?[]:resourceList(_0x437a99['resources'],_0x131777(0x1b9)),_0x40281d=_0x55582d[_0x131777(0x1b7)](_0x35bd91=>_0x35bd91['extend']?.['appName']===_0x1a9fa0),_0x25e5b7=_0x40281d[_0x131777(0x1cd)](_0xcbcdc=>{const _0x296b62=_0x131777;let _0x2f13ed=null,_0x49293b=null;try{_0x2f13ed=_0xcbcdc[_0x296b62(0x1c1)]?.[_0x296b62(0x1b6)]==null?_0xcbcdc[_0x296b62(0x1b6)]:resourceList(_0xcbcdc[_0x296b62(0x1c1)][_0x296b62(0x1b6)],_0x296b62(0x1d7)+_0xcbcdc['id']+_0x296b62(0x1d4));}catch(_0x37590b){_0x49293b=_0x37590b instanceof Error?_0x37590b[_0x296b62(0x1b0)]:String(_0x37590b);}const _0x42f178=_0x52a254[_0x296b62(0x1d5)]>0x0?'app':_0x296b62(0x1b5),_0x3ae1b7=_0x42f178===_0x296b62(0x1cf)?_0x52a254:_0x2f13ed;return{'id':_0xcbcdc['id'],'path':_0xcbcdc[_0x296b62(0x1c7)],'preferredSourceIfSupported':_0x42f178,'preferredResourcesIfSupported':_0x3ae1b7,'menuFallbackResources':_0x2f13ed,'menuFallbackError':_0x49293b,'fallbackDiffers':_0x2f13ed===null?null:_0x42f178===_0x296b62(0x1cf)&&_0x2f13ed['length']>0x0&&JSON[_0x296b62(0x1bd)](_0x2f13ed)!==JSON[_0x296b62(0x1bd)](_0x3ae1b7)};});return{'appName':_0x1a9fa0,'hostCapabilityVerified':![],'sharedConfigured':Boolean(_0x437a99),'sharedResources':_0x52a254,'loadScriptMode':_0x437a99?.['loadScriptMode']??null,'basename':_0x437a99?.['basename']??null,'boundMenus':_0x25e5b7['length'],'staleMenuFallbacks':_0x25e5b7[_0x131777(0x1b7)](_0x22859a=>_0x22859a['fallbackDiffers'])[_0x131777(0x1d5)],'menus':_0x25e5b7};}export async function assertSharedResourcesConfigured(_0x404ec0,_0x50b38d,_0x199ed2){const _0x5857e0=a172_0x30a4,_0x23cb18=await getSmartAppRecord(_0x404ec0,_0x50b38d),_0x4d4753=buildSubappAssetsStatus(_0x23cb18,[],_0x199ed2);if(!_0x4d4753[_0x5857e0(0x1c9)]||_0x4d4753[_0x5857e0(0x1da)][_0x5857e0(0x1d5)]===0x0)throw CliErrors[_0x5857e0(0x1ce)](_0x5857e0(0x1c5)+_0x199ed2+'.');}export const SUBAPP_ASSET_SELECTOR_FLAGS=[{...APPCODE_FLAG,'required':![],'description':a172_0x371033(0x1be)},{'name':a172_0x371033(0x1c4),'type':'string','required':!![],'description':a172_0x371033(0x1bb)}];export function getSubappSelector(_0x417f43){const _0x2aa590=a172_0x371033,_0x46dd67=_0x417f43[_0x2aa590(0x1b8)],_0x2039f6=_0x417f43[_0x2aa590(0x1ae)](_0x2aa590(0x1c4))[_0x2aa590(0x1d6)]();if(!_0x2039f6)throw CliErrors[_0x2aa590(0x1ce)](_0x2aa590(0x1b4));return{'appCode':_0x46dd67,'appName':_0x2039f6};}
@@ -1,7 +1,8 @@
1
- import type { MenuSyncParams, SyncResult } from "../../../commands/menu/shared/types.js";
1
+ import type { LocalPage, MenuSyncParams, ProcessedMenuItem, SyncResult } from "../../../commands/menu/shared/types.js";
2
2
  interface MenuSyncOptions {
3
3
  dryRun?: boolean;
4
4
  }
5
+ export declare function resolvePage(page: LocalPage, params: MenuSyncParams, online: ProcessedMenuItem[]): LocalPage;
5
6
  export declare function runMenuSyncCore(appCode: string, cookie: string, selectedPaths?: string[], paramsFlag?: string, options?: MenuSyncOptions): Promise<SyncResult>;
6
7
  export declare function parseMenuSyncParams(paramsFlag: unknown): MenuSyncParams;
7
8
  export {};
@@ -1 +1 @@
1
- const a170_0x34ce01=a170_0x509a;function a170_0x37c3(){const _0xb200cf=['1457218XRPNii','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','hasOwn','Invalid\x20--params\x20JSON.','Invalid\x20--params:\x20','push','253284lcYBHV','isArray','3320XDpmhL','No\x20local\x20pages\x20matched\x20paths:\x20','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','3079470Zpetvm','CSS\x20URL\x20is\x20unreachable:\x20','keys','jsUrl','get','Invalid\x20--params.','length','cwd','object','3807ujJBfO','trim','cssUrl','Menu\x20sync\x20completed','path','procode','pages','menu-sync','dryRun','57960wcZctc','JS\x20URL\x20is\x20unreachable:\x20','\x0a\x20\x20Available\x20local\x20paths:\x20','has','Start\x20non-interactive\x20menu\x20sync','filter','setLogPath','map','string','65154KNdgMN','16FeuESB','50DZhglq','join','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','info','parse','274296vFTFNb','import'];a170_0x37c3=function(){return _0xb200cf;};return a170_0x37c3();}(function(_0x5abb24,_0x34b926){const _0x35d6b2=a170_0x509a,_0x7560d6=_0x5abb24();while(!![]){try{const _0x389923=parseInt(_0x35d6b2(0x14d))/0x1+parseInt(_0x35d6b2(0x145))/0x2+-parseInt(_0x35d6b2(0x135))/0x3*(parseInt(_0x35d6b2(0x13f))/0x4)+-parseInt(_0x35d6b2(0x140))/0x5*(parseInt(_0x35d6b2(0x13e))/0x6)+-parseInt(_0x35d6b2(0x147))/0x7+parseInt(_0x35d6b2(0x14f))/0x8*(-parseInt(_0x35d6b2(0x12c))/0x9)+parseInt(_0x35d6b2(0x152))/0xa;if(_0x389923===_0x34b926)break;else _0x7560d6['push'](_0x7560d6['shift']());}catch(_0x3bae64){_0x7560d6['push'](_0x7560d6['shift']());}}}(a170_0x37c3,0x1f716));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';const MENU_SYNC_PARAM_KEYS=new Set([a170_0x34ce01(0x155),a170_0x34ce01(0x12e)]);function validateParams(_0xa5eaf0){const _0x19358a=a170_0x34ce01,_0x3584c8=[];return _0xa5eaf0['jsUrl']&&!isValidJsHttpsUrl(_0xa5eaf0['jsUrl'])&&_0x3584c8[_0x19358a(0x14c)]({'field':_0x19358a(0x155),'message':_0x19358a(0x142)}),_0xa5eaf0[_0x19358a(0x12e)]&&!isValidCssHttpsUrl(_0xa5eaf0[_0x19358a(0x12e)])&&_0x3584c8[_0x19358a(0x14c)]({'field':_0x19358a(0x12e),'message':_0x19358a(0x148)}),_0x3584c8;}function a170_0x509a(_0x461ce0,_0x153ad3){_0x461ce0=_0x461ce0-0x12b;const _0x37c3c4=a170_0x37c3();let _0x509a1a=_0x37c3c4[_0x461ce0];return _0x509a1a;}export async function runMenuSyncCore(_0x1f4a77,_0x327e07,_0x36182f=[],_0x4a56cb,_0x41b038={}){const _0x14b7ce=a170_0x34ce01,_0x88eece=parseMenuSyncParams(_0x4a56cb),_0x291af8=[...new Set(_0x36182f[_0x14b7ce(0x13c)](_0x33f010=>_0x33f010[_0x14b7ce(0x12d)]())[_0x14b7ce(0x13a)](Boolean))],_0x2b1cd5=_0x88eece[_0x14b7ce(0x155)],_0x552c20=_0x88eece[_0x14b7ce(0x12e)],_0x253c4d=[];if(_0x2b1cd5)_0x253c4d['push'](_0x2b1cd5);if(_0x552c20)_0x253c4d['push'](_0x552c20);const _0x444ab5=validateParams(_0x88eece);if(_0x444ab5[_0x14b7ce(0x158)]>0x0){const _0x33f0ed=_0x444ab5[_0x14b7ce(0x13c)](_0x3806c6=>'--params.'+_0x3806c6['field']+':\x20'+_0x3806c6['message'])[_0x14b7ce(0x141)](';\x20');throw new Error(_0x14b7ce(0x14b)+_0x33f0ed);}logger[_0x14b7ce(0x13b)](process[_0x14b7ce(0x159)]()),logger[_0x14b7ce(0x143)](_0x14b7ce(0x133),_0x14b7ce(0x139),{'appCode':_0x1f4a77,'selectedCount':_0x291af8[_0x14b7ce(0x158)],'jsUrl':_0x2b1cd5,'cssUrl':_0x552c20});if(_0x2b1cd5){const _0x2c619f=await isUrlReachable(_0x2b1cd5);if(!_0x2c619f)throw new Error(_0x14b7ce(0x136)+_0x2b1cd5);}if(_0x552c20){const _0x58e946=await isUrlReachable(_0x552c20);if(!_0x58e946)throw new Error(_0x14b7ce(0x153)+_0x552c20);}const _0x522b1b=getLocalPages();if(_0x522b1b[_0x14b7ce(0x158)]===0x0){if(_0x291af8[_0x14b7ce(0x158)]>0x0)throw new Error(_0x14b7ce(0x150)+_0x291af8['join'](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x41b038[_0x14b7ce(0x134)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x1d0a0f=await getOnlineMenuList(_0x1f4a77,_0x327e07),_0x284b50=new Set(_0x1d0a0f[_0x14b7ce(0x13c)](_0x1d7cbc=>_0x1d7cbc[_0x14b7ce(0x130)]));let _0x19d5f0;if(_0x291af8[_0x14b7ce(0x158)]>0x0){const _0x130198=new Map(_0x522b1b[_0x14b7ce(0x13c)](_0x224b4c=>[_0x224b4c[_0x14b7ce(0x130)],_0x224b4c])),_0xe2abf7=_0x291af8[_0x14b7ce(0x13a)](_0x4106a7=>!_0x130198[_0x14b7ce(0x138)](_0x4106a7));if(_0xe2abf7[_0x14b7ce(0x158)]>0x0){const _0x3c307c=_0x522b1b[_0x14b7ce(0x13c)](_0x22578a=>_0x22578a[_0x14b7ce(0x130)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0xe2abf7[_0x14b7ce(0x141)](',\x20')+_0x14b7ce(0x137)+_0x3c307c);}const _0x48d7f9=_0x291af8['filter'](_0x10dbc6=>_0x284b50['has'](_0x10dbc6));if(_0x48d7f9[_0x14b7ce(0x158)]>0x0)throw new Error(_0x14b7ce(0x151)+_0x48d7f9[_0x14b7ce(0x141)](',\x20'));_0x19d5f0=_0x291af8[_0x14b7ce(0x13c)](_0x48f27d=>_0x130198[_0x14b7ce(0x156)](_0x48f27d));}else _0x19d5f0=_0x522b1b[_0x14b7ce(0x13a)](_0x33f4b3=>!_0x284b50[_0x14b7ce(0x138)](_0x33f4b3[_0x14b7ce(0x130)]));if(_0x19d5f0['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x41b038[_0x14b7ce(0x134)]===!![],'targetPages':[],'plannedMenus':[]};const _0x5f373f=_0x19d5f0['map'](_0x32f01=>({'type':_0x14b7ce(0x131),'path':_0x32f01[_0x14b7ce(0x130)],'label':_0x32f01['label'],'loadScriptMode':_0x14b7ce(0x146),'resources':[..._0x253c4d]}));if(_0x41b038[_0x14b7ce(0x134)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x19d5f0,'plannedMenus':_0x5f373f};const _0x4cd962=await createMenus(_0x1f4a77,_0x327e07,_0x19d5f0,_0x253c4d[_0x14b7ce(0x158)]>0x0?_0x253c4d:undefined);return logger[_0x14b7ce(0x143)](_0x14b7ce(0x133),_0x14b7ce(0x12f),{'count':_0x19d5f0[_0x14b7ce(0x158)],'resources':_0x253c4d}),{'created':_0x4cd962[_0x14b7ce(0x158)],'skipped':![],'dryRun':![],'targetPages':_0x19d5f0,'plannedMenus':_0x5f373f,'menus':_0x4cd962};}export function parseMenuSyncParams(_0x5badb3){const _0x29e9b8=a170_0x34ce01;if(!_0x5badb3||typeof _0x5badb3!==_0x29e9b8(0x13d))return{};let _0x1aeb00;try{_0x1aeb00=JSON[_0x29e9b8(0x144)](_0x5badb3);}catch{throw new Error(_0x29e9b8(0x14a));}if(typeof _0x1aeb00!==_0x29e9b8(0x12b)||_0x1aeb00===null||Array[_0x29e9b8(0x14e)](_0x1aeb00))throw new Error('Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.');const _0x3f061c=_0x1aeb00;if(Object[_0x29e9b8(0x149)](_0x3f061c,_0x29e9b8(0x132)))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0x19334d=Object[_0x29e9b8(0x154)](_0x3f061c)[_0x29e9b8(0x13a)](_0x32e7fb=>!MENU_SYNC_PARAM_KEYS[_0x29e9b8(0x138)](_0x32e7fb));if(_0x19334d['length']>0x0)throw new Error('Invalid\x20--params\x20fields:\x20'+_0x19334d['join'](',\x20')+'.');for(const _0x4b7466 of MENU_SYNC_PARAM_KEYS){const _0x113aba=_0x3f061c[_0x4b7466];if(_0x113aba!==undefined&&(typeof _0x113aba!==_0x29e9b8(0x13d)||_0x113aba[_0x29e9b8(0x12d)]()===''))throw new Error(_0x29e9b8(0x157)+_0x4b7466+':\x20expected\x20a\x20non-empty\x20string.');}return{'jsUrl':typeof _0x3f061c['jsUrl']===_0x29e9b8(0x13d)?_0x3f061c[_0x29e9b8(0x155)][_0x29e9b8(0x12d)]():undefined,'cssUrl':typeof _0x3f061c['cssUrl']===_0x29e9b8(0x13d)?_0x3f061c[_0x29e9b8(0x12e)][_0x29e9b8(0x12d)]():undefined};}
1
+ const a173_0x1849ab=a173_0x3d41;(function(_0x231e52,_0x3b1e74){const _0x395f32=a173_0x3d41,_0x287289=_0x231e52();while(!![]){try{const _0x50ed4f=parseInt(_0x395f32(0x1f1))/0x1*(-parseInt(_0x395f32(0x207))/0x2)+parseInt(_0x395f32(0x1d2))/0x3*(-parseInt(_0x395f32(0x200))/0x4)+-parseInt(_0x395f32(0x1e5))/0x5*(parseInt(_0x395f32(0x1eb))/0x6)+-parseInt(_0x395f32(0x1ce))/0x7*(-parseInt(_0x395f32(0x209))/0x8)+-parseInt(_0x395f32(0x1d1))/0x9*(parseInt(_0x395f32(0x1f4))/0xa)+-parseInt(_0x395f32(0x1e0))/0xb*(-parseInt(_0x395f32(0x1ea))/0xc)+-parseInt(_0x395f32(0x1f7))/0xd*(-parseInt(_0x395f32(0x1e8))/0xe);if(_0x50ed4f===_0x3b1e74)break;else _0x287289['push'](_0x287289['shift']());}catch(_0x44a052){_0x287289['push'](_0x287289['shift']());}}}(a173_0x1a85,0xe0bc1));import{getLocalPages}from'../../../commands/menu/shared/local-pages.js';function a173_0x3d41(_0x31408b,_0x3fd168){_0x31408b=_0x31408b-0x1cd;const _0x1a85e7=a173_0x1a85();let _0x3d410f=_0x1a85e7[_0x31408b];return _0x3d410f;}import{getOnlineMenuList,createMenus}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{menuPathKey}from'../../../commands/menu/shared/path.js';function a173_0x1a85(){const _0xe96fe0=['label','field','13VStHWx','filter','Invalid\x20--params.parentId:\x20expected\x20a\x20non-negative\x20integer.','dryRun','Invalid\x20--params.','isArray','Invalid\x20--params:\x20','object','string','111956zbYTRK','group','visible','Parent\x20','CSS\x20URL\x20is\x20unreachable:\x20','isInteger','menu-sync','348388UmHJYp','join','12744272eVqFEL','JS\x20URL\x20is\x20unreachable:\x20','hasOwn','path','7NdxYkZ','Menu\x20sync\x20completed','get','2470536AoPqbH','3yAmehc','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL',':\x20expected\x20a\x20non-empty\x20string.','type','Start\x20non-interactive\x20menu\x20sync','jsUrl','appName','has','cwd','Expected\x20one\x20folder\x20named\x20\x22','trim','--params.','import','order','13644983oRuuHP','Invalid\x20--params\x20fields:\x20','cssUrl','setLogPath','push','10IsVUnP','length','No\x20local\x20pages\x20matched\x20paths:\x20','7812378elEbXu','\x0a\x20\x20Available\x20local\x20paths:\x20','12OdeWuV','1200426eTdWZx','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','Invalid\x20--params.visible:\x20expected\x20a\x20boolean.','boolean','number','map','7YlZfaj','keys','parentId','30uTSscr'];a173_0x1a85=function(){return _0xe96fe0;};return a173_0x1a85();}import{logger}from'../../../utils/logger.js';import{assertSharedResourcesConfigured}from'../../../commands/menu/shared/subapp-assets.js';const MENU_SYNC_PARAM_KEYS=new Set([a173_0x1849ab(0x1d7),a173_0x1849ab(0x1e2),'appName',a173_0x1849ab(0x202),'parentId']);export function resolvePage(_0x496a3c,_0x49ac05,_0x2c8c64){const _0x5dccb0=a173_0x1849ab;let _0x145635=_0x49ac05['parentId']??_0x496a3c[_0x5dccb0(0x1f3)];if(_0x145635===undefined&&_0x496a3c[_0x5dccb0(0x201)]){const _0xe6f0ef=_0x2c8c64[_0x5dccb0(0x1f8)](_0x218576=>_0x218576[_0x5dccb0(0x1d5)]==='folder'&&_0x218576[_0x5dccb0(0x1f5)]===_0x496a3c[_0x5dccb0(0x201)]);if(_0xe6f0ef['length']!==0x1)throw new Error(_0x5dccb0(0x1db)+_0x496a3c[_0x5dccb0(0x201)]+'\x22\x20for\x20'+_0x496a3c[_0x5dccb0(0x1cd)]+';\x20found\x20'+_0xe6f0ef[_0x5dccb0(0x1e6)]);_0x145635=_0xe6f0ef[0x0]['id'];}if(_0x145635!==undefined&&_0x145635!==0x0&&_0x2c8c64['filter'](_0xf286a1=>_0xf286a1['id']===_0x145635&&_0xf286a1[_0x5dccb0(0x1d5)]==='folder')[_0x5dccb0(0x1e6)]!==0x1)throw new Error(_0x5dccb0(0x203)+_0x145635+'\x20must\x20be\x20an\x20existing\x20folder\x20in\x20the\x20selected\x20menu\x20host.');return{..._0x496a3c,..._0x145635===undefined?{}:{'parentId':_0x145635},..._0x49ac05['visible']===undefined?{}:{'visible':_0x49ac05['visible']}};}function validateParams(_0x49594a){const _0x33dc7c=a173_0x1849ab,_0x4f3480=[];return _0x49594a[_0x33dc7c(0x1d7)]&&!isValidJsHttpsUrl(_0x49594a[_0x33dc7c(0x1d7)])&&_0x4f3480[_0x33dc7c(0x1e4)]({'field':_0x33dc7c(0x1d7),'message':_0x33dc7c(0x1d3)}),_0x49594a[_0x33dc7c(0x1e2)]&&!isValidCssHttpsUrl(_0x49594a[_0x33dc7c(0x1e2)])&&_0x4f3480['push']({'field':_0x33dc7c(0x1e2),'message':'CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL'}),_0x4f3480;}export async function runMenuSyncCore(_0x42206b,_0x1536dc,_0xaf3ec1=[],_0x1160d5,_0x5c4eb9={}){const _0x2527d4=a173_0x1849ab,_0x3225a9=parseMenuSyncParams(_0x1160d5),_0x59b7a3=[...new Set(_0xaf3ec1[_0x2527d4(0x1f0)](_0xb49c88=>_0xb49c88[_0x2527d4(0x1dc)]())[_0x2527d4(0x1f8)](Boolean)[_0x2527d4(0x1f0)](menuPathKey))],_0x236533=_0x3225a9[_0x2527d4(0x1d7)],_0x38622e=_0x3225a9['cssUrl'],_0x45b3c3=[];if(_0x236533)_0x45b3c3[_0x2527d4(0x1e4)](_0x236533);if(_0x38622e)_0x45b3c3['push'](_0x38622e);const _0x5dfd3b=validateParams(_0x3225a9);if(_0x5dfd3b[_0x2527d4(0x1e6)]>0x0){const _0x30bb31=_0x5dfd3b[_0x2527d4(0x1f0)](_0x26a170=>_0x2527d4(0x1dd)+_0x26a170[_0x2527d4(0x1f6)]+':\x20'+_0x26a170['message'])[_0x2527d4(0x208)](';\x20');throw new Error(_0x2527d4(0x1fd)+_0x30bb31);}logger[_0x2527d4(0x1e3)](process[_0x2527d4(0x1da)]()),logger['info'](_0x2527d4(0x206),_0x2527d4(0x1d6),{'appCode':_0x42206b,'selectedCount':_0x59b7a3[_0x2527d4(0x1e6)],'jsUrl':_0x236533,'cssUrl':_0x38622e});if(_0x236533){const _0x481778=await isUrlReachable(_0x236533);if(!_0x481778)throw new Error(_0x2527d4(0x20a)+_0x236533);}if(_0x38622e){const _0x5d0eb2=await isUrlReachable(_0x38622e);if(!_0x5d0eb2)throw new Error(_0x2527d4(0x204)+_0x38622e);}const _0x5c9970=getLocalPages();if(_0x5c9970[_0x2527d4(0x1e6)]===0x0){if(_0x59b7a3[_0x2527d4(0x1e6)]>0x0)throw new Error(_0x2527d4(0x1e7)+_0x59b7a3[_0x2527d4(0x208)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x5c4eb9[_0x2527d4(0x1fa)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x1b5ddd=await getOnlineMenuList(_0x42206b,_0x1536dc),_0x358663=new Set(_0x1b5ddd['map'](_0x564d05=>menuPathKey(_0x564d05[_0x2527d4(0x1cd)])));let _0x50755e;if(_0x59b7a3[_0x2527d4(0x1e6)]>0x0){const _0x42ac63=new Map(_0x5c9970[_0x2527d4(0x1f0)](_0x2b6a0f=>[menuPathKey(_0x2b6a0f['path']),_0x2b6a0f])),_0x5be530=_0x59b7a3[_0x2527d4(0x1f8)](_0x31b853=>!_0x42ac63[_0x2527d4(0x1d9)](_0x31b853));if(_0x5be530['length']>0x0){const _0xd971ef=_0x5c9970[_0x2527d4(0x1f0)](_0x151c74=>_0x151c74[_0x2527d4(0x1cd)])[_0x2527d4(0x208)](',\x20');throw new Error(_0x2527d4(0x1e7)+_0x5be530[_0x2527d4(0x208)](',\x20')+_0x2527d4(0x1e9)+_0xd971ef);}const _0x11a927=_0x59b7a3[_0x2527d4(0x1f8)](_0x3fa9bc=>_0x358663['has'](_0x3fa9bc));if(_0x11a927[_0x2527d4(0x1e6)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x11a927[_0x2527d4(0x208)](',\x20'));_0x50755e=_0x59b7a3[_0x2527d4(0x1f0)](_0x21501b=>_0x42ac63[_0x2527d4(0x1d0)](_0x21501b));}else _0x50755e=_0x5c9970[_0x2527d4(0x1f8)](_0x3f12d8=>!_0x358663[_0x2527d4(0x1d9)](menuPathKey(_0x3f12d8[_0x2527d4(0x1cd)])));if(_0x50755e[_0x2527d4(0x1e6)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x5c4eb9[_0x2527d4(0x1fa)]===!![],'targetPages':[],'plannedMenus':[]};_0x50755e=_0x50755e['map'](_0x1839d6=>resolvePage(_0x1839d6,_0x3225a9,_0x1b5ddd));_0x3225a9[_0x2527d4(0x1d8)]&&_0x45b3c3[_0x2527d4(0x1e6)]===0x0&&await assertSharedResourcesConfigured(_0x42206b,_0x1536dc,_0x3225a9[_0x2527d4(0x1d8)]);const _0x3393f6=_0x50755e[_0x2527d4(0x1f0)](_0x1d5682=>({'type':'procode','path':_0x1d5682[_0x2527d4(0x1cd)],'label':_0x1d5682[_0x2527d4(0x1f5)],'loadScriptMode':_0x2527d4(0x1de),'resources':[..._0x45b3c3],..._0x1d5682[_0x2527d4(0x202)]===undefined?{}:{'visible':_0x1d5682[_0x2527d4(0x202)]},..._0x1d5682[_0x2527d4(0x1f3)]===undefined?{}:{'parentId':_0x1d5682[_0x2527d4(0x1f3)]},..._0x1d5682[_0x2527d4(0x1df)]===undefined?{}:{'sort':_0x1d5682[_0x2527d4(0x1df)]},..._0x3225a9[_0x2527d4(0x1d8)]===undefined?{}:{'appName':_0x3225a9[_0x2527d4(0x1d8)]}}));if(_0x5c4eb9[_0x2527d4(0x1fa)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x50755e,'plannedMenus':_0x3393f6};const _0xb49d00=_0x3225a9[_0x2527d4(0x1d8)]?await createMenus(_0x42206b,_0x1536dc,_0x50755e,_0x45b3c3['length']>0x0?_0x45b3c3:undefined,{'appName':_0x3225a9[_0x2527d4(0x1d8)]}):await createMenus(_0x42206b,_0x1536dc,_0x50755e,_0x45b3c3[_0x2527d4(0x1e6)]>0x0?_0x45b3c3:undefined);return logger['info'](_0x2527d4(0x206),_0x2527d4(0x1cf),{'count':_0x50755e[_0x2527d4(0x1e6)],'resources':_0x45b3c3}),{'created':_0xb49d00[_0x2527d4(0x1e6)],'skipped':![],'dryRun':![],'targetPages':_0x50755e,'plannedMenus':_0x3393f6,'menus':_0xb49d00};}export function parseMenuSyncParams(_0x7ce868){const _0x1c09a4=a173_0x1849ab;if(!_0x7ce868||typeof _0x7ce868!=='string')return{};let _0x5b1e0d;try{_0x5b1e0d=JSON['parse'](_0x7ce868);}catch{throw new Error('Invalid\x20--params\x20JSON.');}if(typeof _0x5b1e0d!==_0x1c09a4(0x1fe)||_0x5b1e0d===null||Array[_0x1c09a4(0x1fc)](_0x5b1e0d))throw new Error(_0x1c09a4(0x1ec));const _0x45cb41=_0x5b1e0d;if(Object[_0x1c09a4(0x20b)](_0x45cb41,'pages'))throw new Error('--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.');const _0xf6f7fa=Object[_0x1c09a4(0x1f2)](_0x45cb41)[_0x1c09a4(0x1f8)](_0x5695a7=>!MENU_SYNC_PARAM_KEYS[_0x1c09a4(0x1d9)](_0x5695a7));if(_0xf6f7fa[_0x1c09a4(0x1e6)]>0x0)throw new Error(_0x1c09a4(0x1e1)+_0xf6f7fa[_0x1c09a4(0x208)](',\x20')+'.');for(const _0x1990d3 of[_0x1c09a4(0x1d7),_0x1c09a4(0x1e2),_0x1c09a4(0x1d8)]){const _0xdcbdaf=_0x45cb41[_0x1990d3];if(_0xdcbdaf!==undefined&&(typeof _0xdcbdaf!=='string'||_0xdcbdaf[_0x1c09a4(0x1dc)]()===''))throw new Error(_0x1c09a4(0x1fb)+_0x1990d3+_0x1c09a4(0x1d4));}if(_0x45cb41['visible']!==undefined&&typeof _0x45cb41['visible']!==_0x1c09a4(0x1ee))throw new Error(_0x1c09a4(0x1ed));if(_0x45cb41[_0x1c09a4(0x1f3)]!==undefined&&(!Number[_0x1c09a4(0x205)](_0x45cb41['parentId'])||_0x45cb41['parentId']<0x0))throw new Error(_0x1c09a4(0x1f9));return{'jsUrl':typeof _0x45cb41[_0x1c09a4(0x1d7)]===_0x1c09a4(0x1ff)?_0x45cb41['jsUrl']['trim']():undefined,'cssUrl':typeof _0x45cb41[_0x1c09a4(0x1e2)]===_0x1c09a4(0x1ff)?_0x45cb41['cssUrl'][_0x1c09a4(0x1dc)]():undefined,'appName':typeof _0x45cb41[_0x1c09a4(0x1d8)]===_0x1c09a4(0x1ff)?_0x45cb41[_0x1c09a4(0x1d8)][_0x1c09a4(0x1dc)]():undefined,'visible':typeof _0x45cb41['visible']===_0x1c09a4(0x1ee)?_0x45cb41[_0x1c09a4(0x202)]:undefined,'parentId':typeof _0x45cb41['parentId']===_0x1c09a4(0x1ef)?_0x45cb41[_0x1c09a4(0x1f3)]:undefined};}
@@ -17,6 +17,10 @@ export interface UpdateMenuCdnUrlParams {
17
17
  export interface LocalPage {
18
18
  path: string;
19
19
  label: string;
20
+ visible?: boolean;
21
+ group?: string;
22
+ order?: number;
23
+ parentId?: number;
20
24
  }
21
25
  export interface ProcessedMenuItem {
22
26
  id: number;
@@ -24,6 +28,8 @@ export interface ProcessedMenuItem {
24
28
  label: string;
25
29
  resources: string[];
26
30
  extend?: Record<string, unknown> | null;
31
+ type?: string;
32
+ parentId?: number | null;
27
33
  }
28
34
  export interface MenuFact {
29
35
  id: number;
@@ -99,6 +105,9 @@ export interface MenuMutationResult<TTarget = MenuFact> {
99
105
  export interface MenuSyncParams {
100
106
  jsUrl?: string;
101
107
  cssUrl?: string;
108
+ appName?: string;
109
+ visible?: boolean;
110
+ parentId?: number;
102
111
  }
103
112
  export interface MenuUpdateParams {
104
113
  jsUrl?: string;
@@ -154,16 +163,17 @@ export interface SyncResult {
154
163
  created: number;
155
164
  skipped: boolean;
156
165
  dryRun?: boolean;
157
- targetPages: {
158
- path: string;
159
- label: string;
160
- }[];
166
+ targetPages: LocalPage[];
161
167
  plannedMenus?: Array<{
162
168
  type: "procode";
163
169
  path: string;
164
170
  label: string;
165
171
  loadScriptMode: "import";
166
172
  resources: string[];
173
+ visible?: boolean;
174
+ parentId?: number;
175
+ sort?: number;
176
+ appName?: string;
167
177
  }>;
168
178
  menus?: MenuMutationEntity[];
169
179
  }
@@ -1 +1 @@
1
- function a172_0x32ee(_0x52ea9d,_0x17e44c){_0x52ea9d=_0x52ea9d-0xd6;const _0x518f7e=a172_0x518f();let _0x32ee4b=_0x518f7e[_0x52ea9d];return _0x32ee4b;}(function(_0x10d8ff,_0x59794f){const _0x3ca626=a172_0x32ee,_0x3b94f8=_0x10d8ff();while(!![]){try{const _0x57db6d=-parseInt(_0x3ca626(0x10d))/0x1+-parseInt(_0x3ca626(0xd6))/0x2*(-parseInt(_0x3ca626(0xf7))/0x3)+parseInt(_0x3ca626(0x111))/0x4+parseInt(_0x3ca626(0xe0))/0x5+-parseInt(_0x3ca626(0x113))/0x6*(parseInt(_0x3ca626(0x110))/0x7)+parseInt(_0x3ca626(0x108))/0x8+-parseInt(_0x3ca626(0xe3))/0x9*(-parseInt(_0x3ca626(0x10c))/0xa);if(_0x57db6d===_0x59794f)break;else _0x3b94f8['push'](_0x3b94f8['shift']());}catch(_0x4fd666){_0x3b94f8['push'](_0x3b94f8['shift']());}}}(a172_0x518f,0xb72cf));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x46cb31){const _0x5943db=a172_0x32ee,_0x1ba13d=[];return _0x46cb31[_0x5943db(0xec)]&&!isValidJsHttpsUrl(_0x46cb31['jsUrl'])&&_0x1ba13d[_0x5943db(0x112)]({'field':_0x5943db(0xec),'message':'JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL'}),_0x46cb31[_0x5943db(0x103)]&&!isValidCssHttpsUrl(_0x46cb31[_0x5943db(0x103)])&&_0x1ba13d[_0x5943db(0x112)]({'field':_0x5943db(0x103),'message':_0x5943db(0xd8)}),_0x1ba13d;}export async function runMenuUpdateCore(_0x396715,_0x19cac7,_0x189713,_0x4da4c0={}){const _0x43e61d=a172_0x32ee,_0x26a2e1=parseUpdateParamsFlag(_0x189713),_0x3dfd13=normalizeMode(_0x4da4c0[_0x43e61d(0xfb)]);validateSelection(_0x4da4c0[_0x43e61d(0x107)]);const _0x2188f4=[];if(_0x26a2e1[_0x43e61d(0xec)])_0x2188f4[_0x43e61d(0x112)](_0x26a2e1['jsUrl']);if(_0x26a2e1['cssUrl'])_0x2188f4[_0x43e61d(0x112)](_0x26a2e1[_0x43e61d(0x103)]);const _0x51226d=validateParams(_0x26a2e1);if(_0x51226d[_0x43e61d(0xde)]>0x0){const _0x1c4b0f=_0x51226d[_0x43e61d(0xd9)](_0x36a924=>'--params.'+_0x36a924[_0x43e61d(0xf4)]+':\x20'+_0x36a924['message'])[_0x43e61d(0xff)](';\x20');throw new Error(_0x43e61d(0x101)+_0x1c4b0f);}if(_0x2188f4['length']===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x43e61d(0x104));logger[_0x43e61d(0xdf)](process[_0x43e61d(0xe6)]()),logger[_0x43e61d(0xf0)]('menu-asset-update','Start\x20non-interactive\x20menu\x20asset\x20update',{'appCode':_0x396715,'jsUrl':_0x26a2e1[_0x43e61d(0xec)],'cssUrl':_0x26a2e1[_0x43e61d(0x103)],'mode':_0x3dfd13,'dryRun':_0x4da4c0['dryRun']===!![]});if(_0x26a2e1['jsUrl']){const _0x565ee5=await isUrlReachable(_0x26a2e1[_0x43e61d(0xec)]);if(!_0x565ee5)throw new Error(_0x43e61d(0xe4)+_0x26a2e1[_0x43e61d(0xec)]);}if(_0x26a2e1[_0x43e61d(0x103)]){const _0x1e91f2=await isUrlReachable(_0x26a2e1[_0x43e61d(0x103)]);if(!_0x1e91f2)throw new Error(_0x43e61d(0xe1)+_0x26a2e1['cssUrl']);}const _0x309bb0=await getOnlineMenuList(_0x396715,_0x19cac7),_0x1e97a8=_0x309bb0[_0x43e61d(0xf1)](_0x2f64c2=>_0x2f64c2[_0x43e61d(0xf5)][_0x43e61d(0xde)]>0x0),_0x12d941=selectMenusForUpdate(_0x1e97a8,_0x4da4c0[_0x43e61d(0x107)]);if(_0x12d941[_0x43e61d(0xde)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x4da4c0[_0x43e61d(0x10e)]===!![]};const _0x3f172a=_0x12d941[_0x43e61d(0xd9)](_0x2865bf=>buildMenuUpdateDiff(_0x2865bf,_0x26a2e1,_0x3dfd13,_0x4da4c0['force']===!![],_0x4da4c0['loadScriptMode']));if(_0x4da4c0[_0x43e61d(0x10e)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x3f172a};const _0x183e79=await Promise[_0x43e61d(0x118)](_0x12d941[_0x43e61d(0xd9)]((_0xa79b2b,_0x1bd07e)=>updateMenuCdnUrl(_0x396715,_0x19cac7,{'id':_0xa79b2b['id'],'label':_0xa79b2b[_0x43e61d(0x100)],'path':_0xa79b2b['path'],'resources':_0x3f172a[_0x1bd07e][_0x43e61d(0xf6)]['resources'],'extend':_0xa79b2b[_0x43e61d(0xdd)]??null,'loadScriptMode':_0x4da4c0['loadScriptMode']}))),_0x375c65=_0x183e79[_0x43e61d(0xf1)](_0x1db102=>_0x1db102[_0x43e61d(0xf8)]===_0x43e61d(0x114))[_0x43e61d(0xd9)](_0x4c2df7=>_0x4c2df7[_0x43e61d(0xe5)]),_0x391795=_0x183e79[_0x43e61d(0xf1)](_0x421d52=>_0x421d52[_0x43e61d(0xf8)]==='rejected')[_0x43e61d(0xde)];return logger['info'](_0x43e61d(0xfd),'Menu\x20asset\x20update\x20completed',{'count':_0x12d941[_0x43e61d(0xde)],'resources':_0x2188f4}),{'updated':_0x375c65[_0x43e61d(0xde)],'failed':_0x391795,'skipped':![],'menus':_0x375c65};}function a172_0x518f(){const _0x5c306f=['Invalid\x20--params:\x20','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','cssUrl','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','path','replace','selection','6083936EXeUEW','\x22\x20(','paths','Invalid\x20--mode:\x20','470740BdFFyU','737812jwlVlG','dryRun','.js','146503aVYLaz','1390560bvzTQZ','push','366AAzYYP','fulfilled','endsWith','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','allSettled','\x20existing\x20CSS\x20resources\x20for\x20\x22','45748bqPKjD','parse','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','map','has','menu\x20asset-update\x20cannot\x20patch\x20','string','extend','length','setLogPath','4818930JdbkEo','CSS\x20URL\x20is\x20unreachable:\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','45tSbCPs','JS\x20URL\x20is\x20unreachable:\x20','value','cwd','\x20existing\x20JS\x20resources\x20for\x20\x22','menuIds','isArray','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','.css','jsUrl','split','loadScriptMode','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','info','filter','some','unshift','field','resources','after','60jZmixt','status','all','trim','mode','object','menu-asset-update','patch','join','label'];a172_0x518f=function(){return _0x5c306f;};return a172_0x518f();}function validateSelection(_0x154f3b){const _0x476835=a172_0x32ee;if(!_0x154f3b)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');if(_0x154f3b[_0x476835(0xf9)]&&(_0x154f3b['menuIds'][_0x476835(0xde)]>0x0||_0x154f3b[_0x476835(0x10a)][_0x476835(0xde)]>0x0))throw new Error(_0x476835(0x102));if(!_0x154f3b[_0x476835(0xf9)]&&_0x154f3b[_0x476835(0xe8)][_0x476835(0xde)]===0x0&&_0x154f3b[_0x476835(0x10a)]['length']===0x0)throw new Error('menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.');}export function selectMenusForUpdate(_0x45b2fc,_0x20e586){const _0x60e5d8=a172_0x32ee;validateSelection(_0x20e586);if(_0x20e586[_0x60e5d8(0xf9)])return _0x45b2fc;const _0x54b26f=new Set(_0x45b2fc[_0x60e5d8(0xd9)](_0x100f3e=>_0x100f3e['id'])),_0x584b1c=new Set(_0x45b2fc['map'](_0x40b2b7=>_0x40b2b7[_0x60e5d8(0x105)])),_0x3d7e8e=_0x20e586[_0x60e5d8(0xe8)][_0x60e5d8(0xf1)](_0x569fbb=>!_0x54b26f[_0x60e5d8(0xda)](_0x569fbb)),_0x5b69b2=_0x20e586[_0x60e5d8(0x10a)][_0x60e5d8(0xf1)](_0x4700cf=>!_0x584b1c['has'](_0x4700cf));if(_0x3d7e8e[_0x60e5d8(0xde)]>0x0||_0x5b69b2['length']>0x0){const _0x42d810=[..._0x3d7e8e[_0x60e5d8(0xd9)](_0x380b77=>String(_0x380b77)),..._0x5b69b2][_0x60e5d8(0xff)](',\x20');throw new Error(_0x60e5d8(0x116)+_0x42d810);}const _0x3c9a15=new Set(_0x20e586[_0x60e5d8(0xe8)]),_0x4de24a=new Set(_0x20e586[_0x60e5d8(0x10a)]);return _0x45b2fc[_0x60e5d8(0xf1)](_0x17433a=>_0x3c9a15[_0x60e5d8(0xda)](_0x17433a['id'])||_0x4de24a['has'](_0x17433a[_0x60e5d8(0x105)]));}function normalizeMode(_0x12ef6c){const _0x45a571=a172_0x32ee;if(!_0x12ef6c)return'patch';if(_0x12ef6c===_0x45a571(0x106)||_0x12ef6c===_0x45a571(0xfe))return _0x12ef6c;throw new Error(_0x45a571(0x10b)+_0x12ef6c+'.\x20Allowed\x20values:\x20replace,\x20patch');}function buildMenuUpdateDiff(_0x5169c5,_0xa71bbd,_0x59031d,_0xd71313,_0x5ef196){const _0xedc8cb=a172_0x32ee,_0x2ef064=[..._0x5169c5[_0xedc8cb(0xf5)]];_0x59031d===_0xedc8cb(0xfe)&&assertUnambiguousPatchResources(_0x5169c5,_0x2ef064,_0xa71bbd);const _0x47091b=_0x59031d==='patch'?patchResources(_0x2ef064,_0xa71bbd):replaceResources(_0xa71bbd),_0x1287c0=[],_0x16d0aa=_0x2ef064[_0xedc8cb(0xf2)](isJsResource),_0x4f441d=_0x47091b[_0xedc8cb(0xf2)](isJsResource);if(_0x16d0aa&&!_0x4f441d){const _0x42bd37='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x5169c5[_0xedc8cb(0x100)]+_0xedc8cb(0x109)+_0x5169c5['path']+').\x20'+_0xedc8cb(0x117);if(!_0xd71313)throw new Error(_0x42bd37);_0x1287c0[_0xedc8cb(0x112)](_0x42bd37);}const _0x4d65de=_0x2ef064['some'](isCssResource),_0x32712f=_0x47091b[_0xedc8cb(0xf2)](isCssResource);_0x4d65de&&!_0x32712f&&_0x1287c0['push'](_0xedc8cb(0xef)+_0x5169c5[_0xedc8cb(0x100)]+'\x22\x20('+_0x5169c5[_0xedc8cb(0x105)]+').');const _0x3a72c9=typeof _0x5169c5[_0xedc8cb(0xdd)]?.['loadScriptMode']===_0xedc8cb(0xdc)?_0x5169c5[_0xedc8cb(0xdd)][_0xedc8cb(0xee)]:null,_0x54e47f=_0x5ef196?{'loadScriptMode':_0x3a72c9}:{},_0x227a1e=_0x5ef196?{'loadScriptMode':_0x5ef196}:{};return{'id':_0x5169c5['id'],'label':_0x5169c5['label'],'path':_0x5169c5['path'],'mode':_0x59031d,'before':{'resources':_0x2ef064,..._0x54e47f},'after':{'resources':_0x47091b,..._0x227a1e},'warnings':_0x1287c0};}function replaceResources(_0x3b7fad){const _0x204d20=a172_0x32ee;return[_0x3b7fad[_0x204d20(0xec)],_0x3b7fad['cssUrl']][_0x204d20(0xf1)](_0x320fb5=>!!_0x320fb5);}function assertUnambiguousPatchResources(_0x289f04,_0x1e2ef8,_0x50e278){const _0x2a4b4c=a172_0x32ee,_0x1a0a44=_0x1e2ef8[_0x2a4b4c(0xf1)](isJsResource)[_0x2a4b4c(0xde)];if(_0x50e278[_0x2a4b4c(0xec)]&&_0x1a0a44>0x1)throw new Error(_0x2a4b4c(0xdb)+_0x1a0a44+_0x2a4b4c(0xe7)+_0x289f04[_0x2a4b4c(0x100)]+'\x22\x20('+_0x289f04[_0x2a4b4c(0x105)]+')\x20'+_0x2a4b4c(0xea));const _0x43929f=_0x1e2ef8[_0x2a4b4c(0xf1)](isCssResource)['length'];if(_0x50e278[_0x2a4b4c(0x103)]&&_0x43929f>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x43929f+_0x2a4b4c(0x119)+_0x289f04[_0x2a4b4c(0x100)]+_0x2a4b4c(0x109)+_0x289f04[_0x2a4b4c(0x105)]+')\x20'+_0x2a4b4c(0xe2));}function patchResources(_0x41ed33,_0x18adb5){const _0x150f1f=a172_0x32ee;let _0xc06ad2=![],_0x376f07=![];const _0x6200e4=[];for(const _0x4b16d3 of _0x41ed33){if(isJsResource(_0x4b16d3)){if(_0x18adb5[_0x150f1f(0xec)]&&!_0xc06ad2)_0x6200e4[_0x150f1f(0x112)](_0x18adb5[_0x150f1f(0xec)]),_0xc06ad2=!![];else!_0x18adb5[_0x150f1f(0xec)]&&_0x6200e4[_0x150f1f(0x112)](_0x4b16d3);continue;}if(isCssResource(_0x4b16d3)){if(_0x18adb5[_0x150f1f(0x103)]&&!_0x376f07)_0x6200e4[_0x150f1f(0x112)](_0x18adb5[_0x150f1f(0x103)]),_0x376f07=!![];else!_0x18adb5[_0x150f1f(0x103)]&&_0x6200e4[_0x150f1f(0x112)](_0x4b16d3);continue;}_0x6200e4[_0x150f1f(0x112)](_0x4b16d3);}return _0x18adb5['jsUrl']&&!_0xc06ad2&&_0x6200e4[_0x150f1f(0xf3)](_0x18adb5['jsUrl']),_0x18adb5['cssUrl']&&!_0x376f07&&_0x6200e4['push'](_0x18adb5[_0x150f1f(0x103)]),_0x6200e4;}function isJsResource(_0xd3eb8){const _0x5a4c49=a172_0x32ee;return stripQuery(_0xd3eb8)['toLowerCase']()[_0x5a4c49(0x115)](_0x5a4c49(0x10f));}function isCssResource(_0x1c6660){const _0x29d0c9=a172_0x32ee;return stripQuery(_0x1c6660)['toLowerCase']()['endsWith'](_0x29d0c9(0xeb));}function stripQuery(_0x3af2a4){const _0x11b967=a172_0x32ee;return _0x3af2a4[_0x11b967(0xed)]('?')[0x0]??_0x3af2a4;}function parseUpdateParamsFlag(_0x981364){const _0x551690=a172_0x32ee;if(!_0x981364||typeof _0x981364!==_0x551690(0xdc))return{};try{const _0x267475=JSON[_0x551690(0xd7)](_0x981364);if(typeof _0x267475!==_0x551690(0xfc)||_0x267475===null||Array[_0x551690(0xe9)](_0x267475))return{};return{'jsUrl':typeof _0x267475['jsUrl']===_0x551690(0xdc)?_0x267475['jsUrl'][_0x551690(0xfa)]():undefined,'cssUrl':typeof _0x267475[_0x551690(0x103)]===_0x551690(0xdc)?_0x267475[_0x551690(0x103)]['trim']():undefined};}catch{return{};}}
1
+ (function(_0x44358a,_0x2b8c80){const _0x12950c=a175_0x4f14,_0x57ea0b=_0x44358a();while(!![]){try{const _0x5c4e77=parseInt(_0x12950c(0xdd))/0x1+parseInt(_0x12950c(0xd9))/0x2+-parseInt(_0x12950c(0xb0))/0x3*(-parseInt(_0x12950c(0xe6))/0x4)+-parseInt(_0x12950c(0xca))/0x5+-parseInt(_0x12950c(0xdc))/0x6*(-parseInt(_0x12950c(0xef))/0x7)+parseInt(_0x12950c(0xb6))/0x8*(parseInt(_0x12950c(0xb3))/0x9)+-parseInt(_0x12950c(0xd8))/0xa;if(_0x5c4e77===_0x2b8c80)break;else _0x57ea0b['push'](_0x57ea0b['shift']());}catch(_0x2f05e0){_0x57ea0b['push'](_0x57ea0b['shift']());}}}(a175_0x257e,0x4f0d8));import{updateMenuCdnUrl,getOnlineMenuList}from'../../../commands/menu/shared/service.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../../../commands/menu/shared/valid-url.js';import{logger}from'../../../utils/logger.js';function validateParams(_0x2c750a){const _0x2adf02=a175_0x4f14,_0x47399e=[];return _0x2c750a[_0x2adf02(0xe4)]&&!isValidJsHttpsUrl(_0x2c750a['jsUrl'])&&_0x47399e['push']({'field':_0x2adf02(0xe4),'message':_0x2adf02(0xaf)}),_0x2c750a['cssUrl']&&!isValidCssHttpsUrl(_0x2c750a[_0x2adf02(0xec)])&&_0x47399e['push']({'field':'cssUrl','message':_0x2adf02(0xdb)}),_0x47399e;}export async function runMenuUpdateCore(_0x450bad,_0x47bca6,_0x48bc8e,_0x2559e2={}){const _0xdc3604=a175_0x4f14,_0x19df46=parseUpdateParamsFlag(_0x48bc8e),_0x8d5159=normalizeMode(_0x2559e2[_0xdc3604(0xac)]);validateSelection(_0x2559e2[_0xdc3604(0xe0)]);const _0xe52a1f=[];if(_0x19df46[_0xdc3604(0xe4)])_0xe52a1f[_0xdc3604(0xbf)](_0x19df46[_0xdc3604(0xe4)]);if(_0x19df46[_0xdc3604(0xec)])_0xe52a1f[_0xdc3604(0xbf)](_0x19df46['cssUrl']);const _0x4da46d=validateParams(_0x19df46);if(_0x4da46d[_0xdc3604(0xdf)]>0x0){const _0x44f234=_0x4da46d['map'](_0x16af2f=>_0xdc3604(0xd3)+_0x16af2f[_0xdc3604(0xbc)]+':\x20'+_0x16af2f['message'])[_0xdc3604(0xc8)](';\x20');throw new Error(_0xdc3604(0xce)+_0x44f234);}if(_0xe52a1f[_0xdc3604(0xdf)]===0x0)throw new Error(_0xdc3604(0xd0)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0xdc3604(0xb1)](process['cwd']()),logger[_0xdc3604(0xea)]('menu-asset-update',_0xdc3604(0xb5),{'appCode':_0x450bad,'jsUrl':_0x19df46[_0xdc3604(0xe4)],'cssUrl':_0x19df46[_0xdc3604(0xec)],'mode':_0x8d5159,'dryRun':_0x2559e2[_0xdc3604(0xc4)]===!![]});if(_0x19df46[_0xdc3604(0xe4)]){const _0x529e22=await isUrlReachable(_0x19df46[_0xdc3604(0xe4)]);if(!_0x529e22)throw new Error(_0xdc3604(0xb9)+_0x19df46[_0xdc3604(0xe4)]);}if(_0x19df46['cssUrl']){const _0x50762e=await isUrlReachable(_0x19df46[_0xdc3604(0xec)]);if(!_0x50762e)throw new Error(_0xdc3604(0xe3)+_0x19df46['cssUrl']);}const _0x3debc7=await getOnlineMenuList(_0x450bad,_0x47bca6),_0x252b44=_0x3debc7[_0xdc3604(0xc3)](_0x2e6c19=>_0x2e6c19['resources'][_0xdc3604(0xdf)]>0x0),_0x3fb464=selectMenusForUpdate(_0x252b44,_0x2559e2[_0xdc3604(0xe0)]);if(_0x3fb464[_0xdc3604(0xdf)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x2559e2[_0xdc3604(0xc4)]===!![]};const _0x2cf937=_0x3fb464[_0xdc3604(0xed)](_0x2d34db=>buildMenuUpdateDiff(_0x2d34db,_0x19df46,_0x8d5159,_0x2559e2[_0xdc3604(0xbd)]===!![],_0x2559e2['loadScriptMode']));if(_0x2559e2[_0xdc3604(0xc4)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x2cf937};const _0x79ac24=await Promise[_0xdc3604(0xcd)](_0x3fb464[_0xdc3604(0xed)]((_0x15be96,_0x32454c)=>updateMenuCdnUrl(_0x450bad,_0x47bca6,{'id':_0x15be96['id'],'label':_0x15be96[_0xdc3604(0xf0)],'path':_0x15be96[_0xdc3604(0xb4)],'resources':_0x2cf937[_0x32454c][_0xdc3604(0xb2)]['resources'],'extend':_0x15be96[_0xdc3604(0xeb)]??null,'loadScriptMode':_0x2559e2[_0xdc3604(0xe5)]}))),_0x1a9f55=_0x79ac24[_0xdc3604(0xc3)](_0x29241e=>_0x29241e[_0xdc3604(0xe2)]===_0xdc3604(0xd2))[_0xdc3604(0xed)](_0x3e8443=>_0x3e8443[_0xdc3604(0xc1)]),_0x16c3f4=_0x79ac24[_0xdc3604(0xc3)](_0x5db429=>_0x5db429[_0xdc3604(0xe2)]===_0xdc3604(0xbe))[_0xdc3604(0xdf)];return logger[_0xdc3604(0xea)](_0xdc3604(0xd7),_0xdc3604(0xc5),{'count':_0x3fb464['length'],'resources':_0xe52a1f}),{'updated':_0x1a9f55[_0xdc3604(0xdf)],'failed':_0x16c3f4,'skipped':![],'menus':_0x1a9f55};}function validateSelection(_0x4713b6){const _0x204b0c=a175_0x4f14;if(!_0x4713b6)throw new Error(_0x204b0c(0xb8));if(_0x4713b6[_0x204b0c(0xd6)]&&(_0x4713b6[_0x204b0c(0xe1)]['length']>0x0||_0x4713b6[_0x204b0c(0xcf)]['length']>0x0))throw new Error(_0x204b0c(0xda));if(!_0x4713b6[_0x204b0c(0xd6)]&&_0x4713b6[_0x204b0c(0xe1)][_0x204b0c(0xdf)]===0x0&&_0x4713b6[_0x204b0c(0xcf)]['length']===0x0)throw new Error(_0x204b0c(0xb8));}export function selectMenusForUpdate(_0x4d209a,_0x5c89cf){const _0x5e6f15=a175_0x4f14;validateSelection(_0x5c89cf);if(_0x5c89cf['all'])return _0x4d209a;const _0x4e6af=new Set(_0x4d209a[_0x5e6f15(0xed)](_0x188e1b=>_0x188e1b['id'])),_0x130583=new Set(_0x4d209a['map'](_0x1309b3=>_0x1309b3[_0x5e6f15(0xb4)])),_0x1dd3b0=_0x5c89cf[_0x5e6f15(0xe1)][_0x5e6f15(0xc3)](_0x20de20=>!_0x4e6af[_0x5e6f15(0xc9)](_0x20de20)),_0x3eaaca=_0x5c89cf[_0x5e6f15(0xcf)][_0x5e6f15(0xc3)](_0x5695f0=>!_0x130583[_0x5e6f15(0xc9)](_0x5695f0));if(_0x1dd3b0[_0x5e6f15(0xdf)]>0x0||_0x3eaaca[_0x5e6f15(0xdf)]>0x0){const _0x2cd338=[..._0x1dd3b0[_0x5e6f15(0xed)](_0x527519=>String(_0x527519)),..._0x3eaaca][_0x5e6f15(0xc8)](',\x20');throw new Error('menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'+_0x2cd338);}const _0x3d75b4=new Set(_0x5c89cf[_0x5e6f15(0xe1)]),_0x5324be=new Set(_0x5c89cf['paths']);return _0x4d209a[_0x5e6f15(0xc3)](_0x5d3453=>_0x3d75b4[_0x5e6f15(0xc9)](_0x5d3453['id'])||_0x5324be[_0x5e6f15(0xc9)](_0x5d3453[_0x5e6f15(0xb4)]));}function normalizeMode(_0x305652){const _0x288976=a175_0x4f14;if(!_0x305652)return'patch';if(_0x305652==='replace'||_0x305652===_0x288976(0xbb))return _0x305652;throw new Error(_0x288976(0xcb)+_0x305652+_0x288976(0xd5));}function buildMenuUpdateDiff(_0x1d7919,_0x205ffd,_0x1a2247,_0xd5bfa1,_0x1e7c60){const _0x5ece0b=a175_0x4f14,_0x3a80af=[..._0x1d7919[_0x5ece0b(0xd1)]];_0x1a2247===_0x5ece0b(0xbb)&&assertUnambiguousPatchResources(_0x1d7919,_0x3a80af,_0x205ffd);const _0x21cce8=_0x1a2247===_0x5ece0b(0xbb)?patchResources(_0x3a80af,_0x205ffd):replaceResources(_0x205ffd),_0x112b45=[],_0x17863e=_0x3a80af['some'](isJsResource),_0x2000dc=_0x21cce8['some'](isJsResource);if(_0x17863e&&!_0x2000dc){const _0x23ad81=_0x5ece0b(0xe8)+_0x1d7919[_0x5ece0b(0xf0)]+_0x5ece0b(0xc7)+_0x1d7919[_0x5ece0b(0xb4)]+').\x20'+_0x5ece0b(0xe7);if(!_0xd5bfa1)throw new Error(_0x23ad81);_0x112b45['push'](_0x23ad81);}const _0x3086d7=_0x3a80af[_0x5ece0b(0xd4)](isCssResource),_0x261ecb=_0x21cce8[_0x5ece0b(0xd4)](isCssResource);_0x3086d7&&!_0x261ecb&&_0x112b45[_0x5ece0b(0xbf)](_0x5ece0b(0xc0)+_0x1d7919[_0x5ece0b(0xf0)]+_0x5ece0b(0xc7)+_0x1d7919[_0x5ece0b(0xb4)]+').');const _0x5cd311=typeof _0x1d7919[_0x5ece0b(0xeb)]?.['loadScriptMode']===_0x5ece0b(0xde)?_0x1d7919[_0x5ece0b(0xeb)][_0x5ece0b(0xe5)]:null,_0x5ce32f=_0x1e7c60?{'loadScriptMode':_0x5cd311}:{},_0x26fbb0=_0x1e7c60?{'loadScriptMode':_0x1e7c60}:{};return{'id':_0x1d7919['id'],'label':_0x1d7919['label'],'path':_0x1d7919[_0x5ece0b(0xb4)],'mode':_0x1a2247,'before':{'resources':_0x3a80af,..._0x5ce32f},'after':{'resources':_0x21cce8,..._0x26fbb0},'warnings':_0x112b45};}function a175_0x4f14(_0xb20085,_0x51e446){_0xb20085=_0xb20085-0xab;const _0x257e2f=a175_0x257e();let _0x4f1412=_0x257e2f[_0xb20085];return _0x4f1412;}function replaceResources(_0x2bb33a){const _0x28177f=a175_0x4f14;return[_0x2bb33a[_0x28177f(0xe4)],_0x2bb33a['cssUrl']][_0x28177f(0xc3)](_0x2e9ca6=>!!_0x2e9ca6);}function assertUnambiguousPatchResources(_0x4f73a2,_0x56aa2c,_0x3bf993){const _0xabc873=a175_0x4f14,_0x24c3b4=_0x56aa2c[_0xabc873(0xc3)](isJsResource)[_0xabc873(0xdf)];if(_0x3bf993[_0xabc873(0xe4)]&&_0x24c3b4>0x1)throw new Error(_0xabc873(0xf2)+_0x24c3b4+_0xabc873(0xab)+_0x4f73a2[_0xabc873(0xf0)]+_0xabc873(0xc7)+_0x4f73a2[_0xabc873(0xb4)]+')\x20'+_0xabc873(0xad));const _0x95e933=_0x56aa2c[_0xabc873(0xc3)](isCssResource)['length'];if(_0x3bf993[_0xabc873(0xec)]&&_0x95e933>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x95e933+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x4f73a2[_0xabc873(0xf0)]+_0xabc873(0xc7)+_0x4f73a2[_0xabc873(0xb4)]+')\x20'+'with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.');}function patchResources(_0x9e7e6b,_0x51f69d){const _0x597d0c=a175_0x4f14;let _0x1221c4=![],_0x3b6832=![];const _0x2dfe19=[];for(const _0x3e23af of _0x9e7e6b){if(isJsResource(_0x3e23af)){if(_0x51f69d['jsUrl']&&!_0x1221c4)_0x2dfe19[_0x597d0c(0xbf)](_0x51f69d['jsUrl']),_0x1221c4=!![];else!_0x51f69d[_0x597d0c(0xe4)]&&_0x2dfe19[_0x597d0c(0xbf)](_0x3e23af);continue;}if(isCssResource(_0x3e23af)){if(_0x51f69d[_0x597d0c(0xec)]&&!_0x3b6832)_0x2dfe19[_0x597d0c(0xbf)](_0x51f69d[_0x597d0c(0xec)]),_0x3b6832=!![];else!_0x51f69d[_0x597d0c(0xec)]&&_0x2dfe19[_0x597d0c(0xbf)](_0x3e23af);continue;}_0x2dfe19['push'](_0x3e23af);}return _0x51f69d[_0x597d0c(0xe4)]&&!_0x1221c4&&_0x2dfe19[_0x597d0c(0xc6)](_0x51f69d[_0x597d0c(0xe4)]),_0x51f69d[_0x597d0c(0xec)]&&!_0x3b6832&&_0x2dfe19[_0x597d0c(0xbf)](_0x51f69d[_0x597d0c(0xec)]),_0x2dfe19;}function isJsResource(_0xd3abb2){const _0xd5b0c=a175_0x4f14;return stripQuery(_0xd3abb2)[_0xd5b0c(0xae)]()[_0xd5b0c(0xb7)](_0xd5b0c(0xee));}function isCssResource(_0x498e51){const _0x322888=a175_0x4f14;return stripQuery(_0x498e51)['toLowerCase']()[_0x322888(0xb7)]('.css');}function stripQuery(_0xe4f429){const _0x20ecfd=a175_0x4f14;return _0xe4f429[_0x20ecfd(0xe9)]('?')[0x0]??_0xe4f429;}function parseUpdateParamsFlag(_0x2dd0a0){const _0x1473e5=a175_0x4f14;if(!_0x2dd0a0||typeof _0x2dd0a0!=='string')return{};try{const _0x304aa6=JSON[_0x1473e5(0xc2)](_0x2dd0a0);if(typeof _0x304aa6!==_0x1473e5(0xf1)||_0x304aa6===null||Array[_0x1473e5(0xba)](_0x304aa6))return{};return{'jsUrl':typeof _0x304aa6[_0x1473e5(0xe4)]===_0x1473e5(0xde)?_0x304aa6[_0x1473e5(0xe4)][_0x1473e5(0xcc)]():undefined,'cssUrl':typeof _0x304aa6[_0x1473e5(0xec)]===_0x1473e5(0xde)?_0x304aa6[_0x1473e5(0xec)]['trim']():undefined};}catch{return{};}}function a175_0x257e(){const _0x57761c=['some','.\x20Allowed\x20values:\x20replace,\x20patch','all','menu-asset-update','6992460FyuRKm','668546XOrTjE','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','2118RUsJvF','501655FtAPCZ','string','length','selection','menuIds','status','CSS\x20URL\x20is\x20unreachable:\x20','jsUrl','loadScriptMode','8tqgTkw','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22','split','info','extend','cssUrl','map','.js','2072aWLsfj','label','object','menu\x20asset-update\x20cannot\x20patch\x20','\x20existing\x20JS\x20resources\x20for\x20\x22','mode','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','toLowerCase','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','281661ySONKH','setLogPath','after','59346TeFzcN','path','Start\x20non-interactive\x20menu\x20asset\x20update','56EQgNjm','endsWith','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','JS\x20URL\x20is\x20unreachable:\x20','isArray','patch','field','force','rejected','push','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','value','parse','filter','dryRun','Menu\x20asset\x20update\x20completed','unshift','\x22\x20(','join','has','756510ISGmUK','Invalid\x20--mode:\x20','trim','allSettled','Invalid\x20--params:\x20','paths','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','resources','fulfilled','--params.'];a175_0x257e=function(){return _0x57761c;};return a175_0x257e();}
@@ -1 +1 @@
1
- (function(_0x2e5f76,_0x235357){const _0x98f1be=a173_0x2212,_0x1b1b27=_0x2e5f76();while(!![]){try{const _0x2c412c=-parseInt(_0x98f1be(0x144))/0x1*(parseInt(_0x98f1be(0x14b))/0x2)+-parseInt(_0x98f1be(0x142))/0x3+-parseInt(_0x98f1be(0x143))/0x4+-parseInt(_0x98f1be(0x13e))/0x5+parseInt(_0x98f1be(0x14d))/0x6*(-parseInt(_0x98f1be(0x146))/0x7)+-parseInt(_0x98f1be(0x14c))/0x8*(-parseInt(_0x98f1be(0x147))/0x9)+parseInt(_0x98f1be(0x148))/0xa;if(_0x2c412c===_0x235357)break;else _0x1b1b27['push'](_0x1b1b27['shift']());}catch(_0x5d9b69){_0x1b1b27['push'](_0x1b1b27['shift']());}}}(a173_0x58bb,0xdc66e));function a173_0x58bb(){const _0x927cd2=['7126IdOFea','27uiNrLR','42229070AjAeaM','body','trim','40634QCekNk','1635472nUVZcq','78UkEbPa','9022675xEvzAU','bytes=0-0','cancel','test','3920844suoNLz','1447008ruiPNK','22gebjTD','HEAD'];a173_0x58bb=function(){return _0x927cd2;};return a173_0x58bb();}function a173_0x2212(_0xdd42f1,_0x3242d8){_0xdd42f1=_0xdd42f1-0x13e;const _0x58bbfd=a173_0x58bb();let _0x22125a=_0x58bbfd[_0xdd42f1];return _0x22125a;}export function isValidJsHttpsUrl(_0x12298b){const _0x548ba9=a173_0x2212;return/^https:\/\/.+\.js(\?.*)?$/[_0x548ba9(0x141)](_0x12298b[_0x548ba9(0x14a)]());}export function isValidCssHttpsUrl(_0x17a419){const _0x2a3a58=a173_0x2212;return/^https:\/\/.+\.css(\?.*)?$/[_0x2a3a58(0x141)](_0x17a419[_0x2a3a58(0x14a)]());}export async function isUrlReachable(_0x1fc386){const _0x255cd0=a173_0x2212;try{const _0x5e1f11=await fetch(_0x1fc386,{'method':_0x255cd0(0x145)});if(_0x5e1f11['ok'])return!![];}catch{}try{const _0x302011=await fetch(_0x1fc386,{'method':'GET','headers':{'Range':_0x255cd0(0x13f)}}),_0x2782=_0x302011['ok'];try{await _0x302011[_0x255cd0(0x149)]?.[_0x255cd0(0x140)]();}catch{}return _0x2782;}catch{return![];}}
1
+ (function(_0x11c0d1,_0x40f258){const _0x25242d=a176_0x185f,_0x564648=_0x11c0d1();while(!![]){try{const _0x2715fc=parseInt(_0x25242d(0x8b))/0x1*(parseInt(_0x25242d(0x95))/0x2)+parseInt(_0x25242d(0x94))/0x3*(-parseInt(_0x25242d(0x91))/0x4)+-parseInt(_0x25242d(0x90))/0x5*(-parseInt(_0x25242d(0x8e))/0x6)+-parseInt(_0x25242d(0x93))/0x7+parseInt(_0x25242d(0x97))/0x8+parseInt(_0x25242d(0x99))/0x9+-parseInt(_0x25242d(0x98))/0xa;if(_0x2715fc===_0x40f258)break;else _0x564648['push'](_0x564648['shift']());}catch(_0x43a2e0){_0x564648['push'](_0x564648['shift']());}}}(a176_0x1f70,0xebf09));export function isValidJsHttpsUrl(_0x5cfd0e){const _0x5cf388=a176_0x185f;return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x5cfd0e[_0x5cf388(0x96)]());}function a176_0x185f(_0x1df799,_0x52ab08){_0x1df799=_0x1df799-0x8b;const _0x1f701c=a176_0x1f70();let _0x185fbf=_0x1f701c[_0x1df799];return _0x185fbf;}export function isValidCssHttpsUrl(_0x3b61de){const _0x44e1de=a176_0x185f;return/^https:\/\/.+\.css(\?.*)?$/[_0x44e1de(0x8f)](_0x3b61de[_0x44e1de(0x96)]());}export async function isUrlReachable(_0x5c8ed4){const _0x34fbbd=a176_0x185f;try{const _0x41cb8d=await fetch(_0x5c8ed4,{'method':_0x34fbbd(0x9a)});if(_0x41cb8d['ok'])return!![];}catch{}try{const _0xb92b46=await fetch(_0x5c8ed4,{'method':_0x34fbbd(0x8c),'headers':{'Range':'bytes=0-0'}}),_0x51ae21=_0xb92b46['ok'];try{await _0xb92b46[_0x34fbbd(0x92)]?.[_0x34fbbd(0x8d)]();}catch{}return _0x51ae21;}catch{return![];}}function a176_0x1f70(){const _0xe465dc=['902388OjTOFz','4jjCHgt','trim','445968ijsDYD','5980450gVqmWw','13949748cMnHEM','HEAD','900534OJJwrK','GET','cancel','551886AeCOig','test','5CskwHF','4HFRKVp','body','11434619McKEiT'];a176_0x1f70=function(){return _0xe465dc;};return a176_0x1f70();}
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const menuSubappAssetsStatus: CommandDefinition;
@@ -0,0 +1 @@
1
+ function a177_0x2a4e(_0x3eb686,_0x5851fc){_0x3eb686=_0x3eb686-0xfa;const _0x52f612=a177_0x52f6();let _0x2a4ea6=_0x52f612[_0x3eb686];return _0x2a4ea6;}const a177_0x53fe0d=a177_0x2a4e;(function(_0x3fdf5f,_0x1e4578){const _0x5d66ce=a177_0x2a4e,_0xf85418=_0x3fdf5f();while(!![]){try{const _0x96db0e=-parseInt(_0x5d66ce(0xfd))/0x1+parseInt(_0x5d66ce(0x108))/0x2+-parseInt(_0x5d66ce(0xfb))/0x3+parseInt(_0x5d66ce(0x107))/0x4*(parseInt(_0x5d66ce(0xfa))/0x5)+parseInt(_0x5d66ce(0x105))/0x6+-parseInt(_0x5d66ce(0x104))/0x7*(parseInt(_0x5d66ce(0x103))/0x8)+-parseInt(_0x5d66ce(0xff))/0x9;if(_0x96db0e===_0x1e4578)break;else _0xf85418['push'](_0xf85418['shift']());}catch(_0x2edd94){_0xf85418['push'](_0xf85418['shift']());}}}(a177_0x52f6,0x44126));import{getSmartAppRecord}from'../../core/api-client.js';function a177_0x52f6(){const _0x500618=['2497650wOWpsM','\x20menu(s)\x20for\x20','1590388TNblsy','929196BDdyPQ','5KEcmRn','819234qepqoH','boundMenus','241804zmetGN','menu','311094kKSOrh','cookie','all','Inspect\x20shared\x20frontend\x20subapp\x20resources\x20and\x20menu\x20fallbacks\x20in\x20the\x20selected\x20menu\x20host','36016ouqKAy','700PkeTvF'];a177_0x52f6=function(){return _0x500618;};return a177_0x52f6();}import{getOnlineMenuList}from'../../commands/menu/shared/service.js';import{buildSubappAssetsStatus,getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';export const menuSubappAssetsStatus={'service':a177_0x53fe0d(0xfe),'command':'subapp-assets-status','description':a177_0x53fe0d(0x102),'risk':'read','strictFlags':!![],'flags':SUBAPP_ASSET_SELECTOR_FLAGS,async 'validate'(_0x140386){getSubappSelector(_0x140386);},async 'execute'(_0x4a6293){const _0x106825=a177_0x53fe0d,{appCode:_0x4bf44c,appName:_0x9e27ea}=getSubappSelector(_0x4a6293),[_0x48e9ba,_0x948078]=await Promise[_0x106825(0x101)]([getSmartAppRecord(_0x4bf44c,_0x4a6293[_0x106825(0x100)]),getOnlineMenuList(_0x4bf44c,_0x4a6293[_0x106825(0x100)])]),_0x3d9dc9={'appCode':_0x4bf44c,...buildSubappAssetsStatus(_0x48e9ba,_0x948078,_0x9e27ea)};return{'ok':!![],'data':_0x3d9dc9,'message':'Inspected\x20'+_0x3d9dc9[_0x106825(0xfc)]+_0x106825(0x106)+_0x9e27ea+'\x20in\x20menu\x20host\x20'+_0x4bf44c+'.'};}};
@@ -0,0 +1,2 @@
1
+ import type { CommandDefinition } from "../../framework/types.js";
2
+ export declare const menuSubappAssetsUpdate: CommandDefinition;
@@ -0,0 +1 @@
1
+ const a178_0xe7b19c=a178_0x1d2f;function a178_0x589c(){const _0x43f326=['skinColor','accessKey','1863363Ethdgx','size','Update\x20one\x20frontend\x20subapp\x20resource\x20URL\x20set\x20in\x20the\x20selected\x20menu\x20host','test','map','.\x20Refusing\x20update.','some',';\x20independent\x20deployment\x20not\x20verified.','object','extend','Existing\x20subapp.resources\x20must\x20be\x20a\x20JSON\x20string.','--expected-hash\x20from\x20a\x20dry-run\x20is\x20required.','string','keys','Expected\x20exactly\x20one\x20existing\x20subapp\x20entry\x20for\x20','Would\x20update\x20shared\x20assets\x20for\x20','Resources\x20need\x20one\x20JS\x20entry\x20and\x20no\x20duplicate\x20URLs.','cookie','app.extend.assets','unchanged','directDbEnabled','nextExtend','digest','Management\x20app\x20assets\x20already\x20match;\x20independent\x20deployment\x20not\x20verified.','expectedHash','stringify','hex','vipDeploy','24WdUjgk','46642WZxYtB','sha256','enableOpenApi','https:','has','/smartapi/app/update','\x20in\x20menu\x20host\x20','str','--resources\x20is\x20required.','Updated\x20shared\x20resources\x20for\x20','verified\x20app.extend','3826963kifJbq','\x20must\x20be\x20a\x20JSON\x20object.',']\x20must\x20be\x20a\x20URL\x20string.','Existing\x20subapp.resources\x20must\x20be\x20an\x20array\x20of\x20URLs.','trim','JSON\x20array\x20of\x20HTTPS\x20resource\x20URLs','15wIjKuy','isArray','App\x20ID\x20or\x20publish\x20status\x20is\x20missing;\x20refusing\x20a\x20generic\x20app\x20update.','resources','6037390AvgiWx','resources[','filter','316809vjZZsn','apiError','6mgXWty','\x20must\x20be\x20a\x20JSON\x20array.','entries','enableSample','validation','Preview\x20fingerprint\x20binding\x20the\x20host,\x20subapp,\x20resource\x20URLs\x20and\x20current\x20config;\x20required\x20for\x20writes','directDbId','length','subapp-assets-update','appPublishStatus','appCode','689932yLWpOZ','--resources\x20must\x20be\x20a\x20JSON\x20array\x20of\x20HTTPS\x20URLs.','expected-hash','parse','before','assets','\x20contains\x20invalid\x20JSON.','enableAutoSync',']\x20must\x20be\x20an\x20absolute\x20HTTPS\x20URL.','POST','551925ttUAOx'];a178_0x589c=function(){return _0x43f326;};return a178_0x589c();}(function(_0x3c8b7f,_0x3d18d0){const _0x83ce97=a178_0x1d2f,_0x15126c=_0x3c8b7f();while(!![]){try{const _0x2116c7=-parseInt(_0x83ce97(0xc1))/0x1+-parseInt(_0x83ce97(0xe1))/0x2+-parseInt(_0x83ce97(0xc4))/0x3+parseInt(_0x83ce97(0xb7))/0x4*(parseInt(_0x83ce97(0xa3))/0x5)+parseInt(_0x83ce97(0xac))/0x6*(parseInt(_0x83ce97(0x9d))/0x7)+-parseInt(_0x83ce97(0xe0))/0x8*(parseInt(_0x83ce97(0xaa))/0x9)+parseInt(_0x83ce97(0xa7))/0xa;if(_0x2116c7===_0x3d18d0)break;else _0x15126c['push'](_0x15126c['shift']());}catch(_0x3c6d14){_0x15126c['push'](_0x15126c['shift']());}}}(a178_0x589c,0x59567));import{createHash}from'node:crypto';import{isDeepStrictEqual}from'node:util';import{getSmartAppRecord,updateSmartAppRecord}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{getSubappSelector,SUBAPP_ASSET_SELECTOR_FLAGS}from'../../commands/menu/shared/subapp-assets.js';const KNOWN_EXTEND_KEYS=new Set([a178_0xe7b19c(0xc2),a178_0xe7b19c(0xe3),a178_0xe7b19c(0xc3),'assets','tenantColumn',a178_0xe7b19c(0xaf),a178_0xe7b19c(0xdf),a178_0xe7b19c(0xbe),a178_0xe7b19c(0xb2),a178_0xe7b19c(0xd8)]);function parseObject(_0x4e3497,_0x4403d6){const _0x2ee1a0=a178_0xe7b19c;let _0x99593=_0x4e3497;if(typeof _0x4e3497===_0x2ee1a0(0xd0))try{_0x99593=JSON[_0x2ee1a0(0xba)](_0x4e3497);}catch{throw CliErrors['validation'](_0x4403d6+_0x2ee1a0(0xbd));}if(!_0x99593||typeof _0x99593!==_0x2ee1a0(0xcc)||Array[_0x2ee1a0(0xa4)](_0x99593))throw CliErrors[_0x2ee1a0(0xb0)](_0x4403d6+_0x2ee1a0(0x9e));return _0x99593;}function parseArray(_0x14fbf2,_0xb9421c){const _0x50e0ac=a178_0xe7b19c;let _0x2151a7;try{_0x2151a7=JSON['parse'](_0x14fbf2);}catch{throw CliErrors[_0x50e0ac(0xb0)](_0xb9421c+_0x50e0ac(0xbd));}if(!Array['isArray'](_0x2151a7))throw CliErrors[_0x50e0ac(0xb0)](_0xb9421c+_0x50e0ac(0xad));return _0x2151a7[_0x50e0ac(0xc8)]((_0x589dab,_0x3c0ed0)=>parseObject(_0x589dab,_0xb9421c+'['+_0x3c0ed0+']'));}function a178_0x1d2f(_0x321a85,_0x24fed4){_0x321a85=_0x321a85-0x97;const _0x589c25=a178_0x589c();let _0x1d2f79=_0x589c25[_0x321a85];return _0x1d2f79;}function validateResources(_0x483330){const _0x2eed06=a178_0xe7b19c;if(_0x483330[_0x2eed06(0xb3)]===0x0)throw CliErrors[_0x2eed06(0xb0)]('At\x20least\x20one\x20resource\x20URL\x20is\x20required.');for(const [_0x534d91,_0x293ea6]of _0x483330[_0x2eed06(0xae)]()){if(typeof _0x293ea6!==_0x2eed06(0xd0))throw CliErrors[_0x2eed06(0xb0)](_0x2eed06(0xa8)+_0x534d91+_0x2eed06(0x9f));try{if(new URL(_0x293ea6)['protocol']!==_0x2eed06(0xe4))throw new Error('not\x20HTTPS');}catch{throw CliErrors['validation']('resources['+_0x534d91+_0x2eed06(0xbf));}}if(new Set(_0x483330)[_0x2eed06(0xc5)]!==_0x483330['length']||!_0x483330[_0x2eed06(0xca)](_0x1a9b85=>/\.m?js(?:[?#]|$)/i[_0x2eed06(0xc7)](_0x1a9b85)))throw CliErrors[_0x2eed06(0xb0)](_0x2eed06(0xd4));return _0x483330;}function prepare(_0x2582e0,_0x34e15e,_0x2a81e5){const _0x31f68a=a178_0xe7b19c;if(!Number['isSafeInteger'](_0x2582e0['id'])||(_0x2582e0['id']??0x0)<=0x0||typeof _0x2582e0[_0x31f68a(0xb5)]!==_0x31f68a(0xd0)||!_0x2582e0[_0x31f68a(0xb5)])throw CliErrors[_0x31f68a(0xb0)](_0x31f68a(0xa5));const _0x34a2d0=parseObject(_0x2582e0[_0x31f68a(0xcd)],'app.extend'),_0x3f7c6f=Object[_0x31f68a(0xd1)](_0x34a2d0)['filter'](_0x47ec8b=>!KNOWN_EXTEND_KEYS[_0x31f68a(0xe5)](_0x47ec8b));if(_0x3f7c6f[_0x31f68a(0xb3)])throw CliErrors[_0x31f68a(0xb0)]('Unknown\x20app.extend\x20fields:\x20'+_0x3f7c6f['join'](',\x20')+_0x31f68a(0xc9));if(typeof _0x34a2d0[_0x31f68a(0xbc)]!==_0x31f68a(0xd0))throw CliErrors[_0x31f68a(0xb0)]('app.extend.assets\x20must\x20be\x20a\x20JSON\x20string;\x20refusing\x20update.');const _0x4fc138=parseArray(_0x34a2d0[_0x31f68a(0xbc)],_0x31f68a(0xd6)),_0x474b3d=_0x4fc138[_0x31f68a(0xa9)](_0x5911f4=>_0x5911f4['appName']===_0x34e15e);if(_0x474b3d[_0x31f68a(0xb3)]!==0x1)throw CliErrors[_0x31f68a(0xb0)](_0x31f68a(0xd2)+_0x34e15e+';\x20found\x20'+_0x474b3d['length']+'.');const _0x4b7626=_0x474b3d[0x0];if(typeof _0x4b7626[_0x31f68a(0xa6)]!==_0x31f68a(0xd0))throw CliErrors[_0x31f68a(0xb0)](_0x31f68a(0xce));let _0x330e6a;try{_0x330e6a=JSON[_0x31f68a(0xba)](_0x4b7626[_0x31f68a(0xa6)]);}catch{throw CliErrors[_0x31f68a(0xb0)]('Existing\x20subapp.resources\x20contains\x20invalid\x20JSON.');}if(!Array[_0x31f68a(0xa4)](_0x330e6a)||_0x330e6a[_0x31f68a(0xca)](_0x1efef5=>typeof _0x1efef5!==_0x31f68a(0xd0)))throw CliErrors['validation'](_0x31f68a(0xa0));const _0x5a8ec3=_0x4fc138[_0x31f68a(0xc8)](_0x47df66=>_0x47df66===_0x4b7626?{..._0x47df66,'resources':JSON[_0x31f68a(0xdd)](_0x2a81e5)}:_0x47df66),_0x12d274={..._0x34a2d0,'assets':JSON['stringify'](_0x5a8ec3)},_0x494d1e=createHash(_0x31f68a(0xe2))['update'](JSON[_0x31f68a(0xdd)]({'appCode':_0x2582e0[_0x31f68a(0xb6)],'id':_0x2582e0['id'],'appPublishStatus':_0x2582e0['appPublishStatus'],'extend':_0x34a2d0,'appName':_0x34e15e,'resources':_0x2a81e5}))[_0x31f68a(0xda)](_0x31f68a(0xde));return{'before':_0x330e6a,'nextExtend':_0x12d274,'expectedHash':_0x494d1e,'unchanged':isDeepStrictEqual(_0x330e6a,_0x2a81e5)};}function flags(_0x4c0622){const _0x38807a=a178_0xe7b19c,{appCode:_0x88ab13,appName:_0x29b52}=getSubappSelector(_0x4c0622),_0x4b0456=_0x4c0622[_0x38807a(0x99)](_0x38807a(0xa6))[_0x38807a(0xa1)]();if(!_0x4b0456)throw CliErrors[_0x38807a(0xb0)](_0x38807a(0x9a));let _0x3038d;try{_0x3038d=JSON[_0x38807a(0xba)](_0x4b0456);}catch{throw CliErrors[_0x38807a(0xb0)](_0x38807a(0xb8));}if(!Array[_0x38807a(0xa4)](_0x3038d))throw CliErrors[_0x38807a(0xb0)](_0x38807a(0xb8));return{'appCode':_0x88ab13,'appName':_0x29b52,'resources':validateResources(_0x3038d)};}export const menuSubappAssetsUpdate={'service':'menu','command':a178_0xe7b19c(0xb4),'description':a178_0xe7b19c(0xc6),'risk':'write','strictFlags':!![],'flags':[...SUBAPP_ASSET_SELECTOR_FLAGS,{'name':a178_0xe7b19c(0xa6),'type':a178_0xe7b19c(0xd0),'required':!![],'description':a178_0xe7b19c(0xa2)},{'name':'expected-hash','type':a178_0xe7b19c(0xd0),'description':a178_0xe7b19c(0xb1)}],async 'validate'(_0x9aefed){flags(_0x9aefed);},async 'dryRun'(_0x348a5f){const _0x2d100e=a178_0xe7b19c,{appCode:_0x1a6691,appName:_0xf56ee2,resources:_0x29fb47}=flags(_0x348a5f),_0x3cfa8b=await getSmartAppRecord(_0x1a6691,_0x348a5f[_0x2d100e(0xd5)]),_0x183cfe=prepare(_0x3cfa8b,_0xf56ee2,_0x29fb47);return{'method':_0x2d100e(0xc0),'url':_0x2d100e(0x97),'body':{'preview':{'appCode':_0x1a6691,'appName':_0xf56ee2,'before':_0x183cfe[_0x2d100e(0xbb)],'after':_0x29fb47,'expectedHash':_0x183cfe['expectedHash'],'unchanged':_0x183cfe['unchanged'],'remoteContentVerified':![],'independentDeploymentVerified':![]}},'description':_0x183cfe[_0x2d100e(0xd7)]?'Shared\x20assets\x20already\x20match\x20the\x20requested\x20URLs.':_0x2d100e(0xd3)+_0xf56ee2+'.'};},async 'execute'(_0x8272d0){const _0x2efe1f=a178_0xe7b19c,{appCode:_0x32919d,appName:_0x23dc95,resources:_0x58629c}=flags(_0x8272d0),_0x32eea5=_0x8272d0[_0x2efe1f(0x99)](_0x2efe1f(0xb9))[_0x2efe1f(0xa1)]();if(!/^[a-f0-9]{64}$/i[_0x2efe1f(0xc7)](_0x32eea5))throw CliErrors[_0x2efe1f(0xb0)](_0x2efe1f(0xcf));const _0x2541d7=await getSmartAppRecord(_0x32919d,_0x8272d0[_0x2efe1f(0xd5)]),_0xff9de5=prepare(_0x2541d7,_0x23dc95,_0x58629c);if(_0x32eea5!==_0xff9de5[_0x2efe1f(0xdc)])throw CliErrors['validation']('App\x20assets\x20or\x20update\x20target\x20changed\x20since\x20preview;\x20the\x20fingerprint\x20does\x20not\x20match.\x20Run\x20a\x20new\x20dry-run.');if(_0xff9de5[_0x2efe1f(0xd7)])return{'ok':!![],'data':{'appCode':_0x32919d,'appName':_0x23dc95,'updated':![],'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x2efe1f(0xdb)};await updateSmartAppRecord({'id':_0x2541d7['id'],'appCode':_0x32919d,'appPublishStatus':_0x2541d7[_0x2efe1f(0xb5)],'extend':_0xff9de5[_0x2efe1f(0xd9)]},_0x8272d0['cookie']);const _0x491e49=await getSmartAppRecord(_0x32919d,_0x8272d0[_0x2efe1f(0xd5)]),_0x2c35d7=parseObject(_0x491e49[_0x2efe1f(0xcd)],_0x2efe1f(0x9c));if(_0x491e49['id']!==_0x2541d7['id']||_0x491e49[_0x2efe1f(0xb5)]!==_0x2541d7[_0x2efe1f(0xb5)]||!isDeepStrictEqual(_0x2c35d7,_0xff9de5[_0x2efe1f(0xd9)]))throw CliErrors[_0x2efe1f(0xab)]('App\x20asset\x20update\x20verification\x20failed;\x20inspect\x20the\x20app\x20before\x20retrying.');return{'ok':!![],'data':{'appCode':_0x32919d,'appName':_0x23dc95,'updated':!![],'resources':_0x58629c,'managementConfirmed':!![],'independentDeploymentVerified':![],'remoteContentVerified':![]},'message':_0x2efe1f(0x9b)+_0x23dc95+_0x2efe1f(0x98)+_0x32919d+_0x2efe1f(0xcb)};}};
@@ -1 +1 @@
1
- const a174_0x14ccd1=a174_0x189f;(function(_0x57bfb1,_0x4efc7b){const _0x131e87=a174_0x189f,_0x239ba9=_0x57bfb1();while(!![]){try{const _0x256c92=parseInt(_0x131e87(0x17a))/0x1+-parseInt(_0x131e87(0x180))/0x2+parseInt(_0x131e87(0x1ad))/0x3+-parseInt(_0x131e87(0x194))/0x4*(parseInt(_0x131e87(0x18f))/0x5)+parseInt(_0x131e87(0x1ab))/0x6*(parseInt(_0x131e87(0x1c3))/0x7)+parseInt(_0x131e87(0x193))/0x8*(-parseInt(_0x131e87(0x1af))/0x9)+-parseInt(_0x131e87(0x198))/0xa*(parseInt(_0x131e87(0x186))/0xb);if(_0x256c92===_0x4efc7b)break;else _0x239ba9['push'](_0x239ba9['shift']());}catch(_0x456888){_0x239ba9['push'](_0x239ba9['shift']());}}}(a174_0x368f,0x398a2));import a174_0x4570fd from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';function a174_0x189f(_0x2111d4,_0x2f4258){_0x2111d4=_0x2111d4-0x179;const _0x368ff3=a174_0x368f();let _0x189fd1=_0x368ff3[_0x2111d4];return _0x189fd1;}import{isInProject}from'../../context.js';function a174_0x368f(){const _0x45155a=['Created\x20','\x20and\x20CSS:\x20','skipped','124230HOLZdM','Sync\x20local\x20pages\x20as\x20platform\x20menus','\x20menu(s)','Online\x20menu\x20list\x20fetched','\x20menu(s)\x20created','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','549813NVADrL','jsUrl','failed','params','\x20created,\x20','length','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','cssUrl','POST','1868355qftcYv','size','cookie','paths','45008ilgBCU','4pEqobF','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','menu','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','10fWAyeb','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','Pre-fill\x20JS/CSS\x20URLs.\x20','write','sync','targetPages','yes','✓\x20Menu\x20sync\x20completed:\x20','\x20created.','Menu\x20sync\x20completed:\x20','\x20failed.','\x20menu(s)...','split','Fetching\x20online\x20menu\x20list...','Would\x20create\x20','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','filter','rawFlags','\x20\x20Continue\x20with\x20creation?','84SieFBf','\x20\x20Cancelled.','1109154EqgLTF','Menu\x20creation\x20failed','432mSYXEJ','gray','flag','boolean','Failed\x20to\x20fetch\x20online\x20menu\x20list','trim','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','appCode','created','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','onlineMenuList','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','Creating\x20','/smartapi/menu/create','cyan','appcode','selectedAppName','string','yellow','validation','88459OGWfVX','\x20page(s)','\x20menu(s)\x20with\x20JS:\x20','\x20\x20Create\x20','str','444863zPbmgC','message','\x20local\x20microfrontend\x20menu(s).'];a174_0x368f=function(){return _0x45155a;};return a174_0x368f();}export const menuSync={'service':a174_0x14ccd1(0x196),'command':a174_0x14ccd1(0x19c),'description':a174_0x14ccd1(0x181),'risk':a174_0x14ccd1(0x19b),'flags':[{'name':a174_0x14ccd1(0x189),'type':a174_0x14ccd1(0x1c0),'description':a174_0x14ccd1(0x19a)+'JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}'},{'name':a174_0x14ccd1(0x192),'type':a174_0x14ccd1(0x1c0),'description':a174_0x14ccd1(0x1b5)},{'name':a174_0x14ccd1(0x19e),'type':a174_0x14ccd1(0x1b2),'description':a174_0x14ccd1(0x18c)}],async 'dryRun'(_0x39d306){const _0x58edb8=a174_0x14ccd1;ensureRunnableContext(_0x39d306['rawFlags'],_0x39d306['selectedAppName']);const _0x277d38=await runMenuSyncCore(_0x39d306['appCode'],_0x39d306[_0x58edb8(0x191)],parsePaths(_0x39d306[_0x58edb8(0x179)](_0x58edb8(0x192))),_0x39d306['str'](_0x58edb8(0x189)),{'dryRun':!![]});return{'method':_0x58edb8(0x18e),'url':_0x58edb8(0x1bc),'body':_0x277d38,'description':_0x277d38['skipped']?'No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.':_0x58edb8(0x1a6)+_0x277d38[_0x58edb8(0x19d)]['length']+_0x58edb8(0x17c)};},async 'execute'(_0x26327a){const _0x51a647=a174_0x14ccd1;ensureRunnableContext(_0x26327a[_0x51a647(0x1a9)],_0x26327a[_0x51a647(0x1bf)]);const _0x356ce3=_0x26327a[_0x51a647(0x1b1)](_0x51a647(0x19e)),_0x2f364a=_0x26327a[_0x51a647(0x179)](_0x51a647(0x189)),_0x38ac3b=parsePaths(_0x26327a['str'](_0x51a647(0x192))),_0x2ddbd5=parseMenuSyncParams(_0x2f364a);if(_0x356ce3){const _0x3e0f2d=await runMenuSyncCore(_0x26327a[_0x51a647(0x1b6)],_0x26327a[_0x51a647(0x191)],_0x38ac3b,_0x2f364a);if(_0x3e0f2d[_0x51a647(0x17f)]){const _0x4ce088=getLocalPages();_0x4ce088[_0x51a647(0x18b)]===0x0?writeCliSideChannelLine(_0x51a647(0x185)):writeCliSideChannelLine(_0x51a647(0x195));}else writeCliSideChannelLine(_0x51a647(0x19f)+_0x3e0f2d[_0x51a647(0x1b7)]+_0x51a647(0x184));return{'ok':!![],'data':_0x3e0f2d,'message':_0x3e0f2d[_0x51a647(0x17f)]?'Menu\x20sync\x20skipped':_0x51a647(0x1a1)+_0x3e0f2d[_0x51a647(0x1b7)]+_0x51a647(0x1a0)};}if(_0x38ac3b[_0x51a647(0x18b)]>0x0)throw CliErrors[_0x51a647(0x1c2)](_0x51a647(0x199),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');if(!isInteractive()&&_0x2f364a)throw CliErrors[_0x51a647(0x1c2)](_0x51a647(0x197),_0x51a647(0x1ba));requireInteractive();const _0x41c7ee=startSpinner(_0x51a647(0x1a5));let _0x121845,_0x10d1f8,_0x3ac917;try{const _0x13f67c=await fetchMenuData(_0x26327a['appCode'],_0x26327a[_0x51a647(0x191)]);_0x121845=_0x13f67c['localPages'],_0x10d1f8=_0x13f67c['onlinePaths'],_0x3ac917=_0x13f67c[_0x51a647(0x1b9)],stopSpinner(_0x41c7ee,_0x51a647(0x183),!![]);}catch(_0x99182a){stopSpinner(_0x41c7ee,'Failed\x20to\x20fetch\x20online\x20menu\x20list',![]);throw CliErrors['validation'](_0x99182a instanceof Error?_0x99182a[_0x51a647(0x17b)]:_0x51a647(0x1b3));}if(_0x121845[_0x51a647(0x18b)]===0x0)return writeCliSideChannelLine(a174_0x4570fd[_0x51a647(0x1c1)](_0x51a647(0x1a7))),{'ok':!![]};const _0x5a809e=buildCompareRows(_0x121845,_0x10d1f8);writeCliSideChannelLine(renderCompareTable(_0x5a809e)),writeCliSideChannelLine('');const _0x823f7b=await selectPages(_0x121845,_0x10d1f8);writeCliSideChannelLine(''),writeCliSideChannelLine(a174_0x4570fd[_0x51a647(0x1bd)]('\x20\x20✓\x20Selected:\x20'+_0x823f7b[_0x51a647(0x18b)]+_0x51a647(0x1c4)));const _0x27e25b=_0x2ddbd5[_0x51a647(0x187)]&&_0x2ddbd5[_0x51a647(0x18d)];if(!_0x27e25b){writeCliSideChannelLine(renderSyncSummary(_0x823f7b,_0x10d1f8[_0x51a647(0x190)]>0x0));const _0xbab0ca=await askConfirm(_0x51a647(0x1aa));if(!_0xbab0ca)return writeCliSideChannelLine(a174_0x4570fd[_0x51a647(0x1b0)](_0x51a647(0x1ac))),{'ok':!![]};}let _0xad1410=_0x2ddbd5['jsUrl'],_0x50846f=_0x2ddbd5[_0x51a647(0x18d)];!_0xad1410&&(_0xad1410=await askJsUrl());!_0x50846f&&(_0x50846f=await askCssUrl());const _0x3fe61d=await askConfirm(_0x51a647(0x1c6)+_0x823f7b[_0x51a647(0x18b)]+_0x51a647(0x1c5)+_0xad1410+_0x51a647(0x17e)+_0x50846f+'?');if(!_0x3fe61d)return writeCliSideChannelLine(a174_0x4570fd['gray'](_0x51a647(0x1ac))),{'ok':!![]};const _0x4a9a8a=[_0xad1410,_0x50846f],_0x55acd3=startSpinner(_0x51a647(0x1bb)+_0x823f7b['length']+_0x51a647(0x1a3));try{const _0x429495=await doCreateMenus(_0x26327a['appCode'],_0x26327a['cookie'],_0x823f7b,_0x4a9a8a);return stopSpinner(_0x55acd3,_0x51a647(0x17d)+_0x429495[_0x51a647(0x1b7)]+_0x51a647(0x182),!![]),{'ok':!![],'data':_0x429495,'message':_0x51a647(0x1a1)+_0x429495['created']+_0x51a647(0x18a)+_0x429495[_0x51a647(0x188)]+_0x51a647(0x1a2)};}catch(_0xae9577){stopSpinner(_0x55acd3,_0x51a647(0x1ae),![]);throw CliErrors[_0x51a647(0x1c2)](_0xae9577 instanceof Error?_0xae9577[_0x51a647(0x17b)]:_0x51a647(0x1ae));}}};function ensureRunnableContext(_0x5924d8,_0x4df4dd){const _0x1ab6e5=a174_0x14ccd1,_0x244f72=_0x5924d8[_0x1ab6e5(0x1be)]?String(_0x5924d8['appcode'])[_0x1ab6e5(0x1b4)]():'';if(!isInProject()&&!_0x4df4dd&&!_0x244f72)throw CliErrors[_0x1ab6e5(0x1c2)]('menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20'+_0x1ab6e5(0x1b8));}function parsePaths(_0x4e05f8){const _0x2c5336=a174_0x14ccd1;return[...new Set(_0x4e05f8[_0x2c5336(0x1a4)](',')['map'](_0x22e3e8=>_0x22e3e8[_0x2c5336(0x1b4)]())[_0x2c5336(0x1a8)](Boolean))];}
1
+ const a179_0x4f5273=a179_0x4dbd;(function(_0x80c1aa,_0x48439a){const _0x313e40=a179_0x4dbd,_0x2b9960=_0x80c1aa();while(!![]){try{const _0x651843=parseInt(_0x313e40(0x18f))/0x1+-parseInt(_0x313e40(0x19e))/0x2*(parseInt(_0x313e40(0x1c6))/0x3)+-parseInt(_0x313e40(0x197))/0x4+-parseInt(_0x313e40(0x1c7))/0x5+parseInt(_0x313e40(0x195))/0x6*(parseInt(_0x313e40(0x193))/0x7)+parseInt(_0x313e40(0x1bf))/0x8+parseInt(_0x313e40(0x198))/0x9*(-parseInt(_0x313e40(0x19b))/0xa);if(_0x651843===_0x48439a)break;else _0x2b9960['push'](_0x2b9960['shift']());}catch(_0x1024b3){_0x2b9960['push'](_0x2b9960['shift']());}}}(a179_0x71fd,0x786ce));import a179_0x29d165 from'chalk';import{buildCompareRows,doCreateMenus,fetchMenuData}from'../../commands/menu/shared/logic.js';import{renderCompareTable,renderSyncSummary}from'../../commands/menu/shared/compare-table.js';import{selectPages,askJsUrl,askCssUrl,askConfirm,startSpinner,stopSpinner,isInteractive,requireInteractive}from'../../commands/menu/shared/inquirer.js';import{CliErrors}from'../../errors.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';import{parseMenuSyncParams,resolvePage,runMenuSyncCore}from'../../commands/menu/shared/sync-core.js';import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';import{assertSharedResourcesConfigured}from'../../commands/menu/shared/subapp-assets.js';function a179_0x4dbd(_0x18a5e5,_0x2f4e71){_0x18a5e5=_0x18a5e5-0x18d;const _0x71fd73=a179_0x71fd();let _0x4dbd5c=_0x71fd73[_0x18a5e5];return _0x4dbd5c;}export const menuSync={'service':'menu','command':a179_0x4f5273(0x1b9),'description':'Register\x20local\x20pages\x20as\x20platform\x20menus','risk':'write','flags':[{'name':a179_0x4f5273(0x1a9),'type':a179_0x4f5273(0x1ab),'description':a179_0x4f5273(0x1a0)+a179_0x4f5273(0x19f)},{'name':a179_0x4f5273(0x1d0),'type':'string','description':a179_0x4f5273(0x1bd)},{'name':a179_0x4f5273(0x1c8),'type':a179_0x4f5273(0x1b0),'description':a179_0x4f5273(0x1cb)}],async 'dryRun'(_0x5a261a){const _0x210b27=a179_0x4f5273;ensureRunnableContext(_0x5a261a['rawFlags'],_0x5a261a[_0x210b27(0x1cc)]);const _0x10a359=await runMenuSyncCore(_0x5a261a[_0x210b27(0x1b2)],_0x5a261a[_0x210b27(0x1cf)],parsePaths(_0x5a261a[_0x210b27(0x1ad)](_0x210b27(0x1d0))),_0x5a261a[_0x210b27(0x1ad)](_0x210b27(0x1a9)),{'dryRun':!![]});return{'method':_0x210b27(0x1a8),'url':_0x210b27(0x1b4),'body':_0x10a359,'description':_0x10a359[_0x210b27(0x1b3)]?'No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.':'Would\x20create\x20'+_0x10a359[_0x210b27(0x1ca)][_0x210b27(0x1c0)]+_0x210b27(0x1c4)};},async 'execute'(_0x28d0ba){const _0x1396ed=a179_0x4f5273;ensureRunnableContext(_0x28d0ba[_0x1396ed(0x1a6)],_0x28d0ba[_0x1396ed(0x1cc)]);const _0x42bb42=_0x28d0ba[_0x1396ed(0x1af)]('yes'),_0x371c92=_0x28d0ba[_0x1396ed(0x1ad)](_0x1396ed(0x1a9)),_0x82f8bb=parsePaths(_0x28d0ba[_0x1396ed(0x1ad)]('paths')),_0x807a75=parseMenuSyncParams(_0x371c92);if(_0x42bb42){const _0x39ef92=await runMenuSyncCore(_0x28d0ba[_0x1396ed(0x1b2)],_0x28d0ba[_0x1396ed(0x1cf)],_0x82f8bb,_0x371c92);if(_0x39ef92[_0x1396ed(0x1b3)]){const _0x3b3396=getLocalPages();_0x3b3396['length']===0x0?writeCliSideChannelLine(_0x1396ed(0x191)):writeCliSideChannelLine(_0x1396ed(0x18d));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x39ef92[_0x1396ed(0x1a4)]+_0x1396ed(0x1c2));return{'ok':!![],'data':_0x39ef92,'message':_0x39ef92[_0x1396ed(0x1b3)]?_0x1396ed(0x1ce):_0x1396ed(0x1be)+_0x39ef92['created']+_0x1396ed(0x1bb)};}if(_0x82f8bb[_0x1396ed(0x1c0)]>0x0)throw CliErrors[_0x1396ed(0x1d2)]('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0x1396ed(0x1d1));if(!isInteractive()&&_0x371c92)throw CliErrors['validation'](_0x1396ed(0x19c),_0x1396ed(0x1d1));requireInteractive(),writeCliSideChannelLine(_0x1396ed(0x1b8));const _0x438844=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x1c3a36,_0x485dd8,_0x5dda26;try{const _0x3972ec=await fetchMenuData(_0x28d0ba[_0x1396ed(0x1b2)],_0x28d0ba[_0x1396ed(0x1cf)]);_0x1c3a36=_0x3972ec[_0x1396ed(0x19d)],_0x485dd8=_0x3972ec[_0x1396ed(0x196)],_0x5dda26=_0x3972ec[_0x1396ed(0x192)],stopSpinner(_0x438844,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x50c6d0){stopSpinner(_0x438844,_0x1396ed(0x199),![]);throw CliErrors[_0x1396ed(0x1d2)](_0x50c6d0 instanceof Error?_0x50c6d0[_0x1396ed(0x1a7)]:_0x1396ed(0x199));}if(_0x1c3a36[_0x1396ed(0x1c0)]===0x0)return writeCliSideChannelLine(a179_0x29d165['yellow'](_0x1396ed(0x190))),{'ok':!![]};const _0x5aad15=buildCompareRows(_0x1c3a36,_0x485dd8);writeCliSideChannelLine(renderCompareTable(_0x5aad15)),writeCliSideChannelLine('');const _0x59c8cf=await selectPages(_0x1c3a36,_0x485dd8);writeCliSideChannelLine(''),writeCliSideChannelLine(a179_0x29d165[_0x1396ed(0x1a1)]('\x20\x20✓\x20Selected:\x20'+_0x59c8cf['length']+'\x20page(s)'));const _0xcb5151=_0x807a75[_0x1396ed(0x1c3)]&&_0x807a75[_0x1396ed(0x1b1)];if(!_0xcb5151){writeCliSideChannelLine(renderSyncSummary(_0x59c8cf,_0x485dd8['size']>0x0));const _0x3acb4f=await askConfirm(_0x1396ed(0x18e));if(!_0x3acb4f)return writeCliSideChannelLine(a179_0x29d165['gray']('\x20\x20Cancelled.')),{'ok':!![]};}let _0xada97c=_0x807a75[_0x1396ed(0x1c3)],_0x226929=_0x807a75[_0x1396ed(0x1b1)];!_0xada97c&&!_0x807a75[_0x1396ed(0x1b6)]&&(_0xada97c=await askJsUrl());!_0x226929&&!_0x807a75[_0x1396ed(0x1b6)]&&(_0x226929=await askCssUrl());const _0x4326b4=await askConfirm(_0x807a75[_0x1396ed(0x1b6)]?_0x1396ed(0x1bc)+_0x59c8cf[_0x1396ed(0x1c0)]+_0x1396ed(0x1cd)+_0x807a75[_0x1396ed(0x1b6)]+'?':'\x20\x20Create\x20'+_0x59c8cf[_0x1396ed(0x1c0)]+'\x20menu(s)\x20with\x20JS:\x20'+_0xada97c+'\x20and\x20CSS:\x20'+_0x226929+'?');if(!_0x4326b4)return writeCliSideChannelLine(a179_0x29d165[_0x1396ed(0x19a)](_0x1396ed(0x194))),{'ok':!![]};const _0x264601=[_0xada97c,_0x226929][_0x1396ed(0x1ae)](_0x3a4416=>Boolean(_0x3a4416));_0x807a75[_0x1396ed(0x1b6)]&&_0x264601[_0x1396ed(0x1c0)]===0x0&&await assertSharedResourcesConfigured(_0x28d0ba[_0x1396ed(0x1b2)],_0x28d0ba[_0x1396ed(0x1cf)],_0x807a75[_0x1396ed(0x1b6)]);const _0x54d371=startSpinner(_0x1396ed(0x1ba)+_0x59c8cf[_0x1396ed(0x1c0)]+'\x20menu(s)...');try{const _0xb8d41a=_0x59c8cf[_0x1396ed(0x1a5)](_0x14996a=>resolvePage(_0x14996a,_0x807a75,_0x5dda26)),_0x3f3d72=await doCreateMenus(_0x28d0ba[_0x1396ed(0x1b2)],_0x28d0ba[_0x1396ed(0x1cf)],_0xb8d41a,_0x264601,_0x807a75[_0x1396ed(0x1b6)]?{'appName':_0x807a75[_0x1396ed(0x1b6)]}:undefined);return stopSpinner(_0x54d371,_0x1396ed(0x1b7)+_0x3f3d72['created']+'\x20menu(s)',!![]),{'ok':!![],'data':_0x3f3d72,'message':_0x1396ed(0x1be)+_0x3f3d72['created']+_0x1396ed(0x1d3)+_0x3f3d72[_0x1396ed(0x1c1)]+_0x1396ed(0x1c9)};}catch(_0xcc7b39){stopSpinner(_0x54d371,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x1396ed(0x1d2)](_0xcc7b39 instanceof Error?_0xcc7b39['message']:_0x1396ed(0x1ac));}}};function ensureRunnableContext(_0xc63261,_0x42cce8){const _0x8a2922=a179_0x4f5273,_0x347b83=_0xc63261['appcode']?String(_0xc63261[_0x8a2922(0x1a3)])[_0x8a2922(0x1c5)]():'';if(!isInProject()&&!_0x42cce8&&!_0x347b83)throw CliErrors[_0x8a2922(0x1d2)](_0x8a2922(0x1b5)+_0x8a2922(0x1aa));}function a179_0x71fd(){const _0x2a51f8=['appcode','created','map','rawFlags','message','POST','params','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','string','Menu\x20creation\x20failed','str','filter','flag','boolean','cssUrl','appCode','skipped','/smartapi/menu/create','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','appName','Created\x20','Tip:\x20For\x20frontend\x20subapps,\x20prefer\x20Agent-planned\x20menu\x20groups\x20and\x20shared\x20resources.\x20This\x20manual\x20sync\x20workflow\x20remains\x20available\x20as\x20a\x20fallback.','sync','Creating\x20','\x20created.','\x20\x20Create\x20','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','Menu\x20sync\x20completed:\x20','7307880DKaVaI','length','failed','\x20menu(s)\x20created','jsUrl','\x20local\x20microfrontend\x20menu(s).','trim','2661471EvSxUO','1451700jwwDPi','yes','\x20failed.','targetPages','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','selectedAppName','\x20menu(s)\x20bound\x20to\x20','Menu\x20sync\x20skipped','cookie','paths','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','validation','\x20created,\x20','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','\x20\x20Continue\x20with\x20creation?','765224yGXzzN','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','!\x20No\x20local\x20pages\x20found\x20in\x20src/pages','onlineMenuList','123095NXpMoW','\x20\x20Cancelled.','84ICTqeZ','onlinePaths','6932OSCncm','13131LtJFmk','Failed\x20to\x20fetch\x20online\x20menu\x20list','gray','1730bhmViu','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','localPages','2aKOktj','JSON:\x20{\x22appName\x22:\x22store-app\x22,\x22parentId\x22:42,\x22visible\x22:false};\x20jsUrl\x20and\x20cssUrl\x20remain\x20available\x20for\x20individual\x20menu\x20resources.','Prefer\x20appName\x20for\x20shared\x20subapp\x20resources\x20and\x20parentId\x20for\x20planned\x20groups.\x20','cyan','split'];a179_0x71fd=function(){return _0x2a51f8;};return a179_0x71fd();}function parsePaths(_0x2844e9){const _0x24a7ae=a179_0x4f5273;return[...new Set(_0x2844e9[_0x24a7ae(0x1a2)](',')[_0x24a7ae(0x1a5)](_0x4a84ce=>_0x4a84ce[_0x24a7ae(0x1c5)]())[_0x24a7ae(0x1ae)](Boolean))];}