@notionhq/custom-blocks-host 0.3.4 → 0.3.6
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.
- package/README.md +0 -5
- package/dist/browser.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/lifecycle/legacyPage.d.ts +70 -0
- package/dist/lifecycle/legacyPage.d.ts.map +1 -0
- package/dist/lifecycle/legacyPage.js +171 -0
- package/dist/lifecycle/normalizeHostToSandboxMessage.d.ts +2 -2
- package/dist/lifecycle/normalizeHostToSandboxMessage.d.ts.map +1 -1
- package/dist/lifecycle/normalizeHostToSandboxMessage.js +8 -30
- package/dist/lifecycle/normalizePage.d.ts +7 -0
- package/dist/lifecycle/normalizePage.d.ts.map +1 -0
- package/dist/lifecycle/normalizePage.js +22 -0
- package/dist/messages/types.d.ts +1 -2
- package/dist/messages/types.d.ts.map +1 -1
- package/dist/protocol/dataSources/dataSourcePage.d.ts +1 -162
- package/dist/protocol/dataSources/dataSourcePage.js +1 -9
- package/dist/protocol/messages/createPage.js +2 -2
- package/dist/protocol/messages/createPageResult.d.ts +468 -1
- package/dist/protocol/messages/createPageResult.js +17 -2
- package/dist/protocol/messages/getPage.d.ts +468 -1
- package/dist/protocol/messages/getPage.js +18 -3
- package/dist/protocol/messages/hostToSandbox.d.ts +2398 -159
- package/dist/protocol/messages/hostToSandbox.js +22 -12
- package/dist/protocol/messages/queryDataSourceResult.d.ts +312 -2
- package/dist/protocol/messages/queryDataSourceResult.js +18 -5
- package/dist/protocol/messages/sandboxToHost.d.ts +2 -0
- package/dist/protocol/messages/updatePage.d.ts +1 -0
- package/dist/protocol/messages/updatePage.js +4 -3
- package/dist/protocol/messages/updatePageResult.d.ts +467 -1
- package/dist/protocol/messages/updatePageResult.js +16 -2
- package/dist/protocol/pages/page.d.ts +386 -6
- package/dist/protocol/pages/page.js +23 -2
- package/dist/protocol/protocolVersion.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -4
- package/src/lifecycle/legacyPage.ts +208 -0
- package/src/lifecycle/normalizeHostToSandboxMessage.ts +18 -35
- package/src/lifecycle/normalizePage.ts +35 -0
- package/src/messages/types.ts +1 -1
|
@@ -15,6 +15,7 @@ export declare const getPageMessageSchema: v.ObjectSchema<{
|
|
|
15
15
|
readonly type: v.LiteralSchema<"getPage", undefined>;
|
|
16
16
|
readonly requestId: v.StringSchema<undefined>;
|
|
17
17
|
readonly pageId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
18
|
+
readonly dataSourceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
18
19
|
}, undefined>;
|
|
19
20
|
export type GetPageMessage = v.InferOutput<typeof getPageMessageSchema>;
|
|
20
21
|
export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.ObjectSchema<{
|
|
@@ -22,6 +23,471 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
22
23
|
readonly requestId: v.StringSchema<undefined>;
|
|
23
24
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
24
25
|
readonly page: v.ObjectSchema<{
|
|
26
|
+
readonly object: v.LiteralSchema<"page", undefined>;
|
|
27
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
28
|
+
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
29
|
+
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
30
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
31
|
+
}, undefined>, v.ObjectSchema<{
|
|
32
|
+
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
33
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
34
|
+
}, undefined>, v.ObjectSchema<{
|
|
35
|
+
readonly type: v.LiteralSchema<"workspace", undefined>;
|
|
36
|
+
readonly workspace: v.LiteralSchema<true, undefined>;
|
|
37
|
+
}, undefined>, v.ObjectSchema<{
|
|
38
|
+
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
39
|
+
readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
40
|
+
}, undefined>, v.ObjectSchema<{
|
|
41
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
42
|
+
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
43
|
+
}, undefined>, v.ObjectSchema<{
|
|
44
|
+
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
45
|
+
}, undefined>], undefined>;
|
|
46
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
47
|
+
readonly id: v.StringSchema<undefined>;
|
|
48
|
+
readonly type: v.LiteralSchema<"title", undefined>;
|
|
49
|
+
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
50
|
+
}, undefined>, v.ObjectSchema<{
|
|
51
|
+
readonly id: v.StringSchema<undefined>;
|
|
52
|
+
readonly type: v.LiteralSchema<"rich_text", undefined>;
|
|
53
|
+
readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
54
|
+
}, undefined>, v.ObjectSchema<{
|
|
55
|
+
readonly id: v.StringSchema<undefined>;
|
|
56
|
+
readonly type: v.LiteralSchema<"number", undefined>;
|
|
57
|
+
readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
58
|
+
}, undefined>, v.ObjectSchema<{
|
|
59
|
+
readonly id: v.StringSchema<undefined>;
|
|
60
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
61
|
+
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
62
|
+
}, undefined>, v.ObjectSchema<{
|
|
63
|
+
readonly id: v.StringSchema<undefined>;
|
|
64
|
+
readonly type: v.LiteralSchema<"email", undefined>;
|
|
65
|
+
readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
66
|
+
}, undefined>, v.ObjectSchema<{
|
|
67
|
+
readonly id: v.StringSchema<undefined>;
|
|
68
|
+
readonly type: v.LiteralSchema<"phone_number", undefined>;
|
|
69
|
+
readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
70
|
+
}, undefined>, v.ObjectSchema<{
|
|
71
|
+
readonly id: v.StringSchema<undefined>;
|
|
72
|
+
readonly type: v.LiteralSchema<"checkbox", undefined>;
|
|
73
|
+
readonly checkbox: v.BooleanSchema<undefined>;
|
|
74
|
+
}, undefined>, v.ObjectSchema<{
|
|
75
|
+
readonly id: v.StringSchema<undefined>;
|
|
76
|
+
readonly type: v.LiteralSchema<"select", undefined>;
|
|
77
|
+
readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
78
|
+
readonly id: v.StringSchema<undefined>;
|
|
79
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
80
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
81
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
82
|
+
}, undefined>, v.ObjectSchema<{
|
|
83
|
+
readonly name: v.StringSchema<undefined>;
|
|
84
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
85
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
86
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
87
|
+
}, undefined>], undefined>, undefined>;
|
|
88
|
+
}, undefined>, v.ObjectSchema<{
|
|
89
|
+
readonly id: v.StringSchema<undefined>;
|
|
90
|
+
readonly type: v.LiteralSchema<"status", undefined>;
|
|
91
|
+
readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
92
|
+
readonly id: v.StringSchema<undefined>;
|
|
93
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
94
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
95
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
96
|
+
}, undefined>, v.ObjectSchema<{
|
|
97
|
+
readonly name: v.StringSchema<undefined>;
|
|
98
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
99
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
100
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
101
|
+
}, undefined>], undefined>, undefined>;
|
|
102
|
+
}, undefined>, v.ObjectSchema<{
|
|
103
|
+
readonly id: v.StringSchema<undefined>;
|
|
104
|
+
readonly type: v.LiteralSchema<"multi_select", undefined>;
|
|
105
|
+
readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
106
|
+
readonly id: v.StringSchema<undefined>;
|
|
107
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
108
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
109
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
110
|
+
}, undefined>, v.ObjectSchema<{
|
|
111
|
+
readonly name: v.StringSchema<undefined>;
|
|
112
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
113
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
114
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
115
|
+
}, undefined>], undefined>, undefined>;
|
|
116
|
+
}, undefined>, v.ObjectSchema<{
|
|
117
|
+
readonly id: v.StringSchema<undefined>;
|
|
118
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
119
|
+
readonly date: v.NullableSchema<v.ObjectSchema<{
|
|
120
|
+
readonly start: v.StringSchema<undefined>;
|
|
121
|
+
readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
122
|
+
readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
123
|
+
}, undefined>, undefined>;
|
|
124
|
+
}, undefined>, v.ObjectSchema<{
|
|
125
|
+
readonly id: v.StringSchema<undefined>;
|
|
126
|
+
readonly type: v.LiteralSchema<"people", undefined>;
|
|
127
|
+
readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
128
|
+
readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
|
|
129
|
+
readonly id: v.StringSchema<undefined>;
|
|
130
|
+
}, undefined>, v.ObjectSchema<{
|
|
131
|
+
readonly object: v.LiteralSchema<"group", undefined>;
|
|
132
|
+
readonly id: v.StringSchema<undefined>;
|
|
133
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
134
|
+
}, undefined>], undefined>, undefined>;
|
|
135
|
+
}, undefined>, v.ObjectSchema<{
|
|
136
|
+
readonly id: v.StringSchema<undefined>;
|
|
137
|
+
readonly type: v.LiteralSchema<"relation", undefined>;
|
|
138
|
+
readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
139
|
+
readonly relation: v.ArraySchema<v.ObjectSchema<{
|
|
140
|
+
readonly id: v.StringSchema<undefined>;
|
|
141
|
+
}, undefined>, undefined>;
|
|
142
|
+
}, undefined>, v.ObjectSchema<{
|
|
143
|
+
readonly id: v.StringSchema<undefined>;
|
|
144
|
+
readonly type: v.LiteralSchema<"files", undefined>;
|
|
145
|
+
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
146
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
147
|
+
readonly name: v.StringSchema<undefined>;
|
|
148
|
+
readonly external: v.ObjectSchema<{
|
|
149
|
+
readonly url: v.StringSchema<undefined>;
|
|
150
|
+
}, undefined>;
|
|
151
|
+
}, undefined>, v.ObjectSchema<{
|
|
152
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
153
|
+
readonly name: v.StringSchema<undefined>;
|
|
154
|
+
readonly file: v.ObjectSchema<{
|
|
155
|
+
readonly url: v.StringSchema<undefined>;
|
|
156
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
157
|
+
}, undefined>;
|
|
158
|
+
}, undefined>], undefined>, undefined>;
|
|
159
|
+
}, undefined>, v.ObjectSchema<{
|
|
160
|
+
readonly id: v.StringSchema<undefined>;
|
|
161
|
+
readonly type: v.LiteralSchema<"place", undefined>;
|
|
162
|
+
readonly place: v.NullableSchema<v.ObjectSchema<{
|
|
163
|
+
readonly lat: v.NumberSchema<undefined>;
|
|
164
|
+
readonly lon: v.NumberSchema<undefined>;
|
|
165
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
166
|
+
readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
167
|
+
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
168
|
+
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
169
|
+
}, undefined>, undefined>;
|
|
170
|
+
}, undefined>, v.ObjectSchema<{
|
|
171
|
+
readonly id: v.StringSchema<undefined>;
|
|
172
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
173
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
174
|
+
}, undefined>, v.ObjectSchema<{
|
|
175
|
+
readonly id: v.StringSchema<undefined>;
|
|
176
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
177
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
178
|
+
}, undefined>, v.ObjectSchema<{
|
|
179
|
+
readonly id: v.StringSchema<undefined>;
|
|
180
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
181
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
182
|
+
readonly id: v.StringSchema<undefined>;
|
|
183
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
184
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
185
|
+
}, undefined>, undefined>;
|
|
186
|
+
}, undefined>, v.ObjectSchema<{
|
|
187
|
+
readonly id: v.StringSchema<undefined>;
|
|
188
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
189
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
190
|
+
readonly id: v.StringSchema<undefined>;
|
|
191
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
192
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
193
|
+
}, undefined>, undefined>;
|
|
194
|
+
}, undefined>, v.ObjectSchema<{
|
|
195
|
+
readonly id: v.StringSchema<undefined>;
|
|
196
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
197
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
198
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
199
|
+
readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
200
|
+
readonly id: v.StringSchema<undefined>;
|
|
201
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
202
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
203
|
+
}, undefined>, undefined>, null>;
|
|
204
|
+
readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
205
|
+
readonly id: v.StringSchema<undefined>;
|
|
206
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
207
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
208
|
+
}, undefined>, undefined>, null>;
|
|
209
|
+
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
210
|
+
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
211
|
+
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
212
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
213
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
214
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
215
|
+
}, undefined>, v.ObjectSchema<{
|
|
216
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
217
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
218
|
+
readonly id: v.StringSchema<undefined>;
|
|
219
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
220
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
221
|
+
}, undefined>;
|
|
222
|
+
}, undefined>, v.ObjectSchema<{
|
|
223
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
224
|
+
readonly external: v.ObjectSchema<{
|
|
225
|
+
readonly url: v.StringSchema<undefined>;
|
|
226
|
+
}, undefined>;
|
|
227
|
+
}, undefined>, v.ObjectSchema<{
|
|
228
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
229
|
+
readonly file: v.ObjectSchema<{
|
|
230
|
+
readonly url: v.StringSchema<undefined>;
|
|
231
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
232
|
+
}, undefined>;
|
|
233
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
234
|
+
readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
235
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
236
|
+
readonly external: v.ObjectSchema<{
|
|
237
|
+
readonly url: v.StringSchema<undefined>;
|
|
238
|
+
}, undefined>;
|
|
239
|
+
}, undefined>, v.ObjectSchema<{
|
|
240
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
241
|
+
readonly file: v.ObjectSchema<{
|
|
242
|
+
readonly url: v.StringSchema<undefined>;
|
|
243
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
244
|
+
}, undefined>;
|
|
245
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
246
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
247
|
+
readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
248
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
249
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
250
|
+
}, undefined>;
|
|
251
|
+
}, undefined>, v.ObjectSchema<{
|
|
252
|
+
readonly type: v.LiteralSchema<"getPageResult", undefined>;
|
|
253
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
254
|
+
readonly status: v.LiteralSchema<"error", undefined>;
|
|
255
|
+
readonly error: v.ObjectSchema<{
|
|
256
|
+
readonly code: v.StringSchema<undefined>;
|
|
257
|
+
readonly message: v.StringSchema<undefined>;
|
|
258
|
+
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
259
|
+
}, undefined>;
|
|
260
|
+
}, undefined>], undefined>;
|
|
261
|
+
export declare const getPageResultMessageLegacySchema: v.VariantSchema<"status", [v.ObjectSchema<{
|
|
262
|
+
readonly type: v.LiteralSchema<"getPageResult", undefined>;
|
|
263
|
+
readonly requestId: v.StringSchema<undefined>;
|
|
264
|
+
readonly status: v.LiteralSchema<"success", undefined>;
|
|
265
|
+
readonly page: v.UnionSchema<[v.ObjectSchema<{
|
|
266
|
+
readonly object: v.LiteralSchema<"page", undefined>;
|
|
267
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
268
|
+
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
269
|
+
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
270
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
271
|
+
}, undefined>, v.ObjectSchema<{
|
|
272
|
+
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
273
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
274
|
+
}, undefined>, v.ObjectSchema<{
|
|
275
|
+
readonly type: v.LiteralSchema<"workspace", undefined>;
|
|
276
|
+
readonly workspace: v.LiteralSchema<true, undefined>;
|
|
277
|
+
}, undefined>, v.ObjectSchema<{
|
|
278
|
+
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
279
|
+
readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
280
|
+
}, undefined>, v.ObjectSchema<{
|
|
281
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
282
|
+
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
283
|
+
}, undefined>, v.ObjectSchema<{
|
|
284
|
+
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
285
|
+
}, undefined>], undefined>;
|
|
286
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
287
|
+
readonly id: v.StringSchema<undefined>;
|
|
288
|
+
readonly type: v.LiteralSchema<"title", undefined>;
|
|
289
|
+
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
290
|
+
}, undefined>, v.ObjectSchema<{
|
|
291
|
+
readonly id: v.StringSchema<undefined>;
|
|
292
|
+
readonly type: v.LiteralSchema<"rich_text", undefined>;
|
|
293
|
+
readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
294
|
+
}, undefined>, v.ObjectSchema<{
|
|
295
|
+
readonly id: v.StringSchema<undefined>;
|
|
296
|
+
readonly type: v.LiteralSchema<"number", undefined>;
|
|
297
|
+
readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
298
|
+
}, undefined>, v.ObjectSchema<{
|
|
299
|
+
readonly id: v.StringSchema<undefined>;
|
|
300
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
301
|
+
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
302
|
+
}, undefined>, v.ObjectSchema<{
|
|
303
|
+
readonly id: v.StringSchema<undefined>;
|
|
304
|
+
readonly type: v.LiteralSchema<"email", undefined>;
|
|
305
|
+
readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
306
|
+
}, undefined>, v.ObjectSchema<{
|
|
307
|
+
readonly id: v.StringSchema<undefined>;
|
|
308
|
+
readonly type: v.LiteralSchema<"phone_number", undefined>;
|
|
309
|
+
readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
310
|
+
}, undefined>, v.ObjectSchema<{
|
|
311
|
+
readonly id: v.StringSchema<undefined>;
|
|
312
|
+
readonly type: v.LiteralSchema<"checkbox", undefined>;
|
|
313
|
+
readonly checkbox: v.BooleanSchema<undefined>;
|
|
314
|
+
}, undefined>, v.ObjectSchema<{
|
|
315
|
+
readonly id: v.StringSchema<undefined>;
|
|
316
|
+
readonly type: v.LiteralSchema<"select", undefined>;
|
|
317
|
+
readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
318
|
+
readonly id: v.StringSchema<undefined>;
|
|
319
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
320
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
321
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
322
|
+
}, undefined>, v.ObjectSchema<{
|
|
323
|
+
readonly name: v.StringSchema<undefined>;
|
|
324
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
325
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
326
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
327
|
+
}, undefined>], undefined>, undefined>;
|
|
328
|
+
}, undefined>, v.ObjectSchema<{
|
|
329
|
+
readonly id: v.StringSchema<undefined>;
|
|
330
|
+
readonly type: v.LiteralSchema<"status", undefined>;
|
|
331
|
+
readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
332
|
+
readonly id: v.StringSchema<undefined>;
|
|
333
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
334
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
335
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
336
|
+
}, undefined>, v.ObjectSchema<{
|
|
337
|
+
readonly name: v.StringSchema<undefined>;
|
|
338
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
339
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
340
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
341
|
+
}, undefined>], undefined>, undefined>;
|
|
342
|
+
}, undefined>, v.ObjectSchema<{
|
|
343
|
+
readonly id: v.StringSchema<undefined>;
|
|
344
|
+
readonly type: v.LiteralSchema<"multi_select", undefined>;
|
|
345
|
+
readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
346
|
+
readonly id: v.StringSchema<undefined>;
|
|
347
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
348
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
349
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
350
|
+
}, undefined>, v.ObjectSchema<{
|
|
351
|
+
readonly name: v.StringSchema<undefined>;
|
|
352
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
353
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
354
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
355
|
+
}, undefined>], undefined>, undefined>;
|
|
356
|
+
}, undefined>, v.ObjectSchema<{
|
|
357
|
+
readonly id: v.StringSchema<undefined>;
|
|
358
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
359
|
+
readonly date: v.NullableSchema<v.ObjectSchema<{
|
|
360
|
+
readonly start: v.StringSchema<undefined>;
|
|
361
|
+
readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
362
|
+
readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
363
|
+
}, undefined>, undefined>;
|
|
364
|
+
}, undefined>, v.ObjectSchema<{
|
|
365
|
+
readonly id: v.StringSchema<undefined>;
|
|
366
|
+
readonly type: v.LiteralSchema<"people", undefined>;
|
|
367
|
+
readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
368
|
+
readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
|
|
369
|
+
readonly id: v.StringSchema<undefined>;
|
|
370
|
+
}, undefined>, v.ObjectSchema<{
|
|
371
|
+
readonly object: v.LiteralSchema<"group", undefined>;
|
|
372
|
+
readonly id: v.StringSchema<undefined>;
|
|
373
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
374
|
+
}, undefined>], undefined>, undefined>;
|
|
375
|
+
}, undefined>, v.ObjectSchema<{
|
|
376
|
+
readonly id: v.StringSchema<undefined>;
|
|
377
|
+
readonly type: v.LiteralSchema<"relation", undefined>;
|
|
378
|
+
readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
379
|
+
readonly relation: v.ArraySchema<v.ObjectSchema<{
|
|
380
|
+
readonly id: v.StringSchema<undefined>;
|
|
381
|
+
}, undefined>, undefined>;
|
|
382
|
+
}, undefined>, v.ObjectSchema<{
|
|
383
|
+
readonly id: v.StringSchema<undefined>;
|
|
384
|
+
readonly type: v.LiteralSchema<"files", undefined>;
|
|
385
|
+
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
386
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
387
|
+
readonly name: v.StringSchema<undefined>;
|
|
388
|
+
readonly external: v.ObjectSchema<{
|
|
389
|
+
readonly url: v.StringSchema<undefined>;
|
|
390
|
+
}, undefined>;
|
|
391
|
+
}, undefined>, v.ObjectSchema<{
|
|
392
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
393
|
+
readonly name: v.StringSchema<undefined>;
|
|
394
|
+
readonly file: v.ObjectSchema<{
|
|
395
|
+
readonly url: v.StringSchema<undefined>;
|
|
396
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
397
|
+
}, undefined>;
|
|
398
|
+
}, undefined>], undefined>, undefined>;
|
|
399
|
+
}, undefined>, v.ObjectSchema<{
|
|
400
|
+
readonly id: v.StringSchema<undefined>;
|
|
401
|
+
readonly type: v.LiteralSchema<"place", undefined>;
|
|
402
|
+
readonly place: v.NullableSchema<v.ObjectSchema<{
|
|
403
|
+
readonly lat: v.NumberSchema<undefined>;
|
|
404
|
+
readonly lon: v.NumberSchema<undefined>;
|
|
405
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
406
|
+
readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
407
|
+
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
408
|
+
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
409
|
+
}, undefined>, undefined>;
|
|
410
|
+
}, undefined>, v.ObjectSchema<{
|
|
411
|
+
readonly id: v.StringSchema<undefined>;
|
|
412
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
413
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
414
|
+
}, undefined>, v.ObjectSchema<{
|
|
415
|
+
readonly id: v.StringSchema<undefined>;
|
|
416
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
417
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
418
|
+
}, undefined>, v.ObjectSchema<{
|
|
419
|
+
readonly id: v.StringSchema<undefined>;
|
|
420
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
421
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
422
|
+
readonly id: v.StringSchema<undefined>;
|
|
423
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
424
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
425
|
+
}, undefined>, undefined>;
|
|
426
|
+
}, undefined>, v.ObjectSchema<{
|
|
427
|
+
readonly id: v.StringSchema<undefined>;
|
|
428
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
429
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
430
|
+
readonly id: v.StringSchema<undefined>;
|
|
431
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
432
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
433
|
+
}, undefined>, undefined>;
|
|
434
|
+
}, undefined>, v.ObjectSchema<{
|
|
435
|
+
readonly id: v.StringSchema<undefined>;
|
|
436
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
437
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
438
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
439
|
+
readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
440
|
+
readonly id: v.StringSchema<undefined>;
|
|
441
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
442
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
443
|
+
}, undefined>, undefined>, null>;
|
|
444
|
+
readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
445
|
+
readonly id: v.StringSchema<undefined>;
|
|
446
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
447
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
448
|
+
}, undefined>, undefined>, null>;
|
|
449
|
+
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
450
|
+
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
451
|
+
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
452
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
453
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
454
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
455
|
+
}, undefined>, v.ObjectSchema<{
|
|
456
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
457
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
458
|
+
readonly id: v.StringSchema<undefined>;
|
|
459
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
460
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
461
|
+
}, undefined>;
|
|
462
|
+
}, undefined>, v.ObjectSchema<{
|
|
463
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
464
|
+
readonly external: v.ObjectSchema<{
|
|
465
|
+
readonly url: v.StringSchema<undefined>;
|
|
466
|
+
}, undefined>;
|
|
467
|
+
}, undefined>, v.ObjectSchema<{
|
|
468
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
469
|
+
readonly file: v.ObjectSchema<{
|
|
470
|
+
readonly url: v.StringSchema<undefined>;
|
|
471
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
472
|
+
}, undefined>;
|
|
473
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
474
|
+
readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
475
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
476
|
+
readonly external: v.ObjectSchema<{
|
|
477
|
+
readonly url: v.StringSchema<undefined>;
|
|
478
|
+
}, undefined>;
|
|
479
|
+
}, undefined>, v.ObjectSchema<{
|
|
480
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
481
|
+
readonly file: v.ObjectSchema<{
|
|
482
|
+
readonly url: v.StringSchema<undefined>;
|
|
483
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
484
|
+
}, undefined>;
|
|
485
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
486
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
487
|
+
readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
488
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
489
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
490
|
+
}, undefined>, v.ObjectSchema<{
|
|
25
491
|
readonly object: v.LiteralSchema<"page", undefined>;
|
|
26
492
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
27
493
|
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
@@ -235,7 +701,7 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
235
701
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
236
702
|
readonly is_archived: v.BooleanSchema<undefined>;
|
|
237
703
|
readonly in_trash: v.BooleanSchema<undefined>;
|
|
238
|
-
}, undefined>;
|
|
704
|
+
}, undefined>], undefined>;
|
|
239
705
|
}, undefined>, v.ObjectSchema<{
|
|
240
706
|
readonly type: v.LiteralSchema<"getPageResult", undefined>;
|
|
241
707
|
readonly requestId: v.StringSchema<undefined>;
|
|
@@ -247,3 +713,4 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
247
713
|
}, undefined>;
|
|
248
714
|
}, undefined>], undefined>;
|
|
249
715
|
export type GetPageResultMessage = v.InferOutput<typeof getPageResultMessageSchema>;
|
|
716
|
+
export type GetPageResultMessageLegacy = v.InferOutput<typeof getPageResultMessageLegacySchema>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import { notionPageIdSchema } from "../ids.js";
|
|
3
|
-
import {
|
|
2
|
+
import { notionDataSourceIdSchema, notionPageIdSchema } from "../ids.js";
|
|
3
|
+
import { legacyNotionPageSchema, notionPageDataSchema } from "../pages/page.js";
|
|
4
4
|
// The schema accepts any string code. The type lists known codes for
|
|
5
5
|
// autocomplete, with an open string fallback for newer senders.
|
|
6
6
|
export const customBlockGetPageErrorCodeSchema = v.string();
|
|
@@ -16,13 +16,28 @@ export const getPageMessageSchema = v.object({
|
|
|
16
16
|
type: v.literal("getPage"),
|
|
17
17
|
requestId: v.string(),
|
|
18
18
|
pageId: notionPageIdSchema,
|
|
19
|
+
dataSourceId: v.optional(notionDataSourceIdSchema),
|
|
19
20
|
});
|
|
20
21
|
export const getPageResultMessageSchema = v.variant("status", [
|
|
21
22
|
v.object({
|
|
22
23
|
type: v.literal("getPageResult"),
|
|
23
24
|
requestId: v.string(),
|
|
24
25
|
status: v.literal("success"),
|
|
25
|
-
page:
|
|
26
|
+
page: notionPageDataSchema,
|
|
27
|
+
}),
|
|
28
|
+
v.object({
|
|
29
|
+
type: v.literal("getPageResult"),
|
|
30
|
+
requestId: v.string(),
|
|
31
|
+
status: v.literal("error"),
|
|
32
|
+
error: customBlockGetPageErrorInfoSchema,
|
|
33
|
+
}),
|
|
34
|
+
]);
|
|
35
|
+
export const getPageResultMessageLegacySchema = v.variant("status", [
|
|
36
|
+
v.object({
|
|
37
|
+
type: v.literal("getPageResult"),
|
|
38
|
+
requestId: v.string(),
|
|
39
|
+
status: v.literal("success"),
|
|
40
|
+
page: v.union([notionPageDataSchema, legacyNotionPageSchema]),
|
|
26
41
|
}),
|
|
27
42
|
v.object({
|
|
28
43
|
type: v.literal("getPageResult"),
|