@notionhq/custom-blocks-host 0.3.5 → 0.3.7

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 (51) hide show
  1. package/README.md +5 -0
  2. package/dist/browser.js +1 -1
  3. package/dist/dateValue.d.ts +11 -0
  4. package/dist/dateValue.d.ts.map +1 -0
  5. package/dist/dateValue.js +96 -0
  6. package/dist/index.d.ts +3 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1 -0
  9. package/dist/lifecycle/legacyPage.d.ts +4 -2
  10. package/dist/lifecycle/legacyPage.d.ts.map +1 -1
  11. package/dist/lifecycle/legacyPage.js +14 -62
  12. package/dist/lifecycle/normalizeHostToSandboxMessage.d.ts.map +1 -1
  13. package/dist/lifecycle/normalizeHostToSandboxMessage.js +8 -2
  14. package/dist/lifecycle/normalizePage.d.ts +7 -0
  15. package/dist/lifecycle/normalizePage.d.ts.map +1 -0
  16. package/dist/lifecycle/normalizePage.js +22 -0
  17. package/dist/messages/types.d.ts +1 -2
  18. package/dist/messages/types.d.ts.map +1 -1
  19. package/dist/protocol/dataSources/dataSourcePage.d.ts +0 -160
  20. package/dist/protocol/dataSources/dataSourcePage.js +0 -7
  21. package/dist/protocol/dataSources/dateValue.d.ts +2 -2
  22. package/dist/protocol/dataSources/dateValue.js +9 -7
  23. package/dist/protocol/messages/createPage.d.ts +40 -2
  24. package/dist/protocol/messages/createPage.js +2 -2
  25. package/dist/protocol/messages/createPageResult.d.ts +584 -3
  26. package/dist/protocol/messages/createPageResult.js +17 -2
  27. package/dist/protocol/messages/getPage.d.ts +584 -3
  28. package/dist/protocol/messages/getPage.js +18 -3
  29. package/dist/protocol/messages/hostToSandbox.d.ts +1638 -376
  30. package/dist/protocol/messages/hostToSandbox.js +9 -6
  31. package/dist/protocol/messages/queryDataSourceResult.d.ts +222 -10
  32. package/dist/protocol/messages/queryDataSourceResult.js +4 -6
  33. package/dist/protocol/messages/sandboxToHost.d.ts +82 -4
  34. package/dist/protocol/messages/updatePage.d.ts +41 -2
  35. package/dist/protocol/messages/updatePage.js +4 -3
  36. package/dist/protocol/messages/updatePageResult.d.ts +583 -3
  37. package/dist/protocol/messages/updatePageResult.js +16 -2
  38. package/dist/protocol/pages/page.d.ts +622 -14
  39. package/dist/protocol/pages/page.js +41 -4
  40. package/dist/protocol/protocolVersion.js +1 -1
  41. package/package.json +1 -1
  42. package/src/dateValue.ts +120 -0
  43. package/src/index.ts +7 -4
  44. package/src/lifecycle/legacyPage.ts +30 -76
  45. package/src/lifecycle/normalizeHostToSandboxMessage.ts +13 -2
  46. package/src/lifecycle/normalizePage.ts +35 -0
  47. package/src/messages/types.ts +1 -1
  48. package/dist/lifecycle/normalizeQueryPage.d.ts +0 -3
  49. package/dist/lifecycle/normalizeQueryPage.d.ts.map +0 -1
  50. package/dist/lifecycle/normalizeQueryPage.js +0 -13
  51. package/src/lifecycle/normalizeQueryPage.ts +0 -25
@@ -1,9 +1,9 @@
1
1
  import * as v from "valibot";
2
2
  import { contrastModeChangedMessageSchema } from "./contrastModeChanged.js";
3
- import { createPageResultMessageSchema } from "./createPageResult.js";
3
+ import { createPageResultMessageLegacySchema, createPageResultMessageSchema, } from "./createPageResult.js";
4
4
  import { currentUserChangedMessageSchema } from "./currentUserChanged.js";
5
5
  import { dataSourcesChangedMessageSchema } from "./dataSourcesChanged.js";
6
- import { getPageResultMessageSchema } from "./getPage.js";
6
+ import { getPageResultMessageLegacySchema, getPageResultMessageSchema, } from "./getPage.js";
7
7
  import { getUserResultMessageSchema } from "./getUser.js";
8
8
  import { initMessageSchema } from "./init.js";
9
9
  import { invalidSandboxMessageSchema } from "./invalidSandboxMessage.js";
@@ -14,7 +14,7 @@ import { pageChangedMessageSchema } from "./pageChanged.js";
14
14
  import { parentChangedMessageSchema } from "./parentChanged.js";
15
15
  import { queryDataSourceResultMessageLegacySchema, queryDataSourceResultMessageSchema, } from "./queryDataSourceResult.js";
16
16
  import { themeChangedMessageSchema } from "./themeChanged.js";
17
- import { updatePageResultMessageSchema } from "./updatePageResult.js";
17
+ import { updatePageResultMessageLegacySchema, updatePageResultMessageSchema, } from "./updatePageResult.js";
18
18
  const baseHostToSandboxMessageSchema = v.variant("type", [
19
19
  initMessageSchema,
20
20
  themeChangedMessageSchema,
@@ -23,18 +23,18 @@ const baseHostToSandboxMessageSchema = v.variant("type", [
23
23
  pageChangedMessageSchema,
24
24
  currentUserChangedMessageSchema,
25
25
  dataSourcesChangedMessageSchema,
26
- createPageResultMessageSchema,
27
- getPageResultMessageSchema,
28
26
  getUserResultMessageSchema,
29
27
  listUsersResultMessageSchema,
30
28
  openPageResultMessageSchema,
31
29
  openExternalUrlResultMessageSchema,
32
- updatePageResultMessageSchema,
33
30
  invalidSandboxMessageSchema,
34
31
  ]);
35
32
  export const hostToSandboxMessageSchema = v.variant("type", [
36
33
  ...baseHostToSandboxMessageSchema.options,
37
34
  queryDataSourceResultMessageSchema,
35
+ getPageResultMessageSchema,
36
+ createPageResultMessageSchema,
37
+ updatePageResultMessageSchema,
38
38
  ]);
39
39
  /**
40
40
  * Discriminated union of every message the host is allowed to send the sandbox.
@@ -42,4 +42,7 @@ export const hostToSandboxMessageSchema = v.variant("type", [
42
42
  export const hostToSandboxMessageLegacySchema = v.variant("type", [
43
43
  ...baseHostToSandboxMessageSchema.options,
44
44
  queryDataSourceResultMessageLegacySchema,
45
+ getPageResultMessageLegacySchema,
46
+ createPageResultMessageLegacySchema,
47
+ updatePageResultMessageLegacySchema,
45
48
  ]);
@@ -16,10 +16,27 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
16
16
  readonly subscriptionId: v.StringSchema<undefined>;
17
17
  readonly status: v.LiteralSchema<"success", undefined>;
18
18
  readonly items: v.ArraySchema<v.ObjectSchema<{
19
+ readonly object: v.LiteralSchema<"page", undefined>;
19
20
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
20
- readonly is_archived: v.BooleanSchema<undefined>;
21
- readonly in_trash: v.BooleanSchema<undefined>;
22
- readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
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<{
23
40
  readonly id: v.StringSchema<undefined>;
24
41
  readonly type: v.LiteralSchema<"title", undefined>;
25
42
  readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
@@ -92,11 +109,49 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
92
109
  }, undefined>, v.ObjectSchema<{
93
110
  readonly id: v.StringSchema<undefined>;
94
111
  readonly type: v.LiteralSchema<"date", undefined>;
95
- readonly date: v.NullableSchema<v.ObjectSchema<{
112
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
113
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
114
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
115
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
116
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
117
+ readonly value: v.NumberSchema<undefined>;
118
+ readonly time: v.StringSchema<undefined>;
119
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
120
+ }, undefined>, v.ObjectSchema<{
121
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
122
+ readonly value: v.NumberSchema<undefined>;
123
+ }, undefined>], undefined>, v.ObjectSchema<{
124
+ readonly unit: v.LiteralSchema<"none", undefined>;
125
+ }, undefined>], undefined>, undefined>;
126
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
127
+ }, undefined>, v.ObjectSchema<{
128
+ readonly start: v.StringSchema<undefined>;
129
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
130
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
131
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
132
+ readonly value: v.NumberSchema<undefined>;
133
+ readonly time: v.StringSchema<undefined>;
134
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
135
+ }, undefined>, v.ObjectSchema<{
136
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
137
+ readonly value: v.NumberSchema<undefined>;
138
+ }, undefined>], undefined>, v.ObjectSchema<{
139
+ readonly unit: v.LiteralSchema<"none", undefined>;
140
+ }, undefined>], undefined>, undefined>;
141
+ readonly time_zone: v.StringSchema<undefined>;
142
+ }, undefined>, v.ObjectSchema<{
96
143
  readonly start: v.StringSchema<undefined>;
97
144
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
98
145
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
99
- }, undefined>, undefined>;
146
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
147
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
148
+ readonly value: v.NumberSchema<undefined>;
149
+ readonly time: v.StringSchema<undefined>;
150
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
151
+ }, undefined>, v.ObjectSchema<{
152
+ readonly unit: v.LiteralSchema<"none", undefined>;
153
+ }, undefined>], undefined>, undefined>;
154
+ }, undefined>], undefined>, undefined>;
100
155
  }, undefined>, v.ObjectSchema<{
101
156
  readonly id: v.StringSchema<undefined>;
102
157
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -172,6 +227,57 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
172
227
  readonly type: v.LiteralSchema<"last_visited_time", undefined>;
173
228
  readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
174
229
  }, undefined>], undefined>, undefined>, undefined>;
230
+ readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
231
+ readonly id: v.StringSchema<undefined>;
232
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
233
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
234
+ }, undefined>, undefined>, null>;
235
+ readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
236
+ readonly id: v.StringSchema<undefined>;
237
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
238
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
239
+ }, undefined>, undefined>, null>;
240
+ readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
241
+ readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
242
+ readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
243
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
244
+ readonly type: v.LiteralSchema<"emoji", undefined>;
245
+ readonly emoji: v.StringSchema<undefined>;
246
+ }, undefined>, v.ObjectSchema<{
247
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
248
+ readonly custom_emoji: v.ObjectSchema<{
249
+ readonly id: v.StringSchema<undefined>;
250
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
251
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
252
+ }, undefined>;
253
+ }, undefined>, v.ObjectSchema<{
254
+ readonly type: v.LiteralSchema<"external", undefined>;
255
+ readonly external: v.ObjectSchema<{
256
+ readonly url: v.StringSchema<undefined>;
257
+ }, undefined>;
258
+ }, undefined>, v.ObjectSchema<{
259
+ readonly type: v.LiteralSchema<"file", undefined>;
260
+ readonly file: v.ObjectSchema<{
261
+ readonly url: v.StringSchema<undefined>;
262
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
263
+ }, undefined>;
264
+ }, undefined>], undefined>, undefined>, null>;
265
+ readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
266
+ readonly type: v.LiteralSchema<"external", undefined>;
267
+ readonly external: v.ObjectSchema<{
268
+ readonly url: v.StringSchema<undefined>;
269
+ }, undefined>;
270
+ }, undefined>, v.ObjectSchema<{
271
+ readonly type: v.LiteralSchema<"file", undefined>;
272
+ readonly file: v.ObjectSchema<{
273
+ readonly url: v.StringSchema<undefined>;
274
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
275
+ }, undefined>;
276
+ }, undefined>], undefined>, undefined>, null>;
277
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
278
+ readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
279
+ readonly is_archived: v.BooleanSchema<undefined>;
280
+ readonly in_trash: v.BooleanSchema<undefined>;
175
281
  }, undefined>, undefined>;
176
282
  readonly hasMore: v.BooleanSchema<undefined>;
177
283
  }, undefined>, v.ObjectSchema<{
@@ -189,10 +295,27 @@ export declare const queryDataSourceResultMessageLegacySchema: v.VariantSchema<"
189
295
  readonly subscriptionId: v.StringSchema<undefined>;
190
296
  readonly status: v.LiteralSchema<"success", undefined>;
191
297
  readonly items: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
298
+ readonly object: v.LiteralSchema<"page", undefined>;
192
299
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
193
- readonly is_archived: v.BooleanSchema<undefined>;
194
- readonly in_trash: v.BooleanSchema<undefined>;
195
- readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
300
+ readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
301
+ readonly type: v.LiteralSchema<"page_id", undefined>;
302
+ readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
303
+ }, undefined>, v.ObjectSchema<{
304
+ readonly type: v.LiteralSchema<"data_source_id", undefined>;
305
+ readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
306
+ }, undefined>, v.ObjectSchema<{
307
+ readonly type: v.LiteralSchema<"workspace", undefined>;
308
+ readonly workspace: v.LiteralSchema<true, undefined>;
309
+ }, undefined>, v.ObjectSchema<{
310
+ readonly type: v.LiteralSchema<"block_id", undefined>;
311
+ readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
312
+ }, undefined>, v.ObjectSchema<{
313
+ readonly type: v.LiteralSchema<"agent_id", undefined>;
314
+ readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
315
+ }, undefined>, v.ObjectSchema<{
316
+ readonly type: v.LiteralSchema<"unavailable", undefined>;
317
+ }, undefined>], undefined>;
318
+ readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
196
319
  readonly id: v.StringSchema<undefined>;
197
320
  readonly type: v.LiteralSchema<"title", undefined>;
198
321
  readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
@@ -265,11 +388,49 @@ export declare const queryDataSourceResultMessageLegacySchema: v.VariantSchema<"
265
388
  }, undefined>, v.ObjectSchema<{
266
389
  readonly id: v.StringSchema<undefined>;
267
390
  readonly type: v.LiteralSchema<"date", undefined>;
268
- readonly date: v.NullableSchema<v.ObjectSchema<{
391
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
392
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
393
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
394
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
395
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
396
+ readonly value: v.NumberSchema<undefined>;
397
+ readonly time: v.StringSchema<undefined>;
398
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
399
+ }, undefined>, v.ObjectSchema<{
400
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
401
+ readonly value: v.NumberSchema<undefined>;
402
+ }, undefined>], undefined>, v.ObjectSchema<{
403
+ readonly unit: v.LiteralSchema<"none", undefined>;
404
+ }, undefined>], undefined>, undefined>;
405
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
406
+ }, undefined>, v.ObjectSchema<{
407
+ readonly start: v.StringSchema<undefined>;
408
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
409
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
410
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
411
+ readonly value: v.NumberSchema<undefined>;
412
+ readonly time: v.StringSchema<undefined>;
413
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
414
+ }, undefined>, v.ObjectSchema<{
415
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
416
+ readonly value: v.NumberSchema<undefined>;
417
+ }, undefined>], undefined>, v.ObjectSchema<{
418
+ readonly unit: v.LiteralSchema<"none", undefined>;
419
+ }, undefined>], undefined>, undefined>;
420
+ readonly time_zone: v.StringSchema<undefined>;
421
+ }, undefined>, v.ObjectSchema<{
269
422
  readonly start: v.StringSchema<undefined>;
270
423
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
271
424
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
272
- }, undefined>, undefined>;
425
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
426
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
427
+ readonly value: v.NumberSchema<undefined>;
428
+ readonly time: v.StringSchema<undefined>;
429
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
430
+ }, undefined>, v.ObjectSchema<{
431
+ readonly unit: v.LiteralSchema<"none", undefined>;
432
+ }, undefined>], undefined>, undefined>;
433
+ }, undefined>], undefined>, undefined>;
273
434
  }, undefined>, v.ObjectSchema<{
274
435
  readonly id: v.StringSchema<undefined>;
275
436
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -345,6 +506,57 @@ export declare const queryDataSourceResultMessageLegacySchema: v.VariantSchema<"
345
506
  readonly type: v.LiteralSchema<"last_visited_time", undefined>;
346
507
  readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
347
508
  }, undefined>], undefined>, undefined>, undefined>;
509
+ readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
510
+ readonly id: v.StringSchema<undefined>;
511
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
512
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
513
+ }, undefined>, undefined>, null>;
514
+ readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
515
+ readonly id: v.StringSchema<undefined>;
516
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
517
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
518
+ }, undefined>, undefined>, null>;
519
+ readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
520
+ readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
521
+ readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
522
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
523
+ readonly type: v.LiteralSchema<"emoji", undefined>;
524
+ readonly emoji: v.StringSchema<undefined>;
525
+ }, undefined>, v.ObjectSchema<{
526
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
527
+ readonly custom_emoji: v.ObjectSchema<{
528
+ readonly id: v.StringSchema<undefined>;
529
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
530
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
531
+ }, undefined>;
532
+ }, undefined>, v.ObjectSchema<{
533
+ readonly type: v.LiteralSchema<"external", undefined>;
534
+ readonly external: v.ObjectSchema<{
535
+ readonly url: v.StringSchema<undefined>;
536
+ }, undefined>;
537
+ }, undefined>, v.ObjectSchema<{
538
+ readonly type: v.LiteralSchema<"file", undefined>;
539
+ readonly file: v.ObjectSchema<{
540
+ readonly url: v.StringSchema<undefined>;
541
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
542
+ }, undefined>;
543
+ }, undefined>], undefined>, undefined>, null>;
544
+ readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
545
+ readonly type: v.LiteralSchema<"external", undefined>;
546
+ readonly external: v.ObjectSchema<{
547
+ readonly url: v.StringSchema<undefined>;
548
+ }, undefined>;
549
+ }, undefined>, v.ObjectSchema<{
550
+ readonly type: v.LiteralSchema<"file", undefined>;
551
+ readonly file: v.ObjectSchema<{
552
+ readonly url: v.StringSchema<undefined>;
553
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
554
+ }, undefined>;
555
+ }, undefined>], undefined>, undefined>, null>;
556
+ readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
557
+ readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
558
+ readonly is_archived: v.BooleanSchema<undefined>;
559
+ readonly in_trash: v.BooleanSchema<undefined>;
348
560
  }, undefined>, v.ObjectSchema<{
349
561
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
350
562
  readonly is_archived: v.BooleanSchema<undefined>;
@@ -1,5 +1,6 @@
1
1
  import * as v from "valibot";
2
- import { legacyNotionDataSourcePageBridgeSchema, notionDataSourcePageBridgeSchema, } from "../dataSources/dataSourcePage.js";
2
+ import { legacyNotionDataSourcePageBridgeSchema } from "../dataSources/dataSourcePage.js";
3
+ import { notionPageDataSchema } from "../pages/page.js";
3
4
  // The schema accepts any string code. The type lists known codes for
4
5
  // autocomplete, with an open string fallback for newer senders.
5
6
  export const customBlockQueryDataSourceErrorCodeSchema = v.string();
@@ -16,7 +17,7 @@ export const queryDataSourceResultMessageSchema = v.variant("status", [
16
17
  type: v.literal("queryDataSourceResult"),
17
18
  subscriptionId: v.string(),
18
19
  status: v.literal("success"),
19
- items: v.array(notionDataSourcePageBridgeSchema),
20
+ items: v.array(notionPageDataSchema),
20
21
  hasMore: v.boolean(),
21
22
  }),
22
23
  v.object({
@@ -31,10 +32,7 @@ export const queryDataSourceResultMessageLegacySchema = v.variant("status", [
31
32
  type: v.literal("queryDataSourceResult"),
32
33
  subscriptionId: v.string(),
33
34
  status: v.literal("success"),
34
- items: v.array(v.union([
35
- notionDataSourcePageBridgeSchema,
36
- legacyNotionDataSourcePageBridgeSchema,
37
- ])),
35
+ items: v.array(v.union([notionPageDataSchema, legacyNotionDataSourcePageBridgeSchema])),
38
36
  hasMore: v.boolean(),
39
37
  }),
40
38
  v.object({
@@ -650,11 +650,49 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
650
650
  }, undefined>, v.ObjectSchema<{
651
651
  readonly id: v.StringSchema<undefined>;
652
652
  readonly type: v.LiteralSchema<"date", undefined>;
653
- readonly date: v.NullableSchema<v.ObjectSchema<{
653
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
654
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
655
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
656
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
657
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
658
+ readonly value: v.NumberSchema<undefined>;
659
+ readonly time: v.StringSchema<undefined>;
660
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
661
+ }, undefined>, v.ObjectSchema<{
662
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
663
+ readonly value: v.NumberSchema<undefined>;
664
+ }, undefined>], undefined>, v.ObjectSchema<{
665
+ readonly unit: v.LiteralSchema<"none", undefined>;
666
+ }, undefined>], undefined>, undefined>;
667
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
668
+ }, undefined>, v.ObjectSchema<{
669
+ readonly start: v.StringSchema<undefined>;
670
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
671
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
672
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
673
+ readonly value: v.NumberSchema<undefined>;
674
+ readonly time: v.StringSchema<undefined>;
675
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
676
+ }, undefined>, v.ObjectSchema<{
677
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
678
+ readonly value: v.NumberSchema<undefined>;
679
+ }, undefined>], undefined>, v.ObjectSchema<{
680
+ readonly unit: v.LiteralSchema<"none", undefined>;
681
+ }, undefined>], undefined>, undefined>;
682
+ readonly time_zone: v.StringSchema<undefined>;
683
+ }, undefined>, v.ObjectSchema<{
654
684
  readonly start: v.StringSchema<undefined>;
655
685
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
656
686
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
657
- }, undefined>, undefined>;
687
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
688
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
689
+ readonly value: v.NumberSchema<undefined>;
690
+ readonly time: v.StringSchema<undefined>;
691
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
692
+ }, undefined>, v.ObjectSchema<{
693
+ readonly unit: v.LiteralSchema<"none", undefined>;
694
+ }, undefined>], undefined>, undefined>;
695
+ }, undefined>], undefined>, undefined>;
658
696
  }, undefined>, v.ObjectSchema<{
659
697
  readonly id: v.StringSchema<undefined>;
660
698
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -745,6 +783,7 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
745
783
  readonly type: v.LiteralSchema<"getPage", undefined>;
746
784
  readonly requestId: v.StringSchema<undefined>;
747
785
  readonly pageId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
786
+ readonly dataSourceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
748
787
  }, undefined>, v.ObjectSchema<{
749
788
  readonly type: v.LiteralSchema<"getUser", undefined>;
750
789
  readonly requestId: v.StringSchema<undefined>;
@@ -767,6 +806,7 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
767
806
  readonly type: v.LiteralSchema<"updatePage", undefined>;
768
807
  readonly requestId: v.StringSchema<undefined>;
769
808
  readonly pageId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
809
+ readonly dataSourceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
770
810
  readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
771
811
  readonly id: v.StringSchema<undefined>;
772
812
  readonly type: v.LiteralSchema<"title", undefined>;
@@ -840,11 +880,49 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
840
880
  }, undefined>, v.ObjectSchema<{
841
881
  readonly id: v.StringSchema<undefined>;
842
882
  readonly type: v.LiteralSchema<"date", undefined>;
843
- readonly date: v.NullableSchema<v.ObjectSchema<{
883
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
884
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
885
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
886
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
887
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
888
+ readonly value: v.NumberSchema<undefined>;
889
+ readonly time: v.StringSchema<undefined>;
890
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
891
+ }, undefined>, v.ObjectSchema<{
892
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
893
+ readonly value: v.NumberSchema<undefined>;
894
+ }, undefined>], undefined>, v.ObjectSchema<{
895
+ readonly unit: v.LiteralSchema<"none", undefined>;
896
+ }, undefined>], undefined>, undefined>;
897
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
898
+ }, undefined>, v.ObjectSchema<{
899
+ readonly start: v.StringSchema<undefined>;
900
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
901
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
902
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
903
+ readonly value: v.NumberSchema<undefined>;
904
+ readonly time: v.StringSchema<undefined>;
905
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
906
+ }, undefined>, v.ObjectSchema<{
907
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
908
+ readonly value: v.NumberSchema<undefined>;
909
+ }, undefined>], undefined>, v.ObjectSchema<{
910
+ readonly unit: v.LiteralSchema<"none", undefined>;
911
+ }, undefined>], undefined>, undefined>;
912
+ readonly time_zone: v.StringSchema<undefined>;
913
+ }, undefined>, v.ObjectSchema<{
844
914
  readonly start: v.StringSchema<undefined>;
845
915
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
846
916
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
847
- }, undefined>, undefined>;
917
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
918
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
919
+ readonly value: v.NumberSchema<undefined>;
920
+ readonly time: v.StringSchema<undefined>;
921
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
922
+ }, undefined>, v.ObjectSchema<{
923
+ readonly unit: v.LiteralSchema<"none", undefined>;
924
+ }, undefined>], undefined>, undefined>;
925
+ }, undefined>], undefined>, undefined>;
848
926
  }, undefined>, v.ObjectSchema<{
849
927
  readonly id: v.StringSchema<undefined>;
850
928
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -6,6 +6,7 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
6
6
  readonly type: v.LiteralSchema<"updatePage", undefined>;
7
7
  readonly requestId: v.StringSchema<undefined>;
8
8
  readonly pageId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
9
+ readonly dataSourceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
9
10
  /**
10
11
  * Property values, keyed by raw property IDs from Notion.
11
12
  *
@@ -86,11 +87,49 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
86
87
  }, undefined>, v.ObjectSchema<{
87
88
  readonly id: v.StringSchema<undefined>;
88
89
  readonly type: v.LiteralSchema<"date", undefined>;
89
- readonly date: v.NullableSchema<v.ObjectSchema<{
90
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
91
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
92
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
93
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
94
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
95
+ readonly value: v.NumberSchema<undefined>;
96
+ readonly time: v.StringSchema<undefined>;
97
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
98
+ }, undefined>, v.ObjectSchema<{
99
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
100
+ readonly value: v.NumberSchema<undefined>;
101
+ }, undefined>], undefined>, v.ObjectSchema<{
102
+ readonly unit: v.LiteralSchema<"none", undefined>;
103
+ }, undefined>], undefined>, undefined>;
104
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
105
+ }, undefined>, v.ObjectSchema<{
106
+ readonly start: v.StringSchema<undefined>;
107
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
108
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
109
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
110
+ readonly value: v.NumberSchema<undefined>;
111
+ readonly time: v.StringSchema<undefined>;
112
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
113
+ }, undefined>, v.ObjectSchema<{
114
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
115
+ readonly value: v.NumberSchema<undefined>;
116
+ }, undefined>], undefined>, v.ObjectSchema<{
117
+ readonly unit: v.LiteralSchema<"none", undefined>;
118
+ }, undefined>], undefined>, undefined>;
119
+ readonly time_zone: v.StringSchema<undefined>;
120
+ }, undefined>, v.ObjectSchema<{
90
121
  readonly start: v.StringSchema<undefined>;
91
122
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
92
123
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
93
- }, undefined>, undefined>;
124
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
125
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
126
+ readonly value: v.NumberSchema<undefined>;
127
+ readonly time: v.StringSchema<undefined>;
128
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
129
+ }, undefined>, v.ObjectSchema<{
130
+ readonly unit: v.LiteralSchema<"none", undefined>;
131
+ }, undefined>], undefined>, undefined>;
132
+ }, undefined>], undefined>, undefined>;
94
133
  }, undefined>, v.ObjectSchema<{
95
134
  readonly id: v.StringSchema<undefined>;
96
135
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -1,6 +1,6 @@
1
1
  import * as v from "valibot";
2
- import { notionPageIdSchema } from "../ids.js";
3
- import { notionPageCoverSchema, notionPageIconSchema, notionPagePropertyReadMapSchema, } from "../pages/page.js";
2
+ import { notionDataSourceIdSchema, notionPageIdSchema } from "../ids.js";
3
+ import { notionPageCoverSchema, notionPageIconSchema, notionPagePropertyWriteMapSchema, } from "../pages/page.js";
4
4
  /**
5
5
  * The sandbox sends this message to patch a page.
6
6
  */
@@ -8,6 +8,7 @@ export const updatePageMessageSchema = v.object({
8
8
  type: v.literal("updatePage"),
9
9
  requestId: v.string(),
10
10
  pageId: notionPageIdSchema,
11
+ dataSourceId: v.optional(notionDataSourceIdSchema),
11
12
  /**
12
13
  * Property values, keyed by raw property IDs from Notion.
13
14
  *
@@ -15,7 +16,7 @@ export const updatePageMessageSchema = v.object({
15
16
  * To update a page with manifest-defined property keys, call `row.update()` on a row returned
16
17
  * by `useDataSource()`. The SDK resolves those keys before it sends this message.
17
18
  */
18
- properties: v.optional(notionPagePropertyReadMapSchema),
19
+ properties: v.optional(notionPagePropertyWriteMapSchema),
19
20
  icon: v.optional(notionPageIconSchema),
20
21
  cover: v.optional(notionPageCoverSchema),
21
22
  archived: v.optional(v.boolean()),