@notionhq/custom-blocks 0.2.18 → 0.2.20
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 +9 -1
- package/dist/protocol/messages/queryDataSource.d.ts +101 -0
- package/dist/protocol/messages/queryDataSource.js +18 -0
- package/dist/protocol/messages/sandboxToHost.d.ts +34 -0
- package/dist/types.d.ts +4 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/docs/data-sources.md +30 -5
- package/package.json +1 -1
- package/src/bridge/dataSources/query.ts +13 -0
- package/src/types.ts +4 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/bridge/dataSources/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAA;AAElG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AACjF,OAAO,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/bridge/dataSources/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAA;AAElG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AACjF,OAAO,EAUN,KAAK,mCAAmC,EAExC,KAAK,iCAAiC,EACtC,MAAM,8DAA8D,CAAA;AACrE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oEAAoE,CAAA;AAE7H,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAU1D,MAAM,MAAM,uBAAuB,GAAG;IACrC,YAAY,EAAE,kBAAkB,CAAA;IAChC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,mCAAmC,CAAA;IAC5C,KAAK,CAAC,EAAE,iCAAiC,EAAE,CAAA;IAC3C,QAAQ,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,4BAA4B,GACrC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,mCAAmC,CAAA;CAAE,GAC/D;IACA,MAAM,EAAE,IAAI,CAAA;IACZ,UAAU,EAAE,gBAAgB,CAAA;IAC5B,KAAK,EAAE,uBAAuB,CAAA;CAC7B,CAAA;AAYJ,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC5C,WAAW,EAAE,gBAAgB,EAAE,CAAA;IAC/B,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAChC,GAAG,4BAA4B,CAgF/B;AAwFD,wBAAgB,iCAAiC,CAChD,OAAO,EAAE,oBAAoB,GAAG,SAAS,GACvC,MAAM,CAMR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CUSTOM_BLOCK_DATA_SOURCE_SORTABLE_PROPERTY_TYPES } from "../../protocol/dataSources/propertySchema.js";
|
|
2
|
-
import { CUSTOM_BLOCK_DATA_SOURCE_QUERY_MAX_SORTS, customBlockCheckboxFilterOperatorSchema, customBlockContainsFilterOperatorSchema, customBlockDateFilterOperatorSchema, customBlockNumberFilterOperatorSchema, customBlockOptionFilterOperatorSchema, customBlockPeopleFilterOperatorSchema, customBlockTextFilterOperatorSchema, } from "../../protocol/messages/queryDataSource.js";
|
|
2
|
+
import { CUSTOM_BLOCK_DATA_SOURCE_QUERY_MAX_SORTS, customBlockCheckboxFilterOperatorSchema, customBlockContainsFilterOperatorSchema, customBlockCreatedByFilterOperatorSchema, customBlockDateFilterOperatorSchema, customBlockNumberFilterOperatorSchema, customBlockOptionFilterOperatorSchema, customBlockPeopleFilterOperatorSchema, customBlockTextFilterOperatorSchema, } from "../../protocol/messages/queryDataSource.js";
|
|
3
3
|
import * as v from "valibot";
|
|
4
4
|
import { unreachable } from "../../utils.js";
|
|
5
5
|
const DEFAULT_DATA_SOURCE_QUERY_LIMIT = 20;
|
|
@@ -334,6 +334,8 @@ function resolvePropertyFilterBranch(args) {
|
|
|
334
334
|
return resolveMultiSelectPropertyFilter(args.propertyId, args.value);
|
|
335
335
|
case "date":
|
|
336
336
|
return resolveDatePropertyFilter(args.propertyId, args.value);
|
|
337
|
+
case "created_by":
|
|
338
|
+
return resolveCreatedByPropertyFilter(args.propertyId, args.value);
|
|
337
339
|
case "people":
|
|
338
340
|
return resolvePeoplePropertyFilter(args.propertyId, args.value);
|
|
339
341
|
default:
|
|
@@ -432,6 +434,12 @@ function resolveDatePropertyFilter(propertyId, value) {
|
|
|
432
434
|
filter: { propertyId, date: parsed.output },
|
|
433
435
|
};
|
|
434
436
|
}
|
|
437
|
+
function resolveCreatedByPropertyFilter(propertyId, value) {
|
|
438
|
+
const parsed = v.safeParse(customBlockCreatedByFilterOperatorSchema, value);
|
|
439
|
+
return parsed.success
|
|
440
|
+
? { status: "ok", filter: { propertyId, created_by: parsed.output } }
|
|
441
|
+
: invalidOperator("created_by");
|
|
442
|
+
}
|
|
435
443
|
function resolvePeoplePropertyFilter(propertyId, value) {
|
|
436
444
|
const parsed = v.safeParse(customBlockPeopleFilterOperatorSchema, value);
|
|
437
445
|
return parsed.success
|
|
@@ -20,6 +20,22 @@ export declare const customBlockPeopleFilterOperatorSchema: v.UnionSchema<[v.Str
|
|
|
20
20
|
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
21
21
|
}, undefined>], undefined>], undefined>;
|
|
22
22
|
export type CustomBlockPeopleFilterOperator = v.InferOutput<typeof customBlockPeopleFilterOperatorSchema>;
|
|
23
|
+
export declare const customBlockCreatedByFilterOperatorSchema: v.UnionSchema<[v.StrictObjectSchema<{
|
|
24
|
+
readonly contains: v.StrictObjectSchema<{
|
|
25
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
26
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
27
|
+
}, undefined>;
|
|
28
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
29
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
30
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
31
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
32
|
+
}, undefined>;
|
|
33
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
34
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
35
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
36
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
37
|
+
}, undefined>], undefined>;
|
|
38
|
+
export type CustomBlockCreatedByFilterOperator = v.InferOutput<typeof customBlockCreatedByFilterOperatorSchema>;
|
|
23
39
|
export declare const customBlockTextFilterOperatorSchema: v.UnionSchema<[v.StrictObjectSchema<{
|
|
24
40
|
readonly equals: v.StringSchema<undefined>;
|
|
25
41
|
}, undefined>, v.StrictObjectSchema<{
|
|
@@ -101,6 +117,23 @@ export declare const customBlockDateFilterOperatorSchema: v.UnionSchema<[v.Stric
|
|
|
101
117
|
}, undefined>], undefined>], undefined>;
|
|
102
118
|
export type CustomBlockDateFilterOperator = v.InferOutput<typeof customBlockDateFilterOperatorSchema>;
|
|
103
119
|
export declare const resolvedCustomBlockDataSourcePropertyFilterSchema: v.UnionSchema<[v.StrictObjectSchema<{
|
|
120
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
121
|
+
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
122
|
+
readonly contains: v.StrictObjectSchema<{
|
|
123
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
124
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
125
|
+
}, undefined>;
|
|
126
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
127
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
128
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
129
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
130
|
+
}, undefined>;
|
|
131
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
132
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
133
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
134
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
135
|
+
}, undefined>], undefined>;
|
|
136
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
104
137
|
readonly propertyId: v.StringSchema<undefined>;
|
|
105
138
|
readonly title: v.UnionSchema<[v.StrictObjectSchema<{
|
|
106
139
|
readonly equals: v.StringSchema<undefined>;
|
|
@@ -293,6 +326,23 @@ export declare const resolvedCustomBlockDataSourcePropertyFilterSchema: v.UnionS
|
|
|
293
326
|
}, undefined>], undefined>;
|
|
294
327
|
export type ResolvedCustomBlockDataSourcePropertyFilter = v.InferOutput<typeof resolvedCustomBlockDataSourcePropertyFilterSchema>;
|
|
295
328
|
export declare const resolvedCustomBlockDataSourceFilterSchema: v.UnionSchema<[v.UnionSchema<[v.StrictObjectSchema<{
|
|
329
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
330
|
+
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
331
|
+
readonly contains: v.StrictObjectSchema<{
|
|
332
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
333
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
334
|
+
}, undefined>;
|
|
335
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
336
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
337
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
338
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
339
|
+
}, undefined>;
|
|
340
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
341
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
342
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
343
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
344
|
+
}, undefined>], undefined>;
|
|
345
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
296
346
|
readonly propertyId: v.StringSchema<undefined>;
|
|
297
347
|
readonly title: v.UnionSchema<[v.StrictObjectSchema<{
|
|
298
348
|
readonly equals: v.StringSchema<undefined>;
|
|
@@ -484,6 +534,23 @@ export declare const resolvedCustomBlockDataSourceFilterSchema: v.UnionSchema<[v
|
|
|
484
534
|
}, undefined>], undefined>], undefined>;
|
|
485
535
|
}, undefined>], undefined>, v.StrictObjectSchema<{
|
|
486
536
|
readonly and: v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
537
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
538
|
+
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
539
|
+
readonly contains: v.StrictObjectSchema<{
|
|
540
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
541
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
542
|
+
}, undefined>;
|
|
543
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
544
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
545
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
546
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
547
|
+
}, undefined>;
|
|
548
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
549
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
550
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
551
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
552
|
+
}, undefined>], undefined>;
|
|
553
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
487
554
|
readonly propertyId: v.StringSchema<undefined>;
|
|
488
555
|
readonly title: v.UnionSchema<[v.StrictObjectSchema<{
|
|
489
556
|
readonly equals: v.StringSchema<undefined>;
|
|
@@ -700,6 +767,23 @@ export declare const queryDataSourceMessageSchema: v.ObjectSchema<{
|
|
|
700
767
|
readonly limit: v.NumberSchema<undefined>;
|
|
701
768
|
/** A sandbox-resolved property filter. */
|
|
702
769
|
readonly filter: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.StrictObjectSchema<{
|
|
770
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
771
|
+
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
772
|
+
readonly contains: v.StrictObjectSchema<{
|
|
773
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
774
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
775
|
+
}, undefined>;
|
|
776
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
777
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
778
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
779
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
780
|
+
}, undefined>;
|
|
781
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
782
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
783
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
784
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
785
|
+
}, undefined>], undefined>;
|
|
786
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
703
787
|
readonly propertyId: v.StringSchema<undefined>;
|
|
704
788
|
readonly title: v.UnionSchema<[v.StrictObjectSchema<{
|
|
705
789
|
readonly equals: v.StringSchema<undefined>;
|
|
@@ -891,6 +975,23 @@ export declare const queryDataSourceMessageSchema: v.ObjectSchema<{
|
|
|
891
975
|
}, undefined>], undefined>], undefined>;
|
|
892
976
|
}, undefined>], undefined>, v.StrictObjectSchema<{
|
|
893
977
|
readonly and: v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
978
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
979
|
+
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
980
|
+
readonly contains: v.StrictObjectSchema<{
|
|
981
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
982
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
983
|
+
}, undefined>;
|
|
984
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
985
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
986
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
987
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
988
|
+
}, undefined>;
|
|
989
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
990
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
991
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
992
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
993
|
+
}, undefined>], undefined>;
|
|
994
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
894
995
|
readonly propertyId: v.StringSchema<undefined>;
|
|
895
996
|
readonly title: v.UnionSchema<[v.StrictObjectSchema<{
|
|
896
997
|
readonly equals: v.StringSchema<undefined>;
|
|
@@ -14,6 +14,20 @@ export const customBlockPeopleFilterOperatorSchema = v.union([
|
|
|
14
14
|
v.strictObject({ does_not_contain: customBlockPersonFilterValueSchema }),
|
|
15
15
|
emptyOperatorSchema,
|
|
16
16
|
]);
|
|
17
|
+
/**
|
|
18
|
+
* Creator filters accept only human user targets.
|
|
19
|
+
* Returned creator values may refer to other actor types.
|
|
20
|
+
*/
|
|
21
|
+
const customBlockCreatorFilterValueSchema = v.strictObject({
|
|
22
|
+
object: v.literal("user"),
|
|
23
|
+
id: v.pipe(v.string(), v.minLength(1), v.maxLength(2_000)),
|
|
24
|
+
});
|
|
25
|
+
export const customBlockCreatedByFilterOperatorSchema = v.union([
|
|
26
|
+
v.strictObject({ contains: customBlockCreatorFilterValueSchema }),
|
|
27
|
+
v.strictObject({ does_not_contain: customBlockCreatorFilterValueSchema }),
|
|
28
|
+
v.strictObject({ is_empty: v.literal(true) }),
|
|
29
|
+
v.strictObject({ is_not_empty: v.literal(true) }),
|
|
30
|
+
]);
|
|
17
31
|
export const customBlockTextFilterOperatorSchema = v.union([
|
|
18
32
|
v.strictObject({ equals: v.string() }),
|
|
19
33
|
v.strictObject({ does_not_equal: v.string() }),
|
|
@@ -56,6 +70,10 @@ export const customBlockDateFilterOperatorSchema = v.union([
|
|
|
56
70
|
emptyOperatorSchema,
|
|
57
71
|
]);
|
|
58
72
|
export const resolvedCustomBlockDataSourcePropertyFilterSchema = v.union([
|
|
73
|
+
v.strictObject({
|
|
74
|
+
propertyId: v.string(),
|
|
75
|
+
created_by: customBlockCreatedByFilterOperatorSchema,
|
|
76
|
+
}),
|
|
59
77
|
v.strictObject({
|
|
60
78
|
propertyId: v.string(),
|
|
61
79
|
title: customBlockTextFilterOperatorSchema,
|
|
@@ -59,6 +59,23 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
59
59
|
readonly dataSourceId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
60
60
|
readonly limit: v.NumberSchema<undefined>;
|
|
61
61
|
readonly filter: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.StrictObjectSchema<{
|
|
62
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
63
|
+
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
64
|
+
readonly contains: v.StrictObjectSchema<{
|
|
65
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
66
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
67
|
+
}, undefined>;
|
|
68
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
69
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
70
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
71
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
72
|
+
}, undefined>;
|
|
73
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
74
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
75
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
76
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
77
|
+
}, undefined>], undefined>;
|
|
78
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
62
79
|
readonly propertyId: v.StringSchema<undefined>;
|
|
63
80
|
readonly title: v.UnionSchema<[v.StrictObjectSchema<{
|
|
64
81
|
readonly equals: v.StringSchema<undefined>;
|
|
@@ -250,6 +267,23 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
250
267
|
}, undefined>], undefined>], undefined>;
|
|
251
268
|
}, undefined>], undefined>, v.StrictObjectSchema<{
|
|
252
269
|
readonly and: v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
|
|
270
|
+
readonly propertyId: v.StringSchema<undefined>;
|
|
271
|
+
readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
|
|
272
|
+
readonly contains: v.StrictObjectSchema<{
|
|
273
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
274
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
275
|
+
}, undefined>;
|
|
276
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
277
|
+
readonly does_not_contain: v.StrictObjectSchema<{
|
|
278
|
+
readonly object: v.LiteralSchema<"user", undefined>;
|
|
279
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 2000, undefined>]>;
|
|
280
|
+
}, undefined>;
|
|
281
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
282
|
+
readonly is_empty: v.LiteralSchema<true, undefined>;
|
|
283
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
284
|
+
readonly is_not_empty: v.LiteralSchema<true, undefined>;
|
|
285
|
+
}, undefined>], undefined>;
|
|
286
|
+
}, undefined>, v.StrictObjectSchema<{
|
|
253
287
|
readonly propertyId: v.StringSchema<undefined>;
|
|
254
288
|
readonly title: v.UnionSchema<[v.StrictObjectSchema<{
|
|
255
289
|
readonly equals: v.StringSchema<undefined>;
|
package/dist/types.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { CustomBlockGetUserErrorInfo, GetUserResultMessage } from "./protoc
|
|
|
9
9
|
import type { CustomBlockListUsersErrorInfo, ListUsersMessage, ListUsersResultMessage } from "./protocol/messages/listUsers.js";
|
|
10
10
|
import type { BridgeMessagePayload } from "./protocol/messages/messagePayload.js";
|
|
11
11
|
import type { CustomBlockOpenPageErrorInfo, OpenPageMode, OpenPageResultMessage } from "./protocol/messages/openPage.js";
|
|
12
|
-
import type { CustomBlockCheckboxFilterOperator, CustomBlockContainsFilterOperator, CustomBlockDateFilterOperator, CustomBlockNumberFilterOperator, CustomBlockOptionFilterOperator, CustomBlockPeopleFilterOperator, CustomBlockPersonFilterValue, CustomBlockTextFilterOperator } from "./protocol/messages/queryDataSource.js";
|
|
12
|
+
import type { CustomBlockCheckboxFilterOperator, CustomBlockContainsFilterOperator, CustomBlockCreatedByFilterOperator, CustomBlockDateFilterOperator, CustomBlockNumberFilterOperator, CustomBlockOptionFilterOperator, CustomBlockPeopleFilterOperator, CustomBlockPersonFilterValue, CustomBlockTextFilterOperator } from "./protocol/messages/queryDataSource.js";
|
|
13
13
|
import type { CustomBlockQueryDataSourceErrorInfo } from "./protocol/messages/queryDataSourceResult.js";
|
|
14
14
|
import type { UpdatePageMessage } from "./protocol/messages/updatePage.js";
|
|
15
15
|
import type { CustomBlockUpdatePageErrorInfo, UpdatePageResultMessage } from "./protocol/messages/updatePageResult.js";
|
|
@@ -80,6 +80,7 @@ export type NotionDataSourceCheckboxFilterOperator = ExclusiveUnion<CustomBlockC
|
|
|
80
80
|
export type NotionDataSourceOptionFilterOperator = ExclusiveUnion<CustomBlockOptionFilterOperator>;
|
|
81
81
|
export type NotionDataSourceContainsFilterOperator = ExclusiveUnion<CustomBlockContainsFilterOperator>;
|
|
82
82
|
export type NotionDataSourceDateFilterOperator = ExclusiveUnion<CustomBlockDateFilterOperator>;
|
|
83
|
+
export type NotionDataSourceCreatedByFilterOperator = ExclusiveUnion<CustomBlockCreatedByFilterOperator>;
|
|
83
84
|
export type NotionDataSourcePersonFilterValue = CustomBlockPersonFilterValue;
|
|
84
85
|
export type NotionDataSourcePeopleFilterOperator = ExclusiveUnion<CustomBlockPeopleFilterOperator>;
|
|
85
86
|
export type NotionDataSourcePropertyAddress = {
|
|
@@ -113,6 +114,8 @@ export type NotionDataSourcePropertyFilter = NotionDataSourcePropertyAddress & E
|
|
|
113
114
|
date: NotionDataSourceDateFilterOperator;
|
|
114
115
|
} | {
|
|
115
116
|
people: NotionDataSourcePeopleFilterOperator;
|
|
117
|
+
} | {
|
|
118
|
+
created_by: NotionDataSourceCreatedByFilterOperator;
|
|
116
119
|
}>;
|
|
117
120
|
export type NotionDataSourceSort = NotionDataSourcePropertyAddress & {
|
|
118
121
|
direction: "ascending" | "descending";
|
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,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,2BAA2B,EAC3B,oBAAoB,EACpB,MAAM,sDAAsD,CAAA;AAC7D,OAAO,KAAK,EACX,2BAA2B,EAC3B,oBAAoB,EACpB,MAAM,sDAAsD,CAAA;AAC7D,OAAO,KAAK,EACX,6BAA6B,EAC7B,gBAAgB,EAChB,sBAAsB,EACtB,MAAM,wDAAwD,CAAA;AAC/D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EACX,4BAA4B,EAC5B,YAAY,EACZ,qBAAqB,EACrB,MAAM,uDAAuD,CAAA;AAC9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AAM,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
|
@@ -146,8 +146,9 @@ The SDK types prohibit:
|
|
|
146
146
|
Runtime validation also rejects extra fields. Filters and sorts can reference only actual database
|
|
147
147
|
properties of a supported type.
|
|
148
148
|
|
|
149
|
-
Synthetic metadata IDs
|
|
150
|
-
|
|
149
|
+
Synthetic metadata IDs cannot substitute for database properties in filters or sorts. Creator
|
|
150
|
+
filters require a **Created by** column. Timestamp sorts require a **Created time** or **Last edited
|
|
151
|
+
time** column. Use the column's bound key or actual property ID.
|
|
151
152
|
|
|
152
153
|
### Row limits
|
|
153
154
|
|
|
@@ -191,6 +192,23 @@ are unsupported. An empty `and` group applies no conditions. Both APIs accept th
|
|
|
191
192
|
|
|
192
193
|
The SDK reports invalid keys, types, operators, and values through the snapshot's `error` field.
|
|
193
194
|
|
|
195
|
+
Creator filters require an actual **Created by** column in the bound database. The column can have
|
|
196
|
+
any name. In this example, `creator` is a declared property key mapped to that column:
|
|
197
|
+
|
|
198
|
+
```ts
|
|
199
|
+
filter: {
|
|
200
|
+
key: "creator",
|
|
201
|
+
created_by: {
|
|
202
|
+
contains: { object: "user", id: "12345678-1234-4234-8234-123456789abc" },
|
|
203
|
+
},
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Use `propertyId` instead of `key` to address the column by its actual property ID. The `created_by`
|
|
208
|
+
key selects the filter type. It does not identify the column. The synthetic read entry
|
|
209
|
+
`propertiesById.created_by` is available without a column, but `propertyId: "created_by"` does not
|
|
210
|
+
address a Created by column.
|
|
211
|
+
|
|
194
212
|
<details>
|
|
195
213
|
<summary>Filter operators and values</summary>
|
|
196
214
|
|
|
@@ -203,6 +221,7 @@ The SDK reports invalid keys, types, operators, and values through the snapshot'
|
|
|
203
221
|
| `multi_select` | `contains`, `contains_all`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
204
222
|
| `date` | `equals`, `before`, `after`, `on_or_before`, `on_or_after`, `is_empty`, `is_not_empty` |
|
|
205
223
|
| `people` | `contains`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
224
|
+
| `created_by` | `contains`, `does_not_contain`, `is_empty`, `is_not_empty` |
|
|
206
225
|
|
|
207
226
|
- Select, multi-select, and status filters accept one option name or an array of option names.
|
|
208
227
|
- For multi-select filters, `contains` matches **any** supplied option. `contains_all` requires
|
|
@@ -211,6 +230,9 @@ The SDK reports invalid keys, types, operators, and values through the snapshot'
|
|
|
211
230
|
`{ object: "user", id: "..." }` or `{ object: "group", id: "..." }`. Group filters match exact
|
|
212
231
|
group mentions. They do not expand group membership. Using bot or organization bot pointers as
|
|
213
232
|
filter references is not supported.
|
|
233
|
+
- Creator filters accept one explicit human user reference. Groups, bots, and organization bots are
|
|
234
|
+
not supported as filter references. `does_not_contain` also matches rows with non-human or missing
|
|
235
|
+
creators. Empty checks test whether creator metadata is missing.
|
|
214
236
|
- Empty checks use `{ is_empty: true }` or `{ is_not_empty: true }`.
|
|
215
237
|
- Date comparisons accept ISO date strings or timestamps. Notion evaluates timestamps at minute
|
|
216
238
|
precision.
|
|
@@ -431,7 +453,7 @@ This table shows property support for custom blocks running in Notion.
|
|
|
431
453
|
| `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. |
|
|
432
454
|
| `created_time` | 🟢 `NotionDateTime` in UTC | 🔴 Unavailable | 🔴 Unavailable | 🟡 Schema property only |
|
|
433
455
|
| `last_edited_time` | 🟢 `NotionDateTime` in UTC | 🔴 Unavailable | 🔴 Unavailable | 🟡 Schema property only |
|
|
434
|
-
| `created_by` | 🟢 Array of record pointers | 🔴 Unavailable |
|
|
456
|
+
| `created_by` | 🟢 Array of record pointers | 🔴 Unavailable | 🟡 Schema-backed creator filters | 🔴 Unavailable |
|
|
435
457
|
| `last_edited_by` | 🟢 Array of record pointers | 🔴 Unavailable | 🔴 Unavailable | 🔴 Unavailable |
|
|
436
458
|
|
|
437
459
|
### Notes
|
|
@@ -457,6 +479,8 @@ This table shows property support for custom blocks running in Notion.
|
|
|
457
479
|
`space_permission_group`, `bot`, or `organization_bot`. Group IDs use the composite form
|
|
458
480
|
`groupId|workspaceId`. People filters support users and groups. Bot and organization bot filtering
|
|
459
481
|
is not supported.
|
|
482
|
+
- Creator filters require an actual **Created by** column. Use its bound key or property ID, not the
|
|
483
|
+
synthetic `created_by` metadata ID.
|
|
460
484
|
- Filters accept one condition or an `and` group of up to 25 conditions. The SDK does not support
|
|
461
485
|
`or` or nested groups.
|
|
462
486
|
- Select, multi-select, and status query values contain option names. Their schemas provide option
|
|
@@ -515,8 +539,9 @@ See [Pages property support](./pages.md#property-support) for the page-property
|
|
|
515
539
|
- `NotionDataSourceSort` — a property address with an `ascending` or `descending` direction.
|
|
516
540
|
- `NotionDataSourceTextFilterOperator`, `NotionDataSourceNumberFilterOperator`,
|
|
517
541
|
`NotionDataSourceCheckboxFilterOperator`, `NotionDataSourceOptionFilterOperator`,
|
|
518
|
-
`NotionDataSourceContainsFilterOperator`, `NotionDataSourceDateFilterOperator`,
|
|
519
|
-
`NotionDataSourcePeopleFilterOperator` — the
|
|
542
|
+
`NotionDataSourceContainsFilterOperator`, `NotionDataSourceDateFilterOperator`,
|
|
543
|
+
`NotionDataSourcePeopleFilterOperator`, and `NotionDataSourceCreatedByFilterOperator` — the
|
|
544
|
+
operators accepted for each property type.
|
|
520
545
|
- `NotionDataSourcePersonFilterValue` — an explicit `{ object: "user" | "group", id }` reference
|
|
521
546
|
used by a people filter.
|
|
522
547
|
- `DataSourceSnapshot` — current rows, schema, and status for one live data-source query.
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
CUSTOM_BLOCK_DATA_SOURCE_QUERY_MAX_SORTS,
|
|
6
6
|
customBlockCheckboxFilterOperatorSchema,
|
|
7
7
|
customBlockContainsFilterOperatorSchema,
|
|
8
|
+
customBlockCreatedByFilterOperatorSchema,
|
|
8
9
|
customBlockDateFilterOperatorSchema,
|
|
9
10
|
customBlockNumberFilterOperatorSchema,
|
|
10
11
|
customBlockOptionFilterOperatorSchema,
|
|
@@ -458,6 +459,8 @@ function resolvePropertyFilterBranch(args: {
|
|
|
458
459
|
return resolveMultiSelectPropertyFilter(args.propertyId, args.value)
|
|
459
460
|
case "date":
|
|
460
461
|
return resolveDatePropertyFilter(args.propertyId, args.value)
|
|
462
|
+
case "created_by":
|
|
463
|
+
return resolveCreatedByPropertyFilter(args.propertyId, args.value)
|
|
461
464
|
case "people":
|
|
462
465
|
return resolvePeoplePropertyFilter(args.propertyId, args.value)
|
|
463
466
|
default:
|
|
@@ -591,6 +594,16 @@ function resolveDatePropertyFilter(
|
|
|
591
594
|
}
|
|
592
595
|
}
|
|
593
596
|
|
|
597
|
+
function resolveCreatedByPropertyFilter(
|
|
598
|
+
propertyId: string,
|
|
599
|
+
value: Record<string, unknown>,
|
|
600
|
+
): ResolvePropertyFilterResult {
|
|
601
|
+
const parsed = v.safeParse(customBlockCreatedByFilterOperatorSchema, value)
|
|
602
|
+
return parsed.success
|
|
603
|
+
? { status: "ok", filter: { propertyId, created_by: parsed.output } }
|
|
604
|
+
: invalidOperator("created_by")
|
|
605
|
+
}
|
|
606
|
+
|
|
594
607
|
function resolvePeoplePropertyFilter(
|
|
595
608
|
propertyId: string,
|
|
596
609
|
value: Record<string, unknown>,
|
package/src/types.ts
CHANGED
|
@@ -32,6 +32,7 @@ import type {
|
|
|
32
32
|
import type {
|
|
33
33
|
CustomBlockCheckboxFilterOperator,
|
|
34
34
|
CustomBlockContainsFilterOperator,
|
|
35
|
+
CustomBlockCreatedByFilterOperator,
|
|
35
36
|
CustomBlockDateFilterOperator,
|
|
36
37
|
CustomBlockNumberFilterOperator,
|
|
37
38
|
CustomBlockOptionFilterOperator,
|
|
@@ -141,6 +142,8 @@ export type NotionDataSourceContainsFilterOperator =
|
|
|
141
142
|
ExclusiveUnion<CustomBlockContainsFilterOperator>
|
|
142
143
|
export type NotionDataSourceDateFilterOperator =
|
|
143
144
|
ExclusiveUnion<CustomBlockDateFilterOperator>
|
|
145
|
+
export type NotionDataSourceCreatedByFilterOperator =
|
|
146
|
+
ExclusiveUnion<CustomBlockCreatedByFilterOperator>
|
|
144
147
|
export type NotionDataSourcePersonFilterValue = CustomBlockPersonFilterValue
|
|
145
148
|
export type NotionDataSourcePeopleFilterOperator =
|
|
146
149
|
ExclusiveUnion<CustomBlockPeopleFilterOperator>
|
|
@@ -163,6 +166,7 @@ export type NotionDataSourcePropertyFilter = NotionDataSourcePropertyAddress &
|
|
|
163
166
|
| { status: NotionDataSourceOptionFilterOperator }
|
|
164
167
|
| { date: NotionDataSourceDateFilterOperator }
|
|
165
168
|
| { people: NotionDataSourcePeopleFilterOperator }
|
|
169
|
+
| { created_by: NotionDataSourceCreatedByFilterOperator }
|
|
166
170
|
>
|
|
167
171
|
|
|
168
172
|
export type NotionDataSourceSort = NotionDataSourcePropertyAddress & {
|