@notionhq/client 5.14.0 → 5.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +45 -9
  2. package/build/package.json +1 -1
  3. package/build/src/Client.d.ts +7 -1
  4. package/build/src/Client.d.ts.map +1 -1
  5. package/build/src/Client.js +21 -5
  6. package/build/src/Client.js.map +1 -1
  7. package/build/src/api-endpoints/blocks.d.ts +1010 -0
  8. package/build/src/api-endpoints/blocks.d.ts.map +1 -0
  9. package/build/src/api-endpoints/blocks.js +90 -0
  10. package/build/src/api-endpoints/blocks.js.map +1 -0
  11. package/build/src/api-endpoints/comments.d.ts +112 -0
  12. package/build/src/api-endpoints/comments.d.ts.map +1 -0
  13. package/build/src/api-endpoints/comments.js +42 -0
  14. package/build/src/api-endpoints/comments.js.map +1 -0
  15. package/build/src/api-endpoints/common.d.ts +1976 -0
  16. package/build/src/api-endpoints/common.d.ts.map +1 -0
  17. package/build/src/api-endpoints/common.js +5 -0
  18. package/build/src/api-endpoints/common.js.map +1 -0
  19. package/build/src/api-endpoints/custom-emojis.d.ts +26 -0
  20. package/build/src/api-endpoints/custom-emojis.d.ts.map +1 -0
  21. package/build/src/api-endpoints/custom-emojis.js +16 -0
  22. package/build/src/api-endpoints/custom-emojis.js.map +1 -0
  23. package/build/src/api-endpoints/data-sources.d.ts +430 -0
  24. package/build/src/api-endpoints/data-sources.d.ts.map +1 -0
  25. package/build/src/api-endpoints/data-sources.js +64 -0
  26. package/build/src/api-endpoints/data-sources.js.map +1 -0
  27. package/build/src/api-endpoints/databases.d.ts +109 -0
  28. package/build/src/api-endpoints/databases.d.ts.map +1 -0
  29. package/build/src/api-endpoints/databases.js +53 -0
  30. package/build/src/api-endpoints/databases.js.map +1 -0
  31. package/build/src/api-endpoints/file-uploads.d.ts +138 -0
  32. package/build/src/api-endpoints/file-uploads.d.ts.map +1 -0
  33. package/build/src/api-endpoints/file-uploads.js +63 -0
  34. package/build/src/api-endpoints/file-uploads.js.map +1 -0
  35. package/build/src/api-endpoints/oauth.d.ts +90 -0
  36. package/build/src/api-endpoints/oauth.d.ts.map +1 -0
  37. package/build/src/api-endpoints/oauth.js +42 -0
  38. package/build/src/api-endpoints/oauth.js.map +1 -0
  39. package/build/src/api-endpoints/pages.d.ts +639 -0
  40. package/build/src/api-endpoints/pages.d.ts.map +1 -0
  41. package/build/src/api-endpoints/pages.js +102 -0
  42. package/build/src/api-endpoints/pages.js.map +1 -0
  43. package/build/src/api-endpoints/search.d.ts +36 -0
  44. package/build/src/api-endpoints/search.d.ts.map +1 -0
  45. package/build/src/api-endpoints/search.js +16 -0
  46. package/build/src/api-endpoints/search.js.map +1 -0
  47. package/build/src/api-endpoints/users.d.ts +53 -0
  48. package/build/src/api-endpoints/users.d.ts.map +1 -0
  49. package/build/src/api-endpoints/users.js +36 -0
  50. package/build/src/api-endpoints/users.js.map +1 -0
  51. package/build/src/api-endpoints/views.d.ts +504 -0
  52. package/build/src/api-endpoints/views.d.ts.map +1 -0
  53. package/build/src/api-endpoints/views.js +86 -0
  54. package/build/src/api-endpoints/views.js.map +1 -0
  55. package/build/src/api-endpoints/webhooks.d.ts +302 -0
  56. package/build/src/api-endpoints/webhooks.d.ts.map +1 -0
  57. package/build/src/api-endpoints/webhooks.js +5 -0
  58. package/build/src/api-endpoints/webhooks.js.map +1 -0
  59. package/build/src/api-endpoints.d.ts +13 -4916
  60. package/build/src/api-endpoints.d.ts.map +1 -1
  61. package/build/src/api-endpoints.js +31 -533
  62. package/build/src/api-endpoints.js.map +1 -1
  63. package/build/src/constants.d.ts +32 -0
  64. package/build/src/constants.d.ts.map +1 -0
  65. package/build/src/constants.js +35 -0
  66. package/build/src/constants.js.map +1 -0
  67. package/build/src/errors.d.ts +2 -1
  68. package/build/src/errors.d.ts.map +1 -1
  69. package/build/src/errors.js +3 -0
  70. package/build/src/errors.js.map +1 -1
  71. package/build/src/index.d.ts +2 -1
  72. package/build/src/index.d.ts.map +1 -1
  73. package/build/src/index.js +8 -1
  74. package/build/src/index.js.map +1 -1
  75. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"views.js","sourceRoot":"","sources":["../../../src/api-endpoints/views.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C;;;AA8zB/C;;GAEG;AACU,QAAA,iBAAiB,GAAG;IAC/B,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,CAAC,aAAa,EAAE,gBAAgB,EAAE,cAAc,EAAE,WAAW,CAAC;IAC3E,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,GAAW,EAAE,CAAC,OAAO;CACnB,CAAA;AAUV;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,GAAW,EAAE,CAAC,OAAO;CACnB,CAAA;AAaV;;GAEG;AACU,QAAA,OAAO,GAAG;IACrB,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,SAAS,CAAC;IACvB,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAAwB,EAAU,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;CACxD,CAAA;AAgBV;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,OAAO;IACf,UAAU,EAAE,CAAC,SAAS,CAAC;IACvB,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA2B,EAAU,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;CAC3D,CAAA;AAWV;;GAEG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,CAAC,SAAS,CAAC;IACvB,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAA2B,EAAU,EAAE,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE;CAC3D,CAAA;AAcV;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,CAAC,SAAS,CAAC;IACvB,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAAgC,EAAU,EAAE,CACjD,SAAS,CAAC,CAAC,OAAO,UAAU;CACtB,CAAA;AA+BV;;GAEG;AACU,QAAA,mBAAmB,GAAG;IACjC,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IACnC,WAAW,EAAE,CAAC,cAAc,EAAE,WAAW,CAAC;IAC1C,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAAoC,EAAU,EAAE,CACrD,SAAS,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,EAAE;CACpC,CAAA;AAaV;;GAEG;AACU,QAAA,eAAe,GAAG;IAC7B,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,CAAC,SAAS,EAAE,UAAU,CAAC;IACnC,WAAW,EAAE,EAAE;IACf,UAAU,EAAE,EAAE;IAEd,IAAI,EAAE,CAAC,CAAgC,EAAU,EAAE,CACjD,SAAS,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC,QAAQ,EAAE;CACpC,CAAA","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type {\n CreateViewQueryRequest,\n CreateViewRequest,\n DataSourceViewReferenceResponse,\n DatabaseParentResponse,\n EmptyObject,\n IdRequest,\n IdResponse,\n PartialPageObjectResponse,\n PartialUserObjectResponse,\n UpdateViewRequest,\n} from \"./common\"\n\ntype BoardViewConfigResponse = {\n // The view configuration type.\n type: \"board\"\n // Column (horizontal) grouping - required for board view.\n group_by: GroupByConfigResponse\n // Sub-grouping (vertical swimlanes within columns).\n sub_group_by?: GroupByConfigResponse\n // Properties to display on each card.\n properties?: Array<ViewPropertyConfigResponse>\n // Card cover/preview image configuration.\n cover?: CoverConfigResponse\n // Cover image size.\n cover_size?: \"small\" | \"medium\" | \"large\"\n // Cover image aspect ratio.\n cover_aspect?: \"contain\" | \"cover\"\n // Card layout mode (list shows all properties, compact shows inline).\n card_layout?: \"list\" | \"compact\"\n}\n\ntype CalendarViewConfigResponse = {\n // The view configuration type.\n type: \"calendar\"\n // Date property used to position items on the calendar - required.\n date_property_id: string\n // Date property name (convenience field).\n date_property_name?: string\n // Properties to display on calendar event cards.\n properties?: Array<ViewPropertyConfigResponse>\n // Calendar view range.\n view_range?: \"week\" | \"month\"\n // Whether to show weekend days.\n show_weekends?: boolean\n}\n\ntype ChartAggregationResponse = {\n // The aggregation operator. \"count\" counts all rows and does not require a property_id.\n // All other operators require a property_id.\n aggregator:\n | \"count\"\n | \"count_values\"\n | \"sum\"\n | \"average\"\n | \"median\"\n | \"min\"\n | \"max\"\n | \"range\"\n | \"unique\"\n | \"empty\"\n | \"not_empty\"\n | \"percent_empty\"\n | \"percent_not_empty\"\n | \"checked\"\n | \"unchecked\"\n | \"percent_checked\"\n | \"percent_unchecked\"\n | \"earliest_date\"\n | \"latest_date\"\n | \"date_range\"\n // The property to aggregate on. Required for all operators except \"count\".\n property_id?: string\n}\n\ntype ChartReferenceLineResponse = {\n // Unique identifier for the reference line.\n id: string\n // The y-axis value where the reference line is drawn.\n value: number\n // Label displayed alongside the reference line.\n label: string\n // Color of the reference line.\n color:\n | \"gray\"\n | \"lightgray\"\n | \"brown\"\n | \"yellow\"\n | \"orange\"\n | \"green\"\n | \"blue\"\n | \"purple\"\n | \"pink\"\n | \"red\"\n // Line style: \"solid\" for a continuous line, \"dash\" for a dashed line.\n dash_style: \"solid\" | \"dash\"\n}\n\ntype ChartViewConfigResponse = {\n // The view configuration type.\n type: \"chart\"\n // The chart type: column (vertical bars), bar (horizontal bars), line, donut, or number\n // (single value display).\n chart_type: \"column\" | \"bar\" | \"line\" | \"donut\" | \"number\"\n // X-axis grouping configuration for column/bar/line/donut charts using grouped data.\n // Null when using results (raw property values) mode.\n x_axis?: GroupByConfigResponse | null\n // Y-axis aggregation for column/bar/line/donut charts using grouped data. Null when\n // using results mode.\n y_axis?: ChartAggregationResponse | null\n // Property ID for the x-axis name values when using results (raw property values) mode.\n x_axis_property_id?: string\n // Property ID for the y-axis numeric values when using results (raw property values)\n // mode.\n y_axis_property_id?: string\n // Aggregation configuration for number charts (single value display).\n value?: ChartAggregationResponse\n // Sort order for chart data.\n sort?:\n | \"manual\"\n | \"x_ascending\"\n | \"x_descending\"\n | \"y_ascending\"\n | \"y_descending\"\n // Color theme for the chart.\n color_theme?:\n | \"gray\"\n | \"blue\"\n | \"yellow\"\n | \"green\"\n | \"purple\"\n | \"teal\"\n | \"orange\"\n | \"pink\"\n | \"red\"\n | \"auto\"\n | \"colorful\"\n // Chart height.\n height?: \"small\" | \"medium\" | \"large\" | \"extra_large\"\n // Whether to hide groups with no data on the x-axis.\n hide_empty_groups?: boolean\n // Legend display position. \"off\" hides the legend.\n legend_position?: \"off\" | \"bottom\" | \"side\"\n // Whether to show data value labels on chart elements.\n show_data_labels?: boolean\n // Which axis labels to display.\n axis_labels?: \"none\" | \"x_axis\" | \"y_axis\" | \"both\"\n // Which grid lines to display.\n grid_lines?: \"none\" | \"horizontal\" | \"vertical\" | \"both\"\n // Whether to show cumulative values (line charts only).\n cumulative?: boolean\n // Whether to use smooth curves (line charts only).\n smooth_line?: boolean\n // Whether to hide the shaded area under the line (line charts only).\n hide_line_fill_area?: boolean\n // How grouped/stacked bars are displayed. \"normal\" stacks values, \"percent\" normalizes\n // to 100%, \"side_by_side\" places bars next to each other.\n group_style?: \"normal\" | \"percent\" | \"side_by_side\"\n // Custom minimum value for the y-axis. Null clears the override.\n y_axis_min?: number | null\n // Custom maximum value for the y-axis. Null clears the override.\n y_axis_max?: number | null\n // What to display on donut chart slices.\n donut_labels?: \"none\" | \"value\" | \"name\" | \"name_and_value\"\n // Whether to hide the title label (number charts only).\n hide_title?: boolean\n // Stack-by grouping configuration for stacked/grouped bar charts (column/bar/line only).\n // Null when not stacked.\n stack_by?: GroupByConfigResponse | null\n // Reference lines drawn on the chart. Null when no reference lines are configured.\n reference_lines?: Array<ChartReferenceLineResponse> | null\n // Text caption displayed below the chart. Null when no caption is shown.\n caption?: string | null\n // Whether chart elements are colored by their numeric value (gradient coloring).\n color_by_value?: boolean\n}\n\ntype CheckboxGroupByConfigResponse = {\n // The property type for grouping.\n type: \"checkbox\"\n // Property ID to group by.\n property_id: string\n // Sort order for groups (only manual for checkbox).\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n}\n\ntype CoverConfigResponse = {\n // Source of the cover image.\n type: \"page_cover\" | \"page_content\" | \"page_content_first\" | \"property\"\n // Property ID when type is \"property\".\n property_id?: string\n}\n\nexport type DashboardRowResponse = {\n // The ID of this row module.\n id: string\n // The widget modules within this row.\n widgets: Array<DashboardWidgetResponse>\n // Fixed height of the row in pixels.\n height?: number\n}\n\ntype DashboardViewConfigResponse = {\n // The view configuration type.\n type: \"dashboard\"\n // The rows that make up the dashboard layout. Each row contains one or more widget\n // modules.\n rows: Array<DashboardRowResponse>\n}\n\nexport type DashboardWidgetResponse = {\n // The ID of this widget module.\n id: string\n // The ID of the collection view rendered by this widget.\n view_id: string\n // Width of the widget in a 12-column grid (1-12). 12 means full width.\n width?: number\n // The 0-based index of the row this widget belongs to. Widgets in the same row share the\n // same row_index.\n row_index?: number\n}\n\nexport type DataSourceViewObjectResponse = {\n // The object type name.\n object: \"view\"\n // The ID of the view.\n id: IdResponse\n // The parent database of the view.\n parent: DatabaseParentResponse\n // The name of the view.\n name: string\n // The view type.\n type:\n | \"table\"\n | \"board\"\n | \"list\"\n | \"calendar\"\n | \"timeline\"\n | \"gallery\"\n | \"form\"\n | \"chart\"\n | \"map\"\n | \"dashboard\"\n // The time when the view was created.\n created_time: string\n // The time when the view was last edited.\n last_edited_time: string\n // Canonical deep link to the view in Notion.\n url: string\n // The ID of the data source this view is scoped to, or null for dashboard views.\n data_source_id?: string | null\n // The user who created the view, or null if not available.\n created_by?: PartialUserObjectResponse | null\n // The user who last edited the view, or null if not available.\n last_edited_by?: PartialUserObjectResponse | null\n // The filter applied to this view (same shape as data source query filter).\n filter?: ViewFilterResponse | null\n // The sorts applied to this view (same shape as data source query sorts).\n sorts?: Array<ViewSortResponse> | null\n // Quick filters pinned to the view's filter bar. Keys are property IDs. Values are\n // filter conditions (same shape as a property filter without the property field). Null\n // when no quick filters are set.\n quick_filters?: Record<string, QuickFilterConditionResponse> | null\n // View presentation configuration.\n configuration?: ViewConfigResponse | null\n // For dashboard widget views, the ID of the parent dashboard view. Only present when\n // this view is a widget inside a dashboard.\n dashboard_view_id?: string\n}\n\ntype DateGroupByConfigResponse = {\n // The property type for grouping.\n type: \"date\" | \"created_time\" | \"last_edited_time\"\n // Property ID to group by.\n property_id: string\n // Granularity for date grouping.\n group_by: \"relative\" | \"day\" | \"week\" | \"month\" | \"year\"\n // Sort order for groups (no manual sort for dates).\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n // Start day of week for week grouping (0 = Sunday, 1 = Monday).\n start_day_of_week?: 0 | 1\n}\n\nexport type DeletedViewQueryResponse = {\n // The object type.\n object: \"view_query\"\n // The ID of the deleted view query.\n id: IdResponse\n // Whether the view query was deleted.\n deleted: boolean\n}\n\ntype FormViewConfigResponse = {\n // The view configuration type.\n type: \"form\"\n // Whether the form is closed for submissions.\n is_form_closed?: boolean\n // Whether anonymous (non-logged-in) submissions are allowed.\n anonymous_submissions?: boolean\n // Permission level granted to the submitter on the created page after form submission.\n submission_permissions?:\n | \"none\"\n | \"comment_only\"\n | \"reader\"\n | \"read_and_write\"\n | \"editor\"\n}\n\ntype FormulaCheckboxSubGroupByResponse = {\n // The formula result type for grouping.\n type: \"checkbox\"\n // Sort order for groups (only manual for checkbox).\n sort: GroupSortResponse\n}\n\ntype FormulaDateSubGroupByResponse = {\n // The formula result type for grouping.\n type: \"date\"\n // Granularity for date grouping.\n group_by: \"relative\" | \"day\" | \"week\" | \"month\" | \"year\"\n // Sort order for groups.\n sort: GroupSortResponse\n // Start day of week for week grouping (0 = Sunday, 1 = Monday).\n start_day_of_week?: 0 | 1\n}\n\ntype FormulaGroupByConfigResponse = {\n // The property type for grouping.\n type: \"formula\"\n // Property ID of the formula to group by.\n property_id: string\n // Sub-group-by configuration based on the formula result type.\n group_by: FormulaSubGroupByResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n}\n\ntype FormulaNumberSubGroupByResponse = {\n // The formula result type for grouping.\n type: \"number\"\n // Sort order for groups (ascending or descending only).\n sort: GroupSortResponse\n // Start of the range for number grouping buckets.\n range_start?: number\n // End of the range for number grouping buckets.\n range_end?: number\n // Size of each bucket in number grouping.\n range_size?: number\n}\n\n/**\n * Sub-group-by configuration for formula properties based on result type.\n */\ntype FormulaSubGroupByResponse =\n | FormulaDateSubGroupByResponse\n | FormulaTextSubGroupByResponse\n | FormulaNumberSubGroupByResponse\n | FormulaCheckboxSubGroupByResponse\n\ntype FormulaTextSubGroupByResponse = {\n // The formula result type for grouping.\n type: \"text\"\n // How to group text values. \"exact\" = exact match, \"alphabet_prefix\" = first letter.\n group_by: \"exact\" | \"alphabet_prefix\"\n // Sort order for groups.\n sort: GroupSortResponse\n}\n\ntype GalleryViewConfigResponse = {\n // The view configuration type.\n type: \"gallery\"\n // Properties to display on gallery cards.\n properties?: Array<ViewPropertyConfigResponse>\n // Card cover/preview image configuration.\n cover?: CoverConfigResponse\n // Cover image size.\n cover_size?: \"small\" | \"medium\" | \"large\"\n // Cover image aspect ratio.\n cover_aspect?: \"contain\" | \"cover\"\n // Card layout mode (list shows all properties, compact shows inline).\n card_layout?: \"list\" | \"compact\"\n}\n\n/**\n * Group-by configuration based on property type.\n */\ntype GroupByConfigResponse =\n | SelectGroupByConfigResponse\n | StatusGroupByConfigResponse\n | PersonGroupByConfigResponse\n | RelationGroupByConfigResponse\n | DateGroupByConfigResponse\n | TextGroupByConfigResponse\n | NumberGroupByConfigResponse\n | CheckboxGroupByConfigResponse\n | FormulaGroupByConfigResponse\n\ntype GroupSortResponse = {\n // Sort direction for groups.\n type: \"manual\" | \"ascending\" | \"descending\"\n}\n\ntype ListViewConfigResponse = {\n // The view configuration type.\n type: \"list\"\n // Properties to display in list items.\n properties?: Array<ViewPropertyConfigResponse>\n}\n\ntype MapViewConfigResponse = {\n // The view configuration type.\n type: \"map\"\n // Map display height.\n height?: \"small\" | \"medium\" | \"large\" | \"extra_large\"\n // Property ID of the location property used to position items on the map.\n map_by?: string\n // Map-by property name (convenience field).\n map_by_property_name?: string\n // Properties to display on map pin cards.\n properties?: Array<ViewPropertyConfigResponse>\n}\n\ntype NumberGroupByConfigResponse = {\n // The property type for grouping.\n type: \"number\"\n // Property ID to group by.\n property_id: string\n // Sort order for groups (ascending or descending only).\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n // Start of the range for number grouping buckets.\n range_start?: number\n // End of the range for number grouping buckets.\n range_end?: number\n // Size of each bucket in number grouping.\n range_size?: number\n}\n\ntype PageReferenceResponse = {\n // The object type.\n object: string\n // The object ID.\n id: IdResponse\n}\n\nexport type PartialDataSourceViewObjectResponse = {\n // The object type name.\n object: \"view\"\n // The ID of the view.\n id: IdResponse\n // The parent database of the view.\n parent: DatabaseParentResponse\n // The view type.\n type:\n | \"table\"\n | \"board\"\n | \"list\"\n | \"calendar\"\n | \"timeline\"\n | \"gallery\"\n | \"form\"\n | \"chart\"\n | \"map\"\n | \"dashboard\"\n}\n\ntype PersonGroupByConfigResponse = {\n // The property type for grouping.\n type: \"person\" | \"created_by\" | \"last_edited_by\"\n // Property ID to group by.\n property_id: string\n // Sort order for groups (only manual supported).\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n}\n\ntype PropertySortResponse = {\n // The name or ID of the property to sort by.\n property: string\n // Sort direction.\n direction: \"ascending\" | \"descending\"\n}\n\n/**\n * A property filter condition. Same shape as a property filter but without the\n * \"property\" field. For example: { \"select\": { \"equals\": \"High\" } }.\n */\ntype QuickFilterConditionResponse = Record<string, never>\n\ntype RelationGroupByConfigResponse = {\n // The property type for grouping.\n type: \"relation\"\n // Property ID to group by.\n property_id: string\n // Sort order for groups.\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n}\n\ntype SelectGroupByConfigResponse = {\n // The property type for grouping.\n type: \"select\" | \"multi_select\"\n // Property ID to group by.\n property_id: string\n // Sort order for groups.\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n}\n\ntype StatusGroupByConfigResponse = {\n // The property type for grouping.\n type: \"status\"\n // Property ID to group by.\n property_id: string\n // How to group status values. \"group\" groups by status group (To Do/In Progress/Done),\n // \"option\" groups by individual option.\n group_by: \"group\" | \"option\"\n // Sort order for groups.\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n}\n\ntype SubtaskConfigResponse = {\n // Relation property ID used for parent-child nesting.\n property_id?: string\n // How sub-items are displayed. \"show\" renders hierarchically with toggles, \"hidden\"\n // shows parents with a count, \"flattened\" shows sub-items with a parent indicator,\n // \"disabled\" turns off sub-item rendering.\n display_mode?: \"show\" | \"hidden\" | \"flattened\" | \"disabled\"\n // Which items are included when filtering. \"parents\" includes parent items only,\n // \"parents_and_subitems\" includes both, \"subitems\" includes sub-items only.\n filter_scope?: \"parents\" | \"parents_and_subitems\" | \"subitems\"\n // Property ID of the column showing the sub-item expand/collapse toggle.\n toggle_column_id?: string\n}\n\ntype TableViewConfigResponse = {\n // The view configuration type.\n type: \"table\"\n // Columns/properties visible in the table view.\n properties?: Array<ViewPropertyConfigResponse>\n // Vertical (row) grouping configuration.\n group_by?: GroupByConfigResponse\n // Sub-item (subtask) display configuration.\n subtasks?: SubtaskConfigResponse\n // Whether to wrap cell content by default.\n wrap_cells?: boolean\n // Index of the last frozen column. Columns up to and including this index are frozen.\n frozen_column_index?: number\n // Whether to show vertical lines between columns.\n show_vertical_lines?: boolean\n}\n\ntype TextGroupByConfigResponse = {\n // The property type for grouping.\n type: \"text\" | \"title\" | \"url\" | \"email\" | \"phone_number\"\n // Property ID to group by.\n property_id: string\n // How to group text values. \"exact\" = exact match, \"alphabet_prefix\" = first letter.\n group_by: \"exact\" | \"alphabet_prefix\"\n // Sort order for groups.\n sort: GroupSortResponse\n // Property name (convenience field).\n property_name?: string\n // Whether to hide groups that have no items.\n hide_empty_groups?: boolean\n}\n\ntype TimelineArrowsByResponse = {\n // Relation property ID used for dependency arrows.\n property_id?: string | null\n}\n\ntype TimelinePreferenceResponse = {\n // Zoom level for the timeline.\n zoom_level:\n | \"hours\"\n | \"day\"\n | \"week\"\n | \"bi_week\"\n | \"month\"\n | \"quarter\"\n | \"year\"\n | \"5_years\"\n // Center timestamp for the timeline view (Unix timestamp in ms).\n center_timestamp?: number\n}\n\ntype TimelineViewConfigResponse = {\n // The view configuration type.\n type: \"timeline\"\n // Start date property - required.\n date_property_id: string\n // Start date property name (convenience field).\n date_property_name?: string\n // End date property (optional, for items that span a range).\n end_date_property_id?: string\n // End date property name (convenience field).\n end_date_property_name?: string\n // Properties to display on timeline items.\n properties?: Array<ViewPropertyConfigResponse>\n // Whether to show the table panel alongside the timeline.\n show_table?: boolean\n // Properties to display in the table panel (when show_table is true).\n table_properties?: Array<ViewPropertyConfigResponse>\n // Timeline zoom/preference state.\n preference?: TimelinePreferenceResponse\n // Dependency arrows configuration.\n arrows_by?: TimelineArrowsByResponse\n // Whether to color-code items by property.\n color_by?: boolean\n}\n\ntype TimestampSortResponse = {\n // The timestamp to sort by.\n timestamp: \"created_time\" | \"last_edited_time\"\n // Sort direction.\n direction: \"ascending\" | \"descending\"\n}\n\n/**\n * View configuration, typed by view type (table, board, calendar, etc.).\n */\ntype ViewConfigResponse =\n | TableViewConfigResponse\n | BoardViewConfigResponse\n | CalendarViewConfigResponse\n | TimelineViewConfigResponse\n | GalleryViewConfigResponse\n | ListViewConfigResponse\n | MapViewConfigResponse\n | FormViewConfigResponse\n | ChartViewConfigResponse\n | DashboardViewConfigResponse\n\n/**\n * Filter for the view. Can be a property filter (filter by property value), timestamp\n * filter (filter by created_time or last_edited_time), or compound filter (combine\n * filters with and/or logic). Compound filters support up to 2 levels of nesting.\n */\ntype ViewFilterResponse =\n | (Record<string, unknown> & {\n // The name or ID of the property to filter on.\n property: string\n })\n | (Record<string, unknown> & {\n // The timestamp to filter on.\n timestamp: \"created_time\" | \"last_edited_time\"\n })\n | {\n // Filters combined with OR logic.\n or?: Array<\n | (Record<string, unknown> & {\n // The name or ID of the property to filter on.\n property: string\n })\n | (Record<string, unknown> & {\n // The timestamp to filter on.\n timestamp: \"created_time\" | \"last_edited_time\"\n })\n | {\n // Filters combined with OR logic.\n or?: Array<\n | (Record<string, unknown> & {\n // The name or ID of the property to filter on.\n property: string\n })\n | (Record<string, unknown> & {\n // The timestamp to filter on.\n timestamp: \"created_time\" | \"last_edited_time\"\n })\n >\n // Filters combined with AND logic.\n and?: Array<\n | (Record<string, unknown> & {\n // The name or ID of the property to filter on.\n property: string\n })\n | (Record<string, unknown> & {\n // The timestamp to filter on.\n timestamp: \"created_time\" | \"last_edited_time\"\n })\n >\n }\n >\n // Filters combined with AND logic.\n and?: Array<\n | (Record<string, unknown> & {\n // The name or ID of the property to filter on.\n property: string\n })\n | (Record<string, unknown> & {\n // The timestamp to filter on.\n timestamp: \"created_time\" | \"last_edited_time\"\n })\n | {\n // Filters combined with OR logic.\n or?: Array<\n | (Record<string, unknown> & {\n // The name or ID of the property to filter on.\n property: string\n })\n | (Record<string, unknown> & {\n // The timestamp to filter on.\n timestamp: \"created_time\" | \"last_edited_time\"\n })\n >\n // Filters combined with AND logic.\n and?: Array<\n | (Record<string, unknown> & {\n // The name or ID of the property to filter on.\n property: string\n })\n | (Record<string, unknown> & {\n // The timestamp to filter on.\n timestamp: \"created_time\" | \"last_edited_time\"\n })\n >\n }\n >\n }\n\ntype ViewPropertyConfigResponse = {\n // Property ID (stable identifier).\n property_id: string\n // Property name (convenience field, not stable across renames).\n property_name?: string\n // Whether this property is visible in the view.\n visible?: boolean\n // Width of the property column in pixels (table view only).\n width?: number\n // Whether to wrap content in this property cell/card.\n wrap?: boolean\n // How to display status properties (as select dropdown or checkbox).\n status_show_as?: \"select\" | \"checkbox\"\n // Property width mode in compact card layouts (board/gallery).\n card_property_width_mode?: \"full_line\" | \"inline\"\n // Date display format (date properties only). \"full\" = localized full date, \"short\" =\n // month and day, \"month_day_year\" = MM/DD/YYYY, \"day_month_year\" = DD/MM/YYYY,\n // \"year_month_day\" = YYYY/MM/DD, \"relative\" = relative dates.\n date_format?:\n | \"full\"\n | \"short\"\n | \"month_day_year\"\n | \"day_month_year\"\n | \"year_month_day\"\n | \"relative\"\n // Time display format (date properties only). \"12_hour\" = 12-hour clock with AM/PM,\n // \"24_hour\" = 24-hour clock, \"hidden\" = hide time.\n time_format?: \"12_hour\" | \"24_hour\" | \"hidden\"\n}\n\nexport type ViewQueryResponse = {\n // The object type.\n object: \"view_query\"\n // The query ID.\n id: IdResponse\n // The view this query was executed against.\n view_id: IdResponse\n // When the cached query results expire.\n expires_at: string\n // Total number of results in the query.\n total_count: number\n // The page results for this page.\n results: Array<PageReferenceResponse>\n // Cursor for the next page of results.\n next_cursor: IdResponse | null\n // Whether there are more results.\n has_more: boolean\n}\n\n/**\n * Sort for the view. Can sort by property or timestamp.\n */\ntype ViewSortResponse = PropertySortResponse | TimestampSortResponse\n\ntype ListDatabaseViewsQueryParameters = {\n // ID of a Notion database (collection view block) to list views for. At least one of\n // database_id or data_source_id is required.\n database_id?: IdRequest\n // ID of a data source (collection) to list all views for, including linked views across\n // the workspace. At least one of database_id or data_source_id is required.\n data_source_id?: IdRequest\n // If supplied, this endpoint will return a page of results starting after the cursor\n // provided. If not supplied, this endpoint will return the first page of results.\n start_cursor?: string\n // The number of items from the full list desired in the response. Maximum: 100\n page_size?: number\n}\n\nexport type ListDatabaseViewsParameters = ListDatabaseViewsQueryParameters\n\nexport type ListDatabaseViewsResponse = {\n // Always `list`\n object: \"list\"\n next_cursor: IdResponse | null\n has_more: boolean\n results: Array<DataSourceViewReferenceResponse>\n // Always `view`\n type: \"view\"\n view: EmptyObject\n}\n\n/**\n * List views\n */\nexport const listDatabaseViews = {\n method: \"get\",\n pathParams: [],\n queryParams: [\"database_id\", \"data_source_id\", \"start_cursor\", \"page_size\"],\n bodyParams: [],\n\n path: (): string => `views`,\n} as const\n\ntype CreateViewBodyParameters = CreateViewRequest\n\nexport type CreateViewParameters = CreateViewBodyParameters\n\nexport type CreateViewResponse =\n | PartialDataSourceViewObjectResponse\n | DataSourceViewObjectResponse\n\n/**\n * Create a view\n */\nexport const createView = {\n method: \"post\",\n pathParams: [],\n queryParams: [],\n bodyParams: [],\n\n path: (): string => `views`,\n} as const\n\ntype GetViewPathParameters = {\n // ID of a Notion view.\n view_id: IdRequest\n}\n\nexport type GetViewParameters = GetViewPathParameters\n\nexport type GetViewResponse =\n | PartialDataSourceViewObjectResponse\n | DataSourceViewObjectResponse\n\n/**\n * Retrieve a view\n */\nexport const getView = {\n method: \"get\",\n pathParams: [\"view_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: GetViewPathParameters): string => `views/${p.view_id}`,\n} as const\n\ntype UpdateViewPathParameters = {\n // ID of a Notion view.\n view_id: IdRequest\n}\n\ntype UpdateViewBodyParameters = UpdateViewRequest\n\nexport type UpdateViewParameters = UpdateViewPathParameters &\n UpdateViewBodyParameters\n\nexport type UpdateViewResponse =\n | PartialDataSourceViewObjectResponse\n | DataSourceViewObjectResponse\n\n/**\n * Update a view\n */\nexport const updateView = {\n method: \"patch\",\n pathParams: [\"view_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: UpdateViewPathParameters): string => `views/${p.view_id}`,\n} as const\n\ntype DeleteViewPathParameters = {\n // The ID of the view to delete.\n view_id: IdRequest\n}\n\nexport type DeleteViewParameters = DeleteViewPathParameters\n\nexport type DeleteViewResponse = PartialDataSourceViewObjectResponse\n\n/**\n * Delete a view\n */\nexport const deleteView = {\n method: \"delete\",\n pathParams: [\"view_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: DeleteViewPathParameters): string => `views/${p.view_id}`,\n} as const\n\ntype CreateViewQueryPathParameters = {\n // The ID of the view.\n view_id: IdRequest\n}\n\ntype CreateViewQueryBodyParameters = CreateViewQueryRequest\n\nexport type CreateViewQueryParameters = CreateViewQueryPathParameters &\n CreateViewQueryBodyParameters\n\nexport type CreateViewQueryResponse = ViewQueryResponse\n\n/**\n * Create a view query\n */\nexport const createViewQuery = {\n method: \"post\",\n pathParams: [\"view_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: CreateViewQueryPathParameters): string =>\n `views/${p.view_id}/queries`,\n} as const\n\ntype GetViewQueryResultsPathParameters = {\n // The ID of the view.\n view_id: IdRequest\n // The ID of the query.\n query_id: IdRequest\n}\n\ntype GetViewQueryResultsQueryParameters = {\n // If supplied, this endpoint will return a page of results starting after the cursor\n // provided.\n start_cursor?: string\n // The number of results to return per page. Maximum: 100\n page_size?: number\n}\n\nexport type GetViewQueryResultsParameters = GetViewQueryResultsPathParameters &\n GetViewQueryResultsQueryParameters\n\nexport type GetViewQueryResultsResponse = {\n // Always `list`\n object: \"list\"\n next_cursor: IdResponse | null\n has_more: boolean\n results: Array<PartialPageObjectResponse>\n // Always `page`\n type: \"page\"\n page: EmptyObject\n}\n\n/**\n * Get view query results\n */\nexport const getViewQueryResults = {\n method: \"get\",\n pathParams: [\"view_id\", \"query_id\"],\n queryParams: [\"start_cursor\", \"page_size\"],\n bodyParams: [],\n\n path: (p: GetViewQueryResultsPathParameters): string =>\n `views/${p.view_id}/queries/${p.query_id}`,\n} as const\n\ntype DeleteViewQueryPathParameters = {\n // The ID of the view.\n view_id: IdRequest\n // The ID of the query.\n query_id: IdRequest\n}\n\nexport type DeleteViewQueryParameters = DeleteViewQueryPathParameters\n\nexport type DeleteViewQueryResponse = DeletedViewQueryResponse\n\n/**\n * Delete a view query\n */\nexport const deleteViewQuery = {\n method: \"delete\",\n pathParams: [\"view_id\", \"query_id\"],\n queryParams: [],\n bodyParams: [],\n\n path: (p: DeleteViewQueryPathParameters): string =>\n `views/${p.view_id}/queries/${p.query_id}`,\n} as const\n"]}
@@ -0,0 +1,302 @@
1
+ import type { EmptyObject, IdResponse } from "./common";
2
+ export type BaseWebhookPayload = {
3
+ id: string;
4
+ timestamp: string;
5
+ workspace_id: IdResponse;
6
+ workspace_name: string;
7
+ subscription_id: IdResponse;
8
+ integration_id: IdResponse;
9
+ authors: Array<{
10
+ id: IdResponse;
11
+ type: "person";
12
+ } | {
13
+ id: IdResponse;
14
+ type: "bot";
15
+ }>;
16
+ attempt_number: number;
17
+ api_version: "2022-06-28" | "2025-09-03" | "2026-03-11";
18
+ accessible_by?: Array<{
19
+ id: IdResponse;
20
+ type: "person";
21
+ } | {
22
+ id: IdResponse;
23
+ type: "bot";
24
+ }>;
25
+ };
26
+ export type CommentCreatedWebhookPayload = BaseWebhookPayload & {
27
+ type: "comment.created";
28
+ entity: WebhookCommentEntity;
29
+ data: {
30
+ parent: WebhookExternalBlock;
31
+ page_id: IdResponse;
32
+ };
33
+ };
34
+ export type CommentDeletedWebhookPayload = BaseWebhookPayload & {
35
+ type: "comment.deleted";
36
+ entity: WebhookCommentEntity;
37
+ data: {
38
+ parent: WebhookExternalBlock;
39
+ page_id: IdResponse;
40
+ };
41
+ };
42
+ export type CommentUpdatedWebhookPayload = BaseWebhookPayload & {
43
+ type: "comment.updated";
44
+ entity: WebhookCommentEntity;
45
+ data: {
46
+ parent: WebhookExternalBlock;
47
+ page_id: IdResponse;
48
+ };
49
+ };
50
+ export type DataSourceContentUpdatedWebhookPayload = BaseWebhookPayload & {
51
+ type: "data_source.content_updated";
52
+ entity: WebhookDatabaseEventEntity;
53
+ data: {
54
+ parent: WebhookParentBlock;
55
+ updated_blocks: Array<WebhookUpdatedBlock>;
56
+ };
57
+ };
58
+ export type DataSourceCreatedWebhookPayload = BaseWebhookPayload & {
59
+ type: "data_source.created";
60
+ entity: WebhookDatabaseEventEntity;
61
+ data: {
62
+ parent: WebhookParentBlock;
63
+ };
64
+ };
65
+ export type DataSourceDeletedWebhookPayload = BaseWebhookPayload & {
66
+ type: "data_source.deleted";
67
+ entity: WebhookDatabaseEventEntity;
68
+ data: {
69
+ parent: WebhookParentBlock;
70
+ };
71
+ };
72
+ export type DataSourceMovedWebhookPayload = BaseWebhookPayload & {
73
+ type: "data_source.moved";
74
+ entity: WebhookDatabaseEventEntity;
75
+ data: {
76
+ parent: WebhookParentBlock;
77
+ };
78
+ };
79
+ export type DataSourceSchemaUpdatedWebhookPayload = BaseWebhookPayload & {
80
+ type: "data_source.schema_updated";
81
+ entity: WebhookDatabaseEventEntity;
82
+ data: {
83
+ parent: WebhookParentBlock;
84
+ updated_properties?: Array<{
85
+ id: string;
86
+ name: string | null;
87
+ action: "created" | "updated" | "deleted";
88
+ }>;
89
+ };
90
+ };
91
+ export type DataSourceUndeletedWebhookPayload = BaseWebhookPayload & {
92
+ type: "data_source.undeleted";
93
+ entity: WebhookDatabaseEventEntity;
94
+ data: {
95
+ parent: WebhookParentBlock;
96
+ };
97
+ };
98
+ export type DatabaseContentUpdatedWebhookPayload = BaseWebhookPayload & {
99
+ type: "database.content_updated";
100
+ entity: WebhookDatabaseEventEntity;
101
+ data: {
102
+ parent: WebhookParentBlock;
103
+ updated_blocks: Array<WebhookUpdatedBlock>;
104
+ };
105
+ };
106
+ export type DatabaseCreatedWebhookPayload = BaseWebhookPayload & {
107
+ type: "database.created";
108
+ entity: WebhookDatabaseEventEntity;
109
+ data: {
110
+ parent: WebhookParentBlock;
111
+ };
112
+ };
113
+ export type DatabaseDeletedWebhookPayload = BaseWebhookPayload & {
114
+ type: "database.deleted";
115
+ entity: WebhookDatabaseEventEntity;
116
+ data: {
117
+ parent: WebhookParentBlock;
118
+ };
119
+ };
120
+ export type DatabaseMovedWebhookPayload = BaseWebhookPayload & {
121
+ type: "database.moved";
122
+ entity: WebhookDatabaseEventEntity;
123
+ data: {
124
+ parent: WebhookParentBlock;
125
+ };
126
+ };
127
+ export type DatabaseSchemaUpdatedWebhookPayload = BaseWebhookPayload & {
128
+ type: "database.schema_updated";
129
+ entity: WebhookDatabaseEventEntity;
130
+ data: {
131
+ parent: WebhookParentBlock;
132
+ updated_properties?: Array<{
133
+ id: string;
134
+ name: string | null;
135
+ action: "created" | "updated" | "deleted";
136
+ }>;
137
+ };
138
+ };
139
+ export type DatabaseUndeletedWebhookPayload = BaseWebhookPayload & {
140
+ type: "database.undeleted";
141
+ entity: WebhookDatabaseEventEntity;
142
+ data: {
143
+ parent: WebhookParentBlock;
144
+ };
145
+ };
146
+ export type FileUploadCompletedWebhookPayload = BaseWebhookPayload & {
147
+ type: "file_upload.completed";
148
+ entity: WebhookFileUploadEntity;
149
+ };
150
+ export type FileUploadCreatedWebhookPayload = BaseWebhookPayload & {
151
+ type: "file_upload.created";
152
+ entity: WebhookFileUploadEntity;
153
+ };
154
+ export type FileUploadExpiredWebhookPayload = BaseWebhookPayload & {
155
+ type: "file_upload.expired";
156
+ entity: WebhookFileUploadEntity;
157
+ };
158
+ export type FileUploadUploadFailedWebhookPayload = BaseWebhookPayload & {
159
+ type: "file_upload.upload_failed";
160
+ entity: WebhookFileUploadEntity;
161
+ data: {
162
+ file_import_result: {
163
+ type: "success";
164
+ imported_time: string;
165
+ success: EmptyObject;
166
+ } | {
167
+ type: "error";
168
+ imported_time: string;
169
+ error: {
170
+ type: "validation_error" | "internal_system_error" | "download_error" | "upload_error";
171
+ code: string;
172
+ message: string;
173
+ parameter: string | null;
174
+ status_code: number | null;
175
+ };
176
+ };
177
+ };
178
+ };
179
+ export type PageContentUpdatedWebhookPayload = BaseWebhookPayload & {
180
+ type: "page.content_updated";
181
+ entity: WebhookPageEntity;
182
+ data: {
183
+ parent: WebhookParentBlock;
184
+ updated_blocks: Array<WebhookUpdatedBlock>;
185
+ };
186
+ };
187
+ export type PageCreatedWebhookPayload = BaseWebhookPayload & {
188
+ type: "page.created";
189
+ entity: WebhookPageEntity;
190
+ data: {
191
+ parent: WebhookParentBlock;
192
+ };
193
+ };
194
+ export type PageDeletedWebhookPayload = BaseWebhookPayload & {
195
+ type: "page.deleted";
196
+ entity: WebhookPageEntity;
197
+ data: {
198
+ parent: WebhookParentBlock;
199
+ };
200
+ };
201
+ export type PageLockedWebhookPayload = BaseWebhookPayload & {
202
+ type: "page.locked";
203
+ entity: WebhookPageEntity;
204
+ data: {
205
+ parent: WebhookParentBlock;
206
+ };
207
+ };
208
+ export type PageMovedWebhookPayload = BaseWebhookPayload & {
209
+ type: "page.moved";
210
+ entity: WebhookPageEntity;
211
+ data: {
212
+ parent: WebhookParentBlock;
213
+ };
214
+ };
215
+ export type PagePropertiesUpdatedWebhookPayload = BaseWebhookPayload & {
216
+ type: "page.properties_updated";
217
+ entity: WebhookPageEntity;
218
+ data: {
219
+ parent: WebhookParentBlock;
220
+ updated_properties: Array<string>;
221
+ };
222
+ };
223
+ export type PageTranscriptionBlockTranscriptDeletedWebhookPayload = BaseWebhookPayload & {
224
+ type: "page.transcription_block.transcript_deleted";
225
+ entity: WebhookPageEntity;
226
+ data: {
227
+ target: WebhookExternalBlock;
228
+ transcript_id: string | null;
229
+ };
230
+ };
231
+ export type PageUndeletedWebhookPayload = BaseWebhookPayload & {
232
+ type: "page.undeleted";
233
+ entity: WebhookPageEntity;
234
+ data: {
235
+ parent: WebhookParentBlock;
236
+ };
237
+ };
238
+ export type PageUnlockedWebhookPayload = BaseWebhookPayload & {
239
+ type: "page.unlocked";
240
+ entity: WebhookPageEntity;
241
+ data: {
242
+ parent: WebhookParentBlock;
243
+ };
244
+ };
245
+ export type ViewCreatedWebhookPayload = BaseWebhookPayload & {
246
+ type: "view.created";
247
+ entity: WebhookViewEntity;
248
+ data: {
249
+ parent: WebhookParentBlock;
250
+ view_type: string;
251
+ };
252
+ };
253
+ export type ViewDeletedWebhookPayload = BaseWebhookPayload & {
254
+ type: "view.deleted";
255
+ entity: WebhookViewEntity;
256
+ data: {
257
+ parent: WebhookParentBlock;
258
+ };
259
+ };
260
+ export type ViewUpdatedWebhookPayload = BaseWebhookPayload & {
261
+ type: "view.updated";
262
+ entity: WebhookViewEntity;
263
+ data: {
264
+ parent: WebhookParentBlock;
265
+ updated_fields: Array<"name" | "filter" | "sorts" | "configuration">;
266
+ };
267
+ };
268
+ type WebhookCommentEntity = {
269
+ type: "comment";
270
+ id: IdResponse;
271
+ };
272
+ type WebhookDatabaseEventEntity = {
273
+ id: IdResponse;
274
+ type: "block" | "database" | "data_source";
275
+ };
276
+ type WebhookExternalBlock = {
277
+ id: IdResponse;
278
+ type: "page" | "database" | "block";
279
+ };
280
+ type WebhookFileUploadEntity = {
281
+ type: "file_upload";
282
+ id: IdResponse;
283
+ };
284
+ type WebhookPageEntity = {
285
+ type: "page";
286
+ id: IdResponse;
287
+ };
288
+ type WebhookParentBlock = {
289
+ id: IdResponse;
290
+ type: "space" | "block" | "page" | "database" | "team";
291
+ data_source_id?: IdResponse;
292
+ };
293
+ type WebhookUpdatedBlock = {
294
+ id: IdResponse;
295
+ type: "page" | "database" | "block";
296
+ };
297
+ type WebhookViewEntity = {
298
+ id: IdResponse;
299
+ type: "view";
300
+ };
301
+ export {};
302
+ //# sourceMappingURL=webhooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../../src/api-endpoints/webhooks.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE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a generated file. DO NOT EDIT!
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ //# sourceMappingURL=webhooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../../src/api-endpoints/webhooks.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,+CAA+C","sourcesContent":["// cspell:disable-file\n// Note: This is a generated file. DO NOT EDIT!\n\nimport type { EmptyObject, IdResponse } from \"./common\"\n\nexport type BaseWebhookPayload = {\n // Unique identifier for this webhook event.\n id: string\n // ISO 8601 timestamp of when the event occurred. Can be used to order events.\n timestamp: string\n // The ID of the workspace where the event originated.\n workspace_id: IdResponse\n // The name of the workspace where the event originated.\n workspace_name: string\n // The ID of the webhook subscription.\n subscription_id: IdResponse\n // The ID of the integration the subscription is set up with.\n integration_id: IdResponse\n // The users or bots that performed the action. Typically an array of length 1; can be\n // more for aggregated events.\n authors: Array<\n | {\n // The ID of the user.\n id: IdResponse\n // Always `person`\n type: \"person\"\n }\n | {\n // The ID of the bot.\n id: IdResponse\n // Always `bot`\n type: \"bot\"\n }\n >\n // The delivery attempt number (1-8) of the current event delivery.\n attempt_number: number\n // The Notion API version that was used to render this webhook event's shape.\n api_version: \"2022-06-28\" | \"2025-09-03\" | \"2026-03-11\"\n // The users or bots who own the bot connection to the `integration_id` and have access\n // to the webhook's `entity`. Only present for public integrations.\n accessible_by?: Array<\n | {\n // The ID of the user.\n id: IdResponse\n // Always `person`\n type: \"person\"\n }\n | {\n // The ID of the bot.\n id: IdResponse\n // Always `bot`\n type: \"bot\"\n }\n >\n}\n\nexport type CommentCreatedWebhookPayload = BaseWebhookPayload & {\n // Always `comment.created`\n type: \"comment.created\"\n // The object that triggered the event.\n entity: WebhookCommentEntity\n // Additional event-specific data.\n data: {\n // The parent of the comment (the page or block the comment is attached to).\n parent: WebhookExternalBlock\n // The ID of the page containing the comment.\n page_id: IdResponse\n }\n}\n\nexport type CommentDeletedWebhookPayload = BaseWebhookPayload & {\n // Always `comment.deleted`\n type: \"comment.deleted\"\n // The object that triggered the event.\n entity: WebhookCommentEntity\n // Additional event-specific data.\n data: {\n // The parent of the comment (the page or block the comment is attached to).\n parent: WebhookExternalBlock\n // The ID of the page containing the comment.\n page_id: IdResponse\n }\n}\n\nexport type CommentUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `comment.updated`\n type: \"comment.updated\"\n // The object that triggered the event.\n entity: WebhookCommentEntity\n // Additional event-specific data.\n data: {\n // The parent of the comment (the page or block the comment is attached to).\n parent: WebhookExternalBlock\n // The ID of the page containing the comment.\n page_id: IdResponse\n }\n}\n\nexport type DataSourceContentUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `data_source.content_updated`\n type: \"data_source.content_updated\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity whose content was updated.\n parent: WebhookParentBlock\n // The blocks that were updated in this event.\n updated_blocks: Array<WebhookUpdatedBlock>\n }\n}\n\nexport type DataSourceCreatedWebhookPayload = BaseWebhookPayload & {\n // Always `data_source.created`\n type: \"data_source.created\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type DataSourceDeletedWebhookPayload = BaseWebhookPayload & {\n // Always `data_source.deleted`\n type: \"data_source.deleted\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type DataSourceMovedWebhookPayload = BaseWebhookPayload & {\n // Always `data_source.moved`\n type: \"data_source.moved\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type DataSourceSchemaUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `data_source.schema_updated`\n type: \"data_source.schema_updated\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the database whose schema was updated.\n parent: WebhookParentBlock\n // The database properties that were created, updated, or deleted.\n updated_properties?: Array<{\n // The ID of the database property that changed.\n id: string\n // The name of the database property, or `null` if deleted.\n name: string | null\n // The action taken on the property.\n action: \"created\" | \"updated\" | \"deleted\"\n }>\n }\n}\n\nexport type DataSourceUndeletedWebhookPayload = BaseWebhookPayload & {\n // Always `data_source.undeleted`\n type: \"data_source.undeleted\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type DatabaseContentUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `database.content_updated`\n type: \"database.content_updated\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity whose content was updated.\n parent: WebhookParentBlock\n // The blocks that were updated in this event.\n updated_blocks: Array<WebhookUpdatedBlock>\n }\n}\n\nexport type DatabaseCreatedWebhookPayload = BaseWebhookPayload & {\n // Always `database.created`\n type: \"database.created\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type DatabaseDeletedWebhookPayload = BaseWebhookPayload & {\n // Always `database.deleted`\n type: \"database.deleted\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type DatabaseMovedWebhookPayload = BaseWebhookPayload & {\n // Always `database.moved`\n type: \"database.moved\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type DatabaseSchemaUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `database.schema_updated`\n type: \"database.schema_updated\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the database whose schema was updated.\n parent: WebhookParentBlock\n // The database properties that were created, updated, or deleted.\n updated_properties?: Array<{\n // The ID of the database property that changed.\n id: string\n // The name of the database property, or `null` if deleted.\n name: string | null\n // The action taken on the property.\n action: \"created\" | \"updated\" | \"deleted\"\n }>\n }\n}\n\nexport type DatabaseUndeletedWebhookPayload = BaseWebhookPayload & {\n // Always `database.undeleted`\n type: \"database.undeleted\"\n // The object that triggered the event.\n entity: WebhookDatabaseEventEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type FileUploadCompletedWebhookPayload = BaseWebhookPayload & {\n // Always `file_upload.completed`\n type: \"file_upload.completed\"\n // The object that triggered the event.\n entity: WebhookFileUploadEntity\n}\n\nexport type FileUploadCreatedWebhookPayload = BaseWebhookPayload & {\n // Always `file_upload.created`\n type: \"file_upload.created\"\n // The object that triggered the event.\n entity: WebhookFileUploadEntity\n}\n\nexport type FileUploadExpiredWebhookPayload = BaseWebhookPayload & {\n // Always `file_upload.expired`\n type: \"file_upload.expired\"\n // The object that triggered the event.\n entity: WebhookFileUploadEntity\n}\n\nexport type FileUploadUploadFailedWebhookPayload = BaseWebhookPayload & {\n // Always `file_upload.upload_failed`\n type: \"file_upload.upload_failed\"\n // The object that triggered the event.\n entity: WebhookFileUploadEntity\n // Additional event-specific data.\n data: {\n // The result of the file import attempt.\n file_import_result:\n | {\n // Always `success`\n type: \"success\"\n // ISO 8601 timestamp of when the file was imported.\n imported_time: string\n // Empty object indicating success.\n success: EmptyObject\n }\n | {\n // Always `error`\n type: \"error\"\n // ISO 8601 timestamp of when the import was attempted.\n imported_time: string\n // Details about the error.\n error: {\n // The category of the error.\n type:\n | \"validation_error\"\n | \"internal_system_error\"\n | \"download_error\"\n | \"upload_error\"\n // A machine-readable error code.\n code: string\n // A human-readable description of the error.\n message: string\n // The parameter that caused the error, or `null`.\n parameter: string | null\n // The HTTP status code associated with the error, or `null`.\n status_code: number | null\n }\n }\n }\n}\n\nexport type PageContentUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `page.content_updated`\n type: \"page.content_updated\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity whose content was updated.\n parent: WebhookParentBlock\n // The blocks that were updated in this event.\n updated_blocks: Array<WebhookUpdatedBlock>\n }\n}\n\nexport type PageCreatedWebhookPayload = BaseWebhookPayload & {\n // Always `page.created`\n type: \"page.created\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type PageDeletedWebhookPayload = BaseWebhookPayload & {\n // Always `page.deleted`\n type: \"page.deleted\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type PageLockedWebhookPayload = BaseWebhookPayload & {\n // Always `page.locked`\n type: \"page.locked\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type PageMovedWebhookPayload = BaseWebhookPayload & {\n // Always `page.moved`\n type: \"page.moved\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type PagePropertiesUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `page.properties_updated`\n type: \"page.properties_updated\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the page whose properties were updated.\n parent: WebhookParentBlock\n // The IDs of the properties that were updated.\n updated_properties: Array<string>\n }\n}\n\nexport type PageTranscriptionBlockTranscriptDeletedWebhookPayload =\n BaseWebhookPayload & {\n // Always `page.transcription_block.transcript_deleted`\n type: \"page.transcription_block.transcript_deleted\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The block that contained the deleted transcript.\n target: WebhookExternalBlock\n // The ID of the deleted transcript, or `null` if not available.\n transcript_id: string | null\n }\n }\n\nexport type PageUndeletedWebhookPayload = BaseWebhookPayload & {\n // Always `page.undeleted`\n type: \"page.undeleted\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type PageUnlockedWebhookPayload = BaseWebhookPayload & {\n // Always `page.unlocked`\n type: \"page.unlocked\"\n // The object that triggered the event.\n entity: WebhookPageEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type ViewCreatedWebhookPayload = BaseWebhookPayload & {\n // Always `view.created`\n type: \"view.created\"\n // The object that triggered the event.\n entity: WebhookViewEntity\n // Additional event-specific data.\n data: {\n // The parent of the created view.\n parent: WebhookParentBlock\n // The type of the created view (e.g. `table`, `board`, `list`, `calendar`, `gallery`,\n // `timeline`).\n view_type: string\n }\n}\n\nexport type ViewDeletedWebhookPayload = BaseWebhookPayload & {\n // Always `view.deleted`\n type: \"view.deleted\"\n // The object that triggered the event.\n entity: WebhookViewEntity\n // Additional event-specific data.\n data: {\n // The parent of the entity that triggered the event.\n parent: WebhookParentBlock\n }\n}\n\nexport type ViewUpdatedWebhookPayload = BaseWebhookPayload & {\n // Always `view.updated`\n type: \"view.updated\"\n // The object that triggered the event.\n entity: WebhookViewEntity\n // Additional event-specific data.\n data: {\n // The parent of the updated view.\n parent: WebhookParentBlock\n // The fields of the view that were updated.\n updated_fields: Array<\"name\" | \"filter\" | \"sorts\" | \"configuration\">\n }\n}\n\ntype WebhookCommentEntity = {\n // Always `comment`\n type: \"comment\"\n // The ID of the comment that triggered the event.\n id: IdResponse\n}\n\ntype WebhookDatabaseEventEntity = {\n // The ID of the database or data source that triggered the event.\n id: IdResponse\n // The type of entity. For linked databases, this is `block`.\n type: \"block\" | \"database\" | \"data_source\"\n}\n\ntype WebhookExternalBlock = {\n // The ID of the parent.\n id: IdResponse\n // The type of the parent.\n type: \"page\" | \"database\" | \"block\"\n}\n\ntype WebhookFileUploadEntity = {\n // Always `file_upload`\n type: \"file_upload\"\n // The ID of the file upload that triggered the event.\n id: IdResponse\n}\n\ntype WebhookPageEntity = {\n // Always `page`\n type: \"page\"\n // The ID of the page that triggered the event.\n id: IdResponse\n}\n\ntype WebhookParentBlock = {\n // The ID of the parent.\n id: IdResponse\n // The type of the parent.\n type: \"space\" | \"block\" | \"page\" | \"database\" | \"team\"\n // The data source ID of the parent, if applicable.\n data_source_id?: IdResponse\n}\n\ntype WebhookUpdatedBlock = {\n // The ID of the updated block.\n id: IdResponse\n // The type of the updated block.\n type: \"page\" | \"database\" | \"block\"\n}\n\ntype WebhookViewEntity = {\n // The ID of the view that triggered the event.\n id: IdResponse\n // Always `view`\n type: \"view\"\n}\n"]}