@notionhq/custom-blocks-host 0.5.1 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +9 -0
  2. package/dist/browser.js +1 -1
  3. package/dist/compatibility/normalizeHostToSandboxMessage.d.ts.map +1 -1
  4. package/dist/compatibility/normalizeHostToSandboxMessage.js +5 -1
  5. package/dist/compatibility/normalizeSandboxToHostMessage.d.ts +88 -1
  6. package/dist/compatibility/normalizeSandboxToHostMessage.d.ts.map +1 -1
  7. package/dist/compatibility/pages/toIconForProtocol3To8.d.ts +4 -0
  8. package/dist/compatibility/pages/toIconForProtocol3To8.d.ts.map +1 -0
  9. package/dist/compatibility/pages/toIconForProtocol3To8.js +13 -0
  10. package/dist/compatibility/protocol3To5/toPageForProtocol3To5.d.ts.map +1 -1
  11. package/dist/compatibility/protocol3To5/toPageForProtocol3To5.js +2 -1
  12. package/dist/compatibility/protocol3To5/toQueryPageForProtocol3To5.d.ts +8 -8
  13. package/dist/compatibility/protocol6/normalizePageResultsForProtocol6.d.ts.map +1 -1
  14. package/dist/compatibility/protocol6/normalizePageResultsForProtocol6.js +9 -2
  15. package/dist/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.d.ts +4 -0
  16. package/dist/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.d.ts.map +1 -0
  17. package/dist/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.js +16 -0
  18. package/dist/createCustomBlockHost.d.ts.map +1 -1
  19. package/dist/createCustomBlockHost.js +50 -34
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/messages/createSandboxMessageRouter.d.ts +3 -2
  23. package/dist/messages/createSandboxMessageRouter.d.ts.map +1 -1
  24. package/dist/messages/createSandboxMessageRouter.js +7 -1
  25. package/dist/messages/getInvalidSandboxMessageResponse.d.ts.map +1 -1
  26. package/dist/messages/getInvalidSandboxMessageResponse.js +3 -0
  27. package/dist/messages/invalidNativeIconColor.d.ts +5 -0
  28. package/dist/messages/invalidNativeIconColor.d.ts.map +1 -0
  29. package/dist/messages/invalidNativeIconColor.js +34 -0
  30. package/dist/pages/types.d.ts +2 -0
  31. package/dist/pages/types.d.ts.map +1 -1
  32. package/dist/protocol/compatibility/protocol3To5/bridgePage.d.ts +7 -1
  33. package/dist/protocol/dataSources/messages/queryDataSource.d.ts +14 -2
  34. package/dist/protocol/icons.d.ts +17 -0
  35. package/dist/protocol/icons.js +27 -0
  36. package/dist/protocol/index.d.ts +5 -3
  37. package/dist/protocol/index.js +4 -2
  38. package/dist/protocol/messages/hostToSandbox.d.ts +79 -11
  39. package/dist/protocol/messages/invalidHostMessage.d.ts +2 -0
  40. package/dist/protocol/messages/invalidHostMessage.js +2 -0
  41. package/dist/protocol/messages/invalidSandboxMessage.d.ts +2 -0
  42. package/dist/protocol/messages/invalidSandboxMessage.js +2 -0
  43. package/dist/protocol/messages/sandboxToHost.d.ts +88 -1
  44. package/dist/protocol/navigation/openExternalUrl.d.ts +2 -2
  45. package/dist/protocol/pages/bridgePage.d.ts +7 -1
  46. package/dist/protocol/pages/messages/createPage.d.ts +103 -5
  47. package/dist/protocol/pages/messages/createPage.js +3 -1
  48. package/dist/protocol/pages/messages/getPage.d.ts +23 -5
  49. package/dist/protocol/pages/messages/openPage.d.ts +2 -2
  50. package/dist/protocol/pages/messages/updatePage.d.ts +30 -6
  51. package/dist/protocol/pages/pageAppearance.d.ts +36 -1
  52. package/dist/protocol/pages/pageAppearance.js +9 -0
  53. package/dist/protocol/users/messages/getUser.d.ts +2 -2
  54. package/dist/protocol/users/messages/listUsers.d.ts +2 -2
  55. package/dist/protocol/utils/errors.d.ts +2 -0
  56. package/dist/protocol/utils/protocolVersion.d.ts +2 -1
  57. package/dist/protocol/utils/protocolVersion.js +3 -1
  58. package/dist/protocol/utils/readRequestId.d.ts +2 -0
  59. package/dist/protocol/utils/readRequestId.js +7 -0
  60. package/docs/bridge/changelog.md +19 -0
  61. package/docs/bridge/protocol.md +30 -1
  62. package/docs/bridge/versioning.md +1 -0
  63. package/docs/compatibility.md +15 -7
  64. package/docs/handlers.md +6 -3
  65. package/package.json +1 -1
  66. package/src/compatibility/normalizeHostToSandboxMessage.ts +5 -0
  67. package/src/compatibility/pages/toIconForProtocol3To8.ts +17 -0
  68. package/src/compatibility/protocol3To5/toPageForProtocol3To5.ts +2 -1
  69. package/src/compatibility/protocol6/normalizePageResultsForProtocol6.ts +11 -2
  70. package/src/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.ts +22 -0
  71. package/src/createCustomBlockHost.ts +57 -37
  72. package/src/index.ts +1 -0
  73. package/src/messages/createSandboxMessageRouter.ts +18 -2
  74. package/src/messages/getInvalidSandboxMessageResponse.ts +3 -0
  75. package/src/messages/invalidNativeIconColor.ts +43 -0
  76. package/src/pages/types.ts +3 -0
@@ -541,6 +541,7 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
541
541
  }, undefined>;
542
542
  }, undefined>], undefined>, v.ObjectSchema<{
543
543
  readonly type: v.LiteralSchema<"invalidSandboxMessage", undefined>;
544
+ readonly requestId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
544
545
  readonly reason: v.StringSchema<undefined>;
545
546
  }, undefined>, v.VariantSchema<"status", [v.ObjectSchema<{
546
547
  readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
@@ -795,7 +796,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
795
796
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
796
797
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
797
798
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
798
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
799
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
800
+ readonly type: v.LiteralSchema<"icon", undefined>;
801
+ readonly icon: v.LooseObjectSchema<{
802
+ readonly name: v.StringSchema<undefined>;
803
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
804
+ }, undefined>;
805
+ }, undefined>, v.ObjectSchema<{
799
806
  readonly type: v.LiteralSchema<"emoji", undefined>;
800
807
  readonly emoji: v.StringSchema<undefined>;
801
808
  }, undefined>, v.ObjectSchema<{
@@ -1097,7 +1104,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
1097
1104
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1098
1105
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1099
1106
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1100
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1107
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1108
+ readonly type: v.LiteralSchema<"icon", undefined>;
1109
+ readonly icon: v.LooseObjectSchema<{
1110
+ readonly name: v.StringSchema<undefined>;
1111
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
1112
+ }, undefined>;
1113
+ }, undefined>, v.ObjectSchema<{
1101
1114
  readonly type: v.LiteralSchema<"emoji", undefined>;
1102
1115
  readonly emoji: v.StringSchema<undefined>;
1103
1116
  }, undefined>, v.ObjectSchema<{
@@ -1398,7 +1411,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
1398
1411
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1399
1412
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1400
1413
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1401
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1414
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1415
+ readonly type: v.LiteralSchema<"icon", undefined>;
1416
+ readonly icon: v.LooseObjectSchema<{
1417
+ readonly name: v.StringSchema<undefined>;
1418
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
1419
+ }, undefined>;
1420
+ }, undefined>, v.ObjectSchema<{
1402
1421
  readonly type: v.LiteralSchema<"emoji", undefined>;
1403
1422
  readonly emoji: v.StringSchema<undefined>;
1404
1423
  }, undefined>, v.ObjectSchema<{
@@ -1699,7 +1718,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
1699
1718
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1700
1719
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1701
1720
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
1702
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1721
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1722
+ readonly type: v.LiteralSchema<"icon", undefined>;
1723
+ readonly icon: v.LooseObjectSchema<{
1724
+ readonly name: v.StringSchema<undefined>;
1725
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
1726
+ }, undefined>;
1727
+ }, undefined>, v.ObjectSchema<{
1703
1728
  readonly type: v.LiteralSchema<"emoji", undefined>;
1704
1729
  readonly emoji: v.StringSchema<undefined>;
1705
1730
  }, undefined>, v.ObjectSchema<{
@@ -2293,6 +2318,7 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
2293
2318
  }, undefined>;
2294
2319
  }, undefined>], undefined>, v.ObjectSchema<{
2295
2320
  readonly type: v.LiteralSchema<"invalidSandboxMessage", undefined>;
2321
+ readonly requestId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2296
2322
  readonly reason: v.StringSchema<undefined>;
2297
2323
  }, undefined>, v.VariantSchema<"status", [v.ObjectSchema<{
2298
2324
  readonly type: v.LiteralSchema<"queryDataSourceResult", undefined>;
@@ -2547,7 +2573,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
2547
2573
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
2548
2574
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
2549
2575
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
2550
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
2576
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
2577
+ readonly type: v.LiteralSchema<"icon", undefined>;
2578
+ readonly icon: v.LooseObjectSchema<{
2579
+ readonly name: v.StringSchema<undefined>;
2580
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
2581
+ }, undefined>;
2582
+ }, undefined>, v.ObjectSchema<{
2551
2583
  readonly type: v.LiteralSchema<"emoji", undefined>;
2552
2584
  readonly emoji: v.StringSchema<undefined>;
2553
2585
  }, undefined>, v.ObjectSchema<{
@@ -2914,7 +2946,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
2914
2946
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
2915
2947
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
2916
2948
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
2917
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
2949
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
2950
+ readonly type: v.LiteralSchema<"icon", undefined>;
2951
+ readonly icon: v.LooseObjectSchema<{
2952
+ readonly name: v.StringSchema<undefined>;
2953
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
2954
+ }, undefined>;
2955
+ }, undefined>, v.ObjectSchema<{
2918
2956
  readonly type: v.LiteralSchema<"emoji", undefined>;
2919
2957
  readonly emoji: v.StringSchema<undefined>;
2920
2958
  }, undefined>, v.ObjectSchema<{
@@ -3190,7 +3228,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
3190
3228
  }, undefined>], undefined>, undefined>;
3191
3229
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3192
3230
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3193
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
3231
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
3232
+ readonly type: v.LiteralSchema<"icon", undefined>;
3233
+ readonly icon: v.LooseObjectSchema<{
3234
+ readonly name: v.StringSchema<undefined>;
3235
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
3236
+ }, undefined>;
3237
+ }, undefined>, v.ObjectSchema<{
3194
3238
  readonly type: v.LiteralSchema<"emoji", undefined>;
3195
3239
  readonly emoji: v.StringSchema<undefined>;
3196
3240
  }, undefined>, v.ObjectSchema<{
@@ -3491,7 +3535,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
3491
3535
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
3492
3536
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
3493
3537
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
3494
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
3538
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
3539
+ readonly type: v.LiteralSchema<"icon", undefined>;
3540
+ readonly icon: v.LooseObjectSchema<{
3541
+ readonly name: v.StringSchema<undefined>;
3542
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
3543
+ }, undefined>;
3544
+ }, undefined>, v.ObjectSchema<{
3495
3545
  readonly type: v.LiteralSchema<"emoji", undefined>;
3496
3546
  readonly emoji: v.StringSchema<undefined>;
3497
3547
  }, undefined>, v.ObjectSchema<{
@@ -3767,7 +3817,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
3767
3817
  }, undefined>], undefined>, undefined>;
3768
3818
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3769
3819
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
3770
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
3820
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
3821
+ readonly type: v.LiteralSchema<"icon", undefined>;
3822
+ readonly icon: v.LooseObjectSchema<{
3823
+ readonly name: v.StringSchema<undefined>;
3824
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
3825
+ }, undefined>;
3826
+ }, undefined>, v.ObjectSchema<{
3771
3827
  readonly type: v.LiteralSchema<"emoji", undefined>;
3772
3828
  readonly emoji: v.StringSchema<undefined>;
3773
3829
  }, undefined>, v.ObjectSchema<{
@@ -4068,7 +4124,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
4068
4124
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
4069
4125
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
4070
4126
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
4071
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
4127
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
4128
+ readonly type: v.LiteralSchema<"icon", undefined>;
4129
+ readonly icon: v.LooseObjectSchema<{
4130
+ readonly name: v.StringSchema<undefined>;
4131
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
4132
+ }, undefined>;
4133
+ }, undefined>, v.ObjectSchema<{
4072
4134
  readonly type: v.LiteralSchema<"emoji", undefined>;
4073
4135
  readonly emoji: v.StringSchema<undefined>;
4074
4136
  }, undefined>, v.ObjectSchema<{
@@ -4344,7 +4406,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
4344
4406
  }, undefined>], undefined>, undefined>;
4345
4407
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4346
4408
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
4347
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
4409
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
4410
+ readonly type: v.LiteralSchema<"icon", undefined>;
4411
+ readonly icon: v.LooseObjectSchema<{
4412
+ readonly name: v.StringSchema<undefined>;
4413
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
4414
+ }, undefined>;
4415
+ }, undefined>, v.ObjectSchema<{
4348
4416
  readonly type: v.LiteralSchema<"emoji", undefined>;
4349
4417
  readonly emoji: v.StringSchema<undefined>;
4350
4418
  }, undefined>, v.ObjectSchema<{
@@ -6,6 +6,8 @@ import * as v from "valibot";
6
6
  */
7
7
  export declare const invalidHostMessageSchema: v.ObjectSchema<{
8
8
  readonly type: v.LiteralSchema<"invalidHostMessage", undefined>;
9
+ /** Identifies the rejected request or response, when readable. */
10
+ readonly requestId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9
11
  /**
10
12
  * A human-readable string intended for sandbox-side logging. It has no structured contract.
11
13
  */
@@ -6,6 +6,8 @@ import * as v from "valibot";
6
6
  */
7
7
  export const invalidHostMessageSchema = v.object({
8
8
  type: v.literal("invalidHostMessage"),
9
+ /** Identifies the rejected request or response, when readable. */
10
+ requestId: v.optional(v.string()),
9
11
  /**
10
12
  * A human-readable string intended for sandbox-side logging. It has no structured contract.
11
13
  */
@@ -6,6 +6,8 @@ import * as v from "valibot";
6
6
  */
7
7
  export declare const invalidSandboxMessageSchema: v.ObjectSchema<{
8
8
  readonly type: v.LiteralSchema<"invalidSandboxMessage", undefined>;
9
+ /** Identifies the rejected request or response, when readable. */
10
+ readonly requestId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
9
11
  /**
10
12
  * A human-readable string intended for sandbox-side logging. It has no structured contract.
11
13
  */
@@ -6,6 +6,8 @@ import * as v from "valibot";
6
6
  */
7
7
  export const invalidSandboxMessageSchema = v.object({
8
8
  type: v.literal("invalidSandboxMessage"),
9
+ /** Identifies the rejected request or response, when readable. */
10
+ requestId: v.optional(v.string()),
9
11
  /**
10
12
  * A human-readable string intended for sandbox-side logging. It has no structured contract.
11
13
  */
@@ -797,6 +797,46 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
797
797
  readonly type: v.LiteralSchema<"verification", undefined>;
798
798
  readonly verification: v.StringSchema<undefined>;
799
799
  }, undefined>], undefined>, undefined>;
800
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
801
+ readonly type: v.LiteralSchema<"icon", undefined>;
802
+ readonly icon: v.LooseObjectSchema<{
803
+ readonly name: v.StringSchema<undefined>;
804
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
805
+ }, undefined>;
806
+ }, undefined>, v.ObjectSchema<{
807
+ readonly type: v.LiteralSchema<"emoji", undefined>;
808
+ readonly emoji: v.StringSchema<undefined>;
809
+ }, undefined>, v.ObjectSchema<{
810
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
811
+ readonly custom_emoji: v.ObjectSchema<{
812
+ readonly id: v.StringSchema<undefined>;
813
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
814
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
815
+ }, undefined>;
816
+ }, undefined>, v.ObjectSchema<{
817
+ readonly type: v.LiteralSchema<"external", undefined>;
818
+ readonly external: v.ObjectSchema<{
819
+ readonly url: v.StringSchema<undefined>;
820
+ }, undefined>;
821
+ }, undefined>, v.ObjectSchema<{
822
+ readonly type: v.LiteralSchema<"file", undefined>;
823
+ readonly file: v.ObjectSchema<{
824
+ readonly url: v.StringSchema<undefined>;
825
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
826
+ }, undefined>;
827
+ }, undefined>], undefined>, undefined>;
828
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
829
+ readonly type: v.LiteralSchema<"external", undefined>;
830
+ readonly external: v.ObjectSchema<{
831
+ readonly url: v.StringSchema<undefined>;
832
+ }, undefined>;
833
+ }, undefined>, v.ObjectSchema<{
834
+ readonly type: v.LiteralSchema<"file", undefined>;
835
+ readonly file: v.ObjectSchema<{
836
+ readonly url: v.StringSchema<undefined>;
837
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
838
+ }, undefined>;
839
+ }, undefined>], undefined>, undefined>;
800
840
  readonly parent: v.ObjectSchema<{
801
841
  readonly type: v.LiteralSchema<"page_id", undefined>;
802
842
  readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
@@ -1030,6 +1070,46 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
1030
1070
  readonly type: v.LiteralSchema<"verification", undefined>;
1031
1071
  readonly verification: v.StringSchema<undefined>;
1032
1072
  }, undefined>], undefined>, undefined>;
1073
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1074
+ readonly type: v.LiteralSchema<"icon", undefined>;
1075
+ readonly icon: v.LooseObjectSchema<{
1076
+ readonly name: v.StringSchema<undefined>;
1077
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
1078
+ }, undefined>;
1079
+ }, undefined>, v.ObjectSchema<{
1080
+ readonly type: v.LiteralSchema<"emoji", undefined>;
1081
+ readonly emoji: v.StringSchema<undefined>;
1082
+ }, undefined>, v.ObjectSchema<{
1083
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
1084
+ readonly custom_emoji: v.ObjectSchema<{
1085
+ readonly id: v.StringSchema<undefined>;
1086
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1087
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1088
+ }, undefined>;
1089
+ }, undefined>, v.ObjectSchema<{
1090
+ readonly type: v.LiteralSchema<"external", undefined>;
1091
+ readonly external: v.ObjectSchema<{
1092
+ readonly url: v.StringSchema<undefined>;
1093
+ }, undefined>;
1094
+ }, undefined>, v.ObjectSchema<{
1095
+ readonly type: v.LiteralSchema<"file", undefined>;
1096
+ readonly file: v.ObjectSchema<{
1097
+ readonly url: v.StringSchema<undefined>;
1098
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1099
+ }, undefined>;
1100
+ }, undefined>], undefined>, undefined>;
1101
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1102
+ readonly type: v.LiteralSchema<"external", undefined>;
1103
+ readonly external: v.ObjectSchema<{
1104
+ readonly url: v.StringSchema<undefined>;
1105
+ }, undefined>;
1106
+ }, undefined>, v.ObjectSchema<{
1107
+ readonly type: v.LiteralSchema<"file", undefined>;
1108
+ readonly file: v.ObjectSchema<{
1109
+ readonly url: v.StringSchema<undefined>;
1110
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1111
+ }, undefined>;
1112
+ }, undefined>], undefined>, undefined>;
1033
1113
  readonly parent: v.ObjectSchema<{
1034
1114
  readonly type: v.LiteralSchema<"data_source_id", undefined>;
1035
1115
  readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
@@ -1278,7 +1358,13 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
1278
1358
  readonly type: v.LiteralSchema<"verification", undefined>;
1279
1359
  readonly verification: v.StringSchema<undefined>;
1280
1360
  }, undefined>], undefined>, undefined>, undefined>;
1281
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1361
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1362
+ readonly type: v.LiteralSchema<"icon", undefined>;
1363
+ readonly icon: v.LooseObjectSchema<{
1364
+ readonly name: v.StringSchema<undefined>;
1365
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
1366
+ }, undefined>;
1367
+ }, undefined>, v.ObjectSchema<{
1282
1368
  readonly type: v.LiteralSchema<"emoji", undefined>;
1283
1369
  readonly emoji: v.StringSchema<undefined>;
1284
1370
  }, undefined>, v.ObjectSchema<{
@@ -1318,6 +1404,7 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
1318
1404
  readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
1319
1405
  }, undefined>, v.ObjectSchema<{
1320
1406
  readonly type: v.LiteralSchema<"invalidHostMessage", undefined>;
1407
+ readonly requestId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1321
1408
  readonly reason: v.StringSchema<undefined>;
1322
1409
  }, undefined>], undefined>;
1323
1410
  export type SandboxToHostMessage = v.InferOutput<typeof sandboxToHostMessageSchema>;
@@ -1,7 +1,7 @@
1
1
  import * as v from "valibot";
2
- import type { CustomBlockErrorCode, CustomBlockErrorInfo } from "../utils/errors.js";
2
+ import type { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockRequestErrorCode } from "../utils/errors.js";
3
3
  export declare const customBlockOpenExternalUrlErrorCodeSchema: v.StringSchema<undefined>;
4
- export type CustomBlockOpenExternalUrlErrorCode = CustomBlockErrorCode<"user_decline" | "pending_navigation" | "invalid_url">;
4
+ export type CustomBlockOpenExternalUrlErrorCode = CustomBlockErrorCode<CustomBlockRequestErrorCode | "user_decline" | "pending_navigation" | "invalid_url">;
5
5
  export type CustomBlockOpenExternalUrlErrorInfo = CustomBlockErrorInfo<CustomBlockOpenExternalUrlErrorCode>;
6
6
  export declare const customBlockOpenExternalUrlErrorInfoSchema: v.ObjectSchema<{
7
7
  readonly code: v.StringSchema<undefined>;
@@ -248,7 +248,13 @@ export declare const bridgePageSchema: v.ObjectSchema<{
248
248
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
249
249
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
250
250
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
251
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
251
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
252
+ readonly type: v.LiteralSchema<"icon", undefined>;
253
+ readonly icon: v.LooseObjectSchema<{
254
+ readonly name: v.StringSchema<undefined>;
255
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
256
+ }, undefined>;
257
+ }, undefined>, v.ObjectSchema<{
252
258
  readonly type: v.LiteralSchema<"emoji", undefined>;
253
259
  readonly emoji: v.StringSchema<undefined>;
254
260
  }, undefined>, v.ObjectSchema<{
@@ -1,7 +1,7 @@
1
1
  import * as v from "valibot";
2
- import type { CustomBlockCapabilityErrorCode, CustomBlockErrorCode, CustomBlockErrorInfo } from "../../utils/errors.js";
2
+ import type { CustomBlockCapabilityErrorCode, CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockRequestErrorCode } from "../../utils/errors.js";
3
3
  export declare const customBlockCreatePageErrorCodeSchema: v.StringSchema<undefined>;
4
- export type CustomBlockCreatePageErrorCode = CustomBlockErrorCode<"create_page_failed" | "invalid_page_parent" | "page_unavailable" | "data_source_access_failed" | "unknown_data_source_key" | "unmapped_data_source" | "data_source_inaccessible" | "unmapped_property" | "property_id_mismatch" | "duplicate_property" | "invalid_property_value" | CustomBlockCapabilityErrorCode>;
4
+ export type CustomBlockCreatePageErrorCode = CustomBlockErrorCode<CustomBlockRequestErrorCode | "create_page_failed" | "invalid_icon_name" | "invalid_icon_color" | "invalid_page_parent" | "page_unavailable" | "data_source_access_failed" | "unknown_data_source_key" | "unmapped_data_source" | "data_source_inaccessible" | "unmapped_property" | "property_id_mismatch" | "duplicate_property" | "invalid_property_value" | CustomBlockCapabilityErrorCode>;
5
5
  export type CustomBlockCreatePageErrorInfo = CustomBlockErrorInfo<CustomBlockCreatePageErrorCode>;
6
6
  export declare const customBlockCreatePageErrorInfoSchema: v.ObjectSchema<{
7
7
  readonly code: v.StringSchema<undefined>;
@@ -265,7 +265,13 @@ export declare const createPageResultMessageSchema: v.VariantSchema<"status", [v
265
265
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
266
266
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
267
267
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
268
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
268
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
269
+ readonly type: v.LiteralSchema<"icon", undefined>;
270
+ readonly icon: v.LooseObjectSchema<{
271
+ readonly name: v.StringSchema<undefined>;
272
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
273
+ }, undefined>;
274
+ }, undefined>, v.ObjectSchema<{
269
275
  readonly type: v.LiteralSchema<"emoji", undefined>;
270
276
  readonly emoji: v.StringSchema<undefined>;
271
277
  }, undefined>, v.ObjectSchema<{
@@ -568,7 +574,13 @@ export declare const createPageResultMessageWithProtocol3To5CompatibilitySchema:
568
574
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
569
575
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
570
576
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
571
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
577
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
578
+ readonly type: v.LiteralSchema<"icon", undefined>;
579
+ readonly icon: v.LooseObjectSchema<{
580
+ readonly name: v.StringSchema<undefined>;
581
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
582
+ }, undefined>;
583
+ }, undefined>, v.ObjectSchema<{
572
584
  readonly type: v.LiteralSchema<"emoji", undefined>;
573
585
  readonly emoji: v.StringSchema<undefined>;
574
586
  }, undefined>, v.ObjectSchema<{
@@ -844,7 +856,13 @@ export declare const createPageResultMessageWithProtocol3To5CompatibilitySchema:
844
856
  }, undefined>], undefined>, undefined>;
845
857
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
846
858
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
847
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
859
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
860
+ readonly type: v.LiteralSchema<"icon", undefined>;
861
+ readonly icon: v.LooseObjectSchema<{
862
+ readonly name: v.StringSchema<undefined>;
863
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
864
+ }, undefined>;
865
+ }, undefined>, v.ObjectSchema<{
848
866
  readonly type: v.LiteralSchema<"emoji", undefined>;
849
867
  readonly emoji: v.StringSchema<undefined>;
850
868
  }, undefined>, v.ObjectSchema<{
@@ -1150,6 +1168,46 @@ export declare const createPageMessageSchema: v.VariantSchema<"type", [v.ObjectS
1150
1168
  readonly type: v.LiteralSchema<"verification", undefined>;
1151
1169
  readonly verification: v.StringSchema<undefined>;
1152
1170
  }, undefined>], undefined>, undefined>;
1171
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1172
+ readonly type: v.LiteralSchema<"icon", undefined>;
1173
+ readonly icon: v.LooseObjectSchema<{
1174
+ readonly name: v.StringSchema<undefined>;
1175
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
1176
+ }, undefined>;
1177
+ }, undefined>, v.ObjectSchema<{
1178
+ readonly type: v.LiteralSchema<"emoji", undefined>;
1179
+ readonly emoji: v.StringSchema<undefined>;
1180
+ }, undefined>, v.ObjectSchema<{
1181
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
1182
+ readonly custom_emoji: v.ObjectSchema<{
1183
+ readonly id: v.StringSchema<undefined>;
1184
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1185
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1186
+ }, undefined>;
1187
+ }, undefined>, v.ObjectSchema<{
1188
+ readonly type: v.LiteralSchema<"external", undefined>;
1189
+ readonly external: v.ObjectSchema<{
1190
+ readonly url: v.StringSchema<undefined>;
1191
+ }, undefined>;
1192
+ }, undefined>, v.ObjectSchema<{
1193
+ readonly type: v.LiteralSchema<"file", undefined>;
1194
+ readonly file: v.ObjectSchema<{
1195
+ readonly url: v.StringSchema<undefined>;
1196
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1197
+ }, undefined>;
1198
+ }, undefined>], undefined>, undefined>;
1199
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1200
+ readonly type: v.LiteralSchema<"external", undefined>;
1201
+ readonly external: v.ObjectSchema<{
1202
+ readonly url: v.StringSchema<undefined>;
1203
+ }, undefined>;
1204
+ }, undefined>, v.ObjectSchema<{
1205
+ readonly type: v.LiteralSchema<"file", undefined>;
1206
+ readonly file: v.ObjectSchema<{
1207
+ readonly url: v.StringSchema<undefined>;
1208
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1209
+ }, undefined>;
1210
+ }, undefined>], undefined>, undefined>;
1153
1211
  readonly parent: v.ObjectSchema<{
1154
1212
  readonly type: v.LiteralSchema<"page_id", undefined>;
1155
1213
  readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
@@ -1383,6 +1441,46 @@ export declare const createPageMessageSchema: v.VariantSchema<"type", [v.ObjectS
1383
1441
  readonly type: v.LiteralSchema<"verification", undefined>;
1384
1442
  readonly verification: v.StringSchema<undefined>;
1385
1443
  }, undefined>], undefined>, undefined>;
1444
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1445
+ readonly type: v.LiteralSchema<"icon", undefined>;
1446
+ readonly icon: v.LooseObjectSchema<{
1447
+ readonly name: v.StringSchema<undefined>;
1448
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
1449
+ }, undefined>;
1450
+ }, undefined>, v.ObjectSchema<{
1451
+ readonly type: v.LiteralSchema<"emoji", undefined>;
1452
+ readonly emoji: v.StringSchema<undefined>;
1453
+ }, undefined>, v.ObjectSchema<{
1454
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
1455
+ readonly custom_emoji: v.ObjectSchema<{
1456
+ readonly id: v.StringSchema<undefined>;
1457
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1458
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1459
+ }, undefined>;
1460
+ }, undefined>, v.ObjectSchema<{
1461
+ readonly type: v.LiteralSchema<"external", undefined>;
1462
+ readonly external: v.ObjectSchema<{
1463
+ readonly url: v.StringSchema<undefined>;
1464
+ }, undefined>;
1465
+ }, undefined>, v.ObjectSchema<{
1466
+ readonly type: v.LiteralSchema<"file", undefined>;
1467
+ readonly file: v.ObjectSchema<{
1468
+ readonly url: v.StringSchema<undefined>;
1469
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1470
+ }, undefined>;
1471
+ }, undefined>], undefined>, undefined>;
1472
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1473
+ readonly type: v.LiteralSchema<"external", undefined>;
1474
+ readonly external: v.ObjectSchema<{
1475
+ readonly url: v.StringSchema<undefined>;
1476
+ }, undefined>;
1477
+ }, undefined>, v.ObjectSchema<{
1478
+ readonly type: v.LiteralSchema<"file", undefined>;
1479
+ readonly file: v.ObjectSchema<{
1480
+ readonly url: v.StringSchema<undefined>;
1481
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1482
+ }, undefined>;
1483
+ }, undefined>], undefined>, undefined>;
1386
1484
  readonly parent: v.ObjectSchema<{
1387
1485
  readonly type: v.LiteralSchema<"data_source_id", undefined>;
1388
1486
  readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
@@ -3,6 +3,7 @@ import { bridgePageForProtocol3To5Schema } from "../../compatibility/protocol3To
3
3
  import { dataSourceParentSchema, pageParentSchema, } from "../../context/parent.js";
4
4
  import { notionBlockIdSchema } from "../../utils/ids.js";
5
5
  import { bridgePageSchema } from "../bridgePage.js";
6
+ import { notionCreatePageIconSchema, notionPageCoverSchema, } from "../pageAppearance.js";
6
7
  import { bridgePagePropertyWriteMapSchema } from "../properties/bridgePagePropertyMaps.js";
7
8
  // The schema accepts any string code. The type lists known codes for
8
9
  // autocomplete, with an open string fallback for newer senders.
@@ -74,7 +75,6 @@ export const createPageParentSchema = v.variant("type", [
74
75
  ]);
75
76
  /**
76
77
  * The sandbox sends this message to ask the host to create a page.
77
- * The payload mirrors Notion's public `POST /v1/pages` API.
78
78
  */
79
79
  const createPageMessageBaseSchema = {
80
80
  type: v.literal("createPage"),
@@ -87,6 +87,8 @@ const createPageMessageBaseSchema = {
87
87
  * those keys before it sends this message.
88
88
  */
89
89
  properties: bridgePagePropertyWriteMapSchema,
90
+ icon: v.optional(notionCreatePageIconSchema),
91
+ cover: v.optional(notionPageCoverSchema),
90
92
  };
91
93
  // Use a variant so this parent-dependent union can be nested in
92
94
  // sandboxToHostMessageSchema's type discriminator.
@@ -1,7 +1,7 @@
1
1
  import * as v from "valibot";
2
- import type { CustomBlockCapabilityErrorCode, CustomBlockErrorCode, CustomBlockErrorInfo } from "../../utils/errors.js";
2
+ import type { CustomBlockCapabilityErrorCode, CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockRequestErrorCode } from "../../utils/errors.js";
3
3
  export declare const customBlockGetPageErrorCodeSchema: v.StringSchema<undefined>;
4
- export type CustomBlockGetPageErrorCode = CustomBlockErrorCode<"get_page_failed" | "page_unavailable" | CustomBlockCapabilityErrorCode>;
4
+ export type CustomBlockGetPageErrorCode = CustomBlockErrorCode<CustomBlockRequestErrorCode | "get_page_failed" | "page_unavailable" | CustomBlockCapabilityErrorCode>;
5
5
  export type CustomBlockGetPageErrorInfo = CustomBlockErrorInfo<CustomBlockGetPageErrorCode>;
6
6
  export declare const customBlockGetPageErrorInfoSchema: v.ObjectSchema<{
7
7
  readonly code: v.StringSchema<undefined>;
@@ -271,7 +271,13 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
271
271
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
272
272
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
273
273
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
274
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
274
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
275
+ readonly type: v.LiteralSchema<"icon", undefined>;
276
+ readonly icon: v.LooseObjectSchema<{
277
+ readonly name: v.StringSchema<undefined>;
278
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
279
+ }, undefined>;
280
+ }, undefined>, v.ObjectSchema<{
275
281
  readonly type: v.LiteralSchema<"emoji", undefined>;
276
282
  readonly emoji: v.StringSchema<undefined>;
277
283
  }, undefined>, v.ObjectSchema<{
@@ -573,7 +579,13 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
573
579
  readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
574
580
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
575
581
  readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
576
- readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
582
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
583
+ readonly type: v.LiteralSchema<"icon", undefined>;
584
+ readonly icon: v.LooseObjectSchema<{
585
+ readonly name: v.StringSchema<undefined>;
586
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
587
+ }, undefined>;
588
+ }, undefined>, v.ObjectSchema<{
577
589
  readonly type: v.LiteralSchema<"emoji", undefined>;
578
590
  readonly emoji: v.StringSchema<undefined>;
579
591
  }, undefined>, v.ObjectSchema<{
@@ -849,7 +861,13 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
849
861
  }, undefined>], undefined>, undefined>;
850
862
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
851
863
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
852
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
864
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
865
+ readonly type: v.LiteralSchema<"icon", undefined>;
866
+ readonly icon: v.LooseObjectSchema<{
867
+ readonly name: v.StringSchema<undefined>;
868
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
869
+ }, undefined>;
870
+ }, undefined>, v.ObjectSchema<{
853
871
  readonly type: v.LiteralSchema<"emoji", undefined>;
854
872
  readonly emoji: v.StringSchema<undefined>;
855
873
  }, undefined>, v.ObjectSchema<{
@@ -1,9 +1,9 @@
1
1
  import * as v from "valibot";
2
- import type { CustomBlockCapabilityErrorCode, CustomBlockErrorCode, CustomBlockErrorInfo } from "../../utils/errors.js";
2
+ import type { CustomBlockCapabilityErrorCode, CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockRequestErrorCode } from "../../utils/errors.js";
3
3
  export declare const openPageModeSchema: v.PicklistSchema<["side_peek", "center_peek"], undefined>;
4
4
  export type OpenPageMode = v.InferOutput<typeof openPageModeSchema>;
5
5
  export declare const customBlockOpenPageErrorCodeSchema: v.StringSchema<undefined>;
6
- export type CustomBlockOpenPageErrorCode = CustomBlockErrorCode<"open_page_failed" | "page_unavailable" | "navigation_unavailable" | CustomBlockCapabilityErrorCode>;
6
+ export type CustomBlockOpenPageErrorCode = CustomBlockErrorCode<CustomBlockRequestErrorCode | "open_page_failed" | "page_unavailable" | "navigation_unavailable" | CustomBlockCapabilityErrorCode>;
7
7
  export type CustomBlockOpenPageErrorInfo = CustomBlockErrorInfo<CustomBlockOpenPageErrorCode>;
8
8
  export declare const customBlockOpenPageErrorInfoSchema: v.ObjectSchema<{
9
9
  readonly code: v.StringSchema<undefined>;