@notionhq/custom-blocks 0.3.5 → 0.4.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 (124) hide show
  1. package/README.md +2 -2
  2. package/dist/bridge/SandboxBridge.d.ts +4 -23
  3. package/dist/bridge/SandboxBridge.d.ts.map +1 -1
  4. package/dist/bridge/SandboxBridge.js +36 -104
  5. package/dist/bridge/requests.d.ts +35 -0
  6. package/dist/bridge/requests.d.ts.map +1 -0
  7. package/dist/bridge/requests.js +97 -0
  8. package/dist/dataSources/bridge/resolveDataSourceQuery.d.ts.map +1 -1
  9. package/dist/dataSources/bridge/resolveDataSourceQuery.js +15 -1
  10. package/dist/dataSources/createDataSourcePage.d.ts.map +1 -1
  11. package/dist/dataSources/createDataSourcePage.js +5 -1
  12. package/dist/dataSources/types.d.ts +2 -0
  13. package/dist/dataSources/types.d.ts.map +1 -1
  14. package/dist/index.d.ts +2 -1
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/manifest/types.d.ts +1 -1
  17. package/dist/manifest/types.d.ts.map +1 -1
  18. package/dist/navigation/openExternalUrl.d.ts.map +1 -1
  19. package/dist/navigation/openExternalUrl.js +2 -1
  20. package/dist/pages/bridge/getPageForDataSource.d.ts.map +1 -1
  21. package/dist/pages/bridge/getPageForDataSource.js +2 -1
  22. package/dist/pages/bridge/sendCreatePageRequest.d.ts.map +1 -1
  23. package/dist/pages/bridge/sendCreatePageRequest.js +2 -1
  24. package/dist/pages/bridge/toNotionPageFieldsFromBridgePage.d.ts +11 -2
  25. package/dist/pages/bridge/toNotionPageFieldsFromBridgePage.d.ts.map +1 -1
  26. package/dist/pages/bridge/toNotionPageFieldsFromBridgePage.js +0 -1
  27. package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.d.ts.map +1 -1
  28. package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.js +0 -6
  29. package/dist/pages/bridge/updatePage.d.ts.map +1 -1
  30. package/dist/pages/bridge/updatePage.js +19 -4
  31. package/dist/pages/createPage.d.ts.map +1 -1
  32. package/dist/pages/createPage.js +5 -1
  33. package/dist/pages/openPage.d.ts.map +1 -1
  34. package/dist/pages/openPage.js +2 -1
  35. package/dist/pages/types.d.ts +5 -7
  36. package/dist/pages/types.d.ts.map +1 -1
  37. package/dist/protocol/compatibility/protocol3To5/bridgePage.d.ts +7 -5
  38. package/dist/protocol/context/parent.d.ts +2 -0
  39. package/dist/protocol/dataSources/bridgeArchiveStatus.d.ts +3 -0
  40. package/dist/protocol/dataSources/bridgeArchiveStatus.js +6 -0
  41. package/dist/protocol/dataSources/bridgeDataSourceBinding.d.ts +0 -4
  42. package/dist/protocol/dataSources/bridgeDataSourceBindings.d.ts +0 -4
  43. package/dist/protocol/dataSources/collectionSchema.d.ts +0 -4
  44. package/dist/protocol/dataSources/messages/dataSourcesChanged.d.ts +0 -4
  45. package/dist/protocol/dataSources/messages/queryDataSource.d.ts +17 -14
  46. package/dist/protocol/dataSources/messages/queryDataSource.js +2 -0
  47. package/dist/protocol/dataSources/notionDataSource.d.ts +0 -8
  48. package/dist/protocol/dataSources/properties/propertySchema.d.ts +3 -7
  49. package/dist/protocol/dataSources/properties/propertySchema.js +1 -3
  50. package/dist/protocol/handshake/connect.d.ts +15 -4
  51. package/dist/protocol/handshake/init.d.ts +15 -8
  52. package/dist/protocol/icons.d.ts +17 -0
  53. package/dist/protocol/icons.js +27 -0
  54. package/dist/protocol/index.d.ts +13 -9
  55. package/dist/protocol/index.js +8 -5
  56. package/dist/protocol/manifest/grants.d.ts +48 -0
  57. package/dist/protocol/manifest/grants.js +19 -0
  58. package/dist/protocol/manifest/manifest.d.ts +33 -10
  59. package/dist/protocol/manifest/manifest.js +11 -5
  60. package/dist/protocol/messages/hostToSandbox.d.ts +109 -87
  61. package/dist/protocol/messages/invalidHostMessage.d.ts +2 -0
  62. package/dist/protocol/messages/invalidHostMessage.js +2 -0
  63. package/dist/protocol/messages/invalidSandboxMessage.d.ts +2 -0
  64. package/dist/protocol/messages/invalidSandboxMessage.js +2 -0
  65. package/dist/protocol/messages/sandboxToHost.d.ts +104 -17
  66. package/dist/protocol/navigation/openExternalUrl.d.ts +2 -2
  67. package/dist/protocol/pages/bridgePage.d.ts +7 -6
  68. package/dist/protocol/pages/bridgePage.js +0 -1
  69. package/dist/protocol/pages/makeBridgePage.d.ts +3 -1
  70. package/dist/protocol/pages/messages/createPage.d.ts +103 -27
  71. package/dist/protocol/pages/messages/createPage.js +3 -1
  72. package/dist/protocol/pages/messages/getPage.d.ts +23 -19
  73. package/dist/protocol/pages/messages/openPage.d.ts +2 -2
  74. package/dist/protocol/pages/messages/updatePage.d.ts +30 -24
  75. package/dist/protocol/pages/pageAppearance.d.ts +36 -1
  76. package/dist/protocol/pages/pageAppearance.js +9 -0
  77. package/dist/protocol/pages/properties/bridgePagePropertyMaps.d.ts +0 -8
  78. package/dist/protocol/pages/properties/bridgePagePropertyValue.d.ts +0 -4
  79. package/dist/protocol/pages/properties/bridgePagePropertyValue.js +0 -5
  80. package/dist/protocol/users/makeBridgeUser.d.ts +3 -1
  81. package/dist/protocol/users/messages/getUser.d.ts +2 -2
  82. package/dist/protocol/users/messages/listUsers.d.ts +2 -2
  83. package/dist/protocol/utils/errors.d.ts +6 -4
  84. package/dist/protocol/utils/errors.js +3 -3
  85. package/dist/protocol/utils/protocolVersion.d.ts +2 -1
  86. package/dist/protocol/utils/protocolVersion.js +3 -1
  87. package/dist/protocol/utils/readRequestId.d.ts +2 -0
  88. package/dist/protocol/utils/readRequestId.js +7 -0
  89. package/dist/users/getUser.d.ts.map +1 -1
  90. package/dist/users/getUser.js +2 -1
  91. package/dist/users/listUsers.d.ts.map +1 -1
  92. package/dist/users/listUsers.js +4 -2
  93. package/dist/utils/version.js +1 -1
  94. package/docs/data-sources.md +38 -34
  95. package/docs/errors.md +47 -5
  96. package/docs/grants.md +127 -0
  97. package/docs/pages.md +45 -32
  98. package/docs/users.md +2 -2
  99. package/package.json +1 -1
  100. package/src/bridge/SandboxBridge.ts +44 -188
  101. package/src/bridge/requests.ts +138 -0
  102. package/src/dataSources/bridge/resolveDataSourceQuery.ts +21 -1
  103. package/src/dataSources/createDataSourcePage.ts +5 -1
  104. package/src/dataSources/types.ts +3 -0
  105. package/src/index.ts +8 -4
  106. package/src/manifest/types.ts +1 -1
  107. package/src/navigation/openExternalUrl.ts +5 -1
  108. package/src/pages/bridge/getPageForDataSource.ts +5 -1
  109. package/src/pages/bridge/sendCreatePageRequest.ts +5 -1
  110. package/src/pages/bridge/toNotionPageFieldsFromBridgePage.ts +0 -1
  111. package/src/pages/bridge/toNotionPagePropertyFromBridgeProperty.ts +0 -6
  112. package/src/pages/bridge/updatePage.ts +28 -8
  113. package/src/pages/createPage.ts +5 -1
  114. package/src/pages/openPage.ts +5 -1
  115. package/src/pages/types.ts +7 -5
  116. package/src/users/getUser.ts +5 -1
  117. package/src/users/listUsers.ts +9 -4
  118. package/dist/bridge/pendingRequests.d.ts +0 -14
  119. package/dist/bridge/pendingRequests.d.ts.map +0 -1
  120. package/dist/bridge/pendingRequests.js +0 -28
  121. package/dist/protocol/manifest/capabilities.d.ts +0 -37
  122. package/dist/protocol/manifest/capabilities.js +0 -13
  123. package/docs/capabilities.md +0 -111
  124. package/src/bridge/pendingRequests.ts +0 -28
@@ -31,12 +31,23 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
31
31
  readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
32
32
  readonly name: v.StringSchema<undefined>;
33
33
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
34
- readonly type: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "last_visited_time", "location", "created_time", "last_edited_time", "created_by", "last_edited_by"], undefined>;
34
+ readonly type: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "location", "created_time", "last_edited_time", "created_by", "last_edited_by"], undefined>;
35
35
  }, undefined>, undefined>, {}>;
36
36
  }, undefined>, undefined>, {}>;
37
- readonly capabilities: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
38
- readonly capability: v.StringSchema<undefined>;
39
- readonly resource: v.StringSchema<undefined>;
37
+ readonly pages: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
38
+ readonly name: v.StringSchema<undefined>;
39
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
40
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
41
+ readonly type: v.LiteralSchema<"emoji", undefined>;
42
+ readonly emoji: v.StringSchema<undefined>;
43
+ }, undefined>, v.ObjectSchema<{
44
+ readonly type: v.LiteralSchema<"external", undefined>;
45
+ readonly url: v.StringSchema<undefined>;
46
+ }, undefined>], undefined>, undefined>;
47
+ }, undefined>, undefined>, undefined>;
48
+ readonly grants: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
49
+ readonly action: v.StringSchema<undefined>;
50
+ readonly resource: v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>], undefined>;
40
51
  }, undefined>, undefined>, undefined>;
41
52
  }, undefined>, undefined>;
42
53
  }, undefined>, v.ObjectSchema<{
@@ -576,6 +587,7 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
576
587
  readonly propertyId: v.StringSchema<undefined>;
577
588
  readonly direction: v.PicklistSchema<["ascending", "descending"], undefined>;
578
589
  }, undefined>, undefined>, undefined>;
590
+ readonly archive_status: v.OptionalSchema<v.PicklistSchema<["active", "archived", "all"], undefined>, undefined>;
579
591
  }, undefined>, v.ObjectSchema<{
580
592
  readonly type: v.LiteralSchema<"unsubscribeDataSourceQuery", undefined>;
581
593
  readonly subscriptionId: v.StringSchema<undefined>;
@@ -768,10 +780,6 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
768
780
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
769
781
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
770
782
  }, undefined>, undefined>;
771
- }, undefined>, v.ObjectSchema<{
772
- readonly id: v.StringSchema<undefined>;
773
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
774
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
775
783
  }, undefined>, v.ObjectSchema<{
776
784
  readonly id: v.StringSchema<undefined>;
777
785
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -797,6 +805,46 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
797
805
  readonly type: v.LiteralSchema<"verification", undefined>;
798
806
  readonly verification: v.StringSchema<undefined>;
799
807
  }, undefined>], undefined>, undefined>;
808
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
809
+ readonly type: v.LiteralSchema<"icon", undefined>;
810
+ readonly icon: v.LooseObjectSchema<{
811
+ readonly name: v.StringSchema<undefined>;
812
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
813
+ }, undefined>;
814
+ }, undefined>, v.ObjectSchema<{
815
+ readonly type: v.LiteralSchema<"emoji", undefined>;
816
+ readonly emoji: v.StringSchema<undefined>;
817
+ }, undefined>, v.ObjectSchema<{
818
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
819
+ readonly custom_emoji: v.ObjectSchema<{
820
+ readonly id: v.StringSchema<undefined>;
821
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
822
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
823
+ }, undefined>;
824
+ }, undefined>, v.ObjectSchema<{
825
+ readonly type: v.LiteralSchema<"external", undefined>;
826
+ readonly external: v.ObjectSchema<{
827
+ readonly url: v.StringSchema<undefined>;
828
+ }, undefined>;
829
+ }, undefined>, v.ObjectSchema<{
830
+ readonly type: v.LiteralSchema<"file", undefined>;
831
+ readonly file: v.ObjectSchema<{
832
+ readonly url: v.StringSchema<undefined>;
833
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
834
+ }, undefined>;
835
+ }, undefined>], undefined>, undefined>;
836
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
837
+ readonly type: v.LiteralSchema<"external", undefined>;
838
+ readonly external: v.ObjectSchema<{
839
+ readonly url: v.StringSchema<undefined>;
840
+ }, undefined>;
841
+ }, undefined>, v.ObjectSchema<{
842
+ readonly type: v.LiteralSchema<"file", undefined>;
843
+ readonly file: v.ObjectSchema<{
844
+ readonly url: v.StringSchema<undefined>;
845
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
846
+ }, undefined>;
847
+ }, undefined>], undefined>, undefined>;
800
848
  readonly parent: v.ObjectSchema<{
801
849
  readonly type: v.LiteralSchema<"page_id", undefined>;
802
850
  readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
@@ -1001,10 +1049,6 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
1001
1049
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
1002
1050
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1003
1051
  }, undefined>, undefined>;
1004
- }, undefined>, v.ObjectSchema<{
1005
- readonly id: v.StringSchema<undefined>;
1006
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
1007
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1008
1052
  }, undefined>, v.ObjectSchema<{
1009
1053
  readonly id: v.StringSchema<undefined>;
1010
1054
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -1030,6 +1074,46 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
1030
1074
  readonly type: v.LiteralSchema<"verification", undefined>;
1031
1075
  readonly verification: v.StringSchema<undefined>;
1032
1076
  }, undefined>], undefined>, undefined>;
1077
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1078
+ readonly type: v.LiteralSchema<"icon", undefined>;
1079
+ readonly icon: v.LooseObjectSchema<{
1080
+ readonly name: v.StringSchema<undefined>;
1081
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
1082
+ }, undefined>;
1083
+ }, undefined>, v.ObjectSchema<{
1084
+ readonly type: v.LiteralSchema<"emoji", undefined>;
1085
+ readonly emoji: v.StringSchema<undefined>;
1086
+ }, undefined>, v.ObjectSchema<{
1087
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
1088
+ readonly custom_emoji: v.ObjectSchema<{
1089
+ readonly id: v.StringSchema<undefined>;
1090
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1091
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1092
+ }, undefined>;
1093
+ }, undefined>, v.ObjectSchema<{
1094
+ readonly type: v.LiteralSchema<"external", undefined>;
1095
+ readonly external: v.ObjectSchema<{
1096
+ readonly url: v.StringSchema<undefined>;
1097
+ }, undefined>;
1098
+ }, undefined>, v.ObjectSchema<{
1099
+ readonly type: v.LiteralSchema<"file", undefined>;
1100
+ readonly file: v.ObjectSchema<{
1101
+ readonly url: v.StringSchema<undefined>;
1102
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1103
+ }, undefined>;
1104
+ }, undefined>], undefined>, undefined>;
1105
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1106
+ readonly type: v.LiteralSchema<"external", undefined>;
1107
+ readonly external: v.ObjectSchema<{
1108
+ readonly url: v.StringSchema<undefined>;
1109
+ }, undefined>;
1110
+ }, undefined>, v.ObjectSchema<{
1111
+ readonly type: v.LiteralSchema<"file", undefined>;
1112
+ readonly file: v.ObjectSchema<{
1113
+ readonly url: v.StringSchema<undefined>;
1114
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1115
+ }, undefined>;
1116
+ }, undefined>], undefined>, undefined>;
1033
1117
  readonly parent: v.ObjectSchema<{
1034
1118
  readonly type: v.LiteralSchema<"data_source_id", undefined>;
1035
1119
  readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
@@ -1249,10 +1333,6 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
1249
1333
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
1250
1334
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1251
1335
  }, undefined>, undefined>;
1252
- }, undefined>, v.ObjectSchema<{
1253
- readonly id: v.StringSchema<undefined>;
1254
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
1255
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1256
1336
  }, undefined>, v.ObjectSchema<{
1257
1337
  readonly id: v.StringSchema<undefined>;
1258
1338
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -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>;
@@ -206,10 +206,6 @@ export declare const bridgePageSchema: v.ObjectSchema<{
206
206
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
207
207
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
208
208
  }, undefined>, undefined>;
209
- }, undefined>, v.ObjectSchema<{
210
- readonly id: v.StringSchema<undefined>;
211
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
212
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
213
209
  }, undefined>, v.ObjectSchema<{
214
210
  readonly id: v.StringSchema<undefined>;
215
211
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -245,10 +241,15 @@ export declare const bridgePageSchema: v.ObjectSchema<{
245
241
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
246
242
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
247
243
  }, undefined>, undefined>, null>;
248
- readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
249
244
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
250
245
  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<{
246
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
247
+ readonly type: v.LiteralSchema<"icon", undefined>;
248
+ readonly icon: v.LooseObjectSchema<{
249
+ readonly name: v.StringSchema<undefined>;
250
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
251
+ }, undefined>;
252
+ }, undefined>, v.ObjectSchema<{
252
253
  readonly type: v.LiteralSchema<"emoji", undefined>;
253
254
  readonly emoji: v.StringSchema<undefined>;
254
255
  }, undefined>, v.ObjectSchema<{
@@ -11,7 +11,6 @@ export const bridgePageSchema = v.object({
11
11
  properties: bridgePagePropertyReadMapSchema,
12
12
  created_by: v.optional(metadataActorSchema, null),
13
13
  last_edited_by: v.optional(metadataActorSchema, null),
14
- last_visited_time: v.optional(v.nullable(v.string()), null),
15
14
  created_time: v.optional(v.nullable(v.string()), null),
16
15
  last_edited_time: v.optional(v.nullable(v.string()), null),
17
16
  icon: v.optional(v.nullable(notionPageIconSchema), null),
@@ -1,4 +1,6 @@
1
+ import * as v from "valibot";
1
2
  import type { BridgePage } from "./bridgePage.js";
2
- export type MakeBridgePageArgs = Pick<BridgePage, "id" | "parent"> & Partial<Omit<BridgePage, "object" | "id" | "parent">>;
3
+ import { bridgePageSchema } from "./bridgePage.js";
4
+ export type MakeBridgePageArgs = Pick<v.InferInput<typeof bridgePageSchema>, "id" | "parent"> & Partial<Omit<v.InferInput<typeof bridgePageSchema>, "object" | "id" | "parent">>;
3
5
  /** Builds a complete bridge page without inventing identity or Notion data. */
4
6
  export declare function makeBridgePage(args: MakeBridgePageArgs): BridgePage;
@@ -1,7 +1,7 @@
1
1
  import * as v from "valibot";
2
- import type { CustomBlockCapabilityErrorCode, CustomBlockErrorCode, CustomBlockErrorInfo } from "../../utils/errors.js";
2
+ import type { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode, 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" | CustomBlockGrantErrorCode>;
5
5
  export type CustomBlockCreatePageErrorInfo = CustomBlockErrorInfo<CustomBlockCreatePageErrorCode>;
6
6
  export declare const customBlockCreatePageErrorInfoSchema: v.ObjectSchema<{
7
7
  readonly code: v.StringSchema<undefined>;
@@ -223,10 +223,6 @@ export declare const createPageResultMessageSchema: v.VariantSchema<"status", [v
223
223
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
224
224
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
225
225
  }, undefined>, undefined>;
226
- }, undefined>, v.ObjectSchema<{
227
- readonly id: v.StringSchema<undefined>;
228
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
229
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
230
226
  }, undefined>, v.ObjectSchema<{
231
227
  readonly id: v.StringSchema<undefined>;
232
228
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -262,10 +258,15 @@ export declare const createPageResultMessageSchema: v.VariantSchema<"status", [v
262
258
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
263
259
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
264
260
  }, undefined>, undefined>, null>;
265
- readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
266
261
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
267
262
  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<{
263
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
264
+ readonly type: v.LiteralSchema<"icon", undefined>;
265
+ readonly icon: v.LooseObjectSchema<{
266
+ readonly name: v.StringSchema<undefined>;
267
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
268
+ }, undefined>;
269
+ }, undefined>, v.ObjectSchema<{
269
270
  readonly type: v.LiteralSchema<"emoji", undefined>;
270
271
  readonly emoji: v.StringSchema<undefined>;
271
272
  }, undefined>, v.ObjectSchema<{
@@ -526,10 +527,6 @@ export declare const createPageResultMessageWithProtocol3To5CompatibilitySchema:
526
527
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
527
528
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
528
529
  }, undefined>, undefined>;
529
- }, undefined>, v.ObjectSchema<{
530
- readonly id: v.StringSchema<undefined>;
531
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
532
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
533
530
  }, undefined>, v.ObjectSchema<{
534
531
  readonly id: v.StringSchema<undefined>;
535
532
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -565,10 +562,15 @@ export declare const createPageResultMessageWithProtocol3To5CompatibilitySchema:
565
562
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
566
563
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
567
564
  }, undefined>, undefined>, null>;
568
- readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
569
565
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
570
566
  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<{
567
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
568
+ readonly type: v.LiteralSchema<"icon", undefined>;
569
+ readonly icon: v.LooseObjectSchema<{
570
+ readonly name: v.StringSchema<undefined>;
571
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
572
+ }, undefined>;
573
+ }, undefined>, v.ObjectSchema<{
572
574
  readonly type: v.LiteralSchema<"emoji", undefined>;
573
575
  readonly emoji: v.StringSchema<undefined>;
574
576
  }, undefined>, v.ObjectSchema<{
@@ -813,10 +815,6 @@ export declare const createPageResultMessageWithProtocol3To5CompatibilitySchema:
813
815
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
814
816
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
815
817
  }, undefined>, undefined>;
816
- }, undefined>, v.ObjectSchema<{
817
- readonly id: v.StringSchema<undefined>;
818
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
819
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
820
818
  }, undefined>, v.ObjectSchema<{
821
819
  readonly id: v.StringSchema<undefined>;
822
820
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -844,7 +842,13 @@ export declare const createPageResultMessageWithProtocol3To5CompatibilitySchema:
844
842
  }, undefined>], undefined>, undefined>;
845
843
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
846
844
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
847
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
845
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
846
+ readonly type: v.LiteralSchema<"icon", undefined>;
847
+ readonly icon: v.LooseObjectSchema<{
848
+ readonly name: v.StringSchema<undefined>;
849
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
850
+ }, undefined>;
851
+ }, undefined>, v.ObjectSchema<{
848
852
  readonly type: v.LiteralSchema<"emoji", undefined>;
849
853
  readonly emoji: v.StringSchema<undefined>;
850
854
  }, undefined>, v.ObjectSchema<{
@@ -1121,10 +1125,6 @@ export declare const createPageMessageSchema: v.VariantSchema<"type", [v.ObjectS
1121
1125
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
1122
1126
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1123
1127
  }, undefined>, undefined>;
1124
- }, undefined>, v.ObjectSchema<{
1125
- readonly id: v.StringSchema<undefined>;
1126
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
1127
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1128
1128
  }, undefined>, v.ObjectSchema<{
1129
1129
  readonly id: v.StringSchema<undefined>;
1130
1130
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -1150,6 +1150,46 @@ export declare const createPageMessageSchema: v.VariantSchema<"type", [v.ObjectS
1150
1150
  readonly type: v.LiteralSchema<"verification", undefined>;
1151
1151
  readonly verification: v.StringSchema<undefined>;
1152
1152
  }, undefined>], undefined>, undefined>;
1153
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1154
+ readonly type: v.LiteralSchema<"icon", undefined>;
1155
+ readonly icon: v.LooseObjectSchema<{
1156
+ readonly name: v.StringSchema<undefined>;
1157
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
1158
+ }, undefined>;
1159
+ }, undefined>, v.ObjectSchema<{
1160
+ readonly type: v.LiteralSchema<"emoji", undefined>;
1161
+ readonly emoji: v.StringSchema<undefined>;
1162
+ }, undefined>, v.ObjectSchema<{
1163
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
1164
+ readonly custom_emoji: v.ObjectSchema<{
1165
+ readonly id: v.StringSchema<undefined>;
1166
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1167
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1168
+ }, undefined>;
1169
+ }, undefined>, v.ObjectSchema<{
1170
+ readonly type: v.LiteralSchema<"external", undefined>;
1171
+ readonly external: v.ObjectSchema<{
1172
+ readonly url: v.StringSchema<undefined>;
1173
+ }, undefined>;
1174
+ }, undefined>, v.ObjectSchema<{
1175
+ readonly type: v.LiteralSchema<"file", undefined>;
1176
+ readonly file: v.ObjectSchema<{
1177
+ readonly url: v.StringSchema<undefined>;
1178
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1179
+ }, undefined>;
1180
+ }, undefined>], undefined>, undefined>;
1181
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1182
+ readonly type: v.LiteralSchema<"external", undefined>;
1183
+ readonly external: v.ObjectSchema<{
1184
+ readonly url: v.StringSchema<undefined>;
1185
+ }, undefined>;
1186
+ }, undefined>, v.ObjectSchema<{
1187
+ readonly type: v.LiteralSchema<"file", undefined>;
1188
+ readonly file: v.ObjectSchema<{
1189
+ readonly url: v.StringSchema<undefined>;
1190
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1191
+ }, undefined>;
1192
+ }, undefined>], undefined>, undefined>;
1153
1193
  readonly parent: v.ObjectSchema<{
1154
1194
  readonly type: v.LiteralSchema<"page_id", undefined>;
1155
1195
  readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
@@ -1354,10 +1394,6 @@ export declare const createPageMessageSchema: v.VariantSchema<"type", [v.ObjectS
1354
1394
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
1355
1395
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1356
1396
  }, undefined>, undefined>;
1357
- }, undefined>, v.ObjectSchema<{
1358
- readonly id: v.StringSchema<undefined>;
1359
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
1360
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1361
1397
  }, undefined>, v.ObjectSchema<{
1362
1398
  readonly id: v.StringSchema<undefined>;
1363
1399
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -1383,6 +1419,46 @@ export declare const createPageMessageSchema: v.VariantSchema<"type", [v.ObjectS
1383
1419
  readonly type: v.LiteralSchema<"verification", undefined>;
1384
1420
  readonly verification: v.StringSchema<undefined>;
1385
1421
  }, undefined>], undefined>, undefined>;
1422
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
1423
+ readonly type: v.LiteralSchema<"icon", undefined>;
1424
+ readonly icon: v.LooseObjectSchema<{
1425
+ readonly name: v.StringSchema<undefined>;
1426
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
1427
+ }, undefined>;
1428
+ }, undefined>, v.ObjectSchema<{
1429
+ readonly type: v.LiteralSchema<"emoji", undefined>;
1430
+ readonly emoji: v.StringSchema<undefined>;
1431
+ }, undefined>, v.ObjectSchema<{
1432
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
1433
+ readonly custom_emoji: v.ObjectSchema<{
1434
+ readonly id: v.StringSchema<undefined>;
1435
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1436
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1437
+ }, undefined>;
1438
+ }, undefined>, v.ObjectSchema<{
1439
+ readonly type: v.LiteralSchema<"external", undefined>;
1440
+ readonly external: v.ObjectSchema<{
1441
+ readonly url: v.StringSchema<undefined>;
1442
+ }, undefined>;
1443
+ }, undefined>, v.ObjectSchema<{
1444
+ readonly type: v.LiteralSchema<"file", undefined>;
1445
+ readonly file: v.ObjectSchema<{
1446
+ readonly url: v.StringSchema<undefined>;
1447
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1448
+ }, undefined>;
1449
+ }, undefined>], undefined>, undefined>;
1450
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
1451
+ readonly type: v.LiteralSchema<"external", undefined>;
1452
+ readonly external: v.ObjectSchema<{
1453
+ readonly url: v.StringSchema<undefined>;
1454
+ }, undefined>;
1455
+ }, undefined>, v.ObjectSchema<{
1456
+ readonly type: v.LiteralSchema<"file", undefined>;
1457
+ readonly file: v.ObjectSchema<{
1458
+ readonly url: v.StringSchema<undefined>;
1459
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1460
+ }, undefined>;
1461
+ }, undefined>], undefined>, undefined>;
1386
1462
  readonly parent: v.ObjectSchema<{
1387
1463
  readonly type: v.LiteralSchema<"data_source_id", undefined>;
1388
1464
  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 { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode, 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" | CustomBlockGrantErrorCode>;
5
5
  export type CustomBlockGetPageErrorInfo = CustomBlockErrorInfo<CustomBlockGetPageErrorCode>;
6
6
  export declare const customBlockGetPageErrorInfoSchema: v.ObjectSchema<{
7
7
  readonly code: v.StringSchema<undefined>;
@@ -229,10 +229,6 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
229
229
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
230
230
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
231
231
  }, undefined>, undefined>;
232
- }, undefined>, v.ObjectSchema<{
233
- readonly id: v.StringSchema<undefined>;
234
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
235
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
236
232
  }, undefined>, v.ObjectSchema<{
237
233
  readonly id: v.StringSchema<undefined>;
238
234
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -268,10 +264,15 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
268
264
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
269
265
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
270
266
  }, undefined>, undefined>, null>;
271
- readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
272
267
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
273
268
  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<{
269
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
270
+ readonly type: v.LiteralSchema<"icon", undefined>;
271
+ readonly icon: v.LooseObjectSchema<{
272
+ readonly name: v.StringSchema<undefined>;
273
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
274
+ }, undefined>;
275
+ }, undefined>, v.ObjectSchema<{
275
276
  readonly type: v.LiteralSchema<"emoji", undefined>;
276
277
  readonly emoji: v.StringSchema<undefined>;
277
278
  }, undefined>, v.ObjectSchema<{
@@ -531,10 +532,6 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
531
532
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
532
533
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
533
534
  }, undefined>, undefined>;
534
- }, undefined>, v.ObjectSchema<{
535
- readonly id: v.StringSchema<undefined>;
536
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
537
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
538
535
  }, undefined>, v.ObjectSchema<{
539
536
  readonly id: v.StringSchema<undefined>;
540
537
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -570,10 +567,15 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
570
567
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
571
568
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
572
569
  }, undefined>, undefined>, null>;
573
- readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
574
570
  readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
575
571
  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<{
572
+ readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
573
+ readonly type: v.LiteralSchema<"icon", undefined>;
574
+ readonly icon: v.LooseObjectSchema<{
575
+ readonly name: v.StringSchema<undefined>;
576
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
577
+ }, undefined>;
578
+ }, undefined>, v.ObjectSchema<{
577
579
  readonly type: v.LiteralSchema<"emoji", undefined>;
578
580
  readonly emoji: v.StringSchema<undefined>;
579
581
  }, undefined>, v.ObjectSchema<{
@@ -818,10 +820,6 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
818
820
  readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
819
821
  readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
820
822
  }, undefined>, undefined>;
821
- }, undefined>, v.ObjectSchema<{
822
- readonly id: v.StringSchema<undefined>;
823
- readonly type: v.LiteralSchema<"last_visited_time", undefined>;
824
- readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
825
823
  }, undefined>, v.ObjectSchema<{
826
824
  readonly id: v.StringSchema<undefined>;
827
825
  readonly type: v.LiteralSchema<"unique_id", undefined>;
@@ -849,7 +847,13 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
849
847
  }, undefined>], undefined>, undefined>;
850
848
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
851
849
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
852
- readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
850
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
851
+ readonly type: v.LiteralSchema<"icon", undefined>;
852
+ readonly icon: v.LooseObjectSchema<{
853
+ readonly name: v.StringSchema<undefined>;
854
+ readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
855
+ }, undefined>;
856
+ }, undefined>, v.ObjectSchema<{
853
857
  readonly type: v.LiteralSchema<"emoji", undefined>;
854
858
  readonly emoji: v.StringSchema<undefined>;
855
859
  }, 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 { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode, 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" | CustomBlockGrantErrorCode>;
7
7
  export type CustomBlockOpenPageErrorInfo = CustomBlockErrorInfo<CustomBlockOpenPageErrorCode>;
8
8
  export declare const customBlockOpenPageErrorInfoSchema: v.ObjectSchema<{
9
9
  readonly code: v.StringSchema<undefined>;