@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
|
@@ -2,6 +2,7 @@ import * as v from "valibot";
|
|
|
2
2
|
import { notionDataSourcePageForProtocol3To5Schema } from "../../compatibility/protocol3To5/dataSourcePage.js";
|
|
3
3
|
import { bridgePageSchema } from "../../pages/bridgePage.js";
|
|
4
4
|
import { notionDataSourceIdSchema } from "../../utils/ids.js";
|
|
5
|
+
import { bridgeArchiveStatusSchema } from "../bridgeArchiveStatus.js";
|
|
5
6
|
import { bridgeDataSourceFilterSchema } from "../filters/bridgeDataSourceFilter.js";
|
|
6
7
|
import { bridgeDataSourceSortSchema } from "../filters/bridgeDataSourceSort.js";
|
|
7
8
|
/**
|
|
@@ -20,6 +21,7 @@ export const queryDataSourceMessageSchema = v.object({
|
|
|
20
21
|
filter: v.optional(bridgeDataSourceFilterSchema),
|
|
21
22
|
/** Sandbox-resolved property sorts, in priority order. */
|
|
22
23
|
sorts: v.optional(v.array(bridgeDataSourceSortSchema)),
|
|
24
|
+
archive_status: v.optional(bridgeArchiveStatusSchema),
|
|
23
25
|
});
|
|
24
26
|
// The schema accepts any string code. The type lists known codes for
|
|
25
27
|
// autocomplete, with an open string fallback for newer senders.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
2
|
export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
3
3
|
readonly key: v.StringSchema<undefined>;
|
|
4
|
-
readonly
|
|
4
|
+
readonly dataSourcePointer: v.OptionalSchema<v.ObjectSchema<{
|
|
5
5
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
6
6
|
readonly table: v.StringSchema<undefined>;
|
|
7
7
|
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
@@ -11,7 +11,7 @@ export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
|
11
11
|
* schema to validate filter and sort references. Undefined when the host does not provide a
|
|
12
12
|
* database schema.
|
|
13
13
|
*/
|
|
14
|
-
readonly
|
|
14
|
+
readonly dataSourceSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
15
15
|
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
16
16
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
17
17
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -122,14 +122,6 @@ export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
|
122
122
|
readonly name: v.StringSchema<undefined>;
|
|
123
123
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
124
124
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
125
|
-
}, undefined>, v.ObjectSchema<{
|
|
126
|
-
readonly name: v.StringSchema<undefined>;
|
|
127
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
128
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
129
|
-
}, undefined>, v.ObjectSchema<{
|
|
130
|
-
readonly name: v.StringSchema<undefined>;
|
|
131
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
132
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
133
125
|
}, undefined>, v.ObjectSchema<{
|
|
134
126
|
readonly name: v.StringSchema<undefined>;
|
|
135
127
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -163,7 +155,7 @@ export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
|
163
155
|
* database properties when the host provides their schema.
|
|
164
156
|
*
|
|
165
157
|
* Use `propertiesById` to read a value. Use this map to read the value's schema. Use
|
|
166
|
-
* `
|
|
158
|
+
* `dataSourceSchema` to validate filter and sort references.
|
|
167
159
|
*/
|
|
168
160
|
readonly propertySchemasById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
169
161
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -274,14 +266,6 @@ export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
|
274
266
|
readonly name: v.StringSchema<undefined>;
|
|
275
267
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
276
268
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
277
|
-
}, undefined>, v.ObjectSchema<{
|
|
278
|
-
readonly name: v.StringSchema<undefined>;
|
|
279
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
280
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
281
|
-
}, undefined>, v.ObjectSchema<{
|
|
282
|
-
readonly name: v.StringSchema<undefined>;
|
|
283
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
284
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
285
269
|
}, undefined>, v.ObjectSchema<{
|
|
286
270
|
readonly name: v.StringSchema<undefined>;
|
|
287
271
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { dataSourcePointerValidator } from "./dataSourcePointer.js";
|
|
3
|
+
import { notionDataSourceSchemaValidator } from "./dataSourceSchema.js";
|
|
4
4
|
import { notionPropertySchemaSchema } from "./properties/propertySchema.js";
|
|
5
5
|
export const notionDataSourceSchema = v.object({
|
|
6
6
|
key: v.string(),
|
|
7
|
-
|
|
7
|
+
dataSourcePointer: v.optional(dataSourcePointerValidator),
|
|
8
8
|
/**
|
|
9
9
|
* Describes database properties. Use this schema to resolve property bindings. Use this
|
|
10
10
|
* schema to validate filter and sort references. Undefined when the host does not provide a
|
|
11
11
|
* database schema.
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
dataSourceSchema: v.optional(notionDataSourceSchemaValidator),
|
|
14
14
|
/**
|
|
15
15
|
* Maps user-defined property keys to database property IDs. Use this map to resolve a key
|
|
16
16
|
* such as `name` to its database property ID. A value of `undefined` marks a declared
|
|
@@ -26,7 +26,7 @@ export const notionDataSourceSchema = v.object({
|
|
|
26
26
|
* database properties when the host provides their schema.
|
|
27
27
|
*
|
|
28
28
|
* Use `propertiesById` to read a value. Use this map to read the value's schema. Use
|
|
29
|
-
* `
|
|
29
|
+
* `dataSourceSchema` to validate filter and sort references.
|
|
30
30
|
*/
|
|
31
31
|
propertySchemasById: v.record(v.string(), notionPropertySchemaSchema),
|
|
32
32
|
/**
|
|
@@ -29,13 +29,12 @@ export type NotionDualProperty = v.InferOutput<typeof notionDualPropertySchema>;
|
|
|
29
29
|
* Every Notion property type the bridge speaks, in a single readable list.
|
|
30
30
|
* Mirrors the Notion public API
|
|
31
31
|
* [property object](https://developers.notion.com/reference/property-object)
|
|
32
|
-
* type field. Internal-only types (`button`, `verification`,
|
|
33
|
-
* `last_visited_time`, `location`) and the four built-ins (`created_time`,
|
|
32
|
+
* type field. Internal-only types (`button`, `verification`) and the four built-ins (`created_time`,
|
|
34
33
|
* `last_edited_time`, `created_by`, `last_edited_by`) are included under their
|
|
35
34
|
* bridge-native names.
|
|
36
35
|
*/
|
|
37
|
-
export declare const NOTION_PROPERTY_TYPES: readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "
|
|
38
|
-
export declare const notionPropertyTypeSchema: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "
|
|
36
|
+
export declare const NOTION_PROPERTY_TYPES: readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "created_time", "last_edited_time", "created_by", "last_edited_by"];
|
|
37
|
+
export declare const notionPropertyTypeSchema: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "created_time", "last_edited_time", "created_by", "last_edited_by"], undefined>;
|
|
39
38
|
/**
|
|
40
39
|
* String literal union of every supported Notion property type. Same set as
|
|
41
40
|
* the discriminator in `NotionPropertySchema` — split out so the manifest
|
|
@@ -48,7 +47,7 @@ export type NotionPropertyType = v.InferOutput<typeof notionPropertyTypeSchema>;
|
|
|
48
47
|
* Keep this list narrower than {@link NOTION_PROPERTY_TYPES} when a property
|
|
49
48
|
* type is exposed but its sort value is not yet represented by every host.
|
|
50
49
|
*/
|
|
51
|
-
export declare const CUSTOM_BLOCK_DATA_SOURCE_SORTABLE_PROPERTY_TYPES: readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "date", "created_time", "last_edited_time", "people", "created_by"];
|
|
50
|
+
export declare const CUSTOM_BLOCK_DATA_SOURCE_SORTABLE_PROPERTY_TYPES: readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "date", "created_time", "last_edited_time", "people", "created_by", "last_edited_by"];
|
|
52
51
|
export type CustomBlockDataSourceSortablePropertyType = (typeof CUSTOM_BLOCK_DATA_SOURCE_SORTABLE_PROPERTY_TYPES)[number];
|
|
53
52
|
/**
|
|
54
53
|
* Per-property schema as exposed by the host over the custom-block bridge.
|
|
@@ -163,14 +162,6 @@ export declare const notionPropertySchemaSchema: v.VariantSchema<"type", [v.Obje
|
|
|
163
162
|
readonly name: v.StringSchema<undefined>;
|
|
164
163
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
165
164
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
166
|
-
}, undefined>, v.ObjectSchema<{
|
|
167
|
-
readonly name: v.StringSchema<undefined>;
|
|
168
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
169
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
170
|
-
}, undefined>, v.ObjectSchema<{
|
|
171
|
-
readonly name: v.StringSchema<undefined>;
|
|
172
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
173
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
174
165
|
}, undefined>, v.ObjectSchema<{
|
|
175
166
|
readonly name: v.StringSchema<undefined>;
|
|
176
167
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -50,8 +50,7 @@ const baseProp = v.object({
|
|
|
50
50
|
* Every Notion property type the bridge speaks, in a single readable list.
|
|
51
51
|
* Mirrors the Notion public API
|
|
52
52
|
* [property object](https://developers.notion.com/reference/property-object)
|
|
53
|
-
* type field. Internal-only types (`button`, `verification`,
|
|
54
|
-
* `last_visited_time`, `location`) and the four built-ins (`created_time`,
|
|
53
|
+
* type field. Internal-only types (`button`, `verification`) and the four built-ins (`created_time`,
|
|
55
54
|
* `last_edited_time`, `created_by`, `last_edited_by`) are included under their
|
|
56
55
|
* bridge-native names.
|
|
57
56
|
*/
|
|
@@ -76,8 +75,6 @@ export const NOTION_PROPERTY_TYPES = [
|
|
|
76
75
|
"rollup",
|
|
77
76
|
"button",
|
|
78
77
|
"verification",
|
|
79
|
-
"last_visited_time",
|
|
80
|
-
"location",
|
|
81
78
|
"created_time",
|
|
82
79
|
"last_edited_time",
|
|
83
80
|
"created_by",
|
|
@@ -102,6 +99,7 @@ export const CUSTOM_BLOCK_DATA_SOURCE_SORTABLE_PROPERTY_TYPES = [
|
|
|
102
99
|
"last_edited_time",
|
|
103
100
|
"people",
|
|
104
101
|
"created_by",
|
|
102
|
+
"last_edited_by",
|
|
105
103
|
];
|
|
106
104
|
/**
|
|
107
105
|
* Per-property schema as exposed by the host over the custom-block bridge.
|
|
@@ -147,8 +145,6 @@ export const notionPropertySchemaSchema = v.variant("type", [
|
|
|
147
145
|
// Internal-only types passed through under their bridge-native names.
|
|
148
146
|
v.object({ ...baseProp.entries, type: v.literal("button") }),
|
|
149
147
|
v.object({ ...baseProp.entries, type: v.literal("verification") }),
|
|
150
|
-
v.object({ ...baseProp.entries, type: v.literal("last_visited_time") }),
|
|
151
|
-
v.object({ ...baseProp.entries, type: v.literal("location") }),
|
|
152
148
|
// Synthetic built-ins. The host always emits one of each per data source.
|
|
153
149
|
v.object({ ...baseProp.entries, type: v.literal("created_time") }),
|
|
154
150
|
v.object({ ...baseProp.entries, type: v.literal("last_edited_time") }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { BridgeManifestDataSource } from "../manifest/manifest.js";
|
|
2
|
+
import type { NotionDataSourceSchema } from "./dataSourceSchema.js";
|
|
3
3
|
export type MappedPropertyBinding = {
|
|
4
4
|
status: "mapped";
|
|
5
5
|
propertyKey: string;
|
|
@@ -26,7 +26,7 @@ export type ResolvedDataSourceBinding = {
|
|
|
26
26
|
* Each boundary calls this independently and chooses its own errors or UI behavior.
|
|
27
27
|
*/
|
|
28
28
|
export declare function resolveDataSourceBinding(args: {
|
|
29
|
-
manifestDataSource:
|
|
30
|
-
|
|
29
|
+
manifestDataSource: BridgeManifestDataSource;
|
|
30
|
+
dataSourceSchema: Pick<NotionDataSourceSchema, "propertiesById"> | undefined;
|
|
31
31
|
propertyIdsByKey: Record<string, string | undefined> | undefined;
|
|
32
32
|
}): ResolvedDataSourceBinding;
|
|
@@ -7,10 +7,10 @@ export function resolveDataSourceBinding(args) {
|
|
|
7
7
|
const propertyId = args.propertyIdsByKey?.[propertyKey];
|
|
8
8
|
const mappedSchema = propertyId === undefined
|
|
9
9
|
? undefined
|
|
10
|
-
: args.
|
|
10
|
+
: args.dataSourceSchema?.propertiesById[propertyId];
|
|
11
11
|
return resolvePropertyBinding(propertyKey, propertyId, mappedSchema?.type, property.type);
|
|
12
12
|
});
|
|
13
|
-
if (args.
|
|
13
|
+
if (args.dataSourceSchema === undefined) {
|
|
14
14
|
return { status: "missing_schema", properties };
|
|
15
15
|
}
|
|
16
16
|
if (properties.every(property => property.status === "mapped")) {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export declare const bridgeExternalFileSchema: v.ObjectSchema<{
|
|
3
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
4
|
+
readonly external: v.ObjectSchema<{
|
|
5
|
+
readonly url: v.StringSchema<undefined>;
|
|
6
|
+
}, undefined>;
|
|
7
|
+
}, undefined>;
|
|
8
|
+
export type BridgeExternalFile = v.InferOutput<typeof bridgeExternalFileSchema>;
|
|
9
|
+
export declare const bridgeNotionHostedFileSchema: v.ObjectSchema<{
|
|
10
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
11
|
+
readonly file: v.ObjectSchema<{
|
|
12
|
+
readonly url: v.StringSchema<undefined>;
|
|
13
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
14
|
+
}, undefined>;
|
|
15
|
+
}, undefined>;
|
|
16
|
+
export type BridgeNotionHostedFile = v.InferOutput<typeof bridgeNotionHostedFileSchema>;
|
|
17
|
+
/** Property entries add a display label stored in Notion, independent of the file URL. */
|
|
18
|
+
export declare const bridgeFilePropertyItemSchema: v.UnionSchema<[v.ObjectSchema<{
|
|
19
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
20
|
+
readonly external: v.ObjectSchema<{
|
|
21
|
+
readonly url: v.StringSchema<undefined>;
|
|
22
|
+
}, undefined>;
|
|
23
|
+
readonly name: v.StringSchema<undefined>;
|
|
24
|
+
}, undefined>, v.ObjectSchema<{
|
|
25
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
26
|
+
readonly file: v.ObjectSchema<{
|
|
27
|
+
readonly url: v.StringSchema<undefined>;
|
|
28
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
29
|
+
}, undefined>;
|
|
30
|
+
readonly name: v.StringSchema<undefined>;
|
|
31
|
+
}, undefined>], undefined>;
|
|
32
|
+
export type BridgeFilePropertyItem = v.InferOutput<typeof bridgeFilePropertyItemSchema>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
export const bridgeExternalFileSchema = v.object({
|
|
3
|
+
type: v.literal("external"),
|
|
4
|
+
external: v.object({ url: v.string() }),
|
|
5
|
+
});
|
|
6
|
+
export const bridgeNotionHostedFileSchema = v.object({
|
|
7
|
+
type: v.literal("file"),
|
|
8
|
+
file: v.object({
|
|
9
|
+
url: v.string(),
|
|
10
|
+
expiry_time: v.optional(v.string()),
|
|
11
|
+
}),
|
|
12
|
+
});
|
|
13
|
+
/** Property entries add a display label stored in Notion, independent of the file URL. */
|
|
14
|
+
export const bridgeFilePropertyItemSchema = v.union([
|
|
15
|
+
v.object({ ...bridgeExternalFileSchema.entries, name: v.string() }),
|
|
16
|
+
v.object({ ...bridgeNotionHostedFileSchema.entries, name: v.string() }),
|
|
17
|
+
]);
|
|
@@ -35,12 +35,23 @@ export declare const connectMessageSchema: v.VariantSchema<"status", [v.ObjectSc
|
|
|
35
35
|
readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
36
36
|
readonly name: v.StringSchema<undefined>;
|
|
37
37
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
38
|
-
readonly type: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "
|
|
38
|
+
readonly type: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "created_time", "last_edited_time", "created_by", "last_edited_by"], undefined>;
|
|
39
39
|
}, undefined>, undefined>, {}>;
|
|
40
40
|
}, undefined>, undefined>, {}>;
|
|
41
|
-
readonly
|
|
42
|
-
readonly
|
|
43
|
-
readonly
|
|
41
|
+
readonly pages: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
42
|
+
readonly name: v.StringSchema<undefined>;
|
|
43
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
44
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
45
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
46
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
47
|
+
}, undefined>, v.ObjectSchema<{
|
|
48
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
49
|
+
readonly url: v.StringSchema<undefined>;
|
|
50
|
+
}, undefined>], undefined>, undefined>;
|
|
51
|
+
}, undefined>, undefined>, undefined>;
|
|
52
|
+
readonly grants: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
53
|
+
readonly action: v.StringSchema<undefined>;
|
|
54
|
+
readonly resource: v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>], undefined>;
|
|
44
55
|
}, undefined>, undefined>, undefined>;
|
|
45
56
|
}, undefined>, undefined>;
|
|
46
57
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -50,6 +50,9 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
50
50
|
}, undefined>, v.ObjectSchema<{
|
|
51
51
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
52
52
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
53
|
+
}, undefined>, v.ObjectSchema<{
|
|
54
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
55
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
53
56
|
}, undefined>, v.ObjectSchema<{
|
|
54
57
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
55
58
|
}, undefined>], undefined>;
|
|
@@ -73,6 +76,9 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
73
76
|
}, undefined>, v.ObjectSchema<{
|
|
74
77
|
readonly type: v.LiteralSchema<"agent_id", undefined>;
|
|
75
78
|
readonly agent_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAgentId">]>;
|
|
79
|
+
}, undefined>, v.ObjectSchema<{
|
|
80
|
+
readonly type: v.LiteralSchema<"app_installation_id", undefined>;
|
|
81
|
+
readonly app_installation_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionAppInstallationId">]>;
|
|
76
82
|
}, undefined>, v.ObjectSchema<{
|
|
77
83
|
readonly type: v.LiteralSchema<"unavailable", undefined>;
|
|
78
84
|
}, undefined>], undefined>;
|
|
@@ -99,22 +105,33 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
99
105
|
readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
100
106
|
readonly name: v.StringSchema<undefined>;
|
|
101
107
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
102
|
-
readonly type: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "
|
|
108
|
+
readonly type: v.PicklistSchema<readonly ["title", "rich_text", "number", "checkbox", "url", "email", "phone_number", "select", "multi_select", "status", "date", "people", "files", "unique_id", "relation", "place", "formula", "rollup", "button", "verification", "created_time", "last_edited_time", "created_by", "last_edited_by"], undefined>;
|
|
103
109
|
}, undefined>, undefined>, {}>;
|
|
104
110
|
}, undefined>, undefined>, {}>;
|
|
105
|
-
readonly
|
|
106
|
-
readonly
|
|
107
|
-
readonly
|
|
111
|
+
readonly pages: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
112
|
+
readonly name: v.StringSchema<undefined>;
|
|
113
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
114
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
115
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
116
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
117
|
+
}, undefined>, v.ObjectSchema<{
|
|
118
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
119
|
+
readonly url: v.StringSchema<undefined>;
|
|
120
|
+
}, undefined>], undefined>, undefined>;
|
|
121
|
+
}, undefined>, undefined>, undefined>;
|
|
122
|
+
readonly grants: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
123
|
+
readonly action: v.StringSchema<undefined>;
|
|
124
|
+
readonly resource: v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>], undefined>;
|
|
108
125
|
}, undefined>, undefined>, undefined>;
|
|
109
126
|
}, undefined>;
|
|
110
127
|
readonly dataSources: v.ObjectSchema<{
|
|
111
128
|
readonly bindings: v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
112
|
-
readonly
|
|
129
|
+
readonly dataSourcePointer: v.OptionalSchema<v.ObjectSchema<{
|
|
113
130
|
readonly id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
114
131
|
readonly table: v.StringSchema<undefined>;
|
|
115
132
|
readonly spaceId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionSpaceId">]>, undefined>;
|
|
116
133
|
}, undefined>, undefined>;
|
|
117
|
-
readonly
|
|
134
|
+
readonly dataSourceSchema: v.OptionalSchema<v.ObjectSchema<{
|
|
118
135
|
readonly id: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>, undefined>;
|
|
119
136
|
readonly propertiesById: v.RecordSchema<v.StringSchema<undefined>, v.VariantSchema<"type", [v.ObjectSchema<{
|
|
120
137
|
readonly name: v.StringSchema<undefined>;
|
|
@@ -225,14 +242,6 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
225
242
|
readonly name: v.StringSchema<undefined>;
|
|
226
243
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
227
244
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
228
|
-
}, undefined>, v.ObjectSchema<{
|
|
229
|
-
readonly name: v.StringSchema<undefined>;
|
|
230
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
231
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
232
|
-
}, undefined>, v.ObjectSchema<{
|
|
233
|
-
readonly name: v.StringSchema<undefined>;
|
|
234
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
235
|
-
readonly type: v.LiteralSchema<"location", undefined>;
|
|
236
245
|
}, undefined>, v.ObjectSchema<{
|
|
237
246
|
readonly name: v.StringSchema<undefined>;
|
|
238
247
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/** Icon names stay open as hosts add to their catalogs. */
|
|
3
|
+
export declare const bridgeIconNameSchema: v.StringSchema<undefined>;
|
|
4
|
+
export type BridgeIconName = v.InferOutput<typeof bridgeIconNameSchema>;
|
|
5
|
+
declare const knownBridgeIconColorSchema: v.PicklistSchema<["gray", "lightgray", "brown", "yellow", "orange", "green", "blue", "purple", "pink", "red"], undefined>;
|
|
6
|
+
/** Known colors remain discoverable while reads and writes accept future colors. */
|
|
7
|
+
export type BridgeIconColor = v.InferOutput<typeof knownBridgeIconColorSchema> | (string & {});
|
|
8
|
+
export declare const bridgeIconColorSchema: v.GenericSchema<BridgeIconColor>;
|
|
9
|
+
/** Reads and writes share an open shape; hosts resolve names and default omitted colors. */
|
|
10
|
+
export declare const bridgeIconSchema: v.LooseObjectSchema<{
|
|
11
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
12
|
+
readonly icon: v.LooseObjectSchema<{
|
|
13
|
+
readonly name: v.StringSchema<undefined>;
|
|
14
|
+
readonly color: v.OptionalSchema<v.GenericSchema<BridgeIconColor>, undefined>;
|
|
15
|
+
}, undefined>;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
export type BridgeIcon = v.InferOutput<typeof bridgeIconSchema>;
|
|
18
|
+
export declare const bridgeEmojiSchema: v.ObjectSchema<{
|
|
19
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
20
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
21
|
+
}, undefined>;
|
|
22
|
+
export type BridgeEmoji = v.InferOutput<typeof bridgeEmojiSchema>;
|
|
23
|
+
export declare const bridgeCustomEmojiSchema: v.ObjectSchema<{
|
|
24
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
25
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
26
|
+
readonly id: v.StringSchema<undefined>;
|
|
27
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
28
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
29
|
+
}, undefined>;
|
|
30
|
+
}, undefined>;
|
|
31
|
+
export type BridgeCustomEmoji = v.InferOutput<typeof bridgeCustomEmojiSchema>;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/** Icon names stay open as hosts add to their catalogs. */
|
|
3
|
+
export const bridgeIconNameSchema = v.string();
|
|
4
|
+
const knownBridgeIconColorSchema = v.picklist([
|
|
5
|
+
"gray",
|
|
6
|
+
"lightgray",
|
|
7
|
+
"brown",
|
|
8
|
+
"yellow",
|
|
9
|
+
"orange",
|
|
10
|
+
"green",
|
|
11
|
+
"blue",
|
|
12
|
+
"purple",
|
|
13
|
+
"pink",
|
|
14
|
+
"red",
|
|
15
|
+
]);
|
|
16
|
+
export const bridgeIconColorSchema = v.union([
|
|
17
|
+
knownBridgeIconColorSchema,
|
|
18
|
+
v.string(),
|
|
19
|
+
]);
|
|
20
|
+
/** Reads and writes share an open shape; hosts resolve names and default omitted colors. */
|
|
21
|
+
export const bridgeIconSchema = v.looseObject({
|
|
22
|
+
type: v.literal("icon"),
|
|
23
|
+
icon: v.looseObject({
|
|
24
|
+
name: bridgeIconNameSchema,
|
|
25
|
+
color: v.optional(bridgeIconColorSchema),
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
export const bridgeEmojiSchema = v.object({
|
|
29
|
+
type: v.literal("emoji"),
|
|
30
|
+
emoji: v.string(),
|
|
31
|
+
});
|
|
32
|
+
export const bridgeCustomEmojiSchema = v.object({
|
|
33
|
+
type: v.literal("custom_emoji"),
|
|
34
|
+
custom_emoji: v.object({
|
|
35
|
+
id: v.string(),
|
|
36
|
+
name: v.optional(v.string()),
|
|
37
|
+
url: v.optional(v.string()),
|
|
38
|
+
}),
|
|
39
|
+
});
|
package/dist/protocol/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export type { NotionDataSourcePageForProtocol3To5 } from "./compatibility/protoc
|
|
|
5
5
|
export { notionDataSourcePageForProtocol3To5Schema } from "./compatibility/protocol3To5/dataSourcePage.js";
|
|
6
6
|
export type { NotionDataSourceValue } from "./compatibility/protocol3To5/dataSourceValue.js";
|
|
7
7
|
export { notionDataSourceValueSchema } from "./compatibility/protocol3To5/dataSourceValue.js";
|
|
8
|
+
export type { DataSourceBindingsMessageForProtocol3To10 } from "./compatibility/protocol3To10/dataSourceBindings.js";
|
|
9
|
+
export { bridgeDataSourceBindingsForProtocol3To10Schema, dataSourceBindingsMessageForProtocol3To10Schema, } from "./compatibility/protocol3To10/dataSourceBindings.js";
|
|
8
10
|
export type { CustomBlockPage } from "./context/containingPage.js";
|
|
9
11
|
export { customBlockPageSchema } from "./context/containingPage.js";
|
|
10
12
|
export type { NotionContrastMode } from "./context/contrast.js";
|
|
@@ -19,17 +21,20 @@ export type { ResizeMessage } from "./context/messages/resize.js";
|
|
|
19
21
|
export { resizeMessageSchema } from "./context/messages/resize.js";
|
|
20
22
|
export type { ThemeChangedMessage } from "./context/messages/themeChanged.js";
|
|
21
23
|
export { themeChangedMessageSchema } from "./context/messages/themeChanged.js";
|
|
22
|
-
export type { DataSourceParent, NotionParent, PageParent, } from "./context/parent.js";
|
|
24
|
+
export type { BridgeParent, DataSourceParent, NotionParent, PageParent, } from "./context/parent.js";
|
|
23
25
|
export { dataSourceParentSchema, notionParentSchema, pageParentSchema, } from "./context/parent.js";
|
|
24
26
|
export type { NotionTheme } from "./context/theme.js";
|
|
25
27
|
export { notionThemeSchema } from "./context/theme.js";
|
|
28
|
+
export type { BridgeArchiveStatus } from "./dataSources/bridgeArchiveStatus.js";
|
|
29
|
+
export { bridgeArchiveStatusSchema } from "./dataSources/bridgeArchiveStatus.js";
|
|
26
30
|
export type { BridgeDataSourceBinding } from "./dataSources/bridgeDataSourceBinding.js";
|
|
27
31
|
export { bridgeDataSourceBindingSchema } from "./dataSources/bridgeDataSourceBinding.js";
|
|
28
32
|
export type { BridgeDataSourceBindings } from "./dataSources/bridgeDataSourceBindings.js";
|
|
29
33
|
export { bridgeDataSourceBindingsSchema } from "./dataSources/bridgeDataSourceBindings.js";
|
|
30
|
-
export type {
|
|
31
|
-
export
|
|
32
|
-
export {
|
|
34
|
+
export type { NotionDataSourcePointer } from "./dataSources/dataSourcePointer.js";
|
|
35
|
+
export { dataSourcePointerValidator } from "./dataSources/dataSourcePointer.js";
|
|
36
|
+
export type { NotionDataSourceSchema } from "./dataSources/dataSourceSchema.js";
|
|
37
|
+
export { notionDataSourceSchemaValidator } from "./dataSources/dataSourceSchema.js";
|
|
33
38
|
export type { CustomBlockDataSourceResolutionErrorCode, CustomBlockDataSourceResolutionErrorInfo, CustomBlockPropertyErrorCode, CustomBlockPropertyErrorInfo, } from "./dataSources/errors.js";
|
|
34
39
|
export { customBlockDataSourceResolutionErrorCodeSchema, customBlockPropertyErrorCodeSchema, } from "./dataSources/errors.js";
|
|
35
40
|
export type { BridgeDataSourceFilter } from "./dataSources/filters/bridgeDataSourceFilter.js";
|
|
@@ -42,8 +47,6 @@ export type { CustomBlockCheckboxFilterOperator } from "./dataSources/filters/ch
|
|
|
42
47
|
export { customBlockCheckboxFilterOperatorSchema } from "./dataSources/filters/checkboxFilterOperator.js";
|
|
43
48
|
export type { CustomBlockContainsFilterOperator } from "./dataSources/filters/containsFilterOperator.js";
|
|
44
49
|
export { customBlockContainsFilterOperatorSchema } from "./dataSources/filters/containsFilterOperator.js";
|
|
45
|
-
export type { CustomBlockCreatedByFilterOperator } from "./dataSources/filters/createdByFilterOperator.js";
|
|
46
|
-
export { customBlockCreatedByFilterOperatorSchema } from "./dataSources/filters/createdByFilterOperator.js";
|
|
47
50
|
export type { CustomBlockDateFilterOperator, CustomBlockRelativeDateValue, } from "./dataSources/filters/dateFilterOperator.js";
|
|
48
51
|
export { customBlockDateFilterOperatorSchema, customBlockRelativeDateValueSchema, } from "./dataSources/filters/dateFilterOperator.js";
|
|
49
52
|
export type { CustomBlockNumberFilterOperator } from "./dataSources/filters/numberFilterOperator.js";
|
|
@@ -60,6 +63,8 @@ export type { CustomBlockStatusGroupFilterOperator, CustomBlockStatusGroupName,
|
|
|
60
63
|
export { customBlockStatusGroupFilterOperatorSchema, customBlockStatusGroupNameSchema, } from "./dataSources/filters/statusGroupFilterOperator.js";
|
|
61
64
|
export type { CustomBlockTextFilterOperator } from "./dataSources/filters/textFilterOperator.js";
|
|
62
65
|
export { customBlockTextFilterOperatorSchema } from "./dataSources/filters/textFilterOperator.js";
|
|
66
|
+
export type { CustomBlockTimestampFilterOperator } from "./dataSources/filters/timestampFilterOperator.js";
|
|
67
|
+
export { customBlockTimestampFilterOperatorSchema } from "./dataSources/filters/timestampFilterOperator.js";
|
|
63
68
|
export type { MakeBridgeDataSourceBindingArgs } from "./dataSources/makeBridgeDataSourceBinding.js";
|
|
64
69
|
export { makeBridgeDataSourceBinding } from "./dataSources/makeBridgeDataSourceBinding.js";
|
|
65
70
|
export type { DataSourcesChangedMessage } from "./dataSources/messages/dataSourcesChanged.js";
|
|
@@ -78,6 +83,7 @@ export type { MappedPropertyBinding, ResolvedDataSourceBinding, ResolvedProperty
|
|
|
78
83
|
export { resolveDataSourceBinding } from "./dataSources/resolveDataSourceBinding.js";
|
|
79
84
|
export type { NotionSortDirection } from "./dataSources/sortDirection.js";
|
|
80
85
|
export { notionSortDirectionSchema } from "./dataSources/sortDirection.js";
|
|
86
|
+
export * from "./files.js";
|
|
81
87
|
export type { ConnectMessage } from "./handshake/connect.js";
|
|
82
88
|
export { connectMessageSchema } from "./handshake/connect.js";
|
|
83
89
|
export type { CustomBlockInitErrorCode, CustomBlockInitErrorInfo, CustomBlockInitializationErrorCode, CustomBlockInitializationErrorInfo, InitMessage, } from "./handshake/init.js";
|
|
@@ -85,10 +91,11 @@ export { CustomBlockInitializationError, customBlockInitErrorCodeSchema, customB
|
|
|
85
91
|
export type { CustomBlockInitResultErrorCode, CustomBlockInitResultErrorInfo, InitResultMessage, } from "./handshake/initResult.js";
|
|
86
92
|
export { customBlockInitResultErrorCodeSchema, customBlockInitResultErrorInfoSchema, initResultMessageSchema, } from "./handshake/initResult.js";
|
|
87
93
|
export { isInitHandshakeMessage } from "./handshake/isInitHandshakeMessage.js";
|
|
88
|
-
export
|
|
89
|
-
export {
|
|
90
|
-
export
|
|
91
|
-
export {
|
|
94
|
+
export * from "./icons.js";
|
|
95
|
+
export type { CustomBlockDataSourceResourceName, CustomBlockGrant, CustomBlockGrantAction, CustomBlockGrantResourceName, CustomBlockOriginResourceName, } from "./manifest/grants.js";
|
|
96
|
+
export { customBlockGrantSchema } from "./manifest/grants.js";
|
|
97
|
+
export type { BridgeCustomBlockManifest, BridgeManifestDataSource, BridgeManifestIcon, BridgeManifestProperty, ManifestPage, } from "./manifest/manifest.js";
|
|
98
|
+
export { bridgeManifestDataSourceSchema, bridgeManifestIconSchema, bridgeManifestPropertySchema, manifestPageSchema, manifestSchema, } from "./manifest/manifest.js";
|
|
92
99
|
export type { HostToSandboxMessage, HostToSandboxMessageWithProtocol3To5Compatibility, } from "./messages/hostToSandbox.js";
|
|
93
100
|
export { hostToSandboxMessageSchema, hostToSandboxMessageWithProtocol3To5CompatibilitySchema, } from "./messages/hostToSandbox.js";
|
|
94
101
|
export { readIncomingType } from "./messages/incomingType.js";
|
|
@@ -106,21 +113,19 @@ export { bridgePageSchema } from "./pages/bridgePage.js";
|
|
|
106
113
|
export type { MakeBridgePageArgs } from "./pages/makeBridgePage.js";
|
|
107
114
|
export { makeBridgePage } from "./pages/makeBridgePage.js";
|
|
108
115
|
export type { CreatePageMessage, CreatePageMessageParent, CreatePageResultMessage, CreatePageResultMessageWithProtocol3To5Compatibility, CustomBlockCreatePageErrorCode, CustomBlockCreatePageErrorInfo, NotionCreatePagePosition, } from "./pages/messages/createPage.js";
|
|
109
|
-
export { createPageMessageSchema, createPageParentSchema, createPageResultMessageSchema, createPageResultMessageWithProtocol3To5CompatibilitySchema, customBlockCreatePageErrorCodeSchema, customBlockCreatePageErrorInfoSchema, notionCreatePagePositionSchema, } from "./pages/messages/createPage.js";
|
|
116
|
+
export { createPageArgsSchema, createPageMessageSchema, createPageParentSchema, createPageResultMessageSchema, createPageResultMessageWithProtocol3To5CompatibilitySchema, customBlockCreatePageErrorCodeSchema, customBlockCreatePageErrorInfoSchema, notionCreatePagePositionSchema, } from "./pages/messages/createPage.js";
|
|
110
117
|
export type { CustomBlockGetPageErrorCode, CustomBlockGetPageErrorInfo, GetPageMessage, GetPageResultMessage, GetPageResultMessageWithProtocol3To5Compatibility, } from "./pages/messages/getPage.js";
|
|
111
118
|
export { customBlockGetPageErrorCodeSchema, customBlockGetPageErrorInfoSchema, getPageMessageSchema, getPageResultMessageSchema, getPageResultMessageWithProtocol3To5CompatibilitySchema, } from "./pages/messages/getPage.js";
|
|
112
119
|
export type { CustomBlockOpenPageErrorCode, CustomBlockOpenPageErrorInfo, OpenPageMessage, OpenPageMode, OpenPageResultMessage, } from "./pages/messages/openPage.js";
|
|
113
120
|
export { customBlockOpenPageErrorCodeSchema, customBlockOpenPageErrorInfoSchema, openPageMessageSchema, openPageModeSchema, openPageResultMessageSchema, } from "./pages/messages/openPage.js";
|
|
114
121
|
export type { CustomBlockUpdatePageErrorCode, CustomBlockUpdatePageErrorInfo, UpdatePageMessage, UpdatePageResultMessage, UpdatePageResultMessageWithProtocol3To5Compatibility, } from "./pages/messages/updatePage.js";
|
|
115
122
|
export { customBlockUpdatePageErrorCodeSchema, customBlockUpdatePageErrorInfoSchema, updatePageMessageSchema, updatePageResultMessageSchema, updatePageResultMessageWithProtocol3To5CompatibilitySchema, } from "./pages/messages/updatePage.js";
|
|
116
|
-
export type
|
|
117
|
-
export { notionCustomEmojiIconSchema, notionEmojiIconSchema, notionExternalFileSchema, notionHostedFileSchema, notionPageCoverSchema, notionPageIconSchema, } from "./pages/pageAppearance.js";
|
|
123
|
+
export { type BridgePageCover, type BridgePageIcon, bridgePageCoverSchema, bridgePageIconSchema, } from "./pages/pageAppearance.js";
|
|
118
124
|
export type { BridgePagePropertyReadMap, BridgePagePropertyWriteMap, } from "./pages/properties/bridgePagePropertyMaps.js";
|
|
119
125
|
export { bridgePagePropertyReadMapSchema, bridgePagePropertyWriteMapSchema, } from "./pages/properties/bridgePagePropertyMaps.js";
|
|
120
126
|
export type { BridgePagePropertyValue } from "./pages/properties/bridgePagePropertyValue.js";
|
|
121
127
|
export { bridgePagePropertyValueSchema } from "./pages/properties/bridgePagePropertyValue.js";
|
|
122
128
|
export type { NotionDateInput } from "./pages/properties/dateInput.js";
|
|
123
|
-
export type { NotionFileInput } from "./pages/properties/fileInput.js";
|
|
124
129
|
export type { NotionPlaceInput } from "./pages/properties/placeInput.js";
|
|
125
130
|
export type { NotionRelationInput } from "./pages/properties/relationInput.js";
|
|
126
131
|
export type { NotionRichTextItem } from "./pages/properties/richText.js";
|
|
@@ -140,11 +145,12 @@ export type { CustomBlockListUsersErrorCode, CustomBlockListUsersErrorInfo, List
|
|
|
140
145
|
export { customBlockListUsersErrorCodeSchema, customBlockListUsersErrorInfoSchema, listUsersMessageSchema, listUsersResultMessageSchema, } from "./users/messages/listUsers.js";
|
|
141
146
|
export type { NotionUserId } from "./users/userId.js";
|
|
142
147
|
export { notionUserIdSchema } from "./users/userId.js";
|
|
143
|
-
export type {
|
|
144
|
-
export {
|
|
145
|
-
export type { NotionAgentId, NotionBlockId, NotionDataSourceId, NotionPageId, NotionSpaceId, } from "./utils/ids.js";
|
|
146
|
-
export { notionAgentIdSchema, notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, notionSpaceIdSchema, } from "./utils/ids.js";
|
|
148
|
+
export type { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode, CustomBlockRequestErrorCode, } from "./utils/errors.js";
|
|
149
|
+
export { customBlockErrorInfoSchema, NOT_GRANTED_ERROR_CODE, } from "./utils/errors.js";
|
|
150
|
+
export type { NotionAgentId, NotionAppInstallationId, NotionBlockId, NotionDataSourceId, NotionPageId, NotionSpaceId, } from "./utils/ids.js";
|
|
151
|
+
export { notionAgentIdSchema, notionAppInstallationIdSchema, notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, notionSpaceIdSchema, } from "./utils/ids.js";
|
|
147
152
|
export { isLocalBlockServerUrl } from "./utils/isLocalBlockServerUrl.js";
|
|
148
|
-
export { LATEST_BRIDGE_PROTOCOL_VERSION, TEXT_FALLBACK_PROPERTY_PROTOCOL_VERSION, UNIFIED_PAGE_PROTOCOL_VERSION, } from "./utils/protocolVersion.js";
|
|
153
|
+
export { DATA_SOURCE_NAMING_PROTOCOL_VERSION, LATEST_BRIDGE_PROTOCOL_VERSION, NATIVE_ICON_PROTOCOL_VERSION, TEXT_FALLBACK_PROPERTY_PROTOCOL_VERSION, UNIFIED_PAGE_PROTOCOL_VERSION, } from "./utils/protocolVersion.js";
|
|
154
|
+
export { readRequestId } from "./utils/readRequestId.js";
|
|
149
155
|
export type { NotionRecordPointer } from "./utils/recordPointer.js";
|
|
150
156
|
export { notionRecordPointerSchema } from "./utils/recordPointer.js";
|