@notionhq/custom-blocks 0.3.1 → 0.3.3

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 (46) hide show
  1. package/README.md +2 -8
  2. package/dist/bridge/SandboxBridge.d.ts +469 -15
  3. package/dist/bridge/SandboxBridge.d.ts.map +1 -1
  4. package/dist/bridge/SandboxBridge.js +119 -88
  5. package/dist/bridge/dataSources/resolveProperty.d.ts +1 -20
  6. package/dist/bridge/dataSources/resolveProperty.d.ts.map +1 -1
  7. package/dist/bridge/dataSources/resolveProperty.js +37 -32
  8. package/dist/bridge/page.d.ts +11 -7
  9. package/dist/bridge/page.d.ts.map +1 -1
  10. package/dist/bridge/page.js +20 -50
  11. package/dist/bridge/sandboxClient.d.ts.map +1 -1
  12. package/dist/bridge/sandboxClient.js +32 -6
  13. package/dist/dataSources.d.ts.map +1 -1
  14. package/dist/dataSources.js +4 -3
  15. package/dist/index.d.ts +1 -0
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/protocol/dataSources/dateValue.d.ts +2 -2
  18. package/dist/protocol/dataSources/dateValue.js +9 -7
  19. package/dist/protocol/messages/createPage.d.ts +64 -2
  20. package/dist/protocol/messages/createPageResult.d.ts +192 -6
  21. package/dist/protocol/messages/getPage.d.ts +192 -6
  22. package/dist/protocol/messages/hostToSandbox.d.ts +704 -22
  23. package/dist/protocol/messages/queryDataSourceResult.d.ts +128 -4
  24. package/dist/protocol/messages/sandboxToHost.d.ts +128 -4
  25. package/dist/protocol/messages/updatePage.d.ts +64 -2
  26. package/dist/protocol/messages/updatePageResult.d.ts +192 -6
  27. package/dist/protocol/pages/page.d.ts +360 -12
  28. package/dist/protocol/pages/page.js +48 -2
  29. package/dist/protocol/protocolVersion.d.ts +2 -1
  30. package/dist/protocol/protocolVersion.js +3 -1
  31. package/dist/types.d.ts +1 -1
  32. package/dist/types.d.ts.map +1 -1
  33. package/dist/version.js +1 -1
  34. package/docs/build-tools.md +55 -0
  35. package/docs/data-sources.md +12 -9
  36. package/docs/deployment.md +16 -34
  37. package/docs/errors.md +65 -52
  38. package/docs/pages.md +85 -78
  39. package/package.json +2 -18
  40. package/src/bridge/SandboxBridge.ts +168 -129
  41. package/src/bridge/dataSources/resolveProperty.ts +48 -39
  42. package/src/bridge/page.ts +32 -75
  43. package/src/bridge/sandboxClient.ts +40 -7
  44. package/src/dataSources.ts +7 -9
  45. package/src/index.ts +6 -0
  46. package/src/types.ts +6 -0
@@ -116,11 +116,49 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
116
116
  }, undefined>, v.ObjectSchema<{
117
117
  readonly id: v.StringSchema<undefined>;
118
118
  readonly type: v.LiteralSchema<"date", undefined>;
119
- readonly date: v.NullableSchema<v.ObjectSchema<{
119
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
120
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
121
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
122
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
123
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
124
+ readonly value: v.NumberSchema<undefined>;
125
+ readonly time: v.StringSchema<undefined>;
126
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
127
+ }, undefined>, v.ObjectSchema<{
128
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
129
+ readonly value: v.NumberSchema<undefined>;
130
+ }, undefined>], undefined>, v.ObjectSchema<{
131
+ readonly unit: v.LiteralSchema<"none", undefined>;
132
+ }, undefined>], undefined>, undefined>;
133
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
134
+ }, undefined>, v.ObjectSchema<{
135
+ readonly start: v.StringSchema<undefined>;
136
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
137
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
138
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
139
+ readonly value: v.NumberSchema<undefined>;
140
+ readonly time: v.StringSchema<undefined>;
141
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
142
+ }, undefined>, v.ObjectSchema<{
143
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
144
+ readonly value: v.NumberSchema<undefined>;
145
+ }, undefined>], undefined>, v.ObjectSchema<{
146
+ readonly unit: v.LiteralSchema<"none", undefined>;
147
+ }, undefined>], undefined>, undefined>;
148
+ readonly time_zone: v.StringSchema<undefined>;
149
+ }, undefined>, v.ObjectSchema<{
120
150
  readonly start: v.StringSchema<undefined>;
121
151
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
122
152
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
123
- }, undefined>, undefined>;
153
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
154
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
155
+ readonly value: v.NumberSchema<undefined>;
156
+ readonly time: v.StringSchema<undefined>;
157
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
158
+ }, undefined>, v.ObjectSchema<{
159
+ readonly unit: v.LiteralSchema<"none", undefined>;
160
+ }, undefined>], undefined>, undefined>;
161
+ }, undefined>], undefined>, undefined>;
124
162
  }, undefined>, v.ObjectSchema<{
125
163
  readonly id: v.StringSchema<undefined>;
126
164
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -195,6 +233,30 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
195
233
  readonly id: v.StringSchema<undefined>;
196
234
  readonly type: v.LiteralSchema<"last_visited_time", undefined>;
197
235
  readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
236
+ }, undefined>, v.ObjectSchema<{
237
+ readonly id: v.StringSchema<undefined>;
238
+ readonly type: v.LiteralSchema<"unique_id", undefined>;
239
+ readonly unique_id: v.StringSchema<undefined>;
240
+ }, undefined>, v.ObjectSchema<{
241
+ readonly id: v.StringSchema<undefined>;
242
+ readonly type: v.LiteralSchema<"button", undefined>;
243
+ readonly button: v.StringSchema<undefined>;
244
+ }, undefined>, v.ObjectSchema<{
245
+ readonly id: v.StringSchema<undefined>;
246
+ readonly type: v.LiteralSchema<"formula", undefined>;
247
+ readonly formula: v.StringSchema<undefined>;
248
+ }, undefined>, v.ObjectSchema<{
249
+ readonly id: v.StringSchema<undefined>;
250
+ readonly type: v.LiteralSchema<"location", undefined>;
251
+ readonly location: v.StringSchema<undefined>;
252
+ }, undefined>, v.ObjectSchema<{
253
+ readonly id: v.StringSchema<undefined>;
254
+ readonly type: v.LiteralSchema<"rollup", undefined>;
255
+ readonly rollup: v.StringSchema<undefined>;
256
+ }, undefined>, v.ObjectSchema<{
257
+ readonly id: v.StringSchema<undefined>;
258
+ readonly type: v.LiteralSchema<"verification", undefined>;
259
+ readonly verification: v.StringSchema<undefined>;
198
260
  }, undefined>], undefined>, undefined>, undefined>;
199
261
  readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
200
262
  readonly id: v.StringSchema<undefined>;
@@ -356,11 +418,49 @@ export declare const getPageResultMessageLegacySchema: v.VariantSchema<"status",
356
418
  }, undefined>, v.ObjectSchema<{
357
419
  readonly id: v.StringSchema<undefined>;
358
420
  readonly type: v.LiteralSchema<"date", undefined>;
359
- readonly date: v.NullableSchema<v.ObjectSchema<{
421
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
422
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
423
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
424
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
425
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
426
+ readonly value: v.NumberSchema<undefined>;
427
+ readonly time: v.StringSchema<undefined>;
428
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
429
+ }, undefined>, v.ObjectSchema<{
430
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
431
+ readonly value: v.NumberSchema<undefined>;
432
+ }, undefined>], undefined>, v.ObjectSchema<{
433
+ readonly unit: v.LiteralSchema<"none", undefined>;
434
+ }, undefined>], undefined>, undefined>;
435
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
436
+ }, undefined>, v.ObjectSchema<{
437
+ readonly start: v.StringSchema<undefined>;
438
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
439
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
440
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
441
+ readonly value: v.NumberSchema<undefined>;
442
+ readonly time: v.StringSchema<undefined>;
443
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
444
+ }, undefined>, v.ObjectSchema<{
445
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
446
+ readonly value: v.NumberSchema<undefined>;
447
+ }, undefined>], undefined>, v.ObjectSchema<{
448
+ readonly unit: v.LiteralSchema<"none", undefined>;
449
+ }, undefined>], undefined>, undefined>;
450
+ readonly time_zone: v.StringSchema<undefined>;
451
+ }, undefined>, v.ObjectSchema<{
360
452
  readonly start: v.StringSchema<undefined>;
361
453
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
362
454
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
363
- }, undefined>, undefined>;
455
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
456
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
457
+ readonly value: v.NumberSchema<undefined>;
458
+ readonly time: v.StringSchema<undefined>;
459
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
460
+ }, undefined>, v.ObjectSchema<{
461
+ readonly unit: v.LiteralSchema<"none", undefined>;
462
+ }, undefined>], undefined>, undefined>;
463
+ }, undefined>], undefined>, undefined>;
364
464
  }, undefined>, v.ObjectSchema<{
365
465
  readonly id: v.StringSchema<undefined>;
366
466
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -435,6 +535,30 @@ export declare const getPageResultMessageLegacySchema: v.VariantSchema<"status",
435
535
  readonly id: v.StringSchema<undefined>;
436
536
  readonly type: v.LiteralSchema<"last_visited_time", undefined>;
437
537
  readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
538
+ }, undefined>, v.ObjectSchema<{
539
+ readonly id: v.StringSchema<undefined>;
540
+ readonly type: v.LiteralSchema<"unique_id", undefined>;
541
+ readonly unique_id: v.StringSchema<undefined>;
542
+ }, undefined>, v.ObjectSchema<{
543
+ readonly id: v.StringSchema<undefined>;
544
+ readonly type: v.LiteralSchema<"button", undefined>;
545
+ readonly button: v.StringSchema<undefined>;
546
+ }, undefined>, v.ObjectSchema<{
547
+ readonly id: v.StringSchema<undefined>;
548
+ readonly type: v.LiteralSchema<"formula", undefined>;
549
+ readonly formula: v.StringSchema<undefined>;
550
+ }, undefined>, v.ObjectSchema<{
551
+ readonly id: v.StringSchema<undefined>;
552
+ readonly type: v.LiteralSchema<"location", undefined>;
553
+ readonly location: v.StringSchema<undefined>;
554
+ }, undefined>, v.ObjectSchema<{
555
+ readonly id: v.StringSchema<undefined>;
556
+ readonly type: v.LiteralSchema<"rollup", undefined>;
557
+ readonly rollup: v.StringSchema<undefined>;
558
+ }, undefined>, v.ObjectSchema<{
559
+ readonly id: v.StringSchema<undefined>;
560
+ readonly type: v.LiteralSchema<"verification", undefined>;
561
+ readonly verification: v.StringSchema<undefined>;
438
562
  }, undefined>], undefined>, undefined>, undefined>;
439
563
  readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
440
564
  readonly id: v.StringSchema<undefined>;
@@ -581,11 +705,49 @@ export declare const getPageResultMessageLegacySchema: v.VariantSchema<"status",
581
705
  }, undefined>, v.ObjectSchema<{
582
706
  readonly id: v.StringSchema<undefined>;
583
707
  readonly type: v.LiteralSchema<"date", undefined>;
584
- readonly date: v.NullableSchema<v.ObjectSchema<{
708
+ readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
709
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
710
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
711
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
712
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
713
+ readonly value: v.NumberSchema<undefined>;
714
+ readonly time: v.StringSchema<undefined>;
715
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
716
+ }, undefined>, v.ObjectSchema<{
717
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
718
+ readonly value: v.NumberSchema<undefined>;
719
+ }, undefined>], undefined>, v.ObjectSchema<{
720
+ readonly unit: v.LiteralSchema<"none", undefined>;
721
+ }, undefined>], undefined>, undefined>;
722
+ readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
723
+ }, undefined>, v.ObjectSchema<{
724
+ readonly start: v.StringSchema<undefined>;
725
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
726
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
727
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
728
+ readonly value: v.NumberSchema<undefined>;
729
+ readonly time: v.StringSchema<undefined>;
730
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
731
+ }, undefined>, v.ObjectSchema<{
732
+ readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
733
+ readonly value: v.NumberSchema<undefined>;
734
+ }, undefined>], undefined>, v.ObjectSchema<{
735
+ readonly unit: v.LiteralSchema<"none", undefined>;
736
+ }, undefined>], undefined>, undefined>;
737
+ readonly time_zone: v.StringSchema<undefined>;
738
+ }, undefined>, v.ObjectSchema<{
585
739
  readonly start: v.StringSchema<undefined>;
586
740
  readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
587
741
  readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
588
- }, undefined>, undefined>;
742
+ readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
743
+ readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
744
+ readonly value: v.NumberSchema<undefined>;
745
+ readonly time: v.StringSchema<undefined>;
746
+ readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
747
+ }, undefined>, v.ObjectSchema<{
748
+ readonly unit: v.LiteralSchema<"none", undefined>;
749
+ }, undefined>], undefined>, undefined>;
750
+ }, undefined>], undefined>, undefined>;
589
751
  }, undefined>, v.ObjectSchema<{
590
752
  readonly id: v.StringSchema<undefined>;
591
753
  readonly type: v.LiteralSchema<"people", undefined>;
@@ -660,6 +822,30 @@ export declare const getPageResultMessageLegacySchema: v.VariantSchema<"status",
660
822
  readonly id: v.StringSchema<undefined>;
661
823
  readonly type: v.LiteralSchema<"last_visited_time", undefined>;
662
824
  readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
825
+ }, undefined>, v.ObjectSchema<{
826
+ readonly id: v.StringSchema<undefined>;
827
+ readonly type: v.LiteralSchema<"unique_id", undefined>;
828
+ readonly unique_id: v.StringSchema<undefined>;
829
+ }, undefined>, v.ObjectSchema<{
830
+ readonly id: v.StringSchema<undefined>;
831
+ readonly type: v.LiteralSchema<"button", undefined>;
832
+ readonly button: v.StringSchema<undefined>;
833
+ }, undefined>, v.ObjectSchema<{
834
+ readonly id: v.StringSchema<undefined>;
835
+ readonly type: v.LiteralSchema<"formula", undefined>;
836
+ readonly formula: v.StringSchema<undefined>;
837
+ }, undefined>, v.ObjectSchema<{
838
+ readonly id: v.StringSchema<undefined>;
839
+ readonly type: v.LiteralSchema<"location", undefined>;
840
+ readonly location: v.StringSchema<undefined>;
841
+ }, undefined>, v.ObjectSchema<{
842
+ readonly id: v.StringSchema<undefined>;
843
+ readonly type: v.LiteralSchema<"rollup", undefined>;
844
+ readonly rollup: v.StringSchema<undefined>;
845
+ }, undefined>, v.ObjectSchema<{
846
+ readonly id: v.StringSchema<undefined>;
847
+ readonly type: v.LiteralSchema<"verification", undefined>;
848
+ readonly verification: v.StringSchema<undefined>;
663
849
  }, undefined>], undefined>, undefined>;
664
850
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
665
851
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;