google-mcp-suite 1.11.2 → 1.12.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 (524) hide show
  1. package/ADOPTING.md +4 -3
  2. package/README.md +7 -7
  3. package/dist/auth/config.js.map +1 -1
  4. package/dist/auth/oauth.js.map +1 -1
  5. package/dist/calendar/capabilities.js.map +1 -1
  6. package/dist/calendar/entities/NotificationLevel.d.ts +2 -2
  7. package/dist/calendar/lib/notifications.d.ts +3 -3
  8. package/dist/calendar/lib/notifications.d.ts.map +1 -1
  9. package/dist/calendar/methods/add_calendar_entry/schema.d.ts.map +1 -1
  10. package/dist/calendar/methods/clear_calendar/schema.d.ts.map +1 -1
  11. package/dist/calendar/methods/create_calendar/schema.d.ts.map +1 -1
  12. package/dist/calendar/methods/delete_calendar/schema.d.ts.map +1 -1
  13. package/dist/calendar/methods/get_calendar/schema.d.ts.map +1 -1
  14. package/dist/calendar/methods/get_calendar_entry/schema.d.ts.map +1 -1
  15. package/dist/calendar/methods/get_colors/schema.d.ts.map +1 -1
  16. package/dist/calendar/methods/get_setting/schema.d.ts.map +1 -1
  17. package/dist/calendar/methods/list_event_instances/schema.d.ts.map +1 -1
  18. package/dist/calendar/methods/list_settings/schema.d.ts.map +1 -1
  19. package/dist/calendar/methods/move_event/schema.d.ts.map +1 -1
  20. package/dist/calendar/methods/patch_event/index.d.ts +6 -6
  21. package/dist/calendar/methods/patch_event/schema.d.ts +6 -6
  22. package/dist/calendar/methods/patch_event/schema.d.ts.map +1 -1
  23. package/dist/calendar/methods/query_free_busy/schema.d.ts.map +1 -1
  24. package/dist/calendar/methods/quick_add_event/schema.d.ts.map +1 -1
  25. package/dist/calendar/methods/registry.d.ts +6 -6
  26. package/dist/calendar/methods/remove_calendar_entry/schema.d.ts.map +1 -1
  27. package/dist/calendar/methods/update_calendar/schema.d.ts.map +1 -1
  28. package/dist/calendar/methods/update_calendar_entry/schema.d.ts.map +1 -1
  29. package/dist/calendar/operation.d.ts.map +1 -1
  30. package/dist/calendar/tools/create_event/index.d.ts +3 -3
  31. package/dist/calendar/tools/create_event/schema.d.ts +3 -3
  32. package/dist/calendar/tools/create_event/schema.d.ts.map +1 -1
  33. package/dist/calendar/tools/delete_event/index.d.ts +2 -2
  34. package/dist/calendar/tools/delete_event/schema.d.ts +2 -2
  35. package/dist/calendar/tools/delete_event/schema.d.ts.map +1 -1
  36. package/dist/calendar/tools/get_event/schema.d.ts.map +1 -1
  37. package/dist/calendar/tools/list_calendars/schema.d.ts.map +1 -1
  38. package/dist/calendar/tools/list_events/index.d.ts +4 -4
  39. package/dist/calendar/tools/list_events/schema.d.ts +4 -4
  40. package/dist/calendar/tools/list_events/schema.d.ts.map +1 -1
  41. package/dist/calendar/tools/registry.d.ts +15 -15
  42. package/dist/calendar/tools/respond_to_event/index.d.ts +3 -3
  43. package/dist/calendar/tools/respond_to_event/schema.d.ts +3 -3
  44. package/dist/calendar/tools/respond_to_event/schema.d.ts.map +1 -1
  45. package/dist/calendar/tools/suggest_time/schema.d.ts.map +1 -1
  46. package/dist/calendar/tools/update_event/index.d.ts +3 -3
  47. package/dist/calendar/tools/update_event/schema.d.ts +3 -3
  48. package/dist/calendar/tools/update_event/schema.d.ts.map +1 -1
  49. package/dist/docs/capabilities.js.map +1 -1
  50. package/dist/docs/entities/ParagraphStyle.d.ts +4 -4
  51. package/dist/docs/entities/TextStyle.d.ts +1 -1
  52. package/dist/docs/methods/create_document/schema.d.ts.map +1 -1
  53. package/dist/docs/methods/create_paragraph_bullets/index.d.ts +6 -6
  54. package/dist/docs/methods/create_paragraph_bullets/schema.d.ts +6 -6
  55. package/dist/docs/methods/create_paragraph_bullets/schema.d.ts.map +1 -1
  56. package/dist/docs/methods/delete_content_range/schema.d.ts.map +1 -1
  57. package/dist/docs/methods/delete_paragraph_bullets/schema.d.ts.map +1 -1
  58. package/dist/docs/methods/get_document/schema.d.ts.map +1 -1
  59. package/dist/docs/methods/insert_text/schema.d.ts.map +1 -1
  60. package/dist/docs/methods/registry.d.ts +11 -11
  61. package/dist/docs/methods/replace_all_text/schema.d.ts.map +1 -1
  62. package/dist/docs/methods/update_paragraph_style/index.d.ts +4 -4
  63. package/dist/docs/methods/update_paragraph_style/schema.d.ts +4 -4
  64. package/dist/docs/methods/update_paragraph_style/schema.d.ts.map +1 -1
  65. package/dist/docs/methods/update_text_style/index.d.ts +1 -1
  66. package/dist/docs/methods/update_text_style/schema.d.ts +1 -1
  67. package/dist/docs/methods/update_text_style/schema.d.ts.map +1 -1
  68. package/dist/docs/operation.d.ts.map +1 -1
  69. package/dist/doctor/auth.js.map +1 -1
  70. package/dist/doctor/browser.js.map +1 -1
  71. package/dist/doctor/diagnose.js.map +1 -1
  72. package/dist/doctor/services.js.map +1 -1
  73. package/dist/drive/capabilities.js.map +1 -1
  74. package/dist/drive/entities/Comment.d.ts +1 -1
  75. package/dist/drive/entities/Permission.d.ts +5 -5
  76. package/dist/drive/entities/Reply.d.ts +1 -1
  77. package/dist/drive/methods/create_comment/index.d.ts +1 -1
  78. package/dist/drive/methods/create_comment/schema.d.ts +1 -1
  79. package/dist/drive/methods/create_comment/schema.d.ts.map +1 -1
  80. package/dist/drive/methods/create_reply/index.d.ts +2 -2
  81. package/dist/drive/methods/create_reply/schema.d.ts +2 -2
  82. package/dist/drive/methods/create_reply/schema.d.ts.map +1 -1
  83. package/dist/drive/methods/create_shared_drive/schema.d.ts.map +1 -1
  84. package/dist/drive/methods/delete_comment/schema.d.ts.map +1 -1
  85. package/dist/drive/methods/delete_file/schema.d.ts.map +1 -1
  86. package/dist/drive/methods/delete_reply/schema.d.ts.map +1 -1
  87. package/dist/drive/methods/delete_revision/schema.d.ts.map +1 -1
  88. package/dist/drive/methods/delete_shared_drive/schema.d.ts.map +1 -1
  89. package/dist/drive/methods/empty_trash/schema.d.ts.map +1 -1
  90. package/dist/drive/methods/get_about/schema.d.ts.map +1 -1
  91. package/dist/drive/methods/get_comment/index.d.ts +1 -1
  92. package/dist/drive/methods/get_comment/schema.d.ts +1 -1
  93. package/dist/drive/methods/get_comment/schema.d.ts.map +1 -1
  94. package/dist/drive/methods/get_reply/index.d.ts +1 -1
  95. package/dist/drive/methods/get_reply/schema.d.ts +1 -1
  96. package/dist/drive/methods/get_reply/schema.d.ts.map +1 -1
  97. package/dist/drive/methods/get_revision/schema.d.ts.map +1 -1
  98. package/dist/drive/methods/get_shared_drive/schema.d.ts.map +1 -1
  99. package/dist/drive/methods/hide_shared_drive/schema.d.ts.map +1 -1
  100. package/dist/drive/methods/list_comments/index.d.ts +1 -1
  101. package/dist/drive/methods/list_comments/schema.d.ts +1 -1
  102. package/dist/drive/methods/list_comments/schema.d.ts.map +1 -1
  103. package/dist/drive/methods/list_replies/index.d.ts +1 -1
  104. package/dist/drive/methods/list_replies/schema.d.ts +1 -1
  105. package/dist/drive/methods/list_replies/schema.d.ts.map +1 -1
  106. package/dist/drive/methods/list_revisions/schema.d.ts.map +1 -1
  107. package/dist/drive/methods/list_shared_drives/schema.d.ts.map +1 -1
  108. package/dist/drive/methods/registry.d.ts +9 -9
  109. package/dist/drive/methods/trash_file/schema.d.ts.map +1 -1
  110. package/dist/drive/methods/unhide_shared_drive/schema.d.ts.map +1 -1
  111. package/dist/drive/methods/untrash_file/schema.d.ts.map +1 -1
  112. package/dist/drive/methods/update_comment/index.d.ts +1 -1
  113. package/dist/drive/methods/update_comment/schema.d.ts +1 -1
  114. package/dist/drive/methods/update_comment/schema.d.ts.map +1 -1
  115. package/dist/drive/methods/update_file/schema.d.ts.map +1 -1
  116. package/dist/drive/methods/update_reply/index.d.ts +1 -1
  117. package/dist/drive/methods/update_reply/schema.d.ts +1 -1
  118. package/dist/drive/methods/update_reply/schema.d.ts.map +1 -1
  119. package/dist/drive/methods/update_revision/schema.d.ts.map +1 -1
  120. package/dist/drive/methods/update_shared_drive/schema.d.ts.map +1 -1
  121. package/dist/drive/operation.d.ts.map +1 -1
  122. package/dist/drive/tools/copy_file/schema.d.ts.map +1 -1
  123. package/dist/drive/tools/create_file/schema.d.ts.map +1 -1
  124. package/dist/drive/tools/download_file_content/schema.d.ts.map +1 -1
  125. package/dist/drive/tools/get_file_metadata/schema.d.ts.map +1 -1
  126. package/dist/drive/tools/get_file_permissions/index.d.ts +5 -5
  127. package/dist/drive/tools/get_file_permissions/schema.d.ts +5 -5
  128. package/dist/drive/tools/get_file_permissions/schema.d.ts.map +1 -1
  129. package/dist/drive/tools/list_recent_files/index.d.ts +1 -1
  130. package/dist/drive/tools/list_recent_files/schema.d.ts +1 -1
  131. package/dist/drive/tools/list_recent_files/schema.d.ts.map +1 -1
  132. package/dist/drive/tools/read_file_content/schema.d.ts.map +1 -1
  133. package/dist/drive/tools/registry.d.ts +6 -6
  134. package/dist/drive/tools/search_files/schema.d.ts.map +1 -1
  135. package/dist/gmail/capabilities.js.map +1 -1
  136. package/dist/gmail/entities/Filter.d.ts +1 -1
  137. package/dist/gmail/entities/FilterCriteria.d.ts +1 -1
  138. package/dist/gmail/methods/batch_delete_messages/schema.d.ts.map +1 -1
  139. package/dist/gmail/methods/batch_modify_messages/schema.d.ts.map +1 -1
  140. package/dist/gmail/methods/create_filter/index.d.ts +2 -2
  141. package/dist/gmail/methods/create_filter/schema.d.ts +2 -2
  142. package/dist/gmail/methods/create_filter/schema.d.ts.map +1 -1
  143. package/dist/gmail/methods/delete_draft/schema.d.ts.map +1 -1
  144. package/dist/gmail/methods/delete_filter/schema.d.ts.map +1 -1
  145. package/dist/gmail/methods/delete_label/schema.d.ts.map +1 -1
  146. package/dist/gmail/methods/delete_message/schema.d.ts.map +1 -1
  147. package/dist/gmail/methods/delete_thread/schema.d.ts.map +1 -1
  148. package/dist/gmail/methods/download_attachment/schema.d.ts.map +1 -1
  149. package/dist/gmail/methods/get_draft/schema.d.ts.map +1 -1
  150. package/dist/gmail/methods/get_filter/index.d.ts +1 -1
  151. package/dist/gmail/methods/get_filter/schema.d.ts +1 -1
  152. package/dist/gmail/methods/get_filter/schema.d.ts.map +1 -1
  153. package/dist/gmail/methods/get_label/schema.d.ts.map +1 -1
  154. package/dist/gmail/methods/get_message/index.d.ts +1 -1
  155. package/dist/gmail/methods/get_message/schema.d.ts +1 -1
  156. package/dist/gmail/methods/get_message/schema.d.ts.map +1 -1
  157. package/dist/gmail/methods/list_filters/index.d.ts +1 -1
  158. package/dist/gmail/methods/list_filters/schema.d.ts +1 -1
  159. package/dist/gmail/methods/list_filters/schema.d.ts.map +1 -1
  160. package/dist/gmail/methods/list_messages/schema.d.ts.map +1 -1
  161. package/dist/gmail/methods/registry.d.ts +5 -5
  162. package/dist/gmail/methods/send_draft/schema.d.ts.map +1 -1
  163. package/dist/gmail/methods/send_message/schema.d.ts.map +1 -1
  164. package/dist/gmail/methods/trash_message/schema.d.ts.map +1 -1
  165. package/dist/gmail/methods/trash_thread/schema.d.ts.map +1 -1
  166. package/dist/gmail/methods/untrash_message/schema.d.ts.map +1 -1
  167. package/dist/gmail/methods/untrash_thread/schema.d.ts.map +1 -1
  168. package/dist/gmail/methods/update_draft/schema.d.ts.map +1 -1
  169. package/dist/gmail/methods/update_label/schema.d.ts.map +1 -1
  170. package/dist/gmail/operation.d.ts.map +1 -1
  171. package/dist/gmail/tools/create_draft/schema.d.ts.map +1 -1
  172. package/dist/gmail/tools/create_label/schema.d.ts.map +1 -1
  173. package/dist/gmail/tools/get_thread/index.d.ts +1 -1
  174. package/dist/gmail/tools/get_thread/schema.d.ts +1 -1
  175. package/dist/gmail/tools/get_thread/schema.d.ts.map +1 -1
  176. package/dist/gmail/tools/label_message/schema.d.ts.map +1 -1
  177. package/dist/gmail/tools/label_thread/schema.d.ts.map +1 -1
  178. package/dist/gmail/tools/list_drafts/schema.d.ts.map +1 -1
  179. package/dist/gmail/tools/list_labels/schema.d.ts.map +1 -1
  180. package/dist/gmail/tools/registry.d.ts +1 -1
  181. package/dist/gmail/tools/search_threads/schema.d.ts.map +1 -1
  182. package/dist/gmail/tools/unlabel_message/schema.d.ts.map +1 -1
  183. package/dist/gmail/tools/unlabel_thread/schema.d.ts.map +1 -1
  184. package/dist/lib/instructions.d.ts +1 -1
  185. package/dist/lib/instructions.js +2 -2
  186. package/dist/lib/instructions.js.map +1 -1
  187. package/dist/lib/operation.d.ts.map +1 -1
  188. package/dist/sheets/capabilities.js.map +1 -1
  189. package/dist/sheets/entities/BasicChartSpec.d.ts +72 -0
  190. package/dist/sheets/entities/BasicChartSpec.d.ts.map +1 -0
  191. package/dist/sheets/entities/BasicChartSpec.js +53 -0
  192. package/dist/sheets/entities/BasicChartSpec.js.map +1 -0
  193. package/dist/sheets/entities/Border.d.ts +38 -0
  194. package/dist/sheets/entities/Border.d.ts.map +1 -0
  195. package/dist/sheets/entities/Border.js +15 -0
  196. package/dist/sheets/entities/Border.js.map +1 -0
  197. package/dist/sheets/entities/CellFormat.d.ts +86 -0
  198. package/dist/sheets/entities/CellFormat.d.ts.map +1 -0
  199. package/dist/sheets/entities/CellFormat.js +30 -0
  200. package/dist/sheets/entities/CellFormat.js.map +1 -0
  201. package/dist/sheets/entities/ChartData.d.ts +20 -0
  202. package/dist/sheets/entities/ChartData.d.ts.map +1 -0
  203. package/dist/sheets/entities/ChartData.js +18 -0
  204. package/dist/sheets/entities/ChartData.js.map +1 -0
  205. package/dist/sheets/entities/ChartSpec.d.ts +111 -0
  206. package/dist/sheets/entities/ChartSpec.d.ts.map +1 -0
  207. package/dist/sheets/entities/ChartSpec.js +18 -0
  208. package/dist/sheets/entities/ChartSpec.js.map +1 -0
  209. package/dist/sheets/entities/Color.d.ts +15 -0
  210. package/dist/sheets/entities/Color.d.ts.map +1 -0
  211. package/dist/sheets/entities/Color.js +24 -0
  212. package/dist/sheets/entities/Color.js.map +1 -0
  213. package/dist/sheets/entities/ColorStyle.d.ts +29 -0
  214. package/dist/sheets/entities/ColorStyle.d.ts.map +1 -0
  215. package/dist/sheets/entities/ColorStyle.js +28 -0
  216. package/dist/sheets/entities/ColorStyle.js.map +1 -0
  217. package/dist/sheets/entities/DataFilter.d.ts +3 -3
  218. package/dist/sheets/entities/DataFilterValueRange.d.ts +4 -4
  219. package/dist/sheets/entities/DateTimeRenderOption.d.ts +1 -1
  220. package/dist/sheets/entities/DeveloperMetadata.d.ts +2 -2
  221. package/dist/sheets/entities/DeveloperMetadataLocation.d.ts +2 -2
  222. package/dist/sheets/entities/DeveloperMetadataLookup.d.ts +3 -3
  223. package/dist/sheets/entities/DimensionRange.d.ts +1 -1
  224. package/dist/sheets/entities/DimensionRange.d.ts.map +1 -1
  225. package/dist/sheets/entities/DimensionRange.js +2 -0
  226. package/dist/sheets/entities/DimensionRange.js.map +1 -1
  227. package/dist/sheets/entities/EmbeddedObjectPosition.d.ts +24 -0
  228. package/dist/sheets/entities/EmbeddedObjectPosition.d.ts.map +1 -0
  229. package/dist/sheets/entities/EmbeddedObjectPosition.js +17 -0
  230. package/dist/sheets/entities/EmbeddedObjectPosition.js.map +1 -0
  231. package/dist/sheets/entities/GridCoordinate.d.ts +13 -0
  232. package/dist/sheets/entities/GridCoordinate.d.ts.map +1 -0
  233. package/dist/sheets/entities/GridCoordinate.js +12 -0
  234. package/dist/sheets/entities/GridCoordinate.js.map +1 -0
  235. package/dist/sheets/entities/GridProperties.d.ts +1 -1
  236. package/dist/sheets/entities/GridProperties.d.ts.map +1 -1
  237. package/dist/sheets/entities/GridProperties.js +10 -3
  238. package/dist/sheets/entities/GridProperties.js.map +1 -1
  239. package/dist/sheets/entities/MajorDimension.d.ts +1 -1
  240. package/dist/sheets/entities/MatchedValueRange.d.ts +4 -4
  241. package/dist/sheets/entities/NamedRange.d.ts +21 -0
  242. package/dist/sheets/entities/NamedRange.d.ts.map +1 -0
  243. package/dist/sheets/entities/NamedRange.js +15 -0
  244. package/dist/sheets/entities/NamedRange.js.map +1 -0
  245. package/dist/sheets/entities/NumberFormat.d.ts +21 -0
  246. package/dist/sheets/entities/NumberFormat.d.ts.map +1 -0
  247. package/dist/sheets/entities/NumberFormat.js +16 -0
  248. package/dist/sheets/entities/NumberFormat.js.map +1 -0
  249. package/dist/sheets/entities/OverlayPosition.d.ts +20 -0
  250. package/dist/sheets/entities/OverlayPosition.d.ts.map +1 -0
  251. package/dist/sheets/entities/OverlayPosition.js +34 -0
  252. package/dist/sheets/entities/OverlayPosition.js.map +1 -0
  253. package/dist/sheets/entities/PieChartSpec.d.ts +42 -0
  254. package/dist/sheets/entities/PieChartSpec.d.ts.map +1 -0
  255. package/dist/sheets/entities/PieChartSpec.js +30 -0
  256. package/dist/sheets/entities/PieChartSpec.js.map +1 -0
  257. package/dist/sheets/entities/SheetProperties.d.ts +23 -5
  258. package/dist/sheets/entities/SheetProperties.d.ts.map +1 -1
  259. package/dist/sheets/entities/SheetProperties.js +5 -3
  260. package/dist/sheets/entities/SheetProperties.js.map +1 -1
  261. package/dist/sheets/entities/Spreadsheet.d.ts +33 -4
  262. package/dist/sheets/entities/Spreadsheet.d.ts.map +1 -1
  263. package/dist/sheets/entities/Spreadsheet.js +5 -0
  264. package/dist/sheets/entities/Spreadsheet.js.map +1 -1
  265. package/dist/sheets/entities/SpreadsheetProperties.d.ts +2 -2
  266. package/dist/sheets/entities/TextFormat.d.ts +35 -0
  267. package/dist/sheets/entities/TextFormat.d.ts.map +1 -0
  268. package/dist/sheets/entities/TextFormat.js +18 -0
  269. package/dist/sheets/entities/TextFormat.js.map +1 -0
  270. package/dist/sheets/entities/UpdateValuesByDataFilterResponse.d.ts +4 -4
  271. package/dist/sheets/entities/UpdateValuesResponse.d.ts +1 -1
  272. package/dist/sheets/entities/ValueRange.d.ts +1 -1
  273. package/dist/sheets/entities/ValueRenderOption.d.ts +1 -1
  274. package/dist/sheets/instructions.d.ts.map +1 -1
  275. package/dist/sheets/instructions.js +6 -1
  276. package/dist/sheets/instructions.js.map +1 -1
  277. package/dist/sheets/lib/charts.d.ts +15 -0
  278. package/dist/sheets/lib/charts.d.ts.map +1 -0
  279. package/dist/sheets/lib/charts.js +66 -0
  280. package/dist/sheets/lib/charts.js.map +1 -0
  281. package/dist/sheets/lib/formats.d.ts +29 -0
  282. package/dist/sheets/lib/formats.d.ts.map +1 -0
  283. package/dist/sheets/lib/formats.js +61 -0
  284. package/dist/sheets/lib/formats.js.map +1 -0
  285. package/dist/sheets/lib/requests.d.ts +20 -0
  286. package/dist/sheets/lib/requests.d.ts.map +1 -0
  287. package/dist/sheets/lib/requests.js +41 -0
  288. package/dist/sheets/lib/requests.js.map +1 -0
  289. package/dist/sheets/lib/spreadsheet.d.ts +3 -0
  290. package/dist/sheets/lib/spreadsheet.d.ts.map +1 -1
  291. package/dist/sheets/lib/spreadsheet.js +32 -0
  292. package/dist/sheets/lib/spreadsheet.js.map +1 -1
  293. package/dist/sheets/methods/add_chart/handler.d.ts +5 -0
  294. package/dist/sheets/methods/add_chart/handler.d.ts.map +1 -0
  295. package/dist/sheets/methods/add_chart/handler.js +25 -0
  296. package/dist/sheets/methods/add_chart/handler.js.map +1 -0
  297. package/dist/sheets/methods/add_chart/index.d.ts +125 -0
  298. package/dist/sheets/methods/add_chart/index.d.ts.map +1 -0
  299. package/dist/sheets/methods/add_chart/index.js +20 -0
  300. package/dist/sheets/methods/add_chart/index.js.map +1 -0
  301. package/dist/sheets/methods/add_chart/schema.d.ts +126 -0
  302. package/dist/sheets/methods/add_chart/schema.d.ts.map +1 -0
  303. package/dist/sheets/methods/add_chart/schema.js +23 -0
  304. package/dist/sheets/methods/add_chart/schema.js.map +1 -0
  305. package/dist/sheets/methods/add_named_range/handler.d.ts +5 -0
  306. package/dist/sheets/methods/add_named_range/handler.d.ts.map +1 -0
  307. package/dist/sheets/methods/add_named_range/handler.js +12 -0
  308. package/dist/sheets/methods/add_named_range/handler.js.map +1 -0
  309. package/dist/sheets/methods/add_named_range/index.d.ts +26 -0
  310. package/dist/sheets/methods/add_named_range/index.d.ts.map +1 -0
  311. package/dist/sheets/methods/add_named_range/index.js +20 -0
  312. package/dist/sheets/methods/add_named_range/index.js.map +1 -0
  313. package/dist/sheets/methods/add_named_range/schema.d.ts +26 -0
  314. package/dist/sheets/methods/add_named_range/schema.d.ts.map +1 -0
  315. package/dist/sheets/methods/add_named_range/schema.js +14 -0
  316. package/dist/sheets/methods/add_named_range/schema.js.map +1 -0
  317. package/dist/sheets/methods/add_sheet/handler.d.ts +5 -0
  318. package/dist/sheets/methods/add_sheet/handler.d.ts.map +1 -0
  319. package/dist/sheets/methods/add_sheet/handler.js +19 -0
  320. package/dist/sheets/methods/add_sheet/handler.js.map +1 -0
  321. package/dist/sheets/methods/add_sheet/index.d.ts +69 -0
  322. package/dist/sheets/methods/add_sheet/index.d.ts.map +1 -0
  323. package/dist/sheets/methods/add_sheet/index.js +20 -0
  324. package/dist/sheets/methods/add_sheet/index.js.map +1 -0
  325. package/dist/sheets/methods/add_sheet/schema.d.ts +69 -0
  326. package/dist/sheets/methods/add_sheet/schema.d.ts.map +1 -0
  327. package/dist/sheets/methods/add_sheet/schema.js +24 -0
  328. package/dist/sheets/methods/add_sheet/schema.js.map +1 -0
  329. package/dist/sheets/methods/append_values/index.d.ts +5 -5
  330. package/dist/sheets/methods/append_values/schema.d.ts +5 -5
  331. package/dist/sheets/methods/append_values/schema.d.ts.map +1 -1
  332. package/dist/sheets/methods/auto_resize_dimensions/handler.d.ts +5 -0
  333. package/dist/sheets/methods/auto_resize_dimensions/handler.d.ts.map +1 -0
  334. package/dist/sheets/methods/auto_resize_dimensions/handler.js +9 -0
  335. package/dist/sheets/methods/auto_resize_dimensions/handler.js.map +1 -0
  336. package/dist/sheets/methods/auto_resize_dimensions/index.d.ts +16 -0
  337. package/dist/sheets/methods/auto_resize_dimensions/index.d.ts.map +1 -0
  338. package/dist/sheets/methods/auto_resize_dimensions/index.js +17 -0
  339. package/dist/sheets/methods/auto_resize_dimensions/index.js.map +1 -0
  340. package/dist/sheets/methods/auto_resize_dimensions/schema.d.ts +20 -0
  341. package/dist/sheets/methods/auto_resize_dimensions/schema.d.ts.map +1 -0
  342. package/dist/sheets/methods/auto_resize_dimensions/schema.js +13 -0
  343. package/dist/sheets/methods/auto_resize_dimensions/schema.js.map +1 -0
  344. package/dist/sheets/methods/batch_clear_values/schema.d.ts.map +1 -1
  345. package/dist/sheets/methods/batch_clear_values_by_data_filter/index.d.ts +3 -3
  346. package/dist/sheets/methods/batch_clear_values_by_data_filter/schema.d.ts +3 -3
  347. package/dist/sheets/methods/batch_clear_values_by_data_filter/schema.d.ts.map +1 -1
  348. package/dist/sheets/methods/batch_get_values/index.d.ts +4 -4
  349. package/dist/sheets/methods/batch_get_values/schema.d.ts +4 -4
  350. package/dist/sheets/methods/batch_get_values/schema.d.ts.map +1 -1
  351. package/dist/sheets/methods/batch_get_values_by_data_filter/index.d.ts +10 -10
  352. package/dist/sheets/methods/batch_get_values_by_data_filter/schema.d.ts +10 -10
  353. package/dist/sheets/methods/batch_get_values_by_data_filter/schema.d.ts.map +1 -1
  354. package/dist/sheets/methods/batch_update_values/index.d.ts +4 -4
  355. package/dist/sheets/methods/batch_update_values/schema.d.ts +4 -4
  356. package/dist/sheets/methods/batch_update_values/schema.d.ts.map +1 -1
  357. package/dist/sheets/methods/batch_update_values_by_data_filter/index.d.ts +10 -10
  358. package/dist/sheets/methods/batch_update_values_by_data_filter/schema.d.ts +10 -10
  359. package/dist/sheets/methods/batch_update_values_by_data_filter/schema.d.ts.map +1 -1
  360. package/dist/sheets/methods/clear_values/schema.d.ts.map +1 -1
  361. package/dist/sheets/methods/copy_sheet/index.d.ts +20 -2
  362. package/dist/sheets/methods/copy_sheet/index.d.ts.map +1 -1
  363. package/dist/sheets/methods/copy_sheet/schema.d.ts +20 -2
  364. package/dist/sheets/methods/copy_sheet/schema.d.ts.map +1 -1
  365. package/dist/sheets/methods/create_spreadsheet/index.d.ts +33 -4
  366. package/dist/sheets/methods/create_spreadsheet/index.d.ts.map +1 -1
  367. package/dist/sheets/methods/create_spreadsheet/schema.d.ts +33 -4
  368. package/dist/sheets/methods/create_spreadsheet/schema.d.ts.map +1 -1
  369. package/dist/sheets/methods/delete_dimension/handler.d.ts +5 -0
  370. package/dist/sheets/methods/delete_dimension/handler.d.ts.map +1 -0
  371. package/dist/sheets/methods/delete_dimension/handler.js +9 -0
  372. package/dist/sheets/methods/delete_dimension/handler.js.map +1 -0
  373. package/dist/sheets/methods/delete_dimension/index.d.ts +19 -0
  374. package/dist/sheets/methods/delete_dimension/index.d.ts.map +1 -0
  375. package/dist/sheets/methods/delete_dimension/index.js +20 -0
  376. package/dist/sheets/methods/delete_dimension/index.js.map +1 -0
  377. package/dist/sheets/methods/delete_dimension/schema.d.ts +20 -0
  378. package/dist/sheets/methods/delete_dimension/schema.d.ts.map +1 -0
  379. package/dist/sheets/methods/delete_dimension/schema.js +13 -0
  380. package/dist/sheets/methods/delete_dimension/schema.js.map +1 -0
  381. package/dist/sheets/methods/delete_embedded_object/handler.d.ts +5 -0
  382. package/dist/sheets/methods/delete_embedded_object/handler.d.ts.map +1 -0
  383. package/dist/sheets/methods/delete_embedded_object/handler.js +8 -0
  384. package/dist/sheets/methods/delete_embedded_object/handler.js.map +1 -0
  385. package/dist/sheets/methods/delete_embedded_object/index.d.ts +12 -0
  386. package/dist/sheets/methods/delete_embedded_object/index.d.ts.map +1 -0
  387. package/dist/sheets/methods/delete_embedded_object/index.js +20 -0
  388. package/dist/sheets/methods/delete_embedded_object/index.js.map +1 -0
  389. package/dist/sheets/methods/delete_embedded_object/schema.d.ts +13 -0
  390. package/dist/sheets/methods/delete_embedded_object/schema.d.ts.map +1 -0
  391. package/dist/sheets/methods/delete_embedded_object/schema.js +16 -0
  392. package/dist/sheets/methods/delete_embedded_object/schema.js.map +1 -0
  393. package/dist/sheets/methods/delete_named_range/handler.d.ts +5 -0
  394. package/dist/sheets/methods/delete_named_range/handler.d.ts.map +1 -0
  395. package/dist/sheets/methods/delete_named_range/handler.js +8 -0
  396. package/dist/sheets/methods/delete_named_range/handler.js.map +1 -0
  397. package/dist/sheets/methods/delete_named_range/index.d.ts +12 -0
  398. package/dist/sheets/methods/delete_named_range/index.d.ts.map +1 -0
  399. package/dist/sheets/methods/delete_named_range/index.js +20 -0
  400. package/dist/sheets/methods/delete_named_range/index.js.map +1 -0
  401. package/dist/sheets/methods/delete_named_range/schema.d.ts +13 -0
  402. package/dist/sheets/methods/delete_named_range/schema.d.ts.map +1 -0
  403. package/dist/sheets/methods/delete_named_range/schema.js +15 -0
  404. package/dist/sheets/methods/delete_named_range/schema.js.map +1 -0
  405. package/dist/sheets/methods/delete_sheet/handler.d.ts +5 -0
  406. package/dist/sheets/methods/delete_sheet/handler.d.ts.map +1 -0
  407. package/dist/sheets/methods/delete_sheet/handler.js +6 -0
  408. package/dist/sheets/methods/delete_sheet/handler.js.map +1 -0
  409. package/dist/sheets/methods/delete_sheet/index.d.ts +13 -0
  410. package/dist/sheets/methods/delete_sheet/index.d.ts.map +1 -0
  411. package/dist/sheets/methods/delete_sheet/index.js +21 -0
  412. package/dist/sheets/methods/delete_sheet/index.js.map +1 -0
  413. package/dist/sheets/methods/delete_sheet/schema.d.ts +13 -0
  414. package/dist/sheets/methods/delete_sheet/schema.d.ts.map +1 -0
  415. package/dist/sheets/methods/delete_sheet/schema.js +13 -0
  416. package/dist/sheets/methods/delete_sheet/schema.js.map +1 -0
  417. package/dist/sheets/methods/duplicate_sheet/handler.d.ts +5 -0
  418. package/dist/sheets/methods/duplicate_sheet/handler.d.ts.map +1 -0
  419. package/dist/sheets/methods/duplicate_sheet/handler.js +15 -0
  420. package/dist/sheets/methods/duplicate_sheet/handler.js.map +1 -0
  421. package/dist/sheets/methods/duplicate_sheet/index.d.ts +46 -0
  422. package/dist/sheets/methods/duplicate_sheet/index.d.ts.map +1 -0
  423. package/dist/sheets/methods/duplicate_sheet/index.js +20 -0
  424. package/dist/sheets/methods/duplicate_sheet/index.js.map +1 -0
  425. package/dist/sheets/methods/duplicate_sheet/schema.d.ts +46 -0
  426. package/dist/sheets/methods/duplicate_sheet/schema.d.ts.map +1 -0
  427. package/dist/sheets/methods/duplicate_sheet/schema.js +26 -0
  428. package/dist/sheets/methods/duplicate_sheet/schema.js.map +1 -0
  429. package/dist/sheets/methods/get_developer_metadata/index.d.ts +2 -2
  430. package/dist/sheets/methods/get_developer_metadata/schema.d.ts +2 -2
  431. package/dist/sheets/methods/get_developer_metadata/schema.d.ts.map +1 -1
  432. package/dist/sheets/methods/get_spreadsheet/index.d.ts +33 -4
  433. package/dist/sheets/methods/get_spreadsheet/index.d.ts.map +1 -1
  434. package/dist/sheets/methods/get_spreadsheet/schema.d.ts +33 -4
  435. package/dist/sheets/methods/get_spreadsheet/schema.d.ts.map +1 -1
  436. package/dist/sheets/methods/get_values/index.d.ts +4 -4
  437. package/dist/sheets/methods/get_values/schema.d.ts +4 -4
  438. package/dist/sheets/methods/get_values/schema.d.ts.map +1 -1
  439. package/dist/sheets/methods/insert_dimension/handler.d.ts +5 -0
  440. package/dist/sheets/methods/insert_dimension/handler.d.ts.map +1 -0
  441. package/dist/sheets/methods/insert_dimension/handler.js +18 -0
  442. package/dist/sheets/methods/insert_dimension/handler.js.map +1 -0
  443. package/dist/sheets/methods/insert_dimension/index.d.ts +16 -0
  444. package/dist/sheets/methods/insert_dimension/index.d.ts.map +1 -0
  445. package/dist/sheets/methods/insert_dimension/index.js +16 -0
  446. package/dist/sheets/methods/insert_dimension/index.js.map +1 -0
  447. package/dist/sheets/methods/insert_dimension/schema.d.ts +21 -0
  448. package/dist/sheets/methods/insert_dimension/schema.d.ts.map +1 -0
  449. package/dist/sheets/methods/insert_dimension/schema.js +22 -0
  450. package/dist/sheets/methods/insert_dimension/schema.js.map +1 -0
  451. package/dist/sheets/methods/registry.d.ts +882 -65
  452. package/dist/sheets/methods/registry.d.ts.map +1 -1
  453. package/dist/sheets/methods/registry.js +37 -2
  454. package/dist/sheets/methods/registry.js.map +1 -1
  455. package/dist/sheets/methods/repeat_cell/handler.d.ts +5 -0
  456. package/dist/sheets/methods/repeat_cell/handler.d.ts.map +1 -0
  457. package/dist/sheets/methods/repeat_cell/handler.js +22 -0
  458. package/dist/sheets/methods/repeat_cell/handler.js.map +1 -0
  459. package/dist/sheets/methods/repeat_cell/index.d.ts +95 -0
  460. package/dist/sheets/methods/repeat_cell/index.d.ts.map +1 -0
  461. package/dist/sheets/methods/repeat_cell/index.js +22 -0
  462. package/dist/sheets/methods/repeat_cell/index.js.map +1 -0
  463. package/dist/sheets/methods/repeat_cell/schema.d.ts +94 -0
  464. package/dist/sheets/methods/repeat_cell/schema.d.ts.map +1 -0
  465. package/dist/sheets/methods/repeat_cell/schema.js +18 -0
  466. package/dist/sheets/methods/repeat_cell/schema.js.map +1 -0
  467. package/dist/sheets/methods/search_developer_metadata/index.d.ts +8 -8
  468. package/dist/sheets/methods/search_developer_metadata/schema.d.ts +8 -8
  469. package/dist/sheets/methods/search_developer_metadata/schema.d.ts.map +1 -1
  470. package/dist/sheets/methods/update_borders/handler.d.ts +5 -0
  471. package/dist/sheets/methods/update_borders/handler.d.ts.map +1 -0
  472. package/dist/sheets/methods/update_borders/handler.js +21 -0
  473. package/dist/sheets/methods/update_borders/handler.js.map +1 -0
  474. package/dist/sheets/methods/update_borders/index.d.ts +191 -0
  475. package/dist/sheets/methods/update_borders/index.d.ts.map +1 -0
  476. package/dist/sheets/methods/update_borders/index.js +20 -0
  477. package/dist/sheets/methods/update_borders/index.js.map +1 -0
  478. package/dist/sheets/methods/update_borders/schema.d.ts +192 -0
  479. package/dist/sheets/methods/update_borders/schema.d.ts.map +1 -0
  480. package/dist/sheets/methods/update_borders/schema.js +20 -0
  481. package/dist/sheets/methods/update_borders/schema.js.map +1 -0
  482. package/dist/sheets/methods/update_chart_spec/handler.d.ts +5 -0
  483. package/dist/sheets/methods/update_chart_spec/handler.d.ts.map +1 -0
  484. package/dist/sheets/methods/update_chart_spec/handler.js +10 -0
  485. package/dist/sheets/methods/update_chart_spec/handler.js.map +1 -0
  486. package/dist/sheets/methods/update_chart_spec/index.d.ts +112 -0
  487. package/dist/sheets/methods/update_chart_spec/index.d.ts.map +1 -0
  488. package/dist/sheets/methods/update_chart_spec/index.js +20 -0
  489. package/dist/sheets/methods/update_chart_spec/index.js.map +1 -0
  490. package/dist/sheets/methods/update_chart_spec/schema.d.ts +113 -0
  491. package/dist/sheets/methods/update_chart_spec/schema.d.ts.map +1 -0
  492. package/dist/sheets/methods/update_chart_spec/schema.js +15 -0
  493. package/dist/sheets/methods/update_chart_spec/schema.js.map +1 -0
  494. package/dist/sheets/methods/update_sheet_properties/handler.d.ts +5 -0
  495. package/dist/sheets/methods/update_sheet_properties/handler.d.ts.map +1 -0
  496. package/dist/sheets/methods/update_sheet_properties/handler.js +30 -0
  497. package/dist/sheets/methods/update_sheet_properties/handler.js.map +1 -0
  498. package/dist/sheets/methods/update_sheet_properties/index.d.ts +44 -0
  499. package/dist/sheets/methods/update_sheet_properties/index.d.ts.map +1 -0
  500. package/dist/sheets/methods/update_sheet_properties/index.js +24 -0
  501. package/dist/sheets/methods/update_sheet_properties/index.js.map +1 -0
  502. package/dist/sheets/methods/update_sheet_properties/schema.d.ts +41 -0
  503. package/dist/sheets/methods/update_sheet_properties/schema.d.ts.map +1 -0
  504. package/dist/sheets/methods/update_sheet_properties/schema.js +28 -0
  505. package/dist/sheets/methods/update_sheet_properties/schema.js.map +1 -0
  506. package/dist/sheets/methods/update_spreadsheet_properties/handler.d.ts +5 -0
  507. package/dist/sheets/methods/update_spreadsheet_properties/handler.d.ts.map +1 -0
  508. package/dist/sheets/methods/update_spreadsheet_properties/handler.js +26 -0
  509. package/dist/sheets/methods/update_spreadsheet_properties/handler.js.map +1 -0
  510. package/dist/sheets/methods/update_spreadsheet_properties/index.d.ts +20 -0
  511. package/dist/sheets/methods/update_spreadsheet_properties/index.d.ts.map +1 -0
  512. package/dist/sheets/methods/update_spreadsheet_properties/index.js +21 -0
  513. package/dist/sheets/methods/update_spreadsheet_properties/index.js.map +1 -0
  514. package/dist/sheets/methods/update_spreadsheet_properties/schema.d.ts +20 -0
  515. package/dist/sheets/methods/update_spreadsheet_properties/schema.d.ts.map +1 -0
  516. package/dist/sheets/methods/update_spreadsheet_properties/schema.js +19 -0
  517. package/dist/sheets/methods/update_spreadsheet_properties/schema.js.map +1 -0
  518. package/dist/sheets/methods/update_values/index.d.ts +4 -4
  519. package/dist/sheets/methods/update_values/schema.d.ts +4 -4
  520. package/dist/sheets/methods/update_values/schema.d.ts.map +1 -1
  521. package/dist/sheets/operation.d.ts.map +1 -1
  522. package/dist/suite/dispatch.d.ts +1 -1
  523. package/dist/suite/dispatch.d.ts.map +1 -1
  524. package/package.json +6 -6
@@ -0,0 +1,61 @@
1
+ import { forGoogle } from '../../lib/optionality.js';
2
+ /**
3
+ * Format-noun carriers: the request-direction mirror of spreadsheet.ts's
4
+ * projections, taking documented entities across the Google boundary with
5
+ * `forGoogle` at each level (see optionality.ts). Each carrier enumerates its
6
+ * entity's fields by hand, so a field added to an entity without a carrier
7
+ * line compiles unchanged and silently drops at the boundary; the handler
8
+ * tests' exact-params assertions are the guard, so extend them with the field.
9
+ */
10
+ /**
11
+ * Carry a ColorStyle across the Google boundary. Enforces the entity's
12
+ * documented exactly-one rule here, once, for every input path (tab colors,
13
+ * fills, text foregrounds, borders): the REST field is a oneof, and Google
14
+ * rejects both-set with "oneof field 'kind' is already set" (live-verified).
15
+ * The rule stays out of the entity itself because the output projection
16
+ * deliberately degrades an unknown theme color to an empty ColorStyle.
17
+ */
18
+ export function toColorStyle(colorStyle) {
19
+ if ((colorStyle.rgbColor === undefined) === (colorStyle.themeColor === undefined)) {
20
+ throw new Error('Provide exactly one of rgbColor or themeColor in a color.');
21
+ }
22
+ return forGoogle({
23
+ rgbColor: colorStyle.rgbColor ? forGoogle(colorStyle.rgbColor) : undefined,
24
+ themeColor: colorStyle.themeColor,
25
+ });
26
+ }
27
+ /** Carry a TextFormat across the Google boundary. */
28
+ export function toTextFormat(textFormat) {
29
+ return forGoogle({
30
+ foregroundColorStyle: textFormat.foregroundColorStyle
31
+ ? toColorStyle(textFormat.foregroundColorStyle)
32
+ : undefined,
33
+ fontFamily: textFormat.fontFamily,
34
+ fontSize: textFormat.fontSize,
35
+ bold: textFormat.bold,
36
+ italic: textFormat.italic,
37
+ strikethrough: textFormat.strikethrough,
38
+ underline: textFormat.underline,
39
+ });
40
+ }
41
+ /** Carry a CellFormat across the Google boundary. */
42
+ export function toCellFormat(format) {
43
+ return forGoogle({
44
+ numberFormat: format.numberFormat ? forGoogle(format.numberFormat) : undefined,
45
+ backgroundColorStyle: format.backgroundColorStyle
46
+ ? toColorStyle(format.backgroundColorStyle)
47
+ : undefined,
48
+ textFormat: format.textFormat ? toTextFormat(format.textFormat) : undefined,
49
+ horizontalAlignment: format.horizontalAlignment,
50
+ verticalAlignment: format.verticalAlignment,
51
+ wrapStrategy: format.wrapStrategy,
52
+ });
53
+ }
54
+ /** Carry a Border across the Google boundary. */
55
+ export function toBorder(border) {
56
+ return forGoogle({
57
+ style: border.style,
58
+ colorStyle: border.colorStyle ? toColorStyle(border.colorStyle) : undefined,
59
+ });
60
+ }
61
+ //# sourceMappingURL=formats.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formats.js","sourceRoot":"","sources":["../../../src/sheets/lib/formats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAMrD;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,UAAsB;IACjD,IAAI,CAAC,UAAU,CAAC,QAAQ,KAAK,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,CAAC,EAAE,CAAC;QAClF,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,SAAS,CAAC;QACf,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAC1E,UAAU,EAAE,UAAU,CAAC,UAAU;KAClC,CAAC,CAAC;AACL,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,YAAY,CAAC,UAAsB;IACjD,OAAO,SAAS,CAAC;QACf,oBAAoB,EAAE,UAAU,CAAC,oBAAoB;YACnD,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,oBAAoB,CAAC;YAC/C,CAAC,CAAC,SAAS;QACb,UAAU,EAAE,UAAU,CAAC,UAAU;QACjC,QAAQ,EAAE,UAAU,CAAC,QAAQ;QAC7B,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,MAAM,EAAE,UAAU,CAAC,MAAM;QACzB,aAAa,EAAE,UAAU,CAAC,aAAa;QACvC,SAAS,EAAE,UAAU,CAAC,SAAS;KAChC,CAAC,CAAC;AACL,CAAC;AAED,qDAAqD;AACrD,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC7C,OAAO,SAAS,CAAC;QACf,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,SAAS;QAC9E,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;YAC/C,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,oBAAoB,CAAC;YAC3C,CAAC,CAAC,SAAS;QACb,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3E,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;QAC/C,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,YAAY,EAAE,MAAM,CAAC,YAAY;KAClC,CAAC,CAAC;AACL,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,QAAQ,CAAC,MAAc;IACrC,OAAO,SAAS,CAAC;QACf,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;KAC5E,CAAC,CAAC;AACL,CAAC","sourcesContent":["import type { sheets_v4 } from '@googleapis/sheets';\nimport { forGoogle } from '../../lib/optionality.js';\nimport type { Border } from '../entities/Border.js';\nimport type { CellFormat } from '../entities/CellFormat.js';\nimport type { ColorStyle } from '../entities/ColorStyle.js';\nimport type { TextFormat } from '../entities/TextFormat.js';\n\n/**\n * Format-noun carriers: the request-direction mirror of spreadsheet.ts's\n * projections, taking documented entities across the Google boundary with\n * `forGoogle` at each level (see optionality.ts). Each carrier enumerates its\n * entity's fields by hand, so a field added to an entity without a carrier\n * line compiles unchanged and silently drops at the boundary; the handler\n * tests' exact-params assertions are the guard, so extend them with the field.\n */\n\n/**\n * Carry a ColorStyle across the Google boundary. Enforces the entity's\n * documented exactly-one rule here, once, for every input path (tab colors,\n * fills, text foregrounds, borders): the REST field is a oneof, and Google\n * rejects both-set with \"oneof field 'kind' is already set\" (live-verified).\n * The rule stays out of the entity itself because the output projection\n * deliberately degrades an unknown theme color to an empty ColorStyle.\n */\nexport function toColorStyle(colorStyle: ColorStyle): sheets_v4.Schema$ColorStyle {\n if ((colorStyle.rgbColor === undefined) === (colorStyle.themeColor === undefined)) {\n throw new Error('Provide exactly one of rgbColor or themeColor in a color.');\n }\n return forGoogle({\n rgbColor: colorStyle.rgbColor ? forGoogle(colorStyle.rgbColor) : undefined,\n themeColor: colorStyle.themeColor,\n });\n}\n\n/** Carry a TextFormat across the Google boundary. */\nexport function toTextFormat(textFormat: TextFormat): sheets_v4.Schema$TextFormat {\n return forGoogle({\n foregroundColorStyle: textFormat.foregroundColorStyle\n ? toColorStyle(textFormat.foregroundColorStyle)\n : undefined,\n fontFamily: textFormat.fontFamily,\n fontSize: textFormat.fontSize,\n bold: textFormat.bold,\n italic: textFormat.italic,\n strikethrough: textFormat.strikethrough,\n underline: textFormat.underline,\n });\n}\n\n/** Carry a CellFormat across the Google boundary. */\nexport function toCellFormat(format: CellFormat): sheets_v4.Schema$CellFormat {\n return forGoogle({\n numberFormat: format.numberFormat ? forGoogle(format.numberFormat) : undefined,\n backgroundColorStyle: format.backgroundColorStyle\n ? toColorStyle(format.backgroundColorStyle)\n : undefined,\n textFormat: format.textFormat ? toTextFormat(format.textFormat) : undefined,\n horizontalAlignment: format.horizontalAlignment,\n verticalAlignment: format.verticalAlignment,\n wrapStrategy: format.wrapStrategy,\n });\n}\n\n/** Carry a Border across the Google boundary. */\nexport function toBorder(border: Border): sheets_v4.Schema$Border {\n return forGoogle({\n style: border.style,\n colorStyle: border.colorStyle ? toColorStyle(border.colorStyle) : undefined,\n });\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import type { sheets_v4 } from '@googleapis/sheets';
2
+ /**
3
+ * Apply one batchUpdate request to a spreadsheet and return its reply.
4
+ * `spreadsheets.batchUpdate` takes a union-typed requests array of 69 request
5
+ * types; the suite exposes a curated subset as purpose-named operations, each
6
+ * of which funnels through here with exactly one request. Request types whose
7
+ * reply is empty (deletes, property updates) get `{}` back.
8
+ */
9
+ export declare function applyRequest(sheets: sheets_v4.Sheets, spreadsheetId: string, request: sheets_v4.Schema$Request): Promise<sheets_v4.Schema$Response>;
10
+ /**
11
+ * Build an update request's field mask from the arguments actually provided:
12
+ * one path per defined key, with each key named in `expand` broken into one
13
+ * path per defined subkey, so an untouched sibling (a frozen count, a bold
14
+ * flag) is not reset to its default by a too-wide mask. Returns the
15
+ * comma-joined mask, empty when nothing was provided (an expanded key whose
16
+ * object is empty counts as nothing); callers must reject an empty mask
17
+ * rather than send it (Google reads it as "update no fields").
18
+ */
19
+ export declare function fieldPaths<T extends Record<string, unknown>>(provided: T, expand?: readonly (keyof T & string)[]): string;
20
+ //# sourceMappingURL=requests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.d.ts","sourceRoot":"","sources":["../../../src/sheets/lib/requests.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,SAAS,CAAC,MAAM,EACxB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,SAAS,CAAC,cAAc,GAChC,OAAO,CAAC,SAAS,CAAC,eAAe,CAAC,CAMpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC1D,QAAQ,EAAE,CAAC,EACX,MAAM,GAAE,SAAS,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,EAAO,GACzC,MAAM,CAaR"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Apply one batchUpdate request to a spreadsheet and return its reply.
3
+ * `spreadsheets.batchUpdate` takes a union-typed requests array of 69 request
4
+ * types; the suite exposes a curated subset as purpose-named operations, each
5
+ * of which funnels through here with exactly one request. Request types whose
6
+ * reply is empty (deletes, property updates) get `{}` back.
7
+ */
8
+ export async function applyRequest(sheets, spreadsheetId, request) {
9
+ const { data } = await sheets.spreadsheets.batchUpdate({
10
+ spreadsheetId,
11
+ requestBody: { requests: [request] },
12
+ });
13
+ return data.replies?.[0] ?? {};
14
+ }
15
+ /**
16
+ * Build an update request's field mask from the arguments actually provided:
17
+ * one path per defined key, with each key named in `expand` broken into one
18
+ * path per defined subkey, so an untouched sibling (a frozen count, a bold
19
+ * flag) is not reset to its default by a too-wide mask. Returns the
20
+ * comma-joined mask, empty when nothing was provided (an expanded key whose
21
+ * object is empty counts as nothing); callers must reject an empty mask
22
+ * rather than send it (Google reads it as "update no fields").
23
+ */
24
+ export function fieldPaths(provided, expand = []) {
25
+ const paths = [];
26
+ for (const [key, value] of Object.entries(provided)) {
27
+ if (value === undefined)
28
+ continue;
29
+ if (expand.includes(key) && value !== null && typeof value === 'object') {
30
+ for (const [subKey, subValue] of Object.entries(value)) {
31
+ if (subValue !== undefined)
32
+ paths.push(`${key}.${subKey}`);
33
+ }
34
+ }
35
+ else {
36
+ paths.push(key);
37
+ }
38
+ }
39
+ return paths.join(',');
40
+ }
41
+ //# sourceMappingURL=requests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../src/sheets/lib/requests.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAwB,EACxB,aAAqB,EACrB,OAAiC;IAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,WAAW,CAAC;QACrD,aAAa;QACb,WAAW,EAAE,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE;KACrC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACjC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,UAAU,CACxB,QAAW,EACX,MAAM,GAAkC,EAAE;IAE1C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACpD,IAAI,KAAK,KAAK,SAAS;YAAE,SAAS;QAClC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACxE,KAAK,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvD,IAAI,QAAQ,KAAK,SAAS;oBAAE,KAAK,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,EAAE,CAAC,CAAC;YAC7D,CAAC;QACH,CAAC;aAAM,CAAC;YACN,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACzB,CAAC","sourcesContent":["import type { sheets_v4 } from '@googleapis/sheets';\n\n/**\n * Apply one batchUpdate request to a spreadsheet and return its reply.\n * `spreadsheets.batchUpdate` takes a union-typed requests array of 69 request\n * types; the suite exposes a curated subset as purpose-named operations, each\n * of which funnels through here with exactly one request. Request types whose\n * reply is empty (deletes, property updates) get `{}` back.\n */\nexport async function applyRequest(\n sheets: sheets_v4.Sheets,\n spreadsheetId: string,\n request: sheets_v4.Schema$Request,\n): Promise<sheets_v4.Schema$Response> {\n const { data } = await sheets.spreadsheets.batchUpdate({\n spreadsheetId,\n requestBody: { requests: [request] },\n });\n return data.replies?.[0] ?? {};\n}\n\n/**\n * Build an update request's field mask from the arguments actually provided:\n * one path per defined key, with each key named in `expand` broken into one\n * path per defined subkey, so an untouched sibling (a frozen count, a bold\n * flag) is not reset to its default by a too-wide mask. Returns the\n * comma-joined mask, empty when nothing was provided (an expanded key whose\n * object is empty counts as nothing); callers must reject an empty mask\n * rather than send it (Google reads it as \"update no fields\").\n */\nexport function fieldPaths<T extends Record<string, unknown>>(\n provided: T,\n expand: readonly (keyof T & string)[] = [],\n): string {\n const paths: string[] = [];\n for (const [key, value] of Object.entries(provided)) {\n if (value === undefined) continue;\n if (expand.includes(key) && value !== null && typeof value === 'object') {\n for (const [subKey, subValue] of Object.entries(value)) {\n if (subValue !== undefined) paths.push(`${key}.${subKey}`);\n }\n } else {\n paths.push(key);\n }\n }\n return paths.join(',');\n}\n"]}
@@ -1,8 +1,11 @@
1
1
  import type { sheets_v4 } from '@googleapis/sheets';
2
+ import type { NamedRange } from '../entities/NamedRange.js';
2
3
  import { SheetProperties } from '../entities/SheetProperties.js';
3
4
  import type { Spreadsheet } from '../entities/Spreadsheet.js';
4
5
  /** Project REST sheet properties onto the SheetProperties shape, cleaning nulls to undefined. */
5
6
  export declare function projectSheetProperties(data: sheets_v4.Schema$SheetProperties): SheetProperties;
7
+ /** Project a REST named range onto the NamedRange shape, cleaning nulls to undefined. */
8
+ export declare function projectNamedRange(data: sheets_v4.Schema$NamedRange): NamedRange;
6
9
  /**
7
10
  * Project a REST spreadsheet onto the metadata-only Spreadsheet shape: each
8
11
  * `Sheet` flattens to its properties, grid data is never carried, and nulls
@@ -1 +1 @@
1
- {"version":3,"file":"spreadsheet.d.ts","sourceRoot":"","sources":["../../../src/sheets/lib/spreadsheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,iGAAiG;AACjG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,CAAC,sBAAsB,GAAG,eAAe,CAgB9F;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,kBAAkB,GAAG,WAAW,CAqBlF"}
1
+ {"version":3,"file":"spreadsheet.d.ts","sourceRoot":"","sources":["../../../src/sheets/lib/spreadsheet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAiB9D,iGAAiG;AACjG,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,SAAS,CAAC,sBAAsB,GAAG,eAAe,CAiB9F;AAED,yFAAyF;AACzF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,CAAC,iBAAiB,GAAG,UAAU,CAc/E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,kBAAkB,GAAG,WAAW,CAsBlF"}
@@ -1,6 +1,20 @@
1
1
  import { narrow } from '../../lib/utils/narrow.js';
2
+ import { ColorStyle } from '../entities/ColorStyle.js';
2
3
  import { SheetProperties } from '../entities/SheetProperties.js';
3
4
  import { SpreadsheetProperties } from '../entities/SpreadsheetProperties.js';
5
+ /** Project a REST color style onto the ColorStyle shape, dropping unknown theme colors. */
6
+ function projectColorStyle(data) {
7
+ return {
8
+ rgbColor: data.rgbColor
9
+ ? {
10
+ red: data.rgbColor.red ?? undefined,
11
+ green: data.rgbColor.green ?? undefined,
12
+ blue: data.rgbColor.blue ?? undefined,
13
+ }
14
+ : undefined,
15
+ themeColor: narrow(data.themeColor, ColorStyle.shape.themeColor.unwrap().options),
16
+ };
17
+ }
4
18
  /** Project REST sheet properties onto the SheetProperties shape, cleaning nulls to undefined. */
5
19
  export function projectSheetProperties(data) {
6
20
  return {
@@ -17,6 +31,23 @@ export function projectSheetProperties(data) {
17
31
  }
18
32
  : undefined,
19
33
  hidden: data.hidden ?? undefined,
34
+ tabColorStyle: data.tabColorStyle ? projectColorStyle(data.tabColorStyle) : undefined,
35
+ };
36
+ }
37
+ /** Project a REST named range onto the NamedRange shape, cleaning nulls to undefined. */
38
+ export function projectNamedRange(data) {
39
+ return {
40
+ namedRangeId: data.namedRangeId ?? undefined,
41
+ name: data.name ?? undefined,
42
+ range: data.range
43
+ ? {
44
+ sheetId: data.range.sheetId ?? undefined,
45
+ startRowIndex: data.range.startRowIndex ?? undefined,
46
+ endRowIndex: data.range.endRowIndex ?? undefined,
47
+ startColumnIndex: data.range.startColumnIndex ?? undefined,
48
+ endColumnIndex: data.range.endColumnIndex ?? undefined,
49
+ }
50
+ : undefined,
20
51
  };
21
52
  }
22
53
  /**
@@ -39,6 +70,7 @@ export function projectSpreadsheet(data) {
39
70
  sheets: data.sheets
40
71
  ? data.sheets.flatMap((sheet) => sheet.properties ? [projectSheetProperties(sheet.properties)] : [])
41
72
  : undefined,
73
+ namedRanges: data.namedRanges ? data.namedRanges.map(projectNamedRange) : undefined,
42
74
  };
43
75
  }
44
76
  //# sourceMappingURL=spreadsheet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spreadsheet.js","sourceRoot":"","sources":["../../../src/sheets/lib/spreadsheet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,iGAAiG;AACjG,MAAM,UAAU,sBAAsB,CAAC,IAAsC;IAC3E,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,CAAC;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;QAC9B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;QAC9B,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QACnF,cAAc,EAAE,IAAI,CAAC,cAAc;YACjC,CAAC,CAAC;gBACE,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,IAAI,SAAS;gBACnD,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,SAAS;gBACzD,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,cAAc,IAAI,SAAS;gBAC/D,iBAAiB,EAAE,IAAI,CAAC,cAAc,CAAC,iBAAiB,IAAI,SAAS;aACtE;YACH,CAAC,CAAC,SAAS;QACb,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,SAAS;KACjC,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAkC;IACnE,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;QACvC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,SAAS;QAChD,UAAU,EAAE,IAAI,CAAC,UAAU;YACzB,CAAC,CAAC;gBACE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,SAAS;gBACzC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,SAAS;gBAC3C,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS;gBAC/C,UAAU,EAAE,MAAM,CAChB,IAAI,CAAC,UAAU,CAAC,UAAU,EAC1B,qBAAqB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,OAAO,CACxD;aACF;YACH,CAAC,CAAC,SAAS;QACb,MAAM,EAAE,IAAI,CAAC,MAAM;YACjB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5B,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CACnE;YACH,CAAC,CAAC,SAAS;KACd,CAAC;AACJ,CAAC","sourcesContent":["import type { sheets_v4 } from '@googleapis/sheets';\nimport { narrow } from '../../lib/utils/narrow.js';\nimport { SheetProperties } from '../entities/SheetProperties.js';\nimport type { Spreadsheet } from '../entities/Spreadsheet.js';\nimport { SpreadsheetProperties } from '../entities/SpreadsheetProperties.js';\n\n/** Project REST sheet properties onto the SheetProperties shape, cleaning nulls to undefined. */\nexport function projectSheetProperties(data: sheets_v4.Schema$SheetProperties): SheetProperties {\n return {\n sheetId: data.sheetId ?? 0,\n title: data.title ?? undefined,\n index: data.index ?? undefined,\n sheetType: narrow(data.sheetType, SheetProperties.shape.sheetType.unwrap().options),\n gridProperties: data.gridProperties\n ? {\n rowCount: data.gridProperties.rowCount ?? undefined,\n columnCount: data.gridProperties.columnCount ?? undefined,\n frozenRowCount: data.gridProperties.frozenRowCount ?? undefined,\n frozenColumnCount: data.gridProperties.frozenColumnCount ?? undefined,\n }\n : undefined,\n hidden: data.hidden ?? undefined,\n };\n}\n\n/**\n * Project a REST spreadsheet onto the metadata-only Spreadsheet shape: each\n * `Sheet` flattens to its properties, grid data is never carried, and nulls\n * clean to undefined.\n */\nexport function projectSpreadsheet(data: sheets_v4.Schema$Spreadsheet): Spreadsheet {\n return {\n spreadsheetId: data.spreadsheetId ?? '',\n spreadsheetUrl: data.spreadsheetUrl ?? undefined,\n properties: data.properties\n ? {\n title: data.properties.title ?? undefined,\n locale: data.properties.locale ?? undefined,\n timeZone: data.properties.timeZone ?? undefined,\n autoRecalc: narrow(\n data.properties.autoRecalc,\n SpreadsheetProperties.shape.autoRecalc.unwrap().options,\n ),\n }\n : undefined,\n sheets: data.sheets\n ? data.sheets.flatMap((sheet) =>\n sheet.properties ? [projectSheetProperties(sheet.properties)] : [],\n )\n : undefined,\n };\n}\n"]}
1
+ {"version":3,"file":"spreadsheet.js","sourceRoot":"","sources":["../../../src/sheets/lib/spreadsheet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAE7E,2FAA2F;AAC3F,SAAS,iBAAiB,CAAC,IAAiC;IAC1D,OAAO;QACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACrB,CAAC,CAAC;gBACE,GAAG,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,IAAI,SAAS;gBACnC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,SAAS;gBACvC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,SAAS;aACtC;YACH,CAAC,CAAC,SAAS;QACb,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;KAClF,CAAC;AACJ,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,sBAAsB,CAAC,IAAsC;IAC3E,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,CAAC;QAC1B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;QAC9B,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,SAAS;QAC9B,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,eAAe,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC;QACnF,cAAc,EAAE,IAAI,CAAC,cAAc;YACjC,CAAC,CAAC;gBACE,QAAQ,EAAE,IAAI,CAAC,cAAc,CAAC,QAAQ,IAAI,SAAS;gBACnD,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,SAAS;gBACzD,cAAc,EAAE,IAAI,CAAC,cAAc,CAAC,cAAc,IAAI,SAAS;gBAC/D,iBAAiB,EAAE,IAAI,CAAC,cAAc,CAAC,iBAAiB,IAAI,SAAS;aACtE;YACH,CAAC,CAAC,SAAS;QACb,MAAM,EAAE,IAAI,CAAC,MAAM,IAAI,SAAS;QAChC,aAAa,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS;KACtF,CAAC;AACJ,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,iBAAiB,CAAC,IAAiC;IACjE,OAAO;QACL,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS;QAC5C,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,SAAS;QAC5B,KAAK,EAAE,IAAI,CAAC,KAAK;YACf,CAAC,CAAC;gBACE,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,SAAS;gBACxC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,IAAI,SAAS;gBACpD,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,SAAS;gBAChD,gBAAgB,EAAE,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,SAAS;gBAC1D,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,IAAI,SAAS;aACvD;YACH,CAAC,CAAC,SAAS;KACd,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAkC;IACnE,OAAO;QACL,aAAa,EAAE,IAAI,CAAC,aAAa,IAAI,EAAE;QACvC,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,SAAS;QAChD,UAAU,EAAE,IAAI,CAAC,UAAU;YACzB,CAAC,CAAC;gBACE,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,SAAS;gBACzC,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,IAAI,SAAS;gBAC3C,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,IAAI,SAAS;gBAC/C,UAAU,EAAE,MAAM,CAChB,IAAI,CAAC,UAAU,CAAC,UAAU,EAC1B,qBAAqB,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,OAAO,CACxD;aACF;YACH,CAAC,CAAC,SAAS;QACb,MAAM,EAAE,IAAI,CAAC,MAAM;YACjB,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5B,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CACnE;YACH,CAAC,CAAC,SAAS;QACb,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS;KACpF,CAAC;AACJ,CAAC","sourcesContent":["import type { sheets_v4 } from '@googleapis/sheets';\nimport { narrow } from '../../lib/utils/narrow.js';\nimport { ColorStyle } from '../entities/ColorStyle.js';\nimport type { NamedRange } from '../entities/NamedRange.js';\nimport { SheetProperties } from '../entities/SheetProperties.js';\nimport type { Spreadsheet } from '../entities/Spreadsheet.js';\nimport { SpreadsheetProperties } from '../entities/SpreadsheetProperties.js';\n\n/** Project a REST color style onto the ColorStyle shape, dropping unknown theme colors. */\nfunction projectColorStyle(data: sheets_v4.Schema$ColorStyle): ColorStyle {\n return {\n rgbColor: data.rgbColor\n ? {\n red: data.rgbColor.red ?? undefined,\n green: data.rgbColor.green ?? undefined,\n blue: data.rgbColor.blue ?? undefined,\n }\n : undefined,\n themeColor: narrow(data.themeColor, ColorStyle.shape.themeColor.unwrap().options),\n };\n}\n\n/** Project REST sheet properties onto the SheetProperties shape, cleaning nulls to undefined. */\nexport function projectSheetProperties(data: sheets_v4.Schema$SheetProperties): SheetProperties {\n return {\n sheetId: data.sheetId ?? 0,\n title: data.title ?? undefined,\n index: data.index ?? undefined,\n sheetType: narrow(data.sheetType, SheetProperties.shape.sheetType.unwrap().options),\n gridProperties: data.gridProperties\n ? {\n rowCount: data.gridProperties.rowCount ?? undefined,\n columnCount: data.gridProperties.columnCount ?? undefined,\n frozenRowCount: data.gridProperties.frozenRowCount ?? undefined,\n frozenColumnCount: data.gridProperties.frozenColumnCount ?? undefined,\n }\n : undefined,\n hidden: data.hidden ?? undefined,\n tabColorStyle: data.tabColorStyle ? projectColorStyle(data.tabColorStyle) : undefined,\n };\n}\n\n/** Project a REST named range onto the NamedRange shape, cleaning nulls to undefined. */\nexport function projectNamedRange(data: sheets_v4.Schema$NamedRange): NamedRange {\n return {\n namedRangeId: data.namedRangeId ?? undefined,\n name: data.name ?? undefined,\n range: data.range\n ? {\n sheetId: data.range.sheetId ?? undefined,\n startRowIndex: data.range.startRowIndex ?? undefined,\n endRowIndex: data.range.endRowIndex ?? undefined,\n startColumnIndex: data.range.startColumnIndex ?? undefined,\n endColumnIndex: data.range.endColumnIndex ?? undefined,\n }\n : undefined,\n };\n}\n\n/**\n * Project a REST spreadsheet onto the metadata-only Spreadsheet shape: each\n * `Sheet` flattens to its properties, grid data is never carried, and nulls\n * clean to undefined.\n */\nexport function projectSpreadsheet(data: sheets_v4.Schema$Spreadsheet): Spreadsheet {\n return {\n spreadsheetId: data.spreadsheetId ?? '',\n spreadsheetUrl: data.spreadsheetUrl ?? undefined,\n properties: data.properties\n ? {\n title: data.properties.title ?? undefined,\n locale: data.properties.locale ?? undefined,\n timeZone: data.properties.timeZone ?? undefined,\n autoRecalc: narrow(\n data.properties.autoRecalc,\n SpreadsheetProperties.shape.autoRecalc.unwrap().options,\n ),\n }\n : undefined,\n sheets: data.sheets\n ? data.sheets.flatMap((sheet) =>\n sheet.properties ? [projectSheetProperties(sheet.properties)] : [],\n )\n : undefined,\n namedRanges: data.namedRanges ? data.namedRanges.map(projectNamedRange) : undefined,\n };\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import type { sheets_v4 } from '@googleapis/sheets';
2
+ import type { z } from 'zod';
3
+ import type { schema } from './schema.js';
4
+ export declare function handler(sheets: sheets_v4.Sheets, args: z.infer<typeof schema.input>): Promise<z.infer<typeof schema.output>>;
5
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/sheets/methods/add_chart/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAG7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,wBAAsB,OAAO,CAC3B,MAAM,EAAE,SAAS,CAAC,MAAM,EACxB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAqBxC"}
@@ -0,0 +1,25 @@
1
+ import { assertOneChartType, toChartSpec, toEmbeddedObjectPosition } from '../../lib/charts.js';
2
+ import { applyRequest } from '../../lib/requests.js';
3
+ export async function handler(sheets, args) {
4
+ assertOneChartType(args.spec);
5
+ if ((args.position.overlayPosition === undefined) === (args.position.newSheet === undefined)) {
6
+ throw new Error('Provide exactly one of position.overlayPosition or position.newSheet: true.');
7
+ }
8
+ const reply = await applyRequest(sheets, args.spreadsheetId, {
9
+ addChart: {
10
+ chart: {
11
+ spec: toChartSpec(args.spec),
12
+ position: toEmbeddedObjectPosition(args.position),
13
+ },
14
+ },
15
+ });
16
+ const chart = reply.addChart?.chart;
17
+ if (chart?.chartId == null) {
18
+ throw new Error('Google accepted the chart but returned no chart ID in the reply.');
19
+ }
20
+ return {
21
+ chartId: chart.chartId,
22
+ sheetId: chart.position?.sheetId ?? undefined,
23
+ };
24
+ }
25
+ //# sourceMappingURL=handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/sheets/methods/add_chart/handler.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,MAAM,CAAC,KAAK,UAAU,OAAO,CAC3B,MAAwB,EACxB,IAAkC;IAElC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9B,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,eAAe,KAAK,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,KAAK,SAAS,CAAC,EAAE,CAAC;QAC7F,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;IACjG,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE;QAC3D,QAAQ,EAAE;YACR,KAAK,EAAE;gBACL,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC5B,QAAQ,EAAE,wBAAwB,CAAC,IAAI,CAAC,QAAQ,CAAC;aAClD;SACF;KACF,CAAC,CAAC;IACH,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC;IACpC,IAAI,KAAK,EAAE,OAAO,IAAI,IAAI,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IACD,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,OAAO,IAAI,SAAS;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["import type { sheets_v4 } from '@googleapis/sheets';\nimport type { z } from 'zod';\nimport { assertOneChartType, toChartSpec, toEmbeddedObjectPosition } from '../../lib/charts.js';\nimport { applyRequest } from '../../lib/requests.js';\nimport type { schema } from './schema.js';\n\nexport async function handler(\n sheets: sheets_v4.Sheets,\n args: z.infer<typeof schema.input>,\n): Promise<z.infer<typeof schema.output>> {\n assertOneChartType(args.spec);\n if ((args.position.overlayPosition === undefined) === (args.position.newSheet === undefined)) {\n throw new Error('Provide exactly one of position.overlayPosition or position.newSheet: true.');\n }\n const reply = await applyRequest(sheets, args.spreadsheetId, {\n addChart: {\n chart: {\n spec: toChartSpec(args.spec),\n position: toEmbeddedObjectPosition(args.position),\n },\n },\n });\n const chart = reply.addChart?.chart;\n if (chart?.chartId == null) {\n throw new Error('Google accepted the chart but returned no chart ID in the reply.');\n }\n return {\n chartId: chart.chartId,\n sheetId: chart.position?.sheetId ?? undefined,\n };\n}\n"]}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * The spec is the curated ChartSpec (basic family and pie); the reply's chart
3
+ * ID feeds update_chart_spec and delete_embedded_object.
4
+ */
5
+ export declare const add_chart: import("../../../lib/operation.js").Operation<import("@googleapis/sheets").sheets_v4.Sheets, import("zod").ZodObject<{
6
+ spreadsheetId: import("zod").ZodString;
7
+ spec: import("zod").ZodObject<{
8
+ title: import("zod").ZodOptional<import("zod").ZodString>;
9
+ subtitle: import("zod").ZodOptional<import("zod").ZodString>;
10
+ basicChart: import("zod").ZodOptional<import("zod").ZodObject<{
11
+ chartType: import("zod").ZodEnum<{
12
+ AREA: "AREA";
13
+ BAR: "BAR";
14
+ COLUMN: "COLUMN";
15
+ COMBO: "COMBO";
16
+ LINE: "LINE";
17
+ SCATTER: "SCATTER";
18
+ STEPPED_AREA: "STEPPED_AREA";
19
+ }>;
20
+ legendPosition: import("zod").ZodOptional<import("zod").ZodEnum<{
21
+ BOTTOM_LEGEND: "BOTTOM_LEGEND";
22
+ LEFT_LEGEND: "LEFT_LEGEND";
23
+ NO_LEGEND: "NO_LEGEND";
24
+ RIGHT_LEGEND: "RIGHT_LEGEND";
25
+ TOP_LEGEND: "TOP_LEGEND";
26
+ }>>;
27
+ axis: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
28
+ position: import("zod").ZodEnum<{
29
+ BOTTOM_AXIS: "BOTTOM_AXIS";
30
+ LEFT_AXIS: "LEFT_AXIS";
31
+ RIGHT_AXIS: "RIGHT_AXIS";
32
+ }>;
33
+ title: import("zod").ZodOptional<import("zod").ZodString>;
34
+ }, import("zod/v4/core").$strict>>>;
35
+ domains: import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodObject<{
36
+ domain: import("zod").ZodObject<{
37
+ sourceRange: import("zod").ZodObject<{
38
+ sources: import("zod").ZodArray<import("zod").ZodObject<{
39
+ sheetId: import("zod").ZodOptional<import("zod").ZodNumber>;
40
+ startRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
41
+ endRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
42
+ startColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
43
+ endColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
44
+ }, import("zod/v4/core").$strict>>;
45
+ }, import("zod/v4/core").$strict>;
46
+ }, import("zod/v4/core").$strict>;
47
+ }, import("zod/v4/core").$strict>>>;
48
+ series: import("zod").ZodArray<import("zod").ZodObject<{
49
+ series: import("zod").ZodObject<{
50
+ sourceRange: import("zod").ZodObject<{
51
+ sources: import("zod").ZodArray<import("zod").ZodObject<{
52
+ sheetId: import("zod").ZodOptional<import("zod").ZodNumber>;
53
+ startRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
54
+ endRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
55
+ startColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
56
+ endColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
57
+ }, import("zod/v4/core").$strict>>;
58
+ }, import("zod/v4/core").$strict>;
59
+ }, import("zod/v4/core").$strict>;
60
+ targetAxis: import("zod").ZodOptional<import("zod").ZodEnum<{
61
+ LEFT_AXIS: "LEFT_AXIS";
62
+ RIGHT_AXIS: "RIGHT_AXIS";
63
+ }>>;
64
+ type: import("zod").ZodOptional<import("zod").ZodEnum<{
65
+ AREA: "AREA";
66
+ COLUMN: "COLUMN";
67
+ LINE: "LINE";
68
+ }>>;
69
+ }, import("zod/v4/core").$strict>>;
70
+ headerCount: import("zod").ZodOptional<import("zod").ZodNumber>;
71
+ }, import("zod/v4/core").$strict>>;
72
+ pieChart: import("zod").ZodOptional<import("zod").ZodObject<{
73
+ legendPosition: import("zod").ZodOptional<import("zod").ZodEnum<{
74
+ BOTTOM_LEGEND: "BOTTOM_LEGEND";
75
+ LABELED_LEGEND: "LABELED_LEGEND";
76
+ LEFT_LEGEND: "LEFT_LEGEND";
77
+ NO_LEGEND: "NO_LEGEND";
78
+ RIGHT_LEGEND: "RIGHT_LEGEND";
79
+ TOP_LEGEND: "TOP_LEGEND";
80
+ }>>;
81
+ domain: import("zod").ZodOptional<import("zod").ZodObject<{
82
+ sourceRange: import("zod").ZodObject<{
83
+ sources: import("zod").ZodArray<import("zod").ZodObject<{
84
+ sheetId: import("zod").ZodOptional<import("zod").ZodNumber>;
85
+ startRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
86
+ endRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
87
+ startColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
88
+ endColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
89
+ }, import("zod/v4/core").$strict>>;
90
+ }, import("zod/v4/core").$strict>;
91
+ }, import("zod/v4/core").$strict>>;
92
+ series: import("zod").ZodOptional<import("zod").ZodObject<{
93
+ sourceRange: import("zod").ZodObject<{
94
+ sources: import("zod").ZodArray<import("zod").ZodObject<{
95
+ sheetId: import("zod").ZodOptional<import("zod").ZodNumber>;
96
+ startRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
97
+ endRowIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
98
+ startColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
99
+ endColumnIndex: import("zod").ZodOptional<import("zod").ZodNumber>;
100
+ }, import("zod/v4/core").$strict>>;
101
+ }, import("zod/v4/core").$strict>;
102
+ }, import("zod/v4/core").$strict>>;
103
+ threeDimensional: import("zod").ZodOptional<import("zod").ZodBoolean>;
104
+ pieHole: import("zod").ZodOptional<import("zod").ZodNumber>;
105
+ }, import("zod/v4/core").$strict>>;
106
+ }, import("zod/v4/core").$strict>;
107
+ position: import("zod").ZodObject<{
108
+ overlayPosition: import("zod").ZodOptional<import("zod").ZodObject<{
109
+ anchorCell: import("zod").ZodObject<{
110
+ sheetId: import("zod").ZodNumber;
111
+ rowIndex: import("zod").ZodNumber;
112
+ columnIndex: import("zod").ZodNumber;
113
+ }, import("zod/v4/core").$strict>;
114
+ offsetXPixels: import("zod").ZodOptional<import("zod").ZodNumber>;
115
+ offsetYPixels: import("zod").ZodOptional<import("zod").ZodNumber>;
116
+ widthPixels: import("zod").ZodOptional<import("zod").ZodNumber>;
117
+ heightPixels: import("zod").ZodOptional<import("zod").ZodNumber>;
118
+ }, import("zod/v4/core").$strict>>;
119
+ newSheet: import("zod").ZodOptional<import("zod").ZodLiteral<true>>;
120
+ }, import("zod/v4/core").$strict>;
121
+ }, import("zod/v4/core").$strict>, import("zod").ZodObject<{
122
+ chartId: import("zod").ZodNumber;
123
+ sheetId: import("zod").ZodOptional<import("zod").ZodNumber>;
124
+ }, import("zod/v4/core").$strip>>;
125
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/sheets/methods/add_chart/index.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAapB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { sheetsOperation } from '../../operation.js';
2
+ import { handler } from './handler.js';
3
+ import { schema } from './schema.js';
4
+ /**
5
+ * The spec is the curated ChartSpec (basic family and pie); the reply's chart
6
+ * ID feeds update_chart_spec and delete_embedded_object.
7
+ */
8
+ export const add_chart = sheetsOperation({
9
+ description: 'Add a chart to a spreadsheet, floating over the grid or on its own sheet; the chart renders in the UI and in xlsx and pdf exports, and the returned ID addresses later spec updates and deletion.',
10
+ annotations: {
11
+ readOnlyHint: false,
12
+ destructiveHint: false,
13
+ idempotentHint: false,
14
+ openWorldHint: false,
15
+ },
16
+ source: 'https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/request#AddChartRequest',
17
+ schema,
18
+ handler,
19
+ });
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/sheets/methods/add_chart/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;IACvC,WAAW,EACT,mMAAmM;IACrM,WAAW,EAAE;QACX,YAAY,EAAE,KAAK;QACnB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;QACrB,aAAa,EAAE,KAAK;KACrB;IACD,MAAM,EACJ,2GAA2G;IAC7G,MAAM;IACN,OAAO;CACR,CAAC,CAAC","sourcesContent":["import { sheetsOperation } from '../../operation.js';\nimport { handler } from './handler.js';\nimport { schema } from './schema.js';\n\n/**\n * The spec is the curated ChartSpec (basic family and pie); the reply's chart\n * ID feeds update_chart_spec and delete_embedded_object.\n */\nexport const add_chart = sheetsOperation({\n description:\n 'Add a chart to a spreadsheet, floating over the grid or on its own sheet; the chart renders in the UI and in xlsx and pdf exports, and the returned ID addresses later spec updates and deletion.',\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: false,\n },\n source:\n 'https://developers.google.com/workspace/sheets/api/reference/rest/v4/spreadsheets/request#AddChartRequest',\n schema,\n handler,\n});\n"]}
@@ -0,0 +1,126 @@
1
+ import { z } from 'zod';
2
+ export declare const schema: {
3
+ input: z.ZodObject<{
4
+ spreadsheetId: z.ZodString;
5
+ spec: z.ZodObject<{
6
+ title: z.ZodOptional<z.ZodString>;
7
+ subtitle: z.ZodOptional<z.ZodString>;
8
+ basicChart: z.ZodOptional<z.ZodObject<{
9
+ chartType: z.ZodEnum<{
10
+ AREA: "AREA";
11
+ BAR: "BAR";
12
+ COLUMN: "COLUMN";
13
+ COMBO: "COMBO";
14
+ LINE: "LINE";
15
+ SCATTER: "SCATTER";
16
+ STEPPED_AREA: "STEPPED_AREA";
17
+ }>;
18
+ legendPosition: z.ZodOptional<z.ZodEnum<{
19
+ BOTTOM_LEGEND: "BOTTOM_LEGEND";
20
+ LEFT_LEGEND: "LEFT_LEGEND";
21
+ NO_LEGEND: "NO_LEGEND";
22
+ RIGHT_LEGEND: "RIGHT_LEGEND";
23
+ TOP_LEGEND: "TOP_LEGEND";
24
+ }>>;
25
+ axis: z.ZodOptional<z.ZodArray<z.ZodObject<{
26
+ position: z.ZodEnum<{
27
+ BOTTOM_AXIS: "BOTTOM_AXIS";
28
+ LEFT_AXIS: "LEFT_AXIS";
29
+ RIGHT_AXIS: "RIGHT_AXIS";
30
+ }>;
31
+ title: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strict>>>;
33
+ domains: z.ZodOptional<z.ZodArray<z.ZodObject<{
34
+ domain: z.ZodObject<{
35
+ sourceRange: z.ZodObject<{
36
+ sources: z.ZodArray<z.ZodObject<{
37
+ sheetId: z.ZodOptional<z.ZodNumber>;
38
+ startRowIndex: z.ZodOptional<z.ZodNumber>;
39
+ endRowIndex: z.ZodOptional<z.ZodNumber>;
40
+ startColumnIndex: z.ZodOptional<z.ZodNumber>;
41
+ endColumnIndex: z.ZodOptional<z.ZodNumber>;
42
+ }, z.core.$strict>>;
43
+ }, z.core.$strict>;
44
+ }, z.core.$strict>;
45
+ }, z.core.$strict>>>;
46
+ series: z.ZodArray<z.ZodObject<{
47
+ series: z.ZodObject<{
48
+ sourceRange: z.ZodObject<{
49
+ sources: z.ZodArray<z.ZodObject<{
50
+ sheetId: z.ZodOptional<z.ZodNumber>;
51
+ startRowIndex: z.ZodOptional<z.ZodNumber>;
52
+ endRowIndex: z.ZodOptional<z.ZodNumber>;
53
+ startColumnIndex: z.ZodOptional<z.ZodNumber>;
54
+ endColumnIndex: z.ZodOptional<z.ZodNumber>;
55
+ }, z.core.$strict>>;
56
+ }, z.core.$strict>;
57
+ }, z.core.$strict>;
58
+ targetAxis: z.ZodOptional<z.ZodEnum<{
59
+ LEFT_AXIS: "LEFT_AXIS";
60
+ RIGHT_AXIS: "RIGHT_AXIS";
61
+ }>>;
62
+ type: z.ZodOptional<z.ZodEnum<{
63
+ AREA: "AREA";
64
+ COLUMN: "COLUMN";
65
+ LINE: "LINE";
66
+ }>>;
67
+ }, z.core.$strict>>;
68
+ headerCount: z.ZodOptional<z.ZodNumber>;
69
+ }, z.core.$strict>>;
70
+ pieChart: z.ZodOptional<z.ZodObject<{
71
+ legendPosition: z.ZodOptional<z.ZodEnum<{
72
+ BOTTOM_LEGEND: "BOTTOM_LEGEND";
73
+ LABELED_LEGEND: "LABELED_LEGEND";
74
+ LEFT_LEGEND: "LEFT_LEGEND";
75
+ NO_LEGEND: "NO_LEGEND";
76
+ RIGHT_LEGEND: "RIGHT_LEGEND";
77
+ TOP_LEGEND: "TOP_LEGEND";
78
+ }>>;
79
+ domain: z.ZodOptional<z.ZodObject<{
80
+ sourceRange: z.ZodObject<{
81
+ sources: z.ZodArray<z.ZodObject<{
82
+ sheetId: z.ZodOptional<z.ZodNumber>;
83
+ startRowIndex: z.ZodOptional<z.ZodNumber>;
84
+ endRowIndex: z.ZodOptional<z.ZodNumber>;
85
+ startColumnIndex: z.ZodOptional<z.ZodNumber>;
86
+ endColumnIndex: z.ZodOptional<z.ZodNumber>;
87
+ }, z.core.$strict>>;
88
+ }, z.core.$strict>;
89
+ }, z.core.$strict>>;
90
+ series: z.ZodOptional<z.ZodObject<{
91
+ sourceRange: z.ZodObject<{
92
+ sources: z.ZodArray<z.ZodObject<{
93
+ sheetId: z.ZodOptional<z.ZodNumber>;
94
+ startRowIndex: z.ZodOptional<z.ZodNumber>;
95
+ endRowIndex: z.ZodOptional<z.ZodNumber>;
96
+ startColumnIndex: z.ZodOptional<z.ZodNumber>;
97
+ endColumnIndex: z.ZodOptional<z.ZodNumber>;
98
+ }, z.core.$strict>>;
99
+ }, z.core.$strict>;
100
+ }, z.core.$strict>>;
101
+ threeDimensional: z.ZodOptional<z.ZodBoolean>;
102
+ pieHole: z.ZodOptional<z.ZodNumber>;
103
+ }, z.core.$strict>>;
104
+ }, z.core.$strict>;
105
+ position: z.ZodObject<{
106
+ overlayPosition: z.ZodOptional<z.ZodObject<{
107
+ anchorCell: z.ZodObject<{
108
+ sheetId: z.ZodNumber;
109
+ rowIndex: z.ZodNumber;
110
+ columnIndex: z.ZodNumber;
111
+ }, z.core.$strict>;
112
+ offsetXPixels: z.ZodOptional<z.ZodNumber>;
113
+ offsetYPixels: z.ZodOptional<z.ZodNumber>;
114
+ widthPixels: z.ZodOptional<z.ZodNumber>;
115
+ heightPixels: z.ZodOptional<z.ZodNumber>;
116
+ }, z.core.$strict>>;
117
+ newSheet: z.ZodOptional<z.ZodLiteral<true>>;
118
+ }, z.core.$strict>;
119
+ }, z.core.$strict>;
120
+ /** The chart renders in the UI and in xlsx and pdf exports; the reply's chart is projected to its ids. */
121
+ output: z.ZodObject<{
122
+ chartId: z.ZodNumber;
123
+ sheetId: z.ZodOptional<z.ZodNumber>;
124
+ }, z.core.$strip>;
125
+ };
126
+ //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/sheets/methods/add_chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,MAAM;IACjB,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IASL,0GAA0G;IAC1G,MAAM;;;;CAWP,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { z } from 'zod';
2
+ import { ChartSpec } from '../../entities/ChartSpec.js';
3
+ import { EmbeddedObjectPosition } from '../../entities/EmbeddedObjectPosition.js';
4
+ export const schema = {
5
+ input: z.strictObject({
6
+ spreadsheetId: z.string().describe('The ID of the spreadsheet to add the chart to.'),
7
+ spec: ChartSpec.describe('What the chart shows; provide exactly one of basicChart or pieChart.'),
8
+ position: EmbeddedObjectPosition.describe('Where the chart lives: an overlayPosition floating over the grid, or newSheet: true for its own sheet.'),
9
+ }),
10
+ /** The chart renders in the UI and in xlsx and pdf exports; the reply's chart is projected to its ids. */
11
+ output: z.object({
12
+ chartId: z
13
+ .number()
14
+ .int()
15
+ .describe('The ID of the new chart, used by update_chart_spec and delete_embedded_object.'),
16
+ sheetId: z
17
+ .number()
18
+ .int()
19
+ .optional()
20
+ .describe('The sheet the chart was placed on, when positioned on its own new sheet.'),
21
+ }),
22
+ };
23
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/sheets/methods/add_chart/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAElF,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,CAAC,CAAC,YAAY,CAAC;QACpB,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,gDAAgD,CAAC;QACpF,IAAI,EAAE,SAAS,CAAC,QAAQ,CACtB,sEAAsE,CACvE;QACD,QAAQ,EAAE,sBAAsB,CAAC,QAAQ,CACvC,wGAAwG,CACzG;KACF,CAAC;IACF,0GAA0G;IAC1G,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,CAAC,gFAAgF,CAAC;QAC7F,OAAO,EAAE,CAAC;aACP,MAAM,EAAE;aACR,GAAG,EAAE;aACL,QAAQ,EAAE;aACV,QAAQ,CAAC,0EAA0E,CAAC;KACxF,CAAC;CACH,CAAC","sourcesContent":["import { z } from 'zod';\nimport { ChartSpec } from '../../entities/ChartSpec.js';\nimport { EmbeddedObjectPosition } from '../../entities/EmbeddedObjectPosition.js';\n\nexport const schema = {\n input: z.strictObject({\n spreadsheetId: z.string().describe('The ID of the spreadsheet to add the chart to.'),\n spec: ChartSpec.describe(\n 'What the chart shows; provide exactly one of basicChart or pieChart.',\n ),\n position: EmbeddedObjectPosition.describe(\n 'Where the chart lives: an overlayPosition floating over the grid, or newSheet: true for its own sheet.',\n ),\n }),\n /** The chart renders in the UI and in xlsx and pdf exports; the reply's chart is projected to its ids. */\n output: z.object({\n chartId: z\n .number()\n .int()\n .describe('The ID of the new chart, used by update_chart_spec and delete_embedded_object.'),\n sheetId: z\n .number()\n .int()\n .optional()\n .describe('The sheet the chart was placed on, when positioned on its own new sheet.'),\n }),\n};\n"]}
@@ -0,0 +1,5 @@
1
+ import type { sheets_v4 } from '@googleapis/sheets';
2
+ import type { z } from 'zod';
3
+ import type { schema } from './schema.js';
4
+ export declare function handler(sheets: sheets_v4.Sheets, args: z.infer<typeof schema.input>): Promise<z.infer<typeof schema.output>>;
5
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../../src/sheets/methods/add_named_range/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAI7B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,wBAAsB,OAAO,CAC3B,MAAM,EAAE,SAAS,CAAC,MAAM,EACxB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,GACjC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAOxC"}