ncblock 0.0.1

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 (113) hide show
  1. package/README.md +286 -0
  2. package/dist/bridge/context.d.ts +44 -0
  3. package/dist/bridge/context.d.ts.map +1 -0
  4. package/dist/bridge/context.js +42 -0
  5. package/dist/bridge/dataSources/dataSource.d.ts +732 -0
  6. package/dist/bridge/dataSources/dataSource.d.ts.map +1 -0
  7. package/dist/bridge/dataSources/dataSource.js +37 -0
  8. package/dist/bridge/dataSources/dataSourcePage.d.ts +117 -0
  9. package/dist/bridge/dataSources/dataSourcePage.d.ts.map +1 -0
  10. package/dist/bridge/dataSources/dataSourcePage.js +13 -0
  11. package/dist/bridge/dataSources/dataSourceValue.d.ts +67 -0
  12. package/dist/bridge/dataSources/dataSourceValue.d.ts.map +1 -0
  13. package/dist/bridge/dataSources/dataSourceValue.js +14 -0
  14. package/dist/bridge/dataSources/dateValue.d.ts +158 -0
  15. package/dist/bridge/dataSources/dateValue.d.ts.map +1 -0
  16. package/dist/bridge/dataSources/dateValue.js +59 -0
  17. package/dist/bridge/dataSources/propertySchema.d.ts +191 -0
  18. package/dist/bridge/dataSources/propertySchema.d.ts.map +1 -0
  19. package/dist/bridge/dataSources/propertySchema.js +148 -0
  20. package/dist/bridge/dataSources/recordPointer.d.ts +10 -0
  21. package/dist/bridge/dataSources/recordPointer.d.ts.map +1 -0
  22. package/dist/bridge/dataSources/recordPointer.js +8 -0
  23. package/dist/bridge/ids.d.ts +21 -0
  24. package/dist/bridge/ids.d.ts.map +1 -0
  25. package/dist/bridge/ids.js +3 -0
  26. package/dist/bridge/incomingType.d.ts +10 -0
  27. package/dist/bridge/incomingType.d.ts.map +1 -0
  28. package/dist/bridge/incomingType.js +17 -0
  29. package/dist/bridge/manifest.d.ts +66 -0
  30. package/dist/bridge/manifest.d.ts.map +1 -0
  31. package/dist/bridge/manifest.js +40 -0
  32. package/dist/bridge/messages/contextChanged.d.ts +20 -0
  33. package/dist/bridge/messages/contextChanged.d.ts.map +1 -0
  34. package/dist/bridge/messages/contextChanged.js +10 -0
  35. package/dist/bridge/messages/createPage.d.ts +233 -0
  36. package/dist/bridge/messages/createPage.d.ts.map +1 -0
  37. package/dist/bridge/messages/createPage.js +45 -0
  38. package/dist/bridge/messages/createPageResult.d.ts +198 -0
  39. package/dist/bridge/messages/createPageResult.d.ts.map +1 -0
  40. package/dist/bridge/messages/createPageResult.js +20 -0
  41. package/dist/bridge/messages/dataSourcesChanged.d.ts +158 -0
  42. package/dist/bridge/messages/dataSourcesChanged.d.ts.map +1 -0
  43. package/dist/bridge/messages/dataSourcesChanged.js +13 -0
  44. package/dist/bridge/messages/getPage.d.ts +203 -0
  45. package/dist/bridge/messages/getPage.d.ts.map +1 -0
  46. package/dist/bridge/messages/getPage.js +24 -0
  47. package/dist/bridge/messages/hostToSandbox.d.ts +974 -0
  48. package/dist/bridge/messages/hostToSandbox.d.ts.map +1 -0
  49. package/dist/bridge/messages/hostToSandbox.js +24 -0
  50. package/dist/bridge/messages/init.d.ts +169 -0
  51. package/dist/bridge/messages/init.d.ts.map +1 -0
  52. package/dist/bridge/messages/init.js +17 -0
  53. package/dist/bridge/messages/invalidHostMessage.d.ts +15 -0
  54. package/dist/bridge/messages/invalidHostMessage.d.ts.map +1 -0
  55. package/dist/bridge/messages/invalidHostMessage.js +13 -0
  56. package/dist/bridge/messages/invalidSandboxMessage.d.ts +15 -0
  57. package/dist/bridge/messages/invalidSandboxMessage.d.ts.map +1 -0
  58. package/dist/bridge/messages/invalidSandboxMessage.js +13 -0
  59. package/dist/bridge/messages/queryDataSource.d.ts +13 -0
  60. package/dist/bridge/messages/queryDataSource.d.ts.map +1 -0
  61. package/dist/bridge/messages/queryDataSource.js +11 -0
  62. package/dist/bridge/messages/queryDataSourceResult.d.ts +77 -0
  63. package/dist/bridge/messages/queryDataSourceResult.d.ts.map +1 -0
  64. package/dist/bridge/messages/queryDataSourceResult.js +13 -0
  65. package/dist/bridge/messages/ready.d.ts +41 -0
  66. package/dist/bridge/messages/ready.d.ts.map +1 -0
  67. package/dist/bridge/messages/ready.js +22 -0
  68. package/dist/bridge/messages/resize.d.ts +12 -0
  69. package/dist/bridge/messages/resize.d.ts.map +1 -0
  70. package/dist/bridge/messages/resize.js +10 -0
  71. package/dist/bridge/messages/sandboxToHost.d.ts +389 -0
  72. package/dist/bridge/messages/sandboxToHost.d.ts.map +1 -0
  73. package/dist/bridge/messages/sandboxToHost.js +21 -0
  74. package/dist/bridge/messages/themeChanged.d.ts +11 -0
  75. package/dist/bridge/messages/themeChanged.d.ts.map +1 -0
  76. package/dist/bridge/messages/themeChanged.js +10 -0
  77. package/dist/bridge/messages/updatePage.d.ts +171 -0
  78. package/dist/bridge/messages/updatePage.d.ts.map +1 -0
  79. package/dist/bridge/messages/updatePage.js +14 -0
  80. package/dist/bridge/messages/updatePageResult.d.ts +197 -0
  81. package/dist/bridge/messages/updatePageResult.d.ts.map +1 -0
  82. package/dist/bridge/messages/updatePageResult.js +19 -0
  83. package/dist/bridge/pages/page.d.ts +651 -0
  84. package/dist/bridge/pages/page.d.ts.map +1 -0
  85. package/dist/bridge/pages/page.js +229 -0
  86. package/dist/bridge/pendingRequests.d.ts +14 -0
  87. package/dist/bridge/pendingRequests.d.ts.map +1 -0
  88. package/dist/bridge/pendingRequests.js +27 -0
  89. package/dist/bridge/theme.d.ts +4 -0
  90. package/dist/bridge/theme.d.ts.map +1 -0
  91. package/dist/bridge/theme.js +2 -0
  92. package/dist/host.d.ts +52 -0
  93. package/dist/host.d.ts.map +1 -0
  94. package/dist/host.js +32 -0
  95. package/dist/index.d.ts +27 -0
  96. package/dist/index.d.ts.map +1 -0
  97. package/dist/index.js +14 -0
  98. package/dist/notion.d.ts +113 -0
  99. package/dist/notion.d.ts.map +1 -0
  100. package/dist/notion.js +773 -0
  101. package/dist/pages.d.ts +23 -0
  102. package/dist/pages.d.ts.map +1 -0
  103. package/dist/pages.js +30 -0
  104. package/dist/react.d.ts +171 -0
  105. package/dist/react.d.ts.map +1 -0
  106. package/dist/react.js +284 -0
  107. package/dist/types.d.ts +124 -0
  108. package/dist/types.d.ts.map +1 -0
  109. package/dist/types.js +1 -0
  110. package/dist/utils.d.ts +9 -0
  111. package/dist/utils.d.ts.map +1 -0
  112. package/dist/utils.js +10 -0
  113. package/package.json +48 -0
@@ -0,0 +1,389 @@
1
+ import * as v from "valibot";
2
+ /**
3
+ * Discriminated union of every message the sandbox is allowed to send the host. Useful for hosts
4
+ * to validate inbound traffic from sandboxes without re-implementing validation logic.
5
+ */
6
+ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.ObjectSchema<{
7
+ readonly type: v.LiteralSchema<"ready", undefined>;
8
+ readonly bridgeProtocolVersion: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
9
+ readonly manifest: v.UnionSchema<[v.ObjectSchema<{
10
+ readonly version: v.LiteralSchema<1, undefined>;
11
+ readonly dataSources: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
12
+ readonly name: v.StringSchema<undefined>;
13
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
14
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
15
+ readonly type: v.LiteralSchema<"emoji", undefined>;
16
+ readonly emoji: v.StringSchema<undefined>;
17
+ }, undefined>, v.ObjectSchema<{
18
+ readonly type: v.LiteralSchema<"external", undefined>;
19
+ readonly url: v.StringSchema<undefined>;
20
+ }, undefined>], undefined>, undefined>;
21
+ readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
22
+ readonly name: v.StringSchema<undefined>;
23
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
24
+ 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>;
25
+ }, undefined>, undefined>, {}>;
26
+ }, undefined>, undefined>;
27
+ }, undefined>, v.NullSchema<undefined>], undefined>;
28
+ }, undefined>, v.ObjectSchema<{
29
+ readonly type: v.LiteralSchema<"queryDataSource", undefined>;
30
+ readonly requestId: v.StringSchema<undefined>;
31
+ readonly key: v.StringSchema<undefined>;
32
+ readonly limit: v.NumberSchema<undefined>;
33
+ }, undefined>, v.ObjectSchema<{
34
+ readonly type: v.LiteralSchema<"createPage", undefined>;
35
+ readonly requestId: v.StringSchema<undefined>;
36
+ readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
37
+ readonly type: v.LiteralSchema<"page_id", undefined>;
38
+ readonly page_id: v.StringSchema<undefined>;
39
+ }, undefined>, v.ObjectSchema<{
40
+ readonly type: v.LiteralSchema<"data_source_id", undefined>;
41
+ readonly data_source_id: v.StringSchema<undefined>;
42
+ }, undefined>], undefined>;
43
+ readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
44
+ readonly type: v.LiteralSchema<"title", undefined>;
45
+ readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
46
+ readonly id: v.StringSchema<undefined>;
47
+ }, undefined>, v.ObjectSchema<{
48
+ readonly type: v.LiteralSchema<"rich_text", undefined>;
49
+ readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
50
+ readonly id: v.StringSchema<undefined>;
51
+ }, undefined>, v.ObjectSchema<{
52
+ readonly type: v.LiteralSchema<"number", undefined>;
53
+ readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
54
+ readonly id: v.StringSchema<undefined>;
55
+ }, undefined>, v.ObjectSchema<{
56
+ readonly type: v.LiteralSchema<"url", undefined>;
57
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
58
+ readonly id: v.StringSchema<undefined>;
59
+ }, undefined>, v.ObjectSchema<{
60
+ readonly type: v.LiteralSchema<"email", undefined>;
61
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
62
+ readonly id: v.StringSchema<undefined>;
63
+ }, undefined>, v.ObjectSchema<{
64
+ readonly type: v.LiteralSchema<"phone_number", undefined>;
65
+ readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
66
+ readonly id: v.StringSchema<undefined>;
67
+ }, undefined>, v.ObjectSchema<{
68
+ readonly type: v.LiteralSchema<"checkbox", undefined>;
69
+ readonly checkbox: v.BooleanSchema<undefined>;
70
+ readonly id: v.StringSchema<undefined>;
71
+ }, undefined>, v.ObjectSchema<{
72
+ readonly type: v.LiteralSchema<"select", undefined>;
73
+ readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
74
+ readonly id: v.StringSchema<undefined>;
75
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
76
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
77
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
78
+ }, undefined>, v.ObjectSchema<{
79
+ readonly name: v.StringSchema<undefined>;
80
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
81
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
82
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
83
+ }, undefined>], undefined>, undefined>;
84
+ readonly id: v.StringSchema<undefined>;
85
+ }, undefined>, v.ObjectSchema<{
86
+ readonly type: v.LiteralSchema<"status", undefined>;
87
+ readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
88
+ readonly id: v.StringSchema<undefined>;
89
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
90
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
91
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
92
+ }, undefined>, v.ObjectSchema<{
93
+ readonly name: v.StringSchema<undefined>;
94
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
95
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
96
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
97
+ }, undefined>], undefined>, undefined>;
98
+ readonly id: v.StringSchema<undefined>;
99
+ }, undefined>, v.ObjectSchema<{
100
+ readonly type: v.LiteralSchema<"multi_select", undefined>;
101
+ readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
102
+ readonly id: v.StringSchema<undefined>;
103
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
104
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
105
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
106
+ }, undefined>, v.ObjectSchema<{
107
+ readonly name: v.StringSchema<undefined>;
108
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
109
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
110
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
111
+ }, undefined>], undefined>, undefined>;
112
+ readonly id: v.StringSchema<undefined>;
113
+ }, undefined>, v.ObjectSchema<{
114
+ readonly type: v.LiteralSchema<"date", undefined>;
115
+ readonly date: v.NullableSchema<v.ObjectSchema<{
116
+ readonly start: v.StringSchema<undefined>;
117
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
118
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
119
+ }, undefined>, undefined>;
120
+ readonly id: v.StringSchema<undefined>;
121
+ }, undefined>, v.ObjectSchema<{
122
+ readonly type: v.LiteralSchema<"people", undefined>;
123
+ readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
124
+ readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
125
+ readonly id: v.StringSchema<undefined>;
126
+ }, undefined>, v.ObjectSchema<{
127
+ readonly object: v.LiteralSchema<"group", undefined>;
128
+ readonly id: v.StringSchema<undefined>;
129
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
130
+ }, undefined>], undefined>, undefined>;
131
+ readonly id: v.StringSchema<undefined>;
132
+ }, undefined>, v.ObjectSchema<{
133
+ readonly type: v.LiteralSchema<"relation", undefined>;
134
+ readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
135
+ readonly relation: v.ArraySchema<v.ObjectSchema<{
136
+ readonly id: v.StringSchema<undefined>;
137
+ }, undefined>, undefined>;
138
+ readonly id: v.StringSchema<undefined>;
139
+ }, undefined>, v.ObjectSchema<{
140
+ readonly type: v.LiteralSchema<"files", undefined>;
141
+ readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
142
+ readonly type: v.LiteralSchema<"external", undefined>;
143
+ readonly name: v.StringSchema<undefined>;
144
+ readonly external: v.ObjectSchema<{
145
+ readonly url: v.StringSchema<undefined>;
146
+ }, undefined>;
147
+ }, undefined>, v.ObjectSchema<{
148
+ readonly type: v.LiteralSchema<"file", undefined>;
149
+ readonly name: v.StringSchema<undefined>;
150
+ readonly file: v.ObjectSchema<{
151
+ readonly url: v.StringSchema<undefined>;
152
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
153
+ }, undefined>;
154
+ }, undefined>], undefined>, undefined>;
155
+ readonly id: v.StringSchema<undefined>;
156
+ }, undefined>, v.ObjectSchema<{
157
+ readonly type: v.LiteralSchema<"place", undefined>;
158
+ readonly place: v.NullableSchema<v.ObjectSchema<{
159
+ readonly lat: v.NumberSchema<undefined>;
160
+ readonly lon: v.NumberSchema<undefined>;
161
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
162
+ readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
163
+ readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
164
+ readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
165
+ }, undefined>, undefined>;
166
+ readonly id: v.StringSchema<undefined>;
167
+ }, undefined>], undefined>, undefined>;
168
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
169
+ readonly type: v.LiteralSchema<"emoji", undefined>;
170
+ readonly emoji: v.StringSchema<undefined>;
171
+ }, undefined>, v.ObjectSchema<{
172
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
173
+ readonly custom_emoji: v.ObjectSchema<{
174
+ readonly id: v.StringSchema<undefined>;
175
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
176
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
177
+ }, undefined>;
178
+ }, undefined>, v.ObjectSchema<{
179
+ readonly type: v.LiteralSchema<"external", undefined>;
180
+ readonly external: v.ObjectSchema<{
181
+ readonly url: v.StringSchema<undefined>;
182
+ }, undefined>;
183
+ }, undefined>, v.ObjectSchema<{
184
+ readonly type: v.LiteralSchema<"file", undefined>;
185
+ readonly file: v.ObjectSchema<{
186
+ readonly url: v.StringSchema<undefined>;
187
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
188
+ }, undefined>;
189
+ }, undefined>], undefined>, undefined>;
190
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
191
+ readonly type: v.LiteralSchema<"external", undefined>;
192
+ readonly external: v.ObjectSchema<{
193
+ readonly url: v.StringSchema<undefined>;
194
+ }, undefined>;
195
+ }, undefined>, v.ObjectSchema<{
196
+ readonly type: v.LiteralSchema<"file", undefined>;
197
+ readonly file: v.ObjectSchema<{
198
+ readonly url: v.StringSchema<undefined>;
199
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
200
+ }, undefined>;
201
+ }, undefined>], undefined>, undefined>;
202
+ readonly position: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
203
+ readonly type: v.LiteralSchema<"start", undefined>;
204
+ }, undefined>, v.ObjectSchema<{
205
+ readonly type: v.LiteralSchema<"end", undefined>;
206
+ }, undefined>, v.ObjectSchema<{
207
+ readonly type: v.LiteralSchema<"before", undefined>;
208
+ readonly blockId: v.StringSchema<undefined>;
209
+ }, undefined>, v.ObjectSchema<{
210
+ readonly type: v.LiteralSchema<"after", undefined>;
211
+ readonly blockId: v.StringSchema<undefined>;
212
+ }, undefined>], undefined>, undefined>;
213
+ }, undefined>, v.ObjectSchema<{
214
+ readonly type: v.LiteralSchema<"getPage", undefined>;
215
+ readonly requestId: v.StringSchema<undefined>;
216
+ readonly pageId: v.StringSchema<undefined>;
217
+ }, undefined>, v.ObjectSchema<{
218
+ readonly type: v.LiteralSchema<"updatePage", undefined>;
219
+ readonly requestId: v.StringSchema<undefined>;
220
+ readonly pageId: v.StringSchema<undefined>;
221
+ readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
222
+ readonly type: v.LiteralSchema<"title", undefined>;
223
+ readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
224
+ readonly id: v.StringSchema<undefined>;
225
+ }, undefined>, v.ObjectSchema<{
226
+ readonly type: v.LiteralSchema<"rich_text", undefined>;
227
+ readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
228
+ readonly id: v.StringSchema<undefined>;
229
+ }, undefined>, v.ObjectSchema<{
230
+ readonly type: v.LiteralSchema<"number", undefined>;
231
+ readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
232
+ readonly id: v.StringSchema<undefined>;
233
+ }, undefined>, v.ObjectSchema<{
234
+ readonly type: v.LiteralSchema<"url", undefined>;
235
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
236
+ readonly id: v.StringSchema<undefined>;
237
+ }, undefined>, v.ObjectSchema<{
238
+ readonly type: v.LiteralSchema<"email", undefined>;
239
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
240
+ readonly id: v.StringSchema<undefined>;
241
+ }, undefined>, v.ObjectSchema<{
242
+ readonly type: v.LiteralSchema<"phone_number", undefined>;
243
+ readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
244
+ readonly id: v.StringSchema<undefined>;
245
+ }, undefined>, v.ObjectSchema<{
246
+ readonly type: v.LiteralSchema<"checkbox", undefined>;
247
+ readonly checkbox: v.BooleanSchema<undefined>;
248
+ readonly id: v.StringSchema<undefined>;
249
+ }, undefined>, v.ObjectSchema<{
250
+ readonly type: v.LiteralSchema<"select", undefined>;
251
+ readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
252
+ readonly id: v.StringSchema<undefined>;
253
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
254
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
255
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
256
+ }, undefined>, v.ObjectSchema<{
257
+ readonly name: v.StringSchema<undefined>;
258
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
259
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
260
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
261
+ }, undefined>], undefined>, undefined>;
262
+ readonly id: v.StringSchema<undefined>;
263
+ }, undefined>, v.ObjectSchema<{
264
+ readonly type: v.LiteralSchema<"status", undefined>;
265
+ readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
266
+ readonly id: v.StringSchema<undefined>;
267
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
268
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
269
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
270
+ }, undefined>, v.ObjectSchema<{
271
+ readonly name: v.StringSchema<undefined>;
272
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
273
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
274
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
275
+ }, undefined>], undefined>, undefined>;
276
+ readonly id: v.StringSchema<undefined>;
277
+ }, undefined>, v.ObjectSchema<{
278
+ readonly type: v.LiteralSchema<"multi_select", undefined>;
279
+ readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
280
+ readonly id: v.StringSchema<undefined>;
281
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
282
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
283
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
284
+ }, undefined>, v.ObjectSchema<{
285
+ readonly name: v.StringSchema<undefined>;
286
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
287
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
288
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
289
+ }, undefined>], undefined>, undefined>;
290
+ readonly id: v.StringSchema<undefined>;
291
+ }, undefined>, v.ObjectSchema<{
292
+ readonly type: v.LiteralSchema<"date", undefined>;
293
+ readonly date: v.NullableSchema<v.ObjectSchema<{
294
+ readonly start: v.StringSchema<undefined>;
295
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
296
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
297
+ }, undefined>, undefined>;
298
+ readonly id: v.StringSchema<undefined>;
299
+ }, undefined>, v.ObjectSchema<{
300
+ readonly type: v.LiteralSchema<"people", undefined>;
301
+ readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
302
+ readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
303
+ readonly id: v.StringSchema<undefined>;
304
+ }, undefined>, v.ObjectSchema<{
305
+ readonly object: v.LiteralSchema<"group", undefined>;
306
+ readonly id: v.StringSchema<undefined>;
307
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
308
+ }, undefined>], undefined>, undefined>;
309
+ readonly id: v.StringSchema<undefined>;
310
+ }, undefined>, v.ObjectSchema<{
311
+ readonly type: v.LiteralSchema<"relation", undefined>;
312
+ readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
313
+ readonly relation: v.ArraySchema<v.ObjectSchema<{
314
+ readonly id: v.StringSchema<undefined>;
315
+ }, undefined>, undefined>;
316
+ readonly id: v.StringSchema<undefined>;
317
+ }, undefined>, v.ObjectSchema<{
318
+ readonly type: v.LiteralSchema<"files", undefined>;
319
+ readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
320
+ readonly type: v.LiteralSchema<"external", undefined>;
321
+ readonly name: v.StringSchema<undefined>;
322
+ readonly external: v.ObjectSchema<{
323
+ readonly url: v.StringSchema<undefined>;
324
+ }, undefined>;
325
+ }, undefined>, v.ObjectSchema<{
326
+ readonly type: v.LiteralSchema<"file", undefined>;
327
+ readonly name: v.StringSchema<undefined>;
328
+ readonly file: v.ObjectSchema<{
329
+ readonly url: v.StringSchema<undefined>;
330
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
331
+ }, undefined>;
332
+ }, undefined>], undefined>, undefined>;
333
+ readonly id: v.StringSchema<undefined>;
334
+ }, undefined>, v.ObjectSchema<{
335
+ readonly type: v.LiteralSchema<"place", undefined>;
336
+ readonly place: v.NullableSchema<v.ObjectSchema<{
337
+ readonly lat: v.NumberSchema<undefined>;
338
+ readonly lon: v.NumberSchema<undefined>;
339
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
340
+ readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
341
+ readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
342
+ readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
343
+ }, undefined>, undefined>;
344
+ readonly id: v.StringSchema<undefined>;
345
+ }, undefined>], undefined>, undefined>, undefined>;
346
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
347
+ readonly type: v.LiteralSchema<"emoji", undefined>;
348
+ readonly emoji: v.StringSchema<undefined>;
349
+ }, undefined>, v.ObjectSchema<{
350
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
351
+ readonly custom_emoji: v.ObjectSchema<{
352
+ readonly id: v.StringSchema<undefined>;
353
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
354
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
355
+ }, undefined>;
356
+ }, undefined>, v.ObjectSchema<{
357
+ readonly type: v.LiteralSchema<"external", undefined>;
358
+ readonly external: v.ObjectSchema<{
359
+ readonly url: v.StringSchema<undefined>;
360
+ }, undefined>;
361
+ }, undefined>, v.ObjectSchema<{
362
+ readonly type: v.LiteralSchema<"file", undefined>;
363
+ readonly file: v.ObjectSchema<{
364
+ readonly url: v.StringSchema<undefined>;
365
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
366
+ }, undefined>;
367
+ }, undefined>], undefined>, undefined>;
368
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
369
+ readonly type: v.LiteralSchema<"external", undefined>;
370
+ readonly external: v.ObjectSchema<{
371
+ readonly url: v.StringSchema<undefined>;
372
+ }, undefined>;
373
+ }, undefined>, v.ObjectSchema<{
374
+ readonly type: v.LiteralSchema<"file", undefined>;
375
+ readonly file: v.ObjectSchema<{
376
+ readonly url: v.StringSchema<undefined>;
377
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
378
+ }, undefined>;
379
+ }, undefined>], undefined>, undefined>;
380
+ readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
381
+ }, undefined>, v.ObjectSchema<{
382
+ readonly type: v.LiteralSchema<"resize", undefined>;
383
+ readonly height: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.FiniteAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>;
384
+ }, undefined>, v.ObjectSchema<{
385
+ readonly type: v.LiteralSchema<"invalidHostMessage", undefined>;
386
+ readonly reason: v.StringSchema<undefined>;
387
+ }, undefined>], undefined>;
388
+ export type SandboxToHostMessage = v.InferOutput<typeof sandboxToHostMessageSchema>;
389
+ //# sourceMappingURL=sandboxToHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandboxToHost.d.ts","sourceRoot":"","sources":["../../../bridge/messages/sandboxToHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAS5B;;;GAGG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAQrC,CAAA;AAEF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,WAAW,CAC/C,OAAO,0BAA0B,CACjC,CAAA"}
@@ -0,0 +1,21 @@
1
+ import * as v from "valibot";
2
+ import { createPageMessageSchema } from "./createPage";
3
+ import { getPageMessageSchema } from "./getPage";
4
+ import { invalidHostMessageSchema } from "./invalidHostMessage";
5
+ import { queryDataSourceMessageSchema } from "./queryDataSource";
6
+ import { readyMessageSchema } from "./ready";
7
+ import { resizeMessageSchema } from "./resize";
8
+ import { updatePageMessageSchema } from "./updatePage";
9
+ /**
10
+ * Discriminated union of every message the sandbox is allowed to send the host. Useful for hosts
11
+ * to validate inbound traffic from sandboxes without re-implementing validation logic.
12
+ */
13
+ export const sandboxToHostMessageSchema = v.variant("type", [
14
+ readyMessageSchema,
15
+ queryDataSourceMessageSchema,
16
+ createPageMessageSchema,
17
+ getPageMessageSchema,
18
+ updatePageMessageSchema,
19
+ resizeMessageSchema,
20
+ invalidHostMessageSchema,
21
+ ]);
@@ -0,0 +1,11 @@
1
+ import * as v from "valibot";
2
+ /**
3
+ * Message sent by the host every time the theme changes after the initial
4
+ * `init` handshake.
5
+ */
6
+ export declare const themeChangedMessageSchema: v.ObjectSchema<{
7
+ readonly type: v.LiteralSchema<"themeChanged", undefined>;
8
+ readonly theme: v.PicklistSchema<["light", "dark"], undefined>;
9
+ }, undefined>;
10
+ export type ThemeChangedMessage = v.InferOutput<typeof themeChangedMessageSchema>;
11
+ //# sourceMappingURL=themeChanged.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themeChanged.d.ts","sourceRoot":"","sources":["../../../bridge/messages/themeChanged.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAG5B;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;aAGpC,CAAA;AAEF,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,WAAW,CAC9C,OAAO,yBAAyB,CAChC,CAAA"}
@@ -0,0 +1,10 @@
1
+ import * as v from "valibot";
2
+ import { notionThemeSchema } from "../theme";
3
+ /**
4
+ * Message sent by the host every time the theme changes after the initial
5
+ * `init` handshake.
6
+ */
7
+ export const themeChangedMessageSchema = v.object({
8
+ type: v.literal("themeChanged"),
9
+ theme: notionThemeSchema,
10
+ });
@@ -0,0 +1,171 @@
1
+ import * as v from "valibot";
2
+ /**
3
+ * Sandbox -> host: patch an existing page.
4
+ */
5
+ export declare const updatePageMessageSchema: v.ObjectSchema<{
6
+ readonly type: v.LiteralSchema<"updatePage", undefined>;
7
+ readonly requestId: v.StringSchema<undefined>;
8
+ readonly pageId: v.StringSchema<undefined>;
9
+ readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
10
+ readonly type: v.LiteralSchema<"title", undefined>;
11
+ readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
12
+ readonly id: v.StringSchema<undefined>;
13
+ }, undefined>, v.ObjectSchema<{
14
+ readonly type: v.LiteralSchema<"rich_text", undefined>;
15
+ readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
16
+ readonly id: v.StringSchema<undefined>;
17
+ }, undefined>, v.ObjectSchema<{
18
+ readonly type: v.LiteralSchema<"number", undefined>;
19
+ readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
20
+ readonly id: v.StringSchema<undefined>;
21
+ }, undefined>, v.ObjectSchema<{
22
+ readonly type: v.LiteralSchema<"url", undefined>;
23
+ readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
24
+ readonly id: v.StringSchema<undefined>;
25
+ }, undefined>, v.ObjectSchema<{
26
+ readonly type: v.LiteralSchema<"email", undefined>;
27
+ readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
28
+ readonly id: v.StringSchema<undefined>;
29
+ }, undefined>, v.ObjectSchema<{
30
+ readonly type: v.LiteralSchema<"phone_number", undefined>;
31
+ readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
32
+ readonly id: v.StringSchema<undefined>;
33
+ }, undefined>, v.ObjectSchema<{
34
+ readonly type: v.LiteralSchema<"checkbox", undefined>;
35
+ readonly checkbox: v.BooleanSchema<undefined>;
36
+ readonly id: v.StringSchema<undefined>;
37
+ }, undefined>, v.ObjectSchema<{
38
+ readonly type: v.LiteralSchema<"select", undefined>;
39
+ readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
40
+ readonly id: v.StringSchema<undefined>;
41
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
42
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
43
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
44
+ }, undefined>, v.ObjectSchema<{
45
+ readonly name: v.StringSchema<undefined>;
46
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
47
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
48
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
49
+ }, undefined>], undefined>, undefined>;
50
+ readonly id: v.StringSchema<undefined>;
51
+ }, undefined>, v.ObjectSchema<{
52
+ readonly type: v.LiteralSchema<"status", undefined>;
53
+ readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
54
+ readonly id: v.StringSchema<undefined>;
55
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
56
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
57
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
58
+ }, undefined>, v.ObjectSchema<{
59
+ readonly name: v.StringSchema<undefined>;
60
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
61
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
62
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
63
+ }, undefined>], undefined>, undefined>;
64
+ readonly id: v.StringSchema<undefined>;
65
+ }, undefined>, v.ObjectSchema<{
66
+ readonly type: v.LiteralSchema<"multi_select", undefined>;
67
+ readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
68
+ readonly id: v.StringSchema<undefined>;
69
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
70
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
71
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
72
+ }, undefined>, v.ObjectSchema<{
73
+ readonly name: v.StringSchema<undefined>;
74
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
75
+ readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
76
+ readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
77
+ }, undefined>], undefined>, undefined>;
78
+ readonly id: v.StringSchema<undefined>;
79
+ }, undefined>, v.ObjectSchema<{
80
+ readonly type: v.LiteralSchema<"date", undefined>;
81
+ readonly date: v.NullableSchema<v.ObjectSchema<{
82
+ readonly start: v.StringSchema<undefined>;
83
+ readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
84
+ readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
85
+ }, undefined>, undefined>;
86
+ readonly id: v.StringSchema<undefined>;
87
+ }, undefined>, v.ObjectSchema<{
88
+ readonly type: v.LiteralSchema<"people", undefined>;
89
+ readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
90
+ readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
91
+ readonly id: v.StringSchema<undefined>;
92
+ }, undefined>, v.ObjectSchema<{
93
+ readonly object: v.LiteralSchema<"group", undefined>;
94
+ readonly id: v.StringSchema<undefined>;
95
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
96
+ }, undefined>], undefined>, undefined>;
97
+ readonly id: v.StringSchema<undefined>;
98
+ }, undefined>, v.ObjectSchema<{
99
+ readonly type: v.LiteralSchema<"relation", undefined>;
100
+ readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
101
+ readonly relation: v.ArraySchema<v.ObjectSchema<{
102
+ readonly id: v.StringSchema<undefined>;
103
+ }, undefined>, undefined>;
104
+ readonly id: v.StringSchema<undefined>;
105
+ }, undefined>, v.ObjectSchema<{
106
+ readonly type: v.LiteralSchema<"files", undefined>;
107
+ readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
108
+ readonly type: v.LiteralSchema<"external", undefined>;
109
+ readonly name: v.StringSchema<undefined>;
110
+ readonly external: v.ObjectSchema<{
111
+ readonly url: v.StringSchema<undefined>;
112
+ }, undefined>;
113
+ }, undefined>, v.ObjectSchema<{
114
+ readonly type: v.LiteralSchema<"file", undefined>;
115
+ readonly name: v.StringSchema<undefined>;
116
+ readonly file: v.ObjectSchema<{
117
+ readonly url: v.StringSchema<undefined>;
118
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
119
+ }, undefined>;
120
+ }, undefined>], undefined>, undefined>;
121
+ readonly id: v.StringSchema<undefined>;
122
+ }, undefined>, v.ObjectSchema<{
123
+ readonly type: v.LiteralSchema<"place", undefined>;
124
+ readonly place: v.NullableSchema<v.ObjectSchema<{
125
+ readonly lat: v.NumberSchema<undefined>;
126
+ readonly lon: v.NumberSchema<undefined>;
127
+ readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
128
+ readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
129
+ readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
130
+ readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
131
+ }, undefined>, undefined>;
132
+ readonly id: v.StringSchema<undefined>;
133
+ }, undefined>], undefined>, undefined>, undefined>;
134
+ readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
135
+ readonly type: v.LiteralSchema<"emoji", undefined>;
136
+ readonly emoji: v.StringSchema<undefined>;
137
+ }, undefined>, v.ObjectSchema<{
138
+ readonly type: v.LiteralSchema<"custom_emoji", undefined>;
139
+ readonly custom_emoji: v.ObjectSchema<{
140
+ readonly id: v.StringSchema<undefined>;
141
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
142
+ readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
143
+ }, undefined>;
144
+ }, undefined>, v.ObjectSchema<{
145
+ readonly type: v.LiteralSchema<"external", undefined>;
146
+ readonly external: v.ObjectSchema<{
147
+ readonly url: v.StringSchema<undefined>;
148
+ }, undefined>;
149
+ }, undefined>, v.ObjectSchema<{
150
+ readonly type: v.LiteralSchema<"file", undefined>;
151
+ readonly file: v.ObjectSchema<{
152
+ readonly url: v.StringSchema<undefined>;
153
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
154
+ }, undefined>;
155
+ }, undefined>], undefined>, undefined>;
156
+ readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
157
+ readonly type: v.LiteralSchema<"external", undefined>;
158
+ readonly external: v.ObjectSchema<{
159
+ readonly url: v.StringSchema<undefined>;
160
+ }, undefined>;
161
+ }, undefined>, v.ObjectSchema<{
162
+ readonly type: v.LiteralSchema<"file", undefined>;
163
+ readonly file: v.ObjectSchema<{
164
+ readonly url: v.StringSchema<undefined>;
165
+ readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
166
+ }, undefined>;
167
+ }, undefined>], undefined>, undefined>;
168
+ readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
169
+ }, undefined>;
170
+ export type UpdatePageMessage = v.InferOutput<typeof updatePageMessageSchema>;
171
+ //# sourceMappingURL=updatePage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updatePage.d.ts","sourceRoot":"","sources":["../../../bridge/messages/updatePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAO5B;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAQlC,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -0,0 +1,14 @@
1
+ import * as v from "valibot";
2
+ import { notionPageCoverSchema, notionPageIconSchema, notionPagePropertyWriteMapSchema, } from "../pages/page";
3
+ /**
4
+ * Sandbox -> host: patch an existing page.
5
+ */
6
+ export const updatePageMessageSchema = v.object({
7
+ type: v.literal("updatePage"),
8
+ requestId: v.string(),
9
+ pageId: v.string(),
10
+ properties: v.optional(notionPagePropertyWriteMapSchema),
11
+ icon: v.optional(notionPageIconSchema),
12
+ cover: v.optional(notionPageCoverSchema),
13
+ archived: v.optional(v.boolean()),
14
+ });