monday-cli 0.2.0 → 0.3.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 (418) hide show
  1. package/CHANGELOG.md +324 -2
  2. package/README.md +128 -30
  3. package/dist/api/board-favorites.d.ts +329 -0
  4. package/dist/api/board-favorites.d.ts.map +1 -0
  5. package/dist/api/board-favorites.js +353 -0
  6. package/dist/api/board-favorites.js.map +1 -0
  7. package/dist/api/board-mutation-result.d.ts +9 -5
  8. package/dist/api/board-mutation-result.d.ts.map +1 -1
  9. package/dist/api/board-mutation-result.js +9 -5
  10. package/dist/api/board-mutation-result.js.map +1 -1
  11. package/dist/api/board-relation-validation.d.ts +161 -0
  12. package/dist/api/board-relation-validation.d.ts.map +1 -0
  13. package/dist/api/board-relation-validation.js +317 -0
  14. package/dist/api/board-relation-validation.js.map +1 -0
  15. package/dist/api/cache.d.ts +14 -5
  16. package/dist/api/cache.d.ts.map +1 -1
  17. package/dist/api/cache.js +8 -10
  18. package/dist/api/cache.js.map +1 -1
  19. package/dist/api/column-mapping.js +2 -2
  20. package/dist/api/column-mapping.js.map +1 -1
  21. package/dist/api/column-mutation-result.d.ts +9 -5
  22. package/dist/api/column-mutation-result.d.ts.map +1 -1
  23. package/dist/api/column-mutation-result.js +9 -5
  24. package/dist/api/column-mutation-result.js.map +1 -1
  25. package/dist/api/column-types.d.ts +26 -7
  26. package/dist/api/column-types.d.ts.map +1 -1
  27. package/dist/api/column-types.js +42 -3
  28. package/dist/api/column-types.js.map +1 -1
  29. package/dist/api/column-values.d.ts +228 -31
  30. package/dist/api/column-values.d.ts.map +1 -1
  31. package/dist/api/column-values.js +551 -124
  32. package/dist/api/column-values.js.map +1 -1
  33. package/dist/api/cross-board-search.d.ts +501 -0
  34. package/dist/api/cross-board-search.d.ts.map +1 -0
  35. package/dist/api/cross-board-search.js +547 -0
  36. package/dist/api/cross-board-search.js.map +1 -0
  37. package/dist/api/dev-conventions.d.ts +1038 -0
  38. package/dist/api/dev-conventions.d.ts.map +1 -0
  39. package/dist/api/dev-conventions.js +1556 -0
  40. package/dist/api/dev-conventions.js.map +1 -0
  41. package/dist/api/dry-run.d.ts +32 -5
  42. package/dist/api/dry-run.d.ts.map +1 -1
  43. package/dist/api/dry-run.js +149 -32
  44. package/dist/api/dry-run.js.map +1 -1
  45. package/dist/api/errors.d.ts.map +1 -1
  46. package/dist/api/errors.js +28 -7
  47. package/dist/api/errors.js.map +1 -1
  48. package/dist/api/group-mutation-result.d.ts +9 -5
  49. package/dist/api/group-mutation-result.d.ts.map +1 -1
  50. package/dist/api/group-mutation-result.js +9 -5
  51. package/dist/api/group-mutation-result.js.map +1 -1
  52. package/dist/api/item-history-projection.d.ts +919 -0
  53. package/dist/api/item-history-projection.d.ts.map +1 -0
  54. package/dist/api/item-history-projection.js +1104 -0
  55. package/dist/api/item-history-projection.js.map +1 -0
  56. package/dist/api/item-mutation-execute.d.ts +82 -0
  57. package/dist/api/item-mutation-execute.d.ts.map +1 -0
  58. package/dist/api/item-mutation-execute.js +199 -0
  59. package/dist/api/item-mutation-execute.js.map +1 -0
  60. package/dist/api/notifications.d.ts +156 -0
  61. package/dist/api/notifications.d.ts.map +1 -0
  62. package/dist/api/notifications.js +215 -0
  63. package/dist/api/notifications.js.map +1 -0
  64. package/dist/api/oauth-test-helper.d.ts +64 -0
  65. package/dist/api/oauth-test-helper.d.ts.map +1 -0
  66. package/dist/api/oauth-test-helper.js +179 -0
  67. package/dist/api/oauth-test-helper.js.map +1 -0
  68. package/dist/api/oauth.d.ts +198 -0
  69. package/dist/api/oauth.d.ts.map +1 -0
  70. package/dist/api/oauth.js +471 -0
  71. package/dist/api/oauth.js.map +1 -0
  72. package/dist/api/partial-success-bulk.d.ts +422 -0
  73. package/dist/api/partial-success-bulk.d.ts.map +1 -0
  74. package/dist/api/partial-success-bulk.js +378 -0
  75. package/dist/api/partial-success-bulk.js.map +1 -0
  76. package/dist/api/people.d.ts +54 -1
  77. package/dist/api/people.d.ts.map +1 -1
  78. package/dist/api/people.js +27 -3
  79. package/dist/api/people.js.map +1 -1
  80. package/dist/api/probes.d.ts +487 -0
  81. package/dist/api/probes.d.ts.map +1 -0
  82. package/dist/api/probes.js +881 -0
  83. package/dist/api/probes.js.map +1 -0
  84. package/dist/api/raw-document.d.ts.map +1 -1
  85. package/dist/api/raw-document.js +2 -2
  86. package/dist/api/raw-document.js.map +1 -1
  87. package/dist/api/raw-write.d.ts.map +1 -1
  88. package/dist/api/raw-write.js +11 -3
  89. package/dist/api/raw-write.js.map +1 -1
  90. package/dist/api/resolution-context.d.ts +23 -11
  91. package/dist/api/resolution-context.d.ts.map +1 -1
  92. package/dist/api/resolution-context.js +53 -12
  93. package/dist/api/resolution-context.js.map +1 -1
  94. package/dist/api/resolution-pass.d.ts +30 -1
  95. package/dist/api/resolution-pass.d.ts.map +1 -1
  96. package/dist/api/resolution-pass.js +36 -1
  97. package/dist/api/resolution-pass.js.map +1 -1
  98. package/dist/api/resolve-client.d.ts +11 -0
  99. package/dist/api/resolve-client.d.ts.map +1 -1
  100. package/dist/api/resolve-client.js +1 -1
  101. package/dist/api/resolve-client.js.map +1 -1
  102. package/dist/api/response-root.d.ts +92 -46
  103. package/dist/api/response-root.d.ts.map +1 -1
  104. package/dist/api/response-root.js +93 -41
  105. package/dist/api/response-root.js.map +1 -1
  106. package/dist/api/tag-directory.d.ts +154 -0
  107. package/dist/api/tag-directory.d.ts.map +1 -0
  108. package/dist/api/tag-directory.js +325 -0
  109. package/dist/api/tag-directory.js.map +1 -0
  110. package/dist/api/time-tracking.d.ts +165 -0
  111. package/dist/api/time-tracking.d.ts.map +1 -0
  112. package/dist/api/time-tracking.js +135 -0
  113. package/dist/api/time-tracking.js.map +1 -0
  114. package/dist/api/transport.js +3 -3
  115. package/dist/api/transport.js.map +1 -1
  116. package/dist/api/usage.d.ts +190 -0
  117. package/dist/api/usage.d.ts.map +1 -0
  118. package/dist/api/usage.js +194 -0
  119. package/dist/api/usage.js.map +1 -0
  120. package/dist/api/users-fan-out-mutation.d.ts.map +1 -1
  121. package/dist/api/users-fan-out-mutation.js +10 -5
  122. package/dist/api/users-fan-out-mutation.js.map +1 -1
  123. package/dist/api/webhooks.d.ts +357 -0
  124. package/dist/api/webhooks.d.ts.map +1 -0
  125. package/dist/api/webhooks.js +333 -0
  126. package/dist/api/webhooks.js.map +1 -0
  127. package/dist/cli/envelope-out.d.ts +18 -1
  128. package/dist/cli/envelope-out.d.ts.map +1 -1
  129. package/dist/cli/envelope-out.js +16 -2
  130. package/dist/cli/envelope-out.js.map +1 -1
  131. package/dist/cli/program.d.ts.map +1 -1
  132. package/dist/cli/program.js +120 -1
  133. package/dist/cli/program.js.map +1 -1
  134. package/dist/cli/run.d.ts +12 -0
  135. package/dist/cli/run.d.ts.map +1 -1
  136. package/dist/cli/run.js +2 -0
  137. package/dist/cli/run.js.map +1 -1
  138. package/dist/commands/account/tags.d.ts +37 -0
  139. package/dist/commands/account/tags.d.ts.map +1 -0
  140. package/dist/commands/account/tags.js +84 -0
  141. package/dist/commands/account/tags.js.map +1 -0
  142. package/dist/commands/auth/login.d.ts +14 -0
  143. package/dist/commands/auth/login.d.ts.map +1 -0
  144. package/dist/commands/auth/login.js +314 -0
  145. package/dist/commands/auth/login.js.map +1 -0
  146. package/dist/commands/auth/logout.d.ts +28 -0
  147. package/dist/commands/auth/logout.d.ts.map +1 -0
  148. package/dist/commands/auth/logout.js +94 -0
  149. package/dist/commands/auth/logout.js.map +1 -0
  150. package/dist/commands/board/archive.d.ts.map +1 -1
  151. package/dist/commands/board/archive.js +14 -14
  152. package/dist/commands/board/archive.js.map +1 -1
  153. package/dist/commands/board/column-create.d.ts +3 -3
  154. package/dist/commands/board/column-create.d.ts.map +1 -1
  155. package/dist/commands/board/column-create.js +52 -45
  156. package/dist/commands/board/column-create.js.map +1 -1
  157. package/dist/commands/board/column-delete.d.ts.map +1 -1
  158. package/dist/commands/board/column-delete.js +15 -16
  159. package/dist/commands/board/column-delete.js.map +1 -1
  160. package/dist/commands/board/column-update.d.ts.map +1 -1
  161. package/dist/commands/board/column-update.js +23 -22
  162. package/dist/commands/board/column-update.js.map +1 -1
  163. package/dist/commands/board/create.d.ts.map +1 -1
  164. package/dist/commands/board/create.js +14 -17
  165. package/dist/commands/board/create.js.map +1 -1
  166. package/dist/commands/board/delete.d.ts.map +1 -1
  167. package/dist/commands/board/delete.js +12 -15
  168. package/dist/commands/board/delete.js.map +1 -1
  169. package/dist/commands/board/describe.d.ts.map +1 -1
  170. package/dist/commands/board/describe.js +30 -0
  171. package/dist/commands/board/describe.js.map +1 -1
  172. package/dist/commands/board/duplicate.d.ts.map +1 -1
  173. package/dist/commands/board/duplicate.js +12 -13
  174. package/dist/commands/board/duplicate.js.map +1 -1
  175. package/dist/commands/board/favorites.d.ts +33 -0
  176. package/dist/commands/board/favorites.d.ts.map +1 -0
  177. package/dist/commands/board/favorites.js +74 -0
  178. package/dist/commands/board/favorites.js.map +1 -0
  179. package/dist/commands/board/find.d.ts +1 -1
  180. package/dist/commands/board/group-archive.d.ts.map +1 -1
  181. package/dist/commands/board/group-archive.js +12 -16
  182. package/dist/commands/board/group-archive.js.map +1 -1
  183. package/dist/commands/board/group-create.d.ts.map +1 -1
  184. package/dist/commands/board/group-create.js +9 -19
  185. package/dist/commands/board/group-create.js.map +1 -1
  186. package/dist/commands/board/group-delete.d.ts.map +1 -1
  187. package/dist/commands/board/group-delete.js +12 -16
  188. package/dist/commands/board/group-delete.js.map +1 -1
  189. package/dist/commands/board/group-duplicate.d.ts.map +1 -1
  190. package/dist/commands/board/group-duplicate.js +12 -16
  191. package/dist/commands/board/group-duplicate.js.map +1 -1
  192. package/dist/commands/board/group-update.d.ts.map +1 -1
  193. package/dist/commands/board/group-update.js +12 -11
  194. package/dist/commands/board/group-update.js.map +1 -1
  195. package/dist/commands/board/list.d.ts +1 -1
  196. package/dist/commands/board/update.d.ts.map +1 -1
  197. package/dist/commands/board/update.js +16 -11
  198. package/dist/commands/board/update.js.map +1 -1
  199. package/dist/commands/cache/list.d.ts +2 -0
  200. package/dist/commands/cache/list.d.ts.map +1 -1
  201. package/dist/commands/cache/list.js +2 -2
  202. package/dist/commands/cache/list.js.map +1 -1
  203. package/dist/commands/dev/_shared.d.ts +40 -0
  204. package/dist/commands/dev/_shared.d.ts.map +1 -0
  205. package/dist/commands/dev/_shared.js +104 -0
  206. package/dist/commands/dev/_shared.js.map +1 -0
  207. package/dist/commands/dev/configure.d.ts +36 -0
  208. package/dist/commands/dev/configure.d.ts.map +1 -0
  209. package/dist/commands/dev/configure.js +145 -0
  210. package/dist/commands/dev/configure.js.map +1 -0
  211. package/dist/commands/dev/discover.d.ts +34 -0
  212. package/dist/commands/dev/discover.d.ts.map +1 -0
  213. package/dist/commands/dev/discover.js +117 -0
  214. package/dist/commands/dev/discover.js.map +1 -0
  215. package/dist/commands/dev/doctor.d.ts +39 -0
  216. package/dist/commands/dev/doctor.d.ts.map +1 -0
  217. package/dist/commands/dev/doctor.js +91 -0
  218. package/dist/commands/dev/doctor.js.map +1 -0
  219. package/dist/commands/dev/epic/items.d.ts +24 -0
  220. package/dist/commands/dev/epic/items.d.ts.map +1 -0
  221. package/dist/commands/dev/epic/items.js +103 -0
  222. package/dist/commands/dev/epic/items.js.map +1 -0
  223. package/dist/commands/dev/epic/list.d.ts +36 -0
  224. package/dist/commands/dev/epic/list.d.ts.map +1 -0
  225. package/dist/commands/dev/epic/list.js +120 -0
  226. package/dist/commands/dev/epic/list.js.map +1 -0
  227. package/dist/commands/dev/release/list.d.ts +21 -0
  228. package/dist/commands/dev/release/list.d.ts.map +1 -0
  229. package/dist/commands/dev/release/list.js +73 -0
  230. package/dist/commands/dev/release/list.js.map +1 -0
  231. package/dist/commands/dev/sprint/current.d.ts +24 -0
  232. package/dist/commands/dev/sprint/current.d.ts.map +1 -0
  233. package/dist/commands/dev/sprint/current.js +90 -0
  234. package/dist/commands/dev/sprint/current.js.map +1 -0
  235. package/dist/commands/dev/sprint/items.d.ts +34 -0
  236. package/dist/commands/dev/sprint/items.d.ts.map +1 -0
  237. package/dist/commands/dev/sprint/items.js +118 -0
  238. package/dist/commands/dev/sprint/items.js.map +1 -0
  239. package/dist/commands/dev/sprint/list.d.ts +41 -0
  240. package/dist/commands/dev/sprint/list.d.ts.map +1 -0
  241. package/dist/commands/dev/sprint/list.js +104 -0
  242. package/dist/commands/dev/sprint/list.js.map +1 -0
  243. package/dist/commands/dev/task/block.d.ts +29 -0
  244. package/dist/commands/dev/task/block.d.ts.map +1 -0
  245. package/dist/commands/dev/task/block.js +106 -0
  246. package/dist/commands/dev/task/block.js.map +1 -0
  247. package/dist/commands/dev/task/done.d.ts +30 -0
  248. package/dist/commands/dev/task/done.d.ts.map +1 -0
  249. package/dist/commands/dev/task/done.js +113 -0
  250. package/dist/commands/dev/task/done.js.map +1 -0
  251. package/dist/commands/dev/task/list.d.ts +42 -0
  252. package/dist/commands/dev/task/list.d.ts.map +1 -0
  253. package/dist/commands/dev/task/list.js +227 -0
  254. package/dist/commands/dev/task/list.js.map +1 -0
  255. package/dist/commands/dev/task/start.d.ts +29 -0
  256. package/dist/commands/dev/task/start.d.ts.map +1 -0
  257. package/dist/commands/dev/task/start.js +90 -0
  258. package/dist/commands/dev/task/start.js.map +1 -0
  259. package/dist/commands/emit.d.ts.map +1 -1
  260. package/dist/commands/emit.js +5 -3
  261. package/dist/commands/emit.js.map +1 -1
  262. package/dist/commands/index.d.ts.map +1 -1
  263. package/dist/commands/index.js +95 -0
  264. package/dist/commands/index.js.map +1 -1
  265. package/dist/commands/item/archive.d.ts.map +1 -1
  266. package/dist/commands/item/archive.js +11 -0
  267. package/dist/commands/item/archive.js.map +1 -1
  268. package/dist/commands/item/clear.d.ts.map +1 -1
  269. package/dist/commands/item/clear.js +15 -0
  270. package/dist/commands/item/clear.js.map +1 -1
  271. package/dist/commands/item/create.d.ts.map +1 -1
  272. package/dist/commands/item/create.js +41 -8
  273. package/dist/commands/item/create.js.map +1 -1
  274. package/dist/commands/item/delete.d.ts.map +1 -1
  275. package/dist/commands/item/delete.js +11 -0
  276. package/dist/commands/item/delete.js.map +1 -1
  277. package/dist/commands/item/duplicate.d.ts.map +1 -1
  278. package/dist/commands/item/duplicate.js +12 -0
  279. package/dist/commands/item/duplicate.js.map +1 -1
  280. package/dist/commands/item/history.d.ts +60 -0
  281. package/dist/commands/item/history.d.ts.map +1 -0
  282. package/dist/commands/item/history.js +309 -0
  283. package/dist/commands/item/history.js.map +1 -0
  284. package/dist/commands/item/list.d.ts.map +1 -1
  285. package/dist/commands/item/list.js +16 -13
  286. package/dist/commands/item/list.js.map +1 -1
  287. package/dist/commands/item/move.d.ts.map +1 -1
  288. package/dist/commands/item/move.js +41 -7
  289. package/dist/commands/item/move.js.map +1 -1
  290. package/dist/commands/item/search.d.ts +99 -15
  291. package/dist/commands/item/search.d.ts.map +1 -1
  292. package/dist/commands/item/search.js +480 -36
  293. package/dist/commands/item/search.js.map +1 -1
  294. package/dist/commands/item/set.d.ts.map +1 -1
  295. package/dist/commands/item/set.js +52 -8
  296. package/dist/commands/item/set.js.map +1 -1
  297. package/dist/commands/item/time-track/start.d.ts +61 -0
  298. package/dist/commands/item/time-track/start.d.ts.map +1 -0
  299. package/dist/commands/item/time-track/start.js +138 -0
  300. package/dist/commands/item/time-track/start.js.map +1 -0
  301. package/dist/commands/item/time-track/stop.d.ts +32 -0
  302. package/dist/commands/item/time-track/stop.d.ts.map +1 -0
  303. package/dist/commands/item/time-track/stop.js +97 -0
  304. package/dist/commands/item/time-track/stop.js.map +1 -0
  305. package/dist/commands/item/update.d.ts +1 -0
  306. package/dist/commands/item/update.d.ts.map +1 -1
  307. package/dist/commands/item/update.js +103 -113
  308. package/dist/commands/item/update.js.map +1 -1
  309. package/dist/commands/item/upsert.d.ts.map +1 -1
  310. package/dist/commands/item/upsert.js +48 -1
  311. package/dist/commands/item/upsert.js.map +1 -1
  312. package/dist/commands/notification/send.d.ts +60 -0
  313. package/dist/commands/notification/send.d.ts.map +1 -0
  314. package/dist/commands/notification/send.js +147 -0
  315. package/dist/commands/notification/send.js.map +1 -0
  316. package/dist/commands/parse-argv.d.ts.map +1 -1
  317. package/dist/commands/parse-argv.js +14 -4
  318. package/dist/commands/parse-argv.js.map +1 -1
  319. package/dist/commands/raw/index.d.ts.map +1 -1
  320. package/dist/commands/raw/index.js +13 -15
  321. package/dist/commands/raw/index.js.map +1 -1
  322. package/dist/commands/run-by-id-lookup.d.ts.map +1 -1
  323. package/dist/commands/run-by-id-lookup.js +2 -2
  324. package/dist/commands/run-by-id-lookup.js.map +1 -1
  325. package/dist/commands/schema/index.d.ts +2 -0
  326. package/dist/commands/schema/index.d.ts.map +1 -1
  327. package/dist/commands/status.d.ts +120 -0
  328. package/dist/commands/status.d.ts.map +1 -0
  329. package/dist/commands/status.js +365 -0
  330. package/dist/commands/status.js.map +1 -0
  331. package/dist/commands/update/body-source.d.ts.map +1 -1
  332. package/dist/commands/update/body-source.js +2 -2
  333. package/dist/commands/update/body-source.js.map +1 -1
  334. package/dist/commands/update/create.d.ts +2 -3
  335. package/dist/commands/update/create.d.ts.map +1 -1
  336. package/dist/commands/update/create.js +15 -3
  337. package/dist/commands/update/create.js.map +1 -1
  338. package/dist/commands/update/delete.d.ts.map +1 -1
  339. package/dist/commands/update/delete.js +11 -0
  340. package/dist/commands/update/delete.js.map +1 -1
  341. package/dist/commands/update/edit.d.ts.map +1 -1
  342. package/dist/commands/update/edit.js +11 -0
  343. package/dist/commands/update/edit.js.map +1 -1
  344. package/dist/commands/update/list.d.ts.map +1 -1
  345. package/dist/commands/update/list.js +15 -12
  346. package/dist/commands/update/list.js.map +1 -1
  347. package/dist/commands/update/reply.d.ts.map +1 -1
  348. package/dist/commands/update/reply.js +11 -0
  349. package/dist/commands/update/reply.js.map +1 -1
  350. package/dist/commands/update/toggle.d.ts.map +1 -1
  351. package/dist/commands/update/toggle.js +13 -0
  352. package/dist/commands/update/toggle.js.map +1 -1
  353. package/dist/commands/usage.d.ts +58 -0
  354. package/dist/commands/usage.d.ts.map +1 -0
  355. package/dist/commands/usage.js +94 -0
  356. package/dist/commands/usage.js.map +1 -0
  357. package/dist/commands/webhook/create.d.ts +74 -0
  358. package/dist/commands/webhook/create.d.ts.map +1 -0
  359. package/dist/commands/webhook/create.js +150 -0
  360. package/dist/commands/webhook/create.js.map +1 -0
  361. package/dist/commands/webhook/delete.d.ts +46 -0
  362. package/dist/commands/webhook/delete.d.ts.map +1 -0
  363. package/dist/commands/webhook/delete.js +141 -0
  364. package/dist/commands/webhook/delete.js.map +1 -0
  365. package/dist/commands/webhook/list.d.ts +23 -0
  366. package/dist/commands/webhook/list.d.ts.map +1 -0
  367. package/dist/commands/webhook/list.js +68 -0
  368. package/dist/commands/webhook/list.js.map +1 -0
  369. package/dist/commands/workspace/create.d.ts.map +1 -1
  370. package/dist/commands/workspace/create.js +16 -0
  371. package/dist/commands/workspace/create.js.map +1 -1
  372. package/dist/commands/workspace/delete.d.ts.map +1 -1
  373. package/dist/commands/workspace/delete.js +13 -13
  374. package/dist/commands/workspace/delete.js.map +1 -1
  375. package/dist/commands/workspace/list.d.ts +1 -1
  376. package/dist/commands/workspace/update.d.ts.map +1 -1
  377. package/dist/commands/workspace/update.js +15 -15
  378. package/dist/commands/workspace/update.js.map +1 -1
  379. package/dist/config/credentials.d.ts +189 -0
  380. package/dist/config/credentials.d.ts.map +1 -0
  381. package/dist/config/credentials.js +300 -0
  382. package/dist/config/credentials.js.map +1 -0
  383. package/dist/config/profiles.d.ts +125 -0
  384. package/dist/config/profiles.d.ts.map +1 -0
  385. package/dist/config/profiles.js +227 -0
  386. package/dist/config/profiles.js.map +1 -0
  387. package/dist/types/global-flags.d.ts +1 -1
  388. package/dist/types/global-flags.d.ts.map +1 -1
  389. package/dist/types/global-flags.js +28 -16
  390. package/dist/types/global-flags.js.map +1 -1
  391. package/dist/types/ids.d.ts +2 -0
  392. package/dist/types/ids.d.ts.map +1 -1
  393. package/dist/types/ids.js +5 -3
  394. package/dist/types/ids.js.map +1 -1
  395. package/dist/utils/errors.d.ts +57 -3
  396. package/dist/utils/errors.d.ts.map +1 -1
  397. package/dist/utils/errors.js +69 -2
  398. package/dist/utils/errors.js.map +1 -1
  399. package/dist/utils/fs.d.ts +35 -0
  400. package/dist/utils/fs.d.ts.map +1 -0
  401. package/dist/utils/fs.js +36 -0
  402. package/dist/utils/fs.js.map +1 -0
  403. package/dist/utils/json.d.ts +60 -0
  404. package/dist/utils/json.d.ts.map +1 -0
  405. package/dist/utils/json.js +86 -0
  406. package/dist/utils/json.js.map +1 -0
  407. package/dist/utils/output/ndjson.d.ts +65 -3
  408. package/dist/utils/output/ndjson.d.ts.map +1 -1
  409. package/dist/utils/output/ndjson.js +21 -0
  410. package/dist/utils/output/ndjson.js.map +1 -1
  411. package/dist/utils/redact.d.ts.map +1 -1
  412. package/dist/utils/redact.js +31 -0
  413. package/dist/utils/redact.js.map +1 -1
  414. package/package.json +2 -1
  415. package/dist/commands/account/client-helper.d.ts +0 -37
  416. package/dist/commands/account/client-helper.d.ts.map +0 -1
  417. package/dist/commands/account/client-helper.js +0 -55
  418. package/dist/commands/account/client-helper.js.map +0 -1
@@ -1,65 +1,111 @@
1
1
  /**
2
- * Response-root field assertion (R41 lift, v0.2-plan §22).
2
+ * Response-root field assertion (R41 + R42 lifts, v0.2-plan §22).
3
3
  *
4
4
  * Distinguishes "key absent" (response-shape drift →
5
5
  * `internal_error`, whole-call) from "value null" (resource missing
6
- * / can't be applied → `not_found`, per-record). Codex M14 round-2
7
- * F1 + round-3 F1 pinned the contract; R41 lifts the inline helpers
8
- * that workspace add-users / workspace remove-users / board add-
9
- * users each ship verbatim.
6
+ * / per-record idiomatic null → `not_found`, per-record). Codex M14
7
+ * round-2 F1 + round-3 F1 pinned the contract; R41 lifted the inline
8
+ * check that workspace add-users / workspace remove-users / board
9
+ * add-users each shipped verbatim; R42 (post-v0.2 cleanup window)
10
+ * extends the same helper across the ~32 single-target mutation
11
+ * verbs that previously conflated the two cases (or left the
12
+ * missing-key path silent — projector-only null-handling treated
13
+ * "key absent" the same as "value null").
10
14
  *
11
- * **Why distinct from `assertUpdateMutationPresent`**
12
- * (`api/update-mutation-result.ts`). M13's helper handles null /
13
- * undefined uniformly with `not_found` — pre-dating the M14
14
- * missing-root-key vs null-value distinction. R42 (retroactive
15
- * sweep across pre-M14 mutation verbs) handles unifying them; R41
16
- * stays scoped to the M14 + M15 partial-success-fan-out family.
15
+ * **Two modes** controlled by `nullHandling` (required — keep the
16
+ * caller explicit so a future site doesn't silently inherit the
17
+ * wrong behaviour):
17
18
  *
18
- * **Used by:** `commands/workspace/add-users.ts` /
19
- * `commands/workspace/remove-users.ts` / `commands/board/add-users.ts`.
19
+ * - `'caller_handles'` (single-target verbs, R42): only check key
20
+ * presence. The caller's downstream projector handles null-value
21
+ * per-noun semantics — most M5b/M9-M12 verbs throw `not_found`
22
+ * from the projector for `null` (Monday's idiomatic missing-
23
+ * payload signal); item set throws `internal_error` for `null`
24
+ * per its M5b decision (an item that exists must always return a
25
+ * payload from `change_*`). Either way, R42's missing-key check
26
+ * surfaces FIRST and produces a uniform `internal_error` for
27
+ * schema drift, regardless of the noun's null-value choice.
20
28
  *
21
- * **Not used by:** single-target mutation verbs (board create /
22
- * update / archive / delete / duplicate, workspace create / update /
23
- * delete) those carry their own per-verb missing-root-key checks
24
- * because the contract is "every successful call returns the
25
- * resource" rather than "value null is a per-record path"; the
26
- * single-target verbs never throw `not_found` from the inline check
27
- * (the per-verb projector does that on the unwrapped value).
29
+ * - `'throw_not_found'` (partial-success-fan-out verbs, R41): also
30
+ * check `data[key]` for null/undefined and throw `not_found` so
31
+ * `dispatchSequential` slots it into the per-record failure
32
+ * array (whereas `internal_error` propagates and aborts the
33
+ * whole call). The `notFoundTarget` field shapes the not_found
34
+ * message phrasing and details.
35
+ *
36
+ * **Used by:**
37
+ * - `'throw_not_found'` mode: `users-fan-out-mutation.ts`
38
+ * (wraps board add-users / workspace add-users / workspace
39
+ * remove-users via `dispatchSequential`).
40
+ * - `'caller_handles'` mode (R42 sweep): every single-target
41
+ * mutation verb across M5b → M17 (item set / clear / update,
42
+ * item create / archive / delete / duplicate / move / upsert,
43
+ * update create / reply / edit / delete / toggle, board create
44
+ * / update / archive / delete / duplicate / add-users, column-
45
+ * create / update / delete, group-create / update / archive /
46
+ * duplicate / delete). M15-M17 sites inline the check
47
+ * verbatim pre-R42; the lift consolidates that boilerplate
48
+ * onto this helper. Pre-M14 (M5b/M9-M12) sites had no inline
49
+ * missing-key check; R42 adds it as net-new behaviour, picking
50
+ * up the M14 contract distinction proactively.
51
+ *
52
+ * **Not used by:** `update clear-all` per-target dispatch — that
53
+ * site uses `assertUpdateMutationPresent` (api/update-mutation-
54
+ * result.ts) which has a different contract (treats null +
55
+ * undefined uniformly as `not_found`, pre-dating M14's
56
+ * distinction). Migrating it is a separate question for v0.3
57
+ * (the two helpers may usefully merge).
28
58
  */
29
59
  export interface AssertResponseFieldPresentInputs {
30
- /** The parsed response data object (after the wire-shape parse). */
31
- readonly data: Readonly<Record<string, unknown>>;
32
- /** The mutation root key name (e.g. `'add_users_to_board'`). */
60
+ /**
61
+ * The response data object. Accepted as `unknown` so callers can
62
+ * pass `response.data` (typed via per-verb wire interfaces like
63
+ * `ChangeSimpleResponse`) without casting at every site; the
64
+ * helper runtime-narrows to a `Record<string, unknown>` once.
65
+ */
66
+ readonly data: unknown;
67
+ /** The mutation root key name (e.g. `'archive_item'`). */
33
68
  readonly key: string;
34
- /** The operation label for `internal_error` messages
35
- * (e.g. `'BoardAddUsers'`). Distinct from `key` because the
36
- * GraphQL operation name is human-readable PascalCase whereas
37
- * `key` is the snake_case mutation field. */
69
+ /**
70
+ * The operation label for `internal_error` messages — typically
71
+ * the GraphQL operation name (PascalCase). Distinct from `key`
72
+ * (snake_case mutation field).
73
+ */
38
74
  readonly operationLabel: string;
39
- /** The scope-id detail key (`'workspace_id'` or `'board_id'`). */
40
- readonly scopeKey: string;
41
- /** The scope-id value (the workspace or board ID). */
42
- readonly scopeId: string;
43
- /** The target-id detail key (always `'user_id'` in M14/M15
44
- * partial-success-fan-out verbs; future verbs may use other
45
- * targets keep this parameterised for forward-compat). */
46
- readonly targetKey: string;
47
- /** The target-id value (the user ID for the current dispatch
48
- * iteration). */
49
- readonly targetId: string;
75
+ /**
76
+ * Detail map echoed in the `internal_error` thrown when `key` is
77
+ * absent. Caller supplies the full set for two-target partial-
78
+ * success-fan-out verbs that's `{[scopeKey]: scopeId, [targetKey]: targetId}`;
79
+ * for single-target verbs it's just `{[idKey]: idValue}` (or a
80
+ * pair like `{board_id, item_id}` for two-tuple wire signatures).
81
+ * The schema-drift `hint` is appended automatically.
82
+ */
83
+ readonly details: Readonly<Record<string, unknown>>;
84
+ /**
85
+ * Behaviour when `data[key]` is null/undefined. See module doc
86
+ * for the per-mode contract.
87
+ */
88
+ readonly nullHandling: 'caller_handles' | 'throw_not_found';
89
+ /** Required iff `nullHandling === 'throw_not_found'`. */
90
+ readonly notFoundTarget?: {
91
+ readonly key: string;
92
+ readonly id: string;
93
+ };
50
94
  }
51
95
  /**
52
96
  * Throws `ApiError('internal_error')` when `key` is absent from
53
- * `data`; throws `ApiError('not_found')` when present but null.
54
- * Returns void on success. The caller's downstream code can rely
55
- * on `data[key]` being a non-null value after this call.
97
+ * `data` (schema drift). When `nullHandling === 'throw_not_found'`,
98
+ * also throws `ApiError('not_found')` if `data[key]` is null /
99
+ * undefined (per-record idiomatic missing). Returns void on success.
56
100
  *
57
101
  * Distinct error codes per the M14 round-2 F1 / round-3 F1
58
- * contract — `dispatchSequential` re-throws `internal_error`
59
- * (whole-call schema drift) but lets `not_found` land in the
60
- * per-record slot. Without this distinction, a per-record
61
- * not_found could be produced from a schema-drift response,
62
- * masking the contract violation.
102
+ * contract — `dispatchSequential` re-throws `internal_error` (whole-
103
+ * call schema drift) but lets `not_found` land in the per-record
104
+ * slot. Without this distinction, a per-record not_found could be
105
+ * produced from a schema-drift response, masking the contract
106
+ * violation; agents writing recovery loops keyed off `error.code`
107
+ * would treat schema drift as "this resource doesn't exist" and
108
+ * skip the failure rather than reporting it.
63
109
  */
64
110
  export declare const assertResponseFieldPresent: (inputs: AssertResponseFieldPresentInputs) => void;
65
111
  //# sourceMappingURL=response-root.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-root.d.ts","sourceRoot":"","sources":["../../src/api/response-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,MAAM,WAAW,gCAAgC;IAC/C,oEAAoE;IACpE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACjD,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;iDAG6C;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,kEAAkE;IAClE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,sDAAsD;IACtD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB;;gEAE4D;IAC5D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B;qBACiB;IACjB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,gCAAgC,KACvC,IA2BF,CAAC"}
1
+ {"version":3,"file":"response-root.d.ts","sourceRoot":"","sources":["../../src/api/response-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AASH,MAAM,WAAW,gCAAgC;IAC/C;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC;;;;;;;OAOG;IACH,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,gBAAgB,GAAG,iBAAiB,CAAC;IAC5D,yDAAyD;IACzD,QAAQ,CAAC,cAAc,CAAC,EAAE;QAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;CACzE;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0BAA0B,GACrC,QAAQ,gCAAgC,KACvC,IAsDF,CAAC"}
@@ -1,61 +1,113 @@
1
1
  /**
2
- * Response-root field assertion (R41 lift, v0.2-plan §22).
2
+ * Response-root field assertion (R41 + R42 lifts, v0.2-plan §22).
3
3
  *
4
4
  * Distinguishes "key absent" (response-shape drift →
5
5
  * `internal_error`, whole-call) from "value null" (resource missing
6
- * / can't be applied → `not_found`, per-record). Codex M14 round-2
7
- * F1 + round-3 F1 pinned the contract; R41 lifts the inline helpers
8
- * that workspace add-users / workspace remove-users / board add-
9
- * users each ship verbatim.
6
+ * / per-record idiomatic null → `not_found`, per-record). Codex M14
7
+ * round-2 F1 + round-3 F1 pinned the contract; R41 lifted the inline
8
+ * check that workspace add-users / workspace remove-users / board
9
+ * add-users each shipped verbatim; R42 (post-v0.2 cleanup window)
10
+ * extends the same helper across the ~32 single-target mutation
11
+ * verbs that previously conflated the two cases (or left the
12
+ * missing-key path silent — projector-only null-handling treated
13
+ * "key absent" the same as "value null").
10
14
  *
11
- * **Why distinct from `assertUpdateMutationPresent`**
12
- * (`api/update-mutation-result.ts`). M13's helper handles null /
13
- * undefined uniformly with `not_found` — pre-dating the M14
14
- * missing-root-key vs null-value distinction. R42 (retroactive
15
- * sweep across pre-M14 mutation verbs) handles unifying them; R41
16
- * stays scoped to the M14 + M15 partial-success-fan-out family.
15
+ * **Two modes** controlled by `nullHandling` (required — keep the
16
+ * caller explicit so a future site doesn't silently inherit the
17
+ * wrong behaviour):
17
18
  *
18
- * **Used by:** `commands/workspace/add-users.ts` /
19
- * `commands/workspace/remove-users.ts` / `commands/board/add-users.ts`.
19
+ * - `'caller_handles'` (single-target verbs, R42): only check key
20
+ * presence. The caller's downstream projector handles null-value
21
+ * per-noun semantics — most M5b/M9-M12 verbs throw `not_found`
22
+ * from the projector for `null` (Monday's idiomatic missing-
23
+ * payload signal); item set throws `internal_error` for `null`
24
+ * per its M5b decision (an item that exists must always return a
25
+ * payload from `change_*`). Either way, R42's missing-key check
26
+ * surfaces FIRST and produces a uniform `internal_error` for
27
+ * schema drift, regardless of the noun's null-value choice.
20
28
  *
21
- * **Not used by:** single-target mutation verbs (board create /
22
- * update / archive / delete / duplicate, workspace create / update /
23
- * delete) those carry their own per-verb missing-root-key checks
24
- * because the contract is "every successful call returns the
25
- * resource" rather than "value null is a per-record path"; the
26
- * single-target verbs never throw `not_found` from the inline check
27
- * (the per-verb projector does that on the unwrapped value).
29
+ * - `'throw_not_found'` (partial-success-fan-out verbs, R41): also
30
+ * check `data[key]` for null/undefined and throw `not_found` so
31
+ * `dispatchSequential` slots it into the per-record failure
32
+ * array (whereas `internal_error` propagates and aborts the
33
+ * whole call). The `notFoundTarget` field shapes the not_found
34
+ * message phrasing and details.
35
+ *
36
+ * **Used by:**
37
+ * - `'throw_not_found'` mode: `users-fan-out-mutation.ts`
38
+ * (wraps board add-users / workspace add-users / workspace
39
+ * remove-users via `dispatchSequential`).
40
+ * - `'caller_handles'` mode (R42 sweep): every single-target
41
+ * mutation verb across M5b → M17 (item set / clear / update,
42
+ * item create / archive / delete / duplicate / move / upsert,
43
+ * update create / reply / edit / delete / toggle, board create
44
+ * / update / archive / delete / duplicate / add-users, column-
45
+ * create / update / delete, group-create / update / archive /
46
+ * duplicate / delete). M15-M17 sites inline the check
47
+ * verbatim pre-R42; the lift consolidates that boilerplate
48
+ * onto this helper. Pre-M14 (M5b/M9-M12) sites had no inline
49
+ * missing-key check; R42 adds it as net-new behaviour, picking
50
+ * up the M14 contract distinction proactively.
51
+ *
52
+ * **Not used by:** `update clear-all` per-target dispatch — that
53
+ * site uses `assertUpdateMutationPresent` (api/update-mutation-
54
+ * result.ts) which has a different contract (treats null +
55
+ * undefined uniformly as `not_found`, pre-dating M14's
56
+ * distinction). Migrating it is a separate question for v0.3
57
+ * (the two helpers may usefully merge).
28
58
  */
29
59
  import { ApiError } from '../utils/errors.js';
60
+ const SCHEMA_DRIFT_HINT = "this is a schema-drift error in Monday's GraphQL response; " +
61
+ 'verify the mutation declaration and update the response ' +
62
+ "schema if Monday's contract has changed.";
30
63
  /**
31
64
  * Throws `ApiError('internal_error')` when `key` is absent from
32
- * `data`; throws `ApiError('not_found')` when present but null.
33
- * Returns void on success. The caller's downstream code can rely
34
- * on `data[key]` being a non-null value after this call.
65
+ * `data` (schema drift). When `nullHandling === 'throw_not_found'`,
66
+ * also throws `ApiError('not_found')` if `data[key]` is null /
67
+ * undefined (per-record idiomatic missing). Returns void on success.
35
68
  *
36
69
  * Distinct error codes per the M14 round-2 F1 / round-3 F1
37
- * contract — `dispatchSequential` re-throws `internal_error`
38
- * (whole-call schema drift) but lets `not_found` land in the
39
- * per-record slot. Without this distinction, a per-record
40
- * not_found could be produced from a schema-drift response,
41
- * masking the contract violation.
70
+ * contract — `dispatchSequential` re-throws `internal_error` (whole-
71
+ * call schema drift) but lets `not_found` land in the per-record
72
+ * slot. Without this distinction, a per-record not_found could be
73
+ * produced from a schema-drift response, masking the contract
74
+ * violation; agents writing recovery loops keyed off `error.code`
75
+ * would treat schema drift as "this resource doesn't exist" and
76
+ * skip the failure rather than reporting it.
42
77
  */
43
78
  export const assertResponseFieldPresent = (inputs) => {
44
- const { data, key, operationLabel, scopeKey, scopeId, targetKey, targetId } = inputs;
45
- if (!(key in data)) {
46
- throw new ApiError('internal_error', `Monday's ${operationLabel} response is missing the ${key} root field`, {
47
- details: {
48
- [scopeKey]: scopeId,
49
- [targetKey]: targetId,
50
- hint: 'this is a schema-drift error in Monday\'s GraphQL response; ' +
51
- 'verify the mutation declaration and update the response ' +
52
- 'schema if Monday\'s contract has changed.',
53
- },
54
- });
79
+ const { data, key, operationLabel, details, nullHandling, notFoundTarget } = inputs;
80
+ // Defensive narrow the wire-schema parse upstream typically
81
+ // guarantees object-shape, but pre-M14 sites pass `response.data`
82
+ // directly without a wire-schema parse, so a malformed (non-
83
+ // object) response surfaces here rather than crashing on a later
84
+ // property access. Matched against `internal_error` since it's
85
+ // the same class of contract violation as a missing root key.
86
+ if (typeof data !== 'object' || data === null) {
87
+ throw new ApiError('internal_error', `Monday's ${operationLabel} response data is not object-shaped`, { details: { ...details, hint: SCHEMA_DRIFT_HINT } });
88
+ }
89
+ const record = data;
90
+ if (!(key in record)) {
91
+ throw new ApiError('internal_error', `Monday's ${operationLabel} response is missing the ${key} root field`, { details: { ...details, hint: SCHEMA_DRIFT_HINT } });
55
92
  }
56
- const raw = data[key];
93
+ if (nullHandling === 'caller_handles')
94
+ return;
95
+ const raw = record[key];
57
96
  if (raw === null || raw === undefined) {
58
- throw new ApiError('not_found', `Monday returned no payload from ${key} for ${targetKey.replace(/_id$/u, '')} ${targetId}`, { details: { [targetKey]: targetId } });
97
+ // 'throw_not_found' mode requires notFoundTarget to shape the
98
+ // per-record message + details. The type system marks it
99
+ // optional (since 'caller_handles' mode doesn't need it), but
100
+ // logically required here — surface a defensive internal_error
101
+ // if a future caller omits it in 'throw_not_found' mode.
102
+ /* c8 ignore next 7 — defensive: every 'throw_not_found' caller
103
+ supplies notFoundTarget; a future regression that omits it
104
+ fails loudly here rather than producing a half-shaped
105
+ not_found. */
106
+ if (notFoundTarget === undefined) {
107
+ throw new ApiError('internal_error', `assertResponseFieldPresent: 'throw_not_found' mode requires notFoundTarget`, { details: { ...details, hint: SCHEMA_DRIFT_HINT } });
108
+ }
109
+ const noun = notFoundTarget.key.replace(/_id$/u, '');
110
+ throw new ApiError('not_found', `Monday returned no payload from ${key} for ${noun} ${notFoundTarget.id}`, { details: { [notFoundTarget.key]: notFoundTarget.id } });
59
111
  }
60
112
  };
61
113
  //# sourceMappingURL=response-root.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-root.js","sourceRoot":"","sources":["../../src/api/response-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAyB9C;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,MAAwC,EAClC,EAAE;IACR,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,GACzE,MAAM,CAAC;IACT,IAAI,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,EAAE,CAAC;QACnB,MAAM,IAAI,QAAQ,CAChB,gBAAgB,EAChB,YAAY,cAAc,4BAA4B,GAAG,aAAa,EACtE;YACE,OAAO,EAAE;gBACP,CAAC,QAAQ,CAAC,EAAE,OAAO;gBACnB,CAAC,SAAS,CAAC,EAAE,QAAQ;gBACrB,IAAI,EACF,8DAA8D;oBAC9D,0DAA0D;oBAC1D,2CAA2C;aAC9C;SACF,CACF,CAAC;IACJ,CAAC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IACtB,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtC,MAAM,IAAI,QAAQ,CAChB,WAAW,EACX,mCAAmC,GAAG,QAAQ,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,QAAQ,EAAE,EAC1F,EAAE,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,EAAE,CACvC,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
1
+ {"version":3,"file":"response-root.js","sourceRoot":"","sources":["../../src/api/response-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,iBAAiB,GACrB,6DAA6D;IAC7D,0DAA0D;IAC1D,0CAA0C,CAAC;AAoC7C;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,MAAwC,EAClC,EAAE;IACR,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,cAAc,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,GACxE,MAAM,CAAC;IAET,8DAA8D;IAC9D,kEAAkE;IAClE,6DAA6D;IAC7D,iEAAiE;IACjE,+DAA+D;IAC/D,8DAA8D;IAC9D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,IAAI,QAAQ,CAChB,gBAAgB,EAChB,YAAY,cAAc,qCAAqC,EAC/D,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,CACrD,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,IAA+B,CAAC;IAC/C,IAAI,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,EAAE,CAAC;QACrB,MAAM,IAAI,QAAQ,CAChB,gBAAgB,EAChB,YAAY,cAAc,4BAA4B,GAAG,aAAa,EACtE,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,CACrD,CAAC;IACJ,CAAC;IAED,IAAI,YAAY,KAAK,gBAAgB;QAAE,OAAO;IAE9C,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;QACtC,8DAA8D;QAC9D,yDAAyD;QACzD,8DAA8D;QAC9D,+DAA+D;QAC/D,yDAAyD;QACzD;;;wBAGgB;QAChB,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,QAAQ,CAChB,gBAAgB,EAChB,4EAA4E,EAC5E,EAAE,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,EAAE,CACrD,CAAC;QACJ,CAAC;QACD,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QACrD,MAAM,IAAI,QAAQ,CAChB,WAAW,EACX,mCAAmC,GAAG,QAAQ,IAAI,IAAI,cAAc,CAAC,EAAE,EAAE,EACzE,EAAE,OAAO,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,EAAE,EAAE,EAAE,CACzD,CAAC;IACJ,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Per-account tag-directory lookup helper for the v0.3-M19 `tags`
3
+ * friendly translator. Mirrors the `userByEmail` user-directory
4
+ * pattern in `src/api/resolvers.ts:191–402` (the existing precedent —
5
+ * there is no standalone `user-directory.ts` module; the user-
6
+ * directory cache / lookup / refresh-on-miss machinery lives inside
7
+ * `resolvers.ts`).
8
+ *
9
+ * **Two surfaces.**
10
+ *
11
+ * - `loadAccountTags({client, env?, noCache?})` — full-directory
12
+ * reader. Cache-then-live: prefers a fresh on-disk
13
+ * `account_tags/index.json` cache entry; falls through to a live
14
+ * `account { tags { id name } }` query on miss / expiry / `noCache`,
15
+ * and writes the response back to the cache. Also exposes
16
+ * `complexity: Complexity | null` for the live-fetch leg, mirroring
17
+ * `BoardMetadataLoadResult` so `monday account tags --verbose` can
18
+ * report budget like other cache-backed reads.
19
+ *
20
+ * - `resolveTags({client, input, env?, noCache?})` — name-list →
21
+ * tag-id resolver. Splits the input on commas, trims, deduplicates,
22
+ * NFC + case-fold matches against the cache; on any miss, refreshes
23
+ * the directory once (live `account.tags` re-fetch) and re-checks.
24
+ * Residual misses surface as `tag_not_found` per cli-design §6.5
25
+ * with `details.tags: misses[]` in array form (Decision 1, closed
26
+ * at `4c652d5`). Returns `{ ids, misses, source, cacheAgeSeconds }`
27
+ * so the caller can populate `meta.source` + `meta.cache_age_seconds`
28
+ * per cli-design §6.1.
29
+ *
30
+ * **Cache shape.** Per-account scope (`{ kind: 'accountTags' }` cache
31
+ * key, no per-board fan-out — Monday's data model scopes tags to the
32
+ * account, not the workspace). On-disk path
33
+ * `account_tags/index.json`; mode `0600` per the cache layer's existing
34
+ * security contract.
35
+ *
36
+ * **Refresh on miss.** A `--set tags=foo` call against a cache that
37
+ * doesn't list `foo` re-fetches the account directory, upserts, and
38
+ * re-checks before surfacing `tag_not_found`. Mirrors the
39
+ * `userByEmail` cache-then-live-refresh-then-error sequence verbatim.
40
+ */
41
+ import type { MondayClient } from './client.js';
42
+ import type { Complexity } from '../utils/output/envelope.js';
43
+ /**
44
+ * Per-account tag entry. Shape mirrors `UserDirectoryEntry` from
45
+ * `resolvers.ts` (numeric-string id + display name); Monday's
46
+ * `tags` field on the account node returns `{ id, name }` per the
47
+ * GraphQL schema.
48
+ *
49
+ * The `id` field is constrained to a decimal non-negative integer
50
+ * string (NOT just any non-empty string) for the same reason the
51
+ * user directory does it: callers convert it to a JS number for
52
+ * the wire payload (`{ tag_ids: [N1, N2] }`), and a loose
53
+ * `z.string().min(1)` would let `"0x2a"` / `"1e3"` / `"42 "` into
54
+ * the cache where they'd silently corrupt every later
55
+ * `Number(id)` conversion.
56
+ */
57
+ export interface AccountTag {
58
+ readonly id: string;
59
+ readonly name: string;
60
+ }
61
+ export interface ResolveTagsInputs {
62
+ /**
63
+ * The Monday GraphQL client. Required because the cache-then-
64
+ * live sequence falls through to a live account-tag directory
65
+ * reload (via `loadAccountTags`) when the input list contains
66
+ * a name not in the cache, and re-checks the input names
67
+ * against the freshly-loaded set before surfacing
68
+ * `tag_not_found` for any residual misses. Mirrors
69
+ * `UserByEmailInputs.client` in `resolvers.ts:238`.
70
+ */
71
+ readonly client: MondayClient;
72
+ readonly input: string;
73
+ readonly env?: NodeJS.ProcessEnv;
74
+ readonly noCache?: boolean;
75
+ }
76
+ export interface ResolveTagsResult {
77
+ readonly ids: readonly number[];
78
+ readonly misses: readonly string[];
79
+ readonly source: 'cache' | 'live' | 'mixed';
80
+ /**
81
+ * Age of the cache entry the resolver read from when `source` is
82
+ * `'cache'` (full cache hit, no live refresh) or `'mixed'` (cache
83
+ * had some matches, live refresh covered the rest — the cache
84
+ * leg's age is preserved as the worst-case staleness the agent
85
+ * observed). `null` for `'live'` (no cache leg fired — empty
86
+ * cache or `noCache: true`). Surfaced into `meta.cache_age_seconds`
87
+ * via the translator-source aggregation pathway, matching the
88
+ * broader §6.1 mixed-source/cache-age contract.
89
+ */
90
+ readonly cacheAgeSeconds: number | null;
91
+ }
92
+ export interface LoadAccountTagsInputs {
93
+ /**
94
+ * The Monday GraphQL client. Required because `loadAccountTags`
95
+ * may bypass the cache (e.g. `monday account tags --refresh` if
96
+ * that flag ships at M19 implementation) and always hits the live
97
+ * directory on a cache miss. Mirrors `UserByEmailInputs.client`.
98
+ */
99
+ readonly client: MondayClient;
100
+ readonly env?: NodeJS.ProcessEnv;
101
+ readonly noCache?: boolean;
102
+ }
103
+ export interface LoadAccountTagsResult {
104
+ readonly tags: readonly AccountTag[];
105
+ readonly source: 'cache' | 'live';
106
+ readonly cacheAgeSeconds: number | null;
107
+ /**
108
+ * `meta.complexity` payload from the live request when one ran;
109
+ * `null` for cache hits and for non-`--verbose` live calls (Monday
110
+ * doesn't include `complexity` unless the operation selects it).
111
+ * Surfacing this here is what lets cache-backed commands report
112
+ * accurate complexity in `--verbose` mode (mirrors
113
+ * `BoardMetadataLoadResult.complexity` from `board-metadata.ts`).
114
+ */
115
+ readonly complexity: Complexity | null;
116
+ }
117
+ /**
118
+ * Loads the full per-account tag directory. Used by `monday account
119
+ * tags` (the read verb that resolves the §6.5 `tag_not_found.details
120
+ * .hint` forward-reference) and by `resolveTags`'s refresh-on-miss
121
+ * path. Cache-then-live: prefers a fresh on-disk entry; falls
122
+ * through to a live `account.tags` query on miss / expiry /
123
+ * `noCache`. Cache writes are best-effort (disk full / permission
124
+ * flips don't block the lookup).
125
+ */
126
+ export declare const loadAccountTags: (inputs: LoadAccountTagsInputs) => Promise<LoadAccountTagsResult>;
127
+ /**
128
+ * Resolves a comma-split tag-name list against the per-account
129
+ * directory. Returns numeric tag IDs for the matched names and
130
+ * carries the misses through so the caller can construct a
131
+ * `tag_not_found` error envelope with `details.tags: misses[]` per
132
+ * cli-design §6.5 (`4c652d5`).
133
+ *
134
+ * **Three-step lookup** mirroring `userByEmail`:
135
+ *
136
+ * 1. Read the on-disk cache (skipped on `noCache`). Match input
137
+ * tokens against cached entries with NFC + case-fold +
138
+ * whitespace-collapse.
139
+ * 2. If any input token misses against the cached set, refresh
140
+ * the directory once via a live `account.tags` query (also
141
+ * skipped on `noCache` — the live leg always runs but the
142
+ * result isn't cached).
143
+ * 3. Match input tokens against the freshly-loaded set. Any
144
+ * residual miss is surfaced as `tag_not_found` (caller's
145
+ * responsibility — this function returns the misses array
146
+ * and the caller decides whether to throw).
147
+ *
148
+ * **Empty input handled by the caller** — this function does not
149
+ * reject an empty input list; `column-values.ts`'s `tags` translator
150
+ * is the boundary that surfaces `usage_error` for `--set tags=""`
151
+ * (mirroring the dropdown / people empty-input contract).
152
+ */
153
+ export declare const resolveTags: (inputs: ResolveTagsInputs) => Promise<ResolveTagsResult>;
154
+ //# sourceMappingURL=tag-directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tag-directory.d.ts","sourceRoot":"","sources":["../../src/api/tag-directory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AASH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAeD,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;OAQG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAC5C;;;;;;;;;OASG;IACH,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CACxC;AA0DD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,GAC1B,QAAQ,qBAAqB,KAC5B,OAAO,CAAC,qBAAqB,CAoF/B,CAAC;AAgFF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,WAAW,GACtB,QAAQ,iBAAiB,KACxB,OAAO,CAAC,iBAAiB,CAyE3B,CAAC"}