@notionhq/custom-blocks-host 0.5.2 → 0.6.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 +9 -0
- package/dist/browser.js +1 -1
- package/dist/compatibility/normalizeHostToSandboxMessage.d.ts.map +1 -1
- package/dist/compatibility/normalizeHostToSandboxMessage.js +5 -1
- package/dist/compatibility/normalizeSandboxToHostMessage.d.ts +87 -1
- package/dist/compatibility/normalizeSandboxToHostMessage.d.ts.map +1 -1
- package/dist/compatibility/pages/toIconForProtocol3To8.d.ts +4 -0
- package/dist/compatibility/pages/toIconForProtocol3To8.d.ts.map +1 -0
- package/dist/compatibility/pages/toIconForProtocol3To8.js +13 -0
- package/dist/compatibility/protocol3To5/toPageForProtocol3To5.d.ts.map +1 -1
- package/dist/compatibility/protocol3To5/toPageForProtocol3To5.js +2 -1
- package/dist/compatibility/protocol3To5/toQueryPageForProtocol3To5.d.ts +8 -8
- package/dist/compatibility/protocol6/normalizePageResultsForProtocol6.d.ts.map +1 -1
- package/dist/compatibility/protocol6/normalizePageResultsForProtocol6.js +9 -2
- package/dist/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.d.ts +4 -0
- package/dist/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.d.ts.map +1 -0
- package/dist/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.js +16 -0
- package/dist/createCustomBlockHost.d.ts.map +1 -1
- package/dist/createCustomBlockHost.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/messages/createSandboxMessageRouter.d.ts +3 -2
- package/dist/messages/createSandboxMessageRouter.d.ts.map +1 -1
- package/dist/messages/createSandboxMessageRouter.js +7 -1
- package/dist/messages/invalidNativeIconColor.d.ts +5 -0
- package/dist/messages/invalidNativeIconColor.d.ts.map +1 -0
- package/dist/messages/invalidNativeIconColor.js +34 -0
- package/dist/pages/types.d.ts +2 -0
- package/dist/pages/types.d.ts.map +1 -1
- package/dist/protocol/compatibility/protocol3To5/bridgePage.d.ts +7 -1
- package/dist/protocol/dataSources/messages/queryDataSource.d.ts +14 -2
- package/dist/protocol/icons.d.ts +17 -0
- package/dist/protocol/icons.js +27 -0
- package/dist/protocol/index.d.ts +3 -2
- package/dist/protocol/index.js +3 -2
- package/dist/protocol/messages/hostToSandbox.d.ts +77 -11
- package/dist/protocol/messages/sandboxToHost.d.ts +87 -1
- package/dist/protocol/pages/bridgePage.d.ts +7 -1
- package/dist/protocol/pages/messages/createPage.d.ts +102 -4
- package/dist/protocol/pages/messages/createPage.js +3 -1
- package/dist/protocol/pages/messages/getPage.d.ts +21 -3
- package/dist/protocol/pages/messages/updatePage.d.ts +29 -5
- package/dist/protocol/pages/pageAppearance.d.ts +36 -1
- package/dist/protocol/pages/pageAppearance.js +9 -0
- package/dist/protocol/utils/protocolVersion.d.ts +2 -1
- package/dist/protocol/utils/protocolVersion.js +3 -1
- package/docs/bridge/changelog.md +12 -0
- package/docs/bridge/protocol.md +11 -0
- package/docs/bridge/versioning.md +1 -0
- package/docs/compatibility.md +15 -7
- package/package.json +1 -1
- package/src/compatibility/normalizeHostToSandboxMessage.ts +5 -0
- package/src/compatibility/pages/toIconForProtocol3To8.ts +17 -0
- package/src/compatibility/protocol3To5/toPageForProtocol3To5.ts +2 -1
- package/src/compatibility/protocol6/normalizePageResultsForProtocol6.ts +11 -2
- package/src/compatibility/protocol7To8/normalizePageResultsForProtocol7To8.ts +22 -0
- package/src/createCustomBlockHost.ts +1 -0
- package/src/index.ts +1 -0
- package/src/messages/createSandboxMessageRouter.ts +18 -2
- package/src/messages/invalidNativeIconColor.ts +43 -0
- package/src/pages/types.ts +3 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { toIconForProtocol3To8 } from "../pages/toIconForProtocol3To8.js";
|
|
2
|
+
/** Encodes icons for protocols 7–8. Delete when the runtime minimum reaches 9. */
|
|
3
|
+
export function normalizePageResultsForProtocol7To8(message) {
|
|
4
|
+
if (message.type === "queryDataSourceResult") {
|
|
5
|
+
if (!message.items.some(page => page.icon?.type === "icon")) {
|
|
6
|
+
return message;
|
|
7
|
+
}
|
|
8
|
+
return { ...message, items: message.items.map(toPageWithoutNativeIcon) };
|
|
9
|
+
}
|
|
10
|
+
const page = toPageWithoutNativeIcon(message.page);
|
|
11
|
+
return page === message.page ? message : { ...message, page };
|
|
12
|
+
}
|
|
13
|
+
function toPageWithoutNativeIcon(page) {
|
|
14
|
+
const icon = toIconForProtocol3To8(page.icon);
|
|
15
|
+
return icon === page.icon ? page : { ...page, icon };
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createCustomBlockHost.d.ts","sourceRoot":"","sources":["../src/createCustomBlockHost.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAA;AACvG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sDAAsD,CAAA;AAC9F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oDAAoD,CAAA;AACtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mDAAmD,CAAA;AAuBpF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAA;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAA;AAI5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGzC,OAAO,KAAK,EAGX,kCAAkC,EAClC,MAAM,2BAA2B,CAAA;AAOlC,OAAO,KAAK,EACX,iCAAiC,EAGjC,MAAM,wBAAwB,CAAA;AAW/B,OAAO,KAAK,EAEX,qBAAqB,EACrB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACX,6BAA6B,EAE7B,yBAAyB,EACzB,MAAM,qBAAqB,CAAA;AAG5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE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,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAA;IACtC,eAAe,EAAE,CAAC,YAAY,EAAE,kBAAkB,KAAK,IAAI,CAAA;IAC3D,SAAS,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAA;IACzC,OAAO,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,qBAAqB,CAAC,KAAK,IAAI,CAAA;IACjE;;;OAGG;IACH,cAAc,EAAE,CACf,WAAW,EAAE,iCAAiC,KAC1C,mCAAmC,CAAA;IACxC,cAAc,EAAE,CAAC,WAAW,EAAE,UAAU,KAAK,IAAI,CAAA;IACjD,YAAY,EAAE,CAAC,IAAI,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAA;CACtD,CAAA;AAUD,wBAAgB,qBAAqB,CACpC,OAAO,EAAE,sBAAsB,GAC7B,qBAAqB,CAokBvB"}
|
|
@@ -397,6 +397,7 @@ export function createCustomBlockHost(options) {
|
|
|
397
397
|
getInitStatus: () => initializationController.status,
|
|
398
398
|
emit,
|
|
399
399
|
sendNack,
|
|
400
|
+
sendPageMutationError: postToSandbox,
|
|
400
401
|
onInvalidConnect: initializationController.handleInvalidConnect,
|
|
401
402
|
onInvalidInitResult: initializationController.handleInvalidInitResult,
|
|
402
403
|
onConnect: initializationController.handleConnect,
|
package/dist/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type { CustomBlockHostHandlers } from "./messages/handlers.js";
|
|
|
11
11
|
export type { CustomBlockHostLogDirection } from "./messages/logging.js";
|
|
12
12
|
export type { CustomBlockHostResult } from "./messages/result.js";
|
|
13
13
|
export type { CustomBlockHostNavigationContext, OpenExternalUrlMessageInput, } from "./navigation/types.js";
|
|
14
|
-
export type { CreatePageMessageInput, CustomBlockHostOpenPageResult, CustomBlockHostPageResult, GetPageMessageInput, OpenPageMessageInput, UpdatePageMessageInput, } from "./pages/types.js";
|
|
14
|
+
export type { CreatePageMessageInput, CustomBlockHostOpenPageResult, CustomBlockHostPageIcon, CustomBlockHostPageResult, GetPageMessageInput, OpenPageMessageInput, UpdatePageMessageInput, } from "./pages/types.js";
|
|
15
15
|
export type { CustomBlockHostUserListResult, CustomBlockHostUserResult, GetUserMessageInput, ListUsersMessageInput, } from "./users/types.js";
|
|
16
16
|
export { toNotionPageId } from "./utils/toNotionPageId.js";
|
|
17
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACX,2BAA2B,EAC3B,iCAAiC,EACjC,kCAAkC,EAClC,kCAAkC,GAClC,MAAM,2BAA2B,CAAA;AAClC,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,EACN,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,mCAAmC,EACxC,qBAAqB,GACrB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACN,KAAK,oBAAoB,EACzB,4BAA4B,GAC5B,MAAM,wDAAwD,CAAA;AAC/D,OAAO,EACN,KAAK,oBAAoB,EACzB,sBAAsB,EACtB,iBAAiB,GACjB,MAAM,+CAA+C,CAAA;AACtD,YAAY,EACX,iCAAiC,EACjC,oCAAoC,EACpC,2BAA2B,GAC3B,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAA;AAClF,YAAY,EACX,sBAAsB,EACtB,qBAAqB,GACrB,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EACX,6BAA6B,EAC7B,yBAAyB,GACzB,MAAM,qBAAqB,CAAA;AAC5B,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AACrE,YAAY,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAA;AACxE,YAAY,EAAE,qBAAqB,EAAE,MAAM,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A;AACxE,YAAY,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,YAAY,EACX,gCAAgC,EAChC,2BAA2B,GAC3B,MAAM,uBAAuB,CAAA;AAC9B,YAAY,EACX,sBAAsB,EACtB,6BAA6B,EAC7B,uBAAuB,EACvB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,GACtB,MAAM,kBAAkB,CAAA;AACzB,YAAY,EACX,6BAA6B,EAC7B,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,GACrB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA"}
|
|
@@ -5,10 +5,10 @@ import type { ConnectMessage } from "../protocol/handshake/connect.js";
|
|
|
5
5
|
import type { InitResultMessage } from "../protocol/handshake/initResult.js";
|
|
6
6
|
import type { InvalidSandboxMessage } from "../protocol/messages/invalidSandboxMessage.js";
|
|
7
7
|
import type { OpenExternalUrlMessage } from "../protocol/navigation/openExternalUrl.js";
|
|
8
|
-
import type { CreatePageMessage } from "../protocol/pages/messages/createPage.js";
|
|
8
|
+
import type { CreatePageMessage, CreatePageResultMessage } from "../protocol/pages/messages/createPage.js";
|
|
9
9
|
import type { GetPageMessage } from "../protocol/pages/messages/getPage.js";
|
|
10
10
|
import type { OpenPageMessage } from "../protocol/pages/messages/openPage.js";
|
|
11
|
-
import type { UpdatePageMessage } from "../protocol/pages/messages/updatePage.js";
|
|
11
|
+
import type { UpdatePageMessage, UpdatePageResultMessage } from "../protocol/pages/messages/updatePage.js";
|
|
12
12
|
import type { GetUserMessage } from "../protocol/users/messages/getUser.js";
|
|
13
13
|
import type { ListUsersMessage } from "../protocol/users/messages/listUsers.js";
|
|
14
14
|
import type { InitializationController } from "../lifecycle/createInitializationController.js";
|
|
@@ -20,6 +20,7 @@ export type SandboxMessageRouterOptions = {
|
|
|
20
20
|
getInitStatus: () => InitStatus;
|
|
21
21
|
emit: (direction: CustomBlockHostLogDirection, payload: unknown) => void;
|
|
22
22
|
sendNack: (message: InvalidSandboxMessage) => void;
|
|
23
|
+
sendPageMutationError: (message: UpdatePageResultMessage | CreatePageResultMessage) => void;
|
|
23
24
|
onInvalidConnect: InitializationController["handleInvalidConnect"];
|
|
24
25
|
onInvalidInitResult: InitializationController["handleInvalidInitResult"];
|
|
25
26
|
onConnect: (message: ConnectMessage) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSandboxMessageRouter.d.ts","sourceRoot":"","sources":["../../src/messages/createSandboxMessageRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAA;AAChG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0EAA0E,CAAA;AACtH,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qFAAqF,CAAA;AAC5I,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAA;AAC3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAEjG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAA;AAC/G,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAA;AAC5G,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"createSandboxMessageRouter.d.ts","sourceRoot":"","sources":["../../src/messages/createSandboxMessageRouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6DAA6D,CAAA;AAChG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0EAA0E,CAAA;AACtH,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qFAAqF,CAAA;AAC5I,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uDAAuD,CAAA;AAC3F,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0DAA0D,CAAA;AAEjG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MA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BAAiB,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5E,4BAA4B,EAAE,CAC7B,OAAO,EAAE,iCAAiC,KACtC,IAAI,CAAA;IACT,YAAY,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClE,UAAU,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9D,iBAAiB,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5E,SAAS,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,SAAS,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC5D,WAAW,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAChE,YAAY,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAClE,QAAQ,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED,wBAAgB,0BAA0B,CACzC,OAAO,EAAE,2BAA2B,GAClC,CAAC,KAAK,EAAE,YAAY,KAAK,IAAI,CAgJ/B"}
|
|
@@ -5,6 +5,7 @@ import { invalidConnectPayloadError } from "../lifecycle/errors/invalidConnectPa
|
|
|
5
5
|
import { invalidInitResultPayloadError } from "../lifecycle/errors/invalidInitResultPayloadError.js";
|
|
6
6
|
import { unreachable } from "../utils/unreachable.js";
|
|
7
7
|
import { getInvalidSandboxMessageResponse } from "./getInvalidSandboxMessageResponse.js";
|
|
8
|
+
import { getInvalidNativeIconColorResponse } from "./invalidNativeIconColor.js";
|
|
8
9
|
const initializationIdentitySchema = v.object({
|
|
9
10
|
initializationId: v.string(),
|
|
10
11
|
});
|
|
@@ -14,8 +15,13 @@ const bridgeProtocolVersionSchema = v.object({
|
|
|
14
15
|
bridgeProtocolVersion: v.union([v.number(), v.nan()]),
|
|
15
16
|
});
|
|
16
17
|
export function createSandboxMessageRouter(options) {
|
|
17
|
-
const { iframe, sandboxOrigin, getInitStatus, emit, sendNack, onInvalidConnect, onInvalidInitResult, onConnect, onInitResult, onQueryDataSource, onUnsubscribeDataSourceQuery, onCreatePage, onGetPage, onOpenPage, onOpenExternalUrl, onGetUser, onListUsers, onUpdatePage, onResize, } = options;
|
|
18
|
+
const { iframe, sandboxOrigin, getInitStatus, emit, sendNack, sendPageMutationError, onInvalidConnect, onInvalidInitResult, onConnect, onInitResult, onQueryDataSource, onUnsubscribeDataSourceQuery, onCreatePage, onGetPage, onOpenPage, onOpenExternalUrl, onGetUser, onListUsers, onUpdatePage, onResize, } = options;
|
|
18
19
|
function onInvalidSandboxMessage(data, issues) {
|
|
20
|
+
const iconError = getInvalidNativeIconColorResponse(data);
|
|
21
|
+
if (iconError !== undefined && getInitStatus() === "initialized") {
|
|
22
|
+
sendPageMutationError(iconError);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
19
25
|
emit("warn", {
|
|
20
26
|
message: "Ignored unsupported sandbox message",
|
|
21
27
|
payload: redactExternalUrl(data),
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreatePageResultMessage } from "../protocol/pages/messages/createPage.js";
|
|
2
|
+
import type { UpdatePageResultMessage } from "../protocol/pages/messages/updatePage.js";
|
|
3
|
+
/** Reject malformed colors with a correlated result before invoking a page mutation handler. */
|
|
4
|
+
export declare function getInvalidNativeIconColorResponse(data: unknown): UpdatePageResultMessage | CreatePageResultMessage | undefined;
|
|
5
|
+
//# sourceMappingURL=invalidNativeIconColor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalidNativeIconColor.d.ts","sourceRoot":"","sources":["../../src/messages/invalidNativeIconColor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAA;AAC5G,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAA;AAY5G,gGAAgG;AAChG,wBAAgB,iCAAiC,CAChD,IAAI,EAAE,OAAO,GACX,uBAAuB,GAAG,uBAAuB,GAAG,SAAS,CAyB/D"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { notionIconColorSchema } from "../protocol/icons.js";
|
|
2
|
+
import * as v from "valibot";
|
|
3
|
+
const nativeIconMutationSchema = v.object({
|
|
4
|
+
type: v.picklist(["updatePage", "createPage"]),
|
|
5
|
+
requestId: v.string(),
|
|
6
|
+
icon: v.object({
|
|
7
|
+
type: v.literal("icon"),
|
|
8
|
+
icon: v.object({ color: v.unknown() }),
|
|
9
|
+
}),
|
|
10
|
+
});
|
|
11
|
+
/** Reject malformed colors with a correlated result before invoking a page mutation handler. */
|
|
12
|
+
export function getInvalidNativeIconColorResponse(data) {
|
|
13
|
+
const parsed = v.safeParse(nativeIconMutationSchema, data);
|
|
14
|
+
if (!parsed.success) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const color = parsed.output.icon.icon.color;
|
|
18
|
+
if (color === undefined ||
|
|
19
|
+
v.safeParse(notionIconColorSchema, color).success) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
type: parsed.output.type === "createPage"
|
|
24
|
+
? "createPageResult"
|
|
25
|
+
: "updatePageResult",
|
|
26
|
+
requestId: parsed.output.requestId,
|
|
27
|
+
status: "error",
|
|
28
|
+
error: {
|
|
29
|
+
code: "invalid_icon_color",
|
|
30
|
+
message: "Use a supported Notion icon color.",
|
|
31
|
+
isRetryable: false,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
}
|
package/dist/pages/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { createPageMessageSchema } from "../protocol/pages/messages/createP
|
|
|
3
3
|
import type { getPageMessageSchema } from "../protocol/pages/messages/getPage.js";
|
|
4
4
|
import type { openPageMessageSchema } from "../protocol/pages/messages/openPage.js";
|
|
5
5
|
import type { updatePageMessageSchema } from "../protocol/pages/messages/updatePage.js";
|
|
6
|
+
import type { notionPageIconSchema } from "../protocol/pages/pageAppearance.js";
|
|
6
7
|
import type { InferInput } from "valibot";
|
|
7
8
|
import type { CustomBlockHostResult } from "../messages/result.js";
|
|
8
9
|
export type CreatePageMessageInput = InferInput<typeof createPageMessageSchema>;
|
|
@@ -15,4 +16,5 @@ export type CustomBlockHostPageResult = CustomBlockHostResult<{
|
|
|
15
16
|
export type CustomBlockHostOpenPageResult = CustomBlockHostResult<{
|
|
16
17
|
pageId: string;
|
|
17
18
|
}>;
|
|
19
|
+
export type CustomBlockHostPageIcon = InferInput<typeof notionPageIconSchema>;
|
|
18
20
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pages/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAA;AACtF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAA;AAC5G,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAA;AACtG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAA;AACxG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAA;AAC5G,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAElE,MAAM,MAAM,sBAAsB,GAAG,UAAU,CAAC,OAAO,uBAAuB,CAAC,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B,CAAC,CAAA;AAE/E,MAAM,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;IAC7D,IAAI,EAAE,UAAU,CAAA;CAChB,CAAC,CAAA;AACF,MAAM,MAAM,6BAA6B,GAAG,qBAAqB,CAAC;IACjE,MAAM,EAAE,MAAM,CAAA;CACd,CAAC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA"}
|
|
@@ -237,7 +237,13 @@ export declare const bridgePageForProtocol3To5Schema: v.ObjectSchema<{
|
|
|
237
237
|
}, undefined>], undefined>, undefined>;
|
|
238
238
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
239
239
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
240
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
240
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
241
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
242
|
+
readonly icon: v.LooseObjectSchema<{
|
|
243
|
+
readonly name: v.StringSchema<undefined>;
|
|
244
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
|
|
245
|
+
}, undefined>;
|
|
246
|
+
}, undefined>, v.ObjectSchema<{
|
|
241
247
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
242
248
|
readonly emoji: v.StringSchema<undefined>;
|
|
243
249
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -787,7 +787,13 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
787
787
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
788
788
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
789
789
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
790
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
790
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
791
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
792
|
+
readonly icon: v.LooseObjectSchema<{
|
|
793
|
+
readonly name: v.StringSchema<undefined>;
|
|
794
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
|
|
795
|
+
}, undefined>;
|
|
796
|
+
}, undefined>, v.ObjectSchema<{
|
|
791
797
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
792
798
|
readonly emoji: v.StringSchema<undefined>;
|
|
793
799
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1090,7 +1096,13 @@ export declare const queryDataSourceResultMessageWithProtocol3To5CompatibilitySc
|
|
|
1090
1096
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1091
1097
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1092
1098
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1093
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
1099
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1100
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1101
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1102
|
+
readonly name: v.StringSchema<undefined>;
|
|
1103
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
|
|
1104
|
+
}, undefined>;
|
|
1105
|
+
}, undefined>, v.ObjectSchema<{
|
|
1094
1106
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1095
1107
|
readonly emoji: v.StringSchema<undefined>;
|
|
1096
1108
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/** Icon names stay open as hosts add to their catalogs. */
|
|
3
|
+
export declare const notionIconNameSchema: v.StringSchema<undefined>;
|
|
4
|
+
export type NotionIconName = v.InferOutput<typeof notionIconNameSchema>;
|
|
5
|
+
declare const knownNotionIconColorSchema: 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 NotionIconColor = v.InferOutput<typeof knownNotionIconColorSchema> | (string & {});
|
|
8
|
+
export declare const notionIconColorSchema: v.GenericSchema<NotionIconColor>;
|
|
9
|
+
/** Reads and writes share an open shape; hosts resolve names and default omitted colors. */
|
|
10
|
+
export declare const notionNativeIconSchema: 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<NotionIconColor>, undefined>;
|
|
15
|
+
}, undefined>;
|
|
16
|
+
}, undefined>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as v from "valibot";
|
|
2
|
+
/** Icon names stay open as hosts add to their catalogs. */
|
|
3
|
+
export const notionIconNameSchema = v.string();
|
|
4
|
+
const knownNotionIconColorSchema = 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 notionIconColorSchema = v.union([
|
|
17
|
+
knownNotionIconColorSchema,
|
|
18
|
+
v.string(),
|
|
19
|
+
]);
|
|
20
|
+
/** Reads and writes share an open shape; hosts resolve names and default omitted colors. */
|
|
21
|
+
export const notionNativeIconSchema = v.looseObject({
|
|
22
|
+
type: v.literal("icon"),
|
|
23
|
+
icon: v.looseObject({
|
|
24
|
+
name: notionIconNameSchema,
|
|
25
|
+
color: v.optional(notionIconColorSchema),
|
|
26
|
+
}),
|
|
27
|
+
});
|
package/dist/protocol/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export { CustomBlockInitializationError, customBlockInitErrorCodeSchema, customB
|
|
|
85
85
|
export type { CustomBlockInitResultErrorCode, CustomBlockInitResultErrorInfo, InitResultMessage, } from "./handshake/initResult.js";
|
|
86
86
|
export { customBlockInitResultErrorCodeSchema, customBlockInitResultErrorInfoSchema, initResultMessageSchema, } from "./handshake/initResult.js";
|
|
87
87
|
export { isInitHandshakeMessage } from "./handshake/isInitHandshakeMessage.js";
|
|
88
|
+
export * from "./icons.js";
|
|
88
89
|
export type { CustomBlockCapabilityDeclaration, CustomBlockCapabilityName, CustomBlockCapabilityResourceName, CustomBlockOriginResourceName, } from "./manifest/capabilities.js";
|
|
89
90
|
export { customBlockCapabilityDeclarationSchema } from "./manifest/capabilities.js";
|
|
90
91
|
export type { BridgeCustomBlockManifest, ManifestDataSource, ManifestIcon, ManifestProperty, } from "./manifest/manifest.js";
|
|
@@ -114,7 +115,7 @@ export { customBlockOpenPageErrorCodeSchema, customBlockOpenPageErrorInfoSchema,
|
|
|
114
115
|
export type { CustomBlockUpdatePageErrorCode, CustomBlockUpdatePageErrorInfo, UpdatePageMessage, UpdatePageResultMessage, UpdatePageResultMessageWithProtocol3To5Compatibility, } from "./pages/messages/updatePage.js";
|
|
115
116
|
export { customBlockUpdatePageErrorCodeSchema, customBlockUpdatePageErrorInfoSchema, updatePageMessageSchema, updatePageResultMessageSchema, updatePageResultMessageWithProtocol3To5CompatibilitySchema, } from "./pages/messages/updatePage.js";
|
|
116
117
|
export type { NotionPageCover, NotionPageIcon } from "./pages/pageAppearance.js";
|
|
117
|
-
export { notionCustomEmojiIconSchema, notionEmojiIconSchema, notionExternalFileSchema, notionHostedFileSchema, notionPageCoverSchema, notionPageIconSchema, } from "./pages/pageAppearance.js";
|
|
118
|
+
export { type NotionCreatePageIcon, notionCreatePageIconSchema, notionCustomEmojiIconSchema, notionEmojiIconSchema, notionExternalFileSchema, notionHostedFileSchema, notionPageCoverSchema, notionPageIconSchema, } from "./pages/pageAppearance.js";
|
|
118
119
|
export type { BridgePagePropertyReadMap, BridgePagePropertyWriteMap, } from "./pages/properties/bridgePagePropertyMaps.js";
|
|
119
120
|
export { bridgePagePropertyReadMapSchema, bridgePagePropertyWriteMapSchema, } from "./pages/properties/bridgePagePropertyMaps.js";
|
|
120
121
|
export type { BridgePagePropertyValue } from "./pages/properties/bridgePagePropertyValue.js";
|
|
@@ -145,7 +146,7 @@ export { CAPABILITY_NOT_GRANTED_ERROR_CODE, customBlockErrorInfoSchema, } from "
|
|
|
145
146
|
export type { NotionAgentId, NotionBlockId, NotionDataSourceId, NotionPageId, NotionSpaceId, } from "./utils/ids.js";
|
|
146
147
|
export { notionAgentIdSchema, notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, notionSpaceIdSchema, } from "./utils/ids.js";
|
|
147
148
|
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";
|
|
149
|
+
export { LATEST_BRIDGE_PROTOCOL_VERSION, NATIVE_ICON_PROTOCOL_VERSION, TEXT_FALLBACK_PROPERTY_PROTOCOL_VERSION, UNIFIED_PAGE_PROTOCOL_VERSION, } from "./utils/protocolVersion.js";
|
|
149
150
|
export { readRequestId } from "./utils/readRequestId.js";
|
|
150
151
|
export type { NotionRecordPointer } from "./utils/recordPointer.js";
|
|
151
152
|
export { notionRecordPointerSchema } from "./utils/recordPointer.js";
|
package/dist/protocol/index.js
CHANGED
|
@@ -42,6 +42,7 @@ export { connectMessageSchema } from "./handshake/connect.js";
|
|
|
42
42
|
export { CustomBlockInitializationError, customBlockInitErrorCodeSchema, customBlockInitErrorInfoSchema, initMessageSchema, } from "./handshake/init.js";
|
|
43
43
|
export { customBlockInitResultErrorCodeSchema, customBlockInitResultErrorInfoSchema, initResultMessageSchema, } from "./handshake/initResult.js";
|
|
44
44
|
export { isInitHandshakeMessage } from "./handshake/isInitHandshakeMessage.js";
|
|
45
|
+
export * from "./icons.js";
|
|
45
46
|
export { customBlockCapabilityDeclarationSchema } from "./manifest/capabilities.js";
|
|
46
47
|
export { manifestDataSourceSchema, manifestIconSchema, manifestPropertySchema, manifestSchema, } from "./manifest/manifest.js";
|
|
47
48
|
export { hostToSandboxMessageSchema, hostToSandboxMessageWithProtocol3To5CompatibilitySchema, } from "./messages/hostToSandbox.js";
|
|
@@ -56,7 +57,7 @@ export { createPageMessageSchema, createPageParentSchema, createPageResultMessag
|
|
|
56
57
|
export { customBlockGetPageErrorCodeSchema, customBlockGetPageErrorInfoSchema, getPageMessageSchema, getPageResultMessageSchema, getPageResultMessageWithProtocol3To5CompatibilitySchema, } from "./pages/messages/getPage.js";
|
|
57
58
|
export { customBlockOpenPageErrorCodeSchema, customBlockOpenPageErrorInfoSchema, openPageMessageSchema, openPageModeSchema, openPageResultMessageSchema, } from "./pages/messages/openPage.js";
|
|
58
59
|
export { customBlockUpdatePageErrorCodeSchema, customBlockUpdatePageErrorInfoSchema, updatePageMessageSchema, updatePageResultMessageSchema, updatePageResultMessageWithProtocol3To5CompatibilitySchema, } from "./pages/messages/updatePage.js";
|
|
59
|
-
export { notionCustomEmojiIconSchema, notionEmojiIconSchema, notionExternalFileSchema, notionHostedFileSchema, notionPageCoverSchema, notionPageIconSchema, } from "./pages/pageAppearance.js";
|
|
60
|
+
export { notionCreatePageIconSchema, notionCustomEmojiIconSchema, notionEmojiIconSchema, notionExternalFileSchema, notionHostedFileSchema, notionPageCoverSchema, notionPageIconSchema, } from "./pages/pageAppearance.js";
|
|
60
61
|
export { bridgePagePropertyReadMapSchema, bridgePagePropertyWriteMapSchema, } from "./pages/properties/bridgePagePropertyMaps.js";
|
|
61
62
|
export { bridgePagePropertyValueSchema } from "./pages/properties/bridgePagePropertyValue.js";
|
|
62
63
|
export { bridgeUserSchema } from "./users/bridgeUser.js";
|
|
@@ -69,6 +70,6 @@ export { notionUserIdSchema } from "./users/userId.js";
|
|
|
69
70
|
export { CAPABILITY_NOT_GRANTED_ERROR_CODE, customBlockErrorInfoSchema, } from "./utils/errors.js";
|
|
70
71
|
export { notionAgentIdSchema, notionBlockIdSchema, notionDataSourceIdSchema, notionPageIdSchema, notionSpaceIdSchema, } from "./utils/ids.js";
|
|
71
72
|
export { isLocalBlockServerUrl } from "./utils/isLocalBlockServerUrl.js";
|
|
72
|
-
export { LATEST_BRIDGE_PROTOCOL_VERSION, TEXT_FALLBACK_PROPERTY_PROTOCOL_VERSION, UNIFIED_PAGE_PROTOCOL_VERSION, } from "./utils/protocolVersion.js";
|
|
73
|
+
export { LATEST_BRIDGE_PROTOCOL_VERSION, NATIVE_ICON_PROTOCOL_VERSION, TEXT_FALLBACK_PROPERTY_PROTOCOL_VERSION, UNIFIED_PAGE_PROTOCOL_VERSION, } from "./utils/protocolVersion.js";
|
|
73
74
|
export { readRequestId } from "./utils/readRequestId.js";
|
|
74
75
|
export { notionRecordPointerSchema } from "./utils/recordPointer.js";
|
|
@@ -796,7 +796,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
796
796
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
797
797
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
798
798
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
799
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
799
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
800
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
801
|
+
readonly icon: v.LooseObjectSchema<{
|
|
802
|
+
readonly name: v.StringSchema<undefined>;
|
|
803
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
804
|
+
}, undefined>;
|
|
805
|
+
}, undefined>, v.ObjectSchema<{
|
|
800
806
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
801
807
|
readonly emoji: v.StringSchema<undefined>;
|
|
802
808
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1098,7 +1104,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
1098
1104
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1099
1105
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1100
1106
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1101
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
1107
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1108
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1109
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1110
|
+
readonly name: v.StringSchema<undefined>;
|
|
1111
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
1112
|
+
}, undefined>;
|
|
1113
|
+
}, undefined>, v.ObjectSchema<{
|
|
1102
1114
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1103
1115
|
readonly emoji: v.StringSchema<undefined>;
|
|
1104
1116
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1399,7 +1411,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
1399
1411
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1400
1412
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1401
1413
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1402
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
1414
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1415
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1416
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1417
|
+
readonly name: v.StringSchema<undefined>;
|
|
1418
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
1419
|
+
}, undefined>;
|
|
1420
|
+
}, undefined>, v.ObjectSchema<{
|
|
1403
1421
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1404
1422
|
readonly emoji: v.StringSchema<undefined>;
|
|
1405
1423
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1700,7 +1718,13 @@ export declare const hostToSandboxMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
1700
1718
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1701
1719
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1702
1720
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1703
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
1721
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1722
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1723
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1724
|
+
readonly name: v.StringSchema<undefined>;
|
|
1725
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
1726
|
+
}, undefined>;
|
|
1727
|
+
}, undefined>, v.ObjectSchema<{
|
|
1704
1728
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1705
1729
|
readonly emoji: v.StringSchema<undefined>;
|
|
1706
1730
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -2549,7 +2573,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
2549
2573
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
2550
2574
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
2551
2575
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
2552
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
2576
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
2577
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
2578
|
+
readonly icon: v.LooseObjectSchema<{
|
|
2579
|
+
readonly name: v.StringSchema<undefined>;
|
|
2580
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
2581
|
+
}, undefined>;
|
|
2582
|
+
}, undefined>, v.ObjectSchema<{
|
|
2553
2583
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
2554
2584
|
readonly emoji: v.StringSchema<undefined>;
|
|
2555
2585
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -2916,7 +2946,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
2916
2946
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
2917
2947
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
2918
2948
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
2919
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
2949
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
2950
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
2951
|
+
readonly icon: v.LooseObjectSchema<{
|
|
2952
|
+
readonly name: v.StringSchema<undefined>;
|
|
2953
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
2954
|
+
}, undefined>;
|
|
2955
|
+
}, undefined>, v.ObjectSchema<{
|
|
2920
2956
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
2921
2957
|
readonly emoji: v.StringSchema<undefined>;
|
|
2922
2958
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -3192,7 +3228,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
3192
3228
|
}, undefined>], undefined>, undefined>;
|
|
3193
3229
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3194
3230
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3195
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
3231
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
3232
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
3233
|
+
readonly icon: v.LooseObjectSchema<{
|
|
3234
|
+
readonly name: v.StringSchema<undefined>;
|
|
3235
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
3236
|
+
}, undefined>;
|
|
3237
|
+
}, undefined>, v.ObjectSchema<{
|
|
3196
3238
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
3197
3239
|
readonly emoji: v.StringSchema<undefined>;
|
|
3198
3240
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -3493,7 +3535,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
3493
3535
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
3494
3536
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
3495
3537
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
3496
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
3538
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
3539
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
3540
|
+
readonly icon: v.LooseObjectSchema<{
|
|
3541
|
+
readonly name: v.StringSchema<undefined>;
|
|
3542
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
3543
|
+
}, undefined>;
|
|
3544
|
+
}, undefined>, v.ObjectSchema<{
|
|
3497
3545
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
3498
3546
|
readonly emoji: v.StringSchema<undefined>;
|
|
3499
3547
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -3769,7 +3817,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
3769
3817
|
}, undefined>], undefined>, undefined>;
|
|
3770
3818
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3771
3819
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
3772
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
3820
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
3821
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
3822
|
+
readonly icon: v.LooseObjectSchema<{
|
|
3823
|
+
readonly name: v.StringSchema<undefined>;
|
|
3824
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
3825
|
+
}, undefined>;
|
|
3826
|
+
}, undefined>, v.ObjectSchema<{
|
|
3773
3827
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
3774
3828
|
readonly emoji: v.StringSchema<undefined>;
|
|
3775
3829
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -4070,7 +4124,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
4070
4124
|
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
4071
4125
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
4072
4126
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
4073
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
4127
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
4128
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
4129
|
+
readonly icon: v.LooseObjectSchema<{
|
|
4130
|
+
readonly name: v.StringSchema<undefined>;
|
|
4131
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
4132
|
+
}, undefined>;
|
|
4133
|
+
}, undefined>, v.ObjectSchema<{
|
|
4074
4134
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
4075
4135
|
readonly emoji: v.StringSchema<undefined>;
|
|
4076
4136
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -4346,7 +4406,13 @@ export declare const hostToSandboxMessageWithProtocol3To5CompatibilitySchema: v.
|
|
|
4346
4406
|
}, undefined>], undefined>, undefined>;
|
|
4347
4407
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4348
4408
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
4349
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
4409
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
4410
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
4411
|
+
readonly icon: v.LooseObjectSchema<{
|
|
4412
|
+
readonly name: v.StringSchema<undefined>;
|
|
4413
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
4414
|
+
}, undefined>;
|
|
4415
|
+
}, undefined>, v.ObjectSchema<{
|
|
4350
4416
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
4351
4417
|
readonly emoji: v.StringSchema<undefined>;
|
|
4352
4418
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -797,6 +797,46 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
797
797
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
798
798
|
readonly verification: v.StringSchema<undefined>;
|
|
799
799
|
}, undefined>], undefined>, undefined>;
|
|
800
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
801
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
802
|
+
readonly icon: v.LooseObjectSchema<{
|
|
803
|
+
readonly name: v.StringSchema<undefined>;
|
|
804
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
805
|
+
}, undefined>;
|
|
806
|
+
}, undefined>, v.ObjectSchema<{
|
|
807
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
808
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
809
|
+
}, undefined>, v.ObjectSchema<{
|
|
810
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
811
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
812
|
+
readonly id: v.StringSchema<undefined>;
|
|
813
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
814
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
815
|
+
}, undefined>;
|
|
816
|
+
}, undefined>, v.ObjectSchema<{
|
|
817
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
818
|
+
readonly external: v.ObjectSchema<{
|
|
819
|
+
readonly url: v.StringSchema<undefined>;
|
|
820
|
+
}, undefined>;
|
|
821
|
+
}, undefined>, v.ObjectSchema<{
|
|
822
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
823
|
+
readonly file: v.ObjectSchema<{
|
|
824
|
+
readonly url: v.StringSchema<undefined>;
|
|
825
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
826
|
+
}, undefined>;
|
|
827
|
+
}, undefined>], undefined>, undefined>;
|
|
828
|
+
readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
829
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
830
|
+
readonly external: v.ObjectSchema<{
|
|
831
|
+
readonly url: v.StringSchema<undefined>;
|
|
832
|
+
}, undefined>;
|
|
833
|
+
}, undefined>, v.ObjectSchema<{
|
|
834
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
835
|
+
readonly file: v.ObjectSchema<{
|
|
836
|
+
readonly url: v.StringSchema<undefined>;
|
|
837
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
838
|
+
}, undefined>;
|
|
839
|
+
}, undefined>], undefined>, undefined>;
|
|
800
840
|
readonly parent: v.ObjectSchema<{
|
|
801
841
|
readonly type: v.LiteralSchema<"page_id", undefined>;
|
|
802
842
|
readonly page_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionPageId">]>;
|
|
@@ -1030,6 +1070,46 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
1030
1070
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
1031
1071
|
readonly verification: v.StringSchema<undefined>;
|
|
1032
1072
|
}, undefined>], undefined>, undefined>;
|
|
1073
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1074
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1075
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1076
|
+
readonly name: v.StringSchema<undefined>;
|
|
1077
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
1078
|
+
}, undefined>;
|
|
1079
|
+
}, undefined>, v.ObjectSchema<{
|
|
1080
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1081
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
1082
|
+
}, undefined>, v.ObjectSchema<{
|
|
1083
|
+
readonly type: v.LiteralSchema<"custom_emoji", undefined>;
|
|
1084
|
+
readonly custom_emoji: v.ObjectSchema<{
|
|
1085
|
+
readonly id: v.StringSchema<undefined>;
|
|
1086
|
+
readonly name: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1087
|
+
readonly url: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1088
|
+
}, undefined>;
|
|
1089
|
+
}, undefined>, v.ObjectSchema<{
|
|
1090
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
1091
|
+
readonly external: v.ObjectSchema<{
|
|
1092
|
+
readonly url: v.StringSchema<undefined>;
|
|
1093
|
+
}, undefined>;
|
|
1094
|
+
}, undefined>, v.ObjectSchema<{
|
|
1095
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
1096
|
+
readonly file: v.ObjectSchema<{
|
|
1097
|
+
readonly url: v.StringSchema<undefined>;
|
|
1098
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1099
|
+
}, undefined>;
|
|
1100
|
+
}, undefined>], undefined>, undefined>;
|
|
1101
|
+
readonly cover: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
1102
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
1103
|
+
readonly external: v.ObjectSchema<{
|
|
1104
|
+
readonly url: v.StringSchema<undefined>;
|
|
1105
|
+
}, undefined>;
|
|
1106
|
+
}, undefined>, v.ObjectSchema<{
|
|
1107
|
+
readonly type: v.LiteralSchema<"file", undefined>;
|
|
1108
|
+
readonly file: v.ObjectSchema<{
|
|
1109
|
+
readonly url: v.StringSchema<undefined>;
|
|
1110
|
+
readonly expiry_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1111
|
+
}, undefined>;
|
|
1112
|
+
}, undefined>], undefined>, undefined>;
|
|
1033
1113
|
readonly parent: v.ObjectSchema<{
|
|
1034
1114
|
readonly type: v.LiteralSchema<"data_source_id", undefined>;
|
|
1035
1115
|
readonly data_source_id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.BrandAction<string, "NotionDataSourceId">]>;
|
|
@@ -1278,7 +1358,13 @@ export declare const sandboxToHostMessageSchema: v.VariantSchema<"type", [v.Vari
|
|
|
1278
1358
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
1279
1359
|
readonly verification: v.StringSchema<undefined>;
|
|
1280
1360
|
}, undefined>], undefined>, undefined>, undefined>;
|
|
1281
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
1361
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1362
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1363
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1364
|
+
readonly name: v.StringSchema<undefined>;
|
|
1365
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../icons.js").NotionIconColor>, undefined>;
|
|
1366
|
+
}, undefined>;
|
|
1367
|
+
}, undefined>, v.ObjectSchema<{
|
|
1282
1368
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1283
1369
|
readonly emoji: v.StringSchema<undefined>;
|
|
1284
1370
|
}, undefined>, v.ObjectSchema<{
|