@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.
Files changed (36) hide show
  1. package/dist/bridge/dataSources/query.d.ts.map +1 -1
  2. package/dist/bridge/dataSources/query.js +10 -1
  3. package/dist/bridge/dataSources/resolveProperty.d.ts +3 -3
  4. package/dist/bridge/dataSources/resolveProperty.d.ts.map +1 -1
  5. package/dist/bridge/dataSources/resolveProperty.js +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/protocol/manifest.d.ts +10 -3
  9. package/dist/protocol/manifest.js +5 -1
  10. package/dist/protocol/messages/connect.d.ts +9 -2
  11. package/dist/protocol/messages/createPage.d.ts +28 -0
  12. package/dist/protocol/messages/createPage.js +2 -2
  13. package/dist/protocol/messages/createPageResult.d.ts +28 -0
  14. package/dist/protocol/messages/getPage.d.ts +28 -0
  15. package/dist/protocol/messages/hostToSandbox.d.ts +93 -2
  16. package/dist/protocol/messages/init.d.ts +9 -2
  17. package/dist/protocol/messages/queryDataSource.d.ts +41 -0
  18. package/dist/protocol/messages/queryDataSource.js +13 -1
  19. package/dist/protocol/messages/sandboxToHost.d.ts +79 -2
  20. package/dist/protocol/messages/updatePage.d.ts +28 -0
  21. package/dist/protocol/messages/updatePage.js +2 -2
  22. package/dist/protocol/messages/updatePageResult.d.ts +28 -0
  23. package/dist/protocol/pages/page.d.ts +89 -2
  24. package/dist/protocol/pages/page.js +33 -2
  25. package/dist/types.d.ts +6 -3
  26. package/dist/types.d.ts.map +1 -1
  27. package/dist/version.js +1 -1
  28. package/docs/data-sources.md +46 -30
  29. package/docs/errors.md +1 -2
  30. package/docs/lifecycle.md +1 -1
  31. package/docs/pages.md +10 -11
  32. package/package.json +1 -1
  33. package/src/bridge/dataSources/query.ts +13 -0
  34. package/src/bridge/dataSources/resolveProperty.ts +4 -4
  35. package/src/index.ts +1 -0
  36. package/src/types.ts +7 -2
@@ -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;AAGlG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AACjF,OAAO,EAYN,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
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src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ortDirectionSchema } from "../../protocol/dataSources/sortDirection.js";
3
- import { CUSTOM_BLOCK_DATA_SOURCE_QUERY_MAX_SORTS, customBlockCheckboxFilterOperatorSchema, customBlockContainsFilterOperatorSchema, customBlockCreatedByFilterOperatorSchema, customBlockDateFilterOperatorSchema, customBlockNumberFilterOperatorSchema, customBlockOptionFilterOperatorSchema, customBlockPeopleFilterOperatorSchema, customBlockRelativeDateValueSchema, customBlockStatusFilterOperatorSchema, customBlockTextFilterOperatorSchema, } from "../../protocol/messages/queryDataSource.js";
3
+ import { CUSTOM_BLOCK_DATA_SOURCE_QUERY_MAX_SORTS, customBlockCheckboxFilterOperatorSchema, customBlockContainsFilterOperatorSchema, customBlockCreatedByFilterOperatorSchema, customBlockDateFilterOperatorSchema, customBlockNumberFilterOperatorSchema, customBlockOptionFilterOperatorSchema, customBlockPeopleFilterOperatorSchema, customBlockRelationFilterOperatorSchema, customBlockRelativeDateValueSchema, customBlockStatusFilterOperatorSchema, customBlockTextFilterOperatorSchema, } from "../../protocol/messages/queryDataSource.js";
4
4
  import * as v from "valibot";
5
5
  import { unreachable } from "../../utils.js";
6
6
  const DEFAULT_DATA_SOURCE_QUERY_LIMIT = 20;
@@ -349,6 +349,15 @@ function resolvePropertyFilterBranch(args) {
349
349
  return resolveDatePropertyFilter(args.propertyId, args.value);
350
350
  case "created_by":
351
351
  return resolveCreatedByPropertyFilter(args.propertyId, args.value);
352
+ case "relation": {
353
+ const parsed = v.safeParse(customBlockRelationFilterOperatorSchema, args.value);
354
+ return parsed.success
355
+ ? {
356
+ status: "ok",
357
+ filter: { propertyId: args.propertyId, relation: parsed.output },
358
+ }
359
+ : invalidOperator("relation");
360
+ }
352
361
  case "people":
353
362
  return resolvePeoplePropertyFilter(args.propertyId, args.value);
354
363
  default:
@@ -1,10 +1,10 @@
1
1
  import type { NotionDataSource } from "../../protocol/dataSources/dataSource.js";
2
2
  import type { CustomBlockPropertyErrorInfo } from "../../protocol/dataSources/errors.js";
3
- import type { NotionPagePropertyWriteMap } from "../../protocol/pages/page.js";
3
+ import type { CreatePageMessage } from "../../protocol/messages/createPage.js";
4
4
  import type { NotionPagePropertyInputMap } from "../../types.js";
5
5
  export type PropertyWriteMapResolutionResult = {
6
6
  status: "success";
7
- properties: NotionPagePropertyWriteMap;
7
+ properties: CreatePageMessage["properties"];
8
8
  } | {
9
9
  status: "error";
10
10
  error: CustomBlockPropertyErrorInfo;
@@ -14,7 +14,7 @@ export type PropertyWriteMapResolutionResult = {
14
14
  *
15
15
  * Identifiers in `properties` may be raw property IDs or data source property keys; the latter
16
16
  * are looked up in the `dataSource`'s `propertyIdsByKey`. Each value is re-parsed through
17
- * `notionPagePropertyValueSchema` with its `id` rewritten to the resolved property ID.
17
+ * the page property value schema with its `id` rewritten to the resolved property ID.
18
18
  */
19
19
  export declare function resolvePropertyWriteMapForDataSource(args: {
20
20
  dataSource: NotionDataSource | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"resolveProperty.d.ts","sourceRoot":"","sources":["../../../src/bridge/dataSources/resolveProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4DAA4D,CAAA;AAClG,OAAO,KAAK,EAEX,4BAA4B,EAC5B,MAAM,wDAAwD,CAAA;AAC/D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAA;AAGhG,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAEhE,MAAM,MAAM,gCAAgC,GACzC;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,0BAA0B,CAAA;CAAE,GAC7D;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,4BAA4B,CAAA;CAAE,CAAA;AAS3D;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAAC,IAAI,EAAE;IAC1D,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAA;IACxC,UAAU,EAAE,0BAA0B,CAAA;IACtC,a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B,aAAa,EAAE,MAAM,CAAA;CACrB,GACE;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACzC;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,4BAA4B,CAAA;CAAE,CAsB1D"}
@@ -8,7 +8,7 @@ function makePropertyError(code, message) {
8
8
  *
9
9
  * Identifiers in `properties` may be raw property IDs or data source property keys; the latter
10
10
  * are looked up in the `dataSource`'s `propertyIdsByKey`. Each value is re-parsed through
11
- * `notionPagePropertyValueSchema` with its `id` rewritten to the resolved property ID.
11
+ * the page property value schema with its `id` rewritten to the resolved property ID.
12
12
  */
13
13
  export function resolvePropertyWriteMapForDataSource(args) {
14
14
  const { dataSource, properties, operationName } = args;
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ export type { CustomBlockListUsersErrorCode, CustomBlockListUsersErrorInfo, } fr
28
28
  export type { CustomBlockOpenPageErrorCode, CustomBlockOpenPageErrorInfo, OpenPageMode, } from "./protocol/messages/openPage.js";
29
29
  export type { CustomBlockQueryDataSourceErrorCode, CustomBlockQueryDataSourceErrorInfo, } from "./protocol/messages/queryDataSourceResult.js";
30
30
  export type { CustomBlockUpdatePageErrorCode, CustomBlockUpdatePageErrorInfo, } from "./protocol/messages/updatePageResult.js";
31
- export type { CustomBlockPage, NotionPage, NotionPageCover, NotionPageIcon, NotionPagePropertyValue, NotionPagePropertyWriteMap, } from "./protocol/pages/page.js";
31
+ export type { CustomBlockPage, NotionPage, NotionPageCover, NotionPageIcon, NotionPagePropertyReadMap, NotionPagePropertyValue, NotionPagePropertyWriteMap, } from "./protocol/pages/page.js";
32
32
  export type { NotionParent } from "./protocol/parent.js";
33
33
  export type { NotionTheme } from "./protocol/theme.js";
34
34
  export { pages, users } from "./bridge/sandboxClient.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA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AAmC,EACnC,mCAAmC,GACnC,MAAM,oEAAoE,CAAA;AAC3E,YAAY,EACX,8BAA8B,EAC9B,8BAA8B,GAC9B,MAAM,+DAA+D,CAAA;AACtE,YAAY,EACX,eAAe,EACf,UAAU,EACV,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,uBAAuB,EACvB,0BAA0B,GAC1B,MAAM,gDAAgD,CAAA;AACvD,YAAY,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAC9E,YAAY,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EACN,KAAK,sBAAsB,EAC3B,eAAe,EACf,gBAAgB,GAChB,MAAM,WAAW,CAAA;AAClB,cAAc,YAAY,CAAA"}
@@ -37,7 +37,14 @@ export declare const manifestDataSourceSchema: v.ObjectSchema<{
37
37
  export type ManifestDataSource = v.InferOutput<typeof manifestDataSourceSchema>;
38
38
  export declare const manifestSchema: v.ObjectSchema<{
39
39
  readonly version: v.LiteralSchema<1, undefined>;
40
- readonly dataSources: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
40
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
41
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
42
+ readonly slashCommand: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
43
+ readonly icon: v.OptionalSchema<v.ObjectSchema<{
44
+ readonly type: v.LiteralSchema<"emoji", undefined>;
45
+ readonly emoji: v.StringSchema<undefined>;
46
+ }, undefined>, undefined>;
47
+ readonly dataSources: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
41
48
  readonly name: v.StringSchema<undefined>;
42
49
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
43
50
  readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
@@ -52,9 +59,9 @@ export declare const manifestSchema: v.ObjectSchema<{
52
59
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
53
60
  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>;
54
61
  }, undefined>, undefined>, {}>;
55
- }, undefined>, undefined>;
62
+ }, undefined>, undefined>, {}>;
56
63
  }, undefined>;
57
64
  /**
58
- * Manifest declaring the data sources required by a custom block.
65
+ * Manifest describing a custom block and its required data sources.
59
66
  */
60
67
  export type CustomBlockManifest = v.InferOutput<typeof manifestSchema>;
@@ -28,5 +28,9 @@ export const manifestDataSourceSchema = v.object({
28
28
  });
29
29
  export const manifestSchema = v.object({
30
30
  version: v.literal(1),
31
- dataSources: v.record(v.string(), manifestDataSourceSchema),
31
+ name: v.optional(v.string()),
32
+ description: v.optional(v.string()),
33
+ slashCommand: v.optional(v.string()),
34
+ icon: v.optional(v.object({ type: v.literal("emoji"), emoji: v.string() })),
35
+ dataSources: v.optional(v.record(v.string(), manifestDataSourceSchema), {}),
32
36
  });
@@ -15,7 +15,14 @@ export declare const connectMessageSchema: v.VariantSchema<"status", [v.ObjectSc
15
15
  */
16
16
  readonly manifest: v.OptionalSchema<v.ObjectSchema<{
17
17
  readonly version: v.LiteralSchema<1, undefined>;
18
- readonly dataSources: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
18
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
19
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
20
+ readonly slashCommand: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
21
+ readonly icon: v.OptionalSchema<v.ObjectSchema<{
22
+ readonly type: v.LiteralSchema<"emoji", undefined>;
23
+ readonly emoji: v.StringSchema<undefined>;
24
+ }, undefined>, undefined>;
25
+ readonly dataSources: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
19
26
  readonly name: v.StringSchema<undefined>;
20
27
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
21
28
  readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
@@ -30,7 +37,7 @@ export declare const connectMessageSchema: v.VariantSchema<"status", [v.ObjectSc
30
37
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
31
38
  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>;
32
39
  }, undefined>, undefined>, {}>;
33
- }, undefined>, undefined>;
40
+ }, undefined>, undefined>, {}>;
34
41
  }, undefined>, undefined>;
35
42
  }, undefined>, v.ObjectSchema<{
36
43
  readonly type: v.LiteralSchema<"connect", undefined>;
@@ -181,6 +181,34 @@ export declare const createPageMessageSchema: v.ObjectSchema<{
181
181
  readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
182
182
  readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
183
183
  }, undefined>, undefined>;
184
+ }, undefined>, v.ObjectSchema<{
185
+ readonly id: v.StringSchema<undefined>;
186
+ readonly type: v.LiteralSchema<"created_time", undefined>;
187
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
188
+ }, undefined>, v.ObjectSchema<{
189
+ readonly id: v.StringSchema<undefined>;
190
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
191
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
192
+ }, undefined>, v.ObjectSchema<{
193
+ readonly id: v.StringSchema<undefined>;
194
+ readonly type: v.LiteralSchema<"created_by", undefined>;
195
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
196
+ readonly id: v.StringSchema<undefined>;
197
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
198
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
199
+ }, undefined>, undefined>;
200
+ }, undefined>, v.ObjectSchema<{
201
+ readonly id: v.StringSchema<undefined>;
202
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
203
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
204
+ readonly id: v.StringSchema<undefined>;
205
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
206
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
207
+ }, undefined>, undefined>;
208
+ }, undefined>, v.ObjectSchema<{
209
+ readonly id: v.StringSchema<undefined>;
210
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
211
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
184
212
  }, undefined>], undefined>, undefined>;
185
213
  readonly position: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
186
214
  readonly type: v.LiteralSchema<"start", undefined>;
@@ -1,6 +1,6 @@
1
1
  import * as v from "valibot";
2
2
  import { notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, } from "../ids.js";
3
- import { notionPagePropertyWriteMapSchema } from "../pages/page.js";
3
+ import { notionPagePropertyReadMapSchema } from "../pages/page.js";
4
4
  /**
5
5
  * Describes where the newly created page should be inserted.
6
6
  * - `start` / `end` (default): prepend / append to the request's `parent`
@@ -46,6 +46,6 @@ export const createPageMessageSchema = v.object({
46
46
  * To create a page with manifest-defined property keys, call `pages.create`. The SDK resolves
47
47
  * those keys before it sends this message.
48
48
  */
49
- properties: notionPagePropertyWriteMapSchema,
49
+ properties: notionPagePropertyReadMapSchema,
50
50
  position: v.optional(notionCreatePagePositionSchema),
51
51
  });
@@ -161,6 +161,34 @@ export declare const createPageResultMessageSchema: v.VariantSchema<"status", [v
161
161
  readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
162
162
  readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
163
163
  }, undefined>, undefined>;
164
+ }, undefined>, v.ObjectSchema<{
165
+ readonly id: v.StringSchema<undefined>;
166
+ readonly type: v.LiteralSchema<"created_time", undefined>;
167
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
168
+ }, undefined>, v.ObjectSchema<{
169
+ readonly id: v.StringSchema<undefined>;
170
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
171
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
172
+ }, undefined>, v.ObjectSchema<{
173
+ readonly id: v.StringSchema<undefined>;
174
+ readonly type: v.LiteralSchema<"created_by", undefined>;
175
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
176
+ readonly id: v.StringSchema<undefined>;
177
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
178
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
179
+ }, undefined>, undefined>;
180
+ }, undefined>, v.ObjectSchema<{
181
+ readonly id: v.StringSchema<undefined>;
182
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
183
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
184
+ readonly id: v.StringSchema<undefined>;
185
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
186
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
187
+ }, undefined>, undefined>;
188
+ }, undefined>, v.ObjectSchema<{
189
+ readonly id: v.StringSchema<undefined>;
190
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
191
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
164
192
  }, undefined>], undefined>, undefined>;
165
193
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
166
194
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
@@ -166,6 +166,34 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
166
166
  readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
167
167
  readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
168
168
  }, undefined>, undefined>;
169
+ }, undefined>, v.ObjectSchema<{
170
+ readonly id: v.StringSchema<undefined>;
171
+ readonly type: v.LiteralSchema<"created_time", undefined>;
172
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
173
+ }, undefined>, v.ObjectSchema<{
174
+ readonly id: v.StringSchema<undefined>;
175
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
176
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
177
+ }, undefined>, v.ObjectSchema<{
178
+ readonly id: v.StringSchema<undefined>;
179
+ readonly type: v.LiteralSchema<"created_by", undefined>;
180
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
181
+ readonly id: v.StringSchema<undefined>;
182
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
183
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
184
+ }, undefined>, undefined>;
185
+ }, undefined>, v.ObjectSchema<{
186
+ readonly id: v.StringSchema<undefined>;
187
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
188
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
189
+ readonly id: v.StringSchema<undefined>;
190
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
191
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
192
+ }, undefined>, undefined>;
193
+ }, undefined>, v.ObjectSchema<{
194
+ readonly id: v.StringSchema<undefined>;
195
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
196
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
169
197
  }, undefined>], undefined>, undefined>;
170
198
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
171
199
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
@@ -53,7 +53,14 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
53
53
  }, undefined>], undefined>;
54
54
  readonly manifest: v.ObjectSchema<{
55
55
  readonly version: v.LiteralSchema<1, undefined>;
56
- readonly dataSources: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
56
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
57
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
58
+ readonly slashCommand: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
59
+ readonly icon: v.OptionalSchema<v.ObjectSchema<{
60
+ readonly type: v.LiteralSchema<"emoji", undefined>;
61
+ readonly emoji: v.StringSchema<undefined>;
62
+ }, undefined>, undefined>;
63
+ readonly dataSources: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
57
64
  readonly name: v.StringSchema<undefined>;
58
65
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
59
66
  readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
@@ -68,7 +75,7 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
68
75
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
69
76
  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>;
70
77
  }, undefined>, undefined>, {}>;
71
- }, undefined>, undefined>;
78
+ }, undefined>, undefined>, {}>;
72
79
  }, undefined>;
73
80
  readonly dataSources: v.ObjectSchema<{
74
81
  readonly bindings: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
@@ -678,6 +685,34 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
678
685
  readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
679
686
  readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
680
687
  }, undefined>, undefined>;
688
+ }, undefined>, v.ObjectSchema<{
689
+ readonly id: v.StringSchema<undefined>;
690
+ readonly type: v.LiteralSchema<"created_time", undefined>;
691
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
692
+ }, undefined>, v.ObjectSchema<{
693
+ readonly id: v.StringSchema<undefined>;
694
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
695
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
696
+ }, undefined>, v.ObjectSchema<{
697
+ readonly id: v.StringSchema<undefined>;
698
+ readonly type: v.LiteralSchema<"created_by", undefined>;
699
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
700
+ readonly id: v.StringSchema<undefined>;
701
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
702
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
703
+ }, undefined>, undefined>;
704
+ }, undefined>, v.ObjectSchema<{
705
+ readonly id: v.StringSchema<undefined>;
706
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
707
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
708
+ readonly id: v.StringSchema<undefined>;
709
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
710
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
711
+ }, undefined>, undefined>;
712
+ }, undefined>, v.ObjectSchema<{
713
+ readonly id: v.StringSchema<undefined>;
714
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
715
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
681
716
  }, undefined>], undefined>, undefined>;
682
717
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
683
718
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
@@ -878,6 +913,34 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
878
913
  readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
879
914
  readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
880
915
  }, undefined>, undefined>;
916
+ }, undefined>, v.ObjectSchema<{
917
+ readonly id: v.StringSchema<undefined>;
918
+ readonly type: v.LiteralSchema<"created_time", undefined>;
919
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
920
+ }, undefined>, v.ObjectSchema<{
921
+ readonly id: v.StringSchema<undefined>;
922
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
923
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
924
+ }, undefined>, v.ObjectSchema<{
925
+ readonly id: v.StringSchema<undefined>;
926
+ readonly type: v.LiteralSchema<"created_by", undefined>;
927
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
928
+ readonly id: v.StringSchema<undefined>;
929
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
930
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
931
+ }, undefined>, undefined>;
932
+ }, undefined>, v.ObjectSchema<{
933
+ readonly id: v.StringSchema<undefined>;
934
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
935
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
936
+ readonly id: v.StringSchema<undefined>;
937
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
938
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
939
+ }, undefined>, undefined>;
940
+ }, undefined>, v.ObjectSchema<{
941
+ readonly id: v.StringSchema<undefined>;
942
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
943
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
881
944
  }, undefined>], undefined>, undefined>;
882
945
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
883
946
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
@@ -1145,6 +1208,34 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
1145
1208
  readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1146
1209
  readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
1147
1210
  }, undefined>, undefined>;
1211
+ }, undefined>, v.ObjectSchema<{
1212
+ readonly id: v.StringSchema<undefined>;
1213
+ readonly type: v.LiteralSchema<"created_time", undefined>;
1214
+ readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1215
+ }, undefined>, v.ObjectSchema<{
1216
+ readonly id: v.StringSchema<undefined>;
1217
+ readonly type: v.LiteralSchema<"last_edited_time", undefined>;
1218
+ readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1219
+ }, undefined>, v.ObjectSchema<{
1220
+ readonly id: v.StringSchema<undefined>;
1221
+ readonly type: v.LiteralSchema<"created_by", undefined>;
1222
+ readonly created_by: v.NullableSchema<v.ObjectSchema<{
1223
+ readonly id: v.StringSchema<undefined>;
1224
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
1225
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1226
+ }, undefined>, undefined>;
1227
+ }, undefined>, v.ObjectSchema<{
1228
+ readonly id: v.StringSchema<undefined>;
1229
+ readonly type: v.LiteralSchema<"last_edited_by", undefined>;
1230
+ readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
1231
+ readonly id: v.StringSchema<undefined>;
1232
+ readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
1233
+ readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1234
+ }, undefined>, undefined>;
1235
+ }, undefined>, v.ObjectSchema<{
1236
+ readonly id: v.StringSchema<undefined>;
1237
+ readonly type: v.LiteralSchema<"last_visited_time", undefined>;
1238
+ readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
1148
1239
  }, undefined>], undefined>, undefined>;
1149
1240
  readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1150
1241
  readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
@@ -79,7 +79,14 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
79
79
  }, undefined>], undefined>;
80
80
  readonly manifest: v.ObjectSchema<{
81
81
  readonly version: v.LiteralSchema<1, undefined>;
82
- readonly dataSources: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
82
+ readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
83
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
84
+ readonly slashCommand: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
85
+ readonly icon: v.OptionalSchema<v.ObjectSchema<{
86
+ readonly type: v.LiteralSchema<"emoji", undefined>;
87
+ readonly emoji: v.StringSchema<undefined>;
88
+ }, undefined>, undefined>;
89
+ readonly dataSources: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
83
90
  readonly name: v.StringSchema<undefined>;
84
91
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
85
92
  readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
@@ -94,7 +101,7 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
94
101
  readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
95
102
  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>;
96
103
  }, undefined>, undefined>, {}>;
97
- }, undefined>, undefined>;
104
+ }, undefined>, undefined>, {}>;
98
105
  }, undefined>;
99
106
  readonly dataSources: v.ObjectSchema<{
100
107
  readonly bindings: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
@@ -1,4 +1,10 @@
1
1
  import * as v from "valibot";
2
+ export declare const customBlockRelationFilterOperatorSchema: v.UnionSchema<[v.StrictObjectSchema<{
3
+ 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>]>;
4
+ }, undefined>, v.StrictObjectSchema<{
5
+ 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>]>;
6
+ }, undefined>], undefined>;
7
+ export type CustomBlockRelationFilterOperator = v.InferOutput<typeof customBlockRelationFilterOperatorSchema>;
2
8
  declare const customBlockPersonFilterValueSchema: v.StrictObjectSchema<{
3
9
  readonly object: v.PicklistSchema<["user", "group"], undefined>;
4
10
  readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
@@ -169,6 +175,13 @@ export declare const customBlockDateFilterOperatorSchema: v.UnionSchema<[v.Stric
169
175
  }, undefined>], undefined>;
170
176
  export type CustomBlockDateFilterOperator = v.InferOutput<typeof customBlockDateFilterOperatorSchema>;
171
177
  export declare const resolvedCustomBlockDataSourcePropertyFilterSchema: v.UnionSchema<[v.StrictObjectSchema<{
178
+ readonly propertyId: v.StringSchema<undefined>;
179
+ readonly relation: v.UnionSchema<[v.StrictObjectSchema<{
180
+ 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>]>;
181
+ }, undefined>, v.StrictObjectSchema<{
182
+ 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>]>;
183
+ }, undefined>], undefined>;
184
+ }, undefined>, v.StrictObjectSchema<{
172
185
  readonly propertyId: v.StringSchema<undefined>;
173
186
  readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
174
187
  readonly contains: v.StrictObjectSchema<{
@@ -410,6 +423,13 @@ export declare const resolvedCustomBlockDataSourcePropertyFilterSchema: v.UnionS
410
423
  }, undefined>], undefined>;
411
424
  export type ResolvedCustomBlockDataSourcePropertyFilter = v.InferOutput<typeof resolvedCustomBlockDataSourcePropertyFilterSchema>;
412
425
  export declare const resolvedCustomBlockDataSourceFilterSchema: v.UnionSchema<[v.UnionSchema<[v.StrictObjectSchema<{
426
+ readonly propertyId: v.StringSchema<undefined>;
427
+ readonly relation: v.UnionSchema<[v.StrictObjectSchema<{
428
+ 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>]>;
429
+ }, undefined>, v.StrictObjectSchema<{
430
+ 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>]>;
431
+ }, undefined>], undefined>;
432
+ }, undefined>, v.StrictObjectSchema<{
413
433
  readonly propertyId: v.StringSchema<undefined>;
414
434
  readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
415
435
  readonly contains: v.StrictObjectSchema<{
@@ -650,6 +670,13 @@ export declare const resolvedCustomBlockDataSourceFilterSchema: v.UnionSchema<[v
650
670
  }, undefined>], undefined>], undefined>;
651
671
  }, undefined>], undefined>, v.StrictObjectSchema<{
652
672
  readonly and: v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
673
+ readonly propertyId: v.StringSchema<undefined>;
674
+ readonly relation: v.UnionSchema<[v.StrictObjectSchema<{
675
+ 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>]>;
676
+ }, undefined>, v.StrictObjectSchema<{
677
+ 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>]>;
678
+ }, undefined>], undefined>;
679
+ }, undefined>, v.StrictObjectSchema<{
653
680
  readonly propertyId: v.StringSchema<undefined>;
654
681
  readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
655
682
  readonly contains: v.StrictObjectSchema<{
@@ -915,6 +942,13 @@ export declare const queryDataSourceMessageSchema: v.ObjectSchema<{
915
942
  readonly limit: v.NumberSchema<undefined>;
916
943
  /** A sandbox-resolved property filter. */
917
944
  readonly filter: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.StrictObjectSchema<{
945
+ readonly propertyId: v.StringSchema<undefined>;
946
+ readonly relation: v.UnionSchema<[v.StrictObjectSchema<{
947
+ 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>]>;
948
+ }, undefined>, v.StrictObjectSchema<{
949
+ 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>]>;
950
+ }, undefined>], undefined>;
951
+ }, undefined>, v.StrictObjectSchema<{
918
952
  readonly propertyId: v.StringSchema<undefined>;
919
953
  readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
920
954
  readonly contains: v.StrictObjectSchema<{
@@ -1155,6 +1189,13 @@ export declare const queryDataSourceMessageSchema: v.ObjectSchema<{
1155
1189
  }, undefined>], undefined>], undefined>;
1156
1190
  }, undefined>], undefined>, v.StrictObjectSchema<{
1157
1191
  readonly and: v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
1192
+ readonly propertyId: v.StringSchema<undefined>;
1193
+ readonly relation: v.UnionSchema<[v.StrictObjectSchema<{
1194
+ 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>]>;
1195
+ }, undefined>, v.StrictObjectSchema<{
1196
+ 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>]>;
1197
+ }, undefined>], undefined>;
1198
+ }, undefined>, v.StrictObjectSchema<{
1158
1199
  readonly propertyId: v.StringSchema<undefined>;
1159
1200
  readonly created_by: v.UnionSchema<[v.StrictObjectSchema<{
1160
1201
  readonly contains: v.StrictObjectSchema<{
@@ -1,6 +1,14 @@
1
1
  import * as v from "valibot";
2
2
  import { notionSortDirectionSchema } from "../dataSources/sortDirection.js";
3
- import { notionDataSourceIdSchema } from "../ids.js";
3
+ import { notionDataSourceIdSchema, notionPageIdSchema } from "../ids.js";
4
+ const relationPageIdSchema = v.pipe(notionPageIdSchema, v.regex(/^(?:[0-9a-f]{32}|[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12})$/i), v.transform(id => id
5
+ .replaceAll("-", "")
6
+ .toLowerCase()
7
+ .replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, "$1-$2-$3-$4-$5")));
8
+ export const customBlockRelationFilterOperatorSchema = v.union([
9
+ v.strictObject({ contains: relationPageIdSchema }),
10
+ v.strictObject({ does_not_contain: relationPageIdSchema }),
11
+ ]);
4
12
  const emptyOperatorSchema = v.union([
5
13
  v.strictObject({ is_empty: v.literal(true) }),
6
14
  v.strictObject({ is_not_empty: v.literal(true) }),
@@ -156,6 +164,10 @@ export const customBlockDateFilterOperatorSchema = v.union([
156
164
  }),
157
165
  ]);
158
166
  export const resolvedCustomBlockDataSourcePropertyFilterSchema = v.union([
167
+ v.strictObject({
168
+ propertyId: v.string(),
169
+ relation: customBlockRelationFilterOperatorSchema,
170
+ }),
159
171
  v.strictObject({
160
172
  propertyId: v.string(),
161
173
  created_by: customBlockCreatedByFilterOperatorSchema,