@notionhq/custom-blocks-host 0.3.5 → 0.3.6
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/browser.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/lifecycle/legacyPage.d.ts +4 -2
- package/dist/lifecycle/legacyPage.d.ts.map +1 -1
- package/dist/lifecycle/legacyPage.js +12 -0
- package/dist/lifecycle/normalizeHostToSandboxMessage.d.ts.map +1 -1
- package/dist/lifecycle/normalizeHostToSandboxMessage.js +8 -2
- package/dist/lifecycle/normalizePage.d.ts +7 -0
- package/dist/lifecycle/normalizePage.d.ts.map +1 -0
- package/dist/lifecycle/normalizePage.js +22 -0
- package/dist/messages/types.d.ts +1 -2
- package/dist/messages/types.d.ts.map +1 -1
- package/dist/protocol/dataSources/dataSourcePage.d.ts +0 -160
- package/dist/protocol/dataSources/dataSourcePage.js +0 -7
- package/dist/protocol/messages/createPage.js +2 -2
- package/dist/protocol/messages/createPageResult.d.ts +468 -1
- package/dist/protocol/messages/createPageResult.js +17 -2
- package/dist/protocol/messages/getPage.d.ts +468 -1
- package/dist/protocol/messages/getPage.js +18 -3
- package/dist/protocol/messages/hostToSandbox.d.ts +1172 -328
- package/dist/protocol/messages/hostToSandbox.js +9 -6
- package/dist/protocol/messages/queryDataSourceResult.d.ts +142 -6
- package/dist/protocol/messages/queryDataSourceResult.js +4 -6
- package/dist/protocol/messages/sandboxToHost.d.ts +2 -0
- package/dist/protocol/messages/updatePage.d.ts +1 -0
- package/dist/protocol/messages/updatePage.js +4 -3
- package/dist/protocol/messages/updatePageResult.d.ts +467 -1
- package/dist/protocol/messages/updatePageResult.js +16 -2
- package/dist/protocol/pages/page.d.ts +386 -6
- package/dist/protocol/pages/page.js +23 -2
- package/dist/protocol/protocolVersion.js +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -4
- package/src/lifecycle/legacyPage.ts +28 -3
- package/src/lifecycle/normalizeHostToSandboxMessage.ts +13 -2
- package/src/lifecycle/normalizePage.ts +35 -0
- package/src/messages/types.ts +1 -1
- package/dist/lifecycle/normalizeQueryPage.d.ts +0 -3
- package/dist/lifecycle/normalizeQueryPage.d.ts.map +0 -1
- package/dist/lifecycle/normalizeQueryPage.js +0 -13
- package/src/lifecycle/normalizeQueryPage.ts +0 -25
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { contrastModeChangedMessageSchema } from "./contrastModeChanged.js";
|
|
3
|
-
import { createPageResultMessageSchema } from "./createPageResult.js";
|
|
3
|
+
import { createPageResultMessageLegacySchema, createPageResultMessageSchema, } from "./createPageResult.js";
|
|
4
4
|
import { currentUserChangedMessageSchema } from "./currentUserChanged.js";
|
|
5
5
|
import { dataSourcesChangedMessageSchema } from "./dataSourcesChanged.js";
|
|
6
|
-
import { getPageResultMessageSchema } from "./getPage.js";
|
|
6
|
+
import { getPageResultMessageLegacySchema, getPageResultMessageSchema, } from "./getPage.js";
|
|
7
7
|
import { getUserResultMessageSchema } from "./getUser.js";
|
|
8
8
|
import { initMessageSchema } from "./init.js";
|
|
9
9
|
import { invalidSandboxMessageSchema } from "./invalidSandboxMessage.js";
|
|
@@ -14,7 +14,7 @@ import { pageChangedMessageSchema } from "./pageChanged.js";
|
|
|
14
14
|
import { parentChangedMessageSchema } from "./parentChanged.js";
|
|
15
15
|
import { queryDataSourceResultMessageLegacySchema, queryDataSourceResultMessageSchema, } from "./queryDataSourceResult.js";
|
|
16
16
|
import { themeChangedMessageSchema } from "./themeChanged.js";
|
|
17
|
-
import { updatePageResultMessageSchema } from "./updatePageResult.js";
|
|
17
|
+
import { updatePageResultMessageLegacySchema, updatePageResultMessageSchema, } from "./updatePageResult.js";
|
|
18
18
|
const baseHostToSandboxMessageSchema = v.variant("type", [
|
|
19
19
|
initMessageSchema,
|
|
20
20
|
themeChangedMessageSchema,
|
|
@@ -23,18 +23,18 @@ const baseHostToSandboxMessageSchema = v.variant("type", [
|
|
|
23
23
|
pageChangedMessageSchema,
|
|
24
24
|
currentUserChangedMessageSchema,
|
|
25
25
|
dataSourcesChangedMessageSchema,
|
|
26
|
-
createPageResultMessageSchema,
|
|
27
|
-
getPageResultMessageSchema,
|
|
28
26
|
getUserResultMessageSchema,
|
|
29
27
|
listUsersResultMessageSchema,
|
|
30
28
|
openPageResultMessageSchema,
|
|
31
29
|
openExternalUrlResultMessageSchema,
|
|
32
|
-
updatePageResultMessageSchema,
|
|
33
30
|
invalidSandboxMessageSchema,
|
|
34
31
|
]);
|
|
35
32
|
export const hostToSandboxMessageSchema = v.variant("type", [
|
|
36
33
|
...baseHostToSandboxMessageSchema.options,
|
|
37
34
|
queryDataSourceResultMessageSchema,
|
|
35
|
+
getPageResultMessageSchema,
|
|
36
|
+
createPageResultMessageSchema,
|
|
37
|
+
updatePageResultMessageSchema,
|
|
38
38
|
]);
|
|
39
39
|
/**
|
|
40
40
|
* Discriminated union of every message the host is allowed to send the sandbox.
|
|
@@ -42,4 +42,7 @@ export const hostToSandboxMessageSchema = v.variant("type", [
|
|
|
42
42
|
export const hostToSandboxMessageLegacySchema = v.variant("type", [
|
|
43
43
|
...baseHostToSandboxMessageSchema.options,
|
|
44
44
|
queryDataSourceResultMessageLegacySchema,
|
|
45
|
+
getPageResultMessageLegacySchema,
|
|
46
|
+
createPageResultMessageLegacySchema,
|
|
47
|
+
updatePageResultMessageLegacySchema,
|
|
45
48
|
]);
|
|
@@ -16,10 +16,27 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
16
16
|
readonly subscriptionId: v.StringSchema<undefined>;
|
|
17
17
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
18
18
|
readonly items: v.ArraySchema<v.ObjectSchema<{
|
|
19
|
+
readonly object: v.LiteralSchema<"page", undefined>;
|
|
19
20
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
20
|
-
readonly
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
22
|
+
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
23
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
24
|
+
}, undefined>, v.ObjectSchema<{
|
|
25
|
+
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
26
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
27
|
+
}, undefined>, v.ObjectSchema<{
|
|
28
|
+
readonly type: v.LiteralSchema<"workspace", undefined>;
|
|
29
|
+
readonly workspace: v.LiteralSchema<true, undefined>;
|
|
30
|
+
}, undefined>, v.ObjectSchema<{
|
|
31
|
+
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
32
|
+
readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
33
|
+
}, undefined>, v.ObjectSchema<{
|
|
34
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
35
|
+
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
36
|
+
}, undefined>, v.ObjectSchema<{
|
|
37
|
+
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
38
|
+
}, undefined>], undefined>;
|
|
39
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
23
40
|
readonly id: v.StringSchema<undefined>;
|
|
24
41
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
25
42
|
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
@@ -172,6 +189,57 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
172
189
|
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
173
190
|
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
174
191
|
}, undefined>], undefined>, undefined>, undefined>;
|
|
192
|
+
readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
193
|
+
readonly id: v.StringSchema<undefined>;
|
|
194
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
195
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
196
|
+
}, undefined>, undefined>, null>;
|
|
197
|
+
readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
198
|
+
readonly id: v.StringSchema<undefined>;
|
|
199
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
200
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
201
|
+
}, undefined>, undefined>, null>;
|
|
202
|
+
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
203
|
+
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
204
|
+
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
205
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
206
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
207
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
208
|
+
}, undefined>, v.ObjectSchema<{
|
|
209
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
210
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
211
|
+
readonly id: v.StringSchema<undefined>;
|
|
212
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
213
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
214
|
+
}, undefined>;
|
|
215
|
+
}, undefined>, v.ObjectSchema<{
|
|
216
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
217
|
+
readonly external: v.ObjectSchema<{
|
|
218
|
+
readonly url: v.StringSchema<undefined>;
|
|
219
|
+
}, undefined>;
|
|
220
|
+
}, undefined>, v.ObjectSchema<{
|
|
221
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
222
|
+
readonly file: v.ObjectSchema<{
|
|
223
|
+
readonly url: v.StringSchema<undefined>;
|
|
224
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
225
|
+
}, undefined>;
|
|
226
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
227
|
+
readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
228
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
229
|
+
readonly external: v.ObjectSchema<{
|
|
230
|
+
readonly url: v.StringSchema<undefined>;
|
|
231
|
+
}, undefined>;
|
|
232
|
+
}, undefined>, v.ObjectSchema<{
|
|
233
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
234
|
+
readonly file: v.ObjectSchema<{
|
|
235
|
+
readonly url: v.StringSchema<undefined>;
|
|
236
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
237
|
+
}, undefined>;
|
|
238
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
239
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
240
|
+
readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
241
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
242
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
175
243
|
}, undefined>, undefined>;
|
|
176
244
|
readonly hasMore: v.BooleanSchema<undefined>;
|
|
177
245
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -189,10 +257,27 @@ export declare const queryDataSourceResultMessageLegacySchema: v.VariantSchema<"
|
|
|
189
257
|
readonly subscriptionId: v.StringSchema<undefined>;
|
|
190
258
|
readonly status: v.LiteralSchema<"success", undefined>;
|
|
191
259
|
readonly items: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
260
|
+
readonly object: v.LiteralSchema<"page", undefined>;
|
|
192
261
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
193
|
-
readonly
|
|
194
|
-
|
|
195
|
-
|
|
262
|
+
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
263
|
+
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
264
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
265
|
+
}, undefined>, v.ObjectSchema<{
|
|
266
|
+
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
267
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
268
|
+
}, undefined>, v.ObjectSchema<{
|
|
269
|
+
readonly type: v.LiteralSchema<"workspace", undefined>;
|
|
270
|
+
readonly workspace: v.LiteralSchema<true, undefined>;
|
|
271
|
+
}, undefined>, v.ObjectSchema<{
|
|
272
|
+
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
273
|
+
readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
274
|
+
}, undefined>, v.ObjectSchema<{
|
|
275
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
276
|
+
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
277
|
+
}, undefined>, v.ObjectSchema<{
|
|
278
|
+
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
279
|
+
}, undefined>], undefined>;
|
|
280
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
196
281
|
readonly id: v.StringSchema<undefined>;
|
|
197
282
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
198
283
|
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
@@ -345,6 +430,57 @@ export declare const queryDataSourceResultMessageLegacySchema: v.VariantSchema<"
|
|
|
345
430
|
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
346
431
|
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
347
432
|
}, undefined>], undefined>, undefined>, undefined>;
|
|
433
|
+
readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
434
|
+
readonly id: v.StringSchema<undefined>;
|
|
435
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
436
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
437
|
+
}, undefined>, undefined>, null>;
|
|
438
|
+
readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
439
|
+
readonly id: v.StringSchema<undefined>;
|
|
440
|
+
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
441
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
442
|
+
}, undefined>, undefined>, null>;
|
|
443
|
+
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
444
|
+
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
445
|
+
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
446
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
447
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
448
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
449
|
+
}, undefined>, v.ObjectSchema<{
|
|
450
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
451
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
452
|
+
readonly id: v.StringSchema<undefined>;
|
|
453
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
454
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
455
|
+
}, undefined>;
|
|
456
|
+
}, undefined>, v.ObjectSchema<{
|
|
457
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
458
|
+
readonly external: v.ObjectSchema<{
|
|
459
|
+
readonly url: v.StringSchema<undefined>;
|
|
460
|
+
}, undefined>;
|
|
461
|
+
}, undefined>, v.ObjectSchema<{
|
|
462
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
463
|
+
readonly file: v.ObjectSchema<{
|
|
464
|
+
readonly url: v.StringSchema<undefined>;
|
|
465
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
466
|
+
}, undefined>;
|
|
467
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
468
|
+
readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
469
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
470
|
+
readonly external: v.ObjectSchema<{
|
|
471
|
+
readonly url: v.StringSchema<undefined>;
|
|
472
|
+
}, undefined>;
|
|
473
|
+
}, undefined>, v.ObjectSchema<{
|
|
474
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
475
|
+
readonly file: v.ObjectSchema<{
|
|
476
|
+
readonly url: v.StringSchema<undefined>;
|
|
477
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
478
|
+
}, undefined>;
|
|
479
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
480
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
481
|
+
readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
482
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
483
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
348
484
|
}, undefined>, v.ObjectSchema<{
|
|
349
485
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
350
486
|
readonly is_archived: v.BooleanSchema<undefined>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import { legacyNotionDataSourcePageBridgeSchema
|
|
2
|
+
import { legacyNotionDataSourcePageBridgeSchema } from "../dataSources/dataSourcePage.js";
|
|
3
|
+
import { notionPageDataSchema } from "../pages/page.js";
|
|
3
4
|
// The schema accepts any string code. The type lists known codes for
|
|
4
5
|
// autocomplete, with an open string fallback for newer senders.
|
|
5
6
|
export const customBlockQueryDataSourceErrorCodeSchema = v.string();
|
|
@@ -16,7 +17,7 @@ export const queryDataSourceResultMessageSchema = v.variant("status", [
|
|
|
16
17
|
type: v.literal("queryDataSourceResult"),
|
|
17
18
|
subscriptionId: v.string(),
|
|
18
19
|
status: v.literal("success"),
|
|
19
|
-
items: v.array(
|
|
20
|
+
items: v.array(notionPageDataSchema),
|
|
20
21
|
hasMore: v.boolean(),
|
|
21
22
|
}),
|
|
22
23
|
v.object({
|
|
@@ -31,10 +32,7 @@ export const queryDataSourceResultMessageLegacySchema = v.variant("status", [
|
|
|
31
32
|
type: v.literal("queryDataSourceResult"),
|
|
32
33
|
subscriptionId: v.string(),
|
|
33
34
|
status: v.literal("success"),
|
|
34
|
-
items: v.array(v.union([
|
|
35
|
-
notionDataSourcePageBridgeSchema,
|
|
36
|
-
legacyNotionDataSourcePageBridgeSchema,
|
|
37
|
-
])),
|
|
35
|
+
items: v.array(v.union([notionPageDataSchema, legacyNotionDataSourcePageBridgeSchema])),
|
|
38
36
|
hasMore: v.boolean(),
|
|
39
37
|
}),
|
|
40
38
|
v.object({
|
|
@@ -745,6 +745,7 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
745
745
|
readonly type: v.LiteralSchema<"getPage", undefined>;
|
|
746
746
|
readonly requestId: v.StringSchema<undefined>;
|
|
747
747
|
readonly pageId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
748
|
+
readonly dataSourceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
748
749
|
}, undefined>, v.ObjectSchema<{
|
|
749
750
|
readonly type: v.LiteralSchema<"getUser", undefined>;
|
|
750
751
|
readonly requestId: v.StringSchema<undefined>;
|
|
@@ -767,6 +768,7 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
767
768
|
readonly type: v.LiteralSchema<"updatePage", undefined>;
|
|
768
769
|
readonly requestId: v.StringSchema<undefined>;
|
|
769
770
|
readonly pageId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
771
|
+
readonly dataSourceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
770
772
|
readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
771
773
|
readonly id: v.StringSchema<undefined>;
|
|
772
774
|
readonly type: v.LiteralSchema<"title", undefined>;
|
|
@@ -6,6 +6,7 @@ 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
|
+
readonly dataSourceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
9
10
|
/**
|
|
10
11
|
* Property values, keyed by raw property IDs from Notion.
|
|
11
12
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import { notionPageIdSchema } from "../ids.js";
|
|
3
|
-
import { notionPageCoverSchema, notionPageIconSchema,
|
|
2
|
+
import { notionDataSourceIdSchema, notionPageIdSchema } from "../ids.js";
|
|
3
|
+
import { notionPageCoverSchema, notionPageIconSchema, notionPagePropertyWriteMapSchema, } from "../pages/page.js";
|
|
4
4
|
/**
|
|
5
5
|
* The sandbox sends this message to patch a page.
|
|
6
6
|
*/
|
|
@@ -8,6 +8,7 @@ export const updatePageMessageSchema = v.object({
|
|
|
8
8
|
type: v.literal("updatePage"),
|
|
9
9
|
requestId: v.string(),
|
|
10
10
|
pageId: notionPageIdSchema,
|
|
11
|
+
dataSourceId: v.optional(notionDataSourceIdSchema),
|
|
11
12
|
/**
|
|
12
13
|
* Property values, keyed by raw property IDs from Notion.
|
|
13
14
|
*
|
|
@@ -15,7 +16,7 @@ export const updatePageMessageSchema = v.object({
|
|
|
15
16
|
* To update a page with manifest-defined property keys, call `row.update()` on a row returned
|
|
16
17
|
* by `useDataSource()`. The SDK resolves those keys before it sends this message.
|
|
17
18
|
*/
|
|
18
|
-
properties: v.optional(
|
|
19
|
+
properties: v.optional(notionPagePropertyWriteMapSchema),
|
|
19
20
|
icon: v.optional(notionPageIconSchema),
|
|
20
21
|
cover: v.optional(notionPageCoverSchema),
|
|
21
22
|
archived: v.optional(v.boolean()),
|