@notionhq/custom-blocks 0.6.0 → 0.7.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 +32 -18
- package/dist/bridge/SandboxBridge.d.ts +7 -8
- package/dist/bridge/SandboxBridge.d.ts.map +1 -1
- package/dist/bridge/SandboxBridge.js +39 -114
- package/dist/bridge/applyHostStateMessage.d.ts.map +1 -1
- package/dist/bridge/createBrowserSandboxBridge.d.ts +3 -0
- package/dist/bridge/createBrowserSandboxBridge.d.ts.map +1 -0
- package/dist/bridge/createBrowserSandboxBridge.js +54 -0
- package/dist/bridge/getBridge.d.ts +1 -1
- package/dist/bridge/getBridge.d.ts.map +1 -1
- package/dist/bridge/getBridge.js +2 -2
- package/dist/bridge/getInitializedHostState.d.ts.map +1 -1
- package/dist/bridge/hostState.d.ts +2 -2
- package/dist/bridge/hostState.d.ts.map +1 -1
- package/dist/bridge/initialization/SandboxInitialization.d.ts +6 -0
- package/dist/bridge/initialization/SandboxInitialization.d.ts.map +1 -1
- package/dist/bridge/initialization/SandboxInitialization.js +13 -10
- package/dist/bridge/messageInterceptor.d.ts.map +1 -1
- package/dist/bridge/requests.d.ts.map +1 -1
- package/dist/bridge/sandboxEnvironment.d.ts +30 -0
- package/dist/bridge/sandboxEnvironment.d.ts.map +1 -0
- package/dist/bridge/sandboxEnvironment.js +1 -0
- package/dist/bridge/subscribeToHostStateField.d.ts.map +1 -1
- package/dist/bridge.d.ts.map +1 -1
- package/dist/data-sources.d.ts.map +1 -1
- package/dist/dataSources/NotionDataSource.d.ts.map +1 -1
- package/dist/dataSources/bridge/DataSourceCache.d.ts +18 -0
- package/dist/dataSources/bridge/DataSourceCache.d.ts.map +1 -0
- package/dist/dataSources/bridge/DataSourceCache.js +75 -0
- package/dist/dataSources/bridge/applyDataSourceBindings.d.ts.map +1 -1
- package/dist/dataSources/bridge/makeDataSourceReadResponseSchema.d.ts.map +1 -1
- package/dist/dataSources/bridge/resolveDataSourceQuery.d.ts.map +1 -1
- package/dist/dataSources/bridge/resolveDataSources.d.ts.map +1 -1
- package/dist/dataSources/bridge/resolveSorts.d.ts.map +1 -1
- package/dist/dataSources/bridge/reuseDataSourcesForUnchangedBindings.d.ts +0 -3
- package/dist/dataSources/bridge/reuseDataSourcesForUnchangedBindings.d.ts.map +1 -1
- package/dist/dataSources/bridge/reuseDataSourcesForUnchangedBindings.js +2 -5
- package/dist/dataSources/dataSourceInaccessibleError.d.ts.map +1 -1
- package/dist/dataSources/dataSourceState.d.ts.map +1 -1
- package/dist/dataSources/ensureDataSource.d.ts.map +1 -1
- package/dist/dataSources/filters/resolveFilter.d.ts.map +1 -1
- package/dist/dataSources/filters/types.d.ts.map +1 -1
- package/dist/dataSources/getDataSourcePage.d.ts.map +1 -1
- package/dist/dataSources/observeDataSource.d.ts.map +1 -1
- package/dist/dataSources/properties/resolvePropertyAddress.d.ts.map +1 -1
- package/dist/dataSources/properties/resolvePropertyWriteMapForDataSource.d.ts.map +1 -1
- package/dist/dataSources/properties/resolvePropertyWriteMapForDataSource.js +2 -2
- package/dist/dataSources/resolvePageDataSource.d.ts.map +1 -1
- package/dist/dataSources/subscribeToDataSource.d.ts.map +1 -1
- package/dist/dataSources/types.d.ts.map +1 -1
- package/dist/files/files.d.ts +1 -1
- package/dist/files/files.d.ts.map +1 -1
- package/dist/files/icons.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/initialization/NotInIframeError.d.ts.map +1 -1
- package/dist/initialization/initCustomBlock.d.ts.map +1 -1
- package/dist/initialization/notifyReady.d.ts.map +1 -1
- package/dist/initialization/react/useCustomBlockInit.d.ts.map +1 -1
- package/dist/initialization/resolveInitialState.d.ts.map +1 -1
- package/dist/initialization/types.d.ts.map +1 -1
- package/dist/layout/autoResize.d.ts.map +1 -1
- package/dist/layout/getInitialContentHeight.d.ts.map +1 -1
- package/dist/location/getContainingPage.d.ts.map +1 -1
- package/dist/location/getInstance.d.ts.map +1 -1
- package/dist/location/getParent.d.ts.map +1 -1
- package/dist/location/mapContainingPage.d.ts +2 -2
- package/dist/location/mapContainingPage.d.ts.map +1 -1
- package/dist/location/mapParent.d.ts.map +1 -1
- package/dist/location/subscribeToContainingPage.d.ts.map +1 -1
- package/dist/location/subscribeToParent.d.ts.map +1 -1
- package/dist/location/types.d.ts.map +1 -1
- package/dist/manifest/getManifest.d.ts.map +1 -1
- package/dist/manifest/readLocalManifest.d.ts.map +1 -1
- package/dist/manifest/types.d.ts.map +1 -1
- package/dist/navigation/openExternalUrl.d.ts.map +1 -1
- package/dist/navigation/types.d.ts.map +1 -1
- package/dist/navigation.d.ts.map +1 -1
- package/dist/pages/NotionPage.d.ts.map +1 -1
- package/dist/pages/bridge/buildCreatePageRequest.d.ts.map +1 -1
- package/dist/pages/bridge/getPageForDataSource.d.ts.map +1 -1
- package/dist/pages/bridge/resolveCreatePageDestination.d.ts.map +1 -1
- package/dist/pages/bridge/sendCreatePageRequest.d.ts.map +1 -1
- package/dist/pages/bridge/toNotionPageFromBridgePage.d.ts.map +1 -1
- package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.d.ts +2 -2
- package/dist/pages/bridge/toNotionPagePropertyFromBridgeProperty.d.ts.map +1 -1
- package/dist/pages/bridge/updatePage.d.ts.map +1 -1
- package/dist/pages/createPage.d.ts.map +1 -1
- package/dist/pages/getPage.d.ts.map +1 -1
- package/dist/pages/identityBlockKey.d.ts.map +1 -1
- package/dist/pages/identityPageKey.d.ts.map +1 -1
- package/dist/pages/openPage.d.ts.map +1 -1
- package/dist/pages/parent.d.ts.map +1 -1
- package/dist/pages/types.d.ts +5 -3
- package/dist/pages/types.d.ts.map +1 -1
- package/dist/pages.d.ts.map +1 -1
- package/dist/preferences/backgroundColors.d.ts.map +1 -1
- package/dist/preferences/getContrastMode.d.ts.map +1 -1
- package/dist/preferences/getTheme.d.ts.map +1 -1
- package/dist/preferences/react/useContrastMode.d.ts.map +1 -1
- package/dist/preferences/react/useTheme.d.ts.map +1 -1
- package/dist/preferences/subscribeToContrastMode.d.ts.map +1 -1
- package/dist/preferences/subscribeToTheme.d.ts.map +1 -1
- package/dist/preferences/syncDocumentAppearance.d.ts +1 -1
- package/dist/preferences/syncDocumentAppearance.d.ts.map +1 -1
- package/dist/preferences/syncDocumentAppearance.js +2 -1
- package/dist/preferences.d.ts.map +1 -1
- package/dist/protocol/compatibility/protocol12/hostToSandbox.d.ts +3356 -0
- package/dist/protocol/compatibility/protocol12/hostToSandbox.js +38 -0
- package/dist/protocol/compatibility/protocol12/page.d.ts +296 -0
- package/dist/protocol/compatibility/protocol12/page.js +7 -0
- package/dist/protocol/context/containingPage.d.ts +4 -2
- package/dist/protocol/context/containingPage.js +1 -1
- package/dist/protocol/context/messages/pageChanged.js +2 -2
- package/dist/protocol/dataSources/areDataSourceBindingsEqual.d.ts +3 -0
- package/dist/protocol/dataSources/areDataSourceBindingsEqual.js +26 -0
- package/dist/protocol/dataSources/messages/queryDataSource.d.ts +24 -19
- package/dist/protocol/dataSources/messages/queryDataSource.js +2 -0
- package/dist/protocol/files.d.ts +18 -0
- package/dist/protocol/files.js +9 -0
- package/dist/protocol/messages/hostToSandbox.d.ts +2200 -68
- package/dist/protocol/messages/hostToSandbox.js +6 -2
- package/dist/protocol/messages/sandboxToHost.d.ts +51 -51
- package/dist/protocol/pages/bridgePage.d.ts +20 -17
- package/dist/protocol/pages/messages/createPage.d.ts +88 -85
- package/dist/protocol/pages/messages/getPage.d.ts +24 -19
- package/dist/protocol/pages/messages/getPage.js +2 -0
- package/dist/protocol/pages/messages/updatePage.d.ts +37 -34
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.d.ts +37 -34
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.js +3 -3
- package/dist/protocol/pages/properties/bridgePagePropertyValue.d.ts +236 -2
- package/dist/protocol/pages/properties/bridgePagePropertyValue.js +20 -7
- package/dist/protocol/utils/errors.d.ts +6 -0
- package/dist/protocol/utils/errors.js +8 -0
- package/dist/protocol/utils/protocolVersion.d.ts +4 -2
- package/dist/protocol/utils/protocolVersion.js +4 -2
- package/dist/react/InitializationErrorDetails.d.ts.map +1 -1
- package/dist/react/MissingHostCommand.d.ts.map +1 -1
- package/dist/react/MissingHostScreen.d.ts.map +1 -1
- package/dist/react/NotionCustomBlock.d.ts.map +1 -1
- package/dist/react/index.d.ts +0 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +0 -1
- package/dist/react/useAsyncRead.d.ts.map +1 -1
- package/dist/react/useContainingPage.d.ts.map +1 -1
- package/dist/react/useLiveLocationRead.d.ts.map +1 -1
- package/dist/react/usePage.d.ts.map +1 -1
- package/dist/react/useParent.d.ts.map +1 -1
- package/dist/react/useQuerySubscription.d.ts.map +1 -1
- package/dist/react/useUserFields.d.ts.map +1 -1
- package/dist/react/useViewer.d.ts.map +1 -1
- package/dist/styles/scrollbars.css +18 -0
- package/dist/users/NotionUser.d.ts.map +1 -1
- package/dist/users/bridge/toNotionUserDataFromBridgeUser.d.ts.map +1 -1
- package/dist/users/getUser.d.ts.map +1 -1
- package/dist/users/getViewer.d.ts.map +1 -1
- package/dist/users/listUsers.d.ts.map +1 -1
- package/dist/users/types.d.ts.map +1 -1
- package/dist/users.d.ts.map +1 -1
- package/dist/utils/makeUuid.d.ts.map +1 -1
- package/dist/utils/notifyListener.d.ts.map +1 -1
- package/dist/utils/typeUtils.d.ts.map +1 -1
- package/dist/utils/unreachable.d.ts.map +1 -1
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +1 -1
- package/docs/block-location.md +22 -9
- package/docs/deployment.md +5 -11
- package/docs/errors.md +4 -0
- package/docs/grants.md +7 -2
- package/docs/local-development.md +39 -0
- package/docs/pages.md +97 -62
- package/package.json +2 -1
- package/src/bridge/SandboxBridge.ts +49 -144
- package/src/bridge/createBrowserSandboxBridge.ts +64 -0
- package/src/bridge/getBridge.ts +3 -2
- package/src/bridge/hostState.ts +2 -2
- package/src/bridge/initialization/SandboxInitialization.ts +24 -10
- package/src/bridge/sandboxEnvironment.ts +38 -0
- package/src/dataSources/bridge/DataSourceCache.ts +94 -0
- package/src/dataSources/bridge/reuseDataSourcesForUnchangedBindings.ts +5 -5
- package/src/dataSources/properties/resolvePropertyWriteMapForDataSource.ts +2 -2
- package/src/files/files.ts +1 -1
- package/src/location/mapContainingPage.ts +2 -2
- package/src/pages/bridge/toNotionPagePropertyFromBridgeProperty.ts +2 -2
- package/src/pages/types.ts +9 -3
- package/src/preferences/syncDocumentAppearance.ts +2 -1
- package/src/react/index.ts +0 -2
- package/src/styles/scrollbars.css +18 -0
- package/dist/react/NotionTokenScope.d.ts +0 -10
- package/dist/react/NotionTokenScope.d.ts.map +0 -1
- package/dist/react/NotionTokenScope.js +0 -12
- package/src/react/NotionTokenScope.tsx +0 -26
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { queryDataSourceResultMessageSchema } from "../../dataSources/messages/queryDataSource.js";
|
|
3
|
+
import { commonHostToSandboxSchemas } from "../../messages/hostToSandbox.js";
|
|
4
|
+
import { createPageResultMessageSchema } from "../../pages/messages/createPage.js";
|
|
5
|
+
import { getPageResultMessageSchema } from "../../pages/messages/getPage.js";
|
|
6
|
+
import { updatePageResultMessageSchema } from "../../pages/messages/updatePage.js";
|
|
7
|
+
import { bridgePageForProtocol12Schema } from "./page.js";
|
|
8
|
+
export const hostToSandboxMessageForProtocol12Schema = v.variant("type", [
|
|
9
|
+
...commonHostToSandboxSchemas,
|
|
10
|
+
v.variant("status", [
|
|
11
|
+
v.object({
|
|
12
|
+
...queryDataSourceResultMessageSchema.options[0].entries,
|
|
13
|
+
items: v.array(bridgePageForProtocol12Schema),
|
|
14
|
+
}),
|
|
15
|
+
queryDataSourceResultMessageSchema.options[1],
|
|
16
|
+
]),
|
|
17
|
+
v.variant("status", [
|
|
18
|
+
v.object({
|
|
19
|
+
...getPageResultMessageSchema.options[0].entries,
|
|
20
|
+
page: bridgePageForProtocol12Schema,
|
|
21
|
+
}),
|
|
22
|
+
getPageResultMessageSchema.options[1],
|
|
23
|
+
]),
|
|
24
|
+
v.variant("status", [
|
|
25
|
+
v.object({
|
|
26
|
+
...createPageResultMessageSchema.options[0].entries,
|
|
27
|
+
page: bridgePageForProtocol12Schema,
|
|
28
|
+
}),
|
|
29
|
+
createPageResultMessageSchema.options[1],
|
|
30
|
+
]),
|
|
31
|
+
v.variant("status", [
|
|
32
|
+
v.object({
|
|
33
|
+
...updatePageResultMessageSchema.options[0].entries,
|
|
34
|
+
page: bridgePageForProtocol12Schema,
|
|
35
|
+
}),
|
|
36
|
+
updatePageResultMessageSchema.options[1],
|
|
37
|
+
]),
|
|
38
|
+
]);
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare const bridgePageForProtocol12Schema: v.ObjectSchema<{
|
|
3
|
+
readonly object: v.LiteralSchema<"page", undefined>;
|
|
4
|
+
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
5
|
+
readonly parent: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
6
|
+
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
7
|
+
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
8
|
+
}, undefined>, v.ObjectSchema<{
|
|
9
|
+
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
10
|
+
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
11
|
+
}, undefined>, v.ObjectSchema<{
|
|
12
|
+
readonly type: v.LiteralSchema<"workspace", undefined>;
|
|
13
|
+
readonly workspace: v.LiteralSchema<true, undefined>;
|
|
14
|
+
}, undefined>, v.ObjectSchema<{
|
|
15
|
+
readonly type: v.LiteralSchema<"block_id", undefined>;
|
|
16
|
+
readonly block_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionBlockId">]>;
|
|
17
|
+
}, undefined>, v.ObjectSchema<{
|
|
18
|
+
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
19
|
+
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
20
|
+
}, undefined>, v.ObjectSchema<{
|
|
21
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
22
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
23
|
+
}, undefined>, v.ObjectSchema<{
|
|
24
|
+
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
25
|
+
}, undefined>], undefined>;
|
|
26
|
+
readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
27
|
+
readonly id: v.StringSchema<undefined>;
|
|
28
|
+
readonly table: v.StringSchema<undefined>;
|
|
29
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
30
|
+
}, undefined>, undefined>, null>;
|
|
31
|
+
readonly last_edited_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
32
|
+
readonly id: v.StringSchema<undefined>;
|
|
33
|
+
readonly table: v.StringSchema<undefined>;
|
|
34
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
35
|
+
}, undefined>, undefined>, null>;
|
|
36
|
+
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
37
|
+
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
38
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.UnionSchema<[v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
39
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
40
|
+
readonly icon: v.LooseObjectSchema<{
|
|
41
|
+
readonly name: v.StringSchema<undefined>;
|
|
42
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").BridgeIconColor>, undefined>;
|
|
43
|
+
}, undefined>;
|
|
44
|
+
}, undefined>, v.ObjectSchema<{
|
|
45
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
46
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
47
|
+
}, undefined>, v.ObjectSchema<{
|
|
48
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
49
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
50
|
+
readonly id: v.StringSchema<undefined>;
|
|
51
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
52
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
53
|
+
}, undefined>;
|
|
54
|
+
}, undefined>, v.ObjectSchema<{
|
|
55
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
56
|
+
readonly external: v.ObjectSchema<{
|
|
57
|
+
readonly url: v.StringSchema<undefined>;
|
|
58
|
+
}, undefined>;
|
|
59
|
+
}, undefined>, v.ObjectSchema<{
|
|
60
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
61
|
+
readonly file: v.ObjectSchema<{
|
|
62
|
+
readonly url: v.StringSchema<undefined>;
|
|
63
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
64
|
+
}, undefined>;
|
|
65
|
+
}, undefined>], undefined>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
|
|
66
|
+
readonly type: v.StringSchema<undefined>;
|
|
67
|
+
}, undefined>, v.CheckAction<{
|
|
68
|
+
type: string;
|
|
69
|
+
}, undefined>, v.TransformAction<{
|
|
70
|
+
type: string;
|
|
71
|
+
}, null>]>], undefined>, undefined>, null>;
|
|
72
|
+
readonly cover: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
73
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
74
|
+
readonly external: v.ObjectSchema<{
|
|
75
|
+
readonly url: v.StringSchema<undefined>;
|
|
76
|
+
}, undefined>;
|
|
77
|
+
}, undefined>, v.ObjectSchema<{
|
|
78
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
79
|
+
readonly file: v.ObjectSchema<{
|
|
80
|
+
readonly url: v.StringSchema<undefined>;
|
|
81
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
82
|
+
}, undefined>;
|
|
83
|
+
}, undefined>], undefined>, undefined>, null>;
|
|
84
|
+
readonly url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
85
|
+
readonly public_url: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
86
|
+
readonly is_archived: v.BooleanSchema<undefined>;
|
|
87
|
+
readonly in_trash: v.BooleanSchema<undefined>;
|
|
88
|
+
readonly properties: v.RecordSchema<v.StringSchema<undefined>, v.NullableSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
89
|
+
readonly id: v.StringSchema<undefined>;
|
|
90
|
+
readonly type: v.LiteralSchema<"title", undefined>;
|
|
91
|
+
readonly title: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
92
|
+
}, undefined>, v.ObjectSchema<{
|
|
93
|
+
readonly id: v.StringSchema<undefined>;
|
|
94
|
+
readonly type: v.LiteralSchema<"rich_text", undefined>;
|
|
95
|
+
readonly rich_text: v.ArraySchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>;
|
|
96
|
+
}, undefined>, v.ObjectSchema<{
|
|
97
|
+
readonly id: v.StringSchema<undefined>;
|
|
98
|
+
readonly type: v.LiteralSchema<"number", undefined>;
|
|
99
|
+
readonly number: v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
100
|
+
}, undefined>, v.ObjectSchema<{
|
|
101
|
+
readonly id: v.StringSchema<undefined>;
|
|
102
|
+
readonly type: v.LiteralSchema<"url", undefined>;
|
|
103
|
+
readonly url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
104
|
+
}, undefined>, v.ObjectSchema<{
|
|
105
|
+
readonly id: v.StringSchema<undefined>;
|
|
106
|
+
readonly type: v.LiteralSchema<"email", undefined>;
|
|
107
|
+
readonly email: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
108
|
+
}, undefined>, v.ObjectSchema<{
|
|
109
|
+
readonly id: v.StringSchema<undefined>;
|
|
110
|
+
readonly type: v.LiteralSchema<"phone_number", undefined>;
|
|
111
|
+
readonly phone_number: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
112
|
+
}, undefined>, v.ObjectSchema<{
|
|
113
|
+
readonly id: v.StringSchema<undefined>;
|
|
114
|
+
readonly type: v.LiteralSchema<"checkbox", undefined>;
|
|
115
|
+
readonly checkbox: v.BooleanSchema<undefined>;
|
|
116
|
+
}, undefined>, v.ObjectSchema<{
|
|
117
|
+
readonly id: v.StringSchema<undefined>;
|
|
118
|
+
readonly type: v.LiteralSchema<"select", undefined>;
|
|
119
|
+
readonly select: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
120
|
+
readonly id: v.StringSchema<undefined>;
|
|
121
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
122
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
123
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
124
|
+
}, undefined>, v.ObjectSchema<{
|
|
125
|
+
readonly name: v.StringSchema<undefined>;
|
|
126
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
127
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
128
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
129
|
+
}, undefined>], undefined>, undefined>;
|
|
130
|
+
}, undefined>, v.ObjectSchema<{
|
|
131
|
+
readonly id: v.StringSchema<undefined>;
|
|
132
|
+
readonly type: v.LiteralSchema<"status", undefined>;
|
|
133
|
+
readonly status: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
134
|
+
readonly id: v.StringSchema<undefined>;
|
|
135
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
136
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
137
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
138
|
+
}, undefined>, v.ObjectSchema<{
|
|
139
|
+
readonly name: v.StringSchema<undefined>;
|
|
140
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
141
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
142
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
143
|
+
}, undefined>], undefined>, undefined>;
|
|
144
|
+
}, undefined>, v.ObjectSchema<{
|
|
145
|
+
readonly id: v.StringSchema<undefined>;
|
|
146
|
+
readonly type: v.LiteralSchema<"multi_select", undefined>;
|
|
147
|
+
readonly multi_select: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
148
|
+
readonly id: v.StringSchema<undefined>;
|
|
149
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
150
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
151
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
152
|
+
}, undefined>, v.ObjectSchema<{
|
|
153
|
+
readonly name: v.StringSchema<undefined>;
|
|
154
|
+
readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
155
|
+
readonly color: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
156
|
+
readonly description: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
157
|
+
}, undefined>], undefined>, undefined>;
|
|
158
|
+
}, undefined>, v.ObjectSchema<{
|
|
159
|
+
readonly id: v.StringSchema<undefined>;
|
|
160
|
+
readonly type: v.LiteralSchema<"date", undefined>;
|
|
161
|
+
readonly date: v.NullableSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
162
|
+
readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
163
|
+
readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
164
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
165
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
166
|
+
readonly value: v.NumberSchema<undefined>;
|
|
167
|
+
readonly time: v.StringSchema<undefined>;
|
|
168
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
169
|
+
}, undefined>, v.ObjectSchema<{
|
|
170
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
171
|
+
readonly value: v.NumberSchema<undefined>;
|
|
172
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
173
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
174
|
+
}, undefined>], undefined>, undefined>;
|
|
175
|
+
readonly start: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IncludesAction<string, "T", undefined>]>;
|
|
176
|
+
}, undefined>, v.ObjectSchema<{
|
|
177
|
+
readonly start: v.StringSchema<undefined>;
|
|
178
|
+
readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
179
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.UnionSchema<[v.ObjectSchema<{
|
|
180
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
181
|
+
readonly value: v.NumberSchema<undefined>;
|
|
182
|
+
readonly time: v.StringSchema<undefined>;
|
|
183
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
184
|
+
}, undefined>, v.ObjectSchema<{
|
|
185
|
+
readonly unit: v.PicklistSchema<["hour", "minute"], undefined>;
|
|
186
|
+
readonly value: v.NumberSchema<undefined>;
|
|
187
|
+
}, undefined>], undefined>, v.ObjectSchema<{
|
|
188
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
189
|
+
}, undefined>], undefined>, undefined>;
|
|
190
|
+
readonly time_zone: v.StringSchema<undefined>;
|
|
191
|
+
}, undefined>, v.ObjectSchema<{
|
|
192
|
+
readonly start: v.StringSchema<undefined>;
|
|
193
|
+
readonly end: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
194
|
+
readonly time_zone: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
195
|
+
readonly reminder: v.OptionalSchema<v.UnionSchema<[v.ObjectSchema<{
|
|
196
|
+
readonly unit: v.PicklistSchema<["year", "month", "week", "day"], undefined>;
|
|
197
|
+
readonly value: v.NumberSchema<undefined>;
|
|
198
|
+
readonly time: v.StringSchema<undefined>;
|
|
199
|
+
readonly defaultTimeZone: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
200
|
+
}, undefined>, v.ObjectSchema<{
|
|
201
|
+
readonly unit: v.LiteralSchema<"none", undefined>;
|
|
202
|
+
}, undefined>], undefined>, undefined>;
|
|
203
|
+
}, undefined>], undefined>, undefined>;
|
|
204
|
+
}, undefined>, v.ObjectSchema<{
|
|
205
|
+
readonly id: v.StringSchema<undefined>;
|
|
206
|
+
readonly type: v.LiteralSchema<"people", undefined>;
|
|
207
|
+
readonly people: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
208
|
+
readonly object: v.OptionalSchema<v.LiteralSchema<"user", undefined>, undefined>;
|
|
209
|
+
readonly id: v.StringSchema<undefined>;
|
|
210
|
+
}, undefined>, v.ObjectSchema<{
|
|
211
|
+
readonly object: v.LiteralSchema<"group", undefined>;
|
|
212
|
+
readonly id: v.StringSchema<undefined>;
|
|
213
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
214
|
+
}, undefined>], undefined>, undefined>;
|
|
215
|
+
}, undefined>, v.ObjectSchema<{
|
|
216
|
+
readonly id: v.StringSchema<undefined>;
|
|
217
|
+
readonly type: v.LiteralSchema<"relation", undefined>;
|
|
218
|
+
readonly has_more: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
219
|
+
readonly relation: v.ArraySchema<v.ObjectSchema<{
|
|
220
|
+
readonly id: v.StringSchema<undefined>;
|
|
221
|
+
}, undefined>, undefined>;
|
|
222
|
+
}, undefined>, v.ObjectSchema<{
|
|
223
|
+
readonly id: v.StringSchema<undefined>;
|
|
224
|
+
readonly type: v.LiteralSchema<"place", undefined>;
|
|
225
|
+
readonly place: v.NullableSchema<v.ObjectSchema<{
|
|
226
|
+
readonly lat: v.NumberSchema<undefined>;
|
|
227
|
+
readonly lon: v.NumberSchema<undefined>;
|
|
228
|
+
readonly name: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
229
|
+
readonly address: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
230
|
+
readonly aws_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
231
|
+
readonly google_place_id: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, undefined>;
|
|
232
|
+
}, undefined>, undefined>;
|
|
233
|
+
}, undefined>, v.ObjectSchema<{
|
|
234
|
+
readonly id: v.StringSchema<undefined>;
|
|
235
|
+
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
236
|
+
readonly created_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
237
|
+
}, undefined>, v.ObjectSchema<{
|
|
238
|
+
readonly id: v.StringSchema<undefined>;
|
|
239
|
+
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
240
|
+
readonly last_edited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
241
|
+
}, undefined>, v.ObjectSchema<{
|
|
242
|
+
readonly id: v.StringSchema<undefined>;
|
|
243
|
+
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
244
|
+
readonly created_by: v.NullableSchema<v.ObjectSchema<{
|
|
245
|
+
readonly id: v.StringSchema<undefined>;
|
|
246
|
+
readonly table: v.StringSchema<undefined>;
|
|
247
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
248
|
+
}, undefined>, undefined>;
|
|
249
|
+
}, undefined>, v.ObjectSchema<{
|
|
250
|
+
readonly id: v.StringSchema<undefined>;
|
|
251
|
+
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
252
|
+
readonly last_edited_by: v.NullableSchema<v.ObjectSchema<{
|
|
253
|
+
readonly id: v.StringSchema<undefined>;
|
|
254
|
+
readonly table: v.StringSchema<undefined>;
|
|
255
|
+
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
256
|
+
}, undefined>, undefined>;
|
|
257
|
+
}, undefined>, v.ObjectSchema<{
|
|
258
|
+
readonly id: v.StringSchema<undefined>;
|
|
259
|
+
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
260
|
+
readonly unique_id: v.StringSchema<undefined>;
|
|
261
|
+
}, undefined>, v.ObjectSchema<{
|
|
262
|
+
readonly id: v.StringSchema<undefined>;
|
|
263
|
+
readonly type: v.LiteralSchema<"button", undefined>;
|
|
264
|
+
readonly button: v.StringSchema<undefined>;
|
|
265
|
+
}, undefined>, v.ObjectSchema<{
|
|
266
|
+
readonly id: v.StringSchema<undefined>;
|
|
267
|
+
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
268
|
+
readonly formula: v.StringSchema<undefined>;
|
|
269
|
+
}, undefined>, v.ObjectSchema<{
|
|
270
|
+
readonly id: v.StringSchema<undefined>;
|
|
271
|
+
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
272
|
+
readonly rollup: v.StringSchema<undefined>;
|
|
273
|
+
}, undefined>, v.ObjectSchema<{
|
|
274
|
+
readonly id: v.StringSchema<undefined>;
|
|
275
|
+
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
276
|
+
readonly verification: v.StringSchema<undefined>;
|
|
277
|
+
}, undefined>, v.ObjectSchema<{
|
|
278
|
+
readonly id: v.StringSchema<undefined>;
|
|
279
|
+
readonly type: v.LiteralSchema<"files", undefined>;
|
|
280
|
+
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
281
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
282
|
+
readonly external: v.ObjectSchema<{
|
|
283
|
+
readonly url: v.StringSchema<undefined>;
|
|
284
|
+
}, undefined>;
|
|
285
|
+
readonly name: v.StringSchema<undefined>;
|
|
286
|
+
}, undefined>, v.ObjectSchema<{
|
|
287
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
288
|
+
readonly file: v.ObjectSchema<{
|
|
289
|
+
readonly url: v.StringSchema<undefined>;
|
|
290
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
291
|
+
}, undefined>;
|
|
292
|
+
readonly name: v.StringSchema<undefined>;
|
|
293
|
+
}, undefined>], undefined>, undefined>;
|
|
294
|
+
}, undefined>], undefined>, undefined>, undefined>;
|
|
295
|
+
}, undefined>;
|
|
296
|
+
export type BridgePageForProtocol12 = v.InferOutput<typeof bridgePageForProtocol12Schema>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
import { bridgePageSchema } from "../../pages/bridgePage.js";
|
|
3
|
+
import { bridgePagePropertyWriteValueSchema } from "../../pages/properties/bridgePagePropertyValue.js";
|
|
4
|
+
export const bridgePageForProtocol12Schema = v.object({
|
|
5
|
+
...bridgePageSchema.entries,
|
|
6
|
+
properties: v.record(v.string(), v.nullable(bridgePagePropertyWriteValueSchema)),
|
|
7
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const containingPageSchema: v.VariantSchema<"type", [v.ObjectSchema<{
|
|
3
3
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
4
4
|
}, undefined>, v.ObjectSchema<{
|
|
5
5
|
readonly type: v.LiteralSchema<"page", undefined>;
|
|
@@ -33,4 +33,6 @@ export declare const customBlockPageSchema: v.VariantSchema<"type", [v.ObjectSch
|
|
|
33
33
|
/** How this block's containing page is displayed. Defaults to `full_page` for hosts without peek presentation. */
|
|
34
34
|
readonly displayMode: v.OptionalSchema<v.PicklistSchema<["full_page", "side_peek", "center_peek"], undefined>, "full_page">;
|
|
35
35
|
}, undefined>], undefined>;
|
|
36
|
-
|
|
36
|
+
/** Containing-page information supplied by a host before protocol validation. */
|
|
37
|
+
export type BridgeContainingPage = v.InferInput<typeof containingPageSchema>;
|
|
38
|
+
export type ContainingPage = v.InferOutput<typeof containingPageSchema>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { notionPageIdSchema } from "../utils/ids.js";
|
|
3
3
|
import { notionParentSchema } from "./parent.js";
|
|
4
|
-
export const
|
|
4
|
+
export const containingPageSchema = v.variant("type", [
|
|
5
5
|
/** The viewer cannot access the containing page. Its ID and parent are not exposed. */
|
|
6
6
|
v.object({ type: v.literal("unavailable") }),
|
|
7
7
|
/** The accessible containing page, with its ID and parent location. */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import {
|
|
2
|
+
import { containingPageSchema } from "../containingPage.js";
|
|
3
3
|
/**
|
|
4
4
|
* Message sent by the host whenever the custom block's nearest page ancestor changes.
|
|
5
5
|
*/
|
|
6
6
|
export const pageChangedMessageSchema = v.object({
|
|
7
7
|
type: v.literal("pageChanged"),
|
|
8
|
-
page:
|
|
8
|
+
page: containingPageSchema,
|
|
9
9
|
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BridgeDataSourceBinding } from "./bridgeDataSourceBinding.js";
|
|
2
|
+
/** Compares binding records by key and preserves the order of schema lists. */
|
|
3
|
+
export declare function areDataSourceBindingsEqual(previous: BridgeDataSourceBinding | undefined, next: BridgeDataSourceBinding | undefined): boolean;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Compares binding records by key and preserves the order of schema lists. */
|
|
2
|
+
export function areDataSourceBindingsEqual(previous, next) {
|
|
3
|
+
return areBindingValuesEqual(previous, next);
|
|
4
|
+
}
|
|
5
|
+
function areBindingValuesEqual(previous, next) {
|
|
6
|
+
if (previous === next) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
if (Array.isArray(previous)) {
|
|
10
|
+
return (Array.isArray(next) &&
|
|
11
|
+
previous.length === next.length &&
|
|
12
|
+
previous.every((value, index) => areBindingValuesEqual(value, next[index])));
|
|
13
|
+
}
|
|
14
|
+
if (!isBindingRecord(previous) || !isBindingRecord(next)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
// Optional fields and unmapped property keys can be omitted or set to undefined.
|
|
18
|
+
const previousKeys = Object.keys(previous).filter(key => previous[key] !== undefined);
|
|
19
|
+
const nextKeys = Object.keys(next).filter(key => next[key] !== undefined);
|
|
20
|
+
return (previousKeys.length === nextKeys.length &&
|
|
21
|
+
previousKeys.every(key => Object.hasOwn(next, key) &&
|
|
22
|
+
areBindingValuesEqual(previous[key], next[key])));
|
|
23
|
+
}
|
|
24
|
+
function isBindingRecord(value) {
|
|
25
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
26
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import type
|
|
2
|
+
import { type CustomBlockErrorCode, type CustomBlockErrorInfoWithDetails, type CustomBlockGrantErrorCode } from "../../utils/errors.js";
|
|
3
3
|
/**
|
|
4
4
|
* Message sent by the sandbox to ask the host for the current rows in a resolved
|
|
5
5
|
* Notion data source.
|
|
@@ -1996,11 +1996,12 @@ export type CustomBlockQueryDataSourceErrorCode = CustomBlockErrorCode<
|
|
|
1996
1996
|
| "data_source_inaccessible"
|
|
1997
1997
|
/** The SDK or host could not validate filters or sorts because the data source schema is unavailable. */
|
|
1998
1998
|
| "data_source_schema_unavailable" | CustomBlockGrantErrorCode>;
|
|
1999
|
-
export type CustomBlockQueryDataSourceErrorInfo =
|
|
1999
|
+
export type CustomBlockQueryDataSourceErrorInfo = CustomBlockErrorInfoWithDetails<CustomBlockQueryDataSourceErrorCode>;
|
|
2000
2000
|
export declare const customBlockQueryDataSourceErrorInfoSchema: v.ObjectSchema<{
|
|
2001
2001
|
readonly code: v.StringSchema<undefined>;
|
|
2002
2002
|
readonly message: v.StringSchema<undefined>;
|
|
2003
2003
|
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
2004
|
+
readonly details: v.SchemaWithFallback<v.OptionalSchema<v.CustomSchema<Record<string, unknown>, undefined>, undefined>, undefined>;
|
|
2004
2005
|
}, undefined>;
|
|
2005
2006
|
/**
|
|
2006
2007
|
* Message sent by the host to update a `queryDataSource` subscription.
|
|
@@ -2167,23 +2168,6 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
2167
2168
|
readonly relation: v.ArraySchema<v.ObjectSchema<{
|
|
2168
2169
|
readonly id: v.StringSchema<undefined>;
|
|
2169
2170
|
}, undefined>, undefined>;
|
|
2170
|
-
}, undefined>, v.ObjectSchema<{
|
|
2171
|
-
readonly id: v.StringSchema<undefined>;
|
|
2172
|
-
readonly type: v.LiteralSchema<"files", undefined>;
|
|
2173
|
-
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
2174
|
-
readonly type: v.LiteralSchema<"external", undefined>;
|
|
2175
|
-
readonly external: v.ObjectSchema<{
|
|
2176
|
-
readonly url: v.StringSchema<undefined>;
|
|
2177
|
-
}, undefined>;
|
|
2178
|
-
readonly name: v.StringSchema<undefined>;
|
|
2179
|
-
}, undefined>, v.ObjectSchema<{
|
|
2180
|
-
readonly type: v.LiteralSchema<"file", undefined>;
|
|
2181
|
-
readonly file: v.ObjectSchema<{
|
|
2182
|
-
readonly url: v.StringSchema<undefined>;
|
|
2183
|
-
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2184
|
-
}, undefined>;
|
|
2185
|
-
readonly name: v.StringSchema<undefined>;
|
|
2186
|
-
}, undefined>], undefined>, undefined>;
|
|
2187
2171
|
}, undefined>, v.ObjectSchema<{
|
|
2188
2172
|
readonly id: v.StringSchema<undefined>;
|
|
2189
2173
|
readonly type: v.LiteralSchema<"place", undefined>;
|
|
@@ -2239,6 +2223,26 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
2239
2223
|
readonly id: v.StringSchema<undefined>;
|
|
2240
2224
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
2241
2225
|
readonly verification: v.StringSchema<undefined>;
|
|
2226
|
+
}, undefined>, v.ObjectSchema<{
|
|
2227
|
+
readonly id: v.StringSchema<undefined>;
|
|
2228
|
+
readonly type: v.LiteralSchema<"files", undefined>;
|
|
2229
|
+
readonly files: v.ArraySchema<v.UnionSchema<[v.ObjectSchema<{
|
|
2230
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
2231
|
+
readonly external: v.ObjectSchema<{
|
|
2232
|
+
readonly url: v.StringSchema<undefined>;
|
|
2233
|
+
}, undefined>;
|
|
2234
|
+
readonly name: v.StringSchema<undefined>;
|
|
2235
|
+
}, undefined>, v.ObjectSchema<{
|
|
2236
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
2237
|
+
readonly file: v.ObjectSchema<{
|
|
2238
|
+
readonly url: v.StringSchema<undefined>;
|
|
2239
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2240
|
+
}, undefined>;
|
|
2241
|
+
readonly name: v.StringSchema<undefined>;
|
|
2242
|
+
}, undefined>, v.ObjectSchema<{
|
|
2243
|
+
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
2244
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
2245
|
+
}, undefined>], undefined>, undefined>;
|
|
2242
2246
|
}, undefined>], undefined>, undefined>, undefined>;
|
|
2243
2247
|
readonly created_by: v.OptionalSchema<v.NullableSchema<v.ObjectSchema<{
|
|
2244
2248
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -2319,6 +2323,7 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
2319
2323
|
readonly code: v.StringSchema<undefined>;
|
|
2320
2324
|
readonly message: v.StringSchema<undefined>;
|
|
2321
2325
|
readonly isRetryable: v.BooleanSchema<undefined>;
|
|
2326
|
+
readonly details: v.SchemaWithFallback<v.OptionalSchema<v.CustomSchema<Record<string, unknown>, undefined>, undefined>, undefined>;
|
|
2322
2327
|
}, undefined>;
|
|
2323
2328
|
}, undefined>], undefined>;
|
|
2324
2329
|
export type QueryDataSourceResultMessage = v.InferOutput<typeof queryDataSourceResultMessageSchema>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
import { bridgePageSchema } from "../../pages/bridgePage.js";
|
|
3
|
+
import { customBlockErrorDetailsSchema, } from "../../utils/errors.js";
|
|
3
4
|
import { notionDataSourceIdSchema } from "../../utils/ids.js";
|
|
4
5
|
import { bridgeArchiveStatusSchema } from "../bridgeArchiveStatus.js";
|
|
5
6
|
import { bridgeDataSourceQueryLimitClampSchema } from "../bridgeDataSourceQueryLimitClamp.js";
|
|
@@ -30,6 +31,7 @@ export const customBlockQueryDataSourceErrorInfoSchema = v.object({
|
|
|
30
31
|
code: customBlockQueryDataSourceErrorCodeSchema,
|
|
31
32
|
message: v.string(),
|
|
32
33
|
isRetryable: v.boolean(),
|
|
34
|
+
details: v.fallback(v.optional(customBlockErrorDetailsSchema), undefined),
|
|
33
35
|
});
|
|
34
36
|
/**
|
|
35
37
|
* Message sent by the host to update a `queryDataSource` subscription.
|
package/dist/protocol/files.d.ts
CHANGED
|
@@ -30,3 +30,21 @@ export declare const bridgeFilePropertyItemSchema: v.UnionSchema<[v.ObjectSchema
|
|
|
30
30
|
readonly name: v.StringSchema<undefined>;
|
|
31
31
|
}, undefined>], undefined>;
|
|
32
32
|
export type BridgeFilePropertyItem = v.InferOutput<typeof bridgeFilePropertyItemSchema>;
|
|
33
|
+
export declare const bridgeFilePropertyReadItemSchema: v.UnionSchema<[v.ObjectSchema<{
|
|
34
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
35
|
+
readonly external: v.ObjectSchema<{
|
|
36
|
+
readonly url: v.StringSchema<undefined>;
|
|
37
|
+
}, undefined>;
|
|
38
|
+
readonly name: v.StringSchema<undefined>;
|
|
39
|
+
}, undefined>, v.ObjectSchema<{
|
|
40
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
41
|
+
readonly file: v.ObjectSchema<{
|
|
42
|
+
readonly url: v.StringSchema<undefined>;
|
|
43
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
44
|
+
}, undefined>;
|
|
45
|
+
readonly name: v.StringSchema<undefined>;
|
|
46
|
+
}, undefined>, v.ObjectSchema<{
|
|
47
|
+
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
48
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
49
|
+
}, undefined>], undefined>;
|
|
50
|
+
export type BridgeFilePropertyReadItem = v.InferOutput<typeof bridgeFilePropertyReadItemSchema>;
|
package/dist/protocol/files.js
CHANGED
|
@@ -15,3 +15,12 @@ export const bridgeFilePropertyItemSchema = v.union([
|
|
|
15
15
|
v.object({ ...bridgeExternalFileSchema.entries, name: v.string() }),
|
|
16
16
|
v.object({ ...bridgeNotionHostedFileSchema.entries, name: v.string() }),
|
|
17
17
|
]);
|
|
18
|
+
/** An attachment whose reference could not be resolved for the viewer. */
|
|
19
|
+
const bridgeUnavailableFilePropertyItemSchema = v.object({
|
|
20
|
+
type: v.literal("unavailable"),
|
|
21
|
+
name: v.optional(v.string()),
|
|
22
|
+
});
|
|
23
|
+
export const bridgeFilePropertyReadItemSchema = v.union([
|
|
24
|
+
...bridgeFilePropertyItemSchema.options,
|
|
25
|
+
bridgeUnavailableFilePropertyItemSchema,
|
|
26
|
+
]);
|