@@ -32,6 +32,14 @@ export function notionSetupInstructions(eventType: string): string {
3232 'Ensure the integration has access to the pages/databases you want to monitor (share them with the integration).' ,
3333 ]
3434
35+ if ( eventType === 'comment.created' ) {
36+ instructions . splice (
37+ 7 ,
38+ 0 ,
39+ 'Enable the <strong>comment read</strong> capability in your Notion integration settings so comment events can be delivered.'
40+ )
41+ }
42+
3543 return instructions
3644 . map (
3745 ( instruction , index ) =>
@@ -71,11 +79,16 @@ function buildBaseOutputs(): Record<string, TriggerOutput> {
7179 description : 'Event type (e.g., page.created, database.schema_updated)' ,
7280 } ,
7381 timestamp : { type : 'string' , description : 'ISO 8601 timestamp of the event' } ,
82+ api_version : { type : 'string' , description : 'Notion API version included with the event' } ,
7483 workspace_id : { type : 'string' , description : 'Workspace ID where the event occurred' } ,
7584 workspace_name : { type : 'string' , description : 'Workspace name' } ,
7685 subscription_id : { type : 'string' , description : 'Webhook subscription ID' } ,
7786 integration_id : { type : 'string' , description : 'Integration ID that received the event' } ,
7887 attempt_number : { type : 'number' , description : 'Delivery attempt number' } ,
88+ accessible_by : {
89+ type : 'array' ,
90+ description : 'Array of users and bots that can access the entity' ,
91+ } ,
7992 }
8093}
8194
@@ -85,7 +98,7 @@ function buildBaseOutputs(): Record<string, TriggerOutput> {
8598function buildEntityOutputs ( ) : Record < string , TriggerOutput > {
8699 return {
87100 id : { type : 'string' , description : 'Entity ID (page or database ID)' } ,
88- entity_type : { type : 'string' , description : 'Entity type (page or database )' } ,
101+ entity_type : { type : 'string' , description : 'Entity type (page, database, block, or comment )' } ,
89102 }
90103}
91104
@@ -101,9 +114,20 @@ export function buildPageEventOutputs(): Record<string, TriggerOutput> {
101114 } ,
102115 entity : buildEntityOutputs ( ) ,
103116 data : {
117+ updated_blocks : {
118+ type : 'array' ,
119+ description : 'Blocks updated as part of the event, when provided by Notion' ,
120+ } ,
121+ updated_properties : {
122+ type : 'array' ,
123+ description : 'Property IDs updated as part of the event, when provided by Notion' ,
124+ } ,
104125 parent : {
105126 id : { type : 'string' , description : 'Parent page or database ID' } ,
106- parent_type : { type : 'string' , description : 'Parent type (database, page, workspace)' } ,
127+ parent_type : {
128+ type : 'string' ,
129+ description : 'Parent type (database, page, block, or workspace)' ,
130+ } ,
107131 } ,
108132 } ,
109133 }
@@ -121,9 +145,17 @@ export function buildDatabaseEventOutputs(): Record<string, TriggerOutput> {
121145 } ,
122146 entity : buildEntityOutputs ( ) ,
123147 data : {
148+ updated_blocks : {
149+ type : 'array' ,
150+ description : 'Blocks updated as part of the event, when provided by Notion' ,
151+ } ,
152+ updated_properties : {
153+ type : 'array' ,
154+ description : 'Database properties updated as part of the event, when provided by Notion' ,
155+ } ,
124156 parent : {
125157 id : { type : 'string' , description : 'Parent page or workspace ID' } ,
126- parent_type : { type : 'string' , description : 'Parent type (page, workspace)' } ,
158+ parent_type : { type : 'string' , description : 'Parent type (page, database, or workspace)' } ,
127159 } ,
128160 } ,
129161 }
@@ -144,9 +176,10 @@ export function buildCommentEventOutputs(): Record<string, TriggerOutput> {
144176 entity_type : { type : 'string' , description : 'Entity type (comment)' } ,
145177 } ,
146178 data : {
179+ page_id : { type : 'string' , description : 'Page ID that owns the comment thread' } ,
147180 parent : {
148- id : { type : 'string' , description : 'Parent page ID' } ,
149- parent_type : { type : 'string' , description : 'Parent type (page)' } ,
181+ id : { type : 'string' , description : 'Parent page or block ID' } ,
182+ parent_type : { type : 'string' , description : 'Parent type (page or block )' } ,
150183 } ,
151184 } ,
152185 }
@@ -164,8 +197,22 @@ export function buildGenericWebhookOutputs(): Record<string, TriggerOutput> {
164197 } ,
165198 entity : buildEntityOutputs ( ) ,
166199 data : {
167- type : 'json' ,
168- description : 'Event-specific data including parent information' ,
200+ parent : {
201+ id : { type : 'string' , description : 'Parent entity ID, when provided by Notion' } ,
202+ parent_type : {
203+ type : 'string' ,
204+ description : 'Parent entity type (page, database, block, or workspace), when present' ,
205+ } ,
206+ } ,
207+ page_id : { type : 'string' , description : 'Page ID related to the event, when present' } ,
208+ updated_blocks : {
209+ type : 'array' ,
210+ description : 'Blocks updated as part of the event, when provided by Notion' ,
211+ } ,
212+ updated_properties : {
213+ type : 'array' ,
214+ description : 'Updated properties included with the event, when provided by Notion' ,
215+ } ,
169216 } ,
170217 }
171218}
0 commit comments