@notionhq/custom-blocks-host 0.3.4 → 0.3.6

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 (40) hide show
  1. package/README.md +0 -5
  2. package/dist/browser.js +1 -1
  3. package/dist/index.d.ts +2 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/lifecycle/legacyPage.d.ts +70 -0
  6. package/dist/lifecycle/legacyPage.d.ts.map +1 -0
  7. package/dist/lifecycle/legacyPage.js +171 -0
  8. package/dist/lifecycle/normalizeHostToSandboxMessage.d.ts +2 -2
  9. package/dist/lifecycle/normalizeHostToSandboxMessage.d.ts.map +1 -1
  10. package/dist/lifecycle/normalizeHostToSandboxMessage.js +8 -30
  11. package/dist/lifecycle/normalizePage.d.ts +7 -0
  12. package/dist/lifecycle/normalizePage.d.ts.map +1 -0
  13. package/dist/lifecycle/normalizePage.js +22 -0
  14. package/dist/messages/types.d.ts +1 -2
  15. package/dist/messages/types.d.ts.map +1 -1
  16. package/dist/protocol/dataSources/dataSourcePage.d.ts +1 -162
  17. package/dist/protocol/dataSources/dataSourcePage.js +1 -9
  18. package/dist/protocol/messages/createPage.js +2 -2
  19. package/dist/protocol/messages/createPageResult.d.ts +468 -1
  20. package/dist/protocol/messages/createPageResult.js +17 -2
  21. package/dist/protocol/messages/getPage.d.ts +468 -1
  22. package/dist/protocol/messages/getPage.js +18 -3
  23. package/dist/protocol/messages/hostToSandbox.d.ts +2398 -159
  24. package/dist/protocol/messages/hostToSandbox.js +22 -12
  25. package/dist/protocol/messages/queryDataSourceResult.d.ts +312 -2
  26. package/dist/protocol/messages/queryDataSourceResult.js +18 -5
  27. package/dist/protocol/messages/sandboxToHost.d.ts +2 -0
  28. package/dist/protocol/messages/updatePage.d.ts +1 -0
  29. package/dist/protocol/messages/updatePage.js +4 -3
  30. package/dist/protocol/messages/updatePageResult.d.ts +467 -1
  31. package/dist/protocol/messages/updatePageResult.js +16 -2
  32. package/dist/protocol/pages/page.d.ts +386 -6
  33. package/dist/protocol/pages/page.js +23 -2
  34. package/dist/protocol/protocolVersion.js +1 -1
  35. package/package.json +1 -1
  36. package/src/index.ts +2 -4
  37. package/src/lifecycle/legacyPage.ts +208 -0
  38. package/src/lifecycle/normalizeHostToSandboxMessage.ts +18 -35
  39. package/src/lifecycle/normalizePage.ts +35 -0
  40. package/src/messages/types.ts +1 -1
@@ -16,6 +16,471 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
16
16
  readonly requestId: v.StringSchema<undefined>;
17
17
  readonly status: v.LiteralSchema<"success", undefined>;
18
18
  readonly page: v.ObjectSchema<{
19
+ readonly object: v.LiteralSchema<"page", undefined>;
20
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
21
+ readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
22
+ readonly type: v.LiteralSchema<"page_id", undefined>;
23
+ readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
24
+ }, undefined>, v.ObjectSchema<{
25
+ readonly type: v.LiteralSchema<"data_source_id", undefined>;
26
+ readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
27
+ }, undefined>, v.ObjectSchema<{
28
+ readonly type: v.LiteralSchema<"workspace", undefined>;
29
+ readonly workspace: v.LiteralSchema<true, undefined>;
30
+ }, undefined>, v.ObjectSchema<{
31
+ readonly type: v.LiteralSchema<"block_id", undefined>;
32
+ readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
33
+ }, undefined>, v.ObjectSchema<{
34
+ readonly type: v.LiteralSchema<"agent_id", undefined>;
35
+ readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
36
+ }, undefined>, v.ObjectSchema<{
37
+ readonly type: v.LiteralSchema<"unavailable", undefined>;
38
+ }, undefined>], undefined>;
39
+ readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
40
+ readonly id: v.StringSchema<undefined>;
41
+ readonly type: v.LiteralSchema<"title", undefined>;
42
+ readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
43
+ }, undefined>, v.ObjectSchema<{
44
+ readonly id: v.StringSchema<undefined>;
45
+ readonly type: v.LiteralSchema<"rich_text", undefined>;
46
+ readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
47
+ }, undefined>, v.ObjectSchema<{
48
+ readonly id: v.StringSchema<undefined>;
49
+ readonly type: v.LiteralSchema<"number", undefined>;
50
+ readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
51
+ }, undefined>, v.ObjectSchema<{
52
+ readonly id: v.StringSchema<undefined>;
53
+ readonly type: v.LiteralSchema<"url", undefined>;
54
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
55
+ }, undefined>, v.ObjectSchema<{
56
+ readonly id: v.StringSchema<undefined>;
57
+ readonly type: v.LiteralSchema<"email", undefined>;
58
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
59
+ }, undefined>, v.ObjectSchema<{
60
+ readonly id: v.StringSchema<undefined>;
61
+ readonly type: v.LiteralSchema<"phone_number", undefined>;
62
+ readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
63
+ }, undefined>, v.ObjectSchema<{
64
+ readonly id: v.StringSchema<undefined>;
65
+ readonly type: v.LiteralSchema<"checkbox", undefined>;
66
+ readonly checkbox: v.BooleanSchema<undefined>;
67
+ }, undefined>, v.ObjectSchema<{
68
+ readonly id: v.StringSchema<undefined>;
69
+ readonly type: v.LiteralSchema<"select", undefined>;
70
+ readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
71
+ readonly id: v.StringSchema<undefined>;
72
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
73
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
74
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
75
+ }, undefined>, v.ObjectSchema<{
76
+ readonly name: v.StringSchema<undefined>;
77
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
78
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
79
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
80
+ }, undefined>], undefined>, undefined>;
81
+ }, undefined>, v.ObjectSchema<{
82
+ readonly id: v.StringSchema<undefined>;
83
+ readonly type: v.LiteralSchema<"status", undefined>;
84
+ readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
85
+ readonly id: v.StringSchema<undefined>;
86
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
87
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
88
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
89
+ }, undefined>, v.ObjectSchema<{
90
+ readonly name: v.StringSchema<undefined>;
91
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
92
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
93
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
94
+ }, undefined>], undefined>, undefined>;
95
+ }, undefined>, v.ObjectSchema<{
96
+ readonly id: v.StringSchema<undefined>;
97
+ readonly type: v.LiteralSchema<"multi_select", undefined>;
98
+ readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
99
+ readonly id: v.StringSchema<undefined>;
100
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
101
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
102
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
103
+ }, undefined>, v.ObjectSchema<{
104
+ readonly name: v.StringSchema<undefined>;
105
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
106
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
107
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
108
+ }, undefined>], undefined>, undefined>;
109
+ }, undefined>, v.ObjectSchema<{
110
+ readonly id: v.StringSchema<undefined>;
111
+ readonly type: v.LiteralSchema<"date", undefined>;
112
+ readonly date: v.NullableSchema<v.ObjectSchema<{
113
+ readonly start: v.StringSchema<undefined>;
114
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
115
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
116
+ }, undefined>, undefined>;
117
+ }, undefined>, v.ObjectSchema<{
118
+ readonly id: v.StringSchema<undefined>;
119
+ readonly type: v.LiteralSchema<"people", undefined>;
120
+ readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
121
+ readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
122
+ readonly id: v.StringSchema<undefined>;
123
+ }, undefined>, v.ObjectSchema<{
124
+ readonly object: v.LiteralSchema<"group", undefined>;
125
+ readonly id: v.StringSchema<undefined>;
126
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
127
+ }, undefined>], undefined>, undefined>;
128
+ }, undefined>, v.ObjectSchema<{
129
+ readonly id: v.StringSchema<undefined>;
130
+ readonly type: v.LiteralSchema<"relation", undefined>;
131
+ readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
132
+ readonly relation: v.ArraySchema<v.ObjectSchema<{
133
+ readonly id: v.StringSchema<undefined>;
134
+ }, undefined>, undefined>;
135
+ }, undefined>, v.ObjectSchema<{
136
+ readonly id: v.StringSchema<undefined>;
137
+ readonly type: v.LiteralSchema<"files", undefined>;
138
+ readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
139
+ readonly type: v.LiteralSchema<"external", undefined>;
140
+ readonly name: v.StringSchema<undefined>;
141
+ readonly external: v.ObjectSchema<{
142
+ readonly url: v.StringSchema<undefined>;
143
+ }, undefined>;
144
+ }, undefined>, v.ObjectSchema<{
145
+ readonly type: v.LiteralSchema<"file", undefined>;
146
+ readonly name: v.StringSchema<undefined>;
147
+ readonly file: v.ObjectSchema<{
148
+ readonly url: v.StringSchema<undefined>;
149
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
150
+ }, undefined>;
151
+ }, undefined>], undefined>, undefined>;
152
+ }, undefined>, v.ObjectSchema<{
153
+ readonly id: v.StringSchema<undefined>;
154
+ readonly type: v.LiteralSchema<"place", undefined>;
155
+ readonly place: v.NullableSchema<v.ObjectSchema<{
156
+ readonly lat: v.NumberSchema<undefined>;
157
+ readonly lon: v.NumberSchema<undefined>;
158
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
159
+ readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
160
+ readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
161
+ readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
162
+ }, undefined>, undefined>;
163
+ }, undefined>, v.ObjectSchema<{
164
+ readonly id: v.StringSchema<undefined>;
165
+ readonly type: v.LiteralSchema<"created_time", undefined>;
166
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
167
+ }, undefined>, v.ObjectSchema<{
168
+ readonly id: v.StringSchema<undefined>;
169
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
170
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
171
+ }, undefined>, v.ObjectSchema<{
172
+ readonly id: v.StringSchema<undefined>;
173
+ readonly type: v.LiteralSchema<"created_by", undefined>;
174
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
175
+ readonly id: v.StringSchema<undefined>;
176
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
177
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
178
+ }, undefined>, undefined>;
179
+ }, undefined>, v.ObjectSchema<{
180
+ readonly id: v.StringSchema<undefined>;
181
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
182
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
183
+ readonly id: v.StringSchema<undefined>;
184
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
185
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
186
+ }, undefined>, undefined>;
187
+ }, undefined>, v.ObjectSchema<{
188
+ readonly id: v.StringSchema<undefined>;
189
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
190
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
191
+ }, undefined>], undefined>, undefined>, undefined>;
192
+ readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
193
+ readonly id: v.StringSchema<undefined>;
194
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
195
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
196
+ }, undefined>, undefined>, null>;
197
+ readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
198
+ readonly id: v.StringSchema<undefined>;
199
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
200
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
201
+ }, undefined>, undefined>, null>;
202
+ readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
203
+ readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
204
+ readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
205
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
206
+ readonly type: v.LiteralSchema<"emoji", undefined>;
207
+ readonly emoji: v.StringSchema<undefined>;
208
+ }, undefined>, v.ObjectSchema<{
209
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
210
+ readonly custom_emoji: v.ObjectSchema<{
211
+ readonly id: v.StringSchema<undefined>;
212
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
213
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
214
+ }, undefined>;
215
+ }, undefined>, v.ObjectSchema<{
216
+ readonly type: v.LiteralSchema<"external", undefined>;
217
+ readonly external: v.ObjectSchema<{
218
+ readonly url: v.StringSchema<undefined>;
219
+ }, undefined>;
220
+ }, undefined>, v.ObjectSchema<{
221
+ readonly type: v.LiteralSchema<"file", undefined>;
222
+ readonly file: v.ObjectSchema<{
223
+ readonly url: v.StringSchema<undefined>;
224
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
225
+ }, undefined>;
226
+ }, undefined>], undefined>, undefined>, null>;
227
+ readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
228
+ readonly type: v.LiteralSchema<"external", undefined>;
229
+ readonly external: v.ObjectSchema<{
230
+ readonly url: v.StringSchema<undefined>;
231
+ }, undefined>;
232
+ }, undefined>, v.ObjectSchema<{
233
+ readonly type: v.LiteralSchema<"file", undefined>;
234
+ readonly file: v.ObjectSchema<{
235
+ readonly url: v.StringSchema<undefined>;
236
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
237
+ }, undefined>;
238
+ }, undefined>], undefined>, undefined>, null>;
239
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
240
+ readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
241
+ readonly is_archived: v.BooleanSchema<undefined>;
242
+ readonly in_trash: v.BooleanSchema<undefined>;
243
+ }, undefined>;
244
+ }, undefined>, v.ObjectSchema<{
245
+ readonly type: v.LiteralSchema<"updatePageResult", undefined>;
246
+ readonly requestId: v.StringSchema<undefined>;
247
+ readonly status: v.LiteralSchema<"error", undefined>;
248
+ readonly error: v.ObjectSchema<{
249
+ readonly code: v.StringSchema<undefined>;
250
+ readonly message: v.StringSchema<undefined>;
251
+ readonly isRetryable: v.BooleanSchema<undefined>;
252
+ }, undefined>;
253
+ }, undefined>], undefined>;
254
+ export declare const updatePageResultMessageLegacySchema: v.VariantSchema<"status", [v.ObjectSchema<{
255
+ readonly type: v.LiteralSchema<"updatePageResult", undefined>;
256
+ readonly requestId: v.StringSchema<undefined>;
257
+ readonly status: v.LiteralSchema<"success", undefined>;
258
+ readonly page: v.UnionSchema<[v.ObjectSchema<{
259
+ readonly object: v.LiteralSchema<"page", undefined>;
260
+ readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
261
+ readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
262
+ readonly type: v.LiteralSchema<"page_id", undefined>;
263
+ readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
264
+ }, undefined>, v.ObjectSchema<{
265
+ readonly type: v.LiteralSchema<"data_source_id", undefined>;
266
+ readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
267
+ }, undefined>, v.ObjectSchema<{
268
+ readonly type: v.LiteralSchema<"workspace", undefined>;
269
+ readonly workspace: v.LiteralSchema<true, undefined>;
270
+ }, undefined>, v.ObjectSchema<{
271
+ readonly type: v.LiteralSchema<"block_id", undefined>;
272
+ readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
273
+ }, undefined>, v.ObjectSchema<{
274
+ readonly type: v.LiteralSchema<"agent_id", undefined>;
275
+ readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
276
+ }, undefined>, v.ObjectSchema<{
277
+ readonly type: v.LiteralSchema<"unavailable", undefined>;
278
+ }, undefined>], undefined>;
279
+ readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
280
+ readonly id: v.StringSchema<undefined>;
281
+ readonly type: v.LiteralSchema<"title", undefined>;
282
+ readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
283
+ }, undefined>, v.ObjectSchema<{
284
+ readonly id: v.StringSchema<undefined>;
285
+ readonly type: v.LiteralSchema<"rich_text", undefined>;
286
+ readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
287
+ }, undefined>, v.ObjectSchema<{
288
+ readonly id: v.StringSchema<undefined>;
289
+ readonly type: v.LiteralSchema<"number", undefined>;
290
+ readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
291
+ }, undefined>, v.ObjectSchema<{
292
+ readonly id: v.StringSchema<undefined>;
293
+ readonly type: v.LiteralSchema<"url", undefined>;
294
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
295
+ }, undefined>, v.ObjectSchema<{
296
+ readonly id: v.StringSchema<undefined>;
297
+ readonly type: v.LiteralSchema<"email", undefined>;
298
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
299
+ }, undefined>, v.ObjectSchema<{
300
+ readonly id: v.StringSchema<undefined>;
301
+ readonly type: v.LiteralSchema<"phone_number", undefined>;
302
+ readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
303
+ }, undefined>, v.ObjectSchema<{
304
+ readonly id: v.StringSchema<undefined>;
305
+ readonly type: v.LiteralSchema<"checkbox", undefined>;
306
+ readonly checkbox: v.BooleanSchema<undefined>;
307
+ }, undefined>, v.ObjectSchema<{
308
+ readonly id: v.StringSchema<undefined>;
309
+ readonly type: v.LiteralSchema<"select", undefined>;
310
+ readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
311
+ readonly id: v.StringSchema<undefined>;
312
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
313
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
314
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
315
+ }, undefined>, v.ObjectSchema<{
316
+ readonly name: v.StringSchema<undefined>;
317
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
318
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
319
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
320
+ }, undefined>], undefined>, undefined>;
321
+ }, undefined>, v.ObjectSchema<{
322
+ readonly id: v.StringSchema<undefined>;
323
+ readonly type: v.LiteralSchema<"status", undefined>;
324
+ readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
325
+ readonly id: v.StringSchema<undefined>;
326
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
327
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
328
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
329
+ }, undefined>, v.ObjectSchema<{
330
+ readonly name: v.StringSchema<undefined>;
331
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
332
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
333
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
334
+ }, undefined>], undefined>, undefined>;
335
+ }, undefined>, v.ObjectSchema<{
336
+ readonly id: v.StringSchema<undefined>;
337
+ readonly type: v.LiteralSchema<"multi_select", undefined>;
338
+ readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
339
+ readonly id: v.StringSchema<undefined>;
340
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
341
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
342
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
343
+ }, undefined>, v.ObjectSchema<{
344
+ readonly name: v.StringSchema<undefined>;
345
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
346
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
347
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
348
+ }, undefined>], undefined>, undefined>;
349
+ }, undefined>, v.ObjectSchema<{
350
+ readonly id: v.StringSchema<undefined>;
351
+ readonly type: v.LiteralSchema<"date", undefined>;
352
+ readonly date: v.NullableSchema<v.ObjectSchema<{
353
+ readonly start: v.StringSchema<undefined>;
354
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
355
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
356
+ }, undefined>, undefined>;
357
+ }, undefined>, v.ObjectSchema<{
358
+ readonly id: v.StringSchema<undefined>;
359
+ readonly type: v.LiteralSchema<"people", undefined>;
360
+ readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
361
+ readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
362
+ readonly id: v.StringSchema<undefined>;
363
+ }, undefined>, v.ObjectSchema<{
364
+ readonly object: v.LiteralSchema<"group", undefined>;
365
+ readonly id: v.StringSchema<undefined>;
366
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
367
+ }, undefined>], undefined>, undefined>;
368
+ }, undefined>, v.ObjectSchema<{
369
+ readonly id: v.StringSchema<undefined>;
370
+ readonly type: v.LiteralSchema<"relation", undefined>;
371
+ readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
372
+ readonly relation: v.ArraySchema<v.ObjectSchema<{
373
+ readonly id: v.StringSchema<undefined>;
374
+ }, undefined>, undefined>;
375
+ }, undefined>, v.ObjectSchema<{
376
+ readonly id: v.StringSchema<undefined>;
377
+ readonly type: v.LiteralSchema<"files", undefined>;
378
+ readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
379
+ readonly type: v.LiteralSchema<"external", undefined>;
380
+ readonly name: v.StringSchema<undefined>;
381
+ readonly external: v.ObjectSchema<{
382
+ readonly url: v.StringSchema<undefined>;
383
+ }, undefined>;
384
+ }, undefined>, v.ObjectSchema<{
385
+ readonly type: v.LiteralSchema<"file", undefined>;
386
+ readonly name: v.StringSchema<undefined>;
387
+ readonly file: v.ObjectSchema<{
388
+ readonly url: v.StringSchema<undefined>;
389
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
390
+ }, undefined>;
391
+ }, undefined>], undefined>, undefined>;
392
+ }, undefined>, v.ObjectSchema<{
393
+ readonly id: v.StringSchema<undefined>;
394
+ readonly type: v.LiteralSchema<"place", undefined>;
395
+ readonly place: v.NullableSchema<v.ObjectSchema<{
396
+ readonly lat: v.NumberSchema<undefined>;
397
+ readonly lon: v.NumberSchema<undefined>;
398
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
399
+ readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
400
+ readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
401
+ readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
402
+ }, undefined>, undefined>;
403
+ }, undefined>, v.ObjectSchema<{
404
+ readonly id: v.StringSchema<undefined>;
405
+ readonly type: v.LiteralSchema<"created_time", undefined>;
406
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
407
+ }, undefined>, v.ObjectSchema<{
408
+ readonly id: v.StringSchema<undefined>;
409
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
410
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
411
+ }, undefined>, v.ObjectSchema<{
412
+ readonly id: v.StringSchema<undefined>;
413
+ readonly type: v.LiteralSchema<"created_by", undefined>;
414
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
415
+ readonly id: v.StringSchema<undefined>;
416
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
417
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
418
+ }, undefined>, undefined>;
419
+ }, undefined>, v.ObjectSchema<{
420
+ readonly id: v.StringSchema<undefined>;
421
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
422
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
423
+ readonly id: v.StringSchema<undefined>;
424
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
425
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
426
+ }, undefined>, undefined>;
427
+ }, undefined>, v.ObjectSchema<{
428
+ readonly id: v.StringSchema<undefined>;
429
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
430
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
431
+ }, undefined>], undefined>, undefined>, undefined>;
432
+ readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
433
+ readonly id: v.StringSchema<undefined>;
434
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
435
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
436
+ }, undefined>, undefined>, null>;
437
+ readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
438
+ readonly id: v.StringSchema<undefined>;
439
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
440
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
441
+ }, undefined>, undefined>, null>;
442
+ readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
443
+ readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
444
+ readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
445
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
446
+ readonly type: v.LiteralSchema<"emoji", undefined>;
447
+ readonly emoji: v.StringSchema<undefined>;
448
+ }, undefined>, v.ObjectSchema<{
449
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
450
+ readonly custom_emoji: v.ObjectSchema<{
451
+ readonly id: v.StringSchema<undefined>;
452
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
453
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
454
+ }, undefined>;
455
+ }, undefined>, v.ObjectSchema<{
456
+ readonly type: v.LiteralSchema<"external", undefined>;
457
+ readonly external: v.ObjectSchema<{
458
+ readonly url: v.StringSchema<undefined>;
459
+ }, undefined>;
460
+ }, undefined>, v.ObjectSchema<{
461
+ readonly type: v.LiteralSchema<"file", undefined>;
462
+ readonly file: v.ObjectSchema<{
463
+ readonly url: v.StringSchema<undefined>;
464
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
465
+ }, undefined>;
466
+ }, undefined>], undefined>, undefined>, null>;
467
+ readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
468
+ readonly type: v.LiteralSchema<"external", undefined>;
469
+ readonly external: v.ObjectSchema<{
470
+ readonly url: v.StringSchema<undefined>;
471
+ }, undefined>;
472
+ }, undefined>, v.ObjectSchema<{
473
+ readonly type: v.LiteralSchema<"file", undefined>;
474
+ readonly file: v.ObjectSchema<{
475
+ readonly url: v.StringSchema<undefined>;
476
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
477
+ }, undefined>;
478
+ }, undefined>], undefined>, undefined>, null>;
479
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
480
+ readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
481
+ readonly is_archived: v.BooleanSchema<undefined>;
482
+ readonly in_trash: v.BooleanSchema<undefined>;
483
+ }, undefined>, v.ObjectSchema<{
19
484
  readonly object: v.LiteralSchema<"page", undefined>;
20
485
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
21
486
  readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
@@ -229,7 +694,7 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
229
694
  readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
230
695
  readonly is_archived: v.BooleanSchema<undefined>;
231
696
  readonly in_trash: v.BooleanSchema<undefined>;
232
- }, undefined>;
697
+ }, undefined>], undefined>;
233
698
  }, undefined>, v.ObjectSchema<{
234
699
  readonly type: v.LiteralSchema<"updatePageResult", undefined>;
235
700
  readonly requestId: v.StringSchema<undefined>;
@@ -241,3 +706,4 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
241
706
  }, undefined>;
242
707
  }, undefined>], undefined>;
243
708
  export type UpdatePageResultMessage = v.InferOutput<typeof updatePageResultMessageSchema>;
709
+ export type UpdatePageResultMessageLegacy = v.InferOutput<typeof updatePageResultMessageLegacySchema>;
@@ -1,5 +1,5 @@
1
1
  import * as v from "valibot";
2
- import { notionPageSchema } from "../pages/page.js";
2
+ import { legacyNotionPageSchema, notionPageDataSchema } from "../pages/page.js";
3
3
  // The schema accepts any string code. The type lists known codes for
4
4
  // autocomplete, with an open string fallback for newer senders.
5
5
  export const customBlockUpdatePageErrorCodeSchema = v.string();
@@ -16,7 +16,21 @@ export const updatePageResultMessageSchema = v.variant("status", [
16
16
  type: v.literal("updatePageResult"),
17
17
  requestId: v.string(),
18
18
  status: v.literal("success"),
19
- page: notionPageSchema,
19
+ page: notionPageDataSchema,
20
+ }),
21
+ v.object({
22
+ type: v.literal("updatePageResult"),
23
+ requestId: v.string(),
24
+ status: v.literal("error"),
25
+ error: customBlockUpdatePageErrorInfoSchema,
26
+ }),
27
+ ]);
28
+ export const updatePageResultMessageLegacySchema = v.variant("status", [
29
+ v.object({
30
+ type: v.literal("updatePageResult"),
31
+ requestId: v.string(),
32
+ status: v.literal("success"),
33
+ page: v.union([notionPageDataSchema, legacyNotionPageSchema]),
20
34
  }),
21
35
  v.object({
22
36
  type: v.literal("updatePageResult"),