@notionhq/custom-blocks 0.2.22 β 0.2.24
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/dist/bridge/dataSources/query.d.ts.map +1 -1
- package/dist/bridge/dataSources/query.js +10 -1
- package/dist/bridge/dataSources/resolveProperty.d.ts +3 -3
- package/dist/bridge/dataSources/resolveProperty.d.ts.map +1 -1
- package/dist/bridge/dataSources/resolveProperty.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/protocol/manifest.d.ts +10 -3
- package/dist/protocol/manifest.js +5 -1
- package/dist/protocol/messages/connect.d.ts +9 -2
- package/dist/protocol/messages/createPage.d.ts +28 -0
- package/dist/protocol/messages/createPage.js +2 -2
- package/dist/protocol/messages/createPageResult.d.ts +28 -0
- package/dist/protocol/messages/getPage.d.ts +28 -0
- package/dist/protocol/messages/hostToSandbox.d.ts +93 -2
- package/dist/protocol/messages/init.d.ts +9 -2
- package/dist/protocol/messages/queryDataSource.d.ts +41 -0
- package/dist/protocol/messages/queryDataSource.js +13 -1
- package/dist/protocol/messages/sandboxToHost.d.ts +79 -2
- package/dist/protocol/messages/updatePage.d.ts +28 -0
- package/dist/protocol/messages/updatePage.js +2 -2
- package/dist/protocol/messages/updatePageResult.d.ts +28 -0
- package/dist/protocol/pages/page.d.ts +89 -2
- package/dist/protocol/pages/page.js +33 -2
- package/dist/types.d.ts +6 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/docs/data-sources.md +46 -30
- package/docs/errors.md +1 -2
- package/docs/lifecycle.md +1 -1
- package/docs/pages.md +10 -11
- package/package.json +1 -1
- package/src/bridge/dataSources/query.ts +13 -0
- package/src/bridge/dataSources/resolveProperty.ts +4 -4
- package/src/index.ts +1 -0
- package/src/types.ts +7 -2
|
@@ -11,7 +11,14 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
11
11
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
12
12
|
readonly manifest: v.OptionalSchema<v.ObjectSchema<{
|
|
13
13
|
readonly version: v.LiteralSchema<1, undefined>;
|
|
14
|
-
readonly
|
|
14
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
15
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
16
|
+
readonly slashCommand: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
17
|
+
readonly icon: v.OptionalSchema<v.ObjectSchema<{
|
|
18
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
19
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
20
|
+
}, undefined>, undefined>;
|
|
21
|
+
readonly dataSources: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
15
22
|
readonly name: v.StringSchema<undefined>;
|
|
16
23
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
17
24
|
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
@@ -26,7 +33,7 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
26
33
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
27
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>;
|
|
28
35
|
}, undefined>, undefined>, {}>;
|
|
29
|
-
}, undefined>, undefined>;
|
|
36
|
+
}, undefined>, undefined>, {}>;
|
|
30
37
|
}, undefined>, undefined>;
|
|
31
38
|
}, undefined>, v.ObjectSchema<{
|
|
32
39
|
readonly type: v.LiteralSchema<"connect", undefined>;
|
|
@@ -59,6 +66,13 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
59
66
|
readonly dataSourceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
60
67
|
readonly limit: v.NumberSchema<undefined>;
|
|
61
68
|
readonly filter: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.StrictObjectSchema<{
|
|
69
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
70
|
+
readonly relation: v.UnionSchema<[v.StrictObjectSchema<{
|
|
71
|
+
readonly contains: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>, v.RegexAction<string & v.Brand<"NotionPageId">, undefined>, v.TransformAction<string & v.Brand<"NotionPageId">, string>]>;
|
|
72
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
73
|
+
readonly does_not_contain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>, v.RegexAction<string & v.Brand<"NotionPageId">, undefined>, v.TransformAction<string & v.Brand<"NotionPageId">, string>]>;
|
|
74
|
+
}, undefined>], undefined>;
|
|
75
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
62
76
|
readonly propertyId: v.StringSchema<undefined>;
|
|
63
77
|
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
64
78
|
readonly contains: v.StrictObjectSchema<{
|
|
@@ -299,6 +313,13 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
299
313
|
}, undefined>], undefined>], undefined>;
|
|
300
314
|
}, undefined>], undefined>, v.StrictObjectSchema<{
|
|
301
315
|
readonly and: v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
316
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
317
|
+
readonly relation: v.UnionSchema<[v.StrictObjectSchema<{
|
|
318
|
+
readonly contains: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>, v.RegexAction<string & v.Brand<"NotionPageId">, undefined>, v.TransformAction<string & v.Brand<"NotionPageId">, string>]>;
|
|
319
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
320
|
+
readonly does_not_contain: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>, v.RegexAction<string & v.Brand<"NotionPageId">, undefined>, v.TransformAction<string & v.Brand<"NotionPageId">, string>]>;
|
|
321
|
+
}, undefined>], undefined>;
|
|
322
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
302
323
|
readonly propertyId: v.StringSchema<undefined>;
|
|
303
324
|
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
304
325
|
readonly contains: v.StrictObjectSchema<{
|
|
@@ -680,6 +701,34 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
680
701
|
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
681
702
|
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
682
703
|
}, undefined>, undefined>;
|
|
704
|
+
}, undefined>, v.ObjectSchema<{
|
|
705
|
+
readonly id: v.StringSchema<undefined>;
|
|
706
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
707
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
708
|
+
}, undefined>, v.ObjectSchema<{
|
|
709
|
+
readonly id: v.StringSchema<undefined>;
|
|
710
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
711
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
712
|
+
}, undefined>, v.ObjectSchema<{
|
|
713
|
+
readonly id: v.StringSchema<undefined>;
|
|
714
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
715
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
716
|
+
readonly id: v.StringSchema<undefined>;
|
|
717
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
718
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
719
|
+
}, undefined>, undefined>;
|
|
720
|
+
}, undefined>, v.ObjectSchema<{
|
|
721
|
+
readonly id: v.StringSchema<undefined>;
|
|
722
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
723
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
724
|
+
readonly id: v.StringSchema<undefined>;
|
|
725
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
726
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
727
|
+
}, undefined>, undefined>;
|
|
728
|
+
}, undefined>, v.ObjectSchema<{
|
|
729
|
+
readonly id: v.StringSchema<undefined>;
|
|
730
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
731
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
683
732
|
}, undefined>], undefined>, undefined>;
|
|
684
733
|
readonly position: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
685
734
|
readonly type: v.LiteralSchema<"start", undefined>;
|
|
@@ -838,6 +887,34 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
838
887
|
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
839
888
|
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
840
889
|
}, undefined>, undefined>;
|
|
890
|
+
}, undefined>, v.ObjectSchema<{
|
|
891
|
+
readonly id: v.StringSchema<undefined>;
|
|
892
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
893
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
894
|
+
}, undefined>, v.ObjectSchema<{
|
|
895
|
+
readonly id: v.StringSchema<undefined>;
|
|
896
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
897
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
898
|
+
}, undefined>, v.ObjectSchema<{
|
|
899
|
+
readonly id: v.StringSchema<undefined>;
|
|
900
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
901
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
902
|
+
readonly id: v.StringSchema<undefined>;
|
|
903
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
904
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
905
|
+
}, undefined>, undefined>;
|
|
906
|
+
}, undefined>, v.ObjectSchema<{
|
|
907
|
+
readonly id: v.StringSchema<undefined>;
|
|
908
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
909
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
910
|
+
readonly id: v.StringSchema<undefined>;
|
|
911
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
912
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
913
|
+
}, undefined>, undefined>;
|
|
914
|
+
}, undefined>, v.ObjectSchema<{
|
|
915
|
+
readonly id: v.StringSchema<undefined>;
|
|
916
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
917
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
841
918
|
}, undefined>], undefined>, undefined>, undefined>;
|
|
842
919
|
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
843
920
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
@@ -137,6 +137,34 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
|
|
|
137
137
|
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
138
138
|
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
139
139
|
}, undefined>, undefined>;
|
|
140
|
+
}, undefined>, v.ObjectSchema<{
|
|
141
|
+
readonly id: v.StringSchema<undefined>;
|
|
142
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
143
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
144
|
+
}, undefined>, v.ObjectSchema<{
|
|
145
|
+
readonly id: v.StringSchema<undefined>;
|
|
146
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
147
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
148
|
+
}, undefined>, v.ObjectSchema<{
|
|
149
|
+
readonly id: v.StringSchema<undefined>;
|
|
150
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
151
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
152
|
+
readonly id: v.StringSchema<undefined>;
|
|
153
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
154
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
155
|
+
}, undefined>, undefined>;
|
|
156
|
+
}, undefined>, v.ObjectSchema<{
|
|
157
|
+
readonly id: v.StringSchema<undefined>;
|
|
158
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
159
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
160
|
+
readonly id: v.StringSchema<undefined>;
|
|
161
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
162
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
163
|
+
}, undefined>, undefined>;
|
|
164
|
+
}, undefined>, v.ObjectSchema<{
|
|
165
|
+
readonly id: v.StringSchema<undefined>;
|
|
166
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
167
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
140
168
|
}, undefined>], undefined>, undefined>, undefined>;
|
|
141
169
|
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
142
170
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { notionPageIdSchema } from "../ids.js";
|
|
3
|
-
import { notionPageCoverSchema, notionPageIconSchema,
|
|
3
|
+
import { notionPageCoverSchema, notionPageIconSchema, notionPagePropertyReadMapSchema, } from "../pages/page.js";
|
|
4
4
|
/**
|
|
5
5
|
* The sandbox sends this message to patch a page.
|
|
6
6
|
*/
|
|
@@ -15,7 +15,7 @@ export const updatePageMessageSchema = v.object({
|
|
|
15
15
|
* To update a page with manifest-defined property keys, call `row.update()` on a row returned
|
|
16
16
|
* by `useDataSource()`. The SDK resolves those keys before it sends this message.
|
|
17
17
|
*/
|
|
18
|
-
properties: v.optional(
|
|
18
|
+
properties: v.optional(notionPagePropertyReadMapSchema),
|
|
19
19
|
icon: v.optional(notionPageIconSchema),
|
|
20
20
|
cover: v.optional(notionPageCoverSchema),
|
|
21
21
|
archived: v.optional(v.boolean()),
|
|
@@ -160,6 +160,34 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
160
160
|
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
161
161
|
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
162
162
|
}, undefined>, undefined>;
|
|
163
|
+
}, undefined>, v.ObjectSchema<{
|
|
164
|
+
readonly id: v.StringSchema<undefined>;
|
|
165
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
166
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
167
|
+
}, undefined>, v.ObjectSchema<{
|
|
168
|
+
readonly id: v.StringSchema<undefined>;
|
|
169
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
170
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
171
|
+
}, undefined>, v.ObjectSchema<{
|
|
172
|
+
readonly id: v.StringSchema<undefined>;
|
|
173
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
174
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
175
|
+
readonly id: v.StringSchema<undefined>;
|
|
176
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
177
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
178
|
+
}, undefined>, undefined>;
|
|
179
|
+
}, undefined>, v.ObjectSchema<{
|
|
180
|
+
readonly id: v.StringSchema<undefined>;
|
|
181
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
182
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
183
|
+
readonly id: v.StringSchema<undefined>;
|
|
184
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
185
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
186
|
+
}, undefined>, undefined>;
|
|
187
|
+
}, undefined>, v.ObjectSchema<{
|
|
188
|
+
readonly id: v.StringSchema<undefined>;
|
|
189
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
190
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
163
191
|
}, undefined>], undefined>, undefined>;
|
|
164
192
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
165
193
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -283,9 +283,37 @@ export declare const notionPagePropertyValueSchema: v.VariantSchema<"type", [v.O
|
|
|
283
283
|
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
284
284
|
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
285
285
|
}, undefined>, undefined>;
|
|
286
|
+
}, undefined>, v.ObjectSchema<{
|
|
287
|
+
readonly id: v.StringSchema<undefined>;
|
|
288
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
289
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
290
|
+
}, undefined>, v.ObjectSchema<{
|
|
291
|
+
readonly id: v.StringSchema<undefined>;
|
|
292
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
293
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
294
|
+
}, undefined>, v.ObjectSchema<{
|
|
295
|
+
readonly id: v.StringSchema<undefined>;
|
|
296
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
297
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
298
|
+
readonly id: v.StringSchema<undefined>;
|
|
299
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
300
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
301
|
+
}, undefined>, undefined>;
|
|
302
|
+
}, undefined>, v.ObjectSchema<{
|
|
303
|
+
readonly id: v.StringSchema<undefined>;
|
|
304
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
305
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
306
|
+
readonly id: v.StringSchema<undefined>;
|
|
307
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
308
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
309
|
+
}, undefined>, undefined>;
|
|
310
|
+
}, undefined>, v.ObjectSchema<{
|
|
311
|
+
readonly id: v.StringSchema<undefined>;
|
|
312
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
313
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
286
314
|
}, undefined>], undefined>;
|
|
287
315
|
export type NotionPagePropertyValue = v.InferOutput<typeof notionPagePropertyValueSchema>;
|
|
288
|
-
export declare const
|
|
316
|
+
export declare const notionPagePropertyReadMapSchema: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
289
317
|
readonly id: v.StringSchema<undefined>;
|
|
290
318
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
291
319
|
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
@@ -409,8 +437,39 @@ export declare const notionPagePropertyWriteMapSchema: v.RecordSchema<v.StringSc
|
|
|
409
437
|
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
410
438
|
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
411
439
|
}, undefined>, undefined>;
|
|
440
|
+
}, undefined>, v.ObjectSchema<{
|
|
441
|
+
readonly id: v.StringSchema<undefined>;
|
|
442
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
443
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
444
|
+
}, undefined>, v.ObjectSchema<{
|
|
445
|
+
readonly id: v.StringSchema<undefined>;
|
|
446
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
447
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
448
|
+
}, undefined>, v.ObjectSchema<{
|
|
449
|
+
readonly id: v.StringSchema<undefined>;
|
|
450
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
451
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
452
|
+
readonly id: v.StringSchema<undefined>;
|
|
453
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
454
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
455
|
+
}, undefined>, undefined>;
|
|
456
|
+
}, undefined>, v.ObjectSchema<{
|
|
457
|
+
readonly id: v.StringSchema<undefined>;
|
|
458
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
459
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
460
|
+
readonly id: v.StringSchema<undefined>;
|
|
461
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
462
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
463
|
+
}, undefined>, undefined>;
|
|
464
|
+
}, undefined>, v.ObjectSchema<{
|
|
465
|
+
readonly id: v.StringSchema<undefined>;
|
|
466
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
467
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
412
468
|
}, undefined>], undefined>, undefined>;
|
|
413
|
-
export type
|
|
469
|
+
export type NotionPagePropertyReadMap = v.InferOutput<typeof notionPagePropertyReadMapSchema>;
|
|
470
|
+
export type NotionPagePropertyWriteMap = Record<string, Exclude<NotionPagePropertyValue, {
|
|
471
|
+
type: "created_time" | "last_edited_time" | "created_by" | "last_edited_by" | "last_visited_time";
|
|
472
|
+
}>>;
|
|
414
473
|
/**
|
|
415
474
|
* The `Page` object returned in `createPageResult` messages.
|
|
416
475
|
*/
|
|
@@ -559,6 +618,34 @@ export declare const notionPageSchema: v.ObjectSchema<{
|
|
|
559
618
|
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
560
619
|
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
561
620
|
}, undefined>, undefined>;
|
|
621
|
+
}, undefined>, v.ObjectSchema<{
|
|
622
|
+
readonly id: v.StringSchema<undefined>;
|
|
623
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
624
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
625
|
+
}, undefined>, v.ObjectSchema<{
|
|
626
|
+
readonly id: v.StringSchema<undefined>;
|
|
627
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
628
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
629
|
+
}, undefined>, v.ObjectSchema<{
|
|
630
|
+
readonly id: v.StringSchema<undefined>;
|
|
631
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
632
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
633
|
+
readonly id: v.StringSchema<undefined>;
|
|
634
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
635
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
636
|
+
}, undefined>, undefined>;
|
|
637
|
+
}, undefined>, v.ObjectSchema<{
|
|
638
|
+
readonly id: v.StringSchema<undefined>;
|
|
639
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
640
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
641
|
+
readonly id: v.StringSchema<undefined>;
|
|
642
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
643
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
644
|
+
}, undefined>, undefined>;
|
|
645
|
+
}, undefined>, v.ObjectSchema<{
|
|
646
|
+
readonly id: v.StringSchema<undefined>;
|
|
647
|
+
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
648
|
+
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
562
649
|
}, undefined>], undefined>, undefined>;
|
|
563
650
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
564
651
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* shape the host delivers for messages like `createPageResult`.
|
|
6
6
|
*/
|
|
7
7
|
import * as v from "valibot";
|
|
8
|
+
import { notionRecordPointerSchema } from "../dataSources/recordPointer.js";
|
|
8
9
|
import { notionPageIdSchema } from "../ids.js";
|
|
9
10
|
import { notionParentSchema } from "../parent.js";
|
|
10
11
|
/**
|
|
@@ -117,6 +118,11 @@ const notionPlaceInputSchema = v.object({
|
|
|
117
118
|
const pagePropertyBaseSchema = {
|
|
118
119
|
id: v.string(),
|
|
119
120
|
};
|
|
121
|
+
const metadataActorSchema = v.nullable(v.object({
|
|
122
|
+
...notionRecordPointerSchema.entries,
|
|
123
|
+
table: v.picklist(["notion_user", "bot", "organization_bot"]),
|
|
124
|
+
spaceId: v.optional(v.string()),
|
|
125
|
+
}));
|
|
120
126
|
/**
|
|
121
127
|
* A page property value.
|
|
122
128
|
*/
|
|
@@ -197,8 +203,33 @@ export const notionPagePropertyValueSchema = v.variant("type", [
|
|
|
197
203
|
type: v.literal("place"),
|
|
198
204
|
place: v.nullable(notionPlaceInputSchema),
|
|
199
205
|
}),
|
|
206
|
+
v.object({
|
|
207
|
+
...pagePropertyBaseSchema,
|
|
208
|
+
type: v.literal("created_time"),
|
|
209
|
+
created_time: nullableStringSchema,
|
|
210
|
+
}),
|
|
211
|
+
v.object({
|
|
212
|
+
...pagePropertyBaseSchema,
|
|
213
|
+
type: v.literal("last_edited_time"),
|
|
214
|
+
last_edited_time: nullableStringSchema,
|
|
215
|
+
}),
|
|
216
|
+
v.object({
|
|
217
|
+
...pagePropertyBaseSchema,
|
|
218
|
+
type: v.literal("created_by"),
|
|
219
|
+
created_by: metadataActorSchema,
|
|
220
|
+
}),
|
|
221
|
+
v.object({
|
|
222
|
+
...pagePropertyBaseSchema,
|
|
223
|
+
type: v.literal("last_edited_by"),
|
|
224
|
+
last_edited_by: metadataActorSchema,
|
|
225
|
+
}),
|
|
226
|
+
v.object({
|
|
227
|
+
...pagePropertyBaseSchema,
|
|
228
|
+
type: v.literal("last_visited_time"),
|
|
229
|
+
last_visited_time: nullableStringSchema,
|
|
230
|
+
}),
|
|
200
231
|
]);
|
|
201
|
-
export const
|
|
232
|
+
export const notionPagePropertyReadMapSchema = v.record(v.string(), notionPagePropertyValueSchema);
|
|
202
233
|
/**
|
|
203
234
|
* The `Page` object returned in `createPageResult` messages.
|
|
204
235
|
*/
|
|
@@ -206,7 +237,7 @@ export const notionPageSchema = v.object({
|
|
|
206
237
|
object: v.literal("page"),
|
|
207
238
|
id: notionPageIdSchema,
|
|
208
239
|
parent: notionParentSchema,
|
|
209
|
-
properties:
|
|
240
|
+
properties: notionPagePropertyReadMapSchema,
|
|
210
241
|
created_time: v.optional(v.string()),
|
|
211
242
|
last_edited_time: v.optional(v.string()),
|
|
212
243
|
icon: v.optional(notionPageIconSchema),
|
package/dist/types.d.ts
CHANGED
|
@@ -10,11 +10,11 @@ import type { CustomBlockGetUserErrorInfo, GetUserResultMessage } from "./protoc
|
|
|
10
10
|
import type { CustomBlockListUsersErrorInfo, ListUsersMessage, ListUsersResultMessage } from "./protocol/messages/listUsers.js";
|
|
11
11
|
import type { BridgeMessagePayload } from "./protocol/messages/messagePayload.js";
|
|
12
12
|
import type { CustomBlockOpenPageErrorInfo, OpenPageMode, OpenPageResultMessage } from "./protocol/messages/openPage.js";
|
|
13
|
-
import type { CustomBlockCheckboxFilterOperator, CustomBlockContainsFilterOperator, CustomBlockCreatedByFilterOperator, CustomBlockDateFilterOperator, CustomBlockNumberFilterOperator, CustomBlockOptionFilterOperator, CustomBlockPeopleFilterOperator, CustomBlockPersonFilterValue, CustomBlockStatusFilterOperator, CustomBlockTextFilterOperator } from "./protocol/messages/queryDataSource.js";
|
|
13
|
+
import type { CustomBlockCheckboxFilterOperator, CustomBlockContainsFilterOperator, CustomBlockCreatedByFilterOperator, CustomBlockDateFilterOperator, CustomBlockNumberFilterOperator, CustomBlockOptionFilterOperator, CustomBlockPeopleFilterOperator, CustomBlockPersonFilterValue, CustomBlockRelationFilterOperator, CustomBlockStatusFilterOperator, CustomBlockTextFilterOperator } from "./protocol/messages/queryDataSource.js";
|
|
14
14
|
import type { CustomBlockQueryDataSourceErrorInfo } from "./protocol/messages/queryDataSourceResult.js";
|
|
15
15
|
import type { UpdatePageMessage } from "./protocol/messages/updatePage.js";
|
|
16
16
|
import type { CustomBlockUpdatePageErrorInfo, UpdatePageResultMessage } from "./protocol/messages/updatePageResult.js";
|
|
17
|
-
import type { NotionPageCover, NotionPageIcon,
|
|
17
|
+
import type { NotionPageCover, NotionPageIcon, NotionPagePropertyWriteMap } from "./protocol/pages/page.js";
|
|
18
18
|
import type { ExclusiveUnion } from "./typeUtils.js";
|
|
19
19
|
export type { CustomBlockErrorInfo } from "./protocol/errors.js";
|
|
20
20
|
export type { NotionDataSourceId, NotionSpaceId, } from "./protocol/ids.js";
|
|
@@ -25,7 +25,7 @@ export type { CustomBlockCreatePageErrorInfo, CustomBlockGetPageErrorInfo, Custo
|
|
|
25
25
|
* property keys. `id` is optional because the SDK resolves the final raw property ID
|
|
26
26
|
* from the map key before sending the bridge message.
|
|
27
27
|
*/
|
|
28
|
-
export type NotionPagePropertyInputValue =
|
|
28
|
+
export type NotionPagePropertyInputValue = NotionPagePropertyWriteMap[string] extends infer PropertyValue ? PropertyValue extends {
|
|
29
29
|
id: string;
|
|
30
30
|
} ? Omit<PropertyValue, "id"> & {
|
|
31
31
|
id?: string;
|
|
@@ -85,6 +85,7 @@ export type NotionDataSourceDateFilterOperator = ExclusiveUnion<CustomBlockDateF
|
|
|
85
85
|
export type NotionDataSourceCreatedByFilterOperator = ExclusiveUnion<CustomBlockCreatedByFilterOperator>;
|
|
86
86
|
export type NotionDataSourcePersonFilterValue = CustomBlockPersonFilterValue;
|
|
87
87
|
export type NotionDataSourcePeopleFilterOperator = ExclusiveUnion<CustomBlockPeopleFilterOperator>;
|
|
88
|
+
export type NotionDataSourceRelationFilterOperator = ExclusiveUnion<CustomBlockRelationFilterOperator>;
|
|
88
89
|
export type NotionDataSourcePropertyAddress = {
|
|
89
90
|
key: string;
|
|
90
91
|
propertyId?: never;
|
|
@@ -116,6 +117,8 @@ export type NotionDataSourcePropertyFilter = NotionDataSourcePropertyAddress & E
|
|
|
116
117
|
date: NotionDataSourceDateFilterOperator;
|
|
117
118
|
} | {
|
|
118
119
|
people: NotionDataSourcePeopleFilterOperator;
|
|
120
|
+
} | {
|
|
121
|
+
relation: NotionDataSourceRelationFilterOperator;
|
|
119
122
|
} | {
|
|
120
123
|
created_by: NotionDataSourceCreatedByFilterOperator;
|
|
121
124
|
}>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAA;AACxG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iEAAiE,CAAA;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gEAAgE,CAAA;AAC1G,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAA;AACxG,OAAO,KAAK,EACX,kBAAkB,EAClB,YAAY,EACZ,MAAM,yCAAyC,CAAA;AAChD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yDAAyD,CAAA;AACvG,OAAO,KAAK,EACX,uBAAuB,EACvB,8BAA8B,EAC9B,MAAM,+DAA+D,CAAA;AACtE,OAAO,KAAK,EACX,2BA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,MAAM,eAAe,GAAG;IAC7B,IAAI,EAAE,YAAY,CAAA;CAClB,CAAA;AAED,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAChD,qBAAqB,EACrB,4BAA4B,CAC5B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAClD,uBAAuB,EACvB,8BAA8B,CAC9B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,WAAW,CAAC,CAAA;AAExE,MAAM,MAAM,eAAe,GAAG,oBAAoB,CACjD,sBAAsB,EACtB,6BAA6B,CAC7B,CAAA;AAED,MAAM,MAAM,aAAa,GAAG,oBAAoB,CAC/C,oBAAoB,EACpB,2BAA2B,CAC3B,CAAA"}
|
package/dist/version.js
CHANGED
package/docs/data-sources.md
CHANGED
|
@@ -235,6 +235,7 @@ address a Created by column.
|
|
|
235
235
|
| `multi_select` | `contains`, `contains_all`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
236
236
|
| `date` | `equals`, `before`, `after`, `on_or_before`, `on_or_after`, relative ranges, `is_empty`, `is_not_empty` |
|
|
237
237
|
| `people` | `contains`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
238
|
+
| `relation` | `contains`, `does_not_contain` |
|
|
238
239
|
| `created_by` | `contains`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
239
240
|
|
|
240
241
|
- Select, multi-select, and status filters accept one option name or an array of option names.
|
|
@@ -249,6 +250,17 @@ address a Created by column.
|
|
|
249
250
|
- Creator filters accept one explicit human user reference. Groups, bots, and organization bots are
|
|
250
251
|
not supported as filter references. `does_not_contain` also matches rows with non-human or missing
|
|
251
252
|
creators. Empty checks test whether creator metadata is missing.
|
|
253
|
+
- Relation filters accept one page ID in dashed or undashed UUID format.
|
|
254
|
+
- Relation `does_not_contain` includes empty relations. Empty checks and multiple targets are
|
|
255
|
+
unsupported.
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
filter: {
|
|
259
|
+
key: "relation",
|
|
260
|
+
relation: { contains: "aabbccdd-1122-4455-8899-aabbccddeeff" },
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
252
264
|
- Empty checks use `{ is_empty: true }` or `{ is_not_empty: true }`.
|
|
253
265
|
- Date comparisons accept ISO date strings or timestamps. Notion evaluates timestamps at minute
|
|
254
266
|
precision.
|
|
@@ -342,6 +354,9 @@ The four built-ins (`created_time`, `last_edited_time`, `created_by`, `last_edit
|
|
|
342
354
|
present in row `propertiesById` and snapshot `propertySchemasById`. They have no semantic keys, so
|
|
343
355
|
they do not appear in the `*ByKey` views.
|
|
344
356
|
|
|
357
|
+
Matching metadata columns also appear under their schema property IDs and bound semantic keys.
|
|
358
|
+
`last_visited_time` requires an internal schema property and resolves the current viewerβs visit.
|
|
359
|
+
|
|
345
360
|
`collectionSchema.propertiesById` contains only actual database properties. The SDK uses this map to
|
|
346
361
|
resolve bindings and validate every filter and sort reference. Synthetic metadata in
|
|
347
362
|
`propertySchemasById` does not make a property available for filters or sorts.
|
|
@@ -492,34 +507,34 @@ This table shows property support for custom blocks running in Notion.
|
|
|
492
507
|
- π΄ **Unavailable:** The SDK does not expose this operation.
|
|
493
508
|
- β« **Not supported in Notion:** Notion itself does not support this operation in the stated case.
|
|
494
509
|
|
|
495
|
-
| Property type | Query result
|
|
496
|
-
| ------------------- |
|
|
497
|
-
| `title` | π’ Plain text
|
|
498
|
-
| `rich_text` | π’ Plain text
|
|
499
|
-
| `number` | π’ Number
|
|
500
|
-
| `checkbox` | π’ Boolean
|
|
501
|
-
| `url` | π’ String
|
|
502
|
-
| `email` | π’ String
|
|
503
|
-
| `phone_number` | π’ String
|
|
504
|
-
| `select` | π’ Option name
|
|
505
|
-
| `multi_select` | π’ Array of option names
|
|
506
|
-
| `status` | π’ Option name
|
|
507
|
-
| `date` | π’ `NotionDateValue`
|
|
508
|
-
| `people` | π’ Array of record pointers
|
|
509
|
-
| `files` | π‘ Text fallback
|
|
510
|
-
| `unique_id` | π‘ Text fallback
|
|
511
|
-
| `relation` | π’ Array of record pointers
|
|
512
|
-
| `place` | π‘ Text fallback
|
|
513
|
-
| `formula` | π‘ Text fallback
|
|
514
|
-
| `rollup` | π‘ Text fallback
|
|
515
|
-
| `button` | π‘ Text fallback
|
|
516
|
-
| `verification` | π‘ Text fallback
|
|
517
|
-
| `last_visited_time` | π‘
|
|
518
|
-
| `location` | π‘ Text fallback
|
|
519
|
-
| `created_time` | π’ `NotionDateTime` in UTC
|
|
520
|
-
| `last_edited_time` | π’ `NotionDateTime` in UTC
|
|
521
|
-
| `created_by` | π’ Array of record pointers
|
|
522
|
-
| `last_edited_by` | π’ Array of record pointers
|
|
510
|
+
| Property type | Query result | Update row | Filter | Sort |
|
|
511
|
+
| ------------------- | ----------------------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
|
|
512
|
+
| `title` | π’ Plain text | π‘ Plain text only | π’ Supported | π’ Supported |
|
|
513
|
+
| `rich_text` | π’ Plain text | π‘ Plain text only | π’ Supported | π’ Supported |
|
|
514
|
+
| `number` | π’ Number | π’ Supported | π’ Supported | π’ Supported |
|
|
515
|
+
| `checkbox` | π’ Boolean | π’ Supported | π’ Supported | π’ Supported |
|
|
516
|
+
| `url` | π’ String | π’ Supported | π’ Supported | π’ Supported |
|
|
517
|
+
| `email` | π’ String | π’ Supported | π’ Supported | π’ Supported |
|
|
518
|
+
| `phone_number` | π’ String | π’ Supported | π’ Supported | π’ Supported |
|
|
519
|
+
| `select` | π’ Option name | π‘ Set value only | π’ Supported | π΄ Unavailable |
|
|
520
|
+
| `multi_select` | π’ Array of option names | π‘ Set values only | π’ Supported | π΄ Unavailable |
|
|
521
|
+
| `status` | π’ Option name | π‘ Set value only | π’ Option names, group names, or empty checks | π΄ Unavailable |
|
|
522
|
+
| `date` | π’ `NotionDateValue` | π‘ Minute precision | π’ Supported | π’ Supported |
|
|
523
|
+
| `people` | π’ Array of record pointers | π’ Supported | π’ Supported | π’ Native name ordering |
|
|
524
|
+
| `files` | π‘ Text fallback | π‘ File URLs only | π΄ Unavailable | π΄ Unavailable |
|
|
525
|
+
| `unique_id` | π‘ Text fallback | π΄ Unavailable | π΄ Unavailable | π΄ Unavailable |
|
|
526
|
+
| `relation` | π’ Array of record pointers | π‘ Replaces value. Rejects `has_more: true`. | π’ Supported | π΄ Unavailable for standard relations. β« Notion cannot sort XLDB targets. |
|
|
527
|
+
| `place` | π‘ Text fallback | π’ Supported | π΄ Unavailable | π΄ Unavailable |
|
|
528
|
+
| `formula` | π‘ Text fallback | π΄ Unavailable | π΄ Unavailable | π΄ Unavailable |
|
|
529
|
+
| `rollup` | π‘ Text fallback | π΄ Unavailable | π΄ Unavailable | π΄ Unavailable for numeric targets or numeric aggregations. β« Notion cannot sort other rollups. |
|
|
530
|
+
| `button` | π‘ Text fallback | π΄ Unavailable | β« Not supported in Notion | β« Not supported in Notion |
|
|
531
|
+
| `verification` | π‘ Text fallback | π΄ Unavailable | π΄ Unavailable | π΄ Unavailable |
|
|
532
|
+
| `last_visited_time` | π‘ Viewerβs `NotionDateTime` in UTC | π΄ Unavailable | π΄ Unavailable | π΄ Unavailable |
|
|
533
|
+
| `location` | π‘ Text fallback | π΄ Unavailable | π΄ Unavailable elsewhere. β« Notion disables filters in My Meetings and Library system databases. | π΄ Unavailable elsewhere. β« Notion disables sorts in Library system databases. |
|
|
534
|
+
| `created_time` | π’ `NotionDateTime` in UTC | π΄ Unavailable | π΄ Unavailable | π‘ Schema property only |
|
|
535
|
+
| `last_edited_time` | π’ `NotionDateTime` in UTC | π΄ Unavailable | π΄ Unavailable | π‘ Schema property only |
|
|
536
|
+
| `created_by` | π’ Array of record pointers | π΄ Unavailable | π‘ Schema-backed creator filters | π‘ Schema property only |
|
|
537
|
+
| `last_edited_by` | π’ Array of record pointers | π΄ Unavailable | π΄ Unavailable | π΄ Unavailable |
|
|
523
538
|
|
|
524
539
|
### Notes
|
|
525
540
|
|
|
@@ -607,8 +622,9 @@ See [Pages property support](./pages.md#property-support) for the page-property
|
|
|
607
622
|
- `NotionDataSourceTextFilterOperator`, `NotionDataSourceNumberFilterOperator`,
|
|
608
623
|
`NotionDataSourceCheckboxFilterOperator`, `NotionDataSourceOptionFilterOperator`,
|
|
609
624
|
`NotionDataSourceStatusFilterOperator`, `NotionDataSourceContainsFilterOperator`,
|
|
610
|
-
`NotionDataSourceDateFilterOperator`, `NotionDataSourcePeopleFilterOperator`,
|
|
611
|
-
`NotionDataSourceCreatedByFilterOperator` β the
|
|
625
|
+
`NotionDataSourceDateFilterOperator`, `NotionDataSourcePeopleFilterOperator`,
|
|
626
|
+
`NotionDataSourceRelationFilterOperator`, and `NotionDataSourceCreatedByFilterOperator` β the
|
|
627
|
+
operators accepted for each property type.
|
|
612
628
|
- `NotionDataSourcePersonFilterValue` β an explicit `{ object: "user" | "group", id }` reference
|
|
613
629
|
used by a people filter.
|
|
614
630
|
- `DataSourceSnapshot` β current rows, schema, and status for one live data-source query.
|
package/docs/errors.md
CHANGED
|
@@ -59,8 +59,7 @@ recovery does not depend on `isRetryable`.
|
|
|
59
59
|
|
|
60
60
|
Unlike request helpers, `initCustomBlock` rejects with `CustomBlockInitializationError`. Its `code`
|
|
61
61
|
type is `CustomBlockInitializationErrorCode`, which covers failures reported by either side of the
|
|
62
|
-
handshake plus SDK-local iframe errors.
|
|
63
|
-
not finish loading host dependencies in time.
|
|
62
|
+
handshake plus SDK-local iframe errors.
|
|
64
63
|
|
|
65
64
|
`CustomBlockInitializationErrorInfo` is the matching `{ code, message, isRetryable }` object type.
|
|
66
65
|
|