@notionhq/custom-blocks-dev-shell 0.1.115 → 0.2.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/LICENSE +21 -0
- package/README.md +92 -13
- package/THIRD_PARTY_LICENSES.md +133 -0
- package/dist/assets/index-Do-x8yIt.css +2 -0
- package/dist/assets/index-n0_PUieY.js +11 -0
- package/dist/index.html +2 -2
- package/dist-cli/cli/published-cli.js +8572 -51
- package/docs/bindings.md +17 -12
- package/docs/bridge/changelog.md +94 -0
- package/docs/bridge/protocol.md +239 -0
- package/docs/bridge/versioning.md +39 -0
- package/docs/data-sources.md +49 -36
- package/docs/host/README.md +193 -0
- package/docs/host/docs/compatibility.md +76 -0
- package/docs/host/docs/handlers.md +210 -0
- package/docs/host/docs/lifecycle.md +131 -0
- package/package.json +5 -3
- package/dist/assets/index-DXzPwq_J.js +0 -11
- package/dist/assets/index-E1j3FxAu.css +0 -2
- package/dist-cli/cli/binding-cli-flags.js +0 -33
- package/dist-cli/cli/binding-errors.js +0 -15
- package/dist-cli/cli/block-csp.js +0 -84
- package/dist-cli/cli/build-block-registry.js +0 -30
- package/dist-cli/cli/convert-values.js +0 -222
- package/dist-cli/cli/convert.js +0 -210
- package/dist-cli/cli/data-source-files.js +0 -6
- package/dist-cli/cli/data-sources.js +0 -114
- package/dist-cli/cli/dev-shell-launcher.js +0 -239
- package/dist-cli/cli/dev-shell-run.js +0 -72
- package/dist-cli/cli/errors.js +0 -12
- package/dist-cli/cli/launcher-bindings.js +0 -144
- package/dist-cli/cli/materialize.js +0 -105
- package/dist-cli/cli/ports.js +0 -20
- package/dist-cli/cli/prebuilt.js +0 -23
- package/dist-cli/cli/runtime-error-client.js +0 -52
- package/dist-cli/cli/serve-ui.js +0 -110
- package/dist-cli/cli/shared-server.js +0 -70
- package/dist-cli/cli/utils.js +0 -52
- package/dist-cli/cli/vite-block-server.js +0 -125
- package/dist-cli/cli/vite-middleware.js +0 -111
- package/dist-cli/cli/worker-manifest.js +0 -158
- package/dist-cli/protocol/contrast.d.ts +0 -4
- package/dist-cli/protocol/contrast.js +0 -3
- package/dist-cli/protocol/dataSources/dataSource.d.ts +0 -786
- package/dist-cli/protocol/dataSources/dataSource.js +0 -66
- package/dist-cli/protocol/dataSources/dataSourcePage.d.ts +0 -74
- package/dist-cli/protocol/dataSources/dataSourcePage.js +0 -15
- package/dist-cli/protocol/dataSources/dataSourceValue.d.ts +0 -66
- package/dist-cli/protocol/dataSources/dataSourceValue.js +0 -14
- package/dist-cli/protocol/dataSources/dateValue.d.ts +0 -157
- package/dist-cli/protocol/dataSources/dateValue.js +0 -61
- package/dist-cli/protocol/dataSources/errors.d.ts +0 -8
- package/dist-cli/protocol/dataSources/errors.js +0 -7
- package/dist-cli/protocol/dataSources/propertySchema.d.ts +0 -200
- package/dist-cli/protocol/dataSources/propertySchema.js +0 -174
- package/dist-cli/protocol/dataSources/recordPointer.d.ts +0 -9
- package/dist-cli/protocol/dataSources/recordPointer.js +0 -8
- package/dist-cli/protocol/dataSources/sortDirection.d.ts +0 -3
- package/dist-cli/protocol/dataSources/sortDirection.js +0 -2
- package/dist-cli/protocol/errors.d.ts +0 -12
- package/dist-cli/protocol/errors.js +0 -6
- package/dist-cli/protocol/ids.d.ts +0 -31
- package/dist-cli/protocol/ids.js +0 -26
- package/dist-cli/protocol/index.d.ts +0 -53
- package/dist-cli/protocol/index.js +0 -53
- package/dist-cli/protocol/manifest.d.ts +0 -67
- package/dist-cli/protocol/manifest.js +0 -36
- package/dist-cli/protocol/messages/connect.d.ts +0 -54
- package/dist-cli/protocol/messages/connect.js +0 -39
- package/dist-cli/protocol/messages/contrastModeChanged.d.ts +0 -7
- package/dist-cli/protocol/messages/contrastModeChanged.js +0 -7
- package/dist-cli/protocol/messages/createPage.d.ts +0 -290
- package/dist-cli/protocol/messages/createPage.js +0 -51
- package/dist-cli/protocol/messages/createPageResult.d.ts +0 -897
- package/dist-cli/protocol/messages/createPageResult.js +0 -43
- package/dist-cli/protocol/messages/currentUserChanged.d.ts +0 -18
- package/dist-cli/protocol/messages/currentUserChanged.js +0 -9
- package/dist-cli/protocol/messages/dataSourcesChanged.d.ts +0 -157
- package/dist-cli/protocol/messages/dataSourcesChanged.js +0 -13
- package/dist-cli/protocol/messages/getPage.d.ts +0 -902
- package/dist-cli/protocol/messages/getPage.js +0 -48
- package/dist-cli/protocol/messages/getUser.d.ts +0 -44
- package/dist-cli/protocol/messages/getUser.js +0 -32
- package/dist-cli/protocol/messages/hostToSandbox.d.ts +0 -4385
- package/dist-cli/protocol/messages/hostToSandbox.js +0 -48
- package/dist-cli/protocol/messages/incomingType.d.ts +0 -9
- package/dist-cli/protocol/messages/incomingType.js +0 -17
- package/dist-cli/protocol/messages/init.d.ts +0 -273
- package/dist-cli/protocol/messages/init.js +0 -57
- package/dist-cli/protocol/messages/initResult.d.ts +0 -37
- package/dist-cli/protocol/messages/initResult.js +0 -29
- package/dist-cli/protocol/messages/invalidHostMessage.d.ts +0 -14
- package/dist-cli/protocol/messages/invalidHostMessage.js +0 -13
- package/dist-cli/protocol/messages/invalidSandboxMessage.d.ts +0 -14
- package/dist-cli/protocol/messages/invalidSandboxMessage.js +0 -13
- package/dist-cli/protocol/messages/isInitHandshakeMessage.d.ts +0 -4
- package/dist-cli/protocol/messages/isInitHandshakeMessage.js +0 -11
- package/dist-cli/protocol/messages/listUsers.d.ts +0 -52
- package/dist-cli/protocol/messages/listUsers.js +0 -33
- package/dist-cli/protocol/messages/messagePayload.d.ts +0 -19
- package/dist-cli/protocol/messages/messagePayload.js +0 -1
- package/dist-cli/protocol/messages/openExternalUrl.d.ts +0 -32
- package/dist-cli/protocol/messages/openExternalUrl.js +0 -26
- package/dist-cli/protocol/messages/openPage.d.ts +0 -38
- package/dist-cli/protocol/messages/openPage.js +0 -34
- package/dist-cli/protocol/messages/pageChanged.d.ts +0 -32
- package/dist-cli/protocol/messages/pageChanged.js +0 -9
- package/dist-cli/protocol/messages/parentChanged.d.ts +0 -26
- package/dist-cli/protocol/messages/parentChanged.js +0 -9
- package/dist-cli/protocol/messages/queryDataSource.d.ts +0 -1446
- package/dist-cli/protocol/messages/queryDataSource.js +0 -252
- package/dist-cli/protocol/messages/queryDataSourceResult.d.ts +0 -686
- package/dist-cli/protocol/messages/queryDataSourceResult.js +0 -44
- package/dist-cli/protocol/messages/resize.d.ts +0 -11
- package/dist-cli/protocol/messages/resize.js +0 -10
- package/dist-cli/protocol/messages/sandboxToHost.d.ts +0 -1091
- package/dist-cli/protocol/messages/sandboxToHost.js +0 -33
- package/dist-cli/protocol/messages/themeChanged.d.ts +0 -10
- package/dist-cli/protocol/messages/themeChanged.js +0 -10
- package/dist-cli/protocol/messages/unsubscribeDataSourceQuery.d.ts +0 -10
- package/dist-cli/protocol/messages/unsubscribeDataSourceQuery.js +0 -9
- package/dist-cli/protocol/messages/updatePage.d.ts +0 -271
- package/dist-cli/protocol/messages/updatePage.js +0 -23
- package/dist-cli/protocol/messages/updatePageResult.d.ts +0 -895
- package/dist-cli/protocol/messages/updatePageResult.js +0 -41
- package/dist-cli/protocol/pages/page.d.ts +0 -1422
- package/dist-cli/protocol/pages/page.js +0 -318
- package/dist-cli/protocol/parent.d.ts +0 -32
- package/dist-cli/protocol/parent.js +0 -13
- package/dist-cli/protocol/protocolVersion.d.ts +0 -8
- package/dist-cli/protocol/protocolVersion.js +0 -11
- package/dist-cli/protocol/theme.d.ts +0 -3
- package/dist-cli/protocol/theme.js +0 -2
- package/dist-cli/protocol/users/user.d.ts +0 -32
- package/dist-cli/protocol/users/user.js +0 -20
- package/dist-cli/shared/block-registry.js +0 -28
- package/dist-cli/shared/data-source.js +0 -22
- package/dist-cli/shared/runtime-config.js +0 -10
- package/dist-cli/shared/sample-data-source.js +0 -12
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as v from "valibot";
|
|
2
|
-
import { legacyNotionPageSchema, notionPageDataSchema } from "../pages/page.js";
|
|
3
|
-
// The schema accepts any string code. The type lists known codes for
|
|
4
|
-
// autocomplete, with an open string fallback for newer senders.
|
|
5
|
-
export const customBlockCreatePageErrorCodeSchema = v.string();
|
|
6
|
-
export const customBlockCreatePageErrorInfoSchema = v.object({
|
|
7
|
-
code: customBlockCreatePageErrorCodeSchema,
|
|
8
|
-
message: v.string(),
|
|
9
|
-
isRetryable: v.boolean(),
|
|
10
|
-
});
|
|
11
|
-
/**
|
|
12
|
-
* Message sent by the host in response to a sandbox `createPage` request.
|
|
13
|
-
*/
|
|
14
|
-
export const createPageResultMessageSchema = v.variant("status", [
|
|
15
|
-
v.object({
|
|
16
|
-
type: v.literal("createPageResult"),
|
|
17
|
-
requestId: v.string(),
|
|
18
|
-
status: v.literal("success"),
|
|
19
|
-
/** The newly created page. */
|
|
20
|
-
page: notionPageDataSchema,
|
|
21
|
-
}),
|
|
22
|
-
v.object({
|
|
23
|
-
type: v.literal("createPageResult"),
|
|
24
|
-
requestId: v.string(),
|
|
25
|
-
status: v.literal("error"),
|
|
26
|
-
error: customBlockCreatePageErrorInfoSchema,
|
|
27
|
-
}),
|
|
28
|
-
]);
|
|
29
|
-
export const createPageResultMessageLegacySchema = v.variant("status", [
|
|
30
|
-
v.object({
|
|
31
|
-
type: v.literal("createPageResult"),
|
|
32
|
-
requestId: v.string(),
|
|
33
|
-
status: v.literal("success"),
|
|
34
|
-
/** The newly created page. */
|
|
35
|
-
page: v.union([notionPageDataSchema, legacyNotionPageSchema]),
|
|
36
|
-
}),
|
|
37
|
-
v.object({
|
|
38
|
-
type: v.literal("createPageResult"),
|
|
39
|
-
requestId: v.string(),
|
|
40
|
-
status: v.literal("error"),
|
|
41
|
-
error: customBlockCreatePageErrorInfoSchema,
|
|
42
|
-
}),
|
|
43
|
-
]);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as v from "valibot";
|
|
2
|
-
/**
|
|
3
|
-
* Sent by the host when the viewing user's profile changes while the block is mounted.
|
|
4
|
-
*/
|
|
5
|
-
export declare const currentUserChangedMessageSchema: v.ObjectSchema<{
|
|
6
|
-
readonly type: v.LiteralSchema<"currentUserChanged", undefined>;
|
|
7
|
-
readonly currentUser: v.ObjectSchema<{
|
|
8
|
-
readonly object: v.LiteralSchema<"user", undefined>;
|
|
9
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionUserId">]>;
|
|
10
|
-
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
11
|
-
readonly avatar_url: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
12
|
-
readonly type: v.LiteralSchema<"person", undefined>;
|
|
13
|
-
readonly person: v.ObjectSchema<{
|
|
14
|
-
readonly email: v.StringSchema<undefined>;
|
|
15
|
-
}, undefined>;
|
|
16
|
-
}, undefined>;
|
|
17
|
-
}, undefined>;
|
|
18
|
-
export type CurrentUserChangedMessage = v.InferOutput<typeof currentUserChangedMessageSchema>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as v from "valibot";
|
|
2
|
-
import { notionUserSchema } from "../users/user.js";
|
|
3
|
-
/**
|
|
4
|
-
* Sent by the host when the viewing user's profile changes while the block is mounted.
|
|
5
|
-
*/
|
|
6
|
-
export const currentUserChangedMessageSchema = v.object({
|
|
7
|
-
type: v.literal("currentUserChanged"),
|
|
8
|
-
currentUser: notionUserSchema,
|
|
9
|
-
});
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import * as v from "valibot";
|
|
2
|
-
/**
|
|
3
|
-
* Message sent by the host whenever the custom block's data source mapping changes (e.g. a key is
|
|
4
|
-
* added, removed, or remapped). The SDK replaces its list of configured data sources but keeps any
|
|
5
|
-
* in-flight `useDataSource` query state for keys that still exist.
|
|
6
|
-
*/
|
|
7
|
-
export declare const dataSourcesChangedMessageSchema: v.ObjectSchema<{
|
|
8
|
-
readonly type: v.LiteralSchema<"dataSourcesChanged", undefined>;
|
|
9
|
-
readonly dataSources: v.ObjectSchema<{
|
|
10
|
-
readonly bindings: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
11
|
-
readonly collectionPointer: v.OptionalSchema<v.ObjectSchema<{
|
|
12
|
-
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
13
|
-
readonly table: v.StringSchema<undefined>;
|
|
14
|
-
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
15
|
-
}, undefined>, undefined>;
|
|
16
|
-
readonly collectionSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
17
|
-
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
18
|
-
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
19
|
-
readonly name: v.StringSchema<undefined>;
|
|
20
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
21
|
-
readonly type: v.LiteralSchema<"title", undefined>;
|
|
22
|
-
}, undefined>, v.ObjectSchema<{
|
|
23
|
-
readonly name: v.StringSchema<undefined>;
|
|
24
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
25
|
-
readonly type: v.LiteralSchema<"rich_text", undefined>;
|
|
26
|
-
}, undefined>, v.ObjectSchema<{
|
|
27
|
-
readonly name: v.StringSchema<undefined>;
|
|
28
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
29
|
-
readonly type: v.LiteralSchema<"number", undefined>;
|
|
30
|
-
}, undefined>, v.ObjectSchema<{
|
|
31
|
-
readonly name: v.StringSchema<undefined>;
|
|
32
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
33
|
-
readonly type: v.LiteralSchema<"checkbox", undefined>;
|
|
34
|
-
}, undefined>, v.ObjectSchema<{
|
|
35
|
-
readonly name: v.StringSchema<undefined>;
|
|
36
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
37
|
-
readonly type: v.LiteralSchema<"url", undefined>;
|
|
38
|
-
}, undefined>, v.ObjectSchema<{
|
|
39
|
-
readonly name: v.StringSchema<undefined>;
|
|
40
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
41
|
-
readonly type: v.LiteralSchema<"email", undefined>;
|
|
42
|
-
}, undefined>, v.ObjectSchema<{
|
|
43
|
-
readonly name: v.StringSchema<undefined>;
|
|
44
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
45
|
-
readonly type: v.LiteralSchema<"phone_number", undefined>;
|
|
46
|
-
}, undefined>, v.ObjectSchema<{
|
|
47
|
-
readonly name: v.StringSchema<undefined>;
|
|
48
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
49
|
-
readonly type: v.LiteralSchema<"select", undefined>;
|
|
50
|
-
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
51
|
-
readonly id: v.StringSchema<undefined>;
|
|
52
|
-
readonly name: v.StringSchema<undefined>;
|
|
53
|
-
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
54
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
55
|
-
}, undefined>, undefined>;
|
|
56
|
-
}, undefined>, v.ObjectSchema<{
|
|
57
|
-
readonly name: v.StringSchema<undefined>;
|
|
58
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
59
|
-
readonly type: v.LiteralSchema<"multi_select", undefined>;
|
|
60
|
-
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
61
|
-
readonly id: v.StringSchema<undefined>;
|
|
62
|
-
readonly name: v.StringSchema<undefined>;
|
|
63
|
-
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
64
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
65
|
-
}, undefined>, undefined>;
|
|
66
|
-
}, undefined>, v.ObjectSchema<{
|
|
67
|
-
readonly name: v.StringSchema<undefined>;
|
|
68
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
69
|
-
readonly type: v.LiteralSchema<"status", undefined>;
|
|
70
|
-
readonly options: v.ArraySchema<v.ObjectSchema<{
|
|
71
|
-
readonly id: v.StringSchema<undefined>;
|
|
72
|
-
readonly name: v.StringSchema<undefined>;
|
|
73
|
-
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
74
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
75
|
-
}, undefined>, undefined>;
|
|
76
|
-
readonly groups: v.ArraySchema<v.ObjectSchema<{
|
|
77
|
-
readonly id: v.StringSchema<undefined>;
|
|
78
|
-
readonly name: v.StringSchema<undefined>;
|
|
79
|
-
readonly color: v.OptionalSchema<v.PicklistSchema<["default", "gray", "brown", "orange", "yellow", "green", "blue", "purple", "pink", "red", "gray_background", "brown_background", "orange_background", "yellow_background", "green_background", "blue_background", "purple_background", "pink_background", "red_background", "default_background"], undefined>, undefined>;
|
|
80
|
-
readonly option_ids: v.ArraySchema<v.StringSchema<undefined>, undefined>;
|
|
81
|
-
}, undefined>, undefined>;
|
|
82
|
-
}, undefined>, v.ObjectSchema<{
|
|
83
|
-
readonly name: v.StringSchema<undefined>;
|
|
84
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
85
|
-
readonly type: v.LiteralSchema<"date", undefined>;
|
|
86
|
-
}, undefined>, v.ObjectSchema<{
|
|
87
|
-
readonly name: v.StringSchema<undefined>;
|
|
88
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
89
|
-
readonly type: v.LiteralSchema<"people", undefined>;
|
|
90
|
-
}, undefined>, v.ObjectSchema<{
|
|
91
|
-
readonly name: v.StringSchema<undefined>;
|
|
92
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
93
|
-
readonly type: v.LiteralSchema<"files", undefined>;
|
|
94
|
-
}, undefined>, v.ObjectSchema<{
|
|
95
|
-
readonly name: v.StringSchema<undefined>;
|
|
96
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
97
|
-
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
98
|
-
}, undefined>, v.ObjectSchema<{
|
|
99
|
-
readonly name: v.StringSchema<undefined>;
|
|
100
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
101
|
-
readonly type: v.LiteralSchema<"relation", undefined>;
|
|
102
|
-
readonly data_source_id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
103
|
-
readonly dual_property: v.OptionalSchema<v.ObjectSchema<{
|
|
104
|
-
readonly synced_property_id: v.StringSchema<undefined>;
|
|
105
|
-
readonly synced_property_name: v.StringSchema<undefined>;
|
|
106
|
-
}, undefined>, undefined>;
|
|
107
|
-
}, undefined>, v.ObjectSchema<{
|
|
108
|
-
readonly name: v.StringSchema<undefined>;
|
|
109
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
110
|
-
readonly type: v.LiteralSchema<"place", undefined>;
|
|
111
|
-
}, undefined>, v.ObjectSchema<{
|
|
112
|
-
readonly name: v.StringSchema<undefined>;
|
|
113
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
114
|
-
readonly type: v.LiteralSchema<"formula", undefined>;
|
|
115
|
-
}, undefined>, v.ObjectSchema<{
|
|
116
|
-
readonly name: v.StringSchema<undefined>;
|
|
117
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
118
|
-
readonly type: v.LiteralSchema<"rollup", undefined>;
|
|
119
|
-
}, undefined>, v.ObjectSchema<{
|
|
120
|
-
readonly name: v.StringSchema<undefined>;
|
|
121
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
122
|
-
readonly type: v.LiteralSchema<"button", undefined>;
|
|
123
|
-
}, undefined>, v.ObjectSchema<{
|
|
124
|
-
readonly name: v.StringSchema<undefined>;
|
|
125
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
126
|
-
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
127
|
-
}, undefined>, v.ObjectSchema<{
|
|
128
|
-
readonly name: v.StringSchema<undefined>;
|
|
129
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
130
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
131
|
-
}, undefined>, v.ObjectSchema<{
|
|
132
|
-
readonly name: v.StringSchema<undefined>;
|
|
133
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
134
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
135
|
-
}, undefined>, v.ObjectSchema<{
|
|
136
|
-
readonly name: v.StringSchema<undefined>;
|
|
137
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
138
|
-
readonly type: v.LiteralSchema<"created_time", undefined>;
|
|
139
|
-
}, undefined>, v.ObjectSchema<{
|
|
140
|
-
readonly name: v.StringSchema<undefined>;
|
|
141
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
142
|
-
readonly type: v.LiteralSchema<"last_edited_time", undefined>;
|
|
143
|
-
}, undefined>, v.ObjectSchema<{
|
|
144
|
-
readonly name: v.StringSchema<undefined>;
|
|
145
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
146
|
-
readonly type: v.LiteralSchema<"created_by", undefined>;
|
|
147
|
-
}, undefined>, v.ObjectSchema<{
|
|
148
|
-
readonly name: v.StringSchema<undefined>;
|
|
149
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
150
|
-
readonly type: v.LiteralSchema<"last_edited_by", undefined>;
|
|
151
|
-
}, undefined>], undefined>, undefined>;
|
|
152
|
-
}, undefined>, undefined>;
|
|
153
|
-
readonly propertyIdsByKey: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>;
|
|
154
|
-
}, undefined>, undefined>;
|
|
155
|
-
}, undefined>;
|
|
156
|
-
}, undefined>;
|
|
157
|
-
export type DataSourcesChangedMessage = v.InferOutput<typeof dataSourcesChangedMessageSchema>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import * as v from "valibot";
|
|
2
|
-
import { notionDataSourceBindingsSchema } from "../dataSources/dataSource.js";
|
|
3
|
-
/**
|
|
4
|
-
* Message sent by the host whenever the custom block's data source mapping changes (e.g. a key is
|
|
5
|
-
* added, removed, or remapped). The SDK replaces its list of configured data sources but keeps any
|
|
6
|
-
* in-flight `useDataSource` query state for keys that still exist.
|
|
7
|
-
*/
|
|
8
|
-
export const dataSourcesChangedMessageSchema = v.object({
|
|
9
|
-
type: v.literal("dataSourcesChanged"),
|
|
10
|
-
dataSources: v.object({
|
|
11
|
-
bindings: notionDataSourceBindingsSchema,
|
|
12
|
-
}),
|
|
13
|
-
});
|