@commandable/integration-data 0.0.1

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 (335) hide show
  1. package/dist/credentials-index.d.ts +30 -0
  2. package/dist/credentials-index.d.ts.map +1 -0
  3. package/dist/credentials-index.js +292 -0
  4. package/dist/credentials-index.js.map +1 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +2 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/loader.d.ts +69 -0
  10. package/dist/loader.d.ts.map +1 -0
  11. package/dist/loader.js +164 -0
  12. package/dist/loader.js.map +1 -0
  13. package/integrations/README.md +52 -0
  14. package/integrations/airtable/__tests__/get_handlers.test.ts +137 -0
  15. package/integrations/airtable/__tests__/usage_parity.test.ts +35 -0
  16. package/integrations/airtable/__tests__/write_and_admin_handlers.test.ts +113 -0
  17. package/integrations/airtable/credentials.json +20 -0
  18. package/integrations/airtable/credentials_hint.md +4 -0
  19. package/integrations/airtable/handlers/create_record.js +12 -0
  20. package/integrations/airtable/handlers/delete_record.js +7 -0
  21. package/integrations/airtable/handlers/get_record.js +4 -0
  22. package/integrations/airtable/handlers/get_table_schema.js +6 -0
  23. package/integrations/airtable/handlers/list_bases.js +4 -0
  24. package/integrations/airtable/handlers/list_records.js +25 -0
  25. package/integrations/airtable/handlers/list_table_fields.js +6 -0
  26. package/integrations/airtable/handlers/list_tables.js +4 -0
  27. package/integrations/airtable/handlers/list_views.js +6 -0
  28. package/integrations/airtable/handlers/search_records.js +6 -0
  29. package/integrations/airtable/handlers/update_record.js +11 -0
  30. package/integrations/airtable/manifest.json +83 -0
  31. package/integrations/airtable/schemas/create_record.json +12 -0
  32. package/integrations/airtable/schemas/delete_record.json +11 -0
  33. package/integrations/airtable/schemas/empty.json +6 -0
  34. package/integrations/airtable/schemas/get_record.json +11 -0
  35. package/integrations/airtable/schemas/id_base.json +9 -0
  36. package/integrations/airtable/schemas/id_base_table.json +10 -0
  37. package/integrations/airtable/schemas/list_records.json +26 -0
  38. package/integrations/airtable/schemas/search_records.json +12 -0
  39. package/integrations/airtable/schemas/update_record.json +13 -0
  40. package/integrations/github/__tests__/get_handlers.test.ts +117 -0
  41. package/integrations/github/__tests__/usage_parity.test.ts +34 -0
  42. package/integrations/github/__tests__/write_handlers.test.ts +311 -0
  43. package/integrations/github/credentials.json +20 -0
  44. package/integrations/github/credentials_hint.md +7 -0
  45. package/integrations/github/handlers/add_labels_to_issue.js +12 -0
  46. package/integrations/github/handlers/close_issue.js +5 -0
  47. package/integrations/github/handlers/comment_on_issue.js +5 -0
  48. package/integrations/github/handlers/create_branch.js +33 -0
  49. package/integrations/github/handlers/create_commit.js +91 -0
  50. package/integrations/github/handlers/create_issue.js +10 -0
  51. package/integrations/github/handlers/create_or_update_file.js +21 -0
  52. package/integrations/github/handlers/create_pull_request.js +16 -0
  53. package/integrations/github/handlers/create_repo.js +11 -0
  54. package/integrations/github/handlers/delete_repo.js +6 -0
  55. package/integrations/github/handlers/get_issue.js +4 -0
  56. package/integrations/github/handlers/get_repo.js +4 -0
  57. package/integrations/github/handlers/list_branches.js +4 -0
  58. package/integrations/github/handlers/list_commits.js +12 -0
  59. package/integrations/github/handlers/list_issues.js +12 -0
  60. package/integrations/github/handlers/list_pull_requests.js +8 -0
  61. package/integrations/github/handlers/list_repos_install.js +4 -0
  62. package/integrations/github/handlers/list_repos_user.js +4 -0
  63. package/integrations/github/handlers/merge_pull_request.js +14 -0
  64. package/integrations/github/handlers/update_issue.js +15 -0
  65. package/integrations/github/manifest.json +26 -0
  66. package/integrations/github/schemas/add_labels_to_issue.json +12 -0
  67. package/integrations/github/schemas/close_issue.json +10 -0
  68. package/integrations/github/schemas/comment_on_issue.json +11 -0
  69. package/integrations/github/schemas/create_branch.json +12 -0
  70. package/integrations/github/schemas/create_commit.json +25 -0
  71. package/integrations/github/schemas/create_issue.json +13 -0
  72. package/integrations/github/schemas/create_or_update_file.json +15 -0
  73. package/integrations/github/schemas/create_pull_request.json +15 -0
  74. package/integrations/github/schemas/create_repo.json +12 -0
  75. package/integrations/github/schemas/delete_repo.json +10 -0
  76. package/integrations/github/schemas/empty.json +5 -0
  77. package/integrations/github/schemas/get_issue.json +10 -0
  78. package/integrations/github/schemas/get_repo.json +9 -0
  79. package/integrations/github/schemas/list_commits.json +12 -0
  80. package/integrations/github/schemas/list_issues.json +12 -0
  81. package/integrations/github/schemas/list_pull_requests.json +10 -0
  82. package/integrations/github/schemas/merge_pull_request.json +14 -0
  83. package/integrations/github/schemas/owner_repo.json +9 -0
  84. package/integrations/github/schemas/update_issue.json +15 -0
  85. package/integrations/google-calendar/__tests__/get_handlers.test.ts +112 -0
  86. package/integrations/google-calendar/__tests__/usage_parity.test.ts +34 -0
  87. package/integrations/google-calendar/__tests__/write_and_admin_handlers.test.ts +161 -0
  88. package/integrations/google-calendar/credentials.json +36 -0
  89. package/integrations/google-calendar/credentials_hint.md +9 -0
  90. package/integrations/google-calendar/handlers/create_event.js +6 -0
  91. package/integrations/google-calendar/handlers/delete_acl.js +6 -0
  92. package/integrations/google-calendar/handlers/delete_event.js +7 -0
  93. package/integrations/google-calendar/handlers/freebusy_query.js +4 -0
  94. package/integrations/google-calendar/handlers/get_acl.js +5 -0
  95. package/integrations/google-calendar/handlers/get_calendar.js +4 -0
  96. package/integrations/google-calendar/handlers/get_event.js +5 -0
  97. package/integrations/google-calendar/handlers/insert_acl.js +6 -0
  98. package/integrations/google-calendar/handlers/list_acl.js +5 -0
  99. package/integrations/google-calendar/handlers/list_calendars.js +4 -0
  100. package/integrations/google-calendar/handlers/list_colors.js +4 -0
  101. package/integrations/google-calendar/handlers/list_events.js +21 -0
  102. package/integrations/google-calendar/handlers/list_settings.js +4 -0
  103. package/integrations/google-calendar/handlers/move_event.js +6 -0
  104. package/integrations/google-calendar/handlers/patch_event.js +5 -0
  105. package/integrations/google-calendar/handlers/quick_add.js +6 -0
  106. package/integrations/google-calendar/handlers/update_acl.js +7 -0
  107. package/integrations/google-calendar/handlers/update_event.js +5 -0
  108. package/integrations/google-calendar/manifest.json +26 -0
  109. package/integrations/google-calendar/schemas/create_event.json +34 -0
  110. package/integrations/google-calendar/schemas/delete_acl.json +9 -0
  111. package/integrations/google-calendar/schemas/empty.json +1 -0
  112. package/integrations/google-calendar/schemas/freebusy_query.json +13 -0
  113. package/integrations/google-calendar/schemas/get_acl.json +9 -0
  114. package/integrations/google-calendar/schemas/id_calendar.json +8 -0
  115. package/integrations/google-calendar/schemas/id_calendar_event.json +9 -0
  116. package/integrations/google-calendar/schemas/insert_acl.json +18 -0
  117. package/integrations/google-calendar/schemas/list_events.json +15 -0
  118. package/integrations/google-calendar/schemas/move_event.json +10 -0
  119. package/integrations/google-calendar/schemas/patch_event.json +10 -0
  120. package/integrations/google-calendar/schemas/quick_add.json +9 -0
  121. package/integrations/google-calendar/schemas/update_acl.json +10 -0
  122. package/integrations/google-calendar/schemas/update_event.json +10 -0
  123. package/integrations/google-docs/__tests__/get_handlers.test.ts +72 -0
  124. package/integrations/google-docs/__tests__/usage_parity.test.ts +34 -0
  125. package/integrations/google-docs/__tests__/write_handlers.test.ts +249 -0
  126. package/integrations/google-docs/credentials.json +36 -0
  127. package/integrations/google-docs/credentials_hint.md +9 -0
  128. package/integrations/google-docs/handlers/append_text.js +12 -0
  129. package/integrations/google-docs/handlers/batch_update.js +13 -0
  130. package/integrations/google-docs/handlers/create_document.js +9 -0
  131. package/integrations/google-docs/handlers/delete_first_match.js +50 -0
  132. package/integrations/google-docs/handlers/get_document.js +12 -0
  133. package/integrations/google-docs/handlers/get_document_structured.js +6 -0
  134. package/integrations/google-docs/handlers/get_document_text.js +17 -0
  135. package/integrations/google-docs/handlers/insert_inline_image_after_first_match.js +41 -0
  136. package/integrations/google-docs/handlers/insert_page_break_after_first_match.js +49 -0
  137. package/integrations/google-docs/handlers/insert_table_after_first_match.js +49 -0
  138. package/integrations/google-docs/handlers/insert_text_after_first_match.js +51 -0
  139. package/integrations/google-docs/handlers/replace_all_text.js +8 -0
  140. package/integrations/google-docs/handlers/style_first_match.js +42 -0
  141. package/integrations/google-docs/handlers/update_document_style.js +8 -0
  142. package/integrations/google-docs/handlers/update_paragraph_style_for_first_match.js +48 -0
  143. package/integrations/google-docs/manifest.json +58 -0
  144. package/integrations/google-docs/schemas/append_text.json +10 -0
  145. package/integrations/google-docs/schemas/apply_text_style.json +13 -0
  146. package/integrations/google-docs/schemas/batch_update.json +16 -0
  147. package/integrations/google-docs/schemas/create_document.json +8 -0
  148. package/integrations/google-docs/schemas/delete_content_range.json +11 -0
  149. package/integrations/google-docs/schemas/delete_first_match.json +10 -0
  150. package/integrations/google-docs/schemas/get_document.json +11 -0
  151. package/integrations/google-docs/schemas/get_document_structured.json +9 -0
  152. package/integrations/google-docs/schemas/get_document_text.json +9 -0
  153. package/integrations/google-docs/schemas/insert_inline_image.json +12 -0
  154. package/integrations/google-docs/schemas/insert_inline_image_after_first_match.json +13 -0
  155. package/integrations/google-docs/schemas/insert_page_break.json +10 -0
  156. package/integrations/google-docs/schemas/insert_page_break_after_first_match.json +11 -0
  157. package/integrations/google-docs/schemas/insert_table.json +12 -0
  158. package/integrations/google-docs/schemas/insert_table_after_first_match.json +13 -0
  159. package/integrations/google-docs/schemas/insert_text_after_first_match.json +12 -0
  160. package/integrations/google-docs/schemas/insert_text_at.json +11 -0
  161. package/integrations/google-docs/schemas/replace_all_text.json +12 -0
  162. package/integrations/google-docs/schemas/style_first_match.json +12 -0
  163. package/integrations/google-docs/schemas/update_document_style.json +11 -0
  164. package/integrations/google-docs/schemas/update_paragraph_style.json +13 -0
  165. package/integrations/google-docs/schemas/update_paragraph_style_for_first_match.json +12 -0
  166. package/integrations/google-sheet/__tests__/get_handlers.test.ts +129 -0
  167. package/integrations/google-sheet/__tests__/usage_parity.test.ts +35 -0
  168. package/integrations/google-sheet/__tests__/write_handlers.test.ts +171 -0
  169. package/integrations/google-sheet/credentials.json +36 -0
  170. package/integrations/google-sheet/credentials_hint.md +9 -0
  171. package/integrations/google-sheet/handlers/append_values.js +18 -0
  172. package/integrations/google-sheet/handlers/batch_clear_values.js +6 -0
  173. package/integrations/google-sheet/handlers/batch_clear_values_by_data_filter.js +6 -0
  174. package/integrations/google-sheet/handlers/batch_get_values.js +16 -0
  175. package/integrations/google-sheet/handlers/batch_update.js +14 -0
  176. package/integrations/google-sheet/handlers/batch_update_values.js +16 -0
  177. package/integrations/google-sheet/handlers/batch_update_values_by_data_filter.js +16 -0
  178. package/integrations/google-sheet/handlers/clear_values.js +6 -0
  179. package/integrations/google-sheet/handlers/copy_to_spreadsheet.js +6 -0
  180. package/integrations/google-sheet/handlers/create_spreadsheet.js +5 -0
  181. package/integrations/google-sheet/handlers/get_developer_metadata.js +6 -0
  182. package/integrations/google-sheet/handlers/get_spreadsheet.js +12 -0
  183. package/integrations/google-sheet/handlers/get_spreadsheet_by_data_filter.js +10 -0
  184. package/integrations/google-sheet/handlers/get_values.js +14 -0
  185. package/integrations/google-sheet/handlers/get_values_by_data_filter.js +14 -0
  186. package/integrations/google-sheet/handlers/search_developer_metadata.js +7 -0
  187. package/integrations/google-sheet/handlers/update_values.js +16 -0
  188. package/integrations/google-sheet/manifest.json +125 -0
  189. package/integrations/google-sheet/schemas/append_values.json +16 -0
  190. package/integrations/google-sheet/schemas/batch_clear_values.json +10 -0
  191. package/integrations/google-sheet/schemas/batch_clear_values_by_data_filter.json +10 -0
  192. package/integrations/google-sheet/schemas/batch_get_values.json +13 -0
  193. package/integrations/google-sheet/schemas/batch_update.json +13 -0
  194. package/integrations/google-sheet/schemas/batch_update_values.json +25 -0
  195. package/integrations/google-sheet/schemas/batch_update_values_by_data_filter.json +25 -0
  196. package/integrations/google-sheet/schemas/clear_values.json +10 -0
  197. package/integrations/google-sheet/schemas/copy_to_spreadsheet.json +11 -0
  198. package/integrations/google-sheet/schemas/create_spreadsheet.json +11 -0
  199. package/integrations/google-sheet/schemas/get_developer_metadata.json +10 -0
  200. package/integrations/google-sheet/schemas/get_spreadsheet.json +15 -0
  201. package/integrations/google-sheet/schemas/get_spreadsheet_by_data_filter.json +11 -0
  202. package/integrations/google-sheet/schemas/get_values.json +13 -0
  203. package/integrations/google-sheet/schemas/get_values_by_data_filter.json +17 -0
  204. package/integrations/google-sheet/schemas/search_developer_metadata.json +14 -0
  205. package/integrations/google-sheet/schemas/update_values.json +15 -0
  206. package/integrations/google-slides/__tests__/get_handlers.test.ts +69 -0
  207. package/integrations/google-slides/__tests__/usage_parity.test.ts +34 -0
  208. package/integrations/google-slides/__tests__/write_handlers.test.ts +125 -0
  209. package/integrations/google-slides/credentials.json +36 -0
  210. package/integrations/google-slides/credentials_hint.md +9 -0
  211. package/integrations/google-slides/handlers/append_text_to_title_of_first_slide.js +17 -0
  212. package/integrations/google-slides/handlers/batch_update.js +15 -0
  213. package/integrations/google-slides/handlers/create_presentation.js +8 -0
  214. package/integrations/google-slides/handlers/create_slide_after_first_match.js +20 -0
  215. package/integrations/google-slides/handlers/get_page_thumbnail.js +12 -0
  216. package/integrations/google-slides/handlers/get_presentation.js +6 -0
  217. package/integrations/google-slides/handlers/insert_image_after_first_match.js +19 -0
  218. package/integrations/google-slides/handlers/insert_shape_after_first_match.js +21 -0
  219. package/integrations/google-slides/handlers/replace_text_first_match.js +9 -0
  220. package/integrations/google-slides/handlers/set_background_color_for_slide_index.js +15 -0
  221. package/integrations/google-slides/handlers/style_text_first_match.js +48 -0
  222. package/integrations/google-slides/manifest.json +41 -0
  223. package/integrations/google-slides/schemas/append_text_to_title_of_first_slide.json +11 -0
  224. package/integrations/google-slides/schemas/batch_update.json +13 -0
  225. package/integrations/google-slides/schemas/create_presentation.json +8 -0
  226. package/integrations/google-slides/schemas/create_slide_after_first_match.json +11 -0
  227. package/integrations/google-slides/schemas/get_page_thumbnail.json +12 -0
  228. package/integrations/google-slides/schemas/get_presentation.json +9 -0
  229. package/integrations/google-slides/schemas/insert_image_after_first_match.json +13 -0
  230. package/integrations/google-slides/schemas/insert_shape_after_first_match.json +13 -0
  231. package/integrations/google-slides/schemas/replace_text_first_match.json +12 -0
  232. package/integrations/google-slides/schemas/set_background_color_for_slide_index.json +11 -0
  233. package/integrations/google-slides/schemas/style_text_first_match.json +12 -0
  234. package/integrations/new_integration_prompt.md +41 -0
  235. package/integrations/notion/__tests__/get_handlers.test.ts +153 -0
  236. package/integrations/notion/__tests__/usage_parity.test.ts +34 -0
  237. package/integrations/notion/__tests__/write_and_admin_handlers.test.ts +190 -0
  238. package/integrations/notion/credentials.json +21 -0
  239. package/integrations/notion/credentials_hint.md +5 -0
  240. package/integrations/notion/handlers/append_block_children.js +7 -0
  241. package/integrations/notion/handlers/create_comment.js +10 -0
  242. package/integrations/notion/handlers/create_database.js +11 -0
  243. package/integrations/notion/handlers/create_page.js +13 -0
  244. package/integrations/notion/handlers/delete_block.js +8 -0
  245. package/integrations/notion/handlers/get_me.js +4 -0
  246. package/integrations/notion/handlers/list_block_children.js +10 -0
  247. package/integrations/notion/handlers/list_comments.js +14 -0
  248. package/integrations/notion/handlers/list_users.js +10 -0
  249. package/integrations/notion/handlers/query_database.js +10 -0
  250. package/integrations/notion/handlers/retrieve_block.js +4 -0
  251. package/integrations/notion/handlers/retrieve_database.js +4 -0
  252. package/integrations/notion/handlers/retrieve_page.js +4 -0
  253. package/integrations/notion/handlers/retrieve_page_property_item.js +10 -0
  254. package/integrations/notion/handlers/retrieve_user.js +4 -0
  255. package/integrations/notion/handlers/search.js +11 -0
  256. package/integrations/notion/handlers/update_block.js +7 -0
  257. package/integrations/notion/handlers/update_database.js +10 -0
  258. package/integrations/notion/handlers/update_page_properties.js +10 -0
  259. package/integrations/notion/manifest.json +139 -0
  260. package/integrations/notion/prompt.md +26 -0
  261. package/integrations/notion/schemas/append_block_children.json +10 -0
  262. package/integrations/notion/schemas/create_comment.json +18 -0
  263. package/integrations/notion/schemas/create_database.json +18 -0
  264. package/integrations/notion/schemas/create_page.json +22 -0
  265. package/integrations/notion/schemas/delete_block.json +9 -0
  266. package/integrations/notion/schemas/empty.json +6 -0
  267. package/integrations/notion/schemas/id_block.json +9 -0
  268. package/integrations/notion/schemas/id_database.json +9 -0
  269. package/integrations/notion/schemas/id_page.json +9 -0
  270. package/integrations/notion/schemas/id_user.json +9 -0
  271. package/integrations/notion/schemas/list_block_children.json +11 -0
  272. package/integrations/notion/schemas/list_comments.json +15 -0
  273. package/integrations/notion/schemas/list_users.json +9 -0
  274. package/integrations/notion/schemas/query_database.json +13 -0
  275. package/integrations/notion/schemas/retrieve_page_property_item.json +12 -0
  276. package/integrations/notion/schemas/search.json +27 -0
  277. package/integrations/notion/schemas/update_block.json +10 -0
  278. package/integrations/notion/schemas/update_database.json +13 -0
  279. package/integrations/notion/schemas/update_page_properties.json +13 -0
  280. package/integrations/trello/__tests__/get_handlers.test.ts +240 -0
  281. package/integrations/trello/__tests__/usage_parity.test.ts +34 -0
  282. package/integrations/trello/__tests__/write_and_admin_handlers.test.ts +189 -0
  283. package/integrations/trello/credentials.json +26 -0
  284. package/integrations/trello/credentials_hint.md +4 -0
  285. package/integrations/trello/handlers/add_checklist_to_card.js +5 -0
  286. package/integrations/trello/handlers/add_member_to_card.js +5 -0
  287. package/integrations/trello/handlers/archive_list.js +5 -0
  288. package/integrations/trello/handlers/create_card.js +13 -0
  289. package/integrations/trello/handlers/create_list.js +7 -0
  290. package/integrations/trello/handlers/delete_card.js +9 -0
  291. package/integrations/trello/handlers/get_board.js +4 -0
  292. package/integrations/trello/handlers/get_board_cards.js +4 -0
  293. package/integrations/trello/handlers/get_board_custom_fields.js +4 -0
  294. package/integrations/trello/handlers/get_board_labels.js +4 -0
  295. package/integrations/trello/handlers/get_board_lists.js +4 -0
  296. package/integrations/trello/handlers/get_board_members.js +4 -0
  297. package/integrations/trello/handlers/get_board_memberships.js +4 -0
  298. package/integrations/trello/handlers/get_card.js +4 -0
  299. package/integrations/trello/handlers/get_card_actions.js +4 -0
  300. package/integrations/trello/handlers/get_card_attachments.js +4 -0
  301. package/integrations/trello/handlers/get_card_checklists.js +4 -0
  302. package/integrations/trello/handlers/get_card_custom_field_items.js +4 -0
  303. package/integrations/trello/handlers/get_card_members.js +4 -0
  304. package/integrations/trello/handlers/get_list.js +4 -0
  305. package/integrations/trello/handlers/get_list_cards.js +4 -0
  306. package/integrations/trello/handlers/get_member.js +4 -0
  307. package/integrations/trello/handlers/get_member_boards.js +4 -0
  308. package/integrations/trello/handlers/get_member_organizations.js +4 -0
  309. package/integrations/trello/handlers/get_organization.js +4 -0
  310. package/integrations/trello/handlers/get_organization_boards.js +4 -0
  311. package/integrations/trello/handlers/move_card_to_list.js +5 -0
  312. package/integrations/trello/handlers/remove_member_from_card.js +9 -0
  313. package/integrations/trello/handlers/search.js +5 -0
  314. package/integrations/trello/handlers/update_card.js +19 -0
  315. package/integrations/trello/handlers/update_list.js +11 -0
  316. package/integrations/trello/manifest.json +231 -0
  317. package/integrations/trello/schemas/add_checklist_to_card.json +10 -0
  318. package/integrations/trello/schemas/add_member_to_card.json +10 -0
  319. package/integrations/trello/schemas/archive_list.json +9 -0
  320. package/integrations/trello/schemas/create_card.json +13 -0
  321. package/integrations/trello/schemas/create_list.json +11 -0
  322. package/integrations/trello/schemas/delete_card.json +9 -0
  323. package/integrations/trello/schemas/display_trello_cards.json +45 -0
  324. package/integrations/trello/schemas/empty.json +5 -0
  325. package/integrations/trello/schemas/get_member.json +5 -0
  326. package/integrations/trello/schemas/id_board.json +8 -0
  327. package/integrations/trello/schemas/id_card.json +8 -0
  328. package/integrations/trello/schemas/id_list.json +8 -0
  329. package/integrations/trello/schemas/id_org.json +8 -0
  330. package/integrations/trello/schemas/move_card_to_list.json +10 -0
  331. package/integrations/trello/schemas/remove_member_from_card.json +10 -0
  332. package/integrations/trello/schemas/search.json +8 -0
  333. package/integrations/trello/schemas/update_card.json +16 -0
  334. package/integrations/trello/schemas/update_list.json +12 -0
  335. package/package.json +45 -0
@@ -0,0 +1,129 @@
1
+ import { beforeAll, describe, expect, it } from 'vitest'
2
+ import { IntegrationProxy } from '../../../src/integrations/proxy.js'
3
+ import { loadIntegrationTools } from '../../../src/integrations/dataLoader.js'
4
+
5
+ // LIVE Google Sheets read tests using managed OAuth
6
+ // Required env vars:
7
+ // - COMMANDABLE_MANAGED_OAUTH_BASE_URL
8
+ // - COMMANDABLE_MANAGED_OAUTH_SECRET_KEY
9
+ // - GSHEETS_TEST_CONNECTION_ID (managed OAuth connection for provider 'google-sheet')
10
+ // - GSHEETS_TEST_SPREADSHEET_ID (an accessible spreadsheet ID)
11
+
12
+ const env = process.env as Record<string, string>
13
+ const hasEnv = (...keys: string[]) => keys.every(k => !!env[k] && env[k].trim().length > 0)
14
+ const suite = hasEnv(
15
+ 'COMMANDABLE_MANAGED_OAUTH_BASE_URL',
16
+ 'COMMANDABLE_MANAGED_OAUTH_SECRET_KEY',
17
+ 'GSHEETS_TEST_CONNECTION_ID',
18
+ )
19
+ ? describe
20
+ : describe.skip
21
+
22
+ suite('google-sheet read handlers (live)', () => {
23
+ let buildReadHandler: (name: string) => ((input: any) => Promise<any>)
24
+ let sheetTitle: string | undefined
25
+
26
+ beforeAll(async () => {
27
+ const { COMMANDABLE_MANAGED_OAUTH_BASE_URL, COMMANDABLE_MANAGED_OAUTH_SECRET_KEY, GSHEETS_TEST_CONNECTION_ID } = env
28
+
29
+ const proxy = new IntegrationProxy({
30
+ managedOAuthBaseUrl: COMMANDABLE_MANAGED_OAUTH_BASE_URL,
31
+ managedOAuthSecretKey: COMMANDABLE_MANAGED_OAUTH_SECRET_KEY,
32
+ })
33
+ const integrationNode = { id: 'node-gsheets', type: 'google-sheet', label: 'Google Sheets', connectionId: GSHEETS_TEST_CONNECTION_ID } as any
34
+
35
+ const tools = loadIntegrationTools('google-sheet')
36
+ expect(tools).toBeTruthy()
37
+
38
+ buildReadHandler = (name: string) => {
39
+ const tool = tools!.read.find(t => t.name === name)
40
+ expect(tool, `read tool ${name} exists`).toBeTruthy()
41
+ const integration = { fetch: (path: string, init?: RequestInit) => proxy.call(integrationNode, path, init) }
42
+ const build = new Function('integration', `return (${tool!.handlerCode});`)
43
+ return build(integration) as (input: any) => Promise<any>
44
+ }
45
+
46
+ // Try to detect a default sheet title
47
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
48
+ if (spreadsheetId) {
49
+ try {
50
+ const get_spreadsheet = buildReadHandler('get_spreadsheet')
51
+ const meta = await get_spreadsheet({ spreadsheetId })
52
+ sheetTitle = meta?.sheets?.[0]?.properties?.title
53
+ }
54
+ catch {}
55
+ }
56
+ }, 60000)
57
+
58
+ it('get_spreadsheet returns metadata', async () => {
59
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
60
+ if (!spreadsheetId)
61
+ return expect(true).toBe(true)
62
+ const handler = buildReadHandler('get_spreadsheet')
63
+ const result = await handler({ spreadsheetId })
64
+ expect(result?.spreadsheetId || result?.sheets).toBeTruthy()
65
+ }, 30000)
66
+
67
+ it('get_values returns a value range', async () => {
68
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
69
+ if (!spreadsheetId)
70
+ return expect(true).toBe(true)
71
+ const handler = buildReadHandler('get_values')
72
+ const range = sheetTitle ? `${sheetTitle}!A1:B5` : 'A1:B5'
73
+ const result = await handler({ spreadsheetId, range })
74
+ expect(result?.range || result?.values).toBeTruthy()
75
+ }, 30000)
76
+
77
+ it('batch_get_values returns multiple ranges', async () => {
78
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
79
+ if (!spreadsheetId)
80
+ return expect(true).toBe(true)
81
+ const handler = buildReadHandler('batch_get_values')
82
+ const aTitle = sheetTitle || 'Sheet1'
83
+ const result = await handler({ spreadsheetId, ranges: [`${aTitle}!A1:A3`, `${aTitle}!B1:B3`] })
84
+ expect(Array.isArray(result?.valueRanges)).toBe(true)
85
+ }, 30000)
86
+
87
+ it('get_spreadsheet_by_data_filter returns metadata', async () => {
88
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
89
+ if (!spreadsheetId)
90
+ return expect(true).toBe(true)
91
+ const handler = buildReadHandler('get_spreadsheet_by_data_filter')
92
+ const aTitle = sheetTitle || 'Sheet1'
93
+ const result = await handler({ spreadsheetId, dataFilters: [{ a1Range: `${aTitle}!A1:A1` }] })
94
+ expect(result?.spreadsheetId || result?.sheets).toBeTruthy()
95
+ }, 30000)
96
+
97
+ it('get_values_by_data_filter returns values', async () => {
98
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
99
+ if (!spreadsheetId)
100
+ return expect(true).toBe(true)
101
+ const handler = buildReadHandler('get_values_by_data_filter')
102
+ const aTitle = sheetTitle || 'Sheet1'
103
+ const result = await handler({ spreadsheetId, dataFilters: [{ a1Range: `${aTitle}!A1:B2` }] })
104
+ expect(Array.isArray(result?.valueRanges)).toBe(true)
105
+ }, 30000)
106
+
107
+ it('search_developer_metadata returns results or empty', async () => {
108
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
109
+ if (!spreadsheetId)
110
+ return expect(true).toBe(true)
111
+ const handler = buildReadHandler('search_developer_metadata')
112
+ const result = await handler({ spreadsheetId, dataFilters: [{ developerMetadataLookup: { visibility: 'DOCUMENT' } }] })
113
+ expect(result !== undefined).toBe(true)
114
+ }, 30000)
115
+
116
+ it('get_developer_metadata retrieves by id when available', async () => {
117
+ const spreadsheetId = env.GSHEETS_TEST_SPREADSHEET_ID
118
+ if (!spreadsheetId)
119
+ return expect(true).toBe(true)
120
+ const search = buildReadHandler('search_developer_metadata')
121
+ const list = await search({ spreadsheetId, dataFilters: [{ developerMetadataLookup: { visibility: 'DOCUMENT' } }] })
122
+ const first = list?.matchedDeveloperMetadata?.[0]?.developerMetadata || list?.developerMetadata?.[0]
123
+ if (!first?.metadataId)
124
+ return expect(true).toBe(true)
125
+ const getdm = buildReadHandler('get_developer_metadata')
126
+ const got = await getdm({ spreadsheetId, metadataId: first.metadataId })
127
+ expect(got?.metadataId).toBe(first.metadataId)
128
+ }, 30000)
129
+ })
@@ -0,0 +1,35 @@
1
+ import { existsSync, readdirSync, readFileSync } from 'node:fs'
2
+ import { resolve } from 'node:path'
3
+ import { fileURLToPath } from 'node:url'
4
+ import { describe, expect, it } from 'vitest'
5
+ import { loadIntegrationManifest } from '../../../src/integrations/dataLoader.js'
6
+
7
+ function escapeRegExp(str: string): string {
8
+ return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
9
+ }
10
+
11
+ describe('google-sheet static usage parity', () => {
12
+ it('every manifest tool is referenced in tests via build*(name)', () => {
13
+ const manifest = loadIntegrationManifest('google-sheet')!
14
+ const toolNames = (manifest.tools as any[]).map(t => t.name)
15
+
16
+ const testsDir = fileURLToPath(new URL('.', import.meta.url))
17
+ expect(existsSync(testsDir)).toBe(true)
18
+ const testFiles = readdirSync(testsDir)
19
+ .filter(f => /\.test\.(t|j)s$/.test(f) && !f.includes('usage_parity.test'))
20
+ .map(f => resolve(testsDir, f))
21
+
22
+ const fileContents = testFiles.map(f => readFileSync(f, 'utf8'))
23
+
24
+ const missing: string[] = []
25
+ for (const name of toolNames) {
26
+ // Matches buildRead('x'), buildWrite('x'), buildAdmin('x'), buildHandler('x'), buildReadHandler('x'), buildWriteHandler('x')
27
+ const nameRe = new RegExp(`build(?:Read|Write|Admin)?(?:Handler)?\\(\\s*['\"\`]${escapeRegExp(name)}['\"\`]\\s*\\)`, 'm')
28
+ const found = fileContents.some(src => nameRe.test(src))
29
+ if (!found)
30
+ missing.push(name)
31
+ }
32
+
33
+ expect(missing, `Missing handler usages in tests: ${missing.join(', ')}`).toEqual([])
34
+ })
35
+ })
@@ -0,0 +1,171 @@
1
+ import { beforeAll, describe, expect, it } from 'vitest'
2
+ import { IntegrationProxy } from '../../../src/integrations/proxy.js'
3
+ import { loadIntegrationTools } from '../../../src/integrations/dataLoader.js'
4
+
5
+ // LIVE Google Sheets write tests using managed OAuth
6
+ // Required env vars:
7
+ // - COMMANDABLE_MANAGED_OAUTH_BASE_URL
8
+ // - COMMANDABLE_MANAGED_OAUTH_SECRET_KEY
9
+ // - GSHEETS_TEST_CONNECTION_ID (managed OAuth connection for provider 'google-sheet')
10
+ // - GSHEETS_TEST_SPREADSHEET_ID (target spreadsheet ID with write access)
11
+
12
+ interface Ctx {
13
+ spreadsheetId?: string
14
+ }
15
+
16
+ const env = process.env as Record<string, string>
17
+ const hasEnv = (...keys: string[]) => keys.every(k => !!env[k] && env[k].trim().length > 0)
18
+ const suite = hasEnv(
19
+ 'COMMANDABLE_MANAGED_OAUTH_BASE_URL',
20
+ 'COMMANDABLE_MANAGED_OAUTH_SECRET_KEY',
21
+ 'GSHEETS_TEST_CONNECTION_ID',
22
+ 'GSHEETS_TEST_SPREADSHEET_ID',
23
+ )
24
+ ? describe
25
+ : describe.skip
26
+
27
+ suite('google-sheet write handlers (live)', () => {
28
+ const ctx: Ctx = {}
29
+ let buildWriteHandler: (name: string) => ((input: any) => Promise<any>)
30
+ let sheetTitle: string | undefined
31
+
32
+ beforeAll(async () => {
33
+ const { COMMANDABLE_MANAGED_OAUTH_BASE_URL, COMMANDABLE_MANAGED_OAUTH_SECRET_KEY, GSHEETS_TEST_CONNECTION_ID, GSHEETS_TEST_SPREADSHEET_ID } = env
34
+
35
+ const proxy = new IntegrationProxy({
36
+ managedOAuthBaseUrl: COMMANDABLE_MANAGED_OAUTH_BASE_URL,
37
+ managedOAuthSecretKey: COMMANDABLE_MANAGED_OAUTH_SECRET_KEY,
38
+ })
39
+ const integrationNode = { id: 'node-gsheets', type: 'google-sheet', label: 'Google Sheets', connectionId: GSHEETS_TEST_CONNECTION_ID } as any
40
+
41
+ const tools = loadIntegrationTools('google-sheet')
42
+ expect(tools).toBeTruthy()
43
+
44
+ buildWriteHandler = (name: string) => {
45
+ const tool = tools!.write.find(t => t.name === name)
46
+ expect(tool, `write tool ${name} exists`).toBeTruthy()
47
+ const integration = { fetch: (path: string, init?: RequestInit) => proxy.call(integrationNode, path, init) }
48
+ const build = new Function('integration', `return (${tool!.handlerCode});`)
49
+ return build(integration) as (input: any) => Promise<any>
50
+ }
51
+
52
+ ctx.spreadsheetId = GSHEETS_TEST_SPREADSHEET_ID
53
+
54
+ // Try to detect a default sheet title
55
+ if (ctx.spreadsheetId) {
56
+ const proxy2 = new IntegrationProxy({
57
+ managedOAuthBaseUrl: COMMANDABLE_MANAGED_OAUTH_BASE_URL,
58
+ managedOAuthSecretKey: COMMANDABLE_MANAGED_OAUTH_SECRET_KEY,
59
+ })
60
+ const node2 = { id: 'node-gsheets', type: 'google-sheet', label: 'Google Sheets', connectionId: GSHEETS_TEST_CONNECTION_ID } as any
61
+ const tools2 = loadIntegrationTools('google-sheet')!
62
+ const tool = tools2.read.find(t => t.name === 'get_spreadsheet')!
63
+ const build = new Function('integration', `return (${tool.handlerCode});`)
64
+ const integration = { fetch: (path: string, init?: RequestInit) => proxy2.call(node2, path, init) }
65
+ try {
66
+ const get_spreadsheet = build(integration) as (input: any) => Promise<any>
67
+ const meta = await get_spreadsheet({ spreadsheetId: ctx.spreadsheetId })
68
+ sheetTitle = meta?.sheets?.[0]?.properties?.title
69
+ }
70
+ catch {}
71
+ }
72
+ }, 60000)
73
+
74
+ it('append_values appends then clear_values clears', async () => {
75
+ if (!ctx.spreadsheetId)
76
+ return expect(true).toBe(true)
77
+
78
+ const append_values = buildWriteHandler('append_values')
79
+ const aTitle = sheetTitle || 'Sheet1'
80
+ const appendRes = await append_values({ spreadsheetId: ctx.spreadsheetId, range: `${aTitle}!A1`, values: [[`CmdTest ${Date.now()}`]], valueInputOption: 'USER_ENTERED' })
81
+ expect(appendRes?.updates || appendRes?.tableRange || appendRes?.spreadsheetId).toBeTruthy()
82
+
83
+ const clear_values = buildWriteHandler('clear_values')
84
+ const clearRes = await clear_values({ spreadsheetId: ctx.spreadsheetId, range: `${aTitle}!A1:A10` })
85
+ expect(clearRes?.clearedRange || clearRes?.spreadsheetId).toBeTruthy()
86
+ }, 60000)
87
+
88
+ it('update_values updates a range', async () => {
89
+ if (!ctx.spreadsheetId)
90
+ return expect(true).toBe(true)
91
+ const aTitle = sheetTitle || 'Sheet1'
92
+ const update_values = buildWriteHandler('update_values')
93
+ const res = await update_values({ spreadsheetId: ctx.spreadsheetId, range: `${aTitle}!B1:B1`, values: [[`CmdTestU ${Date.now()}`]], valueInputOption: 'USER_ENTERED' })
94
+ expect(res?.updatedRange || res?.spreadsheetId).toBeTruthy()
95
+ }, 60000)
96
+
97
+ it('batch_update_values updates multiple ranges', async () => {
98
+ if (!ctx.spreadsheetId)
99
+ return expect(true).toBe(true)
100
+ const aTitle = sheetTitle || 'Sheet1'
101
+ const batch_update_values = buildWriteHandler('batch_update_values')
102
+ const res = await batch_update_values({ spreadsheetId: ctx.spreadsheetId, data: [
103
+ { range: `${aTitle}!C1:C1`, values: [[`CmdTestB1 ${Date.now()}`]] },
104
+ { range: `${aTitle}!C2:C2`, values: [[`CmdTestB2 ${Date.now()}`]] },
105
+ ], valueInputOption: 'USER_ENTERED', includeValuesInResponse: true })
106
+ expect(res?.totalUpdatedCells >= 0 || res?.spreadsheetId).toBeTruthy()
107
+ }, 60000)
108
+
109
+ it('batch_update_values_by_data_filter updates via filters', async () => {
110
+ if (!ctx.spreadsheetId)
111
+ return expect(true).toBe(true)
112
+ const aTitle = sheetTitle || 'Sheet1'
113
+ const batch_update_values_by_data_filter = buildWriteHandler('batch_update_values_by_data_filter')
114
+ const res = await batch_update_values_by_data_filter({ spreadsheetId: ctx.spreadsheetId, data: [
115
+ { dataFilter: { a1Range: `${aTitle}!D1:D1` }, values: [[`CmdTestDF ${Date.now()}`]] },
116
+ ], valueInputOption: 'USER_ENTERED' })
117
+ expect(res?.totalUpdatedCells >= 0 || res?.spreadsheetId).toBeTruthy()
118
+ }, 60000)
119
+
120
+ it('batch_clear_values clears multiple ranges', async () => {
121
+ if (!ctx.spreadsheetId)
122
+ return expect(true).toBe(true)
123
+ const aTitle = sheetTitle || 'Sheet1'
124
+ const batch_clear_values = buildWriteHandler('batch_clear_values')
125
+ const res = await batch_clear_values({ spreadsheetId: ctx.spreadsheetId, ranges: [`${aTitle}!A1:A2`, `${aTitle}!B1:B2`] })
126
+ expect(Boolean(res?.spreadsheetId) || Array.isArray(res?.clearedRanges)).toBe(true)
127
+ }, 60000)
128
+
129
+ it('batch_clear_values_by_data_filter clears via filters', async () => {
130
+ if (!ctx.spreadsheetId)
131
+ return expect(true).toBe(true)
132
+ const aTitle = sheetTitle || 'Sheet1'
133
+ const batch_clear_values_by_data_filter = buildWriteHandler('batch_clear_values_by_data_filter')
134
+ const res = await batch_clear_values_by_data_filter({ spreadsheetId: ctx.spreadsheetId, dataFilters: [{ a1Range: `${aTitle}!E1:E2` }] })
135
+ expect(Boolean(res?.spreadsheetId) || Array.isArray(res?.clearedRanges)).toBe(true)
136
+ }, 60000)
137
+
138
+ it('batch_update handles a trivial request (no-op findReplace)', async () => {
139
+ if (!ctx.spreadsheetId)
140
+ return expect(true).toBe(true)
141
+ const aTitle = sheetTitle || 'Sheet1'
142
+ const batch_update = buildWriteHandler('batch_update')
143
+ const res = await batch_update({ spreadsheetId: ctx.spreadsheetId, requests: [
144
+ { findReplace: { find: '___unlikely___', replacement: '___unlikely___', matchCase: true, searchByRegex: false, includeFormulas: false, range: { sheetId: 0 } } },
145
+ ], includeSpreadsheetInResponse: false })
146
+ expect(res?.spreadsheetId).toBeTruthy()
147
+ }, 60000)
148
+
149
+ it('copy_to_spreadsheet copies a sheet when destination provided', async () => {
150
+ if (!ctx.spreadsheetId || !env.GSHEETS_TEST_DEST_SPREADSHEET_ID)
151
+ return expect(true).toBe(true)
152
+ const copy_to_spreadsheet = buildWriteHandler('copy_to_spreadsheet')
153
+ // Attempt to copy sheet with id 0 (typical for first sheet). If it fails, skip.
154
+ try {
155
+ const res = await copy_to_spreadsheet({ spreadsheetId: ctx.spreadsheetId, sheetId: 0, destinationSpreadsheetId: env.GSHEETS_TEST_DEST_SPREADSHEET_ID })
156
+ expect(res?.sheetId !== undefined || res?.spreadsheetId).toBeTruthy()
157
+ }
158
+ catch {
159
+ expect(true).toBe(true)
160
+ }
161
+ }, 60000)
162
+
163
+ it('create_spreadsheet creates a spreadsheet when allowed', async () => {
164
+ if (!env.GSHEETS_ALLOW_CREATE)
165
+ return expect(true).toBe(true)
166
+ const create_spreadsheet = buildWriteHandler('create_spreadsheet')
167
+ const res = await create_spreadsheet({ properties: { title: `CmdTest ${Date.now()}` } })
168
+ expect(res?.spreadsheetId).toBeTruthy()
169
+ // Note: No delete here to avoid Drive scope; test leaves an artifact when enabled.
170
+ }, 60000)
171
+ })
@@ -0,0 +1,36 @@
1
+ {
2
+ "schema": {
3
+ "type": "object",
4
+ "properties": {
5
+ "token": {
6
+ "type": "string",
7
+ "title": "OAuth Access Token (optional)",
8
+ "description": "Google OAuth access token to use as a Bearer token (typically short-lived)."
9
+ },
10
+ "serviceAccountJson": {
11
+ "type": "string",
12
+ "title": "Service Account JSON (recommended)",
13
+ "description": "Full service account key JSON (contents of the downloaded JSON file)."
14
+ },
15
+ "subject": {
16
+ "type": "string",
17
+ "title": "Subject / impersonated user (optional)",
18
+ "description": "Optional user email to impersonate when using Google Workspace domain-wide delegation."
19
+ },
20
+ "scopes": {
21
+ "type": "array",
22
+ "title": "OAuth scopes (optional)",
23
+ "description": "Optional override for OAuth scopes.",
24
+ "items": { "type": "string" }
25
+ }
26
+ },
27
+ "required": [],
28
+ "additionalProperties": false
29
+ },
30
+ "injection": {
31
+ "headers": {
32
+ "Authorization": "Bearer {{token}}"
33
+ }
34
+ }
35
+ }
36
+
@@ -0,0 +1,9 @@
1
+ Recommended: use a Google service account.
2
+
3
+ - Create a service account in Google Cloud
4
+ - Download a JSON key
5
+ - Paste the JSON into `serviceAccountJson` (or use `env:GOOGLE_SERVICE_ACCOUNT_JSON`)
6
+ - Share your test spreadsheet with the service account `client_email`
7
+
8
+ You can also paste a short-lived OAuth access token into `token`, but it will expire.
9
+
@@ -0,0 +1,18 @@
1
+ async (input) => {
2
+ const { spreadsheetId, range, values, valueInputOption, insertDataOption, includeValuesInResponse, responseValueRenderOption, responseDateTimeRenderOption } = input
3
+ const params = new URLSearchParams()
4
+ if (valueInputOption)
5
+ params.set('valueInputOption', valueInputOption)
6
+ if (insertDataOption)
7
+ params.set('insertDataOption', insertDataOption)
8
+ if (includeValuesInResponse !== undefined)
9
+ params.set('includeValuesInResponse', String(includeValuesInResponse))
10
+ if (responseValueRenderOption)
11
+ params.set('responseValueRenderOption', responseValueRenderOption)
12
+ if (responseDateTimeRenderOption)
13
+ params.set('responseDateTimeRenderOption', responseDateTimeRenderOption)
14
+ const qs = params.toString()
15
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values/${encodeURIComponent(range)}:append${qs ? `?${qs}` : ''}`
16
+ const res = await integration.fetch(path, { method: 'POST', body: { values } })
17
+ return await res.json()
18
+ }
@@ -0,0 +1,6 @@
1
+ async (input) => {
2
+ const { spreadsheetId, ranges } = input
3
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchClear`
4
+ const res = await integration.fetch(path, { method: 'POST', body: { ranges } })
5
+ return await res.json()
6
+ }
@@ -0,0 +1,6 @@
1
+ async (input) => {
2
+ const { spreadsheetId, dataFilters } = input
3
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchClearByDataFilter`
4
+ const res = await integration.fetch(path, { method: 'POST', body: { dataFilters } })
5
+ return await res.json()
6
+ }
@@ -0,0 +1,16 @@
1
+ async (input) => {
2
+ const { spreadsheetId, ranges, majorDimension, valueRenderOption, dateTimeRenderOption } = input
3
+ const params = new URLSearchParams()
4
+ if (Array.isArray(ranges))
5
+ ranges.forEach(r => params.append('ranges', String(r)))
6
+ if (majorDimension)
7
+ params.set('majorDimension', majorDimension)
8
+ if (valueRenderOption)
9
+ params.set('valueRenderOption', valueRenderOption)
10
+ if (dateTimeRenderOption)
11
+ params.set('dateTimeRenderOption', dateTimeRenderOption)
12
+ const qs = params.toString()
13
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchGet${qs ? `?${qs}` : ''}`
14
+ const res = await integration.fetch(path)
15
+ return await res.json()
16
+ }
@@ -0,0 +1,14 @@
1
+ async (input) => {
2
+ const { spreadsheetId, requests, includeSpreadsheetInResponse, responseRanges, responseIncludeGridData } = input
3
+ const params = new URLSearchParams()
4
+ if (includeSpreadsheetInResponse !== undefined)
5
+ params.set('includeSpreadsheetInResponse', String(includeSpreadsheetInResponse))
6
+ if (Array.isArray(responseRanges))
7
+ responseRanges.forEach(r => params.append('responseRanges', String(r)))
8
+ if (responseIncludeGridData !== undefined)
9
+ params.set('responseIncludeGridData', String(responseIncludeGridData))
10
+ const qs = params.toString()
11
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}:batchUpdate${qs ? `?${qs}` : ''}`
12
+ const res = await integration.fetch(path, { method: 'POST', body: { requests } })
13
+ return await res.json()
14
+ }
@@ -0,0 +1,16 @@
1
+ async (input) => {
2
+ const { spreadsheetId, data, valueInputOption, includeValuesInResponse, responseValueRenderOption, responseDateTimeRenderOption } = input
3
+ const params = new URLSearchParams()
4
+ if (valueInputOption)
5
+ params.set('valueInputOption', valueInputOption)
6
+ if (includeValuesInResponse !== undefined)
7
+ params.set('includeValuesInResponse', String(includeValuesInResponse))
8
+ if (responseValueRenderOption)
9
+ params.set('responseValueRenderOption', responseValueRenderOption)
10
+ if (responseDateTimeRenderOption)
11
+ params.set('responseDateTimeRenderOption', responseDateTimeRenderOption)
12
+ const qs = params.toString()
13
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchUpdate${qs ? `?${qs}` : ''}`
14
+ const res = await integration.fetch(path, { method: 'POST', body: { data } })
15
+ return await res.json()
16
+ }
@@ -0,0 +1,16 @@
1
+ async (input) => {
2
+ const { spreadsheetId, data, valueInputOption, includeValuesInResponse, responseValueRenderOption, responseDateTimeRenderOption } = input
3
+ const params = new URLSearchParams()
4
+ if (valueInputOption)
5
+ params.set('valueInputOption', valueInputOption)
6
+ if (includeValuesInResponse !== undefined)
7
+ params.set('includeValuesInResponse', String(includeValuesInResponse))
8
+ if (responseValueRenderOption)
9
+ params.set('responseValueRenderOption', responseValueRenderOption)
10
+ if (responseDateTimeRenderOption)
11
+ params.set('responseDateTimeRenderOption', responseDateTimeRenderOption)
12
+ const qs = params.toString()
13
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchUpdateByDataFilter${qs ? `?${qs}` : ''}`
14
+ const res = await integration.fetch(path, { method: 'POST', body: { data } })
15
+ return await res.json()
16
+ }
@@ -0,0 +1,6 @@
1
+ async (input) => {
2
+ const { spreadsheetId, range } = input
3
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values/${encodeURIComponent(range)}:clear`
4
+ const res = await integration.fetch(path, { method: 'POST', body: {} })
5
+ return await res.json()
6
+ }
@@ -0,0 +1,6 @@
1
+ async (input) => {
2
+ const { spreadsheetId, sheetId, destinationSpreadsheetId } = input
3
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/sheets/${encodeURIComponent(sheetId)}:copyTo`
4
+ const res = await integration.fetch(path, { method: 'POST', body: { destinationSpreadsheetId } })
5
+ return await res.json()
6
+ }
@@ -0,0 +1,5 @@
1
+ async (input) => {
2
+ const path = `/spreadsheets`
3
+ const res = await integration.fetch(path, { method: 'POST', body: input })
4
+ return await res.json()
5
+ }
@@ -0,0 +1,6 @@
1
+ async (input) => {
2
+ const { spreadsheetId, metadataId } = input
3
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/developerMetadata/${encodeURIComponent(metadataId)}`
4
+ const res = await integration.fetch(path)
5
+ return await res.json()
6
+ }
@@ -0,0 +1,12 @@
1
+ async (input) => {
2
+ const { spreadsheetId, includeGridData, ranges } = input
3
+ const params = new URLSearchParams()
4
+ if (includeGridData !== undefined)
5
+ params.set('includeGridData', String(includeGridData))
6
+ if (Array.isArray(ranges))
7
+ ranges.forEach(r => params.append('ranges', String(r)))
8
+ const qs = params.toString()
9
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}${qs ? `?${qs}` : ''}`
10
+ const res = await integration.fetch(path)
11
+ return await res.json()
12
+ }
@@ -0,0 +1,10 @@
1
+ async (input) => {
2
+ const { spreadsheetId, dataFilters, includeGridData } = input
3
+ const params = new URLSearchParams()
4
+ if (includeGridData !== undefined)
5
+ params.set('includeGridData', String(includeGridData))
6
+ const qs = params.toString()
7
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}:getByDataFilter${qs ? `?${qs}` : ''}`
8
+ const res = await integration.fetch(path, { method: 'POST', body: { dataFilters } })
9
+ return await res.json()
10
+ }
@@ -0,0 +1,14 @@
1
+ async (input) => {
2
+ const { spreadsheetId, range, majorDimension, valueRenderOption, dateTimeRenderOption } = input
3
+ const params = new URLSearchParams()
4
+ if (majorDimension)
5
+ params.set('majorDimension', majorDimension)
6
+ if (valueRenderOption)
7
+ params.set('valueRenderOption', valueRenderOption)
8
+ if (dateTimeRenderOption)
9
+ params.set('dateTimeRenderOption', dateTimeRenderOption)
10
+ const qs = params.toString()
11
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values/${encodeURIComponent(range)}${qs ? `?${qs}` : ''}`
12
+ const res = await integration.fetch(path)
13
+ return await res.json()
14
+ }
@@ -0,0 +1,14 @@
1
+ async (input) => {
2
+ const { spreadsheetId, dataFilters, majorDimension, valueRenderOption, dateTimeRenderOption } = input
3
+ const params = new URLSearchParams()
4
+ if (majorDimension)
5
+ params.set('majorDimension', majorDimension)
6
+ if (valueRenderOption)
7
+ params.set('valueRenderOption', valueRenderOption)
8
+ if (dateTimeRenderOption)
9
+ params.set('dateTimeRenderOption', dateTimeRenderOption)
10
+ const qs = params.toString()
11
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values:batchGetByDataFilter${qs ? `?${qs}` : ''}`
12
+ const res = await integration.fetch(path, { method: 'POST', body: { dataFilters } })
13
+ return await res.json()
14
+ }
@@ -0,0 +1,7 @@
1
+ async (input) => {
2
+ const { spreadsheetId, dataFilters } = input
3
+ // Correct endpoint per Sheets API: /spreadsheets/{spreadsheetId}/developerMetadata:search
4
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/developerMetadata:search`
5
+ const res = await integration.fetch(path, { method: 'POST', body: { dataFilters } })
6
+ return await res.json()
7
+ }
@@ -0,0 +1,16 @@
1
+ async (input) => {
2
+ const { spreadsheetId, range, values, valueInputOption, includeValuesInResponse, responseValueRenderOption, responseDateTimeRenderOption } = input
3
+ const params = new URLSearchParams()
4
+ if (valueInputOption)
5
+ params.set('valueInputOption', valueInputOption)
6
+ if (includeValuesInResponse !== undefined)
7
+ params.set('includeValuesInResponse', String(includeValuesInResponse))
8
+ if (responseValueRenderOption)
9
+ params.set('responseValueRenderOption', responseValueRenderOption)
10
+ if (responseDateTimeRenderOption)
11
+ params.set('responseDateTimeRenderOption', responseDateTimeRenderOption)
12
+ const qs = params.toString()
13
+ const path = `/spreadsheets/${encodeURIComponent(spreadsheetId)}/values/${encodeURIComponent(range)}${qs ? `?${qs}` : ''}`
14
+ const res = await integration.fetch(path, { method: 'PUT', body: { values } })
15
+ return await res.json()
16
+ }