monday-cli 0.2.0

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 (596) hide show
  1. package/CHANGELOG.md +439 -0
  2. package/LICENSE +21 -0
  3. package/README.md +431 -0
  4. package/dist/api/board-child-finder.d.ts +95 -0
  5. package/dist/api/board-child-finder.d.ts.map +1 -0
  6. package/dist/api/board-child-finder.js +89 -0
  7. package/dist/api/board-child-finder.js.map +1 -0
  8. package/dist/api/board-metadata.d.ts +162 -0
  9. package/dist/api/board-metadata.d.ts.map +1 -0
  10. package/dist/api/board-metadata.js +238 -0
  11. package/dist/api/board-metadata.js.map +1 -0
  12. package/dist/api/board-mutation-invalidation.d.ts +153 -0
  13. package/dist/api/board-mutation-invalidation.d.ts.map +1 -0
  14. package/dist/api/board-mutation-invalidation.js +136 -0
  15. package/dist/api/board-mutation-invalidation.js.map +1 -0
  16. package/dist/api/board-mutation-result.d.ts +97 -0
  17. package/dist/api/board-mutation-result.d.ts.map +1 -0
  18. package/dist/api/board-mutation-result.js +99 -0
  19. package/dist/api/board-mutation-result.js.map +1 -0
  20. package/dist/api/board-projection.d.ts +68 -0
  21. package/dist/api/board-projection.d.ts.map +1 -0
  22. package/dist/api/board-projection.js +79 -0
  23. package/dist/api/board-projection.js.map +1 -0
  24. package/dist/api/cache.d.ts +150 -0
  25. package/dist/api/cache.d.ts.map +1 -0
  26. package/dist/api/cache.js +418 -0
  27. package/dist/api/cache.js.map +1 -0
  28. package/dist/api/client.d.ts +162 -0
  29. package/dist/api/client.d.ts.map +1 -0
  30. package/dist/api/client.js +205 -0
  31. package/dist/api/client.js.map +1 -0
  32. package/dist/api/column-mapping.d.ts +68 -0
  33. package/dist/api/column-mapping.d.ts.map +1 -0
  34. package/dist/api/column-mapping.js +117 -0
  35. package/dist/api/column-mapping.js.map +1 -0
  36. package/dist/api/column-mutation-result.d.ts +136 -0
  37. package/dist/api/column-mutation-result.d.ts.map +1 -0
  38. package/dist/api/column-mutation-result.js +130 -0
  39. package/dist/api/column-mutation-result.js.map +1 -0
  40. package/dist/api/column-types.d.ts +215 -0
  41. package/dist/api/column-types.d.ts.map +1 -0
  42. package/dist/api/column-types.js +195 -0
  43. package/dist/api/column-types.js.map +1 -0
  44. package/dist/api/column-values.d.ts +446 -0
  45. package/dist/api/column-values.d.ts.map +1 -0
  46. package/dist/api/column-values.js +795 -0
  47. package/dist/api/column-values.js.map +1 -0
  48. package/dist/api/columns.d.ts +205 -0
  49. package/dist/api/columns.d.ts.map +1 -0
  50. package/dist/api/columns.js +343 -0
  51. package/dist/api/columns.js.map +1 -0
  52. package/dist/api/complexity.d.ts +90 -0
  53. package/dist/api/complexity.d.ts.map +1 -0
  54. package/dist/api/complexity.js +194 -0
  55. package/dist/api/complexity.js.map +1 -0
  56. package/dist/api/dates.d.ts +150 -0
  57. package/dist/api/dates.d.ts.map +1 -0
  58. package/dist/api/dates.js +490 -0
  59. package/dist/api/dates.js.map +1 -0
  60. package/dist/api/destructive-gate.d.ts +107 -0
  61. package/dist/api/destructive-gate.d.ts.map +1 -0
  62. package/dist/api/destructive-gate.js +19 -0
  63. package/dist/api/destructive-gate.js.map +1 -0
  64. package/dist/api/dry-run.d.ts +338 -0
  65. package/dist/api/dry-run.d.ts.map +1 -0
  66. package/dist/api/dry-run.js +607 -0
  67. package/dist/api/dry-run.js.map +1 -0
  68. package/dist/api/emails.d.ts +60 -0
  69. package/dist/api/emails.d.ts.map +1 -0
  70. package/dist/api/emails.js +113 -0
  71. package/dist/api/emails.js.map +1 -0
  72. package/dist/api/errors.d.ts +82 -0
  73. package/dist/api/errors.d.ts.map +1 -0
  74. package/dist/api/errors.js +434 -0
  75. package/dist/api/errors.js.map +1 -0
  76. package/dist/api/filters.d.ts +198 -0
  77. package/dist/api/filters.d.ts.map +1 -0
  78. package/dist/api/filters.js +328 -0
  79. package/dist/api/filters.js.map +1 -0
  80. package/dist/api/group-color.d.ts +33 -0
  81. package/dist/api/group-color.d.ts.map +1 -0
  82. package/dist/api/group-color.js +80 -0
  83. package/dist/api/group-color.js.map +1 -0
  84. package/dist/api/group-mutation-result.d.ts +150 -0
  85. package/dist/api/group-mutation-result.d.ts.map +1 -0
  86. package/dist/api/group-mutation-result.js +141 -0
  87. package/dist/api/group-mutation-result.js.map +1 -0
  88. package/dist/api/iso-country-codes.d.ts +45 -0
  89. package/dist/api/iso-country-codes.d.ts.map +1 -0
  90. package/dist/api/iso-country-codes.js +71 -0
  91. package/dist/api/iso-country-codes.js.map +1 -0
  92. package/dist/api/item-board-lookup.d.ts +86 -0
  93. package/dist/api/item-board-lookup.d.ts.map +1 -0
  94. package/dist/api/item-board-lookup.js +140 -0
  95. package/dist/api/item-board-lookup.js.map +1 -0
  96. package/dist/api/item-helpers.d.ts +133 -0
  97. package/dist/api/item-helpers.d.ts.map +1 -0
  98. package/dist/api/item-helpers.js +139 -0
  99. package/dist/api/item-helpers.js.map +1 -0
  100. package/dist/api/item-mutation-result.d.ts +60 -0
  101. package/dist/api/item-mutation-result.d.ts.map +1 -0
  102. package/dist/api/item-mutation-result.js +63 -0
  103. package/dist/api/item-mutation-result.js.map +1 -0
  104. package/dist/api/item-projection.d.ts +165 -0
  105. package/dist/api/item-projection.d.ts.map +1 -0
  106. package/dist/api/item-projection.js +235 -0
  107. package/dist/api/item-projection.js.map +1 -0
  108. package/dist/api/item-source-read.d.ts +45 -0
  109. package/dist/api/item-source-read.d.ts.map +1 -0
  110. package/dist/api/item-source-read.js +57 -0
  111. package/dist/api/item-source-read.js.map +1 -0
  112. package/dist/api/items-page-walker.d.ts +126 -0
  113. package/dist/api/items-page-walker.d.ts.map +1 -0
  114. package/dist/api/items-page-walker.js +256 -0
  115. package/dist/api/items-page-walker.js.map +1 -0
  116. package/dist/api/links.d.ts +70 -0
  117. package/dist/api/links.d.ts.map +1 -0
  118. package/dist/api/links.js +128 -0
  119. package/dist/api/links.js.map +1 -0
  120. package/dist/api/me-token.d.ts +52 -0
  121. package/dist/api/me-token.d.ts.map +1 -0
  122. package/dist/api/me-token.js +55 -0
  123. package/dist/api/me-token.js.map +1 -0
  124. package/dist/api/pagination.d.ts +201 -0
  125. package/dist/api/pagination.d.ts.map +1 -0
  126. package/dist/api/pagination.js +223 -0
  127. package/dist/api/pagination.js.map +1 -0
  128. package/dist/api/partial-success-mutation.d.ts +28 -0
  129. package/dist/api/partial-success-mutation.d.ts.map +1 -0
  130. package/dist/api/partial-success-mutation.js +68 -0
  131. package/dist/api/partial-success-mutation.js.map +1 -0
  132. package/dist/api/people.d.ts +182 -0
  133. package/dist/api/people.d.ts.map +1 -0
  134. package/dist/api/people.js +260 -0
  135. package/dist/api/people.js.map +1 -0
  136. package/dist/api/phones.d.ts +74 -0
  137. package/dist/api/phones.d.ts.map +1 -0
  138. package/dist/api/phones.js +167 -0
  139. package/dist/api/phones.js.map +1 -0
  140. package/dist/api/raw-document.d.ts +53 -0
  141. package/dist/api/raw-document.d.ts.map +1 -0
  142. package/dist/api/raw-document.js +177 -0
  143. package/dist/api/raw-document.js.map +1 -0
  144. package/dist/api/raw-write.d.ts +127 -0
  145. package/dist/api/raw-write.d.ts.map +1 -0
  146. package/dist/api/raw-write.js +233 -0
  147. package/dist/api/raw-write.js.map +1 -0
  148. package/dist/api/resolution-context.d.ts +32 -0
  149. package/dist/api/resolution-context.d.ts.map +1 -0
  150. package/dist/api/resolution-context.js +42 -0
  151. package/dist/api/resolution-context.js.map +1 -0
  152. package/dist/api/resolution-pass.d.ts +163 -0
  153. package/dist/api/resolution-pass.d.ts.map +1 -0
  154. package/dist/api/resolution-pass.js +254 -0
  155. package/dist/api/resolution-pass.js.map +1 -0
  156. package/dist/api/resolve-client.d.ts +69 -0
  157. package/dist/api/resolve-client.d.ts.map +1 -0
  158. package/dist/api/resolve-client.js +70 -0
  159. package/dist/api/resolve-client.js.map +1 -0
  160. package/dist/api/resolver-error-fold.d.ts +176 -0
  161. package/dist/api/resolver-error-fold.d.ts.map +1 -0
  162. package/dist/api/resolver-error-fold.js +230 -0
  163. package/dist/api/resolver-error-fold.js.map +1 -0
  164. package/dist/api/resolvers.d.ts +131 -0
  165. package/dist/api/resolvers.d.ts.map +1 -0
  166. package/dist/api/resolvers.js +262 -0
  167. package/dist/api/resolvers.js.map +1 -0
  168. package/dist/api/response-root.d.ts +65 -0
  169. package/dist/api/response-root.d.ts.map +1 -0
  170. package/dist/api/response-root.js +61 -0
  171. package/dist/api/response-root.js.map +1 -0
  172. package/dist/api/retry.d.ts +112 -0
  173. package/dist/api/retry.d.ts.map +1 -0
  174. package/dist/api/retry.js +181 -0
  175. package/dist/api/retry.js.map +1 -0
  176. package/dist/api/set-expression.d.ts +23 -0
  177. package/dist/api/set-expression.d.ts.map +1 -0
  178. package/dist/api/set-expression.js +31 -0
  179. package/dist/api/set-expression.js.map +1 -0
  180. package/dist/api/sort.d.ts +59 -0
  181. package/dist/api/sort.d.ts.map +1 -0
  182. package/dist/api/sort.js +73 -0
  183. package/dist/api/sort.js.map +1 -0
  184. package/dist/api/source-aggregator.d.ts +94 -0
  185. package/dist/api/source-aggregator.d.ts.map +1 -0
  186. package/dist/api/source-aggregator.js +111 -0
  187. package/dist/api/source-aggregator.js.map +1 -0
  188. package/dist/api/transport.d.ts +58 -0
  189. package/dist/api/transport.d.ts.map +1 -0
  190. package/dist/api/transport.js +190 -0
  191. package/dist/api/transport.js.map +1 -0
  192. package/dist/api/update-mutation-result.d.ts +133 -0
  193. package/dist/api/update-mutation-result.d.ts.map +1 -0
  194. package/dist/api/update-mutation-result.js +145 -0
  195. package/dist/api/update-mutation-result.js.map +1 -0
  196. package/dist/api/users-fan-out-mutation.d.ts +124 -0
  197. package/dist/api/users-fan-out-mutation.d.ts.map +1 -0
  198. package/dist/api/users-fan-out-mutation.js +331 -0
  199. package/dist/api/users-fan-out-mutation.js.map +1 -0
  200. package/dist/api/walk-pages.d.ts +91 -0
  201. package/dist/api/walk-pages.d.ts.map +1 -0
  202. package/dist/api/walk-pages.js +84 -0
  203. package/dist/api/walk-pages.js.map +1 -0
  204. package/dist/api/workspace-projection.d.ts +64 -0
  205. package/dist/api/workspace-projection.d.ts.map +1 -0
  206. package/dist/api/workspace-projection.js +83 -0
  207. package/dist/api/workspace-projection.js.map +1 -0
  208. package/dist/cli/envelope-out.d.ts +128 -0
  209. package/dist/cli/envelope-out.d.ts.map +1 -0
  210. package/dist/cli/envelope-out.js +146 -0
  211. package/dist/cli/envelope-out.js.map +1 -0
  212. package/dist/cli/index.d.ts +3 -0
  213. package/dist/cli/index.d.ts.map +1 -0
  214. package/dist/cli/index.js +27 -0
  215. package/dist/cli/index.js.map +1 -0
  216. package/dist/cli/program.d.ts +29 -0
  217. package/dist/cli/program.d.ts.map +1 -0
  218. package/dist/cli/program.js +109 -0
  219. package/dist/cli/program.js.map +1 -0
  220. package/dist/cli/run.d.ts +108 -0
  221. package/dist/cli/run.d.ts.map +1 -0
  222. package/dist/cli/run.js +105 -0
  223. package/dist/cli/run.js.map +1 -0
  224. package/dist/commands/account/client-helper.d.ts +37 -0
  225. package/dist/commands/account/client-helper.d.ts.map +1 -0
  226. package/dist/commands/account/client-helper.js +55 -0
  227. package/dist/commands/account/client-helper.js.map +1 -0
  228. package/dist/commands/account/complexity.d.ts +29 -0
  229. package/dist/commands/account/complexity.d.ts.map +1 -0
  230. package/dist/commands/account/complexity.js +70 -0
  231. package/dist/commands/account/complexity.js.map +1 -0
  232. package/dist/commands/account/info.d.ts +36 -0
  233. package/dist/commands/account/info.d.ts.map +1 -0
  234. package/dist/commands/account/info.js +74 -0
  235. package/dist/commands/account/info.js.map +1 -0
  236. package/dist/commands/account/version.d.ts +44 -0
  237. package/dist/commands/account/version.d.ts.map +1 -0
  238. package/dist/commands/account/version.js +98 -0
  239. package/dist/commands/account/version.js.map +1 -0
  240. package/dist/commands/account/whoami.d.ts +34 -0
  241. package/dist/commands/account/whoami.d.ts.map +1 -0
  242. package/dist/commands/account/whoami.js +77 -0
  243. package/dist/commands/account/whoami.js.map +1 -0
  244. package/dist/commands/board/add-users.d.ts +60 -0
  245. package/dist/commands/board/add-users.d.ts.map +1 -0
  246. package/dist/commands/board/add-users.js +133 -0
  247. package/dist/commands/board/add-users.js.map +1 -0
  248. package/dist/commands/board/archive.d.ts +64 -0
  249. package/dist/commands/board/archive.d.ts.map +1 -0
  250. package/dist/commands/board/archive.js +226 -0
  251. package/dist/commands/board/archive.js.map +1 -0
  252. package/dist/commands/board/column-create.d.ts +146 -0
  253. package/dist/commands/board/column-create.d.ts.map +1 -0
  254. package/dist/commands/board/column-create.js +564 -0
  255. package/dist/commands/board/column-create.js.map +1 -0
  256. package/dist/commands/board/column-delete.d.ts +76 -0
  257. package/dist/commands/board/column-delete.d.ts.map +1 -0
  258. package/dist/commands/board/column-delete.js +224 -0
  259. package/dist/commands/board/column-delete.js.map +1 -0
  260. package/dist/commands/board/column-update.d.ts +92 -0
  261. package/dist/commands/board/column-update.d.ts.map +1 -0
  262. package/dist/commands/board/column-update.js +364 -0
  263. package/dist/commands/board/column-update.js.map +1 -0
  264. package/dist/commands/board/columns.d.ts +30 -0
  265. package/dist/commands/board/columns.d.ts.map +1 -0
  266. package/dist/commands/board/columns.js +102 -0
  267. package/dist/commands/board/columns.js.map +1 -0
  268. package/dist/commands/board/create.d.ts +67 -0
  269. package/dist/commands/board/create.d.ts.map +1 -0
  270. package/dist/commands/board/create.js +226 -0
  271. package/dist/commands/board/create.js.map +1 -0
  272. package/dist/commands/board/delete.d.ts +60 -0
  273. package/dist/commands/board/delete.d.ts.map +1 -0
  274. package/dist/commands/board/delete.js +192 -0
  275. package/dist/commands/board/delete.js.map +1 -0
  276. package/dist/commands/board/describe.d.ts +68 -0
  277. package/dist/commands/board/describe.d.ts.map +1 -0
  278. package/dist/commands/board/describe.js +241 -0
  279. package/dist/commands/board/describe.js.map +1 -0
  280. package/dist/commands/board/doctor.d.ts +108 -0
  281. package/dist/commands/board/doctor.d.ts.map +1 -0
  282. package/dist/commands/board/doctor.js +417 -0
  283. package/dist/commands/board/doctor.js.map +1 -0
  284. package/dist/commands/board/duplicate.d.ts +85 -0
  285. package/dist/commands/board/duplicate.d.ts.map +1 -0
  286. package/dist/commands/board/duplicate.js +281 -0
  287. package/dist/commands/board/duplicate.js.map +1 -0
  288. package/dist/commands/board/find.d.ts +47 -0
  289. package/dist/commands/board/find.d.ts.map +1 -0
  290. package/dist/commands/board/find.js +153 -0
  291. package/dist/commands/board/find.js.map +1 -0
  292. package/dist/commands/board/get.d.ts +41 -0
  293. package/dist/commands/board/get.d.ts.map +1 -0
  294. package/dist/commands/board/get.js +66 -0
  295. package/dist/commands/board/get.js.map +1 -0
  296. package/dist/commands/board/group-archive.d.ts +83 -0
  297. package/dist/commands/board/group-archive.d.ts.map +1 -0
  298. package/dist/commands/board/group-archive.js +264 -0
  299. package/dist/commands/board/group-archive.js.map +1 -0
  300. package/dist/commands/board/group-create.d.ts +118 -0
  301. package/dist/commands/board/group-create.d.ts.map +1 -0
  302. package/dist/commands/board/group-create.js +239 -0
  303. package/dist/commands/board/group-create.js.map +1 -0
  304. package/dist/commands/board/group-delete.d.ts +79 -0
  305. package/dist/commands/board/group-delete.d.ts.map +1 -0
  306. package/dist/commands/board/group-delete.js +222 -0
  307. package/dist/commands/board/group-delete.js.map +1 -0
  308. package/dist/commands/board/group-duplicate.d.ts +70 -0
  309. package/dist/commands/board/group-duplicate.d.ts.map +1 -0
  310. package/dist/commands/board/group-duplicate.js +219 -0
  311. package/dist/commands/board/group-duplicate.js.map +1 -0
  312. package/dist/commands/board/group-update.d.ts +145 -0
  313. package/dist/commands/board/group-update.d.ts.map +1 -0
  314. package/dist/commands/board/group-update.js +341 -0
  315. package/dist/commands/board/group-update.js.map +1 -0
  316. package/dist/commands/board/groups.d.ts +28 -0
  317. package/dist/commands/board/groups.d.ts.map +1 -0
  318. package/dist/commands/board/groups.js +85 -0
  319. package/dist/commands/board/groups.js.map +1 -0
  320. package/dist/commands/board/list.d.ts +39 -0
  321. package/dist/commands/board/list.d.ts.map +1 -0
  322. package/dist/commands/board/list.js +135 -0
  323. package/dist/commands/board/list.js.map +1 -0
  324. package/dist/commands/board/subscribers.d.ts +24 -0
  325. package/dist/commands/board/subscribers.d.ts.map +1 -0
  326. package/dist/commands/board/subscribers.js +89 -0
  327. package/dist/commands/board/subscribers.js.map +1 -0
  328. package/dist/commands/board/update.d.ts +82 -0
  329. package/dist/commands/board/update.d.ts.map +1 -0
  330. package/dist/commands/board/update.js +328 -0
  331. package/dist/commands/board/update.js.map +1 -0
  332. package/dist/commands/cache/clear.d.ts +34 -0
  333. package/dist/commands/cache/clear.d.ts.map +1 -0
  334. package/dist/commands/cache/clear.js +113 -0
  335. package/dist/commands/cache/clear.js.map +1 -0
  336. package/dist/commands/cache/list.d.ts +50 -0
  337. package/dist/commands/cache/list.d.ts.map +1 -0
  338. package/dist/commands/cache/list.js +77 -0
  339. package/dist/commands/cache/list.js.map +1 -0
  340. package/dist/commands/cache/stats.d.ts +22 -0
  341. package/dist/commands/cache/stats.d.ts.map +1 -0
  342. package/dist/commands/cache/stats.js +56 -0
  343. package/dist/commands/cache/stats.js.map +1 -0
  344. package/dist/commands/config/path.d.ts +22 -0
  345. package/dist/commands/config/path.d.ts.map +1 -0
  346. package/dist/commands/config/path.js +74 -0
  347. package/dist/commands/config/path.js.map +1 -0
  348. package/dist/commands/config/show.d.ts +61 -0
  349. package/dist/commands/config/show.d.ts.map +1 -0
  350. package/dist/commands/config/show.js +137 -0
  351. package/dist/commands/config/show.js.map +1 -0
  352. package/dist/commands/emit.d.ts +156 -0
  353. package/dist/commands/emit.d.ts.map +1 -0
  354. package/dist/commands/emit.js +212 -0
  355. package/dist/commands/emit.js.map +1 -0
  356. package/dist/commands/index.d.ts +5 -0
  357. package/dist/commands/index.d.ts.map +1 -0
  358. package/dist/commands/index.js +195 -0
  359. package/dist/commands/index.js.map +1 -0
  360. package/dist/commands/item/archive.d.ts +81 -0
  361. package/dist/commands/item/archive.d.ts.map +1 -0
  362. package/dist/commands/item/archive.js +187 -0
  363. package/dist/commands/item/archive.js.map +1 -0
  364. package/dist/commands/item/clear.d.ts +140 -0
  365. package/dist/commands/item/clear.d.ts.map +1 -0
  366. package/dist/commands/item/clear.js +748 -0
  367. package/dist/commands/item/clear.js.map +1 -0
  368. package/dist/commands/item/create.d.ts +77 -0
  369. package/dist/commands/item/create.d.ts.map +1 -0
  370. package/dist/commands/item/create.js +802 -0
  371. package/dist/commands/item/create.js.map +1 -0
  372. package/dist/commands/item/delete.d.ts +82 -0
  373. package/dist/commands/item/delete.d.ts.map +1 -0
  374. package/dist/commands/item/delete.js +179 -0
  375. package/dist/commands/item/delete.js.map +1 -0
  376. package/dist/commands/item/duplicate.d.ts +117 -0
  377. package/dist/commands/item/duplicate.d.ts.map +1 -0
  378. package/dist/commands/item/duplicate.js +238 -0
  379. package/dist/commands/item/duplicate.js.map +1 -0
  380. package/dist/commands/item/find.d.ts +55 -0
  381. package/dist/commands/item/find.d.ts.map +1 -0
  382. package/dist/commands/item/find.js +231 -0
  383. package/dist/commands/item/find.js.map +1 -0
  384. package/dist/commands/item/get.d.ts +47 -0
  385. package/dist/commands/item/get.d.ts.map +1 -0
  386. package/dist/commands/item/get.js +66 -0
  387. package/dist/commands/item/get.js.map +1 -0
  388. package/dist/commands/item/list.d.ts +73 -0
  389. package/dist/commands/item/list.d.ts.map +1 -0
  390. package/dist/commands/item/list.js +284 -0
  391. package/dist/commands/item/list.js.map +1 -0
  392. package/dist/commands/item/move.d.ts +181 -0
  393. package/dist/commands/item/move.d.ts.map +1 -0
  394. package/dist/commands/item/move.js +560 -0
  395. package/dist/commands/item/move.js.map +1 -0
  396. package/dist/commands/item/search.d.ts +67 -0
  397. package/dist/commands/item/search.d.ts.map +1 -0
  398. package/dist/commands/item/search.js +322 -0
  399. package/dist/commands/item/search.js.map +1 -0
  400. package/dist/commands/item/set.d.ts +88 -0
  401. package/dist/commands/item/set.d.ts.map +1 -0
  402. package/dist/commands/item/set.js +387 -0
  403. package/dist/commands/item/set.js.map +1 -0
  404. package/dist/commands/item/subitems.d.ts +50 -0
  405. package/dist/commands/item/subitems.d.ts.map +1 -0
  406. package/dist/commands/item/subitems.js +86 -0
  407. package/dist/commands/item/subitems.js.map +1 -0
  408. package/dist/commands/item/update.d.ts +99 -0
  409. package/dist/commands/item/update.d.ts.map +1 -0
  410. package/dist/commands/item/update.js +884 -0
  411. package/dist/commands/item/update.js.map +1 -0
  412. package/dist/commands/item/upsert.d.ts +105 -0
  413. package/dist/commands/item/upsert.d.ts.map +1 -0
  414. package/dist/commands/item/upsert.js +998 -0
  415. package/dist/commands/item/upsert.js.map +1 -0
  416. package/dist/commands/parse-argv.d.ts +20 -0
  417. package/dist/commands/parse-argv.d.ts.map +1 -0
  418. package/dist/commands/parse-argv.js +40 -0
  419. package/dist/commands/parse-argv.js.map +1 -0
  420. package/dist/commands/raw/index.d.ts +23 -0
  421. package/dist/commands/raw/index.d.ts.map +1 -0
  422. package/dist/commands/raw/index.js +416 -0
  423. package/dist/commands/raw/index.js.map +1 -0
  424. package/dist/commands/run-by-id-lookup.d.ts +72 -0
  425. package/dist/commands/run-by-id-lookup.d.ts.map +1 -0
  426. package/dist/commands/run-by-id-lookup.js +58 -0
  427. package/dist/commands/run-by-id-lookup.js.map +1 -0
  428. package/dist/commands/schema/index.d.ts +104 -0
  429. package/dist/commands/schema/index.d.ts.map +1 -0
  430. package/dist/commands/schema/index.js +183 -0
  431. package/dist/commands/schema/index.js.map +1 -0
  432. package/dist/commands/types.d.ts +66 -0
  433. package/dist/commands/types.d.ts.map +1 -0
  434. package/dist/commands/types.js +15 -0
  435. package/dist/commands/types.js.map +1 -0
  436. package/dist/commands/update/body-source.d.ts +38 -0
  437. package/dist/commands/update/body-source.d.ts.map +1 -0
  438. package/dist/commands/update/body-source.js +80 -0
  439. package/dist/commands/update/body-source.js.map +1 -0
  440. package/dist/commands/update/clear-all.d.ts +67 -0
  441. package/dist/commands/update/clear-all.d.ts.map +1 -0
  442. package/dist/commands/update/clear-all.js +281 -0
  443. package/dist/commands/update/clear-all.js.map +1 -0
  444. package/dist/commands/update/create.d.ts +51 -0
  445. package/dist/commands/update/create.d.ts.map +1 -0
  446. package/dist/commands/update/create.js +167 -0
  447. package/dist/commands/update/create.js.map +1 -0
  448. package/dist/commands/update/delete.d.ts +53 -0
  449. package/dist/commands/update/delete.d.ts.map +1 -0
  450. package/dist/commands/update/delete.js +148 -0
  451. package/dist/commands/update/delete.js.map +1 -0
  452. package/dist/commands/update/edit.d.ts +37 -0
  453. package/dist/commands/update/edit.d.ts.map +1 -0
  454. package/dist/commands/update/edit.js +129 -0
  455. package/dist/commands/update/edit.js.map +1 -0
  456. package/dist/commands/update/get.d.ts +37 -0
  457. package/dist/commands/update/get.d.ts.map +1 -0
  458. package/dist/commands/update/get.js +92 -0
  459. package/dist/commands/update/get.js.map +1 -0
  460. package/dist/commands/update/like.d.ts +17 -0
  461. package/dist/commands/update/like.d.ts.map +1 -0
  462. package/dist/commands/update/like.js +23 -0
  463. package/dist/commands/update/like.js.map +1 -0
  464. package/dist/commands/update/list.d.ts +58 -0
  465. package/dist/commands/update/list.d.ts.map +1 -0
  466. package/dist/commands/update/list.js +322 -0
  467. package/dist/commands/update/list.js.map +1 -0
  468. package/dist/commands/update/pin.d.ts +17 -0
  469. package/dist/commands/update/pin.d.ts.map +1 -0
  470. package/dist/commands/update/pin.js +23 -0
  471. package/dist/commands/update/pin.js.map +1 -0
  472. package/dist/commands/update/reply.d.ts +47 -0
  473. package/dist/commands/update/reply.d.ts.map +1 -0
  474. package/dist/commands/update/reply.js +149 -0
  475. package/dist/commands/update/reply.js.map +1 -0
  476. package/dist/commands/update/toggle.d.ts +70 -0
  477. package/dist/commands/update/toggle.d.ts.map +1 -0
  478. package/dist/commands/update/toggle.js +118 -0
  479. package/dist/commands/update/toggle.js.map +1 -0
  480. package/dist/commands/update/unlike.d.ts +17 -0
  481. package/dist/commands/update/unlike.d.ts.map +1 -0
  482. package/dist/commands/update/unlike.js +22 -0
  483. package/dist/commands/update/unlike.js.map +1 -0
  484. package/dist/commands/update/unpin.d.ts +17 -0
  485. package/dist/commands/update/unpin.d.ts.map +1 -0
  486. package/dist/commands/update/unpin.js +21 -0
  487. package/dist/commands/update/unpin.js.map +1 -0
  488. package/dist/commands/user/get.d.ts +31 -0
  489. package/dist/commands/user/get.d.ts.map +1 -0
  490. package/dist/commands/user/get.js +81 -0
  491. package/dist/commands/user/get.js.map +1 -0
  492. package/dist/commands/user/list.d.ts +61 -0
  493. package/dist/commands/user/list.d.ts.map +1 -0
  494. package/dist/commands/user/list.js +148 -0
  495. package/dist/commands/user/list.js.map +1 -0
  496. package/dist/commands/user/me.d.ts +17 -0
  497. package/dist/commands/user/me.d.ts.map +1 -0
  498. package/dist/commands/user/me.js +49 -0
  499. package/dist/commands/user/me.js.map +1 -0
  500. package/dist/commands/workspace/add-users.d.ts +76 -0
  501. package/dist/commands/workspace/add-users.d.ts.map +1 -0
  502. package/dist/commands/workspace/add-users.js +154 -0
  503. package/dist/commands/workspace/add-users.js.map +1 -0
  504. package/dist/commands/workspace/create.d.ts +59 -0
  505. package/dist/commands/workspace/create.d.ts.map +1 -0
  506. package/dist/commands/workspace/create.js +163 -0
  507. package/dist/commands/workspace/create.js.map +1 -0
  508. package/dist/commands/workspace/delete.d.ts +67 -0
  509. package/dist/commands/workspace/delete.d.ts.map +1 -0
  510. package/dist/commands/workspace/delete.js +182 -0
  511. package/dist/commands/workspace/delete.js.map +1 -0
  512. package/dist/commands/workspace/folders.d.ts +40 -0
  513. package/dist/commands/workspace/folders.d.ts.map +1 -0
  514. package/dist/commands/workspace/folders.js +124 -0
  515. package/dist/commands/workspace/folders.js.map +1 -0
  516. package/dist/commands/workspace/get.d.ts +35 -0
  517. package/dist/commands/workspace/get.d.ts.map +1 -0
  518. package/dist/commands/workspace/get.js +62 -0
  519. package/dist/commands/workspace/get.js.map +1 -0
  520. package/dist/commands/workspace/list.d.ts +57 -0
  521. package/dist/commands/workspace/list.d.ts.map +1 -0
  522. package/dist/commands/workspace/list.js +125 -0
  523. package/dist/commands/workspace/list.js.map +1 -0
  524. package/dist/commands/workspace/remove-users.d.ts +47 -0
  525. package/dist/commands/workspace/remove-users.d.ts.map +1 -0
  526. package/dist/commands/workspace/remove-users.js +122 -0
  527. package/dist/commands/workspace/remove-users.js.map +1 -0
  528. package/dist/commands/workspace/update.d.ts +68 -0
  529. package/dist/commands/workspace/update.d.ts.map +1 -0
  530. package/dist/commands/workspace/update.js +237 -0
  531. package/dist/commands/workspace/update.js.map +1 -0
  532. package/dist/config/load.d.ts +33 -0
  533. package/dist/config/load.d.ts.map +1 -0
  534. package/dist/config/load.js +81 -0
  535. package/dist/config/load.js.map +1 -0
  536. package/dist/index.d.ts +3 -0
  537. package/dist/index.d.ts.map +1 -0
  538. package/dist/index.js +4 -0
  539. package/dist/index.js.map +1 -0
  540. package/dist/types/global-flags.d.ts +69 -0
  541. package/dist/types/global-flags.d.ts.map +1 -0
  542. package/dist/types/global-flags.js +170 -0
  543. package/dist/types/global-flags.js.map +1 -0
  544. package/dist/types/ids.d.ts +38 -0
  545. package/dist/types/ids.d.ts.map +1 -0
  546. package/dist/types/ids.js +51 -0
  547. package/dist/types/ids.js.map +1 -0
  548. package/dist/types/json.d.ts +60 -0
  549. package/dist/types/json.d.ts.map +1 -0
  550. package/dist/types/json.js +33 -0
  551. package/dist/types/json.js.map +1 -0
  552. package/dist/utils/errors.d.ts +121 -0
  553. package/dist/utils/errors.d.ts.map +1 -0
  554. package/dist/utils/errors.js +264 -0
  555. package/dist/utils/errors.js.map +1 -0
  556. package/dist/utils/logger.d.ts +39 -0
  557. package/dist/utils/logger.d.ts.map +1 -0
  558. package/dist/utils/logger.js +49 -0
  559. package/dist/utils/logger.js.map +1 -0
  560. package/dist/utils/output/envelope.d.ts +140 -0
  561. package/dist/utils/output/envelope.d.ts.map +1 -0
  562. package/dist/utils/output/envelope.js +120 -0
  563. package/dist/utils/output/envelope.js.map +1 -0
  564. package/dist/utils/output/json.d.ts +10 -0
  565. package/dist/utils/output/json.d.ts.map +1 -0
  566. package/dist/utils/output/json.js +12 -0
  567. package/dist/utils/output/json.js.map +1 -0
  568. package/dist/utils/output/ndjson.d.ts +92 -0
  569. package/dist/utils/output/ndjson.d.ts.map +1 -0
  570. package/dist/utils/output/ndjson.js +33 -0
  571. package/dist/utils/output/ndjson.js.map +1 -0
  572. package/dist/utils/output/select.d.ts +22 -0
  573. package/dist/utils/output/select.d.ts.map +1 -0
  574. package/dist/utils/output/select.js +47 -0
  575. package/dist/utils/output/select.js.map +1 -0
  576. package/dist/utils/output/table.d.ts +32 -0
  577. package/dist/utils/output/table.d.ts.map +1 -0
  578. package/dist/utils/output/table.js +133 -0
  579. package/dist/utils/output/table.js.map +1 -0
  580. package/dist/utils/output/text.d.ts +5 -0
  581. package/dist/utils/output/text.d.ts.map +1 -0
  582. package/dist/utils/output/text.js +32 -0
  583. package/dist/utils/output/text.js.map +1 -0
  584. package/dist/utils/parse-boundary.d.ts +53 -0
  585. package/dist/utils/parse-boundary.d.ts.map +1 -0
  586. package/dist/utils/parse-boundary.js +62 -0
  587. package/dist/utils/parse-boundary.js.map +1 -0
  588. package/dist/utils/redact.d.ts +54 -0
  589. package/dist/utils/redact.d.ts.map +1 -0
  590. package/dist/utils/redact.js +154 -0
  591. package/dist/utils/redact.js.map +1 -0
  592. package/dist/utils/request-id.d.ts +17 -0
  593. package/dist/utils/request-id.d.ts.map +1 -0
  594. package/dist/utils/request-id.js +26 -0
  595. package/dist/utils/request-id.js.map +1 -0
  596. package/package.json +87 -0
@@ -0,0 +1,884 @@
1
+ /**
2
+ * `monday item update <iid> [--name <n>] [--set <col>=<val>]...` —
3
+ * multi-column atomic update + optional rename.
4
+ * (`cli-design.md` §4.3 line 490, §5.3, `v0.1-plan.md` §3 M5b).
5
+ *
6
+ * Two argv shapes:
7
+ *
8
+ * 1. **Single-item** (this commit): positional `<itemId>` +
9
+ * repeatable `--set <col>=<val>` + optional `--name <n>`.
10
+ * Multi-`--set` (≥2) bundles into one
11
+ * `change_multiple_column_values` mutation (atomic on Monday's
12
+ * side per §5.3 step 5). `--name` rolls into the same multi
13
+ * mutation when columns are also present, otherwise fires a
14
+ * dedicated `change_simple_column_value(column_id: "name", ...)`.
15
+ *
16
+ * 2. **Bulk** (next commit): `--where <expr>` repeatable + no
17
+ * positional `<itemId>` — applies the same `--set` / `--name`
18
+ * bundle to every matching item via Monday's `items_page`
19
+ * walker. `confirmation_required` fires without `--yes` (and
20
+ * without `--dry-run`) per cli-design §10.2.
21
+ *
22
+ * **`--name` + `--set` atomicity.** Per cli-design §5.3 step 5, the
23
+ * design promises atomicity for multi-column updates. Bundling the
24
+ * name into the multi mutation keeps the same atomicity guarantee
25
+ * for `--name + --set`. Monday's
26
+ * `change_multiple_column_values(column_values: JSON!)` accepts
27
+ * `name` as a special key in the map. The dry-run engine produces
28
+ * a single `PlannedChange` whose `diff` includes both column keys
29
+ * and a `name` key when both are passed.
30
+ *
31
+ * **`--name` only.** Single field → `change_simple_column_value(
32
+ * column_id: "name", value: <n>)`. Atomic by default (single
33
+ * mutation).
34
+ *
35
+ * **`--create-labels-if-missing`** (cli-design §4.3) — passes
36
+ * through to Monday's `change_*_column_value(create_labels_if_missing:
37
+ * true)`. Tells Monday to auto-create unknown status / dropdown
38
+ * labels rather than rejecting with `validation_failed`. Off by
39
+ * default; agents who want labels-on-demand pass the flag
40
+ * explicitly.
41
+ *
42
+ * Idempotent: yes — `change_*` mutations are idempotent. Multi-set
43
+ * is also idempotent (re-running with the same args produces the
44
+ * same item state).
45
+ */
46
+ import { z } from 'zod';
47
+ import { ensureSubcommand } from '../types.js';
48
+ import { emitDryRun, emitMutation } from '../emit.js';
49
+ import { resolveClient } from '../../api/resolve-client.js';
50
+ import { BoardIdSchema, ItemIdSchema } from '../../types/ids.js';
51
+ import { parseArgv } from '../parse-argv.js';
52
+ import { ApiError, MondayCliError, UsageError } from '../../utils/errors.js';
53
+ import { selectMutation, } from '../../api/column-values.js';
54
+ import { parseSetRawExpression, } from '../../api/raw-write.js';
55
+ import { splitSetExpression } from '../../api/set-expression.js';
56
+ import { buildResolutionContexts } from '../../api/resolution-context.js';
57
+ import { resolveBoardId } from '../../api/item-board-lookup.js';
58
+ import { SourceAggregator } from '../../api/source-aggregator.js';
59
+ import { resolveAndTranslate } from '../../api/resolution-pass.js';
60
+ import { foldAndRemap } from '../../api/resolver-error-fold.js';
61
+ import { planChanges } from '../../api/dry-run.js';
62
+ import { buildQueryParams } from '../../api/filters.js';
63
+ import { loadBoardMetadata, refreshBoardMetadata, } from '../../api/board-metadata.js';
64
+ import { DEFAULT_PAGE_SIZE, paginate, } from '../../api/pagination.js';
65
+ import { fetchItemsPage, fetchNextItemsPage, } from '../../api/items-page-walker.js';
66
+ import { ConfirmationRequiredError, } from '../../utils/errors.js';
67
+ import { ITEM_FIELDS_FRAGMENT, resolveMeFactory, } from '../../api/item-helpers.js';
68
+ import { projectMutationItem as projectMutationItemShared } from '../../api/item-mutation-result.js';
69
+ import { projectedItemSchema, } from '../../api/item-projection.js';
70
+ const CHANGE_SIMPLE_COLUMN_VALUE_MUTATION = `
71
+ mutation ItemUpdateSimple(
72
+ $itemId: ID!
73
+ $boardId: ID!
74
+ $columnId: String!
75
+ $value: String!
76
+ $createLabelsIfMissing: Boolean
77
+ ) {
78
+ change_simple_column_value(
79
+ item_id: $itemId
80
+ board_id: $boardId
81
+ column_id: $columnId
82
+ value: $value
83
+ create_labels_if_missing: $createLabelsIfMissing
84
+ ) {
85
+ ${ITEM_FIELDS_FRAGMENT}
86
+ }
87
+ }
88
+ `;
89
+ const CHANGE_COLUMN_VALUE_MUTATION = `
90
+ mutation ItemUpdateRich(
91
+ $itemId: ID!
92
+ $boardId: ID!
93
+ $columnId: String!
94
+ $value: JSON!
95
+ $createLabelsIfMissing: Boolean
96
+ ) {
97
+ change_column_value(
98
+ item_id: $itemId
99
+ board_id: $boardId
100
+ column_id: $columnId
101
+ value: $value
102
+ create_labels_if_missing: $createLabelsIfMissing
103
+ ) {
104
+ ${ITEM_FIELDS_FRAGMENT}
105
+ }
106
+ }
107
+ `;
108
+ const CHANGE_MULTIPLE_COLUMN_VALUES_MUTATION = `
109
+ mutation ItemUpdateMulti(
110
+ $itemId: ID!
111
+ $boardId: ID!
112
+ $columnValues: JSON!
113
+ $createLabelsIfMissing: Boolean
114
+ ) {
115
+ change_multiple_column_values(
116
+ item_id: $itemId
117
+ board_id: $boardId
118
+ column_values: $columnValues
119
+ create_labels_if_missing: $createLabelsIfMissing
120
+ ) {
121
+ ${ITEM_FIELDS_FRAGMENT}
122
+ }
123
+ }
124
+ `;
125
+ export const itemUpdateOutputSchema = projectedItemSchema;
126
+ /**
127
+ * Input shape — supports both single-item and bulk shapes.
128
+ *
129
+ * - Single-item: `itemId` positional required; `where` empty.
130
+ * - Bulk: `itemId` positional omitted; `where` non-empty
131
+ * AND `board` required.
132
+ *
133
+ * The split lives in `validateInputShape` (action body) so the zod
134
+ * schema captures the union without the per-shape conditional logic
135
+ * — the action layer reads the discriminator and dispatches.
136
+ */
137
+ const inputSchema = z
138
+ .object({
139
+ itemId: ItemIdSchema.optional(),
140
+ set: z.array(z.string()).default([]),
141
+ // M8: --set-raw <col>=<json>... repeatable raw escape hatch.
142
+ // Mutually exclusive per-column with --set; the duplicate-ID
143
+ // check fires in the dry-run engine + selectMutation per
144
+ // cli-design §5.3 line 961-972 (resolution-time, not parse-time).
145
+ setRaw: z.array(z.string()).default([]),
146
+ name: z.string().min(1).optional(),
147
+ board: BoardIdSchema.optional(),
148
+ where: z.array(z.string()).default([]),
149
+ // Empty `--filter-json ''` would slip through `buildQueryParams`
150
+ // as "no filter" (`hasFilterJson` is gated on `length > 0`) while
151
+ // still tripping `validateInputShape`'s "bulk mode" discriminator
152
+ // (`filterJson !== undefined`) — net effect, a whole-board mutation
153
+ // an agent likely thought was filtered. Reject at the schema
154
+ // boundary so no network call fires. Codex pass-3 of the §10.2
155
+ // backfill PR caught this — see v0.1-plan §3 M5b session 4.
156
+ //
157
+ // `.refine(trim)` rather than `.min(1)` so a whitespace-only
158
+ // `--filter-json ' '` is also caught at the schema boundary;
159
+ // pre-fix it slipped past `.min(1)` and only failed inside
160
+ // `parseFilterJson` AFTER board metadata loaded — same
161
+ // ultimate `usage_error`, but a wasted network call (Codex
162
+ // pass-1 of this fix).
163
+ filterJson: z
164
+ .string()
165
+ .refine((s) => s.trim().length > 0, '--filter-json must be a non-empty JSON object')
166
+ .optional(),
167
+ createLabelsIfMissing: z.boolean().optional(),
168
+ })
169
+ .strict()
170
+ // At least one of --set / --set-raw / --name must be provided. An
171
+ // empty call (`monday item update 12345`) is meaningless and would
172
+ // produce a zero-mutation envelope that surprises agents. M8 widens
173
+ // the rule to include --set-raw.
174
+ .refine((v) => v.set.length > 0 || v.setRaw.length > 0 || v.name !== undefined, {
175
+ message: 'item update requires at least one of --set / --set-raw / --name',
176
+ path: ['set'],
177
+ });
178
+ const validateInputShape = (parsed) => {
179
+ const hasItemId = parsed.itemId !== undefined;
180
+ const hasFilter = parsed.where.length > 0 || parsed.filterJson !== undefined;
181
+ if (hasItemId && hasFilter) {
182
+ throw new UsageError('item update accepts either a positional <itemId> OR --where / ' +
183
+ '--filter-json (bulk shape), not both. Pick one.', { details: { item_id: parsed.itemId, where_count: parsed.where.length } });
184
+ }
185
+ if (!hasItemId && !hasFilter) {
186
+ throw new UsageError('item update requires either a positional <itemId> or --where / ' +
187
+ '--filter-json for the bulk shape.', { details: {} });
188
+ }
189
+ if (hasFilter && parsed.board === undefined) {
190
+ throw new UsageError('item update --where / --filter-json requires --board <bid>. The ' +
191
+ 'bulk shape walks Monday\'s items_page on the named board.', { details: { where_count: parsed.where.length } });
192
+ }
193
+ if (hasItemId) {
194
+ /* c8 ignore next 4 — defensive: hasItemId === true means
195
+ parsed.itemId is non-undefined; the type guard exists for TS. */
196
+ if (parsed.itemId === undefined) {
197
+ throw new UsageError('item update: itemId narrowing failed');
198
+ }
199
+ return { kind: 'single', itemId: parsed.itemId };
200
+ }
201
+ return { kind: 'bulk' };
202
+ };
203
+ export const itemUpdateCommand = {
204
+ name: 'item.update',
205
+ summary: 'Update one or more columns on an item (atomic)',
206
+ examples: [
207
+ 'monday item update 12345 --set status=Done',
208
+ 'monday item update 12345 --set status=Done --set owner=alice@example.com',
209
+ 'monday item update 12345 --name "New title"',
210
+ 'monday item update 12345 --name "New title" --set status=Done',
211
+ 'monday item update 12345 --set tags=Backend,Frontend --create-labels-if-missing',
212
+ 'monday item update 12345 --set status=Done --dry-run --json',
213
+ "monday item update 12345 --set-raw status='{\"label\":\"Done\"}'",
214
+ "monday item update 12345 --set status=Done --set-raw tags_1='{\"tag_ids\":[1,2]}'",
215
+ ],
216
+ idempotent: true,
217
+ inputSchema,
218
+ outputSchema: itemUpdateOutputSchema,
219
+ attach: (program, ctx) => {
220
+ const noun = ensureSubcommand(program, 'item', 'Item commands');
221
+ noun
222
+ .command('update [itemId]')
223
+ .description(itemUpdateCommand.summary)
224
+ .option('--set <expr>', 'repeatable <col>=<val> column write', (value, prev) => [...prev, value], [])
225
+ .option('--set-raw <expr>', 'repeatable <col>=<json> raw write (escape hatch — bypasses friendly translator)', (value, prev) => [...prev, value], [])
226
+ .option('--name <n>', 'rename the item')
227
+ .option('--board <bid>', 'board ID (required for bulk; skip lookup for single-item)')
228
+ .option('--where <expr>', 'repeatable bulk filter (cli-design §10.2): <col><op><val>', (value, prev) => [...prev, value], [])
229
+ .option('--filter-json <json>', 'literal Monday query_params for bulk')
230
+ // `--yes` is a GLOBAL flag (`src/cli/program.ts`); read it via
231
+ // `globalFlags.yes` rather than redeclaring on this subcommand
232
+ // so the flag stays single-source-of-truth across every M5b /
233
+ // M6 mutation surface (and so commander doesn't dispatch the
234
+ // value to a per-subcommand slot that diverges from the
235
+ // global one).
236
+ .option('--create-labels-if-missing', 'auto-create unknown status / dropdown labels (Monday flag)')
237
+ .addHelpText('after', ['', 'Examples:', ...itemUpdateCommand.examples.map((e) => ` ${e}`), ''].join('\n'))
238
+ .action(async (itemId, opts) => {
239
+ const parsed = parseArgv(itemUpdateCommand.inputSchema, {
240
+ ...(itemId === undefined ? {} : { itemId }),
241
+ ...opts,
242
+ });
243
+ const { client, globalFlags, apiVersion, toEmit } = resolveClient(ctx, program.opts());
244
+ const dispatch = validateInputShape(parsed);
245
+ if (dispatch.kind === 'bulk') {
246
+ await runBulk({
247
+ parsed,
248
+ client,
249
+ globalFlags,
250
+ apiVersion,
251
+ ctx,
252
+ programOpts: program.opts(),
253
+ });
254
+ return;
255
+ }
256
+ // Argv-parse-time failures fire BEFORE board lookup / metadata
257
+ // fetch. Splits + JSON parse run on pure strings; surfacing here
258
+ // means a malformed --set or --set-raw fails fast without
259
+ // burning an `ItemBoardLookup` round-trip when `--board` was
260
+ // omitted (Codex M8 finding #4 — pre-fix this parse ran AFTER
261
+ // resolveBoardId, contradicting the argv-boundary contract used
262
+ // by `item set` and the bulk path).
263
+ const setEntries = parsed.set.map(splitSetExpression);
264
+ const rawEntries = parsed.setRaw.map(parseSetRawExpression);
265
+ const boardId = await resolveBoardId({
266
+ client,
267
+ itemId: dispatch.itemId,
268
+ explicit: parsed.board,
269
+ });
270
+ const { dateResolution, peopleResolution } = buildResolutionContexts({ client, ctx, globalFlags });
271
+ if (globalFlags.dryRun) {
272
+ const result = await planChanges({
273
+ client,
274
+ boardId,
275
+ itemId: dispatch.itemId,
276
+ setEntries,
277
+ ...(rawEntries.length === 0 ? {} : { rawEntries }),
278
+ ...(parsed.name === undefined ? {} : { nameChange: parsed.name }),
279
+ dateResolution,
280
+ peopleResolution,
281
+ env: ctx.env,
282
+ noCache: globalFlags.noCache,
283
+ });
284
+ emitDryRun({
285
+ ctx,
286
+ programOpts: program.opts(),
287
+ plannedChanges: result.plannedChanges,
288
+ source: result.source,
289
+ cacheAgeSeconds: result.cacheAgeSeconds,
290
+ warnings: result.warnings,
291
+ apiVersion,
292
+ });
293
+ return;
294
+ }
295
+ // Live update path — three-pass resolution + translation
296
+ // through the shared helper (R20 lift).
297
+ const resolutionResult = await resolveAndTranslate({
298
+ client,
299
+ boardId,
300
+ setEntries,
301
+ rawEntries,
302
+ dateResolution,
303
+ peopleResolution,
304
+ env: ctx.env,
305
+ noCache: globalFlags.noCache,
306
+ });
307
+ const collectedWarnings = [
308
+ ...resolutionResult.warnings,
309
+ ];
310
+ const resolvedIds = resolutionResult.resolvedIds;
311
+ const sourceAgg = new SourceAggregator();
312
+ if (resolutionResult.source !== undefined) {
313
+ sourceAgg.record(resolutionResult.source, resolutionResult.cacheAgeSeconds);
314
+ }
315
+ const translated = resolutionResult.translated;
316
+ // Build the final SelectedMutation. When `--name` is set,
317
+ // a synthetic translated value (columnId: "name",
318
+ // columnType: "text") joins the array so `selectMutation`
319
+ // dispatches uniformly: name-only → simple; columns + name
320
+ // (or ≥2 columns) → multi.
321
+ const allTranslated = parsed.name === undefined
322
+ ? translated
323
+ : [
324
+ {
325
+ columnId: 'name',
326
+ columnType: 'text',
327
+ rawInput: parsed.name,
328
+ payload: { format: 'simple', value: parsed.name },
329
+ resolvedFrom: null,
330
+ peopleResolution: null,
331
+ },
332
+ ...translated,
333
+ ];
334
+ let mutationResult;
335
+ try {
336
+ const mutation = selectMutation(allTranslated);
337
+ mutationResult = await executeMutation(client, {
338
+ mutation,
339
+ itemId: dispatch.itemId,
340
+ boardId,
341
+ createLabelsIfMissing: parsed.createLabelsIfMissing,
342
+ });
343
+ }
344
+ catch (err) {
345
+ if (err instanceof MondayCliError) {
346
+ // F4 remap: cache-sourced resolution + Monday rejecting
347
+ // as validation_failed → check live archived state.
348
+ // Codex M5b finding #3: pass every translated column ID so
349
+ // a multi-column update where a LATER target was archived
350
+ // (post stale-cache read) still remaps.
351
+ // Codex pass-1 F2: pass the actual aggregated resolution
352
+ // source (live / cache / mixed) so plain cache hits
353
+ // without `stale_cache_refreshed` warnings still trigger
354
+ // the remap.
355
+ throw await foldAndRemap({
356
+ err,
357
+ warnings: collectedWarnings,
358
+ client,
359
+ boardId,
360
+ columnIds: translated.map((t) => t.columnId),
361
+ env: ctx.env,
362
+ noCache: globalFlags.noCache,
363
+ resolutionSource: resolutionResult.source ?? 'live',
364
+ });
365
+ }
366
+ throw err;
367
+ }
368
+ const warnings = collectedWarnings;
369
+ // The mutation leg is always live — fold it into the
370
+ // aggregator so a cache-served resolution + live mutation
371
+ // surfaces as `mixed`. Mirrors the bulk path's terminal
372
+ // `record('live', null)` (Codex M5b finding #2; the
373
+ // warning-only inference pre-fix missed plain cache hits).
374
+ sourceAgg.record('live', null);
375
+ emitMutation({
376
+ ctx,
377
+ data: mutationResult.projected,
378
+ schema: itemUpdateCommand.outputSchema,
379
+ programOpts: program.opts(),
380
+ warnings,
381
+ ...toEmit(mutationResult.response),
382
+ ...sourceAgg.result(),
383
+ // resolved_ids — same shape as `item set`. The synthetic
384
+ // `name` field doesn't appear here because the slot only
385
+ // echoes RESOLVED tokens (those that went through the
386
+ // column resolver); `name` skipped that step.
387
+ resolvedIds,
388
+ });
389
+ });
390
+ },
391
+ };
392
+ const executeMutation = async (client, inputs) => {
393
+ const { mutation, itemId, boardId, createLabelsIfMissing } = inputs;
394
+ const labelsFlag = createLabelsIfMissing ?? false;
395
+ if (mutation.kind === 'change_simple_column_value') {
396
+ const response = await client.raw(CHANGE_SIMPLE_COLUMN_VALUE_MUTATION, {
397
+ itemId,
398
+ boardId,
399
+ columnId: mutation.columnId,
400
+ value: mutation.value,
401
+ createLabelsIfMissing: labelsFlag,
402
+ }, { operationName: 'ItemUpdateSimple' });
403
+ return {
404
+ projected: projectMutationItem(response.data.change_simple_column_value, itemId),
405
+ response,
406
+ };
407
+ }
408
+ if (mutation.kind === 'change_column_value') {
409
+ const response = await client.raw(CHANGE_COLUMN_VALUE_MUTATION, {
410
+ itemId,
411
+ boardId,
412
+ columnId: mutation.columnId,
413
+ value: mutation.value,
414
+ createLabelsIfMissing: labelsFlag,
415
+ }, { operationName: 'ItemUpdateRich' });
416
+ return {
417
+ projected: projectMutationItem(response.data.change_column_value, itemId),
418
+ response,
419
+ };
420
+ }
421
+ // change_multiple_column_values — multi-`--set` or `--set + --name`.
422
+ const response = await client.raw(CHANGE_MULTIPLE_COLUMN_VALUES_MUTATION, {
423
+ itemId,
424
+ boardId,
425
+ columnValues: mutation.columnValues,
426
+ createLabelsIfMissing: labelsFlag,
427
+ }, { operationName: 'ItemUpdateMulti' });
428
+ return {
429
+ projected: projectMutationItem(response.data.change_multiple_column_values, itemId),
430
+ response,
431
+ };
432
+ };
433
+ // Thin wrapper around `api/item-mutation-result.ts projectMutationItem`
434
+ // (R28). M5b's `internal_error` + "no item payload" semantics for an
435
+ // empty-payload mutation success are preserved; the wrapper keeps the
436
+ // existing `(raw, itemId)` call signature so the executeMutation arms
437
+ // + the bulk per-item dispatch site stay untouched.
438
+ const projectMutationItem = (raw, itemId) => projectMutationItemShared({
439
+ raw,
440
+ itemId,
441
+ errorCode: 'internal_error',
442
+ errorMessage: `Monday returned no item payload from the mutation for id ${itemId}.`,
443
+ });
444
+ /**
445
+ * Bulk dry-run aggregates per-item resolver warnings — the same
446
+ * `stale_cache_refreshed` / `column_token_collision` signals fire
447
+ * once per item the first time they're triggered (subsequent items
448
+ * hit the now-warm cache). De-duplicates by `code + message +
449
+ * details.token` so an agent reading the dry-run envelope sees
450
+ * each unique warning once rather than N copies. Order-preserving:
451
+ * the first occurrence wins.
452
+ */
453
+ const dedupeWarnings = (warnings) => {
454
+ const seen = new Set();
455
+ const out = [];
456
+ for (const w of warnings) {
457
+ const tokenKey = typeof w.details?.token === 'string'
458
+ ? w.details.token
459
+ : '';
460
+ const key = `${w.code}|${w.message}|${tokenKey}`;
461
+ if (seen.has(key))
462
+ continue;
463
+ seen.add(key);
464
+ out.push(w);
465
+ }
466
+ return out;
467
+ };
468
+ // ============================================================
469
+ // Bulk path (cli-design §10.2 — `--where` / `--filter-json`).
470
+ // items_page walker lifted into `api/items-page-walker.ts` per §18
471
+ // R34 (post-M12) — the helper builds the GraphQL queries inline +
472
+ // parses the response with the per-row schema below, surfacing
473
+ // schema drift as `internal_error` with the failing field path on
474
+ // `details.issues` rather than collapsing to a silent "0 matched,
475
+ // 0 applied" success (the F6 pass-2 hardening lifts to all four
476
+ // items_page consumers automatically).
477
+ // ============================================================
478
+ const bulkItemSchema = z.object({ id: ItemIdSchema }).loose();
479
+ /**
480
+ * Wrapped data shape for the bulk-live success envelope. cli-design
481
+ * §10.2 doesn't pin a specific shape for `data`, so we fold the
482
+ * matched / applied counts into a `summary` slot alongside the
483
+ * per-item projected list. Agents read `data.applied_count` for the
484
+ * "did it work?" probe and `data.items` for the post-mutation state.
485
+ */
486
+ const bulkLiveDataSchema = z.object({
487
+ summary: z.object({
488
+ matched_count: z.number().int().nonnegative(),
489
+ applied_count: z.number().int().nonnegative(),
490
+ board_id: z.string(),
491
+ }),
492
+ items: z.array(projectedItemSchema),
493
+ });
494
+ /**
495
+ * Bulk path orchestrator (cli-design §10.2). Walks `items_page` to
496
+ * collect every matched item, then dispatches:
497
+ *
498
+ * 1. Without `--yes` AND without `--dry-run` → throw
499
+ * `confirmation_required` with the matched count. Per
500
+ * cli-design §3.1 #7: "destructive ops without `--yes` fail
501
+ * fast." Bulk multi-item mutations qualify.
502
+ * 2. With `--dry-run` → per-item `planChanges` → emit N-element
503
+ * `planned_changes`. cli-design §10.2 line 1456-1457: "both
504
+ * single-item and bulk forms use the same envelope".
505
+ * 3. With `--yes` (and not `--dry-run`) → per-item live mutation
506
+ * via `executeMutation`. Fail-fast on first error; the error
507
+ * envelope's `details.applied_to` lists IDs of items that
508
+ * successfully mutated before the failure.
509
+ *
510
+ * **Why per-item planChanges / executeMutation rather than a
511
+ * single bulk mutation.** Monday has no true bulk-update mutation
512
+ * in 2026-01; the CLI walks items + fires N `change_*` calls. The
513
+ * column resolution + translation work is done once, then reused
514
+ * across every per-item mutation.
515
+ *
516
+ * **Sequential execution.** cli-design §9.3 mandates one-at-a-time
517
+ * requests in v0.1-v0.3; the per-item loop respects that. v0.4's
518
+ * `--concurrency` flag is the future extension point.
519
+ */
520
+ const runBulk = async (inputs) => {
521
+ const { parsed, client, globalFlags, apiVersion, ctx, programOpts } = inputs;
522
+ /* c8 ignore next 6 — defensive: validateInputShape guarantees
523
+ parsed.board is non-undefined when shape is bulk; the type
524
+ guard exists for TS. */
525
+ if (parsed.board === undefined) {
526
+ throw new UsageError('item update bulk path: --board is required');
527
+ }
528
+ const boardId = parsed.board;
529
+ // 0) Argv-parse-time failures before any network call. Splits +
530
+ // JSON parse run on pure strings; surfacing here means a
531
+ // malformed --set or malformed --set-raw fails fast without
532
+ // burning a board-metadata fetch + items_page walk + the
533
+ // confirmation prompt. M8 finding from review pass: pre-fix the
534
+ // parse ran AFTER the walk, so a malformed JSON paid two
535
+ // GraphQL round-trips before the agent saw the parse error.
536
+ const setEntries = parsed.set.map(splitSetExpression);
537
+ const rawEntries = parsed.setRaw.map(parseSetRawExpression);
538
+ // 1) Load board metadata (cache-aware, refresh on column-not-found
539
+ // during filter parsing per §5.3 step 5).
540
+ const meta = await loadBoardMetadata({
541
+ client,
542
+ boardId,
543
+ env: ctx.env,
544
+ noCache: globalFlags.noCache,
545
+ });
546
+ const onColumnNotFound = meta.source === 'cache'
547
+ ? async () => {
548
+ const refreshed = await refreshBoardMetadata({
549
+ client,
550
+ boardId,
551
+ env: ctx.env,
552
+ });
553
+ return refreshed.metadata;
554
+ }
555
+ : undefined;
556
+ const filterResult = await buildQueryParams({
557
+ metadata: meta.metadata,
558
+ resolveMe: resolveMeFactory(client),
559
+ whereClauses: parsed.where,
560
+ filterJson: parsed.filterJson,
561
+ ...(onColumnNotFound === undefined ? {} : { onColumnNotFound }),
562
+ });
563
+ // 2) Walk items_page collecting matched item IDs. The §18 R34
564
+ // helper (`fetchItemsPage` / `fetchNextItemsPage`) supplies the
565
+ // GraphQL + parse boundary; `paginate.ts` keeps the §3.1 #8
566
+ // per-page sort + §5.6 `stale_cursor` enrichment.
567
+ const matchedItemIds = [];
568
+ await paginate({
569
+ fetchInitial: () => fetchItemsPage({
570
+ client,
571
+ operationName: 'ItemsPage',
572
+ boardId,
573
+ limit: DEFAULT_PAGE_SIZE,
574
+ queryParams: filterResult.queryParams,
575
+ itemFields: 'id',
576
+ itemSchema: bulkItemSchema,
577
+ }),
578
+ fetchNext: (cursor) => fetchNextItemsPage({
579
+ client,
580
+ operationName: 'NextItemsPage',
581
+ cursor,
582
+ limit: DEFAULT_PAGE_SIZE,
583
+ itemFields: 'id',
584
+ itemSchema: bulkItemSchema,
585
+ }),
586
+ now: ctx.clock,
587
+ extractPage: (r) => r.data,
588
+ getId: (item) => item.id,
589
+ all: true,
590
+ onItem: (item) => {
591
+ matchedItemIds.push(item.id);
592
+ },
593
+ });
594
+ // 3) Empty match set — both dry-run and live are clean no-ops.
595
+ // Emit a success envelope before the confirmation gate fires
596
+ // (Codex pass-1 F1: `--yes` shouldn't be required to confirm
597
+ // "no items matched"). Filter warnings still surface so the
598
+ // agent sees `column_token_collision` / `stale_cache_refreshed`
599
+ // if the empty result was filter-resolved post-refresh.
600
+ //
601
+ // Codex pass-2: source / cacheAgeSeconds aggregate from the metadata
602
+ // load + the items_page walk (always live). Cache-sourced metadata
603
+ // + live walk → `mixed`; pure-cache metadata stays `cache` only on
604
+ // the impossible no-walk path. The live items_page walk forces the
605
+ // aggregate to `mixed` when metadata was cache-served.
606
+ const emptyEnvelopeSource = meta.source === 'cache' ? 'mixed' : 'live';
607
+ if (matchedItemIds.length === 0) {
608
+ if (globalFlags.dryRun) {
609
+ emitDryRun({
610
+ ctx,
611
+ programOpts,
612
+ plannedChanges: [],
613
+ source: emptyEnvelopeSource,
614
+ cacheAgeSeconds: meta.cacheAgeSeconds,
615
+ warnings: filterResult.warnings,
616
+ apiVersion,
617
+ });
618
+ return;
619
+ }
620
+ emitMutation({
621
+ ctx,
622
+ data: {
623
+ summary: { matched_count: 0, applied_count: 0, board_id: boardId },
624
+ items: [],
625
+ },
626
+ schema: bulkLiveDataSchema,
627
+ programOpts,
628
+ warnings: filterResult.warnings,
629
+ source: emptyEnvelopeSource,
630
+ cacheAgeSeconds: meta.cacheAgeSeconds,
631
+ apiVersion,
632
+ });
633
+ return;
634
+ }
635
+ // 4) Confirmation gate. Bulk mutations without --yes (and without
636
+ // --dry-run) surface `confirmation_required` per §3.1 #7 +
637
+ // §6.5. Agents read the matched-item count and re-run with
638
+ // --yes after reviewing. `--yes` is a global flag (program.ts).
639
+ if (!globalFlags.dryRun && !globalFlags.yes) {
640
+ throw new ConfirmationRequiredError(`Bulk item update would mutate ${String(matchedItemIds.length)} ` +
641
+ `matched item(s). Re-run with --yes to confirm, or --dry-run to ` +
642
+ `preview.`, {
643
+ details: {
644
+ board_id: boardId,
645
+ matched_count: matchedItemIds.length,
646
+ where_clauses: parsed.where,
647
+ ...(parsed.filterJson === undefined
648
+ ? {}
649
+ : { filter_json: parsed.filterJson }),
650
+ hint: 'Use --dry-run to inspect the planned_changes for every ' +
651
+ 'matched item before applying.',
652
+ },
653
+ });
654
+ }
655
+ // setEntries + rawEntries pre-parsed at the top of runBulk for the
656
+ // fail-fast invariant. (See step 0 above — moving the parse there
657
+ // means a malformed --set / --set-raw doesn't pay for the metadata
658
+ // load + items_page walk first.)
659
+ const { dateResolution, peopleResolution } = buildResolutionContexts({ client, ctx, globalFlags });
660
+ // 5) Dry-run path: per-item planChanges. Column resolution is
661
+ // cached after the first call; per-item state read fires per
662
+ // item (no item-state cache in v0.1).
663
+ //
664
+ // Codex pass-1 F4: aggregate per-item warnings + source + cache
665
+ // age across the batch. Pre-fix, bulk dry-run dropped per-item
666
+ // results' `warnings` and hardcoded `source: 'mixed'`, losing
667
+ // `column_token_collision` / `stale_cache_refreshed` signals
668
+ // the resolver-warning preservation pattern is meant to keep.
669
+ if (globalFlags.dryRun) {
670
+ const allPlanned = [];
671
+ const aggregatedWarnings = [...filterResult.warnings];
672
+ const sourceAgg = new SourceAggregator({
673
+ source: meta.source,
674
+ cacheAgeSeconds: meta.cacheAgeSeconds,
675
+ });
676
+ for (const itemId of matchedItemIds) {
677
+ const result = await planChanges({
678
+ client,
679
+ boardId,
680
+ itemId,
681
+ setEntries,
682
+ ...(rawEntries.length === 0 ? {} : { rawEntries }),
683
+ ...(parsed.name === undefined ? {} : { nameChange: parsed.name }),
684
+ dateResolution,
685
+ peopleResolution,
686
+ env: ctx.env,
687
+ noCache: globalFlags.noCache,
688
+ });
689
+ for (const plan of result.plannedChanges) {
690
+ allPlanned.push(plan);
691
+ }
692
+ // Resolver warnings can fire per item (the cache-miss-refresh
693
+ // dance is per-token). Most fire on the first item only (cache
694
+ // populated for subsequent items), but the helper deduplicates
695
+ // by code+message+token below for compactness.
696
+ for (const w of result.warnings) {
697
+ aggregatedWarnings.push(w);
698
+ }
699
+ sourceAgg.record(result.source, result.cacheAgeSeconds);
700
+ }
701
+ emitDryRun({
702
+ ctx,
703
+ programOpts,
704
+ plannedChanges: allPlanned,
705
+ ...sourceAgg.result(),
706
+ warnings: dedupeWarnings(aggregatedWarnings),
707
+ apiVersion,
708
+ });
709
+ return;
710
+ }
711
+ // 5) Live path: per-item mutation. Resolve columns once, translate
712
+ // once, then fire the same SelectedMutation against every
713
+ // matched item.
714
+ //
715
+ // Three-pass resolution (Codex M8 finding #2): resolve every token
716
+ // first, run the cross-token duplicate-resolved-ID check, then
717
+ // translate. Pre-fix, translation ran inline, so a `--set X=bad`
718
+ // alongside a `--set-raw X={...}` could surface the translation
719
+ // `usage_error` instead of the mutual-exclusion `usage_error` per
720
+ // cli-design §5.3 line 961-972.
721
+ //
722
+ // Three-pass resolution + translation through the shared helper
723
+ // (R20 lift). The board-metadata leg's source / cacheAge seed the
724
+ // aggregator so a cache-served metadata fetch promotes the final
725
+ // envelope source to `mixed` when subsequent resolution legs hit
726
+ // live (Codex M8 finding #3).
727
+ //
728
+ // `collectedWarnings` is the union of filter warnings + resolver
729
+ // warnings, surfaced on the success envelope. `resolverWarnings`
730
+ // is the narrowed subset used by foldResolverWarningsIntoError —
731
+ // the helper's contract is to fold collision / stale_cache_refreshed
732
+ // signals, not generic Warning types.
733
+ const resolutionResult = await resolveAndTranslate({
734
+ client,
735
+ boardId,
736
+ setEntries,
737
+ rawEntries,
738
+ dateResolution,
739
+ peopleResolution,
740
+ env: ctx.env,
741
+ noCache: globalFlags.noCache,
742
+ initialSource: meta.source,
743
+ initialCacheAgeSeconds: meta.cacheAgeSeconds,
744
+ });
745
+ const collectedWarnings = [
746
+ ...filterResult.warnings,
747
+ ...resolutionResult.warnings,
748
+ ];
749
+ const resolverWarnings = [...resolutionResult.warnings];
750
+ const resolvedIds = resolutionResult.resolvedIds;
751
+ // resolveAndTranslate was seeded with meta.source / meta.cacheAge
752
+ // above, so resolutionResult.source is always defined post-helper.
753
+ // The `?? meta.source` fallback preserves the pre-R30 c8-ignored
754
+ // defensive widening; flow then folds the per-item mutation legs
755
+ // (always live) at emit time via `sourceAgg.record('live', null)`.
756
+ const sourceAgg = new SourceAggregator();
757
+ /* c8 ignore next 3 — defensive: initialSource seeded above so
758
+ resolutionResult.source is always defined post-helper. */
759
+ const remapSource = resolutionResult.source ?? meta.source;
760
+ sourceAgg.record(remapSource, resolutionResult.cacheAgeSeconds);
761
+ const translated = resolutionResult.translated;
762
+ const allTranslated = parsed.name === undefined
763
+ ? translated
764
+ : [
765
+ {
766
+ columnId: 'name',
767
+ columnType: 'text',
768
+ rawInput: parsed.name,
769
+ payload: { format: 'simple', value: parsed.name },
770
+ resolvedFrom: null,
771
+ peopleResolution: null,
772
+ },
773
+ ...translated,
774
+ ];
775
+ const mutation = selectMutation(allTranslated);
776
+ const appliedItems = [];
777
+ // Codex pass-1 F3: F4's `validation_failed` → `column_archived`
778
+ // remap must fire on bulk per-item failures too — agents key off
779
+ // the stable `column_archived` code regardless of whether the
780
+ // mutation came from item set / item update single / item update
781
+ // bulk. Pre-fix, bulk failures only ran the resolver-warning
782
+ // fold + bulk-progress decoration; the remap was missing.
783
+ // Codex M5b finding #3: probe every translated column id, not
784
+ // just the first, so a multi-column bulk update where a LATER
785
+ // target was archived after a stale cache read still surfaces
786
+ // `column_archived`. Single-column bulk passes a one-element
787
+ // array, same as before.
788
+ const remapColumnIds = translated.map((t) => t.columnId);
789
+ for (const itemId of matchedItemIds) {
790
+ try {
791
+ const result = await executeMutation(client, {
792
+ mutation,
793
+ itemId,
794
+ boardId,
795
+ createLabelsIfMissing: parsed.createLabelsIfMissing,
796
+ });
797
+ appliedItems.push(result.projected);
798
+ }
799
+ catch (err) {
800
+ if (err instanceof MondayCliError) {
801
+ // Apply fold + F4 remap before bulk-progress decoration. The
802
+ // remap returns the original error unchanged when its
803
+ // preconditions aren't met (non-validation_failed, live
804
+ // source, refresh failure, post-refresh column still
805
+ // active). When it DOES fire, the remapped error keeps the
806
+ // resolver_warnings slot we just folded in.
807
+ const remapped = await foldAndRemap({
808
+ err,
809
+ warnings: resolverWarnings,
810
+ client,
811
+ boardId,
812
+ columnIds: remapColumnIds,
813
+ env: ctx.env,
814
+ noCache: globalFlags.noCache,
815
+ resolutionSource: remapSource,
816
+ });
817
+ // Decorate with bulk-progress details so agents can see how
818
+ // many items mutated successfully before the failure.
819
+ const existing = remapped.details ?? {};
820
+ if (remapped.code === 'usage_error') {
821
+ throw new UsageError(remapped.message, {
822
+ ...(remapped.cause === undefined ? {} : { cause: remapped.cause }),
823
+ details: {
824
+ ...existing,
825
+ applied_count: appliedItems.length,
826
+ applied_to: appliedItems.map((i) => i.id),
827
+ failed_at_item: itemId,
828
+ matched_count: matchedItemIds.length,
829
+ },
830
+ });
831
+ }
832
+ throw new ApiError(remapped.code, remapped.message, {
833
+ ...(remapped.cause === undefined ? {} : { cause: remapped.cause }),
834
+ ...(remapped.httpStatus === undefined ? {} : { httpStatus: remapped.httpStatus }),
835
+ ...(remapped.mondayCode === undefined ? {} : { mondayCode: remapped.mondayCode }),
836
+ ...(remapped.requestId === undefined ? {} : { requestId: remapped.requestId }),
837
+ retryable: remapped.retryable,
838
+ ...(remapped.retryAfterSeconds === undefined ? {} : { retryAfterSeconds: remapped.retryAfterSeconds }),
839
+ details: {
840
+ ...existing,
841
+ applied_count: appliedItems.length,
842
+ applied_to: appliedItems.map((i) => i.id),
843
+ failed_at_item: itemId,
844
+ matched_count: matchedItemIds.length,
845
+ },
846
+ });
847
+ }
848
+ throw err;
849
+ }
850
+ }
851
+ // Codex pass-2: aggregate `meta.source` + `cache_age_seconds`
852
+ // properly per cli-design §6.1. Pre-fix, source was inferred from
853
+ // warning presence — a plain cache hit (no warning) on metadata
854
+ // would surface as `live` even though the resolver served from
855
+ // cache. M4 pinned this exact regression for read commands; the
856
+ // bulk write path replicated the bug.
857
+ //
858
+ // The items_page walk and per-item mutations always fire live —
859
+ // record one terminal `live` leg so a fully-cached metadata +
860
+ // column-resolution path still surfaces as `mixed` (cache-served
861
+ // metadata + live wire calls). N per-item mutations collapse to
862
+ // one `record('live', null)` because mergeSource is idempotent
863
+ // for a constant second leg. Mirrors the empty-match no-op
864
+ // path's `emptyEnvelopeSource` derivation.
865
+ sourceAgg.record('live', null);
866
+ emitMutation({
867
+ ctx,
868
+ data: {
869
+ summary: {
870
+ matched_count: matchedItemIds.length,
871
+ applied_count: appliedItems.length,
872
+ board_id: boardId,
873
+ },
874
+ items: appliedItems,
875
+ },
876
+ schema: bulkLiveDataSchema,
877
+ programOpts,
878
+ warnings: collectedWarnings,
879
+ ...sourceAgg.result(),
880
+ apiVersion,
881
+ resolvedIds,
882
+ });
883
+ };
884
+ //# sourceMappingURL=update.js.map