@notionhq/custom-blocks 0.3.5 → 0.5.0
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/README.md +2 -2
- package/dist/bridge/SandboxBridge.d.ts +4 -39
- package/dist/bridge/SandboxBridge.d.ts.map +1 -1
- package/dist/bridge/SandboxBridge.js +36 -142
- package/dist/bridge/requests.d.ts +35 -0
- package/dist/bridge/requests.d.ts.map +1 -0
- package/dist/bridge/requests.js +97 -0
- package/dist/dataSources/bridge/resolveDataSourceQuery.d.ts.map +1 -1
- package/dist/dataSources/bridge/resolveDataSourceQuery.js +18 -4
- package/dist/dataSources/bridge/resolveDataSources.js +4 -4
- package/dist/dataSources/createDataSourcePage.d.ts.map +1 -1
- package/dist/dataSources/createDataSourcePage.js +5 -1
- package/dist/dataSources/filters/resolveFilter.d.ts.map +1 -1
- package/dist/dataSources/filters/resolveFilter.js +13 -3
- package/dist/dataSources/filters/types.d.ts +9 -3
- package/dist/dataSources/filters/types.d.ts.map +1 -1
- package/dist/dataSources/properties/resolvePropertyAddress.js +1 -1
- package/dist/dataSources/properties/resolvePropertyWriteMapForDataSource.js +1 -1
- package/dist/dataSources/resolvePageDataSource.js +2 -2
- package/dist/dataSources/subscribeToDataSource.d.ts +1 -4
- package/dist/dataSources/subscribeToDataSource.d.ts.map +1 -1
- package/dist/dataSources/subscribeToDataSource.js +2 -3
- package/dist/dataSources/types.d.ts +2 -0
- package/dist/dataSources/types.d.ts.map +1 -1
- package/dist/files/files.d.ts +2 -0
- package/dist/files/files.d.ts.map +1 -0
- package/dist/files/files.js +1 -0
- package/dist/files/icons.d.ts +2 -0
- package/dist/files/icons.d.ts.map +1 -0
- package/dist/files/icons.js +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/initialization/getInitBindingError.js +2 -2
- package/dist/manifest/types.d.ts +5 -4
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/navigation/openExternalUrl.d.ts.map +1 -1
- package/dist/navigation/openExternalUrl.js +2 -1
- package/dist/pages/bridge/getPageForDataSource.d.ts.map +1 -1
- package/dist/pages/bridge/getPageForDataSource.js +3 -2
- package/dist/pages/bridge/sendCreatePageRequest.d.ts.map +1 -1
- package/dist/pages/bridge/sendCreatePageRequest.js +2 -1
- package/dist/pages/bridge/toNotionPageFieldsFromBridgePage.d.ts +14 -2
- package/dist/pages/bridge/toNotionPageFieldsFromBridgePage.d.ts.map +1 -1
- package/dist/pages/bridge/toNotionPageFieldsFromBridgePage.js +0 -1
- package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.d.ts.map +1 -1
- package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.js +0 -8
- package/dist/pages/bridge/updatePage.d.ts.map +1 -1
- package/dist/pages/bridge/updatePage.js +20 -5
- package/dist/pages/createPage.d.ts.map +1 -1
- package/dist/pages/createPage.js +5 -1
- package/dist/pages/openPage.d.ts.map +1 -1
- package/dist/pages/openPage.js +2 -1
- package/dist/pages/properties/getPropertyByKey.js +2 -2
- package/dist/pages/types.d.ts +10 -14
- package/dist/pages/types.d.ts.map +1 -1
- package/dist/protocol/compatibility/protocol3To10/dataSourceBindings.d.ts +530 -0
- package/dist/protocol/compatibility/protocol3To10/dataSourceBindings.js +25 -0
- package/dist/protocol/compatibility/protocol3To5/bridgePage.d.ts +12 -11
- package/dist/protocol/compatibility/protocol3To5/bridgePage.js +3 -3
- package/dist/protocol/context/containingPage.d.ts +3 -0
- package/dist/protocol/context/messages/pageChanged.d.ts +3 -0
- package/dist/protocol/context/messages/parentChanged.d.ts +3 -0
- package/dist/protocol/context/parent.d.ts +5 -0
- package/dist/protocol/context/parent.js +6 -1
- package/dist/protocol/dataSources/bridgeArchiveStatus.d.ts +3 -0
- package/dist/protocol/dataSources/bridgeArchiveStatus.js +6 -0
- package/dist/protocol/dataSources/bridgeDataSourceBinding.d.ts +3 -11
- package/dist/protocol/dataSources/bridgeDataSourceBinding.js +5 -5
- package/dist/protocol/dataSources/bridgeDataSourceBindings.d.ts +2 -10
- package/dist/protocol/dataSources/{collectionPointer.d.ts → dataSourcePointer.d.ts} +2 -2
- package/dist/protocol/dataSources/{collectionPointer.js → dataSourcePointer.js} +1 -1
- package/dist/protocol/dataSources/{collectionSchema.d.ts → dataSourceSchema.d.ts} +2 -10
- package/dist/protocol/dataSources/{collectionSchema.js → dataSourceSchema.js} +1 -1
- package/dist/protocol/dataSources/filters/bridgeDataSourceFilter.d.ts +1458 -12
- package/dist/protocol/dataSources/filters/bridgeDataSourceFilterCondition.d.ts +729 -6
- package/dist/protocol/dataSources/filters/bridgeDataSourceFilterCondition.js +14 -2
- package/dist/protocol/dataSources/filters/peopleFilterOperator.d.ts +3 -3
- package/dist/protocol/dataSources/filters/peopleFilterOperator.js +1 -1
- package/dist/protocol/dataSources/filters/timestampFilterOperator.d.ts +354 -0
- package/dist/protocol/dataSources/filters/timestampFilterOperator.js +4 -0
- package/dist/protocol/dataSources/messages/dataSourcesChanged.d.ts +2 -10
- package/dist/protocol/dataSources/messages/queryDataSource.d.ts +1485 -38
- package/dist/protocol/dataSources/messages/queryDataSource.js +2 -0
- package/dist/protocol/dataSources/notionDataSource.d.ts +3 -19
- package/dist/protocol/dataSources/notionDataSource.js +5 -5
- package/dist/protocol/dataSources/properties/propertySchema.d.ts +4 -13
- package/dist/protocol/dataSources/properties/propertySchema.js +2 -6
- package/dist/protocol/dataSources/resolveDataSourceBinding.d.ts +4 -4
- package/dist/protocol/dataSources/resolveDataSourceBinding.js +2 -2
- package/dist/protocol/files.d.ts +32 -0
- package/dist/protocol/files.js +17 -0
- package/dist/protocol/handshake/connect.d.ts +15 -4
- package/dist/protocol/handshake/init.d.ts +23 -14
- package/dist/protocol/icons.d.ts +32 -0
- package/dist/protocol/icons.js +39 -0
- package/dist/protocol/index.d.ts +25 -19
- package/dist/protocol/index.js +15 -9
- package/dist/protocol/manifest/grants.d.ts +48 -0
- package/dist/protocol/manifest/grants.js +19 -0
- package/dist/protocol/manifest/manifest.d.ts +39 -16
- package/dist/protocol/manifest/manifest.js +17 -11
- package/dist/protocol/messages/hostToSandbox.d.ts +196 -177
- package/dist/protocol/messages/invalidHostMessage.d.ts +2 -0
- package/dist/protocol/messages/invalidHostMessage.js +2 -0
- package/dist/protocol/messages/invalidSandboxMessage.d.ts +2 -0
- package/dist/protocol/messages/invalidSandboxMessage.js +2 -0
- package/dist/protocol/messages/sandboxToHost.d.ts +1571 -50
- package/dist/protocol/navigation/openExternalUrl.d.ts +2 -2
- package/dist/protocol/pages/bridgePage.d.ts +12 -12
- package/dist/protocol/pages/bridgePage.js +3 -4
- package/dist/protocol/pages/makeBridgePage.d.ts +3 -1
- package/dist/protocol/pages/messages/createPage.d.ts +645 -62
- package/dist/protocol/pages/messages/createPage.js +27 -13
- package/dist/protocol/pages/messages/getPage.d.ts +38 -37
- package/dist/protocol/pages/messages/openPage.d.ts +2 -2
- package/dist/protocol/pages/messages/updatePage.d.ts +47 -48
- package/dist/protocol/pages/messages/updatePage.js +3 -3
- package/dist/protocol/pages/pageAppearance.d.ts +9 -28
- package/dist/protocol/pages/pageAppearance.js +11 -31
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.d.ts +4 -20
- package/dist/protocol/pages/properties/bridgePagePropertyValue.d.ts +2 -10
- package/dist/protocol/pages/properties/bridgePagePropertyValue.js +2 -12
- package/dist/protocol/users/makeBridgeUser.d.ts +3 -1
- package/dist/protocol/users/messages/getUser.d.ts +2 -2
- package/dist/protocol/users/messages/listUsers.d.ts +2 -2
- package/dist/protocol/utils/errors.d.ts +6 -4
- package/dist/protocol/utils/errors.js +3 -3
- package/dist/protocol/utils/ids.d.ts +2 -0
- package/dist/protocol/utils/ids.js +1 -0
- package/dist/protocol/utils/protocolVersion.d.ts +3 -1
- package/dist/protocol/utils/protocolVersion.js +5 -1
- package/dist/protocol/utils/readRequestId.d.ts +2 -0
- package/dist/protocol/utils/readRequestId.js +7 -0
- package/dist/react/NotionCustomBlock.d.ts.map +1 -1
- package/dist/react/NotionCustomBlock.js +1 -15
- package/dist/users/getUser.d.ts.map +1 -1
- package/dist/users/getUser.js +2 -1
- package/dist/users/listUsers.d.ts.map +1 -1
- package/dist/users/listUsers.js +4 -2
- package/dist/utils/version.js +1 -1
- package/docs/data-sources.md +85 -83
- package/docs/deployment.md +4 -5
- package/docs/errors.md +47 -5
- package/docs/grants.md +127 -0
- package/docs/pages.md +105 -56
- package/docs/users.md +2 -2
- package/package.json +1 -1
- package/src/bridge/SandboxBridge.ts +44 -243
- package/src/bridge/requests.ts +138 -0
- package/src/dataSources/bridge/resolveDataSourceQuery.ts +24 -4
- package/src/dataSources/bridge/resolveDataSources.ts +4 -4
- package/src/dataSources/createDataSourcePage.ts +5 -1
- package/src/dataSources/filters/resolveFilter.ts +12 -3
- package/src/dataSources/filters/types.ts +7 -4
- package/src/dataSources/properties/resolvePropertyAddress.ts +1 -1
- package/src/dataSources/properties/resolvePropertyWriteMapForDataSource.ts +1 -1
- package/src/dataSources/resolvePageDataSource.ts +2 -2
- package/src/dataSources/subscribeToDataSource.ts +7 -19
- package/src/dataSources/types.ts +3 -0
- package/src/files/files.ts +5 -0
- package/src/files/icons.ts +9 -0
- package/src/index.ts +10 -11
- package/src/initialization/getInitBindingError.ts +2 -2
- package/src/manifest/types.ts +10 -4
- package/src/navigation/openExternalUrl.ts +5 -1
- package/src/pages/bridge/getPageForDataSource.ts +6 -2
- package/src/pages/bridge/sendCreatePageRequest.ts +5 -1
- package/src/pages/bridge/toNotionPageFieldsFromBridgePage.ts +0 -1
- package/src/pages/bridge/toNotionPagePropertyFromBridgeProperty.ts +0 -8
- package/src/pages/bridge/updatePage.ts +29 -9
- package/src/pages/createPage.ts +5 -1
- package/src/pages/openPage.ts +5 -1
- package/src/pages/properties/getPropertyByKey.ts +2 -2
- package/src/pages/types.ts +14 -16
- package/src/react/NotionCustomBlock.tsx +1 -16
- package/src/users/getUser.ts +5 -1
- package/src/users/listUsers.ts +9 -4
- package/dist/bridge/pendingRequests.d.ts +0 -14
- package/dist/bridge/pendingRequests.d.ts.map +0 -1
- package/dist/bridge/pendingRequests.js +0 -28
- package/dist/protocol/dataSources/filters/createdByFilterOperator.d.ts +0 -17
- package/dist/protocol/dataSources/filters/createdByFilterOperator.js +0 -11
- package/dist/protocol/manifest/capabilities.d.ts +0 -37
- package/dist/protocol/manifest/capabilities.js +0 -13
- package/dist/protocol/pages/properties/fileInput.d.ts +0 -16
- package/dist/protocol/pages/properties/fileInput.js +0 -16
- package/dist/react/DebugMessageLog.d.ts +0 -2
- package/dist/react/DebugMessageLog.d.ts.map +0 -1
- package/dist/react/DebugMessageLog.js +0 -23
- package/docs/capabilities.md +0 -111
- package/src/bridge/pendingRequests.ts +0 -28
- package/src/react/DebugMessageLog.tsx +0 -34
|
@@ -3,6 +3,7 @@ import { bridgePageForProtocol3To5Schema } from "../../compatibility/protocol3To
|
|
|
3
3
|
import { dataSourceParentSchema, pageParentSchema, } from "../../context/parent.js";
|
|
4
4
|
import { notionBlockIdSchema } from "../../utils/ids.js";
|
|
5
5
|
import { bridgePageSchema } from "../bridgePage.js";
|
|
6
|
+
import { bridgePageCoverSchema, bridgePageIconSchema, } from "../pageAppearance.js";
|
|
6
7
|
import { bridgePagePropertyWriteMapSchema } from "../properties/bridgePagePropertyMaps.js";
|
|
7
8
|
// The schema accepts any string code. The type lists known codes for
|
|
8
9
|
// autocomplete, with an open string fallback for newer senders.
|
|
@@ -72,13 +73,7 @@ export const createPageParentSchema = v.variant("type", [
|
|
|
72
73
|
pageParentSchema,
|
|
73
74
|
dataSourceParentSchema,
|
|
74
75
|
]);
|
|
75
|
-
|
|
76
|
-
* The sandbox sends this message to ask the host to create a page.
|
|
77
|
-
* The payload mirrors Notion's public `POST /v1/pages` API.
|
|
78
|
-
*/
|
|
79
|
-
const createPageMessageBaseSchema = {
|
|
80
|
-
type: v.literal("createPage"),
|
|
81
|
-
requestId: v.string(),
|
|
76
|
+
const createPageBaseEntries = {
|
|
82
77
|
/**
|
|
83
78
|
* Property values, keyed by raw property IDs from Notion.
|
|
84
79
|
*
|
|
@@ -87,18 +82,37 @@ const createPageMessageBaseSchema = {
|
|
|
87
82
|
* those keys before it sends this message.
|
|
88
83
|
*/
|
|
89
84
|
properties: bridgePagePropertyWriteMapSchema,
|
|
85
|
+
icon: v.optional(bridgePageIconSchema),
|
|
86
|
+
cover: v.optional(bridgePageCoverSchema),
|
|
87
|
+
};
|
|
88
|
+
const createPageUnderPageArgsSchema = v.object({
|
|
89
|
+
...createPageBaseEntries,
|
|
90
|
+
parent: pageParentSchema,
|
|
91
|
+
position: v.optional(notionCreatePagePositionSchema),
|
|
92
|
+
});
|
|
93
|
+
const createPageUnderDataSourceArgsSchema = v.object({
|
|
94
|
+
...createPageBaseEntries,
|
|
95
|
+
parent: dataSourceParentSchema,
|
|
96
|
+
position: v.optional(v.never()),
|
|
97
|
+
});
|
|
98
|
+
/** Arguments for page creation, without the message envelope. */
|
|
99
|
+
export const createPageArgsSchema = v.union([
|
|
100
|
+
createPageUnderPageArgsSchema,
|
|
101
|
+
createPageUnderDataSourceArgsSchema,
|
|
102
|
+
]);
|
|
103
|
+
const createPageMessageEntries = {
|
|
104
|
+
type: v.literal("createPage"),
|
|
105
|
+
requestId: v.string(),
|
|
90
106
|
};
|
|
91
107
|
// Use a variant so this parent-dependent union can be nested in
|
|
92
108
|
// sandboxToHostMessageSchema's type discriminator.
|
|
93
109
|
export const createPageMessageSchema = v.variant("type", [
|
|
94
110
|
v.object({
|
|
95
|
-
...
|
|
96
|
-
|
|
97
|
-
position: v.optional(notionCreatePagePositionSchema),
|
|
111
|
+
...createPageMessageEntries,
|
|
112
|
+
...createPageUnderPageArgsSchema.entries,
|
|
98
113
|
}),
|
|
99
114
|
v.object({
|
|
100
|
-
...
|
|
101
|
-
|
|
102
|
-
position: v.optional(v.never()),
|
|
115
|
+
...createPageMessageEntries,
|
|
116
|
+
...createPageUnderDataSourceArgsSchema.entries,
|
|
103
117
|
}),
|
|
104
118
|
]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode, CustomBlockRequestErrorCode } from "../../utils/errors.js";
|
|
3
3
|
export declare const customBlockGetPageErrorCodeSchema: v.StringSchema<undefined>;
|
|
4
|
-
export type CustomBlockGetPageErrorCode = CustomBlockErrorCode<"get_page_failed" | "page_unavailable" |
|
|
4
|
+
export type CustomBlockGetPageErrorCode = CustomBlockErrorCode<CustomBlockRequestErrorCode | "get_page_failed" | "page_unavailable" | CustomBlockGrantErrorCode>;
|
|
5
5
|
export type CustomBlockGetPageErrorInfo = CustomBlockErrorInfo<CustomBlockGetPageErrorCode>;
|
|
6
6
|
export declare const customBlockGetPageErrorInfoSchema: v.ObjectSchema<{
|
|
7
7
|
readonly code: v.StringSchema<undefined>;
|
|
@@ -40,6 +40,9 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
40
40
|
}, undefined>, v.ObjectSchema<{
|
|
41
41
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
42
42
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
43
|
+
}, undefined>, v.ObjectSchema<{
|
|
44
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
45
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
43
46
|
}, undefined>, v.ObjectSchema<{
|
|
44
47
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
45
48
|
}, undefined>], undefined>;
|
|
@@ -182,17 +185,17 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
182
185
|
readonly type: v.LiteralSchema<"files", undefined>;
|
|
183
186
|
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
184
187
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
185
|
-
readonly name: v.StringSchema<undefined>;
|
|
186
188
|
readonly external: v.ObjectSchema<{
|
|
187
189
|
readonly url: v.StringSchema<undefined>;
|
|
188
190
|
}, undefined>;
|
|
191
|
+
readonly name: v.StringSchema<undefined>;
|
|
189
192
|
}, undefined>, v.ObjectSchema<{
|
|
190
193
|
readonly type: v.LiteralSchema<"file", undefined>;
|
|
191
|
-
readonly name: v.StringSchema<undefined>;
|
|
192
194
|
readonly file: v.ObjectSchema<{
|
|
193
195
|
readonly url: v.StringSchema<undefined>;
|
|
194
196
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
195
197
|
}, undefined>;
|
|
198
|
+
readonly name: v.StringSchema<undefined>;
|
|
196
199
|
}, undefined>], undefined>, undefined>;
|
|
197
200
|
}, undefined>, v.ObjectSchema<{
|
|
198
201
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -229,10 +232,6 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
229
232
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
230
233
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
231
234
|
}, undefined>, undefined>;
|
|
232
|
-
}, undefined>, v.ObjectSchema<{
|
|
233
|
-
readonly id: v.StringSchema<undefined>;
|
|
234
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
235
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
236
235
|
}, undefined>, v.ObjectSchema<{
|
|
237
236
|
readonly id: v.StringSchema<undefined>;
|
|
238
237
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -245,10 +244,6 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
245
244
|
readonly id: v.StringSchema<undefined>;
|
|
246
245
|
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
247
246
|
readonly formula: v.StringSchema<undefined>;
|
|
248
|
-
}, undefined>, v.ObjectSchema<{
|
|
249
|
-
readonly id: v.StringSchema<undefined>;
|
|
250
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
251
|
-
readonly location: v.StringSchema<undefined>;
|
|
252
247
|
}, undefined>, v.ObjectSchema<{
|
|
253
248
|
readonly id: v.StringSchema<undefined>;
|
|
254
249
|
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
@@ -268,10 +263,15 @@ export declare const getPageResultMessageSchema: v.VariantSchema<"status", [v.Ob
|
|
|
268
263
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
269
264
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
270
265
|
}, undefined>, undefined>, null>;
|
|
271
|
-
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
272
266
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
273
267
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
274
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
268
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
269
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
270
|
+
readonly icon: v.LooseObjectSchema<{
|
|
271
|
+
readonly name: v.StringSchema<undefined>;
|
|
272
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
273
|
+
}, undefined>;
|
|
274
|
+
}, undefined>, v.ObjectSchema<{
|
|
275
275
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
276
276
|
readonly emoji: v.StringSchema<undefined>;
|
|
277
277
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -342,6 +342,9 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
342
342
|
}, undefined>, v.ObjectSchema<{
|
|
343
343
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
344
344
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
345
|
+
}, undefined>, v.ObjectSchema<{
|
|
346
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
347
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
345
348
|
}, undefined>, v.ObjectSchema<{
|
|
346
349
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
347
350
|
}, undefined>], undefined>;
|
|
@@ -484,17 +487,17 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
484
487
|
readonly type: v.LiteralSchema<"files", undefined>;
|
|
485
488
|
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
486
489
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
487
|
-
readonly name: v.StringSchema<undefined>;
|
|
488
490
|
readonly external: v.ObjectSchema<{
|
|
489
491
|
readonly url: v.StringSchema<undefined>;
|
|
490
492
|
}, undefined>;
|
|
493
|
+
readonly name: v.StringSchema<undefined>;
|
|
491
494
|
}, undefined>, v.ObjectSchema<{
|
|
492
495
|
readonly type: v.LiteralSchema<"file", undefined>;
|
|
493
|
-
readonly name: v.StringSchema<undefined>;
|
|
494
496
|
readonly file: v.ObjectSchema<{
|
|
495
497
|
readonly url: v.StringSchema<undefined>;
|
|
496
498
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
497
499
|
}, undefined>;
|
|
500
|
+
readonly name: v.StringSchema<undefined>;
|
|
498
501
|
}, undefined>], undefined>, undefined>;
|
|
499
502
|
}, undefined>, v.ObjectSchema<{
|
|
500
503
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -531,10 +534,6 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
531
534
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
532
535
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
533
536
|
}, undefined>, undefined>;
|
|
534
|
-
}, undefined>, v.ObjectSchema<{
|
|
535
|
-
readonly id: v.StringSchema<undefined>;
|
|
536
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
537
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
538
537
|
}, undefined>, v.ObjectSchema<{
|
|
539
538
|
readonly id: v.StringSchema<undefined>;
|
|
540
539
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -547,10 +546,6 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
547
546
|
readonly id: v.StringSchema<undefined>;
|
|
548
547
|
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
549
548
|
readonly formula: v.StringSchema<undefined>;
|
|
550
|
-
}, undefined>, v.ObjectSchema<{
|
|
551
|
-
readonly id: v.StringSchema<undefined>;
|
|
552
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
553
|
-
readonly location: v.StringSchema<undefined>;
|
|
554
549
|
}, undefined>, v.ObjectSchema<{
|
|
555
550
|
readonly id: v.StringSchema<undefined>;
|
|
556
551
|
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
@@ -570,10 +565,15 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
570
565
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
571
566
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
572
567
|
}, undefined>, undefined>, null>;
|
|
573
|
-
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
574
568
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
575
569
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
576
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
570
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
571
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
572
|
+
readonly icon: v.LooseObjectSchema<{
|
|
573
|
+
readonly name: v.StringSchema<undefined>;
|
|
574
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
575
|
+
}, undefined>;
|
|
576
|
+
}, undefined>, v.ObjectSchema<{
|
|
577
577
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
578
578
|
readonly emoji: v.StringSchema<undefined>;
|
|
579
579
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -629,6 +629,9 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
629
629
|
}, undefined>, v.ObjectSchema<{
|
|
630
630
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
631
631
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
632
|
+
}, undefined>, v.ObjectSchema<{
|
|
633
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
634
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
632
635
|
}, undefined>, v.ObjectSchema<{
|
|
633
636
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
634
637
|
}, undefined>], undefined>;
|
|
@@ -771,17 +774,17 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
771
774
|
readonly type: v.LiteralSchema<"files", undefined>;
|
|
772
775
|
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
773
776
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
774
|
-
readonly name: v.StringSchema<undefined>;
|
|
775
777
|
readonly external: v.ObjectSchema<{
|
|
776
778
|
readonly url: v.StringSchema<undefined>;
|
|
777
779
|
}, undefined>;
|
|
780
|
+
readonly name: v.StringSchema<undefined>;
|
|
778
781
|
}, undefined>, v.ObjectSchema<{
|
|
779
782
|
readonly type: v.LiteralSchema<"file", undefined>;
|
|
780
|
-
readonly name: v.StringSchema<undefined>;
|
|
781
783
|
readonly file: v.ObjectSchema<{
|
|
782
784
|
readonly url: v.StringSchema<undefined>;
|
|
783
785
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
784
786
|
}, undefined>;
|
|
787
|
+
readonly name: v.StringSchema<undefined>;
|
|
785
788
|
}, undefined>], undefined>, undefined>;
|
|
786
789
|
}, undefined>, v.ObjectSchema<{
|
|
787
790
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -818,10 +821,6 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
818
821
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
819
822
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
820
823
|
}, undefined>, undefined>;
|
|
821
|
-
}, undefined>, v.ObjectSchema<{
|
|
822
|
-
readonly id: v.StringSchema<undefined>;
|
|
823
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
824
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
825
824
|
}, undefined>, v.ObjectSchema<{
|
|
826
825
|
readonly id: v.StringSchema<undefined>;
|
|
827
826
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -834,10 +833,6 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
834
833
|
readonly id: v.StringSchema<undefined>;
|
|
835
834
|
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
836
835
|
readonly formula: v.StringSchema<undefined>;
|
|
837
|
-
}, undefined>, v.ObjectSchema<{
|
|
838
|
-
readonly id: v.StringSchema<undefined>;
|
|
839
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
840
|
-
readonly location: v.StringSchema<undefined>;
|
|
841
836
|
}, undefined>, v.ObjectSchema<{
|
|
842
837
|
readonly id: v.StringSchema<undefined>;
|
|
843
838
|
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
@@ -849,7 +844,13 @@ export declare const getPageResultMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
849
844
|
}, undefined>], undefined>, undefined>;
|
|
850
845
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
851
846
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
852
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
847
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
848
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
849
|
+
readonly icon: v.LooseObjectSchema<{
|
|
850
|
+
readonly name: v.StringSchema<undefined>;
|
|
851
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
852
|
+
}, undefined>;
|
|
853
|
+
}, undefined>, v.ObjectSchema<{
|
|
853
854
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
854
855
|
readonly emoji: v.StringSchema<undefined>;
|
|
855
856
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode, CustomBlockRequestErrorCode } from "../../utils/errors.js";
|
|
3
3
|
export declare const openPageModeSchema: v.PicklistSchema<["side_peek", "center_peek"], undefined>;
|
|
4
4
|
export type OpenPageMode = v.InferOutput<typeof openPageModeSchema>;
|
|
5
5
|
export declare const customBlockOpenPageErrorCodeSchema: v.StringSchema<undefined>;
|
|
6
|
-
export type CustomBlockOpenPageErrorCode = CustomBlockErrorCode<"open_page_failed" | "page_unavailable" | "navigation_unavailable" |
|
|
6
|
+
export type CustomBlockOpenPageErrorCode = CustomBlockErrorCode<CustomBlockRequestErrorCode | "open_page_failed" | "page_unavailable" | "navigation_unavailable" | CustomBlockGrantErrorCode>;
|
|
7
7
|
export type CustomBlockOpenPageErrorInfo = CustomBlockErrorInfo<CustomBlockOpenPageErrorCode>;
|
|
8
8
|
export declare const customBlockOpenPageErrorInfoSchema: v.ObjectSchema<{
|
|
9
9
|
readonly code: v.StringSchema<undefined>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode, CustomBlockRequestErrorCode } from "../../utils/errors.js";
|
|
3
3
|
export declare const customBlockUpdatePageErrorCodeSchema: v.StringSchema<undefined>;
|
|
4
|
-
export type CustomBlockUpdatePageErrorCode = CustomBlockErrorCode<"update_page_failed" | "invalid_page_update" | "page_unavailable" | "data_source_access_failed" | "unmapped_property" | "property_id_mismatch" | "duplicate_property" | "invalid_property_value" |
|
|
4
|
+
export type CustomBlockUpdatePageErrorCode = CustomBlockErrorCode<CustomBlockRequestErrorCode | "update_page_failed" | "previous_write_incomplete" | "invalid_page_update" | "invalid_icon_name" | "invalid_icon_color" | "page_unavailable" | "data_source_access_failed" | "unmapped_property" | "property_id_mismatch" | "duplicate_property" | "invalid_property_value" | CustomBlockGrantErrorCode>;
|
|
5
5
|
export type CustomBlockUpdatePageErrorInfo = CustomBlockErrorInfo<CustomBlockUpdatePageErrorCode>;
|
|
6
6
|
export declare const customBlockUpdatePageErrorInfoSchema: v.ObjectSchema<{
|
|
7
7
|
readonly code: v.StringSchema<undefined>;
|
|
@@ -33,6 +33,9 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
33
33
|
}, undefined>, v.ObjectSchema<{
|
|
34
34
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
35
35
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
36
|
+
}, undefined>, v.ObjectSchema<{
|
|
37
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
38
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
36
39
|
}, undefined>, v.ObjectSchema<{
|
|
37
40
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
38
41
|
}, undefined>], undefined>;
|
|
@@ -175,17 +178,17 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
175
178
|
readonly type: v.LiteralSchema<"files", undefined>;
|
|
176
179
|
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
177
180
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
178
|
-
readonly name: v.StringSchema<undefined>;
|
|
179
181
|
readonly external: v.ObjectSchema<{
|
|
180
182
|
readonly url: v.StringSchema<undefined>;
|
|
181
183
|
}, undefined>;
|
|
184
|
+
readonly name: v.StringSchema<undefined>;
|
|
182
185
|
}, undefined>, v.ObjectSchema<{
|
|
183
186
|
readonly type: v.LiteralSchema<"file", undefined>;
|
|
184
|
-
readonly name: v.StringSchema<undefined>;
|
|
185
187
|
readonly file: v.ObjectSchema<{
|
|
186
188
|
readonly url: v.StringSchema<undefined>;
|
|
187
189
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
188
190
|
}, undefined>;
|
|
191
|
+
readonly name: v.StringSchema<undefined>;
|
|
189
192
|
}, undefined>], undefined>, undefined>;
|
|
190
193
|
}, undefined>, v.ObjectSchema<{
|
|
191
194
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -222,10 +225,6 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
222
225
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
223
226
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
224
227
|
}, undefined>, undefined>;
|
|
225
|
-
}, undefined>, v.ObjectSchema<{
|
|
226
|
-
readonly id: v.StringSchema<undefined>;
|
|
227
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
228
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
229
228
|
}, undefined>, v.ObjectSchema<{
|
|
230
229
|
readonly id: v.StringSchema<undefined>;
|
|
231
230
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -238,10 +237,6 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
238
237
|
readonly id: v.StringSchema<undefined>;
|
|
239
238
|
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
240
239
|
readonly formula: v.StringSchema<undefined>;
|
|
241
|
-
}, undefined>, v.ObjectSchema<{
|
|
242
|
-
readonly id: v.StringSchema<undefined>;
|
|
243
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
244
|
-
readonly location: v.StringSchema<undefined>;
|
|
245
240
|
}, undefined>, v.ObjectSchema<{
|
|
246
241
|
readonly id: v.StringSchema<undefined>;
|
|
247
242
|
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
@@ -261,10 +256,15 @@ export declare const updatePageResultMessageSchema: v.VariantSchema<"status", [v
|
|
|
261
256
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
262
257
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
263
258
|
}, undefined>, undefined>, null>;
|
|
264
|
-
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
265
259
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
266
260
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
267
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
261
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
262
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
263
|
+
readonly icon: v.LooseObjectSchema<{
|
|
264
|
+
readonly name: v.StringSchema<undefined>;
|
|
265
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
266
|
+
}, undefined>;
|
|
267
|
+
}, undefined>, v.ObjectSchema<{
|
|
268
268
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
269
269
|
readonly emoji: v.StringSchema<undefined>;
|
|
270
270
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -335,6 +335,9 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
335
335
|
}, undefined>, v.ObjectSchema<{
|
|
336
336
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
337
337
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
338
|
+
}, undefined>, v.ObjectSchema<{
|
|
339
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
340
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
338
341
|
}, undefined>, v.ObjectSchema<{
|
|
339
342
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
340
343
|
}, undefined>], undefined>;
|
|
@@ -477,17 +480,17 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
477
480
|
readonly type: v.LiteralSchema<"files", undefined>;
|
|
478
481
|
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
479
482
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
480
|
-
readonly name: v.StringSchema<undefined>;
|
|
481
483
|
readonly external: v.ObjectSchema<{
|
|
482
484
|
readonly url: v.StringSchema<undefined>;
|
|
483
485
|
}, undefined>;
|
|
486
|
+
readonly name: v.StringSchema<undefined>;
|
|
484
487
|
}, undefined>, v.ObjectSchema<{
|
|
485
488
|
readonly type: v.LiteralSchema<"file", undefined>;
|
|
486
|
-
readonly name: v.StringSchema<undefined>;
|
|
487
489
|
readonly file: v.ObjectSchema<{
|
|
488
490
|
readonly url: v.StringSchema<undefined>;
|
|
489
491
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
490
492
|
}, undefined>;
|
|
493
|
+
readonly name: v.StringSchema<undefined>;
|
|
491
494
|
}, undefined>], undefined>, undefined>;
|
|
492
495
|
}, undefined>, v.ObjectSchema<{
|
|
493
496
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -524,10 +527,6 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
524
527
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
525
528
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
526
529
|
}, undefined>, undefined>;
|
|
527
|
-
}, undefined>, v.ObjectSchema<{
|
|
528
|
-
readonly id: v.StringSchema<undefined>;
|
|
529
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
530
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
531
530
|
}, undefined>, v.ObjectSchema<{
|
|
532
531
|
readonly id: v.StringSchema<undefined>;
|
|
533
532
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -540,10 +539,6 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
540
539
|
readonly id: v.StringSchema<undefined>;
|
|
541
540
|
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
542
541
|
readonly formula: v.StringSchema<undefined>;
|
|
543
|
-
}, undefined>, v.ObjectSchema<{
|
|
544
|
-
readonly id: v.StringSchema<undefined>;
|
|
545
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
546
|
-
readonly location: v.StringSchema<undefined>;
|
|
547
542
|
}, undefined>, v.ObjectSchema<{
|
|
548
543
|
readonly id: v.StringSchema<undefined>;
|
|
549
544
|
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
@@ -563,10 +558,15 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
563
558
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
564
559
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
565
560
|
}, undefined>, undefined>, null>;
|
|
566
|
-
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
567
561
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
568
562
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
569
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
563
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
564
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
565
|
+
readonly icon: v.LooseObjectSchema<{
|
|
566
|
+
readonly name: v.StringSchema<undefined>;
|
|
567
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
568
|
+
}, undefined>;
|
|
569
|
+
}, undefined>, v.ObjectSchema<{
|
|
570
570
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
571
571
|
readonly emoji: v.StringSchema<undefined>;
|
|
572
572
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -622,6 +622,9 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
622
622
|
}, undefined>, v.ObjectSchema<{
|
|
623
623
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
624
624
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
625
|
+
}, undefined>, v.ObjectSchema<{
|
|
626
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
627
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
625
628
|
}, undefined>, v.ObjectSchema<{
|
|
626
629
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
627
630
|
}, undefined>], undefined>;
|
|
@@ -764,17 +767,17 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
764
767
|
readonly type: v.LiteralSchema<"files", undefined>;
|
|
765
768
|
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
766
769
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
767
|
-
readonly name: v.StringSchema<undefined>;
|
|
768
770
|
readonly external: v.ObjectSchema<{
|
|
769
771
|
readonly url: v.StringSchema<undefined>;
|
|
770
772
|
}, undefined>;
|
|
773
|
+
readonly name: v.StringSchema<undefined>;
|
|
771
774
|
}, undefined>, v.ObjectSchema<{
|
|
772
775
|
readonly type: v.LiteralSchema<"file", undefined>;
|
|
773
|
-
readonly name: v.StringSchema<undefined>;
|
|
774
776
|
readonly file: v.ObjectSchema<{
|
|
775
777
|
readonly url: v.StringSchema<undefined>;
|
|
776
778
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
777
779
|
}, undefined>;
|
|
780
|
+
readonly name: v.StringSchema<undefined>;
|
|
778
781
|
}, undefined>], undefined>, undefined>;
|
|
779
782
|
}, undefined>, v.ObjectSchema<{
|
|
780
783
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -811,10 +814,6 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
811
814
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
812
815
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
813
816
|
}, undefined>, undefined>;
|
|
814
|
-
}, undefined>, v.ObjectSchema<{
|
|
815
|
-
readonly id: v.StringSchema<undefined>;
|
|
816
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
817
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
818
817
|
}, undefined>, v.ObjectSchema<{
|
|
819
818
|
readonly id: v.StringSchema<undefined>;
|
|
820
819
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -827,10 +826,6 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
827
826
|
readonly id: v.StringSchema<undefined>;
|
|
828
827
|
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
829
828
|
readonly formula: v.StringSchema<undefined>;
|
|
830
|
-
}, undefined>, v.ObjectSchema<{
|
|
831
|
-
readonly id: v.StringSchema<undefined>;
|
|
832
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
833
|
-
readonly location: v.StringSchema<undefined>;
|
|
834
829
|
}, undefined>, v.ObjectSchema<{
|
|
835
830
|
readonly id: v.StringSchema<undefined>;
|
|
836
831
|
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
@@ -842,7 +837,13 @@ export declare const updatePageResultMessageWithProtocol3To5CompatibilitySchema:
|
|
|
842
837
|
}, undefined>], undefined>, undefined>;
|
|
843
838
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
844
839
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
845
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
840
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
841
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
842
|
+
readonly icon: v.LooseObjectSchema<{
|
|
843
|
+
readonly name: v.StringSchema<undefined>;
|
|
844
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
845
|
+
}, undefined>;
|
|
846
|
+
}, undefined>, v.ObjectSchema<{
|
|
846
847
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
847
848
|
readonly emoji: v.StringSchema<undefined>;
|
|
848
849
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1047,17 +1048,17 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
|
|
|
1047
1048
|
readonly type: v.LiteralSchema<"files", undefined>;
|
|
1048
1049
|
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
1049
1050
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
1050
|
-
readonly name: v.StringSchema<undefined>;
|
|
1051
1051
|
readonly external: v.ObjectSchema<{
|
|
1052
1052
|
readonly url: v.StringSchema<undefined>;
|
|
1053
1053
|
}, undefined>;
|
|
1054
|
+
readonly name: v.StringSchema<undefined>;
|
|
1054
1055
|
}, undefined>, v.ObjectSchema<{
|
|
1055
1056
|
readonly type: v.LiteralSchema<"file", undefined>;
|
|
1056
|
-
readonly name: v.StringSchema<undefined>;
|
|
1057
1057
|
readonly file: v.ObjectSchema<{
|
|
1058
1058
|
readonly url: v.StringSchema<undefined>;
|
|
1059
1059
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1060
1060
|
}, undefined>;
|
|
1061
|
+
readonly name: v.StringSchema<undefined>;
|
|
1061
1062
|
}, undefined>], undefined>, undefined>;
|
|
1062
1063
|
}, undefined>, v.ObjectSchema<{
|
|
1063
1064
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -1094,10 +1095,6 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
|
|
|
1094
1095
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
1095
1096
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1096
1097
|
}, undefined>, undefined>;
|
|
1097
|
-
}, undefined>, v.ObjectSchema<{
|
|
1098
|
-
readonly id: v.StringSchema<undefined>;
|
|
1099
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
1100
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1101
1098
|
}, undefined>, v.ObjectSchema<{
|
|
1102
1099
|
readonly id: v.StringSchema<undefined>;
|
|
1103
1100
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -1110,10 +1107,6 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
|
|
|
1110
1107
|
readonly id: v.StringSchema<undefined>;
|
|
1111
1108
|
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
1112
1109
|
readonly formula: v.StringSchema<undefined>;
|
|
1113
|
-
}, undefined>, v.ObjectSchema<{
|
|
1114
|
-
readonly id: v.StringSchema<undefined>;
|
|
1115
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
1116
|
-
readonly location: v.StringSchema<undefined>;
|
|
1117
1110
|
}, undefined>, v.ObjectSchema<{
|
|
1118
1111
|
readonly id: v.StringSchema<undefined>;
|
|
1119
1112
|
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
@@ -1123,7 +1116,13 @@ export declare const updatePageMessageSchema: v.ObjectSchema<{
|
|
|
1123
1116
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
1124
1117
|
readonly verification: v.StringSchema<undefined>;
|
|
1125
1118
|
}, undefined>], undefined>, undefined>, undefined>;
|
|
1126
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
1119
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1120
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1121
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1122
|
+
readonly name: v.StringSchema<undefined>;
|
|
1123
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
1124
|
+
}, undefined>;
|
|
1125
|
+
}, undefined>, v.ObjectSchema<{
|
|
1127
1126
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1128
1127
|
readonly emoji: v.StringSchema<undefined>;
|
|
1129
1128
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -2,7 +2,7 @@ import * as v from "valibot";
|
|
|
2
2
|
import { bridgePageForProtocol3To5Schema } from "../../compatibility/protocol3To5/bridgePage.js";
|
|
3
3
|
import { notionDataSourceIdSchema, notionPageIdSchema, } from "../../utils/ids.js";
|
|
4
4
|
import { bridgePageSchema } from "../bridgePage.js";
|
|
5
|
-
import {
|
|
5
|
+
import { bridgePageCoverSchema, bridgePageIconSchema, } from "../pageAppearance.js";
|
|
6
6
|
import { bridgePagePropertyWriteMapSchema } from "../properties/bridgePagePropertyMaps.js";
|
|
7
7
|
// The schema accepts any string code. The type lists known codes for
|
|
8
8
|
// autocomplete, with an open string fallback for newer senders.
|
|
@@ -59,7 +59,7 @@ export const updatePageMessageSchema = v.object({
|
|
|
59
59
|
* by `useDataSource()`. The SDK resolves those keys before it sends this message.
|
|
60
60
|
*/
|
|
61
61
|
properties: v.optional(bridgePagePropertyWriteMapSchema),
|
|
62
|
-
icon: v.optional(
|
|
63
|
-
cover: v.optional(
|
|
62
|
+
icon: v.optional(bridgePageIconSchema),
|
|
63
|
+
cover: v.optional(bridgePageCoverSchema),
|
|
64
64
|
archived: v.optional(v.boolean()),
|
|
65
65
|
});
|
|
@@ -1,30 +1,11 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
export declare const
|
|
3
|
-
readonly type: v.LiteralSchema<"
|
|
4
|
-
readonly
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
8
|
-
readonly custom_emoji: v.ObjectSchema<{
|
|
9
|
-
readonly id: v.StringSchema<undefined>;
|
|
10
|
-
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
-
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2
|
+
export declare const bridgePageIconSchema: v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
3
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
4
|
+
readonly icon: v.LooseObjectSchema<{
|
|
5
|
+
readonly name: v.StringSchema<undefined>;
|
|
6
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").BridgeIconColor>, undefined>;
|
|
12
7
|
}, undefined>;
|
|
13
|
-
}, undefined
|
|
14
|
-
export declare const notionExternalFileSchema: v.ObjectSchema<{
|
|
15
|
-
readonly type: v.LiteralSchema<"external", undefined>;
|
|
16
|
-
readonly external: v.ObjectSchema<{
|
|
17
|
-
readonly url: v.StringSchema<undefined>;
|
|
18
|
-
}, undefined>;
|
|
19
|
-
}, undefined>;
|
|
20
|
-
export declare const notionHostedFileSchema: v.ObjectSchema<{
|
|
21
|
-
readonly type: v.LiteralSchema<"file", undefined>;
|
|
22
|
-
readonly file: v.ObjectSchema<{
|
|
23
|
-
readonly url: v.StringSchema<undefined>;
|
|
24
|
-
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
-
}, undefined>;
|
|
26
|
-
}, undefined>;
|
|
27
|
-
export declare const notionPageIconSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
8
|
+
}, undefined>, v.ObjectSchema<{
|
|
28
9
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
29
10
|
readonly emoji: v.StringSchema<undefined>;
|
|
30
11
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -46,8 +27,8 @@ export declare const notionPageIconSchema: v.VariantSchema<"type", [v.ObjectSche
|
|
|
46
27
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
47
28
|
}, undefined>;
|
|
48
29
|
}, undefined>], undefined>;
|
|
49
|
-
export type
|
|
50
|
-
export declare const
|
|
30
|
+
export type BridgePageIcon = v.InferOutput<typeof bridgePageIconSchema>;
|
|
31
|
+
export declare const bridgePageCoverSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
51
32
|
readonly type: v.LiteralSchema<"external", undefined>;
|
|
52
33
|
readonly external: v.ObjectSchema<{
|
|
53
34
|
readonly url: v.StringSchema<undefined>;
|
|
@@ -59,4 +40,4 @@ export declare const notionPageCoverSchema: v.VariantSchema<"type", [v.ObjectSch
|
|
|
59
40
|
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
60
41
|
}, undefined>;
|
|
61
42
|
}, undefined>], undefined>;
|
|
62
|
-
export type
|
|
43
|
+
export type BridgePageCover = v.InferOutput<typeof bridgePageCoverSchema>;
|