@notionhq/custom-blocks-host 0.1.12 → 0.1.14
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/protocol/dataSources/dataSourcePage.d.ts +2 -2
- package/dist/protocol/dataSources/dataSourcePage.js +2 -3
- package/dist/protocol/messages/createPageResult.d.ts +2 -2
- package/dist/protocol/messages/getPage.d.ts +2 -2
- package/dist/protocol/messages/hostToSandbox.d.ts +9 -9
- package/dist/protocol/messages/init.d.ts +1 -1
- package/dist/protocol/messages/init.js +2 -3
- package/dist/protocol/messages/queryDataSourceResult.d.ts +2 -2
- package/dist/protocol/messages/updatePageResult.d.ts +2 -2
- package/dist/protocol/pages/page.d.ts +2 -2
- package/dist/protocol/pages/page.js +2 -3
- package/dist/protocol/protocolVersion.d.ts +1 -1
- package/dist/protocol/protocolVersion.js +1 -1
- package/package.json +1 -1
|
@@ -7,9 +7,9 @@ import * as v from "valibot";
|
|
|
7
7
|
export declare const notionDataSourcePageBridgeSchema: v.ObjectSchema<{
|
|
8
8
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
9
9
|
/** Whether the page or an ancestor is archived. */
|
|
10
|
-
readonly is_archived: v.
|
|
10
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
11
11
|
/** Whether the page or an ancestor is in Trash. */
|
|
12
|
-
readonly in_trash: v.
|
|
12
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
13
13
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
14
14
|
readonly type: v.LiteralSchema<"date", undefined>;
|
|
15
15
|
readonly start_date: v.StringSchema<undefined>;
|
|
@@ -8,10 +8,9 @@ import { notionDataSourceValueSchema } from "./dataSourceValue.js";
|
|
|
8
8
|
*/
|
|
9
9
|
export const notionDataSourcePageBridgeSchema = v.object({
|
|
10
10
|
id: notionPageIdSchema,
|
|
11
|
-
// TODO(custom-blocks): Require is_archived and in_trash in bridge protocol v4.
|
|
12
11
|
/** Whether the page or an ancestor is archived. */
|
|
13
|
-
is_archived: v.
|
|
12
|
+
is_archived: v.boolean(),
|
|
14
13
|
/** Whether the page or an ancestor is in Trash. */
|
|
15
|
-
in_trash: v.
|
|
14
|
+
in_trash: v.boolean(),
|
|
16
15
|
propertiesById: v.record(v.string(), v.optional(notionDataSourceValueSchema)),
|
|
17
16
|
});
|
|
@@ -200,8 +200,8 @@ export declare const createPageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
200
200
|
}, undefined>], undefined>, undefined>;
|
|
201
201
|
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
202
202
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
203
|
-
readonly is_archived: v.
|
|
204
|
-
readonly in_trash: v.
|
|
203
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
204
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
205
205
|
}, undefined>;
|
|
206
206
|
}, undefined>, v.ObjectSchema<{
|
|
207
207
|
readonly type: v.LiteralSchema<"createPageResult", undefined>;
|
|
@@ -205,8 +205,8 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
205
205
|
}, undefined>], undefined>, undefined>;
|
|
206
206
|
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
207
207
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
208
|
-
readonly is_archived: v.
|
|
209
|
-
readonly in_trash: v.
|
|
208
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
209
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
210
210
|
}, undefined>;
|
|
211
211
|
}, undefined>, v.ObjectSchema<{
|
|
212
212
|
readonly type: v.LiteralSchema<"getPageResult", undefined>;
|
|
@@ -7,7 +7,7 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
7
7
|
readonly initializationId: v.StringSchema<undefined>;
|
|
8
8
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
9
9
|
readonly theme: v.PicklistSchema<["light", "dark"], undefined>;
|
|
10
|
-
readonly contrastMode: v.
|
|
10
|
+
readonly contrastMode: v.PicklistSchema<["standard", "high"], undefined>;
|
|
11
11
|
readonly blockId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
12
12
|
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
13
13
|
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
@@ -449,8 +449,8 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
449
449
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
450
450
|
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
451
451
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
452
|
-
readonly is_archived: v.
|
|
453
|
-
readonly in_trash: v.
|
|
452
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
453
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
454
454
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
455
455
|
readonly type: v.LiteralSchema<"date", undefined>;
|
|
456
456
|
readonly start_date: v.StringSchema<undefined>;
|
|
@@ -711,8 +711,8 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
711
711
|
}, undefined>], undefined>, undefined>;
|
|
712
712
|
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
713
713
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
714
|
-
readonly is_archived: v.
|
|
715
|
-
readonly in_trash: v.
|
|
714
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
715
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
716
716
|
}, undefined>;
|
|
717
717
|
}, undefined>, v.ObjectSchema<{
|
|
718
718
|
readonly type: v.LiteralSchema<"createPageResult", undefined>;
|
|
@@ -911,8 +911,8 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
911
911
|
}, undefined>], undefined>, undefined>;
|
|
912
912
|
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
913
913
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
914
|
-
readonly is_archived: v.
|
|
915
|
-
readonly in_trash: v.
|
|
914
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
915
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
916
916
|
}, undefined>;
|
|
917
917
|
}, undefined>, v.ObjectSchema<{
|
|
918
918
|
readonly type: v.LiteralSchema<"getPageResult", undefined>;
|
|
@@ -1164,8 +1164,8 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
1164
1164
|
}, undefined>], undefined>, undefined>;
|
|
1165
1165
|
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1166
1166
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1167
|
-
readonly is_archived: v.
|
|
1168
|
-
readonly in_trash: v.
|
|
1167
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
1168
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
1169
1169
|
}, undefined>;
|
|
1170
1170
|
}, undefined>, v.ObjectSchema<{
|
|
1171
1171
|
readonly type: v.LiteralSchema<"updatePageResult", undefined>;
|
|
@@ -33,7 +33,7 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
33
33
|
readonly initializationId: v.StringSchema<undefined>;
|
|
34
34
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
35
35
|
readonly theme: v.PicklistSchema<["light", "dark"], undefined>;
|
|
36
|
-
readonly contrastMode: v.
|
|
36
|
+
readonly contrastMode: v.PicklistSchema<["standard", "high"], undefined>;
|
|
37
37
|
readonly blockId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
38
38
|
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
39
39
|
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import {
|
|
2
|
+
import { notionContrastModeSchema } from "../contrast.js";
|
|
3
3
|
import { notionDataSourceBindingsSchema } from "../dataSources/dataSource.js";
|
|
4
4
|
import { notionBlockIdSchema } from "../ids.js";
|
|
5
5
|
import { manifestSchema } from "../manifest.js";
|
|
@@ -38,8 +38,7 @@ export const initMessageSchema = v.variant("status", [
|
|
|
38
38
|
initializationId: v.string(),
|
|
39
39
|
status: v.literal("success"),
|
|
40
40
|
theme: notionThemeSchema,
|
|
41
|
-
|
|
42
|
-
contrastMode: v.optional(notionContrastModeSchema, DEFAULT_CONTRAST_MODE),
|
|
41
|
+
contrastMode: notionContrastModeSchema,
|
|
43
42
|
blockId: notionBlockIdSchema,
|
|
44
43
|
parent: notionParentSchema,
|
|
45
44
|
page: customBlockPageSchema,
|
|
@@ -17,8 +17,8 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
17
17
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
18
18
|
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
19
19
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
20
|
-
readonly is_archived: v.
|
|
21
|
-
readonly in_trash: v.
|
|
20
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
21
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
22
22
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.BooleanSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
23
23
|
readonly type: v.LiteralSchema<"date", undefined>;
|
|
24
24
|
readonly start_date: v.StringSchema<undefined>;
|
|
@@ -199,8 +199,8 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
199
199
|
}, undefined>], undefined>, undefined>;
|
|
200
200
|
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
201
201
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
202
|
-
readonly is_archived: v.
|
|
203
|
-
readonly in_trash: v.
|
|
202
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
203
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
204
204
|
}, undefined>;
|
|
205
205
|
}, undefined>, v.ObjectSchema<{
|
|
206
206
|
readonly type: v.LiteralSchema<"updatePageResult", undefined>;
|
|
@@ -596,9 +596,9 @@ export declare const notionPageSchema: v.ObjectSchema<{
|
|
|
596
596
|
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
597
597
|
readonly public_url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
598
598
|
/** Whether the page or an ancestor is archived. */
|
|
599
|
-
readonly is_archived: v.
|
|
599
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
600
600
|
/** Whether the page or an ancestor is in Trash. */
|
|
601
|
-
readonly in_trash: v.
|
|
601
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
602
602
|
}, undefined>;
|
|
603
603
|
export type NotionPage = v.InferOutput<typeof notionPageSchema>;
|
|
604
604
|
export {};
|
|
@@ -207,9 +207,8 @@ export const notionPageSchema = v.object({
|
|
|
207
207
|
cover: v.optional(notionPageCoverSchema),
|
|
208
208
|
url: v.optional(v.string()),
|
|
209
209
|
public_url: v.optional(v.string()),
|
|
210
|
-
// TODO(custom-blocks): Require is_archived and in_trash in bridge protocol v4.
|
|
211
210
|
/** Whether the page or an ancestor is archived. */
|
|
212
|
-
is_archived: v.
|
|
211
|
+
is_archived: v.boolean(),
|
|
213
212
|
/** Whether the page or an ancestor is in Trash. */
|
|
214
|
-
in_trash: v.
|
|
213
|
+
in_trash: v.boolean(),
|
|
215
214
|
});
|
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
* Increase this value for breaking wire changes. Hosts can continue to accept
|
|
4
4
|
* older versions, so this value does not set the minimum or maximum they accept.
|
|
5
5
|
*/
|
|
6
|
-
export declare const LATEST_BRIDGE_PROTOCOL_VERSION =
|
|
6
|
+
export declare const LATEST_BRIDGE_PROTOCOL_VERSION = 4;
|