@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.
- package/dist/credentials-index.d.ts +30 -0
- package/dist/credentials-index.d.ts.map +1 -0
- package/dist/credentials-index.js +292 -0
- package/dist/credentials-index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +69 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +164 -0
- package/dist/loader.js.map +1 -0
- package/integrations/README.md +52 -0
- package/integrations/airtable/__tests__/get_handlers.test.ts +137 -0
- package/integrations/airtable/__tests__/usage_parity.test.ts +35 -0
- package/integrations/airtable/__tests__/write_and_admin_handlers.test.ts +113 -0
- package/integrations/airtable/credentials.json +20 -0
- package/integrations/airtable/credentials_hint.md +4 -0
- package/integrations/airtable/handlers/create_record.js +12 -0
- package/integrations/airtable/handlers/delete_record.js +7 -0
- package/integrations/airtable/handlers/get_record.js +4 -0
- package/integrations/airtable/handlers/get_table_schema.js +6 -0
- package/integrations/airtable/handlers/list_bases.js +4 -0
- package/integrations/airtable/handlers/list_records.js +25 -0
- package/integrations/airtable/handlers/list_table_fields.js +6 -0
- package/integrations/airtable/handlers/list_tables.js +4 -0
- package/integrations/airtable/handlers/list_views.js +6 -0
- package/integrations/airtable/handlers/search_records.js +6 -0
- package/integrations/airtable/handlers/update_record.js +11 -0
- package/integrations/airtable/manifest.json +83 -0
- package/integrations/airtable/schemas/create_record.json +12 -0
- package/integrations/airtable/schemas/delete_record.json +11 -0
- package/integrations/airtable/schemas/empty.json +6 -0
- package/integrations/airtable/schemas/get_record.json +11 -0
- package/integrations/airtable/schemas/id_base.json +9 -0
- package/integrations/airtable/schemas/id_base_table.json +10 -0
- package/integrations/airtable/schemas/list_records.json +26 -0
- package/integrations/airtable/schemas/search_records.json +12 -0
- package/integrations/airtable/schemas/update_record.json +13 -0
- package/integrations/github/__tests__/get_handlers.test.ts +117 -0
- package/integrations/github/__tests__/usage_parity.test.ts +34 -0
- package/integrations/github/__tests__/write_handlers.test.ts +311 -0
- package/integrations/github/credentials.json +20 -0
- package/integrations/github/credentials_hint.md +7 -0
- package/integrations/github/handlers/add_labels_to_issue.js +12 -0
- package/integrations/github/handlers/close_issue.js +5 -0
- package/integrations/github/handlers/comment_on_issue.js +5 -0
- package/integrations/github/handlers/create_branch.js +33 -0
- package/integrations/github/handlers/create_commit.js +91 -0
- package/integrations/github/handlers/create_issue.js +10 -0
- package/integrations/github/handlers/create_or_update_file.js +21 -0
- package/integrations/github/handlers/create_pull_request.js +16 -0
- package/integrations/github/handlers/create_repo.js +11 -0
- package/integrations/github/handlers/delete_repo.js +6 -0
- package/integrations/github/handlers/get_issue.js +4 -0
- package/integrations/github/handlers/get_repo.js +4 -0
- package/integrations/github/handlers/list_branches.js +4 -0
- package/integrations/github/handlers/list_commits.js +12 -0
- package/integrations/github/handlers/list_issues.js +12 -0
- package/integrations/github/handlers/list_pull_requests.js +8 -0
- package/integrations/github/handlers/list_repos_install.js +4 -0
- package/integrations/github/handlers/list_repos_user.js +4 -0
- package/integrations/github/handlers/merge_pull_request.js +14 -0
- package/integrations/github/handlers/update_issue.js +15 -0
- package/integrations/github/manifest.json +26 -0
- package/integrations/github/schemas/add_labels_to_issue.json +12 -0
- package/integrations/github/schemas/close_issue.json +10 -0
- package/integrations/github/schemas/comment_on_issue.json +11 -0
- package/integrations/github/schemas/create_branch.json +12 -0
- package/integrations/github/schemas/create_commit.json +25 -0
- package/integrations/github/schemas/create_issue.json +13 -0
- package/integrations/github/schemas/create_or_update_file.json +15 -0
- package/integrations/github/schemas/create_pull_request.json +15 -0
- package/integrations/github/schemas/create_repo.json +12 -0
- package/integrations/github/schemas/delete_repo.json +10 -0
- package/integrations/github/schemas/empty.json +5 -0
- package/integrations/github/schemas/get_issue.json +10 -0
- package/integrations/github/schemas/get_repo.json +9 -0
- package/integrations/github/schemas/list_commits.json +12 -0
- package/integrations/github/schemas/list_issues.json +12 -0
- package/integrations/github/schemas/list_pull_requests.json +10 -0
- package/integrations/github/schemas/merge_pull_request.json +14 -0
- package/integrations/github/schemas/owner_repo.json +9 -0
- package/integrations/github/schemas/update_issue.json +15 -0
- package/integrations/google-calendar/__tests__/get_handlers.test.ts +112 -0
- package/integrations/google-calendar/__tests__/usage_parity.test.ts +34 -0
- package/integrations/google-calendar/__tests__/write_and_admin_handlers.test.ts +161 -0
- package/integrations/google-calendar/credentials.json +36 -0
- package/integrations/google-calendar/credentials_hint.md +9 -0
- package/integrations/google-calendar/handlers/create_event.js +6 -0
- package/integrations/google-calendar/handlers/delete_acl.js +6 -0
- package/integrations/google-calendar/handlers/delete_event.js +7 -0
- package/integrations/google-calendar/handlers/freebusy_query.js +4 -0
- package/integrations/google-calendar/handlers/get_acl.js +5 -0
- package/integrations/google-calendar/handlers/get_calendar.js +4 -0
- package/integrations/google-calendar/handlers/get_event.js +5 -0
- package/integrations/google-calendar/handlers/insert_acl.js +6 -0
- package/integrations/google-calendar/handlers/list_acl.js +5 -0
- package/integrations/google-calendar/handlers/list_calendars.js +4 -0
- package/integrations/google-calendar/handlers/list_colors.js +4 -0
- package/integrations/google-calendar/handlers/list_events.js +21 -0
- package/integrations/google-calendar/handlers/list_settings.js +4 -0
- package/integrations/google-calendar/handlers/move_event.js +6 -0
- package/integrations/google-calendar/handlers/patch_event.js +5 -0
- package/integrations/google-calendar/handlers/quick_add.js +6 -0
- package/integrations/google-calendar/handlers/update_acl.js +7 -0
- package/integrations/google-calendar/handlers/update_event.js +5 -0
- package/integrations/google-calendar/manifest.json +26 -0
- package/integrations/google-calendar/schemas/create_event.json +34 -0
- package/integrations/google-calendar/schemas/delete_acl.json +9 -0
- package/integrations/google-calendar/schemas/empty.json +1 -0
- package/integrations/google-calendar/schemas/freebusy_query.json +13 -0
- package/integrations/google-calendar/schemas/get_acl.json +9 -0
- package/integrations/google-calendar/schemas/id_calendar.json +8 -0
- package/integrations/google-calendar/schemas/id_calendar_event.json +9 -0
- package/integrations/google-calendar/schemas/insert_acl.json +18 -0
- package/integrations/google-calendar/schemas/list_events.json +15 -0
- package/integrations/google-calendar/schemas/move_event.json +10 -0
- package/integrations/google-calendar/schemas/patch_event.json +10 -0
- package/integrations/google-calendar/schemas/quick_add.json +9 -0
- package/integrations/google-calendar/schemas/update_acl.json +10 -0
- package/integrations/google-calendar/schemas/update_event.json +10 -0
- package/integrations/google-docs/__tests__/get_handlers.test.ts +72 -0
- package/integrations/google-docs/__tests__/usage_parity.test.ts +34 -0
- package/integrations/google-docs/__tests__/write_handlers.test.ts +249 -0
- package/integrations/google-docs/credentials.json +36 -0
- package/integrations/google-docs/credentials_hint.md +9 -0
- package/integrations/google-docs/handlers/append_text.js +12 -0
- package/integrations/google-docs/handlers/batch_update.js +13 -0
- package/integrations/google-docs/handlers/create_document.js +9 -0
- package/integrations/google-docs/handlers/delete_first_match.js +50 -0
- package/integrations/google-docs/handlers/get_document.js +12 -0
- package/integrations/google-docs/handlers/get_document_structured.js +6 -0
- package/integrations/google-docs/handlers/get_document_text.js +17 -0
- package/integrations/google-docs/handlers/insert_inline_image_after_first_match.js +41 -0
- package/integrations/google-docs/handlers/insert_page_break_after_first_match.js +49 -0
- package/integrations/google-docs/handlers/insert_table_after_first_match.js +49 -0
- package/integrations/google-docs/handlers/insert_text_after_first_match.js +51 -0
- package/integrations/google-docs/handlers/replace_all_text.js +8 -0
- package/integrations/google-docs/handlers/style_first_match.js +42 -0
- package/integrations/google-docs/handlers/update_document_style.js +8 -0
- package/integrations/google-docs/handlers/update_paragraph_style_for_first_match.js +48 -0
- package/integrations/google-docs/manifest.json +58 -0
- package/integrations/google-docs/schemas/append_text.json +10 -0
- package/integrations/google-docs/schemas/apply_text_style.json +13 -0
- package/integrations/google-docs/schemas/batch_update.json +16 -0
- package/integrations/google-docs/schemas/create_document.json +8 -0
- package/integrations/google-docs/schemas/delete_content_range.json +11 -0
- package/integrations/google-docs/schemas/delete_first_match.json +10 -0
- package/integrations/google-docs/schemas/get_document.json +11 -0
- package/integrations/google-docs/schemas/get_document_structured.json +9 -0
- package/integrations/google-docs/schemas/get_document_text.json +9 -0
- package/integrations/google-docs/schemas/insert_inline_image.json +12 -0
- package/integrations/google-docs/schemas/insert_inline_image_after_first_match.json +13 -0
- package/integrations/google-docs/schemas/insert_page_break.json +10 -0
- package/integrations/google-docs/schemas/insert_page_break_after_first_match.json +11 -0
- package/integrations/google-docs/schemas/insert_table.json +12 -0
- package/integrations/google-docs/schemas/insert_table_after_first_match.json +13 -0
- package/integrations/google-docs/schemas/insert_text_after_first_match.json +12 -0
- package/integrations/google-docs/schemas/insert_text_at.json +11 -0
- package/integrations/google-docs/schemas/replace_all_text.json +12 -0
- package/integrations/google-docs/schemas/style_first_match.json +12 -0
- package/integrations/google-docs/schemas/update_document_style.json +11 -0
- package/integrations/google-docs/schemas/update_paragraph_style.json +13 -0
- package/integrations/google-docs/schemas/update_paragraph_style_for_first_match.json +12 -0
- package/integrations/google-sheet/__tests__/get_handlers.test.ts +129 -0
- package/integrations/google-sheet/__tests__/usage_parity.test.ts +35 -0
- package/integrations/google-sheet/__tests__/write_handlers.test.ts +171 -0
- package/integrations/google-sheet/credentials.json +36 -0
- package/integrations/google-sheet/credentials_hint.md +9 -0
- package/integrations/google-sheet/handlers/append_values.js +18 -0
- package/integrations/google-sheet/handlers/batch_clear_values.js +6 -0
- package/integrations/google-sheet/handlers/batch_clear_values_by_data_filter.js +6 -0
- package/integrations/google-sheet/handlers/batch_get_values.js +16 -0
- package/integrations/google-sheet/handlers/batch_update.js +14 -0
- package/integrations/google-sheet/handlers/batch_update_values.js +16 -0
- package/integrations/google-sheet/handlers/batch_update_values_by_data_filter.js +16 -0
- package/integrations/google-sheet/handlers/clear_values.js +6 -0
- package/integrations/google-sheet/handlers/copy_to_spreadsheet.js +6 -0
- package/integrations/google-sheet/handlers/create_spreadsheet.js +5 -0
- package/integrations/google-sheet/handlers/get_developer_metadata.js +6 -0
- package/integrations/google-sheet/handlers/get_spreadsheet.js +12 -0
- package/integrations/google-sheet/handlers/get_spreadsheet_by_data_filter.js +10 -0
- package/integrations/google-sheet/handlers/get_values.js +14 -0
- package/integrations/google-sheet/handlers/get_values_by_data_filter.js +14 -0
- package/integrations/google-sheet/handlers/search_developer_metadata.js +7 -0
- package/integrations/google-sheet/handlers/update_values.js +16 -0
- package/integrations/google-sheet/manifest.json +125 -0
- package/integrations/google-sheet/schemas/append_values.json +16 -0
- package/integrations/google-sheet/schemas/batch_clear_values.json +10 -0
- package/integrations/google-sheet/schemas/batch_clear_values_by_data_filter.json +10 -0
- package/integrations/google-sheet/schemas/batch_get_values.json +13 -0
- package/integrations/google-sheet/schemas/batch_update.json +13 -0
- package/integrations/google-sheet/schemas/batch_update_values.json +25 -0
- package/integrations/google-sheet/schemas/batch_update_values_by_data_filter.json +25 -0
- package/integrations/google-sheet/schemas/clear_values.json +10 -0
- package/integrations/google-sheet/schemas/copy_to_spreadsheet.json +11 -0
- package/integrations/google-sheet/schemas/create_spreadsheet.json +11 -0
- package/integrations/google-sheet/schemas/get_developer_metadata.json +10 -0
- package/integrations/google-sheet/schemas/get_spreadsheet.json +15 -0
- package/integrations/google-sheet/schemas/get_spreadsheet_by_data_filter.json +11 -0
- package/integrations/google-sheet/schemas/get_values.json +13 -0
- package/integrations/google-sheet/schemas/get_values_by_data_filter.json +17 -0
- package/integrations/google-sheet/schemas/search_developer_metadata.json +14 -0
- package/integrations/google-sheet/schemas/update_values.json +15 -0
- package/integrations/google-slides/__tests__/get_handlers.test.ts +69 -0
- package/integrations/google-slides/__tests__/usage_parity.test.ts +34 -0
- package/integrations/google-slides/__tests__/write_handlers.test.ts +125 -0
- package/integrations/google-slides/credentials.json +36 -0
- package/integrations/google-slides/credentials_hint.md +9 -0
- package/integrations/google-slides/handlers/append_text_to_title_of_first_slide.js +17 -0
- package/integrations/google-slides/handlers/batch_update.js +15 -0
- package/integrations/google-slides/handlers/create_presentation.js +8 -0
- package/integrations/google-slides/handlers/create_slide_after_first_match.js +20 -0
- package/integrations/google-slides/handlers/get_page_thumbnail.js +12 -0
- package/integrations/google-slides/handlers/get_presentation.js +6 -0
- package/integrations/google-slides/handlers/insert_image_after_first_match.js +19 -0
- package/integrations/google-slides/handlers/insert_shape_after_first_match.js +21 -0
- package/integrations/google-slides/handlers/replace_text_first_match.js +9 -0
- package/integrations/google-slides/handlers/set_background_color_for_slide_index.js +15 -0
- package/integrations/google-slides/handlers/style_text_first_match.js +48 -0
- package/integrations/google-slides/manifest.json +41 -0
- package/integrations/google-slides/schemas/append_text_to_title_of_first_slide.json +11 -0
- package/integrations/google-slides/schemas/batch_update.json +13 -0
- package/integrations/google-slides/schemas/create_presentation.json +8 -0
- package/integrations/google-slides/schemas/create_slide_after_first_match.json +11 -0
- package/integrations/google-slides/schemas/get_page_thumbnail.json +12 -0
- package/integrations/google-slides/schemas/get_presentation.json +9 -0
- package/integrations/google-slides/schemas/insert_image_after_first_match.json +13 -0
- package/integrations/google-slides/schemas/insert_shape_after_first_match.json +13 -0
- package/integrations/google-slides/schemas/replace_text_first_match.json +12 -0
- package/integrations/google-slides/schemas/set_background_color_for_slide_index.json +11 -0
- package/integrations/google-slides/schemas/style_text_first_match.json +12 -0
- package/integrations/new_integration_prompt.md +41 -0
- package/integrations/notion/__tests__/get_handlers.test.ts +153 -0
- package/integrations/notion/__tests__/usage_parity.test.ts +34 -0
- package/integrations/notion/__tests__/write_and_admin_handlers.test.ts +190 -0
- package/integrations/notion/credentials.json +21 -0
- package/integrations/notion/credentials_hint.md +5 -0
- package/integrations/notion/handlers/append_block_children.js +7 -0
- package/integrations/notion/handlers/create_comment.js +10 -0
- package/integrations/notion/handlers/create_database.js +11 -0
- package/integrations/notion/handlers/create_page.js +13 -0
- package/integrations/notion/handlers/delete_block.js +8 -0
- package/integrations/notion/handlers/get_me.js +4 -0
- package/integrations/notion/handlers/list_block_children.js +10 -0
- package/integrations/notion/handlers/list_comments.js +14 -0
- package/integrations/notion/handlers/list_users.js +10 -0
- package/integrations/notion/handlers/query_database.js +10 -0
- package/integrations/notion/handlers/retrieve_block.js +4 -0
- package/integrations/notion/handlers/retrieve_database.js +4 -0
- package/integrations/notion/handlers/retrieve_page.js +4 -0
- package/integrations/notion/handlers/retrieve_page_property_item.js +10 -0
- package/integrations/notion/handlers/retrieve_user.js +4 -0
- package/integrations/notion/handlers/search.js +11 -0
- package/integrations/notion/handlers/update_block.js +7 -0
- package/integrations/notion/handlers/update_database.js +10 -0
- package/integrations/notion/handlers/update_page_properties.js +10 -0
- package/integrations/notion/manifest.json +139 -0
- package/integrations/notion/prompt.md +26 -0
- package/integrations/notion/schemas/append_block_children.json +10 -0
- package/integrations/notion/schemas/create_comment.json +18 -0
- package/integrations/notion/schemas/create_database.json +18 -0
- package/integrations/notion/schemas/create_page.json +22 -0
- package/integrations/notion/schemas/delete_block.json +9 -0
- package/integrations/notion/schemas/empty.json +6 -0
- package/integrations/notion/schemas/id_block.json +9 -0
- package/integrations/notion/schemas/id_database.json +9 -0
- package/integrations/notion/schemas/id_page.json +9 -0
- package/integrations/notion/schemas/id_user.json +9 -0
- package/integrations/notion/schemas/list_block_children.json +11 -0
- package/integrations/notion/schemas/list_comments.json +15 -0
- package/integrations/notion/schemas/list_users.json +9 -0
- package/integrations/notion/schemas/query_database.json +13 -0
- package/integrations/notion/schemas/retrieve_page_property_item.json +12 -0
- package/integrations/notion/schemas/search.json +27 -0
- package/integrations/notion/schemas/update_block.json +10 -0
- package/integrations/notion/schemas/update_database.json +13 -0
- package/integrations/notion/schemas/update_page_properties.json +13 -0
- package/integrations/trello/__tests__/get_handlers.test.ts +240 -0
- package/integrations/trello/__tests__/usage_parity.test.ts +34 -0
- package/integrations/trello/__tests__/write_and_admin_handlers.test.ts +189 -0
- package/integrations/trello/credentials.json +26 -0
- package/integrations/trello/credentials_hint.md +4 -0
- package/integrations/trello/handlers/add_checklist_to_card.js +5 -0
- package/integrations/trello/handlers/add_member_to_card.js +5 -0
- package/integrations/trello/handlers/archive_list.js +5 -0
- package/integrations/trello/handlers/create_card.js +13 -0
- package/integrations/trello/handlers/create_list.js +7 -0
- package/integrations/trello/handlers/delete_card.js +9 -0
- package/integrations/trello/handlers/get_board.js +4 -0
- package/integrations/trello/handlers/get_board_cards.js +4 -0
- package/integrations/trello/handlers/get_board_custom_fields.js +4 -0
- package/integrations/trello/handlers/get_board_labels.js +4 -0
- package/integrations/trello/handlers/get_board_lists.js +4 -0
- package/integrations/trello/handlers/get_board_members.js +4 -0
- package/integrations/trello/handlers/get_board_memberships.js +4 -0
- package/integrations/trello/handlers/get_card.js +4 -0
- package/integrations/trello/handlers/get_card_actions.js +4 -0
- package/integrations/trello/handlers/get_card_attachments.js +4 -0
- package/integrations/trello/handlers/get_card_checklists.js +4 -0
- package/integrations/trello/handlers/get_card_custom_field_items.js +4 -0
- package/integrations/trello/handlers/get_card_members.js +4 -0
- package/integrations/trello/handlers/get_list.js +4 -0
- package/integrations/trello/handlers/get_list_cards.js +4 -0
- package/integrations/trello/handlers/get_member.js +4 -0
- package/integrations/trello/handlers/get_member_boards.js +4 -0
- package/integrations/trello/handlers/get_member_organizations.js +4 -0
- package/integrations/trello/handlers/get_organization.js +4 -0
- package/integrations/trello/handlers/get_organization_boards.js +4 -0
- package/integrations/trello/handlers/move_card_to_list.js +5 -0
- package/integrations/trello/handlers/remove_member_from_card.js +9 -0
- package/integrations/trello/handlers/search.js +5 -0
- package/integrations/trello/handlers/update_card.js +19 -0
- package/integrations/trello/handlers/update_list.js +11 -0
- package/integrations/trello/manifest.json +231 -0
- package/integrations/trello/schemas/add_checklist_to_card.json +10 -0
- package/integrations/trello/schemas/add_member_to_card.json +10 -0
- package/integrations/trello/schemas/archive_list.json +9 -0
- package/integrations/trello/schemas/create_card.json +13 -0
- package/integrations/trello/schemas/create_list.json +11 -0
- package/integrations/trello/schemas/delete_card.json +9 -0
- package/integrations/trello/schemas/display_trello_cards.json +45 -0
- package/integrations/trello/schemas/empty.json +5 -0
- package/integrations/trello/schemas/get_member.json +5 -0
- package/integrations/trello/schemas/id_board.json +8 -0
- package/integrations/trello/schemas/id_card.json +8 -0
- package/integrations/trello/schemas/id_list.json +8 -0
- package/integrations/trello/schemas/id_org.json +8 -0
- package/integrations/trello/schemas/move_card_to_list.json +10 -0
- package/integrations/trello/schemas/remove_member_from_card.json +10 -0
- package/integrations/trello/schemas/search.json +8 -0
- package/integrations/trello/schemas/update_card.json +16 -0
- package/integrations/trello/schemas/update_list.json +12 -0
- package/package.json +45 -0
|
@@ -0,0 +1,34 @@
|
|
|
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('notion static usage parity', () => {
|
|
12
|
+
it('every manifest tool is referenced in tests via build*(name)', () => {
|
|
13
|
+
const manifest = loadIntegrationManifest('notion')!
|
|
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
|
+
const nameRe = new RegExp(`build(?:Read|Write|Admin)?(?:Handler)?\\(\\s*['\"\`]${escapeRegExp(name)}['\"\`]\\s*\\)`, 'm')
|
|
27
|
+
const found = fileContents.some(src => nameRe.test(src))
|
|
28
|
+
if (!found)
|
|
29
|
+
missing.push(name)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
expect(missing, `Missing handler usages in tests: ${missing.join(', ')}`).toEqual([])
|
|
33
|
+
})
|
|
34
|
+
})
|
|
@@ -0,0 +1,190 @@
|
|
|
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
|
+
interface Ctx {
|
|
6
|
+
createdPageId?: string
|
|
7
|
+
parentDatabaseId?: string
|
|
8
|
+
createdDatabaseId?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const env = process.env as Record<string, string>
|
|
12
|
+
const hasEnv = (...keys: string[]) => keys.every(k => !!env[k] && env[k].trim().length > 0)
|
|
13
|
+
const suite = hasEnv(
|
|
14
|
+
'COMMANDABLE_MANAGED_OAUTH_BASE_URL',
|
|
15
|
+
'COMMANDABLE_MANAGED_OAUTH_SECRET_KEY',
|
|
16
|
+
'NOTION_TEST_CONNECTION_ID',
|
|
17
|
+
)
|
|
18
|
+
? describe
|
|
19
|
+
: describe.skip
|
|
20
|
+
|
|
21
|
+
suite('notion write handlers (live)', () => {
|
|
22
|
+
const ctx: Ctx = {}
|
|
23
|
+
let buildWrite: (name: string) => ((input: any) => Promise<any>)
|
|
24
|
+
let buildRead: (name: string) => ((input: any) => Promise<any>)
|
|
25
|
+
|
|
26
|
+
beforeAll(async () => {
|
|
27
|
+
const { COMMANDABLE_MANAGED_OAUTH_BASE_URL, COMMANDABLE_MANAGED_OAUTH_SECRET_KEY, NOTION_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-notion', type: 'notion', label: 'Notion', connectionId: NOTION_TEST_CONNECTION_ID } as any
|
|
34
|
+
|
|
35
|
+
const tools = loadIntegrationTools('notion')
|
|
36
|
+
expect(tools).toBeTruthy()
|
|
37
|
+
|
|
38
|
+
buildWrite = (name: string) => {
|
|
39
|
+
const tool = tools!.write.find(t => t.name === name)
|
|
40
|
+
expect(tool, `write 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
|
+
buildRead = (name: string) => {
|
|
47
|
+
const tool = tools!.read.find(t => t.name === name)
|
|
48
|
+
expect(tool, `read tool ${name} exists`).toBeTruthy()
|
|
49
|
+
const integration = { fetch: (path: string, init?: RequestInit) => proxy.call(integrationNode, path, init) }
|
|
50
|
+
const build = new Function('integration', `return (${tool!.handlerCode});`)
|
|
51
|
+
return build(integration) as (input: any) => Promise<any>
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// Try to find a database to create a page in by searching
|
|
55
|
+
try {
|
|
56
|
+
const search = buildRead('search')
|
|
57
|
+
const res = await search({ query: '', filter: { value: 'database', property: 'object' }, page_size: 1 })
|
|
58
|
+
ctx.parentDatabaseId = res?.results?.[0]?.id
|
|
59
|
+
}
|
|
60
|
+
catch {}
|
|
61
|
+
}, 60000)
|
|
62
|
+
|
|
63
|
+
it('create_page -> retrieve_page -> update_page_properties', async () => {
|
|
64
|
+
if (!ctx.parentDatabaseId)
|
|
65
|
+
return expect(true).toBe(true)
|
|
66
|
+
|
|
67
|
+
const create_page = buildWrite('create_page')
|
|
68
|
+
const titleText = `CmdTest ${Date.now()}`
|
|
69
|
+
const created = await create_page({
|
|
70
|
+
parent: { database_id: ctx.parentDatabaseId },
|
|
71
|
+
properties: {
|
|
72
|
+
Name: { title: [{ type: 'text', text: { content: titleText } }] },
|
|
73
|
+
},
|
|
74
|
+
})
|
|
75
|
+
const pageId = created?.id
|
|
76
|
+
expect(pageId).toBeTruthy()
|
|
77
|
+
ctx.createdPageId = pageId
|
|
78
|
+
|
|
79
|
+
const retrieve_page = buildRead('retrieve_page')
|
|
80
|
+
const got = await retrieve_page({ page_id: pageId })
|
|
81
|
+
expect(got?.id).toBe(pageId)
|
|
82
|
+
|
|
83
|
+
const update_page_properties = buildWrite('update_page_properties')
|
|
84
|
+
const newTitle = `${titleText} Updated`
|
|
85
|
+
const updated = await update_page_properties({ page_id: pageId, properties: { Name: { title: [{ type: 'text', text: { content: newTitle } }] } } })
|
|
86
|
+
expect(updated?.id).toBe(pageId)
|
|
87
|
+
|
|
88
|
+
// Verify via retrieve
|
|
89
|
+
const gotAfter = await retrieve_page({ page_id: pageId })
|
|
90
|
+
const gotTitle = gotAfter?.properties?.Name?.title?.[0]?.plain_text || gotAfter?.properties?.Name?.title?.[0]?.text?.content
|
|
91
|
+
expect(gotTitle?.includes('Updated')).toBe(true)
|
|
92
|
+
}, 90000)
|
|
93
|
+
|
|
94
|
+
it('append_block_children on created page', async () => {
|
|
95
|
+
if (!ctx.createdPageId)
|
|
96
|
+
return expect(true).toBe(true)
|
|
97
|
+
const append_block_children = buildWrite('append_block_children')
|
|
98
|
+
const contentText = 'Hello from test'
|
|
99
|
+
const res = await append_block_children({
|
|
100
|
+
block_id: ctx.createdPageId,
|
|
101
|
+
children: [
|
|
102
|
+
{ object: 'block', type: 'paragraph', paragraph: { rich_text: [{ type: 'text', text: { content: contentText } }] } },
|
|
103
|
+
],
|
|
104
|
+
})
|
|
105
|
+
expect(res).toBeTruthy()
|
|
106
|
+
|
|
107
|
+
// Verify via list_block_children
|
|
108
|
+
const list_block_children = buildRead('list_block_children')
|
|
109
|
+
const listed = await list_block_children({ block_id: ctx.createdPageId })
|
|
110
|
+
const found = (listed?.results || listed || []).some((b: any) => b?.paragraph?.rich_text?.some((t: any) => (t?.plain_text || t?.text?.content) === contentText))
|
|
111
|
+
expect(found).toBe(true)
|
|
112
|
+
}, 60000)
|
|
113
|
+
|
|
114
|
+
it('create_comment on created page', async () => {
|
|
115
|
+
if (!ctx.createdPageId)
|
|
116
|
+
return expect(true).toBe(true)
|
|
117
|
+
const create_comment = buildWrite('create_comment')
|
|
118
|
+
const commentText = 'Test comment'
|
|
119
|
+
const res = await create_comment({ parent: { block_id: ctx.createdPageId }, rich_text: [{ type: 'text', text: { content: commentText } }] })
|
|
120
|
+
expect(res?.object === 'comment' || res?.results).toBeTruthy()
|
|
121
|
+
|
|
122
|
+
// Verify via list_comments
|
|
123
|
+
const list_comments = buildRead('list_comments')
|
|
124
|
+
const comments = await list_comments({ block_id: ctx.createdPageId })
|
|
125
|
+
const hasComment = (comments?.results || comments || []).some((c: any) => c?.rich_text?.some((t: any) => (t?.plain_text || t?.text?.content)?.includes(commentText)))
|
|
126
|
+
expect(hasComment).toBe(true)
|
|
127
|
+
}, 60000)
|
|
128
|
+
|
|
129
|
+
it('update_block and delete_block on appended paragraph', async () => {
|
|
130
|
+
if (!ctx.createdPageId)
|
|
131
|
+
return expect(true).toBe(true)
|
|
132
|
+
// Create a specific block to edit
|
|
133
|
+
const append_block_children = buildWrite('append_block_children')
|
|
134
|
+
const appended = await append_block_children({
|
|
135
|
+
block_id: ctx.createdPageId,
|
|
136
|
+
children: [
|
|
137
|
+
{ object: 'block', type: 'paragraph', paragraph: { rich_text: [{ type: 'text', text: { content: 'Edit me' } }] } },
|
|
138
|
+
],
|
|
139
|
+
})
|
|
140
|
+
const blockId = appended?.results?.[0]?.id || appended?.id
|
|
141
|
+
if (!blockId)
|
|
142
|
+
return expect(true).toBe(true)
|
|
143
|
+
|
|
144
|
+
const update_block = buildWrite('update_block')
|
|
145
|
+
const editedText = 'Edited'
|
|
146
|
+
const updated = await update_block({ block_id: blockId, body: { paragraph: { rich_text: [{ type: 'text', text: { content: editedText } }] } } })
|
|
147
|
+
expect(updated?.id).toBe(blockId)
|
|
148
|
+
|
|
149
|
+
// Verify via retrieve_block
|
|
150
|
+
const retrieve_block = buildRead('retrieve_block')
|
|
151
|
+
const gotBlock = await retrieve_block({ block_id: blockId })
|
|
152
|
+
const gotEdited = gotBlock?.paragraph?.rich_text?.some((t: any) => (t?.plain_text || t?.text?.content) === editedText)
|
|
153
|
+
expect(gotEdited).toBe(true)
|
|
154
|
+
|
|
155
|
+
const delete_block = buildWrite('delete_block')
|
|
156
|
+
const del = await delete_block({ block_id: blockId })
|
|
157
|
+
expect(del?.archived === true || del?.id === blockId).toBe(true)
|
|
158
|
+
|
|
159
|
+
// Verify archived via retrieve_block
|
|
160
|
+
const gotAfterDelete = await retrieve_block({ block_id: blockId })
|
|
161
|
+
expect(gotAfterDelete?.archived === true).toBe(true)
|
|
162
|
+
}, 90000)
|
|
163
|
+
|
|
164
|
+
it('create_database then update_database under created page (optional)', async () => {
|
|
165
|
+
if (!ctx.createdPageId)
|
|
166
|
+
return expect(true).toBe(true)
|
|
167
|
+
const create_database = buildWrite('create_database')
|
|
168
|
+
const created = await create_database({
|
|
169
|
+
parent: { page_id: ctx.createdPageId },
|
|
170
|
+
title: [{ type: 'text', text: { content: `CmdDB ${Date.now()}` } }],
|
|
171
|
+
properties: {
|
|
172
|
+
Name: { title: {} },
|
|
173
|
+
Status: { select: { options: [{ name: 'Open' }, { name: 'Done' }] } },
|
|
174
|
+
},
|
|
175
|
+
})
|
|
176
|
+
const dbId = created?.id
|
|
177
|
+
ctx.createdDatabaseId = dbId
|
|
178
|
+
expect(dbId).toBeTruthy()
|
|
179
|
+
|
|
180
|
+
const update_database = buildWrite('update_database')
|
|
181
|
+
const updated = await update_database({ database_id: dbId, title: [{ type: 'text', text: { content: 'CmdDB Updated' } }] })
|
|
182
|
+
expect(updated?.id).toBe(dbId)
|
|
183
|
+
|
|
184
|
+
// Verify via retrieve_database
|
|
185
|
+
const retrieve_database = buildRead('retrieve_database')
|
|
186
|
+
const gotDb = await retrieve_database({ database_id: dbId })
|
|
187
|
+
const titleText = gotDb?.title?.[0]?.plain_text || gotDb?.title?.[0]?.text?.content
|
|
188
|
+
expect(titleText?.includes('Updated')).toBe(true)
|
|
189
|
+
}, 120000)
|
|
190
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": {
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"token": {
|
|
6
|
+
"type": "string",
|
|
7
|
+
"title": "Internal Integration Token",
|
|
8
|
+
"description": "Notion internal integration token (starts with \"secret_\")."
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"required": ["token"],
|
|
12
|
+
"additionalProperties": false
|
|
13
|
+
},
|
|
14
|
+
"injection": {
|
|
15
|
+
"headers": {
|
|
16
|
+
"Authorization": "Bearer {{token}}",
|
|
17
|
+
"Notion-Version": "2022-06-28"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
1. Go to `https://www.notion.so/profile/integrations/internal`
|
|
2
|
+
2. Create a Notion integration in Notion’s developer settings
|
|
3
|
+
3. Share your target pages/databases with that integration so it has access
|
|
4
|
+
4. Copy the **Internal Integration Token** (usually starts with `secret_`)
|
|
5
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const res = await integration.fetch(`/pages`, {
|
|
3
|
+
method: 'POST',
|
|
4
|
+
body: {
|
|
5
|
+
parent: input.parent,
|
|
6
|
+
properties: input.properties,
|
|
7
|
+
children: input.children || undefined,
|
|
8
|
+
icon: input.icon || undefined,
|
|
9
|
+
cover: input.cover || undefined,
|
|
10
|
+
},
|
|
11
|
+
})
|
|
12
|
+
return await res.json()
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const params = new URLSearchParams()
|
|
3
|
+
if (input.start_cursor)
|
|
4
|
+
params.set('start_cursor', input.start_cursor)
|
|
5
|
+
if (input.page_size)
|
|
6
|
+
params.set('page_size', String(input.page_size))
|
|
7
|
+
const qs = params.toString()
|
|
8
|
+
const res = await integration.fetch(`/blocks/${encodeURIComponent(input.block_id)}/children${qs ? `?${qs}` : ''}`)
|
|
9
|
+
return await res.json()
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const params = new URLSearchParams()
|
|
3
|
+
if (input.block_id)
|
|
4
|
+
params.set('block_id', input.block_id)
|
|
5
|
+
if (input.discussion_id)
|
|
6
|
+
params.set('discussion_id', input.discussion_id)
|
|
7
|
+
if (input.start_cursor)
|
|
8
|
+
params.set('start_cursor', input.start_cursor)
|
|
9
|
+
if (input.page_size)
|
|
10
|
+
params.set('page_size', String(input.page_size))
|
|
11
|
+
const qs = params.toString()
|
|
12
|
+
const res = await integration.fetch(`/comments${qs ? `?${qs}` : ''}`)
|
|
13
|
+
return await res.json()
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const params = new URLSearchParams()
|
|
3
|
+
if (input.start_cursor)
|
|
4
|
+
params.set('start_cursor', input.start_cursor)
|
|
5
|
+
if (input.page_size)
|
|
6
|
+
params.set('page_size', String(input.page_size))
|
|
7
|
+
const qs = params.toString()
|
|
8
|
+
const res = await integration.fetch(`/users${qs ? `?${qs}` : ''}`)
|
|
9
|
+
return await res.json()
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const body = {
|
|
3
|
+
filter: input.filter || undefined,
|
|
4
|
+
sorts: input.sorts || undefined,
|
|
5
|
+
start_cursor: input.start_cursor || undefined,
|
|
6
|
+
page_size: input.page_size || undefined,
|
|
7
|
+
}
|
|
8
|
+
const res = await integration.fetch(`/databases/${encodeURIComponent(input.database_id)}/query`, { method: 'POST', body })
|
|
9
|
+
return await res.json()
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const params = new URLSearchParams()
|
|
3
|
+
if (input.start_cursor)
|
|
4
|
+
params.set('start_cursor', input.start_cursor)
|
|
5
|
+
if (input.page_size)
|
|
6
|
+
params.set('page_size', String(input.page_size))
|
|
7
|
+
const qs = params.toString()
|
|
8
|
+
const res = await integration.fetch(`/pages/${encodeURIComponent(input.page_id)}/properties/${encodeURIComponent(input.property_id)}${qs ? `?${qs}` : ''}`)
|
|
9
|
+
return await res.json()
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const body = {
|
|
3
|
+
query: input.query || '',
|
|
4
|
+
filter: input.filter || undefined,
|
|
5
|
+
sort: input.sort || undefined,
|
|
6
|
+
start_cursor: input.start_cursor || undefined,
|
|
7
|
+
page_size: input.page_size || undefined,
|
|
8
|
+
}
|
|
9
|
+
const res = await integration.fetch(`/search`, { method: 'POST', body })
|
|
10
|
+
return await res.json()
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const body = {
|
|
3
|
+
title: input.title || undefined,
|
|
4
|
+
description: input.description || undefined,
|
|
5
|
+
properties: input.properties || undefined,
|
|
6
|
+
archived: input.archived === undefined ? undefined : input.archived,
|
|
7
|
+
}
|
|
8
|
+
const res = await integration.fetch(`/databases/${encodeURIComponent(input.database_id)}`, { method: 'PATCH', body })
|
|
9
|
+
return await res.json()
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
async (input) => {
|
|
2
|
+
const body = {
|
|
3
|
+
properties: input.properties,
|
|
4
|
+
archived: input.archived === undefined ? undefined : input.archived,
|
|
5
|
+
icon: input.icon || undefined,
|
|
6
|
+
cover: input.cover || undefined,
|
|
7
|
+
}
|
|
8
|
+
const res = await integration.fetch(`/pages/${encodeURIComponent(input.page_id)}`, { method: 'PATCH', body })
|
|
9
|
+
return await res.json()
|
|
10
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "notion",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"tools": [
|
|
5
|
+
{
|
|
6
|
+
"name": "search",
|
|
7
|
+
"description": "Search across all accessible Notion content (pages, databases).",
|
|
8
|
+
"inputSchema": "schemas/search.json",
|
|
9
|
+
"handler": "handlers/search.js",
|
|
10
|
+
"scope": "read"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "retrieve_page",
|
|
14
|
+
"description": "Retrieve a page by ID.",
|
|
15
|
+
"inputSchema": "schemas/id_page.json",
|
|
16
|
+
"handler": "handlers/retrieve_page.js",
|
|
17
|
+
"scope": "read"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "retrieve_database",
|
|
21
|
+
"description": "Retrieve a database by ID.",
|
|
22
|
+
"inputSchema": "schemas/id_database.json",
|
|
23
|
+
"handler": "handlers/retrieve_database.js",
|
|
24
|
+
"scope": "read"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "query_database",
|
|
28
|
+
"description": "Query a database with optional filter, sorts, and pagination.",
|
|
29
|
+
"inputSchema": "schemas/query_database.json",
|
|
30
|
+
"handler": "handlers/query_database.js",
|
|
31
|
+
"scope": "read"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "list_block_children",
|
|
35
|
+
"description": "List child blocks for a block (including page blocks).",
|
|
36
|
+
"inputSchema": "schemas/list_block_children.json",
|
|
37
|
+
"handler": "handlers/list_block_children.js",
|
|
38
|
+
"scope": "read"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "retrieve_block",
|
|
42
|
+
"description": "Retrieve a block by ID.",
|
|
43
|
+
"inputSchema": "schemas/id_block.json",
|
|
44
|
+
"handler": "handlers/retrieve_block.js",
|
|
45
|
+
"scope": "read"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "list_users",
|
|
49
|
+
"description": "List users in the workspace.",
|
|
50
|
+
"inputSchema": "schemas/list_users.json",
|
|
51
|
+
"handler": "handlers/list_users.js",
|
|
52
|
+
"scope": "read"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"name": "retrieve_user",
|
|
56
|
+
"description": "Retrieve a user by ID.",
|
|
57
|
+
"inputSchema": "schemas/id_user.json",
|
|
58
|
+
"handler": "handlers/retrieve_user.js",
|
|
59
|
+
"scope": "read"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "list_comments",
|
|
63
|
+
"description": "List comments for a given discussion or page block.",
|
|
64
|
+
"inputSchema": "schemas/list_comments.json",
|
|
65
|
+
"handler": "handlers/list_comments.js",
|
|
66
|
+
"scope": "read"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"name": "get_me",
|
|
70
|
+
"description": "Retrieve the authenticated user (bot) profile.",
|
|
71
|
+
"inputSchema": "schemas/empty.json",
|
|
72
|
+
"handler": "handlers/get_me.js",
|
|
73
|
+
"scope": "read"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "retrieve_page_property_item",
|
|
77
|
+
"description": "Retrieve a specific page property item (handles rollups and pagination).",
|
|
78
|
+
"inputSchema": "schemas/retrieve_page_property_item.json",
|
|
79
|
+
"handler": "handlers/retrieve_page_property_item.js",
|
|
80
|
+
"scope": "read"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "create_page",
|
|
84
|
+
"description": "Create a new page in a database or as a child of a page.",
|
|
85
|
+
"inputSchema": "schemas/create_page.json",
|
|
86
|
+
"handler": "handlers/create_page.js",
|
|
87
|
+
"scope": "write"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"name": "update_page_properties",
|
|
91
|
+
"description": "Update page properties, archive/unarchive, icon and cover.",
|
|
92
|
+
"inputSchema": "schemas/update_page_properties.json",
|
|
93
|
+
"handler": "handlers/update_page_properties.js",
|
|
94
|
+
"scope": "write"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"name": "append_block_children",
|
|
98
|
+
"description": "Append child blocks to a block (including page blocks).",
|
|
99
|
+
"inputSchema": "schemas/append_block_children.json",
|
|
100
|
+
"handler": "handlers/append_block_children.js",
|
|
101
|
+
"scope": "write"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"name": "update_block",
|
|
105
|
+
"description": "Update a block (content, archived state, etc).",
|
|
106
|
+
"inputSchema": "schemas/update_block.json",
|
|
107
|
+
"handler": "handlers/update_block.js",
|
|
108
|
+
"scope": "write"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
"name": "delete_block",
|
|
112
|
+
"description": "Archive a block (soft delete).",
|
|
113
|
+
"inputSchema": "schemas/delete_block.json",
|
|
114
|
+
"handler": "handlers/delete_block.js",
|
|
115
|
+
"scope": "write"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "create_comment",
|
|
119
|
+
"description": "Create a comment on a discussion or block.",
|
|
120
|
+
"inputSchema": "schemas/create_comment.json",
|
|
121
|
+
"handler": "handlers/create_comment.js",
|
|
122
|
+
"scope": "write"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"name": "create_database",
|
|
126
|
+
"description": "Create a new database under a page.",
|
|
127
|
+
"inputSchema": "schemas/create_database.json",
|
|
128
|
+
"handler": "handlers/create_database.js",
|
|
129
|
+
"scope": "write"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"name": "update_database",
|
|
133
|
+
"description": "Update database title, description, properties, or archived state.",
|
|
134
|
+
"inputSchema": "schemas/update_database.json",
|
|
135
|
+
"handler": "handlers/update_database.js",
|
|
136
|
+
"scope": "write"
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
## Appending paragraph blocks
|
|
2
|
+
|
|
3
|
+
When appending a paragraph block to a Notion page, ensure the `rich_text` field is correctly defined within the `paragraph` type. Example format:
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"block_id": "<page_id>",
|
|
8
|
+
"children": [
|
|
9
|
+
{
|
|
10
|
+
"object": "block",
|
|
11
|
+
"type": "paragraph",
|
|
12
|
+
"paragraph": {
|
|
13
|
+
"rich_text": [
|
|
14
|
+
{
|
|
15
|
+
"type": "text",
|
|
16
|
+
"text": {
|
|
17
|
+
"content": "Your text here"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": ["block_id", "children"],
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"block_id": { "type": "string" },
|
|
8
|
+
"children": { "type": "array", "items": { "type": "object" } }
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"required": ["parent", "rich_text"],
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"parent": {
|
|
8
|
+
"type": "object",
|
|
9
|
+
"description": "Parent discussion_id or block_id.",
|
|
10
|
+
"additionalProperties": false,
|
|
11
|
+
"properties": {
|
|
12
|
+
"discussion_id": { "type": "string" },
|
|
13
|
+
"block_id": { "type": "string" }
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"rich_text": { "type": "array", "items": { "type": "object" } }
|
|
17
|
+
}
|
|
18
|
+
}
|