@notionhq/custom-blocks 0.3.5 → 0.4.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 -23
- package/dist/bridge/SandboxBridge.d.ts.map +1 -1
- package/dist/bridge/SandboxBridge.js +36 -104
- 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 +15 -1
- package/dist/dataSources/createDataSourcePage.d.ts.map +1 -1
- package/dist/dataSources/createDataSourcePage.js +5 -1
- package/dist/dataSources/types.d.ts +2 -0
- package/dist/dataSources/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/manifest/types.d.ts +1 -1
- 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 +2 -1
- 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 +11 -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 -6
- package/dist/pages/bridge/updatePage.d.ts.map +1 -1
- package/dist/pages/bridge/updatePage.js +19 -4
- 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/types.d.ts +5 -7
- package/dist/pages/types.d.ts.map +1 -1
- package/dist/protocol/compatibility/protocol3To5/bridgePage.d.ts +7 -5
- package/dist/protocol/context/parent.d.ts +2 -0
- package/dist/protocol/dataSources/bridgeArchiveStatus.d.ts +3 -0
- package/dist/protocol/dataSources/bridgeArchiveStatus.js +6 -0
- package/dist/protocol/dataSources/bridgeDataSourceBinding.d.ts +0 -4
- package/dist/protocol/dataSources/bridgeDataSourceBindings.d.ts +0 -4
- package/dist/protocol/dataSources/collectionSchema.d.ts +0 -4
- package/dist/protocol/dataSources/messages/dataSourcesChanged.d.ts +0 -4
- package/dist/protocol/dataSources/messages/queryDataSource.d.ts +17 -14
- package/dist/protocol/dataSources/messages/queryDataSource.js +2 -0
- package/dist/protocol/dataSources/notionDataSource.d.ts +0 -8
- package/dist/protocol/dataSources/properties/propertySchema.d.ts +3 -7
- package/dist/protocol/dataSources/properties/propertySchema.js +1 -3
- package/dist/protocol/handshake/connect.d.ts +15 -4
- package/dist/protocol/handshake/init.d.ts +15 -8
- package/dist/protocol/icons.d.ts +17 -0
- package/dist/protocol/icons.js +27 -0
- package/dist/protocol/index.d.ts +13 -9
- package/dist/protocol/index.js +8 -5
- package/dist/protocol/manifest/grants.d.ts +48 -0
- package/dist/protocol/manifest/grants.js +19 -0
- package/dist/protocol/manifest/manifest.d.ts +33 -10
- package/dist/protocol/manifest/manifest.js +11 -5
- package/dist/protocol/messages/hostToSandbox.d.ts +109 -87
- 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 +104 -17
- package/dist/protocol/navigation/openExternalUrl.d.ts +2 -2
- package/dist/protocol/pages/bridgePage.d.ts +7 -6
- package/dist/protocol/pages/bridgePage.js +0 -1
- package/dist/protocol/pages/makeBridgePage.d.ts +3 -1
- package/dist/protocol/pages/messages/createPage.d.ts +103 -27
- package/dist/protocol/pages/messages/createPage.js +3 -1
- package/dist/protocol/pages/messages/getPage.d.ts +23 -19
- package/dist/protocol/pages/messages/openPage.d.ts +2 -2
- package/dist/protocol/pages/messages/updatePage.d.ts +30 -24
- package/dist/protocol/pages/pageAppearance.d.ts +36 -1
- package/dist/protocol/pages/pageAppearance.js +9 -0
- package/dist/protocol/pages/properties/bridgePagePropertyMaps.d.ts +0 -8
- package/dist/protocol/pages/properties/bridgePagePropertyValue.d.ts +0 -4
- package/dist/protocol/pages/properties/bridgePagePropertyValue.js +0 -5
- 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/protocolVersion.d.ts +2 -1
- package/dist/protocol/utils/protocolVersion.js +3 -1
- package/dist/protocol/utils/readRequestId.d.ts +2 -0
- package/dist/protocol/utils/readRequestId.js +7 -0
- 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 +38 -34
- package/docs/errors.md +47 -5
- package/docs/grants.md +127 -0
- package/docs/pages.md +45 -32
- package/docs/users.md +2 -2
- package/package.json +1 -1
- package/src/bridge/SandboxBridge.ts +44 -188
- package/src/bridge/requests.ts +138 -0
- package/src/dataSources/bridge/resolveDataSourceQuery.ts +21 -1
- package/src/dataSources/createDataSourcePage.ts +5 -1
- package/src/dataSources/types.ts +3 -0
- package/src/index.ts +8 -4
- package/src/manifest/types.ts +1 -1
- package/src/navigation/openExternalUrl.ts +5 -1
- package/src/pages/bridge/getPageForDataSource.ts +5 -1
- package/src/pages/bridge/sendCreatePageRequest.ts +5 -1
- package/src/pages/bridge/toNotionPageFieldsFromBridgePage.ts +0 -1
- package/src/pages/bridge/toNotionPagePropertyFromBridgeProperty.ts +0 -6
- package/src/pages/bridge/updatePage.ts +28 -8
- package/src/pages/createPage.ts +5 -1
- package/src/pages/openPage.ts +5 -1
- package/src/pages/types.ts +7 -5
- 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/manifest/capabilities.d.ts +0 -37
- package/dist/protocol/manifest/capabilities.js +0 -13
- package/docs/capabilities.md +0 -111
- package/src/bridge/pendingRequests.ts +0 -28
|
@@ -32,7 +32,6 @@ export declare function toNotionPageFieldsFromBridgePage(page: BridgePage): {
|
|
|
32
32
|
table: "bot" | "notion_user" | "organization_bot";
|
|
33
33
|
spaceId?: string | undefined;
|
|
34
34
|
} | null;
|
|
35
|
-
last_visited_time: string | null;
|
|
36
35
|
created_time: string | null;
|
|
37
36
|
last_edited_time: string | null;
|
|
38
37
|
icon: {
|
|
@@ -56,7 +55,17 @@ export declare function toNotionPageFieldsFromBridgePage(page: BridgePage): {
|
|
|
56
55
|
url: string;
|
|
57
56
|
expiry_time?: string | undefined;
|
|
58
57
|
};
|
|
59
|
-
} |
|
|
58
|
+
} | ({
|
|
59
|
+
type: "icon";
|
|
60
|
+
icon: {
|
|
61
|
+
name: string;
|
|
62
|
+
color?: import("../../protocol/icons.js").NotionIconColor | undefined;
|
|
63
|
+
} & {
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
};
|
|
66
|
+
} & {
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}) | null;
|
|
60
69
|
cover: {
|
|
61
70
|
type: "external";
|
|
62
71
|
external: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toNotionPageFieldsFromBridgePage.d.ts","sourceRoot":"","sources":["../../../src/pages/bridge/toNotionPageFieldsFromBridgePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAA;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAG5D,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,UAAU
|
|
1
|
+
{"version":3,"file":"toNotionPageFieldsFromBridgePage.d.ts","sourceRoot":"","sources":["../../../src/pages/bridge/toNotionPageFieldsFromBridgePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sDAAsD,CAAA;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAG5D,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBhE"}
|
|
@@ -12,7 +12,6 @@ export function toNotionPageFieldsFromBridgePage(page) {
|
|
|
12
12
|
properties,
|
|
13
13
|
created_by: page.created_by,
|
|
14
14
|
last_edited_by: page.last_edited_by,
|
|
15
|
-
last_visited_time: page.last_visited_time,
|
|
16
15
|
created_time: page.created_time,
|
|
17
16
|
last_edited_time: page.last_edited_time,
|
|
18
17
|
icon: page.icon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toNotionPagePropertyFromBridgeProperty.d.ts","sourceRoot":"","sources":["../../../src/pages/bridge/toNotionPagePropertyFromBridgeProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8EAA8E,CAAA;AAE3H,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D,wBAAgB,sCAAsC,CACrD,KAAK,EAAE,uBAAuB,GAC5B,uBAAuB,
|
|
1
|
+
{"version":3,"file":"toNotionPagePropertyFromBridgeProperty.d.ts","sourceRoot":"","sources":["../../../src/pages/bridge/toNotionPagePropertyFromBridgeProperty.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8EAA8E,CAAA;AAE3H,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D,wBAAgB,sCAAsC,CACrD,KAAK,EAAE,uBAAuB,GAC5B,uBAAuB,CAoFzB"}
|
|
@@ -64,12 +64,6 @@ export function toNotionPagePropertyFromBridgeProperty(value) {
|
|
|
64
64
|
type: value.type,
|
|
65
65
|
last_edited_by: value.last_edited_by,
|
|
66
66
|
};
|
|
67
|
-
case "last_visited_time":
|
|
68
|
-
return {
|
|
69
|
-
id: value.id,
|
|
70
|
-
type: value.type,
|
|
71
|
-
last_visited_time: value.last_visited_time,
|
|
72
|
-
};
|
|
73
67
|
case "unique_id":
|
|
74
68
|
return { id: value.id, type: value.type, unique_id: value.unique_id };
|
|
75
69
|
case "button":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updatePage.d.ts","sourceRoot":"","sources":["../../../src/pages/bridge/updatePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kEAAkE,CAAA;AACxG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAEX,uBAAuB,EACvB,MAAM,+DAA+D,CAAA;
|
|
1
|
+
{"version":3,"file":"updatePage.d.ts","sourceRoot":"","sources":["../../../src/pages/bridge/updatePage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kEAAkE,CAAA;AACxG,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAA;AACvG,OAAO,KAAK,EAEX,uBAAuB,EACvB,MAAM,+DAA+D,CAAA;AAEtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAEjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAEpD,MAAM,MAAM,cAAc,GAAG,iBAAiB,GAAG;IAChD,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,EAAE,gBAAgB,GAAG,SAAS,CAAA;CACxC,CAAA;AAOD,wBAAgB,UAAU,CACzB,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,cAAc,GAClB,OAAO,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAmFxD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { updatePageResultMessageSchema } from "../../protocol/pages/messages/updatePage.js";
|
|
1
2
|
import { resolvePropertyWriteMapForDataSource } from "../../dataSources/properties/resolvePropertyWriteMapForDataSource.js";
|
|
2
3
|
const pendingPageUpdatesByBridge = new WeakMap();
|
|
3
4
|
export function updatePage(bridge, args) {
|
|
@@ -6,7 +7,17 @@ export function updatePage(bridge, args) {
|
|
|
6
7
|
pendingPageUpdates = new Map();
|
|
7
8
|
pendingPageUpdatesByBridge.set(bridge, pendingPageUpdates);
|
|
8
9
|
}
|
|
9
|
-
const operation = async () => {
|
|
10
|
+
const operation = async (previousWriteIncomplete) => {
|
|
11
|
+
if (previousWriteIncomplete) {
|
|
12
|
+
return {
|
|
13
|
+
status: "error",
|
|
14
|
+
error: {
|
|
15
|
+
code: "previous_write_incomplete",
|
|
16
|
+
message: "This queued update was not sent because a previous write timed out and may still complete.",
|
|
17
|
+
isRetryable: false,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
}
|
|
10
21
|
const { dataSource } = args;
|
|
11
22
|
const dataSourceId = dataSource?.collectionPointer?.id;
|
|
12
23
|
const resolved = resolvePropertyWriteMapForDataSource({
|
|
@@ -45,11 +56,15 @@ export function updatePage(bridge, args) {
|
|
|
45
56
|
if (args.is_archived !== undefined) {
|
|
46
57
|
outbound.archived = args.is_archived;
|
|
47
58
|
}
|
|
48
|
-
return bridge.
|
|
59
|
+
return bridge.request({ type: "updatePage", ...outbound }, updatePageResultMessageSchema);
|
|
49
60
|
};
|
|
50
61
|
const pending = pendingPageUpdates.get(args.pageId);
|
|
51
|
-
const result = pending ? pending.then(operation) : operation();
|
|
52
|
-
|
|
62
|
+
const result = pending ? pending.then(operation) : operation(false);
|
|
63
|
+
// A timeout does not cancel host work. Skip the rest of this queue to avoid
|
|
64
|
+
// sending writes that could be applied before the timed-out write.
|
|
65
|
+
const finished = result.then(result => result.status === "error" &&
|
|
66
|
+
(result.error.code === "request_timeout" ||
|
|
67
|
+
result.error.code === "previous_write_incomplete"), () => false);
|
|
53
68
|
pendingPageUpdates.set(args.pageId, finished);
|
|
54
69
|
void finished.then(() => {
|
|
55
70
|
if (pendingPageUpdates.get(args.pageId) === finished) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPage.d.ts","sourceRoot":"","sources":["../../src/pages/createPage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElE,wBAAsB,UAAU,CAC/B,KAAK,EAAE,cAAc,GACnB,OAAO,CAAC,gBAAgB,CAAC,
|
|
1
|
+
{"version":3,"file":"createPage.d.ts","sourceRoot":"","sources":["../../src/pages/createPage.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElE,wBAAsB,UAAU,CAC/B,KAAK,EAAE,cAAc,GACnB,OAAO,CAAC,gBAAgB,CAAC,CA0B3B"}
|
package/dist/pages/createPage.js
CHANGED
|
@@ -21,7 +21,11 @@ export async function createPage(input) {
|
|
|
21
21
|
}
|
|
22
22
|
return sendCreatePageRequest({
|
|
23
23
|
bridge,
|
|
24
|
-
request:
|
|
24
|
+
request: {
|
|
25
|
+
...prepared.request,
|
|
26
|
+
...(input.icon === undefined ? {} : { icon: input.icon }),
|
|
27
|
+
...(input.cover === undefined ? {} : { cover: input.cover }),
|
|
28
|
+
},
|
|
25
29
|
dataSource: undefined,
|
|
26
30
|
});
|
|
27
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openPage.d.ts","sourceRoot":"","sources":["../../src/pages/openPage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openPage.d.ts","sourceRoot":"","sources":["../../src/pages/openPage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+CAA+C,CAAA;AAEjF,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEjE;;GAEG;AACH,eAAO,MAAM,QAAQ,WACZ,YAAY,WACX,eAAe,KACtB,OAAO,CAAC,cAAc,CAKxB,CAAA"}
|
package/dist/pages/openPage.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { openPageResultMessageSchema } from "../protocol/pages/messages/openPage.js";
|
|
1
2
|
import { getBridge } from "../bridge/getBridge.js";
|
|
2
3
|
/**
|
|
3
4
|
* Requests that the Notion host open a page.
|
|
4
5
|
*/
|
|
5
6
|
export const openPage = (pageId, options) => {
|
|
6
|
-
return getBridge().
|
|
7
|
+
return getBridge().request({ type: "openPage", pageId, mode: options.mode }, openPageResultMessageSchema);
|
|
7
8
|
};
|
package/dist/pages/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { CustomBlockCreatePageErrorInfo, NotionCreatePagePosition } from ".
|
|
|
3
3
|
import type { CustomBlockGetPageErrorInfo } from "../protocol/pages/messages/getPage.js";
|
|
4
4
|
import type { CustomBlockOpenPageErrorInfo, OpenPageMode } from "../protocol/pages/messages/openPage.js";
|
|
5
5
|
import type { CustomBlockUpdatePageErrorInfo } from "../protocol/pages/messages/updatePage.js";
|
|
6
|
-
import type { NotionPageCover, NotionPageIcon } from "../protocol/pages/pageAppearance.js";
|
|
6
|
+
import type { NotionCreatePageIcon, NotionPageCover, NotionPageIcon } from "../protocol/pages/pageAppearance.js";
|
|
7
7
|
import type { NotionDateInput } from "../protocol/pages/properties/dateInput.js";
|
|
8
8
|
import type { NotionFileInput } from "../protocol/pages/properties/fileInput.js";
|
|
9
9
|
import type { NotionPlaceInput } from "../protocol/pages/properties/placeInput.js";
|
|
@@ -75,9 +75,6 @@ export type NotionPagePropertyValue = {
|
|
|
75
75
|
} | {
|
|
76
76
|
type: "last_edited_by";
|
|
77
77
|
last_edited_by: PageMetadataActor | null;
|
|
78
|
-
} | {
|
|
79
|
-
type: "last_visited_time";
|
|
80
|
-
last_visited_time: string | null;
|
|
81
78
|
} | {
|
|
82
79
|
type: "unique_id";
|
|
83
80
|
unique_id: string;
|
|
@@ -105,7 +102,7 @@ export type NotionPagePropertyWriteMap = Record<string, NotionPagePropertyValue>
|
|
|
105
102
|
* from the map key before sending the bridge message.
|
|
106
103
|
*/
|
|
107
104
|
export type NotionPagePropertyInputValue = Exclude<NotionPagePropertyWriteMap[string], {
|
|
108
|
-
type: "created_time" | "last_edited_time" | "created_by" | "last_edited_by" | "
|
|
105
|
+
type: "created_time" | "last_edited_time" | "created_by" | "last_edited_by" | "unique_id" | "button" | "formula" | "location" | "rollup" | "verification";
|
|
109
106
|
}> extends infer PropertyValue ? PropertyValue extends {
|
|
110
107
|
id: string;
|
|
111
108
|
} ? Omit<PropertyValue, "id"> & {
|
|
@@ -121,7 +118,6 @@ export type NotionPage = {
|
|
|
121
118
|
properties: NotionPagePropertyReadMap;
|
|
122
119
|
created_by: PageMetadataActor | null;
|
|
123
120
|
last_edited_by: PageMetadataActor | null;
|
|
124
|
-
last_visited_time: string | null;
|
|
125
121
|
created_time: string | null;
|
|
126
122
|
last_edited_time: string | null;
|
|
127
123
|
icon: NotionPageIcon | null;
|
|
@@ -172,10 +168,12 @@ export type CreatePageResult = {
|
|
|
172
168
|
*/
|
|
173
169
|
export type { CreatePageParent } from "./parent.js";
|
|
174
170
|
/**
|
|
175
|
-
* Arguments accepted by `sdk.pages.create`.
|
|
171
|
+
* Arguments accepted by `sdk.pages.create`.
|
|
176
172
|
*/
|
|
177
173
|
export type CreatePageArgs = {
|
|
178
174
|
properties: NotionPagePropertyInputMap;
|
|
175
|
+
icon?: NotionCreatePageIcon;
|
|
176
|
+
cover?: NotionPageCover;
|
|
179
177
|
} & ({
|
|
180
178
|
parent: PageParent;
|
|
181
179
|
position?: NotionCreatePagePosition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/pages/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,MAAM,oDAAoD,CAAA;AAC3D,OAAO,KAAK,EACX,8BAA8B,EAC9B,wBAAwB,EACxB,MAAM,+DAA+D,CAAA;AACtE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4DAA4D,CAAA;AAC7G,OAAO,KAAK,EACX,4BAA4B,EAC5B,YAAY,EACZ,MAAM,6DAA6D,CAAA;AACpE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,+DAA+D,CAAA;AACnH,OAAO,KAAK,EACX,eAAe,EACf,cAAc,EACd,MAAM,0DAA0D,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AACrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AACrG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iEAAiE,CAAA;AACvG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oEAAoE,CAAA;AAC7G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+DAA+D,CAAA;AACvG,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mEAAmE,CAAA;AAChH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gEAAgE,CAAA;AACrG,OAAO,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v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
207
207
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
208
208
|
}, undefined>, undefined>;
|
|
209
|
-
}, undefined>, v.ObjectSchema<{
|
|
210
|
-
readonly id: v.StringSchema<undefined>;
|
|
211
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
212
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
213
209
|
}, undefined>, v.ObjectSchema<{
|
|
214
210
|
readonly id: v.StringSchema<undefined>;
|
|
215
211
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -237,7 +233,13 @@ export declare const bridgePageForProtocol3To5Schema: v.ObjectSchema<{
|
|
|
237
233
|
}, undefined>], undefined>, undefined>;
|
|
238
234
|
readonly created_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
239
235
|
readonly last_edited_time: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
240
|
-
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.
|
|
236
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
237
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
238
|
+
readonly icon: v.LooseObjectSchema<{
|
|
239
|
+
readonly name: v.StringSchema<undefined>;
|
|
240
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
|
|
241
|
+
}, undefined>;
|
|
242
|
+
}, undefined>, v.ObjectSchema<{
|
|
241
243
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
242
244
|
readonly emoji: v.StringSchema<undefined>;
|
|
243
245
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -40,3 +40,5 @@ export declare const notionParentSchema: v.VariantSchema<"type", [v.ObjectSchema
|
|
|
40
40
|
* is exposed, including when a readable child identifies the parent as a data source.
|
|
41
41
|
*/
|
|
42
42
|
export type NotionParent = v.InferOutput<typeof notionParentSchema>;
|
|
43
|
+
/** A parent reference constructed from application records with plain string IDs. */
|
|
44
|
+
export type BridgeParent = v.InferInput<typeof notionParentSchema>;
|
|
@@ -121,10 +121,6 @@ export declare const bridgeDataSourceBindingSchema: v.ObjectSchema<{
|
|
|
121
121
|
readonly name: v.StringSchema<undefined>;
|
|
122
122
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
123
123
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
124
|
-
}, undefined>, v.ObjectSchema<{
|
|
125
|
-
readonly name: v.StringSchema<undefined>;
|
|
126
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
127
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
128
124
|
}, undefined>, v.ObjectSchema<{
|
|
129
125
|
readonly name: v.StringSchema<undefined>;
|
|
130
126
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -116,10 +116,6 @@ export declare const bridgeDataSourceBindingsSchema: v.RecordSchema<v.StringSche
|
|
|
116
116
|
readonly name: v.StringSchema<undefined>;
|
|
117
117
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
118
118
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
119
|
-
}, undefined>, v.ObjectSchema<{
|
|
120
|
-
readonly name: v.StringSchema<undefined>;
|
|
121
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
122
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
123
119
|
}, undefined>, v.ObjectSchema<{
|
|
124
120
|
readonly name: v.StringSchema<undefined>;
|
|
125
121
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -115,10 +115,6 @@ export declare const notionCollectionSchemaValidator: v.ObjectSchema<{
|
|
|
115
115
|
readonly name: v.StringSchema<undefined>;
|
|
116
116
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
117
117
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
118
|
-
}, undefined>, v.ObjectSchema<{
|
|
119
|
-
readonly name: v.StringSchema<undefined>;
|
|
120
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
121
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
122
118
|
}, undefined>, v.ObjectSchema<{
|
|
123
119
|
readonly name: v.StringSchema<undefined>;
|
|
124
120
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -124,10 +124,6 @@ export declare const dataSourcesChangedMessageSchema: v.ObjectSchema<{
|
|
|
124
124
|
readonly name: v.StringSchema<undefined>;
|
|
125
125
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
126
126
|
readonly type: v.LiteralSchema<"verification", undefined>;
|
|
127
|
-
}, undefined>, v.ObjectSchema<{
|
|
128
|
-
readonly name: v.StringSchema<undefined>;
|
|
129
|
-
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
130
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
131
127
|
}, undefined>, v.ObjectSchema<{
|
|
132
128
|
readonly name: v.StringSchema<undefined>;
|
|
133
129
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from "valibot";
|
|
2
|
-
import type {
|
|
2
|
+
import type { CustomBlockErrorCode, CustomBlockErrorInfo, CustomBlockGrantErrorCode } from "../../utils/errors.js";
|
|
3
3
|
/**
|
|
4
4
|
* Message sent by the sandbox to ask the host for the current rows in a resolved
|
|
5
5
|
* Notion data source.
|
|
@@ -521,10 +521,11 @@ export declare const queryDataSourceMessageSchema: v.ObjectSchema<{
|
|
|
521
521
|
readonly propertyId: v.StringSchema<undefined>;
|
|
522
522
|
readonly direction: v.PicklistSchema<["ascending", "descending"], undefined>;
|
|
523
523
|
}, undefined>, undefined>, undefined>;
|
|
524
|
+
readonly archive_status: v.OptionalSchema<v.PicklistSchema<["active", "archived", "all"], undefined>, undefined>;
|
|
524
525
|
}, undefined>;
|
|
525
526
|
export type QueryDataSourceMessage = v.InferOutput<typeof queryDataSourceMessageSchema>;
|
|
526
527
|
export declare const customBlockQueryDataSourceErrorCodeSchema: v.StringSchema<undefined>;
|
|
527
|
-
export type CustomBlockQueryDataSourceErrorCode = CustomBlockErrorCode<"query_data_source_failed" | "invalid_data_source_query" | "data_source_query_invalid_limit" | "invalid_data_source_query_filter" | "invalid_data_source_query_sort" | "unknown_data_source_key" | "unmapped_data_source" | "data_source_inaccessible" | "data_source_schema_unavailable" |
|
|
528
|
+
export type CustomBlockQueryDataSourceErrorCode = CustomBlockErrorCode<"query_data_source_failed" | "invalid_data_source_query" | "data_source_query_invalid_limit" | "invalid_data_source_query_filter" | "invalid_data_source_query_sort" | "unknown_data_source_key" | "unmapped_data_source" | "data_source_inaccessible" | "data_source_schema_unavailable" | CustomBlockGrantErrorCode>;
|
|
528
529
|
export type CustomBlockQueryDataSourceErrorInfo = CustomBlockErrorInfo<CustomBlockQueryDataSourceErrorCode>;
|
|
529
530
|
export declare const customBlockQueryDataSourceErrorInfoSchema: v.ObjectSchema<{
|
|
530
531
|
readonly code: v.StringSchema<undefined>;
|
|
@@ -745,10 +746,6 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
745
746
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
746
747
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
747
748
|
}, undefined>, undefined>;
|
|
748
|
-
}, undefined>, v.ObjectSchema<{
|
|
749
|
-
readonly id: v.StringSchema<undefined>;
|
|
750
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
751
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
752
749
|
}, undefined>, v.ObjectSchema<{
|
|
753
750
|
readonly id: v.StringSchema<undefined>;
|
|
754
751
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -784,10 +781,15 @@ export declare const queryDataSourceResultMessageSchema: v.VariantSchema<"status
|
|
|
784
781
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
785
782
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
786
783
|
}, undefined>, undefined>, null>;
|
|
787
|
-
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
788
784
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
789
785
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
790
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
786
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
787
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
788
|
+
readonly icon: v.LooseObjectSchema<{
|
|
789
|
+
readonly name: v.StringSchema<undefined>;
|
|
790
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
|
|
791
|
+
}, undefined>;
|
|
792
|
+
}, undefined>, v.ObjectSchema<{
|
|
791
793
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
792
794
|
readonly emoji: v.StringSchema<undefined>;
|
|
793
795
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1048,10 +1050,6 @@ export declare const queryDataSourceResultMessageWithProtocol3To5CompatibilitySc
|
|
|
1048
1050
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
1049
1051
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1050
1052
|
}, undefined>, undefined>;
|
|
1051
|
-
}, undefined>, v.ObjectSchema<{
|
|
1052
|
-
readonly id: v.StringSchema<undefined>;
|
|
1053
|
-
readonly type: v.LiteralSchema<"last_visited_time", undefined>;
|
|
1054
|
-
readonly last_visited_time: v.NullableSchema<v.StringSchema<undefined>, undefined>;
|
|
1055
1053
|
}, undefined>, v.ObjectSchema<{
|
|
1056
1054
|
readonly id: v.StringSchema<undefined>;
|
|
1057
1055
|
readonly type: v.LiteralSchema<"unique_id", undefined>;
|
|
@@ -1087,10 +1085,15 @@ export declare const queryDataSourceResultMessageWithProtocol3To5CompatibilitySc
|
|
|
1087
1085
|
readonly table: v.PicklistSchema<["notion_user", "bot", "organization_bot"], undefined>;
|
|
1088
1086
|
readonly spaceId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1089
1087
|
}, undefined>, undefined>, null>;
|
|
1090
|
-
readonly last_visited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1091
1088
|
readonly created_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1092
1089
|
readonly last_edited_time: v.OptionalSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>, null>;
|
|
1093
|
-
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.
|
|
1090
|
+
readonly icon: v.OptionalSchema<v.NullableSchema<v.VariantSchema<"type", [v.LooseObjectSchema<{
|
|
1091
|
+
readonly type: v.LiteralSchema<"icon", undefined>;
|
|
1092
|
+
readonly icon: v.LooseObjectSchema<{
|
|
1093
|
+
readonly name: v.StringSchema<undefined>;
|
|
1094
|
+
readonly color: v.OptionalSchema<v.GenericSchema<import("../../icons.js").NotionIconColor>, undefined>;
|
|
1095
|
+
}, undefined>;
|
|
1096
|
+
}, undefined>, v.ObjectSchema<{
|
|
1094
1097
|
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
1095
1098
|
readonly emoji: v.StringSchema<undefined>;
|
|
1096
1099
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -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.
|
|
@@ -122,10 +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
125
|
}, undefined>, v.ObjectSchema<{
|
|
130
126
|
readonly name: v.StringSchema<undefined>;
|
|
131
127
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -274,10 +270,6 @@ export declare const notionDataSourceSchema: v.ObjectSchema<{
|
|
|
274
270
|
readonly name: v.StringSchema<undefined>;
|
|
275
271
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
276
272
|
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
273
|
}, undefined>, v.ObjectSchema<{
|
|
282
274
|
readonly name: v.StringSchema<undefined>;
|
|
283
275
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -30,12 +30,12 @@ export type NotionDualProperty = v.InferOutput<typeof notionDualPropertySchema>;
|
|
|
30
30
|
* Mirrors the Notion public API
|
|
31
31
|
* [property object](https://developers.notion.com/reference/property-object)
|
|
32
32
|
* type field. Internal-only types (`button`, `verification`,
|
|
33
|
-
* `
|
|
33
|
+
* `location`) and the four built-ins (`created_time`,
|
|
34
34
|
* `last_edited_time`, `created_by`, `last_edited_by`) are included under their
|
|
35
35
|
* bridge-native names.
|
|
36
36
|
*/
|
|
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", "
|
|
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", "location", "created_time", "last_edited_time", "created_by", "last_edited_by"];
|
|
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", "location", "created_time", "last_edited_time", "created_by", "last_edited_by"], undefined>;
|
|
39
39
|
/**
|
|
40
40
|
* String literal union of every supported Notion property type. Same set as
|
|
41
41
|
* the discriminator in `NotionPropertySchema` — split out so the manifest
|
|
@@ -163,10 +163,6 @@ export declare const notionPropertySchemaSchema: v.VariantSchema<"type", [v.Obje
|
|
|
163
163
|
readonly name: v.StringSchema<undefined>;
|
|
164
164
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
165
165
|
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
166
|
}, undefined>, v.ObjectSchema<{
|
|
171
167
|
readonly name: v.StringSchema<undefined>;
|
|
172
168
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -51,7 +51,7 @@ const baseProp = v.object({
|
|
|
51
51
|
* Mirrors the Notion public API
|
|
52
52
|
* [property object](https://developers.notion.com/reference/property-object)
|
|
53
53
|
* type field. Internal-only types (`button`, `verification`,
|
|
54
|
-
* `
|
|
54
|
+
* `location`) and the four built-ins (`created_time`,
|
|
55
55
|
* `last_edited_time`, `created_by`, `last_edited_by`) are included under their
|
|
56
56
|
* bridge-native names.
|
|
57
57
|
*/
|
|
@@ -76,7 +76,6 @@ export const NOTION_PROPERTY_TYPES = [
|
|
|
76
76
|
"rollup",
|
|
77
77
|
"button",
|
|
78
78
|
"verification",
|
|
79
|
-
"last_visited_time",
|
|
80
79
|
"location",
|
|
81
80
|
"created_time",
|
|
82
81
|
"last_edited_time",
|
|
@@ -147,7 +146,6 @@ export const notionPropertySchemaSchema = v.variant("type", [
|
|
|
147
146
|
// Internal-only types passed through under their bridge-native names.
|
|
148
147
|
v.object({ ...baseProp.entries, type: v.literal("button") }),
|
|
149
148
|
v.object({ ...baseProp.entries, type: v.literal("verification") }),
|
|
150
|
-
v.object({ ...baseProp.entries, type: v.literal("last_visited_time") }),
|
|
151
149
|
v.object({ ...baseProp.entries, type: v.literal("location") }),
|
|
152
150
|
// Synthetic built-ins. The host always emits one of each per data source.
|
|
153
151
|
v.object({ ...baseProp.entries, type: v.literal("created_time") }),
|
|
@@ -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", "location", "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<{
|
|
@@ -99,12 +99,23 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
99
99
|
readonly properties: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
100
100
|
readonly name: v.StringSchema<undefined>;
|
|
101
101
|
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", "
|
|
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", "location", "created_time", "last_edited_time", "created_by", "last_edited_by"], undefined>;
|
|
103
103
|
}, undefined>, undefined>, {}>;
|
|
104
104
|
}, undefined>, undefined>, {}>;
|
|
105
|
-
readonly
|
|
106
|
-
readonly
|
|
107
|
-
readonly
|
|
105
|
+
readonly pages: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ObjectSchema<{
|
|
106
|
+
readonly name: v.StringSchema<undefined>;
|
|
107
|
+
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
108
|
+
readonly icon: v.OptionalSchema<v.VariantSchema<"type", [v.ObjectSchema<{
|
|
109
|
+
readonly type: v.LiteralSchema<"emoji", undefined>;
|
|
110
|
+
readonly emoji: v.StringSchema<undefined>;
|
|
111
|
+
}, undefined>, v.ObjectSchema<{
|
|
112
|
+
readonly type: v.LiteralSchema<"external", undefined>;
|
|
113
|
+
readonly url: v.StringSchema<undefined>;
|
|
114
|
+
}, undefined>], undefined>, undefined>;
|
|
115
|
+
}, undefined>, undefined>, undefined>;
|
|
116
|
+
readonly grants: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
|
|
117
|
+
readonly action: v.StringSchema<undefined>;
|
|
118
|
+
readonly resource: v.UnionSchema<[v.StringSchema<undefined>, v.SchemaWithPipe<readonly [v.ArraySchema<v.StringSchema<undefined>, undefined>, v.MinLengthAction<string[], 1, undefined>]>], undefined>;
|
|
108
119
|
}, undefined>, undefined>, undefined>;
|
|
109
120
|
}, undefined>;
|
|
110
121
|
readonly dataSources: v.ObjectSchema<{
|
|
@@ -225,10 +236,6 @@ export declare const initMessageSchema: v.VariantSchema<"status", [v.ObjectSchem
|
|
|
225
236
|
readonly name: v.StringSchema<undefined>;
|
|
226
237
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
227
238
|
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
239
|
}, undefined>, v.ObjectSchema<{
|
|
233
240
|
readonly name: v.StringSchema<undefined>;
|
|
234
241
|
readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
@@ -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 {};
|