@lovrabet/rabetbase-cli 2.4.4 → 2.4.5

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 (330) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/members-list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app-config/delete.js +1 -1
  25. package/lib/commands/app-config/get.js +1 -1
  26. package/lib/commands/app-config/index.js +1 -1
  27. package/lib/commands/app-config/list.js +1 -1
  28. package/lib/commands/app-config/set.js +1 -1
  29. package/lib/commands/app-config/shared.js +1 -1
  30. package/lib/commands/auth/index.js +1 -1
  31. package/lib/commands/bff/create.js +1 -1
  32. package/lib/commands/bff/delete.js +1 -1
  33. package/lib/commands/bff/detail.js +1 -1
  34. package/lib/commands/bff/index.js +1 -1
  35. package/lib/commands/bff/list.js +1 -1
  36. package/lib/commands/bff/pull.js +1 -1
  37. package/lib/commands/bff/push.js +1 -1
  38. package/lib/commands/bff/status.js +1 -1
  39. package/lib/commands/cli-skill/index.js +1 -1
  40. package/lib/commands/cli-update.js +1 -1
  41. package/lib/commands/codegen/index.js +1 -1
  42. package/lib/commands/codegen/sdk.js +1 -1
  43. package/lib/commands/codegen/sql.js +1 -1
  44. package/lib/commands/common/app-registry.js +1 -1
  45. package/lib/commands/common/app-selector.js +1 -1
  46. package/lib/commands/common/async-task.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.d.ts +1 -0
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/{permit/index.d.ts → dataset/business-groups.d.ts} +1 -1
  63. package/lib/commands/dataset/business-groups.js +1 -0
  64. package/lib/commands/dataset/capability.js +1 -1
  65. package/lib/commands/dataset/delete.js +1 -1
  66. package/lib/commands/dataset/detail.js +1 -1
  67. package/lib/commands/dataset/extend-update.js +1 -1
  68. package/lib/commands/dataset/field-update.js +1 -1
  69. package/lib/commands/dataset/generate.js +1 -1
  70. package/lib/commands/dataset/index.js +1 -1
  71. package/lib/commands/dataset/list.js +1 -1
  72. package/lib/commands/dataset/operations.js +1 -1
  73. package/lib/commands/dataset/relation-audit.js +1 -1
  74. package/lib/commands/dataset/relation-create.js +1 -1
  75. package/lib/commands/dataset/relation-delete.js +1 -1
  76. package/lib/commands/dataset/relation-shared.js +1 -1
  77. package/lib/commands/dataset/relation-update.js +1 -1
  78. package/lib/commands/dataset/relations.js +1 -1
  79. package/lib/commands/dataset/rename.js +1 -1
  80. package/lib/commands/dataset/restore.js +1 -1
  81. package/lib/commands/db/analysis-batching.js +1 -1
  82. package/lib/commands/db/analyze-batch-plan.js +1 -1
  83. package/lib/commands/db/analyze-cancel.js +1 -1
  84. package/lib/commands/db/analyze-start.js +1 -1
  85. package/lib/commands/db/analyze-status.js +1 -1
  86. package/lib/commands/db/create.js +1 -1
  87. package/lib/commands/db/delete.js +1 -1
  88. package/lib/commands/db/detail.js +1 -1
  89. package/lib/commands/db/diff-refresh-start.js +1 -1
  90. package/lib/commands/db/diff-refresh-status.js +1 -1
  91. package/lib/commands/db/diff.js +1 -1
  92. package/lib/commands/db/index.js +1 -1
  93. package/lib/commands/db/list.js +1 -1
  94. package/lib/commands/db/shared.d.ts +15 -1
  95. package/lib/commands/db/shared.js +1 -1
  96. package/lib/commands/db/tables.js +1 -1
  97. package/lib/commands/db/test.js +1 -1
  98. package/lib/commands/db/update.js +1 -1
  99. package/lib/commands/doctor.js +1 -1
  100. package/lib/commands/file/index.js +1 -1
  101. package/lib/commands/init/index.js +1 -1
  102. package/lib/commands/issue/index.js +1 -1
  103. package/lib/commands/issue/nudge.js +1 -1
  104. package/lib/commands/issue/report.js +1 -1
  105. package/lib/commands/issue/shared.js +1 -1
  106. package/lib/commands/kb/create.js +1 -1
  107. package/lib/commands/kb/delete.js +1 -1
  108. package/lib/commands/kb/detail.js +1 -1
  109. package/lib/commands/kb/index.js +1 -1
  110. package/lib/commands/kb/list.js +1 -1
  111. package/lib/commands/kb/shared.js +1 -1
  112. package/lib/commands/kb/update.js +1 -1
  113. package/lib/commands/logs/index.js +1 -1
  114. package/lib/commands/menu/asset-update.js +1 -1
  115. package/lib/commands/menu/delete.js +1 -1
  116. package/lib/commands/menu/external-link-create.js +1 -1
  117. package/lib/commands/menu/external-link-update.js +1 -1
  118. package/lib/commands/menu/group-create.js +1 -1
  119. package/lib/commands/menu/group-update.js +1 -1
  120. package/lib/commands/menu/index.js +1 -1
  121. package/lib/commands/menu/list.js +1 -1
  122. package/lib/commands/menu/move.js +1 -1
  123. package/lib/commands/menu/regroup-start.js +1 -1
  124. package/lib/commands/menu/rename.js +1 -1
  125. package/lib/commands/menu/shared/compare-table.js +1 -1
  126. package/lib/commands/menu/shared/delete-plan.js +1 -1
  127. package/lib/commands/menu/shared/facts.js +1 -1
  128. package/lib/commands/menu/shared/index.js +1 -1
  129. package/lib/commands/menu/shared/inquirer.js +1 -1
  130. package/lib/commands/menu/shared/local-pages.js +1 -1
  131. package/lib/commands/menu/shared/logic.js +1 -1
  132. package/lib/commands/menu/shared/mutations.js +1 -1
  133. package/lib/commands/menu/shared/service.js +1 -1
  134. package/lib/commands/menu/shared/sync-core.js +1 -1
  135. package/lib/commands/menu/shared/update-core.js +1 -1
  136. package/lib/commands/menu/shared/valid-url.js +1 -1
  137. package/lib/commands/menu/sync.js +1 -1
  138. package/lib/commands/notification/config-create.js +1 -1
  139. package/lib/commands/notification/config-delete.js +1 -1
  140. package/lib/commands/notification/config-list.js +1 -1
  141. package/lib/commands/notification/config-update.js +1 -1
  142. package/lib/commands/notification/index.js +1 -1
  143. package/lib/commands/notification/shared.js +1 -1
  144. package/lib/commands/ocr/index.js +1 -1
  145. package/lib/commands/page/generate-start.js +1 -1
  146. package/lib/commands/page/generate-status.js +1 -1
  147. package/lib/commands/page/index.js +1 -1
  148. package/lib/commands/page/pull.js +1 -1
  149. package/lib/commands/page/push.js +1 -1
  150. package/lib/commands/page/react/create.js +1 -1
  151. package/lib/commands/page/react/detail.js +1 -1
  152. package/lib/commands/page/react/list.js +1 -1
  153. package/lib/commands/page/react/publish.js +1 -1
  154. package/lib/commands/page/react/shared.js +1 -1
  155. package/lib/commands/page/react/syntax.js +1 -1
  156. package/lib/commands/page/react/template.js +1 -1
  157. package/lib/commands/page/react/update.js +1 -1
  158. package/lib/commands/page/relation-audit.js +1 -1
  159. package/lib/commands/page/restore.js +1 -1
  160. package/lib/commands/page/shared.js +1 -1
  161. package/lib/commands/page/standard-page-status.js +1 -1
  162. package/lib/commands/page/sync.js +1 -1
  163. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  164. package/lib/commands/project/create/format-elapsed.js +1 -1
  165. package/lib/commands/project/create/main.js +1 -1
  166. package/lib/commands/project/create/materialize-project-template.js +1 -1
  167. package/lib/commands/project/create/project-name.js +1 -1
  168. package/lib/commands/project/create/project-template-archive.js +1 -1
  169. package/lib/commands/project/create/project-template-path.js +1 -1
  170. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  171. package/lib/commands/project/create/use-format-code.js +1 -1
  172. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  173. package/lib/commands/project/index.js +1 -1
  174. package/lib/commands/project/upgrade.js +1 -1
  175. package/lib/commands/registry.js +1 -1
  176. package/lib/commands/role/delete.js +1 -1
  177. package/lib/commands/role/detail.js +1 -1
  178. package/lib/commands/role/index.js +1 -1
  179. package/lib/commands/role/list.js +1 -1
  180. package/lib/commands/role/shared.d.ts +15 -17
  181. package/lib/commands/role/shared.js +1 -1
  182. package/lib/commands/role/update.js +1 -1
  183. package/lib/commands/role/user-add.js +1 -1
  184. package/lib/commands/role/user-remove.js +1 -1
  185. package/lib/commands/role/user-resolve.js +1 -1
  186. package/lib/commands/run/index.js +1 -1
  187. package/lib/commands/schema.js +1 -1
  188. package/lib/commands/sql/create.js +1 -1
  189. package/lib/commands/sql/delete.js +1 -1
  190. package/lib/commands/sql/detail.js +1 -1
  191. package/lib/commands/sql/exec.js +1 -1
  192. package/lib/commands/sql/index.js +1 -1
  193. package/lib/commands/sql/list.js +1 -1
  194. package/lib/commands/sql/pull.js +1 -1
  195. package/lib/commands/sql/push.js +1 -1
  196. package/lib/commands/sql/shared.js +1 -1
  197. package/lib/commands/sql/status.js +1 -1
  198. package/lib/commands/sql/validate.js +1 -1
  199. package/lib/commands/task/index.js +1 -1
  200. package/lib/commands/task/status.js +1 -1
  201. package/lib/commands/tenant/index.js +1 -1
  202. package/lib/commands/tenant/members-list.js +1 -1
  203. package/lib/commands/tenant/shared.js +1 -1
  204. package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
  205. package/lib/commands/user-account/index.js +1 -1
  206. package/lib/commands/workspace/add.js +1 -1
  207. package/lib/commands/workspace/index.js +1 -1
  208. package/lib/commands/workspace/remove.js +1 -1
  209. package/lib/config/schema.js +1 -1
  210. package/lib/constant/cdn.js +1 -1
  211. package/lib/constant/cli.js +1 -1
  212. package/lib/constant/defaults.js +1 -1
  213. package/lib/constant/domain.js +1 -1
  214. package/lib/constant/env.js +1 -1
  215. package/lib/constant/output.js +1 -1
  216. package/lib/constant/paths.js +1 -1
  217. package/lib/constant/risk.js +1 -1
  218. package/lib/context/app-resolver.js +1 -1
  219. package/lib/context/auth-resolver.js +1 -1
  220. package/lib/context/config-loader.js +1 -1
  221. package/lib/context.js +1 -1
  222. package/lib/core/alias-resolver.js +1 -1
  223. package/lib/core/api-client.d.ts +70 -79
  224. package/lib/core/api-client.js +1 -1
  225. package/lib/core/bff/config.js +1 -1
  226. package/lib/core/bff/file-system.d.ts +1 -0
  227. package/lib/core/bff/file-system.js +1 -1
  228. package/lib/core/bff/hash.js +1 -1
  229. package/lib/core/bff/lock.js +1 -1
  230. package/lib/core/bff/utils.js +1 -1
  231. package/lib/core/db-resolver.js +1 -1
  232. package/lib/core/page/file-system.js +1 -1
  233. package/lib/core/page/hash.js +1 -1
  234. package/lib/core/page/lock.js +1 -1
  235. package/lib/core/sql-index-auditor.js +1 -1
  236. package/lib/core/sql-sync/config.js +1 -1
  237. package/lib/core/sql-sync/file-system.js +1 -1
  238. package/lib/core/sql-sync/hash.js +1 -1
  239. package/lib/core/sql-sync/lock.js +1 -1
  240. package/lib/core/sql-sync/utils.js +1 -1
  241. package/lib/core/sql-validator.js +1 -1
  242. package/lib/errors.js +1 -1
  243. package/lib/framework/build-all-flags.js +1 -1
  244. package/lib/framework/error-output.js +1 -1
  245. package/lib/framework/explicit-yes.js +1 -1
  246. package/lib/framework/flags.js +1 -1
  247. package/lib/framework/help.js +1 -1
  248. package/lib/framework/index.js +1 -1
  249. package/lib/framework/output.js +1 -1
  250. package/lib/framework/response.js +1 -1
  251. package/lib/framework/runner-alias.js +1 -1
  252. package/lib/framework/runner.js +1 -1
  253. package/lib/framework/schema-export.js +1 -1
  254. package/lib/framework/types.js +1 -1
  255. package/lib/generated/build-info.d.ts +4 -4
  256. package/lib/generated/build-info.js +1 -1
  257. package/lib/help.js +1 -1
  258. package/lib/postinstall.js +1 -1
  259. package/lib/runtime/confirmation.js +1 -1
  260. package/lib/runtime/event.js +1 -1
  261. package/lib/runtime/index.js +1 -1
  262. package/lib/runtime/queue.js +1 -1
  263. package/lib/runtime/resolve.js +1 -1
  264. package/lib/skills/builtin-skill.js +1 -1
  265. package/lib/skills/main.js +1 -1
  266. package/lib/skills/npx-skills-add.js +1 -1
  267. package/lib/skills/skill-presence.js +1 -1
  268. package/lib/telemetry/cli-command-trace.js +1 -1
  269. package/lib/telemetry/cli-help-trace.js +1 -1
  270. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  271. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  272. package/lib/telemetry/send-cli-trace-log.js +1 -1
  273. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  274. package/lib/utils/ai_config.js +1 -1
  275. package/lib/utils/apply-jq-filter.js +1 -1
  276. package/lib/utils/cdn-config.js +1 -1
  277. package/lib/utils/check-sdk-version.js +1 -1
  278. package/lib/utils/cli-version-check.js +1 -1
  279. package/lib/utils/cli-version-policy.js +1 -1
  280. package/lib/utils/config.js +1 -1
  281. package/lib/utils/entity-with-id.js +1 -1
  282. package/lib/utils/file-utils.js +1 -1
  283. package/lib/utils/guides-cdn.js +1 -1
  284. package/lib/utils/http-client.js +1 -1
  285. package/lib/utils/is-non-interactive.js +1 -1
  286. package/lib/utils/logger.js +1 -1
  287. package/lib/utils/params.js +1 -1
  288. package/lib/utils/platform.js +1 -1
  289. package/lib/utils/rules-cdn.js +1 -1
  290. package/lib/utils/sleep.js +1 -1
  291. package/lib/utils/template-replacer.js +1 -1
  292. package/lib/utils/update-notice.js +1 -1
  293. package/lib/utils/version.js +1 -1
  294. package/lib/utils/with-active-cookie.js +1 -1
  295. package/lib/utils/write-cli-side-channel.js +1 -1
  296. package/package.json +1 -1
  297. package/skills/rabetbase/SKILL.md +18 -24
  298. package/skills/rabetbase/guides/database-connection-workflow.md +6 -2
  299. package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +28 -0
  300. package/skills/rabetbase/references/rabetbase-dataset-delete.md +7 -5
  301. package/skills/rabetbase/references/rabetbase-dataset-list.md +6 -6
  302. package/skills/rabetbase/references/rabetbase-dataset-restore.md +5 -5
  303. package/skills/rabetbase/references/rabetbase-db-create.md +3 -0
  304. package/skills/rabetbase/references/rabetbase-db-delete.md +10 -2
  305. package/skills/rabetbase/references/rabetbase-db-detail.md +2 -0
  306. package/skills/rabetbase/references/rabetbase-db-list.md +3 -2
  307. package/skills/rabetbase/references/rabetbase-db-update.md +4 -2
  308. package/skills/rabetbase/references/rabetbase-role-list.md +9 -17
  309. package/skills/rabetbase/references/rabetbase-role-user-add.md +44 -16
  310. package/skills/rabetbase/references/rabetbase-role-user-resolve.md +2 -2
  311. package/skills/rabetbase.manifest.json +4 -7
  312. package/lib/commands/permit/index.js +0 -1
  313. package/lib/commands/permit/page-get.d.ts +0 -2
  314. package/lib/commands/permit/page-get.js +0 -1
  315. package/lib/commands/permit/page-set.d.ts +0 -2
  316. package/lib/commands/permit/page-set.js +0 -1
  317. package/lib/commands/permit/role-apis-set.d.ts +0 -2
  318. package/lib/commands/permit/role-apis-set.js +0 -1
  319. package/lib/commands/permit/role-menus-set.d.ts +0 -2
  320. package/lib/commands/permit/role-menus-set.js +0 -1
  321. package/lib/commands/permit/role-menus.d.ts +0 -2
  322. package/lib/commands/permit/role-menus.js +0 -1
  323. package/lib/commands/permit/shared.d.ts +0 -74
  324. package/lib/commands/permit/shared.js +0 -1
  325. package/lib/commands/role/create.d.ts +0 -2
  326. package/lib/commands/role/create.js +0 -1
  327. package/skills/rabetbase/guides/role-permit-workflow.md +0 -127
  328. package/skills/rabetbase/references/rabetbase-permit-page-set.md +0 -69
  329. package/skills/rabetbase/references/rabetbase-permit-role-apis-set.md +0 -53
  330. package/skills/rabetbase/references/rabetbase-permit-role-menus-set.md +0 -57
@@ -1 +1 @@
1
- const a129_0x4d5044=a129_0x32dc;(function(_0x406255,_0x1f2ed8){const _0x549699=a129_0x32dc,_0x4a4149=_0x406255();while(!![]){try{const _0x384b8d=-parseInt(_0x549699(0xc2))/0x1*(-parseInt(_0x549699(0xdd))/0x2)+-parseInt(_0x549699(0xcd))/0x3+parseInt(_0x549699(0xc9))/0x4*(parseInt(_0x549699(0xdf))/0x5)+parseInt(_0x549699(0xbd))/0x6+-parseInt(_0x549699(0xd6))/0x7+-parseInt(_0x549699(0xcb))/0x8+parseInt(_0x549699(0xdc))/0x9;if(_0x384b8d===_0x1f2ed8)break;else _0x4a4149['push'](_0x4a4149['shift']());}catch(_0x41f908){_0x4a4149['push'](_0x4a4149['shift']());}}}(a129_0x3685,0x6c4ee));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';function a129_0x32dc(_0x43556e,_0xb90e7a){_0x43556e=_0x43556e-0xb2;const _0x368560=a129_0x3685();let _0x32dc90=_0x368560[_0x43556e];return _0x32dc90;}import{logger}from'../../../utils/logger.js';function a129_0x3685(){const _0x2e7382=['push','1239340gosqwN','hasOwn','Invalid\x20--params.','has','JS\x20URL\x20is\x20unreachable:\x20','jsUrl','map','Invalid\x20--params:\x20','import','Invalid\x20--params\x20fields:\x20','pages','cssUrl','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','object','1834866igtnuH','dryRun','path','message','\x0a\x20\x20Available\x20local\x20paths:\x20','1zePxww','trim','Menu\x20sync\x20completed','No\x20local\x20pages\x20matched\x20paths:\x20','procode','--params.','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','4JsMKqw','filter','4427640MMhTnW','keys','2415345yGyWnE','isArray','CSS\x20URL\x20is\x20unreachable:\x20','length','Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20','join','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','menu-sync','281043WZRjAj','string','field',':\x20expected\x20a\x20non-empty\x20string.','setLogPath','get','9544257UFSBzA','456394sASUKA'];a129_0x3685=function(){return _0x2e7382;};return a129_0x3685();}const MENU_SYNC_PARAM_KEYS=new Set([a129_0x4d5044(0xb4),'cssUrl']);function validateParams(_0x31e304){const _0x51e867=a129_0x4d5044,_0x69d328=[];return _0x31e304[_0x51e867(0xb4)]&&!isValidJsHttpsUrl(_0x31e304[_0x51e867(0xb4)])&&_0x69d328['push']({'field':_0x51e867(0xb4),'message':_0x51e867(0xc8)}),_0x31e304[_0x51e867(0xba)]&&!isValidCssHttpsUrl(_0x31e304['cssUrl'])&&_0x69d328[_0x51e867(0xde)]({'field':_0x51e867(0xba),'message':_0x51e867(0xd3)}),_0x69d328;}export async function runMenuSyncCore(_0x120aa1,_0x1d6627,_0x98f32c=[],_0x5e43ac,_0x55db83={}){const _0x253fbd=a129_0x4d5044,_0x24ed2a=parseMenuSyncParams(_0x5e43ac),_0x4bd814=[...new Set(_0x98f32c[_0x253fbd(0xb5)](_0xfeeaa2=>_0xfeeaa2[_0x253fbd(0xc3)]())[_0x253fbd(0xca)](Boolean))],_0x33f669=_0x24ed2a['jsUrl'],_0x5123b7=_0x24ed2a[_0x253fbd(0xba)],_0x54367e=[];if(_0x33f669)_0x54367e[_0x253fbd(0xde)](_0x33f669);if(_0x5123b7)_0x54367e[_0x253fbd(0xde)](_0x5123b7);const _0x44e8d9=validateParams(_0x24ed2a);if(_0x44e8d9[_0x253fbd(0xd0)]>0x0){const _0x488ced=_0x44e8d9[_0x253fbd(0xb5)](_0x8007f1=>_0x253fbd(0xc7)+_0x8007f1[_0x253fbd(0xd8)]+':\x20'+_0x8007f1[_0x253fbd(0xc0)])[_0x253fbd(0xd2)](';\x20');throw new Error(_0x253fbd(0xb6)+_0x488ced);}logger[_0x253fbd(0xda)](process['cwd']()),logger['info'](_0x253fbd(0xd5),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x120aa1,'selectedCount':_0x4bd814[_0x253fbd(0xd0)],'jsUrl':_0x33f669,'cssUrl':_0x5123b7});if(_0x33f669){const _0x34179d=await isUrlReachable(_0x33f669);if(!_0x34179d)throw new Error(_0x253fbd(0xb3)+_0x33f669);}if(_0x5123b7){const _0x384cd6=await isUrlReachable(_0x5123b7);if(!_0x384cd6)throw new Error(_0x253fbd(0xcf)+_0x5123b7);}const _0x505e6c=getLocalPages();if(_0x505e6c['length']===0x0){if(_0x4bd814[_0x253fbd(0xd0)]>0x0)throw new Error(_0x253fbd(0xc5)+_0x4bd814[_0x253fbd(0xd2)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x55db83[_0x253fbd(0xbe)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x45184e=await getOnlineMenuList(_0x120aa1,_0x1d6627),_0x303273=new Set(_0x45184e[_0x253fbd(0xb5)](_0x3df0c6=>_0x3df0c6[_0x253fbd(0xbf)]));let _0x46f5c4;if(_0x4bd814['length']>0x0){const _0x52e40f=new Map(_0x505e6c[_0x253fbd(0xb5)](_0x3880b2=>[_0x3880b2['path'],_0x3880b2])),_0x51b34d=_0x4bd814[_0x253fbd(0xca)](_0x359d46=>!_0x52e40f['has'](_0x359d46));if(_0x51b34d[_0x253fbd(0xd0)]>0x0){const _0x29a505=_0x505e6c['map'](_0x48c359=>_0x48c359[_0x253fbd(0xbf)])['join'](',\x20');throw new Error(_0x253fbd(0xc5)+_0x51b34d['join'](',\x20')+_0x253fbd(0xc1)+_0x29a505);}const _0x365785=_0x4bd814['filter'](_0x28e094=>_0x303273[_0x253fbd(0xb2)](_0x28e094));if(_0x365785[_0x253fbd(0xd0)]>0x0)throw new Error(_0x253fbd(0xd1)+_0x365785[_0x253fbd(0xd2)](',\x20'));_0x46f5c4=_0x4bd814[_0x253fbd(0xb5)](_0xa069cd=>_0x52e40f[_0x253fbd(0xdb)](_0xa069cd));}else _0x46f5c4=_0x505e6c[_0x253fbd(0xca)](_0x3394a4=>!_0x303273[_0x253fbd(0xb2)](_0x3394a4['path']));if(_0x46f5c4['length']===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x55db83[_0x253fbd(0xbe)]===!![],'targetPages':[],'plannedMenus':[]};const _0x2af984=_0x46f5c4['map'](_0x4b4877=>({'type':_0x253fbd(0xc6),'path':_0x4b4877['path'],'label':_0x4b4877['label'],'loadScriptMode':_0x253fbd(0xb7),'resources':[..._0x54367e]}));if(_0x55db83[_0x253fbd(0xbe)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x46f5c4,'plannedMenus':_0x2af984};const _0xe1802b=await createMenus(_0x120aa1,_0x1d6627,_0x46f5c4,_0x54367e['length']>0x0?_0x54367e:undefined);return logger['info'](_0x253fbd(0xd5),_0x253fbd(0xc4),{'count':_0x46f5c4['length'],'resources':_0x54367e}),{'created':_0xe1802b['length'],'skipped':![],'dryRun':![],'targetPages':_0x46f5c4,'plannedMenus':_0x2af984,'menus':_0xe1802b};}export function parseMenuSyncParams(_0x10fdb8){const _0x32b69e=a129_0x4d5044;if(!_0x10fdb8||typeof _0x10fdb8!=='string')return{};let _0x5659ba;try{_0x5659ba=JSON['parse'](_0x10fdb8);}catch{throw new Error('Invalid\x20--params\x20JSON.');}if(typeof _0x5659ba!==_0x32b69e(0xbc)||_0x5659ba===null||Array[_0x32b69e(0xce)](_0x5659ba))throw new Error(_0x32b69e(0xbb));const _0x53a7d1=_0x5659ba;if(Object[_0x32b69e(0xe0)](_0x53a7d1,_0x32b69e(0xb9)))throw new Error(_0x32b69e(0xd4));const _0x37d1d8=Object[_0x32b69e(0xcc)](_0x53a7d1)[_0x32b69e(0xca)](_0x18cb9f=>!MENU_SYNC_PARAM_KEYS[_0x32b69e(0xb2)](_0x18cb9f));if(_0x37d1d8[_0x32b69e(0xd0)]>0x0)throw new Error(_0x32b69e(0xb8)+_0x37d1d8['join'](',\x20')+'.');for(const _0x12106d of MENU_SYNC_PARAM_KEYS){const _0x49ecae=_0x53a7d1[_0x12106d];if(_0x49ecae!==undefined&&(typeof _0x49ecae!==_0x32b69e(0xd7)||_0x49ecae[_0x32b69e(0xc3)]()===''))throw new Error(_0x32b69e(0xe1)+_0x12106d+_0x32b69e(0xd9));}return{'jsUrl':typeof _0x53a7d1[_0x32b69e(0xb4)]===_0x32b69e(0xd7)?_0x53a7d1[_0x32b69e(0xb4)][_0x32b69e(0xc3)]():undefined,'cssUrl':typeof _0x53a7d1['cssUrl']===_0x32b69e(0xd7)?_0x53a7d1[_0x32b69e(0xba)][_0x32b69e(0xc3)]():undefined};}
1
+ const a130_0x21e9e4=a130_0x39b6;function a130_0x504d(){const _0x2c1307=['47665ntArfk','686539yUXzFO','5325388rDflrU','map','string','path','24IQxzVd','4911591BpwksF','225DngHHa','\x0a\x20\x20Available\x20local\x20paths:\x20','1056PIlYiO','Invalid\x20--params\x20fields:\x20','join','Menu\x20sync\x20completed','54AXxQLz','field','procode','JS\x20URL\x20is\x20unreachable:\x20','setLogPath','info','34786jEdBVl','label','import','cwd','136FhpcDB','10397024oliIAS','isArray','get','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','cssUrl','trim','dryRun','jsUrl','hasOwn','menu-sync','length','push','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','pages','keys',':\x20expected\x20a\x20non-empty\x20string.','160010YhyowD','has','Invalid\x20--params:\x20expected\x20a\x20JSON\x20object.','--params.pages\x20is\x20no\x20longer\x20supported.\x20Use\x20--paths\x20with\x20exact\x20local\x20page\x20paths.','filter','Invalid\x20--params\x20JSON.','message'];a130_0x504d=function(){return _0x2c1307;};return a130_0x504d();}(function(_0x3e9b3a,_0x5d9838){const _0x2b3a59=a130_0x39b6,_0x68d60d=_0x3e9b3a();while(!![]){try{const _0x5dd721=-parseInt(_0x2b3a59(0xf0))/0x1*(parseInt(_0x2b3a59(0xc6))/0x2)+parseInt(_0x2b3a59(0xe9))/0x3+-parseInt(_0x2b3a59(0xe4))/0x4+parseInt(_0x2b3a59(0xe2))/0x5*(parseInt(_0x2b3a59(0xec))/0x6)+parseInt(_0x2b3a59(0xe3))/0x7*(-parseInt(_0x2b3a59(0xca))/0x8)+parseInt(_0x2b3a59(0xea))/0x9*(-parseInt(_0x2b3a59(0xdb))/0xa)+parseInt(_0x2b3a59(0xcb))/0xb*(parseInt(_0x2b3a59(0xe8))/0xc);if(_0x5dd721===_0x5d9838)break;else _0x68d60d['push'](_0x68d60d['shift']());}catch(_0x4eb0dd){_0x68d60d['push'](_0x68d60d['shift']());}}}(a130_0x504d,0xd3c8e));function a130_0x39b6(_0x345bfc,_0x7297f3){_0x345bfc=_0x345bfc-0xc2;const _0x504d0b=a130_0x504d();let _0x39b65c=_0x504d0b[_0x345bfc];return _0x39b65c;}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([a130_0x21e9e4(0xd2),a130_0x21e9e4(0xcf)]);function validateParams(_0x246266){const _0x3cefb1=a130_0x21e9e4,_0x1b25cc=[];return _0x246266['jsUrl']&&!isValidJsHttpsUrl(_0x246266['jsUrl'])&&_0x1b25cc[_0x3cefb1(0xd6)]({'field':_0x3cefb1(0xd2),'message':_0x3cefb1(0xce)}),_0x246266['cssUrl']&&!isValidCssHttpsUrl(_0x246266['cssUrl'])&&_0x1b25cc[_0x3cefb1(0xd6)]({'field':_0x3cefb1(0xcf),'message':_0x3cefb1(0xd7)}),_0x1b25cc;}export async function runMenuSyncCore(_0x54cb39,_0x16ae5b,_0x229341=[],_0x30249d,_0x23b831={}){const _0x4d6b56=a130_0x21e9e4,_0x369900=parseMenuSyncParams(_0x30249d),_0x503658=[...new Set(_0x229341['map'](_0x281155=>_0x281155['trim']())['filter'](Boolean))],_0x47edfb=_0x369900[_0x4d6b56(0xd2)],_0x7dfd43=_0x369900['cssUrl'],_0x2f68a7=[];if(_0x47edfb)_0x2f68a7[_0x4d6b56(0xd6)](_0x47edfb);if(_0x7dfd43)_0x2f68a7[_0x4d6b56(0xd6)](_0x7dfd43);const _0x5d2808=validateParams(_0x369900);if(_0x5d2808[_0x4d6b56(0xd5)]>0x0){const _0x687ff2=_0x5d2808[_0x4d6b56(0xe5)](_0x32dd4a=>'--params.'+_0x32dd4a[_0x4d6b56(0xf1)]+':\x20'+_0x32dd4a[_0x4d6b56(0xe1)])['join'](';\x20');throw new Error('Invalid\x20--params:\x20'+_0x687ff2);}logger[_0x4d6b56(0xc4)](process[_0x4d6b56(0xc9)]()),logger[_0x4d6b56(0xc5)](_0x4d6b56(0xd4),'Start\x20non-interactive\x20menu\x20sync',{'appCode':_0x54cb39,'selectedCount':_0x503658[_0x4d6b56(0xd5)],'jsUrl':_0x47edfb,'cssUrl':_0x7dfd43});if(_0x47edfb){const _0x20ac6c=await isUrlReachable(_0x47edfb);if(!_0x20ac6c)throw new Error(_0x4d6b56(0xc3)+_0x47edfb);}if(_0x7dfd43){const _0x32baa5=await isUrlReachable(_0x7dfd43);if(!_0x32baa5)throw new Error('CSS\x20URL\x20is\x20unreachable:\x20'+_0x7dfd43);}const _0x3477d2=getLocalPages();if(_0x3477d2[_0x4d6b56(0xd5)]===0x0){if(_0x503658[_0x4d6b56(0xd5)]>0x0)throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x503658[_0x4d6b56(0xee)](',\x20'));return{'created':0x0,'skipped':!![],'dryRun':_0x23b831[_0x4d6b56(0xd1)]===!![],'targetPages':[],'plannedMenus':[]};}const _0x958096=await getOnlineMenuList(_0x54cb39,_0x16ae5b),_0xf7591=new Set(_0x958096[_0x4d6b56(0xe5)](_0x5b8d72=>_0x5b8d72[_0x4d6b56(0xe7)]));let _0x4b8591;if(_0x503658[_0x4d6b56(0xd5)]>0x0){const _0x4ebd9d=new Map(_0x3477d2[_0x4d6b56(0xe5)](_0x4fcf79=>[_0x4fcf79[_0x4d6b56(0xe7)],_0x4fcf79])),_0x380bf6=_0x503658[_0x4d6b56(0xdf)](_0x1b194f=>!_0x4ebd9d[_0x4d6b56(0xdc)](_0x1b194f));if(_0x380bf6[_0x4d6b56(0xd5)]>0x0){const _0xb010b6=_0x3477d2[_0x4d6b56(0xe5)](_0x109197=>_0x109197[_0x4d6b56(0xe7)])['join'](',\x20');throw new Error('No\x20local\x20pages\x20matched\x20paths:\x20'+_0x380bf6[_0x4d6b56(0xee)](',\x20')+_0x4d6b56(0xeb)+_0xb010b6);}const _0x4aca5f=_0x503658[_0x4d6b56(0xdf)](_0x5493c9=>_0xf7591[_0x4d6b56(0xdc)](_0x5493c9));if(_0x4aca5f[_0x4d6b56(0xd5)]>0x0)throw new Error('Local\x20page\x20paths\x20are\x20already\x20on\x20the\x20platform:\x20'+_0x4aca5f[_0x4d6b56(0xee)](',\x20'));_0x4b8591=_0x503658[_0x4d6b56(0xe5)](_0x4696b9=>_0x4ebd9d[_0x4d6b56(0xcd)](_0x4696b9));}else _0x4b8591=_0x3477d2['filter'](_0x782d7e=>!_0xf7591[_0x4d6b56(0xdc)](_0x782d7e['path']));if(_0x4b8591[_0x4d6b56(0xd5)]===0x0)return{'created':0x0,'skipped':!![],'dryRun':_0x23b831[_0x4d6b56(0xd1)]===!![],'targetPages':[],'plannedMenus':[]};const _0x4f0606=_0x4b8591[_0x4d6b56(0xe5)](_0xd8c165=>({'type':_0x4d6b56(0xc2),'path':_0xd8c165[_0x4d6b56(0xe7)],'label':_0xd8c165[_0x4d6b56(0xc7)],'loadScriptMode':_0x4d6b56(0xc8),'resources':[..._0x2f68a7]}));if(_0x23b831[_0x4d6b56(0xd1)])return{'created':0x0,'skipped':![],'dryRun':!![],'targetPages':_0x4b8591,'plannedMenus':_0x4f0606};const _0x548da5=await createMenus(_0x54cb39,_0x16ae5b,_0x4b8591,_0x2f68a7['length']>0x0?_0x2f68a7:undefined);return logger[_0x4d6b56(0xc5)](_0x4d6b56(0xd4),_0x4d6b56(0xef),{'count':_0x4b8591[_0x4d6b56(0xd5)],'resources':_0x2f68a7}),{'created':_0x548da5['length'],'skipped':![],'dryRun':![],'targetPages':_0x4b8591,'plannedMenus':_0x4f0606,'menus':_0x548da5};}export function parseMenuSyncParams(_0x36f5db){const _0x5d5686=a130_0x21e9e4;if(!_0x36f5db||typeof _0x36f5db!==_0x5d5686(0xe6))return{};let _0x307a42;try{_0x307a42=JSON['parse'](_0x36f5db);}catch{throw new Error(_0x5d5686(0xe0));}if(typeof _0x307a42!=='object'||_0x307a42===null||Array[_0x5d5686(0xcc)](_0x307a42))throw new Error(_0x5d5686(0xdd));const _0x3651aa=_0x307a42;if(Object[_0x5d5686(0xd3)](_0x3651aa,_0x5d5686(0xd8)))throw new Error(_0x5d5686(0xde));const _0x3eba9e=Object[_0x5d5686(0xd9)](_0x3651aa)['filter'](_0x208089=>!MENU_SYNC_PARAM_KEYS['has'](_0x208089));if(_0x3eba9e['length']>0x0)throw new Error(_0x5d5686(0xed)+_0x3eba9e[_0x5d5686(0xee)](',\x20')+'.');for(const _0x52aecc of MENU_SYNC_PARAM_KEYS){const _0x324e06=_0x3651aa[_0x52aecc];if(_0x324e06!==undefined&&(typeof _0x324e06!=='string'||_0x324e06[_0x5d5686(0xd0)]()===''))throw new Error('Invalid\x20--params.'+_0x52aecc+_0x5d5686(0xda));}return{'jsUrl':typeof _0x3651aa[_0x5d5686(0xd2)]==='string'?_0x3651aa['jsUrl'][_0x5d5686(0xd0)]():undefined,'cssUrl':typeof _0x3651aa['cssUrl']===_0x5d5686(0xe6)?_0x3651aa[_0x5d5686(0xcf)]['trim']():undefined};}
@@ -1 +1 @@
1
- (function(_0x13c9da,_0x4588ad){const _0x1696ad=a131_0x557f,_0x26eb80=_0x13c9da();while(!![]){try{const _0xced495=-parseInt(_0x1696ad(0x101))/0x1*(-parseInt(_0x1696ad(0x11f))/0x2)+parseInt(_0x1696ad(0x11c))/0x3*(parseInt(_0x1696ad(0x104))/0x4)+parseInt(_0x1696ad(0x12e))/0x5*(-parseInt(_0x1696ad(0x132))/0x6)+parseInt(_0x1696ad(0x12d))/0x7*(parseInt(_0x1696ad(0x120))/0x8)+parseInt(_0x1696ad(0x12b))/0x9*(-parseInt(_0x1696ad(0xfe))/0xa)+parseInt(_0x1696ad(0x109))/0xb+parseInt(_0x1696ad(0x107))/0xc*(parseInt(_0x1696ad(0x117))/0xd);if(_0xced495===_0x4588ad)break;else _0x26eb80['push'](_0x26eb80['shift']());}catch(_0x26671b){_0x26eb80['push'](_0x26eb80['shift']());}}}(a131_0x692f,0xee6b0));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 a131_0x557f(_0x342641,_0x170b4f){_0x342641=_0x342641-0xf0;const _0x692f2=a131_0x692f();let _0x557fe0=_0x692f2[_0x342641];return _0x557fe0;}function validateParams(_0x4e6cd8){const _0x1b7dec=a131_0x557f,_0x122948=[];return _0x4e6cd8[_0x1b7dec(0x121)]&&!isValidJsHttpsUrl(_0x4e6cd8[_0x1b7dec(0x121)])&&_0x122948[_0x1b7dec(0x123)]({'field':_0x1b7dec(0x121),'message':_0x1b7dec(0xf1)}),_0x4e6cd8[_0x1b7dec(0x108)]&&!isValidCssHttpsUrl(_0x4e6cd8[_0x1b7dec(0x108)])&&_0x122948[_0x1b7dec(0x123)]({'field':_0x1b7dec(0x108),'message':_0x1b7dec(0x119)}),_0x122948;}export async function runMenuUpdateCore(_0x337df3,_0x31b9fa,_0x892d9c,_0x472c0e={}){const _0x1345ec=a131_0x557f,_0x414a57=parseUpdateParamsFlag(_0x892d9c),_0x2aae4f=normalizeMode(_0x472c0e['mode']);validateSelection(_0x472c0e[_0x1345ec(0xff)]);const _0x43fcc0=[];if(_0x414a57[_0x1345ec(0x121)])_0x43fcc0[_0x1345ec(0x123)](_0x414a57[_0x1345ec(0x121)]);if(_0x414a57[_0x1345ec(0x108)])_0x43fcc0[_0x1345ec(0x123)](_0x414a57[_0x1345ec(0x108)]);const _0x543b8f=validateParams(_0x414a57);if(_0x543b8f[_0x1345ec(0xf7)]>0x0){const _0x1531a1=_0x543b8f[_0x1345ec(0x11b)](_0x1c2325=>_0x1345ec(0x127)+_0x1c2325['field']+':\x20'+_0x1c2325[_0x1345ec(0x111)])[_0x1345ec(0x12c)](';\x20');throw new Error(_0x1345ec(0xf6)+_0x1531a1);}if(_0x43fcc0[_0x1345ec(0xf7)]===0x0)throw new Error('Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20'+_0x1345ec(0xf4));logger[_0x1345ec(0xf3)](process[_0x1345ec(0x10e)]()),logger[_0x1345ec(0x10a)](_0x1345ec(0x131),_0x1345ec(0xfc),{'appCode':_0x337df3,'jsUrl':_0x414a57['jsUrl'],'cssUrl':_0x414a57[_0x1345ec(0x108)],'mode':_0x2aae4f,'dryRun':_0x472c0e['dryRun']===!![]});if(_0x414a57[_0x1345ec(0x121)]){const _0x457729=await isUrlReachable(_0x414a57[_0x1345ec(0x121)]);if(!_0x457729)throw new Error(_0x1345ec(0x12a)+_0x414a57[_0x1345ec(0x121)]);}if(_0x414a57[_0x1345ec(0x108)]){const _0xb696c3=await isUrlReachable(_0x414a57[_0x1345ec(0x108)]);if(!_0xb696c3)throw new Error(_0x1345ec(0x100)+_0x414a57[_0x1345ec(0x108)]);}const _0x55d5c7=await getOnlineMenuList(_0x337df3,_0x31b9fa),_0x4196c5=_0x55d5c7[_0x1345ec(0x113)](_0x1b7a95=>_0x1b7a95[_0x1345ec(0xf8)][_0x1345ec(0xf7)]>0x0),_0x58415d=selectMenusForUpdate(_0x4196c5,_0x472c0e[_0x1345ec(0xff)]);if(_0x58415d[_0x1345ec(0xf7)]===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x472c0e[_0x1345ec(0x10f)]===!![]};const _0x39a513=_0x58415d[_0x1345ec(0x11b)](_0x89946=>buildMenuUpdateDiff(_0x89946,_0x414a57,_0x2aae4f,_0x472c0e['force']===!![],_0x472c0e[_0x1345ec(0x122)]));if(_0x472c0e[_0x1345ec(0x10f)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x39a513};const _0x5a02dc=await Promise['allSettled'](_0x58415d[_0x1345ec(0x11b)]((_0x134dbd,_0x3588fe)=>updateMenuCdnUrl(_0x337df3,_0x31b9fa,{'id':_0x134dbd['id'],'label':_0x134dbd[_0x1345ec(0x11d)],'path':_0x134dbd[_0x1345ec(0x103)],'resources':_0x39a513[_0x3588fe][_0x1345ec(0x137)][_0x1345ec(0xf8)],'extend':_0x134dbd['extend']??null,'loadScriptMode':_0x472c0e['loadScriptMode']}))),_0x51ac85=_0x5a02dc[_0x1345ec(0x113)](_0x10bb00=>_0x10bb00['status']===_0x1345ec(0x116))[_0x1345ec(0x11b)](_0x589118=>_0x589118[_0x1345ec(0x126)]),_0x562613=_0x5a02dc[_0x1345ec(0x113)](_0x584238=>_0x584238[_0x1345ec(0x135)]==='rejected')['length'];return logger[_0x1345ec(0x10a)](_0x1345ec(0x131),_0x1345ec(0xf2),{'count':_0x58415d['length'],'resources':_0x43fcc0}),{'updated':_0x51ac85[_0x1345ec(0xf7)],'failed':_0x562613,'skipped':![],'menus':_0x51ac85};}function validateSelection(_0x28814e){const _0x32b2b7=a131_0x557f;if(!_0x28814e)throw new Error(_0x32b2b7(0x11a));if(_0x28814e[_0x32b2b7(0x110)]&&(_0x28814e[_0x32b2b7(0x124)][_0x32b2b7(0xf7)]>0x0||_0x28814e['paths'][_0x32b2b7(0xf7)]>0x0))throw new Error(_0x32b2b7(0x136));if(!_0x28814e[_0x32b2b7(0x110)]&&_0x28814e[_0x32b2b7(0x124)]['length']===0x0&&_0x28814e[_0x32b2b7(0x11e)]['length']===0x0)throw new Error(_0x32b2b7(0x11a));}export function selectMenusForUpdate(_0x576535,_0x5c0392){const _0x17ef53=a131_0x557f;validateSelection(_0x5c0392);if(_0x5c0392[_0x17ef53(0x110)])return _0x576535;const _0x1126f3=new Set(_0x576535[_0x17ef53(0x11b)](_0x5ed7e0=>_0x5ed7e0['id'])),_0x5d5957=new Set(_0x576535['map'](_0x6e8c8b=>_0x6e8c8b[_0x17ef53(0x103)])),_0x280fb1=_0x5c0392[_0x17ef53(0x124)][_0x17ef53(0x113)](_0x566ef1=>!_0x1126f3[_0x17ef53(0x129)](_0x566ef1)),_0xe0be1e=_0x5c0392[_0x17ef53(0x11e)][_0x17ef53(0x113)](_0x1457e0=>!_0x5d5957[_0x17ef53(0x129)](_0x1457e0));if(_0x280fb1[_0x17ef53(0xf7)]>0x0||_0xe0be1e[_0x17ef53(0xf7)]>0x0){const _0xa57f42=[..._0x280fb1[_0x17ef53(0x11b)](_0x5cc3c1=>String(_0x5cc3c1)),..._0xe0be1e][_0x17ef53(0x12c)](',\x20');throw new Error(_0x17ef53(0xf0)+_0xa57f42);}const _0x18e2bf=new Set(_0x5c0392[_0x17ef53(0x124)]),_0x38c55f=new Set(_0x5c0392[_0x17ef53(0x11e)]);return _0x576535[_0x17ef53(0x113)](_0x177f6f=>_0x18e2bf[_0x17ef53(0x129)](_0x177f6f['id'])||_0x38c55f[_0x17ef53(0x129)](_0x177f6f[_0x17ef53(0x103)]));}function normalizeMode(_0x104074){const _0x4e2e7f=a131_0x557f;if(!_0x104074)return _0x4e2e7f(0x133);if(_0x104074===_0x4e2e7f(0x10d)||_0x104074===_0x4e2e7f(0x133))return _0x104074;throw new Error(_0x4e2e7f(0x115)+_0x104074+_0x4e2e7f(0xfa));}function buildMenuUpdateDiff(_0x2f1c4d,_0x341eaa,_0x373827,_0x4a49d3,_0x1bc1f9){const _0x1eada2=a131_0x557f,_0x49f312=[..._0x2f1c4d[_0x1eada2(0xf8)]];_0x373827==='patch'&&assertUnambiguousPatchResources(_0x2f1c4d,_0x49f312,_0x341eaa);const _0x2479aa=_0x373827===_0x1eada2(0x133)?patchResources(_0x49f312,_0x341eaa):replaceResources(_0x341eaa),_0x464c95=[],_0x36627f=_0x49f312[_0x1eada2(0x118)](isJsResource),_0x96f8d9=_0x2479aa[_0x1eada2(0x118)](isJsResource);if(_0x36627f&&!_0x96f8d9){const _0x28b0c3='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x2f1c4d[_0x1eada2(0x11d)]+'\x22\x20('+_0x2f1c4d[_0x1eada2(0x103)]+_0x1eada2(0x10c)+_0x1eada2(0x10b);if(!_0x4a49d3)throw new Error(_0x28b0c3);_0x464c95[_0x1eada2(0x123)](_0x28b0c3);}const _0x4cb39f=_0x49f312[_0x1eada2(0x118)](isCssResource),_0x331a9d=_0x2479aa[_0x1eada2(0x118)](isCssResource);_0x4cb39f&&!_0x331a9d&&_0x464c95[_0x1eada2(0x123)](_0x1eada2(0x130)+_0x2f1c4d[_0x1eada2(0x11d)]+'\x22\x20('+_0x2f1c4d[_0x1eada2(0x103)]+').');const _0x1f1ebe=typeof _0x2f1c4d[_0x1eada2(0x114)]?.['loadScriptMode']===_0x1eada2(0x105)?_0x2f1c4d[_0x1eada2(0x114)][_0x1eada2(0x122)]:null,_0xd4b69f=_0x1bc1f9?{'loadScriptMode':_0x1f1ebe}:{},_0x148baa=_0x1bc1f9?{'loadScriptMode':_0x1bc1f9}:{};return{'id':_0x2f1c4d['id'],'label':_0x2f1c4d['label'],'path':_0x2f1c4d['path'],'mode':_0x373827,'before':{'resources':_0x49f312,..._0xd4b69f},'after':{'resources':_0x2479aa,..._0x148baa},'warnings':_0x464c95};}function replaceResources(_0x5dcba0){const _0x95160a=a131_0x557f;return[_0x5dcba0[_0x95160a(0x121)],_0x5dcba0[_0x95160a(0x108)]][_0x95160a(0x113)](_0x1a9e2d=>!!_0x1a9e2d);}function assertUnambiguousPatchResources(_0x427b2e,_0x4112af,_0x5e2db9){const _0x292a27=a131_0x557f,_0x87dbb5=_0x4112af[_0x292a27(0x113)](isJsResource)[_0x292a27(0xf7)];if(_0x5e2db9[_0x292a27(0x121)]&&_0x87dbb5>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x87dbb5+_0x292a27(0x128)+_0x427b2e['label']+_0x292a27(0xf9)+_0x427b2e[_0x292a27(0x103)]+')\x20'+_0x292a27(0xf5));const _0x546a5f=_0x4112af['filter'](isCssResource)[_0x292a27(0xf7)];if(_0x5e2db9['cssUrl']&&_0x546a5f>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x546a5f+'\x20existing\x20CSS\x20resources\x20for\x20\x22'+_0x427b2e[_0x292a27(0x11d)]+_0x292a27(0xf9)+_0x427b2e[_0x292a27(0x103)]+')\x20'+_0x292a27(0x134));}function a131_0x692f(){const _0x5953de=['JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','Menu\x20asset\x20update\x20completed','setLogPath','Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','Invalid\x20--params:\x20','length','resources','\x22\x20(','.\x20Allowed\x20values:\x20replace,\x20patch','isArray','Start\x20non-interactive\x20menu\x20asset\x20update','object','751470CKQTQx','selection','CSS\x20URL\x20is\x20unreachable:\x20','77RpJMKF','trim','path','4xsWvLC','string','.js','4164nHfBcS','cssUrl','6803214AwbBdu','info','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.',').\x20','replace','cwd','dryRun','all','message','toLowerCase','filter','extend','Invalid\x20--mode:\x20','fulfilled','24037jlJuhg','some','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','map','780969YzbXQD','label','paths','10238kazhny','8NksKyy','jsUrl','loadScriptMode','push','menuIds','split','value','--params.','\x20existing\x20JS\x20resources\x20for\x20\x22','has','JS\x20URL\x20is\x20unreachable:\x20','99cuYnmM','join','1372301WzFFrP','145tZSWEe','endsWith','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','menu-asset-update','63606QeGWif','patch','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','status','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','after','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20'];a131_0x692f=function(){return _0x5953de;};return a131_0x692f();}function patchResources(_0x36d2b5,_0x3f22b1){const _0x202744=a131_0x557f;let _0x2a322b=![],_0x3ac4fd=![];const _0x37f079=[];for(const _0x5441ef of _0x36d2b5){if(isJsResource(_0x5441ef)){if(_0x3f22b1['jsUrl']&&!_0x2a322b)_0x37f079[_0x202744(0x123)](_0x3f22b1[_0x202744(0x121)]),_0x2a322b=!![];else!_0x3f22b1['jsUrl']&&_0x37f079[_0x202744(0x123)](_0x5441ef);continue;}if(isCssResource(_0x5441ef)){if(_0x3f22b1['cssUrl']&&!_0x3ac4fd)_0x37f079[_0x202744(0x123)](_0x3f22b1[_0x202744(0x108)]),_0x3ac4fd=!![];else!_0x3f22b1[_0x202744(0x108)]&&_0x37f079[_0x202744(0x123)](_0x5441ef);continue;}_0x37f079[_0x202744(0x123)](_0x5441ef);}return _0x3f22b1['jsUrl']&&!_0x2a322b&&_0x37f079['unshift'](_0x3f22b1[_0x202744(0x121)]),_0x3f22b1[_0x202744(0x108)]&&!_0x3ac4fd&&_0x37f079['push'](_0x3f22b1[_0x202744(0x108)]),_0x37f079;}function isJsResource(_0x4d52fe){const _0x5e9986=a131_0x557f;return stripQuery(_0x4d52fe)[_0x5e9986(0x112)]()[_0x5e9986(0x12f)](_0x5e9986(0x106));}function isCssResource(_0x1c89bc){const _0x4bc97e=a131_0x557f;return stripQuery(_0x1c89bc)[_0x4bc97e(0x112)]()[_0x4bc97e(0x12f)]('.css');}function stripQuery(_0xd6ae5d){const _0x5883eb=a131_0x557f;return _0xd6ae5d[_0x5883eb(0x125)]('?')[0x0]??_0xd6ae5d;}function parseUpdateParamsFlag(_0x2019f9){const _0x1ba047=a131_0x557f;if(!_0x2019f9||typeof _0x2019f9!==_0x1ba047(0x105))return{};try{const _0x4739a8=JSON['parse'](_0x2019f9);if(typeof _0x4739a8!==_0x1ba047(0xfd)||_0x4739a8===null||Array[_0x1ba047(0xfb)](_0x4739a8))return{};return{'jsUrl':typeof _0x4739a8[_0x1ba047(0x121)]===_0x1ba047(0x105)?_0x4739a8[_0x1ba047(0x121)][_0x1ba047(0x102)]():undefined,'cssUrl':typeof _0x4739a8['cssUrl']===_0x1ba047(0x105)?_0x4739a8[_0x1ba047(0x108)][_0x1ba047(0x102)]():undefined};}catch{return{};}}
1
+ (function(_0x34c837,_0x34ebd2){const _0x781f4e=a132_0x10f2,_0x657372=_0x34c837();while(!![]){try{const _0x4f6b0b=parseInt(_0x781f4e(0xf7))/0x1+parseInt(_0x781f4e(0xfd))/0x2+parseInt(_0x781f4e(0x10b))/0x3*(-parseInt(_0x781f4e(0xfa))/0x4)+parseInt(_0x781f4e(0x115))/0x5+-parseInt(_0x781f4e(0x101))/0x6*(parseInt(_0x781f4e(0xf6))/0x7)+parseInt(_0x781f4e(0x10f))/0x8+parseInt(_0x781f4e(0x108))/0x9*(parseInt(_0x781f4e(0x100))/0xa);if(_0x4f6b0b===_0x34ebd2)break;else _0x657372['push'](_0x657372['shift']());}catch(_0x36cbfb){_0x657372['push'](_0x657372['shift']());}}}(a132_0x3f85,0xb69f8));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(_0x52396b){const _0x1bfb30=a132_0x10f2,_0x530eed=[];return _0x52396b[_0x1bfb30(0xf4)]&&!isValidJsHttpsUrl(_0x52396b['jsUrl'])&&_0x530eed['push']({'field':'jsUrl','message':_0x1bfb30(0x117)}),_0x52396b['cssUrl']&&!isValidCssHttpsUrl(_0x52396b[_0x1bfb30(0x106)])&&_0x530eed[_0x1bfb30(0xdc)]({'field':'cssUrl','message':_0x1bfb30(0x102)}),_0x530eed;}export async function runMenuUpdateCore(_0x749224,_0x49754d,_0x3769fe,_0x318974={}){const _0x1bedaf=a132_0x10f2,_0xe35370=parseUpdateParamsFlag(_0x3769fe),_0x464d41=normalizeMode(_0x318974[_0x1bedaf(0x110)]);validateSelection(_0x318974['selection']);const _0x35a11b=[];if(_0xe35370['jsUrl'])_0x35a11b[_0x1bedaf(0xdc)](_0xe35370[_0x1bedaf(0xf4)]);if(_0xe35370[_0x1bedaf(0x106)])_0x35a11b[_0x1bedaf(0xdc)](_0xe35370[_0x1bedaf(0x106)]);const _0x8e9386=validateParams(_0xe35370);if(_0x8e9386['length']>0x0){const _0x9fa535=_0x8e9386[_0x1bedaf(0x104)](_0x30d7e7=>_0x1bedaf(0x119)+_0x30d7e7[_0x1bedaf(0xee)]+':\x20'+_0x30d7e7[_0x1bedaf(0xe6)])[_0x1bedaf(0x105)](';\x20');throw new Error(_0x1bedaf(0xd6)+_0x9fa535);}if(_0x35a11b[_0x1bedaf(0xda)]===0x0)throw new Error(_0x1bedaf(0xf9)+'Pass\x20--params\x20\x27{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}\x27\x20to\x20update\x20assets.');logger[_0x1bedaf(0xe9)](process[_0x1bedaf(0xe2)]()),logger['info'](_0x1bedaf(0x111),_0x1bedaf(0x103),{'appCode':_0x749224,'jsUrl':_0xe35370[_0x1bedaf(0xf4)],'cssUrl':_0xe35370[_0x1bedaf(0x106)],'mode':_0x464d41,'dryRun':_0x318974[_0x1bedaf(0xff)]===!![]});if(_0xe35370[_0x1bedaf(0xf4)]){const _0x58daac=await isUrlReachable(_0xe35370['jsUrl']);if(!_0x58daac)throw new Error(_0x1bedaf(0xe8)+_0xe35370['jsUrl']);}if(_0xe35370[_0x1bedaf(0x106)]){const _0x2bbbaf=await isUrlReachable(_0xe35370[_0x1bedaf(0x106)]);if(!_0x2bbbaf)throw new Error(_0x1bedaf(0x113)+_0xe35370[_0x1bedaf(0x106)]);}const _0x31ff64=await getOnlineMenuList(_0x749224,_0x49754d),_0x3d68b4=_0x31ff64['filter'](_0x21c023=>_0x21c023[_0x1bedaf(0xd3)]['length']>0x0),_0x304e5d=selectMenusForUpdate(_0x3d68b4,_0x318974[_0x1bedaf(0xf2)]);if(_0x304e5d['length']===0x0)return{'updated':0x0,'failed':0x0,'skipped':!![],'dryRun':_0x318974[_0x1bedaf(0xff)]===!![]};const _0x60f8d8=_0x304e5d[_0x1bedaf(0x104)](_0x2d5fd2=>buildMenuUpdateDiff(_0x2d5fd2,_0xe35370,_0x464d41,_0x318974[_0x1bedaf(0xd4)]===!![],_0x318974[_0x1bedaf(0x114)]));if(_0x318974[_0x1bedaf(0xff)])return{'updated':0x0,'failed':0x0,'skipped':![],'dryRun':!![],'diffs':_0x60f8d8};const _0x4c807=await Promise[_0x1bedaf(0x109)](_0x304e5d['map']((_0x37fc89,_0x5ebeb6)=>updateMenuCdnUrl(_0x749224,_0x49754d,{'id':_0x37fc89['id'],'label':_0x37fc89[_0x1bedaf(0xe7)],'path':_0x37fc89[_0x1bedaf(0xfe)],'resources':_0x60f8d8[_0x5ebeb6][_0x1bedaf(0xed)][_0x1bedaf(0xd3)],'extend':_0x37fc89['extend']??null,'loadScriptMode':_0x318974['loadScriptMode']}))),_0xac8b6c=_0x4c807[_0x1bedaf(0xf8)](_0x471aa5=>_0x471aa5[_0x1bedaf(0xea)]==='fulfilled')['map'](_0x7d36c3=>_0x7d36c3[_0x1bedaf(0xe0)]),_0x5eacab=_0x4c807[_0x1bedaf(0xf8)](_0x5e0aa1=>_0x5e0aa1[_0x1bedaf(0xea)]==='rejected')[_0x1bedaf(0xda)];return logger[_0x1bedaf(0xf0)](_0x1bedaf(0x111),_0x1bedaf(0x112),{'count':_0x304e5d[_0x1bedaf(0xda)],'resources':_0x35a11b}),{'updated':_0xac8b6c[_0x1bedaf(0xda)],'failed':_0x5eacab,'skipped':![],'menus':_0xac8b6c};}function a132_0x10f2(_0xf747c,_0x23fc06){_0xf747c=_0xf747c-0xd3;const _0x3f85f8=a132_0x3f85();let _0x10f2e7=_0x3f85f8[_0xf747c];return _0x10f2e7;}function validateSelection(_0x2a55c4){const _0x38f5eb=a132_0x10f2;if(!_0x2a55c4)throw new Error(_0x38f5eb(0xe3));if(_0x2a55c4[_0x38f5eb(0x10a)]&&(_0x2a55c4['menuIds'][_0x38f5eb(0xda)]>0x0||_0x2a55c4[_0x38f5eb(0xd9)][_0x38f5eb(0xda)]>0x0))throw new Error(_0x38f5eb(0xf1));if(!_0x2a55c4[_0x38f5eb(0x10a)]&&_0x2a55c4['menuIds'][_0x38f5eb(0xda)]===0x0&&_0x2a55c4[_0x38f5eb(0xd9)][_0x38f5eb(0xda)]===0x0)throw new Error(_0x38f5eb(0xe3));}export function selectMenusForUpdate(_0x2baac4,_0x16ce4a){const _0x185557=a132_0x10f2;validateSelection(_0x16ce4a);if(_0x16ce4a[_0x185557(0x10a)])return _0x2baac4;const _0x5276d5=new Set(_0x2baac4[_0x185557(0x104)](_0x5eb3d8=>_0x5eb3d8['id'])),_0x47bc06=new Set(_0x2baac4[_0x185557(0x104)](_0x1f2566=>_0x1f2566['path'])),_0x59954a=_0x16ce4a[_0x185557(0xfc)][_0x185557(0xf8)](_0xa89b68=>!_0x5276d5['has'](_0xa89b68)),_0x212b1a=_0x16ce4a[_0x185557(0xd9)][_0x185557(0xf8)](_0x2b5898=>!_0x47bc06[_0x185557(0xf3)](_0x2b5898));if(_0x59954a[_0x185557(0xda)]>0x0||_0x212b1a[_0x185557(0xda)]>0x0){const _0x84585c=[..._0x59954a[_0x185557(0x104)](_0x3b2568=>String(_0x3b2568)),..._0x212b1a][_0x185557(0x105)](',\x20');throw new Error(_0x185557(0xd7)+_0x84585c);}const _0x209f12=new Set(_0x16ce4a[_0x185557(0xfc)]),_0x19014a=new Set(_0x16ce4a[_0x185557(0xd9)]);return _0x2baac4['filter'](_0x26abfd=>_0x209f12[_0x185557(0xf3)](_0x26abfd['id'])||_0x19014a['has'](_0x26abfd['path']));}function normalizeMode(_0x3a8ca2){const _0x4324d0=a132_0x10f2;if(!_0x3a8ca2)return _0x4324d0(0xe4);if(_0x3a8ca2===_0x4324d0(0xef)||_0x3a8ca2==='patch')return _0x3a8ca2;throw new Error(_0x4324d0(0xfb)+_0x3a8ca2+_0x4324d0(0xe5));}function buildMenuUpdateDiff(_0x992410,_0x1329d9,_0x4c570d,_0x4505e3,_0x488175){const _0x3805fa=a132_0x10f2,_0x23a56a=[..._0x992410[_0x3805fa(0xd3)]];_0x4c570d==='patch'&&assertUnambiguousPatchResources(_0x992410,_0x23a56a,_0x1329d9);const _0x59f9ba=_0x4c570d==='patch'?patchResources(_0x23a56a,_0x1329d9):replaceResources(_0x1329d9),_0x27fdad=[],_0x5072e7=_0x23a56a[_0x3805fa(0xd5)](isJsResource),_0x5a6f1e=_0x59f9ba[_0x3805fa(0xd5)](isJsResource);if(_0x5072e7&&!_0x5a6f1e){const _0x418df5='menu\x20asset-update\x20would\x20remove\x20existing\x20JS\x20resource\x20for\x20\x22'+_0x992410[_0x3805fa(0xe7)]+_0x3805fa(0xec)+_0x992410[_0x3805fa(0xfe)]+_0x3805fa(0xf5)+_0x3805fa(0x10c);if(!_0x4505e3)throw new Error(_0x418df5);_0x27fdad[_0x3805fa(0xdc)](_0x418df5);}const _0x2418b6=_0x23a56a[_0x3805fa(0xd5)](isCssResource),_0x3dcec5=_0x59f9ba[_0x3805fa(0xd5)](isCssResource);_0x2418b6&&!_0x3dcec5&&_0x27fdad[_0x3805fa(0xdc)](_0x3805fa(0x10e)+_0x992410[_0x3805fa(0xe7)]+_0x3805fa(0xec)+_0x992410['path']+').');const _0x3876bf=typeof _0x992410['extend']?.['loadScriptMode']===_0x3805fa(0x116)?_0x992410['extend'][_0x3805fa(0x114)]:null,_0x3d628d=_0x488175?{'loadScriptMode':_0x3876bf}:{},_0x4ab335=_0x488175?{'loadScriptMode':_0x488175}:{};return{'id':_0x992410['id'],'label':_0x992410[_0x3805fa(0xe7)],'path':_0x992410[_0x3805fa(0xfe)],'mode':_0x4c570d,'before':{'resources':_0x23a56a,..._0x3d628d},'after':{'resources':_0x59f9ba,..._0x4ab335},'warnings':_0x27fdad};}function replaceResources(_0x3582f2){const _0x143941=a132_0x10f2;return[_0x3582f2['jsUrl'],_0x3582f2[_0x143941(0x106)]][_0x143941(0xf8)](_0x620021=>!!_0x620021);}function a132_0x3f85(){const _0x286946=['jsUrl',').\x20','9330811CuUIFf','389532smxbYE','filter','Invalid\x20--params:\x20menu\x20asset-update\x20requires\x20at\x20least\x20one\x20explicit\x20JS/CSS\x20URL.\x20','5759524sYXTii','Invalid\x20--mode:\x20','menuIds','387744rNXIdt','path','dryRun','10iKQfKX','6xmDByR','CSS\x20URL\x20must\x20be\x20a\x20valid\x20https://...css\x20URL','Start\x20non-interactive\x20menu\x20asset\x20update','map','join','cssUrl','menu\x20asset-update\x20cannot\x20patch\x20','10926108Uoeblp','allSettled','all','3DBygcx','Use\x20--mode\x20patch\x20to\x20preserve\x20it,\x20pass\x20jsUrl,\x20or\x20add\x20--force\x20for\x20an\x20intentional\x20removal.','.js','menu\x20asset-update\x20will\x20remove\x20existing\x20CSS\x20resource\x20for\x20\x22','8351424CanOSn','mode','menu-asset-update','Menu\x20asset\x20update\x20completed','CSS\x20URL\x20is\x20unreachable:\x20','loadScriptMode','3397670oQcTax','string','JS\x20URL\x20must\x20be\x20a\x20valid\x20https://...js\x20URL','toLowerCase','--params.','resources','force','some','Invalid\x20--params:\x20','menu\x20asset-update\x20selectors\x20did\x20not\x20match\x20resource-bearing\x20menus:\x20','with\x20a\x20single\x20cssUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','paths','length','trim','push','endsWith','.css','with\x20a\x20single\x20jsUrl.\x20Review\x20a\x20dry-run\x20and\x20use\x20--mode\x20replace\x20only\x20when\x20intentionally\x20rewriting\x20the\x20complete\x20resource\x20set.','value','\x20existing\x20CSS\x20resources\x20for\x20\x22','cwd','menu\x20asset-update\x20requires\x20an\x20explicit\x20target:\x20pass\x20--all,\x20--menu-ids,\x20or\x20--paths.','patch','.\x20Allowed\x20values:\x20replace,\x20patch','message','label','JS\x20URL\x20is\x20unreachable:\x20','setLogPath','status','unshift','\x22\x20(','after','field','replace','info','--all\x20cannot\x20be\x20combined\x20with\x20--menu-ids\x20or\x20--paths.','selection','has'];a132_0x3f85=function(){return _0x286946;};return a132_0x3f85();}function assertUnambiguousPatchResources(_0x55378e,_0x188900,_0x23c145){const _0x48de3a=a132_0x10f2,_0x13e616=_0x188900[_0x48de3a(0xf8)](isJsResource)[_0x48de3a(0xda)];if(_0x23c145[_0x48de3a(0xf4)]&&_0x13e616>0x1)throw new Error('menu\x20asset-update\x20cannot\x20patch\x20'+_0x13e616+'\x20existing\x20JS\x20resources\x20for\x20\x22'+_0x55378e[_0x48de3a(0xe7)]+_0x48de3a(0xec)+_0x55378e[_0x48de3a(0xfe)]+')\x20'+_0x48de3a(0xdf));const _0x4671eb=_0x188900[_0x48de3a(0xf8)](isCssResource)['length'];if(_0x23c145[_0x48de3a(0x106)]&&_0x4671eb>0x1)throw new Error(_0x48de3a(0x107)+_0x4671eb+_0x48de3a(0xe1)+_0x55378e[_0x48de3a(0xe7)]+'\x22\x20('+_0x55378e[_0x48de3a(0xfe)]+')\x20'+_0x48de3a(0xd8));}function patchResources(_0x8e6f73,_0x191d23){const _0x582fb5=a132_0x10f2;let _0x1bec91=![],_0x1c4bc6=![];const _0xbed5af=[];for(const _0x261fd0 of _0x8e6f73){if(isJsResource(_0x261fd0)){if(_0x191d23[_0x582fb5(0xf4)]&&!_0x1bec91)_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0xf4)]),_0x1bec91=!![];else!_0x191d23[_0x582fb5(0xf4)]&&_0xbed5af[_0x582fb5(0xdc)](_0x261fd0);continue;}if(isCssResource(_0x261fd0)){if(_0x191d23[_0x582fb5(0x106)]&&!_0x1c4bc6)_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0x106)]),_0x1c4bc6=!![];else!_0x191d23[_0x582fb5(0x106)]&&_0xbed5af['push'](_0x261fd0);continue;}_0xbed5af['push'](_0x261fd0);}return _0x191d23[_0x582fb5(0xf4)]&&!_0x1bec91&&_0xbed5af[_0x582fb5(0xeb)](_0x191d23['jsUrl']),_0x191d23[_0x582fb5(0x106)]&&!_0x1c4bc6&&_0xbed5af[_0x582fb5(0xdc)](_0x191d23[_0x582fb5(0x106)]),_0xbed5af;}function isJsResource(_0x481ad6){const _0x197804=a132_0x10f2;return stripQuery(_0x481ad6)[_0x197804(0x118)]()[_0x197804(0xdd)](_0x197804(0x10d));}function isCssResource(_0x42112d){const _0x1e8eeb=a132_0x10f2;return stripQuery(_0x42112d)[_0x1e8eeb(0x118)]()[_0x1e8eeb(0xdd)](_0x1e8eeb(0xde));}function stripQuery(_0x51c507){return _0x51c507['split']('?')[0x0]??_0x51c507;}function parseUpdateParamsFlag(_0x343889){const _0x546286=a132_0x10f2;if(!_0x343889||typeof _0x343889!==_0x546286(0x116))return{};try{const _0x2c39c4=JSON['parse'](_0x343889);if(typeof _0x2c39c4!=='object'||_0x2c39c4===null||Array['isArray'](_0x2c39c4))return{};return{'jsUrl':typeof _0x2c39c4[_0x546286(0xf4)]===_0x546286(0x116)?_0x2c39c4[_0x546286(0xf4)][_0x546286(0xdb)]():undefined,'cssUrl':typeof _0x2c39c4[_0x546286(0x106)]===_0x546286(0x116)?_0x2c39c4[_0x546286(0x106)][_0x546286(0xdb)]():undefined};}catch{return{};}}
@@ -1 +1 @@
1
- (function(_0x5e6a4f,_0x3d881e){const _0x336413=a132_0x4b36,_0x33f6eb=_0x5e6a4f();while(!![]){try{const _0x7d818=-parseInt(_0x336413(0xea))/0x1+parseInt(_0x336413(0xeb))/0x2*(parseInt(_0x336413(0xe6))/0x3)+-parseInt(_0x336413(0xed))/0x4+parseInt(_0x336413(0xe7))/0x5*(parseInt(_0x336413(0xe4))/0x6)+-parseInt(_0x336413(0xe3))/0x7+-parseInt(_0x336413(0xe8))/0x8+-parseInt(_0x336413(0xe9))/0x9*(-parseInt(_0x336413(0xe5))/0xa);if(_0x7d818===_0x3d881e)break;else _0x33f6eb['push'](_0x33f6eb['shift']());}catch(_0x53fbf0){_0x33f6eb['push'](_0x33f6eb['shift']());}}}(a132_0x5b2b,0x5a584));function a132_0x4b36(_0x53e4da,_0x5877e2){_0x53e4da=_0x53e4da-0xe2;const _0x5b2b4e=a132_0x5b2b();let _0x4b36fd=_0x5b2b4e[_0x53e4da];return _0x4b36fd;}export function isValidJsHttpsUrl(_0x5f2ffb){const _0x31614=a132_0x4b36;return/^https:\/\/.+\.js(\?.*)?$/[_0x31614(0xec)](_0x5f2ffb[_0x31614(0xe2)]());}function a132_0x5b2b(){const _0x1b62ca=['trim','1552047iazfbQ','414WDwNvs','2003720eNevNO','87OEgzxw','36295IbNoTp','3321392Qejdeb','27PWzUxq','463636Plqfow','31408KdrwRj','test','347280EQzgEd','HEAD'];a132_0x5b2b=function(){return _0x1b62ca;};return a132_0x5b2b();}export function isValidCssHttpsUrl(_0x5ead6b){const _0x5676d3=a132_0x4b36;return/^https:\/\/.+\.css(\?.*)?$/[_0x5676d3(0xec)](_0x5ead6b[_0x5676d3(0xe2)]());}export async function isUrlReachable(_0x3fb696){const _0x1f20f2=a132_0x4b36;try{const _0x2b7d3f=await fetch(_0x3fb696,{'method':_0x1f20f2(0xee)});return _0x2b7d3f['ok'];}catch{return![];}}
1
+ (function(_0x460b98,_0x1ee9dc){const _0x1d916e=a133_0x41db,_0x1a60fe=_0x460b98();while(!![]){try{const _0x5a36c0=parseInt(_0x1d916e(0x1d2))/0x1*(parseInt(_0x1d916e(0x1d5))/0x2)+-parseInt(_0x1d916e(0x1d3))/0x3+parseInt(_0x1d916e(0x1d4))/0x4*(parseInt(_0x1d916e(0x1d0))/0x5)+parseInt(_0x1d916e(0x1d6))/0x6+-parseInt(_0x1d916e(0x1cc))/0x7*(-parseInt(_0x1d916e(0x1d7))/0x8)+-parseInt(_0x1d916e(0x1cb))/0x9*(parseInt(_0x1d916e(0x1d1))/0xa)+parseInt(_0x1d916e(0x1ca))/0xb;if(_0x5a36c0===_0x1ee9dc)break;else _0x1a60fe['push'](_0x1a60fe['shift']());}catch(_0x48256a){_0x1a60fe['push'](_0x1a60fe['shift']());}}}(a133_0x3e41,0x62bd5));export function isValidJsHttpsUrl(_0x55f39a){const _0x3a1203=a133_0x41db;return/^https:\/\/.+\.js(\?.*)?$/[_0x3a1203(0x1cf)](_0x55f39a['trim']());}export function isValidCssHttpsUrl(_0x3fa387){const _0xcc7eb3=a133_0x41db;return/^https:\/\/.+\.css(\?.*)?$/[_0xcc7eb3(0x1cf)](_0x3fa387[_0xcc7eb3(0x1ce)]());}function a133_0x41db(_0x4c7876,_0x49869d){_0x4c7876=_0x4c7876-0x1ca;const _0x3e416f=a133_0x3e41();let _0x41db56=_0x3e416f[_0x4c7876];return _0x41db56;}function a133_0x3e41(){const _0x12f96b=['7668410molKxb','50981bdEEVq','2244012QYEvyV','1137572LGtHmX','26mqbCsw','3184752YLWZpp','8umHXaf','942216nAprUI','9JXaIKQ','2489816ncmhXL','HEAD','trim','test','5yiOCwr'];a133_0x3e41=function(){return _0x12f96b;};return a133_0x3e41();}export async function isUrlReachable(_0x58e565){const _0x406887=a133_0x41db;try{const _0x8d47a9=await fetch(_0x58e565,{'method':_0x406887(0x1cd)});return _0x8d47a9['ok'];}catch{return![];}}
@@ -1 +1 @@
1
- const a133_0x86be8d=a133_0x2325;function a133_0x18a6(){const _0x4c9974=['3123rXnUTl','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','message','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','2401536WUBTCY','str','Pre-fill\x20JS/CSS\x20URLs.\x20','Creating\x20','write','string','menu','appcode','/smartapi/menu/create','9550734xmvFvA','localPages','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','flag','\x20created.','\x20page(s)','Failed\x20to\x20fetch\x20online\x20menu\x20list','yellow','cssUrl','5yMraTn','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','Sync\x20local\x20pages\x20as\x20platform\x20menus','\x20local\x20microfrontend\x20menu(s).','onlinePaths','2078949AjFfub','boolean','trim','\x20failed.','Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages','paths','cyan','params','Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.','skipped','430MCNMZA','Menu\x20creation\x20failed','Would\x20create\x20','\x20created,\x20','validation','targetPages','\x20\x20Create\x20','split','21918582KXhFLY','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','onlineMenuList','5923516WOcbqm','created','sync','Fetching\x20online\x20menu\x20list...','yes','\x20\x20Cancelled.','\x20menu(s)','cookie','rawFlags','\x20and\x20CSS:\x20','9854845jFnKlq','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','appCode','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','gray','selectedAppName','\x20\x20✓\x20Selected:\x20','failed','Menu\x20sync\x20completed:\x20','Created\x20','length','Non-interactive\x20menu\x20sync\x20requires\x20--yes.'];a133_0x18a6=function(){return _0x4c9974;};return a133_0x18a6();}(function(_0x284cdf,_0x3a4aa4){const _0x265306=a133_0x2325,_0x5065f7=_0x284cdf();while(!![]){try{const _0x9be2a6=parseInt(_0x265306(0x143))/0x1*(parseInt(_0x265306(0x168))/0x2)+parseInt(_0x265306(0x15e))/0x3+parseInt(_0x265306(0x12d))/0x4+parseInt(_0x265306(0x159))/0x5*(parseInt(_0x265306(0x150))/0x6)+-parseInt(_0x265306(0x137))/0x7+parseInt(_0x265306(0x147))/0x8+-parseInt(_0x265306(0x170))/0x9;if(_0x9be2a6===_0x3a4aa4)break;else _0x5065f7['push'](_0x5065f7['shift']());}catch(_0x4b1851){_0x5065f7['push'](_0x5065f7['shift']());}}}(a133_0x18a6,0xda467));import a133_0x1eaddb 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';function a133_0x2325(_0x12fa6a,_0x4d3f7f){_0x12fa6a=_0x12fa6a-0x12d;const _0x18a687=a133_0x18a6();let _0x2325e7=_0x18a687[_0x12fa6a];return _0x2325e7;}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';import{isInProject}from'../../context.js';export const menuSync={'service':a133_0x86be8d(0x14d),'command':a133_0x86be8d(0x12f),'description':a133_0x86be8d(0x15b),'risk':a133_0x86be8d(0x14b),'flags':[{'name':a133_0x86be8d(0x165),'type':a133_0x86be8d(0x14c),'description':a133_0x86be8d(0x149)+a133_0x86be8d(0x15a)},{'name':a133_0x86be8d(0x163),'type':a133_0x86be8d(0x14c),'description':a133_0x86be8d(0x138)},{'name':a133_0x86be8d(0x131),'type':a133_0x86be8d(0x15f),'description':a133_0x86be8d(0x162)}],async 'dryRun'(_0x283a00){const _0x477c46=a133_0x86be8d;ensureRunnableContext(_0x283a00[_0x477c46(0x135)],_0x283a00[_0x477c46(0x13c)]);const _0x42a0ee=await runMenuSyncCore(_0x283a00['appCode'],_0x283a00[_0x477c46(0x134)],parsePaths(_0x283a00['str'](_0x477c46(0x163))),_0x283a00[_0x477c46(0x148)](_0x477c46(0x165)),{'dryRun':!![]});return{'method':'POST','url':_0x477c46(0x14f),'body':_0x42a0ee,'description':_0x42a0ee[_0x477c46(0x167)]?_0x477c46(0x13a):_0x477c46(0x16a)+_0x42a0ee[_0x477c46(0x16d)][_0x477c46(0x141)]+_0x477c46(0x15c)};},async 'execute'(_0x4f7978){const _0x35b93b=a133_0x86be8d;ensureRunnableContext(_0x4f7978['rawFlags'],_0x4f7978['selectedAppName']);const _0x3a9764=_0x4f7978[_0x35b93b(0x153)](_0x35b93b(0x131)),_0x4007bf=_0x4f7978[_0x35b93b(0x148)](_0x35b93b(0x165)),_0x53251b=parsePaths(_0x4f7978[_0x35b93b(0x148)](_0x35b93b(0x163))),_0x509a72=parseMenuSyncParams(_0x4007bf);if(_0x3a9764){const _0x3ccb24=await runMenuSyncCore(_0x4f7978['appCode'],_0x4f7978['cookie'],_0x53251b,_0x4007bf);if(_0x3ccb24['skipped']){const _0x440244=getLocalPages();_0x440244[_0x35b93b(0x141)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x35b93b(0x171));}else writeCliSideChannelLine('✓\x20Menu\x20sync\x20completed:\x20'+_0x3ccb24['created']+'\x20menu(s)\x20created');return{'ok':!![],'data':_0x3ccb24,'message':_0x3ccb24[_0x35b93b(0x167)]?'Menu\x20sync\x20skipped':'Menu\x20sync\x20completed:\x20'+_0x3ccb24[_0x35b93b(0x12e)]+_0x35b93b(0x154)};}if(_0x53251b[_0x35b93b(0x141)]>0x0)throw CliErrors['validation']('menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.',_0x35b93b(0x166));if(!isInteractive()&&_0x4007bf)throw CliErrors[_0x35b93b(0x16c)](_0x35b93b(0x142),_0x35b93b(0x166));requireInteractive();const _0x536e88=startSpinner(_0x35b93b(0x130));let _0x3502c1,_0x2ac2b4,_0x39cf3b;try{const _0x3f4644=await fetchMenuData(_0x4f7978[_0x35b93b(0x139)],_0x4f7978['cookie']);_0x3502c1=_0x3f4644[_0x35b93b(0x151)],_0x2ac2b4=_0x3f4644[_0x35b93b(0x15d)],_0x39cf3b=_0x3f4644[_0x35b93b(0x172)],stopSpinner(_0x536e88,'Online\x20menu\x20list\x20fetched',!![]);}catch(_0x39a92e){stopSpinner(_0x536e88,_0x35b93b(0x156),![]);throw CliErrors[_0x35b93b(0x16c)](_0x39a92e instanceof Error?_0x39a92e[_0x35b93b(0x145)]:_0x35b93b(0x156));}if(_0x3502c1[_0x35b93b(0x141)]===0x0)return writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x157)](_0x35b93b(0x144))),{'ok':!![]};const _0x5d4050=buildCompareRows(_0x3502c1,_0x2ac2b4);writeCliSideChannelLine(renderCompareTable(_0x5d4050)),writeCliSideChannelLine('');const _0x2bff05=await selectPages(_0x3502c1,_0x2ac2b4);writeCliSideChannelLine(''),writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x164)](_0x35b93b(0x13d)+_0x2bff05[_0x35b93b(0x141)]+_0x35b93b(0x155)));const _0x1f6b0e=_0x509a72['jsUrl']&&_0x509a72['cssUrl'];if(!_0x1f6b0e){writeCliSideChannelLine(renderSyncSummary(_0x2bff05,_0x2ac2b4['size']>0x0));const _0x53539e=await askConfirm('\x20\x20Continue\x20with\x20creation?');if(!_0x53539e)return writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x13b)](_0x35b93b(0x132))),{'ok':!![]};}let _0xa7c318=_0x509a72['jsUrl'],_0x2952a2=_0x509a72[_0x35b93b(0x158)];!_0xa7c318&&(_0xa7c318=await askJsUrl());!_0x2952a2&&(_0x2952a2=await askCssUrl());const _0x23ac9e=await askConfirm(_0x35b93b(0x16e)+_0x2bff05[_0x35b93b(0x141)]+'\x20menu(s)\x20with\x20JS:\x20'+_0xa7c318+_0x35b93b(0x136)+_0x2952a2+'?');if(!_0x23ac9e)return writeCliSideChannelLine(a133_0x1eaddb[_0x35b93b(0x13b)](_0x35b93b(0x132))),{'ok':!![]};const _0x1cd606=[_0xa7c318,_0x2952a2],_0x326c2b=startSpinner(_0x35b93b(0x14a)+_0x2bff05[_0x35b93b(0x141)]+'\x20menu(s)...');try{const _0x25074d=await doCreateMenus(_0x4f7978[_0x35b93b(0x139)],_0x4f7978['cookie'],_0x2bff05,_0x1cd606);return stopSpinner(_0x326c2b,_0x35b93b(0x140)+_0x25074d['created']+_0x35b93b(0x133),!![]),{'ok':!![],'data':_0x25074d,'message':_0x35b93b(0x13f)+_0x25074d[_0x35b93b(0x12e)]+_0x35b93b(0x16b)+_0x25074d[_0x35b93b(0x13e)]+_0x35b93b(0x161)};}catch(_0x34111b){stopSpinner(_0x326c2b,'Menu\x20creation\x20failed',![]);throw CliErrors[_0x35b93b(0x16c)](_0x34111b instanceof Error?_0x34111b['message']:_0x35b93b(0x169));}}};function ensureRunnableContext(_0x1b4550,_0x2394df){const _0x1e0342=a133_0x86be8d,_0x33739e=_0x1b4550[_0x1e0342(0x14e)]?String(_0x1b4550[_0x1e0342(0x14e)])[_0x1e0342(0x160)]():'';if(!isInProject()&&!_0x2394df&&!_0x33739e)throw CliErrors['validation'](_0x1e0342(0x152)+_0x1e0342(0x146));}function parsePaths(_0x51fe8d){const _0x3296ff=a133_0x86be8d;return[...new Set(_0x51fe8d[_0x3296ff(0x16f)](',')['map'](_0x363e2=>_0x363e2['trim']())['filter'](Boolean))];}
1
+ function a134_0x2c97(){const _0x532e86=['6zdvLGq','/smartapi/menu/create','1671796LDrikW','selectedAppName','Non-interactive\x20menu\x20sync\x20requires\x20--yes.','POST','appcode','Would\x20create\x20','onlineMenuList','Pre-fill\x20JS/CSS\x20URLs.\x20','string','\x20\x20!\x20No\x20local\x20pages\x20found,\x20please\x20create\x20pages\x20first','Exact\x20comma-separated\x20local\x20page\x20paths\x20to\x20sync','Menu\x20creation\x20failed','str','cyan','map','\x20\x20Continue\x20with\x20creation?','4583655KOFwuy','Menu\x20sync\x20completed:\x20','3850885lJorXP','targetPages','skipped','paths','901202ClggdN','875971kefAVA','cookie','Failed\x20to\x20fetch\x20online\x20menu\x20list','menu\x20sync\x20--paths\x20requires\x20--yes\x20for\x20execution.','\x20menu(s)','\x20local\x20microfrontend\x20menu(s).','Created\x20','Menu\x20sync\x20skipped','menu','gray','\x20and\x20CSS:\x20','failed','created','appCode','localPages','jsUrl','\x20menu(s)...','menu\x20sync\x20requires\x20a\x20project\x20context\x20or\x20explicit\x20--appcode.\x20','1844252PYItGa','length','write','\x20menu(s)\x20with\x20JS:\x20','size','\x20created.','✓\x20All\x20local\x20pages\x20are\x20already\x20on\x20platform','yellow','Online\x20menu\x20list\x20fetched','6uUeYIK','cssUrl','sync','\x20\x20Cancelled.','JSON:\x20{\x22jsUrl\x22:\x22https://...js\x22,\x22cssUrl\x22:\x22https://...css\x22}','No\x20local\x20microfrontend\x20menus\x20would\x20be\x20created.','Run\x20inside\x20a\x20directory\x20with\x20.rabetbase.json,\x20or\x20pass\x20--appcode\x20<code>.','filter','flag','message','✓\x20Menu\x20sync\x20completed:\x20','validation','trim','5739624ujFSmX'];a134_0x2c97=function(){return _0x532e86;};return a134_0x2c97();}const a134_0x18b31c=a134_0x8df3;(function(_0x5f0d6b,_0x10124f){const _0x4ada99=a134_0x8df3,_0xaac293=_0x5f0d6b();while(!![]){try{const _0x16aaeb=parseInt(_0x4ada99(0xc8))/0x1+parseInt(_0x4ada99(0xc7))/0x2*(parseInt(_0x4ada99(0xaf))/0x3)+-parseInt(_0x4ada99(0xda))/0x4+-parseInt(_0x4ada99(0xc3))/0x5+parseInt(_0x4ada99(0xa1))/0x6*(parseInt(_0x4ada99(0xb1))/0x7)+-parseInt(_0x4ada99(0xae))/0x8+parseInt(_0x4ada99(0xc1))/0x9;if(_0x16aaeb===_0x10124f)break;else _0xaac293['push'](_0xaac293['shift']());}catch(_0x580cdd){_0xaac293['push'](_0xaac293['shift']());}}}(a134_0x2c97,0x8cc5b));import a134_0x367112 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';function a134_0x8df3(_0x4a868e,_0x343d6c){_0x4a868e=_0x4a868e-0x9c;const _0x2c9702=a134_0x2c97();let _0x8df324=_0x2c9702[_0x4a868e];return _0x8df324;}import{getLocalPages}from'../../commands/menu/shared/local-pages.js';import{isInProject}from'../../context.js';export const menuSync={'service':a134_0x18b31c(0xd0),'command':a134_0x18b31c(0xa3),'description':'Sync\x20local\x20pages\x20as\x20platform\x20menus','risk':a134_0x18b31c(0xdc),'flags':[{'name':'params','type':a134_0x18b31c(0xb9),'description':a134_0x18b31c(0xb8)+a134_0x18b31c(0xa5)},{'name':'paths','type':'string','description':a134_0x18b31c(0xbb)},{'name':'yes','type':'boolean','description':'Confirm\x20non-interactive\x20sync;\x20without\x20--paths,\x20create\x20all\x20missing\x20local\x20pages'}],async 'dryRun'(_0x2ac711){const _0x430e40=a134_0x18b31c;ensureRunnableContext(_0x2ac711['rawFlags'],_0x2ac711[_0x430e40(0xb2)]);const _0x2023ed=await runMenuSyncCore(_0x2ac711['appCode'],_0x2ac711['cookie'],parsePaths(_0x2ac711[_0x430e40(0xbd)](_0x430e40(0xc6))),_0x2ac711['str']('params'),{'dryRun':!![]});return{'method':_0x430e40(0xb4),'url':_0x430e40(0xb0),'body':_0x2023ed,'description':_0x2023ed[_0x430e40(0xc5)]?_0x430e40(0xa6):_0x430e40(0xb6)+_0x2023ed[_0x430e40(0xc4)][_0x430e40(0xdb)]+_0x430e40(0xcd)};},async 'execute'(_0x1e9a21){const _0x33f59a=a134_0x18b31c;ensureRunnableContext(_0x1e9a21['rawFlags'],_0x1e9a21[_0x33f59a(0xb2)]);const _0x56d79b=_0x1e9a21[_0x33f59a(0xa9)]('yes'),_0x1c9bf1=_0x1e9a21[_0x33f59a(0xbd)]('params'),_0x58872f=parsePaths(_0x1e9a21[_0x33f59a(0xbd)](_0x33f59a(0xc6))),_0xa1e788=parseMenuSyncParams(_0x1c9bf1);if(_0x56d79b){const _0x4c03dc=await runMenuSyncCore(_0x1e9a21[_0x33f59a(0xd5)],_0x1e9a21[_0x33f59a(0xc9)],_0x58872f,_0x1c9bf1);if(_0x4c03dc[_0x33f59a(0xc5)]){const _0x376d0e=getLocalPages();_0x376d0e[_0x33f59a(0xdb)]===0x0?writeCliSideChannelLine('!\x20No\x20local\x20pages\x20found\x20in\x20src/pages'):writeCliSideChannelLine(_0x33f59a(0x9e));}else writeCliSideChannelLine(_0x33f59a(0xab)+_0x4c03dc['created']+'\x20menu(s)\x20created');return{'ok':!![],'data':_0x4c03dc,'message':_0x4c03dc['skipped']?_0x33f59a(0xcf):'Menu\x20sync\x20completed:\x20'+_0x4c03dc[_0x33f59a(0xd4)]+_0x33f59a(0x9d)};}if(_0x58872f['length']>0x0)throw CliErrors[_0x33f59a(0xac)](_0x33f59a(0xcb),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');if(!isInteractive()&&_0x1c9bf1)throw CliErrors[_0x33f59a(0xac)](_0x33f59a(0xb3),'Preview\x20with\x20--dry-run,\x20then\x20reuse\x20the\x20same\x20--paths\x20and\x20--params\x20with\x20--yes.');requireInteractive();const _0x2362c6=startSpinner('Fetching\x20online\x20menu\x20list...');let _0x4ef3cf,_0x10ad23,_0x11ca66;try{const _0xc61ef9=await fetchMenuData(_0x1e9a21[_0x33f59a(0xd5)],_0x1e9a21[_0x33f59a(0xc9)]);_0x4ef3cf=_0xc61ef9[_0x33f59a(0xd6)],_0x10ad23=_0xc61ef9['onlinePaths'],_0x11ca66=_0xc61ef9[_0x33f59a(0xb7)],stopSpinner(_0x2362c6,_0x33f59a(0xa0),!![]);}catch(_0x4059e7){stopSpinner(_0x2362c6,_0x33f59a(0xca),![]);throw CliErrors[_0x33f59a(0xac)](_0x4059e7 instanceof Error?_0x4059e7[_0x33f59a(0xaa)]:_0x33f59a(0xca));}if(_0x4ef3cf[_0x33f59a(0xdb)]===0x0)return writeCliSideChannelLine(a134_0x367112[_0x33f59a(0x9f)](_0x33f59a(0xba))),{'ok':!![]};const _0x150216=buildCompareRows(_0x4ef3cf,_0x10ad23);writeCliSideChannelLine(renderCompareTable(_0x150216)),writeCliSideChannelLine('');const _0x41b1c0=await selectPages(_0x4ef3cf,_0x10ad23);writeCliSideChannelLine(''),writeCliSideChannelLine(a134_0x367112[_0x33f59a(0xbe)]('\x20\x20✓\x20Selected:\x20'+_0x41b1c0[_0x33f59a(0xdb)]+'\x20page(s)'));const _0x2281c6=_0xa1e788[_0x33f59a(0xd7)]&&_0xa1e788[_0x33f59a(0xa2)];if(!_0x2281c6){writeCliSideChannelLine(renderSyncSummary(_0x41b1c0,_0x10ad23[_0x33f59a(0x9c)]>0x0));const _0x183dca=await askConfirm(_0x33f59a(0xc0));if(!_0x183dca)return writeCliSideChannelLine(a134_0x367112[_0x33f59a(0xd1)](_0x33f59a(0xa4))),{'ok':!![]};}let _0x4fec8d=_0xa1e788[_0x33f59a(0xd7)],_0x33cced=_0xa1e788[_0x33f59a(0xa2)];!_0x4fec8d&&(_0x4fec8d=await askJsUrl());!_0x33cced&&(_0x33cced=await askCssUrl());const _0xac26a7=await askConfirm('\x20\x20Create\x20'+_0x41b1c0[_0x33f59a(0xdb)]+_0x33f59a(0xdd)+_0x4fec8d+_0x33f59a(0xd2)+_0x33cced+'?');if(!_0xac26a7)return writeCliSideChannelLine(a134_0x367112[_0x33f59a(0xd1)](_0x33f59a(0xa4))),{'ok':!![]};const _0x4dbc5c=[_0x4fec8d,_0x33cced],_0x2299cb=startSpinner('Creating\x20'+_0x41b1c0[_0x33f59a(0xdb)]+_0x33f59a(0xd8));try{const _0x5cec1b=await doCreateMenus(_0x1e9a21['appCode'],_0x1e9a21['cookie'],_0x41b1c0,_0x4dbc5c);return stopSpinner(_0x2299cb,_0x33f59a(0xce)+_0x5cec1b[_0x33f59a(0xd4)]+_0x33f59a(0xcc),!![]),{'ok':!![],'data':_0x5cec1b,'message':_0x33f59a(0xc2)+_0x5cec1b['created']+'\x20created,\x20'+_0x5cec1b[_0x33f59a(0xd3)]+'\x20failed.'};}catch(_0x4c9f3c){stopSpinner(_0x2299cb,_0x33f59a(0xbc),![]);throw CliErrors['validation'](_0x4c9f3c instanceof Error?_0x4c9f3c[_0x33f59a(0xaa)]:'Menu\x20creation\x20failed');}}};function ensureRunnableContext(_0x1d411f,_0x49e2ce){const _0x4c9da3=a134_0x18b31c,_0x2f99d7=_0x1d411f[_0x4c9da3(0xb5)]?String(_0x1d411f['appcode'])[_0x4c9da3(0xad)]():'';if(!isInProject()&&!_0x49e2ce&&!_0x2f99d7)throw CliErrors[_0x4c9da3(0xac)](_0x4c9da3(0xd9)+_0x4c9da3(0xa7));}function parsePaths(_0x532e37){const _0x25ccee=a134_0x18b31c;return[...new Set(_0x532e37['split'](',')[_0x25ccee(0xbf)](_0x12fd40=>_0x12fd40[_0x25ccee(0xad)]())[_0x25ccee(0xa8)](Boolean))];}
@@ -1 +1 @@
1
- const a134_0x8b54e8=a134_0x5b5c;(function(_0x5db76e,_0x24e359){const _0x1f141a=a134_0x5b5c,_0x5d5c2e=_0x5db76e();while(!![]){try{const _0x3286d2=-parseInt(_0x1f141a(0xa5))/0x1*(-parseInt(_0x1f141a(0xaa))/0x2)+parseInt(_0x1f141a(0xa7))/0x3+parseInt(_0x1f141a(0x91))/0x4+parseInt(_0x1f141a(0xa6))/0x5+-parseInt(_0x1f141a(0xb6))/0x6+parseInt(_0x1f141a(0x9b))/0x7*(parseInt(_0x1f141a(0xb5))/0x8)+-parseInt(_0x1f141a(0xb3))/0x9*(parseInt(_0x1f141a(0xad))/0xa);if(_0x3286d2===_0x24e359)break;else _0x5d5c2e['push'](_0x5d5c2e['shift']());}catch(_0x1fc5dd){_0x5d5c2e['push'](_0x5d5c2e['shift']());}}}(a134_0x1cb5,0x5bf2d));import{asDryRunResult}from'../../commands/common/dry-run.js';import{createNotificationChannelConfig,getNotificationChannelConfig,isPlatformTransportFailure}from'../../core/api-client.js';function a134_0x1cb5(){const _0x2ab816=['2860102AvnpnA',';\x20do\x20not\x20resubmit.','POST','description','notification_config_create_outcome_unknown','readTimeout','notification','input','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','Created\x20notification\x20config\x20','1KIoabS','3083075rwWYzq','1058832VkRQBu','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','config-create','1450886cxMXmc',';\x20no\x20automatic\x20retry\x20was\x20attempted.','document','310RckeoE','channelType','create','verified','configCode','verification','564966qQFOXt','Inspect\x20with\x20','8iKAJZJ','2241192FvtHeP','2370236ckqcCc','planned','mutation','configName','write','isSafeInteger','channelConfig','appCode','Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source',';\x20do\x20not\x20resubmit\x20automatically.'];a134_0x1cb5=function(){return _0x2ab816;};return a134_0x1cb5();}import{assertSingleNotificationSource,createMutationInput,DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,DEFAULT_NOTIFICATION_READ_TIMEOUT,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,NOTIFICATION_APP_FLAG,NOTIFICATION_INPUT_FLAGS,projectNotificationConfig,readNotificationDocument,safeApiFailure}from'../../commands/notification/shared.js';function a134_0x5b5c(_0x5a1528,_0x3dda3d){_0x5a1528=_0x5a1528-0x91;const _0x1cb518=a134_0x1cb5();let _0x5b5c3c=_0x1cb518[_0x5a1528];return _0x5b5c3c;}const CREATE_PATH='/notification/channel-config/create';async function prepareCreate(_0x5be972){const _0x2ef084=a134_0x5b5c,_0x407586=await readNotificationDocument(_0x5be972,_0x2ef084(0xaf)),_0xd58c53=createMutationInput(_0x5be972[_0x2ef084(0x98)],_0x407586);return{'document':_0x407586,'input':_0xd58c53,'planned':projectNotificationConfig({'appCode':_0x5be972[_0x2ef084(0x98)],'configName':_0x407586[_0x2ef084(0x94)],'channelType':_0x407586['channelType'],'endpointUrl':_0x407586['endpointUrl'],'channelConfig':_0x407586[_0x2ef084(0x97)],'description':_0x407586[_0x2ef084(0x9e)],'connectTimeout':_0x407586['connectTimeout']??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x407586[_0x2ef084(0xa0)]??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a134_0x8b54e8(0xa1),'command':a134_0x8b54e8(0xa9),'description':a134_0x8b54e8(0x99),'risk':a134_0x8b54e8(0x95),'requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x132f70){assertSingleNotificationSource(_0x132f70);},async 'dryRun'(_0x3f53f2){const _0x312150=a134_0x8b54e8,_0x441429=await prepareCreate(_0x3f53f2),_0x3f7c79=notificationLookupCommand(_0x3f53f2[_0x312150(0x98)],_0x441429[_0x312150(0xac)][_0x312150(0xae)]);return asDryRunResult({'operation':_0x312150(0xaf),'selector':{'appCode':_0x3f53f2[_0x312150(0x98)],'configName':_0x441429['document']['configName'],'channelType':_0x441429[_0x312150(0xac)][_0x312150(0xae)]},'before':null,'after':_0x441429[_0x312150(0x92)],'dryRun':!![],'backend':{'method':_0x312150(0x9d),'path':CREATE_PATH},'warnings':[],'verification':{'status':'planned','lookupCommand':_0x3f7c79}},{'method':_0x312150(0x9d),'url':CREATE_PATH});},async 'execute'(_0x4e5f08){const _0x47abb9=a134_0x8b54e8,_0x3dcc9d=await prepareCreate(_0x4e5f08),_0x17fae9=notificationLookupCommand(_0x4e5f08[_0x47abb9(0x98)],_0x3dcc9d[_0x47abb9(0xac)][_0x47abb9(0xae)]);let _0x410c84;try{_0x410c84=await createNotificationChannelConfig(_0x3dcc9d[_0x47abb9(0xa2)]);}catch(_0x57f6a9){if(isPlatformTransportFailure(_0x57f6a9))throw notificationError(_0x47abb9(0x9f),_0x47abb9(0xa3),_0x47abb9(0xb4)+_0x17fae9+_0x47abb9(0x9c));throw safeApiFailure(_0x47abb9(0xaf),_0x47abb9(0x93),_0x47abb9(0xb4)+_0x17fae9+_0x47abb9(0xab));}if(!Number[_0x47abb9(0x96)](_0x410c84)||_0x410c84<=0x0)throw notificationError('notification_config_create_outcome_unknown',_0x47abb9(0xa8),_0x47abb9(0xb4)+_0x17fae9+';\x20do\x20not\x20resubmit.');let _0x163a12;try{const _0x2a2215=await getNotificationChannelConfig(_0x410c84,_0x4e5f08[_0x47abb9(0x98)]);_0x163a12=normalizeExactNotificationConfig(_0x2a2215,_0x410c84,_0x4e5f08[_0x47abb9(0x98)]);}catch{throw safeApiFailure('create',_0x47abb9(0xb2),'Inspect\x20with\x20'+_0x17fae9+_0x47abb9(0x9a));}return{'ok':!![],'data':{'operation':'create','selector':{'appCode':_0x163a12['appCode'],'id':_0x163a12['id'],'configCode':_0x163a12[_0x47abb9(0xb1)],'configName':_0x163a12[_0x47abb9(0x94)],'channelType':_0x163a12[_0x47abb9(0xae)]},'before':null,'after':projectNotificationConfig(_0x163a12),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':_0x47abb9(0xb0),'lookupCommand':_0x17fae9}},'message':_0x47abb9(0xa4)+_0x163a12['id']};}};
1
+ const a135_0x367df9=a135_0x4ecb;(function(_0x1de94e,_0x5cbf87){const _0x1af737=a135_0x4ecb,_0x562b9a=_0x1de94e();while(!![]){try{const _0x21cda6=parseInt(_0x1af737(0x19f))/0x1*(parseInt(_0x1af737(0x18a))/0x2)+parseInt(_0x1af737(0x189))/0x3+-parseInt(_0x1af737(0x197))/0x4*(parseInt(_0x1af737(0x191))/0x5)+-parseInt(_0x1af737(0x1a2))/0x6*(-parseInt(_0x1af737(0x1a0))/0x7)+-parseInt(_0x1af737(0x184))/0x8+parseInt(_0x1af737(0x1a3))/0x9*(-parseInt(_0x1af737(0x188))/0xa)+parseInt(_0x1af737(0x198))/0xb;if(_0x21cda6===_0x5cbf87)break;else _0x562b9a['push'](_0x562b9a['shift']());}catch(_0x36fc4f){_0x562b9a['push'](_0x562b9a['shift']());}}}(a135_0x1bfd,0x4deb8));import{asDryRunResult}from'../../commands/common/dry-run.js';import{createNotificationChannelConfig,getNotificationChannelConfig,isPlatformTransportFailure}from'../../core/api-client.js';function a135_0x4ecb(_0xfedfb9,_0x33bf2c){_0xfedfb9=_0xfedfb9-0x183;const _0x1bfd99=a135_0x1bfd();let _0x4ecb2c=_0x1bfd99[_0xfedfb9];return _0x4ecb2c;}import{assertSingleNotificationSource,createMutationInput,DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,DEFAULT_NOTIFICATION_READ_TIMEOUT,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,NOTIFICATION_APP_FLAG,NOTIFICATION_INPUT_FLAGS,projectNotificationConfig,readNotificationDocument,safeApiFailure}from'../../commands/notification/shared.js';const CREATE_PATH=a135_0x367df9(0x195);function a135_0x1bfd(){const _0x5a9f92=['notification','configCode','configName','Create\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20source','document','4155oPrUxJ','readTimeout','connectTimeout','channelConfig','/notification/channel-config/create','Inspect\x20with\x20','504lktvya','7691112CJWscK','POST','Created\x20notification\x20config\x20',';\x20do\x20not\x20resubmit.','verification','write','Notification\x20config\x20create\x20outcome\x20is\x20unknown\x20because\x20no\x20server\x20ID\x20was\x20received.','7wbhfbW','161Qyoavk','config-create','42174XugXlx','38007kBjcgG','channelType','description','create','mutation','input','notification_config_create_outcome_unknown','3788328CcJVRD','appCode','endpointUrl','Notification\x20config\x20create\x20returned\x20no\x20usable\x20server\x20ID.','1150eVWeld','468384xPneAd','104590fdvbaG','verified'];a135_0x1bfd=function(){return _0x5a9f92;};return a135_0x1bfd();}async function prepareCreate(_0x2ab7bd){const _0x4f3458=a135_0x367df9,_0x409d97=await readNotificationDocument(_0x2ab7bd,_0x4f3458(0x1a6)),_0x1467aa=createMutationInput(_0x2ab7bd['appCode'],_0x409d97);return{'document':_0x409d97,'input':_0x1467aa,'planned':projectNotificationConfig({'appCode':_0x2ab7bd['appCode'],'configName':_0x409d97[_0x4f3458(0x18e)],'channelType':_0x409d97['channelType'],'endpointUrl':_0x409d97[_0x4f3458(0x186)],'channelConfig':_0x409d97[_0x4f3458(0x194)],'description':_0x409d97[_0x4f3458(0x1a5)],'connectTimeout':_0x409d97[_0x4f3458(0x193)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT,'readTimeout':_0x409d97[_0x4f3458(0x192)]??DEFAULT_NOTIFICATION_READ_TIMEOUT})};}export const notificationConfigCreate={'service':a135_0x367df9(0x18c),'command':a135_0x367df9(0x1a1),'description':a135_0x367df9(0x18f),'risk':a135_0x367df9(0x19d),'requiresAppCode':!![],'structuredErrors':!![],'flags':[...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x2141fa){assertSingleNotificationSource(_0x2141fa);},async 'dryRun'(_0x34c57d){const _0x25f3fb=a135_0x367df9,_0x3938c4=await prepareCreate(_0x34c57d),_0x9d411a=notificationLookupCommand(_0x34c57d[_0x25f3fb(0x185)],_0x3938c4['document'][_0x25f3fb(0x1a4)]);return asDryRunResult({'operation':_0x25f3fb(0x1a6),'selector':{'appCode':_0x34c57d['appCode'],'configName':_0x3938c4[_0x25f3fb(0x190)][_0x25f3fb(0x18e)],'channelType':_0x3938c4[_0x25f3fb(0x190)][_0x25f3fb(0x1a4)]},'before':null,'after':_0x3938c4['planned'],'dryRun':!![],'backend':{'method':_0x25f3fb(0x199),'path':CREATE_PATH},'warnings':[],'verification':{'status':'planned','lookupCommand':_0x9d411a}},{'method':'POST','url':CREATE_PATH});},async 'execute'(_0x3a0bff){const _0x3c0598=a135_0x367df9,_0x50f582=await prepareCreate(_0x3a0bff),_0x6ffff=notificationLookupCommand(_0x3a0bff[_0x3c0598(0x185)],_0x50f582[_0x3c0598(0x190)][_0x3c0598(0x1a4)]);let _0x5d6f8a;try{_0x5d6f8a=await createNotificationChannelConfig(_0x50f582[_0x3c0598(0x1a8)]);}catch(_0x13ccf0){if(isPlatformTransportFailure(_0x13ccf0))throw notificationError('notification_config_create_outcome_unknown',_0x3c0598(0x19e),_0x3c0598(0x196)+_0x6ffff+_0x3c0598(0x19b));throw safeApiFailure(_0x3c0598(0x1a6),_0x3c0598(0x1a7),_0x3c0598(0x196)+_0x6ffff+';\x20no\x20automatic\x20retry\x20was\x20attempted.');}if(!Number['isSafeInteger'](_0x5d6f8a)||_0x5d6f8a<=0x0)throw notificationError(_0x3c0598(0x183),_0x3c0598(0x187),_0x3c0598(0x196)+_0x6ffff+_0x3c0598(0x19b));let _0x401bf1;try{const _0x1f8116=await getNotificationChannelConfig(_0x5d6f8a,_0x3a0bff[_0x3c0598(0x185)]);_0x401bf1=normalizeExactNotificationConfig(_0x1f8116,_0x5d6f8a,_0x3a0bff[_0x3c0598(0x185)]);}catch{throw safeApiFailure('create',_0x3c0598(0x19c),_0x3c0598(0x196)+_0x6ffff+';\x20do\x20not\x20resubmit\x20automatically.');}return{'ok':!![],'data':{'operation':_0x3c0598(0x1a6),'selector':{'appCode':_0x401bf1[_0x3c0598(0x185)],'id':_0x401bf1['id'],'configCode':_0x401bf1[_0x3c0598(0x18d)],'configName':_0x401bf1[_0x3c0598(0x18e)],'channelType':_0x401bf1[_0x3c0598(0x1a4)]},'before':null,'after':projectNotificationConfig(_0x401bf1),'dryRun':![],'backend':{'method':'POST','path':CREATE_PATH},'warnings':[],'verification':{'status':_0x3c0598(0x18b),'lookupCommand':_0x6ffff}},'message':_0x3c0598(0x19a)+_0x401bf1['id']};}};
@@ -1 +1 @@
1
- const a135_0x4ced75=a135_0x58d7;(function(_0x5edc94,_0x4d3cf8){const _0x13ea26=a135_0x58d7,_0x12720b=_0x5edc94();while(!![]){try{const _0x2c6a6c=-parseInt(_0x13ea26(0xc4))/0x1*(-parseInt(_0x13ea26(0xc8))/0x2)+-parseInt(_0x13ea26(0xb8))/0x3+parseInt(_0x13ea26(0xc2))/0x4*(parseInt(_0x13ea26(0xc7))/0x5)+-parseInt(_0x13ea26(0xca))/0x6*(parseInt(_0x13ea26(0xb5))/0x7)+-parseInt(_0x13ea26(0xd1))/0x8+parseInt(_0x13ea26(0xc6))/0x9*(-parseInt(_0x13ea26(0xc0))/0xa)+parseInt(_0x13ea26(0xc5))/0xb;if(_0x2c6a6c===_0x4d3cf8)break;else _0x12720b['push'](_0x12720b['shift']());}catch(_0x51d528){_0x12720b['push'](_0x12720b['shift']());}}}(a135_0x4853,0x2d3ad));import{asDryRunResult}from'../../commands/common/dry-run.js';import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';const DELETE_PATH=a135_0x4ced75(0xbc),REFERENCE_WARNING=a135_0x4ced75(0xce);function a135_0x4853(){const _0x1c0634=['mutation','/notification/channel-config/delete','Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.','planned','POST','282660RuWYGX','high-risk-write','16XCooKq','channelType','115131pBPZcV','10320365IeuFZy','81NluJHm','272510aytNZE','2KYvGYt','unshift','6OUDAkE','verified','notification_config_delete_verification_unavailable','Deleted\x20notification\x20config\x20','Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.','Inspect\x20with\x20','notification_config_delete_outcome_unknown','1842224eDEBod',';\x20no\x20automatic\x20retry\x20was\x20attempted.','delete','Notification\x20config\x20','notification','2554237vyXnes',';\x20do\x20not\x20resubmit\x20automatically.','before','709590EmLhGf','appCode','\x20remains\x20present\x20after\x20delete.'];a135_0x4853=function(){return _0x1c0634;};return a135_0x4853();}function a135_0x58d7(_0x56e327,_0xbd7e0d){_0x56e327=_0x56e327-0xb5;const _0x4853e5=a135_0x4853();let _0x58d7e6=_0x4853e5[_0x56e327];return _0x58d7e6;}async function prepareDelete(_0x34a246){const _0x3e71cd=a135_0x4ced75,_0x5f3b5a=readNotificationId(_0x34a246),_0x31082a=await requireExactNotificationConfig(_0x34a246['appCode'],_0x5f3b5a,_0x3e71cd(0xd3));return{'id':_0x5f3b5a,'before':_0x31082a};}export const notificationConfigDelete={'service':a135_0x4ced75(0xd5),'command':'config-delete','description':'Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','risk':a135_0x4ced75(0xc1),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0x3954f5){readNotificationId(_0x3954f5),requireNotificationExplicitYes(_0x3954f5);},async 'dryRun'(_0x2457be){const _0x4621d7=a135_0x4ced75,_0x409562=await prepareDelete(_0x2457be),_0x101bc1=notificationLookupCommand(_0x2457be[_0x4621d7(0xb9)],_0x409562[_0x4621d7(0xb7)][_0x4621d7(0xc3)]);return asDryRunResult({'operation':'delete','selector':notificationSelector(_0x409562['before']),'before':projectNotificationConfig(_0x409562[_0x4621d7(0xb7)]),'after':null,'dryRun':!![],'backend':{'method':_0x4621d7(0xbf),'path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':_0x4621d7(0xbe),'lookupCommand':_0x101bc1}},{'method':_0x4621d7(0xbf),'url':DELETE_PATH});},async 'execute'(_0x49b197){const _0x20f956=a135_0x4ced75;requireNotificationExplicitYes(_0x49b197);const _0x5efbc4=await prepareDelete(_0x49b197),_0x3b0c1b=notificationLookupCommand(_0x49b197[_0x20f956(0xb9)],_0x5efbc4[_0x20f956(0xb7)][_0x20f956(0xc3)]);let _0x22e42f=![];try{await deleteNotificationChannelConfig(_0x5efbc4['id'],_0x49b197['appCode']);}catch(_0x1bf61d){if(!isPlatformTransportFailure(_0x1bf61d))throw safeApiFailure('delete',_0x20f956(0xbb),_0x20f956(0xcf)+_0x3b0c1b+_0x20f956(0xd2));_0x22e42f=!![];}let _0x43838e;try{_0x43838e=await listNotificationChannelConfigs(_0x49b197['appCode'],_0x5efbc4[_0x20f956(0xb7)][_0x20f956(0xc3)]),validateNotificationDeleteReadback(_0x43838e,_0x49b197['appCode'],_0x5efbc4[_0x20f956(0xb7)][_0x20f956(0xc3)]);}catch{throw notificationError(_0x22e42f?'notification_config_delete_outcome_unknown':_0x20f956(0xcc),_0x20f956(0xd4)+_0x5efbc4['id']+'\x20delete\x20could\x20not\x20be\x20verified.',_0x20f956(0xcf)+_0x3b0c1b+_0x20f956(0xb6));}if(_0x43838e['some'](_0x18854e=>_0x18854e['id']===_0x5efbc4['id']))throw notificationError(_0x22e42f?_0x20f956(0xd0):'notification_config_delete_verification_failed',_0x20f956(0xd4)+_0x5efbc4['id']+_0x20f956(0xba),_0x20f956(0xcf)+_0x3b0c1b+_0x20f956(0xb6));const _0x47cfdc=[REFERENCE_WARNING];return _0x22e42f&&_0x47cfdc[_0x20f956(0xc9)](_0x20f956(0xbd)),{'ok':!![],'data':{'operation':_0x20f956(0xd3),'selector':notificationSelector(_0x5efbc4[_0x20f956(0xb7)]),'before':projectNotificationConfig(_0x5efbc4[_0x20f956(0xb7)]),'after':null,'dryRun':![],'backend':{'method':_0x20f956(0xbf),'path':DELETE_PATH},'warnings':_0x47cfdc,'verification':{'status':_0x20f956(0xcb),'absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x22e42f,'lookupCommand':_0x3b0c1b}},'message':_0x20f956(0xcd)+_0x5efbc4['id']};}};
1
+ const a136_0x5c3a35=a136_0x4eed;(function(_0x25acf8,_0x4a8f96){const _0x2bf000=a136_0x4eed,_0x1c1c36=_0x25acf8();while(!![]){try{const _0x4c72e7=parseInt(_0x2bf000(0x1f9))/0x1+parseInt(_0x2bf000(0x1f1))/0x2+-parseInt(_0x2bf000(0x1e5))/0x3+parseInt(_0x2bf000(0x1e7))/0x4*(-parseInt(_0x2bf000(0x1ed))/0x5)+parseInt(_0x2bf000(0x1fa))/0x6*(-parseInt(_0x2bf000(0x1fc))/0x7)+parseInt(_0x2bf000(0x200))/0x8+parseInt(_0x2bf000(0x1f3))/0x9;if(_0x4c72e7===_0x4a8f96)break;else _0x1c1c36['push'](_0x1c1c36['shift']());}catch(_0x3e00f0){_0x1c1c36['push'](_0x1c1c36['shift']());}}}(a136_0x4e50,0xbda7b));import{asDryRunResult}from'../../commands/common/dry-run.js';import{deleteNotificationChannelConfig,isPlatformTransportFailure,listNotificationChannelConfigs}from'../../core/api-client.js';import{notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,projectNotificationConfig,readNotificationId,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure,validateNotificationDeleteReadback}from'../../commands/notification/shared.js';function a136_0x4e50(){const _0x14992b=['POST','3165561olqgUo','/notification/channel-config/delete','channelType',';\x20do\x20not\x20resubmit\x20automatically.','notification_config_delete_verification_failed','delete','610593xiPnIa','34980vwdjAd','notification','651KbXQra','Inspect\x20with\x20','notification_config_delete_verification_unavailable','Delete\x20response\x20was\x20unavailable;\x20list\x20readback\x20proved\x20ID\x20absence\x20without\x20resubmitting.','5054008dReNYk','Deleting\x20this\x20app-level\x20config\x20may\x20make\x20dataset-level\x20channels\x20that\x20reference\x20it\x20unavailable;\x20dataset\x20references\x20were\x20not\x20verified\x20by\x20the\x20CLI.','\x20delete\x20could\x20not\x20be\x20verified.','config-delete','3056367VlFTAg','Deleted\x20notification\x20config\x20','4uZUlhX','notification_config_delete_outcome_unknown','\x20remains\x20present\x20after\x20delete.','some','appCode','before','1188955JxTlZJ','planned','Notification\x20config\x20','Delete\x20an\x20app-level\x20notification\x20config\x20after\x20exact\x20preflight','1963048EThxnM'];a136_0x4e50=function(){return _0x14992b;};return a136_0x4e50();}const DELETE_PATH=a136_0x5c3a35(0x1f4),REFERENCE_WARNING=a136_0x5c3a35(0x201);async function prepareDelete(_0x240f4b){const _0x36ecca=a136_0x5c3a35,_0x5c36b9=readNotificationId(_0x240f4b),_0x14d30b=await requireExactNotificationConfig(_0x240f4b[_0x36ecca(0x1eb)],_0x5c36b9,_0x36ecca(0x1f8));return{'id':_0x5c36b9,'before':_0x14d30b};}function a136_0x4eed(_0x581f6a,_0x4f01c3){_0x581f6a=_0x581f6a-0x1e4;const _0x4e5050=a136_0x4e50();let _0x4eedb4=_0x4e5050[_0x581f6a];return _0x4eedb4;}export const notificationConfigDelete={'service':a136_0x5c3a35(0x1fb),'command':a136_0x5c3a35(0x1e4),'description':a136_0x5c3a35(0x1f0),'risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,NOTIFICATION_APP_FLAG],async 'validate'(_0x1563b7){readNotificationId(_0x1563b7),requireNotificationExplicitYes(_0x1563b7);},async 'dryRun'(_0x4b99fc){const _0x5341e6=a136_0x5c3a35,_0x232dd5=await prepareDelete(_0x4b99fc),_0x2dd51d=notificationLookupCommand(_0x4b99fc[_0x5341e6(0x1eb)],_0x232dd5['before'][_0x5341e6(0x1f5)]);return asDryRunResult({'operation':_0x5341e6(0x1f8),'selector':notificationSelector(_0x232dd5[_0x5341e6(0x1ec)]),'before':projectNotificationConfig(_0x232dd5['before']),'after':null,'dryRun':!![],'backend':{'method':_0x5341e6(0x1f2),'path':DELETE_PATH},'warnings':[REFERENCE_WARNING],'verification':{'status':_0x5341e6(0x1ee),'lookupCommand':_0x2dd51d}},{'method':_0x5341e6(0x1f2),'url':DELETE_PATH});},async 'execute'(_0x192512){const _0x21f6ab=a136_0x5c3a35;requireNotificationExplicitYes(_0x192512);const _0x417b3a=await prepareDelete(_0x192512),_0x3558e7=notificationLookupCommand(_0x192512[_0x21f6ab(0x1eb)],_0x417b3a[_0x21f6ab(0x1ec)][_0x21f6ab(0x1f5)]);let _0x568fc1=![];try{await deleteNotificationChannelConfig(_0x417b3a['id'],_0x192512[_0x21f6ab(0x1eb)]);}catch(_0x1a3a55){if(!isPlatformTransportFailure(_0x1a3a55))throw safeApiFailure(_0x21f6ab(0x1f8),'mutation','Inspect\x20with\x20'+_0x3558e7+';\x20no\x20automatic\x20retry\x20was\x20attempted.');_0x568fc1=!![];}let _0x793346;try{_0x793346=await listNotificationChannelConfigs(_0x192512[_0x21f6ab(0x1eb)],_0x417b3a[_0x21f6ab(0x1ec)]['channelType']),validateNotificationDeleteReadback(_0x793346,_0x192512['appCode'],_0x417b3a[_0x21f6ab(0x1ec)][_0x21f6ab(0x1f5)]);}catch{throw notificationError(_0x568fc1?_0x21f6ab(0x1e8):_0x21f6ab(0x1fe),'Notification\x20config\x20'+_0x417b3a['id']+_0x21f6ab(0x202),_0x21f6ab(0x1fd)+_0x3558e7+';\x20do\x20not\x20resubmit\x20automatically.');}if(_0x793346[_0x21f6ab(0x1ea)](_0x159397=>_0x159397['id']===_0x417b3a['id']))throw notificationError(_0x568fc1?'notification_config_delete_outcome_unknown':_0x21f6ab(0x1f7),_0x21f6ab(0x1ef)+_0x417b3a['id']+_0x21f6ab(0x1e9),_0x21f6ab(0x1fd)+_0x3558e7+_0x21f6ab(0x1f6));const _0x1db81b=[REFERENCE_WARNING];return _0x568fc1&&_0x1db81b['unshift'](_0x21f6ab(0x1ff)),{'ok':!![],'data':{'operation':'delete','selector':notificationSelector(_0x417b3a[_0x21f6ab(0x1ec)]),'before':projectNotificationConfig(_0x417b3a[_0x21f6ab(0x1ec)]),'after':null,'dryRun':![],'backend':{'method':_0x21f6ab(0x1f2),'path':DELETE_PATH},'warnings':_0x1db81b,'verification':{'status':'verified','absenceConfirmed':!![],'recoveredAfterUnknownResponse':_0x568fc1,'lookupCommand':_0x3558e7}},'message':_0x21f6ab(0x1e6)+_0x417b3a['id']};}};
@@ -1 +1 @@
1
- const a136_0x3a49e6=a136_0x267a;function a136_0x267a(_0x3faa67,_0x3e78d){_0x3faa67=_0x3faa67-0x137;const _0x508932=a136_0x5089();let _0x267abe=_0x508932[_0x3faa67];return _0x267abe;}function a136_0x5089(){const _0x5b1dfe=['\x20notification\x20config(s)','7667464FbXBIY','List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','2153098piRkGz','EMAIL','read','Notification\x20channel\x20type','13118409JHIVGI','notification','83876JRosGJ','appCode','length','config-list','1YbjgVW','1783645ODouCy','5581440vjLHlx','18hSJUea','type','map','3435817QYPygK'];a136_0x5089=function(){return _0x5b1dfe;};return a136_0x5089();}(function(_0x3ae51c,_0x54dc30){const _0x3e7e48=a136_0x267a,_0x58a39b=_0x3ae51c();while(!![]){try{const _0x6dccb5=parseInt(_0x3e7e48(0x146))/0x1*(parseInt(_0x3e7e48(0x13c))/0x2)+-parseInt(_0x3e7e48(0x149))/0x3*(-parseInt(_0x3e7e48(0x142))/0x4)+parseInt(_0x3e7e48(0x147))/0x5+-parseInt(_0x3e7e48(0x148))/0x6+-parseInt(_0x3e7e48(0x138))/0x7+-parseInt(_0x3e7e48(0x13a))/0x8+parseInt(_0x3e7e48(0x140))/0x9;if(_0x6dccb5===_0x54dc30)break;else _0x58a39b['push'](_0x58a39b['shift']());}catch(_0x338d4a){_0x58a39b['push'](_0x58a39b['shift']());}}}(a136_0x5089,0x9b905));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{listNotificationChannelConfigs}from'../../core/api-client.js';import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':a136_0x3a49e6(0x141),'command':a136_0x3a49e6(0x145),'description':a136_0x3a49e6(0x13b),'risk':a136_0x3a49e6(0x13e),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a136_0x3a49e6(0x14a),'type':'string','description':a136_0x3a49e6(0x13f),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a136_0x3a49e6(0x13d)}],async 'validate'(_0x3c2814){readNotificationChannelType(_0x3c2814);},async 'execute'(_0x511912){const _0xad6ed9=a136_0x3a49e6,_0x2e1e6d=readNotificationChannelType(_0x511912),_0x144ea6=await listNotificationChannelConfigs(_0x511912[_0xad6ed9(0x143)],_0x2e1e6d),_0xd29a9=_0x144ea6[_0xad6ed9(0x137)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x511912[_0xad6ed9(0x143)],'channelType':_0x2e1e6d,'count':_0xd29a9['length'],'configs':_0xd29a9},'message':'Found\x20'+_0xd29a9[_0xad6ed9(0x144)]+'\x20'+_0x2e1e6d+_0xad6ed9(0x139)};}};
1
+ const a137_0x1283d0=a137_0x531d;function a137_0x531d(_0x356091,_0x15b1f0){_0x356091=_0x356091-0xc7;const _0x15a40b=a137_0x15a4();let _0x531d41=_0x15a40b[_0x356091];return _0x531d41;}(function(_0x2227a0,_0x1a62b2){const _0x23488d=a137_0x531d,_0x1798bf=_0x2227a0();while(!![]){try{const _0x51a277=parseInt(_0x23488d(0xda))/0x1+parseInt(_0x23488d(0xcd))/0x2+parseInt(_0x23488d(0xce))/0x3*(-parseInt(_0x23488d(0xcf))/0x4)+parseInt(_0x23488d(0xd2))/0x5+parseInt(_0x23488d(0xcb))/0x6*(parseInt(_0x23488d(0xd3))/0x7)+parseInt(_0x23488d(0xc7))/0x8+-parseInt(_0x23488d(0xd8))/0x9;if(_0x51a277===_0x1a62b2)break;else _0x1798bf['push'](_0x1798bf['shift']());}catch(_0x464396){_0x1798bf['push'](_0x1798bf['shift']());}}}(a137_0x15a4,0xc621a));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{listNotificationChannelConfigs}from'../../core/api-client.js';import{NOTIFICATION_CHANNEL_TYPES,projectNotificationListConfig,readNotificationChannelType}from'../../commands/notification/shared.js';export const notificationConfigList={'service':'notification','command':a137_0x1283d0(0xcc),'description':'List\x20app-level\x20notification\x20configs\x20and\x20their\x20configCode\x20values','risk':a137_0x1283d0(0xd1),'flags':[APPCODE_FLAG_OPTIONAL,{'name':a137_0x1283d0(0xd9),'type':a137_0x1283d0(0xd0),'description':a137_0x1283d0(0xd4),'enum':NOTIFICATION_CHANNEL_TYPES,'default':a137_0x1283d0(0xc9)}],async 'validate'(_0x2a1fd9){readNotificationChannelType(_0x2a1fd9);},async 'execute'(_0x478a5a){const _0x871153=a137_0x1283d0,_0x294eca=readNotificationChannelType(_0x478a5a),_0x754712=await listNotificationChannelConfigs(_0x478a5a['appCode'],_0x294eca),_0x330762=_0x754712[_0x871153(0xd6)](projectNotificationListConfig);return{'ok':!![],'data':{'appCode':_0x478a5a[_0x871153(0xc8)],'channelType':_0x294eca,'count':_0x330762[_0x871153(0xd7)],'configs':_0x330762},'message':_0x871153(0xca)+_0x330762[_0x871153(0xd7)]+'\x20'+_0x294eca+_0x871153(0xd5)};}};function a137_0x15a4(){const _0xb68c4a=['1619288QRIEix','2122032cMiqow','appCode','EMAIL','Found\x20','6EEGQgd','config-list','2163150NTFySg','84UndKKM','182108RkioYF','string','read','1945855nnMdyp','8612709UwvoIb','Notification\x20channel\x20type','\x20notification\x20config(s)','map','length','22494357XyUPdP','type'];a137_0x15a4=function(){return _0xb68c4a;};return a137_0x15a4();}
@@ -1 +1 @@
1
- const a137_0x5e875d=a137_0x4153;(function(_0xc5c261,_0x2bd16d){const _0x2ab87e=a137_0x4153,_0x3adf2a=_0xc5c261();while(!![]){try{const _0x2362ca=-parseInt(_0x2ab87e(0x137))/0x1*(-parseInt(_0x2ab87e(0x143))/0x2)+parseInt(_0x2ab87e(0x128))/0x3+-parseInt(_0x2ab87e(0x145))/0x4+-parseInt(_0x2ab87e(0x13d))/0x5+-parseInt(_0x2ab87e(0x138))/0x6*(-parseInt(_0x2ab87e(0x13b))/0x7)+parseInt(_0x2ab87e(0x12a))/0x8*(parseInt(_0x2ab87e(0x12d))/0x9)+-parseInt(_0x2ab87e(0x139))/0xa;if(_0x2362ca===_0x2bd16d)break;else _0x3adf2a['push'](_0x3adf2a['shift']());}catch(_0x9a15f8){_0x3adf2a['push'](_0x3adf2a['shift']());}}}(a137_0x5a24,0xc2616));function a137_0x5a24(){const _0x3ab2ba=['/notification/channel-config/update','Inspect\x20ID\x20','Updated\x20notification\x20config\x20','allMatch','update','21gvsCGX','990294EOFUOy','4725520ZICAJP','\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20update.','7fAheLz','POST','5926885STqOex','Notification\x20config\x20','Inspect\x20with\x20--id\x20','notification_config_update_verification_failed','config-update','verified','62156nfacVU','mutation','3250708kExBUi','planned','\x20via\x20','notification_config_update_outcome_unknown','payload','before','verifiedFields','notification','4634481BrQCbp',';\x20do\x20not\x20resubmit\x20automatically.','516728sSJvFP','channelType','Update\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20patch','126GXpstY','\x20with\x20','high-risk-write','appCode','notification_config_update_verification_unavailable'];a137_0x5a24=function(){return _0x3ab2ba;};return a137_0x5a24();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{getNotificationChannelConfig,isPlatformTransportFailure,updateNotificationChannelConfig}from'../../core/api-client.js';function a137_0x4153(_0x1ea0ec,_0x44c02c){_0x1ea0ec=_0x1ea0ec-0x125;const _0x5a24dc=a137_0x5a24();let _0x4153a7=_0x5a24dc[_0x1ea0ec];return _0x4153a7;}import{assertSingleNotificationSource,mergeUpdateInput,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,NOTIFICATION_INPUT_FLAGS,plannedUpdateProjection,projectNotificationConfig,readNotificationDocument,readNotificationId,requestedSafeFieldsMatch,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure}from'../../commands/notification/shared.js';const UPDATE_PATH=a137_0x5e875d(0x132);async function prepareUpdate(_0x3bc5f7){const _0x261598=a137_0x5e875d,_0x463b0c=readNotificationId(_0x3bc5f7),_0x44c1f6=await readNotificationDocument(_0x3bc5f7,_0x261598(0x136)),_0x3e0d24=await requireExactNotificationConfig(_0x3bc5f7[_0x261598(0x130)],_0x463b0c,_0x261598(0x136));return{'id':_0x463b0c,'patch':_0x44c1f6,'before':_0x3e0d24,'payload':mergeUpdateInput(_0x3e0d24,_0x44c1f6),'planned':plannedUpdateProjection(_0x3e0d24,_0x44c1f6)};}export const notificationConfigUpdate={'service':a137_0x5e875d(0x127),'command':a137_0x5e875d(0x141),'description':a137_0x5e875d(0x12c),'risk':a137_0x5e875d(0x12f),'requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x1d57e3){readNotificationId(_0x1d57e3),assertSingleNotificationSource(_0x1d57e3),requireNotificationExplicitYes(_0x1d57e3);},async 'dryRun'(_0x3dbc0d){const _0x59221d=a137_0x5e875d,_0x39f6b0=await prepareUpdate(_0x3dbc0d),_0x5aa123=notificationLookupCommand(_0x3dbc0d[_0x59221d(0x130)],_0x39f6b0['before'][_0x59221d(0x12b)]);return asDryRunResult({'operation':_0x59221d(0x136),'selector':notificationSelector(_0x39f6b0[_0x59221d(0x125)]),'before':projectNotificationConfig(_0x39f6b0[_0x59221d(0x125)]),'after':_0x39f6b0[_0x59221d(0x146)],'dryRun':!![],'backend':{'method':_0x59221d(0x13c),'path':UPDATE_PATH},'warnings':[],'verification':{'status':_0x59221d(0x146),'lookupCommand':_0x5aa123}},{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0xb27af){const _0xddd60e=a137_0x5e875d;requireNotificationExplicitYes(_0xb27af);const _0xebc5a2=await prepareUpdate(_0xb27af),_0x49bbb0=notificationLookupCommand(_0xb27af[_0xddd60e(0x130)],_0xebc5a2[_0xddd60e(0x125)][_0xddd60e(0x12b)]);let _0x2d4996=![];try{await updateNotificationChannelConfig(_0xebc5a2[_0xddd60e(0x149)]);}catch(_0x952de2){if(!isPlatformTransportFailure(_0x952de2))throw safeApiFailure(_0xddd60e(0x136),_0xddd60e(0x144),_0xddd60e(0x133)+_0xebc5a2['id']+_0xddd60e(0x12e)+_0x49bbb0+';\x20no\x20automatic\x20retry\x20was\x20attempted.');_0x2d4996=!![];}let _0x5d1eec;try{const _0x2a4923=await getNotificationChannelConfig(_0xebc5a2['id'],_0xb27af[_0xddd60e(0x130)]);_0x5d1eec=normalizeExactNotificationConfig(_0x2a4923,_0xebc5a2['id'],_0xb27af[_0xddd60e(0x130)]);}catch{throw notificationError(_0x2d4996?_0xddd60e(0x148):_0xddd60e(0x131),_0xddd60e(0x13e)+_0xebc5a2['id']+'\x20update\x20could\x20not\x20be\x20verified\x20by\x20exact\x20ID.',_0xddd60e(0x13f)+_0xebc5a2['id']+_0xddd60e(0x147)+_0x49bbb0+_0xddd60e(0x129));}const _0x2ccffa=requestedSafeFieldsMatch(_0xebc5a2[_0xddd60e(0x125)],_0x5d1eec,_0xebc5a2['patch']);if(!_0x2ccffa[_0xddd60e(0x135)]||_0x2d4996&&!_0x2ccffa['provesChange'])throw notificationError(_0x2d4996?_0xddd60e(0x148):_0xddd60e(0x140),'Notification\x20config\x20'+_0xebc5a2['id']+_0xddd60e(0x13a),'Inspect\x20with\x20--id\x20'+_0xebc5a2['id']+_0xddd60e(0x147)+_0x49bbb0+_0xddd60e(0x129));const _0x24d860=_0x2d4996?['Update\x20response\x20was\x20unavailable;\x20exact-ID\x20readback\x20proved\x20changed\x20safe\x20fields\x20without\x20resubmitting.']:[];return{'ok':!![],'data':{'operation':_0xddd60e(0x136),'selector':notificationSelector(_0x5d1eec),'before':projectNotificationConfig(_0xebc5a2[_0xddd60e(0x125)]),'after':projectNotificationConfig(_0x5d1eec),'dryRun':![],'backend':{'method':_0xddd60e(0x13c),'path':UPDATE_PATH},'warnings':_0x24d860,'verification':{'status':_0xddd60e(0x142),'recoveredAfterUnknownResponse':_0x2d4996,'verifiedFields':_0x2ccffa[_0xddd60e(0x126)],'lookupCommand':_0x49bbb0}},'message':_0xddd60e(0x134)+_0x5d1eec['id']};}};
1
+ const a138_0x3d97f3=a138_0x10f8;function a138_0x256f(){const _0x5584a5=['\x20readback\x20does\x20not\x20prove\x20the\x20requested\x20update.','notification_config_update_verification_failed','4heCKgQ','4275832MOSCGX','POST','before','planned','4001473TUkDla','patch','\x20via\x20','Update\x20response\x20was\x20unavailable;\x20exact-ID\x20readback\x20proved\x20changed\x20safe\x20fields\x20without\x20resubmitting.','Inspect\x20ID\x20',';\x20no\x20automatic\x20retry\x20was\x20attempted.','update','verified','payload','channelType','appCode','notification_config_update_outcome_unknown','Inspect\x20with\x20--id\x20','63390EUhWab','47pRAlNa','5618280cmrLad','8956685CNsXiR','Notification\x20config\x20','10VaDlGI','allMatch',';\x20do\x20not\x20resubmit\x20automatically.','/notification/channel-config/update','\x20with\x20','45186251pMViUP','config-update','notification','mutation','verifiedFields','\x20update\x20could\x20not\x20be\x20verified\x20by\x20exact\x20ID.','419868QFaofA','provesChange','18HkaMdo'];a138_0x256f=function(){return _0x5584a5;};return a138_0x256f();}function a138_0x10f8(_0x598a17,_0x20824a){_0x598a17=_0x598a17-0x194;const _0x256fc6=a138_0x256f();let _0x10f873=_0x256fc6[_0x598a17];return _0x10f873;}(function(_0x1fa927,_0x219668){const _0x4e9c75=a138_0x10f8,_0x5ed631=_0x1fa927();while(!![]){try{const _0x21be4f=parseInt(_0x4e9c75(0x1a6))/0x1*(-parseInt(_0x4e9c75(0x1a5))/0x2)+-parseInt(_0x4e9c75(0x1a7))/0x3+-parseInt(_0x4e9c75(0x1ba))/0x4*(-parseInt(_0x4e9c75(0x1a8))/0x5)+parseInt(_0x4e9c75(0x1b5))/0x6+-parseInt(_0x4e9c75(0x198))/0x7+parseInt(_0x4e9c75(0x194))/0x8*(-parseInt(_0x4e9c75(0x1b7))/0x9)+-parseInt(_0x4e9c75(0x1aa))/0xa*(-parseInt(_0x4e9c75(0x1af))/0xb);if(_0x21be4f===_0x219668)break;else _0x5ed631['push'](_0x5ed631['shift']());}catch(_0x4f6b59){_0x5ed631['push'](_0x5ed631['shift']());}}}(a138_0x256f,0xebdf6));import{asDryRunResult}from'../../commands/common/dry-run.js';import{getNotificationChannelConfig,isPlatformTransportFailure,updateNotificationChannelConfig}from'../../core/api-client.js';import{assertSingleNotificationSource,mergeUpdateInput,normalizeExactNotificationConfig,notificationError,notificationLookupCommand,notificationSelector,NOTIFICATION_APP_FLAG,NOTIFICATION_ID_FLAG,NOTIFICATION_INPUT_FLAGS,plannedUpdateProjection,projectNotificationConfig,readNotificationDocument,readNotificationId,requestedSafeFieldsMatch,requireNotificationExplicitYes,requireExactNotificationConfig,safeApiFailure}from'../../commands/notification/shared.js';const UPDATE_PATH=a138_0x3d97f3(0x1ad);async function prepareUpdate(_0x3da077){const _0xcd6c3f=a138_0x3d97f3,_0x370190=readNotificationId(_0x3da077),_0xd13e9=await readNotificationDocument(_0x3da077,_0xcd6c3f(0x19e)),_0x5c95e7=await requireExactNotificationConfig(_0x3da077[_0xcd6c3f(0x1a2)],_0x370190,'update');return{'id':_0x370190,'patch':_0xd13e9,'before':_0x5c95e7,'payload':mergeUpdateInput(_0x5c95e7,_0xd13e9),'planned':plannedUpdateProjection(_0x5c95e7,_0xd13e9)};}export const notificationConfigUpdate={'service':a138_0x3d97f3(0x1b1),'command':a138_0x3d97f3(0x1b0),'description':'Update\x20an\x20app-level\x20notification\x20config\x20from\x20a\x20secure\x20JSON\x20patch','risk':'high-risk-write','requiresAppCode':!![],'structuredErrors':!![],'flags':[NOTIFICATION_ID_FLAG,...NOTIFICATION_INPUT_FLAGS,NOTIFICATION_APP_FLAG],async 'validate'(_0x120237){readNotificationId(_0x120237),assertSingleNotificationSource(_0x120237),requireNotificationExplicitYes(_0x120237);},async 'dryRun'(_0x21ec6a){const _0x55bba9=a138_0x3d97f3,_0x18f505=await prepareUpdate(_0x21ec6a),_0x599fa6=notificationLookupCommand(_0x21ec6a[_0x55bba9(0x1a2)],_0x18f505[_0x55bba9(0x196)][_0x55bba9(0x1a1)]);return asDryRunResult({'operation':_0x55bba9(0x19e),'selector':notificationSelector(_0x18f505['before']),'before':projectNotificationConfig(_0x18f505[_0x55bba9(0x196)]),'after':_0x18f505[_0x55bba9(0x197)],'dryRun':!![],'backend':{'method':'POST','path':UPDATE_PATH},'warnings':[],'verification':{'status':_0x55bba9(0x197),'lookupCommand':_0x599fa6}},{'method':_0x55bba9(0x195),'url':UPDATE_PATH});},async 'execute'(_0x4174ff){const _0x256f8f=a138_0x3d97f3;requireNotificationExplicitYes(_0x4174ff);const _0x14673f=await prepareUpdate(_0x4174ff),_0x51ebbf=notificationLookupCommand(_0x4174ff[_0x256f8f(0x1a2)],_0x14673f[_0x256f8f(0x196)][_0x256f8f(0x1a1)]);let _0x164a16=![];try{await updateNotificationChannelConfig(_0x14673f[_0x256f8f(0x1a0)]);}catch(_0xe998d){if(!isPlatformTransportFailure(_0xe998d))throw safeApiFailure(_0x256f8f(0x19e),_0x256f8f(0x1b2),_0x256f8f(0x19c)+_0x14673f['id']+_0x256f8f(0x1ae)+_0x51ebbf+_0x256f8f(0x19d));_0x164a16=!![];}let _0x4d6127;try{const _0x1c5e7c=await getNotificationChannelConfig(_0x14673f['id'],_0x4174ff[_0x256f8f(0x1a2)]);_0x4d6127=normalizeExactNotificationConfig(_0x1c5e7c,_0x14673f['id'],_0x4174ff[_0x256f8f(0x1a2)]);}catch{throw notificationError(_0x164a16?_0x256f8f(0x1a3):'notification_config_update_verification_unavailable',_0x256f8f(0x1a9)+_0x14673f['id']+_0x256f8f(0x1b4),'Inspect\x20with\x20--id\x20'+_0x14673f['id']+_0x256f8f(0x19a)+_0x51ebbf+';\x20do\x20not\x20resubmit\x20automatically.');}const _0x792db3=requestedSafeFieldsMatch(_0x14673f[_0x256f8f(0x196)],_0x4d6127,_0x14673f[_0x256f8f(0x199)]);if(!_0x792db3[_0x256f8f(0x1ab)]||_0x164a16&&!_0x792db3[_0x256f8f(0x1b6)])throw notificationError(_0x164a16?'notification_config_update_outcome_unknown':_0x256f8f(0x1b9),_0x256f8f(0x1a9)+_0x14673f['id']+_0x256f8f(0x1b8),_0x256f8f(0x1a4)+_0x14673f['id']+_0x256f8f(0x19a)+_0x51ebbf+_0x256f8f(0x1ac));const _0x1e3d1a=_0x164a16?[_0x256f8f(0x19b)]:[];return{'ok':!![],'data':{'operation':_0x256f8f(0x19e),'selector':notificationSelector(_0x4d6127),'before':projectNotificationConfig(_0x14673f['before']),'after':projectNotificationConfig(_0x4d6127),'dryRun':![],'backend':{'method':_0x256f8f(0x195),'path':UPDATE_PATH},'warnings':_0x1e3d1a,'verification':{'status':_0x256f8f(0x19f),'recoveredAfterUnknownResponse':_0x164a16,'verifiedFields':_0x792db3[_0x256f8f(0x1b3)],'lookupCommand':_0x51ebbf}},'message':'Updated\x20notification\x20config\x20'+_0x4d6127['id']};}};
@@ -1 +1 @@
1
- (function(_0x2e0e5e,_0x15a2e7){const _0x5f3149=a138_0x2543,_0x191fb0=_0x2e0e5e();while(!![]){try{const _0xfa10a2=-parseInt(_0x5f3149(0x81))/0x1+-parseInt(_0x5f3149(0x82))/0x2*(parseInt(_0x5f3149(0x85))/0x3)+parseInt(_0x5f3149(0x7f))/0x4*(-parseInt(_0x5f3149(0x83))/0x5)+parseInt(_0x5f3149(0x84))/0x6+-parseInt(_0x5f3149(0x88))/0x7+parseInt(_0x5f3149(0x87))/0x8*(-parseInt(_0x5f3149(0x86))/0x9)+parseInt(_0x5f3149(0x80))/0xa;if(_0xfa10a2===_0x15a2e7)break;else _0x191fb0['push'](_0x191fb0['shift']());}catch(_0x2b3184){_0x191fb0['push'](_0x191fb0['shift']());}}}(a138_0x4827,0x4c089));import{notificationConfigList}from'../../commands/notification/config-list.js';import{notificationConfigCreate}from'../../commands/notification/config-create.js';import{notificationConfigUpdate}from'../../commands/notification/config-update.js';import{notificationConfigDelete}from'../../commands/notification/config-delete.js';function a138_0x2543(_0x3bf85e,_0xf76870){_0x3bf85e=_0x3bf85e-0x7f;const _0x482741=a138_0x4827();let _0x2543b7=_0x482741[_0x3bf85e];return _0x2543b7;}export const notificationDefinitions=[notificationConfigList,notificationConfigCreate,notificationConfigUpdate,notificationConfigDelete];function a138_0x4827(){const _0xa5e3ac=['4642jiAloW','9320ZhpluD','2638056SEsRlq','453MIAaXU','3025089ZUGlOL','8RytMbz','3946691YwADwg','964DrFmYI','17801940AtPVyA','208808ienzIu'];a138_0x4827=function(){return _0xa5e3ac;};return a138_0x4827();}
1
+ (function(_0x1208e5,_0x4ac0e1){const _0x274394=a139_0x19bb,_0x3543eb=_0x1208e5();while(!![]){try{const _0x269141=parseInt(_0x274394(0x182))/0x1*(-parseInt(_0x274394(0x185))/0x2)+parseInt(_0x274394(0x183))/0x3*(-parseInt(_0x274394(0x17d))/0x4)+parseInt(_0x274394(0x180))/0x5+parseInt(_0x274394(0x17e))/0x6+parseInt(_0x274394(0x181))/0x7+parseInt(_0x274394(0x17f))/0x8*(-parseInt(_0x274394(0x186))/0x9)+parseInt(_0x274394(0x184))/0xa;if(_0x269141===_0x4ac0e1)break;else _0x3543eb['push'](_0x3543eb['shift']());}catch(_0x1e3382){_0x3543eb['push'](_0x3543eb['shift']());}}}(a139_0xf566,0xe374b));function a139_0xf566(){const _0x25cb9a=['72952UdBWBb','1867255GYmiQx','5863550JRblAF','1vrNgPJ','1779KiXcvd','15505400nwoDyr','2897324eqpAPc','1179gvrhtD','932VwSVzo','5708628QOGjWm'];a139_0xf566=function(){return _0x25cb9a;};return a139_0xf566();}function a139_0x19bb(_0x4c6952,_0x4f9547){_0x4c6952=_0x4c6952-0x17d;const _0xf56618=a139_0xf566();let _0x19bb8d=_0xf56618[_0x4c6952];return _0x19bb8d;}import{notificationConfigList}from'../../commands/notification/config-list.js';import{notificationConfigCreate}from'../../commands/notification/config-create.js';import{notificationConfigUpdate}from'../../commands/notification/config-update.js';import{notificationConfigDelete}from'../../commands/notification/config-delete.js';export const notificationDefinitions=[notificationConfigList,notificationConfigCreate,notificationConfigUpdate,notificationConfigDelete];
@@ -1 +1 @@
1
- function a139_0x32bf(){const _0x266aa5=['endpointUrl','<redacted>','preflight','bool','setEncoding','appCode','parse','notification_config_source_unavailable','\x20failed.','Notification\x20JSON\x20channelConfig\x20field\x20\x22','\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.','Application-level\x20notification\x20config\x20ID','\x20has\x20an\x20unsupported\x20channelType.','join','channelConfig','a\x20JSON\x20object','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','failed','Notification\x20config\x20list\x20item\x20','Notification\x20JSON\x20from\x20','messageTemplate','246301eiyawi','\x22\x20must\x20be\x20a\x20non-empty\x20string.','update','EMAIL','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','WECOM','1225840quJCOk','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','70LuEhKF','a\x20string\x20or\x20null','4121Kxbazk','length','subjectPrefix','\x22\x20cannot\x20exceed\x20','connectTimeout','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','_unavailable','\x20is\x20missing\x20required\x20field\x20\x22','\x20has\x20invalid\x20field\x20\x22','env','notification_config_field_required','call','notification_config_channel_field_forbidden','updateTime','trim','Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.','Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20','164466StdINZ','recipients','a\x20non-empty\x20string','includes','configCode','channelConfigRaw','Notification\x20JSON\x20field\x20\x22','689622eqnhkG','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','Allowed\x20values:\x20','44088fpCJyK','description','15ZpvYEM','FEISHU','boolean','configName','endpointUrlRaw','12928RZpptZ','Invalid\x20--','name','ccList','notification_config_confirmation_required','notification_config_response_invalid','notification_config_field_forbidden','string','environment\x20variable\x20','every','validation','Create\x20JSON\x20requires\x20field\x20','notification_config_id_invalid','file','stdin','from-env','prototype','replyTo','\x22configName\x22.','kind','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable','some','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','has','str','notification_config_field_unknown','\x20is\x20invalid.','bccList','\x22\x20is\x20forbidden.','\x20--format\x20compress','push','readTimeout','WEBHOOK','Notification\x20config\x20','number','dry-run','591BaIVOt','248TbnDNi','emailTargets','hasOwnProperty','channelType','\x22\x20must\x20be\x20','path','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','fromName','notification_config_','keys','a\x20supported\x20string','endpointUrl:null','Invalid\x20notification\x20config\x20response.','create','isSafeInteger','2WvEJSX','a\x20JSON\x20object\x20or\x20null','Item\x20','notification_config_json_invalid','notification_config_field_invalid','stringify','file\x20','\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.','\x20characters.','589471fntJlx','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20'];a139_0x32bf=function(){return _0x266aa5;};return a139_0x32bf();}const a139_0x2443f0=a139_0x5a80;(function(_0x5269fb,_0x3466dd){const _0x345c25=a139_0x5a80,_0x11dc5a=_0x5269fb();while(!![]){try{const _0x163184=parseInt(_0x345c25(0x1fd))/0x1*(-parseInt(_0x345c25(0x1f4))/0x2)+parseInt(_0x345c25(0x1e4))/0x3*(parseInt(_0x345c25(0x1c0))/0x4)+-parseInt(_0x345c25(0x1bb))/0x5*(parseInt(_0x345c25(0x1b6))/0x6)+parseInt(_0x345c25(0x19a))/0x7+-parseInt(_0x345c25(0x1e5))/0x8*(parseInt(_0x345c25(0x1af))/0x9)+-parseInt(_0x345c25(0x19c))/0xa*(parseInt(_0x345c25(0x194))/0xb)+parseInt(_0x345c25(0x1b9))/0xc*(parseInt(_0x345c25(0x19e))/0xd);if(_0x163184===_0x3466dd)break;else _0x11dc5a['push'](_0x11dc5a['shift']());}catch(_0x21af63){_0x11dc5a['push'](_0x11dc5a['shift']());}}}(a139_0x32bf,0x4ddf9));import{readFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getNotificationChannelConfig}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';export const NOTIFICATION_CHANNEL_TYPES=[a139_0x2443f0(0x197),a139_0x2443f0(0x1bc),'DINGTALK',a139_0x2443f0(0x199),a139_0x2443f0(0x1e0)];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a139_0x2443f0(0x1be),a139_0x2443f0(0x1e8),'endpointUrl',a139_0x2443f0(0x18d),'description',a139_0x2443f0(0x1a2),a139_0x2443f0(0x1df)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a139_0x2443f0(0x184),a139_0x2443f0(0x1b3),'channelCode']),EMAIL_RECIPIENT_FIELDS=new Set([a139_0x2443f0(0x1e6),a139_0x2443f0(0x1b0),a139_0x2443f0(0x1c3),a139_0x2443f0(0x1db),a139_0x2443f0(0x1d1),a139_0x2443f0(0x1a0),a139_0x2443f0(0x1ec),'to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a139_0x2443f0(0x1cd),'type':a139_0x2443f0(0x1c7),'required':![],'description':a139_0x2443f0(0x1b7)},{'name':a139_0x2443f0(0x1ce),'type':a139_0x2443f0(0x1bd),'required':![],'default':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin'},{'name':a139_0x2443f0(0x1cf),'type':a139_0x2443f0(0x1c7),'required':![],'description':a139_0x2443f0(0x1d4)}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a139_0x2443f0(0x1e2),'required':!![],'description':a139_0x2443f0(0x18a)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x261103,_0x3d4e59,_0x48c32c){return new CliError(_0x261103,0x1,_0x3d4e59,_0x48c32c);}export function readNotificationId(_0x240a55){const _0x49a98a=a139_0x2443f0,_0x79a1ef=_0x240a55['num']('id');if(!Number['isSafeInteger'](_0x79a1ef)||_0x79a1ef<=0x0)throw notificationError(_0x49a98a(0x1cc),_0x49a98a(0x1a3));return _0x79a1ef;}export function requireNotificationExplicitYes(_0x1e93c7){const _0x1d3a0e=a139_0x2443f0;if(_0x1e93c7['bool'](_0x1d3a0e(0x1e3))||_0x1e93c7[_0x1d3a0e(0x182)]('yes'))return;throw notificationError(_0x1d3a0e(0x1c4),_0x1d3a0e(0x1d6),'Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.');}export function readNotificationChannelType(_0x1c8cec,_0x28cac8='type',_0x2dd670='EMAIL'){const _0x8fb43e=a139_0x2443f0,_0x13e450=_0x1c8cec['str'](_0x28cac8)[_0x8fb43e(0x1ac)]()||_0x2dd670;if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0x13e450))throw CliErrors['validation'](_0x8fb43e(0x1c1)+_0x28cac8+':\x20'+_0x13e450,'Allowed\x20values:\x20'+NOTIFICATION_CHANNEL_TYPES[_0x8fb43e(0x18c)](',\x20')+'.');return _0x13e450;}export function assertSingleNotificationSource(_0x1eb12b){const _0x593915=a139_0x2443f0,_0x4294df=[],_0x49f2c9=_0x1eb12b[_0x593915(0x1d8)](_0x593915(0x1cd))['trim']();if(_0x49f2c9)_0x4294df['push']({'kind':'file','path':_0x49f2c9});if(_0x1eb12b[_0x593915(0x182)](_0x593915(0x1ce)))_0x4294df[_0x593915(0x1de)]({'kind':_0x593915(0x1ce)});const _0x3636f4=_0x1eb12b[_0x593915(0x1d8)](_0x593915(0x1cf))[_0x593915(0x1ac)]();if(_0x3636f4)_0x4294df['push']({'kind':_0x593915(0x1a7),'name':_0x3636f4});if(_0x4294df[_0x593915(0x19f)]===0x0)throw CliErrors['validation']('Missing\x20notification\x20JSON\x20source.','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.');if(_0x4294df[_0x593915(0x19f)]>0x1)throw CliErrors[_0x593915(0x1ca)]('Notification\x20JSON\x20source\x20is\x20ambiguous.',_0x593915(0x1fe));return _0x4294df[0x0];}export async function readNotificationDocument(_0x2f0bd0,_0x42e085){const _0x12f5ab=a139_0x2443f0,_0x576583=assertSingleNotificationSource(_0x2f0bd0),_0x54f165=_0x576583[_0x12f5ab(0x1d3)]==='file'?_0x12f5ab(0x1fa)+_0x576583['path']:_0x576583[_0x12f5ab(0x1d3)]==='env'?_0x12f5ab(0x1c8)+_0x576583[_0x12f5ab(0x1c2)]:_0x12f5ab(0x1ce);let _0x1f893c;try{if(_0x576583[_0x12f5ab(0x1d3)]===_0x12f5ab(0x1cd))_0x1f893c=await readFile(_0x576583[_0x12f5ab(0x1ea)],'utf8');else{if(_0x576583['kind']==='env'){if(!(_0x576583[_0x12f5ab(0x1c2)]in process.env))throw notificationError(_0x12f5ab(0x186),_0x12f5ab(0x1ae)+_0x576583['name']);_0x1f893c=process.env[_0x576583.name]??'';}else _0x1f893c=await readStdin();}}catch(_0x208b14){if(_0x208b14 instanceof CliError)throw _0x208b14;throw notificationError('notification_config_source_unavailable',_0x12f5ab(0x18f)+_0x54f165+'.');}let _0x52dbb2;try{_0x52dbb2=JSON[_0x12f5ab(0x185)](_0x1f893c);}catch{throw notificationError(_0x12f5ab(0x1f7),_0x12f5ab(0x192)+_0x54f165+_0x12f5ab(0x1da),_0x12f5ab(0x1ad));}if(!isJsonObject(_0x52dbb2))throw notificationError(_0x12f5ab(0x1f7),_0x12f5ab(0x192)+_0x54f165+'\x20must\x20be\x20an\x20object.');return validateNotificationDocument(_0x52dbb2,_0x42e085);}export function projectNotificationListConfig(_0x3c7479,_0x174598){const _0x108624=a139_0x2443f0;return{'id':typeof _0x3c7479['id']==='number'?_0x3c7479['id']:null,'configCode':requireResponseString(_0x3c7479[_0x108624(0x1b3)],_0x108624(0x1b3),_0x174598),'configName':requireResponseString(_0x3c7479['configName'],_0x108624(0x1be),_0x174598),'channelType':requireResponseString(_0x3c7479['channelType'],'channelType',_0x174598),'description':normalizeNullableString(_0x3c7479[_0x108624(0x1ba)]),'createTime':normalizeNullableString(_0x3c7479['createTime']),'updateTime':normalizeNullableString(_0x3c7479[_0x108624(0x1ab)])};}function a139_0x5a80(_0x44681a,_0x3a26a3){_0x44681a=_0x44681a-0x181;const _0x32bf98=a139_0x32bf();let _0x5a8004=_0x32bf98[_0x44681a];return _0x5a8004;}export function normalizeExactNotificationConfig(_0x4aed4f,_0x246a93,_0x1bd790){const _0x4c160c=a139_0x2443f0;if(!Number[_0x4c160c(0x1f3)](_0x4aed4f['id'])||_0x4aed4f['id']!==_0x246a93)throw notificationError('notification_config_response_invalid',_0x4c160c(0x1ff)+_0x246a93+'.');if(_0x4aed4f[_0x4c160c(0x184)]!==_0x1bd790)throw notificationError('notification_config_response_invalid',_0x4c160c(0x1e1)+_0x246a93+_0x4c160c(0x1eb));const _0x81a095=requireExactString(_0x4aed4f['configName'],_0x4c160c(0x1be),_0x246a93),_0x5bc9d5=requireExactString(_0x4aed4f[_0x4c160c(0x1b3)],'configCode',_0x246a93),_0x4854ac=requireExactString(_0x4aed4f[_0x4c160c(0x1e8)],_0x4c160c(0x1e8),_0x246a93);if(!NOTIFICATION_CHANNEL_TYPES[_0x4c160c(0x1b2)](_0x4854ac))throw notificationError(_0x4c160c(0x1c5),_0x4c160c(0x1e1)+_0x246a93+_0x4c160c(0x18b));const _0x1eef81=responseNullableString(_0x4aed4f['endpointUrl'],'endpointUrl',_0x246a93),_0x3647a2=responseNullableString(_0x4aed4f[_0x4c160c(0x18d)],_0x4c160c(0x18d),_0x246a93),_0x2cf36f=responseNullableString(_0x4aed4f['description'],_0x4c160c(0x1ba),_0x246a93),_0x30f929=responseNullableTimeout(_0x4aed4f['connectTimeout'],_0x4c160c(0x1a2),_0x246a93),_0x588d6d=responseNullableTimeout(_0x4aed4f[_0x4c160c(0x1df)],_0x4c160c(0x1df),_0x246a93);return{'id':_0x246a93,'appCode':_0x1bd790,'configCode':_0x5bc9d5,'configName':_0x81a095,'channelType':_0x4854ac,'endpointUrl':redactSensitive(_0x1eef81),'channelConfig':redactSensitive(_0x3647a2),'description':_0x2cf36f,'connectTimeout':_0x30f929,'readTimeout':_0x588d6d,'endpointUrlRaw':_0x1eef81,'channelConfigRaw':_0x3647a2};}export async function requireExactNotificationConfig(_0x3ea000,_0x4dbe7a,_0x6f4a3f){const _0x4f42fa=a139_0x2443f0;let _0x5465e3;try{_0x5465e3=await getNotificationChannelConfig(_0x4dbe7a,_0x3ea000);}catch{throw safeApiFailure(_0x6f4a3f,_0x4f42fa(0x181),_0x4f42fa(0x19b)+_0x3ea000+'\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.');}return normalizeExactNotificationConfig(_0x5465e3,_0x4dbe7a,_0x3ea000);}export function projectNotificationConfig(_0x1b5a29){const _0x257a4b=a139_0x2443f0;return{'id':_0x1b5a29['id']??null,'appCode':_0x1b5a29[_0x257a4b(0x184)],'configCode':_0x1b5a29[_0x257a4b(0x1b3)]??null,'configName':_0x1b5a29[_0x257a4b(0x1be)],'channelType':_0x1b5a29[_0x257a4b(0x1e8)],'endpointUrl':redactSensitive(_0x1b5a29[_0x257a4b(0x200)]),'channelConfig':redactSensitive(_0x1b5a29[_0x257a4b(0x18d)]),'description':_0x1b5a29[_0x257a4b(0x1ba)]??null,'connectTimeout':_0x1b5a29[_0x257a4b(0x1a2)]??null,'readTimeout':_0x1b5a29['readTimeout']??null};}export function notificationSelector(_0x133d39){const _0x322c00=a139_0x2443f0;return{'appCode':_0x133d39['appCode'],'id':_0x133d39['id'],'configCode':_0x133d39[_0x322c00(0x1b3)],'configName':_0x133d39[_0x322c00(0x1be)],'channelType':_0x133d39[_0x322c00(0x1e8)]};}export function createMutationInput(_0x13f71d,_0x6e34e9){const _0x1e2af5=a139_0x2443f0;return{'appCode':_0x13f71d,'configName':_0x6e34e9['configName'],'channelType':_0x6e34e9['channelType'],...hasOwn(_0x6e34e9,'endpointUrl')?{'endpointUrl':_0x6e34e9[_0x1e2af5(0x200)]}:{},...hasOwn(_0x6e34e9,_0x1e2af5(0x18d))?{'channelConfig':serializeChannelConfig(_0x6e34e9[_0x1e2af5(0x18d)])}:{},...hasOwn(_0x6e34e9,_0x1e2af5(0x1ba))?{'description':_0x6e34e9['description']}:{},...hasOwn(_0x6e34e9,_0x1e2af5(0x1a2))?{'connectTimeout':_0x6e34e9[_0x1e2af5(0x1a2)]}:{},...hasOwn(_0x6e34e9,'readTimeout')?{'readTimeout':_0x6e34e9[_0x1e2af5(0x1df)]}:{}};}export function mergeUpdateInput(_0x1ec94c,_0x57a9ca){const _0x4e6f07=a139_0x2443f0;return{'id':_0x1ec94c['id'],'appCode':_0x1ec94c[_0x4e6f07(0x184)],'configName':_0x57a9ca['configName']??_0x1ec94c[_0x4e6f07(0x1be)],'channelType':_0x57a9ca[_0x4e6f07(0x1e8)]??_0x1ec94c[_0x4e6f07(0x1e8)],'endpointUrl':hasOwn(_0x57a9ca,'endpointUrl')?_0x57a9ca[_0x4e6f07(0x200)]:_0x1ec94c[_0x4e6f07(0x1bf)],'channelConfig':hasOwn(_0x57a9ca,_0x4e6f07(0x18d))?serializeChannelConfig(_0x57a9ca[_0x4e6f07(0x18d)]):_0x1ec94c[_0x4e6f07(0x1b4)],'description':hasOwn(_0x57a9ca,'description')?_0x57a9ca[_0x4e6f07(0x1ba)]:_0x1ec94c['description'],'connectTimeout':hasOwn(_0x57a9ca,_0x4e6f07(0x1a2))?_0x57a9ca['connectTimeout']:_0x1ec94c['connectTimeout'],'readTimeout':hasOwn(_0x57a9ca,_0x4e6f07(0x1df))?_0x57a9ca[_0x4e6f07(0x1df)]:_0x1ec94c[_0x4e6f07(0x1df)]};}export function plannedUpdateProjection(_0x514ba3,_0x14b14e){const _0x1fecab=a139_0x2443f0;return projectNotificationConfig({'id':_0x514ba3['id'],'appCode':_0x514ba3[_0x1fecab(0x184)],'configCode':_0x514ba3[_0x1fecab(0x1b3)],'configName':_0x14b14e[_0x1fecab(0x1be)]??_0x514ba3['configName'],'channelType':_0x14b14e[_0x1fecab(0x1e8)]??_0x514ba3[_0x1fecab(0x1e8)],'endpointUrl':hasOwn(_0x14b14e,'endpointUrl')?_0x14b14e[_0x1fecab(0x200)]:_0x514ba3[_0x1fecab(0x1bf)],'channelConfig':hasOwn(_0x14b14e,_0x1fecab(0x18d))?_0x14b14e[_0x1fecab(0x18d)]:_0x514ba3[_0x1fecab(0x1b4)],'description':hasOwn(_0x14b14e,_0x1fecab(0x1ba))?_0x14b14e[_0x1fecab(0x1ba)]:_0x514ba3[_0x1fecab(0x1ba)],'connectTimeout':hasOwn(_0x14b14e,_0x1fecab(0x1a2))?_0x14b14e['connectTimeout']??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x514ba3[_0x1fecab(0x1a2)],'readTimeout':hasOwn(_0x14b14e,_0x1fecab(0x1df))?_0x14b14e[_0x1fecab(0x1df)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x514ba3[_0x1fecab(0x1df)]});}export function requestedSafeFieldsMatch(_0x115c80,_0x3ccf1e,_0x5126c9){const _0x16afea=a139_0x2443f0,_0x5660de=[],_0x5398b6=[],_0x582728=[];for(const _0x16156c of['configName',_0x16afea(0x1e8),_0x16afea(0x1ba)]){if(!hasOwn(_0x5126c9,_0x16156c))continue;_0x582728[_0x16afea(0x1de)](_0x16156c),_0x5660de[_0x16afea(0x1de)](_0x3ccf1e[_0x16156c]===_0x5126c9[_0x16156c]),_0x5398b6[_0x16afea(0x1de)](_0x115c80[_0x16156c]!==_0x5126c9[_0x16156c]&&_0x3ccf1e[_0x16156c]===_0x5126c9[_0x16156c]);}for(const _0x18fa33 of[_0x16afea(0x1a2),_0x16afea(0x1df)]){if(!hasOwn(_0x5126c9,_0x18fa33))continue;const _0x4e2dff=_0x5126c9[_0x18fa33]??(_0x18fa33==='connectTimeout'?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0x582728[_0x16afea(0x1de)](_0x18fa33),_0x5660de[_0x16afea(0x1de)](_0x3ccf1e[_0x18fa33]===_0x4e2dff),_0x5398b6[_0x16afea(0x1de)](_0x115c80[_0x18fa33]!==_0x4e2dff&&_0x3ccf1e[_0x18fa33]===_0x4e2dff);}return hasOwn(_0x5126c9,'endpointUrl')&&_0x5126c9[_0x16afea(0x200)]===null&&(_0x582728[_0x16afea(0x1de)](_0x16afea(0x1f0)),_0x5660de['push'](_0x3ccf1e[_0x16afea(0x1bf)]===null||_0x3ccf1e[_0x16afea(0x1bf)]===''),_0x5398b6[_0x16afea(0x1de)](_0x115c80['endpointUrlRaw']!==null&&_0x115c80[_0x16afea(0x1bf)]!==''&&(_0x3ccf1e[_0x16afea(0x1bf)]===null||_0x3ccf1e[_0x16afea(0x1bf)]===''))),{'allMatch':_0x5660de[_0x16afea(0x1c9)](Boolean),'provesChange':_0x5398b6[_0x16afea(0x1d5)](Boolean),'verifiedFields':_0x582728};}export function validateNotificationDeleteReadback(_0x302819,_0x34d866,_0x4b0678){const _0x343591=a139_0x2443f0;for(const [_0xb8fa1f,_0xb45013]of _0x302819['entries']()){if(!Number[_0x343591(0x1f3)](_0xb45013['id'])||_0xb45013['id']<=0x0)throw notificationError(_0x343591(0x1c5),'Notification\x20config\x20list\x20item\x20'+(_0xb8fa1f+0x1)+'\x20has\x20an\x20invalid\x20id.');if(_0xb45013[_0x343591(0x184)]!==_0x34d866)throw notificationError(_0x343591(0x1c5),_0x343591(0x191)+(_0xb8fa1f+0x1)+'\x20has\x20an\x20invalid\x20appCode.');if(_0xb45013['channelType']!==_0x4b0678)throw notificationError(_0x343591(0x1c5),'Notification\x20config\x20list\x20item\x20'+(_0xb8fa1f+0x1)+'\x20has\x20an\x20invalid\x20channelType.');}}export function safeApiFailure(_0x1c65cd,_0x552970,_0x4a7fae){const _0x469a12=a139_0x2443f0;return notificationError(_0x469a12(0x1ed)+_0x1c65cd+'_'+(_0x552970==='mutation'?_0x469a12(0x190):_0x552970+_0x469a12(0x1a4)),_0x469a12(0x1e1)+_0x1c65cd+'\x20'+_0x552970+_0x469a12(0x187),_0x4a7fae);}export function notificationLookupCommand(_0x5408f7,_0x1bc00a){const _0x2b114e=a139_0x2443f0;return'rabetbase\x20notification\x20config-list\x20--appcode\x20'+_0x5408f7+'\x20--type\x20'+_0x1bc00a+_0x2b114e(0x1dd);}function validateNotificationDocument(_0x1a392d,_0x179304){const _0x150940=a139_0x2443f0;for(const _0x38d2bf of Object[_0x150940(0x1ee)](_0x1a392d)){if(FORBIDDEN_IDENTITY_FIELDS[_0x150940(0x1d7)](_0x38d2bf))throw notificationError(_0x150940(0x1c6),_0x150940(0x1b5)+_0x38d2bf+_0x150940(0x189));if(!ALLOWED_INPUT_FIELDS[_0x150940(0x1d7)](_0x38d2bf))throw notificationError(_0x150940(0x1d9),'Unknown\x20notification\x20JSON\x20field\x20\x22'+_0x38d2bf+'\x22.');}if(_0x179304===_0x150940(0x196)&&Object['keys'](_0x1a392d)[_0x150940(0x19f)]===0x0)throw notificationError('notification_config_update_empty','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.');const _0x2dac7f={};if(hasOwn(_0x1a392d,_0x150940(0x1be)))_0x2dac7f[_0x150940(0x1be)]=validateRequiredString(_0x1a392d['configName'],_0x150940(0x1be),0x80);else{if(_0x179304===_0x150940(0x1f2))throw notificationError('notification_config_field_required',_0x150940(0x1cb)+_0x150940(0x1d2));}if(hasOwn(_0x1a392d,_0x150940(0x1e8))){if(typeof _0x1a392d[_0x150940(0x1e8)]!=='string')throw invalidFieldType(_0x150940(0x1e8),_0x150940(0x1ef));const _0x4d8e89=_0x1a392d['channelType'][_0x150940(0x1ac)]();if(!NOTIFICATION_CHANNEL_TYPES['includes'](_0x4d8e89))throw notificationError(_0x150940(0x1f8),_0x150940(0x198),_0x150940(0x1b8)+NOTIFICATION_CHANNEL_TYPES[_0x150940(0x18c)](',\x20')+'.');_0x2dac7f['channelType']=_0x4d8e89;}else{if(_0x179304===_0x150940(0x1f2))throw notificationError(_0x150940(0x1a8),_0x150940(0x1cb)+'\x22channelType\x22.');}for(const [_0x191787,_0x29e184]of[['endpointUrl',0x200],[_0x150940(0x1ba),0x100]]){if(!hasOwn(_0x1a392d,_0x191787))continue;const _0x22bf05=_0x1a392d[_0x191787];if(_0x22bf05!==null&&typeof _0x22bf05!==_0x150940(0x1c7))throw invalidFieldType(_0x191787,_0x150940(0x19d));if(typeof _0x22bf05==='string'&&_0x22bf05[_0x150940(0x19f)]>_0x29e184)throw notificationError('notification_config_field_invalid',_0x150940(0x1b5)+_0x191787+_0x150940(0x1a1)+_0x29e184+_0x150940(0x1fc));_0x2dac7f[_0x191787]=_0x22bf05;}if(hasOwn(_0x1a392d,_0x150940(0x18d))){const _0x1387e2=_0x1a392d[_0x150940(0x18d)];if(_0x1387e2===null&&_0x179304===_0x150940(0x1f2))throw invalidFieldType(_0x150940(0x18d),_0x150940(0x18e));if(_0x1387e2!==null&&!isJsonObject(_0x1387e2))throw invalidFieldType(_0x150940(0x18d),_0x179304===_0x150940(0x196)?_0x150940(0x1f5):_0x150940(0x18e));_0x1387e2!==null&&validateChannelConfigFields(_0x2dac7f[_0x150940(0x1e8)],_0x1387e2),_0x2dac7f[_0x150940(0x18d)]=_0x1387e2;}for(const _0x562c00 of[_0x150940(0x1a2),_0x150940(0x1df)]){if(!hasOwn(_0x1a392d,_0x562c00))continue;const _0x551467=_0x1a392d[_0x562c00];if(_0x551467!==null&&(!Number['isSafeInteger'](_0x551467)||_0x551467<0x0))throw notificationError(_0x150940(0x1f8),_0x150940(0x1b5)+_0x562c00+_0x150940(0x1fb));_0x2dac7f[_0x562c00]=_0x551467;}return _0x2dac7f;}function validateRequiredString(_0x2ec435,_0x3be8d7,_0x2c7bfd){const _0x429d70=a139_0x2443f0;if(typeof _0x2ec435!==_0x429d70(0x1c7))throw invalidFieldType(_0x3be8d7,_0x429d70(0x1b1));const _0x12347e=_0x2ec435[_0x429d70(0x1ac)]();if(!_0x12347e)throw notificationError(_0x429d70(0x1f8),_0x429d70(0x1b5)+_0x3be8d7+_0x429d70(0x195));if(_0x12347e['length']>_0x2c7bfd)throw notificationError('notification_config_field_invalid',_0x429d70(0x1b5)+_0x3be8d7+'\x22\x20cannot\x20exceed\x20'+_0x2c7bfd+_0x429d70(0x1fc));return _0x12347e;}function validateChannelConfigFields(_0x40913e,_0x5cfbfc){const _0x3b51d4=a139_0x2443f0;if(hasOwn(_0x5cfbfc,_0x3b51d4(0x193)))throw forbiddenChannelConfigField(_0x3b51d4(0x193));if(_0x40913e===_0x3b51d4(0x197))for(const _0x564d48 of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x5cfbfc,_0x564d48))throw forbiddenChannelConfigField(_0x564d48);}}function forbiddenChannelConfigField(_0x8a52d5){const _0x1334f0=a139_0x2443f0;return notificationError(_0x1334f0(0x1aa),_0x1334f0(0x188)+_0x8a52d5+_0x1334f0(0x1dc));}function invalidFieldType(_0x60e059,_0x37ca4a){const _0x121ef3=a139_0x2443f0;return notificationError('notification_config_field_invalid',_0x121ef3(0x1b5)+_0x60e059+_0x121ef3(0x1e9)+_0x37ca4a+'.');}function serializeChannelConfig(_0x248c0e){const _0x4efc6c=a139_0x2443f0;return _0x248c0e===null||_0x248c0e===undefined?null:JSON[_0x4efc6c(0x1f9)](_0x248c0e);}function redactSensitive(_0x2b391c){const _0x2b96fe=a139_0x2443f0;return _0x2b391c===null||_0x2b391c===undefined||_0x2b391c===''?null:_0x2b96fe(0x201);}function requireResponseString(_0x5dd21d,_0x1dc19a,_0x5176b3){const _0x21f788=a139_0x2443f0;if(typeof _0x5dd21d!==_0x21f788(0x1c7)||_0x5dd21d[_0x21f788(0x1ac)]()==='')throw CliErrors['apiError'](_0x21f788(0x1f1),_0x21f788(0x1f6)+(_0x5176b3+0x1)+_0x21f788(0x1a5)+_0x1dc19a+'\x22.');return _0x5dd21d[_0x21f788(0x1ac)]();}function requireExactString(_0x1ae65e,_0x28eb67,_0x27f18b){const _0x5a24a4=a139_0x2443f0;if(typeof _0x1ae65e!==_0x5a24a4(0x1c7)||_0x1ae65e[_0x5a24a4(0x1ac)]()==='')throw notificationError('notification_config_response_invalid',_0x5a24a4(0x1e1)+_0x27f18b+'\x20is\x20missing\x20required\x20field\x20\x22'+_0x28eb67+'\x22.');return _0x1ae65e[_0x5a24a4(0x1ac)]();}function responseNullableString(_0x32edff,_0x19f33a,_0x4ed383){const _0x2a73e6=a139_0x2443f0;if(_0x32edff===undefined||_0x32edff===null)return null;if(typeof _0x32edff!==_0x2a73e6(0x1c7))throw notificationError(_0x2a73e6(0x1c5),_0x2a73e6(0x1e1)+_0x4ed383+_0x2a73e6(0x1a6)+_0x19f33a+'\x22.');return _0x32edff;}function responseNullableTimeout(_0xb38654,_0x384edd,_0x4af284){const _0x1a0bad=a139_0x2443f0;if(_0xb38654===undefined||_0xb38654===null)return null;if(!Number[_0x1a0bad(0x1f3)](_0xb38654)||_0xb38654<0x0)throw notificationError(_0x1a0bad(0x1c5),'Notification\x20config\x20'+_0x4af284+'\x20has\x20invalid\x20field\x20\x22'+_0x384edd+'\x22.');return _0xb38654;}function normalizeNullableString(_0x493da3){const _0x351a7c=a139_0x2443f0;return typeof _0x493da3===_0x351a7c(0x1c7)?_0x493da3:null;}function isJsonObject(_0x19e165){return _0x19e165!==null&&typeof _0x19e165==='object'&&!Array['isArray'](_0x19e165);}function hasOwn(_0x36652a,_0x48ae04){const _0x30022c=a139_0x2443f0;return Object[_0x30022c(0x1d0)][_0x30022c(0x1e7)][_0x30022c(0x1a9)](_0x36652a,_0x48ae04);}async function readStdin(){const _0x43bc2d=a139_0x2443f0;let _0x7df7d8='';process[_0x43bc2d(0x1ce)][_0x43bc2d(0x183)]('utf8');for await(const _0x4762a4 of process[_0x43bc2d(0x1ce)])_0x7df7d8+=_0x4762a4;return _0x7df7d8;}
1
+ const a140_0x97c5c4=a140_0x1d43;(function(_0x3f678e,_0x312b56){const _0x116e50=a140_0x1d43,_0x2e2d7e=_0x3f678e();while(!![]){try{const _0xb94645=parseInt(_0x116e50(0x17b))/0x1*(parseInt(_0x116e50(0x1b8))/0x2)+parseInt(_0x116e50(0x1aa))/0x3+-parseInt(_0x116e50(0x1b0))/0x4*(parseInt(_0x116e50(0x18c))/0x5)+parseInt(_0x116e50(0x17d))/0x6+parseInt(_0x116e50(0x1e4))/0x7*(-parseInt(_0x116e50(0x1af))/0x8)+parseInt(_0x116e50(0x1f2))/0x9+-parseInt(_0x116e50(0x1a8))/0xa;if(_0xb94645===_0x312b56)break;else _0x2e2d7e['push'](_0x2e2d7e['shift']());}catch(_0x5d94ad){_0x2e2d7e['push'](_0x2e2d7e['shift']());}}}(a140_0x1da8,0x7bba2));import{readFile}from'node:fs/promises';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{getNotificationChannelConfig}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';function a140_0x1da8(){const _0x1c6eca=['Item\x20','num','isSafeInteger','1193330vEQTjb','\x22\x20cannot\x20exceed\x20','55068iWDJoQ','Read\x20the\x20notification\x20JSON\x20document\x20from\x20stdin','Notification\x20JSON\x20from\x20','kind','emailTargets','8kGGYtc','9600AsHtoB','notification_config_confirmation_required','stdin','FEISHU','Create\x20JSON\x20requires\x20field\x20','a\x20supported\x20string','createTime','This\x20notification\x20config\x20mutation\x20requires\x20explicit\x20--yes.','2KUnQOe','join','\x20is\x20invalid.','\x20has\x20an\x20invalid\x20appCode.','<redacted>','notification_config_field_forbidden','from-env','\x20has\x20an\x20unsupported\x20channelType.','apiError','\x20has\x20an\x20invalid\x20channelType.','path','\x20characters.','Run\x20the\x20command\x20with\x20--dry-run\x20first,\x20then\x20add\x20--yes\x20after\x20reviewing\x20the\x20plan.','update','appCode','messageTemplate','a\x20JSON\x20object\x20or\x20null','Notification\x20config\x20list\x20item\x20','notification_config_field_invalid','\x22\x20must\x20be\x20a\x20non-empty\x20string.','rabetbase\x20notification\x20config-list\x20--appcode\x20','Notification\x20JSON\x20source\x20is\x20ambiguous.','notification_config_response_invalid','number','Notification\x20JSON\x20field\x20\x22','endpointUrlRaw','Application-level\x20notification\x20config\x20ID','utf8','env','channelConfig','connectTimeout','configCode','length','stringify','\x22\x20is\x20forbidden.','includes','fromName','subjectPrefix','entries','WECOM','\x22configName\x22.','Allowed\x20values:\x20','notification_config_json_invalid','\x22\x20must\x20be\x20','4627343QAIuEP','_unavailable','Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20UTF-8\x20file','\x22\x20is\x20controlled\x20by\x20the\x20CLI\x20or\x20server\x20and\x20is\x20forbidden.','name','Inspect\x20with\x20rabetbase\x20notification\x20config-list\x20--appcode\x20','channelConfigRaw','channelType','\x20--format\x20compress','Invalid\x20notification\x20config\x20response.','Update\x20JSON\x20must\x20contain\x20at\x20least\x20one\x20allowed\x20field.','every','a\x20string\x20or\x20null','mutation','4926375aBnIGd','\x20--type\x20','ccList','\x20--type\x20<CHANNEL_TYPE>\x20--format\x20compress;\x20no\x20mutation\x20was\x20submitted.','\x20is\x20missing\x20required\x20field\x20\x22','setEncoding','bccList','string','validation','notification_config_id_invalid','object','--id\x20must\x20be\x20a\x20positive\x20safe\x20integer.','has','135829oxCbIb','DINGTALK','5745648PwniAu','keys','trim','type','hasOwnProperty','Invalid\x20--','notification_config_channel_field_forbidden','Unable\x20to\x20read\x20notification\x20JSON\x20from\x20','endpointUrl','updateTime','notification_config_','push','a\x20non-empty\x20string','configName','\x20has\x20an\x20invalid\x20id.','775WbDgxk','EMAIL','Notification\x20JSON\x20field\x20\x22channelType\x22\x20is\x20unsupported.','Notification\x20config\x20detail\x20did\x20not\x20contain\x20the\x20requested\x20ID\x20','bool','\x20has\x20invalid\x20field\x20\x22','failed','replyTo','create','readTimeout','notification_config_field_required','a\x20JSON\x20object','recipients','notification_config_source_unavailable','notification_config_field_unknown','environment\x20variable\x20','preflight','Use\x20exactly\x20one\x20of\x20--file\x20<path>,\x20--stdin,\x20or\x20--from-env\x20<NAME>.','file','Unknown\x20notification\x20JSON\x20field\x20\x22','description','some','\x20does\x20not\x20belong\x20to\x20the\x20resolved\x20app.','str','Notification\x20config\x20'];a140_0x1da8=function(){return _0x1c6eca;};return a140_0x1da8();}export const NOTIFICATION_CHANNEL_TYPES=[a140_0x97c5c4(0x18d),a140_0x97c5c4(0x1b3),a140_0x97c5c4(0x17c),a140_0x97c5c4(0x1df),'WEBHOOK'];export const DEFAULT_NOTIFICATION_CONNECT_TIMEOUT=0x1388;export const DEFAULT_NOTIFICATION_READ_TIMEOUT=0x2710;const ALLOWED_INPUT_FIELDS=new Set([a140_0x97c5c4(0x18a),a140_0x97c5c4(0x1eb),a140_0x97c5c4(0x185),'channelConfig',a140_0x97c5c4(0x1a0),a140_0x97c5c4(0x1d6),a140_0x97c5c4(0x195)]),FORBIDDEN_IDENTITY_FIELDS=new Set(['id',a140_0x97c5c4(0x1c6),a140_0x97c5c4(0x1d7),'channelCode']),EMAIL_RECIPIENT_FIELDS=new Set([a140_0x97c5c4(0x1ae),a140_0x97c5c4(0x198),a140_0x97c5c4(0x170),a140_0x97c5c4(0x174),a140_0x97c5c4(0x193),a140_0x97c5c4(0x1dd),a140_0x97c5c4(0x1dc),'to','cc']);export const NOTIFICATION_INPUT_FLAGS=[{'name':a140_0x97c5c4(0x19e),'type':a140_0x97c5c4(0x175),'required':![],'description':a140_0x97c5c4(0x1e6)},{'name':'stdin','type':'boolean','required':![],'default':![],'description':a140_0x97c5c4(0x1ab)},{'name':'from-env','type':a140_0x97c5c4(0x175),'required':![],'description':'Read\x20the\x20notification\x20JSON\x20document\x20from\x20a\x20named\x20environment\x20variable'}];export const NOTIFICATION_ID_FLAG={'name':'id','type':a140_0x97c5c4(0x1cf),'required':!![],'description':a140_0x97c5c4(0x1d2)};export const NOTIFICATION_APP_FLAG=APPCODE_FLAG_OPTIONAL;export function notificationError(_0x45b488,_0x345f8a,_0x41454a){return new CliError(_0x45b488,0x1,_0x345f8a,_0x41454a);}export function readNotificationId(_0x46addf){const _0x3220cf=a140_0x97c5c4,_0x3d801a=_0x46addf[_0x3220cf(0x1a6)]('id');if(!Number[_0x3220cf(0x1a7)](_0x3d801a)||_0x3d801a<=0x0)throw notificationError(_0x3220cf(0x177),_0x3220cf(0x179));return _0x3d801a;}export function requireNotificationExplicitYes(_0x26fc24){const _0x7864e7=a140_0x97c5c4;if(_0x26fc24[_0x7864e7(0x190)]('dry-run')||_0x26fc24['bool']('yes'))return;throw notificationError(_0x7864e7(0x1b1),_0x7864e7(0x1b7),_0x7864e7(0x1c4));}export function readNotificationChannelType(_0x5109d1,_0xebfd5f=a140_0x97c5c4(0x180),_0x3a5127=a140_0x97c5c4(0x18d)){const _0xee53ea=a140_0x97c5c4,_0x56b9a9=_0x5109d1[_0xee53ea(0x1a3)](_0xebfd5f)[_0xee53ea(0x17f)]()||_0x3a5127;if(!NOTIFICATION_CHANNEL_TYPES[_0xee53ea(0x1db)](_0x56b9a9))throw CliErrors[_0xee53ea(0x176)](_0xee53ea(0x182)+_0xebfd5f+':\x20'+_0x56b9a9,_0xee53ea(0x1e1)+NOTIFICATION_CHANNEL_TYPES[_0xee53ea(0x1b9)](',\x20')+'.');return _0x56b9a9;}export function assertSingleNotificationSource(_0xdfc05b){const _0x5d274b=a140_0x97c5c4,_0x4bf1e7=[],_0x3c6dd0=_0xdfc05b['str'](_0x5d274b(0x19e))[_0x5d274b(0x17f)]();if(_0x3c6dd0)_0x4bf1e7[_0x5d274b(0x188)]({'kind':_0x5d274b(0x19e),'path':_0x3c6dd0});if(_0xdfc05b[_0x5d274b(0x190)](_0x5d274b(0x1b2)))_0x4bf1e7[_0x5d274b(0x188)]({'kind':_0x5d274b(0x1b2)});const _0x4bc70e=_0xdfc05b[_0x5d274b(0x1a3)](_0x5d274b(0x1be))[_0x5d274b(0x17f)]();if(_0x4bc70e)_0x4bf1e7[_0x5d274b(0x188)]({'kind':'env','name':_0x4bc70e});if(_0x4bf1e7[_0x5d274b(0x1d8)]===0x0)throw CliErrors['validation']('Missing\x20notification\x20JSON\x20source.',_0x5d274b(0x19d));if(_0x4bf1e7['length']>0x1)throw CliErrors[_0x5d274b(0x176)](_0x5d274b(0x1cd),_0x5d274b(0x19d));return _0x4bf1e7[0x0];}export async function readNotificationDocument(_0x148c1e,_0x3f304a){const _0x3b138c=a140_0x97c5c4,_0x2733b3=assertSingleNotificationSource(_0x148c1e),_0x386aa1=_0x2733b3['kind']==='file'?'file\x20'+_0x2733b3['path']:_0x2733b3[_0x3b138c(0x1ad)]===_0x3b138c(0x1d4)?_0x3b138c(0x19b)+_0x2733b3['name']:_0x3b138c(0x1b2);let _0x5a9c58;try{if(_0x2733b3['kind']==='file')_0x5a9c58=await readFile(_0x2733b3[_0x3b138c(0x1c2)],_0x3b138c(0x1d3));else{if(_0x2733b3['kind']===_0x3b138c(0x1d4)){if(!(_0x2733b3[_0x3b138c(0x1e8)]in process.env))throw notificationError(_0x3b138c(0x199),'Notification\x20JSON\x20environment\x20variable\x20is\x20not\x20set:\x20'+_0x2733b3['name']);_0x5a9c58=process.env[_0x2733b3.name]??'';}else _0x5a9c58=await readStdin();}}catch(_0x373a10){if(_0x373a10 instanceof CliError)throw _0x373a10;throw notificationError('notification_config_source_unavailable',_0x3b138c(0x184)+_0x386aa1+'.');}let _0x8b6c8e;try{_0x8b6c8e=JSON['parse'](_0x5a9c58);}catch{throw notificationError(_0x3b138c(0x1e2),_0x3b138c(0x1ac)+_0x386aa1+_0x3b138c(0x1ba),'Provide\x20one\x20valid\x20JSON\x20object;\x20source\x20contents\x20are\x20not\x20included\x20in\x20errors.');}if(!isJsonObject(_0x8b6c8e))throw notificationError('notification_config_json_invalid','Notification\x20JSON\x20from\x20'+_0x386aa1+'\x20must\x20be\x20an\x20object.');return validateNotificationDocument(_0x8b6c8e,_0x3f304a);}export function projectNotificationListConfig(_0x24a95d,_0x50adcc){const _0x1d6360=a140_0x97c5c4;return{'id':typeof _0x24a95d['id']===_0x1d6360(0x1cf)?_0x24a95d['id']:null,'configCode':requireResponseString(_0x24a95d[_0x1d6360(0x1d7)],_0x1d6360(0x1d7),_0x50adcc),'configName':requireResponseString(_0x24a95d[_0x1d6360(0x18a)],_0x1d6360(0x18a),_0x50adcc),'channelType':requireResponseString(_0x24a95d[_0x1d6360(0x1eb)],'channelType',_0x50adcc),'description':normalizeNullableString(_0x24a95d['description']),'createTime':normalizeNullableString(_0x24a95d[_0x1d6360(0x1b6)]),'updateTime':normalizeNullableString(_0x24a95d[_0x1d6360(0x186)])};}export function normalizeExactNotificationConfig(_0x5f2d1c,_0x4cab6d,_0x1aa73d){const _0x423550=a140_0x97c5c4;if(!Number[_0x423550(0x1a7)](_0x5f2d1c['id'])||_0x5f2d1c['id']!==_0x4cab6d)throw notificationError(_0x423550(0x1ce),_0x423550(0x18f)+_0x4cab6d+'.');if(_0x5f2d1c[_0x423550(0x1c6)]!==_0x1aa73d)throw notificationError('notification_config_response_invalid',_0x423550(0x1a4)+_0x4cab6d+_0x423550(0x1a2));const _0x3d0b86=requireExactString(_0x5f2d1c[_0x423550(0x18a)],'configName',_0x4cab6d),_0x48dced=requireExactString(_0x5f2d1c[_0x423550(0x1d7)],_0x423550(0x1d7),_0x4cab6d),_0x202dd6=requireExactString(_0x5f2d1c[_0x423550(0x1eb)],_0x423550(0x1eb),_0x4cab6d);if(!NOTIFICATION_CHANNEL_TYPES[_0x423550(0x1db)](_0x202dd6))throw notificationError(_0x423550(0x1ce),_0x423550(0x1a4)+_0x4cab6d+_0x423550(0x1bf));const _0x165f05=responseNullableString(_0x5f2d1c['endpointUrl'],_0x423550(0x185),_0x4cab6d),_0x4e72b3=responseNullableString(_0x5f2d1c[_0x423550(0x1d5)],_0x423550(0x1d5),_0x4cab6d),_0x3977e0=responseNullableString(_0x5f2d1c['description'],_0x423550(0x1a0),_0x4cab6d),_0x6bbbd6=responseNullableTimeout(_0x5f2d1c['connectTimeout'],_0x423550(0x1d6),_0x4cab6d),_0x17ed0d=responseNullableTimeout(_0x5f2d1c[_0x423550(0x195)],'readTimeout',_0x4cab6d);return{'id':_0x4cab6d,'appCode':_0x1aa73d,'configCode':_0x48dced,'configName':_0x3d0b86,'channelType':_0x202dd6,'endpointUrl':redactSensitive(_0x165f05),'channelConfig':redactSensitive(_0x4e72b3),'description':_0x3977e0,'connectTimeout':_0x6bbbd6,'readTimeout':_0x17ed0d,'endpointUrlRaw':_0x165f05,'channelConfigRaw':_0x4e72b3};}export async function requireExactNotificationConfig(_0x618cfc,_0x532b10,_0x582e99){const _0x558717=a140_0x97c5c4;let _0x1cbb2b;try{_0x1cbb2b=await getNotificationChannelConfig(_0x532b10,_0x618cfc);}catch{throw safeApiFailure(_0x582e99,_0x558717(0x19c),_0x558717(0x1e9)+_0x618cfc+_0x558717(0x171));}return normalizeExactNotificationConfig(_0x1cbb2b,_0x532b10,_0x618cfc);}export function projectNotificationConfig(_0x2a4f13){const _0x309753=a140_0x97c5c4;return{'id':_0x2a4f13['id']??null,'appCode':_0x2a4f13['appCode'],'configCode':_0x2a4f13['configCode']??null,'configName':_0x2a4f13['configName'],'channelType':_0x2a4f13[_0x309753(0x1eb)],'endpointUrl':redactSensitive(_0x2a4f13['endpointUrl']),'channelConfig':redactSensitive(_0x2a4f13[_0x309753(0x1d5)]),'description':_0x2a4f13[_0x309753(0x1a0)]??null,'connectTimeout':_0x2a4f13[_0x309753(0x1d6)]??null,'readTimeout':_0x2a4f13[_0x309753(0x195)]??null};}export function notificationSelector(_0x535ead){const _0x4f7eae=a140_0x97c5c4;return{'appCode':_0x535ead[_0x4f7eae(0x1c6)],'id':_0x535ead['id'],'configCode':_0x535ead[_0x4f7eae(0x1d7)],'configName':_0x535ead['configName'],'channelType':_0x535ead[_0x4f7eae(0x1eb)]};}export function createMutationInput(_0x11e6b3,_0xf8852d){const _0x47e085=a140_0x97c5c4;return{'appCode':_0x11e6b3,'configName':_0xf8852d[_0x47e085(0x18a)],'channelType':_0xf8852d[_0x47e085(0x1eb)],...hasOwn(_0xf8852d,_0x47e085(0x185))?{'endpointUrl':_0xf8852d[_0x47e085(0x185)]}:{},...hasOwn(_0xf8852d,_0x47e085(0x1d5))?{'channelConfig':serializeChannelConfig(_0xf8852d[_0x47e085(0x1d5)])}:{},...hasOwn(_0xf8852d,'description')?{'description':_0xf8852d[_0x47e085(0x1a0)]}:{},...hasOwn(_0xf8852d,_0x47e085(0x1d6))?{'connectTimeout':_0xf8852d['connectTimeout']}:{},...hasOwn(_0xf8852d,_0x47e085(0x195))?{'readTimeout':_0xf8852d[_0x47e085(0x195)]}:{}};}export function mergeUpdateInput(_0x67c6fc,_0x3d7bcf){const _0x4118aa=a140_0x97c5c4;return{'id':_0x67c6fc['id'],'appCode':_0x67c6fc[_0x4118aa(0x1c6)],'configName':_0x3d7bcf[_0x4118aa(0x18a)]??_0x67c6fc[_0x4118aa(0x18a)],'channelType':_0x3d7bcf[_0x4118aa(0x1eb)]??_0x67c6fc[_0x4118aa(0x1eb)],'endpointUrl':hasOwn(_0x3d7bcf,_0x4118aa(0x185))?_0x3d7bcf[_0x4118aa(0x185)]:_0x67c6fc[_0x4118aa(0x1d1)],'channelConfig':hasOwn(_0x3d7bcf,'channelConfig')?serializeChannelConfig(_0x3d7bcf[_0x4118aa(0x1d5)]):_0x67c6fc[_0x4118aa(0x1ea)],'description':hasOwn(_0x3d7bcf,_0x4118aa(0x1a0))?_0x3d7bcf['description']:_0x67c6fc[_0x4118aa(0x1a0)],'connectTimeout':hasOwn(_0x3d7bcf,'connectTimeout')?_0x3d7bcf[_0x4118aa(0x1d6)]:_0x67c6fc['connectTimeout'],'readTimeout':hasOwn(_0x3d7bcf,_0x4118aa(0x195))?_0x3d7bcf[_0x4118aa(0x195)]:_0x67c6fc[_0x4118aa(0x195)]};}export function plannedUpdateProjection(_0x32a46d,_0x221b78){const _0x4b3d20=a140_0x97c5c4;return projectNotificationConfig({'id':_0x32a46d['id'],'appCode':_0x32a46d[_0x4b3d20(0x1c6)],'configCode':_0x32a46d[_0x4b3d20(0x1d7)],'configName':_0x221b78[_0x4b3d20(0x18a)]??_0x32a46d[_0x4b3d20(0x18a)],'channelType':_0x221b78[_0x4b3d20(0x1eb)]??_0x32a46d[_0x4b3d20(0x1eb)],'endpointUrl':hasOwn(_0x221b78,_0x4b3d20(0x185))?_0x221b78['endpointUrl']:_0x32a46d[_0x4b3d20(0x1d1)],'channelConfig':hasOwn(_0x221b78,_0x4b3d20(0x1d5))?_0x221b78[_0x4b3d20(0x1d5)]:_0x32a46d[_0x4b3d20(0x1ea)],'description':hasOwn(_0x221b78,_0x4b3d20(0x1a0))?_0x221b78['description']:_0x32a46d[_0x4b3d20(0x1a0)],'connectTimeout':hasOwn(_0x221b78,'connectTimeout')?_0x221b78[_0x4b3d20(0x1d6)]??DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:_0x32a46d[_0x4b3d20(0x1d6)],'readTimeout':hasOwn(_0x221b78,_0x4b3d20(0x195))?_0x221b78[_0x4b3d20(0x195)]??DEFAULT_NOTIFICATION_READ_TIMEOUT:_0x32a46d[_0x4b3d20(0x195)]});}export function requestedSafeFieldsMatch(_0x3da3e7,_0x3cdc04,_0x230207){const _0x3b33ff=a140_0x97c5c4,_0x391313=[],_0x197f70=[],_0xb577cf=[];for(const _0x1809a5 of['configName',_0x3b33ff(0x1eb),_0x3b33ff(0x1a0)]){if(!hasOwn(_0x230207,_0x1809a5))continue;_0xb577cf[_0x3b33ff(0x188)](_0x1809a5),_0x391313[_0x3b33ff(0x188)](_0x3cdc04[_0x1809a5]===_0x230207[_0x1809a5]),_0x197f70['push'](_0x3da3e7[_0x1809a5]!==_0x230207[_0x1809a5]&&_0x3cdc04[_0x1809a5]===_0x230207[_0x1809a5]);}for(const _0x1236f2 of[_0x3b33ff(0x1d6),_0x3b33ff(0x195)]){if(!hasOwn(_0x230207,_0x1236f2))continue;const _0x1d0fc1=_0x230207[_0x1236f2]??(_0x1236f2==='connectTimeout'?DEFAULT_NOTIFICATION_CONNECT_TIMEOUT:DEFAULT_NOTIFICATION_READ_TIMEOUT);_0xb577cf[_0x3b33ff(0x188)](_0x1236f2),_0x391313['push'](_0x3cdc04[_0x1236f2]===_0x1d0fc1),_0x197f70[_0x3b33ff(0x188)](_0x3da3e7[_0x1236f2]!==_0x1d0fc1&&_0x3cdc04[_0x1236f2]===_0x1d0fc1);}return hasOwn(_0x230207,_0x3b33ff(0x185))&&_0x230207[_0x3b33ff(0x185)]===null&&(_0xb577cf['push']('endpointUrl:null'),_0x391313[_0x3b33ff(0x188)](_0x3cdc04[_0x3b33ff(0x1d1)]===null||_0x3cdc04[_0x3b33ff(0x1d1)]===''),_0x197f70[_0x3b33ff(0x188)](_0x3da3e7['endpointUrlRaw']!==null&&_0x3da3e7[_0x3b33ff(0x1d1)]!==''&&(_0x3cdc04[_0x3b33ff(0x1d1)]===null||_0x3cdc04[_0x3b33ff(0x1d1)]===''))),{'allMatch':_0x391313[_0x3b33ff(0x1ef)](Boolean),'provesChange':_0x197f70[_0x3b33ff(0x1a1)](Boolean),'verifiedFields':_0xb577cf};}export function validateNotificationDeleteReadback(_0x4129ee,_0x25e7bd,_0x42f27f){const _0x1e35de=a140_0x97c5c4;for(const [_0xfabced,_0xc8c543]of _0x4129ee[_0x1e35de(0x1de)]()){if(!Number[_0x1e35de(0x1a7)](_0xc8c543['id'])||_0xc8c543['id']<=0x0)throw notificationError(_0x1e35de(0x1ce),_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x18b));if(_0xc8c543[_0x1e35de(0x1c6)]!==_0x25e7bd)throw notificationError(_0x1e35de(0x1ce),_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x1bb));if(_0xc8c543['channelType']!==_0x42f27f)throw notificationError('notification_config_response_invalid',_0x1e35de(0x1c9)+(_0xfabced+0x1)+_0x1e35de(0x1c1));}}export function safeApiFailure(_0x28cc11,_0x51b3d7,_0x17dc7f){const _0x447f52=a140_0x97c5c4;return notificationError(_0x447f52(0x187)+_0x28cc11+'_'+(_0x51b3d7===_0x447f52(0x1f1)?_0x447f52(0x192):_0x51b3d7+_0x447f52(0x1e5)),_0x447f52(0x1a4)+_0x28cc11+'\x20'+_0x51b3d7+'\x20failed.',_0x17dc7f);}export function notificationLookupCommand(_0x3e5f62,_0x16088d){const _0x145141=a140_0x97c5c4;return _0x145141(0x1cc)+_0x3e5f62+_0x145141(0x16f)+_0x16088d+_0x145141(0x1ec);}function validateNotificationDocument(_0x1d62d1,_0x43f214){const _0x406ccd=a140_0x97c5c4;for(const _0x1daf25 of Object[_0x406ccd(0x17e)](_0x1d62d1)){if(FORBIDDEN_IDENTITY_FIELDS[_0x406ccd(0x17a)](_0x1daf25))throw notificationError(_0x406ccd(0x1bd),'Notification\x20JSON\x20field\x20\x22'+_0x1daf25+_0x406ccd(0x1e7));if(!ALLOWED_INPUT_FIELDS['has'](_0x1daf25))throw notificationError(_0x406ccd(0x19a),_0x406ccd(0x19f)+_0x1daf25+'\x22.');}if(_0x43f214===_0x406ccd(0x1c5)&&Object[_0x406ccd(0x17e)](_0x1d62d1)[_0x406ccd(0x1d8)]===0x0)throw notificationError('notification_config_update_empty',_0x406ccd(0x1ee));const _0x2e8e75={};if(hasOwn(_0x1d62d1,_0x406ccd(0x18a)))_0x2e8e75[_0x406ccd(0x18a)]=validateRequiredString(_0x1d62d1['configName'],_0x406ccd(0x18a),0x80);else{if(_0x43f214===_0x406ccd(0x194))throw notificationError(_0x406ccd(0x196),_0x406ccd(0x1b4)+_0x406ccd(0x1e0));}if(hasOwn(_0x1d62d1,_0x406ccd(0x1eb))){if(typeof _0x1d62d1['channelType']!==_0x406ccd(0x175))throw invalidFieldType('channelType',_0x406ccd(0x1b5));const _0x5c4dba=_0x1d62d1[_0x406ccd(0x1eb)]['trim']();if(!NOTIFICATION_CHANNEL_TYPES[_0x406ccd(0x1db)](_0x5c4dba))throw notificationError(_0x406ccd(0x1ca),_0x406ccd(0x18e),_0x406ccd(0x1e1)+NOTIFICATION_CHANNEL_TYPES['join'](',\x20')+'.');_0x2e8e75['channelType']=_0x5c4dba;}else{if(_0x43f214===_0x406ccd(0x194))throw notificationError(_0x406ccd(0x196),'Create\x20JSON\x20requires\x20field\x20'+'\x22channelType\x22.');}for(const [_0x2a0299,_0x1d4239]of[[_0x406ccd(0x185),0x200],[_0x406ccd(0x1a0),0x100]]){if(!hasOwn(_0x1d62d1,_0x2a0299))continue;const _0x2f56f1=_0x1d62d1[_0x2a0299];if(_0x2f56f1!==null&&typeof _0x2f56f1!==_0x406ccd(0x175))throw invalidFieldType(_0x2a0299,_0x406ccd(0x1f0));if(typeof _0x2f56f1===_0x406ccd(0x175)&&_0x2f56f1[_0x406ccd(0x1d8)]>_0x1d4239)throw notificationError(_0x406ccd(0x1ca),_0x406ccd(0x1d0)+_0x2a0299+_0x406ccd(0x1a9)+_0x1d4239+_0x406ccd(0x1c3));_0x2e8e75[_0x2a0299]=_0x2f56f1;}if(hasOwn(_0x1d62d1,_0x406ccd(0x1d5))){const _0x1e93c5=_0x1d62d1[_0x406ccd(0x1d5)];if(_0x1e93c5===null&&_0x43f214===_0x406ccd(0x194))throw invalidFieldType('channelConfig',_0x406ccd(0x197));if(_0x1e93c5!==null&&!isJsonObject(_0x1e93c5))throw invalidFieldType(_0x406ccd(0x1d5),_0x43f214===_0x406ccd(0x1c5)?_0x406ccd(0x1c8):_0x406ccd(0x197));_0x1e93c5!==null&&validateChannelConfigFields(_0x2e8e75['channelType'],_0x1e93c5),_0x2e8e75['channelConfig']=_0x1e93c5;}for(const _0x3be00b of['connectTimeout',_0x406ccd(0x195)]){if(!hasOwn(_0x1d62d1,_0x3be00b))continue;const _0x54e020=_0x1d62d1[_0x3be00b];if(_0x54e020!==null&&(!Number[_0x406ccd(0x1a7)](_0x54e020)||_0x54e020<0x0))throw notificationError('notification_config_field_invalid',_0x406ccd(0x1d0)+_0x3be00b+'\x22\x20must\x20be\x20a\x20non-negative\x20safe\x20integer\x20or\x20null.');_0x2e8e75[_0x3be00b]=_0x54e020;}return _0x2e8e75;}function validateRequiredString(_0x303e61,_0x3de79f,_0x278e37){const _0x2bef9a=a140_0x97c5c4;if(typeof _0x303e61!==_0x2bef9a(0x175))throw invalidFieldType(_0x3de79f,_0x2bef9a(0x189));const _0x49c2a3=_0x303e61[_0x2bef9a(0x17f)]();if(!_0x49c2a3)throw notificationError(_0x2bef9a(0x1ca),_0x2bef9a(0x1d0)+_0x3de79f+_0x2bef9a(0x1cb));if(_0x49c2a3[_0x2bef9a(0x1d8)]>_0x278e37)throw notificationError(_0x2bef9a(0x1ca),'Notification\x20JSON\x20field\x20\x22'+_0x3de79f+'\x22\x20cannot\x20exceed\x20'+_0x278e37+'\x20characters.');return _0x49c2a3;}function validateChannelConfigFields(_0x2e7521,_0x2e277f){const _0x3de844=a140_0x97c5c4;if(hasOwn(_0x2e277f,'messageTemplate'))throw forbiddenChannelConfigField(_0x3de844(0x1c7));if(_0x2e7521===_0x3de844(0x18d))for(const _0x2b3f4c of EMAIL_RECIPIENT_FIELDS){if(hasOwn(_0x2e277f,_0x2b3f4c))throw forbiddenChannelConfigField(_0x2b3f4c);}}function forbiddenChannelConfigField(_0x48a26f){const _0x4a20dc=a140_0x97c5c4;return notificationError(_0x4a20dc(0x183),'Notification\x20JSON\x20channelConfig\x20field\x20\x22'+_0x48a26f+_0x4a20dc(0x1da));}function invalidFieldType(_0x2ee9b9,_0x2468cb){const _0x4f92cd=a140_0x97c5c4;return notificationError(_0x4f92cd(0x1ca),_0x4f92cd(0x1d0)+_0x2ee9b9+_0x4f92cd(0x1e3)+_0x2468cb+'.');}function serializeChannelConfig(_0x1b08c8){const _0x2672c3=a140_0x97c5c4;return _0x1b08c8===null||_0x1b08c8===undefined?null:JSON[_0x2672c3(0x1d9)](_0x1b08c8);}function redactSensitive(_0x3b746e){const _0x304b31=a140_0x97c5c4;return _0x3b746e===null||_0x3b746e===undefined||_0x3b746e===''?null:_0x304b31(0x1bc);}function requireResponseString(_0x474391,_0x468a9d,_0x50e21f){const _0x11e498=a140_0x97c5c4;if(typeof _0x474391!==_0x11e498(0x175)||_0x474391[_0x11e498(0x17f)]()==='')throw CliErrors[_0x11e498(0x1c0)](_0x11e498(0x1ed),_0x11e498(0x1a5)+(_0x50e21f+0x1)+_0x11e498(0x172)+_0x468a9d+'\x22.');return _0x474391[_0x11e498(0x17f)]();}function requireExactString(_0x30c3b5,_0x481c6c,_0x2cdac2){const _0x43cac8=a140_0x97c5c4;if(typeof _0x30c3b5!=='string'||_0x30c3b5[_0x43cac8(0x17f)]()==='')throw notificationError(_0x43cac8(0x1ce),_0x43cac8(0x1a4)+_0x2cdac2+_0x43cac8(0x172)+_0x481c6c+'\x22.');return _0x30c3b5[_0x43cac8(0x17f)]();}function responseNullableString(_0x238471,_0x49130e,_0x1736eb){const _0x35b4fa=a140_0x97c5c4;if(_0x238471===undefined||_0x238471===null)return null;if(typeof _0x238471!==_0x35b4fa(0x175))throw notificationError('notification_config_response_invalid',_0x35b4fa(0x1a4)+_0x1736eb+_0x35b4fa(0x191)+_0x49130e+'\x22.');return _0x238471;}function a140_0x1d43(_0x425794,_0x5b4f19){_0x425794=_0x425794-0x16f;const _0x1da8d1=a140_0x1da8();let _0x1d439f=_0x1da8d1[_0x425794];return _0x1d439f;}function responseNullableTimeout(_0x3f65c0,_0x52a718,_0x5d3b04){const _0x2a1855=a140_0x97c5c4;if(_0x3f65c0===undefined||_0x3f65c0===null)return null;if(!Number[_0x2a1855(0x1a7)](_0x3f65c0)||_0x3f65c0<0x0)throw notificationError(_0x2a1855(0x1ce),_0x2a1855(0x1a4)+_0x5d3b04+'\x20has\x20invalid\x20field\x20\x22'+_0x52a718+'\x22.');return _0x3f65c0;}function normalizeNullableString(_0xe7f2cb){return typeof _0xe7f2cb==='string'?_0xe7f2cb:null;}function isJsonObject(_0x2f3f9b){const _0x1f90af=a140_0x97c5c4;return _0x2f3f9b!==null&&typeof _0x2f3f9b===_0x1f90af(0x178)&&!Array['isArray'](_0x2f3f9b);}function hasOwn(_0xfdcf91,_0x4e7ec8){const _0x206f6e=a140_0x97c5c4;return Object['prototype'][_0x206f6e(0x181)]['call'](_0xfdcf91,_0x4e7ec8);}async function readStdin(){const _0x160d3f=a140_0x97c5c4;let _0x2a590c='';process[_0x160d3f(0x1b2)][_0x160d3f(0x173)](_0x160d3f(0x1d3));for await(const _0x44a84a of process[_0x160d3f(0x1b2)])_0x2a590c+=_0x44a84a;return _0x2a590c;}
@@ -1 +1 @@
1
- const a140_0x59b48b=a140_0x522d;(function(_0x13daa8,_0x169681){const _0x5c8019=a140_0x522d,_0x52ffc1=_0x13daa8();while(!![]){try{const _0x254fd8=parseInt(_0x5c8019(0x17b))/0x1*(-parseInt(_0x5c8019(0x172))/0x2)+-parseInt(_0x5c8019(0x185))/0x3*(parseInt(_0x5c8019(0x159))/0x4)+-parseInt(_0x5c8019(0x152))/0x5*(parseInt(_0x5c8019(0x17d))/0x6)+parseInt(_0x5c8019(0x16c))/0x7*(parseInt(_0x5c8019(0x160))/0x8)+-parseInt(_0x5c8019(0x151))/0x9*(-parseInt(_0x5c8019(0x15f))/0xa)+-parseInt(_0x5c8019(0x178))/0xb+parseInt(_0x5c8019(0x17f))/0xc;if(_0x254fd8===_0x169681)break;else _0x52ffc1['push'](_0x52ffc1['shift']());}catch(_0x5c16c4){_0x52ffc1['push'](_0x52ffc1['shift']());}}}(a140_0x36ac,0x2a395));function a140_0x522d(_0x430ebc,_0x5a64a0){_0x430ebc=_0x430ebc-0x14f;const _0x36ac92=a140_0x36ac();let _0x522d5a=_0x36ac92[_0x430ebc];return _0x522d5a;}import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const SUPPORTED_SCENES=[a140_0x59b48b(0x169),a140_0x59b48b(0x175),a140_0x59b48b(0x161),a140_0x59b48b(0x14f)],SCENE_TO_LEGACY_TYPE={'invoice':a140_0x59b48b(0x16d),'general':a140_0x59b48b(0x189),'form':a140_0x59b48b(0x15e),'idCard':'IdCard'},SCENE_FLAG={'name':a140_0x59b48b(0x16a),'type':'string','required':!![],'enum':[...SUPPORTED_SCENES],'description':a140_0x59b48b(0x181)},IMAGE_FILE_FLAG={'name':a140_0x59b48b(0x179),'type':a140_0x59b48b(0x184),'description':a140_0x59b48b(0x156)},IMAGE_URL_FLAG={'name':'image-url','type':a140_0x59b48b(0x184),'description':a140_0x59b48b(0x15a)};function normalizeScene(_0x80c8e9){const _0x15ab82=a140_0x59b48b,_0x3d635a=_0x80c8e9[_0x15ab82(0x182)]()[_0x15ab82(0x173)]();if(_0x3d635a===_0x15ab82(0x177))return _0x15ab82(0x14f);if(_0x3d635a==='invoice'||_0x3d635a===_0x15ab82(0x175)||_0x3d635a===_0x15ab82(0x161))return _0x3d635a;throw CliErrors[_0x15ab82(0x150)](_0x15ab82(0x188)+_0x80c8e9+_0x15ab82(0x16b)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x3a9e80){const _0x1bb8e1=a140_0x59b48b,_0x54729b=_0x3a9e80[_0x1bb8e1(0x180)](_0x1bb8e1(0x179))[_0x1bb8e1(0x182)](),_0x1a9aeb=_0x3a9e80[_0x1bb8e1(0x180)](_0x1bb8e1(0x15c))[_0x1bb8e1(0x182)]();return{'imageFile':_0x54729b,'imageUrl':_0x1a9aeb,'count':[_0x54729b,_0x1a9aeb][_0x1bb8e1(0x174)](Boolean)[_0x1bb8e1(0x183)]};}function validateInputSelection(_0x5a6f03){const _0x572664=a140_0x59b48b,_0x425455=selectedInputs(_0x5a6f03);if(_0x425455[_0x572664(0x16f)]!==0x1)throw CliErrors['validation'](_0x572664(0x17a));return _0x425455;}function withScene(_0x5a11ed,_0x57a4c3,_0x1b120b){const _0x7fd880=a140_0x59b48b;return{..._0x5a11ed,'scene':_0x57a4c3,..._0x1b120b?{'sourceFile':{'fileName':_0x1b120b[_0x7fd880(0x171)],'filePath':_0x1b120b[_0x7fd880(0x168)]}}:{}};}function a140_0x36ac(){const _0x305dcb=['Preview:\x20recognize\x20','fileName','2TxZUsD','toLowerCase','filter','general','toString','idcard','1893991gVXkVH','image-file','Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.','167644pEdrvZ','ocr','12YXcDec','<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','7680kgpify','str','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','trim','length','string','723bIQdMb','/smartapi/ocr/recognize-text?','/smartapi/common/uploadFile','Unsupported\x20OCR\x20scene:\x20','General','fileUrl','idCard','validation','773622IRKBGV','21995ocECzX','imageFile','path','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR','imageUrl','使用研发态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','556JcEvwQ','Publicly\x20accessible\x20image\x20or\x20file\x20URL','GET','image-url','\x20OCR','Table','40iwRMVe','8UJDave','form','read','/smartapi/common/queryFileUrl','apiError','File\x20URL\x20response\x20missing\x20fileUrl.','File\x20upload\x20response\x20missing\x20filePath.','appCode','filePath','invoice','scene','.\x20Supported\x20scenes:\x20','1474193UYIqCj','Invoice','\x20OCR\x20from\x20URL','count'];a140_0x36ac=function(){return _0x305dcb;};return a140_0x36ac();}const ocrRecognize={'service':a140_0x59b48b(0x17c),'command':'recognize','description':a140_0x59b48b(0x158),'risk':a140_0x59b48b(0x162),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x26d5a4){const _0x2c1322=a140_0x59b48b,_0x1cf0a8=normalizeScene(_0x26d5a4[_0x2c1322(0x180)](_0x2c1322(0x16a))),_0x52a919=SCENE_TO_LEGACY_TYPE[_0x1cf0a8],_0xe230cb=validateInputSelection(_0x26d5a4);if(_0xe230cb[_0x2c1322(0x157)]){const _0x1ffc24=new URLSearchParams({'url':_0xe230cb[_0x2c1322(0x157)],'type':_0x52a919,'appCode':_0x26d5a4[_0x2c1322(0x167)]});return{'method':_0x2c1322(0x15b),'url':_0x2c1322(0x186)+_0x1ffc24[_0x2c1322(0x176)](),'description':_0x2c1322(0x170)+_0x1cf0a8+_0x2c1322(0x16e)};}const _0x7e2628=requireDevelopmentUploadFile(_0xe230cb[_0x2c1322(0x153)],_0x2c1322(0x179));return{'method':'POST','url':'/smartapi/common/uploadFile','body':{'steps':[{'method':'POST','url':_0x2c1322(0x187),'body':{'appCode':_0x26d5a4[_0x2c1322(0x167)],'multipart':{'file':_0x7e2628}}},{'method':'POST','url':_0x2c1322(0x163),'body':{'filePath':'<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','downloadFlag':![]}},{'method':'GET','url':'/smartapi/ocr/recognize-text','query':{'appCode':_0x26d5a4[_0x2c1322(0x167)],'url':_0x2c1322(0x17e),'type':_0x52a919}}]},'description':_0x2c1322(0x155)+_0x1cf0a8+_0x2c1322(0x15d)};},async 'execute'(_0x5c874f){const _0x386288=a140_0x59b48b,_0x405c35=normalizeScene(_0x5c874f[_0x386288(0x180)](_0x386288(0x16a))),_0x5d1562=SCENE_TO_LEGACY_TYPE[_0x405c35],_0x4e0170=validateInputSelection(_0x5c874f);if(_0x4e0170[_0x386288(0x157)]){const _0x15fa47=await recognizeDevelopmentOcr(_0x5c874f[_0x386288(0x167)],{'url':_0x4e0170[_0x386288(0x157)],'type':_0x5d1562});return{'ok':!![],'data':withScene(_0x15fa47,_0x405c35)};}const _0x53de16=requireDevelopmentUploadFile(_0x4e0170['imageFile'],'image-file'),_0x4a371d=await uploadDevelopmentFile(_0x5c874f['appCode'],_0x53de16[_0x386288(0x154)]);if(!_0x4a371d[_0x386288(0x168)])throw CliErrors[_0x386288(0x164)](_0x386288(0x166));const _0x4827ec=await queryDevelopmentFileUrl(_0x4a371d[_0x386288(0x168)],{'download':![]});if(!_0x4827ec[_0x386288(0x18a)])throw CliErrors[_0x386288(0x164)](_0x386288(0x165));const _0x3a502a=await recognizeDevelopmentOcr(_0x5c874f['appCode'],{'url':_0x4827ec[_0x386288(0x18a)],'type':_0x5d1562});return{'ok':!![],'data':withScene(_0x3a502a,_0x405c35,_0x4a371d)};}};export const ocrDefinitions=[ocrRecognize];
1
+ const a141_0x340794=a141_0x124c;(function(_0x5c83b9,_0x36d25e){const _0x4d2096=a141_0x124c,_0x3205ca=_0x5c83b9();while(!![]){try{const _0x14ee86=-parseInt(_0x4d2096(0x111))/0x1+-parseInt(_0x4d2096(0x125))/0x2*(-parseInt(_0x4d2096(0x12d))/0x3)+-parseInt(_0x4d2096(0x12a))/0x4*(parseInt(_0x4d2096(0x13c))/0x5)+-parseInt(_0x4d2096(0x136))/0x6+-parseInt(_0x4d2096(0x12e))/0x7+parseInt(_0x4d2096(0x12f))/0x8*(-parseInt(_0x4d2096(0x13e))/0x9)+parseInt(_0x4d2096(0x122))/0xa*(parseInt(_0x4d2096(0x139))/0xb);if(_0x14ee86===_0x36d25e)break;else _0x3205ca['push'](_0x3205ca['shift']());}catch(_0x15f5f7){_0x3205ca['push'](_0x3205ca['shift']());}}}(a141_0x1e3d,0xf0bce));import{requireDevelopmentUploadFile}from'../../commands/common/local-file.js';import{queryDevelopmentFileUrl,recognizeDevelopmentOcr,uploadDevelopmentFile}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a141_0x124c(_0x1759db,_0x2d1d6b){_0x1759db=_0x1759db-0x108;const _0x1e3d98=a141_0x1e3d();let _0x124ca3=_0x1e3d98[_0x1759db];return _0x124ca3;}const SUPPORTED_SCENES=[a141_0x340794(0x12b),a141_0x340794(0x117),a141_0x340794(0x126),a141_0x340794(0x120)],SCENE_TO_LEGACY_TYPE={'invoice':a141_0x340794(0x109),'general':a141_0x340794(0x12c),'form':'Table','idCard':a141_0x340794(0x10f)},SCENE_FLAG={'name':'scene','type':a141_0x340794(0x133),'required':!![],'enum':[...SUPPORTED_SCENES],'description':a141_0x340794(0x13a)},IMAGE_FILE_FLAG={'name':a141_0x340794(0x13d),'type':a141_0x340794(0x133),'description':'Local\x20image\x20or\x20PDF\x20file;\x20uses\x20upload\x20->\x20query-url\x20->\x20OCR'},IMAGE_URL_FLAG={'name':'image-url','type':'string','description':a141_0x340794(0x121)};function normalizeScene(_0x4f0865){const _0x196607=a141_0x340794,_0x3d18de=_0x4f0865[_0x196607(0x115)]()['toLowerCase']();if(_0x3d18de==='idcard')return _0x196607(0x120);if(_0x3d18de===_0x196607(0x12b)||_0x3d18de==='general'||_0x3d18de===_0x196607(0x126))return _0x3d18de;throw CliErrors['validation'](_0x196607(0x114)+_0x4f0865+_0x196607(0x13b)+SUPPORTED_SCENES['join'](',\x20'));}function selectedInputs(_0x4bc36e){const _0x2424d3=a141_0x340794,_0xafc4df=_0x4bc36e[_0x2424d3(0x10e)]('image-file')[_0x2424d3(0x115)](),_0x283572=_0x4bc36e[_0x2424d3(0x10e)]('image-url')[_0x2424d3(0x115)]();return{'imageFile':_0xafc4df,'imageUrl':_0x283572,'count':[_0xafc4df,_0x283572][_0x2424d3(0x10d)](Boolean)[_0x2424d3(0x127)]};}function validateInputSelection(_0x5e5599){const _0x370669=a141_0x340794,_0x29bb2c=selectedInputs(_0x5e5599);if(_0x29bb2c[_0x370669(0x124)]!==0x1)throw CliErrors[_0x370669(0x112)]('Choose\x20exactly\x20one\x20OCR\x20input:\x20--image-file\x20or\x20--image-url.');return _0x29bb2c;}function a141_0x1e3d(){const _0x14d9df=['fileName','21166wYikaK','validation','Preview:\x20upload\x20local\x20file,\x20query\x20temporary\x20URL,\x20then\x20recognize\x20','Unsupported\x20OCR\x20scene:\x20','trim','\x20OCR\x20from\x20URL','general','<filePath\x20returned\x20by\x20/smartapi/common/uploadFile>','/smartapi/ocr/recognize-text','\x20OCR','ocr','File\x20URL\x20response\x20missing\x20fileUrl.','appCode','/smartapi/ocr/recognize-text?','GET','idCard','Publicly\x20accessible\x20image\x20or\x20file\x20URL','10FCwOnR','imageUrl','count','54rsVfzD','form','length','apiError','<fileUrl\x20returned\x20by\x20/smartapi/common/queryFileUrl>','4XDuneg','invoice','General','200265YPfSZY','13213389MWkhTb','23960xrZNsp','path','recognize','fileUrl','string','read','/smartapi/common/uploadFile','852000VURMoq','imageFile','/smartapi/common/queryFileUrl','24391763zlgfkm','OCR\x20scene:\x20invoice,\x20general,\x20form,\x20or\x20idCard','.\x20Supported\x20scenes:\x20','871565VKOxso','image-file','2430ilcrWU','toString','POST','Invoice','使用研发态\x20OCR\x20服务识别\x20URL\x20或本地文件中的文字','scene','filePath','filter','str','IdCard'];a141_0x1e3d=function(){return _0x14d9df;};return a141_0x1e3d();}function withScene(_0x26b078,_0x57a6db,_0x581dde){const _0x5c2042=a141_0x340794;return{..._0x26b078,'scene':_0x57a6db,..._0x581dde?{'sourceFile':{'fileName':_0x581dde[_0x5c2042(0x110)],'filePath':_0x581dde[_0x5c2042(0x10c)]}}:{}};}const ocrRecognize={'service':a141_0x340794(0x11b),'command':a141_0x340794(0x131),'description':a141_0x340794(0x10a),'risk':a141_0x340794(0x134),'flags':[SCENE_FLAG,IMAGE_FILE_FLAG,IMAGE_URL_FLAG],async 'dryRun'(_0x39c2e7){const _0xdb5d2c=a141_0x340794,_0x29163a=normalizeScene(_0x39c2e7[_0xdb5d2c(0x10e)](_0xdb5d2c(0x10b))),_0x572f1e=SCENE_TO_LEGACY_TYPE[_0x29163a],_0x49bbdd=validateInputSelection(_0x39c2e7);if(_0x49bbdd[_0xdb5d2c(0x123)]){const _0x65aa48=new URLSearchParams({'url':_0x49bbdd['imageUrl'],'type':_0x572f1e,'appCode':_0x39c2e7['appCode']});return{'method':_0xdb5d2c(0x11f),'url':_0xdb5d2c(0x11e)+_0x65aa48[_0xdb5d2c(0x13f)](),'description':'Preview:\x20recognize\x20'+_0x29163a+_0xdb5d2c(0x116)};}const _0x3146ee=requireDevelopmentUploadFile(_0x49bbdd[_0xdb5d2c(0x137)],_0xdb5d2c(0x13d));return{'method':_0xdb5d2c(0x108),'url':_0xdb5d2c(0x135),'body':{'steps':[{'method':'POST','url':_0xdb5d2c(0x135),'body':{'appCode':_0x39c2e7['appCode'],'multipart':{'file':_0x3146ee}}},{'method':_0xdb5d2c(0x108),'url':_0xdb5d2c(0x138),'body':{'filePath':_0xdb5d2c(0x118),'downloadFlag':![]}},{'method':'GET','url':_0xdb5d2c(0x119),'query':{'appCode':_0x39c2e7[_0xdb5d2c(0x11d)],'url':_0xdb5d2c(0x129),'type':_0x572f1e}}]},'description':_0xdb5d2c(0x113)+_0x29163a+_0xdb5d2c(0x11a)};},async 'execute'(_0xc23b2e){const _0x19c823=a141_0x340794,_0x1f9c04=normalizeScene(_0xc23b2e['str']('scene')),_0x3f7a24=SCENE_TO_LEGACY_TYPE[_0x1f9c04],_0x39a047=validateInputSelection(_0xc23b2e);if(_0x39a047[_0x19c823(0x123)]){const _0x515577=await recognizeDevelopmentOcr(_0xc23b2e['appCode'],{'url':_0x39a047[_0x19c823(0x123)],'type':_0x3f7a24});return{'ok':!![],'data':withScene(_0x515577,_0x1f9c04)};}const _0x551ad0=requireDevelopmentUploadFile(_0x39a047[_0x19c823(0x137)],_0x19c823(0x13d)),_0x34d1d2=await uploadDevelopmentFile(_0xc23b2e['appCode'],_0x551ad0[_0x19c823(0x130)]);if(!_0x34d1d2['filePath'])throw CliErrors[_0x19c823(0x128)]('File\x20upload\x20response\x20missing\x20filePath.');const _0x35c383=await queryDevelopmentFileUrl(_0x34d1d2[_0x19c823(0x10c)],{'download':![]});if(!_0x35c383['fileUrl'])throw CliErrors['apiError'](_0x19c823(0x11c));const _0x55a2c6=await recognizeDevelopmentOcr(_0xc23b2e[_0x19c823(0x11d)],{'url':_0x35c383[_0x19c823(0x132)],'type':_0x3f7a24});return{'ok':!![],'data':withScene(_0x55a2c6,_0x1f9c04,_0x34d1d2)};}};export const ocrDefinitions=[ocrRecognize];