@notionhq/custom-blocks 0.1.23 → 0.1.25
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/messages/createPage.d.ts +11 -1
- package/dist/protocol/messages/createPage.d.ts.map +1 -1
- package/dist/protocol/messages/createPage.js +8 -1
- package/dist/protocol/messages/sandboxToHost.d.ts +3 -3
- package/dist/protocol/messages/sandboxToHost.js +3 -3
- package/dist/protocol/messages/updatePage.d.ts +11 -1
- package/dist/protocol/messages/updatePage.d.ts.map +1 -1
- package/dist/protocol/messages/updatePage.js +8 -1
- package/dist/types.d.ts +2 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/types.ts +2 -2
|
@@ -37,7 +37,7 @@ export declare const createPageParentSchema: v.VariantSchema<"type", [v.ObjectSc
|
|
|
37
37
|
}, undefined>], undefined>;
|
|
38
38
|
export type CreatePageMessageParent = v.InferOutput<typeof createPageParentSchema>;
|
|
39
39
|
/**
|
|
40
|
-
*
|
|
40
|
+
* The sandbox sends this message to ask the host to create a page.
|
|
41
41
|
* The payload mirrors Notion's public `POST /v1/pages` API.
|
|
42
42
|
*/
|
|
43
43
|
export declare const createPageMessageSchema: v.ObjectSchema<{
|
|
@@ -50,6 +50,13 @@ export declare const createPageMessageSchema: v.ObjectSchema<{
|
|
|
50
50
|
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
51
51
|
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
52
52
|
}, undefined>], undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Property values, keyed by raw property IDs from Notion.
|
|
55
|
+
*
|
|
56
|
+
* Each value must carry the same raw property ID in its `id` field.
|
|
57
|
+
* To create a page with manifest-defined property keys, call `pages.create`. The SDK resolves
|
|
58
|
+
* those keys before it sends this message.
|
|
59
|
+
*/
|
|
53
60
|
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
54
61
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
55
62
|
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
@@ -187,5 +194,8 @@ export declare const createPageMessageSchema: v.ObjectSchema<{
|
|
|
187
194
|
readonly blockId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
188
195
|
}, undefined>], undefined>, undefined>;
|
|
189
196
|
}, undefined>;
|
|
197
|
+
/**
|
|
198
|
+
* The sandbox sends this message to create a page.
|
|
199
|
+
*/
|
|
190
200
|
export type CreatePageMessage = v.InferOutput<typeof createPageMessageSchema>;
|
|
191
201
|
//# sourceMappingURL=createPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPage.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/messages/createPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;0BAKzC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,WAAW,CACnD,OAAO,8BAA8B,CACrC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;;;0BAMjC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAClD,OAAO,sBAAsB,CAC7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"createPage.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/messages/createPage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;0BAKzC,CAAA;AAEF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,WAAW,CACnD,OAAO,8BAA8B,CACrC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB;;;;;;0BAMjC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,WAAW,CAClD,OAAO,sBAAsB,CAC7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;IAInC;;;;;;OAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAIF,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -32,13 +32,20 @@ export const createPageParentSchema = v.variant("type", [
|
|
|
32
32
|
}),
|
|
33
33
|
]);
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* The sandbox sends this message to ask the host to create a page.
|
|
36
36
|
* The payload mirrors Notion's public `POST /v1/pages` API.
|
|
37
37
|
*/
|
|
38
38
|
export const createPageMessageSchema = v.object({
|
|
39
39
|
type: v.literal("createPage"),
|
|
40
40
|
requestId: v.string(),
|
|
41
41
|
parent: createPageParentSchema,
|
|
42
|
+
/**
|
|
43
|
+
* Property values, keyed by raw property IDs from Notion.
|
|
44
|
+
*
|
|
45
|
+
* Each value must carry the same raw property ID in its `id` field.
|
|
46
|
+
* To create a page with manifest-defined property keys, call `pages.create`. The SDK resolves
|
|
47
|
+
* those keys before it sends this message.
|
|
48
|
+
*/
|
|
42
49
|
properties: notionPagePropertyWriteMapSchema,
|
|
43
50
|
// TODO(custom-blocks): Add icon and cover once the Notion host supports them for page creation.
|
|
44
51
|
position: v.optional(notionCreatePagePositionSchema),
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
* inbound traffic from sandboxes without re-implementing validation logic.
|
|
3
|
+
* Discriminated union of every message the sandbox is allowed to send the host. Useful for hosts
|
|
4
|
+
* to validate inbound traffic from sandboxes without re-implementing validation logic.
|
|
5
5
|
*/
|
|
6
|
-
export declare const sandboxToHostMessageSchema: v.
|
|
6
|
+
export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.VariantSchema<"status", [v.ObjectSchema<{
|
|
7
7
|
readonly type: v.LiteralSchema<"connect", undefined>;
|
|
8
8
|
readonly initializationId: v.StringSchema<undefined>;
|
|
9
9
|
readonly bridgeProtocolVersion: v.NumberSchema<undefined>;
|
|
@@ -10,10 +10,10 @@ import { queryDataSourceMessageSchema } from "./queryDataSource.js";
|
|
|
10
10
|
import { resizeMessageSchema } from "./resize.js";
|
|
11
11
|
import { updatePageMessageSchema } from "./updatePage.js";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* inbound traffic from sandboxes without re-implementing validation logic.
|
|
13
|
+
* Discriminated union of every message the sandbox is allowed to send the host. Useful for hosts
|
|
14
|
+
* to validate inbound traffic from sandboxes without re-implementing validation logic.
|
|
15
15
|
*/
|
|
16
|
-
export const sandboxToHostMessageSchema = v.
|
|
16
|
+
export const sandboxToHostMessageSchema = v.variant("type", [
|
|
17
17
|
connectMessageSchema,
|
|
18
18
|
initResultMessageSchema,
|
|
19
19
|
queryDataSourceMessageSchema,
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* The sandbox sends this message to patch a page.
|
|
4
4
|
*/
|
|
5
5
|
export declare const updatePageMessageSchema: v.ObjectSchema<{
|
|
6
6
|
readonly type: v.LiteralSchema<"updatePage", undefined>;
|
|
7
7
|
readonly requestId: v.StringSchema<undefined>;
|
|
8
8
|
readonly pageId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
9
|
+
/**
|
|
10
|
+
* Property values, keyed by raw property IDs from Notion.
|
|
11
|
+
*
|
|
12
|
+
* Each value must carry the same raw property ID in its `id` field.
|
|
13
|
+
* To update a page with manifest-defined property keys, call `row.update()` on a row returned
|
|
14
|
+
* by `useDataSource()`. The SDK resolves those keys before it sends this message.
|
|
15
|
+
*/
|
|
9
16
|
readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
10
17
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
11
18
|
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
@@ -167,5 +174,8 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
|
|
|
167
174
|
}, undefined>], undefined>, undefined>;
|
|
168
175
|
readonly archived: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
169
176
|
}, undefined>;
|
|
177
|
+
/**
|
|
178
|
+
* The sandbox sends this message to update a page.
|
|
179
|
+
*/
|
|
170
180
|
export type UpdatePageMessage = v.InferOutput<typeof updatePageMessageSchema>;
|
|
171
181
|
//# sourceMappingURL=updatePage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updatePage.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/messages/updatePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B;;GAEG;AACH,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"updatePage.d.ts","sourceRoot":"","sources":["../../../../../home/runner/work/custom-blocks/custom-blocks/protocol/src/messages/updatePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;IAInC;;;;;;OAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAKF,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,WAAW,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
|
|
@@ -2,12 +2,19 @@ import * as v from "valibot";
|
|
|
2
2
|
import { notionPageIdSchema } from "../ids.js";
|
|
3
3
|
import { notionPageCoverSchema, notionPageIconSchema, notionPagePropertyWriteMapSchema, } from "../pages/page.js";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* The sandbox sends this message to patch a page.
|
|
6
6
|
*/
|
|
7
7
|
export const updatePageMessageSchema = v.object({
|
|
8
8
|
type: v.literal("updatePage"),
|
|
9
9
|
requestId: v.string(),
|
|
10
10
|
pageId: notionPageIdSchema,
|
|
11
|
+
/**
|
|
12
|
+
* Property values, keyed by raw property IDs from Notion.
|
|
13
|
+
*
|
|
14
|
+
* Each value must carry the same raw property ID in its `id` field.
|
|
15
|
+
* To update a page with manifest-defined property keys, call `row.update()` on a row returned
|
|
16
|
+
* by `useDataSource()`. The SDK resolves those keys before it sends this message.
|
|
17
|
+
*/
|
|
11
18
|
properties: v.optional(notionPagePropertyWriteMapSchema),
|
|
12
19
|
icon: v.optional(notionPageIconSchema),
|
|
13
20
|
cover: v.optional(notionPageCoverSchema),
|
package/dist/types.d.ts
CHANGED
|
@@ -86,8 +86,8 @@ export type NotionDataSourcePageUpdateResult = UpdatePageResult;
|
|
|
86
86
|
export type UseDataSourceResult = {
|
|
87
87
|
items: NotionDataSourcePage[];
|
|
88
88
|
/**
|
|
89
|
-
* Collection/data
|
|
90
|
-
* schemas. Undefined when the semantic data
|
|
89
|
+
* Collection/data source schema for the bound Notion data source, including raw property
|
|
90
|
+
* schemas. Undefined when the semantic data source key has not been bound.
|
|
91
91
|
*/
|
|
92
92
|
collectionSchema?: NotionCollectionSchema;
|
|
93
93
|
/**
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/src/types.ts
CHANGED
|
@@ -128,8 +128,8 @@ export type NotionDataSourcePageUpdateResult = UpdatePageResult
|
|
|
128
128
|
export type UseDataSourceResult = {
|
|
129
129
|
items: NotionDataSourcePage[]
|
|
130
130
|
/**
|
|
131
|
-
* Collection/data
|
|
132
|
-
* schemas. Undefined when the semantic data
|
|
131
|
+
* Collection/data source schema for the bound Notion data source, including raw property
|
|
132
|
+
* schemas. Undefined when the semantic data source key has not been bound.
|
|
133
133
|
*/
|
|
134
134
|
collectionSchema?: NotionCollectionSchema
|
|
135
135
|
/**
|